55 #define PY_SSIZE_T_CLEAN 58 #error Python headers needed to compile C extensions, please install development version of Python. 59 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) 60 #error Cython requires Python 2.6+ or Python 3.3+. 62 #define CYTHON_ABI "0_29_6" 63 #define CYTHON_HEX_VERSION 0x001D06F0 64 #define CYTHON_FUTURE_DIVISION 0 67 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) 69 #if !defined(WIN32) && !defined(MS_WINDOWS) 81 #define DL_IMPORT(t) t 84 #define DL_EXPORT(t) t 87 #ifndef HAVE_LONG_LONG 88 #if PY_VERSION_HEX >= 0x02070000 89 #define HAVE_LONG_LONG 93 #define PY_LONG_LONG LONG_LONG 96 #define Py_HUGE_VAL HUGE_VAL 99 #define CYTHON_COMPILING_IN_PYPY 1 100 #define CYTHON_COMPILING_IN_PYSTON 0 101 #define CYTHON_COMPILING_IN_CPYTHON 0 102 #undef CYTHON_USE_TYPE_SLOTS 103 #define CYTHON_USE_TYPE_SLOTS 0 104 #undef CYTHON_USE_PYTYPE_LOOKUP 105 #define CYTHON_USE_PYTYPE_LOOKUP 0 106 #if PY_VERSION_HEX < 0x03050000 107 #undef CYTHON_USE_ASYNC_SLOTS 108 #define CYTHON_USE_ASYNC_SLOTS 0 109 #elif !defined(CYTHON_USE_ASYNC_SLOTS) 110 #define CYTHON_USE_ASYNC_SLOTS 1 112 #undef CYTHON_USE_PYLIST_INTERNALS 113 #define CYTHON_USE_PYLIST_INTERNALS 0 114 #undef CYTHON_USE_UNICODE_INTERNALS 115 #define CYTHON_USE_UNICODE_INTERNALS 0 116 #undef CYTHON_USE_UNICODE_WRITER 117 #define CYTHON_USE_UNICODE_WRITER 0 118 #undef CYTHON_USE_PYLONG_INTERNALS 119 #define CYTHON_USE_PYLONG_INTERNALS 0 120 #undef CYTHON_AVOID_BORROWED_REFS 121 #define CYTHON_AVOID_BORROWED_REFS 1 122 #undef CYTHON_ASSUME_SAFE_MACROS 123 #define CYTHON_ASSUME_SAFE_MACROS 0 124 #undef CYTHON_UNPACK_METHODS 125 #define CYTHON_UNPACK_METHODS 0 126 #undef CYTHON_FAST_THREAD_STATE 127 #define CYTHON_FAST_THREAD_STATE 0 128 #undef CYTHON_FAST_PYCALL 129 #define CYTHON_FAST_PYCALL 0 130 #undef CYTHON_PEP489_MULTI_PHASE_INIT 131 #define CYTHON_PEP489_MULTI_PHASE_INIT 0 132 #undef CYTHON_USE_TP_FINALIZE 133 #define CYTHON_USE_TP_FINALIZE 0 134 #undef CYTHON_USE_DICT_VERSIONS 135 #define CYTHON_USE_DICT_VERSIONS 0 136 #undef CYTHON_USE_EXC_INFO_STACK 137 #define CYTHON_USE_EXC_INFO_STACK 0 138 #elif defined(PYSTON_VERSION) 139 #define CYTHON_COMPILING_IN_PYPY 0 140 #define CYTHON_COMPILING_IN_PYSTON 1 141 #define CYTHON_COMPILING_IN_CPYTHON 0 142 #ifndef CYTHON_USE_TYPE_SLOTS 143 #define CYTHON_USE_TYPE_SLOTS 1 145 #undef CYTHON_USE_PYTYPE_LOOKUP 146 #define CYTHON_USE_PYTYPE_LOOKUP 0 147 #undef CYTHON_USE_ASYNC_SLOTS 148 #define CYTHON_USE_ASYNC_SLOTS 0 149 #undef CYTHON_USE_PYLIST_INTERNALS 150 #define CYTHON_USE_PYLIST_INTERNALS 0 151 #ifndef CYTHON_USE_UNICODE_INTERNALS 152 #define CYTHON_USE_UNICODE_INTERNALS 1 154 #undef CYTHON_USE_UNICODE_WRITER 155 #define CYTHON_USE_UNICODE_WRITER 0 156 #undef CYTHON_USE_PYLONG_INTERNALS 157 #define CYTHON_USE_PYLONG_INTERNALS 0 158 #ifndef CYTHON_AVOID_BORROWED_REFS 159 #define CYTHON_AVOID_BORROWED_REFS 0 161 #ifndef CYTHON_ASSUME_SAFE_MACROS 162 #define CYTHON_ASSUME_SAFE_MACROS 1 164 #ifndef CYTHON_UNPACK_METHODS 165 #define CYTHON_UNPACK_METHODS 1 167 #undef CYTHON_FAST_THREAD_STATE 168 #define CYTHON_FAST_THREAD_STATE 0 169 #undef CYTHON_FAST_PYCALL 170 #define CYTHON_FAST_PYCALL 0 171 #undef CYTHON_PEP489_MULTI_PHASE_INIT 172 #define CYTHON_PEP489_MULTI_PHASE_INIT 0 173 #undef CYTHON_USE_TP_FINALIZE 174 #define CYTHON_USE_TP_FINALIZE 0 175 #undef CYTHON_USE_DICT_VERSIONS 176 #define CYTHON_USE_DICT_VERSIONS 0 177 #undef CYTHON_USE_EXC_INFO_STACK 178 #define CYTHON_USE_EXC_INFO_STACK 0 180 #define CYTHON_COMPILING_IN_PYPY 0 181 #define CYTHON_COMPILING_IN_PYSTON 0 182 #define CYTHON_COMPILING_IN_CPYTHON 1 183 #ifndef CYTHON_USE_TYPE_SLOTS 184 #define CYTHON_USE_TYPE_SLOTS 1 186 #if PY_VERSION_HEX < 0x02070000 187 #undef CYTHON_USE_PYTYPE_LOOKUP 188 #define CYTHON_USE_PYTYPE_LOOKUP 0 189 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) 190 #define CYTHON_USE_PYTYPE_LOOKUP 1 192 #if PY_MAJOR_VERSION < 3 193 #undef CYTHON_USE_ASYNC_SLOTS 194 #define CYTHON_USE_ASYNC_SLOTS 0 195 #elif !defined(CYTHON_USE_ASYNC_SLOTS) 196 #define CYTHON_USE_ASYNC_SLOTS 1 198 #if PY_VERSION_HEX < 0x02070000 199 #undef CYTHON_USE_PYLONG_INTERNALS 200 #define CYTHON_USE_PYLONG_INTERNALS 0 201 #elif !defined(CYTHON_USE_PYLONG_INTERNALS) 202 #define CYTHON_USE_PYLONG_INTERNALS 1 204 #ifndef CYTHON_USE_PYLIST_INTERNALS 205 #define CYTHON_USE_PYLIST_INTERNALS 1 207 #ifndef CYTHON_USE_UNICODE_INTERNALS 208 #define CYTHON_USE_UNICODE_INTERNALS 1 210 #if PY_VERSION_HEX < 0x030300F0 211 #undef CYTHON_USE_UNICODE_WRITER 212 #define CYTHON_USE_UNICODE_WRITER 0 213 #elif !defined(CYTHON_USE_UNICODE_WRITER) 214 #define CYTHON_USE_UNICODE_WRITER 1 216 #ifndef CYTHON_AVOID_BORROWED_REFS 217 #define CYTHON_AVOID_BORROWED_REFS 0 219 #ifndef CYTHON_ASSUME_SAFE_MACROS 220 #define CYTHON_ASSUME_SAFE_MACROS 1 222 #ifndef CYTHON_UNPACK_METHODS 223 #define CYTHON_UNPACK_METHODS 1 225 #ifndef CYTHON_FAST_THREAD_STATE 226 #define CYTHON_FAST_THREAD_STATE 1 228 #ifndef CYTHON_FAST_PYCALL 229 #define CYTHON_FAST_PYCALL 1 231 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT 232 #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) 234 #ifndef CYTHON_USE_TP_FINALIZE 235 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) 237 #ifndef CYTHON_USE_DICT_VERSIONS 238 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) 240 #ifndef CYTHON_USE_EXC_INFO_STACK 241 #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) 244 #if !defined(CYTHON_FAST_PYCCALL) 245 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) 247 #if CYTHON_USE_PYLONG_INTERNALS 248 #include "longintrepr.h" 253 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P ==
sizeof(
void*)) };
256 #ifndef __has_attribute 257 #define __has_attribute(x) 0 259 #ifndef __has_cpp_attribute 260 #define __has_cpp_attribute(x) 0 262 #ifndef CYTHON_RESTRICT 263 #if defined(__GNUC__) 264 #define CYTHON_RESTRICT __restrict__ 265 #elif defined(_MSC_VER) && _MSC_VER >= 1400 266 #define CYTHON_RESTRICT __restrict 267 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 268 #define CYTHON_RESTRICT restrict 270 #define CYTHON_RESTRICT 273 #ifndef CYTHON_UNUSED 274 # if defined(__GNUC__) 275 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) 276 # define CYTHON_UNUSED __attribute__ ((__unused__)) 278 # define CYTHON_UNUSED 280 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) 281 # define CYTHON_UNUSED __attribute__ ((__unused__)) 283 # define CYTHON_UNUSED 286 #ifndef CYTHON_MAYBE_UNUSED_VAR 287 # if defined(__cplusplus) 288 template<
class T>
void CYTHON_MAYBE_UNUSED_VAR(
const T& ) { }
290 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) 293 #ifndef CYTHON_NCP_UNUSED 294 # if CYTHON_COMPILING_IN_CPYTHON 295 # define CYTHON_NCP_UNUSED 297 # define CYTHON_NCP_UNUSED CYTHON_UNUSED 300 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) 302 #ifndef _MSC_STDINT_H_ 304 typedef unsigned char uint8_t;
305 typedef unsigned int uint32_t;
307 typedef unsigned __int8 uint8_t;
308 typedef unsigned __int32 uint32_t;
314 #ifndef CYTHON_FALLTHROUGH 315 #if defined(__cplusplus) && __cplusplus >= 201103L 316 #if __has_cpp_attribute(fallthrough) 317 #define CYTHON_FALLTHROUGH [[fallthrough]] 318 #elif __has_cpp_attribute(clang::fallthrough) 319 #define CYTHON_FALLTHROUGH [[clang::fallthrough]] 320 #elif __has_cpp_attribute(gnu::fallthrough) 321 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] 324 #ifndef CYTHON_FALLTHROUGH 325 #if __has_attribute(fallthrough) 326 #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) 328 #define CYTHON_FALLTHROUGH 331 #if defined(__clang__ ) && defined(__apple_build_version__) 332 #if __apple_build_version__ < 7000000 333 #undef CYTHON_FALLTHROUGH 334 #define CYTHON_FALLTHROUGH 340 #error "Cython files generated with the C++ option must be compiled with a C++ compiler." 342 #ifndef CYTHON_INLINE 343 #if defined(__clang__) 344 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) 346 #define CYTHON_INLINE inline 350 void __Pyx_call_destructor(T& x) {
354 class __Pyx_FakeReference {
356 __Pyx_FakeReference() : ptr(NULL) { }
357 __Pyx_FakeReference(
const T& ref) : ptr(const_cast<T*>(&ref)) { }
358 T *operator->() {
return ptr; }
360 operator T&() {
return *ptr; }
361 template<
typename U>
bool operator ==(U other) {
return *ptr == other; }
362 template<
typename U>
bool operator !=(U other) {
return *ptr != other; }
367 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) 368 #define Py_OptimizeFlag 0 370 #define __PYX_BUILD_PY_SSIZE_T "n" 371 #define CYTHON_FORMAT_SSIZE_T "z" 372 #if PY_MAJOR_VERSION < 3 373 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" 374 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ 375 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) 376 #define __Pyx_DefaultClassType PyClass_Type 378 #define __Pyx_BUILTIN_MODULE_NAME "builtins" 379 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ 380 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) 381 #define __Pyx_DefaultClassType PyType_Type 383 #ifndef Py_TPFLAGS_CHECKTYPES 384 #define Py_TPFLAGS_CHECKTYPES 0 386 #ifndef Py_TPFLAGS_HAVE_INDEX 387 #define Py_TPFLAGS_HAVE_INDEX 0 389 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER 390 #define Py_TPFLAGS_HAVE_NEWBUFFER 0 392 #ifndef Py_TPFLAGS_HAVE_FINALIZE 393 #define Py_TPFLAGS_HAVE_FINALIZE 0 395 #ifndef METH_STACKLESS 396 #define METH_STACKLESS 0 398 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) 399 #ifndef METH_FASTCALL 400 #define METH_FASTCALL 0x80 402 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *
self, PyObject *
const *args, Py_ssize_t nargs);
403 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *
self, PyObject *
const *args,
404 Py_ssize_t nargs, PyObject *kwnames);
406 #define __Pyx_PyCFunctionFast _PyCFunctionFast 407 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords 409 #if CYTHON_FAST_PYCCALL 410 #define __Pyx_PyFastCFunction_Check(func)\ 411 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) 413 #define __Pyx_PyFastCFunction_Check(func) 0 415 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) 416 #define PyObject_Malloc(s) PyMem_Malloc(s) 417 #define PyObject_Free(p) PyMem_Free(p) 418 #define PyObject_Realloc(p) PyMem_Realloc(p) 420 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 421 #define PyMem_RawMalloc(n) PyMem_Malloc(n) 422 #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) 423 #define PyMem_RawFree(p) PyMem_Free(p) 425 #if CYTHON_COMPILING_IN_PYSTON 426 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) 427 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) 429 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) 430 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) 432 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 433 #define __Pyx_PyThreadState_Current PyThreadState_GET() 434 #elif PY_VERSION_HEX >= 0x03060000 435 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() 436 #elif PY_VERSION_HEX >= 0x03000000 437 #define __Pyx_PyThreadState_Current PyThreadState_GET() 439 #define __Pyx_PyThreadState_Current _PyThreadState_Current 441 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) 442 #include "pythread.h" 443 #define Py_tss_NEEDS_INIT 0 444 typedef int Py_tss_t;
445 static CYTHON_INLINE
int PyThread_tss_create(Py_tss_t *key) {
446 *key = PyThread_create_key();
449 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(
void) {
450 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(
sizeof(Py_tss_t));
451 *key = Py_tss_NEEDS_INIT;
454 static CYTHON_INLINE
void PyThread_tss_free(Py_tss_t *key) {
457 static CYTHON_INLINE
int PyThread_tss_is_created(Py_tss_t *key) {
458 return *key != Py_tss_NEEDS_INIT;
460 static CYTHON_INLINE
void PyThread_tss_delete(Py_tss_t *key) {
461 PyThread_delete_key(*key);
462 *key = Py_tss_NEEDS_INIT;
464 static CYTHON_INLINE
int PyThread_tss_set(Py_tss_t *key,
void *value) {
465 return PyThread_set_key_value(*key, value);
467 static CYTHON_INLINE
void * PyThread_tss_get(Py_tss_t *key) {
468 return PyThread_get_key_value(*key);
471 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) 472 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) 474 #define __Pyx_PyDict_NewPresized(n) PyDict_New() 476 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION 477 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) 478 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) 480 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) 481 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) 483 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS 484 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) 486 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) 488 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) 489 #define CYTHON_PEP393_ENABLED 1 490 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 491 0 : _PyUnicode_Ready((PyObject *)(op))) 492 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) 493 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) 494 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) 495 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) 496 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) 497 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) 498 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) 499 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) 501 #define CYTHON_PEP393_ENABLED 0 502 #define PyUnicode_1BYTE_KIND 1 503 #define PyUnicode_2BYTE_KIND 2 504 #define PyUnicode_4BYTE_KIND 4 505 #define __Pyx_PyUnicode_READY(op) (0) 506 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) 507 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) 508 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) 509 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) 510 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) 511 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) 512 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) 513 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) 515 #if CYTHON_COMPILING_IN_PYPY 516 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) 517 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) 519 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) 520 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ 521 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) 523 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) 524 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) 526 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) 527 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) 529 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) 530 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) 532 #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)) 533 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) 534 #if PY_MAJOR_VERSION >= 3 535 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) 537 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) 539 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) 540 #define PyObject_ASCII(o) PyObject_Repr(o) 542 #if PY_MAJOR_VERSION >= 3 543 #define PyBaseString_Type PyUnicode_Type 544 #define PyStringObject PyUnicodeObject 545 #define PyString_Type PyUnicode_Type 546 #define PyString_Check PyUnicode_Check 547 #define PyString_CheckExact PyUnicode_CheckExact 548 #define PyObject_Unicode PyObject_Str 550 #if PY_MAJOR_VERSION >= 3 551 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) 552 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) 554 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) 555 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) 557 #ifndef PySet_CheckExact 558 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) 560 #if CYTHON_ASSUME_SAFE_MACROS 561 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) 563 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) 565 #if PY_MAJOR_VERSION >= 3 566 #define PyIntObject PyLongObject 567 #define PyInt_Type PyLong_Type 568 #define PyInt_Check(op) PyLong_Check(op) 569 #define PyInt_CheckExact(op) PyLong_CheckExact(op) 570 #define PyInt_FromString PyLong_FromString 571 #define PyInt_FromUnicode PyLong_FromUnicode 572 #define PyInt_FromLong PyLong_FromLong 573 #define PyInt_FromSize_t PyLong_FromSize_t 574 #define PyInt_FromSsize_t PyLong_FromSsize_t 575 #define PyInt_AsLong PyLong_AsLong 576 #define PyInt_AS_LONG PyLong_AS_LONG 577 #define PyInt_AsSsize_t PyLong_AsSsize_t 578 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask 579 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask 580 #define PyNumber_Int PyNumber_Long 582 #if PY_MAJOR_VERSION >= 3 583 #define PyBoolObject PyLongObject 585 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY 586 #ifndef PyUnicode_InternFromString 587 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) 590 #if PY_VERSION_HEX < 0x030200A4 591 typedef long Py_hash_t;
592 #define __Pyx_PyInt_FromHash_t PyInt_FromLong 593 #define __Pyx_PyInt_AsHash_t PyInt_AsLong 595 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t 596 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t 598 #if PY_MAJOR_VERSION >= 3 599 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) 601 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) 603 #if CYTHON_USE_ASYNC_SLOTS 604 #if PY_VERSION_HEX >= 0x030500B1 605 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods 606 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) 608 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) 611 #define __Pyx_PyType_AsAsync(obj) NULL 613 #ifndef __Pyx_PyAsyncMethodsStruct 618 } __Pyx_PyAsyncMethodsStruct;
621 #if defined(WIN32) || defined(MS_WINDOWS) 622 #define _USE_MATH_DEFINES 626 #define __PYX_NAN() ((float) NAN) 628 static CYTHON_INLINE
float __PYX_NAN() {
630 memset(&value, 0xFF,
sizeof(value));
634 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) 635 #define __Pyx_truncl trunc 637 #define __Pyx_truncl truncl 641 #define __PYX_ERR(f_index, lineno, Ln_error) \ 643 __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ 646 #ifndef __PYX_EXTERN_C 648 #define __PYX_EXTERN_C extern "C" 650 #define __PYX_EXTERN_C extern 654 #define __PYX_HAVE__PyClical 655 #define __PYX_HAVE_API__PyClical 667 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) 668 #define CYTHON_WITHOUT_ASSERTIONS 671 typedef struct {PyObject **p;
const char *s;
const Py_ssize_t n;
const char* encoding;
672 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
674 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 675 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 676 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) 677 #define __PYX_DEFAULT_STRING_ENCODING "" 678 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString 679 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize 680 #define __Pyx_uchar_cast(c) ((unsigned char)c) 681 #define __Pyx_long_cast(x) ((long)x) 682 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ 683 (sizeof(type) < sizeof(Py_ssize_t)) ||\ 684 (sizeof(type) > sizeof(Py_ssize_t) &&\ 685 likely(v < (type)PY_SSIZE_T_MAX ||\ 686 v == (type)PY_SSIZE_T_MAX) &&\ 687 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ 688 v == (type)PY_SSIZE_T_MIN))) ||\ 689 (sizeof(type) == sizeof(Py_ssize_t) &&\ 690 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ 691 v == (type)PY_SSIZE_T_MAX))) ) 692 static CYTHON_INLINE
int __Pyx_is_valid_index(Py_ssize_t
i, Py_ssize_t limit) {
693 return (
size_t)
i < (size_t) limit;
695 #if defined (__cplusplus) && __cplusplus >= 201103L 697 #define __Pyx_sst_abs(value) std::abs(value) 698 #elif SIZEOF_INT >= SIZEOF_SIZE_T 699 #define __Pyx_sst_abs(value) abs(value) 700 #elif SIZEOF_LONG >= SIZEOF_SIZE_T 701 #define __Pyx_sst_abs(value) labs(value) 702 #elif defined (_MSC_VER) 703 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) 704 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 705 #define __Pyx_sst_abs(value) llabs(value) 706 #elif defined (__GNUC__) 707 #define __Pyx_sst_abs(value) __builtin_llabs(value) 709 #define __Pyx_sst_abs(value) ((value<0) ? -value : value) 711 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
712 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
713 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) 714 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) 715 #define __Pyx_PyBytes_FromString PyBytes_FromString 716 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize 717 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
718 #if PY_MAJOR_VERSION < 3 719 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString 720 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize 722 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString 723 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize 725 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) 726 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) 727 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) 728 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) 729 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) 730 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) 731 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) 732 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) 733 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) 734 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) 735 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) 736 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) 737 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) 738 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) 739 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) 740 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) 741 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *u) {
742 const Py_UNICODE *u_end = u;
744 return (
size_t)(u_end - u - 1);
746 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) 747 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode 748 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode 749 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) 750 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) 751 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
752 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
753 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
754 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
755 #define __Pyx_PySequence_Tuple(obj)\ 756 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) 757 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
758 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
759 #if CYTHON_ASSUME_SAFE_MACROS 760 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) 762 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) 764 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) 765 #if PY_MAJOR_VERSION >= 3 766 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) 768 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) 770 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) 771 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 772 static int __Pyx_sys_getdefaultencoding_not_ascii;
773 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
775 PyObject* default_encoding = NULL;
776 PyObject* ascii_chars_u = NULL;
777 PyObject* ascii_chars_b = NULL;
778 const char* default_encoding_c;
779 sys = PyImport_ImportModule(
"sys");
781 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
783 if (!default_encoding)
goto bad;
784 default_encoding_c = PyBytes_AsString(default_encoding);
785 if (!default_encoding_c)
goto bad;
786 if (strcmp(default_encoding_c,
"ascii") == 0) {
787 __Pyx_sys_getdefaultencoding_not_ascii = 0;
789 char ascii_chars[128];
791 for (c = 0; c < 128; c++) {
794 __Pyx_sys_getdefaultencoding_not_ascii = 1;
795 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
796 if (!ascii_chars_u)
goto bad;
797 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
798 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
801 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
805 Py_DECREF(ascii_chars_u);
806 Py_DECREF(ascii_chars_b);
808 Py_DECREF(default_encoding);
811 Py_XDECREF(default_encoding);
812 Py_XDECREF(ascii_chars_u);
813 Py_XDECREF(ascii_chars_b);
817 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 818 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) 820 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) 821 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 822 static char* __PYX_DEFAULT_STRING_ENCODING;
823 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
825 PyObject* default_encoding = NULL;
826 char* default_encoding_c;
827 sys = PyImport_ImportModule(
"sys");
829 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
831 if (!default_encoding)
goto bad;
832 default_encoding_c = PyBytes_AsString(default_encoding);
833 if (!default_encoding_c)
goto bad;
834 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c) + 1);
835 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
836 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
837 Py_DECREF(default_encoding);
840 Py_XDECREF(default_encoding);
848 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) 849 #define likely(x) __builtin_expect(!!(x), 1) 850 #define unlikely(x) __builtin_expect(!!(x), 0) 852 #define likely(x) (x) 853 #define unlikely(x) (x) 855 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
857 static PyObject *__pyx_m = NULL;
858 static PyObject *__pyx_d;
859 static PyObject *__pyx_b;
860 static PyObject *__pyx_cython_runtime = NULL;
861 static PyObject *__pyx_empty_tuple;
862 static PyObject *__pyx_empty_bytes;
863 static PyObject *__pyx_empty_unicode;
864 static int __pyx_lineno;
865 static int __pyx_clineno = 0;
866 static const char * __pyx_cfilenm= __FILE__;
867 static const char *__pyx_filename;
870 static const char *__pyx_f[] = {
876 struct __pyx_obj_8PyClical_index_set;
877 struct __pyx_obj_8PyClical_clifford;
878 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__;
879 struct __pyx_opt_args_8PyClical_sqrt;
880 struct __pyx_opt_args_8PyClical_log;
881 struct __pyx_opt_args_8PyClical_cos;
882 struct __pyx_opt_args_8PyClical_acos;
883 struct __pyx_opt_args_8PyClical_acosh;
884 struct __pyx_opt_args_8PyClical_sin;
885 struct __pyx_opt_args_8PyClical_asin;
886 struct __pyx_opt_args_8PyClical_asinh;
887 struct __pyx_opt_args_8PyClical_tan;
888 struct __pyx_opt_args_8PyClical_atan;
889 struct __pyx_opt_args_8PyClical_atanh;
890 struct __pyx_opt_args_8PyClical_random_clifford;
899 struct __pyx_opt_args_8PyClical_sqrt {
911 struct __pyx_opt_args_8PyClical_log {
923 struct __pyx_opt_args_8PyClical_cos {
935 struct __pyx_opt_args_8PyClical_acos {
947 struct __pyx_opt_args_8PyClical_acosh {
959 struct __pyx_opt_args_8PyClical_sin {
971 struct __pyx_opt_args_8PyClical_asin {
983 struct __pyx_opt_args_8PyClical_asinh {
995 struct __pyx_opt_args_8PyClical_tan {
1007 struct __pyx_opt_args_8PyClical_atan {
1019 struct __pyx_opt_args_8PyClical_atanh {
1031 struct __pyx_opt_args_8PyClical_random_clifford {
1043 struct __pyx_obj_8PyClical_index_set {
1045 struct __pyx_vtabstruct_8PyClical_index_set *__pyx_vtab;
1057 struct __pyx_obj_8PyClical_clifford {
1059 struct __pyx_vtabstruct_8PyClical_clifford *__pyx_vtab;
1071 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ {
1073 PyObject *__pyx_v_idx;
1074 struct __pyx_obj_8PyClical_index_set *__pyx_v_self;
1075 PyObject *__pyx_t_0;
1076 Py_ssize_t __pyx_t_1;
1077 PyObject *(*__pyx_t_2)(PyObject *);
1090 struct __pyx_vtabstruct_8PyClical_index_set {
1091 PyObject *(*wrap)(
struct __pyx_obj_8PyClical_index_set *,
IndexSet);
1092 IndexSet (*unwrap)(
struct __pyx_obj_8PyClical_index_set *);
1093 PyObject *(*copy)(
struct __pyx_obj_8PyClical_index_set *,
int __pyx_skip_dispatch);
1095 static struct __pyx_vtabstruct_8PyClical_index_set *__pyx_vtabptr_8PyClical_index_set;
1096 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_9index_set_wrap(
struct __pyx_obj_8PyClical_index_set *,
IndexSet);
1097 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_9index_set_unwrap(
struct __pyx_obj_8PyClical_index_set *);
1108 struct __pyx_vtabstruct_8PyClical_clifford {
1109 PyObject *(*wrap)(
struct __pyx_obj_8PyClical_clifford *,
Clifford);
1110 Clifford (*unwrap)(
struct __pyx_obj_8PyClical_clifford *);
1111 PyObject *(*copy)(
struct __pyx_obj_8PyClical_clifford *,
int __pyx_skip_dispatch);
1113 static struct __pyx_vtabstruct_8PyClical_clifford *__pyx_vtabptr_8PyClical_clifford;
1114 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_8clifford_wrap(
struct __pyx_obj_8PyClical_clifford *,
Clifford);
1115 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_8clifford_unwrap(
struct __pyx_obj_8PyClical_clifford *);
1119 #ifndef CYTHON_REFNANNY 1120 #define CYTHON_REFNANNY 0 1124 void (*INCREF)(
void*, PyObject*, int);
1125 void (*DECREF)(
void*, PyObject*, int);
1126 void (*GOTREF)(
void*, PyObject*, int);
1127 void (*GIVEREF)(
void*, PyObject*, int);
1128 void* (*SetupContext)(
const char*, int,
const char*);
1129 void (*FinishContext)(
void**);
1130 } __Pyx_RefNannyAPIStruct;
1131 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1132 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1133 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; 1135 #define __Pyx_RefNannySetupContext(name, acquire_gil)\ 1137 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ 1138 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ 1139 PyGILState_Release(__pyx_gilstate_save);\ 1141 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ 1144 #define __Pyx_RefNannySetupContext(name, acquire_gil)\ 1145 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) 1147 #define __Pyx_RefNannyFinishContext()\ 1148 __Pyx_RefNanny->FinishContext(&__pyx_refnanny) 1149 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1150 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1151 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1152 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1153 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) 1154 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) 1155 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) 1156 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) 1158 #define __Pyx_RefNannyDeclarations 1159 #define __Pyx_RefNannySetupContext(name, acquire_gil) 1160 #define __Pyx_RefNannyFinishContext() 1161 #define __Pyx_INCREF(r) Py_INCREF(r) 1162 #define __Pyx_DECREF(r) Py_DECREF(r) 1163 #define __Pyx_GOTREF(r) 1164 #define __Pyx_GIVEREF(r) 1165 #define __Pyx_XINCREF(r) Py_XINCREF(r) 1166 #define __Pyx_XDECREF(r) Py_XDECREF(r) 1167 #define __Pyx_XGOTREF(r) 1168 #define __Pyx_XGIVEREF(r) 1170 #define __Pyx_XDECREF_SET(r, v) do {\ 1171 PyObject *tmp = (PyObject *) r;\ 1172 r = v; __Pyx_XDECREF(tmp);\ 1174 #define __Pyx_DECREF_SET(r, v) do {\ 1175 PyObject *tmp = (PyObject *) r;\ 1176 r = v; __Pyx_DECREF(tmp);\ 1178 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) 1179 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) 1182 #if CYTHON_USE_TYPE_SLOTS 1183 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject*
obj, PyObject* attr_name);
1185 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) 1189 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1192 #if CYTHON_FAST_PYCCALL 1193 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1195 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) 1199 #if CYTHON_FAST_PYCALL 1200 #define __Pyx_PyFunction_FastCall(func, args, nargs)\ 1201 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) 1202 #if 1 || PY_VERSION_HEX < 0x030600B1 1203 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
int nargs, PyObject *kwargs);
1205 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) 1207 #define __Pyx_BUILD_ASSERT_EXPR(cond)\ 1208 (sizeof(char [1 - 2*!(cond)]) - 1) 1209 #ifndef Py_MEMBER_SIZE 1210 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) 1212 static size_t __pyx_pyframe_localsplus_offset = 0;
1213 #include "frameobject.h" 1214 #define __Pxy_PyFrame_Initialize_Offsets()\ 1215 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ 1216 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) 1217 #define __Pyx_PyFrame_GetLocalsplus(frame)\ 1218 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) 1222 #if CYTHON_COMPILING_IN_CPYTHON 1223 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1225 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) 1229 #if CYTHON_COMPILING_IN_CPYTHON 1230 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1234 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1237 #if CYTHON_FAST_THREAD_STATE 1238 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; 1239 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; 1240 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type 1242 #define __Pyx_PyThreadState_declare 1243 #define __Pyx_PyThreadState_assign 1244 #define __Pyx_PyErr_Occurred() PyErr_Occurred() 1248 #if CYTHON_FAST_THREAD_STATE 1249 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) 1250 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) 1251 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) 1252 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) 1253 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) 1254 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1255 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1256 #if CYTHON_COMPILING_IN_CPYTHON 1257 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) 1259 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) 1262 #define __Pyx_PyErr_Clear() PyErr_Clear() 1263 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) 1264 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) 1265 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) 1266 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) 1267 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) 1268 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) 1269 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) 1273 static void __Pyx_WriteUnraisable(
const char *name,
int clineno,
1274 int lineno,
const char *filename,
1275 int full_traceback,
int nogil);
1278 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS 1279 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) 1280 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) 1281 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ 1282 (version_var) = __PYX_GET_DICT_VERSION(dict);\ 1283 (cache_var) = (value); 1284 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ 1285 static PY_UINT64_T __pyx_dict_version = 0;\ 1286 static PyObject *__pyx_dict_cached_value = NULL;\ 1287 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ 1288 (VAR) = __pyx_dict_cached_value;\ 1290 (VAR) = __pyx_dict_cached_value = (LOOKUP);\ 1291 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ 1294 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *
obj);
1295 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *
obj);
1296 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject*
obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1298 #define __PYX_GET_DICT_VERSION(dict) (0) 1299 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) 1300 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); 1304 #if CYTHON_COMPILING_IN_CPYTHON 1305 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1307 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) 1311 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
1314 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1315 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1316 const char* function_name);
1319 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1320 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1323 #if CYTHON_USE_DICT_VERSIONS 1324 #define __Pyx_GetModuleGlobalName(var, name) {\ 1325 static PY_UINT64_T __pyx_dict_version = 0;\ 1326 static PyObject *__pyx_dict_cached_value = NULL;\ 1327 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ 1328 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ 1329 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ 1331 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\ 1332 PY_UINT64_T __pyx_dict_version;\ 1333 PyObject *__pyx_dict_cached_value;\ 1334 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ 1336 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1338 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) 1339 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) 1340 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1344 #if CYTHON_USE_EXC_INFO_STACK 1345 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1349 #if CYTHON_FAST_THREAD_STATE 1350 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) 1351 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1352 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) 1353 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1355 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) 1356 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) 1360 #if CYTHON_FAST_THREAD_STATE 1361 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) 1362 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1364 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) 1368 #if CYTHON_FAST_THREAD_STATE 1369 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) 1370 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1372 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1376 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1379 #if !CYTHON_COMPILING_IN_PYPY 1380 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2,
long intval,
int inplace,
int zerodivision_check);
1382 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\ 1383 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) 1387 static CYTHON_INLINE
int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq,
int eq) {
1388 int result = PySequence_Contains(seq, item);
1389 return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
1393 #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ 1394 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ 1395 __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\ 1396 (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\ 1397 __Pyx_SetItemInt_Generic(o, to_py_func(i), v))) 1398 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
1399 static CYTHON_INLINE
int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t
i, PyObject *v,
1400 int is_list,
int wraparound,
int boundscheck);
1403 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2);
1406 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ 1407 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\ 1408 __Pyx__ArgTypeTest(obj, type, name, exact)) 1409 static int __Pyx__ArgTypeTest(PyObject *
obj, PyTypeObject *type,
const char *name,
int exact);
1412 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
1418 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 1419 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject*
obj, PyObject* attr_name);
1421 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr 1425 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 1426 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject*
obj, PyObject* attr_name);
1428 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr 1432 static int __Pyx_SetVtable(PyObject *dict,
void *vtable);
1435 static int __Pyx_setup_reduce(PyObject* type_obj);
1438 #if !CYTHON_COMPILING_IN_PYPY 1439 static PyObject* __Pyx_PyFloat_DivideObjC(PyObject *op1, PyObject *op2,
double floatval,
int inplace,
int zerodivision_check);
1441 #define __Pyx_PyFloat_DivideObjC(op1, op2, floatval, inplace, zerodivision_check)\ 1442 ((inplace ? __Pyx_PyNumber_InPlaceDivide(op1, op2) : __Pyx_PyNumber_Divide(op1, op2))) 1446 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals);
1449 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals);
1452 #if PY_MAJOR_VERSION >= 3 1453 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals 1455 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals 1459 #ifdef CYTHON_CLINE_IN_TRACEBACK 1460 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) 1462 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
1467 PyCodeObject* code_object;
1469 } __Pyx_CodeObjectCacheEntry;
1470 struct __Pyx_CodeObjectCache {
1473 __Pyx_CodeObjectCacheEntry* entries;
1475 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1476 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
1477 static PyCodeObject *__pyx_find_code_object(
int code_line);
1478 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
1481 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
1482 int py_line,
const char *filename);
1485 #ifndef __Pyx_CppExn2PyErr 1488 #include <stdexcept> 1490 static void __Pyx_CppExn2PyErr() {
1492 if (PyErr_Occurred())
1496 }
catch (
const std::bad_alloc& exn) {
1497 PyErr_SetString(PyExc_MemoryError, exn.what());
1498 }
catch (
const std::bad_cast& exn) {
1499 PyErr_SetString(PyExc_TypeError, exn.what());
1500 }
catch (
const std::bad_typeid& exn) {
1501 PyErr_SetString(PyExc_TypeError, exn.what());
1502 }
catch (
const std::domain_error& exn) {
1503 PyErr_SetString(PyExc_ValueError, exn.what());
1504 }
catch (
const std::invalid_argument& exn) {
1505 PyErr_SetString(PyExc_ValueError, exn.what());
1506 }
catch (
const std::ios_base::failure& exn) {
1507 PyErr_SetString(PyExc_IOError, exn.what());
1508 }
catch (
const std::out_of_range& exn) {
1509 PyErr_SetString(PyExc_IndexError, exn.what());
1510 }
catch (
const std::overflow_error& exn) {
1511 PyErr_SetString(PyExc_OverflowError, exn.what());
1512 }
catch (
const std::range_error& exn) {
1513 PyErr_SetString(PyExc_ArithmeticError, exn.what());
1514 }
catch (
const std::underflow_error& exn) {
1515 PyErr_SetString(PyExc_ArithmeticError, exn.what());
1516 }
catch (
const std::exception& exn) {
1517 PyErr_SetString(PyExc_RuntimeError, exn.what());
1521 PyErr_SetString(PyExc_RuntimeError,
"Unknown exception");
1527 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
1530 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
1533 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
1536 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
1539 #if CYTHON_COMPILING_IN_CPYTHON 1540 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) 1541 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1542 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1543 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1545 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) 1546 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) 1547 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) 1549 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) 1552 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
1555 #if CYTHON_FAST_THREAD_STATE 1556 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) 1557 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1559 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
1563 static int __Pyx_PyObject_GetMethod(PyObject *
obj, PyObject *name, PyObject **method);
1566 static PyObject* __Pyx_PyObject_CallMethod1(PyObject*
obj, PyObject* method_name, PyObject* arg);
1569 typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyThreadState *, PyObject *);
1570 #if CYTHON_USE_EXC_INFO_STACK 1571 #define __Pyx_ExcInfoStruct _PyErr_StackItem 1575 PyObject *exc_value;
1576 PyObject *exc_traceback;
1577 } __Pyx_ExcInfoStruct;
1581 __pyx_coroutine_body_t body;
1583 __Pyx_ExcInfoStruct gi_exc_state;
1584 PyObject *gi_weakreflist;
1586 PyObject *yieldfrom;
1588 PyObject *gi_qualname;
1589 PyObject *gi_modulename;
1593 } __pyx_CoroutineObject;
1594 static __pyx_CoroutineObject *__Pyx__Coroutine_New(
1595 PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
1596 PyObject *name, PyObject *qualname, PyObject *module_name);
1597 static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
1598 __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
1599 PyObject *name, PyObject *qualname, PyObject *module_name);
1600 static CYTHON_INLINE
void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *
self);
1601 static int __Pyx_Coroutine_clear(PyObject *
self);
1602 static PyObject *__Pyx_Coroutine_Send(PyObject *
self, PyObject *value);
1603 static PyObject *__Pyx_Coroutine_Close(PyObject *
self);
1604 static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
1605 #if CYTHON_USE_EXC_INFO_STACK 1606 #define __Pyx_Coroutine_SwapException(self) 1607 #define __Pyx_Coroutine_ResetAndClearException(self) __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state) 1609 #define __Pyx_Coroutine_SwapException(self) {\ 1610 __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\ 1611 __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\ 1613 #define __Pyx_Coroutine_ResetAndClearException(self) {\ 1614 __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\ 1615 (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\ 1618 #if CYTHON_FAST_THREAD_STATE 1619 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ 1620 __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue) 1622 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ 1623 __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue) 1625 static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue);
1626 static CYTHON_INLINE
void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state);
1629 static PyObject* __Pyx_Coroutine_patch_module(PyObject* module,
const char* py_code);
1632 static int __Pyx_patch_abc(
void);
1635 #define __Pyx_Generator_USED 1636 static PyTypeObject *__pyx_GeneratorType = 0;
1637 #define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType) 1638 #define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\ 1639 __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name) 1640 static PyObject *__Pyx_Generator_Next(PyObject *
self);
1641 static int __pyx_Generator_init(
void);
1644 static int __Pyx_check_binary_version(
void);
1647 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1649 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_9index_set_wrap(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self,
IndexSet __pyx_v_other);
1650 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_9index_set_unwrap(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
1651 static PyObject *__pyx_f_8PyClical_9index_set_copy(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self,
int __pyx_skip_dispatch);
1652 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_8clifford_wrap(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self,
Clifford __pyx_v_other);
1653 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_8clifford_unwrap(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
1654 static PyObject *__pyx_f_8PyClical_8clifford_copy(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self,
int __pyx_skip_dispatch);
1661 static PyTypeObject *__pyx_ptype_8PyClical_index_set = 0;
1662 static PyTypeObject *__pyx_ptype_8PyClical_clifford = 0;
1663 static PyTypeObject *__pyx_ptype_8PyClical___pyx_scope_struct____iter__ = 0;
1664 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_toIndexSet(PyObject *);
1665 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_compare(PyObject *, PyObject *,
int __pyx_skip_dispatch);
1666 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_min_neg(PyObject *,
int __pyx_skip_dispatch);
1667 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_max_pos(PyObject *,
int __pyx_skip_dispatch);
1668 static CYTHON_INLINE std::vector<scalar_t> __pyx_f_8PyClical_list_to_vector(PyObject *);
1669 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_toClifford(PyObject *);
1670 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_inv(PyObject *,
int __pyx_skip_dispatch);
1671 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_scalar(PyObject *,
int __pyx_skip_dispatch);
1672 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_real(PyObject *,
int __pyx_skip_dispatch);
1673 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_imag(PyObject *,
int __pyx_skip_dispatch);
1674 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_pure(PyObject *,
int __pyx_skip_dispatch);
1675 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_even(PyObject *,
int __pyx_skip_dispatch);
1676 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_odd(PyObject *,
int __pyx_skip_dispatch);
1677 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_involute(PyObject *,
int __pyx_skip_dispatch);
1678 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_reverse(PyObject *,
int __pyx_skip_dispatch);
1679 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_conj(PyObject *,
int __pyx_skip_dispatch);
1680 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_quad(PyObject *,
int __pyx_skip_dispatch);
1681 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_norm(PyObject *,
int __pyx_skip_dispatch);
1682 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_abs(PyObject *,
int __pyx_skip_dispatch);
1683 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_max_abs(PyObject *,
int __pyx_skip_dispatch);
1684 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_pow(PyObject *, PyObject *,
int __pyx_skip_dispatch);
1685 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_outer_pow(PyObject *, PyObject *,
int __pyx_skip_dispatch);
1686 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_complexifier(PyObject *,
int __pyx_skip_dispatch);
1687 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_sqrt(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_sqrt *__pyx_optional_args);
1688 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_exp(PyObject *,
int __pyx_skip_dispatch);
1689 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_log(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_log *__pyx_optional_args);
1690 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cos(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_cos *__pyx_optional_args);
1691 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_acos(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_acos *__pyx_optional_args);
1692 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cosh(PyObject *,
int __pyx_skip_dispatch);
1693 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_acosh(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_acosh *__pyx_optional_args);
1694 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_sin(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_sin *__pyx_optional_args);
1695 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_asin(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_asin *__pyx_optional_args);
1696 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_sinh(PyObject *,
int __pyx_skip_dispatch);
1697 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_asinh(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_asinh *__pyx_optional_args);
1698 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_tan(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_tan *__pyx_optional_args);
1699 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_atan(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_atan *__pyx_optional_args);
1700 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_tanh(PyObject *,
int __pyx_skip_dispatch);
1701 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_atanh(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_atanh *__pyx_optional_args);
1702 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_random_clifford(
struct __pyx_obj_8PyClical_index_set *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_random_clifford *__pyx_optional_args);
1703 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cga3(PyObject *,
int __pyx_skip_dispatch);
1704 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cga3std(PyObject *,
int __pyx_skip_dispatch);
1705 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_agc3(PyObject *,
int __pyx_skip_dispatch);
1706 #define __Pyx_MODULE_NAME "PyClical" 1707 extern int __pyx_module_is_main_PyClical;
1708 int __pyx_module_is_main_PyClical = 0;
1711 static PyObject *__pyx_builtin_IndexError;
1712 static PyObject *__pyx_builtin_RuntimeError;
1713 static PyObject *__pyx_builtin_TypeError;
1714 static PyObject *__pyx_builtin_ValueError;
1715 static PyObject *__pyx_builtin_NotImplemented;
1716 static PyObject *__pyx_builtin_range;
1717 static PyObject *__pyx_builtin_xrange;
1718 static const char __pyx_k_[] =
".";
1719 static const char __pyx_k_e[] =
"e";
1720 static const char __pyx_k_i[] =
"i";
1721 static const char __pyx_k_m[] =
"m";
1722 static const char __pyx_k_p[] =
"p";
1723 static const char __pyx_k_q[] =
"q";
1724 static const char __pyx_k__2[] =
" ";
1725 static const char __pyx_k__5[] =
":";
1726 static const char __pyx_k__6[] =
"\n\t";
1727 static const char __pyx_k__7[] =
" (";
1728 static const char __pyx_k__8[] =
", ";
1729 static const char __pyx_k__9[] =
").";
1730 static const char __pyx_k_cl[] =
"cl";
1731 static const char __pyx_k_pi[] =
"pi";
1732 static const char __pyx_k_cos[] =
"cos";
1733 static const char __pyx_k_exp[] =
"exp";
1734 static const char __pyx_k_frm[] =
"frm";
1735 static const char __pyx_k_inv[] =
"inv";
1736 static const char __pyx_k_ist[] =
"ist";
1737 static const char __pyx_k_ixt[] =
"ixt";
1738 static const char __pyx_k_lhs[] =
"lhs";
1739 static const char __pyx_k_log[] =
"log";
1740 static const char __pyx_k_max[] =
"max";
1741 static const char __pyx_k_min[] =
"min";
1742 static const char __pyx_k_obj[] =
"obj";
1743 static const char __pyx_k_odd[] =
"odd";
1744 static const char __pyx_k_pow[] =
"pow";
1745 static const char __pyx_k_rhs[] =
"rhs";
1746 static const char __pyx_k_sin[] =
"sin";
1747 static const char __pyx_k_tan[] =
"tan";
1748 static const char __pyx_k_tau[] =
"tau";
1749 static const char __pyx_k_Real[] =
"Real";
1750 static const char __pyx_k_acos[] =
"acos";
1751 static const char __pyx_k_args[] =
"args";
1752 static const char __pyx_k_asin[] =
"asin";
1753 static const char __pyx_k_atan[] =
"atan";
1754 static const char __pyx_k_conj[] =
"conj";
1755 static const char __pyx_k_copy[] =
"copy";
1756 static const char __pyx_k_cosh[] =
"cosh";
1757 static const char __pyx_k_even[] =
"even";
1758 static const char __pyx_k_fill[] =
"fill";
1759 static const char __pyx_k_from[] =
" from ";
1760 static const char __pyx_k_iter[] =
"__iter__";
1761 static const char __pyx_k_main[] =
"__main__";
1762 static const char __pyx_k_math[] =
"math";
1763 static const char __pyx_k_name[] =
"__name__";
1764 static const char __pyx_k_norm[] =
"norm";
1765 static const char __pyx_k_pure[] =
"pure";
1766 static const char __pyx_k_quad[] =
"quad";
1767 static const char __pyx_k_send[] =
"send";
1768 static const char __pyx_k_sinh[] =
"sinh";
1769 static const char __pyx_k_sqrt[] =
"sqrt";
1770 static const char __pyx_k_tanh[] =
"tanh";
1771 static const char __pyx_k_test[] =
"_test";
1772 static const char __pyx_k_0_8_2[] =
"0.8.2";
1773 static const char __pyx_k_acosh[] =
"acosh";
1774 static const char __pyx_k_asinh[] =
"asinh";
1775 static const char __pyx_k_atanh[] =
"atanh";
1776 static const char __pyx_k_close[] =
"close";
1777 static const char __pyx_k_grade[] =
"grade";
1778 static const char __pyx_k_istpq[] =
"istpq";
1779 static const char __pyx_k_nbar3[] =
"nbar3";
1780 static const char __pyx_k_ninf3[] =
"ninf3";
1781 static const char __pyx_k_other[] =
"other";
1782 static const char __pyx_k_range[] =
"range";
1783 static const char __pyx_k_throw[] =
"throw";
1784 static const char __pyx_k_using[] =
" using (";
1785 static const char __pyx_k_value[] =
" value ";
1786 static const char __pyx_k_import[] =
"__import__";
1787 static const char __pyx_k_reduce[] =
"__reduce__";
1788 static const char __pyx_k_scalar[] =
"scalar";
1789 static const char __pyx_k_test_2[] =
"__test__";
1790 static const char __pyx_k_xrange[] =
"xrange";
1791 static const char __pyx_k_doctest[] =
"doctest";
1792 static const char __pyx_k_invalid[] =
" invalid ";
1793 static const char __pyx_k_numbers[] =
"numbers";
1794 static const char __pyx_k_reverse[] =
"reverse";
1795 static const char __pyx_k_testmod[] =
"testmod";
1796 static const char __pyx_k_version[] =
"__version__";
1797 static const char __pyx_k_Integral[] =
"Integral";
1798 static const char __pyx_k_PyClical[] =
"PyClical";
1799 static const char __pyx_k_Sequence[] =
"Sequence";
1800 static const char __pyx_k_as_frame[] =
" as frame:\n\t";
1801 static const char __pyx_k_clifford[] =
"clifford";
1802 static const char __pyx_k_getstate[] =
"__getstate__";
1803 static const char __pyx_k_involute[] =
"involute";
1804 static const char __pyx_k_setstate[] =
"__setstate__";
1805 static const char __pyx_k_to_frame[] =
" to frame ";
1806 static const char __pyx_k_TypeError[] =
"TypeError";
1807 static const char __pyx_k_index_set[] =
"index_set";
1808 static const char __pyx_k_outer_pow[] =
"outer_pow";
1809 static const char __pyx_k_reduce_ex[] =
"__reduce_ex__";
1810 static const char __pyx_k_IndexError[] =
"IndexError";
1811 static const char __pyx_k_ValueError[] =
"ValueError";
1812 static const char __pyx_k_pyx_vtable[] =
"__pyx_vtable__";
1813 static const char __pyx_k_collections[] =
"collections";
1814 static const char __pyx_k_e_line_1887[] =
"e (line 1887)";
1815 static const char __pyx_k_PyClical_pyx[] =
"PyClical.pyx";
1816 static const char __pyx_k_RuntimeError[] =
"RuntimeError";
1817 static const char __pyx_k_abs_line_1473[] =
"abs (line 1473)";
1818 static const char __pyx_k_cos_line_1602[] =
"cos (line 1602)";
1819 static const char __pyx_k_exp_line_1565[] =
"exp (line 1565)";
1820 static const char __pyx_k_inv_line_1329[] =
"inv (line 1329)";
1821 static const char __pyx_k_log_line_1579[] =
"log (line 1579)";
1822 static const char __pyx_k_odd_line_1397[] =
"odd (line 1397)";
1823 static const char __pyx_k_pow_line_1494[] =
"pow (line 1494)";
1824 static const char __pyx_k_reduce_cython[] =
"__reduce_cython__";
1825 static const char __pyx_k_sin_line_1679[] =
"sin (line 1679)";
1826 static const char __pyx_k_tan_line_1752[] =
"tan (line 1752)";
1827 static const char __pyx_k_using_invalid[] =
" using invalid ";
1828 static const char __pyx_k_Cannot_reframe[] =
"Cannot reframe";
1829 static const char __pyx_k_NotImplemented[] =
"NotImplemented";
1830 static const char __pyx_k_Not_applicable[] =
"Not applicable.";
1831 static const char __pyx_k_acos_line_1619[] =
"acos (line 1619)";
1832 static const char __pyx_k_agc3_line_1844[] =
"agc3 (line 1844)";
1833 static const char __pyx_k_asin_line_1698[] =
"asin (line 1698)";
1834 static const char __pyx_k_atan_line_1769[] =
"atan (line 1769)";
1835 static const char __pyx_k_cga3_line_1824[] =
"cga3 (line 1824)";
1836 static const char __pyx_k_conj_line_1436[] =
"conj (line 1436)";
1837 static const char __pyx_k_cosh_line_1640[] =
"cosh (line 1640)";
1838 static const char __pyx_k_even_line_1388[] =
"even (line 1388)";
1839 static const char __pyx_k_imag_line_1366[] =
"imag (line 1366)";
1840 static const char __pyx_k_invalid_string[] =
" invalid string ";
1841 static const char __pyx_k_norm_line_1462[] =
"norm (line 1462)";
1842 static const char __pyx_k_pure_line_1377[] =
"pure (line 1377)";
1843 static const char __pyx_k_quad_line_1451[] =
"quad (line 1451)";
1844 static const char __pyx_k_real_line_1355[] =
"real (line 1355)";
1845 static const char __pyx_k_sinh_line_1719[] =
"sinh (line 1719)";
1846 static const char __pyx_k_sqrt_line_1542[] =
"sqrt (line 1542)";
1847 static const char __pyx_k_tanh_line_1786[] =
"tanh (line 1786)";
1848 static const char __pyx_k_acosh_line_1656[] =
"acosh (line 1656)";
1849 static const char __pyx_k_asinh_line_1733[] =
"asinh (line 1733)";
1850 static const char __pyx_k_atanh_line_1798[] =
"atanh (line 1798)";
1851 static const char __pyx_k_istpq_line_1900[] =
"istpq (line 1900)";
1852 static const char __pyx_k_setstate_cython[] =
"__setstate_cython__";
1853 static const char __pyx_k_compare_line_490[] =
"compare (line 490)";
1854 static const char __pyx_k_index_set___iter[] =
"index_set.__iter__";
1855 static const char __pyx_k_max_pos_line_511[] =
"max_pos (line 511)";
1856 static const char __pyx_k_min_neg_line_502[] =
"min_neg (line 502)";
1857 static const char __pyx_k_scalar_line_1344[] =
"scalar (line 1344)";
1858 static const char __pyx_k_cga3std_line_1833[] =
"cga3std (line 1833)";
1859 static const char __pyx_k_max_abs_line_1482[] =
"max_abs (line 1482)";
1860 static const char __pyx_k_reverse_line_1421[] =
"reverse (line 1421)";
1861 static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
1862 static const char __pyx_k_involute_line_1406[] =
"involute (line 1406)";
1863 static const char __pyx_k_outer_pow_line_1518[] =
"outer_pow (line 1518)";
1864 static const char __pyx_k_clifford_inv_line_925[] =
"clifford.inv (line 925)";
1865 static const char __pyx_k_clifford_pow_line_979[] =
"clifford.pow (line 979)";
1866 static const char __pyx_k_clifford_abs_line_1174[] =
"clifford.abs (line 1174)";
1867 static const char __pyx_k_clifford_copy_line_554[] =
"clifford.copy (line 554)";
1868 static const char __pyx_k_clifford_odd_line_1069[] =
"clifford.odd (line 1069)";
1869 static const char __pyx_k_complexifier_line_1527[] =
"complexifier (line 1527)";
1870 static const char __pyx_k_index_set_copy_line_64[] =
"index_set.copy (line 64)";
1871 static const char __pyx_k_index_set_max_line_349[] =
"index_set.max (line 349)";
1872 static const char __pyx_k_index_set_min_line_340[] =
"index_set.min (line 340)";
1873 static const char __pyx_k_clifford_conj_line_1137[] =
"clifford.conj (line 1137)";
1874 static const char __pyx_k_clifford_even_line_1060[] =
"clifford.even (line 1060)";
1875 static const char __pyx_k_clifford_norm_line_1163[] =
"clifford.norm (line 1163)";
1876 static const char __pyx_k_clifford_pure_line_1049[] =
"clifford.pure (line 1049)";
1877 static const char __pyx_k_clifford_quad_line_1152[] =
"clifford.quad (line 1152)";
1878 static const char __pyx_k_Unary_print_clifford_1_1[] =
"\n Unary -.\n\n >>> print -clifford(\"{1}\")\n -{1}\n ";
1879 static const char __pyx_k_clifford___or___line_938[] =
"clifford.__or__ (line 938)";
1880 static const char __pyx_k_clifford_frame_line_1214[] =
"clifford.frame (line 1214)";
1881 static const char __pyx_k_clifford_hidden_doctests[] =
"clifford_hidden_doctests";
1882 static const char __pyx_k_clifford_isnan_line_1205[] =
"clifford.isnan (line 1205)";
1883 static const char __pyx_k_index_set_count_line_313[] =
"index_set.count (line 313)";
1884 static const char __pyx_k_clifford___add___line_739[] =
"clifford.__add__ (line 739)";
1885 static const char __pyx_k_clifford___and___line_835[] =
"clifford.__and__ (line 835)";
1886 static const char __pyx_k_clifford___div___line_895[] =
"clifford.__div__ (line 895)";
1887 static const char __pyx_k_clifford___ior___line_949[] =
"clifford.__ior__ (line 949)";
1888 static const char __pyx_k_clifford___mod___line_805[] =
"clifford.__mod__ (line 805)";
1889 static const char __pyx_k_clifford___mul___line_779[] =
"clifford.__mul__ (line 779)";
1890 static const char __pyx_k_clifford___neg___line_721[] =
"clifford.__neg__ (line 721)";
1891 static const char __pyx_k_clifford___pos___line_730[] =
"clifford.__pos__ (line 730)";
1892 static const char __pyx_k_clifford___pow___line_960[] =
"clifford.__pow__ (line 960)";
1893 static const char __pyx_k_clifford___sub___line_759[] =
"clifford.__sub__ (line 759)";
1894 static const char __pyx_k_clifford___xor___line_865[] =
"clifford.__xor__ (line 865)";
1895 static const char __pyx_k_clifford_reframe_line_648[] =
"clifford.reframe (line 648)";
1896 static const char __pyx_k_clifford_scalar_line_1038[] =
"clifford.scalar (line 1038)";
1897 static const char __pyx_k_index_set___or___line_291[] =
"index_set.__or__ (line 291)";
1898 static const char __pyx_k_index_set_hidden_doctests[] =
"index_set_hidden_doctests";
1899 static const char __pyx_k_random_clifford_line_1815[] =
"random_clifford (line 1815)";
1900 static const char __pyx_k_Cannot_take_vector_part_of[] =
"Cannot take vector part of ";
1901 static const char __pyx_k_Unary_print_clifford_1_1_2[] =
"\n Unary +.\n\n >>> print +clifford(\"{1}\")\n {1}\n ";
1902 static const char __pyx_k_clifford___iadd___line_750[] =
"clifford.__iadd__ (line 750)";
1903 static const char __pyx_k_clifford___iand___line_850[] =
"clifford.__iand__ (line 850)";
1904 static const char __pyx_k_clifford___idiv___line_910[] =
"clifford.__idiv__ (line 910)";
1905 static const char __pyx_k_clifford___imod___line_820[] =
"clifford.__imod__ (line 820)";
1906 static const char __pyx_k_clifford___imul___line_792[] =
"clifford.__imul__ (line 792)";
1907 static const char __pyx_k_clifford___isub___line_770[] =
"clifford.__isub__ (line 770)";
1908 static const char __pyx_k_clifford___iter___line_637[] =
"clifford.__iter__ (line 637)";
1909 static const char __pyx_k_clifford___ixor___line_880[] =
"clifford.__ixor__ (line 880)";
1910 static const char __pyx_k_clifford___str___line_1234[] =
"clifford.__str__ (line 1234)";
1911 static const char __pyx_k_clifford_max_abs_line_1183[] =
"clifford.max_abs (line 1183)";
1912 static const char __pyx_k_clifford_reverse_line_1122[] =
"clifford.reverse (line 1122)";
1913 static const char __pyx_k_index_set___and___line_269[] =
"index_set.__and__ (line 269)";
1914 static const char __pyx_k_index_set___ior___line_302[] =
"index_set.__ior__ (line 302)";
1915 static const char __pyx_k_index_set___str___line_393[] =
"index_set.__str__ (line 393)";
1916 static const char __pyx_k_index_set___xor___line_247[] =
"index_set.__xor__ (line 247)";
1917 static const char __pyx_k_clifford___call___line_1019[] =
"clifford.__call__ (line 1019)";
1918 static const char __pyx_k_clifford___repr___line_1225[] =
"clifford.__repr__ (line 1225)";
1919 static const char __pyx_k_clifford_involute_line_1106[] =
"clifford.involute (line 1106)";
1920 static const char __pyx_k_index_set___iand___line_280[] =
"index_set.__iand__ (line 280)";
1921 static const char __pyx_k_index_set___iter___line_227[] =
"index_set.__iter__ (line 227)";
1922 static const char __pyx_k_index_set___ixor___line_258[] =
"index_set.__ixor__ (line 258)";
1923 static const char __pyx_k_index_set___repr___line_382[] =
"index_set.__repr__ (line 382)";
1924 static const char __pyx_k_clifford_outer_pow_line_1003[] =
"clifford.outer_pow (line 1003)";
1925 static const char __pyx_k_clifford_truncated_line_1194[] =
"clifford.truncated (line 1194)";
1926 static const char __pyx_k_index_set_count_neg_line_322[] =
"index_set.count_neg (line 322)";
1927 static const char __pyx_k_index_set_count_pos_line_331[] =
"index_set.count_pos (line 331)";
1928 static const char __pyx_k_clifford___getitem___line_706[] =
"clifford.__getitem__ (line 706)";
1929 static const char __pyx_k_index_set___invert___line_238[] =
"index_set.__invert__ (line 238)";
1930 static const char __pyx_k_Abbreviation_for_index_set_q_p[] =
"\n Abbreviation for index_set({-q,...p}).\n\n >>> print istpq(2,3)\n {-3,-2,-1,1,2}\n ";
1931 static const char __pyx_k_Conjugation_reverse_o_involute[] =
"\n Conjugation, reverse o involute == involute o reverse.\n\n >>> print (clifford(\"{1}\")).conj()\n -{1}\n >>> print (clifford(\"{2}\") * clifford(\"{1}\")).conj()\n {1,2}\n >>> print (clifford(\"{1}\") * clifford(\"{2}\")).conj()\n -{1,2}\n >>> print clifford(\"1+{1}+{1,2}\").conj()\n 1-{1}-{1,2}\n ";
1932 static const char __pyx_k_Geometric_product_x_clifford_2[] =
"\n Geometric product.\n\n >>> x = clifford(2); x *= clifford(\"{2}\"); print x\n 2{2}\n >>> x = clifford(\"{1}\"); x *= clifford(\"{2}\"); print x\n {1,2}\n >>> x = clifford(\"{1}\"); x *= clifford(\"{1,2}\"); print x\n {2}\n ";
1933 static const char __pyx_k_Geometric_sum_print_clifford_1[] =
"\n Geometric sum.\n\n >>> print clifford(1) + clifford(\"{2}\")\n 1+{2}\n >>> print clifford(\"{1}\") + clifford(\"{2}\")\n {1}+{2}\n ";
1934 static const char __pyx_k_Hyperbolic_sine_of_multivector[] =
"\n Hyperbolic sine of multivector.\n\n >>> x=clifford(\"{1,2}\") * pi/2; print sinh(x)\n {1,2}\n >>> x=clifford(\"{1,2}\") * pi/6; print sinh(x)\n 0.5{1,2}\n ";
1935 static const char __pyx_k_Inner_product_print_clifford_1[] =
"\n Inner product.\n\n >>> print clifford(\"{1}\") & clifford(\"{2}\")\n 0\n >>> print clifford(2) & clifford(\"{2}\")\n 0\n >>> print clifford(\"{1}\") & clifford(\"{1}\")\n 1\n >>> print clifford(\"{1}\") & clifford(\"{1,2}\")\n {2}\n ";
1936 static const char __pyx_k_Inverse_tangent_of_multivector[] =
"\n Inverse tangent of multivector with optional complexifier.\n\n >>> s=index_set({1,2,3}); x=clifford(\"{1}\"); print tan(atan(x,s),s)\n {1}\n >>> x=clifford(\"{1}\"); print tan(atan(x))\n {1}\n ";
1937 static const char __pyx_k_Iterate_over_the_indices_of_an[] =
"\n Iterate over the indices of an index_set.\n\n >>> for i in index_set({-3,4,7}): print i,\n -3 4 7\n ";
1938 static const char __pyx_k_Maximum_member_index_set_1_1_2[] =
"\n Maximum member.\n\n >>> index_set({-1,1,2}).max()\n 2\n ";
1939 static const char __pyx_k_Maximum_positive_index_or_0_if[] =
"\n Maximum positive index, or 0 if none.\n\n >>> max_pos(index_set({1,2}))\n 2\n ";
1940 static const char __pyx_k_Minimum_member_index_set_1_1_2[] =
"\n Minimum member.\n\n >>> index_set({-1,1,2}).min()\n -1\n ";
1941 static const char __pyx_k_Minimum_negative_index_or_0_if[] =
"\n Minimum negative index, or 0 if none.\n\n >>> min_neg(index_set({1,2}))\n 0\n ";
1942 static const char __pyx_k_Odd_part_of_multivector_sum_of[] =
"\n Odd part of multivector, sum of odd grade terms.\n\n >>> print clifford(\"1+{1}+{1,2}\").odd()\n {1}\n ";
1943 static const char __pyx_k_Outer_product_power_x_clifford[] =
"\n Outer product power.\n\n >>> x=clifford(\"2+{1}\"); print x.outer_pow(0)\n 1\n >>> x=clifford(\"2+{1}\"); print x.outer_pow(1)\n 2+{1}\n >>> x=clifford(\"2+{1}\"); print x.outer_pow(2)\n 4+4{1}\n >>> print clifford(\"1+{1}+{1,2}\").outer_pow(3)\n 1+3{1}+3{1,2}\n\n ";
1944 static const char __pyx_k_Outer_product_print_clifford_1[] =
"\n Outer product.\n\n >>> print clifford(\"{1}\") ^ clifford(\"{2}\")\n {1,2}\n >>> print clifford(2) ^ clifford(\"{2}\")\n 2{2}\n >>> print clifford(\"{1}\") ^ clifford(\"{1}\")\n 0\n >>> print clifford(\"{1}\") ^ clifford(\"{1,2}\")\n 0\n ";
1945 static const char __pyx_k_Power_self_to_the_m_x_clifford[] =
"\n Power: self to the m.\n\n >>> x=clifford(\"{1}\"); print x ** 2\n 1\n >>> x=clifford(\"2\"); print x ** 2\n 4\n >>> x=clifford(\"2+{1}\"); print x ** 0\n 1\n >>> x=clifford(\"2+{1}\"); print x ** 1\n 2+{1}\n >>> x=clifford(\"2+{1}\"); print x ** 2\n 5+4{1}\n >>> i=clifford(\"{1,2}\");print exp(pi/2) * (i ** i)\n 1\n ";
1946 static const char __pyx_k_Pure_part_print_clifford_1_1_1[] =
"\n Pure part.\n\n >>> print clifford(\"1+{1}+{1,2}\").pure()\n {1}+{1,2}\n >>> print clifford(\"{1,2}\").pure()\n {1,2}\n ";
1947 static const char __pyx_k_Quadratic_form_rev_x_x_0_print[] =
"\n Quadratic form == (rev(x)*x)(0).\n\n >>> print clifford(\"1+{1}+{1,2}\").quad()\n 3.0\n >>> print clifford(\"1+{-1}+{1,2}+{1,2,3}\").quad()\n 2.0\n ";
1948 static const char __pyx_k_Set_complement_not_print_index[] =
"\n Set complement: not.\n\n >>> print ~index_set({-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16})\n {-32,-31,-30,-29,-28,-27,-26,-25,-24,-23,-22,-21,-20,-19,-18,-17,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32}\n ";
1949 static const char __pyx_k_Set_union_or_print_index_set_1[] =
"\n Set union: or.\n\n >>> print index_set({1}) | index_set({2})\n {1,2}\n >>> print index_set({1,2}) | index_set({2})\n {1,2}\n ";
1950 static const char __pyx_k_Transform_left_hand_side_using[] =
"\n Transform left hand side, using right hand side as a transformation.\n\n >>> x=clifford(\"{1,2}\") * pi/2; y=clifford(\"{1}\"); print y|x\n -{1}\n >>> x=clifford(\"{1,2}\") * pi/2; y=clifford(\"{1}\"); print y|exp(x)\n -{1}\n ";
1951 static const char __pyx_k_clifford_vector_part_line_1078[] =
"clifford.vector_part (line 1078)";
1952 static const char __pyx_k_index_set___getitem___line_189[] =
"index_set.__getitem__ (line 189)";
1953 static const char __pyx_k_index_set___setitem___line_177[] =
"index_set.__setitem__ (line 177)";
1954 static const char __pyx_k_lexicographic_compare_eg_3_4_5[] =
"\n \"lexicographic compare\" eg. {3,4,5} is less than {3,7,8};\n -1 if a<b, +1 if a>b, 0 if a==b.\n\n >>> compare(index_set({1,2}),index_set({-1,3}))\n -1\n >>> compare(index_set({-1,4}),index_set({-1,3}))\n 1\n ";
1955 static const char __pyx_k_Abbreviation_for_clifford_index[] =
"\n Abbreviation for clifford(index_set(obj)).\n\n >>> print e(1)\n {1}\n >>> print e(-1)\n {-1}\n >>> print e(0)\n 1\n ";
1956 static const char __pyx_k_Absolute_value_of_multivector_m[] =
"\n Absolute value of multivector: multivector 2-norm.\n\n >>> abs(clifford(\"1+{-1}+{1,2}+{1,2,3}\"))\n 2.0\n ";
1957 static const char __pyx_k_Absolute_value_square_root_of_n[] =
"\n Absolute value: square root of norm.\n\n >>> clifford(\"1+{-1}+{1,2}+{1,2,3}\").abs()\n 2.0\n ";
1958 static const char __pyx_k_Cardinality_Number_of_indices_i[] =
"\n Cardinality: Number of indices included in set.\n\n >>> index_set({-1,1,2}).count()\n 3\n ";
1959 static const char __pyx_k_Check_if_a_multivector_contains[] =
"\n Check if a multivector contains any IEEE NaN values.\n\n >>> clifford().isnan()\n False\n ";
1960 static const char __pyx_k_Contraction_print_clifford_1_cl[] =
"\n Contraction.\n\n >>> print clifford(\"{1}\") % clifford(\"{2}\")\n 0\n >>> print clifford(2) % clifford(\"{2}\")\n 2{2}\n >>> print clifford(\"{1}\") % clifford(\"{1}\")\n 1\n >>> print clifford(\"{1}\") % clifford(\"{1,2}\")\n {2}\n ";
1961 static const char __pyx_k_Contraction_x_clifford_1_x_clif[] =
"\n Contraction.\n\n >>> x = clifford(\"{1}\"); x %= clifford(\"{2}\"); print x\n 0\n >>> x = clifford(2); x %= clifford(\"{2}\"); print x\n 2{2}\n >>> x = clifford(\"{1}\"); x %= clifford(\"{1}\"); print x\n 1\n >>> x = clifford(\"{1}\"); x %= clifford(\"{1,2}\"); print x\n {2}\n ";
1962 static const char __pyx_k_Convert_CGA3_null_vector_to_Euc[] =
"\n Convert CGA3 null vector to Euclidean 3D vector using Doran and Lasenby definition.\n\n >>> x=clifford(\"2{1}+9{2}+{3}\"); print agc3(cga3(x))\n 2{1}+9{2}+{3}\n >>> x=clifford(\"2{1}+9{2}+{3}\"); print agc3(cga3(x))-x\n 0\n ";
1963 static const char __pyx_k_Convert_CGA3_null_vector_to_sta[] =
"\n Convert CGA3 null vector to standard conformal null vector using Doran and Lasenby definition.\n\n >>> x=clifford(\"2{1}+9{2}+{3}\"); print cga3std(cga3(x))\n 87{-1}+4{1}+18{2}+2{3}+85{4}\n >>> x=clifford(\"2{1}+9{2}+{3}\"); print cga3std(cga3(x))-cga3(x)\n 0\n ";
1964 static const char __pyx_k_Convert_Euclidean_3D_multivecto[] =
"\n Convert Euclidean 3D multivector to Conformal Geometric Algebra using Doran and Lasenby definition.\n\n >>> x=clifford(\"2{1}+9{2}+{3}\"); print cga3(x)\n 87{-1}+4{1}+18{2}+2{3}+85{4}\n ";
1965 static const char __pyx_k_Copy_this_clifford_object_x_cli[] =
"\n Copy this clifford object.\n\n >>> x=clifford(\"1{2}\"); y=x.copy(); print y\n {2}\n ";
1966 static const char __pyx_k_Copy_this_index_set_object_s_in[] =
"\n Copy this index_set object.\n\n >>> s=index_set(1); t=s.copy(); print t\n {1}\n ";
1967 static const char __pyx_k_Cosine_of_multivector_with_opti[] =
"\n Cosine of multivector with optional complexifier.\n\n >>> x=clifford(\"{1,2}\"); print cos(acos(x),\"{1,2,3}\")\n {1,2}\n >>> x=clifford(\"{1,2}\"); print cos(acos(x))\n {1,2}\n ";
1968 static const char __pyx_k_Even_part_of_multivector_sum_of[] =
"\n Even part of multivector, sum of even grade terms.\n\n >>> print clifford(\"1+{1}+{1,2}\").even()\n 1+{1,2}\n ";
1969 static const char __pyx_k_Exponential_of_multivector_x_cl[] =
"\n Exponential of multivector.\n\n >>> x=clifford(\"{1,2}\") * pi/4; print exp(x)\n 0.7071+0.7071{1,2}\n >>> x=clifford(\"{1,2}\") * pi/2; print exp(x)\n {1,2}\n ";
1970 static const char __pyx_k_Geometric_difference_print_clif[] =
"\n Geometric difference.\n\n >>> print clifford(1) - clifford(\"{2}\")\n 1-{2}\n >>> print clifford(\"{1}\") - clifford(\"{2}\")\n {1}-{2}\n ";
1971 static const char __pyx_k_Geometric_difference_x_clifford[] =
"\n Geometric difference.\n\n >>> x = clifford(1); x -= clifford(\"{2}\"); print x\n 1-{2}\n ";
1972 static const char __pyx_k_Geometric_multiplicative_invers[] =
"\n Geometric multiplicative inverse.\n\n >>> x = clifford(\"{1}\"); print x.inv()\n {1}\n >>> x = clifford(2); print x.inv()\n 0.5\n >>> x = clifford(\"{1,2}\"); print x.inv()\n -{1,2}\n ";
1973 static const char __pyx_k_Geometric_product_print_cliffor[] =
"\n Geometric product.\n\n >>> print clifford(\"{1}\") * clifford(\"{2}\")\n {1,2}\n >>> print clifford(2) * clifford(\"{2}\")\n 2{2}\n >>> print clifford(\"{1}\") * clifford(\"{1,2}\")\n {2}\n ";
1974 static const char __pyx_k_Geometric_quotient_print_cliffo[] =
"\n Geometric quotient.\n\n >>> print clifford(\"{1}\") / clifford(\"{2}\")\n {1,2}\n >>> print clifford(2) / clifford(\"{2}\")\n 2{2}\n >>> print clifford(\"{1}\") / clifford(\"{1}\")\n 1\n >>> print clifford(\"{1}\") / clifford(\"{1,2}\")\n -{2}\n ";
1975 static const char __pyx_k_Geometric_quotient_x_clifford_1[] =
"\n Geometric quotient.\n\n >>> x = clifford(\"{1}\"); x /= clifford(\"{2}\"); print x\n {1,2}\n >>> x = clifford(2); x /= clifford(\"{2}\"); print x\n 2{2}\n >>> x = clifford(\"{1}\"); x /= clifford(\"{1}\"); print x\n 1\n >>> x = clifford(\"{1}\"); x /= clifford(\"{1,2}\"); print x\n -{2}\n ";
1976 static const char __pyx_k_Geometric_sum_x_clifford_1_x_cl[] =
"\n Geometric sum.\n\n >>> x = clifford(1); x += clifford(\"{2}\"); print x\n 1+{2}\n ";
1977 static const char __pyx_k_Get_the_value_of_an_index_set_o[] =
"\n Get the value of an index_set object at an index.\n\n >>> index_set({1})[1]\n True\n >>> index_set({1})[2]\n False\n >>> index_set({2})[-1]\n False\n >>> index_set({2})[1]\n False\n >>> index_set({2})[2]\n True\n >>> index_set({2})[33]\n False\n ";
1978 static const char __pyx_k_Hyperbolic_cosine_of_multivecto[] =
"\n Hyperbolic cosine of multivector.\n\n >>> x=clifford(\"{1,2}\") * pi; print cosh(x)\n -1\n >>> x=clifford(\"{1,2,3}\"); print cosh(acosh(x))\n {1,2,3}\n >>> x=clifford(\"{1,2}\"); print cosh(acosh(x))\n {1,2}\n ";
1979 static const char __pyx_k_Hyperbolic_tangent_of_multivect[] =
"\n Hyperbolic tangent of multivector.\n\n >>> x=clifford(\"{1,2}\") * pi/4; print tanh(x)\n {1,2}\n ";
1980 static const char __pyx_k_Imaginary_part_deprecated_alway[] =
"\n Imaginary part: deprecated (always 0).\n\n >>> imag(clifford(\"1+{1}+{1,2}\"))\n 0.0\n >>> imag(clifford(\"{1,2}\"))\n 0.0\n ";
1981 static const char __pyx_k_Inner_product_x_clifford_1_x_cl[] =
"\n Inner product.\n\n >>> x = clifford(\"{1}\"); x &= clifford(\"{2}\"); print x\n 0\n >>> x = clifford(2); x &= clifford(\"{2}\"); print x\n 0\n >>> x = clifford(\"{1}\"); x &= clifford(\"{1}\"); print x\n 1\n >>> x = clifford(\"{1}\"); x &= clifford(\"{1,2}\"); print x\n {2}\n ";
1982 static const char __pyx_k_Integer_power_of_multivector_ob[] =
"\n Integer power of multivector: obj to the m.\n\n >>> x=clifford(\"{1}\"); print pow(x,2)\n 1\n >>> x=clifford(\"2\"); print pow(x,2)\n 4\n >>> x=clifford(\"2+{1}\"); print pow(x,0)\n 1\n >>> x=clifford(\"2+{1}\"); print pow(x,1)\n 2+{1}\n >>> x=clifford(\"2+{1}\"); print pow(x,2)\n 5+4{1}\n >>> print pow(clifford(\"1+{1}+{1,2}\"),3)\n 1+3{1}+3{1,2}\n >>> i=clifford(\"{1,2}\");print exp(pi/2) * pow(i, i)\n 1\n ";
1983 static const char __pyx_k_Inverse_cosine_of_multivector_w[] =
"\n Inverse cosine of multivector with optional complexifier.\n\n >>> x=clifford(\"{1,2}\"); print cos(acos(x),\"{1,2,3}\")\n {1,2}\n >>> x=clifford(\"{1,2}\"); print cos(acos(x),\"{-1,1,2,3,4}\")\n {1,2}\n >>> print acos(0) / pi\n 0.5\n >>> x=clifford(\"{1,2}\"); print cos(acos(x))\n {1,2}\n ";
1984 static const char __pyx_k_Inverse_hyperbolic_cosine_of_mu[] =
"\n Inverse hyperbolic cosine of multivector with optional complexifier.\n\n >>> print acosh(0,\"{-2,-1,1}\")\n 1.571{-2,-1,1}\n >>> x=clifford(\"{1,2,3}\"); print cosh(acosh(x,\"{-1,1,2,3,4}\"))\n {1,2,3}\n >>> print acosh(0)\n 1.571{-1}\n >>> x=clifford(\"{1,2,3}\"); print cosh(acosh(x))\n {1,2,3}\n >>> x=clifford(\"{1,2}\"); print cosh(acosh(x))\n {1,2}\n ";
1985 static const char __pyx_k_Inverse_hyperbolic_sine_of_mult[] =
"\n Inverse hyperbolic sine of multivector with optional complexifier.\n\n >>> x=clifford(\"{1,2}\"); print asinh(x,\"{1,2,3}\") * 2/pi\n {1,2}\n >>> x=clifford(\"{1,2}\"); print asinh(x) * 2/pi\n {1,2}\n >>> x=clifford(\"{1,2}\") / 2; print asinh(x) * 6/pi\n {1,2}\n ";
1986 static const char __pyx_k_Inverse_hyperbolic_tangent_of_m[] =
"\n Inverse hyperbolic tangent of multivector with optional complexifier.\n\n >>> s=index_set({1,2,3}); x=clifford(\"{1,2}\"); print tanh(atanh(x,s))\n {1,2}\n >>> x=clifford(\"{1,2}\"); print tanh(atanh(x))\n {1,2}\n ";
1987 static const char __pyx_k_Inverse_sine_of_multivector_wit[] =
"\n Inverse sine of multivector with optional complexifier.\n\n >>> s=\"{-1}\"; x=clifford(s); print asin(sin(x,s),s)\n {-1}\n >>> s=\"{-1}\"; x=clifford(s); print asin(sin(x,s),\"{-2,-1,1}\")\n {-1}\n >>> print asin(1) / pi\n 0.5\n >>> x=clifford(\"{1,2,3}\"); print asin(sin(x))\n {1,2,3}\n ";
1988 static const char __pyx_k_Main_involution_each_i_is_repla[] =
"\n Main involution, each {i} is replaced by -{i} in each term,\n eg. clifford(\"{1}\") -> -clifford(\"{1}\").\n\n >>> print clifford(\"{1}\").involute()\n -{1}\n >>> print (clifford(\"{2}\") * clifford(\"{1}\")).involute()\n -{1,2}\n >>> print (clifford(\"{1}\") * clifford(\"{2}\")).involute()\n {1,2}\n >>> print clifford(\"1+{1}+{1,2}\").involute()\n 1-{1}+{1,2}\n ";
1989 static const char __pyx_k_Maximum_absolute_value_of_coord[] =
"\n Maximum absolute value of coordinates multivector: multivector infinity-norm.\n\n >>> max_abs(clifford(\"1+{-1}+{1,2}+{1,2,3}\"))\n 1.0\n >>> max_abs(clifford(\"3+2{1}+{1,2}\"))\n 3.0\n\n ";
1990 static const char __pyx_k_Maximum_of_absolute_values_of_c[] =
"\n Maximum of absolute values of components of multivector: multivector infinity norm.\n\n >>> clifford(\"1+{-1}+{1,2}+{1,2,3}\").max_abs()\n 1.0\n >>> clifford(\"3+2{1}+{1,2}\").max_abs()\n 3.0\n ";
1991 static const char __pyx_k_Natural_logarithm_of_multivecto[] =
"\n Natural logarithm of multivector with optional complexifier.\n\n >>> x=clifford(\"{-1}\"); print (log(x,\"{-1}\") * 2/pi)\n {-1}\n >>> x=clifford(\"{1,2}\"); print (log(x,\"{1,2,3}\") * 2/pi)\n {1,2}\n >>> x=clifford(\"{1,2}\"); print (log(x) * 2/pi)\n {1,2}\n >>> x=clifford(\"{1,2}\"); print (log(x,\"{1,2}\") * 2/pi)\n Traceback (most recent call last):\n ...\n RuntimeError: check_complex(val, i): i is not a valid complexifier for val\n ";
1992 static const char __pyx_k_Norm_sum_of_squares_of_coordina[] =
"\n Norm == sum of squares of coordinates.\n\n >>> clifford(\"1+{1}+{1,2}\").norm()\n 3.0\n >>> clifford(\"1+{-1}+{1,2}+{1,2,3}\").norm()\n 4.0\n ";
1993 static const char __pyx_k_Not_applicable_for_a_in_cliffor[] =
"\n Not applicable.\n\n >>> for a in clifford(index_set({-3,4,7})): print a,\n Traceback (most recent call last):\n ...\n TypeError: Not applicable.\n ";
1994 static const char __pyx_k_Number_of_negative_indices_incl[] =
"\n Number of negative indices included in set.\n\n >>> index_set({-1,1,2}).count_neg()\n 1\n ";
1995 static const char __pyx_k_Number_of_positive_indices_incl[] =
"\n Number of positive indices included in set.\n\n >>> index_set({-1,1,2}).count_pos()\n 2\n ";
1996 static const char __pyx_k_Outer_product_power_of_multivec[] =
"\n Outer product power of multivector.\n\n >>> print outer_pow(clifford(\"1+{1}+{1,2}\"),3)\n 1+3{1}+3{1,2}\n ";
1997 static const char __pyx_k_Outer_product_x_clifford_1_x_cl[] =
"\n Outer product.\n\n >>> x = clifford(\"{1}\"); x ^= clifford(\"{2}\"); print x\n {1,2}\n >>> x = clifford(2); x ^= clifford(\"{2}\"); print x\n 2{2}\n >>> x = clifford(\"{1}\"); x ^= clifford(\"{1}\"); print x\n 0\n >>> x = clifford(\"{1}\"); x ^= clifford(\"{1,2}\"); print x\n 0\n ";
1998 static const char __pyx_k_Pure_grade_vector_part_print_cl[] =
"\n Pure grade-vector part.\n\n >>> print clifford(\"{1}\")(1)\n {1}\n >>> print clifford(\"{1}\")(0)\n 0\n >>> print clifford(\"1+{1}+{1,2}\")(0)\n 1\n >>> print clifford(\"1+{1}+{1,2}\")(1)\n {1}\n >>> print clifford(\"1+{1}+{1,2}\")(2)\n {1,2}\n >>> print clifford(\"1+{1}+{1,2}\")(3)\n 0\n ";
1999 static const char __pyx_k_Pure_part_print_pure_clifford_1[] =
"\n Pure part\n\n >>> print pure(clifford(\"1+{1}+{1,2}\"))\n {1}+{1,2}\n >>> print pure(clifford(\"{1,2}\"))\n {1,2}\n ";
2000 static const char __pyx_k_Put_self_into_a_larger_frame_co[] =
"\n Put self into a larger frame, containing the union of self.frame() and index set ixt.\n This can be used to make multiplication faster, by multiplying within a common frame.\n\n >>> clifford(\"2+3{1}\").reframe(index_set({1,2,3}))\n clifford(\"2+3{1}\")\n >>> s=index_set({1,2,3});t=index_set({-3,-2,-1});x=random_clifford(s); x.reframe(t).frame() == (s|t);\n True\n ";
2001 static const char __pyx_k_Random_multivector_within_a_fra[] =
"\n Random multivector within a frame.\n\n >>> print random_clifford(index_set({-3,-1,2})).frame()\n {-3,-1,2}\n ";
2002 static const char __pyx_k_Real_part_synonym_for_scalar_pa[] =
"\n Real part: synonym for scalar part.\n\n >>> real(clifford(\"1+{1}+{1,2}\"))\n 1.0\n >>> real(clifford(\"{1,2}\"))\n 0.0\n ";
2003 static const char __pyx_k_Remove_all_terms_of_self_with_r[] =
"\n Remove all terms of self with relative size smaller than limit.\n\n >>> clifford(\"1e8+{1}+1e-8{1,2}\").truncated(1.0e-6)\n clifford(\"100000000\")\n >>> clifford(\"1e4+{1}+1e-4{1,2}\").truncated(1.0e-6)\n clifford(\"10000+{1}\")\n ";
2004 static const char __pyx_k_Reversion_eg_1_2_2_1_print_reve[] =
"\n Reversion, eg. {1}*{2} -> {2}*{1}\n\n >>> print reverse(clifford(\"{1}\"))\n {1}\n >>> print reverse(clifford(\"{2}\") * clifford(\"{1}\"))\n {1,2}\n >>> print reverse(clifford(\"{1}\") * clifford(\"{2}\"))\n -{1,2}\n >>> print reverse(clifford(\"1+{1}+{1,2}\"))\n 1+{1}-{1,2}\n ";
2005 static const char __pyx_k_Reversion_eg_clifford_1_cliffor[] =
"\n Reversion, eg. clifford(\"{1}\")*clifford(\"{2}\") -> clifford(\"{2}\")*clifford(\"{1}\").\n\n >>> print clifford(\"{1}\").reverse()\n {1}\n >>> print (clifford(\"{2}\") * clifford(\"{1}\")).reverse()\n {1,2}\n >>> print (clifford(\"{1}\") * clifford(\"{2}\")).reverse()\n -{1,2}\n >>> print clifford(\"1+{1}+{1,2}\").reverse()\n 1+{1}-{1,2}\n ";
2006 static const char __pyx_k_Scalar_part_clifford_1_1_1_2_sc[] =
"\n Scalar part.\n\n >>> clifford(\"1+{1}+{1,2}\").scalar()\n 1.0\n >>> clifford(\"{1,2}\").scalar()\n 0.0\n ";
2007 static const char __pyx_k_Scalar_part_scalar_clifford_1_1[] =
"\n Scalar part.\n\n >>> scalar(clifford(\"1+{1}+{1,2}\"))\n 1.0\n >>> scalar(clifford(\"{1,2}\"))\n 0.0\n ";
2008 static const char __pyx_k_Set_intersection_and_print_inde[] =
"\n Set intersection: and.\n\n >>> print index_set({1}) & index_set({2})\n {}\n >>> print index_set({1,2}) & index_set({2})\n {2}\n ";
2009 static const char __pyx_k_Set_intersection_and_x_index_se[] =
"\n Set intersection: and.\n\n >>> x = index_set({1}); x &= index_set({2}); print x\n {}\n >>> x = index_set({1,2}); x &= index_set({2}); print x\n {2}\n ";
2010 static const char __pyx_k_Set_the_value_of_an_index_set_o[] =
"\n Set the value of an index_set object at index idx to value val.\n\n >>> s=index_set({1}); s[2] = True; print s\n {1,2}\n >>> s=index_set({1,2}); s[1] = False; print s\n {2}\n ";
2011 static const char __pyx_k_Set_union_or_x_index_set_1_x_in[] =
"\n Set union: or.\n\n >>> x = index_set({1}); x |= index_set({2}); print x\n {1,2}\n >>> x = index_set({1,2}); x |= index_set({2}); print x\n {1,2}\n ";
2012 static const char __pyx_k_Sign_of_geometric_product_of_tw[] =
"\n Sign of geometric product of two Clifford basis elements.\n\n >>> s = index_set({1,2}); t=index_set({-1}); s.sign_of_mult(t)\n 1\n ";
2013 static const char __pyx_k_Sign_of_geometric_square_of_a_C[] =
"\n Sign of geometric square of a Clifford basis element.\n\n >>> s = index_set({1,2}); s.sign_of_square()\n -1\n ";
2014 static const char __pyx_k_Sine_of_multivector_with_option[] =
"\n Sine of multivector with optional complexifier.\n\n >>> s=\"{-1}\"; x=clifford(s); print asin(sin(x,s),s)\n {-1}\n >>> s=\"{-1}\"; x=clifford(s); print asin(sin(x,s),\"{-2,-1,1}\")\n {-1}\n >>> x=clifford(\"{1,2,3}\"); print asin(sin(x))\n {1,2,3}\n ";
2015 static const char __pyx_k_Square_root_of_1_which_commutes[] =
"\n Square root of -1 which commutes with all members of the frame of the given multivector.\n\n >>> print complexifier(clifford(index_set({1})))\n {1,2,3}\n >>> print complexifier(clifford(index_set({-1})))\n {-1}\n >>> print complexifier(index_set({1}))\n {1,2,3}\n >>> print complexifier(index_set({-1}))\n {-1}\n ";
2016 static const char __pyx_k_Square_root_of_multivector_with[] =
"\n Square root of multivector with optional complexifier.\n\n >>> print sqrt(-1)\n {-1}\n >>> print sqrt(clifford(\"2{-1}\"))\n 1+{-1}\n >>> j=sqrt(-1,complexifier(index_set({1}))); print j; print j*j\n {1,2,3}\n -1\n >>> j=sqrt(-1,\"{1,2,3}\"); print j; print j*j\n {1,2,3}\n -1\n ";
2017 static const char __pyx_k_Subalgebra_generated_by_all_gen[] =
"\n Subalgebra generated by all generators of terms of given multivector.\n\n >>> print clifford(\"1+3{-1}+2{1,2}+4{-2,7}\").frame()\n {-2,-1,1,2,7}\n >>> s=clifford(\"1+3{-1}+2{1,2}+4{-2,7}\").frame(); type(s)\n <type 'PyClical.index_set'>\n ";
2018 static const char __pyx_k_Subscripting_map_from_index_set[] =
"\n Subscripting: map from index set to scalar coordinate.\n\n >>> clifford(\"{1}\")[index_set(1)]\n 1.0\n >>> clifford(\"{1}\")[index_set({1})]\n 1.0\n >>> clifford(\"{1}\")[index_set({1,2})]\n 0.0\n >>> clifford(\"2{1,2}\")[index_set({1,2})]\n 2.0\n ";
2019 static const char __pyx_k_Symmetric_set_difference_exclus[] =
"\n Symmetric set difference: exclusive or.\n\n >>> print index_set({1}) ^ index_set({2})\n {1,2}\n >>> print index_set({1,2}) ^ index_set({2})\n {1}\n ";
2020 static const char __pyx_k_Tangent_of_multivector_with_opt[] =
"\n Tangent of multivector with optional complexifier.\n\n >>> x=clifford(\"{1,2}\"); print tan(x,\"{1,2,3}\")\n 0.7616{1,2}\n >>> x=clifford(\"{1,2}\"); print tan(x)\n 0.7616{1,2}\n ";
2021 static const char __pyx_k_Tests_for_functions_that_Doctes[] =
"\n Tests for functions that Doctest cannot see.\n\n For index_set.__cinit__: Construct index_set.\n\n >>> print index_set(1)\n {1}\n >>> print index_set({1,2})\n {1,2}\n >>> print index_set(index_set({1,2}))\n {1,2}\n >>> print index_set({1,2})\n {1,2}\n >>> print index_set({1,2,1})\n {1,2}\n >>> print index_set({1,2,1})\n {1,2}\n >>> print index_set(\"\")\n {}\n >>> print index_set(\"{\")\n Traceback (most recent call last):\n ...\n ValueError: Cannot initialize index_set object from invalid string '{'.\n >>> print index_set(\"{1\")\n Traceback (most recent call last):\n ...\n ValueError: Cannot initialize index_set object from invalid string '{1'.\n >>> print index_set(\"{1,2,100}\")\n Traceback (most recent call last):\n ...\n ValueError: Cannot initialize index_set object from invalid string '{1,2,100}'.\n >>> print index_set({1,2,100})\n Traceback (most recent call last):\n ...\n IndexError: Cannot initialize index_set object from invalid set([1, 2, 100]).\n >>> print index_set([1,2])\n Traceback (most recent call last):\n ...\n TypeError: Cannot initialize index_set object from <type 'list'>.\n\n For index_set.__richcmp__: Compare two objects of class index_set.\n\n >>> index_set(1) == index_set({1})\n True\n >>> index_set({1}) != index_set({1})\n False\n >>> index_set({1}) != index_set({2})\n True\n >>> index_set({1}) == index_set({2})\n False\n >>> index_set({1}) < index_set({2})\n True\n >>> index_set({1}) <= index_set({2})\n True\n >>> index_set({1}) > index_set({2})\n False\n >>> index_set({1}) >= index_set({2})\n False\n >>> None == index_set({1,2})\n False\n >>> None != index_set({1,2})\n True\n >>> None < index_set({1,2})\n False\n >>> None <= index_set({1,2})\n False\n >>> None > index_set({1,2})\n False\n >>> None >= index_set({1,2})\n False\n >>> index_se""t({1,2}) == None\n False\n >>> index_set({1,2}) != None\n True\n >>> index_set({1,2}) < None\n False\n >>> index_set({1,2}) <= None\n False\n >>> index_set({1,2}) > None\n False\n >>> index_set({1,2}) >= None\n False\n ";
2022 static const char __pyx_k_The_informal_string_representat[] =
"\n The \342\200\234informal\342\200\235 string representation of self.\n\n >>> index_set({1,2}).__str__()\n '{1,2}'\n >>> str(index_set({1,2}))\n '{1,2}'\n ";
2023 static const char __pyx_k_The_official_string_representat[] =
"\n The \342\200\234official\342\200\235 string representation of self.\n\n >>> index_set({1,2}).__repr__()\n 'index_set({1,2})'\n >>> repr(index_set({1,2}))\n 'index_set({1,2})'\n ";
2024 static const char __pyx_k_This_comparison_operator_is_not[] =
"This comparison operator is not implemented for ";
2025 static const char __pyx_k_Vector_part_of_multivector_as_a[] =
"\n Vector part of multivector, as a Python list, with respect to frm.\n\n >>> print clifford(\"1+2{1}+3{2}+4{1,2}\").vector_part()\n [2.0, 3.0]\n >>> print clifford(\"1+2{1}+3{2}+4{1,2}\").vector_part(index_set({-1,1,2}))\n [0.0, 2.0, 3.0]\n ";
2026 static const char __pyx_k_index_set_sign_of_mult_line_364[] =
"index_set.sign_of_mult (line 364)";
2027 static const char __pyx_k_norm_sum_of_squares_of_coordina[] =
"\n norm == sum of squares of coordinates.\n\n >>> norm(clifford(\"1+{1}+{1,2}\"))\n 3.0\n >>> norm(clifford(\"1+{-1}+{1,2}+{1,2,3}\"))\n 4.0\n ";
2028 static const char __pyx_k_Cannot_initialize_clifford_objec[] =
"Cannot initialize clifford object from";
2029 static const char __pyx_k_Cannot_initialize_index_set_obje[] =
"Cannot initialize index_set object from";
2030 static const char __pyx_k_Conjugation_reverse_o_involute_2[] =
"\n Conjugation, reverse o involute == involute o reverse.\n\n >>> print conj(clifford(\"{1}\"))\n -{1}\n >>> print conj(clifford(\"{2}\") * clifford(\"{1}\"))\n {1,2}\n >>> print conj(clifford(\"{1}\") * clifford(\"{2}\"))\n -{1,2}\n >>> print conj(clifford(\"1+{1}+{1,2}\"))\n 1-{1}-{1,2}\n ";
2031 static const char __pyx_k_Odd_part_of_multivector_sum_of_2[] =
"\n Odd part of multivector, sum of odd grade terms.\n\n >>> print odd(clifford(\"1+{1}+{1,2}\"))\n {1}\n ";
2032 static const char __pyx_k_Power_self_to_the_m_x_clifford_2[] =
"\n Power: self to the m.\n\n >>> x=clifford(\"{1}\"); print x.pow(2)\n 1\n >>> x=clifford(\"2\"); print x.pow(2)\n 4\n >>> x=clifford(\"2+{1}\"); print x.pow(0)\n 1\n >>> x=clifford(\"2+{1}\"); print x.pow(1)\n 2+{1}\n >>> x=clifford(\"2+{1}\"); print x.pow(2)\n 5+4{1}\n >>> print clifford(\"1+{1}+{1,2}\").pow(3)\n 1+3{1}+3{1,2}\n >>> i=clifford(\"{1,2}\");print exp(pi/2) * i.pow(i)\n 1\n ";
2033 static const char __pyx_k_Quadratic_form_rev_x_x_0_print_2[] =
"\n Quadratic form == (rev(x)*x)(0).\n\n >>> print quad(clifford(\"1+{1}+{1,2}\"))\n 3.0\n >>> print quad(clifford(\"1+{-1}+{1,2}+{1,2,3}\"))\n 2.0\n ";
2034 static const char __pyx_k_Transform_left_hand_side_using_2[] =
"\n Transform left hand side, using right hand side as a transformation.\n\n >>> x=clifford(\"{1,2}\") * pi/2; y=clifford(\"{1}\"); y|=x; print y\n -{1}\n >>> x=clifford(\"{1,2}\") * pi/2; y=clifford(\"{1}\"); y|=exp(x); print y\n -{1}\n ";
2035 static const char __pyx_k_clifford_hidden_doctests_line_12[] =
"clifford_hidden_doctests (line 1243)";
2036 static const char __pyx_k_index_set_hidden_doctests_line_4[] =
"index_set_hidden_doctests (line 404)";
2037 static const char __pyx_k_index_set_sign_of_square_line_37[] =
"index_set.sign_of_square (line 373)";
2038 static const char __pyx_k_no_default___reduce___due_to_non[] =
"no default __reduce__ due to non-trivial __cinit__";
2039 static const char __pyx_k_Even_part_of_multivector_sum_of_2[] =
"\n Even part of multivector, sum of even grade terms.\n\n >>> print even(clifford(\"1+{1}+{1,2}\"))\n 1+{1,2}\n ";
2040 static const char __pyx_k_Geometric_multiplicative_invers_2[] =
"\n Geometric multiplicative inverse.\n\n >>> print inv(clifford(\"{1}\"))\n {1}\n >>> print inv(clifford(\"{-1}\"))\n -{-1}\n >>> print inv(clifford(\"{-2,-1}\"))\n -{-2,-1}\n >>> print inv(clifford(\"{-1}+{1}\"))\n nan\n ";
2041 static const char __pyx_k_Main_involution_each_i_is_repla_2[] =
"\n Main involution, each {i} is replaced by -{i} in each term, eg. {1}*{2} -> (-{2})*(-{1})\n\n >>> print involute(clifford(\"{1}\"))\n -{1}\n >>> print involute(clifford(\"{2}\") * clifford(\"{1}\"))\n -{1,2}\n >>> print involute(clifford(\"{1}\") * clifford(\"{2}\"))\n {1,2}\n >>> print involute(clifford(\"1+{1}+{1,2}\"))\n 1-{1}+{1,2}\n ";
2042 static const char __pyx_k_Symmetric_set_difference_exclus_2[] =
"\n Symmetric set difference: exclusive or.\n\n >>> x = index_set({1}); x ^= index_set({2}); print x\n {1,2}\n >>> x = index_set({1,2}); x ^= index_set({2}); print x\n {1}\n ";
2043 static const char __pyx_k_Tests_for_functions_that_Doctes_2[] =
"\n Tests for functions that Doctest cannot see.\n\n For clifford.__cinit__: Construct an object of type clifford.\n\n >>> print clifford(2)\n 2\n >>> print clifford(2L)\n 2\n >>> print clifford(2.0)\n 2\n >>> print clifford(1.0e-1)\n 0.1\n >>> print clifford(\"2\")\n 2\n >>> print clifford(\"2{1,2,3}\")\n 2{1,2,3}\n >>> print clifford(clifford(\"2{1,2,3}\"))\n 2{1,2,3}\n >>> print clifford(\"-{1}\")\n -{1}\n >>> print clifford(2,index_set({1,2}))\n 2{1,2}\n >>> print clifford([2,3],index_set({1,2}))\n 2{1}+3{2}\n >>> print clifford([1,2])\n Traceback (most recent call last):\n ...\n TypeError: Cannot initialize clifford object from <type 'list'>.\n >>> print clifford(None)\n Traceback (most recent call last):\n ...\n TypeError: Cannot initialize clifford object from <type 'NoneType'>.\n >>> print clifford(None,[1,2])\n Traceback (most recent call last):\n ...\n TypeError: Cannot initialize clifford object from (<type 'NoneType'>, <type 'list'>).\n >>> print clifford([1,2],[1,2])\n Traceback (most recent call last):\n ...\n TypeError: Cannot initialize clifford object from (<type 'list'>, <type 'list'>).\n >>> print clifford(\"\")\n Traceback (most recent call last):\n ...\n ValueError: Cannot initialize clifford object from invalid string ''.\n >>> print clifford(\"{\")\n Traceback (most recent call last):\n ...\n ValueError: Cannot initialize clifford object from invalid string '{'.\n >>> print clifford(\"{1\")\n Traceback (most recent call last):\n ...\n ValueError: Cannot initialize clifford object from invalid string '{1'.\n >>> print clifford(\"+\")\n Traceback (most recent call last):\n ...\n ValueError: Cannot initialize clifford object from invalid string '+'.\n >>> print clifford(\"-\")\n Traceback (most recent call last):\n ...\n ValueError: Cannot initialize clifford"" object from invalid string '-'.\n >>> print clifford(\"{1}+\")\n Traceback (most recent call last):\n ...\n ValueError: Cannot initialize clifford object from invalid string '{1}+'.\n\n For clifford.__richcmp__: Compare objects of type clifford.\n\n >>> clifford(\"{1}\") == clifford(\"1{1}\")\n True\n >>> clifford(\"{1}\") != clifford(\"1.0{1}\")\n False\n >>> clifford(\"{1}\") != clifford(\"1.0\")\n True\n >>> clifford(\"{1,2}\") == None\n False\n >>> clifford(\"{1,2}\") != None\n True\n >>> None == clifford(\"{1,2}\")\n False\n >>> None != clifford(\"{1,2}\")\n True\n ";
2044 static const char __pyx_k_The_informal_string_representat_2[] =
"\n The \342\200\234informal\342\200\235 string representation of self.\n\n >>> clifford(\"1+3{-1}+2{1,2}+4{-2,7}\").__str__()\n '1+3{-1}+2{1,2}+4{-2,7}'\n ";
2045 static const char __pyx_k_The_official_string_representat_2[] =
"\n The \342\200\234official\342\200\235 string representation of self.\n\n >>> clifford(\"1+3{-1}+2{1,2}+4{-2,7}\").__repr__()\n 'clifford(\"1+3{-1}+2{1,2}+4{-2,7}\")'\n ";
2046 static PyObject *__pyx_kp_s_;
2047 static PyObject *__pyx_kp_s_0_8_2;
2048 static PyObject *__pyx_kp_u_Abbreviation_for_clifford_index;
2049 static PyObject *__pyx_kp_u_Abbreviation_for_index_set_q_p;
2050 static PyObject *__pyx_kp_u_Absolute_value_of_multivector_m;
2051 static PyObject *__pyx_kp_u_Absolute_value_square_root_of_n;
2052 static PyObject *__pyx_kp_s_Cannot_initialize_clifford_objec;
2053 static PyObject *__pyx_kp_s_Cannot_initialize_index_set_obje;
2054 static PyObject *__pyx_kp_s_Cannot_reframe;
2055 static PyObject *__pyx_kp_s_Cannot_take_vector_part_of;
2056 static PyObject *__pyx_kp_u_Cardinality_Number_of_indices_i;
2057 static PyObject *__pyx_kp_u_Check_if_a_multivector_contains;
2058 static PyObject *__pyx_kp_u_Conjugation_reverse_o_involute;
2059 static PyObject *__pyx_kp_u_Conjugation_reverse_o_involute_2;
2060 static PyObject *__pyx_kp_u_Contraction_print_clifford_1_cl;
2061 static PyObject *__pyx_kp_u_Contraction_x_clifford_1_x_clif;
2062 static PyObject *__pyx_kp_u_Convert_CGA3_null_vector_to_Euc;
2063 static PyObject *__pyx_kp_u_Convert_CGA3_null_vector_to_sta;
2064 static PyObject *__pyx_kp_u_Convert_Euclidean_3D_multivecto;
2065 static PyObject *__pyx_kp_u_Copy_this_clifford_object_x_cli;
2066 static PyObject *__pyx_kp_u_Copy_this_index_set_object_s_in;
2067 static PyObject *__pyx_kp_u_Cosine_of_multivector_with_opti;
2068 static PyObject *__pyx_kp_u_Even_part_of_multivector_sum_of;
2069 static PyObject *__pyx_kp_u_Even_part_of_multivector_sum_of_2;
2070 static PyObject *__pyx_kp_u_Exponential_of_multivector_x_cl;
2071 static PyObject *__pyx_kp_u_Geometric_difference_print_clif;
2072 static PyObject *__pyx_kp_u_Geometric_difference_x_clifford;
2073 static PyObject *__pyx_kp_u_Geometric_multiplicative_invers;
2074 static PyObject *__pyx_kp_u_Geometric_multiplicative_invers_2;
2075 static PyObject *__pyx_kp_u_Geometric_product_print_cliffor;
2076 static PyObject *__pyx_kp_u_Geometric_product_x_clifford_2;
2077 static PyObject *__pyx_kp_u_Geometric_quotient_print_cliffo;
2078 static PyObject *__pyx_kp_u_Geometric_quotient_x_clifford_1;
2079 static PyObject *__pyx_kp_u_Geometric_sum_print_clifford_1;
2080 static PyObject *__pyx_kp_u_Geometric_sum_x_clifford_1_x_cl;
2081 static PyObject *__pyx_kp_u_Get_the_value_of_an_index_set_o;
2082 static PyObject *__pyx_kp_u_Hyperbolic_cosine_of_multivecto;
2083 static PyObject *__pyx_kp_u_Hyperbolic_sine_of_multivector;
2084 static PyObject *__pyx_kp_u_Hyperbolic_tangent_of_multivect;
2085 static PyObject *__pyx_kp_u_Imaginary_part_deprecated_alway;
2086 static PyObject *__pyx_n_s_IndexError;
2087 static PyObject *__pyx_kp_u_Inner_product_print_clifford_1;
2088 static PyObject *__pyx_kp_u_Inner_product_x_clifford_1_x_cl;
2089 static PyObject *__pyx_kp_u_Integer_power_of_multivector_ob;
2090 static PyObject *__pyx_n_s_Integral;
2091 static PyObject *__pyx_kp_u_Inverse_cosine_of_multivector_w;
2092 static PyObject *__pyx_kp_u_Inverse_hyperbolic_cosine_of_mu;
2093 static PyObject *__pyx_kp_u_Inverse_hyperbolic_sine_of_mult;
2094 static PyObject *__pyx_kp_u_Inverse_hyperbolic_tangent_of_m;
2095 static PyObject *__pyx_kp_u_Inverse_sine_of_multivector_wit;
2096 static PyObject *__pyx_kp_u_Inverse_tangent_of_multivector;
2097 static PyObject *__pyx_kp_u_Iterate_over_the_indices_of_an;
2098 static PyObject *__pyx_kp_u_Main_involution_each_i_is_repla;
2099 static PyObject *__pyx_kp_u_Main_involution_each_i_is_repla_2;
2100 static PyObject *__pyx_kp_u_Maximum_absolute_value_of_coord;
2101 static PyObject *__pyx_kp_u_Maximum_member_index_set_1_1_2;
2102 static PyObject *__pyx_kp_u_Maximum_of_absolute_values_of_c;
2103 static PyObject *__pyx_kp_u_Maximum_positive_index_or_0_if;
2104 static PyObject *__pyx_kp_u_Minimum_member_index_set_1_1_2;
2105 static PyObject *__pyx_kp_u_Minimum_negative_index_or_0_if;
2106 static PyObject *__pyx_kp_u_Natural_logarithm_of_multivecto;
2107 static PyObject *__pyx_kp_u_Norm_sum_of_squares_of_coordina;
2108 static PyObject *__pyx_n_s_NotImplemented;
2109 static PyObject *__pyx_kp_s_Not_applicable;
2110 static PyObject *__pyx_kp_u_Not_applicable_for_a_in_cliffor;
2111 static PyObject *__pyx_kp_u_Number_of_negative_indices_incl;
2112 static PyObject *__pyx_kp_u_Number_of_positive_indices_incl;
2113 static PyObject *__pyx_kp_u_Odd_part_of_multivector_sum_of;
2114 static PyObject *__pyx_kp_u_Odd_part_of_multivector_sum_of_2;
2115 static PyObject *__pyx_kp_u_Outer_product_power_of_multivec;
2116 static PyObject *__pyx_kp_u_Outer_product_power_x_clifford;
2117 static PyObject *__pyx_kp_u_Outer_product_print_clifford_1;
2118 static PyObject *__pyx_kp_u_Outer_product_x_clifford_1_x_cl;
2119 static PyObject *__pyx_kp_u_Power_self_to_the_m_x_clifford;
2120 static PyObject *__pyx_kp_u_Power_self_to_the_m_x_clifford_2;
2121 static PyObject *__pyx_kp_u_Pure_grade_vector_part_print_cl;
2122 static PyObject *__pyx_kp_u_Pure_part_print_clifford_1_1_1;
2123 static PyObject *__pyx_kp_u_Pure_part_print_pure_clifford_1;
2124 static PyObject *__pyx_kp_u_Put_self_into_a_larger_frame_co;
2125 static PyObject *__pyx_n_s_PyClical;
2126 static PyObject *__pyx_kp_s_PyClical_pyx;
2127 static PyObject *__pyx_kp_u_Quadratic_form_rev_x_x_0_print;
2128 static PyObject *__pyx_kp_u_Quadratic_form_rev_x_x_0_print_2;
2129 static PyObject *__pyx_kp_u_Random_multivector_within_a_fra;
2130 static PyObject *__pyx_n_s_Real;
2131 static PyObject *__pyx_kp_u_Real_part_synonym_for_scalar_pa;
2132 static PyObject *__pyx_kp_u_Remove_all_terms_of_self_with_r;
2133 static PyObject *__pyx_kp_u_Reversion_eg_1_2_2_1_print_reve;
2134 static PyObject *__pyx_kp_u_Reversion_eg_clifford_1_cliffor;
2135 static PyObject *__pyx_n_s_RuntimeError;
2136 static PyObject *__pyx_kp_u_Scalar_part_clifford_1_1_1_2_sc;
2137 static PyObject *__pyx_kp_u_Scalar_part_scalar_clifford_1_1;
2138 static PyObject *__pyx_n_s_Sequence;
2139 static PyObject *__pyx_kp_u_Set_complement_not_print_index;
2140 static PyObject *__pyx_kp_u_Set_intersection_and_print_inde;
2141 static PyObject *__pyx_kp_u_Set_intersection_and_x_index_se;
2142 static PyObject *__pyx_kp_u_Set_the_value_of_an_index_set_o;
2143 static PyObject *__pyx_kp_u_Set_union_or_print_index_set_1;
2144 static PyObject *__pyx_kp_u_Set_union_or_x_index_set_1_x_in;
2145 static PyObject *__pyx_kp_u_Sign_of_geometric_product_of_tw;
2146 static PyObject *__pyx_kp_u_Sign_of_geometric_square_of_a_C;
2147 static PyObject *__pyx_kp_u_Sine_of_multivector_with_option;
2148 static PyObject *__pyx_kp_u_Square_root_of_1_which_commutes;
2149 static PyObject *__pyx_kp_u_Square_root_of_multivector_with;
2150 static PyObject *__pyx_kp_u_Subalgebra_generated_by_all_gen;
2151 static PyObject *__pyx_kp_u_Subscripting_map_from_index_set;
2152 static PyObject *__pyx_kp_u_Symmetric_set_difference_exclus;
2153 static PyObject *__pyx_kp_u_Symmetric_set_difference_exclus_2;
2154 static PyObject *__pyx_kp_u_Tangent_of_multivector_with_opt;
2155 static PyObject *__pyx_kp_u_Tests_for_functions_that_Doctes;
2156 static PyObject *__pyx_kp_u_Tests_for_functions_that_Doctes_2;
2157 static PyObject *__pyx_kp_u_The_informal_string_representat;
2158 static PyObject *__pyx_kp_u_The_informal_string_representat_2;
2159 static PyObject *__pyx_kp_u_The_official_string_representat;
2160 static PyObject *__pyx_kp_u_The_official_string_representat_2;
2161 static PyObject *__pyx_kp_s_This_comparison_operator_is_not;
2162 static PyObject *__pyx_kp_u_Transform_left_hand_side_using;
2163 static PyObject *__pyx_kp_u_Transform_left_hand_side_using_2;
2164 static PyObject *__pyx_n_s_TypeError;
2165 static PyObject *__pyx_kp_u_Unary_print_clifford_1_1;
2166 static PyObject *__pyx_kp_u_Unary_print_clifford_1_1_2;
2167 static PyObject *__pyx_n_s_ValueError;
2168 static PyObject *__pyx_kp_u_Vector_part_of_multivector_as_a;
2169 static PyObject *__pyx_kp_s__2;
2170 static PyObject *__pyx_kp_s__5;
2171 static PyObject *__pyx_kp_s__6;
2172 static PyObject *__pyx_kp_s__7;
2173 static PyObject *__pyx_kp_s__8;
2174 static PyObject *__pyx_kp_s__9;
2175 static PyObject *__pyx_kp_u_abs_line_1473;
2176 static PyObject *__pyx_n_s_acos;
2177 static PyObject *__pyx_kp_u_acos_line_1619;
2178 static PyObject *__pyx_n_s_acosh;
2179 static PyObject *__pyx_kp_u_acosh_line_1656;
2180 static PyObject *__pyx_kp_u_agc3_line_1844;
2181 static PyObject *__pyx_n_s_args;
2182 static PyObject *__pyx_kp_s_as_frame;
2183 static PyObject *__pyx_n_s_asin;
2184 static PyObject *__pyx_kp_u_asin_line_1698;
2185 static PyObject *__pyx_n_s_asinh;
2186 static PyObject *__pyx_kp_u_asinh_line_1733;
2187 static PyObject *__pyx_n_s_atan;
2188 static PyObject *__pyx_kp_u_atan_line_1769;
2189 static PyObject *__pyx_n_s_atanh;
2190 static PyObject *__pyx_kp_u_atanh_line_1798;
2191 static PyObject *__pyx_kp_u_cga3_line_1824;
2192 static PyObject *__pyx_kp_u_cga3std_line_1833;
2193 static PyObject *__pyx_n_s_cl;
2194 static PyObject *__pyx_n_s_clifford;
2195 static PyObject *__pyx_kp_u_clifford___add___line_739;
2196 static PyObject *__pyx_kp_u_clifford___and___line_835;
2197 static PyObject *__pyx_kp_u_clifford___call___line_1019;
2198 static PyObject *__pyx_kp_u_clifford___div___line_895;
2199 static PyObject *__pyx_kp_u_clifford___getitem___line_706;
2200 static PyObject *__pyx_kp_u_clifford___iadd___line_750;
2201 static PyObject *__pyx_kp_u_clifford___iand___line_850;
2202 static PyObject *__pyx_kp_u_clifford___idiv___line_910;
2203 static PyObject *__pyx_kp_u_clifford___imod___line_820;
2204 static PyObject *__pyx_kp_u_clifford___imul___line_792;
2205 static PyObject *__pyx_kp_u_clifford___ior___line_949;
2206 static PyObject *__pyx_kp_u_clifford___isub___line_770;
2207 static PyObject *__pyx_kp_u_clifford___iter___line_637;
2208 static PyObject *__pyx_kp_u_clifford___ixor___line_880;
2209 static PyObject *__pyx_kp_u_clifford___mod___line_805;
2210 static PyObject *__pyx_kp_u_clifford___mul___line_779;
2211 static PyObject *__pyx_kp_u_clifford___neg___line_721;
2212 static PyObject *__pyx_kp_u_clifford___or___line_938;
2213 static PyObject *__pyx_kp_u_clifford___pos___line_730;
2214 static PyObject *__pyx_kp_u_clifford___pow___line_960;
2215 static PyObject *__pyx_kp_u_clifford___repr___line_1225;
2216 static PyObject *__pyx_kp_u_clifford___str___line_1234;
2217 static PyObject *__pyx_kp_u_clifford___sub___line_759;
2218 static PyObject *__pyx_kp_u_clifford___xor___line_865;
2219 static PyObject *__pyx_kp_u_clifford_abs_line_1174;
2220 static PyObject *__pyx_kp_u_clifford_conj_line_1137;
2221 static PyObject *__pyx_kp_u_clifford_copy_line_554;
2222 static PyObject *__pyx_kp_u_clifford_even_line_1060;
2223 static PyObject *__pyx_kp_u_clifford_frame_line_1214;
2224 static PyObject *__pyx_n_s_clifford_hidden_doctests;
2225 static PyObject *__pyx_kp_u_clifford_hidden_doctests_line_12;
2226 static PyObject *__pyx_kp_u_clifford_inv_line_925;
2227 static PyObject *__pyx_kp_u_clifford_involute_line_1106;
2228 static PyObject *__pyx_kp_u_clifford_isnan_line_1205;
2229 static PyObject *__pyx_kp_u_clifford_max_abs_line_1183;
2230 static PyObject *__pyx_kp_u_clifford_norm_line_1163;
2231 static PyObject *__pyx_kp_u_clifford_odd_line_1069;
2232 static PyObject *__pyx_kp_u_clifford_outer_pow_line_1003;
2233 static PyObject *__pyx_kp_u_clifford_pow_line_979;
2234 static PyObject *__pyx_kp_u_clifford_pure_line_1049;
2235 static PyObject *__pyx_kp_u_clifford_quad_line_1152;
2236 static PyObject *__pyx_kp_u_clifford_reframe_line_648;
2237 static PyObject *__pyx_kp_u_clifford_reverse_line_1122;
2238 static PyObject *__pyx_kp_u_clifford_scalar_line_1038;
2239 static PyObject *__pyx_kp_u_clifford_truncated_line_1194;
2240 static PyObject *__pyx_kp_u_clifford_vector_part_line_1078;
2241 static PyObject *__pyx_n_s_cline_in_traceback;
2242 static PyObject *__pyx_n_s_close;
2243 static PyObject *__pyx_n_s_collections;
2244 static PyObject *__pyx_kp_u_compare_line_490;
2245 static PyObject *__pyx_kp_u_complexifier_line_1527;
2246 static PyObject *__pyx_n_s_conj;
2247 static PyObject *__pyx_kp_u_conj_line_1436;
2248 static PyObject *__pyx_n_s_copy;
2249 static PyObject *__pyx_n_s_cos;
2250 static PyObject *__pyx_kp_u_cos_line_1602;
2251 static PyObject *__pyx_n_s_cosh;
2252 static PyObject *__pyx_kp_u_cosh_line_1640;
2253 static PyObject *__pyx_n_s_doctest;
2254 static PyObject *__pyx_n_s_e;
2255 static PyObject *__pyx_kp_u_e_line_1887;
2256 static PyObject *__pyx_n_s_even;
2257 static PyObject *__pyx_kp_u_even_line_1388;
2258 static PyObject *__pyx_n_s_exp;
2259 static PyObject *__pyx_kp_u_exp_line_1565;
2260 static PyObject *__pyx_n_s_fill;
2261 static PyObject *__pyx_n_s_frm;
2262 static PyObject *__pyx_kp_s_from;
2263 static PyObject *__pyx_n_s_getstate;
2264 static PyObject *__pyx_n_s_grade;
2265 static PyObject *__pyx_n_s_i;
2266 static PyObject *__pyx_kp_u_imag_line_1366;
2267 static PyObject *__pyx_n_s_import;
2268 static PyObject *__pyx_n_s_index_set;
2269 static PyObject *__pyx_kp_u_index_set___and___line_269;
2270 static PyObject *__pyx_kp_u_index_set___getitem___line_189;
2271 static PyObject *__pyx_kp_u_index_set___iand___line_280;
2272 static PyObject *__pyx_kp_u_index_set___invert___line_238;
2273 static PyObject *__pyx_kp_u_index_set___ior___line_302;
2274 static PyObject *__pyx_n_s_index_set___iter;
2275 static PyObject *__pyx_kp_u_index_set___iter___line_227;
2276 static PyObject *__pyx_kp_u_index_set___ixor___line_258;
2277 static PyObject *__pyx_kp_u_index_set___or___line_291;
2278 static PyObject *__pyx_kp_u_index_set___repr___line_382;
2279 static PyObject *__pyx_kp_u_index_set___setitem___line_177;
2280 static PyObject *__pyx_kp_u_index_set___str___line_393;
2281 static PyObject *__pyx_kp_u_index_set___xor___line_247;
2282 static PyObject *__pyx_kp_u_index_set_copy_line_64;
2283 static PyObject *__pyx_kp_u_index_set_count_line_313;
2284 static PyObject *__pyx_kp_u_index_set_count_neg_line_322;
2285 static PyObject *__pyx_kp_u_index_set_count_pos_line_331;
2286 static PyObject *__pyx_n_s_index_set_hidden_doctests;
2287 static PyObject *__pyx_kp_u_index_set_hidden_doctests_line_4;
2288 static PyObject *__pyx_kp_u_index_set_max_line_349;
2289 static PyObject *__pyx_kp_u_index_set_min_line_340;
2290 static PyObject *__pyx_kp_u_index_set_sign_of_mult_line_364;
2291 static PyObject *__pyx_kp_u_index_set_sign_of_square_line_37;
2292 static PyObject *__pyx_n_s_inv;
2293 static PyObject *__pyx_kp_u_inv_line_1329;
2294 static PyObject *__pyx_kp_s_invalid;
2295 static PyObject *__pyx_kp_s_invalid_string;
2296 static PyObject *__pyx_n_s_involute;
2297 static PyObject *__pyx_kp_u_involute_line_1406;
2298 static PyObject *__pyx_n_s_ist;
2299 static PyObject *__pyx_n_s_istpq;
2300 static PyObject *__pyx_kp_u_istpq_line_1900;
2301 static PyObject *__pyx_n_s_iter;
2302 static PyObject *__pyx_n_s_ixt;
2303 static PyObject *__pyx_kp_u_lexicographic_compare_eg_3_4_5;
2304 static PyObject *__pyx_n_s_lhs;
2305 static PyObject *__pyx_n_s_log;
2306 static PyObject *__pyx_kp_u_log_line_1579;
2307 static PyObject *__pyx_n_s_m;
2308 static PyObject *__pyx_n_s_main;
2309 static PyObject *__pyx_n_s_math;
2310 static PyObject *__pyx_n_s_max;
2311 static PyObject *__pyx_kp_u_max_abs_line_1482;
2312 static PyObject *__pyx_kp_u_max_pos_line_511;
2313 static PyObject *__pyx_n_s_min;
2314 static PyObject *__pyx_kp_u_min_neg_line_502;
2315 static PyObject *__pyx_n_s_name;
2316 static PyObject *__pyx_n_s_nbar3;
2317 static PyObject *__pyx_n_s_ninf3;
2318 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2319 static PyObject *__pyx_n_s_norm;
2320 static PyObject *__pyx_kp_u_norm_line_1462;
2321 static PyObject *__pyx_kp_u_norm_sum_of_squares_of_coordina;
2322 static PyObject *__pyx_n_s_numbers;
2323 static PyObject *__pyx_n_s_obj;
2324 static PyObject *__pyx_n_s_odd;
2325 static PyObject *__pyx_kp_u_odd_line_1397;
2326 static PyObject *__pyx_n_s_other;
2327 static PyObject *__pyx_n_s_outer_pow;
2328 static PyObject *__pyx_kp_u_outer_pow_line_1518;
2329 static PyObject *__pyx_n_s_p;
2330 static PyObject *__pyx_n_s_pi;
2331 static PyObject *__pyx_n_s_pow;
2332 static PyObject *__pyx_kp_u_pow_line_1494;
2333 static PyObject *__pyx_n_s_pure;
2334 static PyObject *__pyx_kp_u_pure_line_1377;
2335 static PyObject *__pyx_n_s_pyx_vtable;
2336 static PyObject *__pyx_n_s_q;
2337 static PyObject *__pyx_n_s_quad;
2338 static PyObject *__pyx_kp_u_quad_line_1451;
2339 static PyObject *__pyx_kp_u_random_clifford_line_1815;
2340 static PyObject *__pyx_n_s_range;
2341 static PyObject *__pyx_kp_u_real_line_1355;
2342 static PyObject *__pyx_n_s_reduce;
2343 static PyObject *__pyx_n_s_reduce_cython;
2344 static PyObject *__pyx_n_s_reduce_ex;
2345 static PyObject *__pyx_n_s_reverse;
2346 static PyObject *__pyx_kp_u_reverse_line_1421;
2347 static PyObject *__pyx_n_s_rhs;
2348 static PyObject *__pyx_n_s_scalar;
2349 static PyObject *__pyx_kp_u_scalar_line_1344;
2350 static PyObject *__pyx_n_s_send;
2351 static PyObject *__pyx_n_s_setstate;
2352 static PyObject *__pyx_n_s_setstate_cython;
2353 static PyObject *__pyx_n_s_sin;
2354 static PyObject *__pyx_kp_u_sin_line_1679;
2355 static PyObject *__pyx_n_s_sinh;
2356 static PyObject *__pyx_kp_u_sinh_line_1719;
2357 static PyObject *__pyx_n_s_sqrt;
2358 static PyObject *__pyx_kp_u_sqrt_line_1542;
2359 static PyObject *__pyx_n_s_tan;
2360 static PyObject *__pyx_kp_u_tan_line_1752;
2361 static PyObject *__pyx_n_s_tanh;
2362 static PyObject *__pyx_kp_u_tanh_line_1786;
2363 static PyObject *__pyx_n_s_tau;
2364 static PyObject *__pyx_n_s_test;
2365 static PyObject *__pyx_n_s_test_2;
2366 static PyObject *__pyx_n_s_testmod;
2367 static PyObject *__pyx_n_s_throw;
2368 static PyObject *__pyx_kp_s_to_frame;
2369 static PyObject *__pyx_kp_s_using;
2370 static PyObject *__pyx_kp_s_using_invalid;
2371 static PyObject *__pyx_kp_s_value;
2372 static PyObject *__pyx_n_s_version;
2373 static PyObject *__pyx_n_s_xrange;
2374 static PyObject *__pyx_pf_8PyClical_9index_set_copy(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2375 static int __pyx_pf_8PyClical_9index_set_2__cinit__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_other);
2376 static void __pyx_pf_8PyClical_9index_set_4__dealloc__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2377 static PyObject *__pyx_pf_8PyClical_9index_set_6__richcmp__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op);
2378 static int __pyx_pf_8PyClical_9index_set_8__setitem__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_idx, PyObject *__pyx_v_val);
2379 static PyObject *__pyx_pf_8PyClical_9index_set_10__getitem__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_idx);
2380 static int __pyx_pf_8PyClical_9index_set_12__contains__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_idx);
2381 static PyObject *__pyx_pf_8PyClical_9index_set_14__iter__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2382 static PyObject *__pyx_pf_8PyClical_9index_set_17__invert__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2383 static PyObject *__pyx_pf_8PyClical_9index_set_19__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2384 static PyObject *__pyx_pf_8PyClical_9index_set_21__ixor__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs);
2385 static PyObject *__pyx_pf_8PyClical_9index_set_23__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2386 static PyObject *__pyx_pf_8PyClical_9index_set_25__iand__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs);
2387 static PyObject *__pyx_pf_8PyClical_9index_set_27__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2388 static PyObject *__pyx_pf_8PyClical_9index_set_29__ior__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs);
2389 static PyObject *__pyx_pf_8PyClical_9index_set_31count(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2390 static PyObject *__pyx_pf_8PyClical_9index_set_33count_neg(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2391 static PyObject *__pyx_pf_8PyClical_9index_set_35count_pos(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2392 static PyObject *__pyx_pf_8PyClical_9index_set_37min(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2393 static PyObject *__pyx_pf_8PyClical_9index_set_39max(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2394 static PyObject *__pyx_pf_8PyClical_9index_set_41hash_fn(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2395 static PyObject *__pyx_pf_8PyClical_9index_set_43sign_of_mult(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs);
2396 static PyObject *__pyx_pf_8PyClical_9index_set_45sign_of_square(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2397 static PyObject *__pyx_pf_8PyClical_9index_set_47__repr__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2398 static PyObject *__pyx_pf_8PyClical_9index_set_49__str__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2399 static PyObject *__pyx_pf_8PyClical_9index_set_51__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2400 static PyObject *__pyx_pf_8PyClical_9index_set_53__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2401 static PyObject *__pyx_pf_8PyClical_index_set_hidden_doctests(CYTHON_UNUSED PyObject *__pyx_self);
2402 static PyObject *__pyx_pf_8PyClical_2compare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2403 static PyObject *__pyx_pf_8PyClical_4min_neg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2404 static PyObject *__pyx_pf_8PyClical_6max_pos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2405 static PyObject *__pyx_pf_8PyClical_8clifford_copy(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2406 static int __pyx_pf_8PyClical_8clifford_2__cinit__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_ixt);
2407 static void __pyx_pf_8PyClical_8clifford_4__dealloc__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2408 static int __pyx_pf_8PyClical_8clifford_6__contains__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_x);
2409 static PyObject *__pyx_pf_8PyClical_8clifford_8__iter__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2410 static PyObject *__pyx_pf_8PyClical_8clifford_10reframe(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_ixt);
2411 static PyObject *__pyx_pf_8PyClical_8clifford_12__richcmp__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op);
2412 static PyObject *__pyx_pf_8PyClical_8clifford_14__getitem__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_ixt);
2413 static PyObject *__pyx_pf_8PyClical_8clifford_16__neg__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2414 static PyObject *__pyx_pf_8PyClical_8clifford_18__pos__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2415 static PyObject *__pyx_pf_8PyClical_8clifford_20__add__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2416 static PyObject *__pyx_pf_8PyClical_8clifford_22__iadd__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2417 static PyObject *__pyx_pf_8PyClical_8clifford_24__sub__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2418 static PyObject *__pyx_pf_8PyClical_8clifford_26__isub__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2419 static PyObject *__pyx_pf_8PyClical_8clifford_28__mul__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2420 static PyObject *__pyx_pf_8PyClical_8clifford_30__imul__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2421 static PyObject *__pyx_pf_8PyClical_8clifford_32__mod__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2422 static PyObject *__pyx_pf_8PyClical_8clifford_34__imod__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2423 static PyObject *__pyx_pf_8PyClical_8clifford_36__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2424 static PyObject *__pyx_pf_8PyClical_8clifford_38__iand__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2425 static PyObject *__pyx_pf_8PyClical_8clifford_40__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2426 static PyObject *__pyx_pf_8PyClical_8clifford_42__ixor__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2427 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 2428 static PyObject *__pyx_pf_8PyClical_8clifford_44__div__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2430 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 2431 static PyObject *__pyx_pf_8PyClical_8clifford_46__idiv__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2433 static PyObject *__pyx_pf_8PyClical_8clifford_48inv(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2434 static PyObject *__pyx_pf_8PyClical_8clifford_50__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2435 static PyObject *__pyx_pf_8PyClical_8clifford_52__ior__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2436 static PyObject *__pyx_pf_8PyClical_8clifford_54__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_m, CYTHON_UNUSED PyObject *__pyx_v_dummy);
2437 static PyObject *__pyx_pf_8PyClical_8clifford_56pow(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_m);
2438 static PyObject *__pyx_pf_8PyClical_8clifford_58outer_pow(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_m);
2439 static PyObject *__pyx_pf_8PyClical_8clifford_60__call__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_grade);
2440 static PyObject *__pyx_pf_8PyClical_8clifford_62scalar(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2441 static PyObject *__pyx_pf_8PyClical_8clifford_64pure(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2442 static PyObject *__pyx_pf_8PyClical_8clifford_66even(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2443 static PyObject *__pyx_pf_8PyClical_8clifford_68odd(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2444 static PyObject *__pyx_pf_8PyClical_8clifford_70vector_part(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_frm);
2445 static PyObject *__pyx_pf_8PyClical_8clifford_72involute(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2446 static PyObject *__pyx_pf_8PyClical_8clifford_74reverse(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2447 static PyObject *__pyx_pf_8PyClical_8clifford_76conj(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2448 static PyObject *__pyx_pf_8PyClical_8clifford_78quad(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2449 static PyObject *__pyx_pf_8PyClical_8clifford_80norm(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2450 static PyObject *__pyx_pf_8PyClical_8clifford_82abs(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2451 static PyObject *__pyx_pf_8PyClical_8clifford_84max_abs(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2452 static PyObject *__pyx_pf_8PyClical_8clifford_86truncated(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_limit);
2453 static PyObject *__pyx_pf_8PyClical_8clifford_88isnan(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2454 static PyObject *__pyx_pf_8PyClical_8clifford_90frame(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2455 static PyObject *__pyx_pf_8PyClical_8clifford_92__repr__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2456 static PyObject *__pyx_pf_8PyClical_8clifford_94__str__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2457 static PyObject *__pyx_pf_8PyClical_8clifford_96__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2458 static PyObject *__pyx_pf_8PyClical_8clifford_98__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2459 static PyObject *__pyx_pf_8PyClical_8clifford_hidden_doctests(CYTHON_UNUSED PyObject *__pyx_self);
2460 static PyObject *__pyx_pf_8PyClical_10inv(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2461 static PyObject *__pyx_pf_8PyClical_12scalar(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2462 static PyObject *__pyx_pf_8PyClical_14real(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2463 static PyObject *__pyx_pf_8PyClical_16imag(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2464 static PyObject *__pyx_pf_8PyClical_18pure(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2465 static PyObject *__pyx_pf_8PyClical_20even(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2466 static PyObject *__pyx_pf_8PyClical_22odd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2467 static PyObject *__pyx_pf_8PyClical_24involute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2468 static PyObject *__pyx_pf_8PyClical_26reverse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2469 static PyObject *__pyx_pf_8PyClical_28conj(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2470 static PyObject *__pyx_pf_8PyClical_30quad(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2471 static PyObject *__pyx_pf_8PyClical_32norm(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2472 static PyObject *__pyx_pf_8PyClical_34abs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2473 static PyObject *__pyx_pf_8PyClical_36max_abs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2474 static PyObject *__pyx_pf_8PyClical_38pow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_m);
2475 static PyObject *__pyx_pf_8PyClical_40outer_pow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_m);
2476 static PyObject *__pyx_pf_8PyClical_42complexifier(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2477 static PyObject *__pyx_pf_8PyClical_44sqrt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2478 static PyObject *__pyx_pf_8PyClical_46exp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2479 static PyObject *__pyx_pf_8PyClical_48log(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2480 static PyObject *__pyx_pf_8PyClical_50cos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2481 static PyObject *__pyx_pf_8PyClical_52acos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2482 static PyObject *__pyx_pf_8PyClical_54cosh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2483 static PyObject *__pyx_pf_8PyClical_56acosh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2484 static PyObject *__pyx_pf_8PyClical_58sin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2485 static PyObject *__pyx_pf_8PyClical_60asin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2486 static PyObject *__pyx_pf_8PyClical_62sinh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2487 static PyObject *__pyx_pf_8PyClical_64asinh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2488 static PyObject *__pyx_pf_8PyClical_66tan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2489 static PyObject *__pyx_pf_8PyClical_68atan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2490 static PyObject *__pyx_pf_8PyClical_70tanh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2491 static PyObject *__pyx_pf_8PyClical_72atanh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2492 static PyObject *__pyx_pf_8PyClical_74random_clifford(CYTHON_UNUSED PyObject *__pyx_self,
struct __pyx_obj_8PyClical_index_set *__pyx_v_ixt, PyObject *__pyx_v_fill);
2493 static PyObject *__pyx_pf_8PyClical_76cga3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2494 static PyObject *__pyx_pf_8PyClical_78cga3std(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2495 static PyObject *__pyx_pf_8PyClical_80agc3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2496 static PyObject *__pyx_pf_8PyClical_82e(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2497 static PyObject *__pyx_pf_8PyClical_84istpq(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_p, PyObject *__pyx_v_q);
2498 static PyObject *__pyx_pf_8PyClical_86_test(CYTHON_UNUSED PyObject *__pyx_self);
2499 static PyObject *__pyx_tp_new_8PyClical_index_set(PyTypeObject *t, PyObject *a, PyObject *k);
2500 static PyObject *__pyx_tp_new_8PyClical_clifford(PyTypeObject *t, PyObject *a, PyObject *k);
2501 static PyObject *__pyx_tp_new_8PyClical___pyx_scope_struct____iter__(PyTypeObject *t, PyObject *a, PyObject *k);
2502 static PyObject *__pyx_float_0_0;
2503 static PyObject *__pyx_float_1_0;
2504 static PyObject *__pyx_float_2_0;
2505 static PyObject *__pyx_float_8_0;
2506 static PyObject *__pyx_int_0;
2507 static PyObject *__pyx_int_1;
2508 static PyObject *__pyx_int_4;
2509 static PyObject *__pyx_int_neg_1;
2510 static PyObject *__pyx_tuple__3;
2511 static PyObject *__pyx_tuple__4;
2512 static PyObject *__pyx_tuple__10;
2513 static PyObject *__pyx_tuple__11;
2514 static PyObject *__pyx_tuple__12;
2515 static PyObject *__pyx_tuple__15;
2516 static PyObject *__pyx_tuple__16;
2517 static PyObject *__pyx_tuple__18;
2518 static PyObject *__pyx_tuple__20;
2519 static PyObject *__pyx_tuple__21;
2520 static PyObject *__pyx_tuple__22;
2521 static PyObject *__pyx_codeobj__13;
2522 static PyObject *__pyx_codeobj__14;
2523 static PyObject *__pyx_codeobj__17;
2524 static PyObject *__pyx_codeobj__19;
2525 static PyObject *__pyx_codeobj__23;
2536 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_toIndexSet(PyObject *__pyx_v_obj) {
2538 __Pyx_RefNannyDeclarations
2539 PyObject *__pyx_t_1 = NULL;
2540 __Pyx_RefNannySetupContext(
"toIndexSet", 0);
2549 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_index_set), __pyx_v_obj);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
2550 __Pyx_GOTREF(__pyx_t_1);
2551 __pyx_r = (((
struct __pyx_obj_8PyClical_index_set *)__pyx_t_1)->instance[0]);
2552 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2565 __Pyx_XDECREF(__pyx_t_1);
2566 __Pyx_WriteUnraisable(
"PyClical.toIndexSet", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
2567 __Pyx_pretend_to_initialize(&__pyx_r);
2569 __Pyx_RefNannyFinishContext();
2581 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_9index_set_wrap(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self,
IndexSet __pyx_v_other) {
2582 PyObject *__pyx_r = NULL;
2583 __Pyx_RefNannyDeclarations
2584 __Pyx_RefNannySetupContext(
"wrap", 0);
2593 (__pyx_v_self->instance[0]) = __pyx_v_other;
2602 __Pyx_XDECREF(__pyx_r);
2603 __Pyx_INCREF(((PyObject *)__pyx_v_self));
2604 __pyx_r = ((PyObject *)__pyx_v_self);
2617 __Pyx_XGIVEREF(__pyx_r);
2618 __Pyx_RefNannyFinishContext();
2630 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_9index_set_unwrap(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
2632 __Pyx_RefNannyDeclarations
2633 __Pyx_RefNannySetupContext(
"unwrap", 0);
2642 __pyx_r = (__pyx_v_self->instance[0]);
2655 __Pyx_RefNannyFinishContext();
2667 static PyObject *__pyx_pw_8PyClical_9index_set_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
2668 static PyObject *__pyx_f_8PyClical_9index_set_copy(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self,
int __pyx_skip_dispatch) {
2669 PyObject *__pyx_r = NULL;
2670 __Pyx_RefNannyDeclarations
2671 PyObject *__pyx_t_1 = NULL;
2672 PyObject *__pyx_t_2 = NULL;
2673 PyObject *__pyx_t_3 = NULL;
2674 PyObject *__pyx_t_4 = NULL;
2675 __Pyx_RefNannySetupContext(
"copy", 0);
2677 if (unlikely(__pyx_skip_dispatch)) ;
2679 else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
2680 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS 2681 static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
2682 if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
2683 PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
2685 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error)
2686 __Pyx_GOTREF(__pyx_t_1);
2687 if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(
void*)__pyx_pw_8PyClical_9index_set_1copy)) {
2688 __Pyx_XDECREF(__pyx_r);
2689 __Pyx_INCREF(__pyx_t_1);
2690 __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
2691 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
2692 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
2693 if (likely(__pyx_t_4)) {
2694 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
2695 __Pyx_INCREF(__pyx_t_4);
2696 __Pyx_INCREF(
function);
2697 __Pyx_DECREF_SET(__pyx_t_3,
function);
2700 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
2701 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
2702 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error)
2703 __Pyx_GOTREF(__pyx_t_2);
2704 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2705 __pyx_r = __pyx_t_2;
2707 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2710 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS 2711 __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
2712 __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
2713 if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
2714 __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
2717 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2718 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS 2730 __Pyx_XDECREF(__pyx_r);
2731 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_index_set), ((PyObject *)__pyx_v_self));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error)
2732 __Pyx_GOTREF(__pyx_t_1);
2733 __pyx_r = __pyx_t_1;
2747 __Pyx_XDECREF(__pyx_t_1);
2748 __Pyx_XDECREF(__pyx_t_2);
2749 __Pyx_XDECREF(__pyx_t_3);
2750 __Pyx_XDECREF(__pyx_t_4);
2751 __Pyx_AddTraceback(
"PyClical.index_set.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
2754 __Pyx_XGIVEREF(__pyx_r);
2755 __Pyx_RefNannyFinishContext();
2760 static PyObject *__pyx_pw_8PyClical_9index_set_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
2761 static char __pyx_doc_8PyClical_9index_set_copy[] =
"\n Copy this index_set object.\n\n >>> s=index_set(1); t=s.copy(); print t\n {1}\n ";
2762 static PyObject *__pyx_pw_8PyClical_9index_set_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
2763 PyObject *__pyx_r = 0;
2764 __Pyx_RefNannyDeclarations
2765 __Pyx_RefNannySetupContext(
"copy (wrapper)", 0);
2766 __pyx_r = __pyx_pf_8PyClical_9index_set_copy(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
2769 __Pyx_RefNannyFinishContext();
2773 static PyObject *__pyx_pf_8PyClical_9index_set_copy(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
2774 PyObject *__pyx_r = NULL;
2775 __Pyx_RefNannyDeclarations
2776 PyObject *__pyx_t_1 = NULL;
2777 __Pyx_RefNannySetupContext(
"copy", 0);
2778 __Pyx_XDECREF(__pyx_r);
2779 __pyx_t_1 = __pyx_f_8PyClical_9index_set_copy(__pyx_v_self, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error)
2780 __Pyx_GOTREF(__pyx_t_1);
2781 __pyx_r = __pyx_t_1;
2787 __Pyx_XDECREF(__pyx_t_1);
2788 __Pyx_AddTraceback(
"PyClical.index_set.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
2791 __Pyx_XGIVEREF(__pyx_r);
2792 __Pyx_RefNannyFinishContext();
2805 static int __pyx_pw_8PyClical_9index_set_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2806 static int __pyx_pw_8PyClical_9index_set_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2807 PyObject *__pyx_v_other = 0;
2809 __Pyx_RefNannyDeclarations
2810 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
2812 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,0};
2813 PyObject* values[1] = {0};
2814 values[0] = ((PyObject *)__pyx_int_0);
2815 if (unlikely(__pyx_kwds)) {
2817 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2819 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2822 default:
goto __pyx_L5_argtuple_error;
2824 kw_args = PyDict_Size(__pyx_kwds);
2828 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other);
2829 if (value) { values[0] = value; kw_args--; }
2832 if (unlikely(kw_args > 0)) {
2833 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(0, 73, __pyx_L3_error)
2836 switch (PyTuple_GET_SIZE(__pyx_args)) {
2837 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2840 default:
goto __pyx_L5_argtuple_error;
2843 __pyx_v_other = values[0];
2845 goto __pyx_L4_argument_unpacking_done;
2846 __pyx_L5_argtuple_error:;
2847 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 73, __pyx_L3_error)
2849 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2850 __Pyx_RefNannyFinishContext();
2852 __pyx_L4_argument_unpacking_done:;
2853 __pyx_r = __pyx_pf_8PyClical_9index_set_2__cinit__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), __pyx_v_other);
2856 __Pyx_RefNannyFinishContext();
2860 static int __pyx_pf_8PyClical_9index_set_2__cinit__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_other) {
2861 PyObject *__pyx_v_error_msg_prefix = NULL;
2862 PyObject *__pyx_v_idx = NULL;
2864 __Pyx_RefNannyDeclarations
2868 PyObject *__pyx_t_4 = NULL;
2869 PyObject *__pyx_t_5 = NULL;
2872 PyObject *__pyx_t_8 = NULL;
2873 PyObject *__pyx_t_9 = NULL;
2874 PyObject *__pyx_t_10 = NULL;
2875 Py_ssize_t __pyx_t_11;
2876 PyObject *(*__pyx_t_12)(PyObject *);
2877 PyObject *__pyx_t_13 = NULL;
2878 PyObject *__pyx_t_14 = NULL;
2879 PyObject *__pyx_t_15 = NULL;
2880 PyObject *__pyx_t_16 = NULL;
2882 __Pyx_RefNannySetupContext(
"__cinit__", 0);
2891 __Pyx_INCREF(__pyx_kp_s_Cannot_initialize_index_set_obje);
2892 __pyx_v_error_msg_prefix = __pyx_kp_s_Cannot_initialize_index_set_obje;
2901 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8PyClical_index_set);
2902 __pyx_t_2 = (__pyx_t_1 != 0);
2913 __pyx_t_3 =
new IndexSet(__pyx_f_8PyClical_9index_set_unwrap(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_other)));
2915 __Pyx_CppExn2PyErr();
2916 __PYX_ERR(0, 94, __pyx_L1_error)
2918 __pyx_v_self->instance = __pyx_t_3;
2937 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_numbers);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 95, __pyx_L1_error)
2938 __Pyx_GOTREF(__pyx_t_4);
2939 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Integral);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 95, __pyx_L1_error)
2940 __Pyx_GOTREF(__pyx_t_5);
2941 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2942 __pyx_t_2 = PyObject_IsInstance(__pyx_v_other, __pyx_t_5);
if (unlikely(__pyx_t_2 == ((
int)-1))) __PYX_ERR(0, 95, __pyx_L1_error)
2943 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2944 __pyx_t_1 = (__pyx_t_2 != 0);
2954 __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_other);
if (unlikely((__pyx_t_6 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error)
2956 __pyx_t_3 =
new IndexSet(((
int)__pyx_t_6));
2958 __Pyx_CppExn2PyErr();
2959 __PYX_ERR(0, 96, __pyx_L1_error)
2961 __pyx_v_self->instance = __pyx_t_3;
2980 __pyx_t_2 = PySet_Check(__pyx_v_other);
2981 __pyx_t_7 = (__pyx_t_2 != 0);
2984 __pyx_t_1 = __pyx_t_7;
2985 goto __pyx_L4_bool_binop_done;
2987 __pyx_t_7 = PyFrozenSet_Check(__pyx_v_other);
2988 __pyx_t_2 = (__pyx_t_7 != 0);
2989 __pyx_t_1 = __pyx_t_2;
2990 __pyx_L4_bool_binop_done:;
2991 __pyx_t_2 = (__pyx_t_1 != 0);
3002 __Pyx_PyThreadState_declare
3003 __Pyx_PyThreadState_assign
3004 __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
3005 __Pyx_XGOTREF(__pyx_t_8);
3006 __Pyx_XGOTREF(__pyx_t_9);
3007 __Pyx_XGOTREF(__pyx_t_10);
3018 __pyx_v_self->instance = __pyx_t_3;
3027 if (likely(PyList_CheckExact(__pyx_v_other)) || PyTuple_CheckExact(__pyx_v_other)) {
3028 __pyx_t_5 = __pyx_v_other; __Pyx_INCREF(__pyx_t_5); __pyx_t_11 = 0;
3031 __pyx_t_11 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_other);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 100, __pyx_L6_error)
3032 __Pyx_GOTREF(__pyx_t_5);
3033 __pyx_t_12 = Py_TYPE(__pyx_t_5)->tp_iternext;
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 100, __pyx_L6_error)
3036 if (likely(!__pyx_t_12)) {
3037 if (likely(PyList_CheckExact(__pyx_t_5))) {
3038 if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_5))
break;
3039 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 3040 __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_11); __Pyx_INCREF(__pyx_t_4); __pyx_t_11++;
if (unlikely(0 < 0)) __PYX_ERR(0, 100, __pyx_L6_error)
3042 __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_11); __pyx_t_11++;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 100, __pyx_L6_error)
3043 __Pyx_GOTREF(__pyx_t_4);
3046 if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_5))
break;
3047 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 3048 __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_11); __Pyx_INCREF(__pyx_t_4); __pyx_t_11++;
if (unlikely(0 < 0)) __PYX_ERR(0, 100, __pyx_L6_error)
3050 __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_11); __pyx_t_11++;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 100, __pyx_L6_error)
3051 __Pyx_GOTREF(__pyx_t_4);
3055 __pyx_t_4 = __pyx_t_12(__pyx_t_5);
3056 if (unlikely(!__pyx_t_4)) {
3057 PyObject* exc_type = PyErr_Occurred();
3059 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
3060 else __PYX_ERR(0, 100, __pyx_L6_error)
3064 __Pyx_GOTREF(__pyx_t_4);
3066 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_4);
3076 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self), __pyx_v_idx, Py_True) < 0)) __PYX_ERR(0, 101, __pyx_L6_error)
3086 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3096 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3097 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
3098 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3099 goto __pyx_L11_try_end;
3101 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3102 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3111 __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_IndexError);
3113 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3114 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_13) < 0) __PYX_ERR(0, 102, __pyx_L8_except_error)
3115 __Pyx_GOTREF(__pyx_t_5);
3116 __Pyx_GOTREF(__pyx_t_4);
3117 __Pyx_GOTREF(__pyx_t_13);
3126 __pyx_t_14 = PyNumber_Add(__pyx_v_error_msg_prefix, __pyx_kp_s_invalid);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 103, __pyx_L8_except_error)
3127 __Pyx_GOTREF(__pyx_t_14);
3128 __pyx_t_15 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 103, __pyx_L8_except_error)
3129 __Pyx_GOTREF(__pyx_t_15);
3130 __pyx_t_16 = PyNumber_Add(__pyx_t_14, __pyx_t_15);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 103, __pyx_L8_except_error)
3131 __Pyx_GOTREF(__pyx_t_16);
3132 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3133 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3134 __pyx_t_15 = PyNumber_Add(__pyx_t_16, __pyx_kp_s_);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 103, __pyx_L8_except_error)
3135 __Pyx_GOTREF(__pyx_t_15);
3136 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3137 __pyx_t_16 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_15);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 103, __pyx_L8_except_error)
3138 __Pyx_GOTREF(__pyx_t_16);
3139 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3140 __Pyx_Raise(__pyx_t_16, 0, 0, 0);
3141 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3142 __PYX_ERR(0, 103, __pyx_L8_except_error)
3152 __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
3154 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3155 if (__Pyx_GetException(&__pyx_t_13, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(0, 104, __pyx_L8_except_error)
3156 __Pyx_GOTREF(__pyx_t_13);
3157 __Pyx_GOTREF(__pyx_t_4);
3158 __Pyx_GOTREF(__pyx_t_5);
3167 __pyx_t_16 = PyNumber_Add(__pyx_v_error_msg_prefix, __pyx_kp_s_invalid);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 105, __pyx_L8_except_error)
3168 __Pyx_GOTREF(__pyx_t_16);
3169 __pyx_t_15 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 105, __pyx_L8_except_error)
3170 __Pyx_GOTREF(__pyx_t_15);
3171 __pyx_t_14 = PyNumber_Add(__pyx_t_16, __pyx_t_15);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 105, __pyx_L8_except_error)
3172 __Pyx_GOTREF(__pyx_t_14);
3173 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3174 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3175 __pyx_t_15 = PyNumber_Add(__pyx_t_14, __pyx_kp_s_);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 105, __pyx_L8_except_error)
3176 __Pyx_GOTREF(__pyx_t_15);
3177 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3178 __pyx_t_14 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_15);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 105, __pyx_L8_except_error)
3179 __Pyx_GOTREF(__pyx_t_14);
3180 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3181 __Pyx_Raise(__pyx_t_14, 0, 0, 0);
3182 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3183 __PYX_ERR(0, 105, __pyx_L8_except_error)
3185 goto __pyx_L8_except_error;
3186 __pyx_L8_except_error:;
3195 __Pyx_XGIVEREF(__pyx_t_8);
3196 __Pyx_XGIVEREF(__pyx_t_9);
3197 __Pyx_XGIVEREF(__pyx_t_10);
3198 __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
3199 goto __pyx_L1_error;
3220 __pyx_t_2 = PyString_Check(__pyx_v_other);
3221 __pyx_t_1 = (__pyx_t_2 != 0);
3222 if (likely(__pyx_t_1)) {
3232 __Pyx_PyThreadState_declare
3233 __Pyx_PyThreadState_assign
3234 __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
3235 __Pyx_XGOTREF(__pyx_t_10);
3236 __Pyx_XGOTREF(__pyx_t_9);
3237 __Pyx_XGOTREF(__pyx_t_8);
3247 __pyx_t_17 = __Pyx_PyObject_AsWritableString(__pyx_v_other);
if (unlikely((!__pyx_t_17) && PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L18_error)
3249 __pyx_t_3 =
new IndexSet(((
char *)__pyx_t_17));
3251 __Pyx_CppExn2PyErr();
3252 __PYX_ERR(0, 108, __pyx_L18_error)
3254 __pyx_v_self->instance = __pyx_t_3;
3264 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3265 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
3266 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3267 goto __pyx_L23_try_end;
3269 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
3270 __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
3271 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
3272 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
3273 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3274 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3283 __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
3285 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3286 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_13) < 0) __PYX_ERR(0, 109, __pyx_L20_except_error)
3287 __Pyx_GOTREF(__pyx_t_5);
3288 __Pyx_GOTREF(__pyx_t_4);
3289 __Pyx_GOTREF(__pyx_t_13);
3298 __pyx_t_14 = PyNumber_Add(__pyx_v_error_msg_prefix, __pyx_kp_s_invalid_string);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 110, __pyx_L20_except_error)
3299 __Pyx_GOTREF(__pyx_t_14);
3300 __pyx_t_15 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 110, __pyx_L20_except_error)
3301 __Pyx_GOTREF(__pyx_t_15);
3302 __pyx_t_16 = PyNumber_Add(__pyx_t_14, __pyx_t_15);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 110, __pyx_L20_except_error)
3303 __Pyx_GOTREF(__pyx_t_16);
3304 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3305 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3306 __pyx_t_15 = PyNumber_Add(__pyx_t_16, __pyx_kp_s_);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 110, __pyx_L20_except_error)
3307 __Pyx_GOTREF(__pyx_t_15);
3308 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3309 __pyx_t_16 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_15);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 110, __pyx_L20_except_error)
3310 __Pyx_GOTREF(__pyx_t_16);
3311 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3312 __Pyx_Raise(__pyx_t_16, 0, 0, 0);
3313 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3314 __PYX_ERR(0, 110, __pyx_L20_except_error)
3316 goto __pyx_L20_except_error;
3317 __pyx_L20_except_error:;
3326 __Pyx_XGIVEREF(__pyx_t_10);
3327 __Pyx_XGIVEREF(__pyx_t_9);
3328 __Pyx_XGIVEREF(__pyx_t_8);
3329 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8);
3330 goto __pyx_L1_error;
3352 __pyx_t_13 = PyNumber_Add(__pyx_v_error_msg_prefix, __pyx_kp_s__2);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 112, __pyx_L1_error)
3353 __Pyx_GOTREF(__pyx_t_13);
3354 __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), ((PyObject *)Py_TYPE(__pyx_v_other)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 112, __pyx_L1_error)
3355 __Pyx_GOTREF(__pyx_t_4);
3356 __pyx_t_5 = PyNumber_Add(__pyx_t_13, __pyx_t_4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 112, __pyx_L1_error)
3357 __Pyx_GOTREF(__pyx_t_5);
3358 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
3359 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3360 __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_kp_s_);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 112, __pyx_L1_error)
3361 __Pyx_GOTREF(__pyx_t_4);
3362 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3363 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 112, __pyx_L1_error)
3364 __Pyx_GOTREF(__pyx_t_5);
3365 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3366 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
3367 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3368 __PYX_ERR(0, 112, __pyx_L1_error)
3384 __Pyx_XDECREF(__pyx_t_4);
3385 __Pyx_XDECREF(__pyx_t_5);
3386 __Pyx_XDECREF(__pyx_t_13);
3387 __Pyx_XDECREF(__pyx_t_14);
3388 __Pyx_XDECREF(__pyx_t_15);
3389 __Pyx_XDECREF(__pyx_t_16);
3390 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3393 __Pyx_XDECREF(__pyx_v_error_msg_prefix);
3394 __Pyx_XDECREF(__pyx_v_idx);
3395 __Pyx_RefNannyFinishContext();
3408 static void __pyx_pw_8PyClical_9index_set_5__dealloc__(PyObject *__pyx_v_self);
3409 static void __pyx_pw_8PyClical_9index_set_5__dealloc__(PyObject *__pyx_v_self) {
3410 __Pyx_RefNannyDeclarations
3411 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
3412 __pyx_pf_8PyClical_9index_set_4__dealloc__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
3415 __Pyx_RefNannyFinishContext();
3418 static void __pyx_pf_8PyClical_9index_set_4__dealloc__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
3419 __Pyx_RefNannyDeclarations
3420 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
3429 delete __pyx_v_self->instance;
3440 __Pyx_RefNannyFinishContext();
3452 static PyObject *__pyx_pw_8PyClical_9index_set_7__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op);
3453 static PyObject *__pyx_pw_8PyClical_9index_set_7__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op) {
3454 PyObject *__pyx_r = 0;
3455 __Pyx_RefNannyDeclarations
3456 __Pyx_RefNannySetupContext(
"__richcmp__ (wrapper)", 0);
3457 __pyx_r = __pyx_pf_8PyClical_9index_set_6__richcmp__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs), ((
int)__pyx_v_op));
3460 __Pyx_RefNannyFinishContext();
3464 static PyObject *__pyx_pf_8PyClical_9index_set_6__richcmp__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op) {
3465 PyObject *__pyx_v_eq = NULL;
3466 PyObject *__pyx_v_lt = NULL;
3467 PyObject *__pyx_r = NULL;
3468 __Pyx_RefNannyDeclarations
3472 PyObject *__pyx_t_4 = NULL;
3473 __Pyx_RefNannySetupContext(
"__richcmp__", 0);
3482 __pyx_t_2 = (((PyObject *)__pyx_v_lhs) == Py_None);
3483 __pyx_t_3 = (__pyx_t_2 != 0);
3486 __pyx_t_1 = __pyx_t_3;
3487 goto __pyx_L4_bool_binop_done;
3489 __pyx_t_3 = (__pyx_v_rhs == Py_None);
3490 __pyx_t_2 = (__pyx_t_3 != 0);
3491 __pyx_t_1 = __pyx_t_2;
3492 __pyx_L4_bool_binop_done:;
3502 __pyx_t_1 = (((PyObject *)__pyx_v_lhs) == __pyx_v_rhs);
3503 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 142, __pyx_L1_error)
3504 __Pyx_GOTREF(__pyx_t_4);
3505 __pyx_v_eq = __pyx_t_4;
3515 switch (__pyx_v_op) {
3525 __Pyx_XDECREF(__pyx_r);
3526 __Pyx_INCREF(__pyx_v_eq);
3527 __pyx_r = __pyx_v_eq;
3547 __Pyx_XDECREF(__pyx_r);
3548 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_eq);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 146, __pyx_L1_error)
3549 __pyx_t_4 = __Pyx_PyBool_FromLong((!__pyx_t_1));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error)
3550 __Pyx_GOTREF(__pyx_t_4);
3551 __pyx_r = __pyx_t_4;
3572 switch (__pyx_v_op) {
3582 __Pyx_XDECREF(__pyx_r);
3583 __Pyx_INCREF(Py_False);
3604 __Pyx_XDECREF(__pyx_r);
3605 __Pyx_INCREF(__pyx_v_eq);
3606 __pyx_r = __pyx_v_eq;
3626 __Pyx_XDECREF(__pyx_r);
3627 __Pyx_INCREF(Py_False);
3648 __Pyx_XDECREF(__pyx_r);
3649 __Pyx_INCREF(__pyx_v_eq);
3650 __pyx_r = __pyx_v_eq;
3670 __Pyx_XDECREF(__pyx_r);
3671 __Pyx_INCREF(__pyx_builtin_NotImplemented);
3672 __pyx_r = __pyx_builtin_NotImplemented;
3696 __pyx_t_1 = (__pyx_f_8PyClical_toIndexSet(((PyObject *)__pyx_v_lhs)) == __pyx_f_8PyClical_toIndexSet(__pyx_v_rhs));
3697 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error)
3698 __Pyx_GOTREF(__pyx_t_4);
3699 __pyx_v_eq = __pyx_t_4;
3709 switch (__pyx_v_op) {
3719 __Pyx_XDECREF(__pyx_r);
3720 __Pyx_INCREF(__pyx_v_eq);
3721 __pyx_r = __pyx_v_eq;
3741 __Pyx_XDECREF(__pyx_r);
3742 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_eq);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 163, __pyx_L1_error)
3743 __pyx_t_4 = __Pyx_PyBool_FromLong((!__pyx_t_1));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error)
3744 __Pyx_GOTREF(__pyx_t_4);
3745 __pyx_r = __pyx_t_4;
3766 __pyx_t_1 = (__pyx_f_8PyClical_toIndexSet(((PyObject *)__pyx_v_lhs)) < __pyx_f_8PyClical_toIndexSet(__pyx_v_rhs));
3767 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error)
3768 __Pyx_GOTREF(__pyx_t_4);
3769 __pyx_v_lt = __pyx_t_4;
3779 switch (__pyx_v_op) {
3789 __Pyx_XDECREF(__pyx_r);
3790 __Pyx_INCREF(__pyx_v_lt);
3791 __pyx_r = __pyx_v_lt;
3811 __Pyx_XDECREF(__pyx_r);
3812 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_lt);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 169, __pyx_L1_error)
3815 __Pyx_INCREF(__pyx_v_lt);
3816 __pyx_t_4 = __pyx_v_lt;
3817 goto __pyx_L6_bool_binop_done;
3819 __Pyx_INCREF(__pyx_v_eq);
3820 __pyx_t_4 = __pyx_v_eq;
3821 __pyx_L6_bool_binop_done:;
3822 __pyx_r = __pyx_t_4;
3843 __Pyx_XDECREF(__pyx_r);
3844 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_lt);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 171, __pyx_L1_error)
3847 __pyx_t_1 = __pyx_t_2;
3848 goto __pyx_L8_bool_binop_done;
3850 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_eq);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 171, __pyx_L1_error)
3851 __pyx_t_1 = __pyx_t_2;
3852 __pyx_L8_bool_binop_done:;
3853 __pyx_t_4 = __Pyx_PyBool_FromLong((!__pyx_t_1));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error)
3854 __Pyx_GOTREF(__pyx_t_4);
3855 __pyx_r = __pyx_t_4;
3876 __Pyx_XDECREF(__pyx_r);
3877 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_lt);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 173, __pyx_L1_error)
3878 __pyx_t_4 = __Pyx_PyBool_FromLong((!__pyx_t_1));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 173, __pyx_L1_error)
3879 __Pyx_GOTREF(__pyx_t_4);
3880 __pyx_r = __pyx_t_4;
3901 __Pyx_XDECREF(__pyx_r);
3902 __Pyx_INCREF(__pyx_builtin_NotImplemented);
3903 __pyx_r = __pyx_builtin_NotImplemented;
3921 __Pyx_XDECREF(__pyx_t_4);
3922 __Pyx_AddTraceback(
"PyClical.index_set.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3925 __Pyx_XDECREF(__pyx_v_eq);
3926 __Pyx_XDECREF(__pyx_v_lt);
3927 __Pyx_XGIVEREF(__pyx_r);
3928 __Pyx_RefNannyFinishContext();
3941 static int __pyx_pw_8PyClical_9index_set_9__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx, PyObject *__pyx_v_val);
3942 static char __pyx_doc_8PyClical_9index_set_8__setitem__[] =
"\n Set the value of an index_set object at index idx to value val.\n\n >>> s=index_set({1}); s[2] = True; print s\n {1,2}\n >>> s=index_set({1,2}); s[1] = False; print s\n {2}\n ";
3943 #if CYTHON_COMPILING_IN_CPYTHON 3944 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_8__setitem__;
3946 static int __pyx_pw_8PyClical_9index_set_9__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx, PyObject *__pyx_v_val) {
3948 __Pyx_RefNannyDeclarations
3949 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
3950 __pyx_r = __pyx_pf_8PyClical_9index_set_8__setitem__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_idx), ((PyObject *)__pyx_v_val));
3953 __Pyx_RefNannyFinishContext();
3957 static int __pyx_pf_8PyClical_9index_set_8__setitem__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_idx, PyObject *__pyx_v_val) {
3959 __Pyx_RefNannyDeclarations
3962 __Pyx_RefNannySetupContext(
"__setitem__", 0);
3971 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_idx);
if (unlikely((__pyx_t_1 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 186, __pyx_L1_error)
3972 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_val);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 186, __pyx_L1_error)
3974 __pyx_v_self->instance->set(__pyx_t_1, __pyx_t_2);
3976 __Pyx_CppExn2PyErr();
3977 __PYX_ERR(0, 186, __pyx_L1_error)
4000 __Pyx_AddTraceback(
"PyClical.index_set.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4003 __Pyx_RefNannyFinishContext();
4016 static PyObject *__pyx_pw_8PyClical_9index_set_11__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx);
4017 static char __pyx_doc_8PyClical_9index_set_10__getitem__[] =
"\n Get the value of an index_set object at an index.\n\n >>> index_set({1})[1]\n True\n >>> index_set({1})[2]\n False\n >>> index_set({2})[-1]\n False\n >>> index_set({2})[1]\n False\n >>> index_set({2})[2]\n True\n >>> index_set({2})[33]\n False\n ";
4018 #if CYTHON_COMPILING_IN_CPYTHON 4019 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_10__getitem__;
4021 static PyObject *__pyx_pw_8PyClical_9index_set_11__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx) {
4022 PyObject *__pyx_r = 0;
4023 __Pyx_RefNannyDeclarations
4024 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
4025 __pyx_r = __pyx_pf_8PyClical_9index_set_10__getitem__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_idx));
4028 __Pyx_RefNannyFinishContext();
4032 static PyObject *__pyx_pf_8PyClical_9index_set_10__getitem__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_idx) {
4033 PyObject *__pyx_r = NULL;
4034 __Pyx_RefNannyDeclarations
4036 PyObject *__pyx_t_2 = NULL;
4037 __Pyx_RefNannySetupContext(
"__getitem__", 0);
4046 __Pyx_XDECREF(__pyx_r);
4047 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_idx);
if (unlikely((__pyx_t_1 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 206, __pyx_L1_error)
4048 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->instance->operator[](__pyx_t_1));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 206, __pyx_L1_error)
4049 __Pyx_GOTREF(__pyx_t_2);
4050 __pyx_r = __pyx_t_2;
4064 __Pyx_XDECREF(__pyx_t_2);
4065 __Pyx_AddTraceback(
"PyClical.index_set.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4068 __Pyx_XGIVEREF(__pyx_r);
4069 __Pyx_RefNannyFinishContext();
4082 static int __pyx_pw_8PyClical_9index_set_13__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx);
4083 static char __pyx_doc_8PyClical_9index_set_12__contains__[] =
"\n Check that an index_set object contains the index idx: idx in self.\n\n >>> 1 in index_set({1})\n True\n >>> 2 in index_set({1})\n False\n >>> -1 in index_set({2})\n False\n >>> 1 in index_set({2})\n False\n >>> 2 in index_set({2})\n True\n >>> 33 in index_set({2})\n False\n ";
4084 #if CYTHON_COMPILING_IN_CPYTHON 4085 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_12__contains__;
4087 static int __pyx_pw_8PyClical_9index_set_13__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx) {
4089 __Pyx_RefNannyDeclarations
4090 __Pyx_RefNannySetupContext(
"__contains__ (wrapper)", 0);
4091 __pyx_r = __pyx_pf_8PyClical_9index_set_12__contains__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_idx));
4094 __Pyx_RefNannyFinishContext();
4098 static int __pyx_pf_8PyClical_9index_set_12__contains__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_idx) {
4100 __Pyx_RefNannyDeclarations
4102 __Pyx_RefNannySetupContext(
"__contains__", 0);
4111 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_idx);
if (unlikely((__pyx_t_1 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 225, __pyx_L1_error)
4112 __pyx_r = __pyx_v_self->instance->operator[](__pyx_t_1);
4125 __Pyx_AddTraceback(
"PyClical.index_set.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4128 __Pyx_RefNannyFinishContext();
4131 static PyObject *__pyx_gb_8PyClical_9index_set_16generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value);
4142 static PyObject *__pyx_pw_8PyClical_9index_set_15__iter__(PyObject *__pyx_v_self);
4143 static char __pyx_doc_8PyClical_9index_set_14__iter__[] =
"\n Iterate over the indices of an index_set.\n\n >>> for i in index_set({-3,4,7}): print i,\n -3 4 7\n ";
4144 #if CYTHON_COMPILING_IN_CPYTHON 4145 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_14__iter__;
4147 static PyObject *__pyx_pw_8PyClical_9index_set_15__iter__(PyObject *__pyx_v_self) {
4148 PyObject *__pyx_r = 0;
4149 __Pyx_RefNannyDeclarations
4150 __Pyx_RefNannySetupContext(
"__iter__ (wrapper)", 0);
4151 __pyx_r = __pyx_pf_8PyClical_9index_set_14__iter__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
4154 __Pyx_RefNannyFinishContext();
4158 static PyObject *__pyx_pf_8PyClical_9index_set_14__iter__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
4159 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *__pyx_cur_scope;
4160 PyObject *__pyx_r = NULL;
4161 __Pyx_RefNannyDeclarations
4162 __Pyx_RefNannySetupContext(
"__iter__", 0);
4163 __pyx_cur_scope = (
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)__pyx_tp_new_8PyClical___pyx_scope_struct____iter__(__pyx_ptype_8PyClical___pyx_scope_struct____iter__, __pyx_empty_tuple, NULL);
4164 if (unlikely(!__pyx_cur_scope)) {
4165 __pyx_cur_scope = ((
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)Py_None);
4166 __Pyx_INCREF(Py_None);
4167 __PYX_ERR(0, 227, __pyx_L1_error)
4169 __Pyx_GOTREF(__pyx_cur_scope);
4171 __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
4172 __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
4173 __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
4175 __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_8PyClical_9index_set_16generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_index_set___iter, __pyx_n_s_PyClical);
if (unlikely(!gen)) __PYX_ERR(0, 227, __pyx_L1_error)
4176 __Pyx_DECREF(__pyx_cur_scope);
4177 __Pyx_RefNannyFinishContext();
4178 return (PyObject *) gen;
4183 __Pyx_AddTraceback(
"PyClical.index_set.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4185 __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
4186 __Pyx_XGIVEREF(__pyx_r);
4187 __Pyx_RefNannyFinishContext();
4191 static PyObject *__pyx_gb_8PyClical_9index_set_16generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value)
4193 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *__pyx_cur_scope = ((
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)__pyx_generator->closure);
4194 PyObject *__pyx_r = NULL;
4195 PyObject *__pyx_t_1 = NULL;
4196 PyObject *__pyx_t_2 = NULL;
4197 PyObject *__pyx_t_3 = NULL;
4198 PyObject *__pyx_t_4 = NULL;
4199 Py_ssize_t __pyx_t_5;
4200 PyObject *(*__pyx_t_6)(PyObject *);
4203 __Pyx_RefNannyDeclarations
4204 __Pyx_RefNannySetupContext(
"__iter__", 0);
4205 switch (__pyx_generator->resume_label) {
4206 case 0:
goto __pyx_L3_first_run;
4207 case 1:
goto __pyx_L7_resume_from_yield;
4209 __Pyx_RefNannyFinishContext();
4212 __pyx_L3_first_run:;
4213 if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 227, __pyx_L1_error)
4222 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_min);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error)
4223 __Pyx_GOTREF(__pyx_t_2);
4225 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
4226 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
4227 if (likely(__pyx_t_3)) {
4228 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
4229 __Pyx_INCREF(__pyx_t_3);
4230 __Pyx_INCREF(
function);
4231 __Pyx_DECREF_SET(__pyx_t_2,
function);
4234 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
4235 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4236 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error)
4237 __Pyx_GOTREF(__pyx_t_1);
4238 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4239 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_max);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 234, __pyx_L1_error)
4240 __Pyx_GOTREF(__pyx_t_3);
4242 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4243 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
4244 if (likely(__pyx_t_4)) {
4245 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4246 __Pyx_INCREF(__pyx_t_4);
4247 __Pyx_INCREF(
function);
4248 __Pyx_DECREF_SET(__pyx_t_3,
function);
4251 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
4252 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4253 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error)
4254 __Pyx_GOTREF(__pyx_t_2);
4255 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4256 __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 234, __pyx_L1_error)
4257 __Pyx_GOTREF(__pyx_t_3);
4258 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4259 __pyx_t_2 = PyTuple_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error)
4260 __Pyx_GOTREF(__pyx_t_2);
4261 __Pyx_GIVEREF(__pyx_t_1);
4262 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
4263 __Pyx_GIVEREF(__pyx_t_3);
4264 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
4267 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_2, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 234, __pyx_L1_error)
4268 __Pyx_GOTREF(__pyx_t_3);
4269 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4270 if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
4271 __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
4274 __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error)
4275 __Pyx_GOTREF(__pyx_t_2);
4276 __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext;
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error)
4278 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4280 if (likely(!__pyx_t_6)) {
4281 if (likely(PyList_CheckExact(__pyx_t_2))) {
4282 if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2))
break;
4283 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 4284 __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++;
if (unlikely(0 < 0)) __PYX_ERR(0, 234, __pyx_L1_error)
4286 __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 234, __pyx_L1_error)
4287 __Pyx_GOTREF(__pyx_t_3);
4290 if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2))
break;
4291 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 4292 __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++;
if (unlikely(0 < 0)) __PYX_ERR(0, 234, __pyx_L1_error)
4294 __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 234, __pyx_L1_error)
4295 __Pyx_GOTREF(__pyx_t_3);
4299 __pyx_t_3 = __pyx_t_6(__pyx_t_2);
4300 if (unlikely(!__pyx_t_3)) {
4301 PyObject* exc_type = PyErr_Occurred();
4303 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
4304 else __PYX_ERR(0, 234, __pyx_L1_error)
4308 __Pyx_GOTREF(__pyx_t_3);
4310 __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_idx);
4311 __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_idx, __pyx_t_3);
4312 __Pyx_GIVEREF(__pyx_t_3);
4322 __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_cur_scope->__pyx_v_idx, ((PyObject *)__pyx_cur_scope->__pyx_v_self), Py_EQ));
if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 235, __pyx_L1_error)
4323 __pyx_t_8 = (__pyx_t_7 != 0);
4333 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_idx);
4334 __pyx_r = __pyx_cur_scope->__pyx_v_idx;
4335 __Pyx_XGIVEREF(__pyx_t_2);
4336 __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
4337 __pyx_cur_scope->__pyx_t_1 = __pyx_t_5;
4338 __pyx_cur_scope->__pyx_t_2 = __pyx_t_6;
4339 __Pyx_XGIVEREF(__pyx_r);
4340 __Pyx_RefNannyFinishContext();
4341 __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
4343 __pyx_generator->resume_label = 1;
4345 __pyx_L7_resume_from_yield:;
4346 __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
4347 __pyx_cur_scope->__pyx_t_0 = 0;
4348 __Pyx_XGOTREF(__pyx_t_2);
4349 __pyx_t_5 = __pyx_cur_scope->__pyx_t_1;
4350 __pyx_t_6 = __pyx_cur_scope->__pyx_t_2;
4351 if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 236, __pyx_L1_error)
4370 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4371 CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
4382 PyErr_SetNone(PyExc_StopIteration);
4385 __Pyx_XDECREF(__pyx_t_1);
4386 __Pyx_XDECREF(__pyx_t_2);
4387 __Pyx_XDECREF(__pyx_t_3);
4388 __Pyx_XDECREF(__pyx_t_4);
4389 __Pyx_AddTraceback(
"__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4391 __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
4392 #if !CYTHON_USE_EXC_INFO_STACK 4393 __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
4395 __pyx_generator->resume_label = -1;
4396 __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
4397 __Pyx_RefNannyFinishContext();
4410 static PyObject *__pyx_pw_8PyClical_9index_set_18__invert__(PyObject *__pyx_v_self);
4411 static char __pyx_doc_8PyClical_9index_set_17__invert__[] =
"\n Set complement: not.\n\n >>> print ~index_set({-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16})\n {-32,-31,-30,-29,-28,-27,-26,-25,-24,-23,-22,-21,-20,-19,-18,-17,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32}\n ";
4412 #if CYTHON_COMPILING_IN_CPYTHON 4413 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_17__invert__;
4415 static PyObject *__pyx_pw_8PyClical_9index_set_18__invert__(PyObject *__pyx_v_self) {
4416 PyObject *__pyx_r = 0;
4417 __Pyx_RefNannyDeclarations
4418 __Pyx_RefNannySetupContext(
"__invert__ (wrapper)", 0);
4419 __pyx_r = __pyx_pf_8PyClical_9index_set_17__invert__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
4422 __Pyx_RefNannyFinishContext();
4426 static PyObject *__pyx_pf_8PyClical_9index_set_17__invert__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
4427 PyObject *__pyx_r = NULL;
4428 __Pyx_RefNannyDeclarations
4429 PyObject *__pyx_t_1 = NULL;
4430 PyObject *__pyx_t_2 = NULL;
4431 __Pyx_RefNannySetupContext(
"__invert__", 0);
4440 __Pyx_XDECREF(__pyx_r);
4441 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_index_set));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 245, __pyx_L1_error)
4442 __Pyx_GOTREF(__pyx_t_1);
4443 __pyx_t_2 = __pyx_f_8PyClical_9index_set_wrap(((
struct __pyx_obj_8PyClical_index_set *)__pyx_t_1), __pyx_v_self->instance->operator~());
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 245, __pyx_L1_error)
4444 __Pyx_GOTREF(__pyx_t_2);
4445 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4446 __pyx_r = __pyx_t_2;
4460 __Pyx_XDECREF(__pyx_t_1);
4461 __Pyx_XDECREF(__pyx_t_2);
4462 __Pyx_AddTraceback(
"PyClical.index_set.__invert__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4465 __Pyx_XGIVEREF(__pyx_r);
4466 __Pyx_RefNannyFinishContext();
4479 static PyObject *__pyx_pw_8PyClical_9index_set_20__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
4480 static char __pyx_doc_8PyClical_9index_set_19__xor__[] =
"\n Symmetric set difference: exclusive or.\n\n >>> print index_set({1}) ^ index_set({2})\n {1,2}\n >>> print index_set({1,2}) ^ index_set({2})\n {1}\n ";
4481 #if CYTHON_COMPILING_IN_CPYTHON 4482 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_19__xor__;
4484 static PyObject *__pyx_pw_8PyClical_9index_set_20__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4485 PyObject *__pyx_r = 0;
4486 __Pyx_RefNannyDeclarations
4487 __Pyx_RefNannySetupContext(
"__xor__ (wrapper)", 0);
4488 __pyx_r = __pyx_pf_8PyClical_9index_set_19__xor__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
4491 __Pyx_RefNannyFinishContext();
4495 static PyObject *__pyx_pf_8PyClical_9index_set_19__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4496 PyObject *__pyx_r = NULL;
4497 __Pyx_RefNannyDeclarations
4498 PyObject *__pyx_t_1 = NULL;
4499 PyObject *__pyx_t_2 = NULL;
4500 __Pyx_RefNannySetupContext(
"__xor__", 0);
4509 __Pyx_XDECREF(__pyx_r);
4510 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_index_set));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error)
4511 __Pyx_GOTREF(__pyx_t_1);
4512 __pyx_t_2 = __pyx_f_8PyClical_9index_set_wrap(((
struct __pyx_obj_8PyClical_index_set *)__pyx_t_1), (__pyx_f_8PyClical_toIndexSet(__pyx_v_lhs) ^ __pyx_f_8PyClical_toIndexSet(__pyx_v_rhs)));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 256, __pyx_L1_error)
4513 __Pyx_GOTREF(__pyx_t_2);
4514 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4515 __pyx_r = __pyx_t_2;
4529 __Pyx_XDECREF(__pyx_t_1);
4530 __Pyx_XDECREF(__pyx_t_2);
4531 __Pyx_AddTraceback(
"PyClical.index_set.__xor__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4534 __Pyx_XGIVEREF(__pyx_r);
4535 __Pyx_RefNannyFinishContext();
4548 static PyObject *__pyx_pw_8PyClical_9index_set_22__ixor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
4549 static char __pyx_doc_8PyClical_9index_set_21__ixor__[] =
"\n Symmetric set difference: exclusive or.\n\n >>> x = index_set({1}); x ^= index_set({2}); print x\n {1,2}\n >>> x = index_set({1,2}); x ^= index_set({2}); print x\n {1}\n ";
4550 #if CYTHON_COMPILING_IN_CPYTHON 4551 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_21__ixor__;
4553 static PyObject *__pyx_pw_8PyClical_9index_set_22__ixor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
4554 PyObject *__pyx_r = 0;
4555 __Pyx_RefNannyDeclarations
4556 __Pyx_RefNannySetupContext(
"__ixor__ (wrapper)", 0);
4557 __pyx_r = __pyx_pf_8PyClical_9index_set_21__ixor__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
4560 __Pyx_RefNannyFinishContext();
4564 static PyObject *__pyx_pf_8PyClical_9index_set_21__ixor__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs) {
4565 PyObject *__pyx_r = NULL;
4566 __Pyx_RefNannyDeclarations
4567 PyObject *__pyx_t_1 = NULL;
4568 __Pyx_RefNannySetupContext(
"__ixor__", 0);
4577 __Pyx_XDECREF(__pyx_r);
4578 __pyx_t_1 = __pyx_f_8PyClical_9index_set_wrap(__pyx_v_self, (__pyx_f_8PyClical_9index_set_unwrap(__pyx_v_self) ^ __pyx_f_8PyClical_toIndexSet(__pyx_v_rhs)));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 267, __pyx_L1_error)
4579 __Pyx_GOTREF(__pyx_t_1);
4580 __pyx_r = __pyx_t_1;
4594 __Pyx_XDECREF(__pyx_t_1);
4595 __Pyx_AddTraceback(
"PyClical.index_set.__ixor__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4598 __Pyx_XGIVEREF(__pyx_r);
4599 __Pyx_RefNannyFinishContext();
4612 static PyObject *__pyx_pw_8PyClical_9index_set_24__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
4613 static char __pyx_doc_8PyClical_9index_set_23__and__[] =
"\n Set intersection: and.\n\n >>> print index_set({1}) & index_set({2})\n {}\n >>> print index_set({1,2}) & index_set({2})\n {2}\n ";
4614 #if CYTHON_COMPILING_IN_CPYTHON 4615 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_23__and__;
4617 static PyObject *__pyx_pw_8PyClical_9index_set_24__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4618 PyObject *__pyx_r = 0;
4619 __Pyx_RefNannyDeclarations
4620 __Pyx_RefNannySetupContext(
"__and__ (wrapper)", 0);
4621 __pyx_r = __pyx_pf_8PyClical_9index_set_23__and__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
4624 __Pyx_RefNannyFinishContext();
4628 static PyObject *__pyx_pf_8PyClical_9index_set_23__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4629 PyObject *__pyx_r = NULL;
4630 __Pyx_RefNannyDeclarations
4631 PyObject *__pyx_t_1 = NULL;
4632 PyObject *__pyx_t_2 = NULL;
4633 __Pyx_RefNannySetupContext(
"__and__", 0);
4642 __Pyx_XDECREF(__pyx_r);
4643 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_index_set));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __pyx_L1_error)
4644 __Pyx_GOTREF(__pyx_t_1);
4645 __pyx_t_2 = __pyx_f_8PyClical_9index_set_wrap(((
struct __pyx_obj_8PyClical_index_set *)__pyx_t_1), (__pyx_f_8PyClical_toIndexSet(__pyx_v_lhs) & __pyx_f_8PyClical_toIndexSet(__pyx_v_rhs)));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 278, __pyx_L1_error)
4646 __Pyx_GOTREF(__pyx_t_2);
4647 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4648 __pyx_r = __pyx_t_2;
4662 __Pyx_XDECREF(__pyx_t_1);
4663 __Pyx_XDECREF(__pyx_t_2);
4664 __Pyx_AddTraceback(
"PyClical.index_set.__and__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4667 __Pyx_XGIVEREF(__pyx_r);
4668 __Pyx_RefNannyFinishContext();
4681 static PyObject *__pyx_pw_8PyClical_9index_set_26__iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
4682 static char __pyx_doc_8PyClical_9index_set_25__iand__[] =
"\n Set intersection: and.\n\n >>> x = index_set({1}); x &= index_set({2}); print x\n {}\n >>> x = index_set({1,2}); x &= index_set({2}); print x\n {2}\n ";
4683 #if CYTHON_COMPILING_IN_CPYTHON 4684 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_25__iand__;
4686 static PyObject *__pyx_pw_8PyClical_9index_set_26__iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
4687 PyObject *__pyx_r = 0;
4688 __Pyx_RefNannyDeclarations
4689 __Pyx_RefNannySetupContext(
"__iand__ (wrapper)", 0);
4690 __pyx_r = __pyx_pf_8PyClical_9index_set_25__iand__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
4693 __Pyx_RefNannyFinishContext();
4697 static PyObject *__pyx_pf_8PyClical_9index_set_25__iand__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs) {
4698 PyObject *__pyx_r = NULL;
4699 __Pyx_RefNannyDeclarations
4700 PyObject *__pyx_t_1 = NULL;
4701 __Pyx_RefNannySetupContext(
"__iand__", 0);
4710 __Pyx_XDECREF(__pyx_r);
4711 __pyx_t_1 = __pyx_f_8PyClical_9index_set_wrap(__pyx_v_self, (__pyx_f_8PyClical_9index_set_unwrap(__pyx_v_self) & __pyx_f_8PyClical_toIndexSet(__pyx_v_rhs)));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 289, __pyx_L1_error)
4712 __Pyx_GOTREF(__pyx_t_1);
4713 __pyx_r = __pyx_t_1;
4727 __Pyx_XDECREF(__pyx_t_1);
4728 __Pyx_AddTraceback(
"PyClical.index_set.__iand__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4731 __Pyx_XGIVEREF(__pyx_r);
4732 __Pyx_RefNannyFinishContext();
4745 static PyObject *__pyx_pw_8PyClical_9index_set_28__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
4746 static char __pyx_doc_8PyClical_9index_set_27__or__[] =
"\n Set union: or.\n\n >>> print index_set({1}) | index_set({2})\n {1,2}\n >>> print index_set({1,2}) | index_set({2})\n {1,2}\n ";
4747 #if CYTHON_COMPILING_IN_CPYTHON 4748 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_27__or__;
4750 static PyObject *__pyx_pw_8PyClical_9index_set_28__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4751 PyObject *__pyx_r = 0;
4752 __Pyx_RefNannyDeclarations
4753 __Pyx_RefNannySetupContext(
"__or__ (wrapper)", 0);
4754 __pyx_r = __pyx_pf_8PyClical_9index_set_27__or__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
4757 __Pyx_RefNannyFinishContext();
4761 static PyObject *__pyx_pf_8PyClical_9index_set_27__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4762 PyObject *__pyx_r = NULL;
4763 __Pyx_RefNannyDeclarations
4764 PyObject *__pyx_t_1 = NULL;
4765 PyObject *__pyx_t_2 = NULL;
4766 __Pyx_RefNannySetupContext(
"__or__", 0);
4775 __Pyx_XDECREF(__pyx_r);
4776 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_index_set));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error)
4777 __Pyx_GOTREF(__pyx_t_1);
4778 __pyx_t_2 = __pyx_f_8PyClical_9index_set_wrap(((
struct __pyx_obj_8PyClical_index_set *)__pyx_t_1), (__pyx_f_8PyClical_toIndexSet(__pyx_v_lhs) | __pyx_f_8PyClical_toIndexSet(__pyx_v_rhs)));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 300, __pyx_L1_error)
4779 __Pyx_GOTREF(__pyx_t_2);
4780 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4781 __pyx_r = __pyx_t_2;
4795 __Pyx_XDECREF(__pyx_t_1);
4796 __Pyx_XDECREF(__pyx_t_2);
4797 __Pyx_AddTraceback(
"PyClical.index_set.__or__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4800 __Pyx_XGIVEREF(__pyx_r);
4801 __Pyx_RefNannyFinishContext();
4814 static PyObject *__pyx_pw_8PyClical_9index_set_30__ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
4815 static char __pyx_doc_8PyClical_9index_set_29__ior__[] =
"\n Set union: or.\n\n >>> x = index_set({1}); x |= index_set({2}); print x\n {1,2}\n >>> x = index_set({1,2}); x |= index_set({2}); print x\n {1,2}\n ";
4816 #if CYTHON_COMPILING_IN_CPYTHON 4817 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_29__ior__;
4819 static PyObject *__pyx_pw_8PyClical_9index_set_30__ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
4820 PyObject *__pyx_r = 0;
4821 __Pyx_RefNannyDeclarations
4822 __Pyx_RefNannySetupContext(
"__ior__ (wrapper)", 0);
4823 __pyx_r = __pyx_pf_8PyClical_9index_set_29__ior__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
4826 __Pyx_RefNannyFinishContext();
4830 static PyObject *__pyx_pf_8PyClical_9index_set_29__ior__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs) {
4831 PyObject *__pyx_r = NULL;
4832 __Pyx_RefNannyDeclarations
4833 PyObject *__pyx_t_1 = NULL;
4834 __Pyx_RefNannySetupContext(
"__ior__", 0);
4843 __Pyx_XDECREF(__pyx_r);
4844 __pyx_t_1 = __pyx_f_8PyClical_9index_set_wrap(__pyx_v_self, (__pyx_f_8PyClical_9index_set_unwrap(__pyx_v_self) | __pyx_f_8PyClical_toIndexSet(__pyx_v_rhs)));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 311, __pyx_L1_error)
4845 __Pyx_GOTREF(__pyx_t_1);
4846 __pyx_r = __pyx_t_1;
4860 __Pyx_XDECREF(__pyx_t_1);
4861 __Pyx_AddTraceback(
"PyClical.index_set.__ior__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4864 __Pyx_XGIVEREF(__pyx_r);
4865 __Pyx_RefNannyFinishContext();
4878 static PyObject *__pyx_pw_8PyClical_9index_set_32count(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4879 static char __pyx_doc_8PyClical_9index_set_31count[] =
"\n Cardinality: Number of indices included in set.\n\n >>> index_set({-1,1,2}).count()\n 3\n ";
4880 static PyObject *__pyx_pw_8PyClical_9index_set_32count(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4881 PyObject *__pyx_r = 0;
4882 __Pyx_RefNannyDeclarations
4883 __Pyx_RefNannySetupContext(
"count (wrapper)", 0);
4884 __pyx_r = __pyx_pf_8PyClical_9index_set_31count(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
4887 __Pyx_RefNannyFinishContext();
4891 static PyObject *__pyx_pf_8PyClical_9index_set_31count(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
4892 PyObject *__pyx_r = NULL;
4893 __Pyx_RefNannyDeclarations
4894 PyObject *__pyx_t_1 = NULL;
4895 __Pyx_RefNannySetupContext(
"count", 0);
4904 __Pyx_XDECREF(__pyx_r);
4905 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->instance->count());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error)
4906 __Pyx_GOTREF(__pyx_t_1);
4907 __pyx_r = __pyx_t_1;
4921 __Pyx_XDECREF(__pyx_t_1);
4922 __Pyx_AddTraceback(
"PyClical.index_set.count", __pyx_clineno, __pyx_lineno, __pyx_filename);
4925 __Pyx_XGIVEREF(__pyx_r);
4926 __Pyx_RefNannyFinishContext();
4939 static PyObject *__pyx_pw_8PyClical_9index_set_34count_neg(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4940 static char __pyx_doc_8PyClical_9index_set_33count_neg[] =
"\n Number of negative indices included in set.\n\n >>> index_set({-1,1,2}).count_neg()\n 1\n ";
4941 static PyObject *__pyx_pw_8PyClical_9index_set_34count_neg(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4942 PyObject *__pyx_r = 0;
4943 __Pyx_RefNannyDeclarations
4944 __Pyx_RefNannySetupContext(
"count_neg (wrapper)", 0);
4945 __pyx_r = __pyx_pf_8PyClical_9index_set_33count_neg(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
4948 __Pyx_RefNannyFinishContext();
4952 static PyObject *__pyx_pf_8PyClical_9index_set_33count_neg(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
4953 PyObject *__pyx_r = NULL;
4954 __Pyx_RefNannyDeclarations
4955 PyObject *__pyx_t_1 = NULL;
4956 __Pyx_RefNannySetupContext(
"count_neg", 0);
4965 __Pyx_XDECREF(__pyx_r);
4966 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->instance->count_neg());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error)
4967 __Pyx_GOTREF(__pyx_t_1);
4968 __pyx_r = __pyx_t_1;
4982 __Pyx_XDECREF(__pyx_t_1);
4983 __Pyx_AddTraceback(
"PyClical.index_set.count_neg", __pyx_clineno, __pyx_lineno, __pyx_filename);
4986 __Pyx_XGIVEREF(__pyx_r);
4987 __Pyx_RefNannyFinishContext();
5000 static PyObject *__pyx_pw_8PyClical_9index_set_36count_pos(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5001 static char __pyx_doc_8PyClical_9index_set_35count_pos[] =
"\n Number of positive indices included in set.\n\n >>> index_set({-1,1,2}).count_pos()\n 2\n ";
5002 static PyObject *__pyx_pw_8PyClical_9index_set_36count_pos(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5003 PyObject *__pyx_r = 0;
5004 __Pyx_RefNannyDeclarations
5005 __Pyx_RefNannySetupContext(
"count_pos (wrapper)", 0);
5006 __pyx_r = __pyx_pf_8PyClical_9index_set_35count_pos(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5009 __Pyx_RefNannyFinishContext();
5013 static PyObject *__pyx_pf_8PyClical_9index_set_35count_pos(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5014 PyObject *__pyx_r = NULL;
5015 __Pyx_RefNannyDeclarations
5016 PyObject *__pyx_t_1 = NULL;
5017 __Pyx_RefNannySetupContext(
"count_pos", 0);
5026 __Pyx_XDECREF(__pyx_r);
5027 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->instance->count_pos());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 338, __pyx_L1_error)
5028 __Pyx_GOTREF(__pyx_t_1);
5029 __pyx_r = __pyx_t_1;
5043 __Pyx_XDECREF(__pyx_t_1);
5044 __Pyx_AddTraceback(
"PyClical.index_set.count_pos", __pyx_clineno, __pyx_lineno, __pyx_filename);
5047 __Pyx_XGIVEREF(__pyx_r);
5048 __Pyx_RefNannyFinishContext();
5061 static PyObject *__pyx_pw_8PyClical_9index_set_38min(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5062 static char __pyx_doc_8PyClical_9index_set_37min[] =
"\n Minimum member.\n\n >>> index_set({-1,1,2}).min()\n -1\n ";
5063 static PyObject *__pyx_pw_8PyClical_9index_set_38min(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5064 PyObject *__pyx_r = 0;
5065 __Pyx_RefNannyDeclarations
5066 __Pyx_RefNannySetupContext(
"min (wrapper)", 0);
5067 __pyx_r = __pyx_pf_8PyClical_9index_set_37min(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5070 __Pyx_RefNannyFinishContext();
5074 static PyObject *__pyx_pf_8PyClical_9index_set_37min(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5075 PyObject *__pyx_r = NULL;
5076 __Pyx_RefNannyDeclarations
5077 PyObject *__pyx_t_1 = NULL;
5078 __Pyx_RefNannySetupContext(
"min", 0);
5087 __Pyx_XDECREF(__pyx_r);
5088 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->instance->min());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 347, __pyx_L1_error)
5089 __Pyx_GOTREF(__pyx_t_1);
5090 __pyx_r = __pyx_t_1;
5104 __Pyx_XDECREF(__pyx_t_1);
5105 __Pyx_AddTraceback(
"PyClical.index_set.min", __pyx_clineno, __pyx_lineno, __pyx_filename);
5108 __Pyx_XGIVEREF(__pyx_r);
5109 __Pyx_RefNannyFinishContext();
5122 static PyObject *__pyx_pw_8PyClical_9index_set_40max(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5123 static char __pyx_doc_8PyClical_9index_set_39max[] =
"\n Maximum member.\n\n >>> index_set({-1,1,2}).max()\n 2\n ";
5124 static PyObject *__pyx_pw_8PyClical_9index_set_40max(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5125 PyObject *__pyx_r = 0;
5126 __Pyx_RefNannyDeclarations
5127 __Pyx_RefNannySetupContext(
"max (wrapper)", 0);
5128 __pyx_r = __pyx_pf_8PyClical_9index_set_39max(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5131 __Pyx_RefNannyFinishContext();
5135 static PyObject *__pyx_pf_8PyClical_9index_set_39max(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5136 PyObject *__pyx_r = NULL;
5137 __Pyx_RefNannyDeclarations
5138 PyObject *__pyx_t_1 = NULL;
5139 __Pyx_RefNannySetupContext(
"max", 0);
5148 __Pyx_XDECREF(__pyx_r);
5149 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->instance->max());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error)
5150 __Pyx_GOTREF(__pyx_t_1);
5151 __pyx_r = __pyx_t_1;
5165 __Pyx_XDECREF(__pyx_t_1);
5166 __Pyx_AddTraceback(
"PyClical.index_set.max", __pyx_clineno, __pyx_lineno, __pyx_filename);
5169 __Pyx_XGIVEREF(__pyx_r);
5170 __Pyx_RefNannyFinishContext();
5183 static PyObject *__pyx_pw_8PyClical_9index_set_42hash_fn(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5184 static char __pyx_doc_8PyClical_9index_set_41hash_fn[] =
"\n Hash function.\n ";
5185 static PyObject *__pyx_pw_8PyClical_9index_set_42hash_fn(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5186 PyObject *__pyx_r = 0;
5187 __Pyx_RefNannyDeclarations
5188 __Pyx_RefNannySetupContext(
"hash_fn (wrapper)", 0);
5189 __pyx_r = __pyx_pf_8PyClical_9index_set_41hash_fn(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5192 __Pyx_RefNannyFinishContext();
5196 static PyObject *__pyx_pf_8PyClical_9index_set_41hash_fn(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5197 PyObject *__pyx_r = NULL;
5198 __Pyx_RefNannyDeclarations
5199 PyObject *__pyx_t_1 = NULL;
5200 __Pyx_RefNannySetupContext(
"hash_fn", 0);
5209 __Pyx_XDECREF(__pyx_r);
5210 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->instance->hash_fn());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error)
5211 __Pyx_GOTREF(__pyx_t_1);
5212 __pyx_r = __pyx_t_1;
5226 __Pyx_XDECREF(__pyx_t_1);
5227 __Pyx_AddTraceback(
"PyClical.index_set.hash_fn", __pyx_clineno, __pyx_lineno, __pyx_filename);
5230 __Pyx_XGIVEREF(__pyx_r);
5231 __Pyx_RefNannyFinishContext();
5244 static PyObject *__pyx_pw_8PyClical_9index_set_44sign_of_mult(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
5245 static char __pyx_doc_8PyClical_9index_set_43sign_of_mult[] =
"\n Sign of geometric product of two Clifford basis elements.\n\n >>> s = index_set({1,2}); t=index_set({-1}); s.sign_of_mult(t)\n 1\n ";
5246 static PyObject *__pyx_pw_8PyClical_9index_set_44sign_of_mult(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
5247 PyObject *__pyx_r = 0;
5248 __Pyx_RefNannyDeclarations
5249 __Pyx_RefNannySetupContext(
"sign_of_mult (wrapper)", 0);
5250 __pyx_r = __pyx_pf_8PyClical_9index_set_43sign_of_mult(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
5253 __Pyx_RefNannyFinishContext();
5257 static PyObject *__pyx_pf_8PyClical_9index_set_43sign_of_mult(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs) {
5258 PyObject *__pyx_r = NULL;
5259 __Pyx_RefNannyDeclarations
5260 PyObject *__pyx_t_1 = NULL;
5261 __Pyx_RefNannySetupContext(
"sign_of_mult", 0);
5270 __Pyx_XDECREF(__pyx_r);
5271 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->instance->sign_of_mult(__pyx_f_8PyClical_toIndexSet(__pyx_v_rhs)));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 371, __pyx_L1_error)
5272 __Pyx_GOTREF(__pyx_t_1);
5273 __pyx_r = __pyx_t_1;
5287 __Pyx_XDECREF(__pyx_t_1);
5288 __Pyx_AddTraceback(
"PyClical.index_set.sign_of_mult", __pyx_clineno, __pyx_lineno, __pyx_filename);
5291 __Pyx_XGIVEREF(__pyx_r);
5292 __Pyx_RefNannyFinishContext();
5305 static PyObject *__pyx_pw_8PyClical_9index_set_46sign_of_square(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5306 static char __pyx_doc_8PyClical_9index_set_45sign_of_square[] =
"\n Sign of geometric square of a Clifford basis element.\n\n >>> s = index_set({1,2}); s.sign_of_square()\n -1\n ";
5307 static PyObject *__pyx_pw_8PyClical_9index_set_46sign_of_square(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5308 PyObject *__pyx_r = 0;
5309 __Pyx_RefNannyDeclarations
5310 __Pyx_RefNannySetupContext(
"sign_of_square (wrapper)", 0);
5311 __pyx_r = __pyx_pf_8PyClical_9index_set_45sign_of_square(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5314 __Pyx_RefNannyFinishContext();
5318 static PyObject *__pyx_pf_8PyClical_9index_set_45sign_of_square(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5319 PyObject *__pyx_r = NULL;
5320 __Pyx_RefNannyDeclarations
5321 PyObject *__pyx_t_1 = NULL;
5322 __Pyx_RefNannySetupContext(
"sign_of_square", 0);
5331 __Pyx_XDECREF(__pyx_r);
5332 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->instance->sign_of_square());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error)
5333 __Pyx_GOTREF(__pyx_t_1);
5334 __pyx_r = __pyx_t_1;
5348 __Pyx_XDECREF(__pyx_t_1);
5349 __Pyx_AddTraceback(
"PyClical.index_set.sign_of_square", __pyx_clineno, __pyx_lineno, __pyx_filename);
5352 __Pyx_XGIVEREF(__pyx_r);
5353 __Pyx_RefNannyFinishContext();
5366 static PyObject *__pyx_pw_8PyClical_9index_set_48__repr__(PyObject *__pyx_v_self);
5367 static char __pyx_doc_8PyClical_9index_set_47__repr__[] =
"\n The \342\200\234official\342\200\235 string representation of self.\n\n >>> index_set({1,2}).__repr__()\n 'index_set({1,2})'\n >>> repr(index_set({1,2}))\n 'index_set({1,2})'\n ";
5368 #if CYTHON_COMPILING_IN_CPYTHON 5369 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_47__repr__;
5371 static PyObject *__pyx_pw_8PyClical_9index_set_48__repr__(PyObject *__pyx_v_self) {
5372 PyObject *__pyx_r = 0;
5373 __Pyx_RefNannyDeclarations
5374 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
5375 __pyx_r = __pyx_pf_8PyClical_9index_set_47__repr__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5378 __Pyx_RefNannyFinishContext();
5382 static PyObject *__pyx_pf_8PyClical_9index_set_47__repr__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5383 PyObject *__pyx_r = NULL;
5384 __Pyx_RefNannyDeclarations
5385 PyObject *__pyx_t_1 = NULL;
5386 __Pyx_RefNannySetupContext(
"__repr__", 0);
5395 __Pyx_XDECREF(__pyx_r);
5396 __pyx_t_1 = __Pyx_PyBytes_FromString(
index_set_to_repr(__pyx_f_8PyClical_9index_set_unwrap(__pyx_v_self)).c_str());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error)
5397 __Pyx_GOTREF(__pyx_t_1);
5398 __pyx_r = __pyx_t_1;
5412 __Pyx_XDECREF(__pyx_t_1);
5413 __Pyx_AddTraceback(
"PyClical.index_set.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5416 __Pyx_XGIVEREF(__pyx_r);
5417 __Pyx_RefNannyFinishContext();
5430 static PyObject *__pyx_pw_8PyClical_9index_set_50__str__(PyObject *__pyx_v_self);
5431 static char __pyx_doc_8PyClical_9index_set_49__str__[] =
"\n The \342\200\234informal\342\200\235 string representation of self.\n\n >>> index_set({1,2}).__str__()\n '{1,2}'\n >>> str(index_set({1,2}))\n '{1,2}'\n ";
5432 #if CYTHON_COMPILING_IN_CPYTHON 5433 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_49__str__;
5435 static PyObject *__pyx_pw_8PyClical_9index_set_50__str__(PyObject *__pyx_v_self) {
5436 PyObject *__pyx_r = 0;
5437 __Pyx_RefNannyDeclarations
5438 __Pyx_RefNannySetupContext(
"__str__ (wrapper)", 0);
5439 __pyx_r = __pyx_pf_8PyClical_9index_set_49__str__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5442 __Pyx_RefNannyFinishContext();
5446 static PyObject *__pyx_pf_8PyClical_9index_set_49__str__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5447 PyObject *__pyx_r = NULL;
5448 __Pyx_RefNannyDeclarations
5449 PyObject *__pyx_t_1 = NULL;
5450 __Pyx_RefNannySetupContext(
"__str__", 0);
5459 __Pyx_XDECREF(__pyx_r);
5460 __pyx_t_1 = __Pyx_PyBytes_FromString(
index_set_to_str(__pyx_f_8PyClical_9index_set_unwrap(__pyx_v_self)).c_str());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 402, __pyx_L1_error)
5461 __Pyx_GOTREF(__pyx_t_1);
5462 __pyx_r = __pyx_t_1;
5476 __Pyx_XDECREF(__pyx_t_1);
5477 __Pyx_AddTraceback(
"PyClical.index_set.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5480 __Pyx_XGIVEREF(__pyx_r);
5481 __Pyx_RefNannyFinishContext();
5492 static PyObject *__pyx_pw_8PyClical_9index_set_52__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5493 static PyObject *__pyx_pw_8PyClical_9index_set_52__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5494 PyObject *__pyx_r = 0;
5495 __Pyx_RefNannyDeclarations
5496 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
5497 __pyx_r = __pyx_pf_8PyClical_9index_set_51__reduce_cython__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5500 __Pyx_RefNannyFinishContext();
5504 static PyObject *__pyx_pf_8PyClical_9index_set_51__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5505 PyObject *__pyx_r = NULL;
5506 __Pyx_RefNannyDeclarations
5507 PyObject *__pyx_t_1 = NULL;
5508 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
5516 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
5517 __Pyx_GOTREF(__pyx_t_1);
5518 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5519 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5520 __PYX_ERR(1, 2, __pyx_L1_error)
5530 __Pyx_XDECREF(__pyx_t_1);
5531 __Pyx_AddTraceback(
"PyClical.index_set.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5533 __Pyx_XGIVEREF(__pyx_r);
5534 __Pyx_RefNannyFinishContext();
5546 static PyObject *__pyx_pw_8PyClical_9index_set_54__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
5547 static PyObject *__pyx_pw_8PyClical_9index_set_54__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
5548 PyObject *__pyx_r = 0;
5549 __Pyx_RefNannyDeclarations
5550 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
5551 __pyx_r = __pyx_pf_8PyClical_9index_set_53__setstate_cython__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
5554 __Pyx_RefNannyFinishContext();
5558 static PyObject *__pyx_pf_8PyClical_9index_set_53__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
5559 PyObject *__pyx_r = NULL;
5560 __Pyx_RefNannyDeclarations
5561 PyObject *__pyx_t_1 = NULL;
5562 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
5569 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
5570 __Pyx_GOTREF(__pyx_t_1);
5571 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5572 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5573 __PYX_ERR(1, 4, __pyx_L1_error)
5584 __Pyx_XDECREF(__pyx_t_1);
5585 __Pyx_AddTraceback(
"PyClical.index_set.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5587 __Pyx_XGIVEREF(__pyx_r);
5588 __Pyx_RefNannyFinishContext();
5601 static PyObject *__pyx_pw_8PyClical_1index_set_hidden_doctests(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused);
5602 static char __pyx_doc_8PyClical_index_set_hidden_doctests[] =
"\n Tests for functions that Doctest cannot see.\n\n For index_set.__cinit__: Construct index_set.\n\n >>> print index_set(1)\n {1}\n >>> print index_set({1,2})\n {1,2}\n >>> print index_set(index_set({1,2}))\n {1,2}\n >>> print index_set({1,2})\n {1,2}\n >>> print index_set({1,2,1})\n {1,2}\n >>> print index_set({1,2,1})\n {1,2}\n >>> print index_set(\"\")\n {}\n >>> print index_set(\"{\")\n Traceback (most recent call last):\n ...\n ValueError: Cannot initialize index_set object from invalid string '{'.\n >>> print index_set(\"{1\")\n Traceback (most recent call last):\n ...\n ValueError: Cannot initialize index_set object from invalid string '{1'.\n >>> print index_set(\"{1,2,100}\")\n Traceback (most recent call last):\n ...\n ValueError: Cannot initialize index_set object from invalid string '{1,2,100}'.\n >>> print index_set({1,2,100})\n Traceback (most recent call last):\n ...\n IndexError: Cannot initialize index_set object from invalid set([1, 2, 100]).\n >>> print index_set([1,2])\n Traceback (most recent call last):\n ...\n TypeError: Cannot initialize index_set object from <type 'list'>.\n\n For index_set.__richcmp__: Compare two objects of class index_set.\n\n >>> index_set(1) == index_set({1})\n True\n >>> index_set({1}) != index_set({1})\n False\n >>> index_set({1}) != index_set({2})\n True\n >>> index_set({1}) == index_set({2})\n False\n >>> index_set({1}) < index_set({2})\n True\n >>> index_set({1}) <= index_set({2})\n True\n >>> index_set({1}) > index_set({2})\n False\n >>> index_set({1}) >= index_set({2})\n False\n >>> None == index_set({1,2})\n False\n >>> None != index_set({1,2})\n True\n >>> None < index_set({1,2})\n False\n >>> None <= index_set({1,2})\n False\n >>> None > index_set({1,2})\n False\n >>> None >= index_set({1,2})\n False\n >>> index_se""t({1,2}) == None\n False\n >>> index_set({1,2}) != None\n True\n >>> index_set({1,2}) < None\n False\n >>> index_set({1,2}) <= None\n False\n >>> index_set({1,2}) > None\n False\n >>> index_set({1,2}) >= None\n False\n ";
5603 static PyMethodDef __pyx_mdef_8PyClical_1index_set_hidden_doctests = {
"index_set_hidden_doctests", (PyCFunction)__pyx_pw_8PyClical_1index_set_hidden_doctests, METH_NOARGS, __pyx_doc_8PyClical_index_set_hidden_doctests};
5604 static PyObject *__pyx_pw_8PyClical_1index_set_hidden_doctests(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
5605 PyObject *__pyx_r = 0;
5606 __Pyx_RefNannyDeclarations
5607 __Pyx_RefNannySetupContext(
"index_set_hidden_doctests (wrapper)", 0);
5608 __pyx_r = __pyx_pf_8PyClical_index_set_hidden_doctests(__pyx_self);
5611 __Pyx_RefNannyFinishContext();
5615 static PyObject *__pyx_pf_8PyClical_index_set_hidden_doctests(CYTHON_UNUSED PyObject *__pyx_self) {
5616 PyObject *__pyx_r = NULL;
5617 __Pyx_RefNannyDeclarations
5618 __Pyx_RefNannySetupContext(
"index_set_hidden_doctests", 0);
5627 __Pyx_XDECREF(__pyx_r);
5628 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5641 __Pyx_XGIVEREF(__pyx_r);
5642 __Pyx_RefNannyFinishContext();
5654 static PyObject *__pyx_pw_8PyClical_3compare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5655 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_compare(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs, CYTHON_UNUSED
int __pyx_skip_dispatch) {
5656 PyObject *__pyx_r = NULL;
5657 __Pyx_RefNannyDeclarations
5658 PyObject *__pyx_t_1 = NULL;
5659 __Pyx_RefNannySetupContext(
"compare", 0);
5668 __Pyx_XDECREF(__pyx_r);
5669 __pyx_t_1 = __Pyx_PyInt_From_int(
compare(__pyx_f_8PyClical_toIndexSet(__pyx_v_lhs), __pyx_f_8PyClical_toIndexSet(__pyx_v_rhs)));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 500, __pyx_L1_error)
5670 __Pyx_GOTREF(__pyx_t_1);
5671 __pyx_r = __pyx_t_1;
5685 __Pyx_XDECREF(__pyx_t_1);
5686 __Pyx_AddTraceback(
"PyClical.compare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5689 __Pyx_XGIVEREF(__pyx_r);
5690 __Pyx_RefNannyFinishContext();
5695 static PyObject *__pyx_pw_8PyClical_3compare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5696 static char __pyx_doc_8PyClical_2compare[] =
"\n \"lexicographic compare\" eg. {3,4,5} is less than {3,7,8};\n -1 if a<b, +1 if a>b, 0 if a==b.\n\n >>> compare(index_set({1,2}),index_set({-1,3}))\n -1\n >>> compare(index_set({-1,4}),index_set({-1,3}))\n 1\n ";
5697 static PyObject *__pyx_pw_8PyClical_3compare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5698 PyObject *__pyx_v_lhs = 0;
5699 PyObject *__pyx_v_rhs = 0;
5700 PyObject *__pyx_r = 0;
5701 __Pyx_RefNannyDeclarations
5702 __Pyx_RefNannySetupContext(
"compare (wrapper)", 0);
5704 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lhs,&__pyx_n_s_rhs,0};
5705 PyObject* values[2] = {0,0};
5706 if (unlikely(__pyx_kwds)) {
5708 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5710 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5712 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5715 default:
goto __pyx_L5_argtuple_error;
5717 kw_args = PyDict_Size(__pyx_kwds);
5720 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lhs)) != 0)) kw_args--;
5721 else goto __pyx_L5_argtuple_error;
5724 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rhs)) != 0)) kw_args--;
5726 __Pyx_RaiseArgtupleInvalid(
"compare", 1, 2, 2, 1); __PYX_ERR(0, 490, __pyx_L3_error)
5729 if (unlikely(kw_args > 0)) {
5730 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"compare") < 0)) __PYX_ERR(0, 490, __pyx_L3_error)
5732 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5733 goto __pyx_L5_argtuple_error;
5735 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5736 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5738 __pyx_v_lhs = values[0];
5739 __pyx_v_rhs = values[1];
5741 goto __pyx_L4_argument_unpacking_done;
5742 __pyx_L5_argtuple_error:;
5743 __Pyx_RaiseArgtupleInvalid(
"compare", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 490, __pyx_L3_error)
5745 __Pyx_AddTraceback(
"PyClical.compare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5746 __Pyx_RefNannyFinishContext();
5748 __pyx_L4_argument_unpacking_done:;
5749 __pyx_r = __pyx_pf_8PyClical_2compare(__pyx_self, __pyx_v_lhs, __pyx_v_rhs);
5752 __Pyx_RefNannyFinishContext();
5756 static PyObject *__pyx_pf_8PyClical_2compare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
5757 PyObject *__pyx_r = NULL;
5758 __Pyx_RefNannyDeclarations
5759 PyObject *__pyx_t_1 = NULL;
5760 __Pyx_RefNannySetupContext(
"compare", 0);
5761 __Pyx_XDECREF(__pyx_r);
5762 __pyx_t_1 = __pyx_f_8PyClical_compare(__pyx_v_lhs, __pyx_v_rhs, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 490, __pyx_L1_error)
5763 __Pyx_GOTREF(__pyx_t_1);
5764 __pyx_r = __pyx_t_1;
5770 __Pyx_XDECREF(__pyx_t_1);
5771 __Pyx_AddTraceback(
"PyClical.compare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5774 __Pyx_XGIVEREF(__pyx_r);
5775 __Pyx_RefNannyFinishContext();
5787 static PyObject *__pyx_pw_8PyClical_5min_neg(PyObject *__pyx_self, PyObject *__pyx_v_obj);
5788 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_min_neg(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
5789 PyObject *__pyx_r = NULL;
5790 __Pyx_RefNannyDeclarations
5791 PyObject *__pyx_t_1 = NULL;
5792 __Pyx_RefNannySetupContext(
"min_neg", 0);
5801 __Pyx_XDECREF(__pyx_r);
5802 __pyx_t_1 = __Pyx_PyInt_From_int(
min_neg(__pyx_f_8PyClical_toIndexSet(__pyx_v_obj)));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 509, __pyx_L1_error)
5803 __Pyx_GOTREF(__pyx_t_1);
5804 __pyx_r = __pyx_t_1;
5818 __Pyx_XDECREF(__pyx_t_1);
5819 __Pyx_AddTraceback(
"PyClical.min_neg", __pyx_clineno, __pyx_lineno, __pyx_filename);
5822 __Pyx_XGIVEREF(__pyx_r);
5823 __Pyx_RefNannyFinishContext();
5828 static PyObject *__pyx_pw_8PyClical_5min_neg(PyObject *__pyx_self, PyObject *__pyx_v_obj);
5829 static char __pyx_doc_8PyClical_4min_neg[] =
"\n Minimum negative index, or 0 if none.\n\n >>> min_neg(index_set({1,2}))\n 0\n ";
5830 static PyObject *__pyx_pw_8PyClical_5min_neg(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
5831 PyObject *__pyx_r = 0;
5832 __Pyx_RefNannyDeclarations
5833 __Pyx_RefNannySetupContext(
"min_neg (wrapper)", 0);
5834 __pyx_r = __pyx_pf_8PyClical_4min_neg(__pyx_self, ((PyObject *)__pyx_v_obj));
5837 __Pyx_RefNannyFinishContext();
5841 static PyObject *__pyx_pf_8PyClical_4min_neg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
5842 PyObject *__pyx_r = NULL;
5843 __Pyx_RefNannyDeclarations
5844 PyObject *__pyx_t_1 = NULL;
5845 __Pyx_RefNannySetupContext(
"min_neg", 0);
5846 __Pyx_XDECREF(__pyx_r);
5847 __pyx_t_1 = __pyx_f_8PyClical_min_neg(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 502, __pyx_L1_error)
5848 __Pyx_GOTREF(__pyx_t_1);
5849 __pyx_r = __pyx_t_1;
5855 __Pyx_XDECREF(__pyx_t_1);
5856 __Pyx_AddTraceback(
"PyClical.min_neg", __pyx_clineno, __pyx_lineno, __pyx_filename);
5859 __Pyx_XGIVEREF(__pyx_r);
5860 __Pyx_RefNannyFinishContext();
5872 static PyObject *__pyx_pw_8PyClical_7max_pos(PyObject *__pyx_self, PyObject *__pyx_v_obj);
5873 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_max_pos(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
5874 PyObject *__pyx_r = NULL;
5875 __Pyx_RefNannyDeclarations
5876 PyObject *__pyx_t_1 = NULL;
5877 __Pyx_RefNannySetupContext(
"max_pos", 0);
5886 __Pyx_XDECREF(__pyx_r);
5887 __pyx_t_1 = __Pyx_PyInt_From_int(
max_pos(__pyx_f_8PyClical_toIndexSet(__pyx_v_obj)));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error)
5888 __Pyx_GOTREF(__pyx_t_1);
5889 __pyx_r = __pyx_t_1;
5903 __Pyx_XDECREF(__pyx_t_1);
5904 __Pyx_AddTraceback(
"PyClical.max_pos", __pyx_clineno, __pyx_lineno, __pyx_filename);
5907 __Pyx_XGIVEREF(__pyx_r);
5908 __Pyx_RefNannyFinishContext();
5913 static PyObject *__pyx_pw_8PyClical_7max_pos(PyObject *__pyx_self, PyObject *__pyx_v_obj);
5914 static char __pyx_doc_8PyClical_6max_pos[] =
"\n Maximum positive index, or 0 if none.\n\n >>> max_pos(index_set({1,2}))\n 2\n ";
5915 static PyObject *__pyx_pw_8PyClical_7max_pos(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
5916 PyObject *__pyx_r = 0;
5917 __Pyx_RefNannyDeclarations
5918 __Pyx_RefNannySetupContext(
"max_pos (wrapper)", 0);
5919 __pyx_r = __pyx_pf_8PyClical_6max_pos(__pyx_self, ((PyObject *)__pyx_v_obj));
5922 __Pyx_RefNannyFinishContext();
5926 static PyObject *__pyx_pf_8PyClical_6max_pos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
5927 PyObject *__pyx_r = NULL;
5928 __Pyx_RefNannyDeclarations
5929 PyObject *__pyx_t_1 = NULL;
5930 __Pyx_RefNannySetupContext(
"max_pos", 0);
5931 __Pyx_XDECREF(__pyx_r);
5932 __pyx_t_1 = __pyx_f_8PyClical_max_pos(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 511, __pyx_L1_error)
5933 __Pyx_GOTREF(__pyx_t_1);
5934 __pyx_r = __pyx_t_1;
5940 __Pyx_XDECREF(__pyx_t_1);
5941 __Pyx_AddTraceback(
"PyClical.max_pos", __pyx_clineno, __pyx_lineno, __pyx_filename);
5944 __Pyx_XGIVEREF(__pyx_r);
5945 __Pyx_RefNannyFinishContext();
5957 static CYTHON_INLINE std::vector<scalar_t> __pyx_f_8PyClical_list_to_vector(PyObject *__pyx_v_lst) {
5958 std::vector<scalar_t> __pyx_v_v;
5959 PyObject *__pyx_v_s = NULL;
5960 std::vector<scalar_t> __pyx_r;
5961 __Pyx_RefNannyDeclarations
5962 PyObject *__pyx_t_1 = NULL;
5963 Py_ssize_t __pyx_t_2;
5964 PyObject *(*__pyx_t_3)(PyObject *);
5965 PyObject *__pyx_t_4 = NULL;
5967 __Pyx_RefNannySetupContext(
"list_to_vector", 0);
5976 if (likely(PyList_CheckExact(__pyx_v_lst)) || PyTuple_CheckExact(__pyx_v_lst)) {
5977 __pyx_t_1 = __pyx_v_lst; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
5980 __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_lst);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error)
5981 __Pyx_GOTREF(__pyx_t_1);
5982 __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 525, __pyx_L1_error)
5985 if (likely(!__pyx_t_3)) {
5986 if (likely(PyList_CheckExact(__pyx_t_1))) {
5987 if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1))
break;
5988 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 5989 __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, 525, __pyx_L1_error)
5991 __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error)
5992 __Pyx_GOTREF(__pyx_t_4);
5995 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1))
break;
5996 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 5997 __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, 525, __pyx_L1_error)
5999 __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error)
6000 __Pyx_GOTREF(__pyx_t_4);
6004 __pyx_t_4 = __pyx_t_3(__pyx_t_1);
6005 if (unlikely(!__pyx_t_4)) {
6006 PyObject* exc_type = PyErr_Occurred();
6008 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
6009 else __PYX_ERR(0, 525, __pyx_L1_error)
6013 __Pyx_GOTREF(__pyx_t_4);
6015 __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_4);
6025 __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_s);
if (unlikely((__pyx_t_5 == ((
scalar_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 526, __pyx_L1_error)
6027 __pyx_v_v.push_back(((
scalar_t)__pyx_t_5));
6029 __Pyx_CppExn2PyErr();
6030 __PYX_ERR(0, 526, __pyx_L1_error)
6041 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6050 __pyx_r = __pyx_v_v;
6063 __Pyx_XDECREF(__pyx_t_1);
6064 __Pyx_XDECREF(__pyx_t_4);
6065 __Pyx_WriteUnraisable(
"PyClical.list_to_vector", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6066 __Pyx_pretend_to_initialize(&__pyx_r);
6068 __Pyx_XDECREF(__pyx_v_s);
6069 __Pyx_RefNannyFinishContext();
6081 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_toClifford(PyObject *__pyx_v_obj) {
6083 __Pyx_RefNannyDeclarations
6084 PyObject *__pyx_t_1 = NULL;
6085 __Pyx_RefNannySetupContext(
"toClifford", 0);
6094 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_v_obj);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 533, __pyx_L1_error)
6095 __Pyx_GOTREF(__pyx_t_1);
6096 __pyx_r = (((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_1)->instance[0]);
6097 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6110 __Pyx_XDECREF(__pyx_t_1);
6111 __Pyx_WriteUnraisable(
"PyClical.toClifford", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6112 __Pyx_pretend_to_initialize(&__pyx_r);
6114 __Pyx_RefNannyFinishContext();
6126 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_8clifford_wrap(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self,
Clifford __pyx_v_other) {
6127 PyObject *__pyx_r = NULL;
6128 __Pyx_RefNannyDeclarations
6129 __Pyx_RefNannySetupContext(
"wrap", 0);
6138 (__pyx_v_self->instance[0]) = __pyx_v_other;
6147 __Pyx_XDECREF(__pyx_r);
6148 __Pyx_INCREF(((PyObject *)__pyx_v_self));
6149 __pyx_r = ((PyObject *)__pyx_v_self);
6162 __Pyx_XGIVEREF(__pyx_r);
6163 __Pyx_RefNannyFinishContext();
6175 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_8clifford_unwrap(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
6177 __Pyx_RefNannyDeclarations
6178 __Pyx_RefNannySetupContext(
"unwrap", 0);
6187 __pyx_r = (__pyx_v_self->instance[0]);
6200 __Pyx_RefNannyFinishContext();
6212 static PyObject *__pyx_pw_8PyClical_8clifford_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
6213 static PyObject *__pyx_f_8PyClical_8clifford_copy(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self,
int __pyx_skip_dispatch) {
6214 PyObject *__pyx_r = NULL;
6215 __Pyx_RefNannyDeclarations
6216 PyObject *__pyx_t_1 = NULL;
6217 PyObject *__pyx_t_2 = NULL;
6218 PyObject *__pyx_t_3 = NULL;
6219 PyObject *__pyx_t_4 = NULL;
6220 __Pyx_RefNannySetupContext(
"copy", 0);
6222 if (unlikely(__pyx_skip_dispatch)) ;
6224 else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
6225 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS 6226 static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
6227 if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
6228 PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
6230 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 554, __pyx_L1_error)
6231 __Pyx_GOTREF(__pyx_t_1);
6232 if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(
void*)__pyx_pw_8PyClical_8clifford_1copy)) {
6233 __Pyx_XDECREF(__pyx_r);
6234 __Pyx_INCREF(__pyx_t_1);
6235 __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
6236 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
6237 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
6238 if (likely(__pyx_t_4)) {
6239 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
6240 __Pyx_INCREF(__pyx_t_4);
6241 __Pyx_INCREF(
function);
6242 __Pyx_DECREF_SET(__pyx_t_3,
function);
6245 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
6246 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6247 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 554, __pyx_L1_error)
6248 __Pyx_GOTREF(__pyx_t_2);
6249 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6250 __pyx_r = __pyx_t_2;
6252 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6255 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS 6256 __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
6257 __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
6258 if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
6259 __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
6262 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6263 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS 6275 __Pyx_XDECREF(__pyx_r);
6276 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_clifford), ((PyObject *)__pyx_v_self));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 561, __pyx_L1_error)
6277 __Pyx_GOTREF(__pyx_t_1);
6278 __pyx_r = __pyx_t_1;
6292 __Pyx_XDECREF(__pyx_t_1);
6293 __Pyx_XDECREF(__pyx_t_2);
6294 __Pyx_XDECREF(__pyx_t_3);
6295 __Pyx_XDECREF(__pyx_t_4);
6296 __Pyx_AddTraceback(
"PyClical.clifford.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
6299 __Pyx_XGIVEREF(__pyx_r);
6300 __Pyx_RefNannyFinishContext();
6305 static PyObject *__pyx_pw_8PyClical_8clifford_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
6306 static char __pyx_doc_8PyClical_8clifford_copy[] =
"\n Copy this clifford object.\n\n >>> x=clifford(\"1{2}\"); y=x.copy(); print y\n {2}\n ";
6307 static PyObject *__pyx_pw_8PyClical_8clifford_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
6308 PyObject *__pyx_r = 0;
6309 __Pyx_RefNannyDeclarations
6310 __Pyx_RefNannySetupContext(
"copy (wrapper)", 0);
6311 __pyx_r = __pyx_pf_8PyClical_8clifford_copy(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
6314 __Pyx_RefNannyFinishContext();
6318 static PyObject *__pyx_pf_8PyClical_8clifford_copy(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
6319 PyObject *__pyx_r = NULL;
6320 __Pyx_RefNannyDeclarations
6321 PyObject *__pyx_t_1 = NULL;
6322 __Pyx_RefNannySetupContext(
"copy", 0);
6323 __Pyx_XDECREF(__pyx_r);
6324 __pyx_t_1 = __pyx_f_8PyClical_8clifford_copy(__pyx_v_self, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 554, __pyx_L1_error)
6325 __Pyx_GOTREF(__pyx_t_1);
6326 __pyx_r = __pyx_t_1;
6332 __Pyx_XDECREF(__pyx_t_1);
6333 __Pyx_AddTraceback(
"PyClical.clifford.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
6336 __Pyx_XGIVEREF(__pyx_r);
6337 __Pyx_RefNannyFinishContext();
6350 static int __pyx_pw_8PyClical_8clifford_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6351 static int __pyx_pw_8PyClical_8clifford_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6352 PyObject *__pyx_v_other = 0;
6353 PyObject *__pyx_v_ixt = 0;
6355 __Pyx_RefNannyDeclarations
6356 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
6358 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_ixt,0};
6359 PyObject* values[2] = {0,0};
6360 values[0] = ((PyObject *)__pyx_int_0);
6361 values[1] = ((PyObject *)Py_None);
6362 if (unlikely(__pyx_kwds)) {
6364 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6366 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6368 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6371 default:
goto __pyx_L5_argtuple_error;
6373 kw_args = PyDict_Size(__pyx_kwds);
6377 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other);
6378 if (value) { values[0] = value; kw_args--; }
6383 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ixt);
6384 if (value) { values[1] = value; kw_args--; }
6387 if (unlikely(kw_args > 0)) {
6388 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(0, 563, __pyx_L3_error)
6391 switch (PyTuple_GET_SIZE(__pyx_args)) {
6392 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6394 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6397 default:
goto __pyx_L5_argtuple_error;
6400 __pyx_v_other = values[0];
6401 __pyx_v_ixt = values[1];
6403 goto __pyx_L4_argument_unpacking_done;
6404 __pyx_L5_argtuple_error:;
6405 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 563, __pyx_L3_error)
6407 __Pyx_AddTraceback(
"PyClical.clifford.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6408 __Pyx_RefNannyFinishContext();
6410 __pyx_L4_argument_unpacking_done:;
6411 __pyx_r = __pyx_pf_8PyClical_8clifford_2__cinit__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), __pyx_v_other, __pyx_v_ixt);
6414 __Pyx_RefNannyFinishContext();
6418 static int __pyx_pf_8PyClical_8clifford_2__cinit__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_ixt) {
6419 PyObject *__pyx_v_error_msg_prefix = NULL;
6420 PyObject *__pyx_v_err = NULL;
6422 __Pyx_RefNannyDeclarations
6425 PyObject *__pyx_t_3 = NULL;
6426 PyObject *__pyx_t_4 = NULL;
6427 PyObject *__pyx_t_5 = NULL;
6429 PyObject *__pyx_t_7 = NULL;
6430 PyObject *__pyx_t_8 = NULL;
6432 PyObject *__pyx_t_10 = NULL;
6433 PyObject *__pyx_t_11 = NULL;
6434 PyObject *__pyx_t_12 = NULL;
6437 PyObject *__pyx_t_15 = NULL;
6438 PyObject *__pyx_t_16 = NULL;
6439 PyObject *__pyx_t_17 = NULL;
6440 PyObject *__pyx_t_18 = NULL;
6441 __Pyx_RefNannySetupContext(
"__cinit__", 0);
6450 __Pyx_INCREF(__pyx_kp_s_Cannot_initialize_clifford_objec);
6451 __pyx_v_error_msg_prefix = __pyx_kp_s_Cannot_initialize_clifford_objec;
6460 __pyx_t_1 = (__pyx_v_ixt == Py_None);
6461 __pyx_t_2 = (__pyx_t_1 != 0);
6472 __Pyx_PyThreadState_declare
6473 __Pyx_PyThreadState_assign
6474 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
6475 __Pyx_XGOTREF(__pyx_t_3);
6476 __Pyx_XGOTREF(__pyx_t_4);
6477 __Pyx_XGOTREF(__pyx_t_5);
6487 __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8PyClical_clifford);
6488 __pyx_t_1 = (__pyx_t_2 != 0);
6499 __pyx_t_6 =
new Clifford(__pyx_f_8PyClical_8clifford_unwrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_other)));
6501 __Pyx_CppExn2PyErr();
6502 __PYX_ERR(0, 592, __pyx_L4_error)
6504 __pyx_v_self->instance = __pyx_t_6;
6523 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8PyClical_index_set);
6524 __pyx_t_2 = (__pyx_t_1 != 0);
6535 __pyx_t_6 =
new Clifford(__pyx_f_8PyClical_9index_set_unwrap(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_other)), ((
scalar_t)1.0));
6537 __Pyx_CppExn2PyErr();
6538 __PYX_ERR(0, 594, __pyx_L4_error)
6540 __pyx_v_self->instance = __pyx_t_6;
6559 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_numbers);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 595, __pyx_L4_error)
6560 __Pyx_GOTREF(__pyx_t_7);
6561 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_Real);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 595, __pyx_L4_error)
6562 __Pyx_GOTREF(__pyx_t_8);
6563 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6564 __pyx_t_2 = PyObject_IsInstance(__pyx_v_other, __pyx_t_8);
if (unlikely(__pyx_t_2 == ((
int)-1))) __PYX_ERR(0, 595, __pyx_L4_error)
6565 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6566 __pyx_t_1 = (__pyx_t_2 != 0);
6576 __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_other);
if (unlikely((__pyx_t_9 == ((
scalar_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 596, __pyx_L4_error)
6580 __Pyx_CppExn2PyErr();
6581 __PYX_ERR(0, 596, __pyx_L4_error)
6583 __pyx_v_self->instance = __pyx_t_6;
6602 __pyx_t_1 = PyString_Check(__pyx_v_other);
6603 __pyx_t_2 = (__pyx_t_1 != 0);
6604 if (likely(__pyx_t_2)) {
6614 __Pyx_PyThreadState_declare
6615 __Pyx_PyThreadState_assign
6616 __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
6617 __Pyx_XGOTREF(__pyx_t_10);
6618 __Pyx_XGOTREF(__pyx_t_11);
6619 __Pyx_XGOTREF(__pyx_t_12);
6629 __pyx_t_13 = __Pyx_PyObject_AsWritableString(__pyx_v_other);
if (unlikely((!__pyx_t_13) && PyErr_Occurred())) __PYX_ERR(0, 599, __pyx_L11_error)
6631 __pyx_t_6 =
new Clifford(((
char *)__pyx_t_13));
6633 __Pyx_CppExn2PyErr();
6634 __PYX_ERR(0, 599, __pyx_L11_error)
6636 __pyx_v_self->instance = __pyx_t_6;
6646 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
6647 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
6648 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
6649 goto __pyx_L16_try_end;
6651 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6652 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
6661 __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
6663 __Pyx_AddTraceback(
"PyClical.clifford.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6664 if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_15) < 0) __PYX_ERR(0, 600, __pyx_L13_except_error)
6665 __Pyx_GOTREF(__pyx_t_8);
6666 __Pyx_GOTREF(__pyx_t_7);
6667 __Pyx_GOTREF(__pyx_t_15);
6676 __pyx_t_16 = PyNumber_Add(__pyx_v_error_msg_prefix, __pyx_kp_s_invalid_string);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 601, __pyx_L13_except_error)
6677 __Pyx_GOTREF(__pyx_t_16);
6678 __pyx_t_17 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 601, __pyx_L13_except_error)
6679 __Pyx_GOTREF(__pyx_t_17);
6680 __pyx_t_18 = PyNumber_Add(__pyx_t_16, __pyx_t_17);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 601, __pyx_L13_except_error)
6681 __Pyx_GOTREF(__pyx_t_18);
6682 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6683 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6684 __pyx_t_17 = PyNumber_Add(__pyx_t_18, __pyx_kp_s_);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 601, __pyx_L13_except_error)
6685 __Pyx_GOTREF(__pyx_t_17);
6686 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6687 __pyx_t_18 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_17);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 601, __pyx_L13_except_error)
6688 __Pyx_GOTREF(__pyx_t_18);
6689 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6690 __Pyx_Raise(__pyx_t_18, 0, 0, 0);
6691 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6692 __PYX_ERR(0, 601, __pyx_L13_except_error)
6694 goto __pyx_L13_except_error;
6695 __pyx_L13_except_error:;
6704 __Pyx_XGIVEREF(__pyx_t_10);
6705 __Pyx_XGIVEREF(__pyx_t_11);
6706 __Pyx_XGIVEREF(__pyx_t_12);
6707 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
6708 goto __pyx_L4_error;
6730 __pyx_t_15 = PyNumber_Add(__pyx_v_error_msg_prefix, __pyx_kp_s__2);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 603, __pyx_L4_error)
6731 __Pyx_GOTREF(__pyx_t_15);
6732 __pyx_t_7 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), ((PyObject *)Py_TYPE(__pyx_v_other)));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 603, __pyx_L4_error)
6733 __Pyx_GOTREF(__pyx_t_7);
6734 __pyx_t_8 = PyNumber_Add(__pyx_t_15, __pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 603, __pyx_L4_error)
6735 __Pyx_GOTREF(__pyx_t_8);
6736 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6737 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6738 __pyx_t_7 = PyNumber_Add(__pyx_t_8, __pyx_kp_s_);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 603, __pyx_L4_error)
6739 __Pyx_GOTREF(__pyx_t_7);
6740 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6741 __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 603, __pyx_L4_error)
6742 __Pyx_GOTREF(__pyx_t_8);
6743 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6744 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
6745 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6746 __PYX_ERR(0, 603, __pyx_L4_error)
6758 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6759 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6760 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
6761 goto __pyx_L9_try_end;
6763 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
6764 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
6765 __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
6766 __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
6767 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6768 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
6777 __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
6779 __Pyx_AddTraceback(
"PyClical.clifford.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6780 if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_15) < 0) __PYX_ERR(0, 604, __pyx_L6_except_error)
6781 __Pyx_GOTREF(__pyx_t_8);
6782 __Pyx_GOTREF(__pyx_t_7);
6783 __Pyx_GOTREF(__pyx_t_15);
6784 __Pyx_INCREF(__pyx_t_7);
6785 __pyx_v_err = __pyx_t_7;
6794 __pyx_t_18 = PyNumber_Add(__pyx_v_error_msg_prefix, __pyx_kp_s__2);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 605, __pyx_L6_except_error)
6795 __Pyx_GOTREF(__pyx_t_18);
6796 __pyx_t_17 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), ((PyObject *)Py_TYPE(__pyx_v_other)));
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 605, __pyx_L6_except_error)
6797 __Pyx_GOTREF(__pyx_t_17);
6798 __pyx_t_16 = PyNumber_Add(__pyx_t_18, __pyx_t_17);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 605, __pyx_L6_except_error)
6799 __Pyx_GOTREF(__pyx_t_16);
6800 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6801 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6810 __pyx_t_17 = PyNumber_Add(__pyx_t_16, __pyx_kp_s_value);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 606, __pyx_L6_except_error)
6811 __Pyx_GOTREF(__pyx_t_17);
6812 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6813 __pyx_t_16 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 606, __pyx_L6_except_error)
6814 __Pyx_GOTREF(__pyx_t_16);
6815 __pyx_t_18 = PyNumber_Add(__pyx_t_17, __pyx_t_16);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 606, __pyx_L6_except_error)
6816 __Pyx_GOTREF(__pyx_t_18);
6817 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6818 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6819 __pyx_t_16 = PyNumber_Add(__pyx_t_18, __pyx_kp_s__5);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 606, __pyx_L6_except_error)
6820 __Pyx_GOTREF(__pyx_t_16);
6821 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6830 __pyx_t_18 = PyNumber_Add(__pyx_t_16, __pyx_kp_s__6);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 607, __pyx_L6_except_error)
6831 __Pyx_GOTREF(__pyx_t_18);
6832 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6833 __pyx_t_16 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_err);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 607, __pyx_L6_except_error)
6834 __Pyx_GOTREF(__pyx_t_16);
6835 __pyx_t_17 = PyNumber_Add(__pyx_t_18, __pyx_t_16);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 607, __pyx_L6_except_error)
6836 __Pyx_GOTREF(__pyx_t_17);
6837 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6838 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6847 __pyx_t_16 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_17);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 605, __pyx_L6_except_error)
6848 __Pyx_GOTREF(__pyx_t_16);
6849 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6850 __Pyx_Raise(__pyx_t_16, 0, 0, 0);
6851 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6852 __PYX_ERR(0, 605, __pyx_L6_except_error)
6854 goto __pyx_L6_except_error;
6855 __pyx_L6_except_error:;
6864 __Pyx_XGIVEREF(__pyx_t_3);
6865 __Pyx_XGIVEREF(__pyx_t_4);
6866 __Pyx_XGIVEREF(__pyx_t_5);
6867 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
6868 goto __pyx_L1_error;
6889 __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_ixt, __pyx_ptype_8PyClical_index_set);
6890 __pyx_t_1 = (__pyx_t_2 != 0);
6891 if (likely(__pyx_t_1)) {
6900 __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_numbers);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 609, __pyx_L1_error)
6901 __Pyx_GOTREF(__pyx_t_15);
6902 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_Real);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 609, __pyx_L1_error)
6903 __Pyx_GOTREF(__pyx_t_7);
6904 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6905 __pyx_t_1 = PyObject_IsInstance(__pyx_v_other, __pyx_t_7);
if (unlikely(__pyx_t_1 == ((
int)-1))) __PYX_ERR(0, 609, __pyx_L1_error)
6906 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6907 __pyx_t_2 = (__pyx_t_1 != 0);
6917 __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_other);
if (unlikely((__pyx_t_9 == ((
scalar_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 610, __pyx_L1_error)
6919 __pyx_t_6 =
new Clifford(__pyx_f_8PyClical_9index_set_unwrap(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_ixt)), ((
scalar_t)__pyx_t_9));
6921 __Pyx_CppExn2PyErr();
6922 __PYX_ERR(0, 610, __pyx_L1_error)
6924 __pyx_v_self->instance = __pyx_t_6;
6943 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_collections);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 611, __pyx_L1_error)
6944 __Pyx_GOTREF(__pyx_t_7);
6945 __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_Sequence);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 611, __pyx_L1_error)
6946 __Pyx_GOTREF(__pyx_t_15);
6947 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6948 __pyx_t_2 = PyObject_IsInstance(__pyx_v_other, __pyx_t_15);
if (unlikely(__pyx_t_2 == ((
int)-1))) __PYX_ERR(0, 611, __pyx_L1_error)
6949 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6950 __pyx_t_1 = (__pyx_t_2 != 0);
6951 if (likely(__pyx_t_1)) {
6961 __pyx_t_6 =
new Clifford(__pyx_f_8PyClical_list_to_vector(__pyx_v_other), __pyx_f_8PyClical_9index_set_unwrap(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_ixt)));
6963 __Pyx_CppExn2PyErr();
6964 __PYX_ERR(0, 612, __pyx_L1_error)
6966 __pyx_v_self->instance = __pyx_t_6;
6986 __pyx_t_15 = PyNumber_Add(__pyx_v_error_msg_prefix, __pyx_kp_s__7);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 614, __pyx_L1_error)
6987 __Pyx_GOTREF(__pyx_t_15);
6988 __pyx_t_7 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), ((PyObject *)Py_TYPE(__pyx_v_other)));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 614, __pyx_L1_error)
6989 __Pyx_GOTREF(__pyx_t_7);
6990 __pyx_t_8 = PyNumber_Add(__pyx_t_15, __pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 614, __pyx_L1_error)
6991 __Pyx_GOTREF(__pyx_t_8);
6992 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6993 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7002 __pyx_t_7 = PyNumber_Add(__pyx_t_8, __pyx_kp_s__8);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 615, __pyx_L1_error)
7003 __Pyx_GOTREF(__pyx_t_7);
7004 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7005 __pyx_t_8 = PyObject_Repr(__pyx_v_ixt);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 615, __pyx_L1_error)
7006 __Pyx_GOTREF(__pyx_t_8);
7007 __pyx_t_15 = PyNumber_Add(__pyx_t_7, __pyx_t_8);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 615, __pyx_L1_error)
7008 __Pyx_GOTREF(__pyx_t_15);
7009 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7010 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7011 __pyx_t_8 = PyNumber_Add(__pyx_t_15, __pyx_kp_s__9);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 615, __pyx_L1_error)
7012 __Pyx_GOTREF(__pyx_t_8);
7013 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7022 __pyx_t_15 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_8);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 614, __pyx_L1_error)
7023 __Pyx_GOTREF(__pyx_t_15);
7024 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7025 __Pyx_Raise(__pyx_t_15, 0, 0, 0);
7026 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7027 __PYX_ERR(0, 614, __pyx_L1_error)
7049 __pyx_t_15 = PyNumber_Add(__pyx_v_error_msg_prefix, __pyx_kp_s__7);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 617, __pyx_L1_error)
7050 __Pyx_GOTREF(__pyx_t_15);
7051 __pyx_t_8 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), ((PyObject *)Py_TYPE(__pyx_v_other)));
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 617, __pyx_L1_error)
7052 __Pyx_GOTREF(__pyx_t_8);
7053 __pyx_t_7 = PyNumber_Add(__pyx_t_15, __pyx_t_8);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 617, __pyx_L1_error)
7054 __Pyx_GOTREF(__pyx_t_7);
7055 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7056 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7065 __pyx_t_8 = PyNumber_Add(__pyx_t_7, __pyx_kp_s__8);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 618, __pyx_L1_error)
7066 __Pyx_GOTREF(__pyx_t_8);
7067 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7068 __pyx_t_7 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), ((PyObject *)Py_TYPE(__pyx_v_ixt)));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 618, __pyx_L1_error)
7069 __Pyx_GOTREF(__pyx_t_7);
7070 __pyx_t_15 = PyNumber_Add(__pyx_t_8, __pyx_t_7);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 618, __pyx_L1_error)
7071 __Pyx_GOTREF(__pyx_t_15);
7072 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7073 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7074 __pyx_t_7 = PyNumber_Add(__pyx_t_15, __pyx_kp_s__9);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 618, __pyx_L1_error)
7075 __Pyx_GOTREF(__pyx_t_7);
7076 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7085 __pyx_t_15 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 617, __pyx_L1_error)
7086 __Pyx_GOTREF(__pyx_t_15);
7087 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7088 __Pyx_Raise(__pyx_t_15, 0, 0, 0);
7089 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7090 __PYX_ERR(0, 617, __pyx_L1_error)
7106 __Pyx_XDECREF(__pyx_t_7);
7107 __Pyx_XDECREF(__pyx_t_8);
7108 __Pyx_XDECREF(__pyx_t_15);
7109 __Pyx_XDECREF(__pyx_t_16);
7110 __Pyx_XDECREF(__pyx_t_17);
7111 __Pyx_XDECREF(__pyx_t_18);
7112 __Pyx_AddTraceback(
"PyClical.clifford.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7115 __Pyx_XDECREF(__pyx_v_error_msg_prefix);
7116 __Pyx_XDECREF(__pyx_v_err);
7117 __Pyx_RefNannyFinishContext();
7130 static void __pyx_pw_8PyClical_8clifford_5__dealloc__(PyObject *__pyx_v_self);
7131 static void __pyx_pw_8PyClical_8clifford_5__dealloc__(PyObject *__pyx_v_self) {
7132 __Pyx_RefNannyDeclarations
7133 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
7134 __pyx_pf_8PyClical_8clifford_4__dealloc__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
7137 __Pyx_RefNannyFinishContext();
7140 static void __pyx_pf_8PyClical_8clifford_4__dealloc__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
7141 __Pyx_RefNannyDeclarations
7142 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
7151 delete __pyx_v_self->instance;
7162 __Pyx_RefNannyFinishContext();
7174 static int __pyx_pw_8PyClical_8clifford_7__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_x);
7175 static char __pyx_doc_8PyClical_8clifford_6__contains__[] =
"\n Not applicable.\n\n >>> x=clifford(index_set({-3,4,7})); -3 in x\n Traceback (most recent call last):\n ...\n TypeError: Not applicable.\n ";
7176 #if CYTHON_COMPILING_IN_CPYTHON 7177 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_6__contains__;
7179 static int __pyx_pw_8PyClical_8clifford_7__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_x) {
7181 __Pyx_RefNannyDeclarations
7182 __Pyx_RefNannySetupContext(
"__contains__ (wrapper)", 0);
7183 __pyx_r = __pyx_pf_8PyClical_8clifford_6__contains__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_x));
7186 __Pyx_RefNannyFinishContext();
7190 static int __pyx_pf_8PyClical_8clifford_6__contains__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_x) {
7192 __Pyx_RefNannyDeclarations
7193 PyObject *__pyx_t_1 = NULL;
7194 __Pyx_RefNannySetupContext(
"__contains__", 0);
7203 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__10, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error)
7204 __Pyx_GOTREF(__pyx_t_1);
7205 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
7206 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7207 __PYX_ERR(0, 635, __pyx_L1_error)
7219 __Pyx_XDECREF(__pyx_t_1);
7220 __Pyx_AddTraceback(
"PyClical.clifford.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7222 __Pyx_RefNannyFinishContext();
7235 static PyObject *__pyx_pw_8PyClical_8clifford_9__iter__(PyObject *__pyx_v_self);
7236 static char __pyx_doc_8PyClical_8clifford_8__iter__[] =
"\n Not applicable.\n\n >>> for a in clifford(index_set({-3,4,7})): print a,\n Traceback (most recent call last):\n ...\n TypeError: Not applicable.\n ";
7237 #if CYTHON_COMPILING_IN_CPYTHON 7238 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_8__iter__;
7240 static PyObject *__pyx_pw_8PyClical_8clifford_9__iter__(PyObject *__pyx_v_self) {
7241 PyObject *__pyx_r = 0;
7242 __Pyx_RefNannyDeclarations
7243 __Pyx_RefNannySetupContext(
"__iter__ (wrapper)", 0);
7244 __pyx_r = __pyx_pf_8PyClical_8clifford_8__iter__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
7247 __Pyx_RefNannyFinishContext();
7251 static PyObject *__pyx_pf_8PyClical_8clifford_8__iter__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
7252 PyObject *__pyx_r = NULL;
7253 __Pyx_RefNannyDeclarations
7254 PyObject *__pyx_t_1 = NULL;
7255 __Pyx_RefNannySetupContext(
"__iter__", 0);
7264 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__10, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 646, __pyx_L1_error)
7265 __Pyx_GOTREF(__pyx_t_1);
7266 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
7267 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7268 __PYX_ERR(0, 646, __pyx_L1_error)
7280 __Pyx_XDECREF(__pyx_t_1);
7281 __Pyx_AddTraceback(
"PyClical.clifford.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7283 __Pyx_XGIVEREF(__pyx_r);
7284 __Pyx_RefNannyFinishContext();
7297 static PyObject *__pyx_pw_8PyClical_8clifford_11reframe(PyObject *__pyx_v_self, PyObject *__pyx_v_ixt);
7298 static char __pyx_doc_8PyClical_8clifford_10reframe[] =
"\n Put self into a larger frame, containing the union of self.frame() and index set ixt.\n This can be used to make multiplication faster, by multiplying within a common frame.\n\n >>> clifford(\"2+3{1}\").reframe(index_set({1,2,3}))\n clifford(\"2+3{1}\")\n >>> s=index_set({1,2,3});t=index_set({-3,-2,-1});x=random_clifford(s); x.reframe(t).frame() == (s|t);\n True\n ";
7299 static PyObject *__pyx_pw_8PyClical_8clifford_11reframe(PyObject *__pyx_v_self, PyObject *__pyx_v_ixt) {
7300 PyObject *__pyx_r = 0;
7301 __Pyx_RefNannyDeclarations
7302 __Pyx_RefNannySetupContext(
"reframe (wrapper)", 0);
7303 __pyx_r = __pyx_pf_8PyClical_8clifford_10reframe(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_ixt));
7306 __Pyx_RefNannyFinishContext();
7310 static PyObject *__pyx_pf_8PyClical_8clifford_10reframe(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_ixt) {
7311 PyObject *__pyx_v_error_msg_prefix = NULL;
7312 struct __pyx_obj_8PyClical_clifford *__pyx_v_result = NULL;
7313 PyObject *__pyx_v_err = NULL;
7314 PyObject *__pyx_r = NULL;
7315 __Pyx_RefNannyDeclarations
7318 PyObject *__pyx_t_3 = NULL;
7319 PyObject *__pyx_t_4 = NULL;
7320 PyObject *__pyx_t_5 = NULL;
7321 PyObject *__pyx_t_6 = NULL;
7324 PyObject *__pyx_t_9 = NULL;
7325 PyObject *__pyx_t_10 = NULL;
7326 PyObject *__pyx_t_11 = NULL;
7327 PyObject *__pyx_t_12 = NULL;
7328 PyObject *__pyx_t_13 = NULL;
7329 __Pyx_RefNannySetupContext(
"reframe", 0);
7338 __Pyx_INCREF(__pyx_kp_s_Cannot_reframe);
7339 __pyx_v_error_msg_prefix = __pyx_kp_s_Cannot_reframe;
7348 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_ixt, __pyx_ptype_8PyClical_index_set);
7349 __pyx_t_2 = (__pyx_t_1 != 0);
7350 if (likely(__pyx_t_2)) {
7360 __Pyx_PyThreadState_declare
7361 __Pyx_PyThreadState_assign
7362 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
7363 __Pyx_XGOTREF(__pyx_t_3);
7364 __Pyx_XGOTREF(__pyx_t_4);
7365 __Pyx_XGOTREF(__pyx_t_5);
7375 __pyx_t_6 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 661, __pyx_L4_error)
7376 __Pyx_GOTREF(__pyx_t_6);
7377 __pyx_v_result = ((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_6);
7388 __pyx_t_7 =
new Clifford(__pyx_f_8PyClical_8clifford_unwrap(__pyx_v_self), __pyx_f_8PyClical_9index_set_unwrap(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_ixt)));
7390 __Pyx_CppExn2PyErr();
7391 __PYX_ERR(0, 662, __pyx_L4_error)
7393 __pyx_v_result->instance = __pyx_t_7;
7403 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7404 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7405 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
7406 goto __pyx_L9_try_end;
7408 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
7417 __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
7419 __Pyx_AddTraceback(
"PyClical.clifford.reframe", __pyx_clineno, __pyx_lineno, __pyx_filename);
7420 if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 663, __pyx_L6_except_error)
7421 __Pyx_GOTREF(__pyx_t_6);
7422 __Pyx_GOTREF(__pyx_t_9);
7423 __Pyx_GOTREF(__pyx_t_10);
7424 __Pyx_INCREF(__pyx_t_9);
7425 __pyx_v_err = __pyx_t_9;
7434 __pyx_t_11 = PyNumber_Add(__pyx_v_error_msg_prefix, __pyx_kp_s_from);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 664, __pyx_L6_except_error)
7435 __Pyx_GOTREF(__pyx_t_11);
7436 __pyx_t_12 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), ((PyObject *)__pyx_v_self));
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 664, __pyx_L6_except_error)
7437 __Pyx_GOTREF(__pyx_t_12);
7438 __pyx_t_13 = PyNumber_Add(__pyx_t_11, __pyx_t_12);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 664, __pyx_L6_except_error)
7439 __Pyx_GOTREF(__pyx_t_13);
7440 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7441 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7442 __pyx_t_12 = PyNumber_Add(__pyx_t_13, __pyx_kp_s_to_frame);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 664, __pyx_L6_except_error)
7443 __Pyx_GOTREF(__pyx_t_12);
7444 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7453 __pyx_t_13 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_ixt);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 665, __pyx_L6_except_error)
7454 __Pyx_GOTREF(__pyx_t_13);
7455 __pyx_t_11 = PyNumber_Add(__pyx_t_12, __pyx_t_13);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 665, __pyx_L6_except_error)
7456 __Pyx_GOTREF(__pyx_t_11);
7457 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7458 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7459 __pyx_t_13 = PyNumber_Add(__pyx_t_11, __pyx_kp_s__5);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 665, __pyx_L6_except_error)
7460 __Pyx_GOTREF(__pyx_t_13);
7461 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7470 __pyx_t_11 = PyNumber_Add(__pyx_t_13, __pyx_kp_s__6);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 666, __pyx_L6_except_error)
7471 __Pyx_GOTREF(__pyx_t_11);
7472 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7473 __pyx_t_13 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_err);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 666, __pyx_L6_except_error)
7474 __Pyx_GOTREF(__pyx_t_13);
7475 __pyx_t_12 = PyNumber_Add(__pyx_t_11, __pyx_t_13);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 666, __pyx_L6_except_error)
7476 __Pyx_GOTREF(__pyx_t_12);
7477 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7478 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7487 __pyx_t_13 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_12);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 664, __pyx_L6_except_error)
7488 __Pyx_GOTREF(__pyx_t_13);
7489 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7490 __Pyx_Raise(__pyx_t_13, 0, 0, 0);
7491 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7492 __PYX_ERR(0, 664, __pyx_L6_except_error)
7494 goto __pyx_L6_except_error;
7495 __pyx_L6_except_error:;
7504 __Pyx_XGIVEREF(__pyx_t_3);
7505 __Pyx_XGIVEREF(__pyx_t_4);
7506 __Pyx_XGIVEREF(__pyx_t_5);
7507 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
7508 goto __pyx_L1_error;
7530 __pyx_t_10 = PyNumber_Add(__pyx_v_error_msg_prefix, __pyx_kp_s_using);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 668, __pyx_L1_error)
7531 __Pyx_GOTREF(__pyx_t_10);
7532 __pyx_t_9 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), ((PyObject *)Py_TYPE(__pyx_v_ixt)));
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 668, __pyx_L1_error)
7533 __Pyx_GOTREF(__pyx_t_9);
7534 __pyx_t_6 = PyNumber_Add(__pyx_t_10, __pyx_t_9);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 668, __pyx_L1_error)
7535 __Pyx_GOTREF(__pyx_t_6);
7536 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7537 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7538 __pyx_t_9 = PyNumber_Add(__pyx_t_6, __pyx_kp_s__9);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 668, __pyx_L1_error)
7539 __Pyx_GOTREF(__pyx_t_9);
7540 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7541 __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_9);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 668, __pyx_L1_error)
7542 __Pyx_GOTREF(__pyx_t_6);
7543 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7544 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
7545 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7546 __PYX_ERR(0, 668, __pyx_L1_error)
7557 __Pyx_XDECREF(__pyx_r);
7558 __Pyx_INCREF(((PyObject *)__pyx_v_result));
7559 __pyx_r = ((PyObject *)__pyx_v_result);
7572 __Pyx_XDECREF(__pyx_t_6);
7573 __Pyx_XDECREF(__pyx_t_9);
7574 __Pyx_XDECREF(__pyx_t_10);
7575 __Pyx_XDECREF(__pyx_t_11);
7576 __Pyx_XDECREF(__pyx_t_12);
7577 __Pyx_XDECREF(__pyx_t_13);
7578 __Pyx_AddTraceback(
"PyClical.clifford.reframe", __pyx_clineno, __pyx_lineno, __pyx_filename);
7581 __Pyx_XDECREF(__pyx_v_error_msg_prefix);
7582 __Pyx_XDECREF((PyObject *)__pyx_v_result);
7583 __Pyx_XDECREF(__pyx_v_err);
7584 __Pyx_XGIVEREF(__pyx_r);
7585 __Pyx_RefNannyFinishContext();
7598 static PyObject *__pyx_pw_8PyClical_8clifford_13__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op);
7599 static PyObject *__pyx_pw_8PyClical_8clifford_13__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op) {
7600 PyObject *__pyx_r = 0;
7601 __Pyx_RefNannyDeclarations
7602 __Pyx_RefNannySetupContext(
"__richcmp__ (wrapper)", 0);
7603 __pyx_r = __pyx_pf_8PyClical_8clifford_12__richcmp__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs), ((
int)__pyx_v_op));
7606 __Pyx_RefNannyFinishContext();
7610 static PyObject *__pyx_pf_8PyClical_8clifford_12__richcmp__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op) {
7611 PyObject *__pyx_r = NULL;
7612 __Pyx_RefNannyDeclarations
7616 PyObject *__pyx_t_4 = NULL;
7617 PyObject *__pyx_t_5 = NULL;
7618 PyObject *__pyx_t_6 = NULL;
7619 __Pyx_RefNannySetupContext(
"__richcmp__", 0);
7628 __pyx_t_1 = ((__pyx_v_op == 2) != 0);
7638 __pyx_t_2 = (((PyObject *)__pyx_v_lhs) == Py_None);
7639 __pyx_t_3 = (__pyx_t_2 != 0);
7642 __pyx_t_1 = __pyx_t_3;
7643 goto __pyx_L5_bool_binop_done;
7645 __pyx_t_3 = (__pyx_v_rhs == Py_None);
7646 __pyx_t_2 = (__pyx_t_3 != 0);
7647 __pyx_t_1 = __pyx_t_2;
7648 __pyx_L5_bool_binop_done:;
7658 __Pyx_XDECREF(__pyx_r);
7659 __pyx_t_1 = (((PyObject *)__pyx_v_lhs) == __pyx_v_rhs);
7660 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error)
7661 __Pyx_GOTREF(__pyx_t_4);
7662 __pyx_r = __pyx_t_4;
7683 __Pyx_XDECREF(__pyx_r);
7684 __pyx_t_1 = (__pyx_f_8PyClical_toClifford(((PyObject *)__pyx_v_lhs)) == __pyx_f_8PyClical_toClifford(__pyx_v_rhs));
7685 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 694, __pyx_L1_error)
7686 __Pyx_GOTREF(__pyx_t_4);
7687 __pyx_r = __pyx_t_4;
7708 __pyx_t_1 = ((__pyx_v_op == 3) != 0);
7718 __pyx_t_2 = (((PyObject *)__pyx_v_lhs) == Py_None);
7719 __pyx_t_3 = (__pyx_t_2 != 0);
7722 __pyx_t_1 = __pyx_t_3;
7723 goto __pyx_L8_bool_binop_done;
7725 __pyx_t_3 = (__pyx_v_rhs == Py_None);
7726 __pyx_t_2 = (__pyx_t_3 != 0);
7727 __pyx_t_1 = __pyx_t_2;
7728 __pyx_L8_bool_binop_done:;
7738 __Pyx_XDECREF(__pyx_r);
7739 __pyx_t_1 = (((PyObject *)__pyx_v_lhs) == __pyx_v_rhs);
7740 __pyx_t_4 = __Pyx_PyBool_FromLong((!((!(!__pyx_t_1)) != 0)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 697, __pyx_L1_error)
7741 __Pyx_GOTREF(__pyx_t_4);
7742 __pyx_r = __pyx_t_4;
7763 __Pyx_XDECREF(__pyx_r);
7764 __pyx_t_1 = (__pyx_f_8PyClical_toClifford(((PyObject *)__pyx_v_lhs)) != __pyx_f_8PyClical_toClifford(__pyx_v_rhs));
7765 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 699, __pyx_L1_error)
7766 __Pyx_GOTREF(__pyx_t_4);
7767 __pyx_r = __pyx_t_4;
7788 __pyx_t_2 = __Pyx_TypeCheck(((PyObject *)__pyx_v_lhs), __pyx_ptype_8PyClical_clifford);
7789 __pyx_t_3 = (__pyx_t_2 != 0);
7792 __pyx_t_1 = __pyx_t_3;
7793 goto __pyx_L10_bool_binop_done;
7795 __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_rhs, __pyx_ptype_8PyClical_clifford);
7796 __pyx_t_2 = (__pyx_t_3 != 0);
7797 __pyx_t_1 = __pyx_t_2;
7798 __pyx_L10_bool_binop_done:;
7799 if (unlikely(__pyx_t_1)) {
7808 __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_lhs))));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 702, __pyx_L1_error)
7809 __Pyx_GOTREF(__pyx_t_4);
7810 __pyx_t_5 = PyNumber_Add(__pyx_kp_s_This_comparison_operator_is_not, __pyx_t_4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 702, __pyx_L1_error)
7811 __Pyx_GOTREF(__pyx_t_5);
7812 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7813 __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_kp_s__8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 702, __pyx_L1_error)
7814 __Pyx_GOTREF(__pyx_t_4);
7815 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7816 __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), ((PyObject *)Py_TYPE(__pyx_v_rhs)));
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 702, __pyx_L1_error)
7817 __Pyx_GOTREF(__pyx_t_5);
7818 __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_t_5);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 702, __pyx_L1_error)
7819 __Pyx_GOTREF(__pyx_t_6);
7820 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7821 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7822 __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_kp_s_);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 702, __pyx_L1_error)
7823 __Pyx_GOTREF(__pyx_t_5);
7824 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7833 __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_5);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 701, __pyx_L1_error)
7834 __Pyx_GOTREF(__pyx_t_6);
7835 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7836 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
7837 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7838 __PYX_ERR(0, 701, __pyx_L1_error)
7857 __Pyx_XDECREF(__pyx_r);
7858 __Pyx_INCREF(__pyx_builtin_NotImplemented);
7859 __pyx_r = __pyx_builtin_NotImplemented;
7873 __Pyx_XDECREF(__pyx_t_4);
7874 __Pyx_XDECREF(__pyx_t_5);
7875 __Pyx_XDECREF(__pyx_t_6);
7876 __Pyx_AddTraceback(
"PyClical.clifford.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7879 __Pyx_XGIVEREF(__pyx_r);
7880 __Pyx_RefNannyFinishContext();
7893 static PyObject *__pyx_pw_8PyClical_8clifford_15__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ixt);
7894 static char __pyx_doc_8PyClical_8clifford_14__getitem__[] =
"\n Subscripting: map from index set to scalar coordinate.\n\n >>> clifford(\"{1}\")[index_set(1)]\n 1.0\n >>> clifford(\"{1}\")[index_set({1})]\n 1.0\n >>> clifford(\"{1}\")[index_set({1,2})]\n 0.0\n >>> clifford(\"2{1,2}\")[index_set({1,2})]\n 2.0\n ";
7895 #if CYTHON_COMPILING_IN_CPYTHON 7896 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_14__getitem__;
7898 static PyObject *__pyx_pw_8PyClical_8clifford_15__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ixt) {
7899 PyObject *__pyx_r = 0;
7900 __Pyx_RefNannyDeclarations
7901 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
7902 __pyx_r = __pyx_pf_8PyClical_8clifford_14__getitem__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_ixt));
7905 __Pyx_RefNannyFinishContext();
7909 static PyObject *__pyx_pf_8PyClical_8clifford_14__getitem__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_ixt) {
7910 PyObject *__pyx_r = NULL;
7911 __Pyx_RefNannyDeclarations
7912 PyObject *__pyx_t_1 = NULL;
7913 __Pyx_RefNannySetupContext(
"__getitem__", 0);
7922 __Pyx_XDECREF(__pyx_r);
7923 __pyx_t_1 =
PyFloat_FromDouble(__pyx_v_self->instance->operator[](__pyx_f_8PyClical_toIndexSet(__pyx_v_ixt)));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 719, __pyx_L1_error)
7924 __Pyx_GOTREF(__pyx_t_1);
7925 __pyx_r = __pyx_t_1;
7939 __Pyx_XDECREF(__pyx_t_1);
7940 __Pyx_AddTraceback(
"PyClical.clifford.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7943 __Pyx_XGIVEREF(__pyx_r);
7944 __Pyx_RefNannyFinishContext();
7957 static PyObject *__pyx_pw_8PyClical_8clifford_17__neg__(PyObject *__pyx_v_self);
7958 static char __pyx_doc_8PyClical_8clifford_16__neg__[] =
"\n Unary -.\n\n >>> print -clifford(\"{1}\")\n -{1}\n ";
7959 #if CYTHON_COMPILING_IN_CPYTHON 7960 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_16__neg__;
7962 static PyObject *__pyx_pw_8PyClical_8clifford_17__neg__(PyObject *__pyx_v_self) {
7963 PyObject *__pyx_r = 0;
7964 __Pyx_RefNannyDeclarations
7965 __Pyx_RefNannySetupContext(
"__neg__ (wrapper)", 0);
7966 __pyx_r = __pyx_pf_8PyClical_8clifford_16__neg__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
7969 __Pyx_RefNannyFinishContext();
7973 static PyObject *__pyx_pf_8PyClical_8clifford_16__neg__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
7974 PyObject *__pyx_r = NULL;
7975 __Pyx_RefNannyDeclarations
7976 PyObject *__pyx_t_1 = NULL;
7977 PyObject *__pyx_t_2 = NULL;
7978 __Pyx_RefNannySetupContext(
"__neg__", 0);
7987 __Pyx_XDECREF(__pyx_r);
7988 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 728, __pyx_L1_error)
7989 __Pyx_GOTREF(__pyx_t_1);
7990 __pyx_t_2 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_1), __pyx_v_self->instance->operator-());
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 728, __pyx_L1_error)
7991 __Pyx_GOTREF(__pyx_t_2);
7992 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7993 __pyx_r = __pyx_t_2;
8007 __Pyx_XDECREF(__pyx_t_1);
8008 __Pyx_XDECREF(__pyx_t_2);
8009 __Pyx_AddTraceback(
"PyClical.clifford.__neg__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8012 __Pyx_XGIVEREF(__pyx_r);
8013 __Pyx_RefNannyFinishContext();
8026 static PyObject *__pyx_pw_8PyClical_8clifford_19__pos__(PyObject *__pyx_v_self);
8027 static char __pyx_doc_8PyClical_8clifford_18__pos__[] =
"\n Unary +.\n\n >>> print +clifford(\"{1}\")\n {1}\n ";
8028 #if CYTHON_COMPILING_IN_CPYTHON 8029 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_18__pos__;
8031 static PyObject *__pyx_pw_8PyClical_8clifford_19__pos__(PyObject *__pyx_v_self) {
8032 PyObject *__pyx_r = 0;
8033 __Pyx_RefNannyDeclarations
8034 __Pyx_RefNannySetupContext(
"__pos__ (wrapper)", 0);
8035 __pyx_r = __pyx_pf_8PyClical_8clifford_18__pos__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
8038 __Pyx_RefNannyFinishContext();
8042 static PyObject *__pyx_pf_8PyClical_8clifford_18__pos__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
8043 PyObject *__pyx_r = NULL;
8044 __Pyx_RefNannyDeclarations
8045 PyObject *__pyx_t_1 = NULL;
8046 __Pyx_RefNannySetupContext(
"__pos__", 0);
8055 __Pyx_XDECREF(__pyx_r);
8056 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_clifford), ((PyObject *)__pyx_v_self));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 737, __pyx_L1_error)
8057 __Pyx_GOTREF(__pyx_t_1);
8058 __pyx_r = __pyx_t_1;
8072 __Pyx_XDECREF(__pyx_t_1);
8073 __Pyx_AddTraceback(
"PyClical.clifford.__pos__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8076 __Pyx_XGIVEREF(__pyx_r);
8077 __Pyx_RefNannyFinishContext();
8090 static PyObject *__pyx_pw_8PyClical_8clifford_21__add__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8091 static char __pyx_doc_8PyClical_8clifford_20__add__[] =
"\n Geometric sum.\n\n >>> print clifford(1) + clifford(\"{2}\")\n 1+{2}\n >>> print clifford(\"{1}\") + clifford(\"{2}\")\n {1}+{2}\n ";
8092 #if CYTHON_COMPILING_IN_CPYTHON 8093 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_20__add__;
8095 static PyObject *__pyx_pw_8PyClical_8clifford_21__add__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8096 PyObject *__pyx_r = 0;
8097 __Pyx_RefNannyDeclarations
8098 __Pyx_RefNannySetupContext(
"__add__ (wrapper)", 0);
8099 __pyx_r = __pyx_pf_8PyClical_8clifford_20__add__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8102 __Pyx_RefNannyFinishContext();
8106 static PyObject *__pyx_pf_8PyClical_8clifford_20__add__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8107 PyObject *__pyx_r = NULL;
8108 __Pyx_RefNannyDeclarations
8109 PyObject *__pyx_t_1 = NULL;
8110 PyObject *__pyx_t_2 = NULL;
8111 __Pyx_RefNannySetupContext(
"__add__", 0);
8120 __Pyx_XDECREF(__pyx_r);
8121 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 748, __pyx_L1_error)
8122 __Pyx_GOTREF(__pyx_t_1);
8123 __pyx_t_2 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_1), (__pyx_f_8PyClical_toClifford(__pyx_v_lhs) + __pyx_f_8PyClical_toClifford(__pyx_v_rhs)));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 748, __pyx_L1_error)
8124 __Pyx_GOTREF(__pyx_t_2);
8125 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8126 __pyx_r = __pyx_t_2;
8140 __Pyx_XDECREF(__pyx_t_1);
8141 __Pyx_XDECREF(__pyx_t_2);
8142 __Pyx_AddTraceback(
"PyClical.clifford.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8145 __Pyx_XGIVEREF(__pyx_r);
8146 __Pyx_RefNannyFinishContext();
8159 static PyObject *__pyx_pw_8PyClical_8clifford_23__iadd__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8160 static char __pyx_doc_8PyClical_8clifford_22__iadd__[] =
"\n Geometric sum.\n\n >>> x = clifford(1); x += clifford(\"{2}\"); print x\n 1+{2}\n ";
8161 #if CYTHON_COMPILING_IN_CPYTHON 8162 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_22__iadd__;
8164 static PyObject *__pyx_pw_8PyClical_8clifford_23__iadd__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8165 PyObject *__pyx_r = 0;
8166 __Pyx_RefNannyDeclarations
8167 __Pyx_RefNannySetupContext(
"__iadd__ (wrapper)", 0);
8168 __pyx_r = __pyx_pf_8PyClical_8clifford_22__iadd__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8171 __Pyx_RefNannyFinishContext();
8175 static PyObject *__pyx_pf_8PyClical_8clifford_22__iadd__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8176 PyObject *__pyx_r = NULL;
8177 __Pyx_RefNannyDeclarations
8178 PyObject *__pyx_t_1 = NULL;
8179 __Pyx_RefNannySetupContext(
"__iadd__", 0);
8188 __Pyx_XDECREF(__pyx_r);
8189 __pyx_t_1 = __pyx_f_8PyClical_8clifford_wrap(__pyx_v_self, (__pyx_f_8PyClical_8clifford_unwrap(__pyx_v_self) + __pyx_f_8PyClical_toClifford(__pyx_v_rhs)));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 757, __pyx_L1_error)
8190 __Pyx_GOTREF(__pyx_t_1);
8191 __pyx_r = __pyx_t_1;
8205 __Pyx_XDECREF(__pyx_t_1);
8206 __Pyx_AddTraceback(
"PyClical.clifford.__iadd__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8209 __Pyx_XGIVEREF(__pyx_r);
8210 __Pyx_RefNannyFinishContext();
8223 static PyObject *__pyx_pw_8PyClical_8clifford_25__sub__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8224 static char __pyx_doc_8PyClical_8clifford_24__sub__[] =
"\n Geometric difference.\n\n >>> print clifford(1) - clifford(\"{2}\")\n 1-{2}\n >>> print clifford(\"{1}\") - clifford(\"{2}\")\n {1}-{2}\n ";
8225 #if CYTHON_COMPILING_IN_CPYTHON 8226 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_24__sub__;
8228 static PyObject *__pyx_pw_8PyClical_8clifford_25__sub__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8229 PyObject *__pyx_r = 0;
8230 __Pyx_RefNannyDeclarations
8231 __Pyx_RefNannySetupContext(
"__sub__ (wrapper)", 0);
8232 __pyx_r = __pyx_pf_8PyClical_8clifford_24__sub__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8235 __Pyx_RefNannyFinishContext();
8239 static PyObject *__pyx_pf_8PyClical_8clifford_24__sub__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8240 PyObject *__pyx_r = NULL;
8241 __Pyx_RefNannyDeclarations
8242 PyObject *__pyx_t_1 = NULL;
8243 PyObject *__pyx_t_2 = NULL;
8244 __Pyx_RefNannySetupContext(
"__sub__", 0);
8253 __Pyx_XDECREF(__pyx_r);
8254 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 768, __pyx_L1_error)
8255 __Pyx_GOTREF(__pyx_t_1);
8256 __pyx_t_2 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_1), (__pyx_f_8PyClical_toClifford(__pyx_v_lhs) - __pyx_f_8PyClical_toClifford(__pyx_v_rhs)));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 768, __pyx_L1_error)
8257 __Pyx_GOTREF(__pyx_t_2);
8258 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8259 __pyx_r = __pyx_t_2;
8273 __Pyx_XDECREF(__pyx_t_1);
8274 __Pyx_XDECREF(__pyx_t_2);
8275 __Pyx_AddTraceback(
"PyClical.clifford.__sub__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8278 __Pyx_XGIVEREF(__pyx_r);
8279 __Pyx_RefNannyFinishContext();
8292 static PyObject *__pyx_pw_8PyClical_8clifford_27__isub__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8293 static char __pyx_doc_8PyClical_8clifford_26__isub__[] =
"\n Geometric difference.\n\n >>> x = clifford(1); x -= clifford(\"{2}\"); print x\n 1-{2}\n ";
8294 #if CYTHON_COMPILING_IN_CPYTHON 8295 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_26__isub__;
8297 static PyObject *__pyx_pw_8PyClical_8clifford_27__isub__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8298 PyObject *__pyx_r = 0;
8299 __Pyx_RefNannyDeclarations
8300 __Pyx_RefNannySetupContext(
"__isub__ (wrapper)", 0);
8301 __pyx_r = __pyx_pf_8PyClical_8clifford_26__isub__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8304 __Pyx_RefNannyFinishContext();
8308 static PyObject *__pyx_pf_8PyClical_8clifford_26__isub__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8309 PyObject *__pyx_r = NULL;
8310 __Pyx_RefNannyDeclarations
8311 PyObject *__pyx_t_1 = NULL;
8312 __Pyx_RefNannySetupContext(
"__isub__", 0);
8321 __Pyx_XDECREF(__pyx_r);
8322 __pyx_t_1 = __pyx_f_8PyClical_8clifford_wrap(__pyx_v_self, (__pyx_f_8PyClical_8clifford_unwrap(__pyx_v_self) - __pyx_f_8PyClical_toClifford(__pyx_v_rhs)));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 777, __pyx_L1_error)
8323 __Pyx_GOTREF(__pyx_t_1);
8324 __pyx_r = __pyx_t_1;
8338 __Pyx_XDECREF(__pyx_t_1);
8339 __Pyx_AddTraceback(
"PyClical.clifford.__isub__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8342 __Pyx_XGIVEREF(__pyx_r);
8343 __Pyx_RefNannyFinishContext();
8356 static PyObject *__pyx_pw_8PyClical_8clifford_29__mul__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8357 static char __pyx_doc_8PyClical_8clifford_28__mul__[] =
"\n Geometric product.\n\n >>> print clifford(\"{1}\") * clifford(\"{2}\")\n {1,2}\n >>> print clifford(2) * clifford(\"{2}\")\n 2{2}\n >>> print clifford(\"{1}\") * clifford(\"{1,2}\")\n {2}\n ";
8358 #if CYTHON_COMPILING_IN_CPYTHON 8359 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_28__mul__;
8361 static PyObject *__pyx_pw_8PyClical_8clifford_29__mul__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8362 PyObject *__pyx_r = 0;
8363 __Pyx_RefNannyDeclarations
8364 __Pyx_RefNannySetupContext(
"__mul__ (wrapper)", 0);
8365 __pyx_r = __pyx_pf_8PyClical_8clifford_28__mul__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8368 __Pyx_RefNannyFinishContext();
8372 static PyObject *__pyx_pf_8PyClical_8clifford_28__mul__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8373 PyObject *__pyx_r = NULL;
8374 __Pyx_RefNannyDeclarations
8375 PyObject *__pyx_t_1 = NULL;
8376 PyObject *__pyx_t_2 = NULL;
8377 __Pyx_RefNannySetupContext(
"__mul__", 0);
8386 __Pyx_XDECREF(__pyx_r);
8387 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 790, __pyx_L1_error)
8388 __Pyx_GOTREF(__pyx_t_1);
8389 __pyx_t_2 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_1), (__pyx_f_8PyClical_toClifford(__pyx_v_lhs) * __pyx_f_8PyClical_toClifford(__pyx_v_rhs)));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 790, __pyx_L1_error)
8390 __Pyx_GOTREF(__pyx_t_2);
8391 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8392 __pyx_r = __pyx_t_2;
8406 __Pyx_XDECREF(__pyx_t_1);
8407 __Pyx_XDECREF(__pyx_t_2);
8408 __Pyx_AddTraceback(
"PyClical.clifford.__mul__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8411 __Pyx_XGIVEREF(__pyx_r);
8412 __Pyx_RefNannyFinishContext();
8425 static PyObject *__pyx_pw_8PyClical_8clifford_31__imul__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8426 static char __pyx_doc_8PyClical_8clifford_30__imul__[] =
"\n Geometric product.\n\n >>> x = clifford(2); x *= clifford(\"{2}\"); print x\n 2{2}\n >>> x = clifford(\"{1}\"); x *= clifford(\"{2}\"); print x\n {1,2}\n >>> x = clifford(\"{1}\"); x *= clifford(\"{1,2}\"); print x\n {2}\n ";
8427 #if CYTHON_COMPILING_IN_CPYTHON 8428 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_30__imul__;
8430 static PyObject *__pyx_pw_8PyClical_8clifford_31__imul__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8431 PyObject *__pyx_r = 0;
8432 __Pyx_RefNannyDeclarations
8433 __Pyx_RefNannySetupContext(
"__imul__ (wrapper)", 0);
8434 __pyx_r = __pyx_pf_8PyClical_8clifford_30__imul__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8437 __Pyx_RefNannyFinishContext();
8441 static PyObject *__pyx_pf_8PyClical_8clifford_30__imul__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8442 PyObject *__pyx_r = NULL;
8443 __Pyx_RefNannyDeclarations
8444 PyObject *__pyx_t_1 = NULL;
8445 __Pyx_RefNannySetupContext(
"__imul__", 0);
8454 __Pyx_XDECREF(__pyx_r);
8455 __pyx_t_1 = __pyx_f_8PyClical_8clifford_wrap(__pyx_v_self, (__pyx_f_8PyClical_8clifford_unwrap(__pyx_v_self) * __pyx_f_8PyClical_toClifford(__pyx_v_rhs)));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 803, __pyx_L1_error)
8456 __Pyx_GOTREF(__pyx_t_1);
8457 __pyx_r = __pyx_t_1;
8471 __Pyx_XDECREF(__pyx_t_1);
8472 __Pyx_AddTraceback(
"PyClical.clifford.__imul__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8475 __Pyx_XGIVEREF(__pyx_r);
8476 __Pyx_RefNannyFinishContext();
8489 static PyObject *__pyx_pw_8PyClical_8clifford_33__mod__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8490 static char __pyx_doc_8PyClical_8clifford_32__mod__[] =
"\n Contraction.\n\n >>> print clifford(\"{1}\") % clifford(\"{2}\")\n 0\n >>> print clifford(2) % clifford(\"{2}\")\n 2{2}\n >>> print clifford(\"{1}\") % clifford(\"{1}\")\n 1\n >>> print clifford(\"{1}\") % clifford(\"{1,2}\")\n {2}\n ";
8491 #if CYTHON_COMPILING_IN_CPYTHON 8492 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_32__mod__;
8494 static PyObject *__pyx_pw_8PyClical_8clifford_33__mod__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8495 PyObject *__pyx_r = 0;
8496 __Pyx_RefNannyDeclarations
8497 __Pyx_RefNannySetupContext(
"__mod__ (wrapper)", 0);
8498 __pyx_r = __pyx_pf_8PyClical_8clifford_32__mod__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8501 __Pyx_RefNannyFinishContext();
8505 static PyObject *__pyx_pf_8PyClical_8clifford_32__mod__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8506 PyObject *__pyx_r = NULL;
8507 __Pyx_RefNannyDeclarations
8508 PyObject *__pyx_t_1 = NULL;
8509 PyObject *__pyx_t_2 = NULL;
8510 __Pyx_RefNannySetupContext(
"__mod__", 0);
8519 __Pyx_XDECREF(__pyx_r);
8520 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 818, __pyx_L1_error)
8521 __Pyx_GOTREF(__pyx_t_1);
8522 __pyx_t_2 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_1), (__pyx_f_8PyClical_toClifford(__pyx_v_lhs) % __pyx_f_8PyClical_toClifford(__pyx_v_rhs)));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 818, __pyx_L1_error)
8523 __Pyx_GOTREF(__pyx_t_2);
8524 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8525 __pyx_r = __pyx_t_2;
8539 __Pyx_XDECREF(__pyx_t_1);
8540 __Pyx_XDECREF(__pyx_t_2);
8541 __Pyx_AddTraceback(
"PyClical.clifford.__mod__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8544 __Pyx_XGIVEREF(__pyx_r);
8545 __Pyx_RefNannyFinishContext();
8558 static PyObject *__pyx_pw_8PyClical_8clifford_35__imod__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8559 static char __pyx_doc_8PyClical_8clifford_34__imod__[] =
"\n Contraction.\n\n >>> x = clifford(\"{1}\"); x %= clifford(\"{2}\"); print x\n 0\n >>> x = clifford(2); x %= clifford(\"{2}\"); print x\n 2{2}\n >>> x = clifford(\"{1}\"); x %= clifford(\"{1}\"); print x\n 1\n >>> x = clifford(\"{1}\"); x %= clifford(\"{1,2}\"); print x\n {2}\n ";
8560 #if CYTHON_COMPILING_IN_CPYTHON 8561 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_34__imod__;
8563 static PyObject *__pyx_pw_8PyClical_8clifford_35__imod__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8564 PyObject *__pyx_r = 0;
8565 __Pyx_RefNannyDeclarations
8566 __Pyx_RefNannySetupContext(
"__imod__ (wrapper)", 0);
8567 __pyx_r = __pyx_pf_8PyClical_8clifford_34__imod__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8570 __Pyx_RefNannyFinishContext();
8574 static PyObject *__pyx_pf_8PyClical_8clifford_34__imod__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8575 PyObject *__pyx_r = NULL;
8576 __Pyx_RefNannyDeclarations
8577 PyObject *__pyx_t_1 = NULL;
8578 __Pyx_RefNannySetupContext(
"__imod__", 0);
8587 __Pyx_XDECREF(__pyx_r);
8588 __pyx_t_1 = __pyx_f_8PyClical_8clifford_wrap(__pyx_v_self, (__pyx_f_8PyClical_8clifford_unwrap(__pyx_v_self) % __pyx_f_8PyClical_toClifford(__pyx_v_rhs)));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L1_error)
8589 __Pyx_GOTREF(__pyx_t_1);
8590 __pyx_r = __pyx_t_1;
8604 __Pyx_XDECREF(__pyx_t_1);
8605 __Pyx_AddTraceback(
"PyClical.clifford.__imod__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8608 __Pyx_XGIVEREF(__pyx_r);
8609 __Pyx_RefNannyFinishContext();
8622 static PyObject *__pyx_pw_8PyClical_8clifford_37__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8623 static char __pyx_doc_8PyClical_8clifford_36__and__[] =
"\n Inner product.\n\n >>> print clifford(\"{1}\") & clifford(\"{2}\")\n 0\n >>> print clifford(2) & clifford(\"{2}\")\n 0\n >>> print clifford(\"{1}\") & clifford(\"{1}\")\n 1\n >>> print clifford(\"{1}\") & clifford(\"{1,2}\")\n {2}\n ";
8624 #if CYTHON_COMPILING_IN_CPYTHON 8625 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_36__and__;
8627 static PyObject *__pyx_pw_8PyClical_8clifford_37__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8628 PyObject *__pyx_r = 0;
8629 __Pyx_RefNannyDeclarations
8630 __Pyx_RefNannySetupContext(
"__and__ (wrapper)", 0);
8631 __pyx_r = __pyx_pf_8PyClical_8clifford_36__and__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8634 __Pyx_RefNannyFinishContext();
8638 static PyObject *__pyx_pf_8PyClical_8clifford_36__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8639 PyObject *__pyx_r = NULL;
8640 __Pyx_RefNannyDeclarations
8641 PyObject *__pyx_t_1 = NULL;
8642 PyObject *__pyx_t_2 = NULL;
8643 __Pyx_RefNannySetupContext(
"__and__", 0);
8652 __Pyx_XDECREF(__pyx_r);
8653 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 848, __pyx_L1_error)
8654 __Pyx_GOTREF(__pyx_t_1);
8655 __pyx_t_2 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_1), (__pyx_f_8PyClical_toClifford(__pyx_v_lhs) & __pyx_f_8PyClical_toClifford(__pyx_v_rhs)));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 848, __pyx_L1_error)
8656 __Pyx_GOTREF(__pyx_t_2);
8657 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8658 __pyx_r = __pyx_t_2;
8672 __Pyx_XDECREF(__pyx_t_1);
8673 __Pyx_XDECREF(__pyx_t_2);
8674 __Pyx_AddTraceback(
"PyClical.clifford.__and__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8677 __Pyx_XGIVEREF(__pyx_r);
8678 __Pyx_RefNannyFinishContext();
8691 static PyObject *__pyx_pw_8PyClical_8clifford_39__iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8692 static char __pyx_doc_8PyClical_8clifford_38__iand__[] =
"\n Inner product.\n\n >>> x = clifford(\"{1}\"); x &= clifford(\"{2}\"); print x\n 0\n >>> x = clifford(2); x &= clifford(\"{2}\"); print x\n 0\n >>> x = clifford(\"{1}\"); x &= clifford(\"{1}\"); print x\n 1\n >>> x = clifford(\"{1}\"); x &= clifford(\"{1,2}\"); print x\n {2}\n ";
8693 #if CYTHON_COMPILING_IN_CPYTHON 8694 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_38__iand__;
8696 static PyObject *__pyx_pw_8PyClical_8clifford_39__iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8697 PyObject *__pyx_r = 0;
8698 __Pyx_RefNannyDeclarations
8699 __Pyx_RefNannySetupContext(
"__iand__ (wrapper)", 0);
8700 __pyx_r = __pyx_pf_8PyClical_8clifford_38__iand__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8703 __Pyx_RefNannyFinishContext();
8707 static PyObject *__pyx_pf_8PyClical_8clifford_38__iand__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8708 PyObject *__pyx_r = NULL;
8709 __Pyx_RefNannyDeclarations
8710 PyObject *__pyx_t_1 = NULL;
8711 __Pyx_RefNannySetupContext(
"__iand__", 0);
8720 __Pyx_XDECREF(__pyx_r);
8721 __pyx_t_1 = __pyx_f_8PyClical_8clifford_wrap(__pyx_v_self, (__pyx_f_8PyClical_8clifford_unwrap(__pyx_v_self) & __pyx_f_8PyClical_toClifford(__pyx_v_rhs)));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 863, __pyx_L1_error)
8722 __Pyx_GOTREF(__pyx_t_1);
8723 __pyx_r = __pyx_t_1;
8737 __Pyx_XDECREF(__pyx_t_1);
8738 __Pyx_AddTraceback(
"PyClical.clifford.__iand__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8741 __Pyx_XGIVEREF(__pyx_r);
8742 __Pyx_RefNannyFinishContext();
8755 static PyObject *__pyx_pw_8PyClical_8clifford_41__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8756 static char __pyx_doc_8PyClical_8clifford_40__xor__[] =
"\n Outer product.\n\n >>> print clifford(\"{1}\") ^ clifford(\"{2}\")\n {1,2}\n >>> print clifford(2) ^ clifford(\"{2}\")\n 2{2}\n >>> print clifford(\"{1}\") ^ clifford(\"{1}\")\n 0\n >>> print clifford(\"{1}\") ^ clifford(\"{1,2}\")\n 0\n ";
8757 #if CYTHON_COMPILING_IN_CPYTHON 8758 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_40__xor__;
8760 static PyObject *__pyx_pw_8PyClical_8clifford_41__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8761 PyObject *__pyx_r = 0;
8762 __Pyx_RefNannyDeclarations
8763 __Pyx_RefNannySetupContext(
"__xor__ (wrapper)", 0);
8764 __pyx_r = __pyx_pf_8PyClical_8clifford_40__xor__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8767 __Pyx_RefNannyFinishContext();
8771 static PyObject *__pyx_pf_8PyClical_8clifford_40__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8772 PyObject *__pyx_r = NULL;
8773 __Pyx_RefNannyDeclarations
8774 PyObject *__pyx_t_1 = NULL;
8775 PyObject *__pyx_t_2 = NULL;
8776 __Pyx_RefNannySetupContext(
"__xor__", 0);
8785 __Pyx_XDECREF(__pyx_r);
8786 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 878, __pyx_L1_error)
8787 __Pyx_GOTREF(__pyx_t_1);
8788 __pyx_t_2 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_1), (__pyx_f_8PyClical_toClifford(__pyx_v_lhs) ^ __pyx_f_8PyClical_toClifford(__pyx_v_rhs)));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 878, __pyx_L1_error)
8789 __Pyx_GOTREF(__pyx_t_2);
8790 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8791 __pyx_r = __pyx_t_2;
8805 __Pyx_XDECREF(__pyx_t_1);
8806 __Pyx_XDECREF(__pyx_t_2);
8807 __Pyx_AddTraceback(
"PyClical.clifford.__xor__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8810 __Pyx_XGIVEREF(__pyx_r);
8811 __Pyx_RefNannyFinishContext();
8824 static PyObject *__pyx_pw_8PyClical_8clifford_43__ixor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8825 static char __pyx_doc_8PyClical_8clifford_42__ixor__[] =
"\n Outer product.\n\n >>> x = clifford(\"{1}\"); x ^= clifford(\"{2}\"); print x\n {1,2}\n >>> x = clifford(2); x ^= clifford(\"{2}\"); print x\n 2{2}\n >>> x = clifford(\"{1}\"); x ^= clifford(\"{1}\"); print x\n 0\n >>> x = clifford(\"{1}\"); x ^= clifford(\"{1,2}\"); print x\n 0\n ";
8826 #if CYTHON_COMPILING_IN_CPYTHON 8827 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_42__ixor__;
8829 static PyObject *__pyx_pw_8PyClical_8clifford_43__ixor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8830 PyObject *__pyx_r = 0;
8831 __Pyx_RefNannyDeclarations
8832 __Pyx_RefNannySetupContext(
"__ixor__ (wrapper)", 0);
8833 __pyx_r = __pyx_pf_8PyClical_8clifford_42__ixor__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8836 __Pyx_RefNannyFinishContext();
8840 static PyObject *__pyx_pf_8PyClical_8clifford_42__ixor__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8841 PyObject *__pyx_r = NULL;
8842 __Pyx_RefNannyDeclarations
8843 PyObject *__pyx_t_1 = NULL;
8844 __Pyx_RefNannySetupContext(
"__ixor__", 0);
8853 __Pyx_XDECREF(__pyx_r);
8854 __pyx_t_1 = __pyx_f_8PyClical_8clifford_wrap(__pyx_v_self, (__pyx_f_8PyClical_8clifford_unwrap(__pyx_v_self) ^ __pyx_f_8PyClical_toClifford(__pyx_v_rhs)));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 893, __pyx_L1_error)
8855 __Pyx_GOTREF(__pyx_t_1);
8856 __pyx_r = __pyx_t_1;
8870 __Pyx_XDECREF(__pyx_t_1);
8871 __Pyx_AddTraceback(
"PyClical.clifford.__ixor__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8874 __Pyx_XGIVEREF(__pyx_r);
8875 __Pyx_RefNannyFinishContext();
8888 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 8889 static PyObject *__pyx_pw_8PyClical_8clifford_45__div__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8890 static char __pyx_doc_8PyClical_8clifford_44__div__[] =
"\n Geometric quotient.\n\n >>> print clifford(\"{1}\") / clifford(\"{2}\")\n {1,2}\n >>> print clifford(2) / clifford(\"{2}\")\n 2{2}\n >>> print clifford(\"{1}\") / clifford(\"{1}\")\n 1\n >>> print clifford(\"{1}\") / clifford(\"{1,2}\")\n -{2}\n ";
8891 #if CYTHON_COMPILING_IN_CPYTHON 8892 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_44__div__;
8894 static PyObject *__pyx_pw_8PyClical_8clifford_45__div__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8895 PyObject *__pyx_r = 0;
8896 __Pyx_RefNannyDeclarations
8897 __Pyx_RefNannySetupContext(
"__div__ (wrapper)", 0);
8898 __pyx_r = __pyx_pf_8PyClical_8clifford_44__div__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8901 __Pyx_RefNannyFinishContext();
8906 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 8907 static PyObject *__pyx_pf_8PyClical_8clifford_44__div__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8908 PyObject *__pyx_r = NULL;
8909 __Pyx_RefNannyDeclarations
8910 PyObject *__pyx_t_1 = NULL;
8911 PyObject *__pyx_t_2 = NULL;
8912 __Pyx_RefNannySetupContext(
"__div__", 0);
8921 __Pyx_XDECREF(__pyx_r);
8922 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 908, __pyx_L1_error)
8923 __Pyx_GOTREF(__pyx_t_1);
8924 __pyx_t_2 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_1), (__pyx_f_8PyClical_toClifford(__pyx_v_lhs) / __pyx_f_8PyClical_toClifford(__pyx_v_rhs)));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 908, __pyx_L1_error)
8925 __Pyx_GOTREF(__pyx_t_2);
8926 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8927 __pyx_r = __pyx_t_2;
8941 __Pyx_XDECREF(__pyx_t_1);
8942 __Pyx_XDECREF(__pyx_t_2);
8943 __Pyx_AddTraceback(
"PyClical.clifford.__div__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8946 __Pyx_XGIVEREF(__pyx_r);
8947 __Pyx_RefNannyFinishContext();
8961 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 8962 static PyObject *__pyx_pw_8PyClical_8clifford_47__idiv__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8963 static char __pyx_doc_8PyClical_8clifford_46__idiv__[] =
"\n Geometric quotient.\n\n >>> x = clifford(\"{1}\"); x /= clifford(\"{2}\"); print x\n {1,2}\n >>> x = clifford(2); x /= clifford(\"{2}\"); print x\n 2{2}\n >>> x = clifford(\"{1}\"); x /= clifford(\"{1}\"); print x\n 1\n >>> x = clifford(\"{1}\"); x /= clifford(\"{1,2}\"); print x\n -{2}\n ";
8964 #if CYTHON_COMPILING_IN_CPYTHON 8965 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_46__idiv__;
8967 static PyObject *__pyx_pw_8PyClical_8clifford_47__idiv__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8968 PyObject *__pyx_r = 0;
8969 __Pyx_RefNannyDeclarations
8970 __Pyx_RefNannySetupContext(
"__idiv__ (wrapper)", 0);
8971 __pyx_r = __pyx_pf_8PyClical_8clifford_46__idiv__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8974 __Pyx_RefNannyFinishContext();
8979 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 8980 static PyObject *__pyx_pf_8PyClical_8clifford_46__idiv__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8981 PyObject *__pyx_r = NULL;
8982 __Pyx_RefNannyDeclarations
8983 PyObject *__pyx_t_1 = NULL;
8984 __Pyx_RefNannySetupContext(
"__idiv__", 0);
8993 __Pyx_XDECREF(__pyx_r);
8994 __pyx_t_1 = __pyx_f_8PyClical_8clifford_wrap(__pyx_v_self, (__pyx_f_8PyClical_8clifford_unwrap(__pyx_v_self) / __pyx_f_8PyClical_toClifford(__pyx_v_rhs)));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 923, __pyx_L1_error)
8995 __Pyx_GOTREF(__pyx_t_1);
8996 __pyx_r = __pyx_t_1;
9010 __Pyx_XDECREF(__pyx_t_1);
9011 __Pyx_AddTraceback(
"PyClical.clifford.__idiv__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9014 __Pyx_XGIVEREF(__pyx_r);
9015 __Pyx_RefNannyFinishContext();
9029 static PyObject *__pyx_pw_8PyClical_8clifford_49inv(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9030 static char __pyx_doc_8PyClical_8clifford_48inv[] =
"\n Geometric multiplicative inverse.\n\n >>> x = clifford(\"{1}\"); print x.inv()\n {1}\n >>> x = clifford(2); print x.inv()\n 0.5\n >>> x = clifford(\"{1,2}\"); print x.inv()\n -{1,2}\n ";
9031 static PyObject *__pyx_pw_8PyClical_8clifford_49inv(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9032 PyObject *__pyx_r = 0;
9033 __Pyx_RefNannyDeclarations
9034 __Pyx_RefNannySetupContext(
"inv (wrapper)", 0);
9035 __pyx_r = __pyx_pf_8PyClical_8clifford_48inv(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
9038 __Pyx_RefNannyFinishContext();
9042 static PyObject *__pyx_pf_8PyClical_8clifford_48inv(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
9043 PyObject *__pyx_r = NULL;
9044 __Pyx_RefNannyDeclarations
9045 PyObject *__pyx_t_1 = NULL;
9046 PyObject *__pyx_t_2 = NULL;
9047 __Pyx_RefNannySetupContext(
"inv", 0);
9056 __Pyx_XDECREF(__pyx_r);
9057 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 936, __pyx_L1_error)
9058 __Pyx_GOTREF(__pyx_t_1);
9059 __pyx_t_2 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_1), __pyx_v_self->instance->inv());
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 936, __pyx_L1_error)
9060 __Pyx_GOTREF(__pyx_t_2);
9061 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9062 __pyx_r = __pyx_t_2;
9076 __Pyx_XDECREF(__pyx_t_1);
9077 __Pyx_XDECREF(__pyx_t_2);
9078 __Pyx_AddTraceback(
"PyClical.clifford.inv", __pyx_clineno, __pyx_lineno, __pyx_filename);
9081 __Pyx_XGIVEREF(__pyx_r);
9082 __Pyx_RefNannyFinishContext();
9095 static PyObject *__pyx_pw_8PyClical_8clifford_51__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
9096 static char __pyx_doc_8PyClical_8clifford_50__or__[] =
"\n Transform left hand side, using right hand side as a transformation.\n\n >>> x=clifford(\"{1,2}\") * pi/2; y=clifford(\"{1}\"); print y|x\n -{1}\n >>> x=clifford(\"{1,2}\") * pi/2; y=clifford(\"{1}\"); print y|exp(x)\n -{1}\n ";
9097 #if CYTHON_COMPILING_IN_CPYTHON 9098 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_50__or__;
9100 static PyObject *__pyx_pw_8PyClical_8clifford_51__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
9101 PyObject *__pyx_r = 0;
9102 __Pyx_RefNannyDeclarations
9103 __Pyx_RefNannySetupContext(
"__or__ (wrapper)", 0);
9104 __pyx_r = __pyx_pf_8PyClical_8clifford_50__or__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
9107 __Pyx_RefNannyFinishContext();
9111 static PyObject *__pyx_pf_8PyClical_8clifford_50__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
9112 PyObject *__pyx_r = NULL;
9113 __Pyx_RefNannyDeclarations
9114 PyObject *__pyx_t_1 = NULL;
9115 PyObject *__pyx_t_2 = NULL;
9116 __Pyx_RefNannySetupContext(
"__or__", 0);
9125 __Pyx_XDECREF(__pyx_r);
9126 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 947, __pyx_L1_error)
9127 __Pyx_GOTREF(__pyx_t_1);
9128 __pyx_t_2 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_1), (__pyx_f_8PyClical_toClifford(__pyx_v_lhs) | __pyx_f_8PyClical_toClifford(__pyx_v_rhs)));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 947, __pyx_L1_error)
9129 __Pyx_GOTREF(__pyx_t_2);
9130 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9131 __pyx_r = __pyx_t_2;
9145 __Pyx_XDECREF(__pyx_t_1);
9146 __Pyx_XDECREF(__pyx_t_2);
9147 __Pyx_AddTraceback(
"PyClical.clifford.__or__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9150 __Pyx_XGIVEREF(__pyx_r);
9151 __Pyx_RefNannyFinishContext();
9164 static PyObject *__pyx_pw_8PyClical_8clifford_53__ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
9165 static char __pyx_doc_8PyClical_8clifford_52__ior__[] =
"\n Transform left hand side, using right hand side as a transformation.\n\n >>> x=clifford(\"{1,2}\") * pi/2; y=clifford(\"{1}\"); y|=x; print y\n -{1}\n >>> x=clifford(\"{1,2}\") * pi/2; y=clifford(\"{1}\"); y|=exp(x); print y\n -{1}\n ";
9166 #if CYTHON_COMPILING_IN_CPYTHON 9167 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_52__ior__;
9169 static PyObject *__pyx_pw_8PyClical_8clifford_53__ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
9170 PyObject *__pyx_r = 0;
9171 __Pyx_RefNannyDeclarations
9172 __Pyx_RefNannySetupContext(
"__ior__ (wrapper)", 0);
9173 __pyx_r = __pyx_pf_8PyClical_8clifford_52__ior__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
9176 __Pyx_RefNannyFinishContext();
9180 static PyObject *__pyx_pf_8PyClical_8clifford_52__ior__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
9181 PyObject *__pyx_r = NULL;
9182 __Pyx_RefNannyDeclarations
9183 PyObject *__pyx_t_1 = NULL;
9184 __Pyx_RefNannySetupContext(
"__ior__", 0);
9193 __Pyx_XDECREF(__pyx_r);
9194 __pyx_t_1 = __pyx_f_8PyClical_8clifford_wrap(__pyx_v_self, (__pyx_f_8PyClical_8clifford_unwrap(__pyx_v_self) | __pyx_f_8PyClical_toClifford(__pyx_v_rhs)));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 958, __pyx_L1_error)
9195 __Pyx_GOTREF(__pyx_t_1);
9196 __pyx_r = __pyx_t_1;
9210 __Pyx_XDECREF(__pyx_t_1);
9211 __Pyx_AddTraceback(
"PyClical.clifford.__ior__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9214 __Pyx_XGIVEREF(__pyx_r);
9215 __Pyx_RefNannyFinishContext();
9228 static PyObject *__pyx_pw_8PyClical_8clifford_55__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_m, PyObject *__pyx_v_dummy);
9229 static char __pyx_doc_8PyClical_8clifford_54__pow__[] =
"\n Power: self to the m.\n\n >>> x=clifford(\"{1}\"); print x ** 2\n 1\n >>> x=clifford(\"2\"); print x ** 2\n 4\n >>> x=clifford(\"2+{1}\"); print x ** 0\n 1\n >>> x=clifford(\"2+{1}\"); print x ** 1\n 2+{1}\n >>> x=clifford(\"2+{1}\"); print x ** 2\n 5+4{1}\n >>> i=clifford(\"{1,2}\");print exp(pi/2) * (i ** i)\n 1\n ";
9230 #if CYTHON_COMPILING_IN_CPYTHON 9231 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_54__pow__;
9233 static PyObject *__pyx_pw_8PyClical_8clifford_55__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_m, PyObject *__pyx_v_dummy) {
9234 PyObject *__pyx_r = 0;
9235 __Pyx_RefNannyDeclarations
9236 __Pyx_RefNannySetupContext(
"__pow__ (wrapper)", 0);
9237 __pyx_r = __pyx_pf_8PyClical_8clifford_54__pow__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_m), ((PyObject *)__pyx_v_dummy));
9240 __Pyx_RefNannyFinishContext();
9244 static PyObject *__pyx_pf_8PyClical_8clifford_54__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_m, CYTHON_UNUSED PyObject *__pyx_v_dummy) {
9245 PyObject *__pyx_r = NULL;
9246 __Pyx_RefNannyDeclarations
9247 PyObject *__pyx_t_1 = NULL;
9248 __Pyx_RefNannySetupContext(
"__pow__", 0);
9257 __Pyx_XDECREF(__pyx_r);
9258 __pyx_t_1 = __pyx_f_8PyClical_pow(__pyx_v_self, __pyx_v_m, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 977, __pyx_L1_error)
9259 __Pyx_GOTREF(__pyx_t_1);
9260 __pyx_r = __pyx_t_1;
9274 __Pyx_XDECREF(__pyx_t_1);
9275 __Pyx_AddTraceback(
"PyClical.clifford.__pow__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9278 __Pyx_XGIVEREF(__pyx_r);
9279 __Pyx_RefNannyFinishContext();
9292 static PyObject *__pyx_pw_8PyClical_8clifford_57pow(PyObject *__pyx_v_self, PyObject *__pyx_v_m);
9293 static char __pyx_doc_8PyClical_8clifford_56pow[] =
"\n Power: self to the m.\n\n >>> x=clifford(\"{1}\"); print x.pow(2)\n 1\n >>> x=clifford(\"2\"); print x.pow(2)\n 4\n >>> x=clifford(\"2+{1}\"); print x.pow(0)\n 1\n >>> x=clifford(\"2+{1}\"); print x.pow(1)\n 2+{1}\n >>> x=clifford(\"2+{1}\"); print x.pow(2)\n 5+4{1}\n >>> print clifford(\"1+{1}+{1,2}\").pow(3)\n 1+3{1}+3{1,2}\n >>> i=clifford(\"{1,2}\");print exp(pi/2) * i.pow(i)\n 1\n ";
9294 static PyObject *__pyx_pw_8PyClical_8clifford_57pow(PyObject *__pyx_v_self, PyObject *__pyx_v_m) {
9295 PyObject *__pyx_r = 0;
9296 __Pyx_RefNannyDeclarations
9297 __Pyx_RefNannySetupContext(
"pow (wrapper)", 0);
9298 __pyx_r = __pyx_pf_8PyClical_8clifford_56pow(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_m));
9301 __Pyx_RefNannyFinishContext();
9305 static PyObject *__pyx_pf_8PyClical_8clifford_56pow(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_m) {
9306 PyObject *__pyx_r = NULL;
9307 __Pyx_RefNannyDeclarations
9308 PyObject *__pyx_t_1 = NULL;
9309 PyObject *__pyx_t_2 = NULL;
9313 __Pyx_RefNannySetupContext(
"pow", 0);
9322 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_numbers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __pyx_L1_error)
9323 __Pyx_GOTREF(__pyx_t_1);
9324 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Integral);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 998, __pyx_L1_error)
9325 __Pyx_GOTREF(__pyx_t_2);
9326 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9327 __pyx_t_3 = PyObject_IsInstance(__pyx_v_m, __pyx_t_2);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(0, 998, __pyx_L1_error)
9328 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9329 __pyx_t_4 = (__pyx_t_3 != 0);
9339 __Pyx_XDECREF(__pyx_r);
9340 __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 999, __pyx_L1_error)
9341 __Pyx_GOTREF(__pyx_t_2);
9342 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_m);
if (unlikely((__pyx_t_5 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 999, __pyx_L1_error)
9343 __pyx_t_1 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_2), __pyx_v_self->instance->pow(__pyx_t_5));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 999, __pyx_L1_error)
9344 __Pyx_GOTREF(__pyx_t_1);
9345 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9346 __pyx_r = __pyx_t_1;
9367 __Pyx_XDECREF(__pyx_r);
9368 __pyx_t_1 = __pyx_f_8PyClical_log(((PyObject *)__pyx_v_self), 0, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1001, __pyx_L1_error)
9369 __Pyx_GOTREF(__pyx_t_1);
9370 __pyx_t_2 = PyNumber_Multiply(__pyx_v_m, __pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1001, __pyx_L1_error)
9371 __Pyx_GOTREF(__pyx_t_2);
9372 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9373 __pyx_t_1 = __pyx_f_8PyClical_exp(__pyx_t_2, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1001, __pyx_L1_error)
9374 __Pyx_GOTREF(__pyx_t_1);
9375 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9376 __pyx_r = __pyx_t_1;
9391 __Pyx_XDECREF(__pyx_t_1);
9392 __Pyx_XDECREF(__pyx_t_2);
9393 __Pyx_AddTraceback(
"PyClical.clifford.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
9396 __Pyx_XGIVEREF(__pyx_r);
9397 __Pyx_RefNannyFinishContext();
9410 static PyObject *__pyx_pw_8PyClical_8clifford_59outer_pow(PyObject *__pyx_v_self, PyObject *__pyx_v_m);
9411 static char __pyx_doc_8PyClical_8clifford_58outer_pow[] =
"\n Outer product power.\n\n >>> x=clifford(\"2+{1}\"); print x.outer_pow(0)\n 1\n >>> x=clifford(\"2+{1}\"); print x.outer_pow(1)\n 2+{1}\n >>> x=clifford(\"2+{1}\"); print x.outer_pow(2)\n 4+4{1}\n >>> print clifford(\"1+{1}+{1,2}\").outer_pow(3)\n 1+3{1}+3{1,2}\n\n ";
9412 static PyObject *__pyx_pw_8PyClical_8clifford_59outer_pow(PyObject *__pyx_v_self, PyObject *__pyx_v_m) {
9413 PyObject *__pyx_r = 0;
9414 __Pyx_RefNannyDeclarations
9415 __Pyx_RefNannySetupContext(
"outer_pow (wrapper)", 0);
9416 __pyx_r = __pyx_pf_8PyClical_8clifford_58outer_pow(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_m));
9419 __Pyx_RefNannyFinishContext();
9423 static PyObject *__pyx_pf_8PyClical_8clifford_58outer_pow(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_m) {
9424 PyObject *__pyx_r = NULL;
9425 __Pyx_RefNannyDeclarations
9426 PyObject *__pyx_t_1 = NULL;
9428 PyObject *__pyx_t_3 = NULL;
9429 __Pyx_RefNannySetupContext(
"outer_pow", 0);
9438 __Pyx_XDECREF(__pyx_r);
9439 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1017, __pyx_L1_error)
9440 __Pyx_GOTREF(__pyx_t_1);
9441 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_m);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1017, __pyx_L1_error)
9442 __pyx_t_3 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_1), __pyx_v_self->instance->outer_pow(__pyx_t_2));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1017, __pyx_L1_error)
9443 __Pyx_GOTREF(__pyx_t_3);
9444 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9445 __pyx_r = __pyx_t_3;
9459 __Pyx_XDECREF(__pyx_t_1);
9460 __Pyx_XDECREF(__pyx_t_3);
9461 __Pyx_AddTraceback(
"PyClical.clifford.outer_pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
9464 __Pyx_XGIVEREF(__pyx_r);
9465 __Pyx_RefNannyFinishContext();
9478 static PyObject *__pyx_pw_8PyClical_8clifford_61__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
9479 static char __pyx_doc_8PyClical_8clifford_60__call__[] =
"\n Pure grade-vector part.\n\n >>> print clifford(\"{1}\")(1)\n {1}\n >>> print clifford(\"{1}\")(0)\n 0\n >>> print clifford(\"1+{1}+{1,2}\")(0)\n 1\n >>> print clifford(\"1+{1}+{1,2}\")(1)\n {1}\n >>> print clifford(\"1+{1}+{1,2}\")(2)\n {1,2}\n >>> print clifford(\"1+{1}+{1,2}\")(3)\n 0\n ";
9480 #if CYTHON_COMPILING_IN_CPYTHON 9481 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_60__call__;
9483 static PyObject *__pyx_pw_8PyClical_8clifford_61__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9484 PyObject *__pyx_v_grade = 0;
9485 PyObject *__pyx_r = 0;
9486 __Pyx_RefNannyDeclarations
9487 __Pyx_RefNannySetupContext(
"__call__ (wrapper)", 0);
9489 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_grade,0};
9490 PyObject* values[1] = {0};
9491 if (unlikely(__pyx_kwds)) {
9493 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9495 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9498 default:
goto __pyx_L5_argtuple_error;
9500 kw_args = PyDict_Size(__pyx_kwds);
9503 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_grade)) != 0)) kw_args--;
9504 else goto __pyx_L5_argtuple_error;
9506 if (unlikely(kw_args > 0)) {
9507 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__call__") < 0)) __PYX_ERR(0, 1019, __pyx_L3_error)
9509 }
else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
9510 goto __pyx_L5_argtuple_error;
9512 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9514 __pyx_v_grade = values[0];
9516 goto __pyx_L4_argument_unpacking_done;
9517 __pyx_L5_argtuple_error:;
9518 __Pyx_RaiseArgtupleInvalid(
"__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1019, __pyx_L3_error)
9520 __Pyx_AddTraceback(
"PyClical.clifford.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9521 __Pyx_RefNannyFinishContext();
9523 __pyx_L4_argument_unpacking_done:;
9524 __pyx_r = __pyx_pf_8PyClical_8clifford_60__call__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), __pyx_v_grade);
9527 __Pyx_RefNannyFinishContext();
9531 static PyObject *__pyx_pf_8PyClical_8clifford_60__call__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_grade) {
9532 PyObject *__pyx_r = NULL;
9533 __Pyx_RefNannyDeclarations
9534 PyObject *__pyx_t_1 = NULL;
9536 PyObject *__pyx_t_3 = NULL;
9537 __Pyx_RefNannySetupContext(
"__call__", 0);
9546 __Pyx_XDECREF(__pyx_r);
9547 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1036, __pyx_L1_error)
9548 __Pyx_GOTREF(__pyx_t_1);
9549 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_grade);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1036, __pyx_L1_error)
9550 __pyx_t_3 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_1), __pyx_v_self->instance->operator()(__pyx_t_2));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1036, __pyx_L1_error)
9551 __Pyx_GOTREF(__pyx_t_3);
9552 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9553 __pyx_r = __pyx_t_3;
9567 __Pyx_XDECREF(__pyx_t_1);
9568 __Pyx_XDECREF(__pyx_t_3);
9569 __Pyx_AddTraceback(
"PyClical.clifford.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9572 __Pyx_XGIVEREF(__pyx_r);
9573 __Pyx_RefNannyFinishContext();
9586 static PyObject *__pyx_pw_8PyClical_8clifford_63scalar(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9587 static char __pyx_doc_8PyClical_8clifford_62scalar[] =
"\n Scalar part.\n\n >>> clifford(\"1+{1}+{1,2}\").scalar()\n 1.0\n >>> clifford(\"{1,2}\").scalar()\n 0.0\n ";
9588 static PyObject *__pyx_pw_8PyClical_8clifford_63scalar(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9589 PyObject *__pyx_r = 0;
9590 __Pyx_RefNannyDeclarations
9591 __Pyx_RefNannySetupContext(
"scalar (wrapper)", 0);
9592 __pyx_r = __pyx_pf_8PyClical_8clifford_62scalar(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
9595 __Pyx_RefNannyFinishContext();
9599 static PyObject *__pyx_pf_8PyClical_8clifford_62scalar(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
9600 PyObject *__pyx_r = NULL;
9601 __Pyx_RefNannyDeclarations
9602 PyObject *__pyx_t_1 = NULL;
9603 __Pyx_RefNannySetupContext(
"scalar", 0);
9612 __Pyx_XDECREF(__pyx_r);
9613 __pyx_t_1 =
PyFloat_FromDouble(__pyx_v_self->instance->scalar());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1047, __pyx_L1_error)
9614 __Pyx_GOTREF(__pyx_t_1);
9615 __pyx_r = __pyx_t_1;
9629 __Pyx_XDECREF(__pyx_t_1);
9630 __Pyx_AddTraceback(
"PyClical.clifford.scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
9633 __Pyx_XGIVEREF(__pyx_r);
9634 __Pyx_RefNannyFinishContext();
9647 static PyObject *__pyx_pw_8PyClical_8clifford_65pure(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9648 static char __pyx_doc_8PyClical_8clifford_64pure[] =
"\n Pure part.\n\n >>> print clifford(\"1+{1}+{1,2}\").pure()\n {1}+{1,2}\n >>> print clifford(\"{1,2}\").pure()\n {1,2}\n ";
9649 static PyObject *__pyx_pw_8PyClical_8clifford_65pure(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9650 PyObject *__pyx_r = 0;
9651 __Pyx_RefNannyDeclarations
9652 __Pyx_RefNannySetupContext(
"pure (wrapper)", 0);
9653 __pyx_r = __pyx_pf_8PyClical_8clifford_64pure(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
9656 __Pyx_RefNannyFinishContext();
9660 static PyObject *__pyx_pf_8PyClical_8clifford_64pure(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
9661 PyObject *__pyx_r = NULL;
9662 __Pyx_RefNannyDeclarations
9663 PyObject *__pyx_t_1 = NULL;
9664 PyObject *__pyx_t_2 = NULL;
9665 __Pyx_RefNannySetupContext(
"pure", 0);
9674 __Pyx_XDECREF(__pyx_r);
9675 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1058, __pyx_L1_error)
9676 __Pyx_GOTREF(__pyx_t_1);
9677 __pyx_t_2 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_1), __pyx_v_self->instance->pure());
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1058, __pyx_L1_error)
9678 __Pyx_GOTREF(__pyx_t_2);
9679 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9680 __pyx_r = __pyx_t_2;
9694 __Pyx_XDECREF(__pyx_t_1);
9695 __Pyx_XDECREF(__pyx_t_2);
9696 __Pyx_AddTraceback(
"PyClical.clifford.pure", __pyx_clineno, __pyx_lineno, __pyx_filename);
9699 __Pyx_XGIVEREF(__pyx_r);
9700 __Pyx_RefNannyFinishContext();
9713 static PyObject *__pyx_pw_8PyClical_8clifford_67even(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9714 static char __pyx_doc_8PyClical_8clifford_66even[] =
"\n Even part of multivector, sum of even grade terms.\n\n >>> print clifford(\"1+{1}+{1,2}\").even()\n 1+{1,2}\n ";
9715 static PyObject *__pyx_pw_8PyClical_8clifford_67even(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9716 PyObject *__pyx_r = 0;
9717 __Pyx_RefNannyDeclarations
9718 __Pyx_RefNannySetupContext(
"even (wrapper)", 0);
9719 __pyx_r = __pyx_pf_8PyClical_8clifford_66even(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
9722 __Pyx_RefNannyFinishContext();
9726 static PyObject *__pyx_pf_8PyClical_8clifford_66even(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
9727 PyObject *__pyx_r = NULL;
9728 __Pyx_RefNannyDeclarations
9729 PyObject *__pyx_t_1 = NULL;
9730 PyObject *__pyx_t_2 = NULL;
9731 __Pyx_RefNannySetupContext(
"even", 0);
9740 __Pyx_XDECREF(__pyx_r);
9741 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1067, __pyx_L1_error)
9742 __Pyx_GOTREF(__pyx_t_1);
9743 __pyx_t_2 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_1), __pyx_v_self->instance->even());
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1067, __pyx_L1_error)
9744 __Pyx_GOTREF(__pyx_t_2);
9745 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9746 __pyx_r = __pyx_t_2;
9760 __Pyx_XDECREF(__pyx_t_1);
9761 __Pyx_XDECREF(__pyx_t_2);
9762 __Pyx_AddTraceback(
"PyClical.clifford.even", __pyx_clineno, __pyx_lineno, __pyx_filename);
9765 __Pyx_XGIVEREF(__pyx_r);
9766 __Pyx_RefNannyFinishContext();
9779 static PyObject *__pyx_pw_8PyClical_8clifford_69odd(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9780 static char __pyx_doc_8PyClical_8clifford_68odd[] =
"\n Odd part of multivector, sum of odd grade terms.\n\n >>> print clifford(\"1+{1}+{1,2}\").odd()\n {1}\n ";
9781 static PyObject *__pyx_pw_8PyClical_8clifford_69odd(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9782 PyObject *__pyx_r = 0;
9783 __Pyx_RefNannyDeclarations
9784 __Pyx_RefNannySetupContext(
"odd (wrapper)", 0);
9785 __pyx_r = __pyx_pf_8PyClical_8clifford_68odd(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
9788 __Pyx_RefNannyFinishContext();
9792 static PyObject *__pyx_pf_8PyClical_8clifford_68odd(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
9793 PyObject *__pyx_r = NULL;
9794 __Pyx_RefNannyDeclarations
9795 PyObject *__pyx_t_1 = NULL;
9796 PyObject *__pyx_t_2 = NULL;
9797 __Pyx_RefNannySetupContext(
"odd", 0);
9806 __Pyx_XDECREF(__pyx_r);
9807 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1076, __pyx_L1_error)
9808 __Pyx_GOTREF(__pyx_t_1);
9809 __pyx_t_2 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_1), __pyx_v_self->instance->odd());
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1076, __pyx_L1_error)
9810 __Pyx_GOTREF(__pyx_t_2);
9811 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9812 __pyx_r = __pyx_t_2;
9826 __Pyx_XDECREF(__pyx_t_1);
9827 __Pyx_XDECREF(__pyx_t_2);
9828 __Pyx_AddTraceback(
"PyClical.clifford.odd", __pyx_clineno, __pyx_lineno, __pyx_filename);
9831 __Pyx_XGIVEREF(__pyx_r);
9832 __Pyx_RefNannyFinishContext();
9845 static PyObject *__pyx_pw_8PyClical_8clifford_71vector_part(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
9846 static char __pyx_doc_8PyClical_8clifford_70vector_part[] =
"\n Vector part of multivector, as a Python list, with respect to frm.\n\n >>> print clifford(\"1+2{1}+3{2}+4{1,2}\").vector_part()\n [2.0, 3.0]\n >>> print clifford(\"1+2{1}+3{2}+4{1,2}\").vector_part(index_set({-1,1,2}))\n [0.0, 2.0, 3.0]\n ";
9847 static PyObject *__pyx_pw_8PyClical_8clifford_71vector_part(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9848 PyObject *__pyx_v_frm = 0;
9849 PyObject *__pyx_r = 0;
9850 __Pyx_RefNannyDeclarations
9851 __Pyx_RefNannySetupContext(
"vector_part (wrapper)", 0);
9853 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frm,0};
9854 PyObject* values[1] = {0};
9855 values[0] = ((PyObject *)Py_None);
9856 if (unlikely(__pyx_kwds)) {
9858 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9860 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9863 default:
goto __pyx_L5_argtuple_error;
9865 kw_args = PyDict_Size(__pyx_kwds);
9869 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_frm);
9870 if (value) { values[0] = value; kw_args--; }
9873 if (unlikely(kw_args > 0)) {
9874 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"vector_part") < 0)) __PYX_ERR(0, 1078, __pyx_L3_error)
9877 switch (PyTuple_GET_SIZE(__pyx_args)) {
9878 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9881 default:
goto __pyx_L5_argtuple_error;
9884 __pyx_v_frm = values[0];
9886 goto __pyx_L4_argument_unpacking_done;
9887 __pyx_L5_argtuple_error:;
9888 __Pyx_RaiseArgtupleInvalid(
"vector_part", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1078, __pyx_L3_error)
9890 __Pyx_AddTraceback(
"PyClical.clifford.vector_part", __pyx_clineno, __pyx_lineno, __pyx_filename);
9891 __Pyx_RefNannyFinishContext();
9893 __pyx_L4_argument_unpacking_done:;
9894 __pyx_r = __pyx_pf_8PyClical_8clifford_70vector_part(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), __pyx_v_frm);
9897 __Pyx_RefNannyFinishContext();
9901 static PyObject *__pyx_pf_8PyClical_8clifford_70vector_part(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_frm) {
9902 PyObject *__pyx_v_error_msg_prefix = NULL;
9903 std::vector<scalar_t> __pyx_v_vec;
9906 PyObject *__pyx_v_lst = NULL;
9907 PyObject *__pyx_v_err = NULL;
9908 PyObject *__pyx_r = NULL;
9909 __Pyx_RefNannyDeclarations
9910 PyObject *__pyx_t_1 = NULL;
9911 PyObject *__pyx_t_2 = NULL;
9912 PyObject *__pyx_t_3 = NULL;
9915 std::vector<scalar_t> __pyx_t_6;
9916 PyObject *__pyx_t_7 = NULL;
9920 PyObject *__pyx_t_11 = NULL;
9921 PyObject *__pyx_t_12 = NULL;
9922 PyObject *__pyx_t_13 = NULL;
9923 PyObject *__pyx_t_14 = NULL;
9924 PyObject *__pyx_t_15 = NULL;
9925 __Pyx_RefNannySetupContext(
"vector_part", 0);
9934 __Pyx_INCREF(__pyx_kp_s_Cannot_take_vector_part_of);
9935 __pyx_v_error_msg_prefix = __pyx_kp_s_Cannot_take_vector_part_of;
9945 __Pyx_PyThreadState_declare
9946 __Pyx_PyThreadState_assign
9947 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
9948 __Pyx_XGOTREF(__pyx_t_1);
9949 __Pyx_XGOTREF(__pyx_t_2);
9950 __Pyx_XGOTREF(__pyx_t_3);
9960 __pyx_t_4 = (__pyx_v_frm == Py_None);
9961 __pyx_t_5 = (__pyx_t_4 != 0);
9971 __pyx_t_6 = __pyx_v_self->instance->vector_part();
9972 __pyx_v_vec = __pyx_t_6;
9993 __pyx_t_6 = __pyx_v_self->instance->vector_part(__pyx_f_8PyClical_9index_set_unwrap(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_frm)));
9995 __Pyx_CppExn2PyErr();
9996 __PYX_ERR(0, 1095, __pyx_L3_error)
9998 __pyx_v_vec = __pyx_t_6;
10009 __pyx_v_n = __pyx_v_vec.size();
10018 __pyx_t_7 = PyList_New(1 * ((__pyx_v_n<0) ? 0:__pyx_v_n));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1097, __pyx_L3_error)
10019 __Pyx_GOTREF(__pyx_t_7);
10020 { Py_ssize_t __pyx_temp;
10021 for (__pyx_temp=0; __pyx_temp < __pyx_v_n; __pyx_temp++) {
10022 __Pyx_INCREF(__pyx_float_0_0);
10023 __Pyx_GIVEREF(__pyx_float_0_0);
10024 PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_float_0_0);
10027 __pyx_v_lst = ((PyObject*)__pyx_t_7);
10037 __pyx_t_8 = __pyx_v_n;
10038 __pyx_t_9 = __pyx_t_8;
10039 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
10040 __pyx_v_i = __pyx_t_10;
10049 __pyx_t_7 =
PyFloat_FromDouble((__pyx_v_vec[__pyx_v_i]));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1099, __pyx_L3_error)
10050 __Pyx_GOTREF(__pyx_t_7);
10051 if (unlikely(__Pyx_SetItemInt(__pyx_v_lst, __pyx_v_i, __pyx_t_7,
int, 1, __Pyx_PyInt_From_int, 1, 1, 1) < 0)) __PYX_ERR(0, 1099, __pyx_L3_error)
10052 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10062 __Pyx_XDECREF(__pyx_r);
10063 __Pyx_INCREF(__pyx_v_lst);
10064 __pyx_r = __pyx_v_lst;
10065 goto __pyx_L7_try_return;
10076 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10085 __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
10087 __Pyx_AddTraceback(
"PyClical.clifford.vector_part", __pyx_clineno, __pyx_lineno, __pyx_filename);
10088 if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_11, &__pyx_t_12) < 0) __PYX_ERR(0, 1101, __pyx_L5_except_error)
10089 __Pyx_GOTREF(__pyx_t_7);
10090 __Pyx_GOTREF(__pyx_t_11);
10091 __Pyx_GOTREF(__pyx_t_12);
10092 __Pyx_INCREF(__pyx_t_11);
10093 __pyx_v_err = __pyx_t_11;
10102 __pyx_t_13 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), ((PyObject *)__pyx_v_self));
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1102, __pyx_L5_except_error)
10103 __Pyx_GOTREF(__pyx_t_13);
10104 __pyx_t_14 = PyNumber_Add(__pyx_v_error_msg_prefix, __pyx_t_13);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1102, __pyx_L5_except_error)
10105 __Pyx_GOTREF(__pyx_t_14);
10106 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
10107 __pyx_t_13 = PyNumber_Add(__pyx_t_14, __pyx_kp_s_using_invalid);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1102, __pyx_L5_except_error)
10108 __Pyx_GOTREF(__pyx_t_13);
10109 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
10118 __pyx_t_14 = PyObject_Repr(__pyx_v_frm);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1103, __pyx_L5_except_error)
10119 __Pyx_GOTREF(__pyx_t_14);
10120 __pyx_t_15 = PyNumber_Add(__pyx_t_13, __pyx_t_14);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1103, __pyx_L5_except_error)
10121 __Pyx_GOTREF(__pyx_t_15);
10122 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
10123 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
10124 __pyx_t_14 = PyNumber_Add(__pyx_t_15, __pyx_kp_s_as_frame);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1103, __pyx_L5_except_error)
10125 __Pyx_GOTREF(__pyx_t_14);
10126 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
10135 __pyx_t_15 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_err);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1104, __pyx_L5_except_error)
10136 __Pyx_GOTREF(__pyx_t_15);
10137 __pyx_t_13 = PyNumber_Add(__pyx_t_14, __pyx_t_15);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1104, __pyx_L5_except_error)
10138 __Pyx_GOTREF(__pyx_t_13);
10139 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
10140 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
10149 __pyx_t_15 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_13);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1102, __pyx_L5_except_error)
10150 __Pyx_GOTREF(__pyx_t_15);
10151 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
10152 __Pyx_Raise(__pyx_t_15, 0, 0, 0);
10153 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
10154 __PYX_ERR(0, 1102, __pyx_L5_except_error)
10156 goto __pyx_L5_except_error;
10157 __pyx_L5_except_error:;
10166 __Pyx_XGIVEREF(__pyx_t_1);
10167 __Pyx_XGIVEREF(__pyx_t_2);
10168 __Pyx_XGIVEREF(__pyx_t_3);
10169 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
10170 goto __pyx_L1_error;
10171 __pyx_L7_try_return:;
10172 __Pyx_XGIVEREF(__pyx_t_1);
10173 __Pyx_XGIVEREF(__pyx_t_2);
10174 __Pyx_XGIVEREF(__pyx_t_3);
10175 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
10189 __Pyx_XDECREF(__pyx_t_7);
10190 __Pyx_XDECREF(__pyx_t_11);
10191 __Pyx_XDECREF(__pyx_t_12);
10192 __Pyx_XDECREF(__pyx_t_13);
10193 __Pyx_XDECREF(__pyx_t_14);
10194 __Pyx_XDECREF(__pyx_t_15);
10195 __Pyx_AddTraceback(
"PyClical.clifford.vector_part", __pyx_clineno, __pyx_lineno, __pyx_filename);
10198 __Pyx_XDECREF(__pyx_v_error_msg_prefix);
10199 __Pyx_XDECREF(__pyx_v_lst);
10200 __Pyx_XDECREF(__pyx_v_err);
10201 __Pyx_XGIVEREF(__pyx_r);
10202 __Pyx_RefNannyFinishContext();
10215 static PyObject *__pyx_pw_8PyClical_8clifford_73involute(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10216 static char __pyx_doc_8PyClical_8clifford_72involute[] =
"\n Main involution, each {i} is replaced by -{i} in each term,\n eg. clifford(\"{1}\") -> -clifford(\"{1}\").\n\n >>> print clifford(\"{1}\").involute()\n -{1}\n >>> print (clifford(\"{2}\") * clifford(\"{1}\")).involute()\n -{1,2}\n >>> print (clifford(\"{1}\") * clifford(\"{2}\")).involute()\n {1,2}\n >>> print clifford(\"1+{1}+{1,2}\").involute()\n 1-{1}+{1,2}\n ";
10217 static PyObject *__pyx_pw_8PyClical_8clifford_73involute(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10218 PyObject *__pyx_r = 0;
10219 __Pyx_RefNannyDeclarations
10220 __Pyx_RefNannySetupContext(
"involute (wrapper)", 0);
10221 __pyx_r = __pyx_pf_8PyClical_8clifford_72involute(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10224 __Pyx_RefNannyFinishContext();
10228 static PyObject *__pyx_pf_8PyClical_8clifford_72involute(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10229 PyObject *__pyx_r = NULL;
10230 __Pyx_RefNannyDeclarations
10231 PyObject *__pyx_t_1 = NULL;
10232 PyObject *__pyx_t_2 = NULL;
10233 __Pyx_RefNannySetupContext(
"involute", 0);
10242 __Pyx_XDECREF(__pyx_r);
10243 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1120, __pyx_L1_error)
10244 __Pyx_GOTREF(__pyx_t_1);
10245 __pyx_t_2 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_1), __pyx_v_self->instance->involute());
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1120, __pyx_L1_error)
10246 __Pyx_GOTREF(__pyx_t_2);
10247 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10248 __pyx_r = __pyx_t_2;
10262 __Pyx_XDECREF(__pyx_t_1);
10263 __Pyx_XDECREF(__pyx_t_2);
10264 __Pyx_AddTraceback(
"PyClical.clifford.involute", __pyx_clineno, __pyx_lineno, __pyx_filename);
10267 __Pyx_XGIVEREF(__pyx_r);
10268 __Pyx_RefNannyFinishContext();
10281 static PyObject *__pyx_pw_8PyClical_8clifford_75reverse(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10282 static char __pyx_doc_8PyClical_8clifford_74reverse[] =
"\n Reversion, eg. clifford(\"{1}\")*clifford(\"{2}\") -> clifford(\"{2}\")*clifford(\"{1}\").\n\n >>> print clifford(\"{1}\").reverse()\n {1}\n >>> print (clifford(\"{2}\") * clifford(\"{1}\")).reverse()\n {1,2}\n >>> print (clifford(\"{1}\") * clifford(\"{2}\")).reverse()\n -{1,2}\n >>> print clifford(\"1+{1}+{1,2}\").reverse()\n 1+{1}-{1,2}\n ";
10283 static PyObject *__pyx_pw_8PyClical_8clifford_75reverse(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10284 PyObject *__pyx_r = 0;
10285 __Pyx_RefNannyDeclarations
10286 __Pyx_RefNannySetupContext(
"reverse (wrapper)", 0);
10287 __pyx_r = __pyx_pf_8PyClical_8clifford_74reverse(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10290 __Pyx_RefNannyFinishContext();
10294 static PyObject *__pyx_pf_8PyClical_8clifford_74reverse(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10295 PyObject *__pyx_r = NULL;
10296 __Pyx_RefNannyDeclarations
10297 PyObject *__pyx_t_1 = NULL;
10298 PyObject *__pyx_t_2 = NULL;
10299 __Pyx_RefNannySetupContext(
"reverse", 0);
10308 __Pyx_XDECREF(__pyx_r);
10309 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1135, __pyx_L1_error)
10310 __Pyx_GOTREF(__pyx_t_1);
10311 __pyx_t_2 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_1), __pyx_v_self->instance->reverse());
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1135, __pyx_L1_error)
10312 __Pyx_GOTREF(__pyx_t_2);
10313 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10314 __pyx_r = __pyx_t_2;
10328 __Pyx_XDECREF(__pyx_t_1);
10329 __Pyx_XDECREF(__pyx_t_2);
10330 __Pyx_AddTraceback(
"PyClical.clifford.reverse", __pyx_clineno, __pyx_lineno, __pyx_filename);
10333 __Pyx_XGIVEREF(__pyx_r);
10334 __Pyx_RefNannyFinishContext();
10347 static PyObject *__pyx_pw_8PyClical_8clifford_77conj(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10348 static char __pyx_doc_8PyClical_8clifford_76conj[] =
"\n Conjugation, reverse o involute == involute o reverse.\n\n >>> print (clifford(\"{1}\")).conj()\n -{1}\n >>> print (clifford(\"{2}\") * clifford(\"{1}\")).conj()\n {1,2}\n >>> print (clifford(\"{1}\") * clifford(\"{2}\")).conj()\n -{1,2}\n >>> print clifford(\"1+{1}+{1,2}\").conj()\n 1-{1}-{1,2}\n ";
10349 static PyObject *__pyx_pw_8PyClical_8clifford_77conj(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10350 PyObject *__pyx_r = 0;
10351 __Pyx_RefNannyDeclarations
10352 __Pyx_RefNannySetupContext(
"conj (wrapper)", 0);
10353 __pyx_r = __pyx_pf_8PyClical_8clifford_76conj(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10356 __Pyx_RefNannyFinishContext();
10360 static PyObject *__pyx_pf_8PyClical_8clifford_76conj(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10361 PyObject *__pyx_r = NULL;
10362 __Pyx_RefNannyDeclarations
10363 PyObject *__pyx_t_1 = NULL;
10364 PyObject *__pyx_t_2 = NULL;
10365 __Pyx_RefNannySetupContext(
"conj", 0);
10374 __Pyx_XDECREF(__pyx_r);
10375 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1150, __pyx_L1_error)
10376 __Pyx_GOTREF(__pyx_t_1);
10377 __pyx_t_2 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_1), __pyx_v_self->instance->conj());
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1150, __pyx_L1_error)
10378 __Pyx_GOTREF(__pyx_t_2);
10379 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10380 __pyx_r = __pyx_t_2;
10394 __Pyx_XDECREF(__pyx_t_1);
10395 __Pyx_XDECREF(__pyx_t_2);
10396 __Pyx_AddTraceback(
"PyClical.clifford.conj", __pyx_clineno, __pyx_lineno, __pyx_filename);
10399 __Pyx_XGIVEREF(__pyx_r);
10400 __Pyx_RefNannyFinishContext();
10413 static PyObject *__pyx_pw_8PyClical_8clifford_79quad(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10414 static char __pyx_doc_8PyClical_8clifford_78quad[] =
"\n Quadratic form == (rev(x)*x)(0).\n\n >>> print clifford(\"1+{1}+{1,2}\").quad()\n 3.0\n >>> print clifford(\"1+{-1}+{1,2}+{1,2,3}\").quad()\n 2.0\n ";
10415 static PyObject *__pyx_pw_8PyClical_8clifford_79quad(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10416 PyObject *__pyx_r = 0;
10417 __Pyx_RefNannyDeclarations
10418 __Pyx_RefNannySetupContext(
"quad (wrapper)", 0);
10419 __pyx_r = __pyx_pf_8PyClical_8clifford_78quad(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10422 __Pyx_RefNannyFinishContext();
10426 static PyObject *__pyx_pf_8PyClical_8clifford_78quad(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10427 PyObject *__pyx_r = NULL;
10428 __Pyx_RefNannyDeclarations
10429 PyObject *__pyx_t_1 = NULL;
10430 __Pyx_RefNannySetupContext(
"quad", 0);
10439 __Pyx_XDECREF(__pyx_r);
10440 __pyx_t_1 =
PyFloat_FromDouble(__pyx_v_self->instance->quad());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1161, __pyx_L1_error)
10441 __Pyx_GOTREF(__pyx_t_1);
10442 __pyx_r = __pyx_t_1;
10456 __Pyx_XDECREF(__pyx_t_1);
10457 __Pyx_AddTraceback(
"PyClical.clifford.quad", __pyx_clineno, __pyx_lineno, __pyx_filename);
10460 __Pyx_XGIVEREF(__pyx_r);
10461 __Pyx_RefNannyFinishContext();
10474 static PyObject *__pyx_pw_8PyClical_8clifford_81norm(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10475 static char __pyx_doc_8PyClical_8clifford_80norm[] =
"\n Norm == sum of squares of coordinates.\n\n >>> clifford(\"1+{1}+{1,2}\").norm()\n 3.0\n >>> clifford(\"1+{-1}+{1,2}+{1,2,3}\").norm()\n 4.0\n ";
10476 static PyObject *__pyx_pw_8PyClical_8clifford_81norm(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10477 PyObject *__pyx_r = 0;
10478 __Pyx_RefNannyDeclarations
10479 __Pyx_RefNannySetupContext(
"norm (wrapper)", 0);
10480 __pyx_r = __pyx_pf_8PyClical_8clifford_80norm(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10483 __Pyx_RefNannyFinishContext();
10487 static PyObject *__pyx_pf_8PyClical_8clifford_80norm(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10488 PyObject *__pyx_r = NULL;
10489 __Pyx_RefNannyDeclarations
10490 PyObject *__pyx_t_1 = NULL;
10491 __Pyx_RefNannySetupContext(
"norm", 0);
10500 __Pyx_XDECREF(__pyx_r);
10501 __pyx_t_1 =
PyFloat_FromDouble(__pyx_v_self->instance->norm());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1172, __pyx_L1_error)
10502 __Pyx_GOTREF(__pyx_t_1);
10503 __pyx_r = __pyx_t_1;
10517 __Pyx_XDECREF(__pyx_t_1);
10518 __Pyx_AddTraceback(
"PyClical.clifford.norm", __pyx_clineno, __pyx_lineno, __pyx_filename);
10521 __Pyx_XGIVEREF(__pyx_r);
10522 __Pyx_RefNannyFinishContext();
10535 static PyObject *__pyx_pw_8PyClical_8clifford_83abs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10536 static char __pyx_doc_8PyClical_8clifford_82abs[] =
"\n Absolute value: square root of norm.\n\n >>> clifford(\"1+{-1}+{1,2}+{1,2,3}\").abs()\n 2.0\n ";
10537 static PyObject *__pyx_pw_8PyClical_8clifford_83abs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10538 PyObject *__pyx_r = 0;
10539 __Pyx_RefNannyDeclarations
10540 __Pyx_RefNannySetupContext(
"abs (wrapper)", 0);
10541 __pyx_r = __pyx_pf_8PyClical_8clifford_82abs(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10544 __Pyx_RefNannyFinishContext();
10548 static PyObject *__pyx_pf_8PyClical_8clifford_82abs(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10549 PyObject *__pyx_r = NULL;
10550 __Pyx_RefNannyDeclarations
10551 PyObject *__pyx_t_1 = NULL;
10552 __Pyx_RefNannySetupContext(
"abs", 0);
10561 __Pyx_XDECREF(__pyx_r);
10562 __pyx_t_1 =
PyFloat_FromDouble(
abs(__pyx_f_8PyClical_8clifford_unwrap(__pyx_v_self)));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
10563 __Pyx_GOTREF(__pyx_t_1);
10564 __pyx_r = __pyx_t_1;
10578 __Pyx_XDECREF(__pyx_t_1);
10579 __Pyx_AddTraceback(
"PyClical.clifford.abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
10582 __Pyx_XGIVEREF(__pyx_r);
10583 __Pyx_RefNannyFinishContext();
10596 static PyObject *__pyx_pw_8PyClical_8clifford_85max_abs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10597 static char __pyx_doc_8PyClical_8clifford_84max_abs[] =
"\n Maximum of absolute values of components of multivector: multivector infinity norm.\n\n >>> clifford(\"1+{-1}+{1,2}+{1,2,3}\").max_abs()\n 1.0\n >>> clifford(\"3+2{1}+{1,2}\").max_abs()\n 3.0\n ";
10598 static PyObject *__pyx_pw_8PyClical_8clifford_85max_abs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10599 PyObject *__pyx_r = 0;
10600 __Pyx_RefNannyDeclarations
10601 __Pyx_RefNannySetupContext(
"max_abs (wrapper)", 0);
10602 __pyx_r = __pyx_pf_8PyClical_8clifford_84max_abs(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10605 __Pyx_RefNannyFinishContext();
10609 static PyObject *__pyx_pf_8PyClical_8clifford_84max_abs(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10610 PyObject *__pyx_r = NULL;
10611 __Pyx_RefNannyDeclarations
10612 PyObject *__pyx_t_1 = NULL;
10613 __Pyx_RefNannySetupContext(
"max_abs", 0);
10622 __Pyx_XDECREF(__pyx_r);
10623 __pyx_t_1 =
PyFloat_FromDouble(__pyx_v_self->instance->max_abs());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1192, __pyx_L1_error)
10624 __Pyx_GOTREF(__pyx_t_1);
10625 __pyx_r = __pyx_t_1;
10639 __Pyx_XDECREF(__pyx_t_1);
10640 __Pyx_AddTraceback(
"PyClical.clifford.max_abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
10643 __Pyx_XGIVEREF(__pyx_r);
10644 __Pyx_RefNannyFinishContext();
10657 static PyObject *__pyx_pw_8PyClical_8clifford_87truncated(PyObject *__pyx_v_self, PyObject *__pyx_v_limit);
10658 static char __pyx_doc_8PyClical_8clifford_86truncated[] =
"\n Remove all terms of self with relative size smaller than limit.\n\n >>> clifford(\"1e8+{1}+1e-8{1,2}\").truncated(1.0e-6)\n clifford(\"100000000\")\n >>> clifford(\"1e4+{1}+1e-4{1,2}\").truncated(1.0e-6)\n clifford(\"10000+{1}\")\n ";
10659 static PyObject *__pyx_pw_8PyClical_8clifford_87truncated(PyObject *__pyx_v_self, PyObject *__pyx_v_limit) {
10660 PyObject *__pyx_r = 0;
10661 __Pyx_RefNannyDeclarations
10662 __Pyx_RefNannySetupContext(
"truncated (wrapper)", 0);
10663 __pyx_r = __pyx_pf_8PyClical_8clifford_86truncated(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_limit));
10666 __Pyx_RefNannyFinishContext();
10670 static PyObject *__pyx_pf_8PyClical_8clifford_86truncated(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_limit) {
10671 PyObject *__pyx_r = NULL;
10672 __Pyx_RefNannyDeclarations
10673 PyObject *__pyx_t_1 = NULL;
10675 PyObject *__pyx_t_3 = NULL;
10676 __Pyx_RefNannySetupContext(
"truncated", 0);
10685 __Pyx_XDECREF(__pyx_r);
10686 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1203, __pyx_L1_error)
10687 __Pyx_GOTREF(__pyx_t_1);
10688 __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_limit);
if (unlikely((__pyx_t_2 == ((
scalar_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1203, __pyx_L1_error)
10689 __pyx_t_3 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_1), __pyx_v_self->instance->truncated(__pyx_t_2));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1203, __pyx_L1_error)
10690 __Pyx_GOTREF(__pyx_t_3);
10691 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10692 __pyx_r = __pyx_t_3;
10706 __Pyx_XDECREF(__pyx_t_1);
10707 __Pyx_XDECREF(__pyx_t_3);
10708 __Pyx_AddTraceback(
"PyClical.clifford.truncated", __pyx_clineno, __pyx_lineno, __pyx_filename);
10711 __Pyx_XGIVEREF(__pyx_r);
10712 __Pyx_RefNannyFinishContext();
10725 static PyObject *__pyx_pw_8PyClical_8clifford_89isnan(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10726 static char __pyx_doc_8PyClical_8clifford_88isnan[] =
"\n Check if a multivector contains any IEEE NaN values.\n\n >>> clifford().isnan()\n False\n ";
10727 static PyObject *__pyx_pw_8PyClical_8clifford_89isnan(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10728 PyObject *__pyx_r = 0;
10729 __Pyx_RefNannyDeclarations
10730 __Pyx_RefNannySetupContext(
"isnan (wrapper)", 0);
10731 __pyx_r = __pyx_pf_8PyClical_8clifford_88isnan(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10734 __Pyx_RefNannyFinishContext();
10738 static PyObject *__pyx_pf_8PyClical_8clifford_88isnan(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10739 PyObject *__pyx_r = NULL;
10740 __Pyx_RefNannyDeclarations
10741 PyObject *__pyx_t_1 = NULL;
10742 __Pyx_RefNannySetupContext(
"isnan", 0);
10751 __Pyx_XDECREF(__pyx_r);
10752 __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->instance->isnan());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1212, __pyx_L1_error)
10753 __Pyx_GOTREF(__pyx_t_1);
10754 __pyx_r = __pyx_t_1;
10768 __Pyx_XDECREF(__pyx_t_1);
10769 __Pyx_AddTraceback(
"PyClical.clifford.isnan", __pyx_clineno, __pyx_lineno, __pyx_filename);
10772 __Pyx_XGIVEREF(__pyx_r);
10773 __Pyx_RefNannyFinishContext();
10786 static PyObject *__pyx_pw_8PyClical_8clifford_91frame(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10787 static char __pyx_doc_8PyClical_8clifford_90frame[] =
"\n Subalgebra generated by all generators of terms of given multivector.\n\n >>> print clifford(\"1+3{-1}+2{1,2}+4{-2,7}\").frame()\n {-2,-1,1,2,7}\n >>> s=clifford(\"1+3{-1}+2{1,2}+4{-2,7}\").frame(); type(s)\n <type 'PyClical.index_set'>\n ";
10788 static PyObject *__pyx_pw_8PyClical_8clifford_91frame(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10789 PyObject *__pyx_r = 0;
10790 __Pyx_RefNannyDeclarations
10791 __Pyx_RefNannySetupContext(
"frame (wrapper)", 0);
10792 __pyx_r = __pyx_pf_8PyClical_8clifford_90frame(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10795 __Pyx_RefNannyFinishContext();
10799 static PyObject *__pyx_pf_8PyClical_8clifford_90frame(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10800 PyObject *__pyx_r = NULL;
10801 __Pyx_RefNannyDeclarations
10802 PyObject *__pyx_t_1 = NULL;
10803 PyObject *__pyx_t_2 = NULL;
10804 __Pyx_RefNannySetupContext(
"frame", 0);
10813 __Pyx_XDECREF(__pyx_r);
10814 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_index_set));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1223, __pyx_L1_error)
10815 __Pyx_GOTREF(__pyx_t_1);
10816 __pyx_t_2 = __pyx_f_8PyClical_9index_set_wrap(((
struct __pyx_obj_8PyClical_index_set *)__pyx_t_1), __pyx_v_self->instance->frame());
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1223, __pyx_L1_error)
10817 __Pyx_GOTREF(__pyx_t_2);
10818 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10819 __pyx_r = __pyx_t_2;
10833 __Pyx_XDECREF(__pyx_t_1);
10834 __Pyx_XDECREF(__pyx_t_2);
10835 __Pyx_AddTraceback(
"PyClical.clifford.frame", __pyx_clineno, __pyx_lineno, __pyx_filename);
10838 __Pyx_XGIVEREF(__pyx_r);
10839 __Pyx_RefNannyFinishContext();
10852 static PyObject *__pyx_pw_8PyClical_8clifford_93__repr__(PyObject *__pyx_v_self);
10853 static char __pyx_doc_8PyClical_8clifford_92__repr__[] =
"\n The \342\200\234official\342\200\235 string representation of self.\n\n >>> clifford(\"1+3{-1}+2{1,2}+4{-2,7}\").__repr__()\n 'clifford(\"1+3{-1}+2{1,2}+4{-2,7}\")'\n ";
10854 #if CYTHON_COMPILING_IN_CPYTHON 10855 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_92__repr__;
10857 static PyObject *__pyx_pw_8PyClical_8clifford_93__repr__(PyObject *__pyx_v_self) {
10858 PyObject *__pyx_r = 0;
10859 __Pyx_RefNannyDeclarations
10860 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
10861 __pyx_r = __pyx_pf_8PyClical_8clifford_92__repr__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10864 __Pyx_RefNannyFinishContext();
10868 static PyObject *__pyx_pf_8PyClical_8clifford_92__repr__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10869 PyObject *__pyx_r = NULL;
10870 __Pyx_RefNannyDeclarations
10871 PyObject *__pyx_t_1 = NULL;
10872 __Pyx_RefNannySetupContext(
"__repr__", 0);
10881 __Pyx_XDECREF(__pyx_r);
10882 __pyx_t_1 = __Pyx_PyBytes_FromString(
clifford_to_repr(__pyx_f_8PyClical_8clifford_unwrap(__pyx_v_self)).c_str());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1232, __pyx_L1_error)
10883 __Pyx_GOTREF(__pyx_t_1);
10884 __pyx_r = __pyx_t_1;
10898 __Pyx_XDECREF(__pyx_t_1);
10899 __Pyx_AddTraceback(
"PyClical.clifford.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10902 __Pyx_XGIVEREF(__pyx_r);
10903 __Pyx_RefNannyFinishContext();
10916 static PyObject *__pyx_pw_8PyClical_8clifford_95__str__(PyObject *__pyx_v_self);
10917 static char __pyx_doc_8PyClical_8clifford_94__str__[] =
"\n The \342\200\234informal\342\200\235 string representation of self.\n\n >>> clifford(\"1+3{-1}+2{1,2}+4{-2,7}\").__str__()\n '1+3{-1}+2{1,2}+4{-2,7}'\n ";
10918 #if CYTHON_COMPILING_IN_CPYTHON 10919 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_94__str__;
10921 static PyObject *__pyx_pw_8PyClical_8clifford_95__str__(PyObject *__pyx_v_self) {
10922 PyObject *__pyx_r = 0;
10923 __Pyx_RefNannyDeclarations
10924 __Pyx_RefNannySetupContext(
"__str__ (wrapper)", 0);
10925 __pyx_r = __pyx_pf_8PyClical_8clifford_94__str__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10928 __Pyx_RefNannyFinishContext();
10932 static PyObject *__pyx_pf_8PyClical_8clifford_94__str__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10933 PyObject *__pyx_r = NULL;
10934 __Pyx_RefNannyDeclarations
10935 PyObject *__pyx_t_1 = NULL;
10936 __Pyx_RefNannySetupContext(
"__str__", 0);
10945 __Pyx_XDECREF(__pyx_r);
10946 __pyx_t_1 = __Pyx_PyBytes_FromString(
clifford_to_str(__pyx_f_8PyClical_8clifford_unwrap(__pyx_v_self)).c_str());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1241, __pyx_L1_error)
10947 __Pyx_GOTREF(__pyx_t_1);
10948 __pyx_r = __pyx_t_1;
10962 __Pyx_XDECREF(__pyx_t_1);
10963 __Pyx_AddTraceback(
"PyClical.clifford.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10966 __Pyx_XGIVEREF(__pyx_r);
10967 __Pyx_RefNannyFinishContext();
10978 static PyObject *__pyx_pw_8PyClical_8clifford_97__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10979 static PyObject *__pyx_pw_8PyClical_8clifford_97__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10980 PyObject *__pyx_r = 0;
10981 __Pyx_RefNannyDeclarations
10982 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
10983 __pyx_r = __pyx_pf_8PyClical_8clifford_96__reduce_cython__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10986 __Pyx_RefNannyFinishContext();
10990 static PyObject *__pyx_pf_8PyClical_8clifford_96__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10991 PyObject *__pyx_r = NULL;
10992 __Pyx_RefNannyDeclarations
10993 PyObject *__pyx_t_1 = NULL;
10994 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
11002 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
11003 __Pyx_GOTREF(__pyx_t_1);
11004 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
11005 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11006 __PYX_ERR(1, 2, __pyx_L1_error)
11016 __Pyx_XDECREF(__pyx_t_1);
11017 __Pyx_AddTraceback(
"PyClical.clifford.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11019 __Pyx_XGIVEREF(__pyx_r);
11020 __Pyx_RefNannyFinishContext();
11032 static PyObject *__pyx_pw_8PyClical_8clifford_99__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
11033 static PyObject *__pyx_pw_8PyClical_8clifford_99__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
11034 PyObject *__pyx_r = 0;
11035 __Pyx_RefNannyDeclarations
11036 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
11037 __pyx_r = __pyx_pf_8PyClical_8clifford_98__setstate_cython__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
11040 __Pyx_RefNannyFinishContext();
11044 static PyObject *__pyx_pf_8PyClical_8clifford_98__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
11045 PyObject *__pyx_r = NULL;
11046 __Pyx_RefNannyDeclarations
11047 PyObject *__pyx_t_1 = NULL;
11048 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
11055 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__12, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
11056 __Pyx_GOTREF(__pyx_t_1);
11057 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
11058 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11059 __PYX_ERR(1, 4, __pyx_L1_error)
11070 __Pyx_XDECREF(__pyx_t_1);
11071 __Pyx_AddTraceback(
"PyClical.clifford.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11073 __Pyx_XGIVEREF(__pyx_r);
11074 __Pyx_RefNannyFinishContext();
11087 static PyObject *__pyx_pw_8PyClical_9clifford_hidden_doctests(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused);
11088 static char __pyx_doc_8PyClical_8clifford_hidden_doctests[] =
"\n Tests for functions that Doctest cannot see.\n\n For clifford.__cinit__: Construct an object of type clifford.\n\n >>> print clifford(2)\n 2\n >>> print clifford(2L)\n 2\n >>> print clifford(2.0)\n 2\n >>> print clifford(1.0e-1)\n 0.1\n >>> print clifford(\"2\")\n 2\n >>> print clifford(\"2{1,2,3}\")\n 2{1,2,3}\n >>> print clifford(clifford(\"2{1,2,3}\"))\n 2{1,2,3}\n >>> print clifford(\"-{1}\")\n -{1}\n >>> print clifford(2,index_set({1,2}))\n 2{1,2}\n >>> print clifford([2,3],index_set({1,2}))\n 2{1}+3{2}\n >>> print clifford([1,2])\n Traceback (most recent call last):\n ...\n TypeError: Cannot initialize clifford object from <type 'list'>.\n >>> print clifford(None)\n Traceback (most recent call last):\n ...\n TypeError: Cannot initialize clifford object from <type 'NoneType'>.\n >>> print clifford(None,[1,2])\n Traceback (most recent call last):\n ...\n TypeError: Cannot initialize clifford object from (<type 'NoneType'>, <type 'list'>).\n >>> print clifford([1,2],[1,2])\n Traceback (most recent call last):\n ...\n TypeError: Cannot initialize clifford object from (<type 'list'>, <type 'list'>).\n >>> print clifford(\"\")\n Traceback (most recent call last):\n ...\n ValueError: Cannot initialize clifford object from invalid string ''.\n >>> print clifford(\"{\")\n Traceback (most recent call last):\n ...\n ValueError: Cannot initialize clifford object from invalid string '{'.\n >>> print clifford(\"{1\")\n Traceback (most recent call last):\n ...\n ValueError: Cannot initialize clifford object from invalid string '{1'.\n >>> print clifford(\"+\")\n Traceback (most recent call last):\n ...\n ValueError: Cannot initialize clifford object from invalid string '+'.\n >>> print clifford(\"-\")\n Traceback (most recent call last):\n ...\n ValueError: Cannot initialize clifford"" object from invalid string '-'.\n >>> print clifford(\"{1}+\")\n Traceback (most recent call last):\n ...\n ValueError: Cannot initialize clifford object from invalid string '{1}+'.\n\n For clifford.__richcmp__: Compare objects of type clifford.\n\n >>> clifford(\"{1}\") == clifford(\"1{1}\")\n True\n >>> clifford(\"{1}\") != clifford(\"1.0{1}\")\n False\n >>> clifford(\"{1}\") != clifford(\"1.0\")\n True\n >>> clifford(\"{1,2}\") == None\n False\n >>> clifford(\"{1,2}\") != None\n True\n >>> None == clifford(\"{1,2}\")\n False\n >>> None != clifford(\"{1,2}\")\n True\n ";
11089 static PyMethodDef __pyx_mdef_8PyClical_9clifford_hidden_doctests = {
"clifford_hidden_doctests", (PyCFunction)__pyx_pw_8PyClical_9clifford_hidden_doctests, METH_NOARGS, __pyx_doc_8PyClical_8clifford_hidden_doctests};
11090 static PyObject *__pyx_pw_8PyClical_9clifford_hidden_doctests(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
11091 PyObject *__pyx_r = 0;
11092 __Pyx_RefNannyDeclarations
11093 __Pyx_RefNannySetupContext(
"clifford_hidden_doctests (wrapper)", 0);
11094 __pyx_r = __pyx_pf_8PyClical_8clifford_hidden_doctests(__pyx_self);
11097 __Pyx_RefNannyFinishContext();
11101 static PyObject *__pyx_pf_8PyClical_8clifford_hidden_doctests(CYTHON_UNUSED PyObject *__pyx_self) {
11102 PyObject *__pyx_r = NULL;
11103 __Pyx_RefNannyDeclarations
11104 __Pyx_RefNannySetupContext(
"clifford_hidden_doctests", 0);
11113 __Pyx_XDECREF(__pyx_r);
11114 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11127 __Pyx_XGIVEREF(__pyx_r);
11128 __Pyx_RefNannyFinishContext();
11140 static PyObject *__pyx_pw_8PyClical_11inv(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11141 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_inv(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11142 PyObject *__pyx_r = NULL;
11143 __Pyx_RefNannyDeclarations
11144 PyObject *__pyx_t_1 = NULL;
11145 PyObject *__pyx_t_2 = NULL;
11146 PyObject *__pyx_t_3 = NULL;
11147 __Pyx_RefNannySetupContext(
"inv", 0);
11156 __Pyx_XDECREF(__pyx_r);
11157 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_v_obj);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1342, __pyx_L1_error)
11158 __Pyx_GOTREF(__pyx_t_2);
11159 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inv);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1342, __pyx_L1_error)
11160 __Pyx_GOTREF(__pyx_t_3);
11161 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11163 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11164 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11165 if (likely(__pyx_t_2)) {
11166 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
11167 __Pyx_INCREF(__pyx_t_2);
11168 __Pyx_INCREF(
function);
11169 __Pyx_DECREF_SET(__pyx_t_3,
function);
11172 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
11173 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11174 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1342, __pyx_L1_error)
11175 __Pyx_GOTREF(__pyx_t_1);
11176 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11177 __pyx_r = __pyx_t_1;
11191 __Pyx_XDECREF(__pyx_t_1);
11192 __Pyx_XDECREF(__pyx_t_2);
11193 __Pyx_XDECREF(__pyx_t_3);
11194 __Pyx_AddTraceback(
"PyClical.inv", __pyx_clineno, __pyx_lineno, __pyx_filename);
11197 __Pyx_XGIVEREF(__pyx_r);
11198 __Pyx_RefNannyFinishContext();
11203 static PyObject *__pyx_pw_8PyClical_11inv(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11204 static char __pyx_doc_8PyClical_10inv[] =
"\n Geometric multiplicative inverse.\n\n >>> print inv(clifford(\"{1}\"))\n {1}\n >>> print inv(clifford(\"{-1}\"))\n -{-1}\n >>> print inv(clifford(\"{-2,-1}\"))\n -{-2,-1}\n >>> print inv(clifford(\"{-1}+{1}\"))\n nan\n ";
11205 static PyObject *__pyx_pw_8PyClical_11inv(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11206 PyObject *__pyx_r = 0;
11207 __Pyx_RefNannyDeclarations
11208 __Pyx_RefNannySetupContext(
"inv (wrapper)", 0);
11209 __pyx_r = __pyx_pf_8PyClical_10inv(__pyx_self, ((PyObject *)__pyx_v_obj));
11212 __Pyx_RefNannyFinishContext();
11216 static PyObject *__pyx_pf_8PyClical_10inv(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11217 PyObject *__pyx_r = NULL;
11218 __Pyx_RefNannyDeclarations
11219 PyObject *__pyx_t_1 = NULL;
11220 __Pyx_RefNannySetupContext(
"inv", 0);
11221 __Pyx_XDECREF(__pyx_r);
11222 __pyx_t_1 = __pyx_f_8PyClical_inv(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1329, __pyx_L1_error)
11223 __Pyx_GOTREF(__pyx_t_1);
11224 __pyx_r = __pyx_t_1;
11230 __Pyx_XDECREF(__pyx_t_1);
11231 __Pyx_AddTraceback(
"PyClical.inv", __pyx_clineno, __pyx_lineno, __pyx_filename);
11234 __Pyx_XGIVEREF(__pyx_r);
11235 __Pyx_RefNannyFinishContext();
11247 static PyObject *__pyx_pw_8PyClical_13scalar(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11248 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_scalar(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11249 PyObject *__pyx_r = NULL;
11250 __Pyx_RefNannyDeclarations
11251 PyObject *__pyx_t_1 = NULL;
11252 PyObject *__pyx_t_2 = NULL;
11253 PyObject *__pyx_t_3 = NULL;
11254 __Pyx_RefNannySetupContext(
"scalar", 0);
11263 __Pyx_XDECREF(__pyx_r);
11264 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_v_obj);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1353, __pyx_L1_error)
11265 __Pyx_GOTREF(__pyx_t_2);
11266 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_scalar);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1353, __pyx_L1_error)
11267 __Pyx_GOTREF(__pyx_t_3);
11268 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11270 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11271 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11272 if (likely(__pyx_t_2)) {
11273 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
11274 __Pyx_INCREF(__pyx_t_2);
11275 __Pyx_INCREF(
function);
11276 __Pyx_DECREF_SET(__pyx_t_3,
function);
11279 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
11280 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11281 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1353, __pyx_L1_error)
11282 __Pyx_GOTREF(__pyx_t_1);
11283 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11284 __pyx_r = __pyx_t_1;
11298 __Pyx_XDECREF(__pyx_t_1);
11299 __Pyx_XDECREF(__pyx_t_2);
11300 __Pyx_XDECREF(__pyx_t_3);
11301 __Pyx_AddTraceback(
"PyClical.scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
11304 __Pyx_XGIVEREF(__pyx_r);
11305 __Pyx_RefNannyFinishContext();
11310 static PyObject *__pyx_pw_8PyClical_13scalar(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11311 static char __pyx_doc_8PyClical_12scalar[] =
"\n Scalar part.\n\n >>> scalar(clifford(\"1+{1}+{1,2}\"))\n 1.0\n >>> scalar(clifford(\"{1,2}\"))\n 0.0\n ";
11312 static PyObject *__pyx_pw_8PyClical_13scalar(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11313 PyObject *__pyx_r = 0;
11314 __Pyx_RefNannyDeclarations
11315 __Pyx_RefNannySetupContext(
"scalar (wrapper)", 0);
11316 __pyx_r = __pyx_pf_8PyClical_12scalar(__pyx_self, ((PyObject *)__pyx_v_obj));
11319 __Pyx_RefNannyFinishContext();
11323 static PyObject *__pyx_pf_8PyClical_12scalar(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11324 PyObject *__pyx_r = NULL;
11325 __Pyx_RefNannyDeclarations
11326 PyObject *__pyx_t_1 = NULL;
11327 __Pyx_RefNannySetupContext(
"scalar", 0);
11328 __Pyx_XDECREF(__pyx_r);
11329 __pyx_t_1 = __pyx_f_8PyClical_scalar(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1344, __pyx_L1_error)
11330 __Pyx_GOTREF(__pyx_t_1);
11331 __pyx_r = __pyx_t_1;
11337 __Pyx_XDECREF(__pyx_t_1);
11338 __Pyx_AddTraceback(
"PyClical.scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
11341 __Pyx_XGIVEREF(__pyx_r);
11342 __Pyx_RefNannyFinishContext();
11354 static PyObject *__pyx_pw_8PyClical_15real(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11355 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_real(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11356 PyObject *__pyx_r = NULL;
11357 __Pyx_RefNannyDeclarations
11358 PyObject *__pyx_t_1 = NULL;
11359 PyObject *__pyx_t_2 = NULL;
11360 PyObject *__pyx_t_3 = NULL;
11361 __Pyx_RefNannySetupContext(
"real", 0);
11370 __Pyx_XDECREF(__pyx_r);
11371 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_v_obj);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1364, __pyx_L1_error)
11372 __Pyx_GOTREF(__pyx_t_2);
11373 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_scalar);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1364, __pyx_L1_error)
11374 __Pyx_GOTREF(__pyx_t_3);
11375 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11377 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11378 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11379 if (likely(__pyx_t_2)) {
11380 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
11381 __Pyx_INCREF(__pyx_t_2);
11382 __Pyx_INCREF(
function);
11383 __Pyx_DECREF_SET(__pyx_t_3,
function);
11386 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
11387 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11388 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1364, __pyx_L1_error)
11389 __Pyx_GOTREF(__pyx_t_1);
11390 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11391 __pyx_r = __pyx_t_1;
11405 __Pyx_XDECREF(__pyx_t_1);
11406 __Pyx_XDECREF(__pyx_t_2);
11407 __Pyx_XDECREF(__pyx_t_3);
11408 __Pyx_AddTraceback(
"PyClical.real", __pyx_clineno, __pyx_lineno, __pyx_filename);
11411 __Pyx_XGIVEREF(__pyx_r);
11412 __Pyx_RefNannyFinishContext();
11417 static PyObject *__pyx_pw_8PyClical_15real(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11418 static char __pyx_doc_8PyClical_14real[] =
"\n Real part: synonym for scalar part.\n\n >>> real(clifford(\"1+{1}+{1,2}\"))\n 1.0\n >>> real(clifford(\"{1,2}\"))\n 0.0\n ";
11419 static PyObject *__pyx_pw_8PyClical_15real(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11420 PyObject *__pyx_r = 0;
11421 __Pyx_RefNannyDeclarations
11422 __Pyx_RefNannySetupContext(
"real (wrapper)", 0);
11423 __pyx_r = __pyx_pf_8PyClical_14real(__pyx_self, ((PyObject *)__pyx_v_obj));
11426 __Pyx_RefNannyFinishContext();
11430 static PyObject *__pyx_pf_8PyClical_14real(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11431 PyObject *__pyx_r = NULL;
11432 __Pyx_RefNannyDeclarations
11433 PyObject *__pyx_t_1 = NULL;
11434 __Pyx_RefNannySetupContext(
"real", 0);
11435 __Pyx_XDECREF(__pyx_r);
11436 __pyx_t_1 = __pyx_f_8PyClical_real(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1355, __pyx_L1_error)
11437 __Pyx_GOTREF(__pyx_t_1);
11438 __pyx_r = __pyx_t_1;
11444 __Pyx_XDECREF(__pyx_t_1);
11445 __Pyx_AddTraceback(
"PyClical.real", __pyx_clineno, __pyx_lineno, __pyx_filename);
11448 __Pyx_XGIVEREF(__pyx_r);
11449 __Pyx_RefNannyFinishContext();
11461 static PyObject *__pyx_pw_8PyClical_17imag(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11462 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_imag(CYTHON_UNUSED PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11463 PyObject *__pyx_r = NULL;
11464 __Pyx_RefNannyDeclarations
11465 __Pyx_RefNannySetupContext(
"imag", 0);
11474 __Pyx_XDECREF(__pyx_r);
11475 __Pyx_INCREF(__pyx_float_0_0);
11476 __pyx_r = __pyx_float_0_0;
11489 __Pyx_XGIVEREF(__pyx_r);
11490 __Pyx_RefNannyFinishContext();
11495 static PyObject *__pyx_pw_8PyClical_17imag(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11496 static char __pyx_doc_8PyClical_16imag[] =
"\n Imaginary part: deprecated (always 0).\n\n >>> imag(clifford(\"1+{1}+{1,2}\"))\n 0.0\n >>> imag(clifford(\"{1,2}\"))\n 0.0\n ";
11497 static PyObject *__pyx_pw_8PyClical_17imag(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11498 PyObject *__pyx_r = 0;
11499 __Pyx_RefNannyDeclarations
11500 __Pyx_RefNannySetupContext(
"imag (wrapper)", 0);
11501 __pyx_r = __pyx_pf_8PyClical_16imag(__pyx_self, ((PyObject *)__pyx_v_obj));
11504 __Pyx_RefNannyFinishContext();
11508 static PyObject *__pyx_pf_8PyClical_16imag(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11509 PyObject *__pyx_r = NULL;
11510 __Pyx_RefNannyDeclarations
11511 PyObject *__pyx_t_1 = NULL;
11512 __Pyx_RefNannySetupContext(
"imag", 0);
11513 __Pyx_XDECREF(__pyx_r);
11514 __pyx_t_1 = __pyx_f_8PyClical_imag(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1366, __pyx_L1_error)
11515 __Pyx_GOTREF(__pyx_t_1);
11516 __pyx_r = __pyx_t_1;
11522 __Pyx_XDECREF(__pyx_t_1);
11523 __Pyx_AddTraceback(
"PyClical.imag", __pyx_clineno, __pyx_lineno, __pyx_filename);
11526 __Pyx_XGIVEREF(__pyx_r);
11527 __Pyx_RefNannyFinishContext();
11539 static PyObject *__pyx_pw_8PyClical_19pure(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11540 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_pure(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11541 PyObject *__pyx_r = NULL;
11542 __Pyx_RefNannyDeclarations
11543 PyObject *__pyx_t_1 = NULL;
11544 PyObject *__pyx_t_2 = NULL;
11545 PyObject *__pyx_t_3 = NULL;
11546 __Pyx_RefNannySetupContext(
"pure", 0);
11555 __Pyx_XDECREF(__pyx_r);
11556 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_v_obj);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1386, __pyx_L1_error)
11557 __Pyx_GOTREF(__pyx_t_2);
11558 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pure);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1386, __pyx_L1_error)
11559 __Pyx_GOTREF(__pyx_t_3);
11560 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11562 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11563 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11564 if (likely(__pyx_t_2)) {
11565 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
11566 __Pyx_INCREF(__pyx_t_2);
11567 __Pyx_INCREF(
function);
11568 __Pyx_DECREF_SET(__pyx_t_3,
function);
11571 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
11572 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11573 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1386, __pyx_L1_error)
11574 __Pyx_GOTREF(__pyx_t_1);
11575 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11576 __pyx_r = __pyx_t_1;
11590 __Pyx_XDECREF(__pyx_t_1);
11591 __Pyx_XDECREF(__pyx_t_2);
11592 __Pyx_XDECREF(__pyx_t_3);
11593 __Pyx_AddTraceback(
"PyClical.pure", __pyx_clineno, __pyx_lineno, __pyx_filename);
11596 __Pyx_XGIVEREF(__pyx_r);
11597 __Pyx_RefNannyFinishContext();
11602 static PyObject *__pyx_pw_8PyClical_19pure(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11603 static char __pyx_doc_8PyClical_18pure[] =
"\n Pure part\n\n >>> print pure(clifford(\"1+{1}+{1,2}\"))\n {1}+{1,2}\n >>> print pure(clifford(\"{1,2}\"))\n {1,2}\n ";
11604 static PyObject *__pyx_pw_8PyClical_19pure(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11605 PyObject *__pyx_r = 0;
11606 __Pyx_RefNannyDeclarations
11607 __Pyx_RefNannySetupContext(
"pure (wrapper)", 0);
11608 __pyx_r = __pyx_pf_8PyClical_18pure(__pyx_self, ((PyObject *)__pyx_v_obj));
11611 __Pyx_RefNannyFinishContext();
11615 static PyObject *__pyx_pf_8PyClical_18pure(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11616 PyObject *__pyx_r = NULL;
11617 __Pyx_RefNannyDeclarations
11618 PyObject *__pyx_t_1 = NULL;
11619 __Pyx_RefNannySetupContext(
"pure", 0);
11620 __Pyx_XDECREF(__pyx_r);
11621 __pyx_t_1 = __pyx_f_8PyClical_pure(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1377, __pyx_L1_error)
11622 __Pyx_GOTREF(__pyx_t_1);
11623 __pyx_r = __pyx_t_1;
11629 __Pyx_XDECREF(__pyx_t_1);
11630 __Pyx_AddTraceback(
"PyClical.pure", __pyx_clineno, __pyx_lineno, __pyx_filename);
11633 __Pyx_XGIVEREF(__pyx_r);
11634 __Pyx_RefNannyFinishContext();
11646 static PyObject *__pyx_pw_8PyClical_21even(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11647 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_even(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11648 PyObject *__pyx_r = NULL;
11649 __Pyx_RefNannyDeclarations
11650 PyObject *__pyx_t_1 = NULL;
11651 PyObject *__pyx_t_2 = NULL;
11652 PyObject *__pyx_t_3 = NULL;
11653 __Pyx_RefNannySetupContext(
"even", 0);
11662 __Pyx_XDECREF(__pyx_r);
11663 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_v_obj);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1395, __pyx_L1_error)
11664 __Pyx_GOTREF(__pyx_t_2);
11665 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_even);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1395, __pyx_L1_error)
11666 __Pyx_GOTREF(__pyx_t_3);
11667 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11669 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11670 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11671 if (likely(__pyx_t_2)) {
11672 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
11673 __Pyx_INCREF(__pyx_t_2);
11674 __Pyx_INCREF(
function);
11675 __Pyx_DECREF_SET(__pyx_t_3,
function);
11678 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
11679 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11680 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1395, __pyx_L1_error)
11681 __Pyx_GOTREF(__pyx_t_1);
11682 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11683 __pyx_r = __pyx_t_1;
11697 __Pyx_XDECREF(__pyx_t_1);
11698 __Pyx_XDECREF(__pyx_t_2);
11699 __Pyx_XDECREF(__pyx_t_3);
11700 __Pyx_AddTraceback(
"PyClical.even", __pyx_clineno, __pyx_lineno, __pyx_filename);
11703 __Pyx_XGIVEREF(__pyx_r);
11704 __Pyx_RefNannyFinishContext();
11709 static PyObject *__pyx_pw_8PyClical_21even(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11710 static char __pyx_doc_8PyClical_20even[] =
"\n Even part of multivector, sum of even grade terms.\n\n >>> print even(clifford(\"1+{1}+{1,2}\"))\n 1+{1,2}\n ";
11711 static PyObject *__pyx_pw_8PyClical_21even(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11712 PyObject *__pyx_r = 0;
11713 __Pyx_RefNannyDeclarations
11714 __Pyx_RefNannySetupContext(
"even (wrapper)", 0);
11715 __pyx_r = __pyx_pf_8PyClical_20even(__pyx_self, ((PyObject *)__pyx_v_obj));
11718 __Pyx_RefNannyFinishContext();
11722 static PyObject *__pyx_pf_8PyClical_20even(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11723 PyObject *__pyx_r = NULL;
11724 __Pyx_RefNannyDeclarations
11725 PyObject *__pyx_t_1 = NULL;
11726 __Pyx_RefNannySetupContext(
"even", 0);
11727 __Pyx_XDECREF(__pyx_r);
11728 __pyx_t_1 = __pyx_f_8PyClical_even(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1388, __pyx_L1_error)
11729 __Pyx_GOTREF(__pyx_t_1);
11730 __pyx_r = __pyx_t_1;
11736 __Pyx_XDECREF(__pyx_t_1);
11737 __Pyx_AddTraceback(
"PyClical.even", __pyx_clineno, __pyx_lineno, __pyx_filename);
11740 __Pyx_XGIVEREF(__pyx_r);
11741 __Pyx_RefNannyFinishContext();
11753 static PyObject *__pyx_pw_8PyClical_23odd(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11754 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_odd(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11755 PyObject *__pyx_r = NULL;
11756 __Pyx_RefNannyDeclarations
11757 PyObject *__pyx_t_1 = NULL;
11758 PyObject *__pyx_t_2 = NULL;
11759 PyObject *__pyx_t_3 = NULL;
11760 __Pyx_RefNannySetupContext(
"odd", 0);
11769 __Pyx_XDECREF(__pyx_r);
11770 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_v_obj);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1404, __pyx_L1_error)
11771 __Pyx_GOTREF(__pyx_t_2);
11772 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_odd);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1404, __pyx_L1_error)
11773 __Pyx_GOTREF(__pyx_t_3);
11774 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11776 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11777 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11778 if (likely(__pyx_t_2)) {
11779 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
11780 __Pyx_INCREF(__pyx_t_2);
11781 __Pyx_INCREF(
function);
11782 __Pyx_DECREF_SET(__pyx_t_3,
function);
11785 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
11786 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11787 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1404, __pyx_L1_error)
11788 __Pyx_GOTREF(__pyx_t_1);
11789 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11790 __pyx_r = __pyx_t_1;
11804 __Pyx_XDECREF(__pyx_t_1);
11805 __Pyx_XDECREF(__pyx_t_2);
11806 __Pyx_XDECREF(__pyx_t_3);
11807 __Pyx_AddTraceback(
"PyClical.odd", __pyx_clineno, __pyx_lineno, __pyx_filename);
11810 __Pyx_XGIVEREF(__pyx_r);
11811 __Pyx_RefNannyFinishContext();
11816 static PyObject *__pyx_pw_8PyClical_23odd(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11817 static char __pyx_doc_8PyClical_22odd[] =
"\n Odd part of multivector, sum of odd grade terms.\n\n >>> print odd(clifford(\"1+{1}+{1,2}\"))\n {1}\n ";
11818 static PyObject *__pyx_pw_8PyClical_23odd(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11819 PyObject *__pyx_r = 0;
11820 __Pyx_RefNannyDeclarations
11821 __Pyx_RefNannySetupContext(
"odd (wrapper)", 0);
11822 __pyx_r = __pyx_pf_8PyClical_22odd(__pyx_self, ((PyObject *)__pyx_v_obj));
11825 __Pyx_RefNannyFinishContext();
11829 static PyObject *__pyx_pf_8PyClical_22odd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11830 PyObject *__pyx_r = NULL;
11831 __Pyx_RefNannyDeclarations
11832 PyObject *__pyx_t_1 = NULL;
11833 __Pyx_RefNannySetupContext(
"odd", 0);
11834 __Pyx_XDECREF(__pyx_r);
11835 __pyx_t_1 = __pyx_f_8PyClical_odd(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1397, __pyx_L1_error)
11836 __Pyx_GOTREF(__pyx_t_1);
11837 __pyx_r = __pyx_t_1;
11843 __Pyx_XDECREF(__pyx_t_1);
11844 __Pyx_AddTraceback(
"PyClical.odd", __pyx_clineno, __pyx_lineno, __pyx_filename);
11847 __Pyx_XGIVEREF(__pyx_r);
11848 __Pyx_RefNannyFinishContext();
11860 static PyObject *__pyx_pw_8PyClical_25involute(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11861 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_involute(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11862 PyObject *__pyx_r = NULL;
11863 __Pyx_RefNannyDeclarations
11864 PyObject *__pyx_t_1 = NULL;
11865 PyObject *__pyx_t_2 = NULL;
11866 PyObject *__pyx_t_3 = NULL;
11867 __Pyx_RefNannySetupContext(
"involute", 0);
11876 __Pyx_XDECREF(__pyx_r);
11877 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_v_obj);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1419, __pyx_L1_error)
11878 __Pyx_GOTREF(__pyx_t_2);
11879 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_involute);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1419, __pyx_L1_error)
11880 __Pyx_GOTREF(__pyx_t_3);
11881 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11883 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11884 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11885 if (likely(__pyx_t_2)) {
11886 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
11887 __Pyx_INCREF(__pyx_t_2);
11888 __Pyx_INCREF(
function);
11889 __Pyx_DECREF_SET(__pyx_t_3,
function);
11892 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
11893 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11894 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1419, __pyx_L1_error)
11895 __Pyx_GOTREF(__pyx_t_1);
11896 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11897 __pyx_r = __pyx_t_1;
11911 __Pyx_XDECREF(__pyx_t_1);
11912 __Pyx_XDECREF(__pyx_t_2);
11913 __Pyx_XDECREF(__pyx_t_3);
11914 __Pyx_AddTraceback(
"PyClical.involute", __pyx_clineno, __pyx_lineno, __pyx_filename);
11917 __Pyx_XGIVEREF(__pyx_r);
11918 __Pyx_RefNannyFinishContext();
11923 static PyObject *__pyx_pw_8PyClical_25involute(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11924 static char __pyx_doc_8PyClical_24involute[] =
"\n Main involution, each {i} is replaced by -{i} in each term, eg. {1}*{2} -> (-{2})*(-{1})\n\n >>> print involute(clifford(\"{1}\"))\n -{1}\n >>> print involute(clifford(\"{2}\") * clifford(\"{1}\"))\n -{1,2}\n >>> print involute(clifford(\"{1}\") * clifford(\"{2}\"))\n {1,2}\n >>> print involute(clifford(\"1+{1}+{1,2}\"))\n 1-{1}+{1,2}\n ";
11925 static PyObject *__pyx_pw_8PyClical_25involute(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11926 PyObject *__pyx_r = 0;
11927 __Pyx_RefNannyDeclarations
11928 __Pyx_RefNannySetupContext(
"involute (wrapper)", 0);
11929 __pyx_r = __pyx_pf_8PyClical_24involute(__pyx_self, ((PyObject *)__pyx_v_obj));
11932 __Pyx_RefNannyFinishContext();
11936 static PyObject *__pyx_pf_8PyClical_24involute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11937 PyObject *__pyx_r = NULL;
11938 __Pyx_RefNannyDeclarations
11939 PyObject *__pyx_t_1 = NULL;
11940 __Pyx_RefNannySetupContext(
"involute", 0);
11941 __Pyx_XDECREF(__pyx_r);
11942 __pyx_t_1 = __pyx_f_8PyClical_involute(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1406, __pyx_L1_error)
11943 __Pyx_GOTREF(__pyx_t_1);
11944 __pyx_r = __pyx_t_1;
11950 __Pyx_XDECREF(__pyx_t_1);
11951 __Pyx_AddTraceback(
"PyClical.involute", __pyx_clineno, __pyx_lineno, __pyx_filename);
11954 __Pyx_XGIVEREF(__pyx_r);
11955 __Pyx_RefNannyFinishContext();
11967 static PyObject *__pyx_pw_8PyClical_27reverse(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11968 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_reverse(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11969 PyObject *__pyx_r = NULL;
11970 __Pyx_RefNannyDeclarations
11971 PyObject *__pyx_t_1 = NULL;
11972 PyObject *__pyx_t_2 = NULL;
11973 PyObject *__pyx_t_3 = NULL;
11974 __Pyx_RefNannySetupContext(
"reverse", 0);
11983 __Pyx_XDECREF(__pyx_r);
11984 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_v_obj);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1434, __pyx_L1_error)
11985 __Pyx_GOTREF(__pyx_t_2);
11986 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_reverse);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1434, __pyx_L1_error)
11987 __Pyx_GOTREF(__pyx_t_3);
11988 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11990 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11991 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11992 if (likely(__pyx_t_2)) {
11993 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
11994 __Pyx_INCREF(__pyx_t_2);
11995 __Pyx_INCREF(
function);
11996 __Pyx_DECREF_SET(__pyx_t_3,
function);
11999 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
12000 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12001 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1434, __pyx_L1_error)
12002 __Pyx_GOTREF(__pyx_t_1);
12003 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12004 __pyx_r = __pyx_t_1;
12018 __Pyx_XDECREF(__pyx_t_1);
12019 __Pyx_XDECREF(__pyx_t_2);
12020 __Pyx_XDECREF(__pyx_t_3);
12021 __Pyx_AddTraceback(
"PyClical.reverse", __pyx_clineno, __pyx_lineno, __pyx_filename);
12024 __Pyx_XGIVEREF(__pyx_r);
12025 __Pyx_RefNannyFinishContext();
12030 static PyObject *__pyx_pw_8PyClical_27reverse(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12031 static char __pyx_doc_8PyClical_26reverse[] =
"\n Reversion, eg. {1}*{2} -> {2}*{1}\n\n >>> print reverse(clifford(\"{1}\"))\n {1}\n >>> print reverse(clifford(\"{2}\") * clifford(\"{1}\"))\n {1,2}\n >>> print reverse(clifford(\"{1}\") * clifford(\"{2}\"))\n -{1,2}\n >>> print reverse(clifford(\"1+{1}+{1,2}\"))\n 1+{1}-{1,2}\n ";
12032 static PyObject *__pyx_pw_8PyClical_27reverse(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12033 PyObject *__pyx_r = 0;
12034 __Pyx_RefNannyDeclarations
12035 __Pyx_RefNannySetupContext(
"reverse (wrapper)", 0);
12036 __pyx_r = __pyx_pf_8PyClical_26reverse(__pyx_self, ((PyObject *)__pyx_v_obj));
12039 __Pyx_RefNannyFinishContext();
12043 static PyObject *__pyx_pf_8PyClical_26reverse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12044 PyObject *__pyx_r = NULL;
12045 __Pyx_RefNannyDeclarations
12046 PyObject *__pyx_t_1 = NULL;
12047 __Pyx_RefNannySetupContext(
"reverse", 0);
12048 __Pyx_XDECREF(__pyx_r);
12049 __pyx_t_1 = __pyx_f_8PyClical_reverse(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1421, __pyx_L1_error)
12050 __Pyx_GOTREF(__pyx_t_1);
12051 __pyx_r = __pyx_t_1;
12057 __Pyx_XDECREF(__pyx_t_1);
12058 __Pyx_AddTraceback(
"PyClical.reverse", __pyx_clineno, __pyx_lineno, __pyx_filename);
12061 __Pyx_XGIVEREF(__pyx_r);
12062 __Pyx_RefNannyFinishContext();
12074 static PyObject *__pyx_pw_8PyClical_29conj(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12075 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_conj(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12076 PyObject *__pyx_r = NULL;
12077 __Pyx_RefNannyDeclarations
12078 PyObject *__pyx_t_1 = NULL;
12079 PyObject *__pyx_t_2 = NULL;
12080 PyObject *__pyx_t_3 = NULL;
12081 __Pyx_RefNannySetupContext(
"conj", 0);
12090 __Pyx_XDECREF(__pyx_r);
12091 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_v_obj);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1449, __pyx_L1_error)
12092 __Pyx_GOTREF(__pyx_t_2);
12093 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_conj);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1449, __pyx_L1_error)
12094 __Pyx_GOTREF(__pyx_t_3);
12095 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12097 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
12098 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
12099 if (likely(__pyx_t_2)) {
12100 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
12101 __Pyx_INCREF(__pyx_t_2);
12102 __Pyx_INCREF(
function);
12103 __Pyx_DECREF_SET(__pyx_t_3,
function);
12106 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
12107 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12108 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1449, __pyx_L1_error)
12109 __Pyx_GOTREF(__pyx_t_1);
12110 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12111 __pyx_r = __pyx_t_1;
12125 __Pyx_XDECREF(__pyx_t_1);
12126 __Pyx_XDECREF(__pyx_t_2);
12127 __Pyx_XDECREF(__pyx_t_3);
12128 __Pyx_AddTraceback(
"PyClical.conj", __pyx_clineno, __pyx_lineno, __pyx_filename);
12131 __Pyx_XGIVEREF(__pyx_r);
12132 __Pyx_RefNannyFinishContext();
12137 static PyObject *__pyx_pw_8PyClical_29conj(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12138 static char __pyx_doc_8PyClical_28conj[] =
"\n Conjugation, reverse o involute == involute o reverse.\n\n >>> print conj(clifford(\"{1}\"))\n -{1}\n >>> print conj(clifford(\"{2}\") * clifford(\"{1}\"))\n {1,2}\n >>> print conj(clifford(\"{1}\") * clifford(\"{2}\"))\n -{1,2}\n >>> print conj(clifford(\"1+{1}+{1,2}\"))\n 1-{1}-{1,2}\n ";
12139 static PyObject *__pyx_pw_8PyClical_29conj(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12140 PyObject *__pyx_r = 0;
12141 __Pyx_RefNannyDeclarations
12142 __Pyx_RefNannySetupContext(
"conj (wrapper)", 0);
12143 __pyx_r = __pyx_pf_8PyClical_28conj(__pyx_self, ((PyObject *)__pyx_v_obj));
12146 __Pyx_RefNannyFinishContext();
12150 static PyObject *__pyx_pf_8PyClical_28conj(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12151 PyObject *__pyx_r = NULL;
12152 __Pyx_RefNannyDeclarations
12153 PyObject *__pyx_t_1 = NULL;
12154 __Pyx_RefNannySetupContext(
"conj", 0);
12155 __Pyx_XDECREF(__pyx_r);
12156 __pyx_t_1 = __pyx_f_8PyClical_conj(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1436, __pyx_L1_error)
12157 __Pyx_GOTREF(__pyx_t_1);
12158 __pyx_r = __pyx_t_1;
12164 __Pyx_XDECREF(__pyx_t_1);
12165 __Pyx_AddTraceback(
"PyClical.conj", __pyx_clineno, __pyx_lineno, __pyx_filename);
12168 __Pyx_XGIVEREF(__pyx_r);
12169 __Pyx_RefNannyFinishContext();
12181 static PyObject *__pyx_pw_8PyClical_31quad(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12182 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_quad(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12183 PyObject *__pyx_r = NULL;
12184 __Pyx_RefNannyDeclarations
12185 PyObject *__pyx_t_1 = NULL;
12186 PyObject *__pyx_t_2 = NULL;
12187 PyObject *__pyx_t_3 = NULL;
12188 __Pyx_RefNannySetupContext(
"quad", 0);
12197 __Pyx_XDECREF(__pyx_r);
12198 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_v_obj);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1460, __pyx_L1_error)
12199 __Pyx_GOTREF(__pyx_t_2);
12200 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_quad);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1460, __pyx_L1_error)
12201 __Pyx_GOTREF(__pyx_t_3);
12202 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12204 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
12205 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
12206 if (likely(__pyx_t_2)) {
12207 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
12208 __Pyx_INCREF(__pyx_t_2);
12209 __Pyx_INCREF(
function);
12210 __Pyx_DECREF_SET(__pyx_t_3,
function);
12213 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
12214 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12215 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1460, __pyx_L1_error)
12216 __Pyx_GOTREF(__pyx_t_1);
12217 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12218 __pyx_r = __pyx_t_1;
12232 __Pyx_XDECREF(__pyx_t_1);
12233 __Pyx_XDECREF(__pyx_t_2);
12234 __Pyx_XDECREF(__pyx_t_3);
12235 __Pyx_AddTraceback(
"PyClical.quad", __pyx_clineno, __pyx_lineno, __pyx_filename);
12238 __Pyx_XGIVEREF(__pyx_r);
12239 __Pyx_RefNannyFinishContext();
12244 static PyObject *__pyx_pw_8PyClical_31quad(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12245 static char __pyx_doc_8PyClical_30quad[] =
"\n Quadratic form == (rev(x)*x)(0).\n\n >>> print quad(clifford(\"1+{1}+{1,2}\"))\n 3.0\n >>> print quad(clifford(\"1+{-1}+{1,2}+{1,2,3}\"))\n 2.0\n ";
12246 static PyObject *__pyx_pw_8PyClical_31quad(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12247 PyObject *__pyx_r = 0;
12248 __Pyx_RefNannyDeclarations
12249 __Pyx_RefNannySetupContext(
"quad (wrapper)", 0);
12250 __pyx_r = __pyx_pf_8PyClical_30quad(__pyx_self, ((PyObject *)__pyx_v_obj));
12253 __Pyx_RefNannyFinishContext();
12257 static PyObject *__pyx_pf_8PyClical_30quad(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12258 PyObject *__pyx_r = NULL;
12259 __Pyx_RefNannyDeclarations
12260 PyObject *__pyx_t_1 = NULL;
12261 __Pyx_RefNannySetupContext(
"quad", 0);
12262 __Pyx_XDECREF(__pyx_r);
12263 __pyx_t_1 = __pyx_f_8PyClical_quad(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1451, __pyx_L1_error)
12264 __Pyx_GOTREF(__pyx_t_1);
12265 __pyx_r = __pyx_t_1;
12271 __Pyx_XDECREF(__pyx_t_1);
12272 __Pyx_AddTraceback(
"PyClical.quad", __pyx_clineno, __pyx_lineno, __pyx_filename);
12275 __Pyx_XGIVEREF(__pyx_r);
12276 __Pyx_RefNannyFinishContext();
12288 static PyObject *__pyx_pw_8PyClical_33norm(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12289 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_norm(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12290 PyObject *__pyx_r = NULL;
12291 __Pyx_RefNannyDeclarations
12292 PyObject *__pyx_t_1 = NULL;
12293 PyObject *__pyx_t_2 = NULL;
12294 PyObject *__pyx_t_3 = NULL;
12295 __Pyx_RefNannySetupContext(
"norm", 0);
12304 __Pyx_XDECREF(__pyx_r);
12305 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_v_obj);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1471, __pyx_L1_error)
12306 __Pyx_GOTREF(__pyx_t_2);
12307 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_norm);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1471, __pyx_L1_error)
12308 __Pyx_GOTREF(__pyx_t_3);
12309 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12311 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
12312 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
12313 if (likely(__pyx_t_2)) {
12314 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
12315 __Pyx_INCREF(__pyx_t_2);
12316 __Pyx_INCREF(
function);
12317 __Pyx_DECREF_SET(__pyx_t_3,
function);
12320 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
12321 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12322 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1471, __pyx_L1_error)
12323 __Pyx_GOTREF(__pyx_t_1);
12324 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12325 __pyx_r = __pyx_t_1;
12339 __Pyx_XDECREF(__pyx_t_1);
12340 __Pyx_XDECREF(__pyx_t_2);
12341 __Pyx_XDECREF(__pyx_t_3);
12342 __Pyx_AddTraceback(
"PyClical.norm", __pyx_clineno, __pyx_lineno, __pyx_filename);
12345 __Pyx_XGIVEREF(__pyx_r);
12346 __Pyx_RefNannyFinishContext();
12351 static PyObject *__pyx_pw_8PyClical_33norm(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12352 static char __pyx_doc_8PyClical_32norm[] =
"\n norm == sum of squares of coordinates.\n\n >>> norm(clifford(\"1+{1}+{1,2}\"))\n 3.0\n >>> norm(clifford(\"1+{-1}+{1,2}+{1,2,3}\"))\n 4.0\n ";
12353 static PyObject *__pyx_pw_8PyClical_33norm(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12354 PyObject *__pyx_r = 0;
12355 __Pyx_RefNannyDeclarations
12356 __Pyx_RefNannySetupContext(
"norm (wrapper)", 0);
12357 __pyx_r = __pyx_pf_8PyClical_32norm(__pyx_self, ((PyObject *)__pyx_v_obj));
12360 __Pyx_RefNannyFinishContext();
12364 static PyObject *__pyx_pf_8PyClical_32norm(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12365 PyObject *__pyx_r = NULL;
12366 __Pyx_RefNannyDeclarations
12367 PyObject *__pyx_t_1 = NULL;
12368 __Pyx_RefNannySetupContext(
"norm", 0);
12369 __Pyx_XDECREF(__pyx_r);
12370 __pyx_t_1 = __pyx_f_8PyClical_norm(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1462, __pyx_L1_error)
12371 __Pyx_GOTREF(__pyx_t_1);
12372 __pyx_r = __pyx_t_1;
12378 __Pyx_XDECREF(__pyx_t_1);
12379 __Pyx_AddTraceback(
"PyClical.norm", __pyx_clineno, __pyx_lineno, __pyx_filename);
12382 __Pyx_XGIVEREF(__pyx_r);
12383 __Pyx_RefNannyFinishContext();
12395 static PyObject *__pyx_pw_8PyClical_35abs(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12396 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_abs(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12397 PyObject *__pyx_r = NULL;
12398 __Pyx_RefNannyDeclarations
12399 PyObject *__pyx_t_1 = NULL;
12400 __Pyx_RefNannySetupContext(
"abs", 0);
12409 __Pyx_XDECREF(__pyx_r);
12410 __pyx_t_1 =
PyFloat_FromDouble(
abs(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1480, __pyx_L1_error)
12411 __Pyx_GOTREF(__pyx_t_1);
12412 __pyx_r = __pyx_t_1;
12426 __Pyx_XDECREF(__pyx_t_1);
12427 __Pyx_AddTraceback(
"PyClical.abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
12430 __Pyx_XGIVEREF(__pyx_r);
12431 __Pyx_RefNannyFinishContext();
12436 static PyObject *__pyx_pw_8PyClical_35abs(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12437 static char __pyx_doc_8PyClical_34abs[] =
"\n Absolute value of multivector: multivector 2-norm.\n\n >>> abs(clifford(\"1+{-1}+{1,2}+{1,2,3}\"))\n 2.0\n ";
12438 static PyObject *__pyx_pw_8PyClical_35abs(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12439 PyObject *__pyx_r = 0;
12440 __Pyx_RefNannyDeclarations
12441 __Pyx_RefNannySetupContext(
"abs (wrapper)", 0);
12442 __pyx_r = __pyx_pf_8PyClical_34abs(__pyx_self, ((PyObject *)__pyx_v_obj));
12445 __Pyx_RefNannyFinishContext();
12449 static PyObject *__pyx_pf_8PyClical_34abs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12450 PyObject *__pyx_r = NULL;
12451 __Pyx_RefNannyDeclarations
12452 PyObject *__pyx_t_1 = NULL;
12453 __Pyx_RefNannySetupContext(
"abs", 0);
12454 __Pyx_XDECREF(__pyx_r);
12455 __pyx_t_1 = __pyx_f_8PyClical_abs(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1473, __pyx_L1_error)
12456 __Pyx_GOTREF(__pyx_t_1);
12457 __pyx_r = __pyx_t_1;
12463 __Pyx_XDECREF(__pyx_t_1);
12464 __Pyx_AddTraceback(
"PyClical.abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
12467 __Pyx_XGIVEREF(__pyx_r);
12468 __Pyx_RefNannyFinishContext();
12480 static PyObject *__pyx_pw_8PyClical_37max_abs(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12481 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_max_abs(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12482 PyObject *__pyx_r = NULL;
12483 __Pyx_RefNannyDeclarations
12484 PyObject *__pyx_t_1 = NULL;
12485 __Pyx_RefNannySetupContext(
"max_abs", 0);
12494 __Pyx_XDECREF(__pyx_r);
12495 __pyx_t_1 =
PyFloat_FromDouble(
max_abs(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1492, __pyx_L1_error)
12496 __Pyx_GOTREF(__pyx_t_1);
12497 __pyx_r = __pyx_t_1;
12511 __Pyx_XDECREF(__pyx_t_1);
12512 __Pyx_AddTraceback(
"PyClical.max_abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
12515 __Pyx_XGIVEREF(__pyx_r);
12516 __Pyx_RefNannyFinishContext();
12521 static PyObject *__pyx_pw_8PyClical_37max_abs(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12522 static char __pyx_doc_8PyClical_36max_abs[] =
"\n Maximum absolute value of coordinates multivector: multivector infinity-norm.\n\n >>> max_abs(clifford(\"1+{-1}+{1,2}+{1,2,3}\"))\n 1.0\n >>> max_abs(clifford(\"3+2{1}+{1,2}\"))\n 3.0\n\n ";
12523 static PyObject *__pyx_pw_8PyClical_37max_abs(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12524 PyObject *__pyx_r = 0;
12525 __Pyx_RefNannyDeclarations
12526 __Pyx_RefNannySetupContext(
"max_abs (wrapper)", 0);
12527 __pyx_r = __pyx_pf_8PyClical_36max_abs(__pyx_self, ((PyObject *)__pyx_v_obj));
12530 __Pyx_RefNannyFinishContext();
12534 static PyObject *__pyx_pf_8PyClical_36max_abs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12535 PyObject *__pyx_r = NULL;
12536 __Pyx_RefNannyDeclarations
12537 PyObject *__pyx_t_1 = NULL;
12538 __Pyx_RefNannySetupContext(
"max_abs", 0);
12539 __Pyx_XDECREF(__pyx_r);
12540 __pyx_t_1 = __pyx_f_8PyClical_max_abs(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1482, __pyx_L1_error)
12541 __Pyx_GOTREF(__pyx_t_1);
12542 __pyx_r = __pyx_t_1;
12548 __Pyx_XDECREF(__pyx_t_1);
12549 __Pyx_AddTraceback(
"PyClical.max_abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
12552 __Pyx_XGIVEREF(__pyx_r);
12553 __Pyx_RefNannyFinishContext();
12565 static PyObject *__pyx_pw_8PyClical_39pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
12566 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_pow(PyObject *__pyx_v_obj, PyObject *__pyx_v_m, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12567 PyObject *__pyx_r = NULL;
12568 __Pyx_RefNannyDeclarations
12569 PyObject *__pyx_t_1 = NULL;
12570 PyObject *__pyx_t_2 = NULL;
12571 PyObject *__pyx_t_3 = NULL;
12572 PyObject *__pyx_t_4 = NULL;
12573 PyObject *__pyx_t_5 = NULL;
12574 PyObject *__pyx_t_6 = NULL;
12576 PyObject *__pyx_t_8 = NULL;
12577 PyObject *__pyx_t_9 = NULL;
12578 PyObject *__pyx_t_10 = NULL;
12579 __Pyx_RefNannySetupContext(
"pow", 0);
12589 __Pyx_PyThreadState_declare
12590 __Pyx_PyThreadState_assign
12591 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
12592 __Pyx_XGOTREF(__pyx_t_1);
12593 __Pyx_XGOTREF(__pyx_t_2);
12594 __Pyx_XGOTREF(__pyx_t_3);
12604 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1514, __pyx_L3_error)
12605 __Pyx_GOTREF(__pyx_t_5);
12606 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_pow);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1514, __pyx_L3_error)
12607 __Pyx_GOTREF(__pyx_t_6);
12608 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12611 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
12612 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
12613 if (likely(__pyx_t_5)) {
12614 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
12615 __Pyx_INCREF(__pyx_t_5);
12616 __Pyx_INCREF(
function);
12617 __Pyx_DECREF_SET(__pyx_t_6,
function);
12621 #if CYTHON_FAST_PYCALL 12622 if (PyFunction_Check(__pyx_t_6)) {
12623 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_obj, __pyx_v_m};
12624 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1514, __pyx_L3_error)
12625 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12626 __Pyx_GOTREF(__pyx_t_4);
12629 #if CYTHON_FAST_PYCCALL 12630 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
12631 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_obj, __pyx_v_m};
12632 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1514, __pyx_L3_error)
12633 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12634 __Pyx_GOTREF(__pyx_t_4);
12638 __pyx_t_8 = PyTuple_New(2+__pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1514, __pyx_L3_error)
12639 __Pyx_GOTREF(__pyx_t_8);
12641 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
12643 __Pyx_INCREF(__pyx_v_obj);
12644 __Pyx_GIVEREF(__pyx_v_obj);
12645 PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_obj);
12646 __Pyx_INCREF(__pyx_v_m);
12647 __Pyx_GIVEREF(__pyx_v_m);
12648 PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_m);
12649 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1514, __pyx_L3_error)
12650 __Pyx_GOTREF(__pyx_t_4);
12651 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12653 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12654 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12664 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12665 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12666 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12667 goto __pyx_L8_try_end;
12669 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12670 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12671 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12672 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
12682 __Pyx_AddTraceback(
"PyClical.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
12683 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_8) < 0) __PYX_ERR(0, 1515, __pyx_L5_except_error)
12684 __Pyx_GOTREF(__pyx_t_4);
12685 __Pyx_GOTREF(__pyx_t_6);
12686 __Pyx_GOTREF(__pyx_t_8);
12695 __Pyx_XDECREF(__pyx_r);
12696 __pyx_t_9 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_v_obj);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1516, __pyx_L5_except_error)
12697 __Pyx_GOTREF(__pyx_t_9);
12698 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_pow);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1516, __pyx_L5_except_error)
12699 __Pyx_GOTREF(__pyx_t_10);
12700 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12702 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
12703 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
12704 if (likely(__pyx_t_9)) {
12705 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_10);
12706 __Pyx_INCREF(__pyx_t_9);
12707 __Pyx_INCREF(
function);
12708 __Pyx_DECREF_SET(__pyx_t_10,
function);
12711 __pyx_t_5 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_9, __pyx_v_m) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_m);
12712 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
12713 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1516, __pyx_L5_except_error)
12714 __Pyx_GOTREF(__pyx_t_5);
12715 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12716 __pyx_r = __pyx_t_5;
12718 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12719 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12720 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12721 goto __pyx_L6_except_return;
12723 __pyx_L5_except_error:;
12732 __Pyx_XGIVEREF(__pyx_t_1);
12733 __Pyx_XGIVEREF(__pyx_t_2);
12734 __Pyx_XGIVEREF(__pyx_t_3);
12735 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
12736 goto __pyx_L1_error;
12737 __pyx_L6_except_return:;
12738 __Pyx_XGIVEREF(__pyx_t_1);
12739 __Pyx_XGIVEREF(__pyx_t_2);
12740 __Pyx_XGIVEREF(__pyx_t_3);
12741 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
12755 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12758 __Pyx_XDECREF(__pyx_t_4);
12759 __Pyx_XDECREF(__pyx_t_5);
12760 __Pyx_XDECREF(__pyx_t_6);
12761 __Pyx_XDECREF(__pyx_t_8);
12762 __Pyx_XDECREF(__pyx_t_9);
12763 __Pyx_XDECREF(__pyx_t_10);
12764 __Pyx_AddTraceback(
"PyClical.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
12767 __Pyx_XGIVEREF(__pyx_r);
12768 __Pyx_RefNannyFinishContext();
12773 static PyObject *__pyx_pw_8PyClical_39pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
12774 static char __pyx_doc_8PyClical_38pow[] =
"\n Integer power of multivector: obj to the m.\n\n >>> x=clifford(\"{1}\"); print pow(x,2)\n 1\n >>> x=clifford(\"2\"); print pow(x,2)\n 4\n >>> x=clifford(\"2+{1}\"); print pow(x,0)\n 1\n >>> x=clifford(\"2+{1}\"); print pow(x,1)\n 2+{1}\n >>> x=clifford(\"2+{1}\"); print pow(x,2)\n 5+4{1}\n >>> print pow(clifford(\"1+{1}+{1,2}\"),3)\n 1+3{1}+3{1,2}\n >>> i=clifford(\"{1,2}\");print exp(pi/2) * pow(i, i)\n 1\n ";
12775 static PyObject *__pyx_pw_8PyClical_39pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
12776 PyObject *__pyx_v_obj = 0;
12777 PyObject *__pyx_v_m = 0;
12778 PyObject *__pyx_r = 0;
12779 __Pyx_RefNannyDeclarations
12780 __Pyx_RefNannySetupContext(
"pow (wrapper)", 0);
12782 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_m,0};
12783 PyObject* values[2] = {0,0};
12784 if (unlikely(__pyx_kwds)) {
12785 Py_ssize_t kw_args;
12786 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
12787 switch (pos_args) {
12788 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12789 CYTHON_FALLTHROUGH;
12790 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12791 CYTHON_FALLTHROUGH;
12793 default:
goto __pyx_L5_argtuple_error;
12795 kw_args = PyDict_Size(__pyx_kwds);
12796 switch (pos_args) {
12798 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
12799 else goto __pyx_L5_argtuple_error;
12800 CYTHON_FALLTHROUGH;
12802 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
12804 __Pyx_RaiseArgtupleInvalid(
"pow", 1, 2, 2, 1); __PYX_ERR(0, 1494, __pyx_L3_error)
12807 if (unlikely(kw_args > 0)) {
12808 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"pow") < 0)) __PYX_ERR(0, 1494, __pyx_L3_error)
12810 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
12811 goto __pyx_L5_argtuple_error;
12813 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12814 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12816 __pyx_v_obj = values[0];
12817 __pyx_v_m = values[1];
12819 goto __pyx_L4_argument_unpacking_done;
12820 __pyx_L5_argtuple_error:;
12821 __Pyx_RaiseArgtupleInvalid(
"pow", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1494, __pyx_L3_error)
12823 __Pyx_AddTraceback(
"PyClical.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
12824 __Pyx_RefNannyFinishContext();
12826 __pyx_L4_argument_unpacking_done:;
12827 __pyx_r = __pyx_pf_8PyClical_38pow(__pyx_self, __pyx_v_obj, __pyx_v_m);
12830 __Pyx_RefNannyFinishContext();
12834 static PyObject *__pyx_pf_8PyClical_38pow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_m) {
12835 PyObject *__pyx_r = NULL;
12836 __Pyx_RefNannyDeclarations
12837 PyObject *__pyx_t_1 = NULL;
12838 __Pyx_RefNannySetupContext(
"pow", 0);
12839 __Pyx_XDECREF(__pyx_r);
12840 __pyx_t_1 = __pyx_f_8PyClical_pow(__pyx_v_obj, __pyx_v_m, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1494, __pyx_L1_error)
12841 __Pyx_GOTREF(__pyx_t_1);
12842 __pyx_r = __pyx_t_1;
12848 __Pyx_XDECREF(__pyx_t_1);
12849 __Pyx_AddTraceback(
"PyClical.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
12852 __Pyx_XGIVEREF(__pyx_r);
12853 __Pyx_RefNannyFinishContext();
12865 static PyObject *__pyx_pw_8PyClical_41outer_pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
12866 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_outer_pow(PyObject *__pyx_v_obj, PyObject *__pyx_v_m, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12867 PyObject *__pyx_r = NULL;
12868 __Pyx_RefNannyDeclarations
12869 PyObject *__pyx_t_1 = NULL;
12870 PyObject *__pyx_t_2 = NULL;
12871 PyObject *__pyx_t_3 = NULL;
12872 __Pyx_RefNannySetupContext(
"outer_pow", 0);
12881 __Pyx_XDECREF(__pyx_r);
12882 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_v_obj);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1525, __pyx_L1_error)
12883 __Pyx_GOTREF(__pyx_t_2);
12884 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_outer_pow);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1525, __pyx_L1_error)
12885 __Pyx_GOTREF(__pyx_t_3);
12886 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12888 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
12889 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
12890 if (likely(__pyx_t_2)) {
12891 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
12892 __Pyx_INCREF(__pyx_t_2);
12893 __Pyx_INCREF(
function);
12894 __Pyx_DECREF_SET(__pyx_t_3,
function);
12897 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_m) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_m);
12898 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12899 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1525, __pyx_L1_error)
12900 __Pyx_GOTREF(__pyx_t_1);
12901 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12902 __pyx_r = __pyx_t_1;
12916 __Pyx_XDECREF(__pyx_t_1);
12917 __Pyx_XDECREF(__pyx_t_2);
12918 __Pyx_XDECREF(__pyx_t_3);
12919 __Pyx_AddTraceback(
"PyClical.outer_pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
12922 __Pyx_XGIVEREF(__pyx_r);
12923 __Pyx_RefNannyFinishContext();
12928 static PyObject *__pyx_pw_8PyClical_41outer_pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
12929 static char __pyx_doc_8PyClical_40outer_pow[] =
"\n Outer product power of multivector.\n\n >>> print outer_pow(clifford(\"1+{1}+{1,2}\"),3)\n 1+3{1}+3{1,2}\n ";
12930 static PyObject *__pyx_pw_8PyClical_41outer_pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
12931 PyObject *__pyx_v_obj = 0;
12932 PyObject *__pyx_v_m = 0;
12933 PyObject *__pyx_r = 0;
12934 __Pyx_RefNannyDeclarations
12935 __Pyx_RefNannySetupContext(
"outer_pow (wrapper)", 0);
12937 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_m,0};
12938 PyObject* values[2] = {0,0};
12939 if (unlikely(__pyx_kwds)) {
12940 Py_ssize_t kw_args;
12941 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
12942 switch (pos_args) {
12943 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12944 CYTHON_FALLTHROUGH;
12945 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12946 CYTHON_FALLTHROUGH;
12948 default:
goto __pyx_L5_argtuple_error;
12950 kw_args = PyDict_Size(__pyx_kwds);
12951 switch (pos_args) {
12953 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
12954 else goto __pyx_L5_argtuple_error;
12955 CYTHON_FALLTHROUGH;
12957 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
12959 __Pyx_RaiseArgtupleInvalid(
"outer_pow", 1, 2, 2, 1); __PYX_ERR(0, 1518, __pyx_L3_error)
12962 if (unlikely(kw_args > 0)) {
12963 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"outer_pow") < 0)) __PYX_ERR(0, 1518, __pyx_L3_error)
12965 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
12966 goto __pyx_L5_argtuple_error;
12968 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12969 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12971 __pyx_v_obj = values[0];
12972 __pyx_v_m = values[1];
12974 goto __pyx_L4_argument_unpacking_done;
12975 __pyx_L5_argtuple_error:;
12976 __Pyx_RaiseArgtupleInvalid(
"outer_pow", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1518, __pyx_L3_error)
12978 __Pyx_AddTraceback(
"PyClical.outer_pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
12979 __Pyx_RefNannyFinishContext();
12981 __pyx_L4_argument_unpacking_done:;
12982 __pyx_r = __pyx_pf_8PyClical_40outer_pow(__pyx_self, __pyx_v_obj, __pyx_v_m);
12985 __Pyx_RefNannyFinishContext();
12989 static PyObject *__pyx_pf_8PyClical_40outer_pow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_m) {
12990 PyObject *__pyx_r = NULL;
12991 __Pyx_RefNannyDeclarations
12992 PyObject *__pyx_t_1 = NULL;
12993 __Pyx_RefNannySetupContext(
"outer_pow", 0);
12994 __Pyx_XDECREF(__pyx_r);
12995 __pyx_t_1 = __pyx_f_8PyClical_outer_pow(__pyx_v_obj, __pyx_v_m, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1518, __pyx_L1_error)
12996 __Pyx_GOTREF(__pyx_t_1);
12997 __pyx_r = __pyx_t_1;
13003 __Pyx_XDECREF(__pyx_t_1);
13004 __Pyx_AddTraceback(
"PyClical.outer_pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
13007 __Pyx_XGIVEREF(__pyx_r);
13008 __Pyx_RefNannyFinishContext();
13020 static PyObject *__pyx_pw_8PyClical_43complexifier(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13021 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_complexifier(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
13022 PyObject *__pyx_r = NULL;
13023 __Pyx_RefNannyDeclarations
13024 PyObject *__pyx_t_1 = NULL;
13025 PyObject *__pyx_t_2 = NULL;
13026 __Pyx_RefNannySetupContext(
"complexifier", 0);
13035 __Pyx_XDECREF(__pyx_r);
13036 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1540, __pyx_L1_error)
13037 __Pyx_GOTREF(__pyx_t_1);
13038 __pyx_t_2 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_1),
complexifier(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1540, __pyx_L1_error)
13039 __Pyx_GOTREF(__pyx_t_2);
13040 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13041 __pyx_r = __pyx_t_2;
13055 __Pyx_XDECREF(__pyx_t_1);
13056 __Pyx_XDECREF(__pyx_t_2);
13057 __Pyx_AddTraceback(
"PyClical.complexifier", __pyx_clineno, __pyx_lineno, __pyx_filename);
13060 __Pyx_XGIVEREF(__pyx_r);
13061 __Pyx_RefNannyFinishContext();
13066 static PyObject *__pyx_pw_8PyClical_43complexifier(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13067 static char __pyx_doc_8PyClical_42complexifier[] =
"\n Square root of -1 which commutes with all members of the frame of the given multivector.\n\n >>> print complexifier(clifford(index_set({1})))\n {1,2,3}\n >>> print complexifier(clifford(index_set({-1})))\n {-1}\n >>> print complexifier(index_set({1}))\n {1,2,3}\n >>> print complexifier(index_set({-1}))\n {-1}\n ";
13068 static PyObject *__pyx_pw_8PyClical_43complexifier(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13069 PyObject *__pyx_r = 0;
13070 __Pyx_RefNannyDeclarations
13071 __Pyx_RefNannySetupContext(
"complexifier (wrapper)", 0);
13072 __pyx_r = __pyx_pf_8PyClical_42complexifier(__pyx_self, ((PyObject *)__pyx_v_obj));
13075 __Pyx_RefNannyFinishContext();
13079 static PyObject *__pyx_pf_8PyClical_42complexifier(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13080 PyObject *__pyx_r = NULL;
13081 __Pyx_RefNannyDeclarations
13082 PyObject *__pyx_t_1 = NULL;
13083 __Pyx_RefNannySetupContext(
"complexifier", 0);
13084 __Pyx_XDECREF(__pyx_r);
13085 __pyx_t_1 = __pyx_f_8PyClical_complexifier(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1527, __pyx_L1_error)
13086 __Pyx_GOTREF(__pyx_t_1);
13087 __pyx_r = __pyx_t_1;
13093 __Pyx_XDECREF(__pyx_t_1);
13094 __Pyx_AddTraceback(
"PyClical.complexifier", __pyx_clineno, __pyx_lineno, __pyx_filename);
13097 __Pyx_XGIVEREF(__pyx_r);
13098 __Pyx_RefNannyFinishContext();
13110 static PyObject *__pyx_pw_8PyClical_45sqrt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13111 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_sqrt(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_sqrt *__pyx_optional_args) {
13112 PyObject *__pyx_v_i = ((PyObject *)Py_None);
13113 PyObject *__pyx_r = NULL;
13114 __Pyx_RefNannyDeclarations
13117 PyObject *__pyx_t_3 = NULL;
13119 PyObject *__pyx_t_5 = NULL;
13120 PyObject *__pyx_t_6 = NULL;
13121 PyObject *__pyx_t_7 = NULL;
13122 PyObject *__pyx_t_8 = NULL;
13123 PyObject *__pyx_t_9 = NULL;
13124 PyObject *__pyx_t_10 = NULL;
13125 PyObject *__pyx_t_11 = NULL;
13126 __Pyx_RefNannySetupContext(
"sqrt", 0);
13127 if (__pyx_optional_args) {
13128 if (__pyx_optional_args->__pyx_n > 0) {
13129 __pyx_v_i = __pyx_optional_args->i;
13140 __pyx_t_1 = (__pyx_v_i != Py_None);
13141 __pyx_t_2 = (__pyx_t_1 != 0);
13151 __Pyx_XDECREF(__pyx_r);
13152 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1558, __pyx_L1_error)
13153 __Pyx_GOTREF(__pyx_t_3);
13155 __pyx_t_4 =
sqrt(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
13157 __Pyx_CppExn2PyErr();
13158 __PYX_ERR(0, 1558, __pyx_L1_error)
13160 __pyx_t_5 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_3), __pyx_t_4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1558, __pyx_L1_error)
13161 __Pyx_GOTREF(__pyx_t_5);
13162 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13163 __pyx_r = __pyx_t_5;
13185 __Pyx_PyThreadState_declare
13186 __Pyx_PyThreadState_assign
13187 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
13188 __Pyx_XGOTREF(__pyx_t_6);
13189 __Pyx_XGOTREF(__pyx_t_7);
13190 __Pyx_XGOTREF(__pyx_t_8);
13200 __Pyx_XDECREF(__pyx_r);
13201 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1561, __pyx_L4_error)
13202 __Pyx_GOTREF(__pyx_t_3);
13203 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sqrt);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1561, __pyx_L4_error)
13204 __Pyx_GOTREF(__pyx_t_9);
13205 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13207 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
13208 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
13209 if (likely(__pyx_t_3)) {
13210 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
13211 __Pyx_INCREF(__pyx_t_3);
13212 __Pyx_INCREF(
function);
13213 __Pyx_DECREF_SET(__pyx_t_9,
function);
13216 __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_3, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
13217 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13218 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1561, __pyx_L4_error)
13219 __Pyx_GOTREF(__pyx_t_5);
13220 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13221 __pyx_r = __pyx_t_5;
13223 goto __pyx_L8_try_return;
13234 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13235 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13236 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
13246 __Pyx_AddTraceback(
"PyClical.sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename);
13247 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1562, __pyx_L6_except_error)
13248 __Pyx_GOTREF(__pyx_t_5);
13249 __Pyx_GOTREF(__pyx_t_9);
13250 __Pyx_GOTREF(__pyx_t_3);
13259 __Pyx_XDECREF(__pyx_r);
13260 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1563, __pyx_L6_except_error)
13261 __Pyx_GOTREF(__pyx_t_10);
13262 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_10),
sqrt(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1563, __pyx_L6_except_error)
13263 __Pyx_GOTREF(__pyx_t_11);
13264 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13265 __pyx_r = __pyx_t_11;
13267 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13268 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13269 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13270 goto __pyx_L7_except_return;
13272 __pyx_L6_except_error:;
13281 __Pyx_XGIVEREF(__pyx_t_6);
13282 __Pyx_XGIVEREF(__pyx_t_7);
13283 __Pyx_XGIVEREF(__pyx_t_8);
13284 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
13285 goto __pyx_L1_error;
13286 __pyx_L8_try_return:;
13287 __Pyx_XGIVEREF(__pyx_t_6);
13288 __Pyx_XGIVEREF(__pyx_t_7);
13289 __Pyx_XGIVEREF(__pyx_t_8);
13290 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
13292 __pyx_L7_except_return:;
13293 __Pyx_XGIVEREF(__pyx_t_6);
13294 __Pyx_XGIVEREF(__pyx_t_7);
13295 __Pyx_XGIVEREF(__pyx_t_8);
13296 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
13311 __Pyx_XDECREF(__pyx_t_3);
13312 __Pyx_XDECREF(__pyx_t_5);
13313 __Pyx_XDECREF(__pyx_t_9);
13314 __Pyx_XDECREF(__pyx_t_10);
13315 __Pyx_XDECREF(__pyx_t_11);
13316 __Pyx_AddTraceback(
"PyClical.sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename);
13319 __Pyx_XGIVEREF(__pyx_r);
13320 __Pyx_RefNannyFinishContext();
13325 static PyObject *__pyx_pw_8PyClical_45sqrt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13326 static char __pyx_doc_8PyClical_44sqrt[] =
"\n Square root of multivector with optional complexifier.\n\n >>> print sqrt(-1)\n {-1}\n >>> print sqrt(clifford(\"2{-1}\"))\n 1+{-1}\n >>> j=sqrt(-1,complexifier(index_set({1}))); print j; print j*j\n {1,2,3}\n -1\n >>> j=sqrt(-1,\"{1,2,3}\"); print j; print j*j\n {1,2,3}\n -1\n ";
13327 static PyObject *__pyx_pw_8PyClical_45sqrt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13328 PyObject *__pyx_v_obj = 0;
13329 PyObject *__pyx_v_i = 0;
13330 PyObject *__pyx_r = 0;
13331 __Pyx_RefNannyDeclarations
13332 __Pyx_RefNannySetupContext(
"sqrt (wrapper)", 0);
13334 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
13335 PyObject* values[2] = {0,0};
13336 values[1] = ((PyObject *)Py_None);
13337 if (unlikely(__pyx_kwds)) {
13338 Py_ssize_t kw_args;
13339 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13340 switch (pos_args) {
13341 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13342 CYTHON_FALLTHROUGH;
13343 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13344 CYTHON_FALLTHROUGH;
13346 default:
goto __pyx_L5_argtuple_error;
13348 kw_args = PyDict_Size(__pyx_kwds);
13349 switch (pos_args) {
13351 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
13352 else goto __pyx_L5_argtuple_error;
13353 CYTHON_FALLTHROUGH;
13356 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
13357 if (value) { values[1] = value; kw_args--; }
13360 if (unlikely(kw_args > 0)) {
13361 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"sqrt") < 0)) __PYX_ERR(0, 1542, __pyx_L3_error)
13364 switch (PyTuple_GET_SIZE(__pyx_args)) {
13365 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13366 CYTHON_FALLTHROUGH;
13367 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13369 default:
goto __pyx_L5_argtuple_error;
13372 __pyx_v_obj = values[0];
13373 __pyx_v_i = values[1];
13375 goto __pyx_L4_argument_unpacking_done;
13376 __pyx_L5_argtuple_error:;
13377 __Pyx_RaiseArgtupleInvalid(
"sqrt", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1542, __pyx_L3_error)
13379 __Pyx_AddTraceback(
"PyClical.sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename);
13380 __Pyx_RefNannyFinishContext();
13382 __pyx_L4_argument_unpacking_done:;
13383 __pyx_r = __pyx_pf_8PyClical_44sqrt(__pyx_self, __pyx_v_obj, __pyx_v_i);
13386 __Pyx_RefNannyFinishContext();
13390 static PyObject *__pyx_pf_8PyClical_44sqrt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
13391 PyObject *__pyx_r = NULL;
13392 __Pyx_RefNannyDeclarations
13393 PyObject *__pyx_t_1 = NULL;
13394 struct __pyx_opt_args_8PyClical_sqrt __pyx_t_2;
13395 __Pyx_RefNannySetupContext(
"sqrt", 0);
13396 __Pyx_XDECREF(__pyx_r);
13397 __pyx_t_2.__pyx_n = 1;
13398 __pyx_t_2.i = __pyx_v_i;
13399 __pyx_t_1 = __pyx_f_8PyClical_sqrt(__pyx_v_obj, 0, &__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1542, __pyx_L1_error)
13400 __Pyx_GOTREF(__pyx_t_1);
13401 __pyx_r = __pyx_t_1;
13407 __Pyx_XDECREF(__pyx_t_1);
13408 __Pyx_AddTraceback(
"PyClical.sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename);
13411 __Pyx_XGIVEREF(__pyx_r);
13412 __Pyx_RefNannyFinishContext();
13424 static PyObject *__pyx_pw_8PyClical_47exp(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13425 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_exp(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
13426 PyObject *__pyx_r = NULL;
13427 __Pyx_RefNannyDeclarations
13428 PyObject *__pyx_t_1 = NULL;
13429 PyObject *__pyx_t_2 = NULL;
13430 PyObject *__pyx_t_3 = NULL;
13431 PyObject *__pyx_t_4 = NULL;
13432 PyObject *__pyx_t_5 = NULL;
13433 PyObject *__pyx_t_6 = NULL;
13434 PyObject *__pyx_t_7 = NULL;
13435 PyObject *__pyx_t_8 = NULL;
13436 __Pyx_RefNannySetupContext(
"exp", 0);
13446 __Pyx_PyThreadState_declare
13447 __Pyx_PyThreadState_assign
13448 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
13449 __Pyx_XGOTREF(__pyx_t_1);
13450 __Pyx_XGOTREF(__pyx_t_2);
13451 __Pyx_XGOTREF(__pyx_t_3);
13461 __Pyx_XDECREF(__pyx_r);
13462 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1575, __pyx_L3_error)
13463 __Pyx_GOTREF(__pyx_t_5);
13464 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_exp);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1575, __pyx_L3_error)
13465 __Pyx_GOTREF(__pyx_t_6);
13466 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13468 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
13469 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
13470 if (likely(__pyx_t_5)) {
13471 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
13472 __Pyx_INCREF(__pyx_t_5);
13473 __Pyx_INCREF(
function);
13474 __Pyx_DECREF_SET(__pyx_t_6,
function);
13477 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_obj);
13478 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13479 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1575, __pyx_L3_error)
13480 __Pyx_GOTREF(__pyx_t_4);
13481 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13482 __pyx_r = __pyx_t_4;
13484 goto __pyx_L7_try_return;
13495 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
13496 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13497 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
13507 __Pyx_AddTraceback(
"PyClical.exp", __pyx_clineno, __pyx_lineno, __pyx_filename);
13508 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(0, 1576, __pyx_L5_except_error)
13509 __Pyx_GOTREF(__pyx_t_4);
13510 __Pyx_GOTREF(__pyx_t_6);
13511 __Pyx_GOTREF(__pyx_t_5);
13520 __Pyx_XDECREF(__pyx_r);
13521 __pyx_t_7 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1577, __pyx_L5_except_error)
13522 __Pyx_GOTREF(__pyx_t_7);
13523 __pyx_t_8 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_7),
exp(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1577, __pyx_L5_except_error)
13524 __Pyx_GOTREF(__pyx_t_8);
13525 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13526 __pyx_r = __pyx_t_8;
13528 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13529 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13530 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13531 goto __pyx_L6_except_return;
13533 __pyx_L5_except_error:;
13542 __Pyx_XGIVEREF(__pyx_t_1);
13543 __Pyx_XGIVEREF(__pyx_t_2);
13544 __Pyx_XGIVEREF(__pyx_t_3);
13545 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
13546 goto __pyx_L1_error;
13547 __pyx_L7_try_return:;
13548 __Pyx_XGIVEREF(__pyx_t_1);
13549 __Pyx_XGIVEREF(__pyx_t_2);
13550 __Pyx_XGIVEREF(__pyx_t_3);
13551 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
13553 __pyx_L6_except_return:;
13554 __Pyx_XGIVEREF(__pyx_t_1);
13555 __Pyx_XGIVEREF(__pyx_t_2);
13556 __Pyx_XGIVEREF(__pyx_t_3);
13557 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
13571 __Pyx_XDECREF(__pyx_t_4);
13572 __Pyx_XDECREF(__pyx_t_5);
13573 __Pyx_XDECREF(__pyx_t_6);
13574 __Pyx_XDECREF(__pyx_t_7);
13575 __Pyx_XDECREF(__pyx_t_8);
13576 __Pyx_AddTraceback(
"PyClical.exp", __pyx_clineno, __pyx_lineno, __pyx_filename);
13579 __Pyx_XGIVEREF(__pyx_r);
13580 __Pyx_RefNannyFinishContext();
13585 static PyObject *__pyx_pw_8PyClical_47exp(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13586 static char __pyx_doc_8PyClical_46exp[] =
"\n Exponential of multivector.\n\n >>> x=clifford(\"{1,2}\") * pi/4; print exp(x)\n 0.7071+0.7071{1,2}\n >>> x=clifford(\"{1,2}\") * pi/2; print exp(x)\n {1,2}\n ";
13587 static PyObject *__pyx_pw_8PyClical_47exp(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13588 PyObject *__pyx_r = 0;
13589 __Pyx_RefNannyDeclarations
13590 __Pyx_RefNannySetupContext(
"exp (wrapper)", 0);
13591 __pyx_r = __pyx_pf_8PyClical_46exp(__pyx_self, ((PyObject *)__pyx_v_obj));
13594 __Pyx_RefNannyFinishContext();
13598 static PyObject *__pyx_pf_8PyClical_46exp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13599 PyObject *__pyx_r = NULL;
13600 __Pyx_RefNannyDeclarations
13601 PyObject *__pyx_t_1 = NULL;
13602 __Pyx_RefNannySetupContext(
"exp", 0);
13603 __Pyx_XDECREF(__pyx_r);
13604 __pyx_t_1 = __pyx_f_8PyClical_exp(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1565, __pyx_L1_error)
13605 __Pyx_GOTREF(__pyx_t_1);
13606 __pyx_r = __pyx_t_1;
13612 __Pyx_XDECREF(__pyx_t_1);
13613 __Pyx_AddTraceback(
"PyClical.exp", __pyx_clineno, __pyx_lineno, __pyx_filename);
13616 __Pyx_XGIVEREF(__pyx_r);
13617 __Pyx_RefNannyFinishContext();
13629 static PyObject *__pyx_pw_8PyClical_49log(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13630 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_log(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_log *__pyx_optional_args) {
13631 PyObject *__pyx_v_i = ((PyObject *)Py_None);
13632 PyObject *__pyx_r = NULL;
13633 __Pyx_RefNannyDeclarations
13636 PyObject *__pyx_t_3 = NULL;
13638 PyObject *__pyx_t_5 = NULL;
13639 PyObject *__pyx_t_6 = NULL;
13640 PyObject *__pyx_t_7 = NULL;
13641 PyObject *__pyx_t_8 = NULL;
13642 PyObject *__pyx_t_9 = NULL;
13643 PyObject *__pyx_t_10 = NULL;
13644 PyObject *__pyx_t_11 = NULL;
13645 __Pyx_RefNannySetupContext(
"log", 0);
13646 if (__pyx_optional_args) {
13647 if (__pyx_optional_args->__pyx_n > 0) {
13648 __pyx_v_i = __pyx_optional_args->i;
13659 __pyx_t_1 = (__pyx_v_i != Py_None);
13660 __pyx_t_2 = (__pyx_t_1 != 0);
13670 __Pyx_XDECREF(__pyx_r);
13671 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1595, __pyx_L1_error)
13672 __Pyx_GOTREF(__pyx_t_3);
13674 __pyx_t_4 =
log(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
13676 __Pyx_CppExn2PyErr();
13677 __PYX_ERR(0, 1595, __pyx_L1_error)
13679 __pyx_t_5 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_3), __pyx_t_4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1595, __pyx_L1_error)
13680 __Pyx_GOTREF(__pyx_t_5);
13681 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13682 __pyx_r = __pyx_t_5;
13704 __Pyx_PyThreadState_declare
13705 __Pyx_PyThreadState_assign
13706 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
13707 __Pyx_XGOTREF(__pyx_t_6);
13708 __Pyx_XGOTREF(__pyx_t_7);
13709 __Pyx_XGOTREF(__pyx_t_8);
13719 __Pyx_XDECREF(__pyx_r);
13720 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1598, __pyx_L4_error)
13721 __Pyx_GOTREF(__pyx_t_3);
13722 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_log);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1598, __pyx_L4_error)
13723 __Pyx_GOTREF(__pyx_t_9);
13724 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13726 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
13727 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
13728 if (likely(__pyx_t_3)) {
13729 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
13730 __Pyx_INCREF(__pyx_t_3);
13731 __Pyx_INCREF(
function);
13732 __Pyx_DECREF_SET(__pyx_t_9,
function);
13735 __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_3, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
13736 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13737 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1598, __pyx_L4_error)
13738 __Pyx_GOTREF(__pyx_t_5);
13739 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13740 __pyx_r = __pyx_t_5;
13742 goto __pyx_L8_try_return;
13753 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13754 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13755 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
13765 __Pyx_AddTraceback(
"PyClical.log", __pyx_clineno, __pyx_lineno, __pyx_filename);
13766 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1599, __pyx_L6_except_error)
13767 __Pyx_GOTREF(__pyx_t_5);
13768 __Pyx_GOTREF(__pyx_t_9);
13769 __Pyx_GOTREF(__pyx_t_3);
13778 __Pyx_XDECREF(__pyx_r);
13779 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1600, __pyx_L6_except_error)
13780 __Pyx_GOTREF(__pyx_t_10);
13781 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_10),
log(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1600, __pyx_L6_except_error)
13782 __Pyx_GOTREF(__pyx_t_11);
13783 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13784 __pyx_r = __pyx_t_11;
13786 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13787 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13788 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13789 goto __pyx_L7_except_return;
13791 __pyx_L6_except_error:;
13800 __Pyx_XGIVEREF(__pyx_t_6);
13801 __Pyx_XGIVEREF(__pyx_t_7);
13802 __Pyx_XGIVEREF(__pyx_t_8);
13803 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
13804 goto __pyx_L1_error;
13805 __pyx_L8_try_return:;
13806 __Pyx_XGIVEREF(__pyx_t_6);
13807 __Pyx_XGIVEREF(__pyx_t_7);
13808 __Pyx_XGIVEREF(__pyx_t_8);
13809 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
13811 __pyx_L7_except_return:;
13812 __Pyx_XGIVEREF(__pyx_t_6);
13813 __Pyx_XGIVEREF(__pyx_t_7);
13814 __Pyx_XGIVEREF(__pyx_t_8);
13815 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
13830 __Pyx_XDECREF(__pyx_t_3);
13831 __Pyx_XDECREF(__pyx_t_5);
13832 __Pyx_XDECREF(__pyx_t_9);
13833 __Pyx_XDECREF(__pyx_t_10);
13834 __Pyx_XDECREF(__pyx_t_11);
13835 __Pyx_AddTraceback(
"PyClical.log", __pyx_clineno, __pyx_lineno, __pyx_filename);
13838 __Pyx_XGIVEREF(__pyx_r);
13839 __Pyx_RefNannyFinishContext();
13844 static PyObject *__pyx_pw_8PyClical_49log(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13845 static char __pyx_doc_8PyClical_48log[] =
"\n Natural logarithm of multivector with optional complexifier.\n\n >>> x=clifford(\"{-1}\"); print (log(x,\"{-1}\") * 2/pi)\n {-1}\n >>> x=clifford(\"{1,2}\"); print (log(x,\"{1,2,3}\") * 2/pi)\n {1,2}\n >>> x=clifford(\"{1,2}\"); print (log(x) * 2/pi)\n {1,2}\n >>> x=clifford(\"{1,2}\"); print (log(x,\"{1,2}\") * 2/pi)\n Traceback (most recent call last):\n ...\n RuntimeError: check_complex(val, i): i is not a valid complexifier for val\n ";
13846 static PyObject *__pyx_pw_8PyClical_49log(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13847 PyObject *__pyx_v_obj = 0;
13848 PyObject *__pyx_v_i = 0;
13849 PyObject *__pyx_r = 0;
13850 __Pyx_RefNannyDeclarations
13851 __Pyx_RefNannySetupContext(
"log (wrapper)", 0);
13853 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
13854 PyObject* values[2] = {0,0};
13855 values[1] = ((PyObject *)Py_None);
13856 if (unlikely(__pyx_kwds)) {
13857 Py_ssize_t kw_args;
13858 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13859 switch (pos_args) {
13860 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13861 CYTHON_FALLTHROUGH;
13862 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13863 CYTHON_FALLTHROUGH;
13865 default:
goto __pyx_L5_argtuple_error;
13867 kw_args = PyDict_Size(__pyx_kwds);
13868 switch (pos_args) {
13870 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
13871 else goto __pyx_L5_argtuple_error;
13872 CYTHON_FALLTHROUGH;
13875 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
13876 if (value) { values[1] = value; kw_args--; }
13879 if (unlikely(kw_args > 0)) {
13880 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"log") < 0)) __PYX_ERR(0, 1579, __pyx_L3_error)
13883 switch (PyTuple_GET_SIZE(__pyx_args)) {
13884 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13885 CYTHON_FALLTHROUGH;
13886 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13888 default:
goto __pyx_L5_argtuple_error;
13891 __pyx_v_obj = values[0];
13892 __pyx_v_i = values[1];
13894 goto __pyx_L4_argument_unpacking_done;
13895 __pyx_L5_argtuple_error:;
13896 __Pyx_RaiseArgtupleInvalid(
"log", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1579, __pyx_L3_error)
13898 __Pyx_AddTraceback(
"PyClical.log", __pyx_clineno, __pyx_lineno, __pyx_filename);
13899 __Pyx_RefNannyFinishContext();
13901 __pyx_L4_argument_unpacking_done:;
13902 __pyx_r = __pyx_pf_8PyClical_48log(__pyx_self, __pyx_v_obj, __pyx_v_i);
13905 __Pyx_RefNannyFinishContext();
13909 static PyObject *__pyx_pf_8PyClical_48log(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
13910 PyObject *__pyx_r = NULL;
13911 __Pyx_RefNannyDeclarations
13912 PyObject *__pyx_t_1 = NULL;
13913 struct __pyx_opt_args_8PyClical_log __pyx_t_2;
13914 __Pyx_RefNannySetupContext(
"log", 0);
13915 __Pyx_XDECREF(__pyx_r);
13916 __pyx_t_2.__pyx_n = 1;
13917 __pyx_t_2.i = __pyx_v_i;
13918 __pyx_t_1 = __pyx_f_8PyClical_log(__pyx_v_obj, 0, &__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1579, __pyx_L1_error)
13919 __Pyx_GOTREF(__pyx_t_1);
13920 __pyx_r = __pyx_t_1;
13926 __Pyx_XDECREF(__pyx_t_1);
13927 __Pyx_AddTraceback(
"PyClical.log", __pyx_clineno, __pyx_lineno, __pyx_filename);
13930 __Pyx_XGIVEREF(__pyx_r);
13931 __Pyx_RefNannyFinishContext();
13943 static PyObject *__pyx_pw_8PyClical_51cos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13944 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cos(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_cos *__pyx_optional_args) {
13945 PyObject *__pyx_v_i = ((PyObject *)Py_None);
13946 PyObject *__pyx_r = NULL;
13947 __Pyx_RefNannyDeclarations
13950 PyObject *__pyx_t_3 = NULL;
13952 PyObject *__pyx_t_5 = NULL;
13953 PyObject *__pyx_t_6 = NULL;
13954 PyObject *__pyx_t_7 = NULL;
13955 PyObject *__pyx_t_8 = NULL;
13956 PyObject *__pyx_t_9 = NULL;
13957 PyObject *__pyx_t_10 = NULL;
13958 PyObject *__pyx_t_11 = NULL;
13959 __Pyx_RefNannySetupContext(
"cos", 0);
13960 if (__pyx_optional_args) {
13961 if (__pyx_optional_args->__pyx_n > 0) {
13962 __pyx_v_i = __pyx_optional_args->i;
13973 __pyx_t_1 = (__pyx_v_i != Py_None);
13974 __pyx_t_2 = (__pyx_t_1 != 0);
13984 __Pyx_XDECREF(__pyx_r);
13985 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1612, __pyx_L1_error)
13986 __Pyx_GOTREF(__pyx_t_3);
13988 __pyx_t_4 =
cos(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
13990 __Pyx_CppExn2PyErr();
13991 __PYX_ERR(0, 1612, __pyx_L1_error)
13993 __pyx_t_5 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_3), __pyx_t_4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1612, __pyx_L1_error)
13994 __Pyx_GOTREF(__pyx_t_5);
13995 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13996 __pyx_r = __pyx_t_5;
14018 __Pyx_PyThreadState_declare
14019 __Pyx_PyThreadState_assign
14020 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
14021 __Pyx_XGOTREF(__pyx_t_6);
14022 __Pyx_XGOTREF(__pyx_t_7);
14023 __Pyx_XGOTREF(__pyx_t_8);
14033 __Pyx_XDECREF(__pyx_r);
14034 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1615, __pyx_L4_error)
14035 __Pyx_GOTREF(__pyx_t_3);
14036 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_cos);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1615, __pyx_L4_error)
14037 __Pyx_GOTREF(__pyx_t_9);
14038 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14040 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
14041 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
14042 if (likely(__pyx_t_3)) {
14043 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
14044 __Pyx_INCREF(__pyx_t_3);
14045 __Pyx_INCREF(
function);
14046 __Pyx_DECREF_SET(__pyx_t_9,
function);
14049 __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_3, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
14050 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14051 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1615, __pyx_L4_error)
14052 __Pyx_GOTREF(__pyx_t_5);
14053 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14054 __pyx_r = __pyx_t_5;
14056 goto __pyx_L8_try_return;
14067 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14068 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14069 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
14079 __Pyx_AddTraceback(
"PyClical.cos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14080 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1616, __pyx_L6_except_error)
14081 __Pyx_GOTREF(__pyx_t_5);
14082 __Pyx_GOTREF(__pyx_t_9);
14083 __Pyx_GOTREF(__pyx_t_3);
14092 __Pyx_XDECREF(__pyx_r);
14093 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1617, __pyx_L6_except_error)
14094 __Pyx_GOTREF(__pyx_t_10);
14095 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_10),
cos(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1617, __pyx_L6_except_error)
14096 __Pyx_GOTREF(__pyx_t_11);
14097 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14098 __pyx_r = __pyx_t_11;
14100 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14101 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14102 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14103 goto __pyx_L7_except_return;
14105 __pyx_L6_except_error:;
14114 __Pyx_XGIVEREF(__pyx_t_6);
14115 __Pyx_XGIVEREF(__pyx_t_7);
14116 __Pyx_XGIVEREF(__pyx_t_8);
14117 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14118 goto __pyx_L1_error;
14119 __pyx_L8_try_return:;
14120 __Pyx_XGIVEREF(__pyx_t_6);
14121 __Pyx_XGIVEREF(__pyx_t_7);
14122 __Pyx_XGIVEREF(__pyx_t_8);
14123 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14125 __pyx_L7_except_return:;
14126 __Pyx_XGIVEREF(__pyx_t_6);
14127 __Pyx_XGIVEREF(__pyx_t_7);
14128 __Pyx_XGIVEREF(__pyx_t_8);
14129 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14144 __Pyx_XDECREF(__pyx_t_3);
14145 __Pyx_XDECREF(__pyx_t_5);
14146 __Pyx_XDECREF(__pyx_t_9);
14147 __Pyx_XDECREF(__pyx_t_10);
14148 __Pyx_XDECREF(__pyx_t_11);
14149 __Pyx_AddTraceback(
"PyClical.cos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14152 __Pyx_XGIVEREF(__pyx_r);
14153 __Pyx_RefNannyFinishContext();
14158 static PyObject *__pyx_pw_8PyClical_51cos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14159 static char __pyx_doc_8PyClical_50cos[] =
"\n Cosine of multivector with optional complexifier.\n\n >>> x=clifford(\"{1,2}\"); print cos(acos(x),\"{1,2,3}\")\n {1,2}\n >>> x=clifford(\"{1,2}\"); print cos(acos(x))\n {1,2}\n ";
14160 static PyObject *__pyx_pw_8PyClical_51cos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14161 PyObject *__pyx_v_obj = 0;
14162 PyObject *__pyx_v_i = 0;
14163 PyObject *__pyx_r = 0;
14164 __Pyx_RefNannyDeclarations
14165 __Pyx_RefNannySetupContext(
"cos (wrapper)", 0);
14167 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
14168 PyObject* values[2] = {0,0};
14169 values[1] = ((PyObject *)Py_None);
14170 if (unlikely(__pyx_kwds)) {
14171 Py_ssize_t kw_args;
14172 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14173 switch (pos_args) {
14174 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14175 CYTHON_FALLTHROUGH;
14176 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14177 CYTHON_FALLTHROUGH;
14179 default:
goto __pyx_L5_argtuple_error;
14181 kw_args = PyDict_Size(__pyx_kwds);
14182 switch (pos_args) {
14184 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
14185 else goto __pyx_L5_argtuple_error;
14186 CYTHON_FALLTHROUGH;
14189 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
14190 if (value) { values[1] = value; kw_args--; }
14193 if (unlikely(kw_args > 0)) {
14194 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"cos") < 0)) __PYX_ERR(0, 1602, __pyx_L3_error)
14197 switch (PyTuple_GET_SIZE(__pyx_args)) {
14198 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14199 CYTHON_FALLTHROUGH;
14200 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14202 default:
goto __pyx_L5_argtuple_error;
14205 __pyx_v_obj = values[0];
14206 __pyx_v_i = values[1];
14208 goto __pyx_L4_argument_unpacking_done;
14209 __pyx_L5_argtuple_error:;
14210 __Pyx_RaiseArgtupleInvalid(
"cos", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1602, __pyx_L3_error)
14212 __Pyx_AddTraceback(
"PyClical.cos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14213 __Pyx_RefNannyFinishContext();
14215 __pyx_L4_argument_unpacking_done:;
14216 __pyx_r = __pyx_pf_8PyClical_50cos(__pyx_self, __pyx_v_obj, __pyx_v_i);
14219 __Pyx_RefNannyFinishContext();
14223 static PyObject *__pyx_pf_8PyClical_50cos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
14224 PyObject *__pyx_r = NULL;
14225 __Pyx_RefNannyDeclarations
14226 PyObject *__pyx_t_1 = NULL;
14227 struct __pyx_opt_args_8PyClical_cos __pyx_t_2;
14228 __Pyx_RefNannySetupContext(
"cos", 0);
14229 __Pyx_XDECREF(__pyx_r);
14230 __pyx_t_2.__pyx_n = 1;
14231 __pyx_t_2.i = __pyx_v_i;
14232 __pyx_t_1 = __pyx_f_8PyClical_cos(__pyx_v_obj, 0, &__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1602, __pyx_L1_error)
14233 __Pyx_GOTREF(__pyx_t_1);
14234 __pyx_r = __pyx_t_1;
14240 __Pyx_XDECREF(__pyx_t_1);
14241 __Pyx_AddTraceback(
"PyClical.cos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14244 __Pyx_XGIVEREF(__pyx_r);
14245 __Pyx_RefNannyFinishContext();
14257 static PyObject *__pyx_pw_8PyClical_53acos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14258 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_acos(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_acos *__pyx_optional_args) {
14259 PyObject *__pyx_v_i = ((PyObject *)Py_None);
14260 PyObject *__pyx_r = NULL;
14261 __Pyx_RefNannyDeclarations
14264 PyObject *__pyx_t_3 = NULL;
14266 PyObject *__pyx_t_5 = NULL;
14267 PyObject *__pyx_t_6 = NULL;
14268 PyObject *__pyx_t_7 = NULL;
14269 PyObject *__pyx_t_8 = NULL;
14270 PyObject *__pyx_t_9 = NULL;
14271 PyObject *__pyx_t_10 = NULL;
14272 PyObject *__pyx_t_11 = NULL;
14273 __Pyx_RefNannySetupContext(
"acos", 0);
14274 if (__pyx_optional_args) {
14275 if (__pyx_optional_args->__pyx_n > 0) {
14276 __pyx_v_i = __pyx_optional_args->i;
14287 __pyx_t_1 = (__pyx_v_i != Py_None);
14288 __pyx_t_2 = (__pyx_t_1 != 0);
14298 __Pyx_XDECREF(__pyx_r);
14299 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1633, __pyx_L1_error)
14300 __Pyx_GOTREF(__pyx_t_3);
14302 __pyx_t_4 =
acos(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
14304 __Pyx_CppExn2PyErr();
14305 __PYX_ERR(0, 1633, __pyx_L1_error)
14307 __pyx_t_5 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_3), __pyx_t_4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1633, __pyx_L1_error)
14308 __Pyx_GOTREF(__pyx_t_5);
14309 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14310 __pyx_r = __pyx_t_5;
14332 __Pyx_PyThreadState_declare
14333 __Pyx_PyThreadState_assign
14334 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
14335 __Pyx_XGOTREF(__pyx_t_6);
14336 __Pyx_XGOTREF(__pyx_t_7);
14337 __Pyx_XGOTREF(__pyx_t_8);
14347 __Pyx_XDECREF(__pyx_r);
14348 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1636, __pyx_L4_error)
14349 __Pyx_GOTREF(__pyx_t_3);
14350 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_acos);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1636, __pyx_L4_error)
14351 __Pyx_GOTREF(__pyx_t_9);
14352 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14354 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
14355 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
14356 if (likely(__pyx_t_3)) {
14357 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
14358 __Pyx_INCREF(__pyx_t_3);
14359 __Pyx_INCREF(
function);
14360 __Pyx_DECREF_SET(__pyx_t_9,
function);
14363 __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_3, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
14364 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14365 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1636, __pyx_L4_error)
14366 __Pyx_GOTREF(__pyx_t_5);
14367 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14368 __pyx_r = __pyx_t_5;
14370 goto __pyx_L8_try_return;
14381 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14382 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14383 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
14393 __Pyx_AddTraceback(
"PyClical.acos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14394 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1637, __pyx_L6_except_error)
14395 __Pyx_GOTREF(__pyx_t_5);
14396 __Pyx_GOTREF(__pyx_t_9);
14397 __Pyx_GOTREF(__pyx_t_3);
14406 __Pyx_XDECREF(__pyx_r);
14407 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1638, __pyx_L6_except_error)
14408 __Pyx_GOTREF(__pyx_t_10);
14409 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_10),
acos(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1638, __pyx_L6_except_error)
14410 __Pyx_GOTREF(__pyx_t_11);
14411 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14412 __pyx_r = __pyx_t_11;
14414 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14415 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14416 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14417 goto __pyx_L7_except_return;
14419 __pyx_L6_except_error:;
14428 __Pyx_XGIVEREF(__pyx_t_6);
14429 __Pyx_XGIVEREF(__pyx_t_7);
14430 __Pyx_XGIVEREF(__pyx_t_8);
14431 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14432 goto __pyx_L1_error;
14433 __pyx_L8_try_return:;
14434 __Pyx_XGIVEREF(__pyx_t_6);
14435 __Pyx_XGIVEREF(__pyx_t_7);
14436 __Pyx_XGIVEREF(__pyx_t_8);
14437 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14439 __pyx_L7_except_return:;
14440 __Pyx_XGIVEREF(__pyx_t_6);
14441 __Pyx_XGIVEREF(__pyx_t_7);
14442 __Pyx_XGIVEREF(__pyx_t_8);
14443 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14458 __Pyx_XDECREF(__pyx_t_3);
14459 __Pyx_XDECREF(__pyx_t_5);
14460 __Pyx_XDECREF(__pyx_t_9);
14461 __Pyx_XDECREF(__pyx_t_10);
14462 __Pyx_XDECREF(__pyx_t_11);
14463 __Pyx_AddTraceback(
"PyClical.acos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14466 __Pyx_XGIVEREF(__pyx_r);
14467 __Pyx_RefNannyFinishContext();
14472 static PyObject *__pyx_pw_8PyClical_53acos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14473 static char __pyx_doc_8PyClical_52acos[] =
"\n Inverse cosine of multivector with optional complexifier.\n\n >>> x=clifford(\"{1,2}\"); print cos(acos(x),\"{1,2,3}\")\n {1,2}\n >>> x=clifford(\"{1,2}\"); print cos(acos(x),\"{-1,1,2,3,4}\")\n {1,2}\n >>> print acos(0) / pi\n 0.5\n >>> x=clifford(\"{1,2}\"); print cos(acos(x))\n {1,2}\n ";
14474 static PyObject *__pyx_pw_8PyClical_53acos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14475 PyObject *__pyx_v_obj = 0;
14476 PyObject *__pyx_v_i = 0;
14477 PyObject *__pyx_r = 0;
14478 __Pyx_RefNannyDeclarations
14479 __Pyx_RefNannySetupContext(
"acos (wrapper)", 0);
14481 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
14482 PyObject* values[2] = {0,0};
14483 values[1] = ((PyObject *)Py_None);
14484 if (unlikely(__pyx_kwds)) {
14485 Py_ssize_t kw_args;
14486 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14487 switch (pos_args) {
14488 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14489 CYTHON_FALLTHROUGH;
14490 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14491 CYTHON_FALLTHROUGH;
14493 default:
goto __pyx_L5_argtuple_error;
14495 kw_args = PyDict_Size(__pyx_kwds);
14496 switch (pos_args) {
14498 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
14499 else goto __pyx_L5_argtuple_error;
14500 CYTHON_FALLTHROUGH;
14503 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
14504 if (value) { values[1] = value; kw_args--; }
14507 if (unlikely(kw_args > 0)) {
14508 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"acos") < 0)) __PYX_ERR(0, 1619, __pyx_L3_error)
14511 switch (PyTuple_GET_SIZE(__pyx_args)) {
14512 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14513 CYTHON_FALLTHROUGH;
14514 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14516 default:
goto __pyx_L5_argtuple_error;
14519 __pyx_v_obj = values[0];
14520 __pyx_v_i = values[1];
14522 goto __pyx_L4_argument_unpacking_done;
14523 __pyx_L5_argtuple_error:;
14524 __Pyx_RaiseArgtupleInvalid(
"acos", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1619, __pyx_L3_error)
14526 __Pyx_AddTraceback(
"PyClical.acos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14527 __Pyx_RefNannyFinishContext();
14529 __pyx_L4_argument_unpacking_done:;
14530 __pyx_r = __pyx_pf_8PyClical_52acos(__pyx_self, __pyx_v_obj, __pyx_v_i);
14533 __Pyx_RefNannyFinishContext();
14537 static PyObject *__pyx_pf_8PyClical_52acos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
14538 PyObject *__pyx_r = NULL;
14539 __Pyx_RefNannyDeclarations
14540 PyObject *__pyx_t_1 = NULL;
14541 struct __pyx_opt_args_8PyClical_acos __pyx_t_2;
14542 __Pyx_RefNannySetupContext(
"acos", 0);
14543 __Pyx_XDECREF(__pyx_r);
14544 __pyx_t_2.__pyx_n = 1;
14545 __pyx_t_2.i = __pyx_v_i;
14546 __pyx_t_1 = __pyx_f_8PyClical_acos(__pyx_v_obj, 0, &__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1619, __pyx_L1_error)
14547 __Pyx_GOTREF(__pyx_t_1);
14548 __pyx_r = __pyx_t_1;
14554 __Pyx_XDECREF(__pyx_t_1);
14555 __Pyx_AddTraceback(
"PyClical.acos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14558 __Pyx_XGIVEREF(__pyx_r);
14559 __Pyx_RefNannyFinishContext();
14571 static PyObject *__pyx_pw_8PyClical_55cosh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
14572 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cosh(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
14573 PyObject *__pyx_r = NULL;
14574 __Pyx_RefNannyDeclarations
14575 PyObject *__pyx_t_1 = NULL;
14576 PyObject *__pyx_t_2 = NULL;
14577 PyObject *__pyx_t_3 = NULL;
14578 PyObject *__pyx_t_4 = NULL;
14579 PyObject *__pyx_t_5 = NULL;
14580 PyObject *__pyx_t_6 = NULL;
14581 PyObject *__pyx_t_7 = NULL;
14582 PyObject *__pyx_t_8 = NULL;
14583 __Pyx_RefNannySetupContext(
"cosh", 0);
14593 __Pyx_PyThreadState_declare
14594 __Pyx_PyThreadState_assign
14595 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
14596 __Pyx_XGOTREF(__pyx_t_1);
14597 __Pyx_XGOTREF(__pyx_t_2);
14598 __Pyx_XGOTREF(__pyx_t_3);
14608 __Pyx_XDECREF(__pyx_r);
14609 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1652, __pyx_L3_error)
14610 __Pyx_GOTREF(__pyx_t_5);
14611 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_cosh);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1652, __pyx_L3_error)
14612 __Pyx_GOTREF(__pyx_t_6);
14613 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14615 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
14616 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
14617 if (likely(__pyx_t_5)) {
14618 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
14619 __Pyx_INCREF(__pyx_t_5);
14620 __Pyx_INCREF(
function);
14621 __Pyx_DECREF_SET(__pyx_t_6,
function);
14624 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_obj);
14625 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14626 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1652, __pyx_L3_error)
14627 __Pyx_GOTREF(__pyx_t_4);
14628 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14629 __pyx_r = __pyx_t_4;
14631 goto __pyx_L7_try_return;
14642 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
14643 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14644 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
14654 __Pyx_AddTraceback(
"PyClical.cosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
14655 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(0, 1653, __pyx_L5_except_error)
14656 __Pyx_GOTREF(__pyx_t_4);
14657 __Pyx_GOTREF(__pyx_t_6);
14658 __Pyx_GOTREF(__pyx_t_5);
14667 __Pyx_XDECREF(__pyx_r);
14668 __pyx_t_7 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1654, __pyx_L5_except_error)
14669 __Pyx_GOTREF(__pyx_t_7);
14670 __pyx_t_8 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_7),
cosh(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1654, __pyx_L5_except_error)
14671 __Pyx_GOTREF(__pyx_t_8);
14672 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14673 __pyx_r = __pyx_t_8;
14675 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14676 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14677 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14678 goto __pyx_L6_except_return;
14680 __pyx_L5_except_error:;
14689 __Pyx_XGIVEREF(__pyx_t_1);
14690 __Pyx_XGIVEREF(__pyx_t_2);
14691 __Pyx_XGIVEREF(__pyx_t_3);
14692 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
14693 goto __pyx_L1_error;
14694 __pyx_L7_try_return:;
14695 __Pyx_XGIVEREF(__pyx_t_1);
14696 __Pyx_XGIVEREF(__pyx_t_2);
14697 __Pyx_XGIVEREF(__pyx_t_3);
14698 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
14700 __pyx_L6_except_return:;
14701 __Pyx_XGIVEREF(__pyx_t_1);
14702 __Pyx_XGIVEREF(__pyx_t_2);
14703 __Pyx_XGIVEREF(__pyx_t_3);
14704 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
14718 __Pyx_XDECREF(__pyx_t_4);
14719 __Pyx_XDECREF(__pyx_t_5);
14720 __Pyx_XDECREF(__pyx_t_6);
14721 __Pyx_XDECREF(__pyx_t_7);
14722 __Pyx_XDECREF(__pyx_t_8);
14723 __Pyx_AddTraceback(
"PyClical.cosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
14726 __Pyx_XGIVEREF(__pyx_r);
14727 __Pyx_RefNannyFinishContext();
14732 static PyObject *__pyx_pw_8PyClical_55cosh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
14733 static char __pyx_doc_8PyClical_54cosh[] =
"\n Hyperbolic cosine of multivector.\n\n >>> x=clifford(\"{1,2}\") * pi; print cosh(x)\n -1\n >>> x=clifford(\"{1,2,3}\"); print cosh(acosh(x))\n {1,2,3}\n >>> x=clifford(\"{1,2}\"); print cosh(acosh(x))\n {1,2}\n ";
14734 static PyObject *__pyx_pw_8PyClical_55cosh(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
14735 PyObject *__pyx_r = 0;
14736 __Pyx_RefNannyDeclarations
14737 __Pyx_RefNannySetupContext(
"cosh (wrapper)", 0);
14738 __pyx_r = __pyx_pf_8PyClical_54cosh(__pyx_self, ((PyObject *)__pyx_v_obj));
14741 __Pyx_RefNannyFinishContext();
14745 static PyObject *__pyx_pf_8PyClical_54cosh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
14746 PyObject *__pyx_r = NULL;
14747 __Pyx_RefNannyDeclarations
14748 PyObject *__pyx_t_1 = NULL;
14749 __Pyx_RefNannySetupContext(
"cosh", 0);
14750 __Pyx_XDECREF(__pyx_r);
14751 __pyx_t_1 = __pyx_f_8PyClical_cosh(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1640, __pyx_L1_error)
14752 __Pyx_GOTREF(__pyx_t_1);
14753 __pyx_r = __pyx_t_1;
14759 __Pyx_XDECREF(__pyx_t_1);
14760 __Pyx_AddTraceback(
"PyClical.cosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
14763 __Pyx_XGIVEREF(__pyx_r);
14764 __Pyx_RefNannyFinishContext();
14776 static PyObject *__pyx_pw_8PyClical_57acosh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14777 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_acosh(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_acosh *__pyx_optional_args) {
14778 PyObject *__pyx_v_i = ((PyObject *)Py_None);
14779 PyObject *__pyx_r = NULL;
14780 __Pyx_RefNannyDeclarations
14783 PyObject *__pyx_t_3 = NULL;
14785 PyObject *__pyx_t_5 = NULL;
14786 PyObject *__pyx_t_6 = NULL;
14787 PyObject *__pyx_t_7 = NULL;
14788 PyObject *__pyx_t_8 = NULL;
14789 PyObject *__pyx_t_9 = NULL;
14790 PyObject *__pyx_t_10 = NULL;
14791 PyObject *__pyx_t_11 = NULL;
14792 __Pyx_RefNannySetupContext(
"acosh", 0);
14793 if (__pyx_optional_args) {
14794 if (__pyx_optional_args->__pyx_n > 0) {
14795 __pyx_v_i = __pyx_optional_args->i;
14806 __pyx_t_1 = (__pyx_v_i != Py_None);
14807 __pyx_t_2 = (__pyx_t_1 != 0);
14817 __Pyx_XDECREF(__pyx_r);
14818 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1672, __pyx_L1_error)
14819 __Pyx_GOTREF(__pyx_t_3);
14821 __pyx_t_4 =
acosh(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
14823 __Pyx_CppExn2PyErr();
14824 __PYX_ERR(0, 1672, __pyx_L1_error)
14826 __pyx_t_5 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_3), __pyx_t_4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1672, __pyx_L1_error)
14827 __Pyx_GOTREF(__pyx_t_5);
14828 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14829 __pyx_r = __pyx_t_5;
14851 __Pyx_PyThreadState_declare
14852 __Pyx_PyThreadState_assign
14853 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
14854 __Pyx_XGOTREF(__pyx_t_6);
14855 __Pyx_XGOTREF(__pyx_t_7);
14856 __Pyx_XGOTREF(__pyx_t_8);
14866 __Pyx_XDECREF(__pyx_r);
14867 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1675, __pyx_L4_error)
14868 __Pyx_GOTREF(__pyx_t_3);
14869 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_acosh);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1675, __pyx_L4_error)
14870 __Pyx_GOTREF(__pyx_t_9);
14871 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14873 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
14874 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
14875 if (likely(__pyx_t_3)) {
14876 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
14877 __Pyx_INCREF(__pyx_t_3);
14878 __Pyx_INCREF(
function);
14879 __Pyx_DECREF_SET(__pyx_t_9,
function);
14882 __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_3, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
14883 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14884 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1675, __pyx_L4_error)
14885 __Pyx_GOTREF(__pyx_t_5);
14886 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14887 __pyx_r = __pyx_t_5;
14889 goto __pyx_L8_try_return;
14900 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14901 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14902 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
14912 __Pyx_AddTraceback(
"PyClical.acosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
14913 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1676, __pyx_L6_except_error)
14914 __Pyx_GOTREF(__pyx_t_5);
14915 __Pyx_GOTREF(__pyx_t_9);
14916 __Pyx_GOTREF(__pyx_t_3);
14925 __Pyx_XDECREF(__pyx_r);
14926 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1677, __pyx_L6_except_error)
14927 __Pyx_GOTREF(__pyx_t_10);
14928 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_10),
acosh(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1677, __pyx_L6_except_error)
14929 __Pyx_GOTREF(__pyx_t_11);
14930 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14931 __pyx_r = __pyx_t_11;
14933 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14934 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14935 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14936 goto __pyx_L7_except_return;
14938 __pyx_L6_except_error:;
14947 __Pyx_XGIVEREF(__pyx_t_6);
14948 __Pyx_XGIVEREF(__pyx_t_7);
14949 __Pyx_XGIVEREF(__pyx_t_8);
14950 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14951 goto __pyx_L1_error;
14952 __pyx_L8_try_return:;
14953 __Pyx_XGIVEREF(__pyx_t_6);
14954 __Pyx_XGIVEREF(__pyx_t_7);
14955 __Pyx_XGIVEREF(__pyx_t_8);
14956 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14958 __pyx_L7_except_return:;
14959 __Pyx_XGIVEREF(__pyx_t_6);
14960 __Pyx_XGIVEREF(__pyx_t_7);
14961 __Pyx_XGIVEREF(__pyx_t_8);
14962 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14977 __Pyx_XDECREF(__pyx_t_3);
14978 __Pyx_XDECREF(__pyx_t_5);
14979 __Pyx_XDECREF(__pyx_t_9);
14980 __Pyx_XDECREF(__pyx_t_10);
14981 __Pyx_XDECREF(__pyx_t_11);
14982 __Pyx_AddTraceback(
"PyClical.acosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
14985 __Pyx_XGIVEREF(__pyx_r);
14986 __Pyx_RefNannyFinishContext();
14991 static PyObject *__pyx_pw_8PyClical_57acosh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14992 static char __pyx_doc_8PyClical_56acosh[] =
"\n Inverse hyperbolic cosine of multivector with optional complexifier.\n\n >>> print acosh(0,\"{-2,-1,1}\")\n 1.571{-2,-1,1}\n >>> x=clifford(\"{1,2,3}\"); print cosh(acosh(x,\"{-1,1,2,3,4}\"))\n {1,2,3}\n >>> print acosh(0)\n 1.571{-1}\n >>> x=clifford(\"{1,2,3}\"); print cosh(acosh(x))\n {1,2,3}\n >>> x=clifford(\"{1,2}\"); print cosh(acosh(x))\n {1,2}\n ";
14993 static PyObject *__pyx_pw_8PyClical_57acosh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14994 PyObject *__pyx_v_obj = 0;
14995 PyObject *__pyx_v_i = 0;
14996 PyObject *__pyx_r = 0;
14997 __Pyx_RefNannyDeclarations
14998 __Pyx_RefNannySetupContext(
"acosh (wrapper)", 0);
15000 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
15001 PyObject* values[2] = {0,0};
15002 values[1] = ((PyObject *)Py_None);
15003 if (unlikely(__pyx_kwds)) {
15004 Py_ssize_t kw_args;
15005 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15006 switch (pos_args) {
15007 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15008 CYTHON_FALLTHROUGH;
15009 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15010 CYTHON_FALLTHROUGH;
15012 default:
goto __pyx_L5_argtuple_error;
15014 kw_args = PyDict_Size(__pyx_kwds);
15015 switch (pos_args) {
15017 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
15018 else goto __pyx_L5_argtuple_error;
15019 CYTHON_FALLTHROUGH;
15022 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
15023 if (value) { values[1] = value; kw_args--; }
15026 if (unlikely(kw_args > 0)) {
15027 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"acosh") < 0)) __PYX_ERR(0, 1656, __pyx_L3_error)
15030 switch (PyTuple_GET_SIZE(__pyx_args)) {
15031 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15032 CYTHON_FALLTHROUGH;
15033 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15035 default:
goto __pyx_L5_argtuple_error;
15038 __pyx_v_obj = values[0];
15039 __pyx_v_i = values[1];
15041 goto __pyx_L4_argument_unpacking_done;
15042 __pyx_L5_argtuple_error:;
15043 __Pyx_RaiseArgtupleInvalid(
"acosh", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1656, __pyx_L3_error)
15045 __Pyx_AddTraceback(
"PyClical.acosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15046 __Pyx_RefNannyFinishContext();
15048 __pyx_L4_argument_unpacking_done:;
15049 __pyx_r = __pyx_pf_8PyClical_56acosh(__pyx_self, __pyx_v_obj, __pyx_v_i);
15052 __Pyx_RefNannyFinishContext();
15056 static PyObject *__pyx_pf_8PyClical_56acosh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
15057 PyObject *__pyx_r = NULL;
15058 __Pyx_RefNannyDeclarations
15059 PyObject *__pyx_t_1 = NULL;
15060 struct __pyx_opt_args_8PyClical_acosh __pyx_t_2;
15061 __Pyx_RefNannySetupContext(
"acosh", 0);
15062 __Pyx_XDECREF(__pyx_r);
15063 __pyx_t_2.__pyx_n = 1;
15064 __pyx_t_2.i = __pyx_v_i;
15065 __pyx_t_1 = __pyx_f_8PyClical_acosh(__pyx_v_obj, 0, &__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1656, __pyx_L1_error)
15066 __Pyx_GOTREF(__pyx_t_1);
15067 __pyx_r = __pyx_t_1;
15073 __Pyx_XDECREF(__pyx_t_1);
15074 __Pyx_AddTraceback(
"PyClical.acosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15077 __Pyx_XGIVEREF(__pyx_r);
15078 __Pyx_RefNannyFinishContext();
15090 static PyObject *__pyx_pw_8PyClical_59sin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15091 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_sin(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_sin *__pyx_optional_args) {
15092 PyObject *__pyx_v_i = ((PyObject *)Py_None);
15093 PyObject *__pyx_r = NULL;
15094 __Pyx_RefNannyDeclarations
15097 PyObject *__pyx_t_3 = NULL;
15099 PyObject *__pyx_t_5 = NULL;
15100 PyObject *__pyx_t_6 = NULL;
15101 PyObject *__pyx_t_7 = NULL;
15102 PyObject *__pyx_t_8 = NULL;
15103 PyObject *__pyx_t_9 = NULL;
15104 PyObject *__pyx_t_10 = NULL;
15105 PyObject *__pyx_t_11 = NULL;
15106 __Pyx_RefNannySetupContext(
"sin", 0);
15107 if (__pyx_optional_args) {
15108 if (__pyx_optional_args->__pyx_n > 0) {
15109 __pyx_v_i = __pyx_optional_args->i;
15120 __pyx_t_1 = (__pyx_v_i != Py_None);
15121 __pyx_t_2 = (__pyx_t_1 != 0);
15131 __Pyx_XDECREF(__pyx_r);
15132 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1691, __pyx_L1_error)
15133 __Pyx_GOTREF(__pyx_t_3);
15135 __pyx_t_4 =
sin(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
15137 __Pyx_CppExn2PyErr();
15138 __PYX_ERR(0, 1691, __pyx_L1_error)
15140 __pyx_t_5 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_3), __pyx_t_4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1691, __pyx_L1_error)
15141 __Pyx_GOTREF(__pyx_t_5);
15142 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15143 __pyx_r = __pyx_t_5;
15165 __Pyx_PyThreadState_declare
15166 __Pyx_PyThreadState_assign
15167 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
15168 __Pyx_XGOTREF(__pyx_t_6);
15169 __Pyx_XGOTREF(__pyx_t_7);
15170 __Pyx_XGOTREF(__pyx_t_8);
15180 __Pyx_XDECREF(__pyx_r);
15181 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1694, __pyx_L4_error)
15182 __Pyx_GOTREF(__pyx_t_3);
15183 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sin);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1694, __pyx_L4_error)
15184 __Pyx_GOTREF(__pyx_t_9);
15185 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15187 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
15188 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
15189 if (likely(__pyx_t_3)) {
15190 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
15191 __Pyx_INCREF(__pyx_t_3);
15192 __Pyx_INCREF(
function);
15193 __Pyx_DECREF_SET(__pyx_t_9,
function);
15196 __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_3, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
15197 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15198 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1694, __pyx_L4_error)
15199 __Pyx_GOTREF(__pyx_t_5);
15200 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15201 __pyx_r = __pyx_t_5;
15203 goto __pyx_L8_try_return;
15214 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15215 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15216 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
15226 __Pyx_AddTraceback(
"PyClical.sin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15227 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1695, __pyx_L6_except_error)
15228 __Pyx_GOTREF(__pyx_t_5);
15229 __Pyx_GOTREF(__pyx_t_9);
15230 __Pyx_GOTREF(__pyx_t_3);
15239 __Pyx_XDECREF(__pyx_r);
15240 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1696, __pyx_L6_except_error)
15241 __Pyx_GOTREF(__pyx_t_10);
15242 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_10),
sin(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1696, __pyx_L6_except_error)
15243 __Pyx_GOTREF(__pyx_t_11);
15244 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15245 __pyx_r = __pyx_t_11;
15247 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15248 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15249 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15250 goto __pyx_L7_except_return;
15252 __pyx_L6_except_error:;
15261 __Pyx_XGIVEREF(__pyx_t_6);
15262 __Pyx_XGIVEREF(__pyx_t_7);
15263 __Pyx_XGIVEREF(__pyx_t_8);
15264 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15265 goto __pyx_L1_error;
15266 __pyx_L8_try_return:;
15267 __Pyx_XGIVEREF(__pyx_t_6);
15268 __Pyx_XGIVEREF(__pyx_t_7);
15269 __Pyx_XGIVEREF(__pyx_t_8);
15270 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15272 __pyx_L7_except_return:;
15273 __Pyx_XGIVEREF(__pyx_t_6);
15274 __Pyx_XGIVEREF(__pyx_t_7);
15275 __Pyx_XGIVEREF(__pyx_t_8);
15276 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15291 __Pyx_XDECREF(__pyx_t_3);
15292 __Pyx_XDECREF(__pyx_t_5);
15293 __Pyx_XDECREF(__pyx_t_9);
15294 __Pyx_XDECREF(__pyx_t_10);
15295 __Pyx_XDECREF(__pyx_t_11);
15296 __Pyx_AddTraceback(
"PyClical.sin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15299 __Pyx_XGIVEREF(__pyx_r);
15300 __Pyx_RefNannyFinishContext();
15305 static PyObject *__pyx_pw_8PyClical_59sin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15306 static char __pyx_doc_8PyClical_58sin[] =
"\n Sine of multivector with optional complexifier.\n\n >>> s=\"{-1}\"; x=clifford(s); print asin(sin(x,s),s)\n {-1}\n >>> s=\"{-1}\"; x=clifford(s); print asin(sin(x,s),\"{-2,-1,1}\")\n {-1}\n >>> x=clifford(\"{1,2,3}\"); print asin(sin(x))\n {1,2,3}\n ";
15307 static PyObject *__pyx_pw_8PyClical_59sin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15308 PyObject *__pyx_v_obj = 0;
15309 PyObject *__pyx_v_i = 0;
15310 PyObject *__pyx_r = 0;
15311 __Pyx_RefNannyDeclarations
15312 __Pyx_RefNannySetupContext(
"sin (wrapper)", 0);
15314 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
15315 PyObject* values[2] = {0,0};
15316 values[1] = ((PyObject *)Py_None);
15317 if (unlikely(__pyx_kwds)) {
15318 Py_ssize_t kw_args;
15319 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15320 switch (pos_args) {
15321 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15322 CYTHON_FALLTHROUGH;
15323 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15324 CYTHON_FALLTHROUGH;
15326 default:
goto __pyx_L5_argtuple_error;
15328 kw_args = PyDict_Size(__pyx_kwds);
15329 switch (pos_args) {
15331 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
15332 else goto __pyx_L5_argtuple_error;
15333 CYTHON_FALLTHROUGH;
15336 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
15337 if (value) { values[1] = value; kw_args--; }
15340 if (unlikely(kw_args > 0)) {
15341 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"sin") < 0)) __PYX_ERR(0, 1679, __pyx_L3_error)
15344 switch (PyTuple_GET_SIZE(__pyx_args)) {
15345 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15346 CYTHON_FALLTHROUGH;
15347 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15349 default:
goto __pyx_L5_argtuple_error;
15352 __pyx_v_obj = values[0];
15353 __pyx_v_i = values[1];
15355 goto __pyx_L4_argument_unpacking_done;
15356 __pyx_L5_argtuple_error:;
15357 __Pyx_RaiseArgtupleInvalid(
"sin", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1679, __pyx_L3_error)
15359 __Pyx_AddTraceback(
"PyClical.sin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15360 __Pyx_RefNannyFinishContext();
15362 __pyx_L4_argument_unpacking_done:;
15363 __pyx_r = __pyx_pf_8PyClical_58sin(__pyx_self, __pyx_v_obj, __pyx_v_i);
15366 __Pyx_RefNannyFinishContext();
15370 static PyObject *__pyx_pf_8PyClical_58sin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
15371 PyObject *__pyx_r = NULL;
15372 __Pyx_RefNannyDeclarations
15373 PyObject *__pyx_t_1 = NULL;
15374 struct __pyx_opt_args_8PyClical_sin __pyx_t_2;
15375 __Pyx_RefNannySetupContext(
"sin", 0);
15376 __Pyx_XDECREF(__pyx_r);
15377 __pyx_t_2.__pyx_n = 1;
15378 __pyx_t_2.i = __pyx_v_i;
15379 __pyx_t_1 = __pyx_f_8PyClical_sin(__pyx_v_obj, 0, &__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1679, __pyx_L1_error)
15380 __Pyx_GOTREF(__pyx_t_1);
15381 __pyx_r = __pyx_t_1;
15387 __Pyx_XDECREF(__pyx_t_1);
15388 __Pyx_AddTraceback(
"PyClical.sin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15391 __Pyx_XGIVEREF(__pyx_r);
15392 __Pyx_RefNannyFinishContext();
15404 static PyObject *__pyx_pw_8PyClical_61asin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15405 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_asin(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_asin *__pyx_optional_args) {
15406 PyObject *__pyx_v_i = ((PyObject *)Py_None);
15407 PyObject *__pyx_r = NULL;
15408 __Pyx_RefNannyDeclarations
15411 PyObject *__pyx_t_3 = NULL;
15413 PyObject *__pyx_t_5 = NULL;
15414 PyObject *__pyx_t_6 = NULL;
15415 PyObject *__pyx_t_7 = NULL;
15416 PyObject *__pyx_t_8 = NULL;
15417 PyObject *__pyx_t_9 = NULL;
15418 PyObject *__pyx_t_10 = NULL;
15419 PyObject *__pyx_t_11 = NULL;
15420 __Pyx_RefNannySetupContext(
"asin", 0);
15421 if (__pyx_optional_args) {
15422 if (__pyx_optional_args->__pyx_n > 0) {
15423 __pyx_v_i = __pyx_optional_args->i;
15434 __pyx_t_1 = (__pyx_v_i != Py_None);
15435 __pyx_t_2 = (__pyx_t_1 != 0);
15445 __Pyx_XDECREF(__pyx_r);
15446 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1712, __pyx_L1_error)
15447 __Pyx_GOTREF(__pyx_t_3);
15449 __pyx_t_4 =
asin(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
15451 __Pyx_CppExn2PyErr();
15452 __PYX_ERR(0, 1712, __pyx_L1_error)
15454 __pyx_t_5 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_3), __pyx_t_4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1712, __pyx_L1_error)
15455 __Pyx_GOTREF(__pyx_t_5);
15456 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15457 __pyx_r = __pyx_t_5;
15479 __Pyx_PyThreadState_declare
15480 __Pyx_PyThreadState_assign
15481 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
15482 __Pyx_XGOTREF(__pyx_t_6);
15483 __Pyx_XGOTREF(__pyx_t_7);
15484 __Pyx_XGOTREF(__pyx_t_8);
15494 __Pyx_XDECREF(__pyx_r);
15495 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1715, __pyx_L4_error)
15496 __Pyx_GOTREF(__pyx_t_3);
15497 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asin);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1715, __pyx_L4_error)
15498 __Pyx_GOTREF(__pyx_t_9);
15499 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15501 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
15502 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
15503 if (likely(__pyx_t_3)) {
15504 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
15505 __Pyx_INCREF(__pyx_t_3);
15506 __Pyx_INCREF(
function);
15507 __Pyx_DECREF_SET(__pyx_t_9,
function);
15510 __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_3, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
15511 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15512 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1715, __pyx_L4_error)
15513 __Pyx_GOTREF(__pyx_t_5);
15514 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15515 __pyx_r = __pyx_t_5;
15517 goto __pyx_L8_try_return;
15528 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15529 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15530 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
15540 __Pyx_AddTraceback(
"PyClical.asin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15541 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1716, __pyx_L6_except_error)
15542 __Pyx_GOTREF(__pyx_t_5);
15543 __Pyx_GOTREF(__pyx_t_9);
15544 __Pyx_GOTREF(__pyx_t_3);
15553 __Pyx_XDECREF(__pyx_r);
15554 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1717, __pyx_L6_except_error)
15555 __Pyx_GOTREF(__pyx_t_10);
15556 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_10),
asin(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1717, __pyx_L6_except_error)
15557 __Pyx_GOTREF(__pyx_t_11);
15558 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15559 __pyx_r = __pyx_t_11;
15561 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15562 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15563 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15564 goto __pyx_L7_except_return;
15566 __pyx_L6_except_error:;
15575 __Pyx_XGIVEREF(__pyx_t_6);
15576 __Pyx_XGIVEREF(__pyx_t_7);
15577 __Pyx_XGIVEREF(__pyx_t_8);
15578 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15579 goto __pyx_L1_error;
15580 __pyx_L8_try_return:;
15581 __Pyx_XGIVEREF(__pyx_t_6);
15582 __Pyx_XGIVEREF(__pyx_t_7);
15583 __Pyx_XGIVEREF(__pyx_t_8);
15584 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15586 __pyx_L7_except_return:;
15587 __Pyx_XGIVEREF(__pyx_t_6);
15588 __Pyx_XGIVEREF(__pyx_t_7);
15589 __Pyx_XGIVEREF(__pyx_t_8);
15590 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15605 __Pyx_XDECREF(__pyx_t_3);
15606 __Pyx_XDECREF(__pyx_t_5);
15607 __Pyx_XDECREF(__pyx_t_9);
15608 __Pyx_XDECREF(__pyx_t_10);
15609 __Pyx_XDECREF(__pyx_t_11);
15610 __Pyx_AddTraceback(
"PyClical.asin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15613 __Pyx_XGIVEREF(__pyx_r);
15614 __Pyx_RefNannyFinishContext();
15619 static PyObject *__pyx_pw_8PyClical_61asin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15620 static char __pyx_doc_8PyClical_60asin[] =
"\n Inverse sine of multivector with optional complexifier.\n\n >>> s=\"{-1}\"; x=clifford(s); print asin(sin(x,s),s)\n {-1}\n >>> s=\"{-1}\"; x=clifford(s); print asin(sin(x,s),\"{-2,-1,1}\")\n {-1}\n >>> print asin(1) / pi\n 0.5\n >>> x=clifford(\"{1,2,3}\"); print asin(sin(x))\n {1,2,3}\n ";
15621 static PyObject *__pyx_pw_8PyClical_61asin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15622 PyObject *__pyx_v_obj = 0;
15623 PyObject *__pyx_v_i = 0;
15624 PyObject *__pyx_r = 0;
15625 __Pyx_RefNannyDeclarations
15626 __Pyx_RefNannySetupContext(
"asin (wrapper)", 0);
15628 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
15629 PyObject* values[2] = {0,0};
15630 values[1] = ((PyObject *)Py_None);
15631 if (unlikely(__pyx_kwds)) {
15632 Py_ssize_t kw_args;
15633 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15634 switch (pos_args) {
15635 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15636 CYTHON_FALLTHROUGH;
15637 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15638 CYTHON_FALLTHROUGH;
15640 default:
goto __pyx_L5_argtuple_error;
15642 kw_args = PyDict_Size(__pyx_kwds);
15643 switch (pos_args) {
15645 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
15646 else goto __pyx_L5_argtuple_error;
15647 CYTHON_FALLTHROUGH;
15650 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
15651 if (value) { values[1] = value; kw_args--; }
15654 if (unlikely(kw_args > 0)) {
15655 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"asin") < 0)) __PYX_ERR(0, 1698, __pyx_L3_error)
15658 switch (PyTuple_GET_SIZE(__pyx_args)) {
15659 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15660 CYTHON_FALLTHROUGH;
15661 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15663 default:
goto __pyx_L5_argtuple_error;
15666 __pyx_v_obj = values[0];
15667 __pyx_v_i = values[1];
15669 goto __pyx_L4_argument_unpacking_done;
15670 __pyx_L5_argtuple_error:;
15671 __Pyx_RaiseArgtupleInvalid(
"asin", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1698, __pyx_L3_error)
15673 __Pyx_AddTraceback(
"PyClical.asin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15674 __Pyx_RefNannyFinishContext();
15676 __pyx_L4_argument_unpacking_done:;
15677 __pyx_r = __pyx_pf_8PyClical_60asin(__pyx_self, __pyx_v_obj, __pyx_v_i);
15680 __Pyx_RefNannyFinishContext();
15684 static PyObject *__pyx_pf_8PyClical_60asin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
15685 PyObject *__pyx_r = NULL;
15686 __Pyx_RefNannyDeclarations
15687 PyObject *__pyx_t_1 = NULL;
15688 struct __pyx_opt_args_8PyClical_asin __pyx_t_2;
15689 __Pyx_RefNannySetupContext(
"asin", 0);
15690 __Pyx_XDECREF(__pyx_r);
15691 __pyx_t_2.__pyx_n = 1;
15692 __pyx_t_2.i = __pyx_v_i;
15693 __pyx_t_1 = __pyx_f_8PyClical_asin(__pyx_v_obj, 0, &__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1698, __pyx_L1_error)
15694 __Pyx_GOTREF(__pyx_t_1);
15695 __pyx_r = __pyx_t_1;
15701 __Pyx_XDECREF(__pyx_t_1);
15702 __Pyx_AddTraceback(
"PyClical.asin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15705 __Pyx_XGIVEREF(__pyx_r);
15706 __Pyx_RefNannyFinishContext();
15718 static PyObject *__pyx_pw_8PyClical_63sinh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
15719 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_sinh(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
15720 PyObject *__pyx_r = NULL;
15721 __Pyx_RefNannyDeclarations
15722 PyObject *__pyx_t_1 = NULL;
15723 PyObject *__pyx_t_2 = NULL;
15724 PyObject *__pyx_t_3 = NULL;
15725 PyObject *__pyx_t_4 = NULL;
15726 PyObject *__pyx_t_5 = NULL;
15727 PyObject *__pyx_t_6 = NULL;
15728 PyObject *__pyx_t_7 = NULL;
15729 PyObject *__pyx_t_8 = NULL;
15730 __Pyx_RefNannySetupContext(
"sinh", 0);
15740 __Pyx_PyThreadState_declare
15741 __Pyx_PyThreadState_assign
15742 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
15743 __Pyx_XGOTREF(__pyx_t_1);
15744 __Pyx_XGOTREF(__pyx_t_2);
15745 __Pyx_XGOTREF(__pyx_t_3);
15755 __Pyx_XDECREF(__pyx_r);
15756 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1729, __pyx_L3_error)
15757 __Pyx_GOTREF(__pyx_t_5);
15758 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_sinh);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1729, __pyx_L3_error)
15759 __Pyx_GOTREF(__pyx_t_6);
15760 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15762 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
15763 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
15764 if (likely(__pyx_t_5)) {
15765 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
15766 __Pyx_INCREF(__pyx_t_5);
15767 __Pyx_INCREF(
function);
15768 __Pyx_DECREF_SET(__pyx_t_6,
function);
15771 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_obj);
15772 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15773 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1729, __pyx_L3_error)
15774 __Pyx_GOTREF(__pyx_t_4);
15775 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15776 __pyx_r = __pyx_t_4;
15778 goto __pyx_L7_try_return;
15789 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
15790 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15791 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
15801 __Pyx_AddTraceback(
"PyClical.sinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15802 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(0, 1730, __pyx_L5_except_error)
15803 __Pyx_GOTREF(__pyx_t_4);
15804 __Pyx_GOTREF(__pyx_t_6);
15805 __Pyx_GOTREF(__pyx_t_5);
15814 __Pyx_XDECREF(__pyx_r);
15815 __pyx_t_7 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1731, __pyx_L5_except_error)
15816 __Pyx_GOTREF(__pyx_t_7);
15817 __pyx_t_8 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_7),
sinh(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1731, __pyx_L5_except_error)
15818 __Pyx_GOTREF(__pyx_t_8);
15819 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15820 __pyx_r = __pyx_t_8;
15822 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15823 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15824 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15825 goto __pyx_L6_except_return;
15827 __pyx_L5_except_error:;
15836 __Pyx_XGIVEREF(__pyx_t_1);
15837 __Pyx_XGIVEREF(__pyx_t_2);
15838 __Pyx_XGIVEREF(__pyx_t_3);
15839 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
15840 goto __pyx_L1_error;
15841 __pyx_L7_try_return:;
15842 __Pyx_XGIVEREF(__pyx_t_1);
15843 __Pyx_XGIVEREF(__pyx_t_2);
15844 __Pyx_XGIVEREF(__pyx_t_3);
15845 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
15847 __pyx_L6_except_return:;
15848 __Pyx_XGIVEREF(__pyx_t_1);
15849 __Pyx_XGIVEREF(__pyx_t_2);
15850 __Pyx_XGIVEREF(__pyx_t_3);
15851 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
15865 __Pyx_XDECREF(__pyx_t_4);
15866 __Pyx_XDECREF(__pyx_t_5);
15867 __Pyx_XDECREF(__pyx_t_6);
15868 __Pyx_XDECREF(__pyx_t_7);
15869 __Pyx_XDECREF(__pyx_t_8);
15870 __Pyx_AddTraceback(
"PyClical.sinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15873 __Pyx_XGIVEREF(__pyx_r);
15874 __Pyx_RefNannyFinishContext();
15879 static PyObject *__pyx_pw_8PyClical_63sinh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
15880 static char __pyx_doc_8PyClical_62sinh[] =
"\n Hyperbolic sine of multivector.\n\n >>> x=clifford(\"{1,2}\") * pi/2; print sinh(x)\n {1,2}\n >>> x=clifford(\"{1,2}\") * pi/6; print sinh(x)\n 0.5{1,2}\n ";
15881 static PyObject *__pyx_pw_8PyClical_63sinh(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
15882 PyObject *__pyx_r = 0;
15883 __Pyx_RefNannyDeclarations
15884 __Pyx_RefNannySetupContext(
"sinh (wrapper)", 0);
15885 __pyx_r = __pyx_pf_8PyClical_62sinh(__pyx_self, ((PyObject *)__pyx_v_obj));
15888 __Pyx_RefNannyFinishContext();
15892 static PyObject *__pyx_pf_8PyClical_62sinh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
15893 PyObject *__pyx_r = NULL;
15894 __Pyx_RefNannyDeclarations
15895 PyObject *__pyx_t_1 = NULL;
15896 __Pyx_RefNannySetupContext(
"sinh", 0);
15897 __Pyx_XDECREF(__pyx_r);
15898 __pyx_t_1 = __pyx_f_8PyClical_sinh(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1719, __pyx_L1_error)
15899 __Pyx_GOTREF(__pyx_t_1);
15900 __pyx_r = __pyx_t_1;
15906 __Pyx_XDECREF(__pyx_t_1);
15907 __Pyx_AddTraceback(
"PyClical.sinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15910 __Pyx_XGIVEREF(__pyx_r);
15911 __Pyx_RefNannyFinishContext();
15923 static PyObject *__pyx_pw_8PyClical_65asinh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15924 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_asinh(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_asinh *__pyx_optional_args) {
15925 PyObject *__pyx_v_i = ((PyObject *)Py_None);
15926 PyObject *__pyx_r = NULL;
15927 __Pyx_RefNannyDeclarations
15930 PyObject *__pyx_t_3 = NULL;
15932 PyObject *__pyx_t_5 = NULL;
15933 PyObject *__pyx_t_6 = NULL;
15934 PyObject *__pyx_t_7 = NULL;
15935 PyObject *__pyx_t_8 = NULL;
15936 PyObject *__pyx_t_9 = NULL;
15937 PyObject *__pyx_t_10 = NULL;
15938 PyObject *__pyx_t_11 = NULL;
15939 __Pyx_RefNannySetupContext(
"asinh", 0);
15940 if (__pyx_optional_args) {
15941 if (__pyx_optional_args->__pyx_n > 0) {
15942 __pyx_v_i = __pyx_optional_args->i;
15953 __pyx_t_1 = (__pyx_v_i != Py_None);
15954 __pyx_t_2 = (__pyx_t_1 != 0);
15964 __Pyx_XDECREF(__pyx_r);
15965 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1745, __pyx_L1_error)
15966 __Pyx_GOTREF(__pyx_t_3);
15968 __pyx_t_4 =
asinh(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
15970 __Pyx_CppExn2PyErr();
15971 __PYX_ERR(0, 1745, __pyx_L1_error)
15973 __pyx_t_5 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_3), __pyx_t_4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1745, __pyx_L1_error)
15974 __Pyx_GOTREF(__pyx_t_5);
15975 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15976 __pyx_r = __pyx_t_5;
15998 __Pyx_PyThreadState_declare
15999 __Pyx_PyThreadState_assign
16000 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
16001 __Pyx_XGOTREF(__pyx_t_6);
16002 __Pyx_XGOTREF(__pyx_t_7);
16003 __Pyx_XGOTREF(__pyx_t_8);
16013 __Pyx_XDECREF(__pyx_r);
16014 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1748, __pyx_L4_error)
16015 __Pyx_GOTREF(__pyx_t_3);
16016 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asinh);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1748, __pyx_L4_error)
16017 __Pyx_GOTREF(__pyx_t_9);
16018 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16020 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
16021 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
16022 if (likely(__pyx_t_3)) {
16023 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
16024 __Pyx_INCREF(__pyx_t_3);
16025 __Pyx_INCREF(
function);
16026 __Pyx_DECREF_SET(__pyx_t_9,
function);
16029 __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_3, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
16030 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16031 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1748, __pyx_L4_error)
16032 __Pyx_GOTREF(__pyx_t_5);
16033 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16034 __pyx_r = __pyx_t_5;
16036 goto __pyx_L8_try_return;
16047 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16048 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16049 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
16059 __Pyx_AddTraceback(
"PyClical.asinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16060 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1749, __pyx_L6_except_error)
16061 __Pyx_GOTREF(__pyx_t_5);
16062 __Pyx_GOTREF(__pyx_t_9);
16063 __Pyx_GOTREF(__pyx_t_3);
16072 __Pyx_XDECREF(__pyx_r);
16073 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1750, __pyx_L6_except_error)
16074 __Pyx_GOTREF(__pyx_t_10);
16075 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_10),
asinh(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1750, __pyx_L6_except_error)
16076 __Pyx_GOTREF(__pyx_t_11);
16077 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16078 __pyx_r = __pyx_t_11;
16080 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16081 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16082 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16083 goto __pyx_L7_except_return;
16085 __pyx_L6_except_error:;
16094 __Pyx_XGIVEREF(__pyx_t_6);
16095 __Pyx_XGIVEREF(__pyx_t_7);
16096 __Pyx_XGIVEREF(__pyx_t_8);
16097 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16098 goto __pyx_L1_error;
16099 __pyx_L8_try_return:;
16100 __Pyx_XGIVEREF(__pyx_t_6);
16101 __Pyx_XGIVEREF(__pyx_t_7);
16102 __Pyx_XGIVEREF(__pyx_t_8);
16103 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16105 __pyx_L7_except_return:;
16106 __Pyx_XGIVEREF(__pyx_t_6);
16107 __Pyx_XGIVEREF(__pyx_t_7);
16108 __Pyx_XGIVEREF(__pyx_t_8);
16109 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16124 __Pyx_XDECREF(__pyx_t_3);
16125 __Pyx_XDECREF(__pyx_t_5);
16126 __Pyx_XDECREF(__pyx_t_9);
16127 __Pyx_XDECREF(__pyx_t_10);
16128 __Pyx_XDECREF(__pyx_t_11);
16129 __Pyx_AddTraceback(
"PyClical.asinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16132 __Pyx_XGIVEREF(__pyx_r);
16133 __Pyx_RefNannyFinishContext();
16138 static PyObject *__pyx_pw_8PyClical_65asinh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16139 static char __pyx_doc_8PyClical_64asinh[] =
"\n Inverse hyperbolic sine of multivector with optional complexifier.\n\n >>> x=clifford(\"{1,2}\"); print asinh(x,\"{1,2,3}\") * 2/pi\n {1,2}\n >>> x=clifford(\"{1,2}\"); print asinh(x) * 2/pi\n {1,2}\n >>> x=clifford(\"{1,2}\") / 2; print asinh(x) * 6/pi\n {1,2}\n ";
16140 static PyObject *__pyx_pw_8PyClical_65asinh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16141 PyObject *__pyx_v_obj = 0;
16142 PyObject *__pyx_v_i = 0;
16143 PyObject *__pyx_r = 0;
16144 __Pyx_RefNannyDeclarations
16145 __Pyx_RefNannySetupContext(
"asinh (wrapper)", 0);
16147 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
16148 PyObject* values[2] = {0,0};
16149 values[1] = ((PyObject *)Py_None);
16150 if (unlikely(__pyx_kwds)) {
16151 Py_ssize_t kw_args;
16152 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16153 switch (pos_args) {
16154 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16155 CYTHON_FALLTHROUGH;
16156 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16157 CYTHON_FALLTHROUGH;
16159 default:
goto __pyx_L5_argtuple_error;
16161 kw_args = PyDict_Size(__pyx_kwds);
16162 switch (pos_args) {
16164 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
16165 else goto __pyx_L5_argtuple_error;
16166 CYTHON_FALLTHROUGH;
16169 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
16170 if (value) { values[1] = value; kw_args--; }
16173 if (unlikely(kw_args > 0)) {
16174 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"asinh") < 0)) __PYX_ERR(0, 1733, __pyx_L3_error)
16177 switch (PyTuple_GET_SIZE(__pyx_args)) {
16178 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16179 CYTHON_FALLTHROUGH;
16180 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16182 default:
goto __pyx_L5_argtuple_error;
16185 __pyx_v_obj = values[0];
16186 __pyx_v_i = values[1];
16188 goto __pyx_L4_argument_unpacking_done;
16189 __pyx_L5_argtuple_error:;
16190 __Pyx_RaiseArgtupleInvalid(
"asinh", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1733, __pyx_L3_error)
16192 __Pyx_AddTraceback(
"PyClical.asinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16193 __Pyx_RefNannyFinishContext();
16195 __pyx_L4_argument_unpacking_done:;
16196 __pyx_r = __pyx_pf_8PyClical_64asinh(__pyx_self, __pyx_v_obj, __pyx_v_i);
16199 __Pyx_RefNannyFinishContext();
16203 static PyObject *__pyx_pf_8PyClical_64asinh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
16204 PyObject *__pyx_r = NULL;
16205 __Pyx_RefNannyDeclarations
16206 PyObject *__pyx_t_1 = NULL;
16207 struct __pyx_opt_args_8PyClical_asinh __pyx_t_2;
16208 __Pyx_RefNannySetupContext(
"asinh", 0);
16209 __Pyx_XDECREF(__pyx_r);
16210 __pyx_t_2.__pyx_n = 1;
16211 __pyx_t_2.i = __pyx_v_i;
16212 __pyx_t_1 = __pyx_f_8PyClical_asinh(__pyx_v_obj, 0, &__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1733, __pyx_L1_error)
16213 __Pyx_GOTREF(__pyx_t_1);
16214 __pyx_r = __pyx_t_1;
16220 __Pyx_XDECREF(__pyx_t_1);
16221 __Pyx_AddTraceback(
"PyClical.asinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16224 __Pyx_XGIVEREF(__pyx_r);
16225 __Pyx_RefNannyFinishContext();
16237 static PyObject *__pyx_pw_8PyClical_67tan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16238 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_tan(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_tan *__pyx_optional_args) {
16239 PyObject *__pyx_v_i = ((PyObject *)Py_None);
16240 PyObject *__pyx_r = NULL;
16241 __Pyx_RefNannyDeclarations
16244 PyObject *__pyx_t_3 = NULL;
16246 PyObject *__pyx_t_5 = NULL;
16247 PyObject *__pyx_t_6 = NULL;
16248 PyObject *__pyx_t_7 = NULL;
16249 PyObject *__pyx_t_8 = NULL;
16250 PyObject *__pyx_t_9 = NULL;
16251 PyObject *__pyx_t_10 = NULL;
16252 PyObject *__pyx_t_11 = NULL;
16253 __Pyx_RefNannySetupContext(
"tan", 0);
16254 if (__pyx_optional_args) {
16255 if (__pyx_optional_args->__pyx_n > 0) {
16256 __pyx_v_i = __pyx_optional_args->i;
16267 __pyx_t_1 = (__pyx_v_i != Py_None);
16268 __pyx_t_2 = (__pyx_t_1 != 0);
16278 __Pyx_XDECREF(__pyx_r);
16279 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1762, __pyx_L1_error)
16280 __Pyx_GOTREF(__pyx_t_3);
16282 __pyx_t_4 =
tan(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
16284 __Pyx_CppExn2PyErr();
16285 __PYX_ERR(0, 1762, __pyx_L1_error)
16287 __pyx_t_5 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_3), __pyx_t_4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1762, __pyx_L1_error)
16288 __Pyx_GOTREF(__pyx_t_5);
16289 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16290 __pyx_r = __pyx_t_5;
16312 __Pyx_PyThreadState_declare
16313 __Pyx_PyThreadState_assign
16314 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
16315 __Pyx_XGOTREF(__pyx_t_6);
16316 __Pyx_XGOTREF(__pyx_t_7);
16317 __Pyx_XGOTREF(__pyx_t_8);
16327 __Pyx_XDECREF(__pyx_r);
16328 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1765, __pyx_L4_error)
16329 __Pyx_GOTREF(__pyx_t_3);
16330 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_tan);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1765, __pyx_L4_error)
16331 __Pyx_GOTREF(__pyx_t_9);
16332 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16334 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
16335 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
16336 if (likely(__pyx_t_3)) {
16337 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
16338 __Pyx_INCREF(__pyx_t_3);
16339 __Pyx_INCREF(
function);
16340 __Pyx_DECREF_SET(__pyx_t_9,
function);
16343 __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_3, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
16344 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16345 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1765, __pyx_L4_error)
16346 __Pyx_GOTREF(__pyx_t_5);
16347 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16348 __pyx_r = __pyx_t_5;
16350 goto __pyx_L8_try_return;
16361 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16362 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16363 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
16373 __Pyx_AddTraceback(
"PyClical.tan", __pyx_clineno, __pyx_lineno, __pyx_filename);
16374 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1766, __pyx_L6_except_error)
16375 __Pyx_GOTREF(__pyx_t_5);
16376 __Pyx_GOTREF(__pyx_t_9);
16377 __Pyx_GOTREF(__pyx_t_3);
16386 __Pyx_XDECREF(__pyx_r);
16387 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1767, __pyx_L6_except_error)
16388 __Pyx_GOTREF(__pyx_t_10);
16389 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_10),
tan(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1767, __pyx_L6_except_error)
16390 __Pyx_GOTREF(__pyx_t_11);
16391 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16392 __pyx_r = __pyx_t_11;
16394 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16395 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16396 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16397 goto __pyx_L7_except_return;
16399 __pyx_L6_except_error:;
16408 __Pyx_XGIVEREF(__pyx_t_6);
16409 __Pyx_XGIVEREF(__pyx_t_7);
16410 __Pyx_XGIVEREF(__pyx_t_8);
16411 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16412 goto __pyx_L1_error;
16413 __pyx_L8_try_return:;
16414 __Pyx_XGIVEREF(__pyx_t_6);
16415 __Pyx_XGIVEREF(__pyx_t_7);
16416 __Pyx_XGIVEREF(__pyx_t_8);
16417 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16419 __pyx_L7_except_return:;
16420 __Pyx_XGIVEREF(__pyx_t_6);
16421 __Pyx_XGIVEREF(__pyx_t_7);
16422 __Pyx_XGIVEREF(__pyx_t_8);
16423 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16438 __Pyx_XDECREF(__pyx_t_3);
16439 __Pyx_XDECREF(__pyx_t_5);
16440 __Pyx_XDECREF(__pyx_t_9);
16441 __Pyx_XDECREF(__pyx_t_10);
16442 __Pyx_XDECREF(__pyx_t_11);
16443 __Pyx_AddTraceback(
"PyClical.tan", __pyx_clineno, __pyx_lineno, __pyx_filename);
16446 __Pyx_XGIVEREF(__pyx_r);
16447 __Pyx_RefNannyFinishContext();
16452 static PyObject *__pyx_pw_8PyClical_67tan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16453 static char __pyx_doc_8PyClical_66tan[] =
"\n Tangent of multivector with optional complexifier.\n\n >>> x=clifford(\"{1,2}\"); print tan(x,\"{1,2,3}\")\n 0.7616{1,2}\n >>> x=clifford(\"{1,2}\"); print tan(x)\n 0.7616{1,2}\n ";
16454 static PyObject *__pyx_pw_8PyClical_67tan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16455 PyObject *__pyx_v_obj = 0;
16456 PyObject *__pyx_v_i = 0;
16457 PyObject *__pyx_r = 0;
16458 __Pyx_RefNannyDeclarations
16459 __Pyx_RefNannySetupContext(
"tan (wrapper)", 0);
16461 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
16462 PyObject* values[2] = {0,0};
16463 values[1] = ((PyObject *)Py_None);
16464 if (unlikely(__pyx_kwds)) {
16465 Py_ssize_t kw_args;
16466 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16467 switch (pos_args) {
16468 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16469 CYTHON_FALLTHROUGH;
16470 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16471 CYTHON_FALLTHROUGH;
16473 default:
goto __pyx_L5_argtuple_error;
16475 kw_args = PyDict_Size(__pyx_kwds);
16476 switch (pos_args) {
16478 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
16479 else goto __pyx_L5_argtuple_error;
16480 CYTHON_FALLTHROUGH;
16483 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
16484 if (value) { values[1] = value; kw_args--; }
16487 if (unlikely(kw_args > 0)) {
16488 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"tan") < 0)) __PYX_ERR(0, 1752, __pyx_L3_error)
16491 switch (PyTuple_GET_SIZE(__pyx_args)) {
16492 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16493 CYTHON_FALLTHROUGH;
16494 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16496 default:
goto __pyx_L5_argtuple_error;
16499 __pyx_v_obj = values[0];
16500 __pyx_v_i = values[1];
16502 goto __pyx_L4_argument_unpacking_done;
16503 __pyx_L5_argtuple_error:;
16504 __Pyx_RaiseArgtupleInvalid(
"tan", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1752, __pyx_L3_error)
16506 __Pyx_AddTraceback(
"PyClical.tan", __pyx_clineno, __pyx_lineno, __pyx_filename);
16507 __Pyx_RefNannyFinishContext();
16509 __pyx_L4_argument_unpacking_done:;
16510 __pyx_r = __pyx_pf_8PyClical_66tan(__pyx_self, __pyx_v_obj, __pyx_v_i);
16513 __Pyx_RefNannyFinishContext();
16517 static PyObject *__pyx_pf_8PyClical_66tan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
16518 PyObject *__pyx_r = NULL;
16519 __Pyx_RefNannyDeclarations
16520 PyObject *__pyx_t_1 = NULL;
16521 struct __pyx_opt_args_8PyClical_tan __pyx_t_2;
16522 __Pyx_RefNannySetupContext(
"tan", 0);
16523 __Pyx_XDECREF(__pyx_r);
16524 __pyx_t_2.__pyx_n = 1;
16525 __pyx_t_2.i = __pyx_v_i;
16526 __pyx_t_1 = __pyx_f_8PyClical_tan(__pyx_v_obj, 0, &__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1752, __pyx_L1_error)
16527 __Pyx_GOTREF(__pyx_t_1);
16528 __pyx_r = __pyx_t_1;
16534 __Pyx_XDECREF(__pyx_t_1);
16535 __Pyx_AddTraceback(
"PyClical.tan", __pyx_clineno, __pyx_lineno, __pyx_filename);
16538 __Pyx_XGIVEREF(__pyx_r);
16539 __Pyx_RefNannyFinishContext();
16551 static PyObject *__pyx_pw_8PyClical_69atan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16552 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_atan(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_atan *__pyx_optional_args) {
16553 PyObject *__pyx_v_i = ((PyObject *)Py_None);
16554 PyObject *__pyx_r = NULL;
16555 __Pyx_RefNannyDeclarations
16558 PyObject *__pyx_t_3 = NULL;
16560 PyObject *__pyx_t_5 = NULL;
16561 PyObject *__pyx_t_6 = NULL;
16562 PyObject *__pyx_t_7 = NULL;
16563 PyObject *__pyx_t_8 = NULL;
16564 PyObject *__pyx_t_9 = NULL;
16565 PyObject *__pyx_t_10 = NULL;
16566 PyObject *__pyx_t_11 = NULL;
16567 __Pyx_RefNannySetupContext(
"atan", 0);
16568 if (__pyx_optional_args) {
16569 if (__pyx_optional_args->__pyx_n > 0) {
16570 __pyx_v_i = __pyx_optional_args->i;
16581 __pyx_t_1 = (__pyx_v_i != Py_None);
16582 __pyx_t_2 = (__pyx_t_1 != 0);
16592 __Pyx_XDECREF(__pyx_r);
16593 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1779, __pyx_L1_error)
16594 __Pyx_GOTREF(__pyx_t_3);
16596 __pyx_t_4 =
atan(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
16598 __Pyx_CppExn2PyErr();
16599 __PYX_ERR(0, 1779, __pyx_L1_error)
16601 __pyx_t_5 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_3), __pyx_t_4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1779, __pyx_L1_error)
16602 __Pyx_GOTREF(__pyx_t_5);
16603 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16604 __pyx_r = __pyx_t_5;
16626 __Pyx_PyThreadState_declare
16627 __Pyx_PyThreadState_assign
16628 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
16629 __Pyx_XGOTREF(__pyx_t_6);
16630 __Pyx_XGOTREF(__pyx_t_7);
16631 __Pyx_XGOTREF(__pyx_t_8);
16641 __Pyx_XDECREF(__pyx_r);
16642 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1782, __pyx_L4_error)
16643 __Pyx_GOTREF(__pyx_t_3);
16644 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_atan);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1782, __pyx_L4_error)
16645 __Pyx_GOTREF(__pyx_t_9);
16646 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16648 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
16649 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
16650 if (likely(__pyx_t_3)) {
16651 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
16652 __Pyx_INCREF(__pyx_t_3);
16653 __Pyx_INCREF(
function);
16654 __Pyx_DECREF_SET(__pyx_t_9,
function);
16657 __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_3, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
16658 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16659 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1782, __pyx_L4_error)
16660 __Pyx_GOTREF(__pyx_t_5);
16661 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16662 __pyx_r = __pyx_t_5;
16664 goto __pyx_L8_try_return;
16675 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16676 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16677 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
16687 __Pyx_AddTraceback(
"PyClical.atan", __pyx_clineno, __pyx_lineno, __pyx_filename);
16688 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1783, __pyx_L6_except_error)
16689 __Pyx_GOTREF(__pyx_t_5);
16690 __Pyx_GOTREF(__pyx_t_9);
16691 __Pyx_GOTREF(__pyx_t_3);
16700 __Pyx_XDECREF(__pyx_r);
16701 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1784, __pyx_L6_except_error)
16702 __Pyx_GOTREF(__pyx_t_10);
16703 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_10),
atan(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1784, __pyx_L6_except_error)
16704 __Pyx_GOTREF(__pyx_t_11);
16705 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16706 __pyx_r = __pyx_t_11;
16708 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16709 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16710 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16711 goto __pyx_L7_except_return;
16713 __pyx_L6_except_error:;
16722 __Pyx_XGIVEREF(__pyx_t_6);
16723 __Pyx_XGIVEREF(__pyx_t_7);
16724 __Pyx_XGIVEREF(__pyx_t_8);
16725 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16726 goto __pyx_L1_error;
16727 __pyx_L8_try_return:;
16728 __Pyx_XGIVEREF(__pyx_t_6);
16729 __Pyx_XGIVEREF(__pyx_t_7);
16730 __Pyx_XGIVEREF(__pyx_t_8);
16731 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16733 __pyx_L7_except_return:;
16734 __Pyx_XGIVEREF(__pyx_t_6);
16735 __Pyx_XGIVEREF(__pyx_t_7);
16736 __Pyx_XGIVEREF(__pyx_t_8);
16737 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16752 __Pyx_XDECREF(__pyx_t_3);
16753 __Pyx_XDECREF(__pyx_t_5);
16754 __Pyx_XDECREF(__pyx_t_9);
16755 __Pyx_XDECREF(__pyx_t_10);
16756 __Pyx_XDECREF(__pyx_t_11);
16757 __Pyx_AddTraceback(
"PyClical.atan", __pyx_clineno, __pyx_lineno, __pyx_filename);
16760 __Pyx_XGIVEREF(__pyx_r);
16761 __Pyx_RefNannyFinishContext();
16766 static PyObject *__pyx_pw_8PyClical_69atan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16767 static char __pyx_doc_8PyClical_68atan[] =
"\n Inverse tangent of multivector with optional complexifier.\n\n >>> s=index_set({1,2,3}); x=clifford(\"{1}\"); print tan(atan(x,s),s)\n {1}\n >>> x=clifford(\"{1}\"); print tan(atan(x))\n {1}\n ";
16768 static PyObject *__pyx_pw_8PyClical_69atan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16769 PyObject *__pyx_v_obj = 0;
16770 PyObject *__pyx_v_i = 0;
16771 PyObject *__pyx_r = 0;
16772 __Pyx_RefNannyDeclarations
16773 __Pyx_RefNannySetupContext(
"atan (wrapper)", 0);
16775 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
16776 PyObject* values[2] = {0,0};
16777 values[1] = ((PyObject *)Py_None);
16778 if (unlikely(__pyx_kwds)) {
16779 Py_ssize_t kw_args;
16780 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16781 switch (pos_args) {
16782 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16783 CYTHON_FALLTHROUGH;
16784 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16785 CYTHON_FALLTHROUGH;
16787 default:
goto __pyx_L5_argtuple_error;
16789 kw_args = PyDict_Size(__pyx_kwds);
16790 switch (pos_args) {
16792 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
16793 else goto __pyx_L5_argtuple_error;
16794 CYTHON_FALLTHROUGH;
16797 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
16798 if (value) { values[1] = value; kw_args--; }
16801 if (unlikely(kw_args > 0)) {
16802 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"atan") < 0)) __PYX_ERR(0, 1769, __pyx_L3_error)
16805 switch (PyTuple_GET_SIZE(__pyx_args)) {
16806 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16807 CYTHON_FALLTHROUGH;
16808 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16810 default:
goto __pyx_L5_argtuple_error;
16813 __pyx_v_obj = values[0];
16814 __pyx_v_i = values[1];
16816 goto __pyx_L4_argument_unpacking_done;
16817 __pyx_L5_argtuple_error:;
16818 __Pyx_RaiseArgtupleInvalid(
"atan", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1769, __pyx_L3_error)
16820 __Pyx_AddTraceback(
"PyClical.atan", __pyx_clineno, __pyx_lineno, __pyx_filename);
16821 __Pyx_RefNannyFinishContext();
16823 __pyx_L4_argument_unpacking_done:;
16824 __pyx_r = __pyx_pf_8PyClical_68atan(__pyx_self, __pyx_v_obj, __pyx_v_i);
16827 __Pyx_RefNannyFinishContext();
16831 static PyObject *__pyx_pf_8PyClical_68atan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
16832 PyObject *__pyx_r = NULL;
16833 __Pyx_RefNannyDeclarations
16834 PyObject *__pyx_t_1 = NULL;
16835 struct __pyx_opt_args_8PyClical_atan __pyx_t_2;
16836 __Pyx_RefNannySetupContext(
"atan", 0);
16837 __Pyx_XDECREF(__pyx_r);
16838 __pyx_t_2.__pyx_n = 1;
16839 __pyx_t_2.i = __pyx_v_i;
16840 __pyx_t_1 = __pyx_f_8PyClical_atan(__pyx_v_obj, 0, &__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1769, __pyx_L1_error)
16841 __Pyx_GOTREF(__pyx_t_1);
16842 __pyx_r = __pyx_t_1;
16848 __Pyx_XDECREF(__pyx_t_1);
16849 __Pyx_AddTraceback(
"PyClical.atan", __pyx_clineno, __pyx_lineno, __pyx_filename);
16852 __Pyx_XGIVEREF(__pyx_r);
16853 __Pyx_RefNannyFinishContext();
16865 static PyObject *__pyx_pw_8PyClical_71tanh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
16866 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_tanh(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
16867 PyObject *__pyx_r = NULL;
16868 __Pyx_RefNannyDeclarations
16869 PyObject *__pyx_t_1 = NULL;
16870 PyObject *__pyx_t_2 = NULL;
16871 PyObject *__pyx_t_3 = NULL;
16872 PyObject *__pyx_t_4 = NULL;
16873 PyObject *__pyx_t_5 = NULL;
16874 PyObject *__pyx_t_6 = NULL;
16875 PyObject *__pyx_t_7 = NULL;
16876 PyObject *__pyx_t_8 = NULL;
16877 __Pyx_RefNannySetupContext(
"tanh", 0);
16887 __Pyx_PyThreadState_declare
16888 __Pyx_PyThreadState_assign
16889 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
16890 __Pyx_XGOTREF(__pyx_t_1);
16891 __Pyx_XGOTREF(__pyx_t_2);
16892 __Pyx_XGOTREF(__pyx_t_3);
16902 __Pyx_XDECREF(__pyx_r);
16903 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1794, __pyx_L3_error)
16904 __Pyx_GOTREF(__pyx_t_5);
16905 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_tanh);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1794, __pyx_L3_error)
16906 __Pyx_GOTREF(__pyx_t_6);
16907 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16909 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
16910 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
16911 if (likely(__pyx_t_5)) {
16912 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
16913 __Pyx_INCREF(__pyx_t_5);
16914 __Pyx_INCREF(
function);
16915 __Pyx_DECREF_SET(__pyx_t_6,
function);
16918 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_obj);
16919 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16920 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1794, __pyx_L3_error)
16921 __Pyx_GOTREF(__pyx_t_4);
16922 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16923 __pyx_r = __pyx_t_4;
16925 goto __pyx_L7_try_return;
16936 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
16937 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16938 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
16948 __Pyx_AddTraceback(
"PyClical.tanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16949 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(0, 1795, __pyx_L5_except_error)
16950 __Pyx_GOTREF(__pyx_t_4);
16951 __Pyx_GOTREF(__pyx_t_6);
16952 __Pyx_GOTREF(__pyx_t_5);
16961 __Pyx_XDECREF(__pyx_r);
16962 __pyx_t_7 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1796, __pyx_L5_except_error)
16963 __Pyx_GOTREF(__pyx_t_7);
16964 __pyx_t_8 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_7),
tanh(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1796, __pyx_L5_except_error)
16965 __Pyx_GOTREF(__pyx_t_8);
16966 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16967 __pyx_r = __pyx_t_8;
16969 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16970 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16971 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16972 goto __pyx_L6_except_return;
16974 __pyx_L5_except_error:;
16983 __Pyx_XGIVEREF(__pyx_t_1);
16984 __Pyx_XGIVEREF(__pyx_t_2);
16985 __Pyx_XGIVEREF(__pyx_t_3);
16986 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
16987 goto __pyx_L1_error;
16988 __pyx_L7_try_return:;
16989 __Pyx_XGIVEREF(__pyx_t_1);
16990 __Pyx_XGIVEREF(__pyx_t_2);
16991 __Pyx_XGIVEREF(__pyx_t_3);
16992 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
16994 __pyx_L6_except_return:;
16995 __Pyx_XGIVEREF(__pyx_t_1);
16996 __Pyx_XGIVEREF(__pyx_t_2);
16997 __Pyx_XGIVEREF(__pyx_t_3);
16998 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
17012 __Pyx_XDECREF(__pyx_t_4);
17013 __Pyx_XDECREF(__pyx_t_5);
17014 __Pyx_XDECREF(__pyx_t_6);
17015 __Pyx_XDECREF(__pyx_t_7);
17016 __Pyx_XDECREF(__pyx_t_8);
17017 __Pyx_AddTraceback(
"PyClical.tanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17020 __Pyx_XGIVEREF(__pyx_r);
17021 __Pyx_RefNannyFinishContext();
17026 static PyObject *__pyx_pw_8PyClical_71tanh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
17027 static char __pyx_doc_8PyClical_70tanh[] =
"\n Hyperbolic tangent of multivector.\n\n >>> x=clifford(\"{1,2}\") * pi/4; print tanh(x)\n {1,2}\n ";
17028 static PyObject *__pyx_pw_8PyClical_71tanh(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
17029 PyObject *__pyx_r = 0;
17030 __Pyx_RefNannyDeclarations
17031 __Pyx_RefNannySetupContext(
"tanh (wrapper)", 0);
17032 __pyx_r = __pyx_pf_8PyClical_70tanh(__pyx_self, ((PyObject *)__pyx_v_obj));
17035 __Pyx_RefNannyFinishContext();
17039 static PyObject *__pyx_pf_8PyClical_70tanh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
17040 PyObject *__pyx_r = NULL;
17041 __Pyx_RefNannyDeclarations
17042 PyObject *__pyx_t_1 = NULL;
17043 __Pyx_RefNannySetupContext(
"tanh", 0);
17044 __Pyx_XDECREF(__pyx_r);
17045 __pyx_t_1 = __pyx_f_8PyClical_tanh(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1786, __pyx_L1_error)
17046 __Pyx_GOTREF(__pyx_t_1);
17047 __pyx_r = __pyx_t_1;
17053 __Pyx_XDECREF(__pyx_t_1);
17054 __Pyx_AddTraceback(
"PyClical.tanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17057 __Pyx_XGIVEREF(__pyx_r);
17058 __Pyx_RefNannyFinishContext();
17070 static PyObject *__pyx_pw_8PyClical_73atanh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17071 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_atanh(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_atanh *__pyx_optional_args) {
17072 PyObject *__pyx_v_i = ((PyObject *)Py_None);
17073 PyObject *__pyx_r = NULL;
17074 __Pyx_RefNannyDeclarations
17077 PyObject *__pyx_t_3 = NULL;
17079 PyObject *__pyx_t_5 = NULL;
17080 PyObject *__pyx_t_6 = NULL;
17081 PyObject *__pyx_t_7 = NULL;
17082 PyObject *__pyx_t_8 = NULL;
17083 PyObject *__pyx_t_9 = NULL;
17084 PyObject *__pyx_t_10 = NULL;
17085 PyObject *__pyx_t_11 = NULL;
17086 __Pyx_RefNannySetupContext(
"atanh", 0);
17087 if (__pyx_optional_args) {
17088 if (__pyx_optional_args->__pyx_n > 0) {
17089 __pyx_v_i = __pyx_optional_args->i;
17100 __pyx_t_1 = (__pyx_v_i != Py_None);
17101 __pyx_t_2 = (__pyx_t_1 != 0);
17111 __Pyx_XDECREF(__pyx_r);
17112 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1808, __pyx_L1_error)
17113 __Pyx_GOTREF(__pyx_t_3);
17115 __pyx_t_4 =
atanh(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
17117 __Pyx_CppExn2PyErr();
17118 __PYX_ERR(0, 1808, __pyx_L1_error)
17120 __pyx_t_5 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_3), __pyx_t_4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1808, __pyx_L1_error)
17121 __Pyx_GOTREF(__pyx_t_5);
17122 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17123 __pyx_r = __pyx_t_5;
17145 __Pyx_PyThreadState_declare
17146 __Pyx_PyThreadState_assign
17147 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
17148 __Pyx_XGOTREF(__pyx_t_6);
17149 __Pyx_XGOTREF(__pyx_t_7);
17150 __Pyx_XGOTREF(__pyx_t_8);
17160 __Pyx_XDECREF(__pyx_r);
17161 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1811, __pyx_L4_error)
17162 __Pyx_GOTREF(__pyx_t_3);
17163 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_atanh);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1811, __pyx_L4_error)
17164 __Pyx_GOTREF(__pyx_t_9);
17165 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17167 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
17168 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
17169 if (likely(__pyx_t_3)) {
17170 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
17171 __Pyx_INCREF(__pyx_t_3);
17172 __Pyx_INCREF(
function);
17173 __Pyx_DECREF_SET(__pyx_t_9,
function);
17176 __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_3, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
17177 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17178 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1811, __pyx_L4_error)
17179 __Pyx_GOTREF(__pyx_t_5);
17180 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17181 __pyx_r = __pyx_t_5;
17183 goto __pyx_L8_try_return;
17194 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17195 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17196 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
17206 __Pyx_AddTraceback(
"PyClical.atanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17207 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1812, __pyx_L6_except_error)
17208 __Pyx_GOTREF(__pyx_t_5);
17209 __Pyx_GOTREF(__pyx_t_9);
17210 __Pyx_GOTREF(__pyx_t_3);
17219 __Pyx_XDECREF(__pyx_r);
17220 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1813, __pyx_L6_except_error)
17221 __Pyx_GOTREF(__pyx_t_10);
17222 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_10),
atanh(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1813, __pyx_L6_except_error)
17223 __Pyx_GOTREF(__pyx_t_11);
17224 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
17225 __pyx_r = __pyx_t_11;
17227 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17228 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17229 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17230 goto __pyx_L7_except_return;
17232 __pyx_L6_except_error:;
17241 __Pyx_XGIVEREF(__pyx_t_6);
17242 __Pyx_XGIVEREF(__pyx_t_7);
17243 __Pyx_XGIVEREF(__pyx_t_8);
17244 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17245 goto __pyx_L1_error;
17246 __pyx_L8_try_return:;
17247 __Pyx_XGIVEREF(__pyx_t_6);
17248 __Pyx_XGIVEREF(__pyx_t_7);
17249 __Pyx_XGIVEREF(__pyx_t_8);
17250 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17252 __pyx_L7_except_return:;
17253 __Pyx_XGIVEREF(__pyx_t_6);
17254 __Pyx_XGIVEREF(__pyx_t_7);
17255 __Pyx_XGIVEREF(__pyx_t_8);
17256 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17271 __Pyx_XDECREF(__pyx_t_3);
17272 __Pyx_XDECREF(__pyx_t_5);
17273 __Pyx_XDECREF(__pyx_t_9);
17274 __Pyx_XDECREF(__pyx_t_10);
17275 __Pyx_XDECREF(__pyx_t_11);
17276 __Pyx_AddTraceback(
"PyClical.atanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17279 __Pyx_XGIVEREF(__pyx_r);
17280 __Pyx_RefNannyFinishContext();
17285 static PyObject *__pyx_pw_8PyClical_73atanh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17286 static char __pyx_doc_8PyClical_72atanh[] =
"\n Inverse hyperbolic tangent of multivector with optional complexifier.\n\n >>> s=index_set({1,2,3}); x=clifford(\"{1,2}\"); print tanh(atanh(x,s))\n {1,2}\n >>> x=clifford(\"{1,2}\"); print tanh(atanh(x))\n {1,2}\n ";
17287 static PyObject *__pyx_pw_8PyClical_73atanh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17288 PyObject *__pyx_v_obj = 0;
17289 PyObject *__pyx_v_i = 0;
17290 PyObject *__pyx_r = 0;
17291 __Pyx_RefNannyDeclarations
17292 __Pyx_RefNannySetupContext(
"atanh (wrapper)", 0);
17294 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
17295 PyObject* values[2] = {0,0};
17296 values[1] = ((PyObject *)Py_None);
17297 if (unlikely(__pyx_kwds)) {
17298 Py_ssize_t kw_args;
17299 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17300 switch (pos_args) {
17301 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17302 CYTHON_FALLTHROUGH;
17303 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17304 CYTHON_FALLTHROUGH;
17306 default:
goto __pyx_L5_argtuple_error;
17308 kw_args = PyDict_Size(__pyx_kwds);
17309 switch (pos_args) {
17311 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
17312 else goto __pyx_L5_argtuple_error;
17313 CYTHON_FALLTHROUGH;
17316 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
17317 if (value) { values[1] = value; kw_args--; }
17320 if (unlikely(kw_args > 0)) {
17321 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"atanh") < 0)) __PYX_ERR(0, 1798, __pyx_L3_error)
17324 switch (PyTuple_GET_SIZE(__pyx_args)) {
17325 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17326 CYTHON_FALLTHROUGH;
17327 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17329 default:
goto __pyx_L5_argtuple_error;
17332 __pyx_v_obj = values[0];
17333 __pyx_v_i = values[1];
17335 goto __pyx_L4_argument_unpacking_done;
17336 __pyx_L5_argtuple_error:;
17337 __Pyx_RaiseArgtupleInvalid(
"atanh", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1798, __pyx_L3_error)
17339 __Pyx_AddTraceback(
"PyClical.atanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17340 __Pyx_RefNannyFinishContext();
17342 __pyx_L4_argument_unpacking_done:;
17343 __pyx_r = __pyx_pf_8PyClical_72atanh(__pyx_self, __pyx_v_obj, __pyx_v_i);
17346 __Pyx_RefNannyFinishContext();
17350 static PyObject *__pyx_pf_8PyClical_72atanh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
17351 PyObject *__pyx_r = NULL;
17352 __Pyx_RefNannyDeclarations
17353 PyObject *__pyx_t_1 = NULL;
17354 struct __pyx_opt_args_8PyClical_atanh __pyx_t_2;
17355 __Pyx_RefNannySetupContext(
"atanh", 0);
17356 __Pyx_XDECREF(__pyx_r);
17357 __pyx_t_2.__pyx_n = 1;
17358 __pyx_t_2.i = __pyx_v_i;
17359 __pyx_t_1 = __pyx_f_8PyClical_atanh(__pyx_v_obj, 0, &__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1798, __pyx_L1_error)
17360 __Pyx_GOTREF(__pyx_t_1);
17361 __pyx_r = __pyx_t_1;
17367 __Pyx_XDECREF(__pyx_t_1);
17368 __Pyx_AddTraceback(
"PyClical.atanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17371 __Pyx_XGIVEREF(__pyx_r);
17372 __Pyx_RefNannyFinishContext();
17384 static PyObject *__pyx_pw_8PyClical_75random_clifford(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17385 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_random_clifford(
struct __pyx_obj_8PyClical_index_set *__pyx_v_ixt, CYTHON_UNUSED
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_random_clifford *__pyx_optional_args) {
17386 PyObject *__pyx_v_fill = ((PyObject *)__pyx_float_1_0);
17387 PyObject *__pyx_r = NULL;
17388 __Pyx_RefNannyDeclarations
17389 PyObject *__pyx_t_1 = NULL;
17390 PyObject *__pyx_t_2 = NULL;
17392 PyObject *__pyx_t_4 = NULL;
17393 __Pyx_RefNannySetupContext(
"random_clifford", 0);
17394 if (__pyx_optional_args) {
17395 if (__pyx_optional_args->__pyx_n > 0) {
17396 __pyx_v_fill = __pyx_optional_args->fill;
17407 __Pyx_XDECREF(__pyx_r);
17408 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1822, __pyx_L1_error)
17409 __Pyx_GOTREF(__pyx_t_1);
17410 __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1822, __pyx_L1_error)
17411 __Pyx_GOTREF(__pyx_t_2);
17412 __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_fill);
if (unlikely((__pyx_t_3 == ((
scalar_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1822, __pyx_L1_error)
17413 __pyx_t_4 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_1), ((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_2)->instance->random(__pyx_f_8PyClical_9index_set_unwrap(__pyx_v_ixt), ((
scalar_t)__pyx_t_3)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1822, __pyx_L1_error)
17414 __Pyx_GOTREF(__pyx_t_4);
17415 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17416 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17417 __pyx_r = __pyx_t_4;
17431 __Pyx_XDECREF(__pyx_t_1);
17432 __Pyx_XDECREF(__pyx_t_2);
17433 __Pyx_XDECREF(__pyx_t_4);
17434 __Pyx_AddTraceback(
"PyClical.random_clifford", __pyx_clineno, __pyx_lineno, __pyx_filename);
17437 __Pyx_XGIVEREF(__pyx_r);
17438 __Pyx_RefNannyFinishContext();
17443 static PyObject *__pyx_pw_8PyClical_75random_clifford(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17444 static char __pyx_doc_8PyClical_74random_clifford[] =
"\n Random multivector within a frame.\n\n >>> print random_clifford(index_set({-3,-1,2})).frame()\n {-3,-1,2}\n ";
17445 static PyObject *__pyx_pw_8PyClical_75random_clifford(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17446 struct __pyx_obj_8PyClical_index_set *__pyx_v_ixt = 0;
17447 PyObject *__pyx_v_fill = 0;
17448 PyObject *__pyx_r = 0;
17449 __Pyx_RefNannyDeclarations
17450 __Pyx_RefNannySetupContext(
"random_clifford (wrapper)", 0);
17452 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ixt,&__pyx_n_s_fill,0};
17453 PyObject* values[2] = {0,0};
17454 values[1] = ((PyObject *)__pyx_float_1_0);
17455 if (unlikely(__pyx_kwds)) {
17456 Py_ssize_t kw_args;
17457 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17458 switch (pos_args) {
17459 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17460 CYTHON_FALLTHROUGH;
17461 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17462 CYTHON_FALLTHROUGH;
17464 default:
goto __pyx_L5_argtuple_error;
17466 kw_args = PyDict_Size(__pyx_kwds);
17467 switch (pos_args) {
17469 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ixt)) != 0)) kw_args--;
17470 else goto __pyx_L5_argtuple_error;
17471 CYTHON_FALLTHROUGH;
17474 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fill);
17475 if (value) { values[1] = value; kw_args--; }
17478 if (unlikely(kw_args > 0)) {
17479 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"random_clifford") < 0)) __PYX_ERR(0, 1815, __pyx_L3_error)
17482 switch (PyTuple_GET_SIZE(__pyx_args)) {
17483 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17484 CYTHON_FALLTHROUGH;
17485 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17487 default:
goto __pyx_L5_argtuple_error;
17490 __pyx_v_ixt = ((
struct __pyx_obj_8PyClical_index_set *)values[0]);
17491 __pyx_v_fill = values[1];
17493 goto __pyx_L4_argument_unpacking_done;
17494 __pyx_L5_argtuple_error:;
17495 __Pyx_RaiseArgtupleInvalid(
"random_clifford", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1815, __pyx_L3_error)
17497 __Pyx_AddTraceback(
"PyClical.random_clifford", __pyx_clineno, __pyx_lineno, __pyx_filename);
17498 __Pyx_RefNannyFinishContext();
17500 __pyx_L4_argument_unpacking_done:;
17501 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ixt), __pyx_ptype_8PyClical_index_set, 1,
"ixt", 0))) __PYX_ERR(0, 1815, __pyx_L1_error)
17502 __pyx_r = __pyx_pf_8PyClical_74random_clifford(__pyx_self, __pyx_v_ixt, __pyx_v_fill);
17509 __Pyx_RefNannyFinishContext();
17513 static PyObject *__pyx_pf_8PyClical_74random_clifford(CYTHON_UNUSED PyObject *__pyx_self,
struct __pyx_obj_8PyClical_index_set *__pyx_v_ixt, PyObject *__pyx_v_fill) {
17514 PyObject *__pyx_r = NULL;
17515 __Pyx_RefNannyDeclarations
17516 PyObject *__pyx_t_1 = NULL;
17517 struct __pyx_opt_args_8PyClical_random_clifford __pyx_t_2;
17518 __Pyx_RefNannySetupContext(
"random_clifford", 0);
17519 __Pyx_XDECREF(__pyx_r);
17520 __pyx_t_2.__pyx_n = 1;
17521 __pyx_t_2.fill = __pyx_v_fill;
17522 __pyx_t_1 = __pyx_f_8PyClical_random_clifford(__pyx_v_ixt, 0, &__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1815, __pyx_L1_error)
17523 __Pyx_GOTREF(__pyx_t_1);
17524 __pyx_r = __pyx_t_1;
17530 __Pyx_XDECREF(__pyx_t_1);
17531 __Pyx_AddTraceback(
"PyClical.random_clifford", __pyx_clineno, __pyx_lineno, __pyx_filename);
17534 __Pyx_XGIVEREF(__pyx_r);
17535 __Pyx_RefNannyFinishContext();
17547 static PyObject *__pyx_pw_8PyClical_77cga3(PyObject *__pyx_self, PyObject *__pyx_v_obj);
17548 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cga3(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
17549 PyObject *__pyx_r = NULL;
17550 __Pyx_RefNannyDeclarations
17551 PyObject *__pyx_t_1 = NULL;
17552 PyObject *__pyx_t_2 = NULL;
17553 __Pyx_RefNannySetupContext(
"cga3", 0);
17562 __Pyx_XDECREF(__pyx_r);
17563 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1831, __pyx_L1_error)
17564 __Pyx_GOTREF(__pyx_t_1);
17565 __pyx_t_2 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_1),
cga3::cga3(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1831, __pyx_L1_error)
17566 __Pyx_GOTREF(__pyx_t_2);
17567 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17568 __pyx_r = __pyx_t_2;
17582 __Pyx_XDECREF(__pyx_t_1);
17583 __Pyx_XDECREF(__pyx_t_2);
17584 __Pyx_AddTraceback(
"PyClical.cga3", __pyx_clineno, __pyx_lineno, __pyx_filename);
17587 __Pyx_XGIVEREF(__pyx_r);
17588 __Pyx_RefNannyFinishContext();
17593 static PyObject *__pyx_pw_8PyClical_77cga3(PyObject *__pyx_self, PyObject *__pyx_v_obj);
17594 static char __pyx_doc_8PyClical_76cga3[] =
"\n Convert Euclidean 3D multivector to Conformal Geometric Algebra using Doran and Lasenby definition.\n\n >>> x=clifford(\"2{1}+9{2}+{3}\"); print cga3(x)\n 87{-1}+4{1}+18{2}+2{3}+85{4}\n ";
17595 static PyObject *__pyx_pw_8PyClical_77cga3(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
17596 PyObject *__pyx_r = 0;
17597 __Pyx_RefNannyDeclarations
17598 __Pyx_RefNannySetupContext(
"cga3 (wrapper)", 0);
17599 __pyx_r = __pyx_pf_8PyClical_76cga3(__pyx_self, ((PyObject *)__pyx_v_obj));
17602 __Pyx_RefNannyFinishContext();
17606 static PyObject *__pyx_pf_8PyClical_76cga3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
17607 PyObject *__pyx_r = NULL;
17608 __Pyx_RefNannyDeclarations
17609 PyObject *__pyx_t_1 = NULL;
17610 __Pyx_RefNannySetupContext(
"cga3", 0);
17611 __Pyx_XDECREF(__pyx_r);
17612 __pyx_t_1 = __pyx_f_8PyClical_cga3(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1824, __pyx_L1_error)
17613 __Pyx_GOTREF(__pyx_t_1);
17614 __pyx_r = __pyx_t_1;
17620 __Pyx_XDECREF(__pyx_t_1);
17621 __Pyx_AddTraceback(
"PyClical.cga3", __pyx_clineno, __pyx_lineno, __pyx_filename);
17624 __Pyx_XGIVEREF(__pyx_r);
17625 __Pyx_RefNannyFinishContext();
17637 static PyObject *__pyx_pw_8PyClical_79cga3std(PyObject *__pyx_self, PyObject *__pyx_v_obj);
17638 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cga3std(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
17639 PyObject *__pyx_r = NULL;
17640 __Pyx_RefNannyDeclarations
17641 PyObject *__pyx_t_1 = NULL;
17642 PyObject *__pyx_t_2 = NULL;
17643 __Pyx_RefNannySetupContext(
"cga3std", 0);
17652 __Pyx_XDECREF(__pyx_r);
17653 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1842, __pyx_L1_error)
17654 __Pyx_GOTREF(__pyx_t_1);
17655 __pyx_t_2 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_1),
cga3::cga3std(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1842, __pyx_L1_error)
17656 __Pyx_GOTREF(__pyx_t_2);
17657 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17658 __pyx_r = __pyx_t_2;
17672 __Pyx_XDECREF(__pyx_t_1);
17673 __Pyx_XDECREF(__pyx_t_2);
17674 __Pyx_AddTraceback(
"PyClical.cga3std", __pyx_clineno, __pyx_lineno, __pyx_filename);
17677 __Pyx_XGIVEREF(__pyx_r);
17678 __Pyx_RefNannyFinishContext();
17683 static PyObject *__pyx_pw_8PyClical_79cga3std(PyObject *__pyx_self, PyObject *__pyx_v_obj);
17684 static char __pyx_doc_8PyClical_78cga3std[] =
"\n Convert CGA3 null vector to standard conformal null vector using Doran and Lasenby definition.\n\n >>> x=clifford(\"2{1}+9{2}+{3}\"); print cga3std(cga3(x))\n 87{-1}+4{1}+18{2}+2{3}+85{4}\n >>> x=clifford(\"2{1}+9{2}+{3}\"); print cga3std(cga3(x))-cga3(x)\n 0\n ";
17685 static PyObject *__pyx_pw_8PyClical_79cga3std(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
17686 PyObject *__pyx_r = 0;
17687 __Pyx_RefNannyDeclarations
17688 __Pyx_RefNannySetupContext(
"cga3std (wrapper)", 0);
17689 __pyx_r = __pyx_pf_8PyClical_78cga3std(__pyx_self, ((PyObject *)__pyx_v_obj));
17692 __Pyx_RefNannyFinishContext();
17696 static PyObject *__pyx_pf_8PyClical_78cga3std(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
17697 PyObject *__pyx_r = NULL;
17698 __Pyx_RefNannyDeclarations
17699 PyObject *__pyx_t_1 = NULL;
17700 __Pyx_RefNannySetupContext(
"cga3std", 0);
17701 __Pyx_XDECREF(__pyx_r);
17702 __pyx_t_1 = __pyx_f_8PyClical_cga3std(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1833, __pyx_L1_error)
17703 __Pyx_GOTREF(__pyx_t_1);
17704 __pyx_r = __pyx_t_1;
17710 __Pyx_XDECREF(__pyx_t_1);
17711 __Pyx_AddTraceback(
"PyClical.cga3std", __pyx_clineno, __pyx_lineno, __pyx_filename);
17714 __Pyx_XGIVEREF(__pyx_r);
17715 __Pyx_RefNannyFinishContext();
17727 static PyObject *__pyx_pw_8PyClical_81agc3(PyObject *__pyx_self, PyObject *__pyx_v_obj);
17728 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_agc3(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
17729 PyObject *__pyx_r = NULL;
17730 __Pyx_RefNannyDeclarations
17731 PyObject *__pyx_t_1 = NULL;
17732 PyObject *__pyx_t_2 = NULL;
17733 __Pyx_RefNannySetupContext(
"agc3", 0);
17742 __Pyx_XDECREF(__pyx_r);
17743 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1853, __pyx_L1_error)
17744 __Pyx_GOTREF(__pyx_t_1);
17745 __pyx_t_2 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_1),
cga3::agc3(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1853, __pyx_L1_error)
17746 __Pyx_GOTREF(__pyx_t_2);
17747 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17748 __pyx_r = __pyx_t_2;
17762 __Pyx_XDECREF(__pyx_t_1);
17763 __Pyx_XDECREF(__pyx_t_2);
17764 __Pyx_AddTraceback(
"PyClical.agc3", __pyx_clineno, __pyx_lineno, __pyx_filename);
17767 __Pyx_XGIVEREF(__pyx_r);
17768 __Pyx_RefNannyFinishContext();
17773 static PyObject *__pyx_pw_8PyClical_81agc3(PyObject *__pyx_self, PyObject *__pyx_v_obj);
17774 static char __pyx_doc_8PyClical_80agc3[] =
"\n Convert CGA3 null vector to Euclidean 3D vector using Doran and Lasenby definition.\n\n >>> x=clifford(\"2{1}+9{2}+{3}\"); print agc3(cga3(x))\n 2{1}+9{2}+{3}\n >>> x=clifford(\"2{1}+9{2}+{3}\"); print agc3(cga3(x))-x\n 0\n ";
17775 static PyObject *__pyx_pw_8PyClical_81agc3(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
17776 PyObject *__pyx_r = 0;
17777 __Pyx_RefNannyDeclarations
17778 __Pyx_RefNannySetupContext(
"agc3 (wrapper)", 0);
17779 __pyx_r = __pyx_pf_8PyClical_80agc3(__pyx_self, ((PyObject *)__pyx_v_obj));
17782 __Pyx_RefNannyFinishContext();
17786 static PyObject *__pyx_pf_8PyClical_80agc3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
17787 PyObject *__pyx_r = NULL;
17788 __Pyx_RefNannyDeclarations
17789 PyObject *__pyx_t_1 = NULL;
17790 __Pyx_RefNannySetupContext(
"agc3", 0);
17791 __Pyx_XDECREF(__pyx_r);
17792 __pyx_t_1 = __pyx_f_8PyClical_agc3(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1844, __pyx_L1_error)
17793 __Pyx_GOTREF(__pyx_t_1);
17794 __pyx_r = __pyx_t_1;
17800 __Pyx_XDECREF(__pyx_t_1);
17801 __Pyx_AddTraceback(
"PyClical.agc3", __pyx_clineno, __pyx_lineno, __pyx_filename);
17804 __Pyx_XGIVEREF(__pyx_r);
17805 __Pyx_RefNannyFinishContext();
17818 static PyObject *__pyx_pw_8PyClical_83e(PyObject *__pyx_self, PyObject *__pyx_v_obj);
17819 static char __pyx_doc_8PyClical_82e[] =
"\n Abbreviation for clifford(index_set(obj)).\n\n >>> print e(1)\n {1}\n >>> print e(-1)\n {-1}\n >>> print e(0)\n 1\n ";
17820 static PyMethodDef __pyx_mdef_8PyClical_83e = {
"e", (PyCFunction)__pyx_pw_8PyClical_83e, METH_O, __pyx_doc_8PyClical_82e};
17821 static PyObject *__pyx_pw_8PyClical_83e(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
17822 PyObject *__pyx_r = 0;
17823 __Pyx_RefNannyDeclarations
17824 __Pyx_RefNannySetupContext(
"e (wrapper)", 0);
17825 __pyx_r = __pyx_pf_8PyClical_82e(__pyx_self, ((PyObject *)__pyx_v_obj));
17828 __Pyx_RefNannyFinishContext();
17832 static PyObject *__pyx_pf_8PyClical_82e(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
17833 PyObject *__pyx_r = NULL;
17834 __Pyx_RefNannyDeclarations
17835 PyObject *__pyx_t_1 = NULL;
17836 PyObject *__pyx_t_2 = NULL;
17837 __Pyx_RefNannySetupContext(
"e", 0);
17846 __Pyx_XDECREF(__pyx_r);
17847 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_index_set), __pyx_v_obj);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1898, __pyx_L1_error)
17848 __Pyx_GOTREF(__pyx_t_1);
17849 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1898, __pyx_L1_error)
17850 __Pyx_GOTREF(__pyx_t_2);
17851 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17852 __pyx_r = __pyx_t_2;
17866 __Pyx_XDECREF(__pyx_t_1);
17867 __Pyx_XDECREF(__pyx_t_2);
17868 __Pyx_AddTraceback(
"PyClical.e", __pyx_clineno, __pyx_lineno, __pyx_filename);
17871 __Pyx_XGIVEREF(__pyx_r);
17872 __Pyx_RefNannyFinishContext();
17885 static PyObject *__pyx_pw_8PyClical_85istpq(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17886 static char __pyx_doc_8PyClical_84istpq[] =
"\n Abbreviation for index_set({-q,...p}).\n\n >>> print istpq(2,3)\n {-3,-2,-1,1,2}\n ";
17887 static PyMethodDef __pyx_mdef_8PyClical_85istpq = {
"istpq", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_85istpq, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_84istpq};
17888 static PyObject *__pyx_pw_8PyClical_85istpq(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17889 PyObject *__pyx_v_p = 0;
17890 PyObject *__pyx_v_q = 0;
17891 PyObject *__pyx_r = 0;
17892 __Pyx_RefNannyDeclarations
17893 __Pyx_RefNannySetupContext(
"istpq (wrapper)", 0);
17895 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,&__pyx_n_s_q,0};
17896 PyObject* values[2] = {0,0};
17897 if (unlikely(__pyx_kwds)) {
17898 Py_ssize_t kw_args;
17899 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17900 switch (pos_args) {
17901 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17902 CYTHON_FALLTHROUGH;
17903 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17904 CYTHON_FALLTHROUGH;
17906 default:
goto __pyx_L5_argtuple_error;
17908 kw_args = PyDict_Size(__pyx_kwds);
17909 switch (pos_args) {
17911 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p)) != 0)) kw_args--;
17912 else goto __pyx_L5_argtuple_error;
17913 CYTHON_FALLTHROUGH;
17915 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q)) != 0)) kw_args--;
17917 __Pyx_RaiseArgtupleInvalid(
"istpq", 1, 2, 2, 1); __PYX_ERR(0, 1900, __pyx_L3_error)
17920 if (unlikely(kw_args > 0)) {
17921 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"istpq") < 0)) __PYX_ERR(0, 1900, __pyx_L3_error)
17923 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
17924 goto __pyx_L5_argtuple_error;
17926 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17927 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17929 __pyx_v_p = values[0];
17930 __pyx_v_q = values[1];
17932 goto __pyx_L4_argument_unpacking_done;
17933 __pyx_L5_argtuple_error:;
17934 __Pyx_RaiseArgtupleInvalid(
"istpq", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1900, __pyx_L3_error)
17936 __Pyx_AddTraceback(
"PyClical.istpq", __pyx_clineno, __pyx_lineno, __pyx_filename);
17937 __Pyx_RefNannyFinishContext();
17939 __pyx_L4_argument_unpacking_done:;
17940 __pyx_r = __pyx_pf_8PyClical_84istpq(__pyx_self, __pyx_v_p, __pyx_v_q);
17943 __Pyx_RefNannyFinishContext();
17947 static PyObject *__pyx_pf_8PyClical_84istpq(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_p, PyObject *__pyx_v_q) {
17948 PyObject *__pyx_r = NULL;
17949 __Pyx_RefNannyDeclarations
17950 PyObject *__pyx_t_1 = NULL;
17951 PyObject *__pyx_t_2 = NULL;
17952 PyObject *__pyx_t_3 = NULL;
17953 __Pyx_RefNannySetupContext(
"istpq", 0);
17962 __Pyx_XDECREF(__pyx_r);
17963 __pyx_t_1 = PyNumber_Negative(__pyx_v_q);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1907, __pyx_L1_error)
17964 __Pyx_GOTREF(__pyx_t_1);
17965 __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_p, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1907, __pyx_L1_error)
17966 __Pyx_GOTREF(__pyx_t_2);
17967 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1907, __pyx_L1_error)
17968 __Pyx_GOTREF(__pyx_t_3);
17969 __Pyx_GIVEREF(__pyx_t_1);
17970 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
17971 __Pyx_GIVEREF(__pyx_t_2);
17972 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
17975 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1907, __pyx_L1_error)
17976 __Pyx_GOTREF(__pyx_t_2);
17977 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17978 __pyx_t_3 = PySet_New(__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1907, __pyx_L1_error)
17979 __Pyx_GOTREF(__pyx_t_3);
17980 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17981 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_index_set), __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1907, __pyx_L1_error)
17982 __Pyx_GOTREF(__pyx_t_2);
17983 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17984 __pyx_r = __pyx_t_2;
17998 __Pyx_XDECREF(__pyx_t_1);
17999 __Pyx_XDECREF(__pyx_t_2);
18000 __Pyx_XDECREF(__pyx_t_3);
18001 __Pyx_AddTraceback(
"PyClical.istpq", __pyx_clineno, __pyx_lineno, __pyx_filename);
18004 __Pyx_XGIVEREF(__pyx_r);
18005 __Pyx_RefNannyFinishContext();
18018 static PyObject *__pyx_pw_8PyClical_87_test(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused);
18019 static PyMethodDef __pyx_mdef_8PyClical_87_test = {
"_test", (PyCFunction)__pyx_pw_8PyClical_87_test, METH_NOARGS, 0};
18020 static PyObject *__pyx_pw_8PyClical_87_test(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
18021 PyObject *__pyx_r = 0;
18022 __Pyx_RefNannyDeclarations
18023 __Pyx_RefNannySetupContext(
"_test (wrapper)", 0);
18024 __pyx_r = __pyx_pf_8PyClical_86_test(__pyx_self);
18027 __Pyx_RefNannyFinishContext();
18031 static PyObject *__pyx_pf_8PyClical_86_test(CYTHON_UNUSED PyObject *__pyx_self) {
18032 PyObject *__pyx_v_PyClical = NULL;
18033 PyObject *__pyx_v_doctest = NULL;
18034 PyObject *__pyx_r = NULL;
18035 __Pyx_RefNannyDeclarations
18036 PyObject *__pyx_t_1 = NULL;
18037 PyObject *__pyx_t_2 = NULL;
18038 PyObject *__pyx_t_3 = NULL;
18039 __Pyx_RefNannySetupContext(
"_test", 0);
18048 __pyx_t_1 = __Pyx_Import(__pyx_n_s_PyClical, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1914, __pyx_L1_error)
18049 __Pyx_GOTREF(__pyx_t_1);
18050 __pyx_v_PyClical = __pyx_t_1;
18052 __pyx_t_1 = __Pyx_Import(__pyx_n_s_doctest, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1914, __pyx_L1_error)
18053 __Pyx_GOTREF(__pyx_t_1);
18054 __pyx_v_doctest = __pyx_t_1;
18064 __Pyx_XDECREF(__pyx_r);
18065 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_doctest, __pyx_n_s_testmod);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1915, __pyx_L1_error)
18066 __Pyx_GOTREF(__pyx_t_2);
18068 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
18069 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
18070 if (likely(__pyx_t_3)) {
18071 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
18072 __Pyx_INCREF(__pyx_t_3);
18073 __Pyx_INCREF(
function);
18074 __Pyx_DECREF_SET(__pyx_t_2,
function);
18077 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_PyClical) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_PyClical);
18078 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18079 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1915, __pyx_L1_error)
18080 __Pyx_GOTREF(__pyx_t_1);
18081 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18082 __pyx_r = __pyx_t_1;
18096 __Pyx_XDECREF(__pyx_t_1);
18097 __Pyx_XDECREF(__pyx_t_2);
18098 __Pyx_XDECREF(__pyx_t_3);
18099 __Pyx_AddTraceback(
"PyClical._test", __pyx_clineno, __pyx_lineno, __pyx_filename);
18102 __Pyx_XDECREF(__pyx_v_PyClical);
18103 __Pyx_XDECREF(__pyx_v_doctest);
18104 __Pyx_XGIVEREF(__pyx_r);
18105 __Pyx_RefNannyFinishContext();
18108 static struct __pyx_vtabstruct_8PyClical_index_set __pyx_vtable_8PyClical_index_set;
18110 static PyObject *__pyx_tp_new_8PyClical_index_set(PyTypeObject *t, PyObject *a, PyObject *k) {
18111 struct __pyx_obj_8PyClical_index_set *p;
18113 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
18114 o = (*t->tp_alloc)(t, 0);
18116 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
18118 if (unlikely(!o))
return 0;
18119 p = ((
struct __pyx_obj_8PyClical_index_set *)o);
18120 p->__pyx_vtab = __pyx_vtabptr_8PyClical_index_set;
18121 if (unlikely(__pyx_pw_8PyClical_9index_set_3__cinit__(o, a, k) < 0))
goto bad;
18124 Py_DECREF(o); o = 0;
18128 static void __pyx_tp_dealloc_8PyClical_index_set(PyObject *o) {
18129 #if CYTHON_USE_TP_FINALIZE 18130 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
18131 if (PyObject_CallFinalizerFromDealloc(o))
return;
18135 PyObject *etype, *eval, *etb;
18136 PyErr_Fetch(&etype, &eval, &etb);
18138 __pyx_pw_8PyClical_9index_set_5__dealloc__(o);
18140 PyErr_Restore(etype, eval, etb);
18142 (*Py_TYPE(o)->tp_free)(o);
18144 static PyObject *__pyx_sq_item_8PyClical_index_set(PyObject *o, Py_ssize_t
i) {
18146 PyObject *x = PyInt_FromSsize_t(
i);
if(!x)
return 0;
18147 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
18152 static int __pyx_mp_ass_subscript_8PyClical_index_set(PyObject *o, PyObject *
i, PyObject *v) {
18154 return __pyx_pw_8PyClical_9index_set_9__setitem__(o,
i, v);
18157 PyErr_Format(PyExc_NotImplementedError,
18158 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
18163 static PyMethodDef __pyx_methods_8PyClical_index_set[] = {
18164 {
"copy", (PyCFunction)__pyx_pw_8PyClical_9index_set_1copy, METH_NOARGS, __pyx_doc_8PyClical_9index_set_copy},
18165 {
"count", (PyCFunction)__pyx_pw_8PyClical_9index_set_32count, METH_NOARGS, __pyx_doc_8PyClical_9index_set_31count},
18166 {
"count_neg", (PyCFunction)__pyx_pw_8PyClical_9index_set_34count_neg, METH_NOARGS, __pyx_doc_8PyClical_9index_set_33count_neg},
18167 {
"count_pos", (PyCFunction)__pyx_pw_8PyClical_9index_set_36count_pos, METH_NOARGS, __pyx_doc_8PyClical_9index_set_35count_pos},
18168 {
"min", (PyCFunction)__pyx_pw_8PyClical_9index_set_38min, METH_NOARGS, __pyx_doc_8PyClical_9index_set_37min},
18169 {
"max", (PyCFunction)__pyx_pw_8PyClical_9index_set_40max, METH_NOARGS, __pyx_doc_8PyClical_9index_set_39max},
18170 {
"hash_fn", (PyCFunction)__pyx_pw_8PyClical_9index_set_42hash_fn, METH_NOARGS, __pyx_doc_8PyClical_9index_set_41hash_fn},
18171 {
"sign_of_mult", (PyCFunction)__pyx_pw_8PyClical_9index_set_44sign_of_mult, METH_O, __pyx_doc_8PyClical_9index_set_43sign_of_mult},
18172 {
"sign_of_square", (PyCFunction)__pyx_pw_8PyClical_9index_set_46sign_of_square, METH_NOARGS, __pyx_doc_8PyClical_9index_set_45sign_of_square},
18173 {
"__reduce_cython__", (PyCFunction)__pyx_pw_8PyClical_9index_set_52__reduce_cython__, METH_NOARGS, 0},
18174 {
"__setstate_cython__", (PyCFunction)__pyx_pw_8PyClical_9index_set_54__setstate_cython__, METH_O, 0},
18178 static PyNumberMethods __pyx_tp_as_number_index_set = {
18182 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18192 __pyx_pw_8PyClical_9index_set_18__invert__,
18195 __pyx_pw_8PyClical_9index_set_24__and__,
18196 __pyx_pw_8PyClical_9index_set_20__xor__,
18197 __pyx_pw_8PyClical_9index_set_28__or__,
18198 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18202 #if PY_MAJOR_VERSION < 3 18208 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18211 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18217 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18224 __pyx_pw_8PyClical_9index_set_26__iand__,
18225 __pyx_pw_8PyClical_9index_set_22__ixor__,
18226 __pyx_pw_8PyClical_9index_set_30__ior__,
18232 #if PY_VERSION_HEX >= 0x03050000 18235 #if PY_VERSION_HEX >= 0x03050000 18240 static PySequenceMethods __pyx_tp_as_sequence_index_set = {
18244 __pyx_sq_item_8PyClical_index_set,
18248 __pyx_pw_8PyClical_9index_set_13__contains__,
18253 static PyMappingMethods __pyx_tp_as_mapping_index_set = {
18255 __pyx_pw_8PyClical_9index_set_11__getitem__,
18256 __pyx_mp_ass_subscript_8PyClical_index_set,
18259 static PyTypeObject __pyx_type_8PyClical_index_set = {
18260 PyVarObject_HEAD_INIT(0, 0)
18261 "PyClical.index_set",
18262 sizeof(
struct __pyx_obj_8PyClical_index_set),
18264 __pyx_tp_dealloc_8PyClical_index_set,
18268 #if PY_MAJOR_VERSION < 3
18271 #if PY_MAJOR_VERSION >= 3
18274 __pyx_pw_8PyClical_9index_set_48__repr__,
18275 &__pyx_tp_as_number_index_set,
18276 &__pyx_tp_as_sequence_index_set,
18277 &__pyx_tp_as_mapping_index_set,
18280 __pyx_pw_8PyClical_9index_set_50__str__,
18284 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
18285 "\n Python class index_set wraps C++ class IndexSet.\n ",
18288 __pyx_pw_8PyClical_9index_set_7__richcmp__,
18290 __pyx_pw_8PyClical_9index_set_15__iter__,
18292 __pyx_methods_8PyClical_index_set,
18302 __pyx_tp_new_8PyClical_index_set,
18312 #if PY_VERSION_HEX >= 0x030400a1 18316 static struct __pyx_vtabstruct_8PyClical_clifford __pyx_vtable_8PyClical_clifford;
18318 static PyObject *__pyx_tp_new_8PyClical_clifford(PyTypeObject *t, PyObject *a, PyObject *k) {
18319 struct __pyx_obj_8PyClical_clifford *p;
18321 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
18322 o = (*t->tp_alloc)(t, 0);
18324 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
18326 if (unlikely(!o))
return 0;
18327 p = ((
struct __pyx_obj_8PyClical_clifford *)o);
18328 p->__pyx_vtab = __pyx_vtabptr_8PyClical_clifford;
18329 if (unlikely(__pyx_pw_8PyClical_8clifford_3__cinit__(o, a, k) < 0))
goto bad;
18332 Py_DECREF(o); o = 0;
18336 static void __pyx_tp_dealloc_8PyClical_clifford(PyObject *o) {
18337 #if CYTHON_USE_TP_FINALIZE 18338 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
18339 if (PyObject_CallFinalizerFromDealloc(o))
return;
18343 PyObject *etype, *eval, *etb;
18344 PyErr_Fetch(&etype, &eval, &etb);
18346 __pyx_pw_8PyClical_8clifford_5__dealloc__(o);
18348 PyErr_Restore(etype, eval, etb);
18350 (*Py_TYPE(o)->tp_free)(o);
18352 static PyObject *__pyx_sq_item_8PyClical_clifford(PyObject *o, Py_ssize_t
i) {
18354 PyObject *x = PyInt_FromSsize_t(
i);
if(!x)
return 0;
18355 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
18360 static PyMethodDef __pyx_methods_8PyClical_clifford[] = {
18361 {
"copy", (PyCFunction)__pyx_pw_8PyClical_8clifford_1copy, METH_NOARGS, __pyx_doc_8PyClical_8clifford_copy},
18362 {
"reframe", (PyCFunction)__pyx_pw_8PyClical_8clifford_11reframe, METH_O, __pyx_doc_8PyClical_8clifford_10reframe},
18363 {
"inv", (PyCFunction)__pyx_pw_8PyClical_8clifford_49inv, METH_NOARGS, __pyx_doc_8PyClical_8clifford_48inv},
18364 {
"pow", (PyCFunction)__pyx_pw_8PyClical_8clifford_57pow, METH_O, __pyx_doc_8PyClical_8clifford_56pow},
18365 {
"outer_pow", (PyCFunction)__pyx_pw_8PyClical_8clifford_59outer_pow, METH_O, __pyx_doc_8PyClical_8clifford_58outer_pow},
18366 {
"scalar", (PyCFunction)__pyx_pw_8PyClical_8clifford_63scalar, METH_NOARGS, __pyx_doc_8PyClical_8clifford_62scalar},
18367 {
"pure", (PyCFunction)__pyx_pw_8PyClical_8clifford_65pure, METH_NOARGS, __pyx_doc_8PyClical_8clifford_64pure},
18368 {
"even", (PyCFunction)__pyx_pw_8PyClical_8clifford_67even, METH_NOARGS, __pyx_doc_8PyClical_8clifford_66even},
18369 {
"odd", (PyCFunction)__pyx_pw_8PyClical_8clifford_69odd, METH_NOARGS, __pyx_doc_8PyClical_8clifford_68odd},
18370 {
"vector_part", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_8clifford_71vector_part, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_8clifford_70vector_part},
18371 {
"involute", (PyCFunction)__pyx_pw_8PyClical_8clifford_73involute, METH_NOARGS, __pyx_doc_8PyClical_8clifford_72involute},
18372 {
"reverse", (PyCFunction)__pyx_pw_8PyClical_8clifford_75reverse, METH_NOARGS, __pyx_doc_8PyClical_8clifford_74reverse},
18373 {
"conj", (PyCFunction)__pyx_pw_8PyClical_8clifford_77conj, METH_NOARGS, __pyx_doc_8PyClical_8clifford_76conj},
18374 {
"quad", (PyCFunction)__pyx_pw_8PyClical_8clifford_79quad, METH_NOARGS, __pyx_doc_8PyClical_8clifford_78quad},
18375 {
"norm", (PyCFunction)__pyx_pw_8PyClical_8clifford_81norm, METH_NOARGS, __pyx_doc_8PyClical_8clifford_80norm},
18376 {
"abs", (PyCFunction)__pyx_pw_8PyClical_8clifford_83abs, METH_NOARGS, __pyx_doc_8PyClical_8clifford_82abs},
18377 {
"max_abs", (PyCFunction)__pyx_pw_8PyClical_8clifford_85max_abs, METH_NOARGS, __pyx_doc_8PyClical_8clifford_84max_abs},
18378 {
"truncated", (PyCFunction)__pyx_pw_8PyClical_8clifford_87truncated, METH_O, __pyx_doc_8PyClical_8clifford_86truncated},
18379 {
"isnan", (PyCFunction)__pyx_pw_8PyClical_8clifford_89isnan, METH_NOARGS, __pyx_doc_8PyClical_8clifford_88isnan},
18380 {
"frame", (PyCFunction)__pyx_pw_8PyClical_8clifford_91frame, METH_NOARGS, __pyx_doc_8PyClical_8clifford_90frame},
18381 {
"__reduce_cython__", (PyCFunction)__pyx_pw_8PyClical_8clifford_97__reduce_cython__, METH_NOARGS, 0},
18382 {
"__setstate_cython__", (PyCFunction)__pyx_pw_8PyClical_8clifford_99__setstate_cython__, METH_O, 0},
18386 static PyNumberMethods __pyx_tp_as_number_clifford = {
18387 __pyx_pw_8PyClical_8clifford_21__add__,
18388 __pyx_pw_8PyClical_8clifford_25__sub__,
18389 __pyx_pw_8PyClical_8clifford_29__mul__,
18390 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18391 __pyx_pw_8PyClical_8clifford_45__div__,
18393 __pyx_pw_8PyClical_8clifford_33__mod__,
18395 __pyx_pw_8PyClical_8clifford_55__pow__,
18396 __pyx_pw_8PyClical_8clifford_17__neg__,
18397 __pyx_pw_8PyClical_8clifford_19__pos__,
18403 __pyx_pw_8PyClical_8clifford_37__and__,
18404 __pyx_pw_8PyClical_8clifford_41__xor__,
18405 __pyx_pw_8PyClical_8clifford_51__or__,
18406 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18410 #if PY_MAJOR_VERSION < 3 18416 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18419 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18422 __pyx_pw_8PyClical_8clifford_23__iadd__,
18423 __pyx_pw_8PyClical_8clifford_27__isub__,
18424 __pyx_pw_8PyClical_8clifford_31__imul__,
18425 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18426 __pyx_pw_8PyClical_8clifford_47__idiv__,
18428 __pyx_pw_8PyClical_8clifford_35__imod__,
18432 __pyx_pw_8PyClical_8clifford_39__iand__,
18433 __pyx_pw_8PyClical_8clifford_43__ixor__,
18434 __pyx_pw_8PyClical_8clifford_53__ior__,
18440 #if PY_VERSION_HEX >= 0x03050000 18443 #if PY_VERSION_HEX >= 0x03050000 18448 static PySequenceMethods __pyx_tp_as_sequence_clifford = {
18452 __pyx_sq_item_8PyClical_clifford,
18456 __pyx_pw_8PyClical_8clifford_7__contains__,
18461 static PyMappingMethods __pyx_tp_as_mapping_clifford = {
18463 __pyx_pw_8PyClical_8clifford_15__getitem__,
18467 static PyTypeObject __pyx_type_8PyClical_clifford = {
18468 PyVarObject_HEAD_INIT(0, 0)
18469 "PyClical.clifford",
18470 sizeof(
struct __pyx_obj_8PyClical_clifford),
18472 __pyx_tp_dealloc_8PyClical_clifford,
18476 #if PY_MAJOR_VERSION < 3
18479 #if PY_MAJOR_VERSION >= 3
18482 __pyx_pw_8PyClical_8clifford_93__repr__,
18483 &__pyx_tp_as_number_clifford,
18484 &__pyx_tp_as_sequence_clifford,
18485 &__pyx_tp_as_mapping_clifford,
18487 __pyx_pw_8PyClical_8clifford_61__call__,
18488 __pyx_pw_8PyClical_8clifford_95__str__,
18492 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
18493 "\n Python class clifford wraps C++ class Clifford.\n ",
18496 __pyx_pw_8PyClical_8clifford_13__richcmp__,
18498 __pyx_pw_8PyClical_8clifford_9__iter__,
18500 __pyx_methods_8PyClical_clifford,
18510 __pyx_tp_new_8PyClical_clifford,
18520 #if PY_VERSION_HEX >= 0x030400a1 18525 static struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *__pyx_freelist_8PyClical___pyx_scope_struct____iter__[8];
18526 static int __pyx_freecount_8PyClical___pyx_scope_struct____iter__ = 0;
18528 static PyObject *__pyx_tp_new_8PyClical___pyx_scope_struct____iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
18530 if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_8PyClical___pyx_scope_struct____iter__ > 0) & (t->tp_basicsize ==
sizeof(
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__)))) {
18531 o = (PyObject*)__pyx_freelist_8PyClical___pyx_scope_struct____iter__[--__pyx_freecount_8PyClical___pyx_scope_struct____iter__];
18532 memset(o, 0,
sizeof(
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__));
18533 (void) PyObject_INIT(o, t);
18534 PyObject_GC_Track(o);
18536 o = (*t->tp_alloc)(t, 0);
18537 if (unlikely(!o))
return 0;
18542 static void __pyx_tp_dealloc_8PyClical___pyx_scope_struct____iter__(PyObject *o) {
18543 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *p = (
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)o;
18544 PyObject_GC_UnTrack(o);
18545 Py_CLEAR(p->__pyx_v_idx);
18546 Py_CLEAR(p->__pyx_v_self);
18547 Py_CLEAR(p->__pyx_t_0);
18548 if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_8PyClical___pyx_scope_struct____iter__ < 8) & (Py_TYPE(o)->tp_basicsize ==
sizeof(
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__)))) {
18549 __pyx_freelist_8PyClical___pyx_scope_struct____iter__[__pyx_freecount_8PyClical___pyx_scope_struct____iter__++] = ((
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)o);
18551 (*Py_TYPE(o)->tp_free)(o);
18555 static int __pyx_tp_traverse_8PyClical___pyx_scope_struct____iter__(PyObject *o, visitproc v,
void *a) {
18557 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *p = (
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)o;
18558 if (p->__pyx_v_idx) {
18559 e = (*v)(p->__pyx_v_idx, a);
if (
e)
return e;
18561 if (p->__pyx_v_self) {
18562 e = (*v)(((PyObject *)p->__pyx_v_self), a);
if (
e)
return e;
18564 if (p->__pyx_t_0) {
18565 e = (*v)(p->__pyx_t_0, a);
if (
e)
return e;
18570 static PyTypeObject __pyx_type_8PyClical___pyx_scope_struct____iter__ = {
18571 PyVarObject_HEAD_INIT(0, 0)
18572 "PyClical.__pyx_scope_struct____iter__",
18573 sizeof(
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__),
18575 __pyx_tp_dealloc_8PyClical___pyx_scope_struct____iter__,
18579 #if PY_MAJOR_VERSION < 3
18582 #if PY_MAJOR_VERSION >= 3
18595 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
18597 __pyx_tp_traverse_8PyClical___pyx_scope_struct____iter__,
18613 __pyx_tp_new_8PyClical___pyx_scope_struct____iter__,
18623 #if PY_VERSION_HEX >= 0x030400a1 18628 static PyMethodDef __pyx_methods[] = {
18629 {
"compare", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_3compare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_2compare},
18630 {
"min_neg", (PyCFunction)__pyx_pw_8PyClical_5min_neg, METH_O, __pyx_doc_8PyClical_4min_neg},
18631 {
"max_pos", (PyCFunction)__pyx_pw_8PyClical_7max_pos, METH_O, __pyx_doc_8PyClical_6max_pos},
18632 {
"inv", (PyCFunction)__pyx_pw_8PyClical_11inv, METH_O, __pyx_doc_8PyClical_10inv},
18633 {
"scalar", (PyCFunction)__pyx_pw_8PyClical_13scalar, METH_O, __pyx_doc_8PyClical_12scalar},
18634 {
"real", (PyCFunction)__pyx_pw_8PyClical_15real, METH_O, __pyx_doc_8PyClical_14real},
18635 {
"imag", (PyCFunction)__pyx_pw_8PyClical_17imag, METH_O, __pyx_doc_8PyClical_16imag},
18636 {
"pure", (PyCFunction)__pyx_pw_8PyClical_19pure, METH_O, __pyx_doc_8PyClical_18pure},
18637 {
"even", (PyCFunction)__pyx_pw_8PyClical_21even, METH_O, __pyx_doc_8PyClical_20even},
18638 {
"odd", (PyCFunction)__pyx_pw_8PyClical_23odd, METH_O, __pyx_doc_8PyClical_22odd},
18639 {
"involute", (PyCFunction)__pyx_pw_8PyClical_25involute, METH_O, __pyx_doc_8PyClical_24involute},
18640 {
"reverse", (PyCFunction)__pyx_pw_8PyClical_27reverse, METH_O, __pyx_doc_8PyClical_26reverse},
18641 {
"conj", (PyCFunction)__pyx_pw_8PyClical_29conj, METH_O, __pyx_doc_8PyClical_28conj},
18642 {
"quad", (PyCFunction)__pyx_pw_8PyClical_31quad, METH_O, __pyx_doc_8PyClical_30quad},
18643 {
"norm", (PyCFunction)__pyx_pw_8PyClical_33norm, METH_O, __pyx_doc_8PyClical_32norm},
18644 {
"abs", (PyCFunction)__pyx_pw_8PyClical_35abs, METH_O, __pyx_doc_8PyClical_34abs},
18645 {
"max_abs", (PyCFunction)__pyx_pw_8PyClical_37max_abs, METH_O, __pyx_doc_8PyClical_36max_abs},
18646 {
"pow", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_39pow, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_38pow},
18647 {
"outer_pow", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_41outer_pow, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_40outer_pow},
18648 {
"complexifier", (PyCFunction)__pyx_pw_8PyClical_43complexifier, METH_O, __pyx_doc_8PyClical_42complexifier},
18649 {
"sqrt", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_45sqrt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_44sqrt},
18650 {
"exp", (PyCFunction)__pyx_pw_8PyClical_47exp, METH_O, __pyx_doc_8PyClical_46exp},
18651 {
"log", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_49log, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_48log},
18652 {
"cos", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_51cos, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_50cos},
18653 {
"acos", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_53acos, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_52acos},
18654 {
"cosh", (PyCFunction)__pyx_pw_8PyClical_55cosh, METH_O, __pyx_doc_8PyClical_54cosh},
18655 {
"acosh", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_57acosh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_56acosh},
18656 {
"sin", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_59sin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_58sin},
18657 {
"asin", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_61asin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_60asin},
18658 {
"sinh", (PyCFunction)__pyx_pw_8PyClical_63sinh, METH_O, __pyx_doc_8PyClical_62sinh},
18659 {
"asinh", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_65asinh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_64asinh},
18660 {
"tan", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_67tan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_66tan},
18661 {
"atan", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_69atan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_68atan},
18662 {
"tanh", (PyCFunction)__pyx_pw_8PyClical_71tanh, METH_O, __pyx_doc_8PyClical_70tanh},
18663 {
"atanh", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_73atanh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_72atanh},
18664 {
"random_clifford", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_75random_clifford, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_74random_clifford},
18665 {
"cga3", (PyCFunction)__pyx_pw_8PyClical_77cga3, METH_O, __pyx_doc_8PyClical_76cga3},
18666 {
"cga3std", (PyCFunction)__pyx_pw_8PyClical_79cga3std, METH_O, __pyx_doc_8PyClical_78cga3std},
18667 {
"agc3", (PyCFunction)__pyx_pw_8PyClical_81agc3, METH_O, __pyx_doc_8PyClical_80agc3},
18671 #if PY_MAJOR_VERSION >= 3 18672 #if CYTHON_PEP489_MULTI_PHASE_INIT 18673 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
18674 static int __pyx_pymod_exec_PyClical(PyObject* module);
18675 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
18676 {Py_mod_create, (
void*)__pyx_pymod_create},
18677 {Py_mod_exec, (
void*)__pyx_pymod_exec_PyClical},
18682 static struct PyModuleDef __pyx_moduledef = {
18683 PyModuleDef_HEAD_INIT,
18686 #if CYTHON_PEP489_MULTI_PHASE_INIT 18692 #if CYTHON_PEP489_MULTI_PHASE_INIT 18693 __pyx_moduledef_slots,
18702 #ifndef CYTHON_SMALL_CODE 18703 #if defined(__clang__) 18704 #define CYTHON_SMALL_CODE 18705 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) 18706 #define CYTHON_SMALL_CODE __attribute__((cold)) 18708 #define CYTHON_SMALL_CODE 18712 static __Pyx_StringTabEntry __pyx_string_tab[] = {
18713 {&__pyx_kp_s_, __pyx_k_,
sizeof(__pyx_k_), 0, 0, 1, 0},
18714 {&__pyx_kp_s_0_8_2, __pyx_k_0_8_2,
sizeof(__pyx_k_0_8_2), 0, 0, 1, 0},
18715 {&__pyx_kp_u_Abbreviation_for_clifford_index, __pyx_k_Abbreviation_for_clifford_index,
sizeof(__pyx_k_Abbreviation_for_clifford_index), 0, 1, 0, 0},
18716 {&__pyx_kp_u_Abbreviation_for_index_set_q_p, __pyx_k_Abbreviation_for_index_set_q_p,
sizeof(__pyx_k_Abbreviation_for_index_set_q_p), 0, 1, 0, 0},
18717 {&__pyx_kp_u_Absolute_value_of_multivector_m, __pyx_k_Absolute_value_of_multivector_m,
sizeof(__pyx_k_Absolute_value_of_multivector_m), 0, 1, 0, 0},
18718 {&__pyx_kp_u_Absolute_value_square_root_of_n, __pyx_k_Absolute_value_square_root_of_n,
sizeof(__pyx_k_Absolute_value_square_root_of_n), 0, 1, 0, 0},
18719 {&__pyx_kp_s_Cannot_initialize_clifford_objec, __pyx_k_Cannot_initialize_clifford_objec,
sizeof(__pyx_k_Cannot_initialize_clifford_objec), 0, 0, 1, 0},
18720 {&__pyx_kp_s_Cannot_initialize_index_set_obje, __pyx_k_Cannot_initialize_index_set_obje,
sizeof(__pyx_k_Cannot_initialize_index_set_obje), 0, 0, 1, 0},
18721 {&__pyx_kp_s_Cannot_reframe, __pyx_k_Cannot_reframe,
sizeof(__pyx_k_Cannot_reframe), 0, 0, 1, 0},
18722 {&__pyx_kp_s_Cannot_take_vector_part_of, __pyx_k_Cannot_take_vector_part_of,
sizeof(__pyx_k_Cannot_take_vector_part_of), 0, 0, 1, 0},
18723 {&__pyx_kp_u_Cardinality_Number_of_indices_i, __pyx_k_Cardinality_Number_of_indices_i,
sizeof(__pyx_k_Cardinality_Number_of_indices_i), 0, 1, 0, 0},
18724 {&__pyx_kp_u_Check_if_a_multivector_contains, __pyx_k_Check_if_a_multivector_contains,
sizeof(__pyx_k_Check_if_a_multivector_contains), 0, 1, 0, 0},
18725 {&__pyx_kp_u_Conjugation_reverse_o_involute, __pyx_k_Conjugation_reverse_o_involute,
sizeof(__pyx_k_Conjugation_reverse_o_involute), 0, 1, 0, 0},
18726 {&__pyx_kp_u_Conjugation_reverse_o_involute_2, __pyx_k_Conjugation_reverse_o_involute_2,
sizeof(__pyx_k_Conjugation_reverse_o_involute_2), 0, 1, 0, 0},
18727 {&__pyx_kp_u_Contraction_print_clifford_1_cl, __pyx_k_Contraction_print_clifford_1_cl,
sizeof(__pyx_k_Contraction_print_clifford_1_cl), 0, 1, 0, 0},
18728 {&__pyx_kp_u_Contraction_x_clifford_1_x_clif, __pyx_k_Contraction_x_clifford_1_x_clif,
sizeof(__pyx_k_Contraction_x_clifford_1_x_clif), 0, 1, 0, 0},
18729 {&__pyx_kp_u_Convert_CGA3_null_vector_to_Euc, __pyx_k_Convert_CGA3_null_vector_to_Euc,
sizeof(__pyx_k_Convert_CGA3_null_vector_to_Euc), 0, 1, 0, 0},
18730 {&__pyx_kp_u_Convert_CGA3_null_vector_to_sta, __pyx_k_Convert_CGA3_null_vector_to_sta,
sizeof(__pyx_k_Convert_CGA3_null_vector_to_sta), 0, 1, 0, 0},
18731 {&__pyx_kp_u_Convert_Euclidean_3D_multivecto, __pyx_k_Convert_Euclidean_3D_multivecto,
sizeof(__pyx_k_Convert_Euclidean_3D_multivecto), 0, 1, 0, 0},
18732 {&__pyx_kp_u_Copy_this_clifford_object_x_cli, __pyx_k_Copy_this_clifford_object_x_cli,
sizeof(__pyx_k_Copy_this_clifford_object_x_cli), 0, 1, 0, 0},
18733 {&__pyx_kp_u_Copy_this_index_set_object_s_in, __pyx_k_Copy_this_index_set_object_s_in,
sizeof(__pyx_k_Copy_this_index_set_object_s_in), 0, 1, 0, 0},
18734 {&__pyx_kp_u_Cosine_of_multivector_with_opti, __pyx_k_Cosine_of_multivector_with_opti,
sizeof(__pyx_k_Cosine_of_multivector_with_opti), 0, 1, 0, 0},
18735 {&__pyx_kp_u_Even_part_of_multivector_sum_of, __pyx_k_Even_part_of_multivector_sum_of,
sizeof(__pyx_k_Even_part_of_multivector_sum_of), 0, 1, 0, 0},
18736 {&__pyx_kp_u_Even_part_of_multivector_sum_of_2, __pyx_k_Even_part_of_multivector_sum_of_2,
sizeof(__pyx_k_Even_part_of_multivector_sum_of_2), 0, 1, 0, 0},
18737 {&__pyx_kp_u_Exponential_of_multivector_x_cl, __pyx_k_Exponential_of_multivector_x_cl,
sizeof(__pyx_k_Exponential_of_multivector_x_cl), 0, 1, 0, 0},
18738 {&__pyx_kp_u_Geometric_difference_print_clif, __pyx_k_Geometric_difference_print_clif,
sizeof(__pyx_k_Geometric_difference_print_clif), 0, 1, 0, 0},
18739 {&__pyx_kp_u_Geometric_difference_x_clifford, __pyx_k_Geometric_difference_x_clifford,
sizeof(__pyx_k_Geometric_difference_x_clifford), 0, 1, 0, 0},
18740 {&__pyx_kp_u_Geometric_multiplicative_invers, __pyx_k_Geometric_multiplicative_invers,
sizeof(__pyx_k_Geometric_multiplicative_invers), 0, 1, 0, 0},
18741 {&__pyx_kp_u_Geometric_multiplicative_invers_2, __pyx_k_Geometric_multiplicative_invers_2,
sizeof(__pyx_k_Geometric_multiplicative_invers_2), 0, 1, 0, 0},
18742 {&__pyx_kp_u_Geometric_product_print_cliffor, __pyx_k_Geometric_product_print_cliffor,
sizeof(__pyx_k_Geometric_product_print_cliffor), 0, 1, 0, 0},
18743 {&__pyx_kp_u_Geometric_product_x_clifford_2, __pyx_k_Geometric_product_x_clifford_2,
sizeof(__pyx_k_Geometric_product_x_clifford_2), 0, 1, 0, 0},
18744 {&__pyx_kp_u_Geometric_quotient_print_cliffo, __pyx_k_Geometric_quotient_print_cliffo,
sizeof(__pyx_k_Geometric_quotient_print_cliffo), 0, 1, 0, 0},
18745 {&__pyx_kp_u_Geometric_quotient_x_clifford_1, __pyx_k_Geometric_quotient_x_clifford_1,
sizeof(__pyx_k_Geometric_quotient_x_clifford_1), 0, 1, 0, 0},
18746 {&__pyx_kp_u_Geometric_sum_print_clifford_1, __pyx_k_Geometric_sum_print_clifford_1,
sizeof(__pyx_k_Geometric_sum_print_clifford_1), 0, 1, 0, 0},
18747 {&__pyx_kp_u_Geometric_sum_x_clifford_1_x_cl, __pyx_k_Geometric_sum_x_clifford_1_x_cl,
sizeof(__pyx_k_Geometric_sum_x_clifford_1_x_cl), 0, 1, 0, 0},
18748 {&__pyx_kp_u_Get_the_value_of_an_index_set_o, __pyx_k_Get_the_value_of_an_index_set_o,
sizeof(__pyx_k_Get_the_value_of_an_index_set_o), 0, 1, 0, 0},
18749 {&__pyx_kp_u_Hyperbolic_cosine_of_multivecto, __pyx_k_Hyperbolic_cosine_of_multivecto,
sizeof(__pyx_k_Hyperbolic_cosine_of_multivecto), 0, 1, 0, 0},
18750 {&__pyx_kp_u_Hyperbolic_sine_of_multivector, __pyx_k_Hyperbolic_sine_of_multivector,
sizeof(__pyx_k_Hyperbolic_sine_of_multivector), 0, 1, 0, 0},
18751 {&__pyx_kp_u_Hyperbolic_tangent_of_multivect, __pyx_k_Hyperbolic_tangent_of_multivect,
sizeof(__pyx_k_Hyperbolic_tangent_of_multivect), 0, 1, 0, 0},
18752 {&__pyx_kp_u_Imaginary_part_deprecated_alway, __pyx_k_Imaginary_part_deprecated_alway,
sizeof(__pyx_k_Imaginary_part_deprecated_alway), 0, 1, 0, 0},
18753 {&__pyx_n_s_IndexError, __pyx_k_IndexError,
sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
18754 {&__pyx_kp_u_Inner_product_print_clifford_1, __pyx_k_Inner_product_print_clifford_1,
sizeof(__pyx_k_Inner_product_print_clifford_1), 0, 1, 0, 0},
18755 {&__pyx_kp_u_Inner_product_x_clifford_1_x_cl, __pyx_k_Inner_product_x_clifford_1_x_cl,
sizeof(__pyx_k_Inner_product_x_clifford_1_x_cl), 0, 1, 0, 0},
18756 {&__pyx_kp_u_Integer_power_of_multivector_ob, __pyx_k_Integer_power_of_multivector_ob,
sizeof(__pyx_k_Integer_power_of_multivector_ob), 0, 1, 0, 0},
18757 {&__pyx_n_s_Integral, __pyx_k_Integral,
sizeof(__pyx_k_Integral), 0, 0, 1, 1},
18758 {&__pyx_kp_u_Inverse_cosine_of_multivector_w, __pyx_k_Inverse_cosine_of_multivector_w,
sizeof(__pyx_k_Inverse_cosine_of_multivector_w), 0, 1, 0, 0},
18759 {&__pyx_kp_u_Inverse_hyperbolic_cosine_of_mu, __pyx_k_Inverse_hyperbolic_cosine_of_mu,
sizeof(__pyx_k_Inverse_hyperbolic_cosine_of_mu), 0, 1, 0, 0},
18760 {&__pyx_kp_u_Inverse_hyperbolic_sine_of_mult, __pyx_k_Inverse_hyperbolic_sine_of_mult,
sizeof(__pyx_k_Inverse_hyperbolic_sine_of_mult), 0, 1, 0, 0},
18761 {&__pyx_kp_u_Inverse_hyperbolic_tangent_of_m, __pyx_k_Inverse_hyperbolic_tangent_of_m,
sizeof(__pyx_k_Inverse_hyperbolic_tangent_of_m), 0, 1, 0, 0},
18762 {&__pyx_kp_u_Inverse_sine_of_multivector_wit, __pyx_k_Inverse_sine_of_multivector_wit,
sizeof(__pyx_k_Inverse_sine_of_multivector_wit), 0, 1, 0, 0},
18763 {&__pyx_kp_u_Inverse_tangent_of_multivector, __pyx_k_Inverse_tangent_of_multivector,
sizeof(__pyx_k_Inverse_tangent_of_multivector), 0, 1, 0, 0},
18764 {&__pyx_kp_u_Iterate_over_the_indices_of_an, __pyx_k_Iterate_over_the_indices_of_an,
sizeof(__pyx_k_Iterate_over_the_indices_of_an), 0, 1, 0, 0},
18765 {&__pyx_kp_u_Main_involution_each_i_is_repla, __pyx_k_Main_involution_each_i_is_repla,
sizeof(__pyx_k_Main_involution_each_i_is_repla), 0, 1, 0, 0},
18766 {&__pyx_kp_u_Main_involution_each_i_is_repla_2, __pyx_k_Main_involution_each_i_is_repla_2,
sizeof(__pyx_k_Main_involution_each_i_is_repla_2), 0, 1, 0, 0},
18767 {&__pyx_kp_u_Maximum_absolute_value_of_coord, __pyx_k_Maximum_absolute_value_of_coord,
sizeof(__pyx_k_Maximum_absolute_value_of_coord), 0, 1, 0, 0},
18768 {&__pyx_kp_u_Maximum_member_index_set_1_1_2, __pyx_k_Maximum_member_index_set_1_1_2,
sizeof(__pyx_k_Maximum_member_index_set_1_1_2), 0, 1, 0, 0},
18769 {&__pyx_kp_u_Maximum_of_absolute_values_of_c, __pyx_k_Maximum_of_absolute_values_of_c,
sizeof(__pyx_k_Maximum_of_absolute_values_of_c), 0, 1, 0, 0},
18770 {&__pyx_kp_u_Maximum_positive_index_or_0_if, __pyx_k_Maximum_positive_index_or_0_if,
sizeof(__pyx_k_Maximum_positive_index_or_0_if), 0, 1, 0, 0},
18771 {&__pyx_kp_u_Minimum_member_index_set_1_1_2, __pyx_k_Minimum_member_index_set_1_1_2,
sizeof(__pyx_k_Minimum_member_index_set_1_1_2), 0, 1, 0, 0},
18772 {&__pyx_kp_u_Minimum_negative_index_or_0_if, __pyx_k_Minimum_negative_index_or_0_if,
sizeof(__pyx_k_Minimum_negative_index_or_0_if), 0, 1, 0, 0},
18773 {&__pyx_kp_u_Natural_logarithm_of_multivecto, __pyx_k_Natural_logarithm_of_multivecto,
sizeof(__pyx_k_Natural_logarithm_of_multivecto), 0, 1, 0, 0},
18774 {&__pyx_kp_u_Norm_sum_of_squares_of_coordina, __pyx_k_Norm_sum_of_squares_of_coordina,
sizeof(__pyx_k_Norm_sum_of_squares_of_coordina), 0, 1, 0, 0},
18775 {&__pyx_n_s_NotImplemented, __pyx_k_NotImplemented,
sizeof(__pyx_k_NotImplemented), 0, 0, 1, 1},
18776 {&__pyx_kp_s_Not_applicable, __pyx_k_Not_applicable,
sizeof(__pyx_k_Not_applicable), 0, 0, 1, 0},
18777 {&__pyx_kp_u_Not_applicable_for_a_in_cliffor, __pyx_k_Not_applicable_for_a_in_cliffor,
sizeof(__pyx_k_Not_applicable_for_a_in_cliffor), 0, 1, 0, 0},
18778 {&__pyx_kp_u_Number_of_negative_indices_incl, __pyx_k_Number_of_negative_indices_incl,
sizeof(__pyx_k_Number_of_negative_indices_incl), 0, 1, 0, 0},
18779 {&__pyx_kp_u_Number_of_positive_indices_incl, __pyx_k_Number_of_positive_indices_incl,
sizeof(__pyx_k_Number_of_positive_indices_incl), 0, 1, 0, 0},
18780 {&__pyx_kp_u_Odd_part_of_multivector_sum_of, __pyx_k_Odd_part_of_multivector_sum_of,
sizeof(__pyx_k_Odd_part_of_multivector_sum_of), 0, 1, 0, 0},
18781 {&__pyx_kp_u_Odd_part_of_multivector_sum_of_2, __pyx_k_Odd_part_of_multivector_sum_of_2,
sizeof(__pyx_k_Odd_part_of_multivector_sum_of_2), 0, 1, 0, 0},
18782 {&__pyx_kp_u_Outer_product_power_of_multivec, __pyx_k_Outer_product_power_of_multivec,
sizeof(__pyx_k_Outer_product_power_of_multivec), 0, 1, 0, 0},
18783 {&__pyx_kp_u_Outer_product_power_x_clifford, __pyx_k_Outer_product_power_x_clifford,
sizeof(__pyx_k_Outer_product_power_x_clifford), 0, 1, 0, 0},
18784 {&__pyx_kp_u_Outer_product_print_clifford_1, __pyx_k_Outer_product_print_clifford_1,
sizeof(__pyx_k_Outer_product_print_clifford_1), 0, 1, 0, 0},
18785 {&__pyx_kp_u_Outer_product_x_clifford_1_x_cl, __pyx_k_Outer_product_x_clifford_1_x_cl,
sizeof(__pyx_k_Outer_product_x_clifford_1_x_cl), 0, 1, 0, 0},
18786 {&__pyx_kp_u_Power_self_to_the_m_x_clifford, __pyx_k_Power_self_to_the_m_x_clifford,
sizeof(__pyx_k_Power_self_to_the_m_x_clifford), 0, 1, 0, 0},
18787 {&__pyx_kp_u_Power_self_to_the_m_x_clifford_2, __pyx_k_Power_self_to_the_m_x_clifford_2,
sizeof(__pyx_k_Power_self_to_the_m_x_clifford_2), 0, 1, 0, 0},
18788 {&__pyx_kp_u_Pure_grade_vector_part_print_cl, __pyx_k_Pure_grade_vector_part_print_cl,
sizeof(__pyx_k_Pure_grade_vector_part_print_cl), 0, 1, 0, 0},
18789 {&__pyx_kp_u_Pure_part_print_clifford_1_1_1, __pyx_k_Pure_part_print_clifford_1_1_1,
sizeof(__pyx_k_Pure_part_print_clifford_1_1_1), 0, 1, 0, 0},
18790 {&__pyx_kp_u_Pure_part_print_pure_clifford_1, __pyx_k_Pure_part_print_pure_clifford_1,
sizeof(__pyx_k_Pure_part_print_pure_clifford_1), 0, 1, 0, 0},
18791 {&__pyx_kp_u_Put_self_into_a_larger_frame_co, __pyx_k_Put_self_into_a_larger_frame_co,
sizeof(__pyx_k_Put_self_into_a_larger_frame_co), 0, 1, 0, 0},
18792 {&__pyx_n_s_PyClical, __pyx_k_PyClical,
sizeof(__pyx_k_PyClical), 0, 0, 1, 1},
18793 {&__pyx_kp_s_PyClical_pyx, __pyx_k_PyClical_pyx,
sizeof(__pyx_k_PyClical_pyx), 0, 0, 1, 0},
18794 {&__pyx_kp_u_Quadratic_form_rev_x_x_0_print, __pyx_k_Quadratic_form_rev_x_x_0_print,
sizeof(__pyx_k_Quadratic_form_rev_x_x_0_print), 0, 1, 0, 0},
18795 {&__pyx_kp_u_Quadratic_form_rev_x_x_0_print_2, __pyx_k_Quadratic_form_rev_x_x_0_print_2,
sizeof(__pyx_k_Quadratic_form_rev_x_x_0_print_2), 0, 1, 0, 0},
18796 {&__pyx_kp_u_Random_multivector_within_a_fra, __pyx_k_Random_multivector_within_a_fra,
sizeof(__pyx_k_Random_multivector_within_a_fra), 0, 1, 0, 0},
18797 {&__pyx_n_s_Real, __pyx_k_Real,
sizeof(__pyx_k_Real), 0, 0, 1, 1},
18798 {&__pyx_kp_u_Real_part_synonym_for_scalar_pa, __pyx_k_Real_part_synonym_for_scalar_pa,
sizeof(__pyx_k_Real_part_synonym_for_scalar_pa), 0, 1, 0, 0},
18799 {&__pyx_kp_u_Remove_all_terms_of_self_with_r, __pyx_k_Remove_all_terms_of_self_with_r,
sizeof(__pyx_k_Remove_all_terms_of_self_with_r), 0, 1, 0, 0},
18800 {&__pyx_kp_u_Reversion_eg_1_2_2_1_print_reve, __pyx_k_Reversion_eg_1_2_2_1_print_reve,
sizeof(__pyx_k_Reversion_eg_1_2_2_1_print_reve), 0, 1, 0, 0},
18801 {&__pyx_kp_u_Reversion_eg_clifford_1_cliffor, __pyx_k_Reversion_eg_clifford_1_cliffor,
sizeof(__pyx_k_Reversion_eg_clifford_1_cliffor), 0, 1, 0, 0},
18802 {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError,
sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
18803 {&__pyx_kp_u_Scalar_part_clifford_1_1_1_2_sc, __pyx_k_Scalar_part_clifford_1_1_1_2_sc,
sizeof(__pyx_k_Scalar_part_clifford_1_1_1_2_sc), 0, 1, 0, 0},
18804 {&__pyx_kp_u_Scalar_part_scalar_clifford_1_1, __pyx_k_Scalar_part_scalar_clifford_1_1,
sizeof(__pyx_k_Scalar_part_scalar_clifford_1_1), 0, 1, 0, 0},
18805 {&__pyx_n_s_Sequence, __pyx_k_Sequence,
sizeof(__pyx_k_Sequence), 0, 0, 1, 1},
18806 {&__pyx_kp_u_Set_complement_not_print_index, __pyx_k_Set_complement_not_print_index,
sizeof(__pyx_k_Set_complement_not_print_index), 0, 1, 0, 0},
18807 {&__pyx_kp_u_Set_intersection_and_print_inde, __pyx_k_Set_intersection_and_print_inde,
sizeof(__pyx_k_Set_intersection_and_print_inde), 0, 1, 0, 0},
18808 {&__pyx_kp_u_Set_intersection_and_x_index_se, __pyx_k_Set_intersection_and_x_index_se,
sizeof(__pyx_k_Set_intersection_and_x_index_se), 0, 1, 0, 0},
18809 {&__pyx_kp_u_Set_the_value_of_an_index_set_o, __pyx_k_Set_the_value_of_an_index_set_o,
sizeof(__pyx_k_Set_the_value_of_an_index_set_o), 0, 1, 0, 0},
18810 {&__pyx_kp_u_Set_union_or_print_index_set_1, __pyx_k_Set_union_or_print_index_set_1,
sizeof(__pyx_k_Set_union_or_print_index_set_1), 0, 1, 0, 0},
18811 {&__pyx_kp_u_Set_union_or_x_index_set_1_x_in, __pyx_k_Set_union_or_x_index_set_1_x_in,
sizeof(__pyx_k_Set_union_or_x_index_set_1_x_in), 0, 1, 0, 0},
18812 {&__pyx_kp_u_Sign_of_geometric_product_of_tw, __pyx_k_Sign_of_geometric_product_of_tw,
sizeof(__pyx_k_Sign_of_geometric_product_of_tw), 0, 1, 0, 0},
18813 {&__pyx_kp_u_Sign_of_geometric_square_of_a_C, __pyx_k_Sign_of_geometric_square_of_a_C,
sizeof(__pyx_k_Sign_of_geometric_square_of_a_C), 0, 1, 0, 0},
18814 {&__pyx_kp_u_Sine_of_multivector_with_option, __pyx_k_Sine_of_multivector_with_option,
sizeof(__pyx_k_Sine_of_multivector_with_option), 0, 1, 0, 0},
18815 {&__pyx_kp_u_Square_root_of_1_which_commutes, __pyx_k_Square_root_of_1_which_commutes,
sizeof(__pyx_k_Square_root_of_1_which_commutes), 0, 1, 0, 0},
18816 {&__pyx_kp_u_Square_root_of_multivector_with, __pyx_k_Square_root_of_multivector_with,
sizeof(__pyx_k_Square_root_of_multivector_with), 0, 1, 0, 0},
18817 {&__pyx_kp_u_Subalgebra_generated_by_all_gen, __pyx_k_Subalgebra_generated_by_all_gen,
sizeof(__pyx_k_Subalgebra_generated_by_all_gen), 0, 1, 0, 0},
18818 {&__pyx_kp_u_Subscripting_map_from_index_set, __pyx_k_Subscripting_map_from_index_set,
sizeof(__pyx_k_Subscripting_map_from_index_set), 0, 1, 0, 0},
18819 {&__pyx_kp_u_Symmetric_set_difference_exclus, __pyx_k_Symmetric_set_difference_exclus,
sizeof(__pyx_k_Symmetric_set_difference_exclus), 0, 1, 0, 0},
18820 {&__pyx_kp_u_Symmetric_set_difference_exclus_2, __pyx_k_Symmetric_set_difference_exclus_2,
sizeof(__pyx_k_Symmetric_set_difference_exclus_2), 0, 1, 0, 0},
18821 {&__pyx_kp_u_Tangent_of_multivector_with_opt, __pyx_k_Tangent_of_multivector_with_opt,
sizeof(__pyx_k_Tangent_of_multivector_with_opt), 0, 1, 0, 0},
18822 {&__pyx_kp_u_Tests_for_functions_that_Doctes, __pyx_k_Tests_for_functions_that_Doctes,
sizeof(__pyx_k_Tests_for_functions_that_Doctes), 0, 1, 0, 0},
18823 {&__pyx_kp_u_Tests_for_functions_that_Doctes_2, __pyx_k_Tests_for_functions_that_Doctes_2,
sizeof(__pyx_k_Tests_for_functions_that_Doctes_2), 0, 1, 0, 0},
18824 {&__pyx_kp_u_The_informal_string_representat, __pyx_k_The_informal_string_representat,
sizeof(__pyx_k_The_informal_string_representat), 0, 1, 0, 0},
18825 {&__pyx_kp_u_The_informal_string_representat_2, __pyx_k_The_informal_string_representat_2,
sizeof(__pyx_k_The_informal_string_representat_2), 0, 1, 0, 0},
18826 {&__pyx_kp_u_The_official_string_representat, __pyx_k_The_official_string_representat,
sizeof(__pyx_k_The_official_string_representat), 0, 1, 0, 0},
18827 {&__pyx_kp_u_The_official_string_representat_2, __pyx_k_The_official_string_representat_2,
sizeof(__pyx_k_The_official_string_representat_2), 0, 1, 0, 0},
18828 {&__pyx_kp_s_This_comparison_operator_is_not, __pyx_k_This_comparison_operator_is_not,
sizeof(__pyx_k_This_comparison_operator_is_not), 0, 0, 1, 0},
18829 {&__pyx_kp_u_Transform_left_hand_side_using, __pyx_k_Transform_left_hand_side_using,
sizeof(__pyx_k_Transform_left_hand_side_using), 0, 1, 0, 0},
18830 {&__pyx_kp_u_Transform_left_hand_side_using_2, __pyx_k_Transform_left_hand_side_using_2,
sizeof(__pyx_k_Transform_left_hand_side_using_2), 0, 1, 0, 0},
18831 {&__pyx_n_s_TypeError, __pyx_k_TypeError,
sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
18832 {&__pyx_kp_u_Unary_print_clifford_1_1, __pyx_k_Unary_print_clifford_1_1,
sizeof(__pyx_k_Unary_print_clifford_1_1), 0, 1, 0, 0},
18833 {&__pyx_kp_u_Unary_print_clifford_1_1_2, __pyx_k_Unary_print_clifford_1_1_2,
sizeof(__pyx_k_Unary_print_clifford_1_1_2), 0, 1, 0, 0},
18834 {&__pyx_n_s_ValueError, __pyx_k_ValueError,
sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
18835 {&__pyx_kp_u_Vector_part_of_multivector_as_a, __pyx_k_Vector_part_of_multivector_as_a,
sizeof(__pyx_k_Vector_part_of_multivector_as_a), 0, 1, 0, 0},
18836 {&__pyx_kp_s__2, __pyx_k__2,
sizeof(__pyx_k__2), 0, 0, 1, 0},
18837 {&__pyx_kp_s__5, __pyx_k__5,
sizeof(__pyx_k__5), 0, 0, 1, 0},
18838 {&__pyx_kp_s__6, __pyx_k__6,
sizeof(__pyx_k__6), 0, 0, 1, 0},
18839 {&__pyx_kp_s__7, __pyx_k__7,
sizeof(__pyx_k__7), 0, 0, 1, 0},
18840 {&__pyx_kp_s__8, __pyx_k__8,
sizeof(__pyx_k__8), 0, 0, 1, 0},
18841 {&__pyx_kp_s__9, __pyx_k__9,
sizeof(__pyx_k__9), 0, 0, 1, 0},
18842 {&__pyx_kp_u_abs_line_1473, __pyx_k_abs_line_1473,
sizeof(__pyx_k_abs_line_1473), 0, 1, 0, 0},
18843 {&__pyx_n_s_acos, __pyx_k_acos,
sizeof(__pyx_k_acos), 0, 0, 1, 1},
18844 {&__pyx_kp_u_acos_line_1619, __pyx_k_acos_line_1619,
sizeof(__pyx_k_acos_line_1619), 0, 1, 0, 0},
18845 {&__pyx_n_s_acosh, __pyx_k_acosh,
sizeof(__pyx_k_acosh), 0, 0, 1, 1},
18846 {&__pyx_kp_u_acosh_line_1656, __pyx_k_acosh_line_1656,
sizeof(__pyx_k_acosh_line_1656), 0, 1, 0, 0},
18847 {&__pyx_kp_u_agc3_line_1844, __pyx_k_agc3_line_1844,
sizeof(__pyx_k_agc3_line_1844), 0, 1, 0, 0},
18848 {&__pyx_n_s_args, __pyx_k_args,
sizeof(__pyx_k_args), 0, 0, 1, 1},
18849 {&__pyx_kp_s_as_frame, __pyx_k_as_frame,
sizeof(__pyx_k_as_frame), 0, 0, 1, 0},
18850 {&__pyx_n_s_asin, __pyx_k_asin,
sizeof(__pyx_k_asin), 0, 0, 1, 1},
18851 {&__pyx_kp_u_asin_line_1698, __pyx_k_asin_line_1698,
sizeof(__pyx_k_asin_line_1698), 0, 1, 0, 0},
18852 {&__pyx_n_s_asinh, __pyx_k_asinh,
sizeof(__pyx_k_asinh), 0, 0, 1, 1},
18853 {&__pyx_kp_u_asinh_line_1733, __pyx_k_asinh_line_1733,
sizeof(__pyx_k_asinh_line_1733), 0, 1, 0, 0},
18854 {&__pyx_n_s_atan, __pyx_k_atan,
sizeof(__pyx_k_atan), 0, 0, 1, 1},
18855 {&__pyx_kp_u_atan_line_1769, __pyx_k_atan_line_1769,
sizeof(__pyx_k_atan_line_1769), 0, 1, 0, 0},
18856 {&__pyx_n_s_atanh, __pyx_k_atanh,
sizeof(__pyx_k_atanh), 0, 0, 1, 1},
18857 {&__pyx_kp_u_atanh_line_1798, __pyx_k_atanh_line_1798,
sizeof(__pyx_k_atanh_line_1798), 0, 1, 0, 0},
18858 {&__pyx_kp_u_cga3_line_1824, __pyx_k_cga3_line_1824,
sizeof(__pyx_k_cga3_line_1824), 0, 1, 0, 0},
18859 {&__pyx_kp_u_cga3std_line_1833, __pyx_k_cga3std_line_1833,
sizeof(__pyx_k_cga3std_line_1833), 0, 1, 0, 0},
18860 {&__pyx_n_s_cl, __pyx_k_cl,
sizeof(__pyx_k_cl), 0, 0, 1, 1},
18861 {&__pyx_n_s_clifford, __pyx_k_clifford,
sizeof(__pyx_k_clifford), 0, 0, 1, 1},
18862 {&__pyx_kp_u_clifford___add___line_739, __pyx_k_clifford___add___line_739,
sizeof(__pyx_k_clifford___add___line_739), 0, 1, 0, 0},
18863 {&__pyx_kp_u_clifford___and___line_835, __pyx_k_clifford___and___line_835,
sizeof(__pyx_k_clifford___and___line_835), 0, 1, 0, 0},
18864 {&__pyx_kp_u_clifford___call___line_1019, __pyx_k_clifford___call___line_1019,
sizeof(__pyx_k_clifford___call___line_1019), 0, 1, 0, 0},
18865 {&__pyx_kp_u_clifford___div___line_895, __pyx_k_clifford___div___line_895,
sizeof(__pyx_k_clifford___div___line_895), 0, 1, 0, 0},
18866 {&__pyx_kp_u_clifford___getitem___line_706, __pyx_k_clifford___getitem___line_706,
sizeof(__pyx_k_clifford___getitem___line_706), 0, 1, 0, 0},
18867 {&__pyx_kp_u_clifford___iadd___line_750, __pyx_k_clifford___iadd___line_750,
sizeof(__pyx_k_clifford___iadd___line_750), 0, 1, 0, 0},
18868 {&__pyx_kp_u_clifford___iand___line_850, __pyx_k_clifford___iand___line_850,
sizeof(__pyx_k_clifford___iand___line_850), 0, 1, 0, 0},
18869 {&__pyx_kp_u_clifford___idiv___line_910, __pyx_k_clifford___idiv___line_910,
sizeof(__pyx_k_clifford___idiv___line_910), 0, 1, 0, 0},
18870 {&__pyx_kp_u_clifford___imod___line_820, __pyx_k_clifford___imod___line_820,
sizeof(__pyx_k_clifford___imod___line_820), 0, 1, 0, 0},
18871 {&__pyx_kp_u_clifford___imul___line_792, __pyx_k_clifford___imul___line_792,
sizeof(__pyx_k_clifford___imul___line_792), 0, 1, 0, 0},
18872 {&__pyx_kp_u_clifford___ior___line_949, __pyx_k_clifford___ior___line_949,
sizeof(__pyx_k_clifford___ior___line_949), 0, 1, 0, 0},
18873 {&__pyx_kp_u_clifford___isub___line_770, __pyx_k_clifford___isub___line_770,
sizeof(__pyx_k_clifford___isub___line_770), 0, 1, 0, 0},
18874 {&__pyx_kp_u_clifford___iter___line_637, __pyx_k_clifford___iter___line_637,
sizeof(__pyx_k_clifford___iter___line_637), 0, 1, 0, 0},
18875 {&__pyx_kp_u_clifford___ixor___line_880, __pyx_k_clifford___ixor___line_880,
sizeof(__pyx_k_clifford___ixor___line_880), 0, 1, 0, 0},
18876 {&__pyx_kp_u_clifford___mod___line_805, __pyx_k_clifford___mod___line_805,
sizeof(__pyx_k_clifford___mod___line_805), 0, 1, 0, 0},
18877 {&__pyx_kp_u_clifford___mul___line_779, __pyx_k_clifford___mul___line_779,
sizeof(__pyx_k_clifford___mul___line_779), 0, 1, 0, 0},
18878 {&__pyx_kp_u_clifford___neg___line_721, __pyx_k_clifford___neg___line_721,
sizeof(__pyx_k_clifford___neg___line_721), 0, 1, 0, 0},
18879 {&__pyx_kp_u_clifford___or___line_938, __pyx_k_clifford___or___line_938,
sizeof(__pyx_k_clifford___or___line_938), 0, 1, 0, 0},
18880 {&__pyx_kp_u_clifford___pos___line_730, __pyx_k_clifford___pos___line_730,
sizeof(__pyx_k_clifford___pos___line_730), 0, 1, 0, 0},
18881 {&__pyx_kp_u_clifford___pow___line_960, __pyx_k_clifford___pow___line_960,
sizeof(__pyx_k_clifford___pow___line_960), 0, 1, 0, 0},
18882 {&__pyx_kp_u_clifford___repr___line_1225, __pyx_k_clifford___repr___line_1225,
sizeof(__pyx_k_clifford___repr___line_1225), 0, 1, 0, 0},
18883 {&__pyx_kp_u_clifford___str___line_1234, __pyx_k_clifford___str___line_1234,
sizeof(__pyx_k_clifford___str___line_1234), 0, 1, 0, 0},
18884 {&__pyx_kp_u_clifford___sub___line_759, __pyx_k_clifford___sub___line_759,
sizeof(__pyx_k_clifford___sub___line_759), 0, 1, 0, 0},
18885 {&__pyx_kp_u_clifford___xor___line_865, __pyx_k_clifford___xor___line_865,
sizeof(__pyx_k_clifford___xor___line_865), 0, 1, 0, 0},
18886 {&__pyx_kp_u_clifford_abs_line_1174, __pyx_k_clifford_abs_line_1174,
sizeof(__pyx_k_clifford_abs_line_1174), 0, 1, 0, 0},
18887 {&__pyx_kp_u_clifford_conj_line_1137, __pyx_k_clifford_conj_line_1137,
sizeof(__pyx_k_clifford_conj_line_1137), 0, 1, 0, 0},
18888 {&__pyx_kp_u_clifford_copy_line_554, __pyx_k_clifford_copy_line_554,
sizeof(__pyx_k_clifford_copy_line_554), 0, 1, 0, 0},
18889 {&__pyx_kp_u_clifford_even_line_1060, __pyx_k_clifford_even_line_1060,
sizeof(__pyx_k_clifford_even_line_1060), 0, 1, 0, 0},
18890 {&__pyx_kp_u_clifford_frame_line_1214, __pyx_k_clifford_frame_line_1214,
sizeof(__pyx_k_clifford_frame_line_1214), 0, 1, 0, 0},
18891 {&__pyx_n_s_clifford_hidden_doctests, __pyx_k_clifford_hidden_doctests,
sizeof(__pyx_k_clifford_hidden_doctests), 0, 0, 1, 1},
18892 {&__pyx_kp_u_clifford_hidden_doctests_line_12, __pyx_k_clifford_hidden_doctests_line_12,
sizeof(__pyx_k_clifford_hidden_doctests_line_12), 0, 1, 0, 0},
18893 {&__pyx_kp_u_clifford_inv_line_925, __pyx_k_clifford_inv_line_925,
sizeof(__pyx_k_clifford_inv_line_925), 0, 1, 0, 0},
18894 {&__pyx_kp_u_clifford_involute_line_1106, __pyx_k_clifford_involute_line_1106,
sizeof(__pyx_k_clifford_involute_line_1106), 0, 1, 0, 0},
18895 {&__pyx_kp_u_clifford_isnan_line_1205, __pyx_k_clifford_isnan_line_1205,
sizeof(__pyx_k_clifford_isnan_line_1205), 0, 1, 0, 0},
18896 {&__pyx_kp_u_clifford_max_abs_line_1183, __pyx_k_clifford_max_abs_line_1183,
sizeof(__pyx_k_clifford_max_abs_line_1183), 0, 1, 0, 0},
18897 {&__pyx_kp_u_clifford_norm_line_1163, __pyx_k_clifford_norm_line_1163,
sizeof(__pyx_k_clifford_norm_line_1163), 0, 1, 0, 0},
18898 {&__pyx_kp_u_clifford_odd_line_1069, __pyx_k_clifford_odd_line_1069,
sizeof(__pyx_k_clifford_odd_line_1069), 0, 1, 0, 0},
18899 {&__pyx_kp_u_clifford_outer_pow_line_1003, __pyx_k_clifford_outer_pow_line_1003,
sizeof(__pyx_k_clifford_outer_pow_line_1003), 0, 1, 0, 0},
18900 {&__pyx_kp_u_clifford_pow_line_979, __pyx_k_clifford_pow_line_979,
sizeof(__pyx_k_clifford_pow_line_979), 0, 1, 0, 0},
18901 {&__pyx_kp_u_clifford_pure_line_1049, __pyx_k_clifford_pure_line_1049,
sizeof(__pyx_k_clifford_pure_line_1049), 0, 1, 0, 0},
18902 {&__pyx_kp_u_clifford_quad_line_1152, __pyx_k_clifford_quad_line_1152,
sizeof(__pyx_k_clifford_quad_line_1152), 0, 1, 0, 0},
18903 {&__pyx_kp_u_clifford_reframe_line_648, __pyx_k_clifford_reframe_line_648,
sizeof(__pyx_k_clifford_reframe_line_648), 0, 1, 0, 0},
18904 {&__pyx_kp_u_clifford_reverse_line_1122, __pyx_k_clifford_reverse_line_1122,
sizeof(__pyx_k_clifford_reverse_line_1122), 0, 1, 0, 0},
18905 {&__pyx_kp_u_clifford_scalar_line_1038, __pyx_k_clifford_scalar_line_1038,
sizeof(__pyx_k_clifford_scalar_line_1038), 0, 1, 0, 0},
18906 {&__pyx_kp_u_clifford_truncated_line_1194, __pyx_k_clifford_truncated_line_1194,
sizeof(__pyx_k_clifford_truncated_line_1194), 0, 1, 0, 0},
18907 {&__pyx_kp_u_clifford_vector_part_line_1078, __pyx_k_clifford_vector_part_line_1078,
sizeof(__pyx_k_clifford_vector_part_line_1078), 0, 1, 0, 0},
18908 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback,
sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
18909 {&__pyx_n_s_close, __pyx_k_close,
sizeof(__pyx_k_close), 0, 0, 1, 1},
18910 {&__pyx_n_s_collections, __pyx_k_collections,
sizeof(__pyx_k_collections), 0, 0, 1, 1},
18911 {&__pyx_kp_u_compare_line_490, __pyx_k_compare_line_490,
sizeof(__pyx_k_compare_line_490), 0, 1, 0, 0},
18912 {&__pyx_kp_u_complexifier_line_1527, __pyx_k_complexifier_line_1527,
sizeof(__pyx_k_complexifier_line_1527), 0, 1, 0, 0},
18913 {&__pyx_n_s_conj, __pyx_k_conj,
sizeof(__pyx_k_conj), 0, 0, 1, 1},
18914 {&__pyx_kp_u_conj_line_1436, __pyx_k_conj_line_1436,
sizeof(__pyx_k_conj_line_1436), 0, 1, 0, 0},
18915 {&__pyx_n_s_copy, __pyx_k_copy,
sizeof(__pyx_k_copy), 0, 0, 1, 1},
18916 {&__pyx_n_s_cos, __pyx_k_cos,
sizeof(__pyx_k_cos), 0, 0, 1, 1},
18917 {&__pyx_kp_u_cos_line_1602, __pyx_k_cos_line_1602,
sizeof(__pyx_k_cos_line_1602), 0, 1, 0, 0},
18918 {&__pyx_n_s_cosh, __pyx_k_cosh,
sizeof(__pyx_k_cosh), 0, 0, 1, 1},
18919 {&__pyx_kp_u_cosh_line_1640, __pyx_k_cosh_line_1640,
sizeof(__pyx_k_cosh_line_1640), 0, 1, 0, 0},
18920 {&__pyx_n_s_doctest, __pyx_k_doctest,
sizeof(__pyx_k_doctest), 0, 0, 1, 1},
18921 {&__pyx_n_s_e, __pyx_k_e,
sizeof(__pyx_k_e), 0, 0, 1, 1},
18922 {&__pyx_kp_u_e_line_1887, __pyx_k_e_line_1887,
sizeof(__pyx_k_e_line_1887), 0, 1, 0, 0},
18923 {&__pyx_n_s_even, __pyx_k_even,
sizeof(__pyx_k_even), 0, 0, 1, 1},
18924 {&__pyx_kp_u_even_line_1388, __pyx_k_even_line_1388,
sizeof(__pyx_k_even_line_1388), 0, 1, 0, 0},
18925 {&__pyx_n_s_exp, __pyx_k_exp,
sizeof(__pyx_k_exp), 0, 0, 1, 1},
18926 {&__pyx_kp_u_exp_line_1565, __pyx_k_exp_line_1565,
sizeof(__pyx_k_exp_line_1565), 0, 1, 0, 0},
18927 {&__pyx_n_s_fill, __pyx_k_fill,
sizeof(__pyx_k_fill), 0, 0, 1, 1},
18928 {&__pyx_n_s_frm, __pyx_k_frm,
sizeof(__pyx_k_frm), 0, 0, 1, 1},
18929 {&__pyx_kp_s_from, __pyx_k_from,
sizeof(__pyx_k_from), 0, 0, 1, 0},
18930 {&__pyx_n_s_getstate, __pyx_k_getstate,
sizeof(__pyx_k_getstate), 0, 0, 1, 1},
18931 {&__pyx_n_s_grade, __pyx_k_grade,
sizeof(__pyx_k_grade), 0, 0, 1, 1},
18932 {&__pyx_n_s_i, __pyx_k_i,
sizeof(__pyx_k_i), 0, 0, 1, 1},
18933 {&__pyx_kp_u_imag_line_1366, __pyx_k_imag_line_1366,
sizeof(__pyx_k_imag_line_1366), 0, 1, 0, 0},
18934 {&__pyx_n_s_import, __pyx_k_import,
sizeof(__pyx_k_import), 0, 0, 1, 1},
18935 {&__pyx_n_s_index_set, __pyx_k_index_set,
sizeof(__pyx_k_index_set), 0, 0, 1, 1},
18936 {&__pyx_kp_u_index_set___and___line_269, __pyx_k_index_set___and___line_269,
sizeof(__pyx_k_index_set___and___line_269), 0, 1, 0, 0},
18937 {&__pyx_kp_u_index_set___getitem___line_189, __pyx_k_index_set___getitem___line_189,
sizeof(__pyx_k_index_set___getitem___line_189), 0, 1, 0, 0},
18938 {&__pyx_kp_u_index_set___iand___line_280, __pyx_k_index_set___iand___line_280,
sizeof(__pyx_k_index_set___iand___line_280), 0, 1, 0, 0},
18939 {&__pyx_kp_u_index_set___invert___line_238, __pyx_k_index_set___invert___line_238,
sizeof(__pyx_k_index_set___invert___line_238), 0, 1, 0, 0},
18940 {&__pyx_kp_u_index_set___ior___line_302, __pyx_k_index_set___ior___line_302,
sizeof(__pyx_k_index_set___ior___line_302), 0, 1, 0, 0},
18941 {&__pyx_n_s_index_set___iter, __pyx_k_index_set___iter,
sizeof(__pyx_k_index_set___iter), 0, 0, 1, 1},
18942 {&__pyx_kp_u_index_set___iter___line_227, __pyx_k_index_set___iter___line_227,
sizeof(__pyx_k_index_set___iter___line_227), 0, 1, 0, 0},
18943 {&__pyx_kp_u_index_set___ixor___line_258, __pyx_k_index_set___ixor___line_258,
sizeof(__pyx_k_index_set___ixor___line_258), 0, 1, 0, 0},
18944 {&__pyx_kp_u_index_set___or___line_291, __pyx_k_index_set___or___line_291,
sizeof(__pyx_k_index_set___or___line_291), 0, 1, 0, 0},
18945 {&__pyx_kp_u_index_set___repr___line_382, __pyx_k_index_set___repr___line_382,
sizeof(__pyx_k_index_set___repr___line_382), 0, 1, 0, 0},
18946 {&__pyx_kp_u_index_set___setitem___line_177, __pyx_k_index_set___setitem___line_177,
sizeof(__pyx_k_index_set___setitem___line_177), 0, 1, 0, 0},
18947 {&__pyx_kp_u_index_set___str___line_393, __pyx_k_index_set___str___line_393,
sizeof(__pyx_k_index_set___str___line_393), 0, 1, 0, 0},
18948 {&__pyx_kp_u_index_set___xor___line_247, __pyx_k_index_set___xor___line_247,
sizeof(__pyx_k_index_set___xor___line_247), 0, 1, 0, 0},
18949 {&__pyx_kp_u_index_set_copy_line_64, __pyx_k_index_set_copy_line_64,
sizeof(__pyx_k_index_set_copy_line_64), 0, 1, 0, 0},
18950 {&__pyx_kp_u_index_set_count_line_313, __pyx_k_index_set_count_line_313,
sizeof(__pyx_k_index_set_count_line_313), 0, 1, 0, 0},
18951 {&__pyx_kp_u_index_set_count_neg_line_322, __pyx_k_index_set_count_neg_line_322,
sizeof(__pyx_k_index_set_count_neg_line_322), 0, 1, 0, 0},
18952 {&__pyx_kp_u_index_set_count_pos_line_331, __pyx_k_index_set_count_pos_line_331,
sizeof(__pyx_k_index_set_count_pos_line_331), 0, 1, 0, 0},
18953 {&__pyx_n_s_index_set_hidden_doctests, __pyx_k_index_set_hidden_doctests,
sizeof(__pyx_k_index_set_hidden_doctests), 0, 0, 1, 1},
18954 {&__pyx_kp_u_index_set_hidden_doctests_line_4, __pyx_k_index_set_hidden_doctests_line_4,
sizeof(__pyx_k_index_set_hidden_doctests_line_4), 0, 1, 0, 0},
18955 {&__pyx_kp_u_index_set_max_line_349, __pyx_k_index_set_max_line_349,
sizeof(__pyx_k_index_set_max_line_349), 0, 1, 0, 0},
18956 {&__pyx_kp_u_index_set_min_line_340, __pyx_k_index_set_min_line_340,
sizeof(__pyx_k_index_set_min_line_340), 0, 1, 0, 0},
18957 {&__pyx_kp_u_index_set_sign_of_mult_line_364, __pyx_k_index_set_sign_of_mult_line_364,
sizeof(__pyx_k_index_set_sign_of_mult_line_364), 0, 1, 0, 0},
18958 {&__pyx_kp_u_index_set_sign_of_square_line_37, __pyx_k_index_set_sign_of_square_line_37,
sizeof(__pyx_k_index_set_sign_of_square_line_37), 0, 1, 0, 0},
18959 {&__pyx_n_s_inv, __pyx_k_inv,
sizeof(__pyx_k_inv), 0, 0, 1, 1},
18960 {&__pyx_kp_u_inv_line_1329, __pyx_k_inv_line_1329,
sizeof(__pyx_k_inv_line_1329), 0, 1, 0, 0},
18961 {&__pyx_kp_s_invalid, __pyx_k_invalid,
sizeof(__pyx_k_invalid), 0, 0, 1, 0},
18962 {&__pyx_kp_s_invalid_string, __pyx_k_invalid_string,
sizeof(__pyx_k_invalid_string), 0, 0, 1, 0},
18963 {&__pyx_n_s_involute, __pyx_k_involute,
sizeof(__pyx_k_involute), 0, 0, 1, 1},
18964 {&__pyx_kp_u_involute_line_1406, __pyx_k_involute_line_1406,
sizeof(__pyx_k_involute_line_1406), 0, 1, 0, 0},
18965 {&__pyx_n_s_ist, __pyx_k_ist,
sizeof(__pyx_k_ist), 0, 0, 1, 1},
18966 {&__pyx_n_s_istpq, __pyx_k_istpq,
sizeof(__pyx_k_istpq), 0, 0, 1, 1},
18967 {&__pyx_kp_u_istpq_line_1900, __pyx_k_istpq_line_1900,
sizeof(__pyx_k_istpq_line_1900), 0, 1, 0, 0},
18968 {&__pyx_n_s_iter, __pyx_k_iter,
sizeof(__pyx_k_iter), 0, 0, 1, 1},
18969 {&__pyx_n_s_ixt, __pyx_k_ixt,
sizeof(__pyx_k_ixt), 0, 0, 1, 1},
18970 {&__pyx_kp_u_lexicographic_compare_eg_3_4_5, __pyx_k_lexicographic_compare_eg_3_4_5,
sizeof(__pyx_k_lexicographic_compare_eg_3_4_5), 0, 1, 0, 0},
18971 {&__pyx_n_s_lhs, __pyx_k_lhs,
sizeof(__pyx_k_lhs), 0, 0, 1, 1},
18972 {&__pyx_n_s_log, __pyx_k_log,
sizeof(__pyx_k_log), 0, 0, 1, 1},
18973 {&__pyx_kp_u_log_line_1579, __pyx_k_log_line_1579,
sizeof(__pyx_k_log_line_1579), 0, 1, 0, 0},
18974 {&__pyx_n_s_m, __pyx_k_m,
sizeof(__pyx_k_m), 0, 0, 1, 1},
18975 {&__pyx_n_s_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 0, 1, 1},
18976 {&__pyx_n_s_math, __pyx_k_math,
sizeof(__pyx_k_math), 0, 0, 1, 1},
18977 {&__pyx_n_s_max, __pyx_k_max,
sizeof(__pyx_k_max), 0, 0, 1, 1},
18978 {&__pyx_kp_u_max_abs_line_1482, __pyx_k_max_abs_line_1482,
sizeof(__pyx_k_max_abs_line_1482), 0, 1, 0, 0},
18979 {&__pyx_kp_u_max_pos_line_511, __pyx_k_max_pos_line_511,
sizeof(__pyx_k_max_pos_line_511), 0, 1, 0, 0},
18980 {&__pyx_n_s_min, __pyx_k_min,
sizeof(__pyx_k_min), 0, 0, 1, 1},
18981 {&__pyx_kp_u_min_neg_line_502, __pyx_k_min_neg_line_502,
sizeof(__pyx_k_min_neg_line_502), 0, 1, 0, 0},
18982 {&__pyx_n_s_name, __pyx_k_name,
sizeof(__pyx_k_name), 0, 0, 1, 1},
18983 {&__pyx_n_s_nbar3, __pyx_k_nbar3,
sizeof(__pyx_k_nbar3), 0, 0, 1, 1},
18984 {&__pyx_n_s_ninf3, __pyx_k_ninf3,
sizeof(__pyx_k_ninf3), 0, 0, 1, 1},
18985 {&__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},
18986 {&__pyx_n_s_norm, __pyx_k_norm,
sizeof(__pyx_k_norm), 0, 0, 1, 1},
18987 {&__pyx_kp_u_norm_line_1462, __pyx_k_norm_line_1462,
sizeof(__pyx_k_norm_line_1462), 0, 1, 0, 0},
18988 {&__pyx_kp_u_norm_sum_of_squares_of_coordina, __pyx_k_norm_sum_of_squares_of_coordina,
sizeof(__pyx_k_norm_sum_of_squares_of_coordina), 0, 1, 0, 0},
18989 {&__pyx_n_s_numbers, __pyx_k_numbers,
sizeof(__pyx_k_numbers), 0, 0, 1, 1},
18990 {&__pyx_n_s_obj, __pyx_k_obj,
sizeof(__pyx_k_obj), 0, 0, 1, 1},
18991 {&__pyx_n_s_odd, __pyx_k_odd,
sizeof(__pyx_k_odd), 0, 0, 1, 1},
18992 {&__pyx_kp_u_odd_line_1397, __pyx_k_odd_line_1397,
sizeof(__pyx_k_odd_line_1397), 0, 1, 0, 0},
18993 {&__pyx_n_s_other, __pyx_k_other,
sizeof(__pyx_k_other), 0, 0, 1, 1},
18994 {&__pyx_n_s_outer_pow, __pyx_k_outer_pow,
sizeof(__pyx_k_outer_pow), 0, 0, 1, 1},
18995 {&__pyx_kp_u_outer_pow_line_1518, __pyx_k_outer_pow_line_1518,
sizeof(__pyx_k_outer_pow_line_1518), 0, 1, 0, 0},
18996 {&__pyx_n_s_p, __pyx_k_p,
sizeof(__pyx_k_p), 0, 0, 1, 1},
18997 {&__pyx_n_s_pi, __pyx_k_pi,
sizeof(__pyx_k_pi), 0, 0, 1, 1},
18998 {&__pyx_n_s_pow, __pyx_k_pow,
sizeof(__pyx_k_pow), 0, 0, 1, 1},
18999 {&__pyx_kp_u_pow_line_1494, __pyx_k_pow_line_1494,
sizeof(__pyx_k_pow_line_1494), 0, 1, 0, 0},
19000 {&__pyx_n_s_pure, __pyx_k_pure,
sizeof(__pyx_k_pure), 0, 0, 1, 1},
19001 {&__pyx_kp_u_pure_line_1377, __pyx_k_pure_line_1377,
sizeof(__pyx_k_pure_line_1377), 0, 1, 0, 0},
19002 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable,
sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
19003 {&__pyx_n_s_q, __pyx_k_q,
sizeof(__pyx_k_q), 0, 0, 1, 1},
19004 {&__pyx_n_s_quad, __pyx_k_quad,
sizeof(__pyx_k_quad), 0, 0, 1, 1},
19005 {&__pyx_kp_u_quad_line_1451, __pyx_k_quad_line_1451,
sizeof(__pyx_k_quad_line_1451), 0, 1, 0, 0},
19006 {&__pyx_kp_u_random_clifford_line_1815, __pyx_k_random_clifford_line_1815,
sizeof(__pyx_k_random_clifford_line_1815), 0, 1, 0, 0},
19007 {&__pyx_n_s_range, __pyx_k_range,
sizeof(__pyx_k_range), 0, 0, 1, 1},
19008 {&__pyx_kp_u_real_line_1355, __pyx_k_real_line_1355,
sizeof(__pyx_k_real_line_1355), 0, 1, 0, 0},
19009 {&__pyx_n_s_reduce, __pyx_k_reduce,
sizeof(__pyx_k_reduce), 0, 0, 1, 1},
19010 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython,
sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
19011 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex,
sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
19012 {&__pyx_n_s_reverse, __pyx_k_reverse,
sizeof(__pyx_k_reverse), 0, 0, 1, 1},
19013 {&__pyx_kp_u_reverse_line_1421, __pyx_k_reverse_line_1421,
sizeof(__pyx_k_reverse_line_1421), 0, 1, 0, 0},
19014 {&__pyx_n_s_rhs, __pyx_k_rhs,
sizeof(__pyx_k_rhs), 0, 0, 1, 1},
19015 {&__pyx_n_s_scalar, __pyx_k_scalar,
sizeof(__pyx_k_scalar), 0, 0, 1, 1},
19016 {&__pyx_kp_u_scalar_line_1344, __pyx_k_scalar_line_1344,
sizeof(__pyx_k_scalar_line_1344), 0, 1, 0, 0},
19017 {&__pyx_n_s_send, __pyx_k_send,
sizeof(__pyx_k_send), 0, 0, 1, 1},
19018 {&__pyx_n_s_setstate, __pyx_k_setstate,
sizeof(__pyx_k_setstate), 0, 0, 1, 1},
19019 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython,
sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
19020 {&__pyx_n_s_sin, __pyx_k_sin,
sizeof(__pyx_k_sin), 0, 0, 1, 1},
19021 {&__pyx_kp_u_sin_line_1679, __pyx_k_sin_line_1679,
sizeof(__pyx_k_sin_line_1679), 0, 1, 0, 0},
19022 {&__pyx_n_s_sinh, __pyx_k_sinh,
sizeof(__pyx_k_sinh), 0, 0, 1, 1},
19023 {&__pyx_kp_u_sinh_line_1719, __pyx_k_sinh_line_1719,
sizeof(__pyx_k_sinh_line_1719), 0, 1, 0, 0},
19024 {&__pyx_n_s_sqrt, __pyx_k_sqrt,
sizeof(__pyx_k_sqrt), 0, 0, 1, 1},
19025 {&__pyx_kp_u_sqrt_line_1542, __pyx_k_sqrt_line_1542,
sizeof(__pyx_k_sqrt_line_1542), 0, 1, 0, 0},
19026 {&__pyx_n_s_tan, __pyx_k_tan,
sizeof(__pyx_k_tan), 0, 0, 1, 1},
19027 {&__pyx_kp_u_tan_line_1752, __pyx_k_tan_line_1752,
sizeof(__pyx_k_tan_line_1752), 0, 1, 0, 0},
19028 {&__pyx_n_s_tanh, __pyx_k_tanh,
sizeof(__pyx_k_tanh), 0, 0, 1, 1},
19029 {&__pyx_kp_u_tanh_line_1786, __pyx_k_tanh_line_1786,
sizeof(__pyx_k_tanh_line_1786), 0, 1, 0, 0},
19030 {&__pyx_n_s_tau, __pyx_k_tau,
sizeof(__pyx_k_tau), 0, 0, 1, 1},
19031 {&__pyx_n_s_test, __pyx_k_test,
sizeof(__pyx_k_test), 0, 0, 1, 1},
19032 {&__pyx_n_s_test_2, __pyx_k_test_2,
sizeof(__pyx_k_test_2), 0, 0, 1, 1},
19033 {&__pyx_n_s_testmod, __pyx_k_testmod,
sizeof(__pyx_k_testmod), 0, 0, 1, 1},
19034 {&__pyx_n_s_throw, __pyx_k_throw,
sizeof(__pyx_k_throw), 0, 0, 1, 1},
19035 {&__pyx_kp_s_to_frame, __pyx_k_to_frame,
sizeof(__pyx_k_to_frame), 0, 0, 1, 0},
19036 {&__pyx_kp_s_using, __pyx_k_using,
sizeof(__pyx_k_using), 0, 0, 1, 0},
19037 {&__pyx_kp_s_using_invalid, __pyx_k_using_invalid,
sizeof(__pyx_k_using_invalid), 0, 0, 1, 0},
19038 {&__pyx_kp_s_value, __pyx_k_value,
sizeof(__pyx_k_value), 0, 0, 1, 0},
19039 {&__pyx_n_s_version, __pyx_k_version,
sizeof(__pyx_k_version), 0, 0, 1, 1},
19040 {&__pyx_n_s_xrange, __pyx_k_xrange,
sizeof(__pyx_k_xrange), 0, 0, 1, 1},
19041 {0, 0, 0, 0, 0, 0, 0}
19043 static CYTHON_SMALL_CODE
int __Pyx_InitCachedBuiltins(
void) {
19044 __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError);
if (!__pyx_builtin_IndexError) __PYX_ERR(0, 102, __pyx_L1_error)
19045 __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError);
if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 104, __pyx_L1_error)
19046 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError);
if (!__pyx_builtin_TypeError) __PYX_ERR(0, 104, __pyx_L1_error)
19047 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError);
if (!__pyx_builtin_ValueError) __PYX_ERR(0, 105, __pyx_L1_error)
19048 __pyx_builtin_NotImplemented = __Pyx_GetBuiltinName(__pyx_n_s_NotImplemented);
if (!__pyx_builtin_NotImplemented) __PYX_ERR(0, 157, __pyx_L1_error)
19049 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_range) __PYX_ERR(0, 234, __pyx_L1_error)
19050 #if PY_MAJOR_VERSION >= 3 19051 __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_xrange) __PYX_ERR(0, 1098, __pyx_L1_error)
19053 __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange);
if (!__pyx_builtin_xrange) __PYX_ERR(0, 1098, __pyx_L1_error)
19060 static CYTHON_SMALL_CODE
int __Pyx_InitCachedConstants(
void) {
19061 __Pyx_RefNannyDeclarations
19062 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
19070 __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 2, __pyx_L1_error)
19071 __Pyx_GOTREF(__pyx_tuple__3);
19072 __Pyx_GIVEREF(__pyx_tuple__3);
19079 __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 4, __pyx_L1_error)
19080 __Pyx_GOTREF(__pyx_tuple__4);
19081 __Pyx_GIVEREF(__pyx_tuple__4);
19090 __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Not_applicable);
if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 635, __pyx_L1_error)
19091 __Pyx_GOTREF(__pyx_tuple__10);
19092 __Pyx_GIVEREF(__pyx_tuple__10);
19100 __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 2, __pyx_L1_error)
19101 __Pyx_GOTREF(__pyx_tuple__11);
19102 __Pyx_GIVEREF(__pyx_tuple__11);
19109 __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 4, __pyx_L1_error)
19110 __Pyx_GOTREF(__pyx_tuple__12);
19111 __Pyx_GIVEREF(__pyx_tuple__12);
19120 __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_PyClical_pyx, __pyx_n_s_index_set_hidden_doctests, 404, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 404, __pyx_L1_error)
19129 __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_PyClical_pyx, __pyx_n_s_clifford_hidden_doctests, 1243, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 1243, __pyx_L1_error)
19138 __pyx_tuple__15 = PyTuple_Pack(1, __pyx_float_1_0);
if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 1856, __pyx_L1_error)
19139 __Pyx_GOTREF(__pyx_tuple__15);
19140 __Pyx_GIVEREF(__pyx_tuple__15);
19149 __pyx_tuple__16 = PyTuple_Pack(1, __pyx_n_s_obj);
if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 1887, __pyx_L1_error)
19150 __Pyx_GOTREF(__pyx_tuple__16);
19151 __Pyx_GIVEREF(__pyx_tuple__16);
19152 __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_PyClical_pyx, __pyx_n_s_e, 1887, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 1887, __pyx_L1_error)
19161 __pyx_tuple__18 = PyTuple_Pack(2, __pyx_n_s_p, __pyx_n_s_q);
if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 1900, __pyx_L1_error)
19162 __Pyx_GOTREF(__pyx_tuple__18);
19163 __Pyx_GIVEREF(__pyx_tuple__18);
19164 __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_PyClical_pyx, __pyx_n_s_istpq, 1900, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 1900, __pyx_L1_error)
19173 __pyx_tuple__20 = PyTuple_Pack(1, __pyx_int_4);
if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 1909, __pyx_L1_error)
19174 __Pyx_GOTREF(__pyx_tuple__20);
19175 __Pyx_GIVEREF(__pyx_tuple__20);
19176 __pyx_tuple__21 = PyTuple_Pack(1, __pyx_int_neg_1);
if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 1909, __pyx_L1_error)
19177 __Pyx_GOTREF(__pyx_tuple__21);
19178 __Pyx_GIVEREF(__pyx_tuple__21);
19187 __pyx_tuple__22 = PyTuple_Pack(2, __pyx_n_s_PyClical, __pyx_n_s_doctest);
if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 1913, __pyx_L1_error)
19188 __Pyx_GOTREF(__pyx_tuple__22);
19189 __Pyx_GIVEREF(__pyx_tuple__22);
19190 __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_PyClical_pyx, __pyx_n_s_test, 1913, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 1913, __pyx_L1_error)
19191 __Pyx_RefNannyFinishContext();
19194 __Pyx_RefNannyFinishContext();
19198 static CYTHON_SMALL_CODE
int __Pyx_InitGlobals(
void) {
19199 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
19200 __pyx_float_0_0 =
PyFloat_FromDouble(0.0);
if (unlikely(!__pyx_float_0_0)) __PYX_ERR(0, 1, __pyx_L1_error)
19201 __pyx_float_1_0 =
PyFloat_FromDouble(1.0);
if (unlikely(!__pyx_float_1_0)) __PYX_ERR(0, 1, __pyx_L1_error)
19202 __pyx_float_2_0 =
PyFloat_FromDouble(2.0);
if (unlikely(!__pyx_float_2_0)) __PYX_ERR(0, 1, __pyx_L1_error)
19203 __pyx_float_8_0 =
PyFloat_FromDouble(8.0);
if (unlikely(!__pyx_float_8_0)) __PYX_ERR(0, 1, __pyx_L1_error)
19204 __pyx_int_0 = PyInt_FromLong(0);
if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
19205 __pyx_int_1 = PyInt_FromLong(1);
if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
19206 __pyx_int_4 = PyInt_FromLong(4);
if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error)
19207 __pyx_int_neg_1 = PyInt_FromLong(-1);
if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
19213 static CYTHON_SMALL_CODE
int __Pyx_modinit_global_init_code(
void);
19214 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_export_code(
void);
19215 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_export_code(
void);
19216 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_init_code(
void);
19217 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_import_code(
void);
19218 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_import_code(
void);
19219 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_import_code(
void);
19221 static int __Pyx_modinit_global_init_code(
void) {
19222 __Pyx_RefNannyDeclarations
19223 __Pyx_RefNannySetupContext(
"__Pyx_modinit_global_init_code", 0);
19225 __Pyx_RefNannyFinishContext();
19229 static int __Pyx_modinit_variable_export_code(
void) {
19230 __Pyx_RefNannyDeclarations
19231 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_export_code", 0);
19233 __Pyx_RefNannyFinishContext();
19237 static int __Pyx_modinit_function_export_code(
void) {
19238 __Pyx_RefNannyDeclarations
19239 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_export_code", 0);
19241 __Pyx_RefNannyFinishContext();
19245 static int __Pyx_modinit_type_init_code(
void) {
19246 __Pyx_RefNannyDeclarations
19247 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_init_code", 0);
19249 __pyx_vtabptr_8PyClical_index_set = &__pyx_vtable_8PyClical_index_set;
19250 __pyx_vtable_8PyClical_index_set.wrap = (PyObject *(*)(
struct __pyx_obj_8PyClical_index_set *,
IndexSet))__pyx_f_8PyClical_9index_set_wrap;
19251 __pyx_vtable_8PyClical_index_set.unwrap = (
IndexSet (*)(
struct __pyx_obj_8PyClical_index_set *))__pyx_f_8PyClical_9index_set_unwrap;
19252 __pyx_vtable_8PyClical_index_set.copy = (PyObject *(*)(
struct __pyx_obj_8PyClical_index_set *,
int __pyx_skip_dispatch))__pyx_f_8PyClical_9index_set_copy;
19253 if (PyType_Ready(&__pyx_type_8PyClical_index_set) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
19254 __pyx_type_8PyClical_index_set.tp_print = 0;
19255 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8PyClical_index_set.tp_dictoffset && __pyx_type_8PyClical_index_set.tp_getattro == PyObject_GenericGetAttr)) {
19256 __pyx_type_8PyClical_index_set.tp_getattro = __Pyx_PyObject_GenericGetAttr;
19258 #if CYTHON_COMPILING_IN_CPYTHON 19260 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__setitem__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19261 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19262 __pyx_wrapperbase_8PyClical_9index_set_8__setitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19263 __pyx_wrapperbase_8PyClical_9index_set_8__setitem__.doc = __pyx_doc_8PyClical_9index_set_8__setitem__;
19264 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_8__setitem__;
19268 #if CYTHON_COMPILING_IN_CPYTHON 19270 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__getitem__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19271 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19272 __pyx_wrapperbase_8PyClical_9index_set_10__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19273 __pyx_wrapperbase_8PyClical_9index_set_10__getitem__.doc = __pyx_doc_8PyClical_9index_set_10__getitem__;
19274 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_10__getitem__;
19278 #if CYTHON_COMPILING_IN_CPYTHON 19280 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__contains__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19281 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19282 __pyx_wrapperbase_8PyClical_9index_set_12__contains__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19283 __pyx_wrapperbase_8PyClical_9index_set_12__contains__.doc = __pyx_doc_8PyClical_9index_set_12__contains__;
19284 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_12__contains__;
19288 #if CYTHON_COMPILING_IN_CPYTHON 19290 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__iter__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19291 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19292 __pyx_wrapperbase_8PyClical_9index_set_14__iter__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19293 __pyx_wrapperbase_8PyClical_9index_set_14__iter__.doc = __pyx_doc_8PyClical_9index_set_14__iter__;
19294 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_14__iter__;
19298 #if CYTHON_COMPILING_IN_CPYTHON 19300 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__invert__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19301 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19302 __pyx_wrapperbase_8PyClical_9index_set_17__invert__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19303 __pyx_wrapperbase_8PyClical_9index_set_17__invert__.doc = __pyx_doc_8PyClical_9index_set_17__invert__;
19304 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_17__invert__;
19308 #if CYTHON_COMPILING_IN_CPYTHON 19310 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__xor__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19311 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19312 __pyx_wrapperbase_8PyClical_9index_set_19__xor__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19313 __pyx_wrapperbase_8PyClical_9index_set_19__xor__.doc = __pyx_doc_8PyClical_9index_set_19__xor__;
19314 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_19__xor__;
19318 #if CYTHON_COMPILING_IN_CPYTHON 19320 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__ixor__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19321 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19322 __pyx_wrapperbase_8PyClical_9index_set_21__ixor__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19323 __pyx_wrapperbase_8PyClical_9index_set_21__ixor__.doc = __pyx_doc_8PyClical_9index_set_21__ixor__;
19324 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_21__ixor__;
19328 #if CYTHON_COMPILING_IN_CPYTHON 19330 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__and__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19331 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19332 __pyx_wrapperbase_8PyClical_9index_set_23__and__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19333 __pyx_wrapperbase_8PyClical_9index_set_23__and__.doc = __pyx_doc_8PyClical_9index_set_23__and__;
19334 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_23__and__;
19338 #if CYTHON_COMPILING_IN_CPYTHON 19340 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__iand__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19341 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19342 __pyx_wrapperbase_8PyClical_9index_set_25__iand__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19343 __pyx_wrapperbase_8PyClical_9index_set_25__iand__.doc = __pyx_doc_8PyClical_9index_set_25__iand__;
19344 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_25__iand__;
19348 #if CYTHON_COMPILING_IN_CPYTHON 19350 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__or__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19351 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19352 __pyx_wrapperbase_8PyClical_9index_set_27__or__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19353 __pyx_wrapperbase_8PyClical_9index_set_27__or__.doc = __pyx_doc_8PyClical_9index_set_27__or__;
19354 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_27__or__;
19358 #if CYTHON_COMPILING_IN_CPYTHON 19360 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__ior__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19361 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19362 __pyx_wrapperbase_8PyClical_9index_set_29__ior__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19363 __pyx_wrapperbase_8PyClical_9index_set_29__ior__.doc = __pyx_doc_8PyClical_9index_set_29__ior__;
19364 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_29__ior__;
19368 #if CYTHON_COMPILING_IN_CPYTHON 19370 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__repr__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19371 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19372 __pyx_wrapperbase_8PyClical_9index_set_47__repr__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19373 __pyx_wrapperbase_8PyClical_9index_set_47__repr__.doc = __pyx_doc_8PyClical_9index_set_47__repr__;
19374 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_47__repr__;
19378 #if CYTHON_COMPILING_IN_CPYTHON 19380 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__str__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19381 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19382 __pyx_wrapperbase_8PyClical_9index_set_49__str__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19383 __pyx_wrapperbase_8PyClical_9index_set_49__str__.doc = __pyx_doc_8PyClical_9index_set_49__str__;
19384 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_49__str__;
19388 if (__Pyx_SetVtable(__pyx_type_8PyClical_index_set.tp_dict, __pyx_vtabptr_8PyClical_index_set) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
19389 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_index_set, (PyObject *)&__pyx_type_8PyClical_index_set) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
19390 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8PyClical_index_set) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
19391 __pyx_ptype_8PyClical_index_set = &__pyx_type_8PyClical_index_set;
19392 __pyx_vtabptr_8PyClical_clifford = &__pyx_vtable_8PyClical_clifford;
19393 __pyx_vtable_8PyClical_clifford.wrap = (PyObject *(*)(
struct __pyx_obj_8PyClical_clifford *,
Clifford))__pyx_f_8PyClical_8clifford_wrap;
19394 __pyx_vtable_8PyClical_clifford.unwrap = (
Clifford (*)(
struct __pyx_obj_8PyClical_clifford *))__pyx_f_8PyClical_8clifford_unwrap;
19395 __pyx_vtable_8PyClical_clifford.copy = (PyObject *(*)(
struct __pyx_obj_8PyClical_clifford *,
int __pyx_skip_dispatch))__pyx_f_8PyClical_8clifford_copy;
19396 if (PyType_Ready(&__pyx_type_8PyClical_clifford) < 0) __PYX_ERR(0, 535, __pyx_L1_error)
19397 __pyx_type_8PyClical_clifford.tp_print = 0;
19398 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8PyClical_clifford.tp_dictoffset && __pyx_type_8PyClical_clifford.tp_getattro == PyObject_GenericGetAttr)) {
19399 __pyx_type_8PyClical_clifford.tp_getattro = __Pyx_PyObject_GenericGetAttr;
19401 #if CYTHON_COMPILING_IN_CPYTHON 19403 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__contains__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19404 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19405 __pyx_wrapperbase_8PyClical_8clifford_6__contains__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19406 __pyx_wrapperbase_8PyClical_8clifford_6__contains__.doc = __pyx_doc_8PyClical_8clifford_6__contains__;
19407 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_6__contains__;
19411 #if CYTHON_COMPILING_IN_CPYTHON 19413 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__iter__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19414 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19415 __pyx_wrapperbase_8PyClical_8clifford_8__iter__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19416 __pyx_wrapperbase_8PyClical_8clifford_8__iter__.doc = __pyx_doc_8PyClical_8clifford_8__iter__;
19417 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_8__iter__;
19421 #if CYTHON_COMPILING_IN_CPYTHON 19423 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__getitem__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19424 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19425 __pyx_wrapperbase_8PyClical_8clifford_14__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19426 __pyx_wrapperbase_8PyClical_8clifford_14__getitem__.doc = __pyx_doc_8PyClical_8clifford_14__getitem__;
19427 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_14__getitem__;
19431 #if CYTHON_COMPILING_IN_CPYTHON 19433 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__neg__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19434 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19435 __pyx_wrapperbase_8PyClical_8clifford_16__neg__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19436 __pyx_wrapperbase_8PyClical_8clifford_16__neg__.doc = __pyx_doc_8PyClical_8clifford_16__neg__;
19437 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_16__neg__;
19441 #if CYTHON_COMPILING_IN_CPYTHON 19443 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__pos__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19444 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19445 __pyx_wrapperbase_8PyClical_8clifford_18__pos__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19446 __pyx_wrapperbase_8PyClical_8clifford_18__pos__.doc = __pyx_doc_8PyClical_8clifford_18__pos__;
19447 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_18__pos__;
19451 #if CYTHON_COMPILING_IN_CPYTHON 19453 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__add__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19454 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19455 __pyx_wrapperbase_8PyClical_8clifford_20__add__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19456 __pyx_wrapperbase_8PyClical_8clifford_20__add__.doc = __pyx_doc_8PyClical_8clifford_20__add__;
19457 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_20__add__;
19461 #if CYTHON_COMPILING_IN_CPYTHON 19463 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__iadd__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19464 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19465 __pyx_wrapperbase_8PyClical_8clifford_22__iadd__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19466 __pyx_wrapperbase_8PyClical_8clifford_22__iadd__.doc = __pyx_doc_8PyClical_8clifford_22__iadd__;
19467 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_22__iadd__;
19471 #if CYTHON_COMPILING_IN_CPYTHON 19473 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__sub__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19474 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19475 __pyx_wrapperbase_8PyClical_8clifford_24__sub__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19476 __pyx_wrapperbase_8PyClical_8clifford_24__sub__.doc = __pyx_doc_8PyClical_8clifford_24__sub__;
19477 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_24__sub__;
19481 #if CYTHON_COMPILING_IN_CPYTHON 19483 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__isub__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19484 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19485 __pyx_wrapperbase_8PyClical_8clifford_26__isub__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19486 __pyx_wrapperbase_8PyClical_8clifford_26__isub__.doc = __pyx_doc_8PyClical_8clifford_26__isub__;
19487 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_26__isub__;
19491 #if CYTHON_COMPILING_IN_CPYTHON 19493 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__mul__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19494 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19495 __pyx_wrapperbase_8PyClical_8clifford_28__mul__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19496 __pyx_wrapperbase_8PyClical_8clifford_28__mul__.doc = __pyx_doc_8PyClical_8clifford_28__mul__;
19497 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_28__mul__;
19501 #if CYTHON_COMPILING_IN_CPYTHON 19503 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__imul__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19504 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19505 __pyx_wrapperbase_8PyClical_8clifford_30__imul__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19506 __pyx_wrapperbase_8PyClical_8clifford_30__imul__.doc = __pyx_doc_8PyClical_8clifford_30__imul__;
19507 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_30__imul__;
19511 #if CYTHON_COMPILING_IN_CPYTHON 19513 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__mod__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19514 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19515 __pyx_wrapperbase_8PyClical_8clifford_32__mod__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19516 __pyx_wrapperbase_8PyClical_8clifford_32__mod__.doc = __pyx_doc_8PyClical_8clifford_32__mod__;
19517 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_32__mod__;
19521 #if CYTHON_COMPILING_IN_CPYTHON 19523 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__imod__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19524 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19525 __pyx_wrapperbase_8PyClical_8clifford_34__imod__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19526 __pyx_wrapperbase_8PyClical_8clifford_34__imod__.doc = __pyx_doc_8PyClical_8clifford_34__imod__;
19527 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_34__imod__;
19531 #if CYTHON_COMPILING_IN_CPYTHON 19533 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__and__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19534 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19535 __pyx_wrapperbase_8PyClical_8clifford_36__and__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19536 __pyx_wrapperbase_8PyClical_8clifford_36__and__.doc = __pyx_doc_8PyClical_8clifford_36__and__;
19537 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_36__and__;
19541 #if CYTHON_COMPILING_IN_CPYTHON 19543 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__iand__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19544 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19545 __pyx_wrapperbase_8PyClical_8clifford_38__iand__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19546 __pyx_wrapperbase_8PyClical_8clifford_38__iand__.doc = __pyx_doc_8PyClical_8clifford_38__iand__;
19547 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_38__iand__;
19551 #if CYTHON_COMPILING_IN_CPYTHON 19553 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__xor__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19554 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19555 __pyx_wrapperbase_8PyClical_8clifford_40__xor__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19556 __pyx_wrapperbase_8PyClical_8clifford_40__xor__.doc = __pyx_doc_8PyClical_8clifford_40__xor__;
19557 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_40__xor__;
19561 #if CYTHON_COMPILING_IN_CPYTHON 19563 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__ixor__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19564 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19565 __pyx_wrapperbase_8PyClical_8clifford_42__ixor__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19566 __pyx_wrapperbase_8PyClical_8clifford_42__ixor__.doc = __pyx_doc_8PyClical_8clifford_42__ixor__;
19567 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_42__ixor__;
19571 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 19572 #if CYTHON_COMPILING_IN_CPYTHON 19574 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__div__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19575 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19576 __pyx_wrapperbase_8PyClical_8clifford_44__div__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19577 __pyx_wrapperbase_8PyClical_8clifford_44__div__.doc = __pyx_doc_8PyClical_8clifford_44__div__;
19578 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_44__div__;
19583 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 19584 #if CYTHON_COMPILING_IN_CPYTHON 19586 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__idiv__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19587 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19588 __pyx_wrapperbase_8PyClical_8clifford_46__idiv__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19589 __pyx_wrapperbase_8PyClical_8clifford_46__idiv__.doc = __pyx_doc_8PyClical_8clifford_46__idiv__;
19590 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_46__idiv__;
19595 #if CYTHON_COMPILING_IN_CPYTHON 19597 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__or__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19598 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19599 __pyx_wrapperbase_8PyClical_8clifford_50__or__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19600 __pyx_wrapperbase_8PyClical_8clifford_50__or__.doc = __pyx_doc_8PyClical_8clifford_50__or__;
19601 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_50__or__;
19605 #if CYTHON_COMPILING_IN_CPYTHON 19607 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__ior__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19608 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19609 __pyx_wrapperbase_8PyClical_8clifford_52__ior__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19610 __pyx_wrapperbase_8PyClical_8clifford_52__ior__.doc = __pyx_doc_8PyClical_8clifford_52__ior__;
19611 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_52__ior__;
19615 #if CYTHON_COMPILING_IN_CPYTHON 19617 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__pow__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19618 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19619 __pyx_wrapperbase_8PyClical_8clifford_54__pow__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19620 __pyx_wrapperbase_8PyClical_8clifford_54__pow__.doc = __pyx_doc_8PyClical_8clifford_54__pow__;
19621 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_54__pow__;
19625 #if CYTHON_COMPILING_IN_CPYTHON 19627 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__call__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19628 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19629 __pyx_wrapperbase_8PyClical_8clifford_60__call__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19630 __pyx_wrapperbase_8PyClical_8clifford_60__call__.doc = __pyx_doc_8PyClical_8clifford_60__call__;
19631 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_60__call__;
19635 #if CYTHON_COMPILING_IN_CPYTHON 19637 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__repr__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19638 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19639 __pyx_wrapperbase_8PyClical_8clifford_92__repr__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19640 __pyx_wrapperbase_8PyClical_8clifford_92__repr__.doc = __pyx_doc_8PyClical_8clifford_92__repr__;
19641 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_92__repr__;
19645 #if CYTHON_COMPILING_IN_CPYTHON 19647 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__str__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19648 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19649 __pyx_wrapperbase_8PyClical_8clifford_94__str__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19650 __pyx_wrapperbase_8PyClical_8clifford_94__str__.doc = __pyx_doc_8PyClical_8clifford_94__str__;
19651 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_94__str__;
19655 if (__Pyx_SetVtable(__pyx_type_8PyClical_clifford.tp_dict, __pyx_vtabptr_8PyClical_clifford) < 0) __PYX_ERR(0, 535, __pyx_L1_error)
19656 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_clifford, (PyObject *)&__pyx_type_8PyClical_clifford) < 0) __PYX_ERR(0, 535, __pyx_L1_error)
19657 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8PyClical_clifford) < 0) __PYX_ERR(0, 535, __pyx_L1_error)
19658 __pyx_ptype_8PyClical_clifford = &__pyx_type_8PyClical_clifford;
19659 if (PyType_Ready(&__pyx_type_8PyClical___pyx_scope_struct____iter__) < 0) __PYX_ERR(0, 227, __pyx_L1_error)
19660 __pyx_type_8PyClical___pyx_scope_struct____iter__.tp_print = 0;
19661 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8PyClical___pyx_scope_struct____iter__.tp_dictoffset && __pyx_type_8PyClical___pyx_scope_struct____iter__.tp_getattro == PyObject_GenericGetAttr)) {
19662 __pyx_type_8PyClical___pyx_scope_struct____iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
19664 __pyx_ptype_8PyClical___pyx_scope_struct____iter__ = &__pyx_type_8PyClical___pyx_scope_struct____iter__;
19665 __Pyx_RefNannyFinishContext();
19668 __Pyx_RefNannyFinishContext();
19672 static int __Pyx_modinit_type_import_code(
void) {
19673 __Pyx_RefNannyDeclarations
19674 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_import_code", 0);
19676 __Pyx_RefNannyFinishContext();
19680 static int __Pyx_modinit_variable_import_code(
void) {
19681 __Pyx_RefNannyDeclarations
19682 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_import_code", 0);
19684 __Pyx_RefNannyFinishContext();
19688 static int __Pyx_modinit_function_import_code(
void) {
19689 __Pyx_RefNannyDeclarations
19690 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_import_code", 0);
19692 __Pyx_RefNannyFinishContext();
19697 #if PY_MAJOR_VERSION < 3 19698 #ifdef CYTHON_NO_PYINIT_EXPORT 19699 #define __Pyx_PyMODINIT_FUNC void 19701 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC 19704 #ifdef CYTHON_NO_PYINIT_EXPORT 19705 #define __Pyx_PyMODINIT_FUNC PyObject * 19707 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC 19712 #if PY_MAJOR_VERSION < 3 19713 __Pyx_PyMODINIT_FUNC initPyClical(
void) CYTHON_SMALL_CODE;
19714 __Pyx_PyMODINIT_FUNC initPyClical(
void)
19716 __Pyx_PyMODINIT_FUNC PyInit_PyClical(
void) CYTHON_SMALL_CODE;
19717 __Pyx_PyMODINIT_FUNC PyInit_PyClical(
void)
19718 #if CYTHON_PEP489_MULTI_PHASE_INIT 19720 return PyModuleDef_Init(&__pyx_moduledef);
19722 static CYTHON_SMALL_CODE
int __Pyx_check_single_interpreter(
void) {
19723 #if PY_VERSION_HEX >= 0x030700A1 19724 static PY_INT64_T main_interpreter_id = -1;
19725 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
19726 if (main_interpreter_id == -1) {
19727 main_interpreter_id = current_id;
19728 return (unlikely(current_id == -1)) ? -1 : 0;
19729 }
else if (unlikely(main_interpreter_id != current_id))
19731 static PyInterpreterState *main_interpreter = NULL;
19732 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
19733 if (!main_interpreter) {
19734 main_interpreter = current_interpreter;
19735 }
else if (unlikely(main_interpreter != current_interpreter))
19740 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
19745 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) {
19746 PyObject *value = PyObject_GetAttrString(spec, from_name);
19748 if (likely(value)) {
19749 if (allow_none || value != Py_None) {
19750 result = PyDict_SetItemString(moddict, to_name, value);
19753 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
19760 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
19761 PyObject *module = NULL, *moddict, *modname;
19762 if (__Pyx_check_single_interpreter())
19765 return __Pyx_NewRef(__pyx_m);
19766 modname = PyObject_GetAttrString(spec,
"name");
19767 if (unlikely(!modname))
goto bad;
19768 module = PyModule_NewObject(modname);
19769 Py_DECREF(modname);
19770 if (unlikely(!module))
goto bad;
19771 moddict = PyModule_GetDict(module);
19772 if (unlikely(!moddict))
goto bad;
19773 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__", 1) < 0))
goto bad;
19774 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__", 1) < 0))
goto bad;
19775 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__", 1) < 0))
goto bad;
19776 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__", 0) < 0))
goto bad;
19779 Py_XDECREF(module);
19784 static CYTHON_SMALL_CODE
int __pyx_pymod_exec_PyClical(PyObject *__pyx_pyinit_module)
19788 PyObject *__pyx_t_1 = NULL;
19789 PyObject *__pyx_t_2 = NULL;
19790 PyObject *__pyx_t_3 = NULL;
19792 __Pyx_RefNannyDeclarations
19793 #if CYTHON_PEP489_MULTI_PHASE_INIT 19795 if (__pyx_m == __pyx_pyinit_module)
return 0;
19796 PyErr_SetString(PyExc_RuntimeError,
"Module 'PyClical' has already been imported. Re-initialisation is not supported.");
19799 #elif PY_MAJOR_VERSION >= 3 19800 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
19802 #if CYTHON_REFNANNY 19803 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
19804 if (!__Pyx_RefNanny) {
19806 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
19807 if (!__Pyx_RefNanny)
19808 Py_FatalError(
"failed to import 'refnanny' module");
19811 __Pyx_RefNannySetupContext(
"__Pyx_PyMODINIT_FUNC PyInit_PyClical(void)", 0);
19812 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
19813 #ifdef __Pxy_PyFrame_Initialize_Offsets 19814 __Pxy_PyFrame_Initialize_Offsets();
19816 __pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
19817 __pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
19818 __pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
19819 #ifdef __Pyx_CyFunction_USED 19820 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
19822 #ifdef __Pyx_FusedFunction_USED 19823 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
19825 #ifdef __Pyx_Coroutine_USED 19826 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
19828 #ifdef __Pyx_Generator_USED 19829 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
19831 #ifdef __Pyx_AsyncGen_USED 19832 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
19834 #ifdef __Pyx_StopAsyncIteration_USED 19835 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
19839 #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS 19841 PyEval_InitThreads();
19845 #if CYTHON_PEP489_MULTI_PHASE_INIT 19846 __pyx_m = __pyx_pyinit_module;
19847 Py_INCREF(__pyx_m);
19849 #if PY_MAJOR_VERSION < 3 19850 __pyx_m = Py_InitModule4(
"PyClical", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
19852 __pyx_m = PyModule_Create(&__pyx_moduledef);
19854 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
19856 __pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
19857 Py_INCREF(__pyx_d);
19858 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
19859 __pyx_cython_runtime = PyImport_AddModule((
char *)
"cython_runtime");
if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
19860 #if CYTHON_COMPILING_IN_PYPY 19861 Py_INCREF(__pyx_b);
19863 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
19865 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
19866 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) 19867 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
19869 if (__pyx_module_is_main_PyClical) {
19870 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
19872 #if PY_MAJOR_VERSION >= 3 19874 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
19875 if (!PyDict_GetItemString(modules,
"PyClical")) {
19876 if (unlikely(PyDict_SetItemString(modules,
"PyClical", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
19881 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
19883 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
19885 (void)__Pyx_modinit_global_init_code();
19886 (void)__Pyx_modinit_variable_export_code();
19887 (void)__Pyx_modinit_function_export_code();
19888 if (unlikely(__Pyx_modinit_type_init_code() != 0))
goto __pyx_L1_error;
19889 (void)__Pyx_modinit_type_import_code();
19890 (void)__Pyx_modinit_variable_import_code();
19891 (void)__Pyx_modinit_function_import_code();
19893 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) 19894 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
19904 __pyx_t_1 = __Pyx_Import(__pyx_n_s_math, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
19905 __Pyx_GOTREF(__pyx_t_1);
19906 if (PyDict_SetItem(__pyx_d, __pyx_n_s_math, __pyx_t_1) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
19907 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19916 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numbers, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
19917 __Pyx_GOTREF(__pyx_t_1);
19918 if (PyDict_SetItem(__pyx_d, __pyx_n_s_numbers, __pyx_t_1) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
19919 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19928 __pyx_t_1 = __Pyx_Import(__pyx_n_s_collections, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error)
19929 __Pyx_GOTREF(__pyx_t_1);
19930 if (PyDict_SetItem(__pyx_d, __pyx_n_s_collections, __pyx_t_1) < 0) __PYX_ERR(0, 30, __pyx_L1_error)
19931 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19940 if (PyDict_SetItem(__pyx_d, __pyx_n_s_version, __pyx_kp_s_0_8_2) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
19949 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8PyClical_1index_set_hidden_doctests, NULL, __pyx_n_s_PyClical);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 404, __pyx_L1_error)
19950 __Pyx_GOTREF(__pyx_t_1);
19951 if (PyDict_SetItem(__pyx_d, __pyx_n_s_index_set_hidden_doctests, __pyx_t_1) < 0) __PYX_ERR(0, 404, __pyx_L1_error)
19952 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19961 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8PyClical_9clifford_hidden_doctests, NULL, __pyx_n_s_PyClical);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1243, __pyx_L1_error)
19962 __Pyx_GOTREF(__pyx_t_1);
19963 if (PyDict_SetItem(__pyx_d, __pyx_n_s_clifford_hidden_doctests, __pyx_t_1) < 0) __PYX_ERR(0, 1243, __pyx_L1_error)
19964 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19973 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_tuple__15, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1856, __pyx_L1_error)
19974 __Pyx_GOTREF(__pyx_t_1);
19975 __pyx_t_2 = __pyx_f_8PyClical_atan(__pyx_t_1, 0, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1856, __pyx_L1_error)
19976 __Pyx_GOTREF(__pyx_t_2);
19977 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19978 __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_float_8_0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1856, __pyx_L1_error)
19979 __Pyx_GOTREF(__pyx_t_1);
19980 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19981 if (PyDict_SetItem(__pyx_d, __pyx_n_s_tau, __pyx_t_1) < 0) __PYX_ERR(0, 1856, __pyx_L1_error)
19982 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19991 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_tau);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1857, __pyx_L1_error)
19992 __Pyx_GOTREF(__pyx_t_1);
19993 __pyx_t_2 = __Pyx_PyFloat_DivideObjC(__pyx_t_1, __pyx_float_2_0, 2.0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1857, __pyx_L1_error)
19994 __Pyx_GOTREF(__pyx_t_2);
19995 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19996 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pi, __pyx_t_2) < 0) __PYX_ERR(0, 1857, __pyx_L1_error)
19997 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20006 if (PyDict_SetItem(__pyx_d, __pyx_n_s_cl, ((PyObject *)__pyx_ptype_8PyClical_clifford)) < 0) __PYX_ERR(0, 1859, __pyx_L1_error)
20015 if (PyDict_SetItem(__pyx_d, __pyx_n_s_ist, ((PyObject *)__pyx_ptype_8PyClical_index_set)) < 0) __PYX_ERR(0, 1879, __pyx_L1_error)
20024 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8PyClical_83e, NULL, __pyx_n_s_PyClical);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1887, __pyx_L1_error)
20025 __Pyx_GOTREF(__pyx_t_2);
20026 if (PyDict_SetItem(__pyx_d, __pyx_n_s_e, __pyx_t_2) < 0) __PYX_ERR(0, 1887, __pyx_L1_error)
20027 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20036 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8PyClical_85istpq, NULL, __pyx_n_s_PyClical);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1900, __pyx_L1_error)
20037 __Pyx_GOTREF(__pyx_t_2);
20038 if (PyDict_SetItem(__pyx_d, __pyx_n_s_istpq, __pyx_t_2) < 0) __PYX_ERR(0, 1900, __pyx_L1_error)
20039 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20048 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_e);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1909, __pyx_L1_error)
20049 __Pyx_GOTREF(__pyx_t_2);
20050 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__20, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1909, __pyx_L1_error)
20051 __Pyx_GOTREF(__pyx_t_1);
20052 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20053 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_e);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1909, __pyx_L1_error)
20054 __Pyx_GOTREF(__pyx_t_2);
20055 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__21, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1909, __pyx_L1_error)
20056 __Pyx_GOTREF(__pyx_t_3);
20057 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20058 __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1909, __pyx_L1_error)
20059 __Pyx_GOTREF(__pyx_t_2);
20060 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20061 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20062 if (PyDict_SetItem(__pyx_d, __pyx_n_s_ninf3, __pyx_t_2) < 0) __PYX_ERR(0, 1909, __pyx_L1_error)
20063 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20072 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_e);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1910, __pyx_L1_error)
20073 __Pyx_GOTREF(__pyx_t_2);
20074 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__20, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1910, __pyx_L1_error)
20075 __Pyx_GOTREF(__pyx_t_3);
20076 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20077 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_e);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1910, __pyx_L1_error)
20078 __Pyx_GOTREF(__pyx_t_2);
20079 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__21, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1910, __pyx_L1_error)
20080 __Pyx_GOTREF(__pyx_t_1);
20081 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20082 __pyx_t_2 = PyNumber_Subtract(__pyx_t_3, __pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1910, __pyx_L1_error)
20083 __Pyx_GOTREF(__pyx_t_2);
20084 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20085 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20086 if (PyDict_SetItem(__pyx_d, __pyx_n_s_nbar3, __pyx_t_2) < 0) __PYX_ERR(0, 1910, __pyx_L1_error)
20087 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20096 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8PyClical_87_test, NULL, __pyx_n_s_PyClical);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1913, __pyx_L1_error)
20097 __Pyx_GOTREF(__pyx_t_2);
20098 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1913, __pyx_L1_error)
20099 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20107 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1917, __pyx_L1_error)
20108 __Pyx_GOTREF(__pyx_t_2);
20109 __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_main, Py_EQ));
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1917, __pyx_L1_error)
20110 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20118 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_test);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1918, __pyx_L1_error)
20119 __Pyx_GOTREF(__pyx_t_2);
20120 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1918, __pyx_L1_error)
20121 __Pyx_GOTREF(__pyx_t_1);
20122 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20123 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20138 __pyx_t_1 = __Pyx_PyDict_NewPresized(107);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
20139 __Pyx_GOTREF(__pyx_t_1);
20140 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_index_set_copy_line_64, __pyx_kp_u_Copy_this_index_set_object_s_in) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20141 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_index_set___setitem___line_177, __pyx_kp_u_Set_the_value_of_an_index_set_o) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20142 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_index_set___getitem___line_189, __pyx_kp_u_Get_the_value_of_an_index_set_o) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20143 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_index_set___iter___line_227, __pyx_kp_u_Iterate_over_the_indices_of_an) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20144 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_index_set___invert___line_238, __pyx_kp_u_Set_complement_not_print_index) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20145 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_index_set___xor___line_247, __pyx_kp_u_Symmetric_set_difference_exclus) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20146 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_index_set___ixor___line_258, __pyx_kp_u_Symmetric_set_difference_exclus_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20147 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_index_set___and___line_269, __pyx_kp_u_Set_intersection_and_print_inde) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20148 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_index_set___iand___line_280, __pyx_kp_u_Set_intersection_and_x_index_se) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20149 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_index_set___or___line_291, __pyx_kp_u_Set_union_or_print_index_set_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20150 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_index_set___ior___line_302, __pyx_kp_u_Set_union_or_x_index_set_1_x_in) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20151 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_index_set_count_line_313, __pyx_kp_u_Cardinality_Number_of_indices_i) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20152 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_index_set_count_neg_line_322, __pyx_kp_u_Number_of_negative_indices_incl) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20153 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_index_set_count_pos_line_331, __pyx_kp_u_Number_of_positive_indices_incl) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20154 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_index_set_min_line_340, __pyx_kp_u_Minimum_member_index_set_1_1_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20155 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_index_set_max_line_349, __pyx_kp_u_Maximum_member_index_set_1_1_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20156 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_index_set_sign_of_mult_line_364, __pyx_kp_u_Sign_of_geometric_product_of_tw) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20157 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_index_set_sign_of_square_line_37, __pyx_kp_u_Sign_of_geometric_square_of_a_C) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20158 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_index_set___repr___line_382, __pyx_kp_u_The_official_string_representat) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20159 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_index_set___str___line_393, __pyx_kp_u_The_informal_string_representat) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20160 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_index_set_hidden_doctests_line_4, __pyx_kp_u_Tests_for_functions_that_Doctes) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20161 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_compare_line_490, __pyx_kp_u_lexicographic_compare_eg_3_4_5) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20162 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_min_neg_line_502, __pyx_kp_u_Minimum_negative_index_or_0_if) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20163 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_max_pos_line_511, __pyx_kp_u_Maximum_positive_index_or_0_if) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20164 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_clifford_copy_line_554, __pyx_kp_u_Copy_this_clifford_object_x_cli) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20165 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_clifford___iter___line_637, __pyx_kp_u_Not_applicable_for_a_in_cliffor) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20166 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_clifford_reframe_line_648, __pyx_kp_u_Put_self_into_a_larger_frame_co) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20167 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_clifford___getitem___line_706, __pyx_kp_u_Subscripting_map_from_index_set) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20168 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_clifford___neg___line_721, __pyx_kp_u_Unary_print_clifford_1_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20169 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_clifford___pos___line_730, __pyx_kp_u_Unary_print_clifford_1_1_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20170 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_clifford___add___line_739, __pyx_kp_u_Geometric_sum_print_clifford_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20171 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_clifford___iadd___line_750, __pyx_kp_u_Geometric_sum_x_clifford_1_x_cl) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20172 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_clifford___sub___line_759, __pyx_kp_u_Geometric_difference_print_clif) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20173 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_clifford___isub___line_770, __pyx_kp_u_Geometric_difference_x_clifford) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20174 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_clifford___mul___line_779, __pyx_kp_u_Geometric_product_print_cliffor) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20175 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_clifford___imul___line_792, __pyx_kp_u_Geometric_product_x_clifford_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20176 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_clifford___mod___line_805, __pyx_kp_u_Contraction_print_clifford_1_cl) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20177 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_clifford___imod___line_820, __pyx_kp_u_Contraction_x_clifford_1_x_clif) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20178 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_clifford___and___line_835, __pyx_kp_u_Inner_product_print_clifford_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20179 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_clifford___iand___line_850, __pyx_kp_u_Inner_product_x_clifford_1_x_cl) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20180 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_clifford___xor___line_865, __pyx_kp_u_Outer_product_print_clifford_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20181 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_clifford___ixor___line_880, __pyx_kp_u_Outer_product_x_clifford_1_x_cl) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20182 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_clifford___div___line_895, __pyx_kp_u_Geometric_quotient_print_cliffo) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20183 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_clifford___idiv___line_910, __pyx_kp_u_Geometric_quotient_x_clifford_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20184 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_clifford_inv_line_925, __pyx_kp_u_Geometric_multiplicative_invers) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20185 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_clifford___or___line_938, __pyx_kp_u_Transform_left_hand_side_using) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20186 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_clifford___ior___line_949, __pyx_kp_u_Transform_left_hand_side_using_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20187 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_clifford___pow___line_960, __pyx_kp_u_Power_self_to_the_m_x_clifford) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20188 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_clifford_pow_line_979, __pyx_kp_u_Power_self_to_the_m_x_clifford_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20189 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_clifford_outer_pow_line_1003, __pyx_kp_u_Outer_product_power_x_clifford) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20190 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_clifford___call___line_1019, __pyx_kp_u_Pure_grade_vector_part_print_cl) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20191 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_clifford_scalar_line_1038, __pyx_kp_u_Scalar_part_clifford_1_1_1_2_sc) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20192 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_clifford_pure_line_1049, __pyx_kp_u_Pure_part_print_clifford_1_1_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20193 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_clifford_even_line_1060, __pyx_kp_u_Even_part_of_multivector_sum_of) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20194 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_clifford_odd_line_1069, __pyx_kp_u_Odd_part_of_multivector_sum_of) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20195 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_clifford_vector_part_line_1078, __pyx_kp_u_Vector_part_of_multivector_as_a) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20196 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_clifford_involute_line_1106, __pyx_kp_u_Main_involution_each_i_is_repla) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20197 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_clifford_reverse_line_1122, __pyx_kp_u_Reversion_eg_clifford_1_cliffor) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20198 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_clifford_conj_line_1137, __pyx_kp_u_Conjugation_reverse_o_involute) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20199 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_clifford_quad_line_1152, __pyx_kp_u_Quadratic_form_rev_x_x_0_print) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20200 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_clifford_norm_line_1163, __pyx_kp_u_Norm_sum_of_squares_of_coordina) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20201 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_clifford_abs_line_1174, __pyx_kp_u_Absolute_value_square_root_of_n) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20202 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_clifford_max_abs_line_1183, __pyx_kp_u_Maximum_of_absolute_values_of_c) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20203 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_clifford_truncated_line_1194, __pyx_kp_u_Remove_all_terms_of_self_with_r) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20204 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_clifford_isnan_line_1205, __pyx_kp_u_Check_if_a_multivector_contains) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20205 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_clifford_frame_line_1214, __pyx_kp_u_Subalgebra_generated_by_all_gen) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20206 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_clifford___repr___line_1225, __pyx_kp_u_The_official_string_representat_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20207 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_clifford___str___line_1234, __pyx_kp_u_The_informal_string_representat_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20208 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_clifford_hidden_doctests_line_12, __pyx_kp_u_Tests_for_functions_that_Doctes_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20209 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_inv_line_1329, __pyx_kp_u_Geometric_multiplicative_invers_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20210 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_scalar_line_1344, __pyx_kp_u_Scalar_part_scalar_clifford_1_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20211 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_real_line_1355, __pyx_kp_u_Real_part_synonym_for_scalar_pa) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20212 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_imag_line_1366, __pyx_kp_u_Imaginary_part_deprecated_alway) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20213 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_pure_line_1377, __pyx_kp_u_Pure_part_print_pure_clifford_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20214 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_even_line_1388, __pyx_kp_u_Even_part_of_multivector_sum_of_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20215 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_odd_line_1397, __pyx_kp_u_Odd_part_of_multivector_sum_of_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20216 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_involute_line_1406, __pyx_kp_u_Main_involution_each_i_is_repla_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20217 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_reverse_line_1421, __pyx_kp_u_Reversion_eg_1_2_2_1_print_reve) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20218 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_conj_line_1436, __pyx_kp_u_Conjugation_reverse_o_involute_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20219 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_quad_line_1451, __pyx_kp_u_Quadratic_form_rev_x_x_0_print_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20220 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_norm_line_1462, __pyx_kp_u_norm_sum_of_squares_of_coordina) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20221 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_abs_line_1473, __pyx_kp_u_Absolute_value_of_multivector_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20222 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_max_abs_line_1482, __pyx_kp_u_Maximum_absolute_value_of_coord) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20223 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_pow_line_1494, __pyx_kp_u_Integer_power_of_multivector_ob) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20224 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_outer_pow_line_1518, __pyx_kp_u_Outer_product_power_of_multivec) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20225 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_complexifier_line_1527, __pyx_kp_u_Square_root_of_1_which_commutes) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20226 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_sqrt_line_1542, __pyx_kp_u_Square_root_of_multivector_with) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20227 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_exp_line_1565, __pyx_kp_u_Exponential_of_multivector_x_cl) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20228 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_log_line_1579, __pyx_kp_u_Natural_logarithm_of_multivecto) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20229 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_cos_line_1602, __pyx_kp_u_Cosine_of_multivector_with_opti) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20230 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_acos_line_1619, __pyx_kp_u_Inverse_cosine_of_multivector_w) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20231 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_cosh_line_1640, __pyx_kp_u_Hyperbolic_cosine_of_multivecto) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20232 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_acosh_line_1656, __pyx_kp_u_Inverse_hyperbolic_cosine_of_mu) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20233 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_sin_line_1679, __pyx_kp_u_Sine_of_multivector_with_option) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20234 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_asin_line_1698, __pyx_kp_u_Inverse_sine_of_multivector_wit) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20235 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_sinh_line_1719, __pyx_kp_u_Hyperbolic_sine_of_multivector) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20236 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_asinh_line_1733, __pyx_kp_u_Inverse_hyperbolic_sine_of_mult) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20237 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_tan_line_1752, __pyx_kp_u_Tangent_of_multivector_with_opt) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20238 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_atan_line_1769, __pyx_kp_u_Inverse_tangent_of_multivector) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20239 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_tanh_line_1786, __pyx_kp_u_Hyperbolic_tangent_of_multivect) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20240 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_atanh_line_1798, __pyx_kp_u_Inverse_hyperbolic_tangent_of_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20241 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_random_clifford_line_1815, __pyx_kp_u_Random_multivector_within_a_fra) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20242 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_cga3_line_1824, __pyx_kp_u_Convert_Euclidean_3D_multivecto) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20243 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_cga3std_line_1833, __pyx_kp_u_Convert_CGA3_null_vector_to_sta) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20244 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_agc3_line_1844, __pyx_kp_u_Convert_CGA3_null_vector_to_Euc) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20245 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_e_line_1887, __pyx_kp_u_Abbreviation_for_clifford_index) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20246 if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_istpq_line_1900, __pyx_kp_u_Abbreviation_for_index_set_q_p) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20247 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_2, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20248 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20254 __Pyx_XDECREF(__pyx_t_1);
20255 __Pyx_XDECREF(__pyx_t_2);
20256 __Pyx_XDECREF(__pyx_t_3);
20259 __Pyx_AddTraceback(
"init PyClical", __pyx_clineno, __pyx_lineno, __pyx_filename);
20262 }
else if (!PyErr_Occurred()) {
20263 PyErr_SetString(PyExc_ImportError,
"init PyClical");
20266 __Pyx_RefNannyFinishContext();
20267 #if CYTHON_PEP489_MULTI_PHASE_INIT 20268 return (__pyx_m != NULL) ? 0 : -1;
20269 #elif PY_MAJOR_VERSION >= 3 20278 #if CYTHON_REFNANNY 20279 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
20280 PyObject *m = NULL, *p = NULL;
20282 m = PyImport_ImportModule(modname);
20284 p = PyObject_GetAttrString(m,
"RefNannyAPI");
20286 r = PyLong_AsVoidPtr(p);
20290 return (__Pyx_RefNannyAPIStruct *)r;
20295 #if CYTHON_USE_TYPE_SLOTS 20296 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject*
obj, PyObject* attr_name) {
20297 PyTypeObject* tp = Py_TYPE(
obj);
20298 if (likely(tp->tp_getattro))
20299 return tp->tp_getattro(
obj, attr_name);
20300 #if PY_MAJOR_VERSION < 3 20301 if (likely(tp->tp_getattr))
20302 return tp->tp_getattr(
obj, PyString_AS_STRING(attr_name));
20304 return PyObject_GetAttr(
obj, attr_name);
20309 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
20310 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
20311 if (unlikely(!result)) {
20312 PyErr_Format(PyExc_NameError,
20313 #
if PY_MAJOR_VERSION >= 3
20314 "name '%U' is not defined", name);
20316 "name '%.200s' is not defined", PyString_AS_STRING(name));
20323 #if CYTHON_FAST_PYCCALL 20324 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
20325 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
20326 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
20327 PyObject *
self = PyCFunction_GET_SELF(func);
20328 int flags = PyCFunction_GET_FLAGS(func);
20329 assert(PyCFunction_Check(func));
20330 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
20331 assert(nargs >= 0);
20332 assert(nargs == 0 || args != NULL);
20336 assert(!PyErr_Occurred());
20337 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
20338 return (*((__Pyx_PyCFunctionFastWithKeywords)(
void*)meth)) (
self, args, nargs, NULL);
20340 return (*((__Pyx_PyCFunctionFast)(
void*)meth)) (
self, args, nargs);
20346 #if CYTHON_FAST_PYCALL 20347 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
20348 PyObject *globals) {
20350 PyThreadState *tstate = __Pyx_PyThreadState_Current;
20351 PyObject **fastlocals;
20354 assert(globals != NULL);
20359 assert(tstate != NULL);
20360 f = PyFrame_New(tstate, co, globals, NULL);
20364 fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
20365 for (
i = 0;
i < na;
i++) {
20367 fastlocals[
i] = *args++;
20369 result = PyEval_EvalFrameEx(f,0);
20370 ++tstate->recursion_depth;
20372 --tstate->recursion_depth;
20375 #if 1 || PY_VERSION_HEX < 0x030600B1 20376 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
int nargs, PyObject *kwargs) {
20377 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
20378 PyObject *globals = PyFunction_GET_GLOBALS(func);
20379 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
20381 #if PY_MAJOR_VERSION >= 3 20384 PyObject *kwtuple, **k;
20389 assert(kwargs == NULL || PyDict_Check(kwargs));
20390 nk = kwargs ? PyDict_Size(kwargs) : 0;
20391 if (Py_EnterRecursiveCall((
char*)
" while calling a Python object")) {
20395 #
if PY_MAJOR_VERSION >= 3
20396 co->co_kwonlyargcount == 0 &&
20398 likely(kwargs == NULL || nk == 0) &&
20399 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
20400 if (argdefs == NULL && co->co_argcount == nargs) {
20401 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
20404 else if (nargs == 0 && argdefs != NULL
20405 && co->co_argcount == Py_SIZE(argdefs)) {
20408 args = &PyTuple_GET_ITEM(argdefs, 0);
20409 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
20413 if (kwargs != NULL) {
20415 kwtuple = PyTuple_New(2 * nk);
20416 if (kwtuple == NULL) {
20420 k = &PyTuple_GET_ITEM(kwtuple, 0);
20422 while (PyDict_Next(kwargs, &pos, &k[
i], &k[
i+1])) {
20433 closure = PyFunction_GET_CLOSURE(func);
20434 #if PY_MAJOR_VERSION >= 3 20435 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
20437 if (argdefs != NULL) {
20438 d = &PyTuple_GET_ITEM(argdefs, 0);
20439 nd = Py_SIZE(argdefs);
20445 #if PY_MAJOR_VERSION >= 3 20446 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
20449 d, (
int)nd, kwdefs, closure);
20451 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
20454 d, (
int)nd, closure);
20456 Py_XDECREF(kwtuple);
20458 Py_LeaveRecursiveCall();
20465 #if CYTHON_COMPILING_IN_CPYTHON 20466 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
20468 ternaryfunc call = func->ob_type->tp_call;
20469 if (unlikely(!call))
20470 return PyObject_Call(func, arg, kw);
20471 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
20473 result = (*call)(func, arg, kw);
20474 Py_LeaveRecursiveCall();
20475 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
20478 "NULL result without error in PyObject_Call");
20485 #if CYTHON_COMPILING_IN_CPYTHON 20486 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
20487 PyObject *
self, *result;
20489 cfunc = PyCFunction_GET_FUNCTION(func);
20490 self = PyCFunction_GET_SELF(func);
20491 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
20493 result = cfunc(
self, arg);
20494 Py_LeaveRecursiveCall();
20495 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
20498 "NULL result without error in PyObject_Call");
20505 #if CYTHON_COMPILING_IN_CPYTHON 20506 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
20508 PyObject *args = PyTuple_New(1);
20509 if (unlikely(!args))
return NULL;
20511 PyTuple_SET_ITEM(args, 0, arg);
20512 result = __Pyx_PyObject_Call(func, args, NULL);
20516 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
20517 #if CYTHON_FAST_PYCALL 20518 if (PyFunction_Check(func)) {
20519 return __Pyx_PyFunction_FastCall(func, &arg, 1);
20522 if (likely(PyCFunction_Check(func))) {
20523 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
20524 return __Pyx_PyObject_CallMethO(func, arg);
20525 #if CYTHON_FAST_PYCCALL 20526 }
else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
20527 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
20531 return __Pyx__PyObject_CallOneArg(func, arg);
20534 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
20536 PyObject *args = PyTuple_Pack(1, arg);
20537 if (unlikely(!args))
return NULL;
20538 result = __Pyx_PyObject_Call(func, args, NULL);
20545 #if CYTHON_FAST_THREAD_STATE 20546 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
20547 PyObject *tmp_type, *tmp_value, *tmp_tb;
20548 tmp_type = tstate->curexc_type;
20549 tmp_value = tstate->curexc_value;
20550 tmp_tb = tstate->curexc_traceback;
20551 tstate->curexc_type = type;
20552 tstate->curexc_value = value;
20553 tstate->curexc_traceback = tb;
20554 Py_XDECREF(tmp_type);
20555 Py_XDECREF(tmp_value);
20556 Py_XDECREF(tmp_tb);
20558 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
20559 *type = tstate->curexc_type;
20560 *value = tstate->curexc_value;
20561 *tb = tstate->curexc_traceback;
20562 tstate->curexc_type = 0;
20563 tstate->curexc_value = 0;
20564 tstate->curexc_traceback = 0;
20569 static void __Pyx_WriteUnraisable(
const char *name, CYTHON_UNUSED
int clineno,
20570 CYTHON_UNUSED
int lineno, CYTHON_UNUSED
const char *filename,
20571 int full_traceback, CYTHON_UNUSED
int nogil) {
20572 PyObject *old_exc, *old_val, *old_tb;
20574 __Pyx_PyThreadState_declare
20576 PyGILState_STATE state;
20578 state = PyGILState_Ensure();
20580 else state = (PyGILState_STATE)-1;
20583 __Pyx_PyThreadState_assign
20584 __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
20585 if (full_traceback) {
20586 Py_XINCREF(old_exc);
20587 Py_XINCREF(old_val);
20588 Py_XINCREF(old_tb);
20589 __Pyx_ErrRestore(old_exc, old_val, old_tb);
20592 #if PY_MAJOR_VERSION < 3 20593 ctx = PyString_FromString(name);
20595 ctx = PyUnicode_FromString(name);
20597 __Pyx_ErrRestore(old_exc, old_val, old_tb);
20599 PyErr_WriteUnraisable(Py_None);
20601 PyErr_WriteUnraisable(ctx);
20606 PyGILState_Release(state);
20611 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS 20612 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *
obj) {
20613 PyObject *dict = Py_TYPE(
obj)->tp_dict;
20614 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
20616 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *
obj) {
20617 PyObject **dictptr = NULL;
20618 Py_ssize_t offset = Py_TYPE(
obj)->tp_dictoffset;
20620 #if CYTHON_COMPILING_IN_CPYTHON 20621 dictptr = (likely(offset > 0)) ? (PyObject **) ((
char *)
obj + offset) : _PyObject_GetDictPtr(
obj);
20623 dictptr = _PyObject_GetDictPtr(
obj);
20626 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
20628 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject*
obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
20629 PyObject *dict = Py_TYPE(
obj)->tp_dict;
20630 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
20632 return obj_dict_version == __Pyx_get_object_dict_version(
obj);
20637 #if CYTHON_COMPILING_IN_CPYTHON 20638 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
20639 #if CYTHON_FAST_PYCALL 20640 if (PyFunction_Check(func)) {
20641 return __Pyx_PyFunction_FastCall(func, NULL, 0);
20644 #ifdef __Pyx_CyFunction_USED 20645 if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
20647 if (likely(PyCFunction_Check(func)))
20650 if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
20651 return __Pyx_PyObject_CallMethO(func, NULL);
20654 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
20659 static void __Pyx_RaiseDoubleKeywordsError(
20660 const char* func_name,
20663 PyErr_Format(PyExc_TypeError,
20664 #
if PY_MAJOR_VERSION >= 3
20665 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
20667 "%s() got multiple values for keyword argument '%s'", func_name,
20668 PyString_AsString(kw_name));
20673 static int __Pyx_ParseOptionalKeywords(
20675 PyObject **argnames[],
20677 PyObject *values[],
20678 Py_ssize_t num_pos_args,
20679 const char* function_name)
20681 PyObject *key = 0, *value = 0;
20682 Py_ssize_t pos = 0;
20684 PyObject*** first_kw_arg = argnames + num_pos_args;
20685 while (PyDict_Next(kwds, &pos, &key, &value)) {
20686 name = first_kw_arg;
20687 while (*name && (**name != key)) name++;
20689 values[name-argnames] = value;
20692 name = first_kw_arg;
20693 #if PY_MAJOR_VERSION < 3 20694 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
20696 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
20697 && _PyString_Eq(**name, key)) {
20698 values[name-argnames] = value;
20703 if (*name)
continue;
20705 PyObject*** argname = argnames;
20706 while (argname != first_kw_arg) {
20707 if ((**argname == key) || (
20708 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
20709 && _PyString_Eq(**argname, key))) {
20710 goto arg_passed_twice;
20717 if (likely(PyUnicode_Check(key))) {
20719 int cmp = (**name == key) ? 0 :
20720 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
20721 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
20723 PyUnicode_Compare(**name, key);
20724 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
20726 values[name-argnames] = value;
20731 if (*name)
continue;
20733 PyObject*** argname = argnames;
20734 while (argname != first_kw_arg) {
20735 int cmp = (**argname == key) ? 0 :
20736 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
20737 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
20739 PyUnicode_Compare(**argname, key);
20740 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
20741 if (cmp == 0)
goto arg_passed_twice;
20746 goto invalid_keyword_type;
20748 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
20750 goto invalid_keyword;
20755 __Pyx_RaiseDoubleKeywordsError(function_name, key);
20757 invalid_keyword_type:
20758 PyErr_Format(PyExc_TypeError,
20759 "%.200s() keywords must be strings", function_name);
20762 PyErr_Format(PyExc_TypeError,
20763 #
if PY_MAJOR_VERSION < 3
20764 "%.200s() got an unexpected keyword argument '%.200s'",
20765 function_name, PyString_AsString(key));
20767 "%s() got an unexpected keyword argument '%U'",
20768 function_name, key);
20775 static void __Pyx_RaiseArgtupleInvalid(
20776 const char* func_name,
20778 Py_ssize_t num_min,
20779 Py_ssize_t num_max,
20780 Py_ssize_t num_found)
20782 Py_ssize_t num_expected;
20783 const char *more_or_less;
20784 if (num_found < num_min) {
20785 num_expected = num_min;
20786 more_or_less =
"at least";
20788 num_expected = num_max;
20789 more_or_less =
"at most";
20792 more_or_less =
"exactly";
20794 PyErr_Format(PyExc_TypeError,
20795 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
20796 func_name, more_or_less, num_expected,
20797 (num_expected == 1) ?
"" :
"s", num_found);
20801 #if CYTHON_USE_DICT_VERSIONS 20802 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
20804 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
20808 #if !CYTHON_AVOID_BORROWED_REFS 20809 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 20810 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
20811 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
20812 if (likely(result)) {
20813 return __Pyx_NewRef(result);
20814 }
else if (unlikely(PyErr_Occurred())) {
20818 result = PyDict_GetItem(__pyx_d, name);
20819 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
20820 if (likely(result)) {
20821 return __Pyx_NewRef(result);
20825 result = PyObject_GetItem(__pyx_d, name);
20826 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
20827 if (likely(result)) {
20828 return __Pyx_NewRef(result);
20832 return __Pyx_GetBuiltinName(name);
20836 #if CYTHON_USE_EXC_INFO_STACK 20837 static _PyErr_StackItem *
20838 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
20840 _PyErr_StackItem *exc_info = tstate->exc_info;
20841 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
20842 exc_info->previous_item != NULL)
20844 exc_info = exc_info->previous_item;
20851 #if CYTHON_FAST_THREAD_STATE 20852 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
20853 #if CYTHON_USE_EXC_INFO_STACK 20854 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
20855 *type = exc_info->exc_type;
20856 *value = exc_info->exc_value;
20857 *tb = exc_info->exc_traceback;
20859 *type = tstate->exc_type;
20860 *value = tstate->exc_value;
20861 *tb = tstate->exc_traceback;
20864 Py_XINCREF(*value);
20867 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
20868 PyObject *tmp_type, *tmp_value, *tmp_tb;
20869 #if CYTHON_USE_EXC_INFO_STACK 20870 _PyErr_StackItem *exc_info = tstate->exc_info;
20871 tmp_type = exc_info->exc_type;
20872 tmp_value = exc_info->exc_value;
20873 tmp_tb = exc_info->exc_traceback;
20874 exc_info->exc_type = type;
20875 exc_info->exc_value = value;
20876 exc_info->exc_traceback = tb;
20878 tmp_type = tstate->exc_type;
20879 tmp_value = tstate->exc_value;
20880 tmp_tb = tstate->exc_traceback;
20881 tstate->exc_type = type;
20882 tstate->exc_value = value;
20883 tstate->exc_traceback = tb;
20885 Py_XDECREF(tmp_type);
20886 Py_XDECREF(tmp_value);
20887 Py_XDECREF(tmp_tb);
20892 #if CYTHON_FAST_THREAD_STATE 20893 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
20895 n = PyTuple_GET_SIZE(tuple);
20896 #if PY_MAJOR_VERSION >= 3 20897 for (
i=0;
i<n;
i++) {
20898 if (exc_type == PyTuple_GET_ITEM(tuple,
i))
return 1;
20901 for (
i=0;
i<n;
i++) {
20902 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple,
i)))
return 1;
20906 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
20907 PyObject *exc_type = tstate->curexc_type;
20908 if (exc_type == err)
return 1;
20909 if (unlikely(!exc_type))
return 0;
20910 if (unlikely(PyTuple_Check(err)))
20911 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
20912 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
20917 #if CYTHON_FAST_THREAD_STATE 20918 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
20920 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
20923 PyObject *local_type, *local_value, *local_tb;
20924 #if CYTHON_FAST_THREAD_STATE 20925 PyObject *tmp_type, *tmp_value, *tmp_tb;
20926 local_type = tstate->curexc_type;
20927 local_value = tstate->curexc_value;
20928 local_tb = tstate->curexc_traceback;
20929 tstate->curexc_type = 0;
20930 tstate->curexc_value = 0;
20931 tstate->curexc_traceback = 0;
20933 PyErr_Fetch(&local_type, &local_value, &local_tb);
20935 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
20936 #if CYTHON_FAST_THREAD_STATE 20937 if (unlikely(tstate->curexc_type))
20939 if (unlikely(PyErr_Occurred()))
20942 #if PY_MAJOR_VERSION >= 3 20944 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
20948 Py_XINCREF(local_tb);
20949 Py_XINCREF(local_type);
20950 Py_XINCREF(local_value);
20951 *type = local_type;
20952 *value = local_value;
20954 #if CYTHON_FAST_THREAD_STATE 20955 #if CYTHON_USE_EXC_INFO_STACK 20957 _PyErr_StackItem *exc_info = tstate->exc_info;
20958 tmp_type = exc_info->exc_type;
20959 tmp_value = exc_info->exc_value;
20960 tmp_tb = exc_info->exc_traceback;
20961 exc_info->exc_type = local_type;
20962 exc_info->exc_value = local_value;
20963 exc_info->exc_traceback = local_tb;
20966 tmp_type = tstate->exc_type;
20967 tmp_value = tstate->exc_value;
20968 tmp_tb = tstate->exc_traceback;
20969 tstate->exc_type = local_type;
20970 tstate->exc_value = local_value;
20971 tstate->exc_traceback = local_tb;
20973 Py_XDECREF(tmp_type);
20974 Py_XDECREF(tmp_value);
20975 Py_XDECREF(tmp_tb);
20977 PyErr_SetExcInfo(local_type, local_value, local_tb);
20984 Py_XDECREF(local_type);
20985 Py_XDECREF(local_value);
20986 Py_XDECREF(local_tb);
20991 #if PY_MAJOR_VERSION < 3 20992 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
20993 CYTHON_UNUSED PyObject *cause) {
20994 __Pyx_PyThreadState_declare
20996 if (!value || value == Py_None)
21000 if (!tb || tb == Py_None)
21004 if (!PyTraceBack_Check(tb)) {
21005 PyErr_SetString(PyExc_TypeError,
21006 "raise: arg 3 must be a traceback or None");
21010 if (PyType_Check(type)) {
21011 #if CYTHON_COMPILING_IN_PYPY 21013 Py_INCREF(Py_None);
21017 PyErr_NormalizeException(&type, &value, &tb);
21020 PyErr_SetString(PyExc_TypeError,
21021 "instance exception may not have a separate value");
21025 type = (PyObject*) Py_TYPE(type);
21027 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
21028 PyErr_SetString(PyExc_TypeError,
21029 "raise: exception class must be a subclass of BaseException");
21033 __Pyx_PyThreadState_assign
21034 __Pyx_ErrRestore(type, value, tb);
21043 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
21044 PyObject* owned_instance = NULL;
21045 if (tb == Py_None) {
21047 }
else if (tb && !PyTraceBack_Check(tb)) {
21048 PyErr_SetString(PyExc_TypeError,
21049 "raise: arg 3 must be a traceback or None");
21052 if (value == Py_None)
21054 if (PyExceptionInstance_Check(type)) {
21056 PyErr_SetString(PyExc_TypeError,
21057 "instance exception may not have a separate value");
21061 type = (PyObject*) Py_TYPE(value);
21062 }
else if (PyExceptionClass_Check(type)) {
21063 PyObject *instance_class = NULL;
21064 if (value && PyExceptionInstance_Check(value)) {
21065 instance_class = (PyObject*) Py_TYPE(value);
21066 if (instance_class != type) {
21067 int is_subclass = PyObject_IsSubclass(instance_class, type);
21068 if (!is_subclass) {
21069 instance_class = NULL;
21070 }
else if (unlikely(is_subclass == -1)) {
21073 type = instance_class;
21077 if (!instance_class) {
21080 args = PyTuple_New(0);
21081 else if (PyTuple_Check(value)) {
21085 args = PyTuple_Pack(1, value);
21088 owned_instance = PyObject_Call(type, args, NULL);
21090 if (!owned_instance)
21092 value = owned_instance;
21093 if (!PyExceptionInstance_Check(value)) {
21094 PyErr_Format(PyExc_TypeError,
21095 "calling %R should have returned an instance of " 21096 "BaseException, not %R",
21097 type, Py_TYPE(value));
21102 PyErr_SetString(PyExc_TypeError,
21103 "raise: exception class must be a subclass of BaseException");
21107 PyObject *fixed_cause;
21108 if (cause == Py_None) {
21109 fixed_cause = NULL;
21110 }
else if (PyExceptionClass_Check(cause)) {
21111 fixed_cause = PyObject_CallObject(cause, NULL);
21112 if (fixed_cause == NULL)
21114 }
else if (PyExceptionInstance_Check(cause)) {
21115 fixed_cause = cause;
21116 Py_INCREF(fixed_cause);
21118 PyErr_SetString(PyExc_TypeError,
21119 "exception causes must derive from " 21123 PyException_SetCause(value, fixed_cause);
21125 PyErr_SetObject(type, value);
21127 #if CYTHON_COMPILING_IN_PYPY 21128 PyObject *tmp_type, *tmp_value, *tmp_tb;
21129 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
21131 PyErr_Restore(tmp_type, tmp_value, tb);
21132 Py_XDECREF(tmp_tb);
21134 PyThreadState *tstate = __Pyx_PyThreadState_Current;
21135 PyObject* tmp_tb = tstate->curexc_traceback;
21136 if (tb != tmp_tb) {
21138 tstate->curexc_traceback = tb;
21139 Py_XDECREF(tmp_tb);
21144 Py_XDECREF(owned_instance);
21150 #if !CYTHON_COMPILING_IN_PYPY 21151 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
long intval,
int inplace,
int zerodivision_check) {
21153 (void)zerodivision_check;
21154 #if PY_MAJOR_VERSION < 3 21155 if (likely(PyInt_CheckExact(op1))) {
21156 const long b = intval;
21158 long a = PyInt_AS_LONG(op1);
21159 x = (long)((
unsigned long)a + b);
21160 if (likely((x^a) >= 0 || (x^b) >= 0))
21161 return PyInt_FromLong(x);
21162 return PyLong_Type.tp_as_number->nb_add(op1, op2);
21165 #if CYTHON_USE_PYLONG_INTERNALS 21166 if (likely(PyLong_CheckExact(op1))) {
21167 const long b = intval;
21169 #ifdef HAVE_LONG_LONG 21170 const PY_LONG_LONG llb = intval;
21171 PY_LONG_LONG lla, llx;
21173 const digit* digits = ((PyLongObject*)op1)->ob_digit;
21174 const Py_ssize_t size = Py_SIZE(op1);
21175 if (likely(__Pyx_sst_abs(size) <= 1)) {
21176 a = likely(size) ? digits[0] : 0;
21177 if (size == -1) a = -a;
21181 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
21182 a = -(long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21184 #ifdef HAVE_LONG_LONG 21185 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
21186 lla = -(PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
21190 CYTHON_FALLTHROUGH;
21192 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
21193 a = (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21195 #ifdef HAVE_LONG_LONG 21196 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
21197 lla = (PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
21201 CYTHON_FALLTHROUGH;
21203 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
21204 a = -(long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21206 #ifdef HAVE_LONG_LONG 21207 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
21208 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]));
21212 CYTHON_FALLTHROUGH;
21214 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
21215 a = (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21217 #ifdef HAVE_LONG_LONG 21218 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
21219 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]));
21223 CYTHON_FALLTHROUGH;
21225 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
21226 a = -(long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21228 #ifdef HAVE_LONG_LONG 21229 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
21230 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]));
21234 CYTHON_FALLTHROUGH;
21236 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
21237 a = (long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21239 #ifdef HAVE_LONG_LONG 21240 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
21241 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]));
21245 CYTHON_FALLTHROUGH;
21246 default:
return PyLong_Type.tp_as_number->nb_add(op1, op2);
21250 return PyLong_FromLong(x);
21251 #ifdef HAVE_LONG_LONG 21254 return PyLong_FromLongLong(llx);
21260 if (PyFloat_CheckExact(op1)) {
21261 const long b = intval;
21262 double a = PyFloat_AS_DOUBLE(op1);
21264 PyFPE_START_PROTECT(
"add",
return NULL)
21265 result = ((double)a) + (double)b;
21266 PyFPE_END_PROTECT(result)
21269 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
21274 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
21277 r = PyObject_SetItem(o, j, v);
21281 static CYTHON_INLINE
int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t
i, PyObject *v,
int is_list,
21282 CYTHON_NCP_UNUSED
int wraparound, CYTHON_NCP_UNUSED
int boundscheck) {
21283 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS 21284 if (is_list || PyList_CheckExact(o)) {
21285 Py_ssize_t n = (!wraparound) ?
i : ((likely(
i >= 0)) ?
i :
i + PyList_GET_SIZE(o));
21286 if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) {
21287 PyObject* old = PyList_GET_ITEM(o, n);
21289 PyList_SET_ITEM(o, n, v);
21294 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
21295 if (likely(m && m->sq_ass_item)) {
21296 if (wraparound && unlikely(
i < 0) && likely(m->sq_length)) {
21297 Py_ssize_t l = m->sq_length(o);
21298 if (likely(l >= 0)) {
21301 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
21306 return m->sq_ass_item(o,
i, v);
21310 #if CYTHON_COMPILING_IN_PYPY 21311 if (is_list || (PySequence_Check(o) && !PyDict_Check(o)))
21313 if (is_list || PySequence_Check(o))
21316 return PySequence_SetItem(o,
i, v);
21319 return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(
i), v);
21323 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2) {
21324 PyObject *args, *result = NULL;
21325 #if CYTHON_FAST_PYCALL 21326 if (PyFunction_Check(
function)) {
21327 PyObject *args[2] = {arg1, arg2};
21328 return __Pyx_PyFunction_FastCall(
function, args, 2);
21331 #if CYTHON_FAST_PYCCALL 21332 if (__Pyx_PyFastCFunction_Check(
function)) {
21333 PyObject *args[2] = {arg1, arg2};
21334 return __Pyx_PyCFunction_FastCall(
function, args, 2);
21337 args = PyTuple_New(2);
21338 if (unlikely(!args))
goto done;
21340 PyTuple_SET_ITEM(args, 0, arg1);
21342 PyTuple_SET_ITEM(args, 1, arg2);
21343 Py_INCREF(
function);
21344 result = __Pyx_PyObject_Call(
function, args, NULL);
21346 Py_DECREF(
function);
21352 static int __Pyx__ArgTypeTest(PyObject *
obj, PyTypeObject *type,
const char *name,
int exact)
21354 if (unlikely(!type)) {
21355 PyErr_SetString(PyExc_SystemError,
"Missing type object");
21359 #if PY_MAJOR_VERSION == 2 21360 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(
obj)))
return 1;
21364 if (likely(__Pyx_TypeCheck(
obj, type)))
return 1;
21366 PyErr_Format(PyExc_TypeError,
21367 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
21368 name, type->tp_name, Py_TYPE(
obj)->tp_name);
21373 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level) {
21374 PyObject *empty_list = 0;
21375 PyObject *module = 0;
21376 PyObject *global_dict = 0;
21377 PyObject *empty_dict = 0;
21379 #if PY_MAJOR_VERSION < 3 21380 PyObject *py_import;
21381 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
21388 empty_list = PyList_New(0);
21393 global_dict = PyModule_GetDict(__pyx_m);
21396 empty_dict = PyDict_New();
21400 #if PY_MAJOR_VERSION >= 3 21402 if (strchr(__Pyx_MODULE_NAME,
'.')) {
21403 module = PyImport_ImportModuleLevelObject(
21404 name, global_dict, empty_dict, list, 1);
21406 if (!PyErr_ExceptionMatches(PyExc_ImportError))
21415 #if PY_MAJOR_VERSION < 3 21416 PyObject *py_level = PyInt_FromLong(level);
21419 module = PyObject_CallFunctionObjArgs(py_import,
21420 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
21421 Py_DECREF(py_level);
21423 module = PyImport_ImportModuleLevelObject(
21424 name, global_dict, empty_dict, list, level);
21429 #if PY_MAJOR_VERSION < 3 21430 Py_XDECREF(py_import);
21432 Py_XDECREF(empty_list);
21433 Py_XDECREF(empty_dict);
21438 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 21439 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
21440 PyErr_Format(PyExc_AttributeError,
21441 #
if PY_MAJOR_VERSION >= 3
21442 "'%.50s' object has no attribute '%U'",
21443 tp->tp_name, attr_name);
21445 "'%.50s' object has no attribute '%.400s'",
21446 tp->tp_name, PyString_AS_STRING(attr_name));
21450 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject*
obj, PyObject* attr_name) {
21452 PyTypeObject *tp = Py_TYPE(
obj);
21453 if (unlikely(!PyString_Check(attr_name))) {
21454 return PyObject_GenericGetAttr(
obj, attr_name);
21456 assert(!tp->tp_dictoffset);
21457 descr = _PyType_Lookup(tp, attr_name);
21458 if (unlikely(!descr)) {
21459 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
21462 #if PY_MAJOR_VERSION < 3 21463 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
21466 descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
21468 PyObject *res = f(descr,
obj, (PyObject *)tp);
21478 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 21479 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject*
obj, PyObject* attr_name) {
21480 if (unlikely(Py_TYPE(
obj)->tp_dictoffset)) {
21481 return PyObject_GenericGetAttr(
obj, attr_name);
21483 return __Pyx_PyObject_GenericGetAttrNoDict(
obj, attr_name);
21488 static int __Pyx_SetVtable(PyObject *dict,
void *vtable) {
21489 #if PY_VERSION_HEX >= 0x02070000 21490 PyObject *ob = PyCapsule_New(vtable, 0, 0);
21492 PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
21496 if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
21506 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
21508 PyObject *name_attr;
21509 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name);
21510 if (likely(name_attr)) {
21511 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
21515 if (unlikely(ret < 0)) {
21519 Py_XDECREF(name_attr);
21522 static int __Pyx_setup_reduce(PyObject* type_obj) {
21524 PyObject *object_reduce = NULL;
21525 PyObject *object_reduce_ex = NULL;
21526 PyObject *reduce = NULL;
21527 PyObject *reduce_ex = NULL;
21528 PyObject *reduce_cython = NULL;
21529 PyObject *setstate = NULL;
21530 PyObject *setstate_cython = NULL;
21531 #if CYTHON_USE_PYTYPE_LOOKUP 21532 if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate))
goto GOOD;
21534 if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate))
goto GOOD;
21536 #if CYTHON_USE_PYTYPE_LOOKUP 21537 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto BAD;
21539 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto BAD;
21541 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex);
if (unlikely(!reduce_ex))
goto BAD;
21542 if (reduce_ex == object_reduce_ex) {
21543 #if CYTHON_USE_PYTYPE_LOOKUP 21544 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto BAD;
21546 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto BAD;
21548 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce);
if (unlikely(!reduce))
goto BAD;
21549 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
21550 reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython);
if (unlikely(!reduce_cython))
goto BAD;
21551 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython);
if (unlikely(ret < 0))
goto BAD;
21552 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython);
if (unlikely(ret < 0))
goto BAD;
21553 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
21554 if (!setstate) PyErr_Clear();
21555 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
21556 setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython);
if (unlikely(!setstate_cython))
goto BAD;
21557 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython);
if (unlikely(ret < 0))
goto BAD;
21558 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython);
if (unlikely(ret < 0))
goto BAD;
21560 PyType_Modified((PyTypeObject*)type_obj);
21565 if (!PyErr_Occurred())
21566 PyErr_Format(PyExc_RuntimeError,
"Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
21569 #if !CYTHON_USE_PYTYPE_LOOKUP 21570 Py_XDECREF(object_reduce);
21571 Py_XDECREF(object_reduce_ex);
21573 Py_XDECREF(reduce);
21574 Py_XDECREF(reduce_ex);
21575 Py_XDECREF(reduce_cython);
21576 Py_XDECREF(setstate);
21577 Py_XDECREF(setstate_cython);
21582 #if !CYTHON_COMPILING_IN_PYPY 21583 static PyObject* __Pyx_PyFloat_DivideObjC(PyObject *op1, PyObject *op2,
double floatval,
int inplace,
int zerodivision_check) {
21584 const double b = floatval;
21587 (void)zerodivision_check;
21588 if (likely(PyFloat_CheckExact(op1))) {
21589 a = PyFloat_AS_DOUBLE(op1);
21592 #if PY_MAJOR_VERSION < 3 21593 if (likely(PyInt_CheckExact(op1))) {
21594 a = (double) PyInt_AS_LONG(op1);
21598 if (likely(PyLong_CheckExact(op1))) {
21599 #if CYTHON_USE_PYLONG_INTERNALS 21600 const digit* digits = ((PyLongObject*)op1)->ob_digit;
21601 const Py_ssize_t size = Py_SIZE(op1);
21603 case 0: a = 0.0;
break;
21604 case -1: a = -(double) digits[0];
break;
21605 case 1: a = (double) digits[0];
break;
21608 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
21609 a = (double) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21610 if ((8 *
sizeof(
unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
21616 CYTHON_FALLTHROUGH;
21619 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
21620 a = (double) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21621 if ((8 *
sizeof(
unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
21627 CYTHON_FALLTHROUGH;
21630 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
21631 a = (double) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21632 if ((8 *
sizeof(
unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
21638 CYTHON_FALLTHROUGH;
21643 a = PyLong_AsDouble(op1);
21644 if (unlikely(a == -1.0 && PyErr_Occurred()))
return NULL;
21648 return (inplace ? __Pyx_PyNumber_InPlaceDivide(op1, op2) : __Pyx_PyNumber_Divide(op1, op2));
21651 PyFPE_START_PROTECT(
"divide",
return NULL)
21653 PyFPE_END_PROTECT(result)
21659 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals) {
21660 #if CYTHON_COMPILING_IN_PYPY 21661 return PyObject_RichCompareBool(s1, s2, equals);
21664 return (equals == Py_EQ);
21665 }
else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
21666 const char *ps1, *ps2;
21667 Py_ssize_t length = PyBytes_GET_SIZE(s1);
21668 if (length != PyBytes_GET_SIZE(s2))
21669 return (equals == Py_NE);
21670 ps1 = PyBytes_AS_STRING(s1);
21671 ps2 = PyBytes_AS_STRING(s2);
21672 if (ps1[0] != ps2[0]) {
21673 return (equals == Py_NE);
21674 }
else if (length == 1) {
21675 return (equals == Py_EQ);
21678 #if CYTHON_USE_UNICODE_INTERNALS 21679 Py_hash_t hash1, hash2;
21680 hash1 = ((PyBytesObject*)s1)->ob_shash;
21681 hash2 = ((PyBytesObject*)s2)->ob_shash;
21682 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
21683 return (equals == Py_NE);
21686 result = memcmp(ps1, ps2, (
size_t)length);
21687 return (equals == Py_EQ) ? (result == 0) : (result != 0);
21689 }
else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
21690 return (equals == Py_NE);
21691 }
else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
21692 return (equals == Py_NE);
21695 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
21698 result = __Pyx_PyObject_IsTrue(py_result);
21699 Py_DECREF(py_result);
21706 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals) {
21707 #if CYTHON_COMPILING_IN_PYPY 21708 return PyObject_RichCompareBool(s1, s2, equals);
21710 #if PY_MAJOR_VERSION < 3 21711 PyObject* owned_ref = NULL;
21713 int s1_is_unicode, s2_is_unicode;
21717 s1_is_unicode = PyUnicode_CheckExact(s1);
21718 s2_is_unicode = PyUnicode_CheckExact(s2);
21719 #if PY_MAJOR_VERSION < 3 21720 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
21721 owned_ref = PyUnicode_FromObject(s2);
21722 if (unlikely(!owned_ref))
21726 }
else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
21727 owned_ref = PyUnicode_FromObject(s1);
21728 if (unlikely(!owned_ref))
21732 }
else if (((!s2_is_unicode) & (!s1_is_unicode))) {
21733 return __Pyx_PyBytes_Equals(s1, s2, equals);
21736 if (s1_is_unicode & s2_is_unicode) {
21739 void *data1, *data2;
21740 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
21742 length = __Pyx_PyUnicode_GET_LENGTH(s1);
21743 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
21746 #if CYTHON_USE_UNICODE_INTERNALS 21748 Py_hash_t hash1, hash2;
21749 #if CYTHON_PEP393_ENABLED 21750 hash1 = ((PyASCIIObject*)s1)->hash;
21751 hash2 = ((PyASCIIObject*)s2)->hash;
21753 hash1 = ((PyUnicodeObject*)s1)->hash;
21754 hash2 = ((PyUnicodeObject*)s2)->hash;
21756 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
21761 kind = __Pyx_PyUnicode_KIND(s1);
21762 if (kind != __Pyx_PyUnicode_KIND(s2)) {
21765 data1 = __Pyx_PyUnicode_DATA(s1);
21766 data2 = __Pyx_PyUnicode_DATA(s2);
21767 if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
21769 }
else if (length == 1) {
21772 int result = memcmp(data1, data2, (
size_t)(length * kind));
21773 #if PY_MAJOR_VERSION < 3 21774 Py_XDECREF(owned_ref);
21776 return (equals == Py_EQ) ? (result == 0) : (result != 0);
21778 }
else if ((s1 == Py_None) & s2_is_unicode) {
21780 }
else if ((s2 == Py_None) & s1_is_unicode) {
21784 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
21785 #if PY_MAJOR_VERSION < 3 21786 Py_XDECREF(owned_ref);
21790 result = __Pyx_PyObject_IsTrue(py_result);
21791 Py_DECREF(py_result);
21795 #if PY_MAJOR_VERSION < 3 21796 Py_XDECREF(owned_ref);
21798 return (equals == Py_EQ);
21800 #if PY_MAJOR_VERSION < 3 21801 Py_XDECREF(owned_ref);
21803 return (equals == Py_NE);
21808 #ifndef CYTHON_CLINE_IN_TRACEBACK 21809 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line) {
21810 PyObject *use_cline;
21811 PyObject *ptype, *pvalue, *ptraceback;
21812 #if CYTHON_COMPILING_IN_CPYTHON 21813 PyObject **cython_runtime_dict;
21815 if (unlikely(!__pyx_cython_runtime)) {
21818 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
21819 #if CYTHON_COMPILING_IN_CPYTHON 21820 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
21821 if (likely(cython_runtime_dict)) {
21822 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
21823 use_cline, *cython_runtime_dict,
21824 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
21828 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
21829 if (use_cline_obj) {
21830 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
21831 Py_DECREF(use_cline_obj);
21839 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
21841 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
21844 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
21850 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
21851 int start = 0, mid = 0, end = count - 1;
21852 if (end >= 0 && code_line > entries[end].code_line) {
21855 while (start < end) {
21856 mid = start + (end - start) / 2;
21857 if (code_line < entries[mid].code_line) {
21859 }
else if (code_line > entries[mid].code_line) {
21865 if (code_line <= entries[mid].code_line) {
21871 static PyCodeObject *__pyx_find_code_object(
int code_line) {
21872 PyCodeObject* code_object;
21874 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
21877 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
21878 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
21881 code_object = __pyx_code_cache.entries[pos].code_object;
21882 Py_INCREF(code_object);
21883 return code_object;
21885 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
21887 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
21888 if (unlikely(!code_line)) {
21891 if (unlikely(!entries)) {
21892 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
21893 if (likely(entries)) {
21894 __pyx_code_cache.entries = entries;
21895 __pyx_code_cache.max_count = 64;
21896 __pyx_code_cache.count = 1;
21897 entries[0].code_line = code_line;
21898 entries[0].code_object = code_object;
21899 Py_INCREF(code_object);
21903 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
21904 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
21905 PyCodeObject* tmp = entries[pos].code_object;
21906 entries[pos].code_object = code_object;
21910 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
21911 int new_max = __pyx_code_cache.max_count + 64;
21912 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
21913 __pyx_code_cache.entries, (
size_t)new_max*
sizeof(__Pyx_CodeObjectCacheEntry));
21914 if (unlikely(!entries)) {
21917 __pyx_code_cache.entries = entries;
21918 __pyx_code_cache.max_count = new_max;
21920 for (
i=__pyx_code_cache.count;
i>pos;
i--) {
21921 entries[
i] = entries[
i-1];
21923 entries[pos].code_line = code_line;
21924 entries[pos].code_object = code_object;
21925 __pyx_code_cache.count++;
21926 Py_INCREF(code_object);
21930 #include "compile.h" 21931 #include "frameobject.h" 21932 #include "traceback.h" 21933 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
21934 const char *funcname,
int c_line,
21935 int py_line,
const char *filename) {
21936 PyCodeObject *py_code = 0;
21937 PyObject *py_srcfile = 0;
21938 PyObject *py_funcname = 0;
21939 #if PY_MAJOR_VERSION < 3 21940 py_srcfile = PyString_FromString(filename);
21942 py_srcfile = PyUnicode_FromString(filename);
21944 if (!py_srcfile)
goto bad;
21946 #if PY_MAJOR_VERSION < 3 21947 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
21949 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
21953 #if PY_MAJOR_VERSION < 3 21954 py_funcname = PyString_FromString(funcname);
21956 py_funcname = PyUnicode_FromString(funcname);
21959 if (!py_funcname)
goto bad;
21960 py_code = __Pyx_PyCode_New(
21977 Py_DECREF(py_srcfile);
21978 Py_DECREF(py_funcname);
21981 Py_XDECREF(py_srcfile);
21982 Py_XDECREF(py_funcname);
21985 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
21986 int py_line,
const char *filename) {
21987 PyCodeObject *py_code = 0;
21988 PyFrameObject *py_frame = 0;
21989 PyThreadState *tstate = __Pyx_PyThreadState_Current;
21991 c_line = __Pyx_CLineForTraceback(tstate, c_line);
21993 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
21995 py_code = __Pyx_CreateCodeObjectForTraceback(
21996 funcname, c_line, py_line, filename);
21997 if (!py_code)
goto bad;
21998 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
22000 py_frame = PyFrame_New(
22006 if (!py_frame)
goto bad;
22007 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
22008 PyTraceBack_Here(py_frame);
22010 Py_XDECREF(py_code);
22011 Py_XDECREF(py_frame);
22015 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ 22016 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) 22017 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ 22018 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) 22019 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ 22021 func_type value = func_value;\ 22022 if (sizeof(target_type) < sizeof(func_type)) {\ 22023 if (unlikely(value != (func_type) (target_type) value)) {\ 22024 func_type zero = 0;\ 22025 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ 22026 return (target_type) -1;\ 22027 if (is_unsigned && unlikely(value < zero))\ 22028 goto raise_neg_overflow;\ 22030 goto raise_overflow;\ 22033 return (target_type) value;\ 22037 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value) {
22038 const int neg_one = (int) ((
int) 0 - (int) 1), const_zero = (int) 0;
22039 const int is_unsigned = neg_one > const_zero;
22041 if (
sizeof(
int) <
sizeof(long)) {
22042 return PyInt_FromLong((
long) value);
22043 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
22044 return PyLong_FromUnsignedLong((
unsigned long) value);
22045 #ifdef HAVE_LONG_LONG 22046 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
22047 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
22051 if (
sizeof(
int) <=
sizeof(
long)) {
22052 return PyInt_FromLong((
long) value);
22053 #ifdef HAVE_LONG_LONG 22054 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
22055 return PyLong_FromLongLong((PY_LONG_LONG) value);
22060 int one = 1;
int little = (int)*(
unsigned char *)&one;
22061 unsigned char *bytes = (
unsigned char *)&value;
22062 return _PyLong_FromByteArray(bytes,
sizeof(
int),
22063 little, !is_unsigned);
22068 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *x) {
22069 const int neg_one = (int) ((
int) 0 - (int) 1), const_zero = (int) 0;
22070 const int is_unsigned = neg_one > const_zero;
22071 #if PY_MAJOR_VERSION < 3 22072 if (likely(PyInt_Check(x))) {
22073 if (
sizeof(
int) <
sizeof(long)) {
22074 __PYX_VERIFY_RETURN_INT(
int,
long, PyInt_AS_LONG(x))
22076 long val = PyInt_AS_LONG(x);
22077 if (is_unsigned && unlikely(val < 0)) {
22078 goto raise_neg_overflow;
22084 if (likely(PyLong_Check(x))) {
22086 #if CYTHON_USE_PYLONG_INTERNALS 22087 const digit* digits = ((PyLongObject*)x)->ob_digit;
22088 switch (Py_SIZE(x)) {
22089 case 0:
return (
int) 0;
22090 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, digits[0])
22092 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
22093 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22094 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22095 }
else if (8 *
sizeof(
int) >= 2 * PyLong_SHIFT) {
22096 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
22101 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
22102 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22103 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22104 }
else if (8 *
sizeof(
int) >= 3 * PyLong_SHIFT) {
22105 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
22110 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
22111 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22112 __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])))
22113 }
else if (8 *
sizeof(
int) >= 4 * PyLong_SHIFT) {
22114 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
22120 #if CYTHON_COMPILING_IN_CPYTHON 22121 if (unlikely(Py_SIZE(x) < 0)) {
22122 goto raise_neg_overflow;
22126 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
22127 if (unlikely(result < 0))
22129 if (unlikely(result == 1))
22130 goto raise_neg_overflow;
22133 if (
sizeof(
int) <=
sizeof(
unsigned long)) {
22134 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
22135 #ifdef HAVE_LONG_LONG 22136 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
22137 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
22141 #if CYTHON_USE_PYLONG_INTERNALS 22142 const digit* digits = ((PyLongObject*)x)->ob_digit;
22143 switch (Py_SIZE(x)) {
22144 case 0:
return (
int) 0;
22145 case -1: __PYX_VERIFY_RETURN_INT(
int, sdigit, (sdigit) (-(sdigit)digits[0]))
22146 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, +digits[0])
22148 if (8 *
sizeof(
int) - 1 > 1 * PyLong_SHIFT) {
22149 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22150 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22151 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
22152 return (
int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
22157 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
22158 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22159 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22160 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
22161 return (
int) ((((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
22166 if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
22167 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22168 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22169 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
22170 return (
int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
22175 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
22176 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22177 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22178 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
22179 return (
int) ((((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
22184 if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
22185 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22186 __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])))
22187 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
22188 return (
int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
22193 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
22194 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22195 __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])))
22196 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
22197 return (
int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
22203 if (
sizeof(
int) <=
sizeof(long)) {
22204 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
22205 #ifdef HAVE_LONG_LONG 22206 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
22207 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
22212 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) 22213 PyErr_SetString(PyExc_RuntimeError,
22214 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
22217 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
22218 #if PY_MAJOR_VERSION < 3 22219 if (likely(v) && !PyLong_Check(v)) {
22221 v = PyNumber_Long(tmp);
22226 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
22227 unsigned char *bytes = (
unsigned char *)&val;
22228 int ret = _PyLong_AsByteArray((PyLongObject *)v,
22229 bytes,
sizeof(val),
22230 is_little, !is_unsigned);
22240 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
22241 if (!tmp)
return (
int) -1;
22242 val = __Pyx_PyInt_As_int(tmp);
22247 PyErr_SetString(PyExc_OverflowError,
22248 "value too large to convert to int");
22250 raise_neg_overflow:
22251 PyErr_SetString(PyExc_OverflowError,
22252 "can't convert negative value to int");
22257 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value) {
22258 const long neg_one = (long) ((
long) 0 - (long) 1), const_zero = (long) 0;
22259 const int is_unsigned = neg_one > const_zero;
22261 if (
sizeof(
long) <
sizeof(long)) {
22262 return PyInt_FromLong((
long) value);
22263 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
22264 return PyLong_FromUnsignedLong((
unsigned long) value);
22265 #ifdef HAVE_LONG_LONG 22266 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
22267 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
22271 if (
sizeof(
long) <=
sizeof(
long)) {
22272 return PyInt_FromLong((
long) value);
22273 #ifdef HAVE_LONG_LONG 22274 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
22275 return PyLong_FromLongLong((PY_LONG_LONG) value);
22280 int one = 1;
int little = (int)*(
unsigned char *)&one;
22281 unsigned char *bytes = (
unsigned char *)&value;
22282 return _PyLong_FromByteArray(bytes,
sizeof(
long),
22283 little, !is_unsigned);
22288 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *x) {
22289 const long neg_one = (long) ((
long) 0 - (long) 1), const_zero = (long) 0;
22290 const int is_unsigned = neg_one > const_zero;
22291 #if PY_MAJOR_VERSION < 3 22292 if (likely(PyInt_Check(x))) {
22293 if (
sizeof(
long) <
sizeof(long)) {
22294 __PYX_VERIFY_RETURN_INT(
long,
long, PyInt_AS_LONG(x))
22296 long val = PyInt_AS_LONG(x);
22297 if (is_unsigned && unlikely(val < 0)) {
22298 goto raise_neg_overflow;
22304 if (likely(PyLong_Check(x))) {
22306 #if CYTHON_USE_PYLONG_INTERNALS 22307 const digit* digits = ((PyLongObject*)x)->ob_digit;
22308 switch (Py_SIZE(x)) {
22309 case 0:
return (
long) 0;
22310 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, digits[0])
22312 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
22313 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22314 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22315 }
else if (8 *
sizeof(
long) >= 2 * PyLong_SHIFT) {
22316 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
22321 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
22322 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22323 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22324 }
else if (8 *
sizeof(
long) >= 3 * PyLong_SHIFT) {
22325 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
22330 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
22331 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22332 __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])))
22333 }
else if (8 *
sizeof(
long) >= 4 * PyLong_SHIFT) {
22334 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
22340 #if CYTHON_COMPILING_IN_CPYTHON 22341 if (unlikely(Py_SIZE(x) < 0)) {
22342 goto raise_neg_overflow;
22346 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
22347 if (unlikely(result < 0))
22349 if (unlikely(result == 1))
22350 goto raise_neg_overflow;
22353 if (
sizeof(
long) <=
sizeof(
unsigned long)) {
22354 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
22355 #ifdef HAVE_LONG_LONG 22356 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
22357 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
22361 #if CYTHON_USE_PYLONG_INTERNALS 22362 const digit* digits = ((PyLongObject*)x)->ob_digit;
22363 switch (Py_SIZE(x)) {
22364 case 0:
return (
long) 0;
22365 case -1: __PYX_VERIFY_RETURN_INT(
long, sdigit, (sdigit) (-(sdigit)digits[0]))
22366 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, +digits[0])
22368 if (8 *
sizeof(
long) - 1 > 1 * PyLong_SHIFT) {
22369 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22370 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22371 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
22372 return (
long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
22377 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
22378 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22379 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22380 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
22381 return (
long) ((((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
22386 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
22387 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22388 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22389 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
22390 return (
long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
22395 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
22396 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22397 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22398 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
22399 return (
long) ((((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
22404 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
22405 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22406 __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])))
22407 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
22408 return (
long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
22413 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
22414 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22415 __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])))
22416 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
22417 return (
long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
22423 if (
sizeof(
long) <=
sizeof(long)) {
22424 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
22425 #ifdef HAVE_LONG_LONG 22426 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
22427 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
22432 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) 22433 PyErr_SetString(PyExc_RuntimeError,
22434 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
22437 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
22438 #if PY_MAJOR_VERSION < 3 22439 if (likely(v) && !PyLong_Check(v)) {
22441 v = PyNumber_Long(tmp);
22446 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
22447 unsigned char *bytes = (
unsigned char *)&val;
22448 int ret = _PyLong_AsByteArray((PyLongObject *)v,
22449 bytes,
sizeof(val),
22450 is_little, !is_unsigned);
22460 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
22461 if (!tmp)
return (
long) -1;
22462 val = __Pyx_PyInt_As_long(tmp);
22467 PyErr_SetString(PyExc_OverflowError,
22468 "value too large to convert to long");
22470 raise_neg_overflow:
22471 PyErr_SetString(PyExc_OverflowError,
22472 "can't convert negative value to long");
22477 #if CYTHON_COMPILING_IN_CPYTHON 22478 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
22484 return b == &PyBaseObject_Type;
22486 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
22488 if (a == b)
return 1;
22492 n = PyTuple_GET_SIZE(mro);
22493 for (
i = 0;
i < n;
i++) {
22494 if (PyTuple_GET_ITEM(mro,
i) == (PyObject *)b)
22499 return __Pyx_InBases(a, b);
22501 #if PY_MAJOR_VERSION == 2 22502 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
22503 PyObject *exception, *value, *tb;
22505 __Pyx_PyThreadState_declare
22506 __Pyx_PyThreadState_assign
22507 __Pyx_ErrFetch(&exception, &value, &tb);
22508 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
22509 if (unlikely(res == -1)) {
22510 PyErr_WriteUnraisable(err);
22514 res = PyObject_IsSubclass(err, exc_type2);
22515 if (unlikely(res == -1)) {
22516 PyErr_WriteUnraisable(err);
22520 __Pyx_ErrRestore(exception, value, tb);
22524 static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
22525 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
22527 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
22532 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
22534 assert(PyExceptionClass_Check(exc_type));
22535 n = PyTuple_GET_SIZE(tuple);
22536 #if PY_MAJOR_VERSION >= 3 22537 for (
i=0;
i<n;
i++) {
22538 if (exc_type == PyTuple_GET_ITEM(tuple,
i))
return 1;
22541 for (
i=0;
i<n;
i++) {
22542 PyObject *t = PyTuple_GET_ITEM(tuple,
i);
22543 #if PY_MAJOR_VERSION < 3 22544 if (likely(exc_type == t))
return 1;
22546 if (likely(PyExceptionClass_Check(t))) {
22547 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
22553 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
22554 if (likely(err == exc_type))
return 1;
22555 if (likely(PyExceptionClass_Check(err))) {
22556 if (likely(PyExceptionClass_Check(exc_type))) {
22557 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
22558 }
else if (likely(PyTuple_Check(exc_type))) {
22559 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
22563 return PyErr_GivenExceptionMatches(err, exc_type);
22565 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
22566 assert(PyExceptionClass_Check(exc_type1));
22567 assert(PyExceptionClass_Check(exc_type2));
22568 if (likely(err == exc_type1 || err == exc_type2))
return 1;
22569 if (likely(PyExceptionClass_Check(err))) {
22570 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
22572 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
22577 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
22578 PyObject* fake_module;
22579 PyTypeObject* cached_type = NULL;
22580 fake_module = PyImport_AddModule((
char*)
"_cython_" CYTHON_ABI);
22581 if (!fake_module)
return NULL;
22582 Py_INCREF(fake_module);
22583 cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
22585 if (!PyType_Check((PyObject*)cached_type)) {
22586 PyErr_Format(PyExc_TypeError,
22587 "Shared Cython type %.200s is not a type object",
22591 if (cached_type->tp_basicsize != type->tp_basicsize) {
22592 PyErr_Format(PyExc_TypeError,
22593 "Shared Cython type %.200s has the wrong size, try recompiling",
22598 if (!PyErr_ExceptionMatches(PyExc_AttributeError))
goto bad;
22600 if (PyType_Ready(type) < 0)
goto bad;
22601 if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
22604 cached_type = type;
22607 Py_DECREF(fake_module);
22608 return cached_type;
22610 Py_XDECREF(cached_type);
22611 cached_type = NULL;
22616 #if CYTHON_FAST_THREAD_STATE 22617 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
22618 PyObject *tmp_type, *tmp_value, *tmp_tb;
22619 #if CYTHON_USE_EXC_INFO_STACK 22620 _PyErr_StackItem *exc_info = tstate->exc_info;
22621 tmp_type = exc_info->exc_type;
22622 tmp_value = exc_info->exc_value;
22623 tmp_tb = exc_info->exc_traceback;
22624 exc_info->exc_type = *type;
22625 exc_info->exc_value = *value;
22626 exc_info->exc_traceback = *tb;
22628 tmp_type = tstate->exc_type;
22629 tmp_value = tstate->exc_value;
22630 tmp_tb = tstate->exc_traceback;
22631 tstate->exc_type = *type;
22632 tstate->exc_value = *value;
22633 tstate->exc_traceback = *tb;
22636 *value = tmp_value;
22640 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
22641 PyObject *tmp_type, *tmp_value, *tmp_tb;
22642 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
22643 PyErr_SetExcInfo(*type, *value, *tb);
22645 *value = tmp_value;
22651 static int __Pyx_PyObject_GetMethod(PyObject *
obj, PyObject *name, PyObject **method) {
22653 #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP 22654 PyTypeObject *tp = Py_TYPE(
obj);
22656 descrgetfunc f = NULL;
22657 PyObject **dictptr, *dict;
22658 int meth_found = 0;
22659 assert (*method == NULL);
22660 if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
22661 attr = __Pyx_PyObject_GetAttrStr(
obj, name);
22664 if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
22667 descr = _PyType_Lookup(tp, name);
22668 if (likely(descr != NULL)) {
22670 #if PY_MAJOR_VERSION >= 3 22671 #ifdef __Pyx_CyFunction_USED 22672 if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
22674 if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type)))
22677 #ifdef __Pyx_CyFunction_USED 22678 if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
22680 if (likely(PyFunction_Check(descr)))
22686 f = Py_TYPE(descr)->tp_descr_get;
22687 if (f != NULL && PyDescr_IsData(descr)) {
22688 attr = f(descr,
obj, (PyObject *)Py_TYPE(
obj));
22694 dictptr = _PyObject_GetDictPtr(
obj);
22695 if (dictptr != NULL && (dict = *dictptr) != NULL) {
22697 attr = __Pyx_PyDict_GetItemStr(dict, name);
22698 if (attr != NULL) {
22711 attr = f(descr,
obj, (PyObject *)Py_TYPE(
obj));
22715 if (descr != NULL) {
22719 PyErr_Format(PyExc_AttributeError,
22720 #
if PY_MAJOR_VERSION >= 3
22721 "'%.50s' object has no attribute '%U'",
22722 tp->tp_name, name);
22724 "'%.50s' object has no attribute '%.400s'",
22725 tp->tp_name, PyString_AS_STRING(name));
22729 attr = __Pyx_PyObject_GetAttrStr(
obj, name);
22733 #if CYTHON_UNPACK_METHODS 22734 if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) ==
obj)) {
22735 PyObject *
function = PyMethod_GET_FUNCTION(attr);
22736 Py_INCREF(
function);
22738 *method =
function;
22747 static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
22748 PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
22752 static PyObject* __Pyx_PyObject_CallMethod1(PyObject*
obj, PyObject* method_name, PyObject* arg) {
22753 PyObject *method = NULL, *result;
22754 int is_method = __Pyx_PyObject_GetMethod(
obj, method_name, &method);
22755 if (likely(is_method)) {
22756 result = __Pyx_PyObject_Call2Args(method,
obj, arg);
22760 if (unlikely(!method))
return NULL;
22761 return __Pyx__PyObject_CallMethod1(method, arg);
22765 #include <structmember.h> 22766 #include <frameobject.h> 22767 #define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom) 22768 static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) {
22769 PyObject *et, *ev, *tb;
22770 PyObject *value = NULL;
22771 __Pyx_ErrFetch(&et, &ev, &tb);
22775 Py_INCREF(Py_None);
22779 if (likely(et == PyExc_StopIteration)) {
22781 Py_INCREF(Py_None);
22784 #if PY_VERSION_HEX >= 0x030300A0 22785 else if (Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) {
22786 value = ((PyStopIterationObject *)ev)->value;
22791 else if (unlikely(PyTuple_Check(ev))) {
22792 if (PyTuple_GET_SIZE(ev) >= 1) {
22793 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 22794 value = PyTuple_GET_ITEM(ev, 0);
22797 value = PySequence_ITEM(ev, 0);
22800 Py_INCREF(Py_None);
22805 else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
22808 if (likely(value)) {
22814 }
else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
22815 __Pyx_ErrRestore(et, ev, tb);
22818 PyErr_NormalizeException(&et, &ev, &tb);
22819 if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
22820 __Pyx_ErrRestore(et, ev, tb);
22825 #if PY_VERSION_HEX >= 0x030300A0 22826 value = ((PyStopIterationObject *)ev)->value;
22831 PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args);
22833 if (likely(args)) {
22834 value = PySequence_GetItem(args, 0);
22837 if (unlikely(!value)) {
22838 __Pyx_ErrRestore(NULL, NULL, NULL);
22839 Py_INCREF(Py_None);
22847 static CYTHON_INLINE
22848 void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) {
22849 PyObject *t, *v, *tb;
22850 t = exc_state->exc_type;
22851 v = exc_state->exc_value;
22852 tb = exc_state->exc_traceback;
22853 exc_state->exc_type = NULL;
22854 exc_state->exc_value = NULL;
22855 exc_state->exc_traceback = NULL;
22860 #define __Pyx_Coroutine_AlreadyRunningError(gen) (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL) 22861 static void __Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject *gen) {
22864 #ifdef __Pyx_Coroutine_USED 22865 }
else if (__Pyx_Coroutine_Check((PyObject*)gen)) {
22866 msg =
"coroutine already executing";
22868 #ifdef __Pyx_AsyncGen_USED 22869 }
else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
22870 msg =
"async generator already executing";
22873 msg =
"generator already executing";
22875 PyErr_SetString(PyExc_ValueError, msg);
22877 #define __Pyx_Coroutine_NotStartedError(gen) (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL) 22878 static void __Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject *gen) {
22881 #ifdef __Pyx_Coroutine_USED 22882 }
else if (__Pyx_Coroutine_Check(gen)) {
22883 msg =
"can't send non-None value to a just-started coroutine";
22885 #ifdef __Pyx_AsyncGen_USED 22886 }
else if (__Pyx_AsyncGen_CheckExact(gen)) {
22887 msg =
"can't send non-None value to a just-started async generator";
22890 msg =
"can't send non-None value to a just-started generator";
22892 PyErr_SetString(PyExc_TypeError, msg);
22894 #define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing) (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL) 22895 static void __Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject *gen, PyObject *value, CYTHON_UNUSED
int closing) {
22896 #ifdef __Pyx_Coroutine_USED 22897 if (!closing && __Pyx_Coroutine_Check(gen)) {
22898 PyErr_SetString(PyExc_RuntimeError,
"cannot reuse already awaited coroutine");
22902 #ifdef __Pyx_AsyncGen_USED 22903 if (__Pyx_AsyncGen_CheckExact(gen))
22904 PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration);
22907 PyErr_SetNone(PyExc_StopIteration);
22911 PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *
self, PyObject *value,
int closing) {
22912 __Pyx_PyThreadState_declare
22913 PyThreadState *tstate;
22914 __Pyx_ExcInfoStruct *exc_state;
22916 assert(!self->is_running);
22917 if (unlikely(self->resume_label == 0)) {
22918 if (unlikely(value && value != Py_None)) {
22919 return __Pyx_Coroutine_NotStartedError((PyObject*)
self);
22922 if (unlikely(self->resume_label == -1)) {
22923 return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)
self, value, closing);
22925 #if CYTHON_FAST_THREAD_STATE 22926 __Pyx_PyThreadState_assign
22927 tstate = __pyx_tstate;
22929 tstate = __Pyx_PyThreadState_Current;
22931 exc_state = &
self->gi_exc_state;
22932 if (exc_state->exc_type) {
22933 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON 22935 if (exc_state->exc_traceback) {
22936 PyTracebackObject *tb = (PyTracebackObject *) exc_state->exc_traceback;
22937 PyFrameObject *f = tb->tb_frame;
22938 Py_XINCREF(tstate->frame);
22939 assert(f->f_back == NULL);
22940 f->f_back = tstate->frame;
22944 #if CYTHON_USE_EXC_INFO_STACK 22945 exc_state->previous_item = tstate->exc_info;
22946 tstate->exc_info = exc_state;
22948 if (exc_state->exc_type) {
22949 __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
22951 __Pyx_Coroutine_ExceptionClear(exc_state);
22952 __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
22955 self->is_running = 1;
22956 retval =
self->body((PyObject *)
self, tstate, value);
22957 self->is_running = 0;
22958 #if CYTHON_USE_EXC_INFO_STACK 22959 exc_state = &
self->gi_exc_state;
22960 tstate->exc_info = exc_state->previous_item;
22961 exc_state->previous_item = NULL;
22962 __Pyx_Coroutine_ResetFrameBackpointer(exc_state);
22966 static CYTHON_INLINE
void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) {
22967 PyObject *exc_tb = exc_state->exc_traceback;
22968 if (likely(exc_tb)) {
22969 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON 22971 PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
22972 PyFrameObject *f = tb->tb_frame;
22973 Py_CLEAR(f->f_back);
22977 static CYTHON_INLINE
22978 PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *retval) {
22979 if (unlikely(!retval)) {
22980 __Pyx_PyThreadState_declare
22981 __Pyx_PyThreadState_assign
22982 if (!__Pyx_PyErr_Occurred()) {
22983 PyObject *exc = PyExc_StopIteration;
22984 #ifdef __Pyx_AsyncGen_USED 22985 if (__Pyx_AsyncGen_CheckExact(gen))
22986 exc = __Pyx_PyExc_StopAsyncIteration;
22988 __Pyx_PyErr_SetNone(exc);
22993 static CYTHON_INLINE
22994 PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
22996 PyObject *val = NULL;
22997 __Pyx_Coroutine_Undelegate(gen);
22998 __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
22999 ret = __Pyx_Coroutine_SendEx(gen, val, 0);
23003 static PyObject *__Pyx_Coroutine_Send(PyObject *
self, PyObject *value) {
23005 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*)
self;
23006 PyObject *yf = gen->yieldfrom;
23007 if (unlikely(gen->is_running))
23008 return __Pyx_Coroutine_AlreadyRunningError(gen);
23011 gen->is_running = 1;
23012 #ifdef __Pyx_Generator_USED 23013 if (__Pyx_Generator_CheckExact(yf)) {
23014 ret = __Pyx_Coroutine_Send(yf, value);
23017 #ifdef __Pyx_Coroutine_USED 23018 if (__Pyx_Coroutine_Check(yf)) {
23019 ret = __Pyx_Coroutine_Send(yf, value);
23022 #ifdef __Pyx_AsyncGen_USED 23023 if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
23024 ret = __Pyx_async_gen_asend_send(yf, value);
23027 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) 23028 if (PyGen_CheckExact(yf)) {
23029 ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
23032 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) 23033 if (PyCoro_CheckExact(yf)) {
23034 ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
23038 if (value == Py_None)
23039 ret = Py_TYPE(yf)->tp_iternext(yf);
23041 ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
23043 gen->is_running = 0;
23047 retval = __Pyx_Coroutine_FinishDelegation(gen);
23049 retval = __Pyx_Coroutine_SendEx(gen, value, 0);
23051 return __Pyx_Coroutine_MethodReturn(
self, retval);
23053 static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
23054 PyObject *retval = NULL;
23056 #ifdef __Pyx_Generator_USED 23057 if (__Pyx_Generator_CheckExact(yf)) {
23058 retval = __Pyx_Coroutine_Close(yf);
23063 #ifdef __Pyx_Coroutine_USED 23064 if (__Pyx_Coroutine_Check(yf)) {
23065 retval = __Pyx_Coroutine_Close(yf);
23069 if (__Pyx_CoroutineAwait_CheckExact(yf)) {
23070 retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL);
23075 #ifdef __Pyx_AsyncGen_USED 23076 if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
23077 retval = __Pyx_async_gen_asend_close(yf, NULL);
23079 if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
23080 retval = __Pyx_async_gen_athrow_close(yf, NULL);
23085 gen->is_running = 1;
23086 meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close);
23087 if (unlikely(!meth)) {
23088 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
23089 PyErr_WriteUnraisable(yf);
23093 retval = PyObject_CallFunction(meth, NULL);
23098 gen->is_running = 0;
23100 Py_XDECREF(retval);
23103 static PyObject *__Pyx_Generator_Next(PyObject *
self) {
23104 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*)
self;
23105 PyObject *yf = gen->yieldfrom;
23106 if (unlikely(gen->is_running))
23107 return __Pyx_Coroutine_AlreadyRunningError(gen);
23110 gen->is_running = 1;
23111 #ifdef __Pyx_Generator_USED 23112 if (__Pyx_Generator_CheckExact(yf)) {
23113 ret = __Pyx_Generator_Next(yf);
23116 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) 23117 if (PyGen_CheckExact(yf)) {
23118 ret = _PyGen_Send((PyGenObject*)yf, NULL);
23121 #ifdef __Pyx_Coroutine_USED 23122 if (__Pyx_Coroutine_Check(yf)) {
23123 ret = __Pyx_Coroutine_Send(yf, Py_None);
23126 ret = Py_TYPE(yf)->tp_iternext(yf);
23127 gen->is_running = 0;
23131 return __Pyx_Coroutine_FinishDelegation(gen);
23133 return __Pyx_Coroutine_SendEx(gen, Py_None, 0);
23135 static PyObject *__Pyx_Coroutine_Close_Method(PyObject *
self, CYTHON_UNUSED PyObject *arg) {
23136 return __Pyx_Coroutine_Close(
self);
23138 static PyObject *__Pyx_Coroutine_Close(PyObject *
self) {
23139 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
23140 PyObject *retval, *raised_exception;
23141 PyObject *yf = gen->yieldfrom;
23143 if (unlikely(gen->is_running))
23144 return __Pyx_Coroutine_AlreadyRunningError(gen);
23147 err = __Pyx_Coroutine_CloseIter(gen, yf);
23148 __Pyx_Coroutine_Undelegate(gen);
23152 PyErr_SetNone(PyExc_GeneratorExit);
23153 retval = __Pyx_Coroutine_SendEx(gen, NULL, 1);
23154 if (unlikely(retval)) {
23158 #ifdef __Pyx_Coroutine_USED 23159 }
else if (__Pyx_Coroutine_Check(
self)) {
23160 msg =
"coroutine ignored GeneratorExit";
23162 #ifdef __Pyx_AsyncGen_USED 23163 }
else if (__Pyx_AsyncGen_CheckExact(
self)) {
23164 #if PY_VERSION_HEX < 0x03060000 23165 msg =
"async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)";
23167 msg =
"async generator ignored GeneratorExit";
23171 msg =
"generator ignored GeneratorExit";
23173 PyErr_SetString(PyExc_RuntimeError, msg);
23176 raised_exception = PyErr_Occurred();
23177 if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) {
23178 if (raised_exception) PyErr_Clear();
23179 Py_INCREF(Py_None);
23184 static PyObject *__Pyx__Coroutine_Throw(PyObject *
self, PyObject *typ, PyObject *val, PyObject *tb,
23185 PyObject *args,
int close_on_genexit) {
23186 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
23187 PyObject *yf = gen->yieldfrom;
23188 if (unlikely(gen->is_running))
23189 return __Pyx_Coroutine_AlreadyRunningError(gen);
23193 if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
23194 int err = __Pyx_Coroutine_CloseIter(gen, yf);
23196 __Pyx_Coroutine_Undelegate(gen);
23198 return __Pyx_Coroutine_MethodReturn(
self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
23201 gen->is_running = 1;
23203 #ifdef __Pyx_Generator_USED
23204 || __Pyx_Generator_CheckExact(yf)
23206 #ifdef __Pyx_Coroutine_USED
23207 || __Pyx_Coroutine_Check(yf)
23210 ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
23211 #ifdef __Pyx_Coroutine_USED 23212 }
else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
23213 ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
23216 PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw);
23217 if (unlikely(!meth)) {
23219 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
23220 gen->is_running = 0;
23224 __Pyx_Coroutine_Undelegate(gen);
23225 gen->is_running = 0;
23228 if (likely(args)) {
23229 ret = PyObject_CallObject(meth, args);
23231 ret = PyObject_CallFunctionObjArgs(meth, typ, val, tb, NULL);
23235 gen->is_running = 0;
23238 ret = __Pyx_Coroutine_FinishDelegation(gen);
23240 return __Pyx_Coroutine_MethodReturn(
self, ret);
23243 __Pyx_Raise(typ, val, tb, NULL);
23244 return __Pyx_Coroutine_MethodReturn(
self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
23246 static PyObject *__Pyx_Coroutine_Throw(PyObject *
self, PyObject *args) {
23248 PyObject *val = NULL;
23249 PyObject *tb = NULL;
23250 if (!PyArg_UnpackTuple(args, (
char *)
"throw", 1, 3, &typ, &val, &tb))
23252 return __Pyx__Coroutine_Throw(
self, typ, val, tb, args, 1);
23254 static CYTHON_INLINE
int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit,
void *arg) {
23255 Py_VISIT(exc_state->exc_type);
23256 Py_VISIT(exc_state->exc_value);
23257 Py_VISIT(exc_state->exc_traceback);
23260 static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit,
void *arg) {
23261 Py_VISIT(gen->closure);
23262 Py_VISIT(gen->classobj);
23263 Py_VISIT(gen->yieldfrom);
23264 return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg);
23266 static int __Pyx_Coroutine_clear(PyObject *
self) {
23267 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
23268 Py_CLEAR(gen->closure);
23269 Py_CLEAR(gen->classobj);
23270 Py_CLEAR(gen->yieldfrom);
23271 __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state);
23272 #ifdef __Pyx_AsyncGen_USED 23273 if (__Pyx_AsyncGen_CheckExact(
self)) {
23274 Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
23277 Py_CLEAR(gen->gi_code);
23278 Py_CLEAR(gen->gi_name);
23279 Py_CLEAR(gen->gi_qualname);
23280 Py_CLEAR(gen->gi_modulename);
23283 static void __Pyx_Coroutine_dealloc(PyObject *
self) {
23284 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
23285 PyObject_GC_UnTrack(gen);
23286 if (gen->gi_weakreflist != NULL)
23287 PyObject_ClearWeakRefs(
self);
23288 if (gen->resume_label >= 0) {
23289 PyObject_GC_Track(
self);
23290 #if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE 23291 if (PyObject_CallFinalizerFromDealloc(
self))
23293 Py_TYPE(gen)->tp_del(
self);
23294 if (self->ob_refcnt > 0)
23299 PyObject_GC_UnTrack(
self);
23301 #ifdef __Pyx_AsyncGen_USED 23302 if (__Pyx_AsyncGen_CheckExact(
self)) {
23306 Py_CLEAR(((__pyx_PyAsyncGenObject*)
self)->ag_finalizer);
23309 __Pyx_Coroutine_clear(
self);
23310 PyObject_GC_Del(gen);
23312 static void __Pyx_Coroutine_del(PyObject *
self) {
23313 PyObject *error_type, *error_value, *error_traceback;
23314 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
23315 __Pyx_PyThreadState_declare
23316 if (gen->resume_label < 0) {
23319 #if !CYTHON_USE_TP_FINALIZE 23320 assert(self->ob_refcnt == 0);
23321 self->ob_refcnt = 1;
23323 __Pyx_PyThreadState_assign
23324 __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
23325 #ifdef __Pyx_AsyncGen_USED 23326 if (__Pyx_AsyncGen_CheckExact(
self)) {
23327 __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)
self;
23328 PyObject *finalizer = agen->ag_finalizer;
23329 if (finalizer && !agen->ag_closed) {
23330 PyObject *res = __Pyx_PyObject_CallOneArg(finalizer,
self);
23331 if (unlikely(!res)) {
23332 PyErr_WriteUnraisable(
self);
23336 __Pyx_ErrRestore(error_type, error_value, error_traceback);
23341 if (unlikely(gen->resume_label == 0 && !error_value)) {
23342 #ifdef __Pyx_Coroutine_USED 23343 #ifdef __Pyx_Generator_USED 23344 if (!__Pyx_Generator_CheckExact(
self))
23347 PyObject_GC_UnTrack(
self);
23348 #if PY_MAJOR_VERSION >= 3 || defined(PyErr_WarnFormat) 23349 if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1,
"coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
23350 PyErr_WriteUnraisable(
self);
23354 #if CYTHON_COMPILING_IN_PYPY 23356 cmsg = (
char*)
"coroutine was never awaited";
23359 PyObject *qualname;
23360 qualname = gen->gi_qualname;
23361 cname = PyString_AS_STRING(qualname);
23362 msg = PyString_FromFormat(
"coroutine '%.50s' was never awaited", cname);
23363 if (unlikely(!msg)) {
23365 cmsg = (
char*)
"coroutine was never awaited";
23367 cmsg = PyString_AS_STRING(msg);
23370 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0))
23371 PyErr_WriteUnraisable(
self);
23374 PyObject_GC_Track(
self);
23378 PyObject *res = __Pyx_Coroutine_Close(
self);
23379 if (unlikely(!res)) {
23380 if (PyErr_Occurred())
23381 PyErr_WriteUnraisable(
self);
23386 __Pyx_ErrRestore(error_type, error_value, error_traceback);
23387 #if !CYTHON_USE_TP_FINALIZE 23388 assert(self->ob_refcnt > 0);
23389 if (--self->ob_refcnt == 0) {
23393 Py_ssize_t refcnt =
self->ob_refcnt;
23394 _Py_NewReference(
self);
23395 self->ob_refcnt = refcnt;
23397 #if CYTHON_COMPILING_IN_CPYTHON 23398 assert(PyType_IS_GC(self->ob_type) &&
23399 _Py_AS_GC(
self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
23402 #ifdef COUNT_ALLOCS 23403 --Py_TYPE(
self)->tp_frees;
23404 --Py_TYPE(
self)->tp_allocs;
23409 __Pyx_Coroutine_get_name(__pyx_CoroutineObject *
self, CYTHON_UNUSED
void *context)
23411 PyObject *name =
self->gi_name;
23412 if (unlikely(!name)) name = Py_None;
23417 __Pyx_Coroutine_set_name(__pyx_CoroutineObject *
self, PyObject *value, CYTHON_UNUSED
void *context)
23420 #if PY_MAJOR_VERSION >= 3 23421 if (unlikely(value == NULL || !PyUnicode_Check(value)))
23423 if (unlikely(value == NULL || !PyString_Check(value)))
23426 PyErr_SetString(PyExc_TypeError,
23427 "__name__ must be set to a string object");
23430 tmp =
self->gi_name;
23432 self->gi_name = value;
23437 __Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *
self, CYTHON_UNUSED
void *context)
23439 PyObject *name =
self->gi_qualname;
23440 if (unlikely(!name)) name = Py_None;
23445 __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *
self, PyObject *value, CYTHON_UNUSED
void *context)
23448 #if PY_MAJOR_VERSION >= 3 23449 if (unlikely(value == NULL || !PyUnicode_Check(value)))
23451 if (unlikely(value == NULL || !PyString_Check(value)))
23454 PyErr_SetString(PyExc_TypeError,
23455 "__qualname__ must be set to a string object");
23458 tmp =
self->gi_qualname;
23460 self->gi_qualname = value;
23464 static __pyx_CoroutineObject *__Pyx__Coroutine_New(
23465 PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
23466 PyObject *name, PyObject *qualname, PyObject *module_name) {
23467 __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
23468 if (unlikely(!gen))
23470 return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name);
23472 static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
23473 __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
23474 PyObject *name, PyObject *qualname, PyObject *module_name) {
23476 gen->closure = closure;
23477 Py_XINCREF(closure);
23478 gen->is_running = 0;
23479 gen->resume_label = 0;
23480 gen->classobj = NULL;
23481 gen->yieldfrom = NULL;
23482 gen->gi_exc_state.exc_type = NULL;
23483 gen->gi_exc_state.exc_value = NULL;
23484 gen->gi_exc_state.exc_traceback = NULL;
23485 #if CYTHON_USE_EXC_INFO_STACK 23486 gen->gi_exc_state.previous_item = NULL;
23488 gen->gi_weakreflist = NULL;
23489 Py_XINCREF(qualname);
23490 gen->gi_qualname = qualname;
23492 gen->gi_name = name;
23493 Py_XINCREF(module_name);
23494 gen->gi_modulename = module_name;
23496 gen->gi_code = code;
23497 PyObject_GC_Track(gen);
23502 static PyObject* __Pyx_Coroutine_patch_module(PyObject* module,
const char* py_code) {
23503 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) 23505 PyObject *globals, *result_obj;
23506 globals = PyDict_New();
if (unlikely(!globals))
goto ignore;
23507 result = PyDict_SetItemString(globals,
"_cython_coroutine_type",
23508 #ifdef __Pyx_Coroutine_USED
23509 (PyObject*)__pyx_CoroutineType);
23513 if (unlikely(result < 0))
goto ignore;
23514 result = PyDict_SetItemString(globals,
"_cython_generator_type",
23515 #ifdef __Pyx_Generator_USED
23516 (PyObject*)__pyx_GeneratorType);
23520 if (unlikely(result < 0))
goto ignore;
23521 if (unlikely(PyDict_SetItemString(globals,
"_module", module) < 0))
goto ignore;
23522 if (unlikely(PyDict_SetItemString(globals,
"__builtins__", __pyx_b) < 0))
goto ignore;
23523 result_obj = PyRun_String(py_code, Py_file_input, globals, globals);
23524 if (unlikely(!result_obj))
goto ignore;
23525 Py_DECREF(result_obj);
23526 Py_DECREF(globals);
23529 Py_XDECREF(globals);
23530 PyErr_WriteUnraisable(module);
23531 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
"Cython module failed to patch module with custom type", 1) < 0)) {
23542 #ifndef CYTHON_REGISTER_ABCS 23543 #define CYTHON_REGISTER_ABCS 1 23545 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) 23546 static PyObject* __Pyx_patch_abc_module(PyObject *module);
23547 static PyObject* __Pyx_patch_abc_module(PyObject *module) {
23548 module = __Pyx_Coroutine_patch_module(
23550 "if _cython_generator_type is not None:\n" 23551 " try: Generator = _module.Generator\n" 23552 " except AttributeError: pass\n" 23553 " else: Generator.register(_cython_generator_type)\n" 23554 "if _cython_coroutine_type is not None:\n" 23555 " try: Coroutine = _module.Coroutine\n" 23556 " except AttributeError: pass\n" 23557 " else: Coroutine.register(_cython_coroutine_type)\n" 23562 static int __Pyx_patch_abc(
void) {
23563 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) 23564 static int abc_patched = 0;
23565 if (CYTHON_REGISTER_ABCS && !abc_patched) {
23567 module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ?
"collections.abc" :
"collections");
23569 PyErr_WriteUnraisable(NULL);
23570 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
23571 ((PY_MAJOR_VERSION >= 3) ?
23572 "Cython module failed to register with collections.abc module" :
23573 "Cython module failed to register with collections module"), 1) < 0)) {
23577 module = __Pyx_patch_abc_module(module);
23579 if (unlikely(!module))
23583 module = PyImport_ImportModule(
"backports_abc");
23585 module = __Pyx_patch_abc_module(module);
23586 Py_XDECREF(module);
23593 if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL);
23599 static PyMethodDef __pyx_Generator_methods[] = {
23600 {
"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
23601 (
char*) PyDoc_STR(
"send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
23602 {
"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
23603 (
char*) PyDoc_STR(
"throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
23604 {
"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS,
23605 (
char*) PyDoc_STR(
"close() -> raise GeneratorExit inside generator.")},
23608 static PyMemberDef __pyx_Generator_memberlist[] = {
23609 {(
char *)
"gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL},
23610 {(
char*)
"gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
23611 (
char*) PyDoc_STR(
"object being iterated by 'yield from', or None")},
23612 {(
char*)
"gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
23615 static PyGetSetDef __pyx_Generator_getsets[] = {
23616 {(
char *)
"__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
23617 (
char*) PyDoc_STR(
"name of the generator"), 0},
23618 {(
char *)
"__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
23619 (
char*) PyDoc_STR(
"qualified name of the generator"), 0},
23622 static PyTypeObject __pyx_GeneratorType_type = {
23623 PyVarObject_HEAD_INIT(0, 0)
23625 sizeof(__pyx_CoroutineObject),
23627 (destructor) __Pyx_Coroutine_dealloc,
23642 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
23644 (traverseproc) __Pyx_Coroutine_traverse,
23647 offsetof(__pyx_CoroutineObject, gi_weakreflist),
23649 (iternextfunc) __Pyx_Generator_Next,
23650 __pyx_Generator_methods,
23651 __pyx_Generator_memberlist,
23652 __pyx_Generator_getsets,
23668 #
if CYTHON_USE_TP_FINALIZE
23671 __Pyx_Coroutine_del,
23674 #
if CYTHON_USE_TP_FINALIZE
23675 __Pyx_Coroutine_del,
23676 #elif PY_VERSION_HEX >= 0x030400a1
23680 static int __pyx_Generator_init(
void) {
23681 __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
23682 __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
23683 __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
23684 if (unlikely(!__pyx_GeneratorType)) {
23691 static int __Pyx_check_binary_version(
void) {
23692 char ctversion[4], rtversion[4];
23693 PyOS_snprintf(ctversion, 4,
"%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
23694 PyOS_snprintf(rtversion, 4,
"%s", Py_GetVersion());
23695 if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
23697 PyOS_snprintf(message,
sizeof(message),
23698 "compiletime version %s of module '%.100s' " 23699 "does not match runtime version %s",
23700 ctversion, __Pyx_MODULE_NAME, rtversion);
23701 return PyErr_WarnEx(NULL, message, 1);
23707 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
23709 #if PY_MAJOR_VERSION < 3 23710 if (t->is_unicode) {
23711 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
23712 }
else if (t->intern) {
23713 *t->p = PyString_InternFromString(t->s);
23715 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
23718 if (t->is_unicode | t->is_str) {
23720 *t->p = PyUnicode_InternFromString(t->s);
23721 }
else if (t->encoding) {
23722 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
23724 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
23727 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
23732 if (PyObject_Hash(*t->p) == -1)
23739 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
23740 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
23742 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
23744 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
23746 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 23747 #if !CYTHON_PEP393_ENABLED 23748 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
23750 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
23751 if (!defenc)
return NULL;
23752 defenc_c = PyBytes_AS_STRING(defenc);
23753 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 23755 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
23757 for (c = defenc_c; c < end; c++) {
23758 if ((
unsigned char) (*c) >= 128) {
23759 PyUnicode_AsASCIIString(o);
23765 *length = PyBytes_GET_SIZE(defenc);
23769 static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
23770 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
23771 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 23772 if (likely(PyUnicode_IS_ASCII(o))) {
23773 *length = PyUnicode_GET_LENGTH(o);
23774 return PyUnicode_AsUTF8(o);
23776 PyUnicode_AsASCIIString(o);
23780 return PyUnicode_AsUTF8AndSize(o, length);
23785 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
23786 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 23788 #
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
23789 __Pyx_sys_getdefaultencoding_not_ascii &&
23791 PyUnicode_Check(o)) {
23792 return __Pyx_PyUnicode_AsStringAndSize(o, length);
23795 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) 23796 if (PyByteArray_Check(o)) {
23797 *length = PyByteArray_GET_SIZE(o);
23798 return PyByteArray_AS_STRING(o);
23803 int r = PyBytes_AsStringAndSize(o, &result, length);
23804 if (unlikely(r < 0)) {
23811 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
23812 int is_true = x == Py_True;
23813 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
23814 else return PyObject_IsTrue(x);
23816 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
23818 if (unlikely(!x))
return -1;
23819 retval = __Pyx_PyObject_IsTrue(x);
23823 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result,
const char* type_name) {
23824 #if PY_MAJOR_VERSION >= 3 23825 if (PyLong_Check(result)) {
23826 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
23827 "__int__ returned non-int (type %.200s). " 23828 "The ability to return an instance of a strict subclass of int " 23829 "is deprecated, and may be removed in a future version of Python.",
23830 Py_TYPE(result)->tp_name)) {
23837 PyErr_Format(PyExc_TypeError,
23838 "__%.4s__ returned non-%.4s (type %.200s)",
23839 type_name, type_name, Py_TYPE(result)->tp_name);
23843 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
23844 #if CYTHON_USE_TYPE_SLOTS 23845 PyNumberMethods *m;
23847 const char *name = NULL;
23848 PyObject *res = NULL;
23849 #if PY_MAJOR_VERSION < 3 23850 if (likely(PyInt_Check(x) || PyLong_Check(x)))
23852 if (likely(PyLong_Check(x)))
23854 return __Pyx_NewRef(x);
23855 #if CYTHON_USE_TYPE_SLOTS 23856 m = Py_TYPE(x)->tp_as_number;
23857 #if PY_MAJOR_VERSION < 3 23858 if (m && m->nb_int) {
23860 res = m->nb_int(x);
23862 else if (m && m->nb_long) {
23864 res = m->nb_long(x);
23867 if (likely(m && m->nb_int)) {
23869 res = m->nb_int(x);
23873 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
23874 res = PyNumber_Int(x);
23878 #if PY_MAJOR_VERSION < 3 23879 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
23881 if (unlikely(!PyLong_CheckExact(res))) {
23883 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
23886 else if (!PyErr_Occurred()) {
23887 PyErr_SetString(PyExc_TypeError,
23888 "an integer is required");
23892 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
23895 #if PY_MAJOR_VERSION < 3 23896 if (likely(PyInt_CheckExact(b))) {
23897 if (
sizeof(Py_ssize_t) >=
sizeof(
long))
23898 return PyInt_AS_LONG(b);
23900 return PyInt_AsSsize_t(b);
23903 if (likely(PyLong_CheckExact(b))) {
23904 #if CYTHON_USE_PYLONG_INTERNALS 23905 const digit* digits = ((PyLongObject*)b)->ob_digit;
23906 const Py_ssize_t size = Py_SIZE(b);
23907 if (likely(__Pyx_sst_abs(size) <= 1)) {
23908 ival = likely(size) ? digits[0] : 0;
23909 if (size == -1) ival = -ival;
23914 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
23915 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
23919 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
23920 return -(Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
23924 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
23925 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
23929 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
23930 return -(Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
23934 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
23935 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]));
23939 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
23940 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]));
23946 return PyLong_AsSsize_t(b);
23948 x = PyNumber_Index(b);
23950 ival = PyInt_AsSsize_t(x);
23954 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
23955 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
23957 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
23958 return PyInt_FromSize_t(ival);
int compare(const index_set< LO, HI > &a, const index_set< LO, HI > &b)
"lexicographic compare" eg. {3,4,5} is less than {3,7,8}
const Multivector< Scalar_T, LO, HI > sqrt(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Square root of multivector with specified complexifier.
String clifford_to_str(const Multivector_T &mv)
The "informal" string representation of Multivector_T mv.
const Multivector< Scalar_T, LO, HI > acosh(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Inverse hyperbolic cosine of multivector with specified complexifier.
String index_set_to_repr(const Index_Set_T &ist)
The “official” string representation of Index_Set_T ist.
const Multivector< Scalar_T, LO, HI > sinh(const Multivector< Scalar_T, LO, HI > &val)
Hyperbolic sine of multivector.
index_set< lo_ndx, hi_ndx > IndexSet
Scalar_T abs(const Multivector< Scalar_T, LO, HI > &val)
Absolute value == sqrt(norm)
const Multivector< Scalar_T, LO, HI > log(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Natural logarithm of multivector with specified complexifier.
String clifford_to_repr(const Multivector_T &mv)
The “official” string representation of Multivector_T mv.
Multivector_T cga3(const Multivector_T &x)
Convert Euclidean 3D vector to Conformal Geometric Algebra null vector [DL (10.50)].
const Multivector< Scalar_T, LO, HI > sin(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Sine of multivector with specified complexifier.
const Multivector< Scalar_T, LO, HI > atanh(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Inverse hyperbolic tangent of multivector with specified complexifier.
const framed_multi< Scalar_T, LO, HI > exp(const framed_multi< Scalar_T, LO, HI > &val)
Exponential of multivector.
const Multivector< Scalar_T, LO, HI > cos(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Cosine of multivector with specified complexifier.
const Multivector< Scalar_T, LO, HI > tanh(const Multivector< Scalar_T, LO, HI > &val)
Hyperbolic tangent of multivector.
index_t min_neg(const index_set< LO, HI > &ist)
Minimum negative index, or 0 if none.
const Multivector< Scalar_T, LO, HI > asin(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Inverse sine of multivector with specified complexifier.
const Multivector< Scalar_T, LO, HI > operator &(const Multivector< Scalar_T, LO, HI > &lhs, const RHS< Scalar_T, LO, HI > &rhs)
Inner product.
matrix_multi< scalar_t > Clifford
const Multivector< Scalar_T, LO, HI > complexifier(const Multivector< Scalar_T, LO, HI > &val)
Square root of -1 which commutes with all members of the frame of the given multivector.
PyObject * PyFloat_FromDouble(Scalar_T v)
const Multivector< Scalar_T, LO, HI > atan(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Inverse tangent of multivector with specified complexifier.
const Multivector< Scalar_T, LO, HI > tan(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Tangent of multivector with specified complexifier.
const Multivector< Scalar_T, LO, HI > acos(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Inverse cosine of multivector with specified complexifier.
String index_set_to_str(const Index_Set_T &ist)
The "informal" string representation of Index_Set_T ist.
index_t max_pos(const index_set< LO, HI > &ist)
Maximum positive index, or 0 if none.
const Multivector< Scalar_T, LO, HI > asinh(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Inverse hyperbolic sine of multivector with specified complexifier.
Scalar_T max_abs(const Multivector< Scalar_T, LO, HI > &val)
Maximum of absolute values of components of multivector: multivector infinity norm.
const Multivector< Scalar_T, LO, HI > cosh(const Multivector< Scalar_T, LO, HI > &val)
Hyperbolic cosine of multivector.
Multivector_T cga3std(const Multivector_T &X)
Convert CGA3 null vector to standard Conformal Geometric Algebra null vector [DL (10....
Multivector_T agc3(const Multivector_T &X)
Convert CGA3 null vector to Euclidean 3D vector [DL (10.50)].