57 #define PY_SSIZE_T_CLEAN 60 #error Python headers needed to compile C extensions, please install development version of Python. 61 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) 62 #error Cython requires Python 2.6+ or Python 3.3+. 64 #define CYTHON_ABI "0_29_6" 65 #define CYTHON_HEX_VERSION 0x001D06F0 66 #define CYTHON_FUTURE_DIVISION 0 69 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) 71 #if !defined(WIN32) && !defined(MS_WINDOWS) 83 #define DL_IMPORT(t) t 86 #define DL_EXPORT(t) t 89 #ifndef HAVE_LONG_LONG 90 #if PY_VERSION_HEX >= 0x02070000 91 #define HAVE_LONG_LONG 95 #define PY_LONG_LONG LONG_LONG 98 #define Py_HUGE_VAL HUGE_VAL 101 #define CYTHON_COMPILING_IN_PYPY 1 102 #define CYTHON_COMPILING_IN_PYSTON 0 103 #define CYTHON_COMPILING_IN_CPYTHON 0 104 #undef CYTHON_USE_TYPE_SLOTS 105 #define CYTHON_USE_TYPE_SLOTS 0 106 #undef CYTHON_USE_PYTYPE_LOOKUP 107 #define CYTHON_USE_PYTYPE_LOOKUP 0 108 #if PY_VERSION_HEX < 0x03050000 109 #undef CYTHON_USE_ASYNC_SLOTS 110 #define CYTHON_USE_ASYNC_SLOTS 0 111 #elif !defined(CYTHON_USE_ASYNC_SLOTS) 112 #define CYTHON_USE_ASYNC_SLOTS 1 114 #undef CYTHON_USE_PYLIST_INTERNALS 115 #define CYTHON_USE_PYLIST_INTERNALS 0 116 #undef CYTHON_USE_UNICODE_INTERNALS 117 #define CYTHON_USE_UNICODE_INTERNALS 0 118 #undef CYTHON_USE_UNICODE_WRITER 119 #define CYTHON_USE_UNICODE_WRITER 0 120 #undef CYTHON_USE_PYLONG_INTERNALS 121 #define CYTHON_USE_PYLONG_INTERNALS 0 122 #undef CYTHON_AVOID_BORROWED_REFS 123 #define CYTHON_AVOID_BORROWED_REFS 1 124 #undef CYTHON_ASSUME_SAFE_MACROS 125 #define CYTHON_ASSUME_SAFE_MACROS 0 126 #undef CYTHON_UNPACK_METHODS 127 #define CYTHON_UNPACK_METHODS 0 128 #undef CYTHON_FAST_THREAD_STATE 129 #define CYTHON_FAST_THREAD_STATE 0 130 #undef CYTHON_FAST_PYCALL 131 #define CYTHON_FAST_PYCALL 0 132 #undef CYTHON_PEP489_MULTI_PHASE_INIT 133 #define CYTHON_PEP489_MULTI_PHASE_INIT 0 134 #undef CYTHON_USE_TP_FINALIZE 135 #define CYTHON_USE_TP_FINALIZE 0 136 #undef CYTHON_USE_DICT_VERSIONS 137 #define CYTHON_USE_DICT_VERSIONS 0 138 #undef CYTHON_USE_EXC_INFO_STACK 139 #define CYTHON_USE_EXC_INFO_STACK 0 140 #elif defined(PYSTON_VERSION) 141 #define CYTHON_COMPILING_IN_PYPY 0 142 #define CYTHON_COMPILING_IN_PYSTON 1 143 #define CYTHON_COMPILING_IN_CPYTHON 0 144 #ifndef CYTHON_USE_TYPE_SLOTS 145 #define CYTHON_USE_TYPE_SLOTS 1 147 #undef CYTHON_USE_PYTYPE_LOOKUP 148 #define CYTHON_USE_PYTYPE_LOOKUP 0 149 #undef CYTHON_USE_ASYNC_SLOTS 150 #define CYTHON_USE_ASYNC_SLOTS 0 151 #undef CYTHON_USE_PYLIST_INTERNALS 152 #define CYTHON_USE_PYLIST_INTERNALS 0 153 #ifndef CYTHON_USE_UNICODE_INTERNALS 154 #define CYTHON_USE_UNICODE_INTERNALS 1 156 #undef CYTHON_USE_UNICODE_WRITER 157 #define CYTHON_USE_UNICODE_WRITER 0 158 #undef CYTHON_USE_PYLONG_INTERNALS 159 #define CYTHON_USE_PYLONG_INTERNALS 0 160 #ifndef CYTHON_AVOID_BORROWED_REFS 161 #define CYTHON_AVOID_BORROWED_REFS 0 163 #ifndef CYTHON_ASSUME_SAFE_MACROS 164 #define CYTHON_ASSUME_SAFE_MACROS 1 166 #ifndef CYTHON_UNPACK_METHODS 167 #define CYTHON_UNPACK_METHODS 1 169 #undef CYTHON_FAST_THREAD_STATE 170 #define CYTHON_FAST_THREAD_STATE 0 171 #undef CYTHON_FAST_PYCALL 172 #define CYTHON_FAST_PYCALL 0 173 #undef CYTHON_PEP489_MULTI_PHASE_INIT 174 #define CYTHON_PEP489_MULTI_PHASE_INIT 0 175 #undef CYTHON_USE_TP_FINALIZE 176 #define CYTHON_USE_TP_FINALIZE 0 177 #undef CYTHON_USE_DICT_VERSIONS 178 #define CYTHON_USE_DICT_VERSIONS 0 179 #undef CYTHON_USE_EXC_INFO_STACK 180 #define CYTHON_USE_EXC_INFO_STACK 0 182 #define CYTHON_COMPILING_IN_PYPY 0 183 #define CYTHON_COMPILING_IN_PYSTON 0 184 #define CYTHON_COMPILING_IN_CPYTHON 1 185 #ifndef CYTHON_USE_TYPE_SLOTS 186 #define CYTHON_USE_TYPE_SLOTS 1 188 #if PY_VERSION_HEX < 0x02070000 189 #undef CYTHON_USE_PYTYPE_LOOKUP 190 #define CYTHON_USE_PYTYPE_LOOKUP 0 191 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) 192 #define CYTHON_USE_PYTYPE_LOOKUP 1 194 #if PY_MAJOR_VERSION < 3 195 #undef CYTHON_USE_ASYNC_SLOTS 196 #define CYTHON_USE_ASYNC_SLOTS 0 197 #elif !defined(CYTHON_USE_ASYNC_SLOTS) 198 #define CYTHON_USE_ASYNC_SLOTS 1 200 #if PY_VERSION_HEX < 0x02070000 201 #undef CYTHON_USE_PYLONG_INTERNALS 202 #define CYTHON_USE_PYLONG_INTERNALS 0 203 #elif !defined(CYTHON_USE_PYLONG_INTERNALS) 204 #define CYTHON_USE_PYLONG_INTERNALS 1 206 #ifndef CYTHON_USE_PYLIST_INTERNALS 207 #define CYTHON_USE_PYLIST_INTERNALS 1 209 #ifndef CYTHON_USE_UNICODE_INTERNALS 210 #define CYTHON_USE_UNICODE_INTERNALS 1 212 #if PY_VERSION_HEX < 0x030300F0 213 #undef CYTHON_USE_UNICODE_WRITER 214 #define CYTHON_USE_UNICODE_WRITER 0 215 #elif !defined(CYTHON_USE_UNICODE_WRITER) 216 #define CYTHON_USE_UNICODE_WRITER 1 218 #ifndef CYTHON_AVOID_BORROWED_REFS 219 #define CYTHON_AVOID_BORROWED_REFS 0 221 #ifndef CYTHON_ASSUME_SAFE_MACROS 222 #define CYTHON_ASSUME_SAFE_MACROS 1 224 #ifndef CYTHON_UNPACK_METHODS 225 #define CYTHON_UNPACK_METHODS 1 227 #ifndef CYTHON_FAST_THREAD_STATE 228 #define CYTHON_FAST_THREAD_STATE 1 230 #ifndef CYTHON_FAST_PYCALL 231 #define CYTHON_FAST_PYCALL 1 233 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT 234 #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) 236 #ifndef CYTHON_USE_TP_FINALIZE 237 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) 239 #ifndef CYTHON_USE_DICT_VERSIONS 240 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) 242 #ifndef CYTHON_USE_EXC_INFO_STACK 243 #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) 246 #if !defined(CYTHON_FAST_PYCCALL) 247 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) 249 #if CYTHON_USE_PYLONG_INTERNALS 250 #include "longintrepr.h" 255 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P ==
sizeof(
void*)) };
258 #ifndef __has_attribute 259 #define __has_attribute(x) 0 261 #ifndef __has_cpp_attribute 262 #define __has_cpp_attribute(x) 0 264 #ifndef CYTHON_RESTRICT 265 #if defined(__GNUC__) 266 #define CYTHON_RESTRICT __restrict__ 267 #elif defined(_MSC_VER) && _MSC_VER >= 1400 268 #define CYTHON_RESTRICT __restrict 269 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 270 #define CYTHON_RESTRICT restrict 272 #define CYTHON_RESTRICT 275 #ifndef CYTHON_UNUSED 276 # if defined(__GNUC__) 277 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) 278 # define CYTHON_UNUSED __attribute__ ((__unused__)) 280 # define CYTHON_UNUSED 282 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) 283 # define CYTHON_UNUSED __attribute__ ((__unused__)) 285 # define CYTHON_UNUSED 288 #ifndef CYTHON_MAYBE_UNUSED_VAR 289 # if defined(__cplusplus) 290 template<
class T>
void CYTHON_MAYBE_UNUSED_VAR(
const T& ) { }
292 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) 295 #ifndef CYTHON_NCP_UNUSED 296 # if CYTHON_COMPILING_IN_CPYTHON 297 # define CYTHON_NCP_UNUSED 299 # define CYTHON_NCP_UNUSED CYTHON_UNUSED 302 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) 304 #ifndef _MSC_STDINT_H_ 306 typedef unsigned char uint8_t;
307 typedef unsigned int uint32_t;
309 typedef unsigned __int8 uint8_t;
310 typedef unsigned __int32 uint32_t;
316 #ifndef CYTHON_FALLTHROUGH 317 #if defined(__cplusplus) && __cplusplus >= 201103L 318 #if __has_cpp_attribute(fallthrough) 319 #define CYTHON_FALLTHROUGH [[fallthrough]] 320 #elif __has_cpp_attribute(clang::fallthrough) 321 #define CYTHON_FALLTHROUGH [[clang::fallthrough]] 322 #elif __has_cpp_attribute(gnu::fallthrough) 323 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] 326 #ifndef CYTHON_FALLTHROUGH 327 #if __has_attribute(fallthrough) 328 #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) 330 #define CYTHON_FALLTHROUGH 333 #if defined(__clang__ ) && defined(__apple_build_version__) 334 #if __apple_build_version__ < 7000000 335 #undef CYTHON_FALLTHROUGH 336 #define CYTHON_FALLTHROUGH 342 #error "Cython files generated with the C++ option must be compiled with a C++ compiler." 344 #ifndef CYTHON_INLINE 345 #if defined(__clang__) 346 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) 348 #define CYTHON_INLINE inline 352 void __Pyx_call_destructor(T& x) {
356 class __Pyx_FakeReference {
358 __Pyx_FakeReference() : ptr(NULL) { }
359 __Pyx_FakeReference(
const T& ref) : ptr(const_cast<T*>(&ref)) { }
360 T *operator->() {
return ptr; }
362 operator T&() {
return *ptr; }
363 template<
typename U>
bool operator ==(U other) {
return *ptr == other; }
364 template<
typename U>
bool operator !=(U other) {
return *ptr != other; }
369 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) 370 #define Py_OptimizeFlag 0 372 #define __PYX_BUILD_PY_SSIZE_T "n" 373 #define CYTHON_FORMAT_SSIZE_T "z" 374 #if PY_MAJOR_VERSION < 3 375 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" 376 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ 377 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) 378 #define __Pyx_DefaultClassType PyClass_Type 380 #define __Pyx_BUILTIN_MODULE_NAME "builtins" 381 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ 382 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) 383 #define __Pyx_DefaultClassType PyType_Type 385 #ifndef Py_TPFLAGS_CHECKTYPES 386 #define Py_TPFLAGS_CHECKTYPES 0 388 #ifndef Py_TPFLAGS_HAVE_INDEX 389 #define Py_TPFLAGS_HAVE_INDEX 0 391 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER 392 #define Py_TPFLAGS_HAVE_NEWBUFFER 0 394 #ifndef Py_TPFLAGS_HAVE_FINALIZE 395 #define Py_TPFLAGS_HAVE_FINALIZE 0 397 #ifndef METH_STACKLESS 398 #define METH_STACKLESS 0 400 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) 401 #ifndef METH_FASTCALL 402 #define METH_FASTCALL 0x80 404 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *
self, PyObject *
const *args, Py_ssize_t nargs);
405 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *
self, PyObject *
const *args,
406 Py_ssize_t nargs, PyObject *kwnames);
408 #define __Pyx_PyCFunctionFast _PyCFunctionFast 409 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords 411 #if CYTHON_FAST_PYCCALL 412 #define __Pyx_PyFastCFunction_Check(func)\ 413 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) 415 #define __Pyx_PyFastCFunction_Check(func) 0 417 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) 418 #define PyObject_Malloc(s) PyMem_Malloc(s) 419 #define PyObject_Free(p) PyMem_Free(p) 420 #define PyObject_Realloc(p) PyMem_Realloc(p) 422 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 423 #define PyMem_RawMalloc(n) PyMem_Malloc(n) 424 #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) 425 #define PyMem_RawFree(p) PyMem_Free(p) 427 #if CYTHON_COMPILING_IN_PYSTON 428 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) 429 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) 431 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) 432 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) 434 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 435 #define __Pyx_PyThreadState_Current PyThreadState_GET() 436 #elif PY_VERSION_HEX >= 0x03060000 437 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() 438 #elif PY_VERSION_HEX >= 0x03000000 439 #define __Pyx_PyThreadState_Current PyThreadState_GET() 441 #define __Pyx_PyThreadState_Current _PyThreadState_Current 443 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) 444 #include "pythread.h" 445 #define Py_tss_NEEDS_INIT 0 446 typedef int Py_tss_t;
447 static CYTHON_INLINE
int PyThread_tss_create(Py_tss_t *key) {
448 *key = PyThread_create_key();
451 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(
void) {
452 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(
sizeof(Py_tss_t));
453 *key = Py_tss_NEEDS_INIT;
456 static CYTHON_INLINE
void PyThread_tss_free(Py_tss_t *key) {
459 static CYTHON_INLINE
int PyThread_tss_is_created(Py_tss_t *key) {
460 return *key != Py_tss_NEEDS_INIT;
462 static CYTHON_INLINE
void PyThread_tss_delete(Py_tss_t *key) {
463 PyThread_delete_key(*key);
464 *key = Py_tss_NEEDS_INIT;
466 static CYTHON_INLINE
int PyThread_tss_set(Py_tss_t *key,
void *value) {
467 return PyThread_set_key_value(*key, value);
469 static CYTHON_INLINE
void * PyThread_tss_get(Py_tss_t *key) {
470 return PyThread_get_key_value(*key);
473 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) 474 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) 476 #define __Pyx_PyDict_NewPresized(n) PyDict_New() 478 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION 479 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) 480 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) 482 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) 483 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) 485 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS 486 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) 488 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) 490 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) 491 #define CYTHON_PEP393_ENABLED 1 492 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 493 0 : _PyUnicode_Ready((PyObject *)(op))) 494 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) 495 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) 496 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) 497 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) 498 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) 499 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) 500 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) 501 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) 503 #define CYTHON_PEP393_ENABLED 0 504 #define PyUnicode_1BYTE_KIND 1 505 #define PyUnicode_2BYTE_KIND 2 506 #define PyUnicode_4BYTE_KIND 4 507 #define __Pyx_PyUnicode_READY(op) (0) 508 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) 509 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) 510 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) 511 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) 512 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) 513 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) 514 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) 515 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) 517 #if CYTHON_COMPILING_IN_PYPY 518 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) 519 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) 521 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) 522 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ 523 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) 525 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) 526 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) 528 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) 529 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) 531 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) 532 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) 534 #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)) 535 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) 536 #if PY_MAJOR_VERSION >= 3 537 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) 539 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) 541 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) 542 #define PyObject_ASCII(o) PyObject_Repr(o) 544 #if PY_MAJOR_VERSION >= 3 545 #define PyBaseString_Type PyUnicode_Type 546 #define PyStringObject PyUnicodeObject 547 #define PyString_Type PyUnicode_Type 548 #define PyString_Check PyUnicode_Check 549 #define PyString_CheckExact PyUnicode_CheckExact 550 #define PyObject_Unicode PyObject_Str 552 #if PY_MAJOR_VERSION >= 3 553 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) 554 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) 556 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) 557 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) 559 #ifndef PySet_CheckExact 560 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) 562 #if CYTHON_ASSUME_SAFE_MACROS 563 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) 565 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) 567 #if PY_MAJOR_VERSION >= 3 568 #define PyIntObject PyLongObject 569 #define PyInt_Type PyLong_Type 570 #define PyInt_Check(op) PyLong_Check(op) 571 #define PyInt_CheckExact(op) PyLong_CheckExact(op) 572 #define PyInt_FromString PyLong_FromString 573 #define PyInt_FromUnicode PyLong_FromUnicode 574 #define PyInt_FromLong PyLong_FromLong 575 #define PyInt_FromSize_t PyLong_FromSize_t 576 #define PyInt_FromSsize_t PyLong_FromSsize_t 577 #define PyInt_AsLong PyLong_AsLong 578 #define PyInt_AS_LONG PyLong_AS_LONG 579 #define PyInt_AsSsize_t PyLong_AsSsize_t 580 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask 581 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask 582 #define PyNumber_Int PyNumber_Long 584 #if PY_MAJOR_VERSION >= 3 585 #define PyBoolObject PyLongObject 587 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY 588 #ifndef PyUnicode_InternFromString 589 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) 592 #if PY_VERSION_HEX < 0x030200A4 593 typedef long Py_hash_t;
594 #define __Pyx_PyInt_FromHash_t PyInt_FromLong 595 #define __Pyx_PyInt_AsHash_t PyInt_AsLong 597 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t 598 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t 600 #if PY_MAJOR_VERSION >= 3 601 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) 603 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) 605 #if CYTHON_USE_ASYNC_SLOTS 606 #if PY_VERSION_HEX >= 0x030500B1 607 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods 608 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) 610 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) 613 #define __Pyx_PyType_AsAsync(obj) NULL 615 #ifndef __Pyx_PyAsyncMethodsStruct 620 } __Pyx_PyAsyncMethodsStruct;
623 #if defined(WIN32) || defined(MS_WINDOWS) 624 #define _USE_MATH_DEFINES 628 #define __PYX_NAN() ((float) NAN) 630 static CYTHON_INLINE
float __PYX_NAN() {
632 memset(&value, 0xFF,
sizeof(value));
636 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) 637 #define __Pyx_truncl trunc 639 #define __Pyx_truncl truncl 643 #define __PYX_ERR(f_index, lineno, Ln_error) \ 645 __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ 648 #ifndef __PYX_EXTERN_C 650 #define __PYX_EXTERN_C extern "C" 652 #define __PYX_EXTERN_C extern 656 #define __PYX_HAVE__PyClical 657 #define __PYX_HAVE_API__PyClical 669 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) 670 #define CYTHON_WITHOUT_ASSERTIONS 673 typedef struct {PyObject **p;
const char *s;
const Py_ssize_t n;
const char* encoding;
674 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
676 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 677 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 678 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) 679 #define __PYX_DEFAULT_STRING_ENCODING "" 680 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString 681 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize 682 #define __Pyx_uchar_cast(c) ((unsigned char)c) 683 #define __Pyx_long_cast(x) ((long)x) 684 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ 685 (sizeof(type) < sizeof(Py_ssize_t)) ||\ 686 (sizeof(type) > sizeof(Py_ssize_t) &&\ 687 likely(v < (type)PY_SSIZE_T_MAX ||\ 688 v == (type)PY_SSIZE_T_MAX) &&\ 689 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ 690 v == (type)PY_SSIZE_T_MIN))) ||\ 691 (sizeof(type) == sizeof(Py_ssize_t) &&\ 692 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ 693 v == (type)PY_SSIZE_T_MAX))) ) 694 static CYTHON_INLINE
int __Pyx_is_valid_index(Py_ssize_t
i, Py_ssize_t limit) {
695 return (
size_t)
i < (size_t) limit;
697 #if defined (__cplusplus) && __cplusplus >= 201103L 699 #define __Pyx_sst_abs(value) std::abs(value) 700 #elif SIZEOF_INT >= SIZEOF_SIZE_T 701 #define __Pyx_sst_abs(value) abs(value) 702 #elif SIZEOF_LONG >= SIZEOF_SIZE_T 703 #define __Pyx_sst_abs(value) labs(value) 704 #elif defined (_MSC_VER) 705 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) 706 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 707 #define __Pyx_sst_abs(value) llabs(value) 708 #elif defined (__GNUC__) 709 #define __Pyx_sst_abs(value) __builtin_llabs(value) 711 #define __Pyx_sst_abs(value) ((value<0) ? -value : value) 713 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
714 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
715 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) 716 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) 717 #define __Pyx_PyBytes_FromString PyBytes_FromString 718 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize 719 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
720 #if PY_MAJOR_VERSION < 3 721 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString 722 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize 724 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString 725 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize 727 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) 728 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) 729 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) 730 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) 731 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) 732 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) 733 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) 734 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) 735 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) 736 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) 737 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) 738 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) 739 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) 740 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) 741 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) 742 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) 743 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *u) {
744 const Py_UNICODE *u_end = u;
746 return (
size_t)(u_end - u - 1);
748 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) 749 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode 750 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode 751 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) 752 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) 753 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
754 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
755 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
756 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
757 #define __Pyx_PySequence_Tuple(obj)\ 758 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) 759 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
760 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
761 #if CYTHON_ASSUME_SAFE_MACROS 762 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) 764 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) 766 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) 767 #if PY_MAJOR_VERSION >= 3 768 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) 770 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) 772 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) 773 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 774 static int __Pyx_sys_getdefaultencoding_not_ascii;
775 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
777 PyObject* default_encoding = NULL;
778 PyObject* ascii_chars_u = NULL;
779 PyObject* ascii_chars_b = NULL;
780 const char* default_encoding_c;
781 sys = PyImport_ImportModule(
"sys");
783 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
785 if (!default_encoding)
goto bad;
786 default_encoding_c = PyBytes_AsString(default_encoding);
787 if (!default_encoding_c)
goto bad;
788 if (strcmp(default_encoding_c,
"ascii") == 0) {
789 __Pyx_sys_getdefaultencoding_not_ascii = 0;
791 char ascii_chars[128];
793 for (c = 0; c < 128; c++) {
796 __Pyx_sys_getdefaultencoding_not_ascii = 1;
797 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
798 if (!ascii_chars_u)
goto bad;
799 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
800 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
803 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
807 Py_DECREF(ascii_chars_u);
808 Py_DECREF(ascii_chars_b);
810 Py_DECREF(default_encoding);
813 Py_XDECREF(default_encoding);
814 Py_XDECREF(ascii_chars_u);
815 Py_XDECREF(ascii_chars_b);
819 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 820 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) 822 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) 823 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 824 static char* __PYX_DEFAULT_STRING_ENCODING;
825 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
827 PyObject* default_encoding = NULL;
828 char* default_encoding_c;
829 sys = PyImport_ImportModule(
"sys");
831 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
833 if (!default_encoding)
goto bad;
834 default_encoding_c = PyBytes_AsString(default_encoding);
835 if (!default_encoding_c)
goto bad;
836 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c) + 1);
837 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
838 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
839 Py_DECREF(default_encoding);
842 Py_XDECREF(default_encoding);
850 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) 851 #define likely(x) __builtin_expect(!!(x), 1) 852 #define unlikely(x) __builtin_expect(!!(x), 0) 854 #define likely(x) (x) 855 #define unlikely(x) (x) 857 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
859 static PyObject *__pyx_m = NULL;
860 static PyObject *__pyx_d;
861 static PyObject *__pyx_b;
862 static PyObject *__pyx_cython_runtime = NULL;
863 static PyObject *__pyx_empty_tuple;
864 static PyObject *__pyx_empty_bytes;
865 static PyObject *__pyx_empty_unicode;
866 static int __pyx_lineno;
867 static int __pyx_clineno = 0;
868 static const char * __pyx_cfilenm= __FILE__;
869 static const char *__pyx_filename;
872 static const char *__pyx_f[] = {
878 struct __pyx_obj_8PyClical_index_set;
879 struct __pyx_obj_8PyClical_clifford;
880 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__;
881 struct __pyx_opt_args_8PyClical_sqrt;
882 struct __pyx_opt_args_8PyClical_log;
883 struct __pyx_opt_args_8PyClical_cos;
884 struct __pyx_opt_args_8PyClical_acos;
885 struct __pyx_opt_args_8PyClical_acosh;
886 struct __pyx_opt_args_8PyClical_sin;
887 struct __pyx_opt_args_8PyClical_asin;
888 struct __pyx_opt_args_8PyClical_asinh;
889 struct __pyx_opt_args_8PyClical_tan;
890 struct __pyx_opt_args_8PyClical_atan;
891 struct __pyx_opt_args_8PyClical_atanh;
892 struct __pyx_opt_args_8PyClical_random_clifford;
901 struct __pyx_opt_args_8PyClical_sqrt {
913 struct __pyx_opt_args_8PyClical_log {
925 struct __pyx_opt_args_8PyClical_cos {
937 struct __pyx_opt_args_8PyClical_acos {
949 struct __pyx_opt_args_8PyClical_acosh {
961 struct __pyx_opt_args_8PyClical_sin {
973 struct __pyx_opt_args_8PyClical_asin {
985 struct __pyx_opt_args_8PyClical_asinh {
997 struct __pyx_opt_args_8PyClical_tan {
1009 struct __pyx_opt_args_8PyClical_atan {
1021 struct __pyx_opt_args_8PyClical_atanh {
1033 struct __pyx_opt_args_8PyClical_random_clifford {
1045 struct __pyx_obj_8PyClical_index_set {
1047 struct __pyx_vtabstruct_8PyClical_index_set *__pyx_vtab;
1059 struct __pyx_obj_8PyClical_clifford {
1061 struct __pyx_vtabstruct_8PyClical_clifford *__pyx_vtab;
1073 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ {
1075 PyObject *__pyx_v_idx;
1076 struct __pyx_obj_8PyClical_index_set *__pyx_v_self;
1077 PyObject *__pyx_t_0;
1078 Py_ssize_t __pyx_t_1;
1079 PyObject *(*__pyx_t_2)(PyObject *);
1092 struct __pyx_vtabstruct_8PyClical_index_set {
1093 PyObject *(*wrap)(
struct __pyx_obj_8PyClical_index_set *,
IndexSet);
1094 IndexSet (*unwrap)(
struct __pyx_obj_8PyClical_index_set *);
1095 PyObject *(*copy)(
struct __pyx_obj_8PyClical_index_set *,
int __pyx_skip_dispatch);
1097 static struct __pyx_vtabstruct_8PyClical_index_set *__pyx_vtabptr_8PyClical_index_set;
1098 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_9index_set_wrap(
struct __pyx_obj_8PyClical_index_set *,
IndexSet);
1099 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_9index_set_unwrap(
struct __pyx_obj_8PyClical_index_set *);
1110 struct __pyx_vtabstruct_8PyClical_clifford {
1111 PyObject *(*wrap)(
struct __pyx_obj_8PyClical_clifford *,
Clifford);
1112 Clifford (*unwrap)(
struct __pyx_obj_8PyClical_clifford *);
1113 PyObject *(*copy)(
struct __pyx_obj_8PyClical_clifford *,
int __pyx_skip_dispatch);
1115 static struct __pyx_vtabstruct_8PyClical_clifford *__pyx_vtabptr_8PyClical_clifford;
1116 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_8clifford_wrap(
struct __pyx_obj_8PyClical_clifford *,
Clifford);
1117 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_8clifford_unwrap(
struct __pyx_obj_8PyClical_clifford *);
1121 #ifndef CYTHON_REFNANNY 1122 #define CYTHON_REFNANNY 0 1126 void (*INCREF)(
void*, PyObject*, int);
1127 void (*DECREF)(
void*, PyObject*, int);
1128 void (*GOTREF)(
void*, PyObject*, int);
1129 void (*GIVEREF)(
void*, PyObject*, int);
1130 void* (*SetupContext)(
const char*, int,
const char*);
1131 void (*FinishContext)(
void**);
1132 } __Pyx_RefNannyAPIStruct;
1133 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1134 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1135 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; 1137 #define __Pyx_RefNannySetupContext(name, acquire_gil)\ 1139 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ 1140 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ 1141 PyGILState_Release(__pyx_gilstate_save);\ 1143 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ 1146 #define __Pyx_RefNannySetupContext(name, acquire_gil)\ 1147 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) 1149 #define __Pyx_RefNannyFinishContext()\ 1150 __Pyx_RefNanny->FinishContext(&__pyx_refnanny) 1151 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1152 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1153 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1154 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1155 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) 1156 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) 1157 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) 1158 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) 1160 #define __Pyx_RefNannyDeclarations 1161 #define __Pyx_RefNannySetupContext(name, acquire_gil) 1162 #define __Pyx_RefNannyFinishContext() 1163 #define __Pyx_INCREF(r) Py_INCREF(r) 1164 #define __Pyx_DECREF(r) Py_DECREF(r) 1165 #define __Pyx_GOTREF(r) 1166 #define __Pyx_GIVEREF(r) 1167 #define __Pyx_XINCREF(r) Py_XINCREF(r) 1168 #define __Pyx_XDECREF(r) Py_XDECREF(r) 1169 #define __Pyx_XGOTREF(r) 1170 #define __Pyx_XGIVEREF(r) 1172 #define __Pyx_XDECREF_SET(r, v) do {\ 1173 PyObject *tmp = (PyObject *) r;\ 1174 r = v; __Pyx_XDECREF(tmp);\ 1176 #define __Pyx_DECREF_SET(r, v) do {\ 1177 PyObject *tmp = (PyObject *) r;\ 1178 r = v; __Pyx_DECREF(tmp);\ 1180 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) 1181 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) 1184 #if CYTHON_USE_TYPE_SLOTS 1185 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject*
obj, PyObject* attr_name);
1187 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) 1191 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1194 #if CYTHON_FAST_PYCCALL 1195 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1197 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) 1201 #if CYTHON_FAST_PYCALL 1202 #define __Pyx_PyFunction_FastCall(func, args, nargs)\ 1203 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) 1204 #if 1 || PY_VERSION_HEX < 0x030600B1 1205 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
int nargs, PyObject *kwargs);
1207 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) 1209 #define __Pyx_BUILD_ASSERT_EXPR(cond)\ 1210 (sizeof(char [1 - 2*!(cond)]) - 1) 1211 #ifndef Py_MEMBER_SIZE 1212 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) 1214 static size_t __pyx_pyframe_localsplus_offset = 0;
1215 #include "frameobject.h" 1216 #define __Pxy_PyFrame_Initialize_Offsets()\ 1217 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ 1218 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) 1219 #define __Pyx_PyFrame_GetLocalsplus(frame)\ 1220 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) 1224 #if CYTHON_COMPILING_IN_CPYTHON 1225 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1227 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) 1231 #if CYTHON_COMPILING_IN_CPYTHON 1232 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1236 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1239 #if CYTHON_FAST_THREAD_STATE 1240 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; 1241 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; 1242 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type 1244 #define __Pyx_PyThreadState_declare 1245 #define __Pyx_PyThreadState_assign 1246 #define __Pyx_PyErr_Occurred() PyErr_Occurred() 1250 #if CYTHON_FAST_THREAD_STATE 1251 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) 1252 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) 1253 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) 1254 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) 1255 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) 1256 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1257 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1258 #if CYTHON_COMPILING_IN_CPYTHON 1259 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) 1261 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) 1264 #define __Pyx_PyErr_Clear() PyErr_Clear() 1265 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) 1266 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) 1267 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) 1268 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) 1269 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) 1270 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) 1271 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) 1275 static void __Pyx_WriteUnraisable(
const char *name,
int clineno,
1276 int lineno,
const char *filename,
1277 int full_traceback,
int nogil);
1280 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS 1281 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) 1282 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) 1283 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ 1284 (version_var) = __PYX_GET_DICT_VERSION(dict);\ 1285 (cache_var) = (value); 1286 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ 1287 static PY_UINT64_T __pyx_dict_version = 0;\ 1288 static PyObject *__pyx_dict_cached_value = NULL;\ 1289 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ 1290 (VAR) = __pyx_dict_cached_value;\ 1292 (VAR) = __pyx_dict_cached_value = (LOOKUP);\ 1293 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ 1296 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *
obj);
1297 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *
obj);
1298 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject*
obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1300 #define __PYX_GET_DICT_VERSION(dict) (0) 1301 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) 1302 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); 1306 #if CYTHON_COMPILING_IN_CPYTHON 1307 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1309 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) 1313 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
1316 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1317 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1318 const char* function_name);
1321 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1322 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1325 #if CYTHON_USE_DICT_VERSIONS 1326 #define __Pyx_GetModuleGlobalName(var, name) {\ 1327 static PY_UINT64_T __pyx_dict_version = 0;\ 1328 static PyObject *__pyx_dict_cached_value = NULL;\ 1329 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ 1330 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ 1331 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ 1333 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\ 1334 PY_UINT64_T __pyx_dict_version;\ 1335 PyObject *__pyx_dict_cached_value;\ 1336 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ 1338 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1340 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) 1341 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) 1342 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1346 #if CYTHON_USE_EXC_INFO_STACK 1347 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1351 #if CYTHON_FAST_THREAD_STATE 1352 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) 1353 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1354 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) 1355 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1357 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) 1358 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) 1362 #if CYTHON_FAST_THREAD_STATE 1363 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) 1364 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1366 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) 1370 #if CYTHON_FAST_THREAD_STATE 1371 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) 1372 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1374 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1378 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1381 #if !CYTHON_COMPILING_IN_PYPY 1382 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2,
long intval,
int inplace,
int zerodivision_check);
1384 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\ 1385 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) 1389 static CYTHON_INLINE
int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq,
int eq) {
1390 int result = PySequence_Contains(seq, item);
1391 return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
1395 #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ 1396 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ 1397 __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\ 1398 (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\ 1399 __Pyx_SetItemInt_Generic(o, to_py_func(i), v))) 1400 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
1401 static CYTHON_INLINE
int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t
i, PyObject *v,
1402 int is_list,
int wraparound,
int boundscheck);
1405 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2);
1408 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ 1409 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\ 1410 __Pyx__ArgTypeTest(obj, type, name, exact)) 1411 static int __Pyx__ArgTypeTest(PyObject *
obj, PyTypeObject *type,
const char *name,
int exact);
1414 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
1420 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 1421 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject*
obj, PyObject* attr_name);
1423 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr 1427 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 1428 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject*
obj, PyObject* attr_name);
1430 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr 1434 static int __Pyx_SetVtable(PyObject *dict,
void *vtable);
1437 static int __Pyx_setup_reduce(PyObject* type_obj);
1440 #if !CYTHON_COMPILING_IN_PYPY 1441 static PyObject* __Pyx_PyFloat_DivideObjC(PyObject *op1, PyObject *op2,
double floatval,
int inplace,
int zerodivision_check);
1443 #define __Pyx_PyFloat_DivideObjC(op1, op2, floatval, inplace, zerodivision_check)\ 1444 ((inplace ? __Pyx_PyNumber_InPlaceDivide(op1, op2) : __Pyx_PyNumber_Divide(op1, op2))) 1448 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals);
1451 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals);
1454 #if PY_MAJOR_VERSION >= 3 1455 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals 1457 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals 1461 #ifdef CYTHON_CLINE_IN_TRACEBACK 1462 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) 1464 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
1469 PyCodeObject* code_object;
1471 } __Pyx_CodeObjectCacheEntry;
1472 struct __Pyx_CodeObjectCache {
1475 __Pyx_CodeObjectCacheEntry* entries;
1477 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1478 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
1479 static PyCodeObject *__pyx_find_code_object(
int code_line);
1480 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
1483 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
1484 int py_line,
const char *filename);
1487 #ifndef __Pyx_CppExn2PyErr 1490 #include <stdexcept> 1492 static void __Pyx_CppExn2PyErr() {
1494 if (PyErr_Occurred())
1498 }
catch (
const std::bad_alloc& exn) {
1499 PyErr_SetString(PyExc_MemoryError, exn.what());
1500 }
catch (
const std::bad_cast& exn) {
1501 PyErr_SetString(PyExc_TypeError, exn.what());
1502 }
catch (
const std::bad_typeid& exn) {
1503 PyErr_SetString(PyExc_TypeError, exn.what());
1504 }
catch (
const std::domain_error& exn) {
1505 PyErr_SetString(PyExc_ValueError, exn.what());
1506 }
catch (
const std::invalid_argument& exn) {
1507 PyErr_SetString(PyExc_ValueError, exn.what());
1508 }
catch (
const std::ios_base::failure& exn) {
1509 PyErr_SetString(PyExc_IOError, exn.what());
1510 }
catch (
const std::out_of_range& exn) {
1511 PyErr_SetString(PyExc_IndexError, exn.what());
1512 }
catch (
const std::overflow_error& exn) {
1513 PyErr_SetString(PyExc_OverflowError, exn.what());
1514 }
catch (
const std::range_error& exn) {
1515 PyErr_SetString(PyExc_ArithmeticError, exn.what());
1516 }
catch (
const std::underflow_error& exn) {
1517 PyErr_SetString(PyExc_ArithmeticError, exn.what());
1518 }
catch (
const std::exception& exn) {
1519 PyErr_SetString(PyExc_RuntimeError, exn.what());
1523 PyErr_SetString(PyExc_RuntimeError,
"Unknown exception");
1529 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
1532 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
1535 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
1538 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
1541 #if CYTHON_COMPILING_IN_CPYTHON 1542 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) 1543 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1544 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1545 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1547 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) 1548 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) 1549 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) 1551 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) 1554 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
1557 #if CYTHON_FAST_THREAD_STATE 1558 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) 1559 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1561 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
1565 static int __Pyx_PyObject_GetMethod(PyObject *
obj, PyObject *name, PyObject **method);
1568 static PyObject* __Pyx_PyObject_CallMethod1(PyObject*
obj, PyObject* method_name, PyObject* arg);
1571 typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyThreadState *, PyObject *);
1572 #if CYTHON_USE_EXC_INFO_STACK 1573 #define __Pyx_ExcInfoStruct _PyErr_StackItem 1577 PyObject *exc_value;
1578 PyObject *exc_traceback;
1579 } __Pyx_ExcInfoStruct;
1583 __pyx_coroutine_body_t body;
1585 __Pyx_ExcInfoStruct gi_exc_state;
1586 PyObject *gi_weakreflist;
1588 PyObject *yieldfrom;
1590 PyObject *gi_qualname;
1591 PyObject *gi_modulename;
1595 } __pyx_CoroutineObject;
1596 static __pyx_CoroutineObject *__Pyx__Coroutine_New(
1597 PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
1598 PyObject *name, PyObject *qualname, PyObject *module_name);
1599 static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
1600 __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
1601 PyObject *name, PyObject *qualname, PyObject *module_name);
1602 static CYTHON_INLINE
void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *
self);
1603 static int __Pyx_Coroutine_clear(PyObject *
self);
1604 static PyObject *__Pyx_Coroutine_Send(PyObject *
self, PyObject *value);
1605 static PyObject *__Pyx_Coroutine_Close(PyObject *
self);
1606 static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
1607 #if CYTHON_USE_EXC_INFO_STACK 1608 #define __Pyx_Coroutine_SwapException(self) 1609 #define __Pyx_Coroutine_ResetAndClearException(self) __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state) 1611 #define __Pyx_Coroutine_SwapException(self) {\ 1612 __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\ 1613 __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\ 1615 #define __Pyx_Coroutine_ResetAndClearException(self) {\ 1616 __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\ 1617 (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\ 1620 #if CYTHON_FAST_THREAD_STATE 1621 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ 1622 __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue) 1624 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ 1625 __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue) 1627 static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue);
1628 static CYTHON_INLINE
void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state);
1631 static PyObject* __Pyx_Coroutine_patch_module(PyObject* module,
const char* py_code);
1634 static int __Pyx_patch_abc(
void);
1637 #define __Pyx_Generator_USED 1638 static PyTypeObject *__pyx_GeneratorType = 0;
1639 #define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType) 1640 #define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\ 1641 __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name) 1642 static PyObject *__Pyx_Generator_Next(PyObject *
self);
1643 static int __pyx_Generator_init(
void);
1646 static int __Pyx_check_binary_version(
void);
1649 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1651 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_9index_set_wrap(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self,
IndexSet __pyx_v_other);
1652 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_9index_set_unwrap(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
1653 static PyObject *__pyx_f_8PyClical_9index_set_copy(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self,
int __pyx_skip_dispatch);
1654 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_8clifford_wrap(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self,
Clifford __pyx_v_other);
1655 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_8clifford_unwrap(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
1656 static PyObject *__pyx_f_8PyClical_8clifford_copy(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self,
int __pyx_skip_dispatch);
1663 static PyTypeObject *__pyx_ptype_8PyClical_index_set = 0;
1664 static PyTypeObject *__pyx_ptype_8PyClical_clifford = 0;
1665 static PyTypeObject *__pyx_ptype_8PyClical___pyx_scope_struct____iter__ = 0;
1666 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_toIndexSet(PyObject *);
1667 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_compare(PyObject *, PyObject *,
int __pyx_skip_dispatch);
1668 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_min_neg(PyObject *,
int __pyx_skip_dispatch);
1669 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_max_pos(PyObject *,
int __pyx_skip_dispatch);
1670 static CYTHON_INLINE std::vector<scalar_t> __pyx_f_8PyClical_list_to_vector(PyObject *);
1671 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_toClifford(PyObject *);
1672 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_inv(PyObject *,
int __pyx_skip_dispatch);
1673 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_scalar(PyObject *,
int __pyx_skip_dispatch);
1674 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_real(PyObject *,
int __pyx_skip_dispatch);
1675 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_imag(PyObject *,
int __pyx_skip_dispatch);
1676 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_pure(PyObject *,
int __pyx_skip_dispatch);
1677 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_even(PyObject *,
int __pyx_skip_dispatch);
1678 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_odd(PyObject *,
int __pyx_skip_dispatch);
1679 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_involute(PyObject *,
int __pyx_skip_dispatch);
1680 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_reverse(PyObject *,
int __pyx_skip_dispatch);
1681 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_conj(PyObject *,
int __pyx_skip_dispatch);
1682 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_quad(PyObject *,
int __pyx_skip_dispatch);
1683 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_norm(PyObject *,
int __pyx_skip_dispatch);
1684 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_abs(PyObject *,
int __pyx_skip_dispatch);
1685 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_max_abs(PyObject *,
int __pyx_skip_dispatch);
1686 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_pow(PyObject *, PyObject *,
int __pyx_skip_dispatch);
1687 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_outer_pow(PyObject *, PyObject *,
int __pyx_skip_dispatch);
1688 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_complexifier(PyObject *,
int __pyx_skip_dispatch);
1689 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_sqrt(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_sqrt *__pyx_optional_args);
1690 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_exp(PyObject *,
int __pyx_skip_dispatch);
1691 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_log(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_log *__pyx_optional_args);
1692 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cos(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_cos *__pyx_optional_args);
1693 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_acos(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_acos *__pyx_optional_args);
1694 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cosh(PyObject *,
int __pyx_skip_dispatch);
1695 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_acosh(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_acosh *__pyx_optional_args);
1696 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_sin(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_sin *__pyx_optional_args);
1697 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_asin(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_asin *__pyx_optional_args);
1698 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_sinh(PyObject *,
int __pyx_skip_dispatch);
1699 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_asinh(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_asinh *__pyx_optional_args);
1700 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_tan(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_tan *__pyx_optional_args);
1701 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_atan(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_atan *__pyx_optional_args);
1702 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_tanh(PyObject *,
int __pyx_skip_dispatch);
1703 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_atanh(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_atanh *__pyx_optional_args);
1704 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);
1705 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cga3(PyObject *,
int __pyx_skip_dispatch);
1706 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cga3std(PyObject *,
int __pyx_skip_dispatch);
1707 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_agc3(PyObject *,
int __pyx_skip_dispatch);
1708 #define __Pyx_MODULE_NAME "PyClical" 1709 extern int __pyx_module_is_main_PyClical;
1710 int __pyx_module_is_main_PyClical = 0;
1713 static PyObject *__pyx_builtin_IndexError;
1714 static PyObject *__pyx_builtin_RuntimeError;
1715 static PyObject *__pyx_builtin_TypeError;
1716 static PyObject *__pyx_builtin_ValueError;
1717 static PyObject *__pyx_builtin_NotImplemented;
1718 static PyObject *__pyx_builtin_range;
1719 static PyObject *__pyx_builtin_xrange;
1720 static const char __pyx_k_[] =
".";
1721 static const char __pyx_k_e[] =
"e";
1722 static const char __pyx_k_i[] =
"i";
1723 static const char __pyx_k_m[] =
"m";
1724 static const char __pyx_k_p[] =
"p";
1725 static const char __pyx_k_q[] =
"q";
1726 static const char __pyx_k__2[] =
" ";
1727 static const char __pyx_k__5[] =
":";
1728 static const char __pyx_k__6[] =
"\n\t";
1729 static const char __pyx_k__7[] =
" (";
1730 static const char __pyx_k__8[] =
", ";
1731 static const char __pyx_k__9[] =
").";
1732 static const char __pyx_k_cl[] =
"cl";
1733 static const char __pyx_k_pi[] =
"pi";
1734 static const char __pyx_k_cos[] =
"cos";
1735 static const char __pyx_k_exp[] =
"exp";
1736 static const char __pyx_k_frm[] =
"frm";
1737 static const char __pyx_k_inv[] =
"inv";
1738 static const char __pyx_k_ist[] =
"ist";
1739 static const char __pyx_k_ixt[] =
"ixt";
1740 static const char __pyx_k_lhs[] =
"lhs";
1741 static const char __pyx_k_log[] =
"log";
1742 static const char __pyx_k_max[] =
"max";
1743 static const char __pyx_k_min[] =
"min";
1744 static const char __pyx_k_obj[] =
"obj";
1745 static const char __pyx_k_odd[] =
"odd";
1746 static const char __pyx_k_pow[] =
"pow";
1747 static const char __pyx_k_rhs[] =
"rhs";
1748 static const char __pyx_k_sin[] =
"sin";
1749 static const char __pyx_k_tan[] =
"tan";
1750 static const char __pyx_k_tau[] =
"tau";
1751 static const char __pyx_k_Real[] =
"Real";
1752 static const char __pyx_k_acos[] =
"acos";
1753 static const char __pyx_k_args[] =
"args";
1754 static const char __pyx_k_asin[] =
"asin";
1755 static const char __pyx_k_atan[] =
"atan";
1756 static const char __pyx_k_conj[] =
"conj";
1757 static const char __pyx_k_copy[] =
"copy";
1758 static const char __pyx_k_cosh[] =
"cosh";
1759 static const char __pyx_k_even[] =
"even";
1760 static const char __pyx_k_fill[] =
"fill";
1761 static const char __pyx_k_from[] =
" from ";
1762 static const char __pyx_k_iter[] =
"__iter__";
1763 static const char __pyx_k_main[] =
"__main__";
1764 static const char __pyx_k_math[] =
"math";
1765 static const char __pyx_k_name[] =
"__name__";
1766 static const char __pyx_k_norm[] =
"norm";
1767 static const char __pyx_k_pure[] =
"pure";
1768 static const char __pyx_k_quad[] =
"quad";
1769 static const char __pyx_k_send[] =
"send";
1770 static const char __pyx_k_sinh[] =
"sinh";
1771 static const char __pyx_k_sqrt[] =
"sqrt";
1772 static const char __pyx_k_tanh[] =
"tanh";
1773 static const char __pyx_k_test[] =
"_test";
1774 static const char __pyx_k_0_8_2[] =
"0.8.2";
1775 static const char __pyx_k_acosh[] =
"acosh";
1776 static const char __pyx_k_asinh[] =
"asinh";
1777 static const char __pyx_k_atanh[] =
"atanh";
1778 static const char __pyx_k_close[] =
"close";
1779 static const char __pyx_k_grade[] =
"grade";
1780 static const char __pyx_k_istpq[] =
"istpq";
1781 static const char __pyx_k_nbar3[] =
"nbar3";
1782 static const char __pyx_k_ninf3[] =
"ninf3";
1783 static const char __pyx_k_other[] =
"other";
1784 static const char __pyx_k_range[] =
"range";
1785 static const char __pyx_k_throw[] =
"throw";
1786 static const char __pyx_k_using[] =
" using (";
1787 static const char __pyx_k_value[] =
" value ";
1788 static const char __pyx_k_import[] =
"__import__";
1789 static const char __pyx_k_reduce[] =
"__reduce__";
1790 static const char __pyx_k_scalar[] =
"scalar";
1791 static const char __pyx_k_test_2[] =
"__test__";
1792 static const char __pyx_k_xrange[] =
"xrange";
1793 static const char __pyx_k_doctest[] =
"doctest";
1794 static const char __pyx_k_invalid[] =
" invalid ";
1795 static const char __pyx_k_numbers[] =
"numbers";
1796 static const char __pyx_k_reverse[] =
"reverse";
1797 static const char __pyx_k_testmod[] =
"testmod";
1798 static const char __pyx_k_version[] =
"__version__";
1799 static const char __pyx_k_Integral[] =
"Integral";
1800 static const char __pyx_k_PyClical[] =
"PyClical";
1801 static const char __pyx_k_Sequence[] =
"Sequence";
1802 static const char __pyx_k_as_frame[] =
" as frame:\n\t";
1803 static const char __pyx_k_clifford[] =
"clifford";
1804 static const char __pyx_k_getstate[] =
"__getstate__";
1805 static const char __pyx_k_involute[] =
"involute";
1806 static const char __pyx_k_setstate[] =
"__setstate__";
1807 static const char __pyx_k_to_frame[] =
" to frame ";
1808 static const char __pyx_k_TypeError[] =
"TypeError";
1809 static const char __pyx_k_index_set[] =
"index_set";
1810 static const char __pyx_k_outer_pow[] =
"outer_pow";
1811 static const char __pyx_k_reduce_ex[] =
"__reduce_ex__";
1812 static const char __pyx_k_IndexError[] =
"IndexError";
1813 static const char __pyx_k_ValueError[] =
"ValueError";
1814 static const char __pyx_k_pyx_vtable[] =
"__pyx_vtable__";
1815 static const char __pyx_k_collections[] =
"collections";
1816 static const char __pyx_k_e_line_1887[] =
"e (line 1887)";
1817 static const char __pyx_k_PyClical_pyx[] =
"PyClical.pyx";
1818 static const char __pyx_k_RuntimeError[] =
"RuntimeError";
1819 static const char __pyx_k_abs_line_1473[] =
"abs (line 1473)";
1820 static const char __pyx_k_cos_line_1602[] =
"cos (line 1602)";
1821 static const char __pyx_k_exp_line_1565[] =
"exp (line 1565)";
1822 static const char __pyx_k_inv_line_1329[] =
"inv (line 1329)";
1823 static const char __pyx_k_log_line_1579[] =
"log (line 1579)";
1824 static const char __pyx_k_odd_line_1397[] =
"odd (line 1397)";
1825 static const char __pyx_k_pow_line_1494[] =
"pow (line 1494)";
1826 static const char __pyx_k_reduce_cython[] =
"__reduce_cython__";
1827 static const char __pyx_k_sin_line_1679[] =
"sin (line 1679)";
1828 static const char __pyx_k_tan_line_1752[] =
"tan (line 1752)";
1829 static const char __pyx_k_using_invalid[] =
" using invalid ";
1830 static const char __pyx_k_Cannot_reframe[] =
"Cannot reframe";
1831 static const char __pyx_k_NotImplemented[] =
"NotImplemented";
1832 static const char __pyx_k_Not_applicable[] =
"Not applicable.";
1833 static const char __pyx_k_acos_line_1619[] =
"acos (line 1619)";
1834 static const char __pyx_k_agc3_line_1844[] =
"agc3 (line 1844)";
1835 static const char __pyx_k_asin_line_1698[] =
"asin (line 1698)";
1836 static const char __pyx_k_atan_line_1769[] =
"atan (line 1769)";
1837 static const char __pyx_k_cga3_line_1824[] =
"cga3 (line 1824)";
1838 static const char __pyx_k_conj_line_1436[] =
"conj (line 1436)";
1839 static const char __pyx_k_cosh_line_1640[] =
"cosh (line 1640)";
1840 static const char __pyx_k_even_line_1388[] =
"even (line 1388)";
1841 static const char __pyx_k_imag_line_1366[] =
"imag (line 1366)";
1842 static const char __pyx_k_invalid_string[] =
" invalid string ";
1843 static const char __pyx_k_norm_line_1462[] =
"norm (line 1462)";
1844 static const char __pyx_k_pure_line_1377[] =
"pure (line 1377)";
1845 static const char __pyx_k_quad_line_1451[] =
"quad (line 1451)";
1846 static const char __pyx_k_real_line_1355[] =
"real (line 1355)";
1847 static const char __pyx_k_sinh_line_1719[] =
"sinh (line 1719)";
1848 static const char __pyx_k_sqrt_line_1542[] =
"sqrt (line 1542)";
1849 static const char __pyx_k_tanh_line_1786[] =
"tanh (line 1786)";
1850 static const char __pyx_k_acosh_line_1656[] =
"acosh (line 1656)";
1851 static const char __pyx_k_asinh_line_1733[] =
"asinh (line 1733)";
1852 static const char __pyx_k_atanh_line_1798[] =
"atanh (line 1798)";
1853 static const char __pyx_k_istpq_line_1900[] =
"istpq (line 1900)";
1854 static const char __pyx_k_setstate_cython[] =
"__setstate_cython__";
1855 static const char __pyx_k_compare_line_490[] =
"compare (line 490)";
1856 static const char __pyx_k_index_set___iter[] =
"index_set.__iter__";
1857 static const char __pyx_k_max_pos_line_511[] =
"max_pos (line 511)";
1858 static const char __pyx_k_min_neg_line_502[] =
"min_neg (line 502)";
1859 static const char __pyx_k_scalar_line_1344[] =
"scalar (line 1344)";
1860 static const char __pyx_k_cga3std_line_1833[] =
"cga3std (line 1833)";
1861 static const char __pyx_k_max_abs_line_1482[] =
"max_abs (line 1482)";
1862 static const char __pyx_k_reverse_line_1421[] =
"reverse (line 1421)";
1863 static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
1864 static const char __pyx_k_involute_line_1406[] =
"involute (line 1406)";
1865 static const char __pyx_k_outer_pow_line_1518[] =
"outer_pow (line 1518)";
1866 static const char __pyx_k_clifford_inv_line_925[] =
"clifford.inv (line 925)";
1867 static const char __pyx_k_clifford_pow_line_979[] =
"clifford.pow (line 979)";
1868 static const char __pyx_k_clifford_abs_line_1174[] =
"clifford.abs (line 1174)";
1869 static const char __pyx_k_clifford_copy_line_554[] =
"clifford.copy (line 554)";
1870 static const char __pyx_k_clifford_odd_line_1069[] =
"clifford.odd (line 1069)";
1871 static const char __pyx_k_complexifier_line_1527[] =
"complexifier (line 1527)";
1872 static const char __pyx_k_index_set_copy_line_64[] =
"index_set.copy (line 64)";
1873 static const char __pyx_k_index_set_max_line_349[] =
"index_set.max (line 349)";
1874 static const char __pyx_k_index_set_min_line_340[] =
"index_set.min (line 340)";
1875 static const char __pyx_k_clifford_conj_line_1137[] =
"clifford.conj (line 1137)";
1876 static const char __pyx_k_clifford_even_line_1060[] =
"clifford.even (line 1060)";
1877 static const char __pyx_k_clifford_norm_line_1163[] =
"clifford.norm (line 1163)";
1878 static const char __pyx_k_clifford_pure_line_1049[] =
"clifford.pure (line 1049)";
1879 static const char __pyx_k_clifford_quad_line_1152[] =
"clifford.quad (line 1152)";
1880 static const char __pyx_k_Unary_print_clifford_1_1[] =
"\n Unary -.\n\n >>> print -clifford(\"{1}\")\n -{1}\n ";
1881 static const char __pyx_k_clifford___or___line_938[] =
"clifford.__or__ (line 938)";
1882 static const char __pyx_k_clifford_frame_line_1214[] =
"clifford.frame (line 1214)";
1883 static const char __pyx_k_clifford_hidden_doctests[] =
"clifford_hidden_doctests";
1884 static const char __pyx_k_clifford_isnan_line_1205[] =
"clifford.isnan (line 1205)";
1885 static const char __pyx_k_index_set_count_line_313[] =
"index_set.count (line 313)";
1886 static const char __pyx_k_clifford___add___line_739[] =
"clifford.__add__ (line 739)";
1887 static const char __pyx_k_clifford___and___line_835[] =
"clifford.__and__ (line 835)";
1888 static const char __pyx_k_clifford___div___line_895[] =
"clifford.__div__ (line 895)";
1889 static const char __pyx_k_clifford___ior___line_949[] =
"clifford.__ior__ (line 949)";
1890 static const char __pyx_k_clifford___mod___line_805[] =
"clifford.__mod__ (line 805)";
1891 static const char __pyx_k_clifford___mul___line_779[] =
"clifford.__mul__ (line 779)";
1892 static const char __pyx_k_clifford___neg___line_721[] =
"clifford.__neg__ (line 721)";
1893 static const char __pyx_k_clifford___pos___line_730[] =
"clifford.__pos__ (line 730)";
1894 static const char __pyx_k_clifford___pow___line_960[] =
"clifford.__pow__ (line 960)";
1895 static const char __pyx_k_clifford___sub___line_759[] =
"clifford.__sub__ (line 759)";
1896 static const char __pyx_k_clifford___xor___line_865[] =
"clifford.__xor__ (line 865)";
1897 static const char __pyx_k_clifford_reframe_line_648[] =
"clifford.reframe (line 648)";
1898 static const char __pyx_k_clifford_scalar_line_1038[] =
"clifford.scalar (line 1038)";
1899 static const char __pyx_k_index_set___or___line_291[] =
"index_set.__or__ (line 291)";
1900 static const char __pyx_k_index_set_hidden_doctests[] =
"index_set_hidden_doctests";
1901 static const char __pyx_k_random_clifford_line_1815[] =
"random_clifford (line 1815)";
1902 static const char __pyx_k_Cannot_take_vector_part_of[] =
"Cannot take vector part of ";
1903 static const char __pyx_k_Unary_print_clifford_1_1_2[] =
"\n Unary +.\n\n >>> print +clifford(\"{1}\")\n {1}\n ";
1904 static const char __pyx_k_clifford___iadd___line_750[] =
"clifford.__iadd__ (line 750)";
1905 static const char __pyx_k_clifford___iand___line_850[] =
"clifford.__iand__ (line 850)";
1906 static const char __pyx_k_clifford___idiv___line_910[] =
"clifford.__idiv__ (line 910)";
1907 static const char __pyx_k_clifford___imod___line_820[] =
"clifford.__imod__ (line 820)";
1908 static const char __pyx_k_clifford___imul___line_792[] =
"clifford.__imul__ (line 792)";
1909 static const char __pyx_k_clifford___isub___line_770[] =
"clifford.__isub__ (line 770)";
1910 static const char __pyx_k_clifford___iter___line_637[] =
"clifford.__iter__ (line 637)";
1911 static const char __pyx_k_clifford___ixor___line_880[] =
"clifford.__ixor__ (line 880)";
1912 static const char __pyx_k_clifford___str___line_1234[] =
"clifford.__str__ (line 1234)";
1913 static const char __pyx_k_clifford_max_abs_line_1183[] =
"clifford.max_abs (line 1183)";
1914 static const char __pyx_k_clifford_reverse_line_1122[] =
"clifford.reverse (line 1122)";
1915 static const char __pyx_k_index_set___and___line_269[] =
"index_set.__and__ (line 269)";
1916 static const char __pyx_k_index_set___ior___line_302[] =
"index_set.__ior__ (line 302)";
1917 static const char __pyx_k_index_set___str___line_393[] =
"index_set.__str__ (line 393)";
1918 static const char __pyx_k_index_set___xor___line_247[] =
"index_set.__xor__ (line 247)";
1919 static const char __pyx_k_clifford___call___line_1019[] =
"clifford.__call__ (line 1019)";
1920 static const char __pyx_k_clifford___repr___line_1225[] =
"clifford.__repr__ (line 1225)";
1921 static const char __pyx_k_clifford_involute_line_1106[] =
"clifford.involute (line 1106)";
1922 static const char __pyx_k_index_set___iand___line_280[] =
"index_set.__iand__ (line 280)";
1923 static const char __pyx_k_index_set___iter___line_227[] =
"index_set.__iter__ (line 227)";
1924 static const char __pyx_k_index_set___ixor___line_258[] =
"index_set.__ixor__ (line 258)";
1925 static const char __pyx_k_index_set___repr___line_382[] =
"index_set.__repr__ (line 382)";
1926 static const char __pyx_k_clifford_outer_pow_line_1003[] =
"clifford.outer_pow (line 1003)";
1927 static const char __pyx_k_clifford_truncated_line_1194[] =
"clifford.truncated (line 1194)";
1928 static const char __pyx_k_index_set_count_neg_line_322[] =
"index_set.count_neg (line 322)";
1929 static const char __pyx_k_index_set_count_pos_line_331[] =
"index_set.count_pos (line 331)";
1930 static const char __pyx_k_clifford___getitem___line_706[] =
"clifford.__getitem__ (line 706)";
1931 static const char __pyx_k_index_set___invert___line_238[] =
"index_set.__invert__ (line 238)";
1932 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 ";
1933 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 ";
1934 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 ";
1935 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 ";
1936 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 ";
1937 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 ";
1938 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 ";
1939 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 ";
1940 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 ";
1941 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 ";
1942 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 ";
1943 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 ";
1944 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 ";
1945 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 ";
1946 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 ";
1947 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 ";
1948 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 ";
1949 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 ";
1950 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 ";
1951 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 ";
1952 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 ";
1953 static const char __pyx_k_clifford_vector_part_line_1078[] =
"clifford.vector_part (line 1078)";
1954 static const char __pyx_k_index_set___getitem___line_189[] =
"index_set.__getitem__ (line 189)";
1955 static const char __pyx_k_index_set___setitem___line_177[] =
"index_set.__setitem__ (line 177)";
1956 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 ";
1957 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 ";
1958 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 ";
1959 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 ";
1960 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 ";
1961 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 ";
1962 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 ";
1963 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 ";
1964 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 ";
1965 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 ";
1966 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 ";
1967 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 ";
1968 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 ";
1969 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 ";
1970 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 ";
1971 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 ";
1972 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 ";
1973 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 ";
1974 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 ";
1975 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 ";
1976 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 ";
1977 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 ";
1978 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 ";
1979 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 ";
1980 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 ";
1981 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 ";
1982 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 ";
1983 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 ";
1984 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 ";
1985 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 ";
1986 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 ";
1987 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 ";
1988 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 ";
1989 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 ";
1990 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 ";
1991 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 ";
1992 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 ";
1993 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 ";
1994 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 ";
1995 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 ";
1996 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 ";
1997 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 ";
1998 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 ";
1999 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 ";
2000 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 ";
2001 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 ";
2002 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 ";
2003 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 ";
2004 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 ";
2005 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 ";
2006 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 ";
2007 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 ";
2008 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 ";
2009 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 ";
2010 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 ";
2011 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 ";
2012 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 ";
2013 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 ";
2014 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 ";
2015 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 ";
2016 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 ";
2017 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 ";
2018 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 ";
2019 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 ";
2020 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 ";
2021 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 ";
2022 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 ";
2023 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 ";
2024 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 ";
2025 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 ";
2026 static const char __pyx_k_This_comparison_operator_is_not[] =
"This comparison operator is not implemented for ";
2027 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 ";
2028 static const char __pyx_k_index_set_sign_of_mult_line_364[] =
"index_set.sign_of_mult (line 364)";
2029 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 ";
2030 static const char __pyx_k_Cannot_initialize_clifford_objec[] =
"Cannot initialize clifford object from";
2031 static const char __pyx_k_Cannot_initialize_index_set_obje[] =
"Cannot initialize index_set object from";
2032 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 ";
2033 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 ";
2034 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 ";
2035 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 ";
2036 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 ";
2037 static const char __pyx_k_clifford_hidden_doctests_line_12[] =
"clifford_hidden_doctests (line 1243)";
2038 static const char __pyx_k_index_set_hidden_doctests_line_4[] =
"index_set_hidden_doctests (line 404)";
2039 static const char __pyx_k_index_set_sign_of_square_line_37[] =
"index_set.sign_of_square (line 373)";
2040 static const char __pyx_k_no_default___reduce___due_to_non[] =
"no default __reduce__ due to non-trivial __cinit__";
2041 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 ";
2042 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 ";
2043 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 ";
2044 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 ";
2045 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 ";
2046 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 ";
2047 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 ";
2048 static PyObject *__pyx_kp_s_;
2049 static PyObject *__pyx_kp_s_0_8_2;
2050 static PyObject *__pyx_kp_u_Abbreviation_for_clifford_index;
2051 static PyObject *__pyx_kp_u_Abbreviation_for_index_set_q_p;
2052 static PyObject *__pyx_kp_u_Absolute_value_of_multivector_m;
2053 static PyObject *__pyx_kp_u_Absolute_value_square_root_of_n;
2054 static PyObject *__pyx_kp_s_Cannot_initialize_clifford_objec;
2055 static PyObject *__pyx_kp_s_Cannot_initialize_index_set_obje;
2056 static PyObject *__pyx_kp_s_Cannot_reframe;
2057 static PyObject *__pyx_kp_s_Cannot_take_vector_part_of;
2058 static PyObject *__pyx_kp_u_Cardinality_Number_of_indices_i;
2059 static PyObject *__pyx_kp_u_Check_if_a_multivector_contains;
2060 static PyObject *__pyx_kp_u_Conjugation_reverse_o_involute;
2061 static PyObject *__pyx_kp_u_Conjugation_reverse_o_involute_2;
2062 static PyObject *__pyx_kp_u_Contraction_print_clifford_1_cl;
2063 static PyObject *__pyx_kp_u_Contraction_x_clifford_1_x_clif;
2064 static PyObject *__pyx_kp_u_Convert_CGA3_null_vector_to_Euc;
2065 static PyObject *__pyx_kp_u_Convert_CGA3_null_vector_to_sta;
2066 static PyObject *__pyx_kp_u_Convert_Euclidean_3D_multivecto;
2067 static PyObject *__pyx_kp_u_Copy_this_clifford_object_x_cli;
2068 static PyObject *__pyx_kp_u_Copy_this_index_set_object_s_in;
2069 static PyObject *__pyx_kp_u_Cosine_of_multivector_with_opti;
2070 static PyObject *__pyx_kp_u_Even_part_of_multivector_sum_of;
2071 static PyObject *__pyx_kp_u_Even_part_of_multivector_sum_of_2;
2072 static PyObject *__pyx_kp_u_Exponential_of_multivector_x_cl;
2073 static PyObject *__pyx_kp_u_Geometric_difference_print_clif;
2074 static PyObject *__pyx_kp_u_Geometric_difference_x_clifford;
2075 static PyObject *__pyx_kp_u_Geometric_multiplicative_invers;
2076 static PyObject *__pyx_kp_u_Geometric_multiplicative_invers_2;
2077 static PyObject *__pyx_kp_u_Geometric_product_print_cliffor;
2078 static PyObject *__pyx_kp_u_Geometric_product_x_clifford_2;
2079 static PyObject *__pyx_kp_u_Geometric_quotient_print_cliffo;
2080 static PyObject *__pyx_kp_u_Geometric_quotient_x_clifford_1;
2081 static PyObject *__pyx_kp_u_Geometric_sum_print_clifford_1;
2082 static PyObject *__pyx_kp_u_Geometric_sum_x_clifford_1_x_cl;
2083 static PyObject *__pyx_kp_u_Get_the_value_of_an_index_set_o;
2084 static PyObject *__pyx_kp_u_Hyperbolic_cosine_of_multivecto;
2085 static PyObject *__pyx_kp_u_Hyperbolic_sine_of_multivector;
2086 static PyObject *__pyx_kp_u_Hyperbolic_tangent_of_multivect;
2087 static PyObject *__pyx_kp_u_Imaginary_part_deprecated_alway;
2088 static PyObject *__pyx_n_s_IndexError;
2089 static PyObject *__pyx_kp_u_Inner_product_print_clifford_1;
2090 static PyObject *__pyx_kp_u_Inner_product_x_clifford_1_x_cl;
2091 static PyObject *__pyx_kp_u_Integer_power_of_multivector_ob;
2092 static PyObject *__pyx_n_s_Integral;
2093 static PyObject *__pyx_kp_u_Inverse_cosine_of_multivector_w;
2094 static PyObject *__pyx_kp_u_Inverse_hyperbolic_cosine_of_mu;
2095 static PyObject *__pyx_kp_u_Inverse_hyperbolic_sine_of_mult;
2096 static PyObject *__pyx_kp_u_Inverse_hyperbolic_tangent_of_m;
2097 static PyObject *__pyx_kp_u_Inverse_sine_of_multivector_wit;
2098 static PyObject *__pyx_kp_u_Inverse_tangent_of_multivector;
2099 static PyObject *__pyx_kp_u_Iterate_over_the_indices_of_an;
2100 static PyObject *__pyx_kp_u_Main_involution_each_i_is_repla;
2101 static PyObject *__pyx_kp_u_Main_involution_each_i_is_repla_2;
2102 static PyObject *__pyx_kp_u_Maximum_absolute_value_of_coord;
2103 static PyObject *__pyx_kp_u_Maximum_member_index_set_1_1_2;
2104 static PyObject *__pyx_kp_u_Maximum_of_absolute_values_of_c;
2105 static PyObject *__pyx_kp_u_Maximum_positive_index_or_0_if;
2106 static PyObject *__pyx_kp_u_Minimum_member_index_set_1_1_2;
2107 static PyObject *__pyx_kp_u_Minimum_negative_index_or_0_if;
2108 static PyObject *__pyx_kp_u_Natural_logarithm_of_multivecto;
2109 static PyObject *__pyx_kp_u_Norm_sum_of_squares_of_coordina;
2110 static PyObject *__pyx_n_s_NotImplemented;
2111 static PyObject *__pyx_kp_s_Not_applicable;
2112 static PyObject *__pyx_kp_u_Not_applicable_for_a_in_cliffor;
2113 static PyObject *__pyx_kp_u_Number_of_negative_indices_incl;
2114 static PyObject *__pyx_kp_u_Number_of_positive_indices_incl;
2115 static PyObject *__pyx_kp_u_Odd_part_of_multivector_sum_of;
2116 static PyObject *__pyx_kp_u_Odd_part_of_multivector_sum_of_2;
2117 static PyObject *__pyx_kp_u_Outer_product_power_of_multivec;
2118 static PyObject *__pyx_kp_u_Outer_product_power_x_clifford;
2119 static PyObject *__pyx_kp_u_Outer_product_print_clifford_1;
2120 static PyObject *__pyx_kp_u_Outer_product_x_clifford_1_x_cl;
2121 static PyObject *__pyx_kp_u_Power_self_to_the_m_x_clifford;
2122 static PyObject *__pyx_kp_u_Power_self_to_the_m_x_clifford_2;
2123 static PyObject *__pyx_kp_u_Pure_grade_vector_part_print_cl;
2124 static PyObject *__pyx_kp_u_Pure_part_print_clifford_1_1_1;
2125 static PyObject *__pyx_kp_u_Pure_part_print_pure_clifford_1;
2126 static PyObject *__pyx_kp_u_Put_self_into_a_larger_frame_co;
2127 static PyObject *__pyx_n_s_PyClical;
2128 static PyObject *__pyx_kp_s_PyClical_pyx;
2129 static PyObject *__pyx_kp_u_Quadratic_form_rev_x_x_0_print;
2130 static PyObject *__pyx_kp_u_Quadratic_form_rev_x_x_0_print_2;
2131 static PyObject *__pyx_kp_u_Random_multivector_within_a_fra;
2132 static PyObject *__pyx_n_s_Real;
2133 static PyObject *__pyx_kp_u_Real_part_synonym_for_scalar_pa;
2134 static PyObject *__pyx_kp_u_Remove_all_terms_of_self_with_r;
2135 static PyObject *__pyx_kp_u_Reversion_eg_1_2_2_1_print_reve;
2136 static PyObject *__pyx_kp_u_Reversion_eg_clifford_1_cliffor;
2137 static PyObject *__pyx_n_s_RuntimeError;
2138 static PyObject *__pyx_kp_u_Scalar_part_clifford_1_1_1_2_sc;
2139 static PyObject *__pyx_kp_u_Scalar_part_scalar_clifford_1_1;
2140 static PyObject *__pyx_n_s_Sequence;
2141 static PyObject *__pyx_kp_u_Set_complement_not_print_index;
2142 static PyObject *__pyx_kp_u_Set_intersection_and_print_inde;
2143 static PyObject *__pyx_kp_u_Set_intersection_and_x_index_se;
2144 static PyObject *__pyx_kp_u_Set_the_value_of_an_index_set_o;
2145 static PyObject *__pyx_kp_u_Set_union_or_print_index_set_1;
2146 static PyObject *__pyx_kp_u_Set_union_or_x_index_set_1_x_in;
2147 static PyObject *__pyx_kp_u_Sign_of_geometric_product_of_tw;
2148 static PyObject *__pyx_kp_u_Sign_of_geometric_square_of_a_C;
2149 static PyObject *__pyx_kp_u_Sine_of_multivector_with_option;
2150 static PyObject *__pyx_kp_u_Square_root_of_1_which_commutes;
2151 static PyObject *__pyx_kp_u_Square_root_of_multivector_with;
2152 static PyObject *__pyx_kp_u_Subalgebra_generated_by_all_gen;
2153 static PyObject *__pyx_kp_u_Subscripting_map_from_index_set;
2154 static PyObject *__pyx_kp_u_Symmetric_set_difference_exclus;
2155 static PyObject *__pyx_kp_u_Symmetric_set_difference_exclus_2;
2156 static PyObject *__pyx_kp_u_Tangent_of_multivector_with_opt;
2157 static PyObject *__pyx_kp_u_Tests_for_functions_that_Doctes;
2158 static PyObject *__pyx_kp_u_Tests_for_functions_that_Doctes_2;
2159 static PyObject *__pyx_kp_u_The_informal_string_representat;
2160 static PyObject *__pyx_kp_u_The_informal_string_representat_2;
2161 static PyObject *__pyx_kp_u_The_official_string_representat;
2162 static PyObject *__pyx_kp_u_The_official_string_representat_2;
2163 static PyObject *__pyx_kp_s_This_comparison_operator_is_not;
2164 static PyObject *__pyx_kp_u_Transform_left_hand_side_using;
2165 static PyObject *__pyx_kp_u_Transform_left_hand_side_using_2;
2166 static PyObject *__pyx_n_s_TypeError;
2167 static PyObject *__pyx_kp_u_Unary_print_clifford_1_1;
2168 static PyObject *__pyx_kp_u_Unary_print_clifford_1_1_2;
2169 static PyObject *__pyx_n_s_ValueError;
2170 static PyObject *__pyx_kp_u_Vector_part_of_multivector_as_a;
2171 static PyObject *__pyx_kp_s__2;
2172 static PyObject *__pyx_kp_s__5;
2173 static PyObject *__pyx_kp_s__6;
2174 static PyObject *__pyx_kp_s__7;
2175 static PyObject *__pyx_kp_s__8;
2176 static PyObject *__pyx_kp_s__9;
2177 static PyObject *__pyx_kp_u_abs_line_1473;
2178 static PyObject *__pyx_n_s_acos;
2179 static PyObject *__pyx_kp_u_acos_line_1619;
2180 static PyObject *__pyx_n_s_acosh;
2181 static PyObject *__pyx_kp_u_acosh_line_1656;
2182 static PyObject *__pyx_kp_u_agc3_line_1844;
2183 static PyObject *__pyx_n_s_args;
2184 static PyObject *__pyx_kp_s_as_frame;
2185 static PyObject *__pyx_n_s_asin;
2186 static PyObject *__pyx_kp_u_asin_line_1698;
2187 static PyObject *__pyx_n_s_asinh;
2188 static PyObject *__pyx_kp_u_asinh_line_1733;
2189 static PyObject *__pyx_n_s_atan;
2190 static PyObject *__pyx_kp_u_atan_line_1769;
2191 static PyObject *__pyx_n_s_atanh;
2192 static PyObject *__pyx_kp_u_atanh_line_1798;
2193 static PyObject *__pyx_kp_u_cga3_line_1824;
2194 static PyObject *__pyx_kp_u_cga3std_line_1833;
2195 static PyObject *__pyx_n_s_cl;
2196 static PyObject *__pyx_n_s_clifford;
2197 static PyObject *__pyx_kp_u_clifford___add___line_739;
2198 static PyObject *__pyx_kp_u_clifford___and___line_835;
2199 static PyObject *__pyx_kp_u_clifford___call___line_1019;
2200 static PyObject *__pyx_kp_u_clifford___div___line_895;
2201 static PyObject *__pyx_kp_u_clifford___getitem___line_706;
2202 static PyObject *__pyx_kp_u_clifford___iadd___line_750;
2203 static PyObject *__pyx_kp_u_clifford___iand___line_850;
2204 static PyObject *__pyx_kp_u_clifford___idiv___line_910;
2205 static PyObject *__pyx_kp_u_clifford___imod___line_820;
2206 static PyObject *__pyx_kp_u_clifford___imul___line_792;
2207 static PyObject *__pyx_kp_u_clifford___ior___line_949;
2208 static PyObject *__pyx_kp_u_clifford___isub___line_770;
2209 static PyObject *__pyx_kp_u_clifford___iter___line_637;
2210 static PyObject *__pyx_kp_u_clifford___ixor___line_880;
2211 static PyObject *__pyx_kp_u_clifford___mod___line_805;
2212 static PyObject *__pyx_kp_u_clifford___mul___line_779;
2213 static PyObject *__pyx_kp_u_clifford___neg___line_721;
2214 static PyObject *__pyx_kp_u_clifford___or___line_938;
2215 static PyObject *__pyx_kp_u_clifford___pos___line_730;
2216 static PyObject *__pyx_kp_u_clifford___pow___line_960;
2217 static PyObject *__pyx_kp_u_clifford___repr___line_1225;
2218 static PyObject *__pyx_kp_u_clifford___str___line_1234;
2219 static PyObject *__pyx_kp_u_clifford___sub___line_759;
2220 static PyObject *__pyx_kp_u_clifford___xor___line_865;
2221 static PyObject *__pyx_kp_u_clifford_abs_line_1174;
2222 static PyObject *__pyx_kp_u_clifford_conj_line_1137;
2223 static PyObject *__pyx_kp_u_clifford_copy_line_554;
2224 static PyObject *__pyx_kp_u_clifford_even_line_1060;
2225 static PyObject *__pyx_kp_u_clifford_frame_line_1214;
2226 static PyObject *__pyx_n_s_clifford_hidden_doctests;
2227 static PyObject *__pyx_kp_u_clifford_hidden_doctests_line_12;
2228 static PyObject *__pyx_kp_u_clifford_inv_line_925;
2229 static PyObject *__pyx_kp_u_clifford_involute_line_1106;
2230 static PyObject *__pyx_kp_u_clifford_isnan_line_1205;
2231 static PyObject *__pyx_kp_u_clifford_max_abs_line_1183;
2232 static PyObject *__pyx_kp_u_clifford_norm_line_1163;
2233 static PyObject *__pyx_kp_u_clifford_odd_line_1069;
2234 static PyObject *__pyx_kp_u_clifford_outer_pow_line_1003;
2235 static PyObject *__pyx_kp_u_clifford_pow_line_979;
2236 static PyObject *__pyx_kp_u_clifford_pure_line_1049;
2237 static PyObject *__pyx_kp_u_clifford_quad_line_1152;
2238 static PyObject *__pyx_kp_u_clifford_reframe_line_648;
2239 static PyObject *__pyx_kp_u_clifford_reverse_line_1122;
2240 static PyObject *__pyx_kp_u_clifford_scalar_line_1038;
2241 static PyObject *__pyx_kp_u_clifford_truncated_line_1194;
2242 static PyObject *__pyx_kp_u_clifford_vector_part_line_1078;
2243 static PyObject *__pyx_n_s_cline_in_traceback;
2244 static PyObject *__pyx_n_s_close;
2245 static PyObject *__pyx_n_s_collections;
2246 static PyObject *__pyx_kp_u_compare_line_490;
2247 static PyObject *__pyx_kp_u_complexifier_line_1527;
2248 static PyObject *__pyx_n_s_conj;
2249 static PyObject *__pyx_kp_u_conj_line_1436;
2250 static PyObject *__pyx_n_s_copy;
2251 static PyObject *__pyx_n_s_cos;
2252 static PyObject *__pyx_kp_u_cos_line_1602;
2253 static PyObject *__pyx_n_s_cosh;
2254 static PyObject *__pyx_kp_u_cosh_line_1640;
2255 static PyObject *__pyx_n_s_doctest;
2256 static PyObject *__pyx_n_s_e;
2257 static PyObject *__pyx_kp_u_e_line_1887;
2258 static PyObject *__pyx_n_s_even;
2259 static PyObject *__pyx_kp_u_even_line_1388;
2260 static PyObject *__pyx_n_s_exp;
2261 static PyObject *__pyx_kp_u_exp_line_1565;
2262 static PyObject *__pyx_n_s_fill;
2263 static PyObject *__pyx_n_s_frm;
2264 static PyObject *__pyx_kp_s_from;
2265 static PyObject *__pyx_n_s_getstate;
2266 static PyObject *__pyx_n_s_grade;
2267 static PyObject *__pyx_n_s_i;
2268 static PyObject *__pyx_kp_u_imag_line_1366;
2269 static PyObject *__pyx_n_s_import;
2270 static PyObject *__pyx_n_s_index_set;
2271 static PyObject *__pyx_kp_u_index_set___and___line_269;
2272 static PyObject *__pyx_kp_u_index_set___getitem___line_189;
2273 static PyObject *__pyx_kp_u_index_set___iand___line_280;
2274 static PyObject *__pyx_kp_u_index_set___invert___line_238;
2275 static PyObject *__pyx_kp_u_index_set___ior___line_302;
2276 static PyObject *__pyx_n_s_index_set___iter;
2277 static PyObject *__pyx_kp_u_index_set___iter___line_227;
2278 static PyObject *__pyx_kp_u_index_set___ixor___line_258;
2279 static PyObject *__pyx_kp_u_index_set___or___line_291;
2280 static PyObject *__pyx_kp_u_index_set___repr___line_382;
2281 static PyObject *__pyx_kp_u_index_set___setitem___line_177;
2282 static PyObject *__pyx_kp_u_index_set___str___line_393;
2283 static PyObject *__pyx_kp_u_index_set___xor___line_247;
2284 static PyObject *__pyx_kp_u_index_set_copy_line_64;
2285 static PyObject *__pyx_kp_u_index_set_count_line_313;
2286 static PyObject *__pyx_kp_u_index_set_count_neg_line_322;
2287 static PyObject *__pyx_kp_u_index_set_count_pos_line_331;
2288 static PyObject *__pyx_n_s_index_set_hidden_doctests;
2289 static PyObject *__pyx_kp_u_index_set_hidden_doctests_line_4;
2290 static PyObject *__pyx_kp_u_index_set_max_line_349;
2291 static PyObject *__pyx_kp_u_index_set_min_line_340;
2292 static PyObject *__pyx_kp_u_index_set_sign_of_mult_line_364;
2293 static PyObject *__pyx_kp_u_index_set_sign_of_square_line_37;
2294 static PyObject *__pyx_n_s_inv;
2295 static PyObject *__pyx_kp_u_inv_line_1329;
2296 static PyObject *__pyx_kp_s_invalid;
2297 static PyObject *__pyx_kp_s_invalid_string;
2298 static PyObject *__pyx_n_s_involute;
2299 static PyObject *__pyx_kp_u_involute_line_1406;
2300 static PyObject *__pyx_n_s_ist;
2301 static PyObject *__pyx_n_s_istpq;
2302 static PyObject *__pyx_kp_u_istpq_line_1900;
2303 static PyObject *__pyx_n_s_iter;
2304 static PyObject *__pyx_n_s_ixt;
2305 static PyObject *__pyx_kp_u_lexicographic_compare_eg_3_4_5;
2306 static PyObject *__pyx_n_s_lhs;
2307 static PyObject *__pyx_n_s_log;
2308 static PyObject *__pyx_kp_u_log_line_1579;
2309 static PyObject *__pyx_n_s_m;
2310 static PyObject *__pyx_n_s_main;
2311 static PyObject *__pyx_n_s_math;
2312 static PyObject *__pyx_n_s_max;
2313 static PyObject *__pyx_kp_u_max_abs_line_1482;
2314 static PyObject *__pyx_kp_u_max_pos_line_511;
2315 static PyObject *__pyx_n_s_min;
2316 static PyObject *__pyx_kp_u_min_neg_line_502;
2317 static PyObject *__pyx_n_s_name;
2318 static PyObject *__pyx_n_s_nbar3;
2319 static PyObject *__pyx_n_s_ninf3;
2320 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2321 static PyObject *__pyx_n_s_norm;
2322 static PyObject *__pyx_kp_u_norm_line_1462;
2323 static PyObject *__pyx_kp_u_norm_sum_of_squares_of_coordina;
2324 static PyObject *__pyx_n_s_numbers;
2325 static PyObject *__pyx_n_s_obj;
2326 static PyObject *__pyx_n_s_odd;
2327 static PyObject *__pyx_kp_u_odd_line_1397;
2328 static PyObject *__pyx_n_s_other;
2329 static PyObject *__pyx_n_s_outer_pow;
2330 static PyObject *__pyx_kp_u_outer_pow_line_1518;
2331 static PyObject *__pyx_n_s_p;
2332 static PyObject *__pyx_n_s_pi;
2333 static PyObject *__pyx_n_s_pow;
2334 static PyObject *__pyx_kp_u_pow_line_1494;
2335 static PyObject *__pyx_n_s_pure;
2336 static PyObject *__pyx_kp_u_pure_line_1377;
2337 static PyObject *__pyx_n_s_pyx_vtable;
2338 static PyObject *__pyx_n_s_q;
2339 static PyObject *__pyx_n_s_quad;
2340 static PyObject *__pyx_kp_u_quad_line_1451;
2341 static PyObject *__pyx_kp_u_random_clifford_line_1815;
2342 static PyObject *__pyx_n_s_range;
2343 static PyObject *__pyx_kp_u_real_line_1355;
2344 static PyObject *__pyx_n_s_reduce;
2345 static PyObject *__pyx_n_s_reduce_cython;
2346 static PyObject *__pyx_n_s_reduce_ex;
2347 static PyObject *__pyx_n_s_reverse;
2348 static PyObject *__pyx_kp_u_reverse_line_1421;
2349 static PyObject *__pyx_n_s_rhs;
2350 static PyObject *__pyx_n_s_scalar;
2351 static PyObject *__pyx_kp_u_scalar_line_1344;
2352 static PyObject *__pyx_n_s_send;
2353 static PyObject *__pyx_n_s_setstate;
2354 static PyObject *__pyx_n_s_setstate_cython;
2355 static PyObject *__pyx_n_s_sin;
2356 static PyObject *__pyx_kp_u_sin_line_1679;
2357 static PyObject *__pyx_n_s_sinh;
2358 static PyObject *__pyx_kp_u_sinh_line_1719;
2359 static PyObject *__pyx_n_s_sqrt;
2360 static PyObject *__pyx_kp_u_sqrt_line_1542;
2361 static PyObject *__pyx_n_s_tan;
2362 static PyObject *__pyx_kp_u_tan_line_1752;
2363 static PyObject *__pyx_n_s_tanh;
2364 static PyObject *__pyx_kp_u_tanh_line_1786;
2365 static PyObject *__pyx_n_s_tau;
2366 static PyObject *__pyx_n_s_test;
2367 static PyObject *__pyx_n_s_test_2;
2368 static PyObject *__pyx_n_s_testmod;
2369 static PyObject *__pyx_n_s_throw;
2370 static PyObject *__pyx_kp_s_to_frame;
2371 static PyObject *__pyx_kp_s_using;
2372 static PyObject *__pyx_kp_s_using_invalid;
2373 static PyObject *__pyx_kp_s_value;
2374 static PyObject *__pyx_n_s_version;
2375 static PyObject *__pyx_n_s_xrange;
2376 static PyObject *__pyx_pf_8PyClical_9index_set_copy(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2377 static int __pyx_pf_8PyClical_9index_set_2__cinit__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_other);
2378 static void __pyx_pf_8PyClical_9index_set_4__dealloc__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2379 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);
2380 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);
2381 static PyObject *__pyx_pf_8PyClical_9index_set_10__getitem__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_idx);
2382 static int __pyx_pf_8PyClical_9index_set_12__contains__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_idx);
2383 static PyObject *__pyx_pf_8PyClical_9index_set_14__iter__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2384 static PyObject *__pyx_pf_8PyClical_9index_set_17__invert__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2385 static PyObject *__pyx_pf_8PyClical_9index_set_19__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2386 static PyObject *__pyx_pf_8PyClical_9index_set_21__ixor__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs);
2387 static PyObject *__pyx_pf_8PyClical_9index_set_23__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2388 static PyObject *__pyx_pf_8PyClical_9index_set_25__iand__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs);
2389 static PyObject *__pyx_pf_8PyClical_9index_set_27__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2390 static PyObject *__pyx_pf_8PyClical_9index_set_29__ior__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs);
2391 static PyObject *__pyx_pf_8PyClical_9index_set_31count(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2392 static PyObject *__pyx_pf_8PyClical_9index_set_33count_neg(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2393 static PyObject *__pyx_pf_8PyClical_9index_set_35count_pos(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2394 static PyObject *__pyx_pf_8PyClical_9index_set_37min(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2395 static PyObject *__pyx_pf_8PyClical_9index_set_39max(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2396 static PyObject *__pyx_pf_8PyClical_9index_set_41hash_fn(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2397 static PyObject *__pyx_pf_8PyClical_9index_set_43sign_of_mult(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs);
2398 static PyObject *__pyx_pf_8PyClical_9index_set_45sign_of_square(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2399 static PyObject *__pyx_pf_8PyClical_9index_set_47__repr__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2400 static PyObject *__pyx_pf_8PyClical_9index_set_49__str__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2401 static PyObject *__pyx_pf_8PyClical_9index_set_51__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2402 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);
2403 static PyObject *__pyx_pf_8PyClical_index_set_hidden_doctests(CYTHON_UNUSED PyObject *__pyx_self);
2404 static PyObject *__pyx_pf_8PyClical_2compare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2405 static PyObject *__pyx_pf_8PyClical_4min_neg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2406 static PyObject *__pyx_pf_8PyClical_6max_pos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2407 static PyObject *__pyx_pf_8PyClical_8clifford_copy(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2408 static int __pyx_pf_8PyClical_8clifford_2__cinit__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_ixt);
2409 static void __pyx_pf_8PyClical_8clifford_4__dealloc__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2410 static int __pyx_pf_8PyClical_8clifford_6__contains__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_x);
2411 static PyObject *__pyx_pf_8PyClical_8clifford_8__iter__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2412 static PyObject *__pyx_pf_8PyClical_8clifford_10reframe(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_ixt);
2413 static PyObject *__pyx_pf_8PyClical_8clifford_12__richcmp__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op);
2414 static PyObject *__pyx_pf_8PyClical_8clifford_14__getitem__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_ixt);
2415 static PyObject *__pyx_pf_8PyClical_8clifford_16__neg__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2416 static PyObject *__pyx_pf_8PyClical_8clifford_18__pos__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2417 static PyObject *__pyx_pf_8PyClical_8clifford_20__add__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2418 static PyObject *__pyx_pf_8PyClical_8clifford_22__iadd__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2419 static PyObject *__pyx_pf_8PyClical_8clifford_24__sub__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2420 static PyObject *__pyx_pf_8PyClical_8clifford_26__isub__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2421 static PyObject *__pyx_pf_8PyClical_8clifford_28__mul__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2422 static PyObject *__pyx_pf_8PyClical_8clifford_30__imul__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2423 static PyObject *__pyx_pf_8PyClical_8clifford_32__mod__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2424 static PyObject *__pyx_pf_8PyClical_8clifford_34__imod__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2425 static PyObject *__pyx_pf_8PyClical_8clifford_36__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2426 static PyObject *__pyx_pf_8PyClical_8clifford_38__iand__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2427 static PyObject *__pyx_pf_8PyClical_8clifford_40__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2428 static PyObject *__pyx_pf_8PyClical_8clifford_42__ixor__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2429 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 2430 static PyObject *__pyx_pf_8PyClical_8clifford_44__div__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2432 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 2433 static PyObject *__pyx_pf_8PyClical_8clifford_46__idiv__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2435 static PyObject *__pyx_pf_8PyClical_8clifford_48inv(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2436 static PyObject *__pyx_pf_8PyClical_8clifford_50__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2437 static PyObject *__pyx_pf_8PyClical_8clifford_52__ior__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2438 static PyObject *__pyx_pf_8PyClical_8clifford_54__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_m, CYTHON_UNUSED PyObject *__pyx_v_dummy);
2439 static PyObject *__pyx_pf_8PyClical_8clifford_56pow(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_m);
2440 static PyObject *__pyx_pf_8PyClical_8clifford_58outer_pow(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_m);
2441 static PyObject *__pyx_pf_8PyClical_8clifford_60__call__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_grade);
2442 static PyObject *__pyx_pf_8PyClical_8clifford_62scalar(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2443 static PyObject *__pyx_pf_8PyClical_8clifford_64pure(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2444 static PyObject *__pyx_pf_8PyClical_8clifford_66even(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2445 static PyObject *__pyx_pf_8PyClical_8clifford_68odd(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2446 static PyObject *__pyx_pf_8PyClical_8clifford_70vector_part(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_frm);
2447 static PyObject *__pyx_pf_8PyClical_8clifford_72involute(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2448 static PyObject *__pyx_pf_8PyClical_8clifford_74reverse(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2449 static PyObject *__pyx_pf_8PyClical_8clifford_76conj(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2450 static PyObject *__pyx_pf_8PyClical_8clifford_78quad(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2451 static PyObject *__pyx_pf_8PyClical_8clifford_80norm(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2452 static PyObject *__pyx_pf_8PyClical_8clifford_82abs(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2453 static PyObject *__pyx_pf_8PyClical_8clifford_84max_abs(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2454 static PyObject *__pyx_pf_8PyClical_8clifford_86truncated(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_limit);
2455 static PyObject *__pyx_pf_8PyClical_8clifford_88isnan(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2456 static PyObject *__pyx_pf_8PyClical_8clifford_90frame(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2457 static PyObject *__pyx_pf_8PyClical_8clifford_92__repr__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2458 static PyObject *__pyx_pf_8PyClical_8clifford_94__str__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2459 static PyObject *__pyx_pf_8PyClical_8clifford_96__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2460 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);
2461 static PyObject *__pyx_pf_8PyClical_8clifford_hidden_doctests(CYTHON_UNUSED PyObject *__pyx_self);
2462 static PyObject *__pyx_pf_8PyClical_10inv(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2463 static PyObject *__pyx_pf_8PyClical_12scalar(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2464 static PyObject *__pyx_pf_8PyClical_14real(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2465 static PyObject *__pyx_pf_8PyClical_16imag(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2466 static PyObject *__pyx_pf_8PyClical_18pure(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2467 static PyObject *__pyx_pf_8PyClical_20even(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2468 static PyObject *__pyx_pf_8PyClical_22odd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2469 static PyObject *__pyx_pf_8PyClical_24involute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2470 static PyObject *__pyx_pf_8PyClical_26reverse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2471 static PyObject *__pyx_pf_8PyClical_28conj(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2472 static PyObject *__pyx_pf_8PyClical_30quad(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2473 static PyObject *__pyx_pf_8PyClical_32norm(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2474 static PyObject *__pyx_pf_8PyClical_34abs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2475 static PyObject *__pyx_pf_8PyClical_36max_abs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2476 static PyObject *__pyx_pf_8PyClical_38pow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_m);
2477 static PyObject *__pyx_pf_8PyClical_40outer_pow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_m);
2478 static PyObject *__pyx_pf_8PyClical_42complexifier(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2479 static PyObject *__pyx_pf_8PyClical_44sqrt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2480 static PyObject *__pyx_pf_8PyClical_46exp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2481 static PyObject *__pyx_pf_8PyClical_48log(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2482 static PyObject *__pyx_pf_8PyClical_50cos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2483 static PyObject *__pyx_pf_8PyClical_52acos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2484 static PyObject *__pyx_pf_8PyClical_54cosh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2485 static PyObject *__pyx_pf_8PyClical_56acosh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2486 static PyObject *__pyx_pf_8PyClical_58sin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2487 static PyObject *__pyx_pf_8PyClical_60asin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2488 static PyObject *__pyx_pf_8PyClical_62sinh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2489 static PyObject *__pyx_pf_8PyClical_64asinh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2490 static PyObject *__pyx_pf_8PyClical_66tan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2491 static PyObject *__pyx_pf_8PyClical_68atan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2492 static PyObject *__pyx_pf_8PyClical_70tanh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2493 static PyObject *__pyx_pf_8PyClical_72atanh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2494 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);
2495 static PyObject *__pyx_pf_8PyClical_76cga3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2496 static PyObject *__pyx_pf_8PyClical_78cga3std(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2497 static PyObject *__pyx_pf_8PyClical_80agc3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2498 static PyObject *__pyx_pf_8PyClical_82e(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2499 static PyObject *__pyx_pf_8PyClical_84istpq(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_p, PyObject *__pyx_v_q);
2500 static PyObject *__pyx_pf_8PyClical_86_test(CYTHON_UNUSED PyObject *__pyx_self);
2501 static PyObject *__pyx_tp_new_8PyClical_index_set(PyTypeObject *t, PyObject *a, PyObject *k);
2502 static PyObject *__pyx_tp_new_8PyClical_clifford(PyTypeObject *t, PyObject *a, PyObject *k);
2503 static PyObject *__pyx_tp_new_8PyClical___pyx_scope_struct____iter__(PyTypeObject *t, PyObject *a, PyObject *k);
2504 static PyObject *__pyx_float_0_0;
2505 static PyObject *__pyx_float_1_0;
2506 static PyObject *__pyx_float_2_0;
2507 static PyObject *__pyx_float_8_0;
2508 static PyObject *__pyx_int_0;
2509 static PyObject *__pyx_int_1;
2510 static PyObject *__pyx_int_4;
2511 static PyObject *__pyx_int_neg_1;
2512 static PyObject *__pyx_tuple__3;
2513 static PyObject *__pyx_tuple__4;
2514 static PyObject *__pyx_tuple__10;
2515 static PyObject *__pyx_tuple__11;
2516 static PyObject *__pyx_tuple__12;
2517 static PyObject *__pyx_tuple__15;
2518 static PyObject *__pyx_tuple__16;
2519 static PyObject *__pyx_tuple__18;
2520 static PyObject *__pyx_tuple__20;
2521 static PyObject *__pyx_tuple__21;
2522 static PyObject *__pyx_tuple__22;
2523 static PyObject *__pyx_codeobj__13;
2524 static PyObject *__pyx_codeobj__14;
2525 static PyObject *__pyx_codeobj__17;
2526 static PyObject *__pyx_codeobj__19;
2527 static PyObject *__pyx_codeobj__23;
2538 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_toIndexSet(PyObject *__pyx_v_obj) {
2540 __Pyx_RefNannyDeclarations
2541 PyObject *__pyx_t_1 = NULL;
2542 __Pyx_RefNannySetupContext(
"toIndexSet", 0);
2551 __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)
2552 __Pyx_GOTREF(__pyx_t_1);
2553 __pyx_r = (((
struct __pyx_obj_8PyClical_index_set *)__pyx_t_1)->instance[0]);
2554 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2567 __Pyx_XDECREF(__pyx_t_1);
2568 __Pyx_WriteUnraisable(
"PyClical.toIndexSet", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
2569 __Pyx_pretend_to_initialize(&__pyx_r);
2571 __Pyx_RefNannyFinishContext();
2583 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_9index_set_wrap(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self,
IndexSet __pyx_v_other) {
2584 PyObject *__pyx_r = NULL;
2585 __Pyx_RefNannyDeclarations
2586 __Pyx_RefNannySetupContext(
"wrap", 0);
2595 (__pyx_v_self->instance[0]) = __pyx_v_other;
2604 __Pyx_XDECREF(__pyx_r);
2605 __Pyx_INCREF(((PyObject *)__pyx_v_self));
2606 __pyx_r = ((PyObject *)__pyx_v_self);
2619 __Pyx_XGIVEREF(__pyx_r);
2620 __Pyx_RefNannyFinishContext();
2632 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_9index_set_unwrap(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
2634 __Pyx_RefNannyDeclarations
2635 __Pyx_RefNannySetupContext(
"unwrap", 0);
2644 __pyx_r = (__pyx_v_self->instance[0]);
2657 __Pyx_RefNannyFinishContext();
2669 static PyObject *__pyx_pw_8PyClical_9index_set_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
2670 static PyObject *__pyx_f_8PyClical_9index_set_copy(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self,
int __pyx_skip_dispatch) {
2671 PyObject *__pyx_r = NULL;
2672 __Pyx_RefNannyDeclarations
2673 PyObject *__pyx_t_1 = NULL;
2674 PyObject *__pyx_t_2 = NULL;
2675 PyObject *__pyx_t_3 = NULL;
2676 PyObject *__pyx_t_4 = NULL;
2677 __Pyx_RefNannySetupContext(
"copy", 0);
2679 if (unlikely(__pyx_skip_dispatch)) ;
2681 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)))) {
2682 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS 2683 static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
2684 if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
2685 PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
2687 __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)
2688 __Pyx_GOTREF(__pyx_t_1);
2689 if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(
void*)__pyx_pw_8PyClical_9index_set_1copy)) {
2690 __Pyx_XDECREF(__pyx_r);
2691 __Pyx_INCREF(__pyx_t_1);
2692 __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
2693 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
2694 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
2695 if (likely(__pyx_t_4)) {
2696 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
2697 __Pyx_INCREF(__pyx_t_4);
2698 __Pyx_INCREF(
function);
2699 __Pyx_DECREF_SET(__pyx_t_3,
function);
2702 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
2703 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
2704 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error)
2705 __Pyx_GOTREF(__pyx_t_2);
2706 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2707 __pyx_r = __pyx_t_2;
2709 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2712 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS 2713 __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
2714 __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
2715 if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
2716 __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
2719 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2720 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS 2732 __Pyx_XDECREF(__pyx_r);
2733 __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)
2734 __Pyx_GOTREF(__pyx_t_1);
2735 __pyx_r = __pyx_t_1;
2749 __Pyx_XDECREF(__pyx_t_1);
2750 __Pyx_XDECREF(__pyx_t_2);
2751 __Pyx_XDECREF(__pyx_t_3);
2752 __Pyx_XDECREF(__pyx_t_4);
2753 __Pyx_AddTraceback(
"PyClical.index_set.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
2756 __Pyx_XGIVEREF(__pyx_r);
2757 __Pyx_RefNannyFinishContext();
2762 static PyObject *__pyx_pw_8PyClical_9index_set_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
2763 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 ";
2764 static PyObject *__pyx_pw_8PyClical_9index_set_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
2765 PyObject *__pyx_r = 0;
2766 __Pyx_RefNannyDeclarations
2767 __Pyx_RefNannySetupContext(
"copy (wrapper)", 0);
2768 __pyx_r = __pyx_pf_8PyClical_9index_set_copy(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
2771 __Pyx_RefNannyFinishContext();
2775 static PyObject *__pyx_pf_8PyClical_9index_set_copy(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
2776 PyObject *__pyx_r = NULL;
2777 __Pyx_RefNannyDeclarations
2778 PyObject *__pyx_t_1 = NULL;
2779 __Pyx_RefNannySetupContext(
"copy", 0);
2780 __Pyx_XDECREF(__pyx_r);
2781 __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)
2782 __Pyx_GOTREF(__pyx_t_1);
2783 __pyx_r = __pyx_t_1;
2789 __Pyx_XDECREF(__pyx_t_1);
2790 __Pyx_AddTraceback(
"PyClical.index_set.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
2793 __Pyx_XGIVEREF(__pyx_r);
2794 __Pyx_RefNannyFinishContext();
2807 static int __pyx_pw_8PyClical_9index_set_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2808 static int __pyx_pw_8PyClical_9index_set_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2809 PyObject *__pyx_v_other = 0;
2811 __Pyx_RefNannyDeclarations
2812 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
2814 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,0};
2815 PyObject* values[1] = {0};
2816 values[0] = ((PyObject *)__pyx_int_0);
2817 if (unlikely(__pyx_kwds)) {
2819 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2821 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2824 default:
goto __pyx_L5_argtuple_error;
2826 kw_args = PyDict_Size(__pyx_kwds);
2830 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other);
2831 if (value) { values[0] = value; kw_args--; }
2834 if (unlikely(kw_args > 0)) {
2835 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(0, 73, __pyx_L3_error)
2838 switch (PyTuple_GET_SIZE(__pyx_args)) {
2839 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2842 default:
goto __pyx_L5_argtuple_error;
2845 __pyx_v_other = values[0];
2847 goto __pyx_L4_argument_unpacking_done;
2848 __pyx_L5_argtuple_error:;
2849 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 73, __pyx_L3_error)
2851 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2852 __Pyx_RefNannyFinishContext();
2854 __pyx_L4_argument_unpacking_done:;
2855 __pyx_r = __pyx_pf_8PyClical_9index_set_2__cinit__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), __pyx_v_other);
2858 __Pyx_RefNannyFinishContext();
2862 static int __pyx_pf_8PyClical_9index_set_2__cinit__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_other) {
2863 PyObject *__pyx_v_error_msg_prefix = NULL;
2864 PyObject *__pyx_v_idx = NULL;
2866 __Pyx_RefNannyDeclarations
2870 PyObject *__pyx_t_4 = NULL;
2871 PyObject *__pyx_t_5 = NULL;
2874 PyObject *__pyx_t_8 = NULL;
2875 PyObject *__pyx_t_9 = NULL;
2876 PyObject *__pyx_t_10 = NULL;
2877 Py_ssize_t __pyx_t_11;
2878 PyObject *(*__pyx_t_12)(PyObject *);
2879 PyObject *__pyx_t_13 = NULL;
2880 PyObject *__pyx_t_14 = NULL;
2881 PyObject *__pyx_t_15 = NULL;
2882 PyObject *__pyx_t_16 = NULL;
2884 __Pyx_RefNannySetupContext(
"__cinit__", 0);
2893 __Pyx_INCREF(__pyx_kp_s_Cannot_initialize_index_set_obje);
2894 __pyx_v_error_msg_prefix = __pyx_kp_s_Cannot_initialize_index_set_obje;
2903 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8PyClical_index_set);
2904 __pyx_t_2 = (__pyx_t_1 != 0);
2915 __pyx_t_3 =
new IndexSet(__pyx_f_8PyClical_9index_set_unwrap(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_other)));
2917 __Pyx_CppExn2PyErr();
2918 __PYX_ERR(0, 94, __pyx_L1_error)
2920 __pyx_v_self->instance = __pyx_t_3;
2939 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_numbers);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 95, __pyx_L1_error)
2940 __Pyx_GOTREF(__pyx_t_4);
2941 __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)
2942 __Pyx_GOTREF(__pyx_t_5);
2943 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2944 __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)
2945 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2946 __pyx_t_1 = (__pyx_t_2 != 0);
2956 __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)
2958 __pyx_t_3 =
new IndexSet(((
int)__pyx_t_6));
2960 __Pyx_CppExn2PyErr();
2961 __PYX_ERR(0, 96, __pyx_L1_error)
2963 __pyx_v_self->instance = __pyx_t_3;
2982 __pyx_t_2 = PySet_Check(__pyx_v_other);
2983 __pyx_t_7 = (__pyx_t_2 != 0);
2986 __pyx_t_1 = __pyx_t_7;
2987 goto __pyx_L4_bool_binop_done;
2989 __pyx_t_7 = PyFrozenSet_Check(__pyx_v_other);
2990 __pyx_t_2 = (__pyx_t_7 != 0);
2991 __pyx_t_1 = __pyx_t_2;
2992 __pyx_L4_bool_binop_done:;
2993 __pyx_t_2 = (__pyx_t_1 != 0);
3004 __Pyx_PyThreadState_declare
3005 __Pyx_PyThreadState_assign
3006 __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
3007 __Pyx_XGOTREF(__pyx_t_8);
3008 __Pyx_XGOTREF(__pyx_t_9);
3009 __Pyx_XGOTREF(__pyx_t_10);
3020 __pyx_v_self->instance = __pyx_t_3;
3029 if (likely(PyList_CheckExact(__pyx_v_other)) || PyTuple_CheckExact(__pyx_v_other)) {
3030 __pyx_t_5 = __pyx_v_other; __Pyx_INCREF(__pyx_t_5); __pyx_t_11 = 0;
3033 __pyx_t_11 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_other);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 100, __pyx_L6_error)
3034 __Pyx_GOTREF(__pyx_t_5);
3035 __pyx_t_12 = Py_TYPE(__pyx_t_5)->tp_iternext;
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 100, __pyx_L6_error)
3038 if (likely(!__pyx_t_12)) {
3039 if (likely(PyList_CheckExact(__pyx_t_5))) {
3040 if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_5))
break;
3041 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 3042 __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)
3044 __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)
3045 __Pyx_GOTREF(__pyx_t_4);
3048 if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_5))
break;
3049 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 3050 __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)
3052 __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)
3053 __Pyx_GOTREF(__pyx_t_4);
3057 __pyx_t_4 = __pyx_t_12(__pyx_t_5);
3058 if (unlikely(!__pyx_t_4)) {
3059 PyObject* exc_type = PyErr_Occurred();
3061 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
3062 else __PYX_ERR(0, 100, __pyx_L6_error)
3066 __Pyx_GOTREF(__pyx_t_4);
3068 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_4);
3078 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self), __pyx_v_idx, Py_True) < 0)) __PYX_ERR(0, 101, __pyx_L6_error)
3088 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3098 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3099 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
3100 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3101 goto __pyx_L11_try_end;
3103 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3104 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3113 __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_IndexError);
3115 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3116 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_13) < 0) __PYX_ERR(0, 102, __pyx_L8_except_error)
3117 __Pyx_GOTREF(__pyx_t_5);
3118 __Pyx_GOTREF(__pyx_t_4);
3119 __Pyx_GOTREF(__pyx_t_13);
3128 __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)
3129 __Pyx_GOTREF(__pyx_t_14);
3130 __pyx_t_15 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 103, __pyx_L8_except_error)
3131 __Pyx_GOTREF(__pyx_t_15);
3132 __pyx_t_16 = PyNumber_Add(__pyx_t_14, __pyx_t_15);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 103, __pyx_L8_except_error)
3133 __Pyx_GOTREF(__pyx_t_16);
3134 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3135 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3136 __pyx_t_15 = PyNumber_Add(__pyx_t_16, __pyx_kp_s_);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 103, __pyx_L8_except_error)
3137 __Pyx_GOTREF(__pyx_t_15);
3138 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3139 __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)
3140 __Pyx_GOTREF(__pyx_t_16);
3141 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3142 __Pyx_Raise(__pyx_t_16, 0, 0, 0);
3143 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3144 __PYX_ERR(0, 103, __pyx_L8_except_error)
3154 __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
3156 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3157 if (__Pyx_GetException(&__pyx_t_13, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(0, 104, __pyx_L8_except_error)
3158 __Pyx_GOTREF(__pyx_t_13);
3159 __Pyx_GOTREF(__pyx_t_4);
3160 __Pyx_GOTREF(__pyx_t_5);
3169 __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)
3170 __Pyx_GOTREF(__pyx_t_16);
3171 __pyx_t_15 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 105, __pyx_L8_except_error)
3172 __Pyx_GOTREF(__pyx_t_15);
3173 __pyx_t_14 = PyNumber_Add(__pyx_t_16, __pyx_t_15);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 105, __pyx_L8_except_error)
3174 __Pyx_GOTREF(__pyx_t_14);
3175 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3176 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3177 __pyx_t_15 = PyNumber_Add(__pyx_t_14, __pyx_kp_s_);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 105, __pyx_L8_except_error)
3178 __Pyx_GOTREF(__pyx_t_15);
3179 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3180 __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)
3181 __Pyx_GOTREF(__pyx_t_14);
3182 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3183 __Pyx_Raise(__pyx_t_14, 0, 0, 0);
3184 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3185 __PYX_ERR(0, 105, __pyx_L8_except_error)
3187 goto __pyx_L8_except_error;
3188 __pyx_L8_except_error:;
3197 __Pyx_XGIVEREF(__pyx_t_8);
3198 __Pyx_XGIVEREF(__pyx_t_9);
3199 __Pyx_XGIVEREF(__pyx_t_10);
3200 __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
3201 goto __pyx_L1_error;
3222 __pyx_t_2 = PyString_Check(__pyx_v_other);
3223 __pyx_t_1 = (__pyx_t_2 != 0);
3224 if (likely(__pyx_t_1)) {
3234 __Pyx_PyThreadState_declare
3235 __Pyx_PyThreadState_assign
3236 __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
3237 __Pyx_XGOTREF(__pyx_t_10);
3238 __Pyx_XGOTREF(__pyx_t_9);
3239 __Pyx_XGOTREF(__pyx_t_8);
3249 __pyx_t_17 = __Pyx_PyObject_AsWritableString(__pyx_v_other);
if (unlikely((!__pyx_t_17) && PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L18_error)
3251 __pyx_t_3 =
new IndexSet(((
char *)__pyx_t_17));
3253 __Pyx_CppExn2PyErr();
3254 __PYX_ERR(0, 108, __pyx_L18_error)
3256 __pyx_v_self->instance = __pyx_t_3;
3266 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3267 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
3268 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3269 goto __pyx_L23_try_end;
3271 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
3272 __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
3273 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
3274 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
3275 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3276 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3285 __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
3287 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3288 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_13) < 0) __PYX_ERR(0, 109, __pyx_L20_except_error)
3289 __Pyx_GOTREF(__pyx_t_5);
3290 __Pyx_GOTREF(__pyx_t_4);
3291 __Pyx_GOTREF(__pyx_t_13);
3300 __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)
3301 __Pyx_GOTREF(__pyx_t_14);
3302 __pyx_t_15 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 110, __pyx_L20_except_error)
3303 __Pyx_GOTREF(__pyx_t_15);
3304 __pyx_t_16 = PyNumber_Add(__pyx_t_14, __pyx_t_15);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 110, __pyx_L20_except_error)
3305 __Pyx_GOTREF(__pyx_t_16);
3306 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3307 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3308 __pyx_t_15 = PyNumber_Add(__pyx_t_16, __pyx_kp_s_);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 110, __pyx_L20_except_error)
3309 __Pyx_GOTREF(__pyx_t_15);
3310 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3311 __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)
3312 __Pyx_GOTREF(__pyx_t_16);
3313 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3314 __Pyx_Raise(__pyx_t_16, 0, 0, 0);
3315 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3316 __PYX_ERR(0, 110, __pyx_L20_except_error)
3318 goto __pyx_L20_except_error;
3319 __pyx_L20_except_error:;
3328 __Pyx_XGIVEREF(__pyx_t_10);
3329 __Pyx_XGIVEREF(__pyx_t_9);
3330 __Pyx_XGIVEREF(__pyx_t_8);
3331 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8);
3332 goto __pyx_L1_error;
3354 __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)
3355 __Pyx_GOTREF(__pyx_t_13);
3356 __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)
3357 __Pyx_GOTREF(__pyx_t_4);
3358 __pyx_t_5 = PyNumber_Add(__pyx_t_13, __pyx_t_4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 112, __pyx_L1_error)
3359 __Pyx_GOTREF(__pyx_t_5);
3360 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
3361 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3362 __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_kp_s_);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 112, __pyx_L1_error)
3363 __Pyx_GOTREF(__pyx_t_4);
3364 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3365 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 112, __pyx_L1_error)
3366 __Pyx_GOTREF(__pyx_t_5);
3367 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3368 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
3369 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3370 __PYX_ERR(0, 112, __pyx_L1_error)
3386 __Pyx_XDECREF(__pyx_t_4);
3387 __Pyx_XDECREF(__pyx_t_5);
3388 __Pyx_XDECREF(__pyx_t_13);
3389 __Pyx_XDECREF(__pyx_t_14);
3390 __Pyx_XDECREF(__pyx_t_15);
3391 __Pyx_XDECREF(__pyx_t_16);
3392 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3395 __Pyx_XDECREF(__pyx_v_error_msg_prefix);
3396 __Pyx_XDECREF(__pyx_v_idx);
3397 __Pyx_RefNannyFinishContext();
3410 static void __pyx_pw_8PyClical_9index_set_5__dealloc__(PyObject *__pyx_v_self);
3411 static void __pyx_pw_8PyClical_9index_set_5__dealloc__(PyObject *__pyx_v_self) {
3412 __Pyx_RefNannyDeclarations
3413 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
3414 __pyx_pf_8PyClical_9index_set_4__dealloc__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
3417 __Pyx_RefNannyFinishContext();
3420 static void __pyx_pf_8PyClical_9index_set_4__dealloc__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
3421 __Pyx_RefNannyDeclarations
3422 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
3431 delete __pyx_v_self->instance;
3442 __Pyx_RefNannyFinishContext();
3454 static PyObject *__pyx_pw_8PyClical_9index_set_7__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op);
3455 static PyObject *__pyx_pw_8PyClical_9index_set_7__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op) {
3456 PyObject *__pyx_r = 0;
3457 __Pyx_RefNannyDeclarations
3458 __Pyx_RefNannySetupContext(
"__richcmp__ (wrapper)", 0);
3459 __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));
3462 __Pyx_RefNannyFinishContext();
3466 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) {
3467 PyObject *__pyx_v_eq = NULL;
3468 PyObject *__pyx_v_lt = NULL;
3469 PyObject *__pyx_r = NULL;
3470 __Pyx_RefNannyDeclarations
3474 PyObject *__pyx_t_4 = NULL;
3475 __Pyx_RefNannySetupContext(
"__richcmp__", 0);
3484 __pyx_t_2 = (((PyObject *)__pyx_v_lhs) == Py_None);
3485 __pyx_t_3 = (__pyx_t_2 != 0);
3488 __pyx_t_1 = __pyx_t_3;
3489 goto __pyx_L4_bool_binop_done;
3491 __pyx_t_3 = (__pyx_v_rhs == Py_None);
3492 __pyx_t_2 = (__pyx_t_3 != 0);
3493 __pyx_t_1 = __pyx_t_2;
3494 __pyx_L4_bool_binop_done:;
3504 __pyx_t_1 = (((PyObject *)__pyx_v_lhs) == __pyx_v_rhs);
3505 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 142, __pyx_L1_error)
3506 __Pyx_GOTREF(__pyx_t_4);
3507 __pyx_v_eq = __pyx_t_4;
3517 switch (__pyx_v_op) {
3527 __Pyx_XDECREF(__pyx_r);
3528 __Pyx_INCREF(__pyx_v_eq);
3529 __pyx_r = __pyx_v_eq;
3549 __Pyx_XDECREF(__pyx_r);
3550 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_eq);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 146, __pyx_L1_error)
3551 __pyx_t_4 = __Pyx_PyBool_FromLong((!__pyx_t_1));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error)
3552 __Pyx_GOTREF(__pyx_t_4);
3553 __pyx_r = __pyx_t_4;
3574 switch (__pyx_v_op) {
3584 __Pyx_XDECREF(__pyx_r);
3585 __Pyx_INCREF(Py_False);
3606 __Pyx_XDECREF(__pyx_r);
3607 __Pyx_INCREF(__pyx_v_eq);
3608 __pyx_r = __pyx_v_eq;
3628 __Pyx_XDECREF(__pyx_r);
3629 __Pyx_INCREF(Py_False);
3650 __Pyx_XDECREF(__pyx_r);
3651 __Pyx_INCREF(__pyx_v_eq);
3652 __pyx_r = __pyx_v_eq;
3672 __Pyx_XDECREF(__pyx_r);
3673 __Pyx_INCREF(__pyx_builtin_NotImplemented);
3674 __pyx_r = __pyx_builtin_NotImplemented;
3698 __pyx_t_1 = (__pyx_f_8PyClical_toIndexSet(((PyObject *)__pyx_v_lhs)) == __pyx_f_8PyClical_toIndexSet(__pyx_v_rhs));
3699 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error)
3700 __Pyx_GOTREF(__pyx_t_4);
3701 __pyx_v_eq = __pyx_t_4;
3711 switch (__pyx_v_op) {
3721 __Pyx_XDECREF(__pyx_r);
3722 __Pyx_INCREF(__pyx_v_eq);
3723 __pyx_r = __pyx_v_eq;
3743 __Pyx_XDECREF(__pyx_r);
3744 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_eq);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 163, __pyx_L1_error)
3745 __pyx_t_4 = __Pyx_PyBool_FromLong((!__pyx_t_1));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error)
3746 __Pyx_GOTREF(__pyx_t_4);
3747 __pyx_r = __pyx_t_4;
3768 __pyx_t_1 = (__pyx_f_8PyClical_toIndexSet(((PyObject *)__pyx_v_lhs)) < __pyx_f_8PyClical_toIndexSet(__pyx_v_rhs));
3769 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error)
3770 __Pyx_GOTREF(__pyx_t_4);
3771 __pyx_v_lt = __pyx_t_4;
3781 switch (__pyx_v_op) {
3791 __Pyx_XDECREF(__pyx_r);
3792 __Pyx_INCREF(__pyx_v_lt);
3793 __pyx_r = __pyx_v_lt;
3813 __Pyx_XDECREF(__pyx_r);
3814 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_lt);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 169, __pyx_L1_error)
3817 __Pyx_INCREF(__pyx_v_lt);
3818 __pyx_t_4 = __pyx_v_lt;
3819 goto __pyx_L6_bool_binop_done;
3821 __Pyx_INCREF(__pyx_v_eq);
3822 __pyx_t_4 = __pyx_v_eq;
3823 __pyx_L6_bool_binop_done:;
3824 __pyx_r = __pyx_t_4;
3845 __Pyx_XDECREF(__pyx_r);
3846 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_lt);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 171, __pyx_L1_error)
3849 __pyx_t_1 = __pyx_t_2;
3850 goto __pyx_L8_bool_binop_done;
3852 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_eq);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 171, __pyx_L1_error)
3853 __pyx_t_1 = __pyx_t_2;
3854 __pyx_L8_bool_binop_done:;
3855 __pyx_t_4 = __Pyx_PyBool_FromLong((!__pyx_t_1));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error)
3856 __Pyx_GOTREF(__pyx_t_4);
3857 __pyx_r = __pyx_t_4;
3878 __Pyx_XDECREF(__pyx_r);
3879 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_lt);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 173, __pyx_L1_error)
3880 __pyx_t_4 = __Pyx_PyBool_FromLong((!__pyx_t_1));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 173, __pyx_L1_error)
3881 __Pyx_GOTREF(__pyx_t_4);
3882 __pyx_r = __pyx_t_4;
3903 __Pyx_XDECREF(__pyx_r);
3904 __Pyx_INCREF(__pyx_builtin_NotImplemented);
3905 __pyx_r = __pyx_builtin_NotImplemented;
3923 __Pyx_XDECREF(__pyx_t_4);
3924 __Pyx_AddTraceback(
"PyClical.index_set.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3927 __Pyx_XDECREF(__pyx_v_eq);
3928 __Pyx_XDECREF(__pyx_v_lt);
3929 __Pyx_XGIVEREF(__pyx_r);
3930 __Pyx_RefNannyFinishContext();
3943 static int __pyx_pw_8PyClical_9index_set_9__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx, PyObject *__pyx_v_val);
3944 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 ";
3945 #if CYTHON_COMPILING_IN_CPYTHON 3946 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_8__setitem__;
3948 static int __pyx_pw_8PyClical_9index_set_9__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx, PyObject *__pyx_v_val) {
3950 __Pyx_RefNannyDeclarations
3951 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
3952 __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));
3955 __Pyx_RefNannyFinishContext();
3959 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) {
3961 __Pyx_RefNannyDeclarations
3964 __Pyx_RefNannySetupContext(
"__setitem__", 0);
3973 __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)
3974 __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)
3976 __pyx_v_self->instance->set(__pyx_t_1, __pyx_t_2);
3978 __Pyx_CppExn2PyErr();
3979 __PYX_ERR(0, 186, __pyx_L1_error)
4002 __Pyx_AddTraceback(
"PyClical.index_set.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4005 __Pyx_RefNannyFinishContext();
4018 static PyObject *__pyx_pw_8PyClical_9index_set_11__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx);
4019 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 ";
4020 #if CYTHON_COMPILING_IN_CPYTHON 4021 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_10__getitem__;
4023 static PyObject *__pyx_pw_8PyClical_9index_set_11__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx) {
4024 PyObject *__pyx_r = 0;
4025 __Pyx_RefNannyDeclarations
4026 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
4027 __pyx_r = __pyx_pf_8PyClical_9index_set_10__getitem__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_idx));
4030 __Pyx_RefNannyFinishContext();
4034 static PyObject *__pyx_pf_8PyClical_9index_set_10__getitem__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_idx) {
4035 PyObject *__pyx_r = NULL;
4036 __Pyx_RefNannyDeclarations
4038 PyObject *__pyx_t_2 = NULL;
4039 __Pyx_RefNannySetupContext(
"__getitem__", 0);
4048 __Pyx_XDECREF(__pyx_r);
4049 __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)
4050 __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)
4051 __Pyx_GOTREF(__pyx_t_2);
4052 __pyx_r = __pyx_t_2;
4066 __Pyx_XDECREF(__pyx_t_2);
4067 __Pyx_AddTraceback(
"PyClical.index_set.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4070 __Pyx_XGIVEREF(__pyx_r);
4071 __Pyx_RefNannyFinishContext();
4084 static int __pyx_pw_8PyClical_9index_set_13__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx);
4085 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 ";
4086 #if CYTHON_COMPILING_IN_CPYTHON 4087 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_12__contains__;
4089 static int __pyx_pw_8PyClical_9index_set_13__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx) {
4091 __Pyx_RefNannyDeclarations
4092 __Pyx_RefNannySetupContext(
"__contains__ (wrapper)", 0);
4093 __pyx_r = __pyx_pf_8PyClical_9index_set_12__contains__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_idx));
4096 __Pyx_RefNannyFinishContext();
4100 static int __pyx_pf_8PyClical_9index_set_12__contains__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_idx) {
4102 __Pyx_RefNannyDeclarations
4104 __Pyx_RefNannySetupContext(
"__contains__", 0);
4113 __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)
4114 __pyx_r = __pyx_v_self->instance->operator[](__pyx_t_1);
4127 __Pyx_AddTraceback(
"PyClical.index_set.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4130 __Pyx_RefNannyFinishContext();
4133 static PyObject *__pyx_gb_8PyClical_9index_set_16generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value);
4144 static PyObject *__pyx_pw_8PyClical_9index_set_15__iter__(PyObject *__pyx_v_self);
4145 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 ";
4146 #if CYTHON_COMPILING_IN_CPYTHON 4147 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_14__iter__;
4149 static PyObject *__pyx_pw_8PyClical_9index_set_15__iter__(PyObject *__pyx_v_self) {
4150 PyObject *__pyx_r = 0;
4151 __Pyx_RefNannyDeclarations
4152 __Pyx_RefNannySetupContext(
"__iter__ (wrapper)", 0);
4153 __pyx_r = __pyx_pf_8PyClical_9index_set_14__iter__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
4156 __Pyx_RefNannyFinishContext();
4160 static PyObject *__pyx_pf_8PyClical_9index_set_14__iter__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
4161 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *__pyx_cur_scope;
4162 PyObject *__pyx_r = NULL;
4163 __Pyx_RefNannyDeclarations
4164 __Pyx_RefNannySetupContext(
"__iter__", 0);
4165 __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);
4166 if (unlikely(!__pyx_cur_scope)) {
4167 __pyx_cur_scope = ((
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)Py_None);
4168 __Pyx_INCREF(Py_None);
4169 __PYX_ERR(0, 227, __pyx_L1_error)
4171 __Pyx_GOTREF(__pyx_cur_scope);
4173 __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
4174 __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
4175 __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
4177 __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)
4178 __Pyx_DECREF(__pyx_cur_scope);
4179 __Pyx_RefNannyFinishContext();
4180 return (PyObject *) gen;
4185 __Pyx_AddTraceback(
"PyClical.index_set.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4187 __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
4188 __Pyx_XGIVEREF(__pyx_r);
4189 __Pyx_RefNannyFinishContext();
4193 static PyObject *__pyx_gb_8PyClical_9index_set_16generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value)
4195 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *__pyx_cur_scope = ((
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)__pyx_generator->closure);
4196 PyObject *__pyx_r = NULL;
4197 PyObject *__pyx_t_1 = NULL;
4198 PyObject *__pyx_t_2 = NULL;
4199 PyObject *__pyx_t_3 = NULL;
4200 PyObject *__pyx_t_4 = NULL;
4201 Py_ssize_t __pyx_t_5;
4202 PyObject *(*__pyx_t_6)(PyObject *);
4205 __Pyx_RefNannyDeclarations
4206 __Pyx_RefNannySetupContext(
"__iter__", 0);
4207 switch (__pyx_generator->resume_label) {
4208 case 0:
goto __pyx_L3_first_run;
4209 case 1:
goto __pyx_L7_resume_from_yield;
4211 __Pyx_RefNannyFinishContext();
4214 __pyx_L3_first_run:;
4215 if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 227, __pyx_L1_error)
4224 __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)
4225 __Pyx_GOTREF(__pyx_t_2);
4227 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
4228 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
4229 if (likely(__pyx_t_3)) {
4230 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
4231 __Pyx_INCREF(__pyx_t_3);
4232 __Pyx_INCREF(
function);
4233 __Pyx_DECREF_SET(__pyx_t_2,
function);
4236 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
4237 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4238 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error)
4239 __Pyx_GOTREF(__pyx_t_1);
4240 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4241 __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)
4242 __Pyx_GOTREF(__pyx_t_3);
4244 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4245 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
4246 if (likely(__pyx_t_4)) {
4247 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4248 __Pyx_INCREF(__pyx_t_4);
4249 __Pyx_INCREF(
function);
4250 __Pyx_DECREF_SET(__pyx_t_3,
function);
4253 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
4254 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4255 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error)
4256 __Pyx_GOTREF(__pyx_t_2);
4257 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4258 __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)
4259 __Pyx_GOTREF(__pyx_t_3);
4260 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4261 __pyx_t_2 = PyTuple_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error)
4262 __Pyx_GOTREF(__pyx_t_2);
4263 __Pyx_GIVEREF(__pyx_t_1);
4264 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
4265 __Pyx_GIVEREF(__pyx_t_3);
4266 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
4269 __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)
4270 __Pyx_GOTREF(__pyx_t_3);
4271 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4272 if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
4273 __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
4276 __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error)
4277 __Pyx_GOTREF(__pyx_t_2);
4278 __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext;
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error)
4280 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4282 if (likely(!__pyx_t_6)) {
4283 if (likely(PyList_CheckExact(__pyx_t_2))) {
4284 if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2))
break;
4285 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 4286 __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)
4288 __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)
4289 __Pyx_GOTREF(__pyx_t_3);
4292 if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2))
break;
4293 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 4294 __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)
4296 __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)
4297 __Pyx_GOTREF(__pyx_t_3);
4301 __pyx_t_3 = __pyx_t_6(__pyx_t_2);
4302 if (unlikely(!__pyx_t_3)) {
4303 PyObject* exc_type = PyErr_Occurred();
4305 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
4306 else __PYX_ERR(0, 234, __pyx_L1_error)
4310 __Pyx_GOTREF(__pyx_t_3);
4312 __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_idx);
4313 __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_idx, __pyx_t_3);
4314 __Pyx_GIVEREF(__pyx_t_3);
4324 __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)
4325 __pyx_t_8 = (__pyx_t_7 != 0);
4335 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_idx);
4336 __pyx_r = __pyx_cur_scope->__pyx_v_idx;
4337 __Pyx_XGIVEREF(__pyx_t_2);
4338 __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
4339 __pyx_cur_scope->__pyx_t_1 = __pyx_t_5;
4340 __pyx_cur_scope->__pyx_t_2 = __pyx_t_6;
4341 __Pyx_XGIVEREF(__pyx_r);
4342 __Pyx_RefNannyFinishContext();
4343 __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
4345 __pyx_generator->resume_label = 1;
4347 __pyx_L7_resume_from_yield:;
4348 __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
4349 __pyx_cur_scope->__pyx_t_0 = 0;
4350 __Pyx_XGOTREF(__pyx_t_2);
4351 __pyx_t_5 = __pyx_cur_scope->__pyx_t_1;
4352 __pyx_t_6 = __pyx_cur_scope->__pyx_t_2;
4353 if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 236, __pyx_L1_error)
4372 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4373 CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
4384 PyErr_SetNone(PyExc_StopIteration);
4387 __Pyx_XDECREF(__pyx_t_1);
4388 __Pyx_XDECREF(__pyx_t_2);
4389 __Pyx_XDECREF(__pyx_t_3);
4390 __Pyx_XDECREF(__pyx_t_4);
4391 __Pyx_AddTraceback(
"__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4393 __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
4394 #if !CYTHON_USE_EXC_INFO_STACK 4395 __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
4397 __pyx_generator->resume_label = -1;
4398 __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
4399 __Pyx_RefNannyFinishContext();
4412 static PyObject *__pyx_pw_8PyClical_9index_set_18__invert__(PyObject *__pyx_v_self);
4413 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 ";
4414 #if CYTHON_COMPILING_IN_CPYTHON 4415 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_17__invert__;
4417 static PyObject *__pyx_pw_8PyClical_9index_set_18__invert__(PyObject *__pyx_v_self) {
4418 PyObject *__pyx_r = 0;
4419 __Pyx_RefNannyDeclarations
4420 __Pyx_RefNannySetupContext(
"__invert__ (wrapper)", 0);
4421 __pyx_r = __pyx_pf_8PyClical_9index_set_17__invert__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
4424 __Pyx_RefNannyFinishContext();
4428 static PyObject *__pyx_pf_8PyClical_9index_set_17__invert__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
4429 PyObject *__pyx_r = NULL;
4430 __Pyx_RefNannyDeclarations
4431 PyObject *__pyx_t_1 = NULL;
4432 PyObject *__pyx_t_2 = NULL;
4433 __Pyx_RefNannySetupContext(
"__invert__", 0);
4442 __Pyx_XDECREF(__pyx_r);
4443 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_index_set));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 245, __pyx_L1_error)
4444 __Pyx_GOTREF(__pyx_t_1);
4445 __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)
4446 __Pyx_GOTREF(__pyx_t_2);
4447 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4448 __pyx_r = __pyx_t_2;
4462 __Pyx_XDECREF(__pyx_t_1);
4463 __Pyx_XDECREF(__pyx_t_2);
4464 __Pyx_AddTraceback(
"PyClical.index_set.__invert__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4467 __Pyx_XGIVEREF(__pyx_r);
4468 __Pyx_RefNannyFinishContext();
4481 static PyObject *__pyx_pw_8PyClical_9index_set_20__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
4482 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 ";
4483 #if CYTHON_COMPILING_IN_CPYTHON 4484 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_19__xor__;
4486 static PyObject *__pyx_pw_8PyClical_9index_set_20__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4487 PyObject *__pyx_r = 0;
4488 __Pyx_RefNannyDeclarations
4489 __Pyx_RefNannySetupContext(
"__xor__ (wrapper)", 0);
4490 __pyx_r = __pyx_pf_8PyClical_9index_set_19__xor__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
4493 __Pyx_RefNannyFinishContext();
4497 static PyObject *__pyx_pf_8PyClical_9index_set_19__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4498 PyObject *__pyx_r = NULL;
4499 __Pyx_RefNannyDeclarations
4500 PyObject *__pyx_t_1 = NULL;
4501 PyObject *__pyx_t_2 = NULL;
4502 __Pyx_RefNannySetupContext(
"__xor__", 0);
4511 __Pyx_XDECREF(__pyx_r);
4512 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_index_set));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error)
4513 __Pyx_GOTREF(__pyx_t_1);
4514 __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)
4515 __Pyx_GOTREF(__pyx_t_2);
4516 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4517 __pyx_r = __pyx_t_2;
4531 __Pyx_XDECREF(__pyx_t_1);
4532 __Pyx_XDECREF(__pyx_t_2);
4533 __Pyx_AddTraceback(
"PyClical.index_set.__xor__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4536 __Pyx_XGIVEREF(__pyx_r);
4537 __Pyx_RefNannyFinishContext();
4550 static PyObject *__pyx_pw_8PyClical_9index_set_22__ixor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
4551 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 ";
4552 #if CYTHON_COMPILING_IN_CPYTHON 4553 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_21__ixor__;
4555 static PyObject *__pyx_pw_8PyClical_9index_set_22__ixor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
4556 PyObject *__pyx_r = 0;
4557 __Pyx_RefNannyDeclarations
4558 __Pyx_RefNannySetupContext(
"__ixor__ (wrapper)", 0);
4559 __pyx_r = __pyx_pf_8PyClical_9index_set_21__ixor__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
4562 __Pyx_RefNannyFinishContext();
4566 static PyObject *__pyx_pf_8PyClical_9index_set_21__ixor__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs) {
4567 PyObject *__pyx_r = NULL;
4568 __Pyx_RefNannyDeclarations
4569 PyObject *__pyx_t_1 = NULL;
4570 __Pyx_RefNannySetupContext(
"__ixor__", 0);
4579 __Pyx_XDECREF(__pyx_r);
4580 __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)
4581 __Pyx_GOTREF(__pyx_t_1);
4582 __pyx_r = __pyx_t_1;
4596 __Pyx_XDECREF(__pyx_t_1);
4597 __Pyx_AddTraceback(
"PyClical.index_set.__ixor__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4600 __Pyx_XGIVEREF(__pyx_r);
4601 __Pyx_RefNannyFinishContext();
4614 static PyObject *__pyx_pw_8PyClical_9index_set_24__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
4615 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 ";
4616 #if CYTHON_COMPILING_IN_CPYTHON 4617 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_23__and__;
4619 static PyObject *__pyx_pw_8PyClical_9index_set_24__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4620 PyObject *__pyx_r = 0;
4621 __Pyx_RefNannyDeclarations
4622 __Pyx_RefNannySetupContext(
"__and__ (wrapper)", 0);
4623 __pyx_r = __pyx_pf_8PyClical_9index_set_23__and__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
4626 __Pyx_RefNannyFinishContext();
4630 static PyObject *__pyx_pf_8PyClical_9index_set_23__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4631 PyObject *__pyx_r = NULL;
4632 __Pyx_RefNannyDeclarations
4633 PyObject *__pyx_t_1 = NULL;
4634 PyObject *__pyx_t_2 = NULL;
4635 __Pyx_RefNannySetupContext(
"__and__", 0);
4644 __Pyx_XDECREF(__pyx_r);
4645 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_index_set));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __pyx_L1_error)
4646 __Pyx_GOTREF(__pyx_t_1);
4647 __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)
4648 __Pyx_GOTREF(__pyx_t_2);
4649 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4650 __pyx_r = __pyx_t_2;
4664 __Pyx_XDECREF(__pyx_t_1);
4665 __Pyx_XDECREF(__pyx_t_2);
4666 __Pyx_AddTraceback(
"PyClical.index_set.__and__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4669 __Pyx_XGIVEREF(__pyx_r);
4670 __Pyx_RefNannyFinishContext();
4683 static PyObject *__pyx_pw_8PyClical_9index_set_26__iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
4684 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 ";
4685 #if CYTHON_COMPILING_IN_CPYTHON 4686 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_25__iand__;
4688 static PyObject *__pyx_pw_8PyClical_9index_set_26__iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
4689 PyObject *__pyx_r = 0;
4690 __Pyx_RefNannyDeclarations
4691 __Pyx_RefNannySetupContext(
"__iand__ (wrapper)", 0);
4692 __pyx_r = __pyx_pf_8PyClical_9index_set_25__iand__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
4695 __Pyx_RefNannyFinishContext();
4699 static PyObject *__pyx_pf_8PyClical_9index_set_25__iand__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs) {
4700 PyObject *__pyx_r = NULL;
4701 __Pyx_RefNannyDeclarations
4702 PyObject *__pyx_t_1 = NULL;
4703 __Pyx_RefNannySetupContext(
"__iand__", 0);
4712 __Pyx_XDECREF(__pyx_r);
4713 __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)
4714 __Pyx_GOTREF(__pyx_t_1);
4715 __pyx_r = __pyx_t_1;
4729 __Pyx_XDECREF(__pyx_t_1);
4730 __Pyx_AddTraceback(
"PyClical.index_set.__iand__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4733 __Pyx_XGIVEREF(__pyx_r);
4734 __Pyx_RefNannyFinishContext();
4747 static PyObject *__pyx_pw_8PyClical_9index_set_28__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
4748 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 ";
4749 #if CYTHON_COMPILING_IN_CPYTHON 4750 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_27__or__;
4752 static PyObject *__pyx_pw_8PyClical_9index_set_28__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4753 PyObject *__pyx_r = 0;
4754 __Pyx_RefNannyDeclarations
4755 __Pyx_RefNannySetupContext(
"__or__ (wrapper)", 0);
4756 __pyx_r = __pyx_pf_8PyClical_9index_set_27__or__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
4759 __Pyx_RefNannyFinishContext();
4763 static PyObject *__pyx_pf_8PyClical_9index_set_27__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4764 PyObject *__pyx_r = NULL;
4765 __Pyx_RefNannyDeclarations
4766 PyObject *__pyx_t_1 = NULL;
4767 PyObject *__pyx_t_2 = NULL;
4768 __Pyx_RefNannySetupContext(
"__or__", 0);
4777 __Pyx_XDECREF(__pyx_r);
4778 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_index_set));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error)
4779 __Pyx_GOTREF(__pyx_t_1);
4780 __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)
4781 __Pyx_GOTREF(__pyx_t_2);
4782 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4783 __pyx_r = __pyx_t_2;
4797 __Pyx_XDECREF(__pyx_t_1);
4798 __Pyx_XDECREF(__pyx_t_2);
4799 __Pyx_AddTraceback(
"PyClical.index_set.__or__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4802 __Pyx_XGIVEREF(__pyx_r);
4803 __Pyx_RefNannyFinishContext();
4816 static PyObject *__pyx_pw_8PyClical_9index_set_30__ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
4817 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 ";
4818 #if CYTHON_COMPILING_IN_CPYTHON 4819 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_29__ior__;
4821 static PyObject *__pyx_pw_8PyClical_9index_set_30__ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
4822 PyObject *__pyx_r = 0;
4823 __Pyx_RefNannyDeclarations
4824 __Pyx_RefNannySetupContext(
"__ior__ (wrapper)", 0);
4825 __pyx_r = __pyx_pf_8PyClical_9index_set_29__ior__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
4828 __Pyx_RefNannyFinishContext();
4832 static PyObject *__pyx_pf_8PyClical_9index_set_29__ior__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs) {
4833 PyObject *__pyx_r = NULL;
4834 __Pyx_RefNannyDeclarations
4835 PyObject *__pyx_t_1 = NULL;
4836 __Pyx_RefNannySetupContext(
"__ior__", 0);
4845 __Pyx_XDECREF(__pyx_r);
4846 __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)
4847 __Pyx_GOTREF(__pyx_t_1);
4848 __pyx_r = __pyx_t_1;
4862 __Pyx_XDECREF(__pyx_t_1);
4863 __Pyx_AddTraceback(
"PyClical.index_set.__ior__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4866 __Pyx_XGIVEREF(__pyx_r);
4867 __Pyx_RefNannyFinishContext();
4880 static PyObject *__pyx_pw_8PyClical_9index_set_32count(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4881 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 ";
4882 static PyObject *__pyx_pw_8PyClical_9index_set_32count(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4883 PyObject *__pyx_r = 0;
4884 __Pyx_RefNannyDeclarations
4885 __Pyx_RefNannySetupContext(
"count (wrapper)", 0);
4886 __pyx_r = __pyx_pf_8PyClical_9index_set_31count(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
4889 __Pyx_RefNannyFinishContext();
4893 static PyObject *__pyx_pf_8PyClical_9index_set_31count(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
4894 PyObject *__pyx_r = NULL;
4895 __Pyx_RefNannyDeclarations
4896 PyObject *__pyx_t_1 = NULL;
4897 __Pyx_RefNannySetupContext(
"count", 0);
4906 __Pyx_XDECREF(__pyx_r);
4907 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->instance->count());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error)
4908 __Pyx_GOTREF(__pyx_t_1);
4909 __pyx_r = __pyx_t_1;
4923 __Pyx_XDECREF(__pyx_t_1);
4924 __Pyx_AddTraceback(
"PyClical.index_set.count", __pyx_clineno, __pyx_lineno, __pyx_filename);
4927 __Pyx_XGIVEREF(__pyx_r);
4928 __Pyx_RefNannyFinishContext();
4941 static PyObject *__pyx_pw_8PyClical_9index_set_34count_neg(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4942 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 ";
4943 static PyObject *__pyx_pw_8PyClical_9index_set_34count_neg(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4944 PyObject *__pyx_r = 0;
4945 __Pyx_RefNannyDeclarations
4946 __Pyx_RefNannySetupContext(
"count_neg (wrapper)", 0);
4947 __pyx_r = __pyx_pf_8PyClical_9index_set_33count_neg(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
4950 __Pyx_RefNannyFinishContext();
4954 static PyObject *__pyx_pf_8PyClical_9index_set_33count_neg(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
4955 PyObject *__pyx_r = NULL;
4956 __Pyx_RefNannyDeclarations
4957 PyObject *__pyx_t_1 = NULL;
4958 __Pyx_RefNannySetupContext(
"count_neg", 0);
4967 __Pyx_XDECREF(__pyx_r);
4968 __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)
4969 __Pyx_GOTREF(__pyx_t_1);
4970 __pyx_r = __pyx_t_1;
4984 __Pyx_XDECREF(__pyx_t_1);
4985 __Pyx_AddTraceback(
"PyClical.index_set.count_neg", __pyx_clineno, __pyx_lineno, __pyx_filename);
4988 __Pyx_XGIVEREF(__pyx_r);
4989 __Pyx_RefNannyFinishContext();
5002 static PyObject *__pyx_pw_8PyClical_9index_set_36count_pos(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5003 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 ";
5004 static PyObject *__pyx_pw_8PyClical_9index_set_36count_pos(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5005 PyObject *__pyx_r = 0;
5006 __Pyx_RefNannyDeclarations
5007 __Pyx_RefNannySetupContext(
"count_pos (wrapper)", 0);
5008 __pyx_r = __pyx_pf_8PyClical_9index_set_35count_pos(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5011 __Pyx_RefNannyFinishContext();
5015 static PyObject *__pyx_pf_8PyClical_9index_set_35count_pos(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5016 PyObject *__pyx_r = NULL;
5017 __Pyx_RefNannyDeclarations
5018 PyObject *__pyx_t_1 = NULL;
5019 __Pyx_RefNannySetupContext(
"count_pos", 0);
5028 __Pyx_XDECREF(__pyx_r);
5029 __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)
5030 __Pyx_GOTREF(__pyx_t_1);
5031 __pyx_r = __pyx_t_1;
5045 __Pyx_XDECREF(__pyx_t_1);
5046 __Pyx_AddTraceback(
"PyClical.index_set.count_pos", __pyx_clineno, __pyx_lineno, __pyx_filename);
5049 __Pyx_XGIVEREF(__pyx_r);
5050 __Pyx_RefNannyFinishContext();
5063 static PyObject *__pyx_pw_8PyClical_9index_set_38min(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5064 static char __pyx_doc_8PyClical_9index_set_37min[] =
"\n Minimum member.\n\n >>> index_set({-1,1,2}).min()\n -1\n ";
5065 static PyObject *__pyx_pw_8PyClical_9index_set_38min(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5066 PyObject *__pyx_r = 0;
5067 __Pyx_RefNannyDeclarations
5068 __Pyx_RefNannySetupContext(
"min (wrapper)", 0);
5069 __pyx_r = __pyx_pf_8PyClical_9index_set_37min(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5072 __Pyx_RefNannyFinishContext();
5076 static PyObject *__pyx_pf_8PyClical_9index_set_37min(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5077 PyObject *__pyx_r = NULL;
5078 __Pyx_RefNannyDeclarations
5079 PyObject *__pyx_t_1 = NULL;
5080 __Pyx_RefNannySetupContext(
"min", 0);
5089 __Pyx_XDECREF(__pyx_r);
5090 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->instance->min());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 347, __pyx_L1_error)
5091 __Pyx_GOTREF(__pyx_t_1);
5092 __pyx_r = __pyx_t_1;
5106 __Pyx_XDECREF(__pyx_t_1);
5107 __Pyx_AddTraceback(
"PyClical.index_set.min", __pyx_clineno, __pyx_lineno, __pyx_filename);
5110 __Pyx_XGIVEREF(__pyx_r);
5111 __Pyx_RefNannyFinishContext();
5124 static PyObject *__pyx_pw_8PyClical_9index_set_40max(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5125 static char __pyx_doc_8PyClical_9index_set_39max[] =
"\n Maximum member.\n\n >>> index_set({-1,1,2}).max()\n 2\n ";
5126 static PyObject *__pyx_pw_8PyClical_9index_set_40max(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5127 PyObject *__pyx_r = 0;
5128 __Pyx_RefNannyDeclarations
5129 __Pyx_RefNannySetupContext(
"max (wrapper)", 0);
5130 __pyx_r = __pyx_pf_8PyClical_9index_set_39max(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5133 __Pyx_RefNannyFinishContext();
5137 static PyObject *__pyx_pf_8PyClical_9index_set_39max(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5138 PyObject *__pyx_r = NULL;
5139 __Pyx_RefNannyDeclarations
5140 PyObject *__pyx_t_1 = NULL;
5141 __Pyx_RefNannySetupContext(
"max", 0);
5150 __Pyx_XDECREF(__pyx_r);
5151 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->instance->max());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error)
5152 __Pyx_GOTREF(__pyx_t_1);
5153 __pyx_r = __pyx_t_1;
5167 __Pyx_XDECREF(__pyx_t_1);
5168 __Pyx_AddTraceback(
"PyClical.index_set.max", __pyx_clineno, __pyx_lineno, __pyx_filename);
5171 __Pyx_XGIVEREF(__pyx_r);
5172 __Pyx_RefNannyFinishContext();
5185 static PyObject *__pyx_pw_8PyClical_9index_set_42hash_fn(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5186 static char __pyx_doc_8PyClical_9index_set_41hash_fn[] =
"\n Hash function.\n ";
5187 static PyObject *__pyx_pw_8PyClical_9index_set_42hash_fn(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5188 PyObject *__pyx_r = 0;
5189 __Pyx_RefNannyDeclarations
5190 __Pyx_RefNannySetupContext(
"hash_fn (wrapper)", 0);
5191 __pyx_r = __pyx_pf_8PyClical_9index_set_41hash_fn(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5194 __Pyx_RefNannyFinishContext();
5198 static PyObject *__pyx_pf_8PyClical_9index_set_41hash_fn(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5199 PyObject *__pyx_r = NULL;
5200 __Pyx_RefNannyDeclarations
5201 PyObject *__pyx_t_1 = NULL;
5202 __Pyx_RefNannySetupContext(
"hash_fn", 0);
5211 __Pyx_XDECREF(__pyx_r);
5212 __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)
5213 __Pyx_GOTREF(__pyx_t_1);
5214 __pyx_r = __pyx_t_1;
5228 __Pyx_XDECREF(__pyx_t_1);
5229 __Pyx_AddTraceback(
"PyClical.index_set.hash_fn", __pyx_clineno, __pyx_lineno, __pyx_filename);
5232 __Pyx_XGIVEREF(__pyx_r);
5233 __Pyx_RefNannyFinishContext();
5246 static PyObject *__pyx_pw_8PyClical_9index_set_44sign_of_mult(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
5247 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 ";
5248 static PyObject *__pyx_pw_8PyClical_9index_set_44sign_of_mult(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
5249 PyObject *__pyx_r = 0;
5250 __Pyx_RefNannyDeclarations
5251 __Pyx_RefNannySetupContext(
"sign_of_mult (wrapper)", 0);
5252 __pyx_r = __pyx_pf_8PyClical_9index_set_43sign_of_mult(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
5255 __Pyx_RefNannyFinishContext();
5259 static PyObject *__pyx_pf_8PyClical_9index_set_43sign_of_mult(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs) {
5260 PyObject *__pyx_r = NULL;
5261 __Pyx_RefNannyDeclarations
5262 PyObject *__pyx_t_1 = NULL;
5263 __Pyx_RefNannySetupContext(
"sign_of_mult", 0);
5272 __Pyx_XDECREF(__pyx_r);
5273 __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)
5274 __Pyx_GOTREF(__pyx_t_1);
5275 __pyx_r = __pyx_t_1;
5289 __Pyx_XDECREF(__pyx_t_1);
5290 __Pyx_AddTraceback(
"PyClical.index_set.sign_of_mult", __pyx_clineno, __pyx_lineno, __pyx_filename);
5293 __Pyx_XGIVEREF(__pyx_r);
5294 __Pyx_RefNannyFinishContext();
5307 static PyObject *__pyx_pw_8PyClical_9index_set_46sign_of_square(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5308 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 ";
5309 static PyObject *__pyx_pw_8PyClical_9index_set_46sign_of_square(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5310 PyObject *__pyx_r = 0;
5311 __Pyx_RefNannyDeclarations
5312 __Pyx_RefNannySetupContext(
"sign_of_square (wrapper)", 0);
5313 __pyx_r = __pyx_pf_8PyClical_9index_set_45sign_of_square(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5316 __Pyx_RefNannyFinishContext();
5320 static PyObject *__pyx_pf_8PyClical_9index_set_45sign_of_square(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5321 PyObject *__pyx_r = NULL;
5322 __Pyx_RefNannyDeclarations
5323 PyObject *__pyx_t_1 = NULL;
5324 __Pyx_RefNannySetupContext(
"sign_of_square", 0);
5333 __Pyx_XDECREF(__pyx_r);
5334 __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)
5335 __Pyx_GOTREF(__pyx_t_1);
5336 __pyx_r = __pyx_t_1;
5350 __Pyx_XDECREF(__pyx_t_1);
5351 __Pyx_AddTraceback(
"PyClical.index_set.sign_of_square", __pyx_clineno, __pyx_lineno, __pyx_filename);
5354 __Pyx_XGIVEREF(__pyx_r);
5355 __Pyx_RefNannyFinishContext();
5368 static PyObject *__pyx_pw_8PyClical_9index_set_48__repr__(PyObject *__pyx_v_self);
5369 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 ";
5370 #if CYTHON_COMPILING_IN_CPYTHON 5371 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_47__repr__;
5373 static PyObject *__pyx_pw_8PyClical_9index_set_48__repr__(PyObject *__pyx_v_self) {
5374 PyObject *__pyx_r = 0;
5375 __Pyx_RefNannyDeclarations
5376 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
5377 __pyx_r = __pyx_pf_8PyClical_9index_set_47__repr__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5380 __Pyx_RefNannyFinishContext();
5384 static PyObject *__pyx_pf_8PyClical_9index_set_47__repr__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5385 PyObject *__pyx_r = NULL;
5386 __Pyx_RefNannyDeclarations
5387 PyObject *__pyx_t_1 = NULL;
5388 __Pyx_RefNannySetupContext(
"__repr__", 0);
5397 __Pyx_XDECREF(__pyx_r);
5398 __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)
5399 __Pyx_GOTREF(__pyx_t_1);
5400 __pyx_r = __pyx_t_1;
5414 __Pyx_XDECREF(__pyx_t_1);
5415 __Pyx_AddTraceback(
"PyClical.index_set.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5418 __Pyx_XGIVEREF(__pyx_r);
5419 __Pyx_RefNannyFinishContext();
5432 static PyObject *__pyx_pw_8PyClical_9index_set_50__str__(PyObject *__pyx_v_self);
5433 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 ";
5434 #if CYTHON_COMPILING_IN_CPYTHON 5435 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_49__str__;
5437 static PyObject *__pyx_pw_8PyClical_9index_set_50__str__(PyObject *__pyx_v_self) {
5438 PyObject *__pyx_r = 0;
5439 __Pyx_RefNannyDeclarations
5440 __Pyx_RefNannySetupContext(
"__str__ (wrapper)", 0);
5441 __pyx_r = __pyx_pf_8PyClical_9index_set_49__str__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5444 __Pyx_RefNannyFinishContext();
5448 static PyObject *__pyx_pf_8PyClical_9index_set_49__str__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5449 PyObject *__pyx_r = NULL;
5450 __Pyx_RefNannyDeclarations
5451 PyObject *__pyx_t_1 = NULL;
5452 __Pyx_RefNannySetupContext(
"__str__", 0);
5461 __Pyx_XDECREF(__pyx_r);
5462 __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)
5463 __Pyx_GOTREF(__pyx_t_1);
5464 __pyx_r = __pyx_t_1;
5478 __Pyx_XDECREF(__pyx_t_1);
5479 __Pyx_AddTraceback(
"PyClical.index_set.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5482 __Pyx_XGIVEREF(__pyx_r);
5483 __Pyx_RefNannyFinishContext();
5494 static PyObject *__pyx_pw_8PyClical_9index_set_52__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5495 static PyObject *__pyx_pw_8PyClical_9index_set_52__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5496 PyObject *__pyx_r = 0;
5497 __Pyx_RefNannyDeclarations
5498 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
5499 __pyx_r = __pyx_pf_8PyClical_9index_set_51__reduce_cython__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5502 __Pyx_RefNannyFinishContext();
5506 static PyObject *__pyx_pf_8PyClical_9index_set_51__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5507 PyObject *__pyx_r = NULL;
5508 __Pyx_RefNannyDeclarations
5509 PyObject *__pyx_t_1 = NULL;
5510 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
5518 __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)
5519 __Pyx_GOTREF(__pyx_t_1);
5520 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5521 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5522 __PYX_ERR(1, 2, __pyx_L1_error)
5532 __Pyx_XDECREF(__pyx_t_1);
5533 __Pyx_AddTraceback(
"PyClical.index_set.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5535 __Pyx_XGIVEREF(__pyx_r);
5536 __Pyx_RefNannyFinishContext();
5548 static PyObject *__pyx_pw_8PyClical_9index_set_54__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
5549 static PyObject *__pyx_pw_8PyClical_9index_set_54__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
5550 PyObject *__pyx_r = 0;
5551 __Pyx_RefNannyDeclarations
5552 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
5553 __pyx_r = __pyx_pf_8PyClical_9index_set_53__setstate_cython__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
5556 __Pyx_RefNannyFinishContext();
5560 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) {
5561 PyObject *__pyx_r = NULL;
5562 __Pyx_RefNannyDeclarations
5563 PyObject *__pyx_t_1 = NULL;
5564 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
5571 __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)
5572 __Pyx_GOTREF(__pyx_t_1);
5573 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5574 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5575 __PYX_ERR(1, 4, __pyx_L1_error)
5586 __Pyx_XDECREF(__pyx_t_1);
5587 __Pyx_AddTraceback(
"PyClical.index_set.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5589 __Pyx_XGIVEREF(__pyx_r);
5590 __Pyx_RefNannyFinishContext();
5603 static PyObject *__pyx_pw_8PyClical_1index_set_hidden_doctests(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused);
5604 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 ";
5605 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};
5606 static PyObject *__pyx_pw_8PyClical_1index_set_hidden_doctests(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
5607 PyObject *__pyx_r = 0;
5608 __Pyx_RefNannyDeclarations
5609 __Pyx_RefNannySetupContext(
"index_set_hidden_doctests (wrapper)", 0);
5610 __pyx_r = __pyx_pf_8PyClical_index_set_hidden_doctests(__pyx_self);
5613 __Pyx_RefNannyFinishContext();
5617 static PyObject *__pyx_pf_8PyClical_index_set_hidden_doctests(CYTHON_UNUSED PyObject *__pyx_self) {
5618 PyObject *__pyx_r = NULL;
5619 __Pyx_RefNannyDeclarations
5620 __Pyx_RefNannySetupContext(
"index_set_hidden_doctests", 0);
5629 __Pyx_XDECREF(__pyx_r);
5630 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5643 __Pyx_XGIVEREF(__pyx_r);
5644 __Pyx_RefNannyFinishContext();
5656 static PyObject *__pyx_pw_8PyClical_3compare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5657 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_compare(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs, CYTHON_UNUSED
int __pyx_skip_dispatch) {
5658 PyObject *__pyx_r = NULL;
5659 __Pyx_RefNannyDeclarations
5660 PyObject *__pyx_t_1 = NULL;
5661 __Pyx_RefNannySetupContext(
"compare", 0);
5670 __Pyx_XDECREF(__pyx_r);
5671 __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)
5672 __Pyx_GOTREF(__pyx_t_1);
5673 __pyx_r = __pyx_t_1;
5687 __Pyx_XDECREF(__pyx_t_1);
5688 __Pyx_AddTraceback(
"PyClical.compare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5691 __Pyx_XGIVEREF(__pyx_r);
5692 __Pyx_RefNannyFinishContext();
5697 static PyObject *__pyx_pw_8PyClical_3compare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5698 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 ";
5699 static PyObject *__pyx_pw_8PyClical_3compare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5700 PyObject *__pyx_v_lhs = 0;
5701 PyObject *__pyx_v_rhs = 0;
5702 PyObject *__pyx_r = 0;
5703 __Pyx_RefNannyDeclarations
5704 __Pyx_RefNannySetupContext(
"compare (wrapper)", 0);
5706 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lhs,&__pyx_n_s_rhs,0};
5707 PyObject* values[2] = {0,0};
5708 if (unlikely(__pyx_kwds)) {
5710 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5712 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5714 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5717 default:
goto __pyx_L5_argtuple_error;
5719 kw_args = PyDict_Size(__pyx_kwds);
5722 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lhs)) != 0)) kw_args--;
5723 else goto __pyx_L5_argtuple_error;
5726 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rhs)) != 0)) kw_args--;
5728 __Pyx_RaiseArgtupleInvalid(
"compare", 1, 2, 2, 1); __PYX_ERR(0, 490, __pyx_L3_error)
5731 if (unlikely(kw_args > 0)) {
5732 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"compare") < 0)) __PYX_ERR(0, 490, __pyx_L3_error)
5734 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5735 goto __pyx_L5_argtuple_error;
5737 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5738 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5740 __pyx_v_lhs = values[0];
5741 __pyx_v_rhs = values[1];
5743 goto __pyx_L4_argument_unpacking_done;
5744 __pyx_L5_argtuple_error:;
5745 __Pyx_RaiseArgtupleInvalid(
"compare", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 490, __pyx_L3_error)
5747 __Pyx_AddTraceback(
"PyClical.compare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5748 __Pyx_RefNannyFinishContext();
5750 __pyx_L4_argument_unpacking_done:;
5751 __pyx_r = __pyx_pf_8PyClical_2compare(__pyx_self, __pyx_v_lhs, __pyx_v_rhs);
5754 __Pyx_RefNannyFinishContext();
5758 static PyObject *__pyx_pf_8PyClical_2compare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
5759 PyObject *__pyx_r = NULL;
5760 __Pyx_RefNannyDeclarations
5761 PyObject *__pyx_t_1 = NULL;
5762 __Pyx_RefNannySetupContext(
"compare", 0);
5763 __Pyx_XDECREF(__pyx_r);
5764 __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)
5765 __Pyx_GOTREF(__pyx_t_1);
5766 __pyx_r = __pyx_t_1;
5772 __Pyx_XDECREF(__pyx_t_1);
5773 __Pyx_AddTraceback(
"PyClical.compare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5776 __Pyx_XGIVEREF(__pyx_r);
5777 __Pyx_RefNannyFinishContext();
5789 static PyObject *__pyx_pw_8PyClical_5min_neg(PyObject *__pyx_self, PyObject *__pyx_v_obj);
5790 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_min_neg(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
5791 PyObject *__pyx_r = NULL;
5792 __Pyx_RefNannyDeclarations
5793 PyObject *__pyx_t_1 = NULL;
5794 __Pyx_RefNannySetupContext(
"min_neg", 0);
5803 __Pyx_XDECREF(__pyx_r);
5804 __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)
5805 __Pyx_GOTREF(__pyx_t_1);
5806 __pyx_r = __pyx_t_1;
5820 __Pyx_XDECREF(__pyx_t_1);
5821 __Pyx_AddTraceback(
"PyClical.min_neg", __pyx_clineno, __pyx_lineno, __pyx_filename);
5824 __Pyx_XGIVEREF(__pyx_r);
5825 __Pyx_RefNannyFinishContext();
5830 static PyObject *__pyx_pw_8PyClical_5min_neg(PyObject *__pyx_self, PyObject *__pyx_v_obj);
5831 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 ";
5832 static PyObject *__pyx_pw_8PyClical_5min_neg(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
5833 PyObject *__pyx_r = 0;
5834 __Pyx_RefNannyDeclarations
5835 __Pyx_RefNannySetupContext(
"min_neg (wrapper)", 0);
5836 __pyx_r = __pyx_pf_8PyClical_4min_neg(__pyx_self, ((PyObject *)__pyx_v_obj));
5839 __Pyx_RefNannyFinishContext();
5843 static PyObject *__pyx_pf_8PyClical_4min_neg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
5844 PyObject *__pyx_r = NULL;
5845 __Pyx_RefNannyDeclarations
5846 PyObject *__pyx_t_1 = NULL;
5847 __Pyx_RefNannySetupContext(
"min_neg", 0);
5848 __Pyx_XDECREF(__pyx_r);
5849 __pyx_t_1 = __pyx_f_8PyClical_min_neg(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 502, __pyx_L1_error)
5850 __Pyx_GOTREF(__pyx_t_1);
5851 __pyx_r = __pyx_t_1;
5857 __Pyx_XDECREF(__pyx_t_1);
5858 __Pyx_AddTraceback(
"PyClical.min_neg", __pyx_clineno, __pyx_lineno, __pyx_filename);
5861 __Pyx_XGIVEREF(__pyx_r);
5862 __Pyx_RefNannyFinishContext();
5874 static PyObject *__pyx_pw_8PyClical_7max_pos(PyObject *__pyx_self, PyObject *__pyx_v_obj);
5875 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_max_pos(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
5876 PyObject *__pyx_r = NULL;
5877 __Pyx_RefNannyDeclarations
5878 PyObject *__pyx_t_1 = NULL;
5879 __Pyx_RefNannySetupContext(
"max_pos", 0);
5888 __Pyx_XDECREF(__pyx_r);
5889 __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)
5890 __Pyx_GOTREF(__pyx_t_1);
5891 __pyx_r = __pyx_t_1;
5905 __Pyx_XDECREF(__pyx_t_1);
5906 __Pyx_AddTraceback(
"PyClical.max_pos", __pyx_clineno, __pyx_lineno, __pyx_filename);
5909 __Pyx_XGIVEREF(__pyx_r);
5910 __Pyx_RefNannyFinishContext();
5915 static PyObject *__pyx_pw_8PyClical_7max_pos(PyObject *__pyx_self, PyObject *__pyx_v_obj);
5916 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 ";
5917 static PyObject *__pyx_pw_8PyClical_7max_pos(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
5918 PyObject *__pyx_r = 0;
5919 __Pyx_RefNannyDeclarations
5920 __Pyx_RefNannySetupContext(
"max_pos (wrapper)", 0);
5921 __pyx_r = __pyx_pf_8PyClical_6max_pos(__pyx_self, ((PyObject *)__pyx_v_obj));
5924 __Pyx_RefNannyFinishContext();
5928 static PyObject *__pyx_pf_8PyClical_6max_pos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
5929 PyObject *__pyx_r = NULL;
5930 __Pyx_RefNannyDeclarations
5931 PyObject *__pyx_t_1 = NULL;
5932 __Pyx_RefNannySetupContext(
"max_pos", 0);
5933 __Pyx_XDECREF(__pyx_r);
5934 __pyx_t_1 = __pyx_f_8PyClical_max_pos(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 511, __pyx_L1_error)
5935 __Pyx_GOTREF(__pyx_t_1);
5936 __pyx_r = __pyx_t_1;
5942 __Pyx_XDECREF(__pyx_t_1);
5943 __Pyx_AddTraceback(
"PyClical.max_pos", __pyx_clineno, __pyx_lineno, __pyx_filename);
5946 __Pyx_XGIVEREF(__pyx_r);
5947 __Pyx_RefNannyFinishContext();
5959 static CYTHON_INLINE std::vector<scalar_t> __pyx_f_8PyClical_list_to_vector(PyObject *__pyx_v_lst) {
5960 std::vector<scalar_t> __pyx_v_v;
5961 PyObject *__pyx_v_s = NULL;
5962 std::vector<scalar_t> __pyx_r;
5963 __Pyx_RefNannyDeclarations
5964 PyObject *__pyx_t_1 = NULL;
5965 Py_ssize_t __pyx_t_2;
5966 PyObject *(*__pyx_t_3)(PyObject *);
5967 PyObject *__pyx_t_4 = NULL;
5969 __Pyx_RefNannySetupContext(
"list_to_vector", 0);
5978 if (likely(PyList_CheckExact(__pyx_v_lst)) || PyTuple_CheckExact(__pyx_v_lst)) {
5979 __pyx_t_1 = __pyx_v_lst; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
5982 __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_lst);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error)
5983 __Pyx_GOTREF(__pyx_t_1);
5984 __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 525, __pyx_L1_error)
5987 if (likely(!__pyx_t_3)) {
5988 if (likely(PyList_CheckExact(__pyx_t_1))) {
5989 if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1))
break;
5990 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 5991 __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)
5993 __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)
5994 __Pyx_GOTREF(__pyx_t_4);
5997 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1))
break;
5998 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 5999 __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)
6001 __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)
6002 __Pyx_GOTREF(__pyx_t_4);
6006 __pyx_t_4 = __pyx_t_3(__pyx_t_1);
6007 if (unlikely(!__pyx_t_4)) {
6008 PyObject* exc_type = PyErr_Occurred();
6010 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
6011 else __PYX_ERR(0, 525, __pyx_L1_error)
6015 __Pyx_GOTREF(__pyx_t_4);
6017 __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_4);
6027 __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)
6029 __pyx_v_v.push_back(((
scalar_t)__pyx_t_5));
6031 __Pyx_CppExn2PyErr();
6032 __PYX_ERR(0, 526, __pyx_L1_error)
6043 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6052 __pyx_r = __pyx_v_v;
6065 __Pyx_XDECREF(__pyx_t_1);
6066 __Pyx_XDECREF(__pyx_t_4);
6067 __Pyx_WriteUnraisable(
"PyClical.list_to_vector", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6068 __Pyx_pretend_to_initialize(&__pyx_r);
6070 __Pyx_XDECREF(__pyx_v_s);
6071 __Pyx_RefNannyFinishContext();
6083 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_toClifford(PyObject *__pyx_v_obj) {
6085 __Pyx_RefNannyDeclarations
6086 PyObject *__pyx_t_1 = NULL;
6087 __Pyx_RefNannySetupContext(
"toClifford", 0);
6096 __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)
6097 __Pyx_GOTREF(__pyx_t_1);
6098 __pyx_r = (((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_1)->instance[0]);
6099 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6112 __Pyx_XDECREF(__pyx_t_1);
6113 __Pyx_WriteUnraisable(
"PyClical.toClifford", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6114 __Pyx_pretend_to_initialize(&__pyx_r);
6116 __Pyx_RefNannyFinishContext();
6128 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_8clifford_wrap(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self,
Clifford __pyx_v_other) {
6129 PyObject *__pyx_r = NULL;
6130 __Pyx_RefNannyDeclarations
6131 __Pyx_RefNannySetupContext(
"wrap", 0);
6140 (__pyx_v_self->instance[0]) = __pyx_v_other;
6149 __Pyx_XDECREF(__pyx_r);
6150 __Pyx_INCREF(((PyObject *)__pyx_v_self));
6151 __pyx_r = ((PyObject *)__pyx_v_self);
6164 __Pyx_XGIVEREF(__pyx_r);
6165 __Pyx_RefNannyFinishContext();
6177 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_8clifford_unwrap(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
6179 __Pyx_RefNannyDeclarations
6180 __Pyx_RefNannySetupContext(
"unwrap", 0);
6189 __pyx_r = (__pyx_v_self->instance[0]);
6202 __Pyx_RefNannyFinishContext();
6214 static PyObject *__pyx_pw_8PyClical_8clifford_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
6215 static PyObject *__pyx_f_8PyClical_8clifford_copy(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self,
int __pyx_skip_dispatch) {
6216 PyObject *__pyx_r = NULL;
6217 __Pyx_RefNannyDeclarations
6218 PyObject *__pyx_t_1 = NULL;
6219 PyObject *__pyx_t_2 = NULL;
6220 PyObject *__pyx_t_3 = NULL;
6221 PyObject *__pyx_t_4 = NULL;
6222 __Pyx_RefNannySetupContext(
"copy", 0);
6224 if (unlikely(__pyx_skip_dispatch)) ;
6226 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)))) {
6227 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS 6228 static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
6229 if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
6230 PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
6232 __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)
6233 __Pyx_GOTREF(__pyx_t_1);
6234 if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(
void*)__pyx_pw_8PyClical_8clifford_1copy)) {
6235 __Pyx_XDECREF(__pyx_r);
6236 __Pyx_INCREF(__pyx_t_1);
6237 __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
6238 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
6239 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
6240 if (likely(__pyx_t_4)) {
6241 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
6242 __Pyx_INCREF(__pyx_t_4);
6243 __Pyx_INCREF(
function);
6244 __Pyx_DECREF_SET(__pyx_t_3,
function);
6247 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
6248 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6249 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 554, __pyx_L1_error)
6250 __Pyx_GOTREF(__pyx_t_2);
6251 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6252 __pyx_r = __pyx_t_2;
6254 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6257 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS 6258 __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
6259 __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
6260 if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
6261 __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
6264 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6265 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS 6277 __Pyx_XDECREF(__pyx_r);
6278 __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)
6279 __Pyx_GOTREF(__pyx_t_1);
6280 __pyx_r = __pyx_t_1;
6294 __Pyx_XDECREF(__pyx_t_1);
6295 __Pyx_XDECREF(__pyx_t_2);
6296 __Pyx_XDECREF(__pyx_t_3);
6297 __Pyx_XDECREF(__pyx_t_4);
6298 __Pyx_AddTraceback(
"PyClical.clifford.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
6301 __Pyx_XGIVEREF(__pyx_r);
6302 __Pyx_RefNannyFinishContext();
6307 static PyObject *__pyx_pw_8PyClical_8clifford_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
6308 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 ";
6309 static PyObject *__pyx_pw_8PyClical_8clifford_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
6310 PyObject *__pyx_r = 0;
6311 __Pyx_RefNannyDeclarations
6312 __Pyx_RefNannySetupContext(
"copy (wrapper)", 0);
6313 __pyx_r = __pyx_pf_8PyClical_8clifford_copy(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
6316 __Pyx_RefNannyFinishContext();
6320 static PyObject *__pyx_pf_8PyClical_8clifford_copy(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
6321 PyObject *__pyx_r = NULL;
6322 __Pyx_RefNannyDeclarations
6323 PyObject *__pyx_t_1 = NULL;
6324 __Pyx_RefNannySetupContext(
"copy", 0);
6325 __Pyx_XDECREF(__pyx_r);
6326 __pyx_t_1 = __pyx_f_8PyClical_8clifford_copy(__pyx_v_self, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 554, __pyx_L1_error)
6327 __Pyx_GOTREF(__pyx_t_1);
6328 __pyx_r = __pyx_t_1;
6334 __Pyx_XDECREF(__pyx_t_1);
6335 __Pyx_AddTraceback(
"PyClical.clifford.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
6338 __Pyx_XGIVEREF(__pyx_r);
6339 __Pyx_RefNannyFinishContext();
6352 static int __pyx_pw_8PyClical_8clifford_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6353 static int __pyx_pw_8PyClical_8clifford_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6354 PyObject *__pyx_v_other = 0;
6355 PyObject *__pyx_v_ixt = 0;
6357 __Pyx_RefNannyDeclarations
6358 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
6360 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_ixt,0};
6361 PyObject* values[2] = {0,0};
6362 values[0] = ((PyObject *)__pyx_int_0);
6363 values[1] = ((PyObject *)Py_None);
6364 if (unlikely(__pyx_kwds)) {
6366 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6368 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6370 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6373 default:
goto __pyx_L5_argtuple_error;
6375 kw_args = PyDict_Size(__pyx_kwds);
6379 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other);
6380 if (value) { values[0] = value; kw_args--; }
6385 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ixt);
6386 if (value) { values[1] = value; kw_args--; }
6389 if (unlikely(kw_args > 0)) {
6390 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(0, 563, __pyx_L3_error)
6393 switch (PyTuple_GET_SIZE(__pyx_args)) {
6394 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6396 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6399 default:
goto __pyx_L5_argtuple_error;
6402 __pyx_v_other = values[0];
6403 __pyx_v_ixt = values[1];
6405 goto __pyx_L4_argument_unpacking_done;
6406 __pyx_L5_argtuple_error:;
6407 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 563, __pyx_L3_error)
6409 __Pyx_AddTraceback(
"PyClical.clifford.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6410 __Pyx_RefNannyFinishContext();
6412 __pyx_L4_argument_unpacking_done:;
6413 __pyx_r = __pyx_pf_8PyClical_8clifford_2__cinit__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), __pyx_v_other, __pyx_v_ixt);
6416 __Pyx_RefNannyFinishContext();
6420 static int __pyx_pf_8PyClical_8clifford_2__cinit__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_ixt) {
6421 PyObject *__pyx_v_error_msg_prefix = NULL;
6422 PyObject *__pyx_v_err = NULL;
6424 __Pyx_RefNannyDeclarations
6427 PyObject *__pyx_t_3 = NULL;
6428 PyObject *__pyx_t_4 = NULL;
6429 PyObject *__pyx_t_5 = NULL;
6431 PyObject *__pyx_t_7 = NULL;
6432 PyObject *__pyx_t_8 = NULL;
6434 PyObject *__pyx_t_10 = NULL;
6435 PyObject *__pyx_t_11 = NULL;
6436 PyObject *__pyx_t_12 = NULL;
6439 PyObject *__pyx_t_15 = NULL;
6440 PyObject *__pyx_t_16 = NULL;
6441 PyObject *__pyx_t_17 = NULL;
6442 PyObject *__pyx_t_18 = NULL;
6443 __Pyx_RefNannySetupContext(
"__cinit__", 0);
6452 __Pyx_INCREF(__pyx_kp_s_Cannot_initialize_clifford_objec);
6453 __pyx_v_error_msg_prefix = __pyx_kp_s_Cannot_initialize_clifford_objec;
6462 __pyx_t_1 = (__pyx_v_ixt == Py_None);
6463 __pyx_t_2 = (__pyx_t_1 != 0);
6474 __Pyx_PyThreadState_declare
6475 __Pyx_PyThreadState_assign
6476 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
6477 __Pyx_XGOTREF(__pyx_t_3);
6478 __Pyx_XGOTREF(__pyx_t_4);
6479 __Pyx_XGOTREF(__pyx_t_5);
6489 __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8PyClical_clifford);
6490 __pyx_t_1 = (__pyx_t_2 != 0);
6501 __pyx_t_6 =
new Clifford(__pyx_f_8PyClical_8clifford_unwrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_other)));
6503 __Pyx_CppExn2PyErr();
6504 __PYX_ERR(0, 592, __pyx_L4_error)
6506 __pyx_v_self->instance = __pyx_t_6;
6525 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8PyClical_index_set);
6526 __pyx_t_2 = (__pyx_t_1 != 0);
6537 __pyx_t_6 =
new Clifford(__pyx_f_8PyClical_9index_set_unwrap(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_other)), ((
scalar_t)1.0));
6539 __Pyx_CppExn2PyErr();
6540 __PYX_ERR(0, 594, __pyx_L4_error)
6542 __pyx_v_self->instance = __pyx_t_6;
6561 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_numbers);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 595, __pyx_L4_error)
6562 __Pyx_GOTREF(__pyx_t_7);
6563 __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)
6564 __Pyx_GOTREF(__pyx_t_8);
6565 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6566 __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)
6567 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6568 __pyx_t_1 = (__pyx_t_2 != 0);
6578 __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)
6582 __Pyx_CppExn2PyErr();
6583 __PYX_ERR(0, 596, __pyx_L4_error)
6585 __pyx_v_self->instance = __pyx_t_6;
6604 __pyx_t_1 = PyString_Check(__pyx_v_other);
6605 __pyx_t_2 = (__pyx_t_1 != 0);
6606 if (likely(__pyx_t_2)) {
6616 __Pyx_PyThreadState_declare
6617 __Pyx_PyThreadState_assign
6618 __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
6619 __Pyx_XGOTREF(__pyx_t_10);
6620 __Pyx_XGOTREF(__pyx_t_11);
6621 __Pyx_XGOTREF(__pyx_t_12);
6631 __pyx_t_13 = __Pyx_PyObject_AsWritableString(__pyx_v_other);
if (unlikely((!__pyx_t_13) && PyErr_Occurred())) __PYX_ERR(0, 599, __pyx_L11_error)
6633 __pyx_t_6 =
new Clifford(((
char *)__pyx_t_13));
6635 __Pyx_CppExn2PyErr();
6636 __PYX_ERR(0, 599, __pyx_L11_error)
6638 __pyx_v_self->instance = __pyx_t_6;
6648 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
6649 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
6650 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
6651 goto __pyx_L16_try_end;
6653 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6654 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
6663 __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
6665 __Pyx_AddTraceback(
"PyClical.clifford.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6666 if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_15) < 0) __PYX_ERR(0, 600, __pyx_L13_except_error)
6667 __Pyx_GOTREF(__pyx_t_8);
6668 __Pyx_GOTREF(__pyx_t_7);
6669 __Pyx_GOTREF(__pyx_t_15);
6678 __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)
6679 __Pyx_GOTREF(__pyx_t_16);
6680 __pyx_t_17 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 601, __pyx_L13_except_error)
6681 __Pyx_GOTREF(__pyx_t_17);
6682 __pyx_t_18 = PyNumber_Add(__pyx_t_16, __pyx_t_17);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 601, __pyx_L13_except_error)
6683 __Pyx_GOTREF(__pyx_t_18);
6684 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6685 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6686 __pyx_t_17 = PyNumber_Add(__pyx_t_18, __pyx_kp_s_);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 601, __pyx_L13_except_error)
6687 __Pyx_GOTREF(__pyx_t_17);
6688 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6689 __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)
6690 __Pyx_GOTREF(__pyx_t_18);
6691 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6692 __Pyx_Raise(__pyx_t_18, 0, 0, 0);
6693 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6694 __PYX_ERR(0, 601, __pyx_L13_except_error)
6696 goto __pyx_L13_except_error;
6697 __pyx_L13_except_error:;
6706 __Pyx_XGIVEREF(__pyx_t_10);
6707 __Pyx_XGIVEREF(__pyx_t_11);
6708 __Pyx_XGIVEREF(__pyx_t_12);
6709 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
6710 goto __pyx_L4_error;
6732 __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)
6733 __Pyx_GOTREF(__pyx_t_15);
6734 __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)
6735 __Pyx_GOTREF(__pyx_t_7);
6736 __pyx_t_8 = PyNumber_Add(__pyx_t_15, __pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 603, __pyx_L4_error)
6737 __Pyx_GOTREF(__pyx_t_8);
6738 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6739 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6740 __pyx_t_7 = PyNumber_Add(__pyx_t_8, __pyx_kp_s_);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 603, __pyx_L4_error)
6741 __Pyx_GOTREF(__pyx_t_7);
6742 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6743 __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 603, __pyx_L4_error)
6744 __Pyx_GOTREF(__pyx_t_8);
6745 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6746 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
6747 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6748 __PYX_ERR(0, 603, __pyx_L4_error)
6760 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6761 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6762 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
6763 goto __pyx_L9_try_end;
6765 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
6766 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
6767 __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
6768 __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
6769 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6770 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
6779 __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
6781 __Pyx_AddTraceback(
"PyClical.clifford.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6782 if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_15) < 0) __PYX_ERR(0, 604, __pyx_L6_except_error)
6783 __Pyx_GOTREF(__pyx_t_8);
6784 __Pyx_GOTREF(__pyx_t_7);
6785 __Pyx_GOTREF(__pyx_t_15);
6786 __Pyx_INCREF(__pyx_t_7);
6787 __pyx_v_err = __pyx_t_7;
6796 __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)
6797 __Pyx_GOTREF(__pyx_t_18);
6798 __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)
6799 __Pyx_GOTREF(__pyx_t_17);
6800 __pyx_t_16 = PyNumber_Add(__pyx_t_18, __pyx_t_17);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 605, __pyx_L6_except_error)
6801 __Pyx_GOTREF(__pyx_t_16);
6802 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6803 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6812 __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)
6813 __Pyx_GOTREF(__pyx_t_17);
6814 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6815 __pyx_t_16 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 606, __pyx_L6_except_error)
6816 __Pyx_GOTREF(__pyx_t_16);
6817 __pyx_t_18 = PyNumber_Add(__pyx_t_17, __pyx_t_16);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 606, __pyx_L6_except_error)
6818 __Pyx_GOTREF(__pyx_t_18);
6819 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6820 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6821 __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)
6822 __Pyx_GOTREF(__pyx_t_16);
6823 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6832 __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)
6833 __Pyx_GOTREF(__pyx_t_18);
6834 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6835 __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)
6836 __Pyx_GOTREF(__pyx_t_16);
6837 __pyx_t_17 = PyNumber_Add(__pyx_t_18, __pyx_t_16);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 607, __pyx_L6_except_error)
6838 __Pyx_GOTREF(__pyx_t_17);
6839 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6840 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6849 __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)
6850 __Pyx_GOTREF(__pyx_t_16);
6851 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6852 __Pyx_Raise(__pyx_t_16, 0, 0, 0);
6853 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6854 __PYX_ERR(0, 605, __pyx_L6_except_error)
6856 goto __pyx_L6_except_error;
6857 __pyx_L6_except_error:;
6866 __Pyx_XGIVEREF(__pyx_t_3);
6867 __Pyx_XGIVEREF(__pyx_t_4);
6868 __Pyx_XGIVEREF(__pyx_t_5);
6869 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
6870 goto __pyx_L1_error;
6891 __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_ixt, __pyx_ptype_8PyClical_index_set);
6892 __pyx_t_1 = (__pyx_t_2 != 0);
6893 if (likely(__pyx_t_1)) {
6902 __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_numbers);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 609, __pyx_L1_error)
6903 __Pyx_GOTREF(__pyx_t_15);
6904 __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)
6905 __Pyx_GOTREF(__pyx_t_7);
6906 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6907 __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)
6908 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6909 __pyx_t_2 = (__pyx_t_1 != 0);
6919 __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)
6921 __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));
6923 __Pyx_CppExn2PyErr();
6924 __PYX_ERR(0, 610, __pyx_L1_error)
6926 __pyx_v_self->instance = __pyx_t_6;
6945 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_collections);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 611, __pyx_L1_error)
6946 __Pyx_GOTREF(__pyx_t_7);
6947 __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)
6948 __Pyx_GOTREF(__pyx_t_15);
6949 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6950 __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)
6951 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6952 __pyx_t_1 = (__pyx_t_2 != 0);
6953 if (likely(__pyx_t_1)) {
6963 __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)));
6965 __Pyx_CppExn2PyErr();
6966 __PYX_ERR(0, 612, __pyx_L1_error)
6968 __pyx_v_self->instance = __pyx_t_6;
6988 __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)
6989 __Pyx_GOTREF(__pyx_t_15);
6990 __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)
6991 __Pyx_GOTREF(__pyx_t_7);
6992 __pyx_t_8 = PyNumber_Add(__pyx_t_15, __pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 614, __pyx_L1_error)
6993 __Pyx_GOTREF(__pyx_t_8);
6994 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6995 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7004 __pyx_t_7 = PyNumber_Add(__pyx_t_8, __pyx_kp_s__8);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 615, __pyx_L1_error)
7005 __Pyx_GOTREF(__pyx_t_7);
7006 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7007 __pyx_t_8 = PyObject_Repr(__pyx_v_ixt);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 615, __pyx_L1_error)
7008 __Pyx_GOTREF(__pyx_t_8);
7009 __pyx_t_15 = PyNumber_Add(__pyx_t_7, __pyx_t_8);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 615, __pyx_L1_error)
7010 __Pyx_GOTREF(__pyx_t_15);
7011 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7012 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7013 __pyx_t_8 = PyNumber_Add(__pyx_t_15, __pyx_kp_s__9);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 615, __pyx_L1_error)
7014 __Pyx_GOTREF(__pyx_t_8);
7015 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7024 __pyx_t_15 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_8);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 614, __pyx_L1_error)
7025 __Pyx_GOTREF(__pyx_t_15);
7026 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7027 __Pyx_Raise(__pyx_t_15, 0, 0, 0);
7028 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7029 __PYX_ERR(0, 614, __pyx_L1_error)
7051 __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)
7052 __Pyx_GOTREF(__pyx_t_15);
7053 __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)
7054 __Pyx_GOTREF(__pyx_t_8);
7055 __pyx_t_7 = PyNumber_Add(__pyx_t_15, __pyx_t_8);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 617, __pyx_L1_error)
7056 __Pyx_GOTREF(__pyx_t_7);
7057 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7058 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7067 __pyx_t_8 = PyNumber_Add(__pyx_t_7, __pyx_kp_s__8);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 618, __pyx_L1_error)
7068 __Pyx_GOTREF(__pyx_t_8);
7069 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7070 __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)
7071 __Pyx_GOTREF(__pyx_t_7);
7072 __pyx_t_15 = PyNumber_Add(__pyx_t_8, __pyx_t_7);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 618, __pyx_L1_error)
7073 __Pyx_GOTREF(__pyx_t_15);
7074 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7075 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7076 __pyx_t_7 = PyNumber_Add(__pyx_t_15, __pyx_kp_s__9);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 618, __pyx_L1_error)
7077 __Pyx_GOTREF(__pyx_t_7);
7078 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7087 __pyx_t_15 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 617, __pyx_L1_error)
7088 __Pyx_GOTREF(__pyx_t_15);
7089 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7090 __Pyx_Raise(__pyx_t_15, 0, 0, 0);
7091 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7092 __PYX_ERR(0, 617, __pyx_L1_error)
7108 __Pyx_XDECREF(__pyx_t_7);
7109 __Pyx_XDECREF(__pyx_t_8);
7110 __Pyx_XDECREF(__pyx_t_15);
7111 __Pyx_XDECREF(__pyx_t_16);
7112 __Pyx_XDECREF(__pyx_t_17);
7113 __Pyx_XDECREF(__pyx_t_18);
7114 __Pyx_AddTraceback(
"PyClical.clifford.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7117 __Pyx_XDECREF(__pyx_v_error_msg_prefix);
7118 __Pyx_XDECREF(__pyx_v_err);
7119 __Pyx_RefNannyFinishContext();
7132 static void __pyx_pw_8PyClical_8clifford_5__dealloc__(PyObject *__pyx_v_self);
7133 static void __pyx_pw_8PyClical_8clifford_5__dealloc__(PyObject *__pyx_v_self) {
7134 __Pyx_RefNannyDeclarations
7135 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
7136 __pyx_pf_8PyClical_8clifford_4__dealloc__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
7139 __Pyx_RefNannyFinishContext();
7142 static void __pyx_pf_8PyClical_8clifford_4__dealloc__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
7143 __Pyx_RefNannyDeclarations
7144 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
7153 delete __pyx_v_self->instance;
7164 __Pyx_RefNannyFinishContext();
7176 static int __pyx_pw_8PyClical_8clifford_7__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_x);
7177 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 ";
7178 #if CYTHON_COMPILING_IN_CPYTHON 7179 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_6__contains__;
7181 static int __pyx_pw_8PyClical_8clifford_7__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_x) {
7183 __Pyx_RefNannyDeclarations
7184 __Pyx_RefNannySetupContext(
"__contains__ (wrapper)", 0);
7185 __pyx_r = __pyx_pf_8PyClical_8clifford_6__contains__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_x));
7188 __Pyx_RefNannyFinishContext();
7192 static int __pyx_pf_8PyClical_8clifford_6__contains__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_x) {
7194 __Pyx_RefNannyDeclarations
7195 PyObject *__pyx_t_1 = NULL;
7196 __Pyx_RefNannySetupContext(
"__contains__", 0);
7205 __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)
7206 __Pyx_GOTREF(__pyx_t_1);
7207 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
7208 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7209 __PYX_ERR(0, 635, __pyx_L1_error)
7221 __Pyx_XDECREF(__pyx_t_1);
7222 __Pyx_AddTraceback(
"PyClical.clifford.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7224 __Pyx_RefNannyFinishContext();
7237 static PyObject *__pyx_pw_8PyClical_8clifford_9__iter__(PyObject *__pyx_v_self);
7238 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 ";
7239 #if CYTHON_COMPILING_IN_CPYTHON 7240 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_8__iter__;
7242 static PyObject *__pyx_pw_8PyClical_8clifford_9__iter__(PyObject *__pyx_v_self) {
7243 PyObject *__pyx_r = 0;
7244 __Pyx_RefNannyDeclarations
7245 __Pyx_RefNannySetupContext(
"__iter__ (wrapper)", 0);
7246 __pyx_r = __pyx_pf_8PyClical_8clifford_8__iter__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
7249 __Pyx_RefNannyFinishContext();
7253 static PyObject *__pyx_pf_8PyClical_8clifford_8__iter__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
7254 PyObject *__pyx_r = NULL;
7255 __Pyx_RefNannyDeclarations
7256 PyObject *__pyx_t_1 = NULL;
7257 __Pyx_RefNannySetupContext(
"__iter__", 0);
7266 __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)
7267 __Pyx_GOTREF(__pyx_t_1);
7268 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
7269 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7270 __PYX_ERR(0, 646, __pyx_L1_error)
7282 __Pyx_XDECREF(__pyx_t_1);
7283 __Pyx_AddTraceback(
"PyClical.clifford.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7285 __Pyx_XGIVEREF(__pyx_r);
7286 __Pyx_RefNannyFinishContext();
7299 static PyObject *__pyx_pw_8PyClical_8clifford_11reframe(PyObject *__pyx_v_self, PyObject *__pyx_v_ixt);
7300 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 ";
7301 static PyObject *__pyx_pw_8PyClical_8clifford_11reframe(PyObject *__pyx_v_self, PyObject *__pyx_v_ixt) {
7302 PyObject *__pyx_r = 0;
7303 __Pyx_RefNannyDeclarations
7304 __Pyx_RefNannySetupContext(
"reframe (wrapper)", 0);
7305 __pyx_r = __pyx_pf_8PyClical_8clifford_10reframe(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_ixt));
7308 __Pyx_RefNannyFinishContext();
7312 static PyObject *__pyx_pf_8PyClical_8clifford_10reframe(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_ixt) {
7313 PyObject *__pyx_v_error_msg_prefix = NULL;
7314 struct __pyx_obj_8PyClical_clifford *__pyx_v_result = NULL;
7315 PyObject *__pyx_v_err = NULL;
7316 PyObject *__pyx_r = NULL;
7317 __Pyx_RefNannyDeclarations
7320 PyObject *__pyx_t_3 = NULL;
7321 PyObject *__pyx_t_4 = NULL;
7322 PyObject *__pyx_t_5 = NULL;
7323 PyObject *__pyx_t_6 = NULL;
7326 PyObject *__pyx_t_9 = NULL;
7327 PyObject *__pyx_t_10 = NULL;
7328 PyObject *__pyx_t_11 = NULL;
7329 PyObject *__pyx_t_12 = NULL;
7330 PyObject *__pyx_t_13 = NULL;
7331 __Pyx_RefNannySetupContext(
"reframe", 0);
7340 __Pyx_INCREF(__pyx_kp_s_Cannot_reframe);
7341 __pyx_v_error_msg_prefix = __pyx_kp_s_Cannot_reframe;
7350 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_ixt, __pyx_ptype_8PyClical_index_set);
7351 __pyx_t_2 = (__pyx_t_1 != 0);
7352 if (likely(__pyx_t_2)) {
7362 __Pyx_PyThreadState_declare
7363 __Pyx_PyThreadState_assign
7364 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
7365 __Pyx_XGOTREF(__pyx_t_3);
7366 __Pyx_XGOTREF(__pyx_t_4);
7367 __Pyx_XGOTREF(__pyx_t_5);
7377 __pyx_t_6 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 661, __pyx_L4_error)
7378 __Pyx_GOTREF(__pyx_t_6);
7379 __pyx_v_result = ((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_6);
7390 __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)));
7392 __Pyx_CppExn2PyErr();
7393 __PYX_ERR(0, 662, __pyx_L4_error)
7395 __pyx_v_result->instance = __pyx_t_7;
7405 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7406 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7407 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
7408 goto __pyx_L9_try_end;
7410 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
7419 __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
7421 __Pyx_AddTraceback(
"PyClical.clifford.reframe", __pyx_clineno, __pyx_lineno, __pyx_filename);
7422 if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 663, __pyx_L6_except_error)
7423 __Pyx_GOTREF(__pyx_t_6);
7424 __Pyx_GOTREF(__pyx_t_9);
7425 __Pyx_GOTREF(__pyx_t_10);
7426 __Pyx_INCREF(__pyx_t_9);
7427 __pyx_v_err = __pyx_t_9;
7436 __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)
7437 __Pyx_GOTREF(__pyx_t_11);
7438 __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)
7439 __Pyx_GOTREF(__pyx_t_12);
7440 __pyx_t_13 = PyNumber_Add(__pyx_t_11, __pyx_t_12);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 664, __pyx_L6_except_error)
7441 __Pyx_GOTREF(__pyx_t_13);
7442 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7443 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7444 __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)
7445 __Pyx_GOTREF(__pyx_t_12);
7446 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7455 __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)
7456 __Pyx_GOTREF(__pyx_t_13);
7457 __pyx_t_11 = PyNumber_Add(__pyx_t_12, __pyx_t_13);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 665, __pyx_L6_except_error)
7458 __Pyx_GOTREF(__pyx_t_11);
7459 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7460 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7461 __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)
7462 __Pyx_GOTREF(__pyx_t_13);
7463 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7472 __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)
7473 __Pyx_GOTREF(__pyx_t_11);
7474 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7475 __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)
7476 __Pyx_GOTREF(__pyx_t_13);
7477 __pyx_t_12 = PyNumber_Add(__pyx_t_11, __pyx_t_13);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 666, __pyx_L6_except_error)
7478 __Pyx_GOTREF(__pyx_t_12);
7479 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7480 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7489 __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)
7490 __Pyx_GOTREF(__pyx_t_13);
7491 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7492 __Pyx_Raise(__pyx_t_13, 0, 0, 0);
7493 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7494 __PYX_ERR(0, 664, __pyx_L6_except_error)
7496 goto __pyx_L6_except_error;
7497 __pyx_L6_except_error:;
7506 __Pyx_XGIVEREF(__pyx_t_3);
7507 __Pyx_XGIVEREF(__pyx_t_4);
7508 __Pyx_XGIVEREF(__pyx_t_5);
7509 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
7510 goto __pyx_L1_error;
7532 __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)
7533 __Pyx_GOTREF(__pyx_t_10);
7534 __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)
7535 __Pyx_GOTREF(__pyx_t_9);
7536 __pyx_t_6 = PyNumber_Add(__pyx_t_10, __pyx_t_9);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 668, __pyx_L1_error)
7537 __Pyx_GOTREF(__pyx_t_6);
7538 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7539 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7540 __pyx_t_9 = PyNumber_Add(__pyx_t_6, __pyx_kp_s__9);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 668, __pyx_L1_error)
7541 __Pyx_GOTREF(__pyx_t_9);
7542 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7543 __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_9);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 668, __pyx_L1_error)
7544 __Pyx_GOTREF(__pyx_t_6);
7545 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7546 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
7547 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7548 __PYX_ERR(0, 668, __pyx_L1_error)
7559 __Pyx_XDECREF(__pyx_r);
7560 __Pyx_INCREF(((PyObject *)__pyx_v_result));
7561 __pyx_r = ((PyObject *)__pyx_v_result);
7574 __Pyx_XDECREF(__pyx_t_6);
7575 __Pyx_XDECREF(__pyx_t_9);
7576 __Pyx_XDECREF(__pyx_t_10);
7577 __Pyx_XDECREF(__pyx_t_11);
7578 __Pyx_XDECREF(__pyx_t_12);
7579 __Pyx_XDECREF(__pyx_t_13);
7580 __Pyx_AddTraceback(
"PyClical.clifford.reframe", __pyx_clineno, __pyx_lineno, __pyx_filename);
7583 __Pyx_XDECREF(__pyx_v_error_msg_prefix);
7584 __Pyx_XDECREF((PyObject *)__pyx_v_result);
7585 __Pyx_XDECREF(__pyx_v_err);
7586 __Pyx_XGIVEREF(__pyx_r);
7587 __Pyx_RefNannyFinishContext();
7600 static PyObject *__pyx_pw_8PyClical_8clifford_13__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op);
7601 static PyObject *__pyx_pw_8PyClical_8clifford_13__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op) {
7602 PyObject *__pyx_r = 0;
7603 __Pyx_RefNannyDeclarations
7604 __Pyx_RefNannySetupContext(
"__richcmp__ (wrapper)", 0);
7605 __pyx_r = __pyx_pf_8PyClical_8clifford_12__richcmp__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs), ((
int)__pyx_v_op));
7608 __Pyx_RefNannyFinishContext();
7612 static PyObject *__pyx_pf_8PyClical_8clifford_12__richcmp__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op) {
7613 PyObject *__pyx_r = NULL;
7614 __Pyx_RefNannyDeclarations
7618 PyObject *__pyx_t_4 = NULL;
7619 PyObject *__pyx_t_5 = NULL;
7620 PyObject *__pyx_t_6 = NULL;
7621 __Pyx_RefNannySetupContext(
"__richcmp__", 0);
7630 __pyx_t_1 = ((__pyx_v_op == 2) != 0);
7640 __pyx_t_2 = (((PyObject *)__pyx_v_lhs) == Py_None);
7641 __pyx_t_3 = (__pyx_t_2 != 0);
7644 __pyx_t_1 = __pyx_t_3;
7645 goto __pyx_L5_bool_binop_done;
7647 __pyx_t_3 = (__pyx_v_rhs == Py_None);
7648 __pyx_t_2 = (__pyx_t_3 != 0);
7649 __pyx_t_1 = __pyx_t_2;
7650 __pyx_L5_bool_binop_done:;
7660 __Pyx_XDECREF(__pyx_r);
7661 __pyx_t_1 = (((PyObject *)__pyx_v_lhs) == __pyx_v_rhs);
7662 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error)
7663 __Pyx_GOTREF(__pyx_t_4);
7664 __pyx_r = __pyx_t_4;
7685 __Pyx_XDECREF(__pyx_r);
7686 __pyx_t_1 = (__pyx_f_8PyClical_toClifford(((PyObject *)__pyx_v_lhs)) == __pyx_f_8PyClical_toClifford(__pyx_v_rhs));
7687 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 694, __pyx_L1_error)
7688 __Pyx_GOTREF(__pyx_t_4);
7689 __pyx_r = __pyx_t_4;
7710 __pyx_t_1 = ((__pyx_v_op == 3) != 0);
7720 __pyx_t_2 = (((PyObject *)__pyx_v_lhs) == Py_None);
7721 __pyx_t_3 = (__pyx_t_2 != 0);
7724 __pyx_t_1 = __pyx_t_3;
7725 goto __pyx_L8_bool_binop_done;
7727 __pyx_t_3 = (__pyx_v_rhs == Py_None);
7728 __pyx_t_2 = (__pyx_t_3 != 0);
7729 __pyx_t_1 = __pyx_t_2;
7730 __pyx_L8_bool_binop_done:;
7740 __Pyx_XDECREF(__pyx_r);
7741 __pyx_t_1 = (((PyObject *)__pyx_v_lhs) == __pyx_v_rhs);
7742 __pyx_t_4 = __Pyx_PyBool_FromLong((!((!(!__pyx_t_1)) != 0)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 697, __pyx_L1_error)
7743 __Pyx_GOTREF(__pyx_t_4);
7744 __pyx_r = __pyx_t_4;
7765 __Pyx_XDECREF(__pyx_r);
7766 __pyx_t_1 = (__pyx_f_8PyClical_toClifford(((PyObject *)__pyx_v_lhs)) != __pyx_f_8PyClical_toClifford(__pyx_v_rhs));
7767 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 699, __pyx_L1_error)
7768 __Pyx_GOTREF(__pyx_t_4);
7769 __pyx_r = __pyx_t_4;
7790 __pyx_t_2 = __Pyx_TypeCheck(((PyObject *)__pyx_v_lhs), __pyx_ptype_8PyClical_clifford);
7791 __pyx_t_3 = (__pyx_t_2 != 0);
7794 __pyx_t_1 = __pyx_t_3;
7795 goto __pyx_L10_bool_binop_done;
7797 __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_rhs, __pyx_ptype_8PyClical_clifford);
7798 __pyx_t_2 = (__pyx_t_3 != 0);
7799 __pyx_t_1 = __pyx_t_2;
7800 __pyx_L10_bool_binop_done:;
7801 if (unlikely(__pyx_t_1)) {
7810 __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)
7811 __Pyx_GOTREF(__pyx_t_4);
7812 __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)
7813 __Pyx_GOTREF(__pyx_t_5);
7814 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7815 __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_kp_s__8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 702, __pyx_L1_error)
7816 __Pyx_GOTREF(__pyx_t_4);
7817 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7818 __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)
7819 __Pyx_GOTREF(__pyx_t_5);
7820 __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_t_5);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 702, __pyx_L1_error)
7821 __Pyx_GOTREF(__pyx_t_6);
7822 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7823 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7824 __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_kp_s_);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 702, __pyx_L1_error)
7825 __Pyx_GOTREF(__pyx_t_5);
7826 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7835 __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_5);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 701, __pyx_L1_error)
7836 __Pyx_GOTREF(__pyx_t_6);
7837 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7838 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
7839 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7840 __PYX_ERR(0, 701, __pyx_L1_error)
7859 __Pyx_XDECREF(__pyx_r);
7860 __Pyx_INCREF(__pyx_builtin_NotImplemented);
7861 __pyx_r = __pyx_builtin_NotImplemented;
7875 __Pyx_XDECREF(__pyx_t_4);
7876 __Pyx_XDECREF(__pyx_t_5);
7877 __Pyx_XDECREF(__pyx_t_6);
7878 __Pyx_AddTraceback(
"PyClical.clifford.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7881 __Pyx_XGIVEREF(__pyx_r);
7882 __Pyx_RefNannyFinishContext();
7895 static PyObject *__pyx_pw_8PyClical_8clifford_15__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ixt);
7896 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 ";
7897 #if CYTHON_COMPILING_IN_CPYTHON 7898 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_14__getitem__;
7900 static PyObject *__pyx_pw_8PyClical_8clifford_15__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ixt) {
7901 PyObject *__pyx_r = 0;
7902 __Pyx_RefNannyDeclarations
7903 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
7904 __pyx_r = __pyx_pf_8PyClical_8clifford_14__getitem__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_ixt));
7907 __Pyx_RefNannyFinishContext();
7911 static PyObject *__pyx_pf_8PyClical_8clifford_14__getitem__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_ixt) {
7912 PyObject *__pyx_r = NULL;
7913 __Pyx_RefNannyDeclarations
7914 PyObject *__pyx_t_1 = NULL;
7915 __Pyx_RefNannySetupContext(
"__getitem__", 0);
7924 __Pyx_XDECREF(__pyx_r);
7925 __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)
7926 __Pyx_GOTREF(__pyx_t_1);
7927 __pyx_r = __pyx_t_1;
7941 __Pyx_XDECREF(__pyx_t_1);
7942 __Pyx_AddTraceback(
"PyClical.clifford.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7945 __Pyx_XGIVEREF(__pyx_r);
7946 __Pyx_RefNannyFinishContext();
7959 static PyObject *__pyx_pw_8PyClical_8clifford_17__neg__(PyObject *__pyx_v_self);
7960 static char __pyx_doc_8PyClical_8clifford_16__neg__[] =
"\n Unary -.\n\n >>> print -clifford(\"{1}\")\n -{1}\n ";
7961 #if CYTHON_COMPILING_IN_CPYTHON 7962 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_16__neg__;
7964 static PyObject *__pyx_pw_8PyClical_8clifford_17__neg__(PyObject *__pyx_v_self) {
7965 PyObject *__pyx_r = 0;
7966 __Pyx_RefNannyDeclarations
7967 __Pyx_RefNannySetupContext(
"__neg__ (wrapper)", 0);
7968 __pyx_r = __pyx_pf_8PyClical_8clifford_16__neg__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
7971 __Pyx_RefNannyFinishContext();
7975 static PyObject *__pyx_pf_8PyClical_8clifford_16__neg__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
7976 PyObject *__pyx_r = NULL;
7977 __Pyx_RefNannyDeclarations
7978 PyObject *__pyx_t_1 = NULL;
7979 PyObject *__pyx_t_2 = NULL;
7980 __Pyx_RefNannySetupContext(
"__neg__", 0);
7989 __Pyx_XDECREF(__pyx_r);
7990 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 728, __pyx_L1_error)
7991 __Pyx_GOTREF(__pyx_t_1);
7992 __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)
7993 __Pyx_GOTREF(__pyx_t_2);
7994 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7995 __pyx_r = __pyx_t_2;
8009 __Pyx_XDECREF(__pyx_t_1);
8010 __Pyx_XDECREF(__pyx_t_2);
8011 __Pyx_AddTraceback(
"PyClical.clifford.__neg__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8014 __Pyx_XGIVEREF(__pyx_r);
8015 __Pyx_RefNannyFinishContext();
8028 static PyObject *__pyx_pw_8PyClical_8clifford_19__pos__(PyObject *__pyx_v_self);
8029 static char __pyx_doc_8PyClical_8clifford_18__pos__[] =
"\n Unary +.\n\n >>> print +clifford(\"{1}\")\n {1}\n ";
8030 #if CYTHON_COMPILING_IN_CPYTHON 8031 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_18__pos__;
8033 static PyObject *__pyx_pw_8PyClical_8clifford_19__pos__(PyObject *__pyx_v_self) {
8034 PyObject *__pyx_r = 0;
8035 __Pyx_RefNannyDeclarations
8036 __Pyx_RefNannySetupContext(
"__pos__ (wrapper)", 0);
8037 __pyx_r = __pyx_pf_8PyClical_8clifford_18__pos__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
8040 __Pyx_RefNannyFinishContext();
8044 static PyObject *__pyx_pf_8PyClical_8clifford_18__pos__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
8045 PyObject *__pyx_r = NULL;
8046 __Pyx_RefNannyDeclarations
8047 PyObject *__pyx_t_1 = NULL;
8048 __Pyx_RefNannySetupContext(
"__pos__", 0);
8057 __Pyx_XDECREF(__pyx_r);
8058 __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)
8059 __Pyx_GOTREF(__pyx_t_1);
8060 __pyx_r = __pyx_t_1;
8074 __Pyx_XDECREF(__pyx_t_1);
8075 __Pyx_AddTraceback(
"PyClical.clifford.__pos__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8078 __Pyx_XGIVEREF(__pyx_r);
8079 __Pyx_RefNannyFinishContext();
8092 static PyObject *__pyx_pw_8PyClical_8clifford_21__add__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8093 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 ";
8094 #if CYTHON_COMPILING_IN_CPYTHON 8095 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_20__add__;
8097 static PyObject *__pyx_pw_8PyClical_8clifford_21__add__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8098 PyObject *__pyx_r = 0;
8099 __Pyx_RefNannyDeclarations
8100 __Pyx_RefNannySetupContext(
"__add__ (wrapper)", 0);
8101 __pyx_r = __pyx_pf_8PyClical_8clifford_20__add__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8104 __Pyx_RefNannyFinishContext();
8108 static PyObject *__pyx_pf_8PyClical_8clifford_20__add__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8109 PyObject *__pyx_r = NULL;
8110 __Pyx_RefNannyDeclarations
8111 PyObject *__pyx_t_1 = NULL;
8112 PyObject *__pyx_t_2 = NULL;
8113 __Pyx_RefNannySetupContext(
"__add__", 0);
8122 __Pyx_XDECREF(__pyx_r);
8123 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 748, __pyx_L1_error)
8124 __Pyx_GOTREF(__pyx_t_1);
8125 __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)
8126 __Pyx_GOTREF(__pyx_t_2);
8127 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8128 __pyx_r = __pyx_t_2;
8142 __Pyx_XDECREF(__pyx_t_1);
8143 __Pyx_XDECREF(__pyx_t_2);
8144 __Pyx_AddTraceback(
"PyClical.clifford.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8147 __Pyx_XGIVEREF(__pyx_r);
8148 __Pyx_RefNannyFinishContext();
8161 static PyObject *__pyx_pw_8PyClical_8clifford_23__iadd__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8162 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 ";
8163 #if CYTHON_COMPILING_IN_CPYTHON 8164 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_22__iadd__;
8166 static PyObject *__pyx_pw_8PyClical_8clifford_23__iadd__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8167 PyObject *__pyx_r = 0;
8168 __Pyx_RefNannyDeclarations
8169 __Pyx_RefNannySetupContext(
"__iadd__ (wrapper)", 0);
8170 __pyx_r = __pyx_pf_8PyClical_8clifford_22__iadd__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8173 __Pyx_RefNannyFinishContext();
8177 static PyObject *__pyx_pf_8PyClical_8clifford_22__iadd__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8178 PyObject *__pyx_r = NULL;
8179 __Pyx_RefNannyDeclarations
8180 PyObject *__pyx_t_1 = NULL;
8181 __Pyx_RefNannySetupContext(
"__iadd__", 0);
8190 __Pyx_XDECREF(__pyx_r);
8191 __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)
8192 __Pyx_GOTREF(__pyx_t_1);
8193 __pyx_r = __pyx_t_1;
8207 __Pyx_XDECREF(__pyx_t_1);
8208 __Pyx_AddTraceback(
"PyClical.clifford.__iadd__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8211 __Pyx_XGIVEREF(__pyx_r);
8212 __Pyx_RefNannyFinishContext();
8225 static PyObject *__pyx_pw_8PyClical_8clifford_25__sub__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8226 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 ";
8227 #if CYTHON_COMPILING_IN_CPYTHON 8228 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_24__sub__;
8230 static PyObject *__pyx_pw_8PyClical_8clifford_25__sub__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8231 PyObject *__pyx_r = 0;
8232 __Pyx_RefNannyDeclarations
8233 __Pyx_RefNannySetupContext(
"__sub__ (wrapper)", 0);
8234 __pyx_r = __pyx_pf_8PyClical_8clifford_24__sub__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8237 __Pyx_RefNannyFinishContext();
8241 static PyObject *__pyx_pf_8PyClical_8clifford_24__sub__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8242 PyObject *__pyx_r = NULL;
8243 __Pyx_RefNannyDeclarations
8244 PyObject *__pyx_t_1 = NULL;
8245 PyObject *__pyx_t_2 = NULL;
8246 __Pyx_RefNannySetupContext(
"__sub__", 0);
8255 __Pyx_XDECREF(__pyx_r);
8256 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 768, __pyx_L1_error)
8257 __Pyx_GOTREF(__pyx_t_1);
8258 __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)
8259 __Pyx_GOTREF(__pyx_t_2);
8260 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8261 __pyx_r = __pyx_t_2;
8275 __Pyx_XDECREF(__pyx_t_1);
8276 __Pyx_XDECREF(__pyx_t_2);
8277 __Pyx_AddTraceback(
"PyClical.clifford.__sub__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8280 __Pyx_XGIVEREF(__pyx_r);
8281 __Pyx_RefNannyFinishContext();
8294 static PyObject *__pyx_pw_8PyClical_8clifford_27__isub__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8295 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 ";
8296 #if CYTHON_COMPILING_IN_CPYTHON 8297 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_26__isub__;
8299 static PyObject *__pyx_pw_8PyClical_8clifford_27__isub__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8300 PyObject *__pyx_r = 0;
8301 __Pyx_RefNannyDeclarations
8302 __Pyx_RefNannySetupContext(
"__isub__ (wrapper)", 0);
8303 __pyx_r = __pyx_pf_8PyClical_8clifford_26__isub__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8306 __Pyx_RefNannyFinishContext();
8310 static PyObject *__pyx_pf_8PyClical_8clifford_26__isub__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8311 PyObject *__pyx_r = NULL;
8312 __Pyx_RefNannyDeclarations
8313 PyObject *__pyx_t_1 = NULL;
8314 __Pyx_RefNannySetupContext(
"__isub__", 0);
8323 __Pyx_XDECREF(__pyx_r);
8324 __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)
8325 __Pyx_GOTREF(__pyx_t_1);
8326 __pyx_r = __pyx_t_1;
8340 __Pyx_XDECREF(__pyx_t_1);
8341 __Pyx_AddTraceback(
"PyClical.clifford.__isub__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8344 __Pyx_XGIVEREF(__pyx_r);
8345 __Pyx_RefNannyFinishContext();
8358 static PyObject *__pyx_pw_8PyClical_8clifford_29__mul__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8359 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 ";
8360 #if CYTHON_COMPILING_IN_CPYTHON 8361 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_28__mul__;
8363 static PyObject *__pyx_pw_8PyClical_8clifford_29__mul__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8364 PyObject *__pyx_r = 0;
8365 __Pyx_RefNannyDeclarations
8366 __Pyx_RefNannySetupContext(
"__mul__ (wrapper)", 0);
8367 __pyx_r = __pyx_pf_8PyClical_8clifford_28__mul__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8370 __Pyx_RefNannyFinishContext();
8374 static PyObject *__pyx_pf_8PyClical_8clifford_28__mul__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8375 PyObject *__pyx_r = NULL;
8376 __Pyx_RefNannyDeclarations
8377 PyObject *__pyx_t_1 = NULL;
8378 PyObject *__pyx_t_2 = NULL;
8379 __Pyx_RefNannySetupContext(
"__mul__", 0);
8388 __Pyx_XDECREF(__pyx_r);
8389 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 790, __pyx_L1_error)
8390 __Pyx_GOTREF(__pyx_t_1);
8391 __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)
8392 __Pyx_GOTREF(__pyx_t_2);
8393 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8394 __pyx_r = __pyx_t_2;
8408 __Pyx_XDECREF(__pyx_t_1);
8409 __Pyx_XDECREF(__pyx_t_2);
8410 __Pyx_AddTraceback(
"PyClical.clifford.__mul__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8413 __Pyx_XGIVEREF(__pyx_r);
8414 __Pyx_RefNannyFinishContext();
8427 static PyObject *__pyx_pw_8PyClical_8clifford_31__imul__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8428 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 ";
8429 #if CYTHON_COMPILING_IN_CPYTHON 8430 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_30__imul__;
8432 static PyObject *__pyx_pw_8PyClical_8clifford_31__imul__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8433 PyObject *__pyx_r = 0;
8434 __Pyx_RefNannyDeclarations
8435 __Pyx_RefNannySetupContext(
"__imul__ (wrapper)", 0);
8436 __pyx_r = __pyx_pf_8PyClical_8clifford_30__imul__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8439 __Pyx_RefNannyFinishContext();
8443 static PyObject *__pyx_pf_8PyClical_8clifford_30__imul__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8444 PyObject *__pyx_r = NULL;
8445 __Pyx_RefNannyDeclarations
8446 PyObject *__pyx_t_1 = NULL;
8447 __Pyx_RefNannySetupContext(
"__imul__", 0);
8456 __Pyx_XDECREF(__pyx_r);
8457 __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)
8458 __Pyx_GOTREF(__pyx_t_1);
8459 __pyx_r = __pyx_t_1;
8473 __Pyx_XDECREF(__pyx_t_1);
8474 __Pyx_AddTraceback(
"PyClical.clifford.__imul__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8477 __Pyx_XGIVEREF(__pyx_r);
8478 __Pyx_RefNannyFinishContext();
8491 static PyObject *__pyx_pw_8PyClical_8clifford_33__mod__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8492 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 ";
8493 #if CYTHON_COMPILING_IN_CPYTHON 8494 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_32__mod__;
8496 static PyObject *__pyx_pw_8PyClical_8clifford_33__mod__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8497 PyObject *__pyx_r = 0;
8498 __Pyx_RefNannyDeclarations
8499 __Pyx_RefNannySetupContext(
"__mod__ (wrapper)", 0);
8500 __pyx_r = __pyx_pf_8PyClical_8clifford_32__mod__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8503 __Pyx_RefNannyFinishContext();
8507 static PyObject *__pyx_pf_8PyClical_8clifford_32__mod__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8508 PyObject *__pyx_r = NULL;
8509 __Pyx_RefNannyDeclarations
8510 PyObject *__pyx_t_1 = NULL;
8511 PyObject *__pyx_t_2 = NULL;
8512 __Pyx_RefNannySetupContext(
"__mod__", 0);
8521 __Pyx_XDECREF(__pyx_r);
8522 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 818, __pyx_L1_error)
8523 __Pyx_GOTREF(__pyx_t_1);
8524 __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)
8525 __Pyx_GOTREF(__pyx_t_2);
8526 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8527 __pyx_r = __pyx_t_2;
8541 __Pyx_XDECREF(__pyx_t_1);
8542 __Pyx_XDECREF(__pyx_t_2);
8543 __Pyx_AddTraceback(
"PyClical.clifford.__mod__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8546 __Pyx_XGIVEREF(__pyx_r);
8547 __Pyx_RefNannyFinishContext();
8560 static PyObject *__pyx_pw_8PyClical_8clifford_35__imod__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8561 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 ";
8562 #if CYTHON_COMPILING_IN_CPYTHON 8563 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_34__imod__;
8565 static PyObject *__pyx_pw_8PyClical_8clifford_35__imod__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8566 PyObject *__pyx_r = 0;
8567 __Pyx_RefNannyDeclarations
8568 __Pyx_RefNannySetupContext(
"__imod__ (wrapper)", 0);
8569 __pyx_r = __pyx_pf_8PyClical_8clifford_34__imod__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8572 __Pyx_RefNannyFinishContext();
8576 static PyObject *__pyx_pf_8PyClical_8clifford_34__imod__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8577 PyObject *__pyx_r = NULL;
8578 __Pyx_RefNannyDeclarations
8579 PyObject *__pyx_t_1 = NULL;
8580 __Pyx_RefNannySetupContext(
"__imod__", 0);
8589 __Pyx_XDECREF(__pyx_r);
8590 __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)
8591 __Pyx_GOTREF(__pyx_t_1);
8592 __pyx_r = __pyx_t_1;
8606 __Pyx_XDECREF(__pyx_t_1);
8607 __Pyx_AddTraceback(
"PyClical.clifford.__imod__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8610 __Pyx_XGIVEREF(__pyx_r);
8611 __Pyx_RefNannyFinishContext();
8624 static PyObject *__pyx_pw_8PyClical_8clifford_37__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8625 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 ";
8626 #if CYTHON_COMPILING_IN_CPYTHON 8627 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_36__and__;
8629 static PyObject *__pyx_pw_8PyClical_8clifford_37__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8630 PyObject *__pyx_r = 0;
8631 __Pyx_RefNannyDeclarations
8632 __Pyx_RefNannySetupContext(
"__and__ (wrapper)", 0);
8633 __pyx_r = __pyx_pf_8PyClical_8clifford_36__and__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8636 __Pyx_RefNannyFinishContext();
8640 static PyObject *__pyx_pf_8PyClical_8clifford_36__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8641 PyObject *__pyx_r = NULL;
8642 __Pyx_RefNannyDeclarations
8643 PyObject *__pyx_t_1 = NULL;
8644 PyObject *__pyx_t_2 = NULL;
8645 __Pyx_RefNannySetupContext(
"__and__", 0);
8654 __Pyx_XDECREF(__pyx_r);
8655 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 848, __pyx_L1_error)
8656 __Pyx_GOTREF(__pyx_t_1);
8657 __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)
8658 __Pyx_GOTREF(__pyx_t_2);
8659 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8660 __pyx_r = __pyx_t_2;
8674 __Pyx_XDECREF(__pyx_t_1);
8675 __Pyx_XDECREF(__pyx_t_2);
8676 __Pyx_AddTraceback(
"PyClical.clifford.__and__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8679 __Pyx_XGIVEREF(__pyx_r);
8680 __Pyx_RefNannyFinishContext();
8693 static PyObject *__pyx_pw_8PyClical_8clifford_39__iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8694 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 ";
8695 #if CYTHON_COMPILING_IN_CPYTHON 8696 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_38__iand__;
8698 static PyObject *__pyx_pw_8PyClical_8clifford_39__iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8699 PyObject *__pyx_r = 0;
8700 __Pyx_RefNannyDeclarations
8701 __Pyx_RefNannySetupContext(
"__iand__ (wrapper)", 0);
8702 __pyx_r = __pyx_pf_8PyClical_8clifford_38__iand__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8705 __Pyx_RefNannyFinishContext();
8709 static PyObject *__pyx_pf_8PyClical_8clifford_38__iand__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8710 PyObject *__pyx_r = NULL;
8711 __Pyx_RefNannyDeclarations
8712 PyObject *__pyx_t_1 = NULL;
8713 __Pyx_RefNannySetupContext(
"__iand__", 0);
8722 __Pyx_XDECREF(__pyx_r);
8723 __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)
8724 __Pyx_GOTREF(__pyx_t_1);
8725 __pyx_r = __pyx_t_1;
8739 __Pyx_XDECREF(__pyx_t_1);
8740 __Pyx_AddTraceback(
"PyClical.clifford.__iand__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8743 __Pyx_XGIVEREF(__pyx_r);
8744 __Pyx_RefNannyFinishContext();
8757 static PyObject *__pyx_pw_8PyClical_8clifford_41__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8758 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 ";
8759 #if CYTHON_COMPILING_IN_CPYTHON 8760 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_40__xor__;
8762 static PyObject *__pyx_pw_8PyClical_8clifford_41__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8763 PyObject *__pyx_r = 0;
8764 __Pyx_RefNannyDeclarations
8765 __Pyx_RefNannySetupContext(
"__xor__ (wrapper)", 0);
8766 __pyx_r = __pyx_pf_8PyClical_8clifford_40__xor__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8769 __Pyx_RefNannyFinishContext();
8773 static PyObject *__pyx_pf_8PyClical_8clifford_40__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8774 PyObject *__pyx_r = NULL;
8775 __Pyx_RefNannyDeclarations
8776 PyObject *__pyx_t_1 = NULL;
8777 PyObject *__pyx_t_2 = NULL;
8778 __Pyx_RefNannySetupContext(
"__xor__", 0);
8787 __Pyx_XDECREF(__pyx_r);
8788 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 878, __pyx_L1_error)
8789 __Pyx_GOTREF(__pyx_t_1);
8790 __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)
8791 __Pyx_GOTREF(__pyx_t_2);
8792 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8793 __pyx_r = __pyx_t_2;
8807 __Pyx_XDECREF(__pyx_t_1);
8808 __Pyx_XDECREF(__pyx_t_2);
8809 __Pyx_AddTraceback(
"PyClical.clifford.__xor__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8812 __Pyx_XGIVEREF(__pyx_r);
8813 __Pyx_RefNannyFinishContext();
8826 static PyObject *__pyx_pw_8PyClical_8clifford_43__ixor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8827 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 ";
8828 #if CYTHON_COMPILING_IN_CPYTHON 8829 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_42__ixor__;
8831 static PyObject *__pyx_pw_8PyClical_8clifford_43__ixor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8832 PyObject *__pyx_r = 0;
8833 __Pyx_RefNannyDeclarations
8834 __Pyx_RefNannySetupContext(
"__ixor__ (wrapper)", 0);
8835 __pyx_r = __pyx_pf_8PyClical_8clifford_42__ixor__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8838 __Pyx_RefNannyFinishContext();
8842 static PyObject *__pyx_pf_8PyClical_8clifford_42__ixor__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8843 PyObject *__pyx_r = NULL;
8844 __Pyx_RefNannyDeclarations
8845 PyObject *__pyx_t_1 = NULL;
8846 __Pyx_RefNannySetupContext(
"__ixor__", 0);
8855 __Pyx_XDECREF(__pyx_r);
8856 __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)
8857 __Pyx_GOTREF(__pyx_t_1);
8858 __pyx_r = __pyx_t_1;
8872 __Pyx_XDECREF(__pyx_t_1);
8873 __Pyx_AddTraceback(
"PyClical.clifford.__ixor__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8876 __Pyx_XGIVEREF(__pyx_r);
8877 __Pyx_RefNannyFinishContext();
8890 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 8891 static PyObject *__pyx_pw_8PyClical_8clifford_45__div__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8892 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 ";
8893 #if CYTHON_COMPILING_IN_CPYTHON 8894 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_44__div__;
8896 static PyObject *__pyx_pw_8PyClical_8clifford_45__div__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8897 PyObject *__pyx_r = 0;
8898 __Pyx_RefNannyDeclarations
8899 __Pyx_RefNannySetupContext(
"__div__ (wrapper)", 0);
8900 __pyx_r = __pyx_pf_8PyClical_8clifford_44__div__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8903 __Pyx_RefNannyFinishContext();
8908 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 8909 static PyObject *__pyx_pf_8PyClical_8clifford_44__div__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8910 PyObject *__pyx_r = NULL;
8911 __Pyx_RefNannyDeclarations
8912 PyObject *__pyx_t_1 = NULL;
8913 PyObject *__pyx_t_2 = NULL;
8914 __Pyx_RefNannySetupContext(
"__div__", 0);
8923 __Pyx_XDECREF(__pyx_r);
8924 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 908, __pyx_L1_error)
8925 __Pyx_GOTREF(__pyx_t_1);
8926 __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)
8927 __Pyx_GOTREF(__pyx_t_2);
8928 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8929 __pyx_r = __pyx_t_2;
8943 __Pyx_XDECREF(__pyx_t_1);
8944 __Pyx_XDECREF(__pyx_t_2);
8945 __Pyx_AddTraceback(
"PyClical.clifford.__div__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8948 __Pyx_XGIVEREF(__pyx_r);
8949 __Pyx_RefNannyFinishContext();
8963 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 8964 static PyObject *__pyx_pw_8PyClical_8clifford_47__idiv__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8965 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 ";
8966 #if CYTHON_COMPILING_IN_CPYTHON 8967 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_46__idiv__;
8969 static PyObject *__pyx_pw_8PyClical_8clifford_47__idiv__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8970 PyObject *__pyx_r = 0;
8971 __Pyx_RefNannyDeclarations
8972 __Pyx_RefNannySetupContext(
"__idiv__ (wrapper)", 0);
8973 __pyx_r = __pyx_pf_8PyClical_8clifford_46__idiv__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8976 __Pyx_RefNannyFinishContext();
8981 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 8982 static PyObject *__pyx_pf_8PyClical_8clifford_46__idiv__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8983 PyObject *__pyx_r = NULL;
8984 __Pyx_RefNannyDeclarations
8985 PyObject *__pyx_t_1 = NULL;
8986 __Pyx_RefNannySetupContext(
"__idiv__", 0);
8995 __Pyx_XDECREF(__pyx_r);
8996 __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)
8997 __Pyx_GOTREF(__pyx_t_1);
8998 __pyx_r = __pyx_t_1;
9012 __Pyx_XDECREF(__pyx_t_1);
9013 __Pyx_AddTraceback(
"PyClical.clifford.__idiv__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9016 __Pyx_XGIVEREF(__pyx_r);
9017 __Pyx_RefNannyFinishContext();
9031 static PyObject *__pyx_pw_8PyClical_8clifford_49inv(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9032 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 ";
9033 static PyObject *__pyx_pw_8PyClical_8clifford_49inv(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9034 PyObject *__pyx_r = 0;
9035 __Pyx_RefNannyDeclarations
9036 __Pyx_RefNannySetupContext(
"inv (wrapper)", 0);
9037 __pyx_r = __pyx_pf_8PyClical_8clifford_48inv(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
9040 __Pyx_RefNannyFinishContext();
9044 static PyObject *__pyx_pf_8PyClical_8clifford_48inv(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
9045 PyObject *__pyx_r = NULL;
9046 __Pyx_RefNannyDeclarations
9047 PyObject *__pyx_t_1 = NULL;
9048 PyObject *__pyx_t_2 = NULL;
9049 __Pyx_RefNannySetupContext(
"inv", 0);
9058 __Pyx_XDECREF(__pyx_r);
9059 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 936, __pyx_L1_error)
9060 __Pyx_GOTREF(__pyx_t_1);
9061 __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)
9062 __Pyx_GOTREF(__pyx_t_2);
9063 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9064 __pyx_r = __pyx_t_2;
9078 __Pyx_XDECREF(__pyx_t_1);
9079 __Pyx_XDECREF(__pyx_t_2);
9080 __Pyx_AddTraceback(
"PyClical.clifford.inv", __pyx_clineno, __pyx_lineno, __pyx_filename);
9083 __Pyx_XGIVEREF(__pyx_r);
9084 __Pyx_RefNannyFinishContext();
9097 static PyObject *__pyx_pw_8PyClical_8clifford_51__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
9098 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 ";
9099 #if CYTHON_COMPILING_IN_CPYTHON 9100 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_50__or__;
9102 static PyObject *__pyx_pw_8PyClical_8clifford_51__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
9103 PyObject *__pyx_r = 0;
9104 __Pyx_RefNannyDeclarations
9105 __Pyx_RefNannySetupContext(
"__or__ (wrapper)", 0);
9106 __pyx_r = __pyx_pf_8PyClical_8clifford_50__or__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
9109 __Pyx_RefNannyFinishContext();
9113 static PyObject *__pyx_pf_8PyClical_8clifford_50__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
9114 PyObject *__pyx_r = NULL;
9115 __Pyx_RefNannyDeclarations
9116 PyObject *__pyx_t_1 = NULL;
9117 PyObject *__pyx_t_2 = NULL;
9118 __Pyx_RefNannySetupContext(
"__or__", 0);
9127 __Pyx_XDECREF(__pyx_r);
9128 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 947, __pyx_L1_error)
9129 __Pyx_GOTREF(__pyx_t_1);
9130 __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)
9131 __Pyx_GOTREF(__pyx_t_2);
9132 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9133 __pyx_r = __pyx_t_2;
9147 __Pyx_XDECREF(__pyx_t_1);
9148 __Pyx_XDECREF(__pyx_t_2);
9149 __Pyx_AddTraceback(
"PyClical.clifford.__or__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9152 __Pyx_XGIVEREF(__pyx_r);
9153 __Pyx_RefNannyFinishContext();
9166 static PyObject *__pyx_pw_8PyClical_8clifford_53__ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
9167 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 ";
9168 #if CYTHON_COMPILING_IN_CPYTHON 9169 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_52__ior__;
9171 static PyObject *__pyx_pw_8PyClical_8clifford_53__ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
9172 PyObject *__pyx_r = 0;
9173 __Pyx_RefNannyDeclarations
9174 __Pyx_RefNannySetupContext(
"__ior__ (wrapper)", 0);
9175 __pyx_r = __pyx_pf_8PyClical_8clifford_52__ior__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
9178 __Pyx_RefNannyFinishContext();
9182 static PyObject *__pyx_pf_8PyClical_8clifford_52__ior__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
9183 PyObject *__pyx_r = NULL;
9184 __Pyx_RefNannyDeclarations
9185 PyObject *__pyx_t_1 = NULL;
9186 __Pyx_RefNannySetupContext(
"__ior__", 0);
9195 __Pyx_XDECREF(__pyx_r);
9196 __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)
9197 __Pyx_GOTREF(__pyx_t_1);
9198 __pyx_r = __pyx_t_1;
9212 __Pyx_XDECREF(__pyx_t_1);
9213 __Pyx_AddTraceback(
"PyClical.clifford.__ior__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9216 __Pyx_XGIVEREF(__pyx_r);
9217 __Pyx_RefNannyFinishContext();
9230 static PyObject *__pyx_pw_8PyClical_8clifford_55__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_m, PyObject *__pyx_v_dummy);
9231 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 ";
9232 #if CYTHON_COMPILING_IN_CPYTHON 9233 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_54__pow__;
9235 static PyObject *__pyx_pw_8PyClical_8clifford_55__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_m, PyObject *__pyx_v_dummy) {
9236 PyObject *__pyx_r = 0;
9237 __Pyx_RefNannyDeclarations
9238 __Pyx_RefNannySetupContext(
"__pow__ (wrapper)", 0);
9239 __pyx_r = __pyx_pf_8PyClical_8clifford_54__pow__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_m), ((PyObject *)__pyx_v_dummy));
9242 __Pyx_RefNannyFinishContext();
9246 static PyObject *__pyx_pf_8PyClical_8clifford_54__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_m, CYTHON_UNUSED PyObject *__pyx_v_dummy) {
9247 PyObject *__pyx_r = NULL;
9248 __Pyx_RefNannyDeclarations
9249 PyObject *__pyx_t_1 = NULL;
9250 __Pyx_RefNannySetupContext(
"__pow__", 0);
9259 __Pyx_XDECREF(__pyx_r);
9260 __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)
9261 __Pyx_GOTREF(__pyx_t_1);
9262 __pyx_r = __pyx_t_1;
9276 __Pyx_XDECREF(__pyx_t_1);
9277 __Pyx_AddTraceback(
"PyClical.clifford.__pow__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9280 __Pyx_XGIVEREF(__pyx_r);
9281 __Pyx_RefNannyFinishContext();
9294 static PyObject *__pyx_pw_8PyClical_8clifford_57pow(PyObject *__pyx_v_self, PyObject *__pyx_v_m);
9295 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 ";
9296 static PyObject *__pyx_pw_8PyClical_8clifford_57pow(PyObject *__pyx_v_self, PyObject *__pyx_v_m) {
9297 PyObject *__pyx_r = 0;
9298 __Pyx_RefNannyDeclarations
9299 __Pyx_RefNannySetupContext(
"pow (wrapper)", 0);
9300 __pyx_r = __pyx_pf_8PyClical_8clifford_56pow(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_m));
9303 __Pyx_RefNannyFinishContext();
9307 static PyObject *__pyx_pf_8PyClical_8clifford_56pow(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_m) {
9308 PyObject *__pyx_r = NULL;
9309 __Pyx_RefNannyDeclarations
9310 PyObject *__pyx_t_1 = NULL;
9311 PyObject *__pyx_t_2 = NULL;
9315 __Pyx_RefNannySetupContext(
"pow", 0);
9324 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_numbers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __pyx_L1_error)
9325 __Pyx_GOTREF(__pyx_t_1);
9326 __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)
9327 __Pyx_GOTREF(__pyx_t_2);
9328 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9329 __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)
9330 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9331 __pyx_t_4 = (__pyx_t_3 != 0);
9341 __Pyx_XDECREF(__pyx_r);
9342 __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 999, __pyx_L1_error)
9343 __Pyx_GOTREF(__pyx_t_2);
9344 __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)
9345 __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)
9346 __Pyx_GOTREF(__pyx_t_1);
9347 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9348 __pyx_r = __pyx_t_1;
9369 __Pyx_XDECREF(__pyx_r);
9370 __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)
9371 __Pyx_GOTREF(__pyx_t_1);
9372 __pyx_t_2 = PyNumber_Multiply(__pyx_v_m, __pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1001, __pyx_L1_error)
9373 __Pyx_GOTREF(__pyx_t_2);
9374 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9375 __pyx_t_1 = __pyx_f_8PyClical_exp(__pyx_t_2, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1001, __pyx_L1_error)
9376 __Pyx_GOTREF(__pyx_t_1);
9377 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9378 __pyx_r = __pyx_t_1;
9393 __Pyx_XDECREF(__pyx_t_1);
9394 __Pyx_XDECREF(__pyx_t_2);
9395 __Pyx_AddTraceback(
"PyClical.clifford.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
9398 __Pyx_XGIVEREF(__pyx_r);
9399 __Pyx_RefNannyFinishContext();
9412 static PyObject *__pyx_pw_8PyClical_8clifford_59outer_pow(PyObject *__pyx_v_self, PyObject *__pyx_v_m);
9413 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 ";
9414 static PyObject *__pyx_pw_8PyClical_8clifford_59outer_pow(PyObject *__pyx_v_self, PyObject *__pyx_v_m) {
9415 PyObject *__pyx_r = 0;
9416 __Pyx_RefNannyDeclarations
9417 __Pyx_RefNannySetupContext(
"outer_pow (wrapper)", 0);
9418 __pyx_r = __pyx_pf_8PyClical_8clifford_58outer_pow(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_m));
9421 __Pyx_RefNannyFinishContext();
9425 static PyObject *__pyx_pf_8PyClical_8clifford_58outer_pow(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_m) {
9426 PyObject *__pyx_r = NULL;
9427 __Pyx_RefNannyDeclarations
9428 PyObject *__pyx_t_1 = NULL;
9430 PyObject *__pyx_t_3 = NULL;
9431 __Pyx_RefNannySetupContext(
"outer_pow", 0);
9440 __Pyx_XDECREF(__pyx_r);
9441 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1017, __pyx_L1_error)
9442 __Pyx_GOTREF(__pyx_t_1);
9443 __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)
9444 __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)
9445 __Pyx_GOTREF(__pyx_t_3);
9446 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9447 __pyx_r = __pyx_t_3;
9461 __Pyx_XDECREF(__pyx_t_1);
9462 __Pyx_XDECREF(__pyx_t_3);
9463 __Pyx_AddTraceback(
"PyClical.clifford.outer_pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
9466 __Pyx_XGIVEREF(__pyx_r);
9467 __Pyx_RefNannyFinishContext();
9480 static PyObject *__pyx_pw_8PyClical_8clifford_61__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
9481 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 ";
9482 #if CYTHON_COMPILING_IN_CPYTHON 9483 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_60__call__;
9485 static PyObject *__pyx_pw_8PyClical_8clifford_61__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9486 PyObject *__pyx_v_grade = 0;
9487 PyObject *__pyx_r = 0;
9488 __Pyx_RefNannyDeclarations
9489 __Pyx_RefNannySetupContext(
"__call__ (wrapper)", 0);
9491 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_grade,0};
9492 PyObject* values[1] = {0};
9493 if (unlikely(__pyx_kwds)) {
9495 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9497 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9500 default:
goto __pyx_L5_argtuple_error;
9502 kw_args = PyDict_Size(__pyx_kwds);
9505 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_grade)) != 0)) kw_args--;
9506 else goto __pyx_L5_argtuple_error;
9508 if (unlikely(kw_args > 0)) {
9509 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__call__") < 0)) __PYX_ERR(0, 1019, __pyx_L3_error)
9511 }
else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
9512 goto __pyx_L5_argtuple_error;
9514 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9516 __pyx_v_grade = values[0];
9518 goto __pyx_L4_argument_unpacking_done;
9519 __pyx_L5_argtuple_error:;
9520 __Pyx_RaiseArgtupleInvalid(
"__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1019, __pyx_L3_error)
9522 __Pyx_AddTraceback(
"PyClical.clifford.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9523 __Pyx_RefNannyFinishContext();
9525 __pyx_L4_argument_unpacking_done:;
9526 __pyx_r = __pyx_pf_8PyClical_8clifford_60__call__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), __pyx_v_grade);
9529 __Pyx_RefNannyFinishContext();
9533 static PyObject *__pyx_pf_8PyClical_8clifford_60__call__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_grade) {
9534 PyObject *__pyx_r = NULL;
9535 __Pyx_RefNannyDeclarations
9536 PyObject *__pyx_t_1 = NULL;
9538 PyObject *__pyx_t_3 = NULL;
9539 __Pyx_RefNannySetupContext(
"__call__", 0);
9548 __Pyx_XDECREF(__pyx_r);
9549 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1036, __pyx_L1_error)
9550 __Pyx_GOTREF(__pyx_t_1);
9551 __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)
9552 __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)
9553 __Pyx_GOTREF(__pyx_t_3);
9554 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9555 __pyx_r = __pyx_t_3;
9569 __Pyx_XDECREF(__pyx_t_1);
9570 __Pyx_XDECREF(__pyx_t_3);
9571 __Pyx_AddTraceback(
"PyClical.clifford.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9574 __Pyx_XGIVEREF(__pyx_r);
9575 __Pyx_RefNannyFinishContext();
9588 static PyObject *__pyx_pw_8PyClical_8clifford_63scalar(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9589 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 ";
9590 static PyObject *__pyx_pw_8PyClical_8clifford_63scalar(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9591 PyObject *__pyx_r = 0;
9592 __Pyx_RefNannyDeclarations
9593 __Pyx_RefNannySetupContext(
"scalar (wrapper)", 0);
9594 __pyx_r = __pyx_pf_8PyClical_8clifford_62scalar(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
9597 __Pyx_RefNannyFinishContext();
9601 static PyObject *__pyx_pf_8PyClical_8clifford_62scalar(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
9602 PyObject *__pyx_r = NULL;
9603 __Pyx_RefNannyDeclarations
9604 PyObject *__pyx_t_1 = NULL;
9605 __Pyx_RefNannySetupContext(
"scalar", 0);
9614 __Pyx_XDECREF(__pyx_r);
9615 __pyx_t_1 =
PyFloat_FromDouble(__pyx_v_self->instance->scalar());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1047, __pyx_L1_error)
9616 __Pyx_GOTREF(__pyx_t_1);
9617 __pyx_r = __pyx_t_1;
9631 __Pyx_XDECREF(__pyx_t_1);
9632 __Pyx_AddTraceback(
"PyClical.clifford.scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
9635 __Pyx_XGIVEREF(__pyx_r);
9636 __Pyx_RefNannyFinishContext();
9649 static PyObject *__pyx_pw_8PyClical_8clifford_65pure(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9650 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 ";
9651 static PyObject *__pyx_pw_8PyClical_8clifford_65pure(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9652 PyObject *__pyx_r = 0;
9653 __Pyx_RefNannyDeclarations
9654 __Pyx_RefNannySetupContext(
"pure (wrapper)", 0);
9655 __pyx_r = __pyx_pf_8PyClical_8clifford_64pure(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
9658 __Pyx_RefNannyFinishContext();
9662 static PyObject *__pyx_pf_8PyClical_8clifford_64pure(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
9663 PyObject *__pyx_r = NULL;
9664 __Pyx_RefNannyDeclarations
9665 PyObject *__pyx_t_1 = NULL;
9666 PyObject *__pyx_t_2 = NULL;
9667 __Pyx_RefNannySetupContext(
"pure", 0);
9676 __Pyx_XDECREF(__pyx_r);
9677 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1058, __pyx_L1_error)
9678 __Pyx_GOTREF(__pyx_t_1);
9679 __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)
9680 __Pyx_GOTREF(__pyx_t_2);
9681 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9682 __pyx_r = __pyx_t_2;
9696 __Pyx_XDECREF(__pyx_t_1);
9697 __Pyx_XDECREF(__pyx_t_2);
9698 __Pyx_AddTraceback(
"PyClical.clifford.pure", __pyx_clineno, __pyx_lineno, __pyx_filename);
9701 __Pyx_XGIVEREF(__pyx_r);
9702 __Pyx_RefNannyFinishContext();
9715 static PyObject *__pyx_pw_8PyClical_8clifford_67even(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9716 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 ";
9717 static PyObject *__pyx_pw_8PyClical_8clifford_67even(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9718 PyObject *__pyx_r = 0;
9719 __Pyx_RefNannyDeclarations
9720 __Pyx_RefNannySetupContext(
"even (wrapper)", 0);
9721 __pyx_r = __pyx_pf_8PyClical_8clifford_66even(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
9724 __Pyx_RefNannyFinishContext();
9728 static PyObject *__pyx_pf_8PyClical_8clifford_66even(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
9729 PyObject *__pyx_r = NULL;
9730 __Pyx_RefNannyDeclarations
9731 PyObject *__pyx_t_1 = NULL;
9732 PyObject *__pyx_t_2 = NULL;
9733 __Pyx_RefNannySetupContext(
"even", 0);
9742 __Pyx_XDECREF(__pyx_r);
9743 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1067, __pyx_L1_error)
9744 __Pyx_GOTREF(__pyx_t_1);
9745 __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)
9746 __Pyx_GOTREF(__pyx_t_2);
9747 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9748 __pyx_r = __pyx_t_2;
9762 __Pyx_XDECREF(__pyx_t_1);
9763 __Pyx_XDECREF(__pyx_t_2);
9764 __Pyx_AddTraceback(
"PyClical.clifford.even", __pyx_clineno, __pyx_lineno, __pyx_filename);
9767 __Pyx_XGIVEREF(__pyx_r);
9768 __Pyx_RefNannyFinishContext();
9781 static PyObject *__pyx_pw_8PyClical_8clifford_69odd(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9782 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 ";
9783 static PyObject *__pyx_pw_8PyClical_8clifford_69odd(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9784 PyObject *__pyx_r = 0;
9785 __Pyx_RefNannyDeclarations
9786 __Pyx_RefNannySetupContext(
"odd (wrapper)", 0);
9787 __pyx_r = __pyx_pf_8PyClical_8clifford_68odd(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
9790 __Pyx_RefNannyFinishContext();
9794 static PyObject *__pyx_pf_8PyClical_8clifford_68odd(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
9795 PyObject *__pyx_r = NULL;
9796 __Pyx_RefNannyDeclarations
9797 PyObject *__pyx_t_1 = NULL;
9798 PyObject *__pyx_t_2 = NULL;
9799 __Pyx_RefNannySetupContext(
"odd", 0);
9808 __Pyx_XDECREF(__pyx_r);
9809 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1076, __pyx_L1_error)
9810 __Pyx_GOTREF(__pyx_t_1);
9811 __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)
9812 __Pyx_GOTREF(__pyx_t_2);
9813 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9814 __pyx_r = __pyx_t_2;
9828 __Pyx_XDECREF(__pyx_t_1);
9829 __Pyx_XDECREF(__pyx_t_2);
9830 __Pyx_AddTraceback(
"PyClical.clifford.odd", __pyx_clineno, __pyx_lineno, __pyx_filename);
9833 __Pyx_XGIVEREF(__pyx_r);
9834 __Pyx_RefNannyFinishContext();
9847 static PyObject *__pyx_pw_8PyClical_8clifford_71vector_part(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
9848 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 ";
9849 static PyObject *__pyx_pw_8PyClical_8clifford_71vector_part(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9850 PyObject *__pyx_v_frm = 0;
9851 PyObject *__pyx_r = 0;
9852 __Pyx_RefNannyDeclarations
9853 __Pyx_RefNannySetupContext(
"vector_part (wrapper)", 0);
9855 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frm,0};
9856 PyObject* values[1] = {0};
9857 values[0] = ((PyObject *)Py_None);
9858 if (unlikely(__pyx_kwds)) {
9860 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9862 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9865 default:
goto __pyx_L5_argtuple_error;
9867 kw_args = PyDict_Size(__pyx_kwds);
9871 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_frm);
9872 if (value) { values[0] = value; kw_args--; }
9875 if (unlikely(kw_args > 0)) {
9876 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"vector_part") < 0)) __PYX_ERR(0, 1078, __pyx_L3_error)
9879 switch (PyTuple_GET_SIZE(__pyx_args)) {
9880 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9883 default:
goto __pyx_L5_argtuple_error;
9886 __pyx_v_frm = values[0];
9888 goto __pyx_L4_argument_unpacking_done;
9889 __pyx_L5_argtuple_error:;
9890 __Pyx_RaiseArgtupleInvalid(
"vector_part", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1078, __pyx_L3_error)
9892 __Pyx_AddTraceback(
"PyClical.clifford.vector_part", __pyx_clineno, __pyx_lineno, __pyx_filename);
9893 __Pyx_RefNannyFinishContext();
9895 __pyx_L4_argument_unpacking_done:;
9896 __pyx_r = __pyx_pf_8PyClical_8clifford_70vector_part(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), __pyx_v_frm);
9899 __Pyx_RefNannyFinishContext();
9903 static PyObject *__pyx_pf_8PyClical_8clifford_70vector_part(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_frm) {
9904 PyObject *__pyx_v_error_msg_prefix = NULL;
9905 std::vector<scalar_t> __pyx_v_vec;
9908 PyObject *__pyx_v_lst = NULL;
9909 PyObject *__pyx_v_err = NULL;
9910 PyObject *__pyx_r = NULL;
9911 __Pyx_RefNannyDeclarations
9912 PyObject *__pyx_t_1 = NULL;
9913 PyObject *__pyx_t_2 = NULL;
9914 PyObject *__pyx_t_3 = NULL;
9917 std::vector<scalar_t> __pyx_t_6;
9918 PyObject *__pyx_t_7 = NULL;
9922 PyObject *__pyx_t_11 = NULL;
9923 PyObject *__pyx_t_12 = NULL;
9924 PyObject *__pyx_t_13 = NULL;
9925 PyObject *__pyx_t_14 = NULL;
9926 PyObject *__pyx_t_15 = NULL;
9927 __Pyx_RefNannySetupContext(
"vector_part", 0);
9936 __Pyx_INCREF(__pyx_kp_s_Cannot_take_vector_part_of);
9937 __pyx_v_error_msg_prefix = __pyx_kp_s_Cannot_take_vector_part_of;
9947 __Pyx_PyThreadState_declare
9948 __Pyx_PyThreadState_assign
9949 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
9950 __Pyx_XGOTREF(__pyx_t_1);
9951 __Pyx_XGOTREF(__pyx_t_2);
9952 __Pyx_XGOTREF(__pyx_t_3);
9962 __pyx_t_4 = (__pyx_v_frm == Py_None);
9963 __pyx_t_5 = (__pyx_t_4 != 0);
9973 __pyx_t_6 = __pyx_v_self->instance->vector_part();
9974 __pyx_v_vec = __pyx_t_6;
9995 __pyx_t_6 = __pyx_v_self->instance->vector_part(__pyx_f_8PyClical_9index_set_unwrap(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_frm)));
9997 __Pyx_CppExn2PyErr();
9998 __PYX_ERR(0, 1095, __pyx_L3_error)
10000 __pyx_v_vec = __pyx_t_6;
10011 __pyx_v_n = __pyx_v_vec.size();
10020 __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)
10021 __Pyx_GOTREF(__pyx_t_7);
10022 { Py_ssize_t __pyx_temp;
10023 for (__pyx_temp=0; __pyx_temp < __pyx_v_n; __pyx_temp++) {
10024 __Pyx_INCREF(__pyx_float_0_0);
10025 __Pyx_GIVEREF(__pyx_float_0_0);
10026 PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_float_0_0);
10029 __pyx_v_lst = ((PyObject*)__pyx_t_7);
10039 __pyx_t_8 = __pyx_v_n;
10040 __pyx_t_9 = __pyx_t_8;
10041 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
10042 __pyx_v_i = __pyx_t_10;
10051 __pyx_t_7 =
PyFloat_FromDouble((__pyx_v_vec[__pyx_v_i]));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1099, __pyx_L3_error)
10052 __Pyx_GOTREF(__pyx_t_7);
10053 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)
10054 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10064 __Pyx_XDECREF(__pyx_r);
10065 __Pyx_INCREF(__pyx_v_lst);
10066 __pyx_r = __pyx_v_lst;
10067 goto __pyx_L7_try_return;
10078 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10087 __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
10089 __Pyx_AddTraceback(
"PyClical.clifford.vector_part", __pyx_clineno, __pyx_lineno, __pyx_filename);
10090 if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_11, &__pyx_t_12) < 0) __PYX_ERR(0, 1101, __pyx_L5_except_error)
10091 __Pyx_GOTREF(__pyx_t_7);
10092 __Pyx_GOTREF(__pyx_t_11);
10093 __Pyx_GOTREF(__pyx_t_12);
10094 __Pyx_INCREF(__pyx_t_11);
10095 __pyx_v_err = __pyx_t_11;
10104 __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)
10105 __Pyx_GOTREF(__pyx_t_13);
10106 __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)
10107 __Pyx_GOTREF(__pyx_t_14);
10108 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
10109 __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)
10110 __Pyx_GOTREF(__pyx_t_13);
10111 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
10120 __pyx_t_14 = PyObject_Repr(__pyx_v_frm);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1103, __pyx_L5_except_error)
10121 __Pyx_GOTREF(__pyx_t_14);
10122 __pyx_t_15 = PyNumber_Add(__pyx_t_13, __pyx_t_14);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1103, __pyx_L5_except_error)
10123 __Pyx_GOTREF(__pyx_t_15);
10124 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
10125 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
10126 __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)
10127 __Pyx_GOTREF(__pyx_t_14);
10128 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
10137 __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)
10138 __Pyx_GOTREF(__pyx_t_15);
10139 __pyx_t_13 = PyNumber_Add(__pyx_t_14, __pyx_t_15);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1104, __pyx_L5_except_error)
10140 __Pyx_GOTREF(__pyx_t_13);
10141 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
10142 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
10151 __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)
10152 __Pyx_GOTREF(__pyx_t_15);
10153 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
10154 __Pyx_Raise(__pyx_t_15, 0, 0, 0);
10155 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
10156 __PYX_ERR(0, 1102, __pyx_L5_except_error)
10158 goto __pyx_L5_except_error;
10159 __pyx_L5_except_error:;
10168 __Pyx_XGIVEREF(__pyx_t_1);
10169 __Pyx_XGIVEREF(__pyx_t_2);
10170 __Pyx_XGIVEREF(__pyx_t_3);
10171 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
10172 goto __pyx_L1_error;
10173 __pyx_L7_try_return:;
10174 __Pyx_XGIVEREF(__pyx_t_1);
10175 __Pyx_XGIVEREF(__pyx_t_2);
10176 __Pyx_XGIVEREF(__pyx_t_3);
10177 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
10191 __Pyx_XDECREF(__pyx_t_7);
10192 __Pyx_XDECREF(__pyx_t_11);
10193 __Pyx_XDECREF(__pyx_t_12);
10194 __Pyx_XDECREF(__pyx_t_13);
10195 __Pyx_XDECREF(__pyx_t_14);
10196 __Pyx_XDECREF(__pyx_t_15);
10197 __Pyx_AddTraceback(
"PyClical.clifford.vector_part", __pyx_clineno, __pyx_lineno, __pyx_filename);
10200 __Pyx_XDECREF(__pyx_v_error_msg_prefix);
10201 __Pyx_XDECREF(__pyx_v_lst);
10202 __Pyx_XDECREF(__pyx_v_err);
10203 __Pyx_XGIVEREF(__pyx_r);
10204 __Pyx_RefNannyFinishContext();
10217 static PyObject *__pyx_pw_8PyClical_8clifford_73involute(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10218 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 ";
10219 static PyObject *__pyx_pw_8PyClical_8clifford_73involute(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10220 PyObject *__pyx_r = 0;
10221 __Pyx_RefNannyDeclarations
10222 __Pyx_RefNannySetupContext(
"involute (wrapper)", 0);
10223 __pyx_r = __pyx_pf_8PyClical_8clifford_72involute(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10226 __Pyx_RefNannyFinishContext();
10230 static PyObject *__pyx_pf_8PyClical_8clifford_72involute(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10231 PyObject *__pyx_r = NULL;
10232 __Pyx_RefNannyDeclarations
10233 PyObject *__pyx_t_1 = NULL;
10234 PyObject *__pyx_t_2 = NULL;
10235 __Pyx_RefNannySetupContext(
"involute", 0);
10244 __Pyx_XDECREF(__pyx_r);
10245 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1120, __pyx_L1_error)
10246 __Pyx_GOTREF(__pyx_t_1);
10247 __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)
10248 __Pyx_GOTREF(__pyx_t_2);
10249 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10250 __pyx_r = __pyx_t_2;
10264 __Pyx_XDECREF(__pyx_t_1);
10265 __Pyx_XDECREF(__pyx_t_2);
10266 __Pyx_AddTraceback(
"PyClical.clifford.involute", __pyx_clineno, __pyx_lineno, __pyx_filename);
10269 __Pyx_XGIVEREF(__pyx_r);
10270 __Pyx_RefNannyFinishContext();
10283 static PyObject *__pyx_pw_8PyClical_8clifford_75reverse(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10284 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 ";
10285 static PyObject *__pyx_pw_8PyClical_8clifford_75reverse(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10286 PyObject *__pyx_r = 0;
10287 __Pyx_RefNannyDeclarations
10288 __Pyx_RefNannySetupContext(
"reverse (wrapper)", 0);
10289 __pyx_r = __pyx_pf_8PyClical_8clifford_74reverse(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10292 __Pyx_RefNannyFinishContext();
10296 static PyObject *__pyx_pf_8PyClical_8clifford_74reverse(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10297 PyObject *__pyx_r = NULL;
10298 __Pyx_RefNannyDeclarations
10299 PyObject *__pyx_t_1 = NULL;
10300 PyObject *__pyx_t_2 = NULL;
10301 __Pyx_RefNannySetupContext(
"reverse", 0);
10310 __Pyx_XDECREF(__pyx_r);
10311 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1135, __pyx_L1_error)
10312 __Pyx_GOTREF(__pyx_t_1);
10313 __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)
10314 __Pyx_GOTREF(__pyx_t_2);
10315 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10316 __pyx_r = __pyx_t_2;
10330 __Pyx_XDECREF(__pyx_t_1);
10331 __Pyx_XDECREF(__pyx_t_2);
10332 __Pyx_AddTraceback(
"PyClical.clifford.reverse", __pyx_clineno, __pyx_lineno, __pyx_filename);
10335 __Pyx_XGIVEREF(__pyx_r);
10336 __Pyx_RefNannyFinishContext();
10349 static PyObject *__pyx_pw_8PyClical_8clifford_77conj(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10350 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 ";
10351 static PyObject *__pyx_pw_8PyClical_8clifford_77conj(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10352 PyObject *__pyx_r = 0;
10353 __Pyx_RefNannyDeclarations
10354 __Pyx_RefNannySetupContext(
"conj (wrapper)", 0);
10355 __pyx_r = __pyx_pf_8PyClical_8clifford_76conj(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10358 __Pyx_RefNannyFinishContext();
10362 static PyObject *__pyx_pf_8PyClical_8clifford_76conj(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10363 PyObject *__pyx_r = NULL;
10364 __Pyx_RefNannyDeclarations
10365 PyObject *__pyx_t_1 = NULL;
10366 PyObject *__pyx_t_2 = NULL;
10367 __Pyx_RefNannySetupContext(
"conj", 0);
10376 __Pyx_XDECREF(__pyx_r);
10377 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1150, __pyx_L1_error)
10378 __Pyx_GOTREF(__pyx_t_1);
10379 __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)
10380 __Pyx_GOTREF(__pyx_t_2);
10381 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10382 __pyx_r = __pyx_t_2;
10396 __Pyx_XDECREF(__pyx_t_1);
10397 __Pyx_XDECREF(__pyx_t_2);
10398 __Pyx_AddTraceback(
"PyClical.clifford.conj", __pyx_clineno, __pyx_lineno, __pyx_filename);
10401 __Pyx_XGIVEREF(__pyx_r);
10402 __Pyx_RefNannyFinishContext();
10415 static PyObject *__pyx_pw_8PyClical_8clifford_79quad(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10416 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 ";
10417 static PyObject *__pyx_pw_8PyClical_8clifford_79quad(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10418 PyObject *__pyx_r = 0;
10419 __Pyx_RefNannyDeclarations
10420 __Pyx_RefNannySetupContext(
"quad (wrapper)", 0);
10421 __pyx_r = __pyx_pf_8PyClical_8clifford_78quad(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10424 __Pyx_RefNannyFinishContext();
10428 static PyObject *__pyx_pf_8PyClical_8clifford_78quad(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10429 PyObject *__pyx_r = NULL;
10430 __Pyx_RefNannyDeclarations
10431 PyObject *__pyx_t_1 = NULL;
10432 __Pyx_RefNannySetupContext(
"quad", 0);
10441 __Pyx_XDECREF(__pyx_r);
10442 __pyx_t_1 =
PyFloat_FromDouble(__pyx_v_self->instance->quad());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1161, __pyx_L1_error)
10443 __Pyx_GOTREF(__pyx_t_1);
10444 __pyx_r = __pyx_t_1;
10458 __Pyx_XDECREF(__pyx_t_1);
10459 __Pyx_AddTraceback(
"PyClical.clifford.quad", __pyx_clineno, __pyx_lineno, __pyx_filename);
10462 __Pyx_XGIVEREF(__pyx_r);
10463 __Pyx_RefNannyFinishContext();
10476 static PyObject *__pyx_pw_8PyClical_8clifford_81norm(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10477 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 ";
10478 static PyObject *__pyx_pw_8PyClical_8clifford_81norm(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10479 PyObject *__pyx_r = 0;
10480 __Pyx_RefNannyDeclarations
10481 __Pyx_RefNannySetupContext(
"norm (wrapper)", 0);
10482 __pyx_r = __pyx_pf_8PyClical_8clifford_80norm(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10485 __Pyx_RefNannyFinishContext();
10489 static PyObject *__pyx_pf_8PyClical_8clifford_80norm(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10490 PyObject *__pyx_r = NULL;
10491 __Pyx_RefNannyDeclarations
10492 PyObject *__pyx_t_1 = NULL;
10493 __Pyx_RefNannySetupContext(
"norm", 0);
10502 __Pyx_XDECREF(__pyx_r);
10503 __pyx_t_1 =
PyFloat_FromDouble(__pyx_v_self->instance->norm());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1172, __pyx_L1_error)
10504 __Pyx_GOTREF(__pyx_t_1);
10505 __pyx_r = __pyx_t_1;
10519 __Pyx_XDECREF(__pyx_t_1);
10520 __Pyx_AddTraceback(
"PyClical.clifford.norm", __pyx_clineno, __pyx_lineno, __pyx_filename);
10523 __Pyx_XGIVEREF(__pyx_r);
10524 __Pyx_RefNannyFinishContext();
10537 static PyObject *__pyx_pw_8PyClical_8clifford_83abs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10538 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 ";
10539 static PyObject *__pyx_pw_8PyClical_8clifford_83abs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10540 PyObject *__pyx_r = 0;
10541 __Pyx_RefNannyDeclarations
10542 __Pyx_RefNannySetupContext(
"abs (wrapper)", 0);
10543 __pyx_r = __pyx_pf_8PyClical_8clifford_82abs(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10546 __Pyx_RefNannyFinishContext();
10550 static PyObject *__pyx_pf_8PyClical_8clifford_82abs(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10551 PyObject *__pyx_r = NULL;
10552 __Pyx_RefNannyDeclarations
10553 PyObject *__pyx_t_1 = NULL;
10554 __Pyx_RefNannySetupContext(
"abs", 0);
10563 __Pyx_XDECREF(__pyx_r);
10564 __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)
10565 __Pyx_GOTREF(__pyx_t_1);
10566 __pyx_r = __pyx_t_1;
10580 __Pyx_XDECREF(__pyx_t_1);
10581 __Pyx_AddTraceback(
"PyClical.clifford.abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
10584 __Pyx_XGIVEREF(__pyx_r);
10585 __Pyx_RefNannyFinishContext();
10598 static PyObject *__pyx_pw_8PyClical_8clifford_85max_abs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10599 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 ";
10600 static PyObject *__pyx_pw_8PyClical_8clifford_85max_abs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10601 PyObject *__pyx_r = 0;
10602 __Pyx_RefNannyDeclarations
10603 __Pyx_RefNannySetupContext(
"max_abs (wrapper)", 0);
10604 __pyx_r = __pyx_pf_8PyClical_8clifford_84max_abs(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10607 __Pyx_RefNannyFinishContext();
10611 static PyObject *__pyx_pf_8PyClical_8clifford_84max_abs(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10612 PyObject *__pyx_r = NULL;
10613 __Pyx_RefNannyDeclarations
10614 PyObject *__pyx_t_1 = NULL;
10615 __Pyx_RefNannySetupContext(
"max_abs", 0);
10624 __Pyx_XDECREF(__pyx_r);
10625 __pyx_t_1 =
PyFloat_FromDouble(__pyx_v_self->instance->max_abs());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1192, __pyx_L1_error)
10626 __Pyx_GOTREF(__pyx_t_1);
10627 __pyx_r = __pyx_t_1;
10641 __Pyx_XDECREF(__pyx_t_1);
10642 __Pyx_AddTraceback(
"PyClical.clifford.max_abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
10645 __Pyx_XGIVEREF(__pyx_r);
10646 __Pyx_RefNannyFinishContext();
10659 static PyObject *__pyx_pw_8PyClical_8clifford_87truncated(PyObject *__pyx_v_self, PyObject *__pyx_v_limit);
10660 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 ";
10661 static PyObject *__pyx_pw_8PyClical_8clifford_87truncated(PyObject *__pyx_v_self, PyObject *__pyx_v_limit) {
10662 PyObject *__pyx_r = 0;
10663 __Pyx_RefNannyDeclarations
10664 __Pyx_RefNannySetupContext(
"truncated (wrapper)", 0);
10665 __pyx_r = __pyx_pf_8PyClical_8clifford_86truncated(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_limit));
10668 __Pyx_RefNannyFinishContext();
10672 static PyObject *__pyx_pf_8PyClical_8clifford_86truncated(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_limit) {
10673 PyObject *__pyx_r = NULL;
10674 __Pyx_RefNannyDeclarations
10675 PyObject *__pyx_t_1 = NULL;
10677 PyObject *__pyx_t_3 = NULL;
10678 __Pyx_RefNannySetupContext(
"truncated", 0);
10687 __Pyx_XDECREF(__pyx_r);
10688 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1203, __pyx_L1_error)
10689 __Pyx_GOTREF(__pyx_t_1);
10690 __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)
10691 __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)
10692 __Pyx_GOTREF(__pyx_t_3);
10693 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10694 __pyx_r = __pyx_t_3;
10708 __Pyx_XDECREF(__pyx_t_1);
10709 __Pyx_XDECREF(__pyx_t_3);
10710 __Pyx_AddTraceback(
"PyClical.clifford.truncated", __pyx_clineno, __pyx_lineno, __pyx_filename);
10713 __Pyx_XGIVEREF(__pyx_r);
10714 __Pyx_RefNannyFinishContext();
10727 static PyObject *__pyx_pw_8PyClical_8clifford_89isnan(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10728 static char __pyx_doc_8PyClical_8clifford_88isnan[] =
"\n Check if a multivector contains any IEEE NaN values.\n\n >>> clifford().isnan()\n False\n ";
10729 static PyObject *__pyx_pw_8PyClical_8clifford_89isnan(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10730 PyObject *__pyx_r = 0;
10731 __Pyx_RefNannyDeclarations
10732 __Pyx_RefNannySetupContext(
"isnan (wrapper)", 0);
10733 __pyx_r = __pyx_pf_8PyClical_8clifford_88isnan(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10736 __Pyx_RefNannyFinishContext();
10740 static PyObject *__pyx_pf_8PyClical_8clifford_88isnan(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10741 PyObject *__pyx_r = NULL;
10742 __Pyx_RefNannyDeclarations
10743 PyObject *__pyx_t_1 = NULL;
10744 __Pyx_RefNannySetupContext(
"isnan", 0);
10753 __Pyx_XDECREF(__pyx_r);
10754 __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->instance->isnan());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1212, __pyx_L1_error)
10755 __Pyx_GOTREF(__pyx_t_1);
10756 __pyx_r = __pyx_t_1;
10770 __Pyx_XDECREF(__pyx_t_1);
10771 __Pyx_AddTraceback(
"PyClical.clifford.isnan", __pyx_clineno, __pyx_lineno, __pyx_filename);
10774 __Pyx_XGIVEREF(__pyx_r);
10775 __Pyx_RefNannyFinishContext();
10788 static PyObject *__pyx_pw_8PyClical_8clifford_91frame(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10789 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 ";
10790 static PyObject *__pyx_pw_8PyClical_8clifford_91frame(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10791 PyObject *__pyx_r = 0;
10792 __Pyx_RefNannyDeclarations
10793 __Pyx_RefNannySetupContext(
"frame (wrapper)", 0);
10794 __pyx_r = __pyx_pf_8PyClical_8clifford_90frame(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10797 __Pyx_RefNannyFinishContext();
10801 static PyObject *__pyx_pf_8PyClical_8clifford_90frame(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10802 PyObject *__pyx_r = NULL;
10803 __Pyx_RefNannyDeclarations
10804 PyObject *__pyx_t_1 = NULL;
10805 PyObject *__pyx_t_2 = NULL;
10806 __Pyx_RefNannySetupContext(
"frame", 0);
10815 __Pyx_XDECREF(__pyx_r);
10816 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_index_set));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1223, __pyx_L1_error)
10817 __Pyx_GOTREF(__pyx_t_1);
10818 __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)
10819 __Pyx_GOTREF(__pyx_t_2);
10820 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10821 __pyx_r = __pyx_t_2;
10835 __Pyx_XDECREF(__pyx_t_1);
10836 __Pyx_XDECREF(__pyx_t_2);
10837 __Pyx_AddTraceback(
"PyClical.clifford.frame", __pyx_clineno, __pyx_lineno, __pyx_filename);
10840 __Pyx_XGIVEREF(__pyx_r);
10841 __Pyx_RefNannyFinishContext();
10854 static PyObject *__pyx_pw_8PyClical_8clifford_93__repr__(PyObject *__pyx_v_self);
10855 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 ";
10856 #if CYTHON_COMPILING_IN_CPYTHON 10857 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_92__repr__;
10859 static PyObject *__pyx_pw_8PyClical_8clifford_93__repr__(PyObject *__pyx_v_self) {
10860 PyObject *__pyx_r = 0;
10861 __Pyx_RefNannyDeclarations
10862 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
10863 __pyx_r = __pyx_pf_8PyClical_8clifford_92__repr__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10866 __Pyx_RefNannyFinishContext();
10870 static PyObject *__pyx_pf_8PyClical_8clifford_92__repr__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10871 PyObject *__pyx_r = NULL;
10872 __Pyx_RefNannyDeclarations
10873 PyObject *__pyx_t_1 = NULL;
10874 __Pyx_RefNannySetupContext(
"__repr__", 0);
10883 __Pyx_XDECREF(__pyx_r);
10884 __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)
10885 __Pyx_GOTREF(__pyx_t_1);
10886 __pyx_r = __pyx_t_1;
10900 __Pyx_XDECREF(__pyx_t_1);
10901 __Pyx_AddTraceback(
"PyClical.clifford.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10904 __Pyx_XGIVEREF(__pyx_r);
10905 __Pyx_RefNannyFinishContext();
10918 static PyObject *__pyx_pw_8PyClical_8clifford_95__str__(PyObject *__pyx_v_self);
10919 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 ";
10920 #if CYTHON_COMPILING_IN_CPYTHON 10921 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_94__str__;
10923 static PyObject *__pyx_pw_8PyClical_8clifford_95__str__(PyObject *__pyx_v_self) {
10924 PyObject *__pyx_r = 0;
10925 __Pyx_RefNannyDeclarations
10926 __Pyx_RefNannySetupContext(
"__str__ (wrapper)", 0);
10927 __pyx_r = __pyx_pf_8PyClical_8clifford_94__str__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10930 __Pyx_RefNannyFinishContext();
10934 static PyObject *__pyx_pf_8PyClical_8clifford_94__str__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10935 PyObject *__pyx_r = NULL;
10936 __Pyx_RefNannyDeclarations
10937 PyObject *__pyx_t_1 = NULL;
10938 __Pyx_RefNannySetupContext(
"__str__", 0);
10947 __Pyx_XDECREF(__pyx_r);
10948 __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)
10949 __Pyx_GOTREF(__pyx_t_1);
10950 __pyx_r = __pyx_t_1;
10964 __Pyx_XDECREF(__pyx_t_1);
10965 __Pyx_AddTraceback(
"PyClical.clifford.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10968 __Pyx_XGIVEREF(__pyx_r);
10969 __Pyx_RefNannyFinishContext();
10980 static PyObject *__pyx_pw_8PyClical_8clifford_97__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10981 static PyObject *__pyx_pw_8PyClical_8clifford_97__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10982 PyObject *__pyx_r = 0;
10983 __Pyx_RefNannyDeclarations
10984 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
10985 __pyx_r = __pyx_pf_8PyClical_8clifford_96__reduce_cython__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10988 __Pyx_RefNannyFinishContext();
10992 static PyObject *__pyx_pf_8PyClical_8clifford_96__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10993 PyObject *__pyx_r = NULL;
10994 __Pyx_RefNannyDeclarations
10995 PyObject *__pyx_t_1 = NULL;
10996 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
11004 __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)
11005 __Pyx_GOTREF(__pyx_t_1);
11006 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
11007 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11008 __PYX_ERR(1, 2, __pyx_L1_error)
11018 __Pyx_XDECREF(__pyx_t_1);
11019 __Pyx_AddTraceback(
"PyClical.clifford.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11021 __Pyx_XGIVEREF(__pyx_r);
11022 __Pyx_RefNannyFinishContext();
11034 static PyObject *__pyx_pw_8PyClical_8clifford_99__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
11035 static PyObject *__pyx_pw_8PyClical_8clifford_99__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
11036 PyObject *__pyx_r = 0;
11037 __Pyx_RefNannyDeclarations
11038 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
11039 __pyx_r = __pyx_pf_8PyClical_8clifford_98__setstate_cython__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
11042 __Pyx_RefNannyFinishContext();
11046 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) {
11047 PyObject *__pyx_r = NULL;
11048 __Pyx_RefNannyDeclarations
11049 PyObject *__pyx_t_1 = NULL;
11050 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
11057 __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)
11058 __Pyx_GOTREF(__pyx_t_1);
11059 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
11060 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11061 __PYX_ERR(1, 4, __pyx_L1_error)
11072 __Pyx_XDECREF(__pyx_t_1);
11073 __Pyx_AddTraceback(
"PyClical.clifford.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11075 __Pyx_XGIVEREF(__pyx_r);
11076 __Pyx_RefNannyFinishContext();
11089 static PyObject *__pyx_pw_8PyClical_9clifford_hidden_doctests(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused);
11090 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 ";
11091 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};
11092 static PyObject *__pyx_pw_8PyClical_9clifford_hidden_doctests(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
11093 PyObject *__pyx_r = 0;
11094 __Pyx_RefNannyDeclarations
11095 __Pyx_RefNannySetupContext(
"clifford_hidden_doctests (wrapper)", 0);
11096 __pyx_r = __pyx_pf_8PyClical_8clifford_hidden_doctests(__pyx_self);
11099 __Pyx_RefNannyFinishContext();
11103 static PyObject *__pyx_pf_8PyClical_8clifford_hidden_doctests(CYTHON_UNUSED PyObject *__pyx_self) {
11104 PyObject *__pyx_r = NULL;
11105 __Pyx_RefNannyDeclarations
11106 __Pyx_RefNannySetupContext(
"clifford_hidden_doctests", 0);
11115 __Pyx_XDECREF(__pyx_r);
11116 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11129 __Pyx_XGIVEREF(__pyx_r);
11130 __Pyx_RefNannyFinishContext();
11142 static PyObject *__pyx_pw_8PyClical_11inv(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11143 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_inv(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11144 PyObject *__pyx_r = NULL;
11145 __Pyx_RefNannyDeclarations
11146 PyObject *__pyx_t_1 = NULL;
11147 PyObject *__pyx_t_2 = NULL;
11148 PyObject *__pyx_t_3 = NULL;
11149 __Pyx_RefNannySetupContext(
"inv", 0);
11158 __Pyx_XDECREF(__pyx_r);
11159 __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)
11160 __Pyx_GOTREF(__pyx_t_2);
11161 __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)
11162 __Pyx_GOTREF(__pyx_t_3);
11163 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11165 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11166 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11167 if (likely(__pyx_t_2)) {
11168 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
11169 __Pyx_INCREF(__pyx_t_2);
11170 __Pyx_INCREF(
function);
11171 __Pyx_DECREF_SET(__pyx_t_3,
function);
11174 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
11175 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11176 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1342, __pyx_L1_error)
11177 __Pyx_GOTREF(__pyx_t_1);
11178 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11179 __pyx_r = __pyx_t_1;
11193 __Pyx_XDECREF(__pyx_t_1);
11194 __Pyx_XDECREF(__pyx_t_2);
11195 __Pyx_XDECREF(__pyx_t_3);
11196 __Pyx_AddTraceback(
"PyClical.inv", __pyx_clineno, __pyx_lineno, __pyx_filename);
11199 __Pyx_XGIVEREF(__pyx_r);
11200 __Pyx_RefNannyFinishContext();
11205 static PyObject *__pyx_pw_8PyClical_11inv(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11206 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 ";
11207 static PyObject *__pyx_pw_8PyClical_11inv(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11208 PyObject *__pyx_r = 0;
11209 __Pyx_RefNannyDeclarations
11210 __Pyx_RefNannySetupContext(
"inv (wrapper)", 0);
11211 __pyx_r = __pyx_pf_8PyClical_10inv(__pyx_self, ((PyObject *)__pyx_v_obj));
11214 __Pyx_RefNannyFinishContext();
11218 static PyObject *__pyx_pf_8PyClical_10inv(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11219 PyObject *__pyx_r = NULL;
11220 __Pyx_RefNannyDeclarations
11221 PyObject *__pyx_t_1 = NULL;
11222 __Pyx_RefNannySetupContext(
"inv", 0);
11223 __Pyx_XDECREF(__pyx_r);
11224 __pyx_t_1 = __pyx_f_8PyClical_inv(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1329, __pyx_L1_error)
11225 __Pyx_GOTREF(__pyx_t_1);
11226 __pyx_r = __pyx_t_1;
11232 __Pyx_XDECREF(__pyx_t_1);
11233 __Pyx_AddTraceback(
"PyClical.inv", __pyx_clineno, __pyx_lineno, __pyx_filename);
11236 __Pyx_XGIVEREF(__pyx_r);
11237 __Pyx_RefNannyFinishContext();
11249 static PyObject *__pyx_pw_8PyClical_13scalar(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11250 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_scalar(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11251 PyObject *__pyx_r = NULL;
11252 __Pyx_RefNannyDeclarations
11253 PyObject *__pyx_t_1 = NULL;
11254 PyObject *__pyx_t_2 = NULL;
11255 PyObject *__pyx_t_3 = NULL;
11256 __Pyx_RefNannySetupContext(
"scalar", 0);
11265 __Pyx_XDECREF(__pyx_r);
11266 __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)
11267 __Pyx_GOTREF(__pyx_t_2);
11268 __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)
11269 __Pyx_GOTREF(__pyx_t_3);
11270 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11272 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11273 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11274 if (likely(__pyx_t_2)) {
11275 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
11276 __Pyx_INCREF(__pyx_t_2);
11277 __Pyx_INCREF(
function);
11278 __Pyx_DECREF_SET(__pyx_t_3,
function);
11281 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
11282 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11283 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1353, __pyx_L1_error)
11284 __Pyx_GOTREF(__pyx_t_1);
11285 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11286 __pyx_r = __pyx_t_1;
11300 __Pyx_XDECREF(__pyx_t_1);
11301 __Pyx_XDECREF(__pyx_t_2);
11302 __Pyx_XDECREF(__pyx_t_3);
11303 __Pyx_AddTraceback(
"PyClical.scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
11306 __Pyx_XGIVEREF(__pyx_r);
11307 __Pyx_RefNannyFinishContext();
11312 static PyObject *__pyx_pw_8PyClical_13scalar(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11313 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 ";
11314 static PyObject *__pyx_pw_8PyClical_13scalar(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11315 PyObject *__pyx_r = 0;
11316 __Pyx_RefNannyDeclarations
11317 __Pyx_RefNannySetupContext(
"scalar (wrapper)", 0);
11318 __pyx_r = __pyx_pf_8PyClical_12scalar(__pyx_self, ((PyObject *)__pyx_v_obj));
11321 __Pyx_RefNannyFinishContext();
11325 static PyObject *__pyx_pf_8PyClical_12scalar(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11326 PyObject *__pyx_r = NULL;
11327 __Pyx_RefNannyDeclarations
11328 PyObject *__pyx_t_1 = NULL;
11329 __Pyx_RefNannySetupContext(
"scalar", 0);
11330 __Pyx_XDECREF(__pyx_r);
11331 __pyx_t_1 = __pyx_f_8PyClical_scalar(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1344, __pyx_L1_error)
11332 __Pyx_GOTREF(__pyx_t_1);
11333 __pyx_r = __pyx_t_1;
11339 __Pyx_XDECREF(__pyx_t_1);
11340 __Pyx_AddTraceback(
"PyClical.scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
11343 __Pyx_XGIVEREF(__pyx_r);
11344 __Pyx_RefNannyFinishContext();
11356 static PyObject *__pyx_pw_8PyClical_15real(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11357 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_real(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11358 PyObject *__pyx_r = NULL;
11359 __Pyx_RefNannyDeclarations
11360 PyObject *__pyx_t_1 = NULL;
11361 PyObject *__pyx_t_2 = NULL;
11362 PyObject *__pyx_t_3 = NULL;
11363 __Pyx_RefNannySetupContext(
"real", 0);
11372 __Pyx_XDECREF(__pyx_r);
11373 __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)
11374 __Pyx_GOTREF(__pyx_t_2);
11375 __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)
11376 __Pyx_GOTREF(__pyx_t_3);
11377 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11379 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11380 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11381 if (likely(__pyx_t_2)) {
11382 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
11383 __Pyx_INCREF(__pyx_t_2);
11384 __Pyx_INCREF(
function);
11385 __Pyx_DECREF_SET(__pyx_t_3,
function);
11388 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
11389 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11390 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1364, __pyx_L1_error)
11391 __Pyx_GOTREF(__pyx_t_1);
11392 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11393 __pyx_r = __pyx_t_1;
11407 __Pyx_XDECREF(__pyx_t_1);
11408 __Pyx_XDECREF(__pyx_t_2);
11409 __Pyx_XDECREF(__pyx_t_3);
11410 __Pyx_AddTraceback(
"PyClical.real", __pyx_clineno, __pyx_lineno, __pyx_filename);
11413 __Pyx_XGIVEREF(__pyx_r);
11414 __Pyx_RefNannyFinishContext();
11419 static PyObject *__pyx_pw_8PyClical_15real(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11420 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 ";
11421 static PyObject *__pyx_pw_8PyClical_15real(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11422 PyObject *__pyx_r = 0;
11423 __Pyx_RefNannyDeclarations
11424 __Pyx_RefNannySetupContext(
"real (wrapper)", 0);
11425 __pyx_r = __pyx_pf_8PyClical_14real(__pyx_self, ((PyObject *)__pyx_v_obj));
11428 __Pyx_RefNannyFinishContext();
11432 static PyObject *__pyx_pf_8PyClical_14real(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11433 PyObject *__pyx_r = NULL;
11434 __Pyx_RefNannyDeclarations
11435 PyObject *__pyx_t_1 = NULL;
11436 __Pyx_RefNannySetupContext(
"real", 0);
11437 __Pyx_XDECREF(__pyx_r);
11438 __pyx_t_1 = __pyx_f_8PyClical_real(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1355, __pyx_L1_error)
11439 __Pyx_GOTREF(__pyx_t_1);
11440 __pyx_r = __pyx_t_1;
11446 __Pyx_XDECREF(__pyx_t_1);
11447 __Pyx_AddTraceback(
"PyClical.real", __pyx_clineno, __pyx_lineno, __pyx_filename);
11450 __Pyx_XGIVEREF(__pyx_r);
11451 __Pyx_RefNannyFinishContext();
11463 static PyObject *__pyx_pw_8PyClical_17imag(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11464 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_imag(CYTHON_UNUSED PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11465 PyObject *__pyx_r = NULL;
11466 __Pyx_RefNannyDeclarations
11467 __Pyx_RefNannySetupContext(
"imag", 0);
11476 __Pyx_XDECREF(__pyx_r);
11477 __Pyx_INCREF(__pyx_float_0_0);
11478 __pyx_r = __pyx_float_0_0;
11491 __Pyx_XGIVEREF(__pyx_r);
11492 __Pyx_RefNannyFinishContext();
11497 static PyObject *__pyx_pw_8PyClical_17imag(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11498 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 ";
11499 static PyObject *__pyx_pw_8PyClical_17imag(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11500 PyObject *__pyx_r = 0;
11501 __Pyx_RefNannyDeclarations
11502 __Pyx_RefNannySetupContext(
"imag (wrapper)", 0);
11503 __pyx_r = __pyx_pf_8PyClical_16imag(__pyx_self, ((PyObject *)__pyx_v_obj));
11506 __Pyx_RefNannyFinishContext();
11510 static PyObject *__pyx_pf_8PyClical_16imag(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11511 PyObject *__pyx_r = NULL;
11512 __Pyx_RefNannyDeclarations
11513 PyObject *__pyx_t_1 = NULL;
11514 __Pyx_RefNannySetupContext(
"imag", 0);
11515 __Pyx_XDECREF(__pyx_r);
11516 __pyx_t_1 = __pyx_f_8PyClical_imag(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1366, __pyx_L1_error)
11517 __Pyx_GOTREF(__pyx_t_1);
11518 __pyx_r = __pyx_t_1;
11524 __Pyx_XDECREF(__pyx_t_1);
11525 __Pyx_AddTraceback(
"PyClical.imag", __pyx_clineno, __pyx_lineno, __pyx_filename);
11528 __Pyx_XGIVEREF(__pyx_r);
11529 __Pyx_RefNannyFinishContext();
11541 static PyObject *__pyx_pw_8PyClical_19pure(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11542 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_pure(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11543 PyObject *__pyx_r = NULL;
11544 __Pyx_RefNannyDeclarations
11545 PyObject *__pyx_t_1 = NULL;
11546 PyObject *__pyx_t_2 = NULL;
11547 PyObject *__pyx_t_3 = NULL;
11548 __Pyx_RefNannySetupContext(
"pure", 0);
11557 __Pyx_XDECREF(__pyx_r);
11558 __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)
11559 __Pyx_GOTREF(__pyx_t_2);
11560 __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)
11561 __Pyx_GOTREF(__pyx_t_3);
11562 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11564 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11565 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11566 if (likely(__pyx_t_2)) {
11567 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
11568 __Pyx_INCREF(__pyx_t_2);
11569 __Pyx_INCREF(
function);
11570 __Pyx_DECREF_SET(__pyx_t_3,
function);
11573 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
11574 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11575 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1386, __pyx_L1_error)
11576 __Pyx_GOTREF(__pyx_t_1);
11577 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11578 __pyx_r = __pyx_t_1;
11592 __Pyx_XDECREF(__pyx_t_1);
11593 __Pyx_XDECREF(__pyx_t_2);
11594 __Pyx_XDECREF(__pyx_t_3);
11595 __Pyx_AddTraceback(
"PyClical.pure", __pyx_clineno, __pyx_lineno, __pyx_filename);
11598 __Pyx_XGIVEREF(__pyx_r);
11599 __Pyx_RefNannyFinishContext();
11604 static PyObject *__pyx_pw_8PyClical_19pure(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11605 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 ";
11606 static PyObject *__pyx_pw_8PyClical_19pure(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11607 PyObject *__pyx_r = 0;
11608 __Pyx_RefNannyDeclarations
11609 __Pyx_RefNannySetupContext(
"pure (wrapper)", 0);
11610 __pyx_r = __pyx_pf_8PyClical_18pure(__pyx_self, ((PyObject *)__pyx_v_obj));
11613 __Pyx_RefNannyFinishContext();
11617 static PyObject *__pyx_pf_8PyClical_18pure(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11618 PyObject *__pyx_r = NULL;
11619 __Pyx_RefNannyDeclarations
11620 PyObject *__pyx_t_1 = NULL;
11621 __Pyx_RefNannySetupContext(
"pure", 0);
11622 __Pyx_XDECREF(__pyx_r);
11623 __pyx_t_1 = __pyx_f_8PyClical_pure(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1377, __pyx_L1_error)
11624 __Pyx_GOTREF(__pyx_t_1);
11625 __pyx_r = __pyx_t_1;
11631 __Pyx_XDECREF(__pyx_t_1);
11632 __Pyx_AddTraceback(
"PyClical.pure", __pyx_clineno, __pyx_lineno, __pyx_filename);
11635 __Pyx_XGIVEREF(__pyx_r);
11636 __Pyx_RefNannyFinishContext();
11648 static PyObject *__pyx_pw_8PyClical_21even(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11649 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_even(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11650 PyObject *__pyx_r = NULL;
11651 __Pyx_RefNannyDeclarations
11652 PyObject *__pyx_t_1 = NULL;
11653 PyObject *__pyx_t_2 = NULL;
11654 PyObject *__pyx_t_3 = NULL;
11655 __Pyx_RefNannySetupContext(
"even", 0);
11664 __Pyx_XDECREF(__pyx_r);
11665 __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)
11666 __Pyx_GOTREF(__pyx_t_2);
11667 __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)
11668 __Pyx_GOTREF(__pyx_t_3);
11669 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11671 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11672 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11673 if (likely(__pyx_t_2)) {
11674 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
11675 __Pyx_INCREF(__pyx_t_2);
11676 __Pyx_INCREF(
function);
11677 __Pyx_DECREF_SET(__pyx_t_3,
function);
11680 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
11681 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11682 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1395, __pyx_L1_error)
11683 __Pyx_GOTREF(__pyx_t_1);
11684 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11685 __pyx_r = __pyx_t_1;
11699 __Pyx_XDECREF(__pyx_t_1);
11700 __Pyx_XDECREF(__pyx_t_2);
11701 __Pyx_XDECREF(__pyx_t_3);
11702 __Pyx_AddTraceback(
"PyClical.even", __pyx_clineno, __pyx_lineno, __pyx_filename);
11705 __Pyx_XGIVEREF(__pyx_r);
11706 __Pyx_RefNannyFinishContext();
11711 static PyObject *__pyx_pw_8PyClical_21even(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11712 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 ";
11713 static PyObject *__pyx_pw_8PyClical_21even(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11714 PyObject *__pyx_r = 0;
11715 __Pyx_RefNannyDeclarations
11716 __Pyx_RefNannySetupContext(
"even (wrapper)", 0);
11717 __pyx_r = __pyx_pf_8PyClical_20even(__pyx_self, ((PyObject *)__pyx_v_obj));
11720 __Pyx_RefNannyFinishContext();
11724 static PyObject *__pyx_pf_8PyClical_20even(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11725 PyObject *__pyx_r = NULL;
11726 __Pyx_RefNannyDeclarations
11727 PyObject *__pyx_t_1 = NULL;
11728 __Pyx_RefNannySetupContext(
"even", 0);
11729 __Pyx_XDECREF(__pyx_r);
11730 __pyx_t_1 = __pyx_f_8PyClical_even(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1388, __pyx_L1_error)
11731 __Pyx_GOTREF(__pyx_t_1);
11732 __pyx_r = __pyx_t_1;
11738 __Pyx_XDECREF(__pyx_t_1);
11739 __Pyx_AddTraceback(
"PyClical.even", __pyx_clineno, __pyx_lineno, __pyx_filename);
11742 __Pyx_XGIVEREF(__pyx_r);
11743 __Pyx_RefNannyFinishContext();
11755 static PyObject *__pyx_pw_8PyClical_23odd(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11756 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_odd(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11757 PyObject *__pyx_r = NULL;
11758 __Pyx_RefNannyDeclarations
11759 PyObject *__pyx_t_1 = NULL;
11760 PyObject *__pyx_t_2 = NULL;
11761 PyObject *__pyx_t_3 = NULL;
11762 __Pyx_RefNannySetupContext(
"odd", 0);
11771 __Pyx_XDECREF(__pyx_r);
11772 __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)
11773 __Pyx_GOTREF(__pyx_t_2);
11774 __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)
11775 __Pyx_GOTREF(__pyx_t_3);
11776 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11778 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11779 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11780 if (likely(__pyx_t_2)) {
11781 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
11782 __Pyx_INCREF(__pyx_t_2);
11783 __Pyx_INCREF(
function);
11784 __Pyx_DECREF_SET(__pyx_t_3,
function);
11787 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
11788 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11789 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1404, __pyx_L1_error)
11790 __Pyx_GOTREF(__pyx_t_1);
11791 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11792 __pyx_r = __pyx_t_1;
11806 __Pyx_XDECREF(__pyx_t_1);
11807 __Pyx_XDECREF(__pyx_t_2);
11808 __Pyx_XDECREF(__pyx_t_3);
11809 __Pyx_AddTraceback(
"PyClical.odd", __pyx_clineno, __pyx_lineno, __pyx_filename);
11812 __Pyx_XGIVEREF(__pyx_r);
11813 __Pyx_RefNannyFinishContext();
11818 static PyObject *__pyx_pw_8PyClical_23odd(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11819 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 ";
11820 static PyObject *__pyx_pw_8PyClical_23odd(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11821 PyObject *__pyx_r = 0;
11822 __Pyx_RefNannyDeclarations
11823 __Pyx_RefNannySetupContext(
"odd (wrapper)", 0);
11824 __pyx_r = __pyx_pf_8PyClical_22odd(__pyx_self, ((PyObject *)__pyx_v_obj));
11827 __Pyx_RefNannyFinishContext();
11831 static PyObject *__pyx_pf_8PyClical_22odd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11832 PyObject *__pyx_r = NULL;
11833 __Pyx_RefNannyDeclarations
11834 PyObject *__pyx_t_1 = NULL;
11835 __Pyx_RefNannySetupContext(
"odd", 0);
11836 __Pyx_XDECREF(__pyx_r);
11837 __pyx_t_1 = __pyx_f_8PyClical_odd(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1397, __pyx_L1_error)
11838 __Pyx_GOTREF(__pyx_t_1);
11839 __pyx_r = __pyx_t_1;
11845 __Pyx_XDECREF(__pyx_t_1);
11846 __Pyx_AddTraceback(
"PyClical.odd", __pyx_clineno, __pyx_lineno, __pyx_filename);
11849 __Pyx_XGIVEREF(__pyx_r);
11850 __Pyx_RefNannyFinishContext();
11862 static PyObject *__pyx_pw_8PyClical_25involute(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11863 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_involute(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11864 PyObject *__pyx_r = NULL;
11865 __Pyx_RefNannyDeclarations
11866 PyObject *__pyx_t_1 = NULL;
11867 PyObject *__pyx_t_2 = NULL;
11868 PyObject *__pyx_t_3 = NULL;
11869 __Pyx_RefNannySetupContext(
"involute", 0);
11878 __Pyx_XDECREF(__pyx_r);
11879 __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)
11880 __Pyx_GOTREF(__pyx_t_2);
11881 __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)
11882 __Pyx_GOTREF(__pyx_t_3);
11883 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11885 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11886 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11887 if (likely(__pyx_t_2)) {
11888 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
11889 __Pyx_INCREF(__pyx_t_2);
11890 __Pyx_INCREF(
function);
11891 __Pyx_DECREF_SET(__pyx_t_3,
function);
11894 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
11895 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11896 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1419, __pyx_L1_error)
11897 __Pyx_GOTREF(__pyx_t_1);
11898 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11899 __pyx_r = __pyx_t_1;
11913 __Pyx_XDECREF(__pyx_t_1);
11914 __Pyx_XDECREF(__pyx_t_2);
11915 __Pyx_XDECREF(__pyx_t_3);
11916 __Pyx_AddTraceback(
"PyClical.involute", __pyx_clineno, __pyx_lineno, __pyx_filename);
11919 __Pyx_XGIVEREF(__pyx_r);
11920 __Pyx_RefNannyFinishContext();
11925 static PyObject *__pyx_pw_8PyClical_25involute(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11926 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 ";
11927 static PyObject *__pyx_pw_8PyClical_25involute(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11928 PyObject *__pyx_r = 0;
11929 __Pyx_RefNannyDeclarations
11930 __Pyx_RefNannySetupContext(
"involute (wrapper)", 0);
11931 __pyx_r = __pyx_pf_8PyClical_24involute(__pyx_self, ((PyObject *)__pyx_v_obj));
11934 __Pyx_RefNannyFinishContext();
11938 static PyObject *__pyx_pf_8PyClical_24involute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11939 PyObject *__pyx_r = NULL;
11940 __Pyx_RefNannyDeclarations
11941 PyObject *__pyx_t_1 = NULL;
11942 __Pyx_RefNannySetupContext(
"involute", 0);
11943 __Pyx_XDECREF(__pyx_r);
11944 __pyx_t_1 = __pyx_f_8PyClical_involute(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1406, __pyx_L1_error)
11945 __Pyx_GOTREF(__pyx_t_1);
11946 __pyx_r = __pyx_t_1;
11952 __Pyx_XDECREF(__pyx_t_1);
11953 __Pyx_AddTraceback(
"PyClical.involute", __pyx_clineno, __pyx_lineno, __pyx_filename);
11956 __Pyx_XGIVEREF(__pyx_r);
11957 __Pyx_RefNannyFinishContext();
11969 static PyObject *__pyx_pw_8PyClical_27reverse(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11970 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_reverse(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11971 PyObject *__pyx_r = NULL;
11972 __Pyx_RefNannyDeclarations
11973 PyObject *__pyx_t_1 = NULL;
11974 PyObject *__pyx_t_2 = NULL;
11975 PyObject *__pyx_t_3 = NULL;
11976 __Pyx_RefNannySetupContext(
"reverse", 0);
11985 __Pyx_XDECREF(__pyx_r);
11986 __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)
11987 __Pyx_GOTREF(__pyx_t_2);
11988 __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)
11989 __Pyx_GOTREF(__pyx_t_3);
11990 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11992 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11993 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11994 if (likely(__pyx_t_2)) {
11995 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
11996 __Pyx_INCREF(__pyx_t_2);
11997 __Pyx_INCREF(
function);
11998 __Pyx_DECREF_SET(__pyx_t_3,
function);
12001 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
12002 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12003 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1434, __pyx_L1_error)
12004 __Pyx_GOTREF(__pyx_t_1);
12005 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12006 __pyx_r = __pyx_t_1;
12020 __Pyx_XDECREF(__pyx_t_1);
12021 __Pyx_XDECREF(__pyx_t_2);
12022 __Pyx_XDECREF(__pyx_t_3);
12023 __Pyx_AddTraceback(
"PyClical.reverse", __pyx_clineno, __pyx_lineno, __pyx_filename);
12026 __Pyx_XGIVEREF(__pyx_r);
12027 __Pyx_RefNannyFinishContext();
12032 static PyObject *__pyx_pw_8PyClical_27reverse(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12033 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 ";
12034 static PyObject *__pyx_pw_8PyClical_27reverse(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12035 PyObject *__pyx_r = 0;
12036 __Pyx_RefNannyDeclarations
12037 __Pyx_RefNannySetupContext(
"reverse (wrapper)", 0);
12038 __pyx_r = __pyx_pf_8PyClical_26reverse(__pyx_self, ((PyObject *)__pyx_v_obj));
12041 __Pyx_RefNannyFinishContext();
12045 static PyObject *__pyx_pf_8PyClical_26reverse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12046 PyObject *__pyx_r = NULL;
12047 __Pyx_RefNannyDeclarations
12048 PyObject *__pyx_t_1 = NULL;
12049 __Pyx_RefNannySetupContext(
"reverse", 0);
12050 __Pyx_XDECREF(__pyx_r);
12051 __pyx_t_1 = __pyx_f_8PyClical_reverse(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1421, __pyx_L1_error)
12052 __Pyx_GOTREF(__pyx_t_1);
12053 __pyx_r = __pyx_t_1;
12059 __Pyx_XDECREF(__pyx_t_1);
12060 __Pyx_AddTraceback(
"PyClical.reverse", __pyx_clineno, __pyx_lineno, __pyx_filename);
12063 __Pyx_XGIVEREF(__pyx_r);
12064 __Pyx_RefNannyFinishContext();
12076 static PyObject *__pyx_pw_8PyClical_29conj(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12077 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_conj(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12078 PyObject *__pyx_r = NULL;
12079 __Pyx_RefNannyDeclarations
12080 PyObject *__pyx_t_1 = NULL;
12081 PyObject *__pyx_t_2 = NULL;
12082 PyObject *__pyx_t_3 = NULL;
12083 __Pyx_RefNannySetupContext(
"conj", 0);
12092 __Pyx_XDECREF(__pyx_r);
12093 __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)
12094 __Pyx_GOTREF(__pyx_t_2);
12095 __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)
12096 __Pyx_GOTREF(__pyx_t_3);
12097 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12099 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
12100 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
12101 if (likely(__pyx_t_2)) {
12102 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
12103 __Pyx_INCREF(__pyx_t_2);
12104 __Pyx_INCREF(
function);
12105 __Pyx_DECREF_SET(__pyx_t_3,
function);
12108 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
12109 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12110 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1449, __pyx_L1_error)
12111 __Pyx_GOTREF(__pyx_t_1);
12112 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12113 __pyx_r = __pyx_t_1;
12127 __Pyx_XDECREF(__pyx_t_1);
12128 __Pyx_XDECREF(__pyx_t_2);
12129 __Pyx_XDECREF(__pyx_t_3);
12130 __Pyx_AddTraceback(
"PyClical.conj", __pyx_clineno, __pyx_lineno, __pyx_filename);
12133 __Pyx_XGIVEREF(__pyx_r);
12134 __Pyx_RefNannyFinishContext();
12139 static PyObject *__pyx_pw_8PyClical_29conj(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12140 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 ";
12141 static PyObject *__pyx_pw_8PyClical_29conj(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12142 PyObject *__pyx_r = 0;
12143 __Pyx_RefNannyDeclarations
12144 __Pyx_RefNannySetupContext(
"conj (wrapper)", 0);
12145 __pyx_r = __pyx_pf_8PyClical_28conj(__pyx_self, ((PyObject *)__pyx_v_obj));
12148 __Pyx_RefNannyFinishContext();
12152 static PyObject *__pyx_pf_8PyClical_28conj(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12153 PyObject *__pyx_r = NULL;
12154 __Pyx_RefNannyDeclarations
12155 PyObject *__pyx_t_1 = NULL;
12156 __Pyx_RefNannySetupContext(
"conj", 0);
12157 __Pyx_XDECREF(__pyx_r);
12158 __pyx_t_1 = __pyx_f_8PyClical_conj(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1436, __pyx_L1_error)
12159 __Pyx_GOTREF(__pyx_t_1);
12160 __pyx_r = __pyx_t_1;
12166 __Pyx_XDECREF(__pyx_t_1);
12167 __Pyx_AddTraceback(
"PyClical.conj", __pyx_clineno, __pyx_lineno, __pyx_filename);
12170 __Pyx_XGIVEREF(__pyx_r);
12171 __Pyx_RefNannyFinishContext();
12183 static PyObject *__pyx_pw_8PyClical_31quad(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12184 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_quad(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12185 PyObject *__pyx_r = NULL;
12186 __Pyx_RefNannyDeclarations
12187 PyObject *__pyx_t_1 = NULL;
12188 PyObject *__pyx_t_2 = NULL;
12189 PyObject *__pyx_t_3 = NULL;
12190 __Pyx_RefNannySetupContext(
"quad", 0);
12199 __Pyx_XDECREF(__pyx_r);
12200 __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)
12201 __Pyx_GOTREF(__pyx_t_2);
12202 __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)
12203 __Pyx_GOTREF(__pyx_t_3);
12204 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12206 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
12207 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
12208 if (likely(__pyx_t_2)) {
12209 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
12210 __Pyx_INCREF(__pyx_t_2);
12211 __Pyx_INCREF(
function);
12212 __Pyx_DECREF_SET(__pyx_t_3,
function);
12215 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
12216 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12217 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1460, __pyx_L1_error)
12218 __Pyx_GOTREF(__pyx_t_1);
12219 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12220 __pyx_r = __pyx_t_1;
12234 __Pyx_XDECREF(__pyx_t_1);
12235 __Pyx_XDECREF(__pyx_t_2);
12236 __Pyx_XDECREF(__pyx_t_3);
12237 __Pyx_AddTraceback(
"PyClical.quad", __pyx_clineno, __pyx_lineno, __pyx_filename);
12240 __Pyx_XGIVEREF(__pyx_r);
12241 __Pyx_RefNannyFinishContext();
12246 static PyObject *__pyx_pw_8PyClical_31quad(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12247 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 ";
12248 static PyObject *__pyx_pw_8PyClical_31quad(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12249 PyObject *__pyx_r = 0;
12250 __Pyx_RefNannyDeclarations
12251 __Pyx_RefNannySetupContext(
"quad (wrapper)", 0);
12252 __pyx_r = __pyx_pf_8PyClical_30quad(__pyx_self, ((PyObject *)__pyx_v_obj));
12255 __Pyx_RefNannyFinishContext();
12259 static PyObject *__pyx_pf_8PyClical_30quad(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12260 PyObject *__pyx_r = NULL;
12261 __Pyx_RefNannyDeclarations
12262 PyObject *__pyx_t_1 = NULL;
12263 __Pyx_RefNannySetupContext(
"quad", 0);
12264 __Pyx_XDECREF(__pyx_r);
12265 __pyx_t_1 = __pyx_f_8PyClical_quad(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1451, __pyx_L1_error)
12266 __Pyx_GOTREF(__pyx_t_1);
12267 __pyx_r = __pyx_t_1;
12273 __Pyx_XDECREF(__pyx_t_1);
12274 __Pyx_AddTraceback(
"PyClical.quad", __pyx_clineno, __pyx_lineno, __pyx_filename);
12277 __Pyx_XGIVEREF(__pyx_r);
12278 __Pyx_RefNannyFinishContext();
12290 static PyObject *__pyx_pw_8PyClical_33norm(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12291 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_norm(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12292 PyObject *__pyx_r = NULL;
12293 __Pyx_RefNannyDeclarations
12294 PyObject *__pyx_t_1 = NULL;
12295 PyObject *__pyx_t_2 = NULL;
12296 PyObject *__pyx_t_3 = NULL;
12297 __Pyx_RefNannySetupContext(
"norm", 0);
12306 __Pyx_XDECREF(__pyx_r);
12307 __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)
12308 __Pyx_GOTREF(__pyx_t_2);
12309 __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)
12310 __Pyx_GOTREF(__pyx_t_3);
12311 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12313 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
12314 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
12315 if (likely(__pyx_t_2)) {
12316 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
12317 __Pyx_INCREF(__pyx_t_2);
12318 __Pyx_INCREF(
function);
12319 __Pyx_DECREF_SET(__pyx_t_3,
function);
12322 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
12323 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12324 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1471, __pyx_L1_error)
12325 __Pyx_GOTREF(__pyx_t_1);
12326 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12327 __pyx_r = __pyx_t_1;
12341 __Pyx_XDECREF(__pyx_t_1);
12342 __Pyx_XDECREF(__pyx_t_2);
12343 __Pyx_XDECREF(__pyx_t_3);
12344 __Pyx_AddTraceback(
"PyClical.norm", __pyx_clineno, __pyx_lineno, __pyx_filename);
12347 __Pyx_XGIVEREF(__pyx_r);
12348 __Pyx_RefNannyFinishContext();
12353 static PyObject *__pyx_pw_8PyClical_33norm(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12354 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 ";
12355 static PyObject *__pyx_pw_8PyClical_33norm(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12356 PyObject *__pyx_r = 0;
12357 __Pyx_RefNannyDeclarations
12358 __Pyx_RefNannySetupContext(
"norm (wrapper)", 0);
12359 __pyx_r = __pyx_pf_8PyClical_32norm(__pyx_self, ((PyObject *)__pyx_v_obj));
12362 __Pyx_RefNannyFinishContext();
12366 static PyObject *__pyx_pf_8PyClical_32norm(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12367 PyObject *__pyx_r = NULL;
12368 __Pyx_RefNannyDeclarations
12369 PyObject *__pyx_t_1 = NULL;
12370 __Pyx_RefNannySetupContext(
"norm", 0);
12371 __Pyx_XDECREF(__pyx_r);
12372 __pyx_t_1 = __pyx_f_8PyClical_norm(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1462, __pyx_L1_error)
12373 __Pyx_GOTREF(__pyx_t_1);
12374 __pyx_r = __pyx_t_1;
12380 __Pyx_XDECREF(__pyx_t_1);
12381 __Pyx_AddTraceback(
"PyClical.norm", __pyx_clineno, __pyx_lineno, __pyx_filename);
12384 __Pyx_XGIVEREF(__pyx_r);
12385 __Pyx_RefNannyFinishContext();
12397 static PyObject *__pyx_pw_8PyClical_35abs(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12398 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_abs(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12399 PyObject *__pyx_r = NULL;
12400 __Pyx_RefNannyDeclarations
12401 PyObject *__pyx_t_1 = NULL;
12402 __Pyx_RefNannySetupContext(
"abs", 0);
12411 __Pyx_XDECREF(__pyx_r);
12412 __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)
12413 __Pyx_GOTREF(__pyx_t_1);
12414 __pyx_r = __pyx_t_1;
12428 __Pyx_XDECREF(__pyx_t_1);
12429 __Pyx_AddTraceback(
"PyClical.abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
12432 __Pyx_XGIVEREF(__pyx_r);
12433 __Pyx_RefNannyFinishContext();
12438 static PyObject *__pyx_pw_8PyClical_35abs(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12439 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 ";
12440 static PyObject *__pyx_pw_8PyClical_35abs(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12441 PyObject *__pyx_r = 0;
12442 __Pyx_RefNannyDeclarations
12443 __Pyx_RefNannySetupContext(
"abs (wrapper)", 0);
12444 __pyx_r = __pyx_pf_8PyClical_34abs(__pyx_self, ((PyObject *)__pyx_v_obj));
12447 __Pyx_RefNannyFinishContext();
12451 static PyObject *__pyx_pf_8PyClical_34abs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12452 PyObject *__pyx_r = NULL;
12453 __Pyx_RefNannyDeclarations
12454 PyObject *__pyx_t_1 = NULL;
12455 __Pyx_RefNannySetupContext(
"abs", 0);
12456 __Pyx_XDECREF(__pyx_r);
12457 __pyx_t_1 = __pyx_f_8PyClical_abs(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1473, __pyx_L1_error)
12458 __Pyx_GOTREF(__pyx_t_1);
12459 __pyx_r = __pyx_t_1;
12465 __Pyx_XDECREF(__pyx_t_1);
12466 __Pyx_AddTraceback(
"PyClical.abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
12469 __Pyx_XGIVEREF(__pyx_r);
12470 __Pyx_RefNannyFinishContext();
12482 static PyObject *__pyx_pw_8PyClical_37max_abs(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12483 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_max_abs(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12484 PyObject *__pyx_r = NULL;
12485 __Pyx_RefNannyDeclarations
12486 PyObject *__pyx_t_1 = NULL;
12487 __Pyx_RefNannySetupContext(
"max_abs", 0);
12496 __Pyx_XDECREF(__pyx_r);
12497 __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)
12498 __Pyx_GOTREF(__pyx_t_1);
12499 __pyx_r = __pyx_t_1;
12513 __Pyx_XDECREF(__pyx_t_1);
12514 __Pyx_AddTraceback(
"PyClical.max_abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
12517 __Pyx_XGIVEREF(__pyx_r);
12518 __Pyx_RefNannyFinishContext();
12523 static PyObject *__pyx_pw_8PyClical_37max_abs(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12524 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 ";
12525 static PyObject *__pyx_pw_8PyClical_37max_abs(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12526 PyObject *__pyx_r = 0;
12527 __Pyx_RefNannyDeclarations
12528 __Pyx_RefNannySetupContext(
"max_abs (wrapper)", 0);
12529 __pyx_r = __pyx_pf_8PyClical_36max_abs(__pyx_self, ((PyObject *)__pyx_v_obj));
12532 __Pyx_RefNannyFinishContext();
12536 static PyObject *__pyx_pf_8PyClical_36max_abs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12537 PyObject *__pyx_r = NULL;
12538 __Pyx_RefNannyDeclarations
12539 PyObject *__pyx_t_1 = NULL;
12540 __Pyx_RefNannySetupContext(
"max_abs", 0);
12541 __Pyx_XDECREF(__pyx_r);
12542 __pyx_t_1 = __pyx_f_8PyClical_max_abs(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1482, __pyx_L1_error)
12543 __Pyx_GOTREF(__pyx_t_1);
12544 __pyx_r = __pyx_t_1;
12550 __Pyx_XDECREF(__pyx_t_1);
12551 __Pyx_AddTraceback(
"PyClical.max_abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
12554 __Pyx_XGIVEREF(__pyx_r);
12555 __Pyx_RefNannyFinishContext();
12567 static PyObject *__pyx_pw_8PyClical_39pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
12568 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_pow(PyObject *__pyx_v_obj, PyObject *__pyx_v_m, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12569 PyObject *__pyx_r = NULL;
12570 __Pyx_RefNannyDeclarations
12571 PyObject *__pyx_t_1 = NULL;
12572 PyObject *__pyx_t_2 = NULL;
12573 PyObject *__pyx_t_3 = NULL;
12574 PyObject *__pyx_t_4 = NULL;
12575 PyObject *__pyx_t_5 = NULL;
12576 PyObject *__pyx_t_6 = NULL;
12578 PyObject *__pyx_t_8 = NULL;
12579 PyObject *__pyx_t_9 = NULL;
12580 PyObject *__pyx_t_10 = NULL;
12581 __Pyx_RefNannySetupContext(
"pow", 0);
12591 __Pyx_PyThreadState_declare
12592 __Pyx_PyThreadState_assign
12593 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
12594 __Pyx_XGOTREF(__pyx_t_1);
12595 __Pyx_XGOTREF(__pyx_t_2);
12596 __Pyx_XGOTREF(__pyx_t_3);
12606 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1514, __pyx_L3_error)
12607 __Pyx_GOTREF(__pyx_t_5);
12608 __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)
12609 __Pyx_GOTREF(__pyx_t_6);
12610 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12613 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
12614 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
12615 if (likely(__pyx_t_5)) {
12616 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
12617 __Pyx_INCREF(__pyx_t_5);
12618 __Pyx_INCREF(
function);
12619 __Pyx_DECREF_SET(__pyx_t_6,
function);
12623 #if CYTHON_FAST_PYCALL 12624 if (PyFunction_Check(__pyx_t_6)) {
12625 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_obj, __pyx_v_m};
12626 __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)
12627 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12628 __Pyx_GOTREF(__pyx_t_4);
12631 #if CYTHON_FAST_PYCCALL 12632 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
12633 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_obj, __pyx_v_m};
12634 __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)
12635 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12636 __Pyx_GOTREF(__pyx_t_4);
12640 __pyx_t_8 = PyTuple_New(2+__pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1514, __pyx_L3_error)
12641 __Pyx_GOTREF(__pyx_t_8);
12643 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
12645 __Pyx_INCREF(__pyx_v_obj);
12646 __Pyx_GIVEREF(__pyx_v_obj);
12647 PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_obj);
12648 __Pyx_INCREF(__pyx_v_m);
12649 __Pyx_GIVEREF(__pyx_v_m);
12650 PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_m);
12651 __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)
12652 __Pyx_GOTREF(__pyx_t_4);
12653 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12655 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12656 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12666 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12667 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12668 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12669 goto __pyx_L8_try_end;
12671 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12672 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12673 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12674 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
12684 __Pyx_AddTraceback(
"PyClical.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
12685 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_8) < 0) __PYX_ERR(0, 1515, __pyx_L5_except_error)
12686 __Pyx_GOTREF(__pyx_t_4);
12687 __Pyx_GOTREF(__pyx_t_6);
12688 __Pyx_GOTREF(__pyx_t_8);
12697 __Pyx_XDECREF(__pyx_r);
12698 __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)
12699 __Pyx_GOTREF(__pyx_t_9);
12700 __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)
12701 __Pyx_GOTREF(__pyx_t_10);
12702 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12704 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
12705 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
12706 if (likely(__pyx_t_9)) {
12707 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_10);
12708 __Pyx_INCREF(__pyx_t_9);
12709 __Pyx_INCREF(
function);
12710 __Pyx_DECREF_SET(__pyx_t_10,
function);
12713 __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);
12714 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
12715 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1516, __pyx_L5_except_error)
12716 __Pyx_GOTREF(__pyx_t_5);
12717 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12718 __pyx_r = __pyx_t_5;
12720 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12721 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12722 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12723 goto __pyx_L6_except_return;
12725 __pyx_L5_except_error:;
12734 __Pyx_XGIVEREF(__pyx_t_1);
12735 __Pyx_XGIVEREF(__pyx_t_2);
12736 __Pyx_XGIVEREF(__pyx_t_3);
12737 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
12738 goto __pyx_L1_error;
12739 __pyx_L6_except_return:;
12740 __Pyx_XGIVEREF(__pyx_t_1);
12741 __Pyx_XGIVEREF(__pyx_t_2);
12742 __Pyx_XGIVEREF(__pyx_t_3);
12743 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
12757 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12760 __Pyx_XDECREF(__pyx_t_4);
12761 __Pyx_XDECREF(__pyx_t_5);
12762 __Pyx_XDECREF(__pyx_t_6);
12763 __Pyx_XDECREF(__pyx_t_8);
12764 __Pyx_XDECREF(__pyx_t_9);
12765 __Pyx_XDECREF(__pyx_t_10);
12766 __Pyx_AddTraceback(
"PyClical.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
12769 __Pyx_XGIVEREF(__pyx_r);
12770 __Pyx_RefNannyFinishContext();
12775 static PyObject *__pyx_pw_8PyClical_39pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
12776 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 ";
12777 static PyObject *__pyx_pw_8PyClical_39pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
12778 PyObject *__pyx_v_obj = 0;
12779 PyObject *__pyx_v_m = 0;
12780 PyObject *__pyx_r = 0;
12781 __Pyx_RefNannyDeclarations
12782 __Pyx_RefNannySetupContext(
"pow (wrapper)", 0);
12784 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_m,0};
12785 PyObject* values[2] = {0,0};
12786 if (unlikely(__pyx_kwds)) {
12787 Py_ssize_t kw_args;
12788 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
12789 switch (pos_args) {
12790 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12791 CYTHON_FALLTHROUGH;
12792 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12793 CYTHON_FALLTHROUGH;
12795 default:
goto __pyx_L5_argtuple_error;
12797 kw_args = PyDict_Size(__pyx_kwds);
12798 switch (pos_args) {
12800 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
12801 else goto __pyx_L5_argtuple_error;
12802 CYTHON_FALLTHROUGH;
12804 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
12806 __Pyx_RaiseArgtupleInvalid(
"pow", 1, 2, 2, 1); __PYX_ERR(0, 1494, __pyx_L3_error)
12809 if (unlikely(kw_args > 0)) {
12810 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"pow") < 0)) __PYX_ERR(0, 1494, __pyx_L3_error)
12812 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
12813 goto __pyx_L5_argtuple_error;
12815 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12816 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12818 __pyx_v_obj = values[0];
12819 __pyx_v_m = values[1];
12821 goto __pyx_L4_argument_unpacking_done;
12822 __pyx_L5_argtuple_error:;
12823 __Pyx_RaiseArgtupleInvalid(
"pow", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1494, __pyx_L3_error)
12825 __Pyx_AddTraceback(
"PyClical.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
12826 __Pyx_RefNannyFinishContext();
12828 __pyx_L4_argument_unpacking_done:;
12829 __pyx_r = __pyx_pf_8PyClical_38pow(__pyx_self, __pyx_v_obj, __pyx_v_m);
12832 __Pyx_RefNannyFinishContext();
12836 static PyObject *__pyx_pf_8PyClical_38pow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_m) {
12837 PyObject *__pyx_r = NULL;
12838 __Pyx_RefNannyDeclarations
12839 PyObject *__pyx_t_1 = NULL;
12840 __Pyx_RefNannySetupContext(
"pow", 0);
12841 __Pyx_XDECREF(__pyx_r);
12842 __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)
12843 __Pyx_GOTREF(__pyx_t_1);
12844 __pyx_r = __pyx_t_1;
12850 __Pyx_XDECREF(__pyx_t_1);
12851 __Pyx_AddTraceback(
"PyClical.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
12854 __Pyx_XGIVEREF(__pyx_r);
12855 __Pyx_RefNannyFinishContext();
12867 static PyObject *__pyx_pw_8PyClical_41outer_pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
12868 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_outer_pow(PyObject *__pyx_v_obj, PyObject *__pyx_v_m, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12869 PyObject *__pyx_r = NULL;
12870 __Pyx_RefNannyDeclarations
12871 PyObject *__pyx_t_1 = NULL;
12872 PyObject *__pyx_t_2 = NULL;
12873 PyObject *__pyx_t_3 = NULL;
12874 __Pyx_RefNannySetupContext(
"outer_pow", 0);
12883 __Pyx_XDECREF(__pyx_r);
12884 __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)
12885 __Pyx_GOTREF(__pyx_t_2);
12886 __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)
12887 __Pyx_GOTREF(__pyx_t_3);
12888 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12890 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
12891 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
12892 if (likely(__pyx_t_2)) {
12893 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
12894 __Pyx_INCREF(__pyx_t_2);
12895 __Pyx_INCREF(
function);
12896 __Pyx_DECREF_SET(__pyx_t_3,
function);
12899 __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);
12900 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12901 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1525, __pyx_L1_error)
12902 __Pyx_GOTREF(__pyx_t_1);
12903 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12904 __pyx_r = __pyx_t_1;
12918 __Pyx_XDECREF(__pyx_t_1);
12919 __Pyx_XDECREF(__pyx_t_2);
12920 __Pyx_XDECREF(__pyx_t_3);
12921 __Pyx_AddTraceback(
"PyClical.outer_pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
12924 __Pyx_XGIVEREF(__pyx_r);
12925 __Pyx_RefNannyFinishContext();
12930 static PyObject *__pyx_pw_8PyClical_41outer_pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
12931 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 ";
12932 static PyObject *__pyx_pw_8PyClical_41outer_pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
12933 PyObject *__pyx_v_obj = 0;
12934 PyObject *__pyx_v_m = 0;
12935 PyObject *__pyx_r = 0;
12936 __Pyx_RefNannyDeclarations
12937 __Pyx_RefNannySetupContext(
"outer_pow (wrapper)", 0);
12939 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_m,0};
12940 PyObject* values[2] = {0,0};
12941 if (unlikely(__pyx_kwds)) {
12942 Py_ssize_t kw_args;
12943 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
12944 switch (pos_args) {
12945 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12946 CYTHON_FALLTHROUGH;
12947 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12948 CYTHON_FALLTHROUGH;
12950 default:
goto __pyx_L5_argtuple_error;
12952 kw_args = PyDict_Size(__pyx_kwds);
12953 switch (pos_args) {
12955 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
12956 else goto __pyx_L5_argtuple_error;
12957 CYTHON_FALLTHROUGH;
12959 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
12961 __Pyx_RaiseArgtupleInvalid(
"outer_pow", 1, 2, 2, 1); __PYX_ERR(0, 1518, __pyx_L3_error)
12964 if (unlikely(kw_args > 0)) {
12965 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"outer_pow") < 0)) __PYX_ERR(0, 1518, __pyx_L3_error)
12967 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
12968 goto __pyx_L5_argtuple_error;
12970 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12971 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12973 __pyx_v_obj = values[0];
12974 __pyx_v_m = values[1];
12976 goto __pyx_L4_argument_unpacking_done;
12977 __pyx_L5_argtuple_error:;
12978 __Pyx_RaiseArgtupleInvalid(
"outer_pow", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1518, __pyx_L3_error)
12980 __Pyx_AddTraceback(
"PyClical.outer_pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
12981 __Pyx_RefNannyFinishContext();
12983 __pyx_L4_argument_unpacking_done:;
12984 __pyx_r = __pyx_pf_8PyClical_40outer_pow(__pyx_self, __pyx_v_obj, __pyx_v_m);
12987 __Pyx_RefNannyFinishContext();
12991 static PyObject *__pyx_pf_8PyClical_40outer_pow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_m) {
12992 PyObject *__pyx_r = NULL;
12993 __Pyx_RefNannyDeclarations
12994 PyObject *__pyx_t_1 = NULL;
12995 __Pyx_RefNannySetupContext(
"outer_pow", 0);
12996 __Pyx_XDECREF(__pyx_r);
12997 __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)
12998 __Pyx_GOTREF(__pyx_t_1);
12999 __pyx_r = __pyx_t_1;
13005 __Pyx_XDECREF(__pyx_t_1);
13006 __Pyx_AddTraceback(
"PyClical.outer_pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
13009 __Pyx_XGIVEREF(__pyx_r);
13010 __Pyx_RefNannyFinishContext();
13022 static PyObject *__pyx_pw_8PyClical_43complexifier(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13023 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_complexifier(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
13024 PyObject *__pyx_r = NULL;
13025 __Pyx_RefNannyDeclarations
13026 PyObject *__pyx_t_1 = NULL;
13027 PyObject *__pyx_t_2 = NULL;
13028 __Pyx_RefNannySetupContext(
"complexifier", 0);
13037 __Pyx_XDECREF(__pyx_r);
13038 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1540, __pyx_L1_error)
13039 __Pyx_GOTREF(__pyx_t_1);
13040 __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)
13041 __Pyx_GOTREF(__pyx_t_2);
13042 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13043 __pyx_r = __pyx_t_2;
13057 __Pyx_XDECREF(__pyx_t_1);
13058 __Pyx_XDECREF(__pyx_t_2);
13059 __Pyx_AddTraceback(
"PyClical.complexifier", __pyx_clineno, __pyx_lineno, __pyx_filename);
13062 __Pyx_XGIVEREF(__pyx_r);
13063 __Pyx_RefNannyFinishContext();
13068 static PyObject *__pyx_pw_8PyClical_43complexifier(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13069 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 ";
13070 static PyObject *__pyx_pw_8PyClical_43complexifier(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13071 PyObject *__pyx_r = 0;
13072 __Pyx_RefNannyDeclarations
13073 __Pyx_RefNannySetupContext(
"complexifier (wrapper)", 0);
13074 __pyx_r = __pyx_pf_8PyClical_42complexifier(__pyx_self, ((PyObject *)__pyx_v_obj));
13077 __Pyx_RefNannyFinishContext();
13081 static PyObject *__pyx_pf_8PyClical_42complexifier(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13082 PyObject *__pyx_r = NULL;
13083 __Pyx_RefNannyDeclarations
13084 PyObject *__pyx_t_1 = NULL;
13085 __Pyx_RefNannySetupContext(
"complexifier", 0);
13086 __Pyx_XDECREF(__pyx_r);
13087 __pyx_t_1 = __pyx_f_8PyClical_complexifier(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1527, __pyx_L1_error)
13088 __Pyx_GOTREF(__pyx_t_1);
13089 __pyx_r = __pyx_t_1;
13095 __Pyx_XDECREF(__pyx_t_1);
13096 __Pyx_AddTraceback(
"PyClical.complexifier", __pyx_clineno, __pyx_lineno, __pyx_filename);
13099 __Pyx_XGIVEREF(__pyx_r);
13100 __Pyx_RefNannyFinishContext();
13112 static PyObject *__pyx_pw_8PyClical_45sqrt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13113 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) {
13114 PyObject *__pyx_v_i = ((PyObject *)Py_None);
13115 PyObject *__pyx_r = NULL;
13116 __Pyx_RefNannyDeclarations
13119 PyObject *__pyx_t_3 = NULL;
13121 PyObject *__pyx_t_5 = NULL;
13122 PyObject *__pyx_t_6 = NULL;
13123 PyObject *__pyx_t_7 = NULL;
13124 PyObject *__pyx_t_8 = NULL;
13125 PyObject *__pyx_t_9 = NULL;
13126 PyObject *__pyx_t_10 = NULL;
13127 PyObject *__pyx_t_11 = NULL;
13128 __Pyx_RefNannySetupContext(
"sqrt", 0);
13129 if (__pyx_optional_args) {
13130 if (__pyx_optional_args->__pyx_n > 0) {
13131 __pyx_v_i = __pyx_optional_args->i;
13142 __pyx_t_1 = (__pyx_v_i != Py_None);
13143 __pyx_t_2 = (__pyx_t_1 != 0);
13153 __Pyx_XDECREF(__pyx_r);
13154 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1558, __pyx_L1_error)
13155 __Pyx_GOTREF(__pyx_t_3);
13157 __pyx_t_4 =
sqrt(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
13159 __Pyx_CppExn2PyErr();
13160 __PYX_ERR(0, 1558, __pyx_L1_error)
13162 __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)
13163 __Pyx_GOTREF(__pyx_t_5);
13164 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13165 __pyx_r = __pyx_t_5;
13187 __Pyx_PyThreadState_declare
13188 __Pyx_PyThreadState_assign
13189 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
13190 __Pyx_XGOTREF(__pyx_t_6);
13191 __Pyx_XGOTREF(__pyx_t_7);
13192 __Pyx_XGOTREF(__pyx_t_8);
13202 __Pyx_XDECREF(__pyx_r);
13203 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1561, __pyx_L4_error)
13204 __Pyx_GOTREF(__pyx_t_3);
13205 __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)
13206 __Pyx_GOTREF(__pyx_t_9);
13207 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13209 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
13210 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
13211 if (likely(__pyx_t_3)) {
13212 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
13213 __Pyx_INCREF(__pyx_t_3);
13214 __Pyx_INCREF(
function);
13215 __Pyx_DECREF_SET(__pyx_t_9,
function);
13218 __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);
13219 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13220 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1561, __pyx_L4_error)
13221 __Pyx_GOTREF(__pyx_t_5);
13222 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13223 __pyx_r = __pyx_t_5;
13225 goto __pyx_L8_try_return;
13236 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13237 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13238 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
13248 __Pyx_AddTraceback(
"PyClical.sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename);
13249 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1562, __pyx_L6_except_error)
13250 __Pyx_GOTREF(__pyx_t_5);
13251 __Pyx_GOTREF(__pyx_t_9);
13252 __Pyx_GOTREF(__pyx_t_3);
13261 __Pyx_XDECREF(__pyx_r);
13262 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1563, __pyx_L6_except_error)
13263 __Pyx_GOTREF(__pyx_t_10);
13264 __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)
13265 __Pyx_GOTREF(__pyx_t_11);
13266 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13267 __pyx_r = __pyx_t_11;
13269 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13270 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13271 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13272 goto __pyx_L7_except_return;
13274 __pyx_L6_except_error:;
13283 __Pyx_XGIVEREF(__pyx_t_6);
13284 __Pyx_XGIVEREF(__pyx_t_7);
13285 __Pyx_XGIVEREF(__pyx_t_8);
13286 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
13287 goto __pyx_L1_error;
13288 __pyx_L8_try_return:;
13289 __Pyx_XGIVEREF(__pyx_t_6);
13290 __Pyx_XGIVEREF(__pyx_t_7);
13291 __Pyx_XGIVEREF(__pyx_t_8);
13292 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
13294 __pyx_L7_except_return:;
13295 __Pyx_XGIVEREF(__pyx_t_6);
13296 __Pyx_XGIVEREF(__pyx_t_7);
13297 __Pyx_XGIVEREF(__pyx_t_8);
13298 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
13313 __Pyx_XDECREF(__pyx_t_3);
13314 __Pyx_XDECREF(__pyx_t_5);
13315 __Pyx_XDECREF(__pyx_t_9);
13316 __Pyx_XDECREF(__pyx_t_10);
13317 __Pyx_XDECREF(__pyx_t_11);
13318 __Pyx_AddTraceback(
"PyClical.sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename);
13321 __Pyx_XGIVEREF(__pyx_r);
13322 __Pyx_RefNannyFinishContext();
13327 static PyObject *__pyx_pw_8PyClical_45sqrt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13328 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 ";
13329 static PyObject *__pyx_pw_8PyClical_45sqrt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13330 PyObject *__pyx_v_obj = 0;
13331 PyObject *__pyx_v_i = 0;
13332 PyObject *__pyx_r = 0;
13333 __Pyx_RefNannyDeclarations
13334 __Pyx_RefNannySetupContext(
"sqrt (wrapper)", 0);
13336 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
13337 PyObject* values[2] = {0,0};
13338 values[1] = ((PyObject *)Py_None);
13339 if (unlikely(__pyx_kwds)) {
13340 Py_ssize_t kw_args;
13341 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13342 switch (pos_args) {
13343 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13344 CYTHON_FALLTHROUGH;
13345 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13346 CYTHON_FALLTHROUGH;
13348 default:
goto __pyx_L5_argtuple_error;
13350 kw_args = PyDict_Size(__pyx_kwds);
13351 switch (pos_args) {
13353 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
13354 else goto __pyx_L5_argtuple_error;
13355 CYTHON_FALLTHROUGH;
13358 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
13359 if (value) { values[1] = value; kw_args--; }
13362 if (unlikely(kw_args > 0)) {
13363 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"sqrt") < 0)) __PYX_ERR(0, 1542, __pyx_L3_error)
13366 switch (PyTuple_GET_SIZE(__pyx_args)) {
13367 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13368 CYTHON_FALLTHROUGH;
13369 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13371 default:
goto __pyx_L5_argtuple_error;
13374 __pyx_v_obj = values[0];
13375 __pyx_v_i = values[1];
13377 goto __pyx_L4_argument_unpacking_done;
13378 __pyx_L5_argtuple_error:;
13379 __Pyx_RaiseArgtupleInvalid(
"sqrt", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1542, __pyx_L3_error)
13381 __Pyx_AddTraceback(
"PyClical.sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename);
13382 __Pyx_RefNannyFinishContext();
13384 __pyx_L4_argument_unpacking_done:;
13385 __pyx_r = __pyx_pf_8PyClical_44sqrt(__pyx_self, __pyx_v_obj, __pyx_v_i);
13388 __Pyx_RefNannyFinishContext();
13392 static PyObject *__pyx_pf_8PyClical_44sqrt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
13393 PyObject *__pyx_r = NULL;
13394 __Pyx_RefNannyDeclarations
13395 PyObject *__pyx_t_1 = NULL;
13396 struct __pyx_opt_args_8PyClical_sqrt __pyx_t_2;
13397 __Pyx_RefNannySetupContext(
"sqrt", 0);
13398 __Pyx_XDECREF(__pyx_r);
13399 __pyx_t_2.__pyx_n = 1;
13400 __pyx_t_2.i = __pyx_v_i;
13401 __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)
13402 __Pyx_GOTREF(__pyx_t_1);
13403 __pyx_r = __pyx_t_1;
13409 __Pyx_XDECREF(__pyx_t_1);
13410 __Pyx_AddTraceback(
"PyClical.sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename);
13413 __Pyx_XGIVEREF(__pyx_r);
13414 __Pyx_RefNannyFinishContext();
13426 static PyObject *__pyx_pw_8PyClical_47exp(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13427 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_exp(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
13428 PyObject *__pyx_r = NULL;
13429 __Pyx_RefNannyDeclarations
13430 PyObject *__pyx_t_1 = NULL;
13431 PyObject *__pyx_t_2 = NULL;
13432 PyObject *__pyx_t_3 = NULL;
13433 PyObject *__pyx_t_4 = NULL;
13434 PyObject *__pyx_t_5 = NULL;
13435 PyObject *__pyx_t_6 = NULL;
13436 PyObject *__pyx_t_7 = NULL;
13437 PyObject *__pyx_t_8 = NULL;
13438 __Pyx_RefNannySetupContext(
"exp", 0);
13448 __Pyx_PyThreadState_declare
13449 __Pyx_PyThreadState_assign
13450 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
13451 __Pyx_XGOTREF(__pyx_t_1);
13452 __Pyx_XGOTREF(__pyx_t_2);
13453 __Pyx_XGOTREF(__pyx_t_3);
13463 __Pyx_XDECREF(__pyx_r);
13464 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1575, __pyx_L3_error)
13465 __Pyx_GOTREF(__pyx_t_5);
13466 __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)
13467 __Pyx_GOTREF(__pyx_t_6);
13468 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13470 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
13471 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
13472 if (likely(__pyx_t_5)) {
13473 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
13474 __Pyx_INCREF(__pyx_t_5);
13475 __Pyx_INCREF(
function);
13476 __Pyx_DECREF_SET(__pyx_t_6,
function);
13479 __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);
13480 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13481 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1575, __pyx_L3_error)
13482 __Pyx_GOTREF(__pyx_t_4);
13483 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13484 __pyx_r = __pyx_t_4;
13486 goto __pyx_L7_try_return;
13497 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
13498 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13499 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
13509 __Pyx_AddTraceback(
"PyClical.exp", __pyx_clineno, __pyx_lineno, __pyx_filename);
13510 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(0, 1576, __pyx_L5_except_error)
13511 __Pyx_GOTREF(__pyx_t_4);
13512 __Pyx_GOTREF(__pyx_t_6);
13513 __Pyx_GOTREF(__pyx_t_5);
13522 __Pyx_XDECREF(__pyx_r);
13523 __pyx_t_7 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1577, __pyx_L5_except_error)
13524 __Pyx_GOTREF(__pyx_t_7);
13525 __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)
13526 __Pyx_GOTREF(__pyx_t_8);
13527 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13528 __pyx_r = __pyx_t_8;
13530 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13531 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13532 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13533 goto __pyx_L6_except_return;
13535 __pyx_L5_except_error:;
13544 __Pyx_XGIVEREF(__pyx_t_1);
13545 __Pyx_XGIVEREF(__pyx_t_2);
13546 __Pyx_XGIVEREF(__pyx_t_3);
13547 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
13548 goto __pyx_L1_error;
13549 __pyx_L7_try_return:;
13550 __Pyx_XGIVEREF(__pyx_t_1);
13551 __Pyx_XGIVEREF(__pyx_t_2);
13552 __Pyx_XGIVEREF(__pyx_t_3);
13553 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
13555 __pyx_L6_except_return:;
13556 __Pyx_XGIVEREF(__pyx_t_1);
13557 __Pyx_XGIVEREF(__pyx_t_2);
13558 __Pyx_XGIVEREF(__pyx_t_3);
13559 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
13573 __Pyx_XDECREF(__pyx_t_4);
13574 __Pyx_XDECREF(__pyx_t_5);
13575 __Pyx_XDECREF(__pyx_t_6);
13576 __Pyx_XDECREF(__pyx_t_7);
13577 __Pyx_XDECREF(__pyx_t_8);
13578 __Pyx_AddTraceback(
"PyClical.exp", __pyx_clineno, __pyx_lineno, __pyx_filename);
13581 __Pyx_XGIVEREF(__pyx_r);
13582 __Pyx_RefNannyFinishContext();
13587 static PyObject *__pyx_pw_8PyClical_47exp(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13588 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 ";
13589 static PyObject *__pyx_pw_8PyClical_47exp(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13590 PyObject *__pyx_r = 0;
13591 __Pyx_RefNannyDeclarations
13592 __Pyx_RefNannySetupContext(
"exp (wrapper)", 0);
13593 __pyx_r = __pyx_pf_8PyClical_46exp(__pyx_self, ((PyObject *)__pyx_v_obj));
13596 __Pyx_RefNannyFinishContext();
13600 static PyObject *__pyx_pf_8PyClical_46exp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13601 PyObject *__pyx_r = NULL;
13602 __Pyx_RefNannyDeclarations
13603 PyObject *__pyx_t_1 = NULL;
13604 __Pyx_RefNannySetupContext(
"exp", 0);
13605 __Pyx_XDECREF(__pyx_r);
13606 __pyx_t_1 = __pyx_f_8PyClical_exp(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1565, __pyx_L1_error)
13607 __Pyx_GOTREF(__pyx_t_1);
13608 __pyx_r = __pyx_t_1;
13614 __Pyx_XDECREF(__pyx_t_1);
13615 __Pyx_AddTraceback(
"PyClical.exp", __pyx_clineno, __pyx_lineno, __pyx_filename);
13618 __Pyx_XGIVEREF(__pyx_r);
13619 __Pyx_RefNannyFinishContext();
13631 static PyObject *__pyx_pw_8PyClical_49log(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13632 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) {
13633 PyObject *__pyx_v_i = ((PyObject *)Py_None);
13634 PyObject *__pyx_r = NULL;
13635 __Pyx_RefNannyDeclarations
13638 PyObject *__pyx_t_3 = NULL;
13640 PyObject *__pyx_t_5 = NULL;
13641 PyObject *__pyx_t_6 = NULL;
13642 PyObject *__pyx_t_7 = NULL;
13643 PyObject *__pyx_t_8 = NULL;
13644 PyObject *__pyx_t_9 = NULL;
13645 PyObject *__pyx_t_10 = NULL;
13646 PyObject *__pyx_t_11 = NULL;
13647 __Pyx_RefNannySetupContext(
"log", 0);
13648 if (__pyx_optional_args) {
13649 if (__pyx_optional_args->__pyx_n > 0) {
13650 __pyx_v_i = __pyx_optional_args->i;
13661 __pyx_t_1 = (__pyx_v_i != Py_None);
13662 __pyx_t_2 = (__pyx_t_1 != 0);
13672 __Pyx_XDECREF(__pyx_r);
13673 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1595, __pyx_L1_error)
13674 __Pyx_GOTREF(__pyx_t_3);
13676 __pyx_t_4 =
log(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
13678 __Pyx_CppExn2PyErr();
13679 __PYX_ERR(0, 1595, __pyx_L1_error)
13681 __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)
13682 __Pyx_GOTREF(__pyx_t_5);
13683 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13684 __pyx_r = __pyx_t_5;
13706 __Pyx_PyThreadState_declare
13707 __Pyx_PyThreadState_assign
13708 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
13709 __Pyx_XGOTREF(__pyx_t_6);
13710 __Pyx_XGOTREF(__pyx_t_7);
13711 __Pyx_XGOTREF(__pyx_t_8);
13721 __Pyx_XDECREF(__pyx_r);
13722 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1598, __pyx_L4_error)
13723 __Pyx_GOTREF(__pyx_t_3);
13724 __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)
13725 __Pyx_GOTREF(__pyx_t_9);
13726 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13728 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
13729 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
13730 if (likely(__pyx_t_3)) {
13731 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
13732 __Pyx_INCREF(__pyx_t_3);
13733 __Pyx_INCREF(
function);
13734 __Pyx_DECREF_SET(__pyx_t_9,
function);
13737 __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);
13738 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13739 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1598, __pyx_L4_error)
13740 __Pyx_GOTREF(__pyx_t_5);
13741 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13742 __pyx_r = __pyx_t_5;
13744 goto __pyx_L8_try_return;
13755 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13756 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13757 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
13767 __Pyx_AddTraceback(
"PyClical.log", __pyx_clineno, __pyx_lineno, __pyx_filename);
13768 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1599, __pyx_L6_except_error)
13769 __Pyx_GOTREF(__pyx_t_5);
13770 __Pyx_GOTREF(__pyx_t_9);
13771 __Pyx_GOTREF(__pyx_t_3);
13780 __Pyx_XDECREF(__pyx_r);
13781 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1600, __pyx_L6_except_error)
13782 __Pyx_GOTREF(__pyx_t_10);
13783 __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)
13784 __Pyx_GOTREF(__pyx_t_11);
13785 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13786 __pyx_r = __pyx_t_11;
13788 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13789 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13790 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13791 goto __pyx_L7_except_return;
13793 __pyx_L6_except_error:;
13802 __Pyx_XGIVEREF(__pyx_t_6);
13803 __Pyx_XGIVEREF(__pyx_t_7);
13804 __Pyx_XGIVEREF(__pyx_t_8);
13805 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
13806 goto __pyx_L1_error;
13807 __pyx_L8_try_return:;
13808 __Pyx_XGIVEREF(__pyx_t_6);
13809 __Pyx_XGIVEREF(__pyx_t_7);
13810 __Pyx_XGIVEREF(__pyx_t_8);
13811 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
13813 __pyx_L7_except_return:;
13814 __Pyx_XGIVEREF(__pyx_t_6);
13815 __Pyx_XGIVEREF(__pyx_t_7);
13816 __Pyx_XGIVEREF(__pyx_t_8);
13817 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
13832 __Pyx_XDECREF(__pyx_t_3);
13833 __Pyx_XDECREF(__pyx_t_5);
13834 __Pyx_XDECREF(__pyx_t_9);
13835 __Pyx_XDECREF(__pyx_t_10);
13836 __Pyx_XDECREF(__pyx_t_11);
13837 __Pyx_AddTraceback(
"PyClical.log", __pyx_clineno, __pyx_lineno, __pyx_filename);
13840 __Pyx_XGIVEREF(__pyx_r);
13841 __Pyx_RefNannyFinishContext();
13846 static PyObject *__pyx_pw_8PyClical_49log(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13847 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 ";
13848 static PyObject *__pyx_pw_8PyClical_49log(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13849 PyObject *__pyx_v_obj = 0;
13850 PyObject *__pyx_v_i = 0;
13851 PyObject *__pyx_r = 0;
13852 __Pyx_RefNannyDeclarations
13853 __Pyx_RefNannySetupContext(
"log (wrapper)", 0);
13855 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
13856 PyObject* values[2] = {0,0};
13857 values[1] = ((PyObject *)Py_None);
13858 if (unlikely(__pyx_kwds)) {
13859 Py_ssize_t kw_args;
13860 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13861 switch (pos_args) {
13862 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13863 CYTHON_FALLTHROUGH;
13864 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13865 CYTHON_FALLTHROUGH;
13867 default:
goto __pyx_L5_argtuple_error;
13869 kw_args = PyDict_Size(__pyx_kwds);
13870 switch (pos_args) {
13872 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
13873 else goto __pyx_L5_argtuple_error;
13874 CYTHON_FALLTHROUGH;
13877 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
13878 if (value) { values[1] = value; kw_args--; }
13881 if (unlikely(kw_args > 0)) {
13882 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"log") < 0)) __PYX_ERR(0, 1579, __pyx_L3_error)
13885 switch (PyTuple_GET_SIZE(__pyx_args)) {
13886 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13887 CYTHON_FALLTHROUGH;
13888 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13890 default:
goto __pyx_L5_argtuple_error;
13893 __pyx_v_obj = values[0];
13894 __pyx_v_i = values[1];
13896 goto __pyx_L4_argument_unpacking_done;
13897 __pyx_L5_argtuple_error:;
13898 __Pyx_RaiseArgtupleInvalid(
"log", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1579, __pyx_L3_error)
13900 __Pyx_AddTraceback(
"PyClical.log", __pyx_clineno, __pyx_lineno, __pyx_filename);
13901 __Pyx_RefNannyFinishContext();
13903 __pyx_L4_argument_unpacking_done:;
13904 __pyx_r = __pyx_pf_8PyClical_48log(__pyx_self, __pyx_v_obj, __pyx_v_i);
13907 __Pyx_RefNannyFinishContext();
13911 static PyObject *__pyx_pf_8PyClical_48log(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
13912 PyObject *__pyx_r = NULL;
13913 __Pyx_RefNannyDeclarations
13914 PyObject *__pyx_t_1 = NULL;
13915 struct __pyx_opt_args_8PyClical_log __pyx_t_2;
13916 __Pyx_RefNannySetupContext(
"log", 0);
13917 __Pyx_XDECREF(__pyx_r);
13918 __pyx_t_2.__pyx_n = 1;
13919 __pyx_t_2.i = __pyx_v_i;
13920 __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)
13921 __Pyx_GOTREF(__pyx_t_1);
13922 __pyx_r = __pyx_t_1;
13928 __Pyx_XDECREF(__pyx_t_1);
13929 __Pyx_AddTraceback(
"PyClical.log", __pyx_clineno, __pyx_lineno, __pyx_filename);
13932 __Pyx_XGIVEREF(__pyx_r);
13933 __Pyx_RefNannyFinishContext();
13945 static PyObject *__pyx_pw_8PyClical_51cos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13946 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) {
13947 PyObject *__pyx_v_i = ((PyObject *)Py_None);
13948 PyObject *__pyx_r = NULL;
13949 __Pyx_RefNannyDeclarations
13952 PyObject *__pyx_t_3 = NULL;
13954 PyObject *__pyx_t_5 = NULL;
13955 PyObject *__pyx_t_6 = NULL;
13956 PyObject *__pyx_t_7 = NULL;
13957 PyObject *__pyx_t_8 = NULL;
13958 PyObject *__pyx_t_9 = NULL;
13959 PyObject *__pyx_t_10 = NULL;
13960 PyObject *__pyx_t_11 = NULL;
13961 __Pyx_RefNannySetupContext(
"cos", 0);
13962 if (__pyx_optional_args) {
13963 if (__pyx_optional_args->__pyx_n > 0) {
13964 __pyx_v_i = __pyx_optional_args->i;
13975 __pyx_t_1 = (__pyx_v_i != Py_None);
13976 __pyx_t_2 = (__pyx_t_1 != 0);
13986 __Pyx_XDECREF(__pyx_r);
13987 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1612, __pyx_L1_error)
13988 __Pyx_GOTREF(__pyx_t_3);
13990 __pyx_t_4 =
cos(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
13992 __Pyx_CppExn2PyErr();
13993 __PYX_ERR(0, 1612, __pyx_L1_error)
13995 __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)
13996 __Pyx_GOTREF(__pyx_t_5);
13997 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13998 __pyx_r = __pyx_t_5;
14020 __Pyx_PyThreadState_declare
14021 __Pyx_PyThreadState_assign
14022 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
14023 __Pyx_XGOTREF(__pyx_t_6);
14024 __Pyx_XGOTREF(__pyx_t_7);
14025 __Pyx_XGOTREF(__pyx_t_8);
14035 __Pyx_XDECREF(__pyx_r);
14036 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1615, __pyx_L4_error)
14037 __Pyx_GOTREF(__pyx_t_3);
14038 __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)
14039 __Pyx_GOTREF(__pyx_t_9);
14040 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14042 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
14043 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
14044 if (likely(__pyx_t_3)) {
14045 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
14046 __Pyx_INCREF(__pyx_t_3);
14047 __Pyx_INCREF(
function);
14048 __Pyx_DECREF_SET(__pyx_t_9,
function);
14051 __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);
14052 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14053 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1615, __pyx_L4_error)
14054 __Pyx_GOTREF(__pyx_t_5);
14055 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14056 __pyx_r = __pyx_t_5;
14058 goto __pyx_L8_try_return;
14069 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14070 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14071 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
14081 __Pyx_AddTraceback(
"PyClical.cos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14082 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1616, __pyx_L6_except_error)
14083 __Pyx_GOTREF(__pyx_t_5);
14084 __Pyx_GOTREF(__pyx_t_9);
14085 __Pyx_GOTREF(__pyx_t_3);
14094 __Pyx_XDECREF(__pyx_r);
14095 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1617, __pyx_L6_except_error)
14096 __Pyx_GOTREF(__pyx_t_10);
14097 __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)
14098 __Pyx_GOTREF(__pyx_t_11);
14099 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14100 __pyx_r = __pyx_t_11;
14102 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14103 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14104 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14105 goto __pyx_L7_except_return;
14107 __pyx_L6_except_error:;
14116 __Pyx_XGIVEREF(__pyx_t_6);
14117 __Pyx_XGIVEREF(__pyx_t_7);
14118 __Pyx_XGIVEREF(__pyx_t_8);
14119 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14120 goto __pyx_L1_error;
14121 __pyx_L8_try_return:;
14122 __Pyx_XGIVEREF(__pyx_t_6);
14123 __Pyx_XGIVEREF(__pyx_t_7);
14124 __Pyx_XGIVEREF(__pyx_t_8);
14125 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14127 __pyx_L7_except_return:;
14128 __Pyx_XGIVEREF(__pyx_t_6);
14129 __Pyx_XGIVEREF(__pyx_t_7);
14130 __Pyx_XGIVEREF(__pyx_t_8);
14131 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14146 __Pyx_XDECREF(__pyx_t_3);
14147 __Pyx_XDECREF(__pyx_t_5);
14148 __Pyx_XDECREF(__pyx_t_9);
14149 __Pyx_XDECREF(__pyx_t_10);
14150 __Pyx_XDECREF(__pyx_t_11);
14151 __Pyx_AddTraceback(
"PyClical.cos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14154 __Pyx_XGIVEREF(__pyx_r);
14155 __Pyx_RefNannyFinishContext();
14160 static PyObject *__pyx_pw_8PyClical_51cos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14161 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 ";
14162 static PyObject *__pyx_pw_8PyClical_51cos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14163 PyObject *__pyx_v_obj = 0;
14164 PyObject *__pyx_v_i = 0;
14165 PyObject *__pyx_r = 0;
14166 __Pyx_RefNannyDeclarations
14167 __Pyx_RefNannySetupContext(
"cos (wrapper)", 0);
14169 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
14170 PyObject* values[2] = {0,0};
14171 values[1] = ((PyObject *)Py_None);
14172 if (unlikely(__pyx_kwds)) {
14173 Py_ssize_t kw_args;
14174 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14175 switch (pos_args) {
14176 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14177 CYTHON_FALLTHROUGH;
14178 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14179 CYTHON_FALLTHROUGH;
14181 default:
goto __pyx_L5_argtuple_error;
14183 kw_args = PyDict_Size(__pyx_kwds);
14184 switch (pos_args) {
14186 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
14187 else goto __pyx_L5_argtuple_error;
14188 CYTHON_FALLTHROUGH;
14191 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
14192 if (value) { values[1] = value; kw_args--; }
14195 if (unlikely(kw_args > 0)) {
14196 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"cos") < 0)) __PYX_ERR(0, 1602, __pyx_L3_error)
14199 switch (PyTuple_GET_SIZE(__pyx_args)) {
14200 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14201 CYTHON_FALLTHROUGH;
14202 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14204 default:
goto __pyx_L5_argtuple_error;
14207 __pyx_v_obj = values[0];
14208 __pyx_v_i = values[1];
14210 goto __pyx_L4_argument_unpacking_done;
14211 __pyx_L5_argtuple_error:;
14212 __Pyx_RaiseArgtupleInvalid(
"cos", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1602, __pyx_L3_error)
14214 __Pyx_AddTraceback(
"PyClical.cos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14215 __Pyx_RefNannyFinishContext();
14217 __pyx_L4_argument_unpacking_done:;
14218 __pyx_r = __pyx_pf_8PyClical_50cos(__pyx_self, __pyx_v_obj, __pyx_v_i);
14221 __Pyx_RefNannyFinishContext();
14225 static PyObject *__pyx_pf_8PyClical_50cos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
14226 PyObject *__pyx_r = NULL;
14227 __Pyx_RefNannyDeclarations
14228 PyObject *__pyx_t_1 = NULL;
14229 struct __pyx_opt_args_8PyClical_cos __pyx_t_2;
14230 __Pyx_RefNannySetupContext(
"cos", 0);
14231 __Pyx_XDECREF(__pyx_r);
14232 __pyx_t_2.__pyx_n = 1;
14233 __pyx_t_2.i = __pyx_v_i;
14234 __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)
14235 __Pyx_GOTREF(__pyx_t_1);
14236 __pyx_r = __pyx_t_1;
14242 __Pyx_XDECREF(__pyx_t_1);
14243 __Pyx_AddTraceback(
"PyClical.cos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14246 __Pyx_XGIVEREF(__pyx_r);
14247 __Pyx_RefNannyFinishContext();
14259 static PyObject *__pyx_pw_8PyClical_53acos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14260 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) {
14261 PyObject *__pyx_v_i = ((PyObject *)Py_None);
14262 PyObject *__pyx_r = NULL;
14263 __Pyx_RefNannyDeclarations
14266 PyObject *__pyx_t_3 = NULL;
14268 PyObject *__pyx_t_5 = NULL;
14269 PyObject *__pyx_t_6 = NULL;
14270 PyObject *__pyx_t_7 = NULL;
14271 PyObject *__pyx_t_8 = NULL;
14272 PyObject *__pyx_t_9 = NULL;
14273 PyObject *__pyx_t_10 = NULL;
14274 PyObject *__pyx_t_11 = NULL;
14275 __Pyx_RefNannySetupContext(
"acos", 0);
14276 if (__pyx_optional_args) {
14277 if (__pyx_optional_args->__pyx_n > 0) {
14278 __pyx_v_i = __pyx_optional_args->i;
14289 __pyx_t_1 = (__pyx_v_i != Py_None);
14290 __pyx_t_2 = (__pyx_t_1 != 0);
14300 __Pyx_XDECREF(__pyx_r);
14301 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1633, __pyx_L1_error)
14302 __Pyx_GOTREF(__pyx_t_3);
14304 __pyx_t_4 =
acos(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
14306 __Pyx_CppExn2PyErr();
14307 __PYX_ERR(0, 1633, __pyx_L1_error)
14309 __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)
14310 __Pyx_GOTREF(__pyx_t_5);
14311 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14312 __pyx_r = __pyx_t_5;
14334 __Pyx_PyThreadState_declare
14335 __Pyx_PyThreadState_assign
14336 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
14337 __Pyx_XGOTREF(__pyx_t_6);
14338 __Pyx_XGOTREF(__pyx_t_7);
14339 __Pyx_XGOTREF(__pyx_t_8);
14349 __Pyx_XDECREF(__pyx_r);
14350 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1636, __pyx_L4_error)
14351 __Pyx_GOTREF(__pyx_t_3);
14352 __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)
14353 __Pyx_GOTREF(__pyx_t_9);
14354 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14356 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
14357 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
14358 if (likely(__pyx_t_3)) {
14359 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
14360 __Pyx_INCREF(__pyx_t_3);
14361 __Pyx_INCREF(
function);
14362 __Pyx_DECREF_SET(__pyx_t_9,
function);
14365 __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);
14366 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14367 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1636, __pyx_L4_error)
14368 __Pyx_GOTREF(__pyx_t_5);
14369 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14370 __pyx_r = __pyx_t_5;
14372 goto __pyx_L8_try_return;
14383 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14384 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14385 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
14395 __Pyx_AddTraceback(
"PyClical.acos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14396 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1637, __pyx_L6_except_error)
14397 __Pyx_GOTREF(__pyx_t_5);
14398 __Pyx_GOTREF(__pyx_t_9);
14399 __Pyx_GOTREF(__pyx_t_3);
14408 __Pyx_XDECREF(__pyx_r);
14409 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1638, __pyx_L6_except_error)
14410 __Pyx_GOTREF(__pyx_t_10);
14411 __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)
14412 __Pyx_GOTREF(__pyx_t_11);
14413 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14414 __pyx_r = __pyx_t_11;
14416 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14417 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14418 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14419 goto __pyx_L7_except_return;
14421 __pyx_L6_except_error:;
14430 __Pyx_XGIVEREF(__pyx_t_6);
14431 __Pyx_XGIVEREF(__pyx_t_7);
14432 __Pyx_XGIVEREF(__pyx_t_8);
14433 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14434 goto __pyx_L1_error;
14435 __pyx_L8_try_return:;
14436 __Pyx_XGIVEREF(__pyx_t_6);
14437 __Pyx_XGIVEREF(__pyx_t_7);
14438 __Pyx_XGIVEREF(__pyx_t_8);
14439 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14441 __pyx_L7_except_return:;
14442 __Pyx_XGIVEREF(__pyx_t_6);
14443 __Pyx_XGIVEREF(__pyx_t_7);
14444 __Pyx_XGIVEREF(__pyx_t_8);
14445 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14460 __Pyx_XDECREF(__pyx_t_3);
14461 __Pyx_XDECREF(__pyx_t_5);
14462 __Pyx_XDECREF(__pyx_t_9);
14463 __Pyx_XDECREF(__pyx_t_10);
14464 __Pyx_XDECREF(__pyx_t_11);
14465 __Pyx_AddTraceback(
"PyClical.acos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14468 __Pyx_XGIVEREF(__pyx_r);
14469 __Pyx_RefNannyFinishContext();
14474 static PyObject *__pyx_pw_8PyClical_53acos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14475 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 ";
14476 static PyObject *__pyx_pw_8PyClical_53acos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14477 PyObject *__pyx_v_obj = 0;
14478 PyObject *__pyx_v_i = 0;
14479 PyObject *__pyx_r = 0;
14480 __Pyx_RefNannyDeclarations
14481 __Pyx_RefNannySetupContext(
"acos (wrapper)", 0);
14483 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
14484 PyObject* values[2] = {0,0};
14485 values[1] = ((PyObject *)Py_None);
14486 if (unlikely(__pyx_kwds)) {
14487 Py_ssize_t kw_args;
14488 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14489 switch (pos_args) {
14490 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14491 CYTHON_FALLTHROUGH;
14492 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14493 CYTHON_FALLTHROUGH;
14495 default:
goto __pyx_L5_argtuple_error;
14497 kw_args = PyDict_Size(__pyx_kwds);
14498 switch (pos_args) {
14500 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
14501 else goto __pyx_L5_argtuple_error;
14502 CYTHON_FALLTHROUGH;
14505 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
14506 if (value) { values[1] = value; kw_args--; }
14509 if (unlikely(kw_args > 0)) {
14510 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"acos") < 0)) __PYX_ERR(0, 1619, __pyx_L3_error)
14513 switch (PyTuple_GET_SIZE(__pyx_args)) {
14514 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14515 CYTHON_FALLTHROUGH;
14516 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14518 default:
goto __pyx_L5_argtuple_error;
14521 __pyx_v_obj = values[0];
14522 __pyx_v_i = values[1];
14524 goto __pyx_L4_argument_unpacking_done;
14525 __pyx_L5_argtuple_error:;
14526 __Pyx_RaiseArgtupleInvalid(
"acos", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1619, __pyx_L3_error)
14528 __Pyx_AddTraceback(
"PyClical.acos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14529 __Pyx_RefNannyFinishContext();
14531 __pyx_L4_argument_unpacking_done:;
14532 __pyx_r = __pyx_pf_8PyClical_52acos(__pyx_self, __pyx_v_obj, __pyx_v_i);
14535 __Pyx_RefNannyFinishContext();
14539 static PyObject *__pyx_pf_8PyClical_52acos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
14540 PyObject *__pyx_r = NULL;
14541 __Pyx_RefNannyDeclarations
14542 PyObject *__pyx_t_1 = NULL;
14543 struct __pyx_opt_args_8PyClical_acos __pyx_t_2;
14544 __Pyx_RefNannySetupContext(
"acos", 0);
14545 __Pyx_XDECREF(__pyx_r);
14546 __pyx_t_2.__pyx_n = 1;
14547 __pyx_t_2.i = __pyx_v_i;
14548 __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)
14549 __Pyx_GOTREF(__pyx_t_1);
14550 __pyx_r = __pyx_t_1;
14556 __Pyx_XDECREF(__pyx_t_1);
14557 __Pyx_AddTraceback(
"PyClical.acos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14560 __Pyx_XGIVEREF(__pyx_r);
14561 __Pyx_RefNannyFinishContext();
14573 static PyObject *__pyx_pw_8PyClical_55cosh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
14574 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cosh(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
14575 PyObject *__pyx_r = NULL;
14576 __Pyx_RefNannyDeclarations
14577 PyObject *__pyx_t_1 = NULL;
14578 PyObject *__pyx_t_2 = NULL;
14579 PyObject *__pyx_t_3 = NULL;
14580 PyObject *__pyx_t_4 = NULL;
14581 PyObject *__pyx_t_5 = NULL;
14582 PyObject *__pyx_t_6 = NULL;
14583 PyObject *__pyx_t_7 = NULL;
14584 PyObject *__pyx_t_8 = NULL;
14585 __Pyx_RefNannySetupContext(
"cosh", 0);
14595 __Pyx_PyThreadState_declare
14596 __Pyx_PyThreadState_assign
14597 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
14598 __Pyx_XGOTREF(__pyx_t_1);
14599 __Pyx_XGOTREF(__pyx_t_2);
14600 __Pyx_XGOTREF(__pyx_t_3);
14610 __Pyx_XDECREF(__pyx_r);
14611 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1652, __pyx_L3_error)
14612 __Pyx_GOTREF(__pyx_t_5);
14613 __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)
14614 __Pyx_GOTREF(__pyx_t_6);
14615 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14617 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
14618 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
14619 if (likely(__pyx_t_5)) {
14620 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
14621 __Pyx_INCREF(__pyx_t_5);
14622 __Pyx_INCREF(
function);
14623 __Pyx_DECREF_SET(__pyx_t_6,
function);
14626 __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);
14627 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14628 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1652, __pyx_L3_error)
14629 __Pyx_GOTREF(__pyx_t_4);
14630 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14631 __pyx_r = __pyx_t_4;
14633 goto __pyx_L7_try_return;
14644 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
14645 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14646 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
14656 __Pyx_AddTraceback(
"PyClical.cosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
14657 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(0, 1653, __pyx_L5_except_error)
14658 __Pyx_GOTREF(__pyx_t_4);
14659 __Pyx_GOTREF(__pyx_t_6);
14660 __Pyx_GOTREF(__pyx_t_5);
14669 __Pyx_XDECREF(__pyx_r);
14670 __pyx_t_7 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1654, __pyx_L5_except_error)
14671 __Pyx_GOTREF(__pyx_t_7);
14672 __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)
14673 __Pyx_GOTREF(__pyx_t_8);
14674 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14675 __pyx_r = __pyx_t_8;
14677 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14678 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14679 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14680 goto __pyx_L6_except_return;
14682 __pyx_L5_except_error:;
14691 __Pyx_XGIVEREF(__pyx_t_1);
14692 __Pyx_XGIVEREF(__pyx_t_2);
14693 __Pyx_XGIVEREF(__pyx_t_3);
14694 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
14695 goto __pyx_L1_error;
14696 __pyx_L7_try_return:;
14697 __Pyx_XGIVEREF(__pyx_t_1);
14698 __Pyx_XGIVEREF(__pyx_t_2);
14699 __Pyx_XGIVEREF(__pyx_t_3);
14700 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
14702 __pyx_L6_except_return:;
14703 __Pyx_XGIVEREF(__pyx_t_1);
14704 __Pyx_XGIVEREF(__pyx_t_2);
14705 __Pyx_XGIVEREF(__pyx_t_3);
14706 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
14720 __Pyx_XDECREF(__pyx_t_4);
14721 __Pyx_XDECREF(__pyx_t_5);
14722 __Pyx_XDECREF(__pyx_t_6);
14723 __Pyx_XDECREF(__pyx_t_7);
14724 __Pyx_XDECREF(__pyx_t_8);
14725 __Pyx_AddTraceback(
"PyClical.cosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
14728 __Pyx_XGIVEREF(__pyx_r);
14729 __Pyx_RefNannyFinishContext();
14734 static PyObject *__pyx_pw_8PyClical_55cosh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
14735 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 ";
14736 static PyObject *__pyx_pw_8PyClical_55cosh(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
14737 PyObject *__pyx_r = 0;
14738 __Pyx_RefNannyDeclarations
14739 __Pyx_RefNannySetupContext(
"cosh (wrapper)", 0);
14740 __pyx_r = __pyx_pf_8PyClical_54cosh(__pyx_self, ((PyObject *)__pyx_v_obj));
14743 __Pyx_RefNannyFinishContext();
14747 static PyObject *__pyx_pf_8PyClical_54cosh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
14748 PyObject *__pyx_r = NULL;
14749 __Pyx_RefNannyDeclarations
14750 PyObject *__pyx_t_1 = NULL;
14751 __Pyx_RefNannySetupContext(
"cosh", 0);
14752 __Pyx_XDECREF(__pyx_r);
14753 __pyx_t_1 = __pyx_f_8PyClical_cosh(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1640, __pyx_L1_error)
14754 __Pyx_GOTREF(__pyx_t_1);
14755 __pyx_r = __pyx_t_1;
14761 __Pyx_XDECREF(__pyx_t_1);
14762 __Pyx_AddTraceback(
"PyClical.cosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
14765 __Pyx_XGIVEREF(__pyx_r);
14766 __Pyx_RefNannyFinishContext();
14778 static PyObject *__pyx_pw_8PyClical_57acosh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14779 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) {
14780 PyObject *__pyx_v_i = ((PyObject *)Py_None);
14781 PyObject *__pyx_r = NULL;
14782 __Pyx_RefNannyDeclarations
14785 PyObject *__pyx_t_3 = NULL;
14787 PyObject *__pyx_t_5 = NULL;
14788 PyObject *__pyx_t_6 = NULL;
14789 PyObject *__pyx_t_7 = NULL;
14790 PyObject *__pyx_t_8 = NULL;
14791 PyObject *__pyx_t_9 = NULL;
14792 PyObject *__pyx_t_10 = NULL;
14793 PyObject *__pyx_t_11 = NULL;
14794 __Pyx_RefNannySetupContext(
"acosh", 0);
14795 if (__pyx_optional_args) {
14796 if (__pyx_optional_args->__pyx_n > 0) {
14797 __pyx_v_i = __pyx_optional_args->i;
14808 __pyx_t_1 = (__pyx_v_i != Py_None);
14809 __pyx_t_2 = (__pyx_t_1 != 0);
14819 __Pyx_XDECREF(__pyx_r);
14820 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1672, __pyx_L1_error)
14821 __Pyx_GOTREF(__pyx_t_3);
14823 __pyx_t_4 =
acosh(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
14825 __Pyx_CppExn2PyErr();
14826 __PYX_ERR(0, 1672, __pyx_L1_error)
14828 __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)
14829 __Pyx_GOTREF(__pyx_t_5);
14830 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14831 __pyx_r = __pyx_t_5;
14853 __Pyx_PyThreadState_declare
14854 __Pyx_PyThreadState_assign
14855 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
14856 __Pyx_XGOTREF(__pyx_t_6);
14857 __Pyx_XGOTREF(__pyx_t_7);
14858 __Pyx_XGOTREF(__pyx_t_8);
14868 __Pyx_XDECREF(__pyx_r);
14869 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1675, __pyx_L4_error)
14870 __Pyx_GOTREF(__pyx_t_3);
14871 __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)
14872 __Pyx_GOTREF(__pyx_t_9);
14873 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14875 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
14876 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
14877 if (likely(__pyx_t_3)) {
14878 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
14879 __Pyx_INCREF(__pyx_t_3);
14880 __Pyx_INCREF(
function);
14881 __Pyx_DECREF_SET(__pyx_t_9,
function);
14884 __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);
14885 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14886 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1675, __pyx_L4_error)
14887 __Pyx_GOTREF(__pyx_t_5);
14888 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14889 __pyx_r = __pyx_t_5;
14891 goto __pyx_L8_try_return;
14902 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14903 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14904 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
14914 __Pyx_AddTraceback(
"PyClical.acosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
14915 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1676, __pyx_L6_except_error)
14916 __Pyx_GOTREF(__pyx_t_5);
14917 __Pyx_GOTREF(__pyx_t_9);
14918 __Pyx_GOTREF(__pyx_t_3);
14927 __Pyx_XDECREF(__pyx_r);
14928 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1677, __pyx_L6_except_error)
14929 __Pyx_GOTREF(__pyx_t_10);
14930 __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)
14931 __Pyx_GOTREF(__pyx_t_11);
14932 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14933 __pyx_r = __pyx_t_11;
14935 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14936 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14937 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14938 goto __pyx_L7_except_return;
14940 __pyx_L6_except_error:;
14949 __Pyx_XGIVEREF(__pyx_t_6);
14950 __Pyx_XGIVEREF(__pyx_t_7);
14951 __Pyx_XGIVEREF(__pyx_t_8);
14952 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14953 goto __pyx_L1_error;
14954 __pyx_L8_try_return:;
14955 __Pyx_XGIVEREF(__pyx_t_6);
14956 __Pyx_XGIVEREF(__pyx_t_7);
14957 __Pyx_XGIVEREF(__pyx_t_8);
14958 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14960 __pyx_L7_except_return:;
14961 __Pyx_XGIVEREF(__pyx_t_6);
14962 __Pyx_XGIVEREF(__pyx_t_7);
14963 __Pyx_XGIVEREF(__pyx_t_8);
14964 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14979 __Pyx_XDECREF(__pyx_t_3);
14980 __Pyx_XDECREF(__pyx_t_5);
14981 __Pyx_XDECREF(__pyx_t_9);
14982 __Pyx_XDECREF(__pyx_t_10);
14983 __Pyx_XDECREF(__pyx_t_11);
14984 __Pyx_AddTraceback(
"PyClical.acosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
14987 __Pyx_XGIVEREF(__pyx_r);
14988 __Pyx_RefNannyFinishContext();
14993 static PyObject *__pyx_pw_8PyClical_57acosh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14994 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 ";
14995 static PyObject *__pyx_pw_8PyClical_57acosh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14996 PyObject *__pyx_v_obj = 0;
14997 PyObject *__pyx_v_i = 0;
14998 PyObject *__pyx_r = 0;
14999 __Pyx_RefNannyDeclarations
15000 __Pyx_RefNannySetupContext(
"acosh (wrapper)", 0);
15002 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
15003 PyObject* values[2] = {0,0};
15004 values[1] = ((PyObject *)Py_None);
15005 if (unlikely(__pyx_kwds)) {
15006 Py_ssize_t kw_args;
15007 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15008 switch (pos_args) {
15009 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15010 CYTHON_FALLTHROUGH;
15011 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15012 CYTHON_FALLTHROUGH;
15014 default:
goto __pyx_L5_argtuple_error;
15016 kw_args = PyDict_Size(__pyx_kwds);
15017 switch (pos_args) {
15019 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
15020 else goto __pyx_L5_argtuple_error;
15021 CYTHON_FALLTHROUGH;
15024 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
15025 if (value) { values[1] = value; kw_args--; }
15028 if (unlikely(kw_args > 0)) {
15029 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"acosh") < 0)) __PYX_ERR(0, 1656, __pyx_L3_error)
15032 switch (PyTuple_GET_SIZE(__pyx_args)) {
15033 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15034 CYTHON_FALLTHROUGH;
15035 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15037 default:
goto __pyx_L5_argtuple_error;
15040 __pyx_v_obj = values[0];
15041 __pyx_v_i = values[1];
15043 goto __pyx_L4_argument_unpacking_done;
15044 __pyx_L5_argtuple_error:;
15045 __Pyx_RaiseArgtupleInvalid(
"acosh", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1656, __pyx_L3_error)
15047 __Pyx_AddTraceback(
"PyClical.acosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15048 __Pyx_RefNannyFinishContext();
15050 __pyx_L4_argument_unpacking_done:;
15051 __pyx_r = __pyx_pf_8PyClical_56acosh(__pyx_self, __pyx_v_obj, __pyx_v_i);
15054 __Pyx_RefNannyFinishContext();
15058 static PyObject *__pyx_pf_8PyClical_56acosh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
15059 PyObject *__pyx_r = NULL;
15060 __Pyx_RefNannyDeclarations
15061 PyObject *__pyx_t_1 = NULL;
15062 struct __pyx_opt_args_8PyClical_acosh __pyx_t_2;
15063 __Pyx_RefNannySetupContext(
"acosh", 0);
15064 __Pyx_XDECREF(__pyx_r);
15065 __pyx_t_2.__pyx_n = 1;
15066 __pyx_t_2.i = __pyx_v_i;
15067 __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)
15068 __Pyx_GOTREF(__pyx_t_1);
15069 __pyx_r = __pyx_t_1;
15075 __Pyx_XDECREF(__pyx_t_1);
15076 __Pyx_AddTraceback(
"PyClical.acosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15079 __Pyx_XGIVEREF(__pyx_r);
15080 __Pyx_RefNannyFinishContext();
15092 static PyObject *__pyx_pw_8PyClical_59sin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15093 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) {
15094 PyObject *__pyx_v_i = ((PyObject *)Py_None);
15095 PyObject *__pyx_r = NULL;
15096 __Pyx_RefNannyDeclarations
15099 PyObject *__pyx_t_3 = NULL;
15101 PyObject *__pyx_t_5 = NULL;
15102 PyObject *__pyx_t_6 = NULL;
15103 PyObject *__pyx_t_7 = NULL;
15104 PyObject *__pyx_t_8 = NULL;
15105 PyObject *__pyx_t_9 = NULL;
15106 PyObject *__pyx_t_10 = NULL;
15107 PyObject *__pyx_t_11 = NULL;
15108 __Pyx_RefNannySetupContext(
"sin", 0);
15109 if (__pyx_optional_args) {
15110 if (__pyx_optional_args->__pyx_n > 0) {
15111 __pyx_v_i = __pyx_optional_args->i;
15122 __pyx_t_1 = (__pyx_v_i != Py_None);
15123 __pyx_t_2 = (__pyx_t_1 != 0);
15133 __Pyx_XDECREF(__pyx_r);
15134 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1691, __pyx_L1_error)
15135 __Pyx_GOTREF(__pyx_t_3);
15137 __pyx_t_4 =
sin(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
15139 __Pyx_CppExn2PyErr();
15140 __PYX_ERR(0, 1691, __pyx_L1_error)
15142 __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)
15143 __Pyx_GOTREF(__pyx_t_5);
15144 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15145 __pyx_r = __pyx_t_5;
15167 __Pyx_PyThreadState_declare
15168 __Pyx_PyThreadState_assign
15169 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
15170 __Pyx_XGOTREF(__pyx_t_6);
15171 __Pyx_XGOTREF(__pyx_t_7);
15172 __Pyx_XGOTREF(__pyx_t_8);
15182 __Pyx_XDECREF(__pyx_r);
15183 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1694, __pyx_L4_error)
15184 __Pyx_GOTREF(__pyx_t_3);
15185 __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)
15186 __Pyx_GOTREF(__pyx_t_9);
15187 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15189 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
15190 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
15191 if (likely(__pyx_t_3)) {
15192 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
15193 __Pyx_INCREF(__pyx_t_3);
15194 __Pyx_INCREF(
function);
15195 __Pyx_DECREF_SET(__pyx_t_9,
function);
15198 __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);
15199 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15200 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1694, __pyx_L4_error)
15201 __Pyx_GOTREF(__pyx_t_5);
15202 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15203 __pyx_r = __pyx_t_5;
15205 goto __pyx_L8_try_return;
15216 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15217 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15218 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
15228 __Pyx_AddTraceback(
"PyClical.sin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15229 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1695, __pyx_L6_except_error)
15230 __Pyx_GOTREF(__pyx_t_5);
15231 __Pyx_GOTREF(__pyx_t_9);
15232 __Pyx_GOTREF(__pyx_t_3);
15241 __Pyx_XDECREF(__pyx_r);
15242 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1696, __pyx_L6_except_error)
15243 __Pyx_GOTREF(__pyx_t_10);
15244 __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)
15245 __Pyx_GOTREF(__pyx_t_11);
15246 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15247 __pyx_r = __pyx_t_11;
15249 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15250 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15251 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15252 goto __pyx_L7_except_return;
15254 __pyx_L6_except_error:;
15263 __Pyx_XGIVEREF(__pyx_t_6);
15264 __Pyx_XGIVEREF(__pyx_t_7);
15265 __Pyx_XGIVEREF(__pyx_t_8);
15266 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15267 goto __pyx_L1_error;
15268 __pyx_L8_try_return:;
15269 __Pyx_XGIVEREF(__pyx_t_6);
15270 __Pyx_XGIVEREF(__pyx_t_7);
15271 __Pyx_XGIVEREF(__pyx_t_8);
15272 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15274 __pyx_L7_except_return:;
15275 __Pyx_XGIVEREF(__pyx_t_6);
15276 __Pyx_XGIVEREF(__pyx_t_7);
15277 __Pyx_XGIVEREF(__pyx_t_8);
15278 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15293 __Pyx_XDECREF(__pyx_t_3);
15294 __Pyx_XDECREF(__pyx_t_5);
15295 __Pyx_XDECREF(__pyx_t_9);
15296 __Pyx_XDECREF(__pyx_t_10);
15297 __Pyx_XDECREF(__pyx_t_11);
15298 __Pyx_AddTraceback(
"PyClical.sin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15301 __Pyx_XGIVEREF(__pyx_r);
15302 __Pyx_RefNannyFinishContext();
15307 static PyObject *__pyx_pw_8PyClical_59sin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15308 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 ";
15309 static PyObject *__pyx_pw_8PyClical_59sin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15310 PyObject *__pyx_v_obj = 0;
15311 PyObject *__pyx_v_i = 0;
15312 PyObject *__pyx_r = 0;
15313 __Pyx_RefNannyDeclarations
15314 __Pyx_RefNannySetupContext(
"sin (wrapper)", 0);
15316 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
15317 PyObject* values[2] = {0,0};
15318 values[1] = ((PyObject *)Py_None);
15319 if (unlikely(__pyx_kwds)) {
15320 Py_ssize_t kw_args;
15321 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15322 switch (pos_args) {
15323 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15324 CYTHON_FALLTHROUGH;
15325 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15326 CYTHON_FALLTHROUGH;
15328 default:
goto __pyx_L5_argtuple_error;
15330 kw_args = PyDict_Size(__pyx_kwds);
15331 switch (pos_args) {
15333 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
15334 else goto __pyx_L5_argtuple_error;
15335 CYTHON_FALLTHROUGH;
15338 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
15339 if (value) { values[1] = value; kw_args--; }
15342 if (unlikely(kw_args > 0)) {
15343 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"sin") < 0)) __PYX_ERR(0, 1679, __pyx_L3_error)
15346 switch (PyTuple_GET_SIZE(__pyx_args)) {
15347 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15348 CYTHON_FALLTHROUGH;
15349 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15351 default:
goto __pyx_L5_argtuple_error;
15354 __pyx_v_obj = values[0];
15355 __pyx_v_i = values[1];
15357 goto __pyx_L4_argument_unpacking_done;
15358 __pyx_L5_argtuple_error:;
15359 __Pyx_RaiseArgtupleInvalid(
"sin", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1679, __pyx_L3_error)
15361 __Pyx_AddTraceback(
"PyClical.sin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15362 __Pyx_RefNannyFinishContext();
15364 __pyx_L4_argument_unpacking_done:;
15365 __pyx_r = __pyx_pf_8PyClical_58sin(__pyx_self, __pyx_v_obj, __pyx_v_i);
15368 __Pyx_RefNannyFinishContext();
15372 static PyObject *__pyx_pf_8PyClical_58sin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
15373 PyObject *__pyx_r = NULL;
15374 __Pyx_RefNannyDeclarations
15375 PyObject *__pyx_t_1 = NULL;
15376 struct __pyx_opt_args_8PyClical_sin __pyx_t_2;
15377 __Pyx_RefNannySetupContext(
"sin", 0);
15378 __Pyx_XDECREF(__pyx_r);
15379 __pyx_t_2.__pyx_n = 1;
15380 __pyx_t_2.i = __pyx_v_i;
15381 __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)
15382 __Pyx_GOTREF(__pyx_t_1);
15383 __pyx_r = __pyx_t_1;
15389 __Pyx_XDECREF(__pyx_t_1);
15390 __Pyx_AddTraceback(
"PyClical.sin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15393 __Pyx_XGIVEREF(__pyx_r);
15394 __Pyx_RefNannyFinishContext();
15406 static PyObject *__pyx_pw_8PyClical_61asin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15407 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) {
15408 PyObject *__pyx_v_i = ((PyObject *)Py_None);
15409 PyObject *__pyx_r = NULL;
15410 __Pyx_RefNannyDeclarations
15413 PyObject *__pyx_t_3 = NULL;
15415 PyObject *__pyx_t_5 = NULL;
15416 PyObject *__pyx_t_6 = NULL;
15417 PyObject *__pyx_t_7 = NULL;
15418 PyObject *__pyx_t_8 = NULL;
15419 PyObject *__pyx_t_9 = NULL;
15420 PyObject *__pyx_t_10 = NULL;
15421 PyObject *__pyx_t_11 = NULL;
15422 __Pyx_RefNannySetupContext(
"asin", 0);
15423 if (__pyx_optional_args) {
15424 if (__pyx_optional_args->__pyx_n > 0) {
15425 __pyx_v_i = __pyx_optional_args->i;
15436 __pyx_t_1 = (__pyx_v_i != Py_None);
15437 __pyx_t_2 = (__pyx_t_1 != 0);
15447 __Pyx_XDECREF(__pyx_r);
15448 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1712, __pyx_L1_error)
15449 __Pyx_GOTREF(__pyx_t_3);
15451 __pyx_t_4 =
asin(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
15453 __Pyx_CppExn2PyErr();
15454 __PYX_ERR(0, 1712, __pyx_L1_error)
15456 __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)
15457 __Pyx_GOTREF(__pyx_t_5);
15458 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15459 __pyx_r = __pyx_t_5;
15481 __Pyx_PyThreadState_declare
15482 __Pyx_PyThreadState_assign
15483 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
15484 __Pyx_XGOTREF(__pyx_t_6);
15485 __Pyx_XGOTREF(__pyx_t_7);
15486 __Pyx_XGOTREF(__pyx_t_8);
15496 __Pyx_XDECREF(__pyx_r);
15497 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1715, __pyx_L4_error)
15498 __Pyx_GOTREF(__pyx_t_3);
15499 __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)
15500 __Pyx_GOTREF(__pyx_t_9);
15501 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15503 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
15504 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
15505 if (likely(__pyx_t_3)) {
15506 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
15507 __Pyx_INCREF(__pyx_t_3);
15508 __Pyx_INCREF(
function);
15509 __Pyx_DECREF_SET(__pyx_t_9,
function);
15512 __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);
15513 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15514 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1715, __pyx_L4_error)
15515 __Pyx_GOTREF(__pyx_t_5);
15516 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15517 __pyx_r = __pyx_t_5;
15519 goto __pyx_L8_try_return;
15530 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15531 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15532 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
15542 __Pyx_AddTraceback(
"PyClical.asin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15543 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1716, __pyx_L6_except_error)
15544 __Pyx_GOTREF(__pyx_t_5);
15545 __Pyx_GOTREF(__pyx_t_9);
15546 __Pyx_GOTREF(__pyx_t_3);
15555 __Pyx_XDECREF(__pyx_r);
15556 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1717, __pyx_L6_except_error)
15557 __Pyx_GOTREF(__pyx_t_10);
15558 __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)
15559 __Pyx_GOTREF(__pyx_t_11);
15560 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15561 __pyx_r = __pyx_t_11;
15563 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15564 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15565 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15566 goto __pyx_L7_except_return;
15568 __pyx_L6_except_error:;
15577 __Pyx_XGIVEREF(__pyx_t_6);
15578 __Pyx_XGIVEREF(__pyx_t_7);
15579 __Pyx_XGIVEREF(__pyx_t_8);
15580 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15581 goto __pyx_L1_error;
15582 __pyx_L8_try_return:;
15583 __Pyx_XGIVEREF(__pyx_t_6);
15584 __Pyx_XGIVEREF(__pyx_t_7);
15585 __Pyx_XGIVEREF(__pyx_t_8);
15586 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15588 __pyx_L7_except_return:;
15589 __Pyx_XGIVEREF(__pyx_t_6);
15590 __Pyx_XGIVEREF(__pyx_t_7);
15591 __Pyx_XGIVEREF(__pyx_t_8);
15592 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15607 __Pyx_XDECREF(__pyx_t_3);
15608 __Pyx_XDECREF(__pyx_t_5);
15609 __Pyx_XDECREF(__pyx_t_9);
15610 __Pyx_XDECREF(__pyx_t_10);
15611 __Pyx_XDECREF(__pyx_t_11);
15612 __Pyx_AddTraceback(
"PyClical.asin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15615 __Pyx_XGIVEREF(__pyx_r);
15616 __Pyx_RefNannyFinishContext();
15621 static PyObject *__pyx_pw_8PyClical_61asin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15622 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 ";
15623 static PyObject *__pyx_pw_8PyClical_61asin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15624 PyObject *__pyx_v_obj = 0;
15625 PyObject *__pyx_v_i = 0;
15626 PyObject *__pyx_r = 0;
15627 __Pyx_RefNannyDeclarations
15628 __Pyx_RefNannySetupContext(
"asin (wrapper)", 0);
15630 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
15631 PyObject* values[2] = {0,0};
15632 values[1] = ((PyObject *)Py_None);
15633 if (unlikely(__pyx_kwds)) {
15634 Py_ssize_t kw_args;
15635 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15636 switch (pos_args) {
15637 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15638 CYTHON_FALLTHROUGH;
15639 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15640 CYTHON_FALLTHROUGH;
15642 default:
goto __pyx_L5_argtuple_error;
15644 kw_args = PyDict_Size(__pyx_kwds);
15645 switch (pos_args) {
15647 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
15648 else goto __pyx_L5_argtuple_error;
15649 CYTHON_FALLTHROUGH;
15652 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
15653 if (value) { values[1] = value; kw_args--; }
15656 if (unlikely(kw_args > 0)) {
15657 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"asin") < 0)) __PYX_ERR(0, 1698, __pyx_L3_error)
15660 switch (PyTuple_GET_SIZE(__pyx_args)) {
15661 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15662 CYTHON_FALLTHROUGH;
15663 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15665 default:
goto __pyx_L5_argtuple_error;
15668 __pyx_v_obj = values[0];
15669 __pyx_v_i = values[1];
15671 goto __pyx_L4_argument_unpacking_done;
15672 __pyx_L5_argtuple_error:;
15673 __Pyx_RaiseArgtupleInvalid(
"asin", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1698, __pyx_L3_error)
15675 __Pyx_AddTraceback(
"PyClical.asin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15676 __Pyx_RefNannyFinishContext();
15678 __pyx_L4_argument_unpacking_done:;
15679 __pyx_r = __pyx_pf_8PyClical_60asin(__pyx_self, __pyx_v_obj, __pyx_v_i);
15682 __Pyx_RefNannyFinishContext();
15686 static PyObject *__pyx_pf_8PyClical_60asin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
15687 PyObject *__pyx_r = NULL;
15688 __Pyx_RefNannyDeclarations
15689 PyObject *__pyx_t_1 = NULL;
15690 struct __pyx_opt_args_8PyClical_asin __pyx_t_2;
15691 __Pyx_RefNannySetupContext(
"asin", 0);
15692 __Pyx_XDECREF(__pyx_r);
15693 __pyx_t_2.__pyx_n = 1;
15694 __pyx_t_2.i = __pyx_v_i;
15695 __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)
15696 __Pyx_GOTREF(__pyx_t_1);
15697 __pyx_r = __pyx_t_1;
15703 __Pyx_XDECREF(__pyx_t_1);
15704 __Pyx_AddTraceback(
"PyClical.asin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15707 __Pyx_XGIVEREF(__pyx_r);
15708 __Pyx_RefNannyFinishContext();
15720 static PyObject *__pyx_pw_8PyClical_63sinh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
15721 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_sinh(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
15722 PyObject *__pyx_r = NULL;
15723 __Pyx_RefNannyDeclarations
15724 PyObject *__pyx_t_1 = NULL;
15725 PyObject *__pyx_t_2 = NULL;
15726 PyObject *__pyx_t_3 = NULL;
15727 PyObject *__pyx_t_4 = NULL;
15728 PyObject *__pyx_t_5 = NULL;
15729 PyObject *__pyx_t_6 = NULL;
15730 PyObject *__pyx_t_7 = NULL;
15731 PyObject *__pyx_t_8 = NULL;
15732 __Pyx_RefNannySetupContext(
"sinh", 0);
15742 __Pyx_PyThreadState_declare
15743 __Pyx_PyThreadState_assign
15744 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
15745 __Pyx_XGOTREF(__pyx_t_1);
15746 __Pyx_XGOTREF(__pyx_t_2);
15747 __Pyx_XGOTREF(__pyx_t_3);
15757 __Pyx_XDECREF(__pyx_r);
15758 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1729, __pyx_L3_error)
15759 __Pyx_GOTREF(__pyx_t_5);
15760 __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)
15761 __Pyx_GOTREF(__pyx_t_6);
15762 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15764 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
15765 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
15766 if (likely(__pyx_t_5)) {
15767 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
15768 __Pyx_INCREF(__pyx_t_5);
15769 __Pyx_INCREF(
function);
15770 __Pyx_DECREF_SET(__pyx_t_6,
function);
15773 __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);
15774 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15775 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1729, __pyx_L3_error)
15776 __Pyx_GOTREF(__pyx_t_4);
15777 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15778 __pyx_r = __pyx_t_4;
15780 goto __pyx_L7_try_return;
15791 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
15792 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15793 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
15803 __Pyx_AddTraceback(
"PyClical.sinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15804 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(0, 1730, __pyx_L5_except_error)
15805 __Pyx_GOTREF(__pyx_t_4);
15806 __Pyx_GOTREF(__pyx_t_6);
15807 __Pyx_GOTREF(__pyx_t_5);
15816 __Pyx_XDECREF(__pyx_r);
15817 __pyx_t_7 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1731, __pyx_L5_except_error)
15818 __Pyx_GOTREF(__pyx_t_7);
15819 __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)
15820 __Pyx_GOTREF(__pyx_t_8);
15821 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15822 __pyx_r = __pyx_t_8;
15824 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15825 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15826 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15827 goto __pyx_L6_except_return;
15829 __pyx_L5_except_error:;
15838 __Pyx_XGIVEREF(__pyx_t_1);
15839 __Pyx_XGIVEREF(__pyx_t_2);
15840 __Pyx_XGIVEREF(__pyx_t_3);
15841 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
15842 goto __pyx_L1_error;
15843 __pyx_L7_try_return:;
15844 __Pyx_XGIVEREF(__pyx_t_1);
15845 __Pyx_XGIVEREF(__pyx_t_2);
15846 __Pyx_XGIVEREF(__pyx_t_3);
15847 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
15849 __pyx_L6_except_return:;
15850 __Pyx_XGIVEREF(__pyx_t_1);
15851 __Pyx_XGIVEREF(__pyx_t_2);
15852 __Pyx_XGIVEREF(__pyx_t_3);
15853 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
15867 __Pyx_XDECREF(__pyx_t_4);
15868 __Pyx_XDECREF(__pyx_t_5);
15869 __Pyx_XDECREF(__pyx_t_6);
15870 __Pyx_XDECREF(__pyx_t_7);
15871 __Pyx_XDECREF(__pyx_t_8);
15872 __Pyx_AddTraceback(
"PyClical.sinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15875 __Pyx_XGIVEREF(__pyx_r);
15876 __Pyx_RefNannyFinishContext();
15881 static PyObject *__pyx_pw_8PyClical_63sinh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
15882 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 ";
15883 static PyObject *__pyx_pw_8PyClical_63sinh(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
15884 PyObject *__pyx_r = 0;
15885 __Pyx_RefNannyDeclarations
15886 __Pyx_RefNannySetupContext(
"sinh (wrapper)", 0);
15887 __pyx_r = __pyx_pf_8PyClical_62sinh(__pyx_self, ((PyObject *)__pyx_v_obj));
15890 __Pyx_RefNannyFinishContext();
15894 static PyObject *__pyx_pf_8PyClical_62sinh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
15895 PyObject *__pyx_r = NULL;
15896 __Pyx_RefNannyDeclarations
15897 PyObject *__pyx_t_1 = NULL;
15898 __Pyx_RefNannySetupContext(
"sinh", 0);
15899 __Pyx_XDECREF(__pyx_r);
15900 __pyx_t_1 = __pyx_f_8PyClical_sinh(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1719, __pyx_L1_error)
15901 __Pyx_GOTREF(__pyx_t_1);
15902 __pyx_r = __pyx_t_1;
15908 __Pyx_XDECREF(__pyx_t_1);
15909 __Pyx_AddTraceback(
"PyClical.sinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15912 __Pyx_XGIVEREF(__pyx_r);
15913 __Pyx_RefNannyFinishContext();
15925 static PyObject *__pyx_pw_8PyClical_65asinh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15926 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) {
15927 PyObject *__pyx_v_i = ((PyObject *)Py_None);
15928 PyObject *__pyx_r = NULL;
15929 __Pyx_RefNannyDeclarations
15932 PyObject *__pyx_t_3 = NULL;
15934 PyObject *__pyx_t_5 = NULL;
15935 PyObject *__pyx_t_6 = NULL;
15936 PyObject *__pyx_t_7 = NULL;
15937 PyObject *__pyx_t_8 = NULL;
15938 PyObject *__pyx_t_9 = NULL;
15939 PyObject *__pyx_t_10 = NULL;
15940 PyObject *__pyx_t_11 = NULL;
15941 __Pyx_RefNannySetupContext(
"asinh", 0);
15942 if (__pyx_optional_args) {
15943 if (__pyx_optional_args->__pyx_n > 0) {
15944 __pyx_v_i = __pyx_optional_args->i;
15955 __pyx_t_1 = (__pyx_v_i != Py_None);
15956 __pyx_t_2 = (__pyx_t_1 != 0);
15966 __Pyx_XDECREF(__pyx_r);
15967 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1745, __pyx_L1_error)
15968 __Pyx_GOTREF(__pyx_t_3);
15970 __pyx_t_4 =
asinh(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
15972 __Pyx_CppExn2PyErr();
15973 __PYX_ERR(0, 1745, __pyx_L1_error)
15975 __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)
15976 __Pyx_GOTREF(__pyx_t_5);
15977 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15978 __pyx_r = __pyx_t_5;
16000 __Pyx_PyThreadState_declare
16001 __Pyx_PyThreadState_assign
16002 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
16003 __Pyx_XGOTREF(__pyx_t_6);
16004 __Pyx_XGOTREF(__pyx_t_7);
16005 __Pyx_XGOTREF(__pyx_t_8);
16015 __Pyx_XDECREF(__pyx_r);
16016 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1748, __pyx_L4_error)
16017 __Pyx_GOTREF(__pyx_t_3);
16018 __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)
16019 __Pyx_GOTREF(__pyx_t_9);
16020 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16022 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
16023 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
16024 if (likely(__pyx_t_3)) {
16025 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
16026 __Pyx_INCREF(__pyx_t_3);
16027 __Pyx_INCREF(
function);
16028 __Pyx_DECREF_SET(__pyx_t_9,
function);
16031 __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);
16032 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16033 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1748, __pyx_L4_error)
16034 __Pyx_GOTREF(__pyx_t_5);
16035 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16036 __pyx_r = __pyx_t_5;
16038 goto __pyx_L8_try_return;
16049 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16050 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16051 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
16061 __Pyx_AddTraceback(
"PyClical.asinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16062 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1749, __pyx_L6_except_error)
16063 __Pyx_GOTREF(__pyx_t_5);
16064 __Pyx_GOTREF(__pyx_t_9);
16065 __Pyx_GOTREF(__pyx_t_3);
16074 __Pyx_XDECREF(__pyx_r);
16075 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1750, __pyx_L6_except_error)
16076 __Pyx_GOTREF(__pyx_t_10);
16077 __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)
16078 __Pyx_GOTREF(__pyx_t_11);
16079 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16080 __pyx_r = __pyx_t_11;
16082 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16083 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16084 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16085 goto __pyx_L7_except_return;
16087 __pyx_L6_except_error:;
16096 __Pyx_XGIVEREF(__pyx_t_6);
16097 __Pyx_XGIVEREF(__pyx_t_7);
16098 __Pyx_XGIVEREF(__pyx_t_8);
16099 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16100 goto __pyx_L1_error;
16101 __pyx_L8_try_return:;
16102 __Pyx_XGIVEREF(__pyx_t_6);
16103 __Pyx_XGIVEREF(__pyx_t_7);
16104 __Pyx_XGIVEREF(__pyx_t_8);
16105 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16107 __pyx_L7_except_return:;
16108 __Pyx_XGIVEREF(__pyx_t_6);
16109 __Pyx_XGIVEREF(__pyx_t_7);
16110 __Pyx_XGIVEREF(__pyx_t_8);
16111 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16126 __Pyx_XDECREF(__pyx_t_3);
16127 __Pyx_XDECREF(__pyx_t_5);
16128 __Pyx_XDECREF(__pyx_t_9);
16129 __Pyx_XDECREF(__pyx_t_10);
16130 __Pyx_XDECREF(__pyx_t_11);
16131 __Pyx_AddTraceback(
"PyClical.asinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16134 __Pyx_XGIVEREF(__pyx_r);
16135 __Pyx_RefNannyFinishContext();
16140 static PyObject *__pyx_pw_8PyClical_65asinh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16141 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 ";
16142 static PyObject *__pyx_pw_8PyClical_65asinh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16143 PyObject *__pyx_v_obj = 0;
16144 PyObject *__pyx_v_i = 0;
16145 PyObject *__pyx_r = 0;
16146 __Pyx_RefNannyDeclarations
16147 __Pyx_RefNannySetupContext(
"asinh (wrapper)", 0);
16149 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
16150 PyObject* values[2] = {0,0};
16151 values[1] = ((PyObject *)Py_None);
16152 if (unlikely(__pyx_kwds)) {
16153 Py_ssize_t kw_args;
16154 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16155 switch (pos_args) {
16156 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16157 CYTHON_FALLTHROUGH;
16158 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16159 CYTHON_FALLTHROUGH;
16161 default:
goto __pyx_L5_argtuple_error;
16163 kw_args = PyDict_Size(__pyx_kwds);
16164 switch (pos_args) {
16166 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
16167 else goto __pyx_L5_argtuple_error;
16168 CYTHON_FALLTHROUGH;
16171 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
16172 if (value) { values[1] = value; kw_args--; }
16175 if (unlikely(kw_args > 0)) {
16176 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"asinh") < 0)) __PYX_ERR(0, 1733, __pyx_L3_error)
16179 switch (PyTuple_GET_SIZE(__pyx_args)) {
16180 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16181 CYTHON_FALLTHROUGH;
16182 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16184 default:
goto __pyx_L5_argtuple_error;
16187 __pyx_v_obj = values[0];
16188 __pyx_v_i = values[1];
16190 goto __pyx_L4_argument_unpacking_done;
16191 __pyx_L5_argtuple_error:;
16192 __Pyx_RaiseArgtupleInvalid(
"asinh", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1733, __pyx_L3_error)
16194 __Pyx_AddTraceback(
"PyClical.asinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16195 __Pyx_RefNannyFinishContext();
16197 __pyx_L4_argument_unpacking_done:;
16198 __pyx_r = __pyx_pf_8PyClical_64asinh(__pyx_self, __pyx_v_obj, __pyx_v_i);
16201 __Pyx_RefNannyFinishContext();
16205 static PyObject *__pyx_pf_8PyClical_64asinh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
16206 PyObject *__pyx_r = NULL;
16207 __Pyx_RefNannyDeclarations
16208 PyObject *__pyx_t_1 = NULL;
16209 struct __pyx_opt_args_8PyClical_asinh __pyx_t_2;
16210 __Pyx_RefNannySetupContext(
"asinh", 0);
16211 __Pyx_XDECREF(__pyx_r);
16212 __pyx_t_2.__pyx_n = 1;
16213 __pyx_t_2.i = __pyx_v_i;
16214 __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)
16215 __Pyx_GOTREF(__pyx_t_1);
16216 __pyx_r = __pyx_t_1;
16222 __Pyx_XDECREF(__pyx_t_1);
16223 __Pyx_AddTraceback(
"PyClical.asinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16226 __Pyx_XGIVEREF(__pyx_r);
16227 __Pyx_RefNannyFinishContext();
16239 static PyObject *__pyx_pw_8PyClical_67tan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16240 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) {
16241 PyObject *__pyx_v_i = ((PyObject *)Py_None);
16242 PyObject *__pyx_r = NULL;
16243 __Pyx_RefNannyDeclarations
16246 PyObject *__pyx_t_3 = NULL;
16248 PyObject *__pyx_t_5 = NULL;
16249 PyObject *__pyx_t_6 = NULL;
16250 PyObject *__pyx_t_7 = NULL;
16251 PyObject *__pyx_t_8 = NULL;
16252 PyObject *__pyx_t_9 = NULL;
16253 PyObject *__pyx_t_10 = NULL;
16254 PyObject *__pyx_t_11 = NULL;
16255 __Pyx_RefNannySetupContext(
"tan", 0);
16256 if (__pyx_optional_args) {
16257 if (__pyx_optional_args->__pyx_n > 0) {
16258 __pyx_v_i = __pyx_optional_args->i;
16269 __pyx_t_1 = (__pyx_v_i != Py_None);
16270 __pyx_t_2 = (__pyx_t_1 != 0);
16280 __Pyx_XDECREF(__pyx_r);
16281 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1762, __pyx_L1_error)
16282 __Pyx_GOTREF(__pyx_t_3);
16284 __pyx_t_4 =
tan(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
16286 __Pyx_CppExn2PyErr();
16287 __PYX_ERR(0, 1762, __pyx_L1_error)
16289 __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)
16290 __Pyx_GOTREF(__pyx_t_5);
16291 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16292 __pyx_r = __pyx_t_5;
16314 __Pyx_PyThreadState_declare
16315 __Pyx_PyThreadState_assign
16316 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
16317 __Pyx_XGOTREF(__pyx_t_6);
16318 __Pyx_XGOTREF(__pyx_t_7);
16319 __Pyx_XGOTREF(__pyx_t_8);
16329 __Pyx_XDECREF(__pyx_r);
16330 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1765, __pyx_L4_error)
16331 __Pyx_GOTREF(__pyx_t_3);
16332 __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)
16333 __Pyx_GOTREF(__pyx_t_9);
16334 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16336 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
16337 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
16338 if (likely(__pyx_t_3)) {
16339 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
16340 __Pyx_INCREF(__pyx_t_3);
16341 __Pyx_INCREF(
function);
16342 __Pyx_DECREF_SET(__pyx_t_9,
function);
16345 __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);
16346 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16347 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1765, __pyx_L4_error)
16348 __Pyx_GOTREF(__pyx_t_5);
16349 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16350 __pyx_r = __pyx_t_5;
16352 goto __pyx_L8_try_return;
16363 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16364 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16365 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
16375 __Pyx_AddTraceback(
"PyClical.tan", __pyx_clineno, __pyx_lineno, __pyx_filename);
16376 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1766, __pyx_L6_except_error)
16377 __Pyx_GOTREF(__pyx_t_5);
16378 __Pyx_GOTREF(__pyx_t_9);
16379 __Pyx_GOTREF(__pyx_t_3);
16388 __Pyx_XDECREF(__pyx_r);
16389 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1767, __pyx_L6_except_error)
16390 __Pyx_GOTREF(__pyx_t_10);
16391 __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)
16392 __Pyx_GOTREF(__pyx_t_11);
16393 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16394 __pyx_r = __pyx_t_11;
16396 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16397 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16398 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16399 goto __pyx_L7_except_return;
16401 __pyx_L6_except_error:;
16410 __Pyx_XGIVEREF(__pyx_t_6);
16411 __Pyx_XGIVEREF(__pyx_t_7);
16412 __Pyx_XGIVEREF(__pyx_t_8);
16413 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16414 goto __pyx_L1_error;
16415 __pyx_L8_try_return:;
16416 __Pyx_XGIVEREF(__pyx_t_6);
16417 __Pyx_XGIVEREF(__pyx_t_7);
16418 __Pyx_XGIVEREF(__pyx_t_8);
16419 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16421 __pyx_L7_except_return:;
16422 __Pyx_XGIVEREF(__pyx_t_6);
16423 __Pyx_XGIVEREF(__pyx_t_7);
16424 __Pyx_XGIVEREF(__pyx_t_8);
16425 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16440 __Pyx_XDECREF(__pyx_t_3);
16441 __Pyx_XDECREF(__pyx_t_5);
16442 __Pyx_XDECREF(__pyx_t_9);
16443 __Pyx_XDECREF(__pyx_t_10);
16444 __Pyx_XDECREF(__pyx_t_11);
16445 __Pyx_AddTraceback(
"PyClical.tan", __pyx_clineno, __pyx_lineno, __pyx_filename);
16448 __Pyx_XGIVEREF(__pyx_r);
16449 __Pyx_RefNannyFinishContext();
16454 static PyObject *__pyx_pw_8PyClical_67tan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16455 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 ";
16456 static PyObject *__pyx_pw_8PyClical_67tan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16457 PyObject *__pyx_v_obj = 0;
16458 PyObject *__pyx_v_i = 0;
16459 PyObject *__pyx_r = 0;
16460 __Pyx_RefNannyDeclarations
16461 __Pyx_RefNannySetupContext(
"tan (wrapper)", 0);
16463 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
16464 PyObject* values[2] = {0,0};
16465 values[1] = ((PyObject *)Py_None);
16466 if (unlikely(__pyx_kwds)) {
16467 Py_ssize_t kw_args;
16468 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16469 switch (pos_args) {
16470 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16471 CYTHON_FALLTHROUGH;
16472 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16473 CYTHON_FALLTHROUGH;
16475 default:
goto __pyx_L5_argtuple_error;
16477 kw_args = PyDict_Size(__pyx_kwds);
16478 switch (pos_args) {
16480 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
16481 else goto __pyx_L5_argtuple_error;
16482 CYTHON_FALLTHROUGH;
16485 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
16486 if (value) { values[1] = value; kw_args--; }
16489 if (unlikely(kw_args > 0)) {
16490 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"tan") < 0)) __PYX_ERR(0, 1752, __pyx_L3_error)
16493 switch (PyTuple_GET_SIZE(__pyx_args)) {
16494 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16495 CYTHON_FALLTHROUGH;
16496 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16498 default:
goto __pyx_L5_argtuple_error;
16501 __pyx_v_obj = values[0];
16502 __pyx_v_i = values[1];
16504 goto __pyx_L4_argument_unpacking_done;
16505 __pyx_L5_argtuple_error:;
16506 __Pyx_RaiseArgtupleInvalid(
"tan", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1752, __pyx_L3_error)
16508 __Pyx_AddTraceback(
"PyClical.tan", __pyx_clineno, __pyx_lineno, __pyx_filename);
16509 __Pyx_RefNannyFinishContext();
16511 __pyx_L4_argument_unpacking_done:;
16512 __pyx_r = __pyx_pf_8PyClical_66tan(__pyx_self, __pyx_v_obj, __pyx_v_i);
16515 __Pyx_RefNannyFinishContext();
16519 static PyObject *__pyx_pf_8PyClical_66tan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
16520 PyObject *__pyx_r = NULL;
16521 __Pyx_RefNannyDeclarations
16522 PyObject *__pyx_t_1 = NULL;
16523 struct __pyx_opt_args_8PyClical_tan __pyx_t_2;
16524 __Pyx_RefNannySetupContext(
"tan", 0);
16525 __Pyx_XDECREF(__pyx_r);
16526 __pyx_t_2.__pyx_n = 1;
16527 __pyx_t_2.i = __pyx_v_i;
16528 __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)
16529 __Pyx_GOTREF(__pyx_t_1);
16530 __pyx_r = __pyx_t_1;
16536 __Pyx_XDECREF(__pyx_t_1);
16537 __Pyx_AddTraceback(
"PyClical.tan", __pyx_clineno, __pyx_lineno, __pyx_filename);
16540 __Pyx_XGIVEREF(__pyx_r);
16541 __Pyx_RefNannyFinishContext();
16553 static PyObject *__pyx_pw_8PyClical_69atan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16554 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) {
16555 PyObject *__pyx_v_i = ((PyObject *)Py_None);
16556 PyObject *__pyx_r = NULL;
16557 __Pyx_RefNannyDeclarations
16560 PyObject *__pyx_t_3 = NULL;
16562 PyObject *__pyx_t_5 = NULL;
16563 PyObject *__pyx_t_6 = NULL;
16564 PyObject *__pyx_t_7 = NULL;
16565 PyObject *__pyx_t_8 = NULL;
16566 PyObject *__pyx_t_9 = NULL;
16567 PyObject *__pyx_t_10 = NULL;
16568 PyObject *__pyx_t_11 = NULL;
16569 __Pyx_RefNannySetupContext(
"atan", 0);
16570 if (__pyx_optional_args) {
16571 if (__pyx_optional_args->__pyx_n > 0) {
16572 __pyx_v_i = __pyx_optional_args->i;
16583 __pyx_t_1 = (__pyx_v_i != Py_None);
16584 __pyx_t_2 = (__pyx_t_1 != 0);
16594 __Pyx_XDECREF(__pyx_r);
16595 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1779, __pyx_L1_error)
16596 __Pyx_GOTREF(__pyx_t_3);
16598 __pyx_t_4 =
atan(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
16600 __Pyx_CppExn2PyErr();
16601 __PYX_ERR(0, 1779, __pyx_L1_error)
16603 __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)
16604 __Pyx_GOTREF(__pyx_t_5);
16605 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16606 __pyx_r = __pyx_t_5;
16628 __Pyx_PyThreadState_declare
16629 __Pyx_PyThreadState_assign
16630 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
16631 __Pyx_XGOTREF(__pyx_t_6);
16632 __Pyx_XGOTREF(__pyx_t_7);
16633 __Pyx_XGOTREF(__pyx_t_8);
16643 __Pyx_XDECREF(__pyx_r);
16644 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1782, __pyx_L4_error)
16645 __Pyx_GOTREF(__pyx_t_3);
16646 __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)
16647 __Pyx_GOTREF(__pyx_t_9);
16648 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16650 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
16651 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
16652 if (likely(__pyx_t_3)) {
16653 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
16654 __Pyx_INCREF(__pyx_t_3);
16655 __Pyx_INCREF(
function);
16656 __Pyx_DECREF_SET(__pyx_t_9,
function);
16659 __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);
16660 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16661 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1782, __pyx_L4_error)
16662 __Pyx_GOTREF(__pyx_t_5);
16663 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16664 __pyx_r = __pyx_t_5;
16666 goto __pyx_L8_try_return;
16677 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16678 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16679 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
16689 __Pyx_AddTraceback(
"PyClical.atan", __pyx_clineno, __pyx_lineno, __pyx_filename);
16690 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1783, __pyx_L6_except_error)
16691 __Pyx_GOTREF(__pyx_t_5);
16692 __Pyx_GOTREF(__pyx_t_9);
16693 __Pyx_GOTREF(__pyx_t_3);
16702 __Pyx_XDECREF(__pyx_r);
16703 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1784, __pyx_L6_except_error)
16704 __Pyx_GOTREF(__pyx_t_10);
16705 __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)
16706 __Pyx_GOTREF(__pyx_t_11);
16707 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16708 __pyx_r = __pyx_t_11;
16710 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16711 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16712 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16713 goto __pyx_L7_except_return;
16715 __pyx_L6_except_error:;
16724 __Pyx_XGIVEREF(__pyx_t_6);
16725 __Pyx_XGIVEREF(__pyx_t_7);
16726 __Pyx_XGIVEREF(__pyx_t_8);
16727 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16728 goto __pyx_L1_error;
16729 __pyx_L8_try_return:;
16730 __Pyx_XGIVEREF(__pyx_t_6);
16731 __Pyx_XGIVEREF(__pyx_t_7);
16732 __Pyx_XGIVEREF(__pyx_t_8);
16733 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16735 __pyx_L7_except_return:;
16736 __Pyx_XGIVEREF(__pyx_t_6);
16737 __Pyx_XGIVEREF(__pyx_t_7);
16738 __Pyx_XGIVEREF(__pyx_t_8);
16739 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16754 __Pyx_XDECREF(__pyx_t_3);
16755 __Pyx_XDECREF(__pyx_t_5);
16756 __Pyx_XDECREF(__pyx_t_9);
16757 __Pyx_XDECREF(__pyx_t_10);
16758 __Pyx_XDECREF(__pyx_t_11);
16759 __Pyx_AddTraceback(
"PyClical.atan", __pyx_clineno, __pyx_lineno, __pyx_filename);
16762 __Pyx_XGIVEREF(__pyx_r);
16763 __Pyx_RefNannyFinishContext();
16768 static PyObject *__pyx_pw_8PyClical_69atan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16769 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 ";
16770 static PyObject *__pyx_pw_8PyClical_69atan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16771 PyObject *__pyx_v_obj = 0;
16772 PyObject *__pyx_v_i = 0;
16773 PyObject *__pyx_r = 0;
16774 __Pyx_RefNannyDeclarations
16775 __Pyx_RefNannySetupContext(
"atan (wrapper)", 0);
16777 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
16778 PyObject* values[2] = {0,0};
16779 values[1] = ((PyObject *)Py_None);
16780 if (unlikely(__pyx_kwds)) {
16781 Py_ssize_t kw_args;
16782 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16783 switch (pos_args) {
16784 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16785 CYTHON_FALLTHROUGH;
16786 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16787 CYTHON_FALLTHROUGH;
16789 default:
goto __pyx_L5_argtuple_error;
16791 kw_args = PyDict_Size(__pyx_kwds);
16792 switch (pos_args) {
16794 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
16795 else goto __pyx_L5_argtuple_error;
16796 CYTHON_FALLTHROUGH;
16799 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
16800 if (value) { values[1] = value; kw_args--; }
16803 if (unlikely(kw_args > 0)) {
16804 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"atan") < 0)) __PYX_ERR(0, 1769, __pyx_L3_error)
16807 switch (PyTuple_GET_SIZE(__pyx_args)) {
16808 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16809 CYTHON_FALLTHROUGH;
16810 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16812 default:
goto __pyx_L5_argtuple_error;
16815 __pyx_v_obj = values[0];
16816 __pyx_v_i = values[1];
16818 goto __pyx_L4_argument_unpacking_done;
16819 __pyx_L5_argtuple_error:;
16820 __Pyx_RaiseArgtupleInvalid(
"atan", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1769, __pyx_L3_error)
16822 __Pyx_AddTraceback(
"PyClical.atan", __pyx_clineno, __pyx_lineno, __pyx_filename);
16823 __Pyx_RefNannyFinishContext();
16825 __pyx_L4_argument_unpacking_done:;
16826 __pyx_r = __pyx_pf_8PyClical_68atan(__pyx_self, __pyx_v_obj, __pyx_v_i);
16829 __Pyx_RefNannyFinishContext();
16833 static PyObject *__pyx_pf_8PyClical_68atan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
16834 PyObject *__pyx_r = NULL;
16835 __Pyx_RefNannyDeclarations
16836 PyObject *__pyx_t_1 = NULL;
16837 struct __pyx_opt_args_8PyClical_atan __pyx_t_2;
16838 __Pyx_RefNannySetupContext(
"atan", 0);
16839 __Pyx_XDECREF(__pyx_r);
16840 __pyx_t_2.__pyx_n = 1;
16841 __pyx_t_2.i = __pyx_v_i;
16842 __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)
16843 __Pyx_GOTREF(__pyx_t_1);
16844 __pyx_r = __pyx_t_1;
16850 __Pyx_XDECREF(__pyx_t_1);
16851 __Pyx_AddTraceback(
"PyClical.atan", __pyx_clineno, __pyx_lineno, __pyx_filename);
16854 __Pyx_XGIVEREF(__pyx_r);
16855 __Pyx_RefNannyFinishContext();
16867 static PyObject *__pyx_pw_8PyClical_71tanh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
16868 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_tanh(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
16869 PyObject *__pyx_r = NULL;
16870 __Pyx_RefNannyDeclarations
16871 PyObject *__pyx_t_1 = NULL;
16872 PyObject *__pyx_t_2 = NULL;
16873 PyObject *__pyx_t_3 = NULL;
16874 PyObject *__pyx_t_4 = NULL;
16875 PyObject *__pyx_t_5 = NULL;
16876 PyObject *__pyx_t_6 = NULL;
16877 PyObject *__pyx_t_7 = NULL;
16878 PyObject *__pyx_t_8 = NULL;
16879 __Pyx_RefNannySetupContext(
"tanh", 0);
16889 __Pyx_PyThreadState_declare
16890 __Pyx_PyThreadState_assign
16891 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
16892 __Pyx_XGOTREF(__pyx_t_1);
16893 __Pyx_XGOTREF(__pyx_t_2);
16894 __Pyx_XGOTREF(__pyx_t_3);
16904 __Pyx_XDECREF(__pyx_r);
16905 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1794, __pyx_L3_error)
16906 __Pyx_GOTREF(__pyx_t_5);
16907 __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)
16908 __Pyx_GOTREF(__pyx_t_6);
16909 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16911 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
16912 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
16913 if (likely(__pyx_t_5)) {
16914 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
16915 __Pyx_INCREF(__pyx_t_5);
16916 __Pyx_INCREF(
function);
16917 __Pyx_DECREF_SET(__pyx_t_6,
function);
16920 __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);
16921 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16922 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1794, __pyx_L3_error)
16923 __Pyx_GOTREF(__pyx_t_4);
16924 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16925 __pyx_r = __pyx_t_4;
16927 goto __pyx_L7_try_return;
16938 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
16939 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16940 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
16950 __Pyx_AddTraceback(
"PyClical.tanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16951 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(0, 1795, __pyx_L5_except_error)
16952 __Pyx_GOTREF(__pyx_t_4);
16953 __Pyx_GOTREF(__pyx_t_6);
16954 __Pyx_GOTREF(__pyx_t_5);
16963 __Pyx_XDECREF(__pyx_r);
16964 __pyx_t_7 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1796, __pyx_L5_except_error)
16965 __Pyx_GOTREF(__pyx_t_7);
16966 __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)
16967 __Pyx_GOTREF(__pyx_t_8);
16968 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16969 __pyx_r = __pyx_t_8;
16971 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16972 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16973 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16974 goto __pyx_L6_except_return;
16976 __pyx_L5_except_error:;
16985 __Pyx_XGIVEREF(__pyx_t_1);
16986 __Pyx_XGIVEREF(__pyx_t_2);
16987 __Pyx_XGIVEREF(__pyx_t_3);
16988 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
16989 goto __pyx_L1_error;
16990 __pyx_L7_try_return:;
16991 __Pyx_XGIVEREF(__pyx_t_1);
16992 __Pyx_XGIVEREF(__pyx_t_2);
16993 __Pyx_XGIVEREF(__pyx_t_3);
16994 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
16996 __pyx_L6_except_return:;
16997 __Pyx_XGIVEREF(__pyx_t_1);
16998 __Pyx_XGIVEREF(__pyx_t_2);
16999 __Pyx_XGIVEREF(__pyx_t_3);
17000 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
17014 __Pyx_XDECREF(__pyx_t_4);
17015 __Pyx_XDECREF(__pyx_t_5);
17016 __Pyx_XDECREF(__pyx_t_6);
17017 __Pyx_XDECREF(__pyx_t_7);
17018 __Pyx_XDECREF(__pyx_t_8);
17019 __Pyx_AddTraceback(
"PyClical.tanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17022 __Pyx_XGIVEREF(__pyx_r);
17023 __Pyx_RefNannyFinishContext();
17028 static PyObject *__pyx_pw_8PyClical_71tanh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
17029 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 ";
17030 static PyObject *__pyx_pw_8PyClical_71tanh(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
17031 PyObject *__pyx_r = 0;
17032 __Pyx_RefNannyDeclarations
17033 __Pyx_RefNannySetupContext(
"tanh (wrapper)", 0);
17034 __pyx_r = __pyx_pf_8PyClical_70tanh(__pyx_self, ((PyObject *)__pyx_v_obj));
17037 __Pyx_RefNannyFinishContext();
17041 static PyObject *__pyx_pf_8PyClical_70tanh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
17042 PyObject *__pyx_r = NULL;
17043 __Pyx_RefNannyDeclarations
17044 PyObject *__pyx_t_1 = NULL;
17045 __Pyx_RefNannySetupContext(
"tanh", 0);
17046 __Pyx_XDECREF(__pyx_r);
17047 __pyx_t_1 = __pyx_f_8PyClical_tanh(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1786, __pyx_L1_error)
17048 __Pyx_GOTREF(__pyx_t_1);
17049 __pyx_r = __pyx_t_1;
17055 __Pyx_XDECREF(__pyx_t_1);
17056 __Pyx_AddTraceback(
"PyClical.tanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17059 __Pyx_XGIVEREF(__pyx_r);
17060 __Pyx_RefNannyFinishContext();
17072 static PyObject *__pyx_pw_8PyClical_73atanh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17073 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) {
17074 PyObject *__pyx_v_i = ((PyObject *)Py_None);
17075 PyObject *__pyx_r = NULL;
17076 __Pyx_RefNannyDeclarations
17079 PyObject *__pyx_t_3 = NULL;
17081 PyObject *__pyx_t_5 = NULL;
17082 PyObject *__pyx_t_6 = NULL;
17083 PyObject *__pyx_t_7 = NULL;
17084 PyObject *__pyx_t_8 = NULL;
17085 PyObject *__pyx_t_9 = NULL;
17086 PyObject *__pyx_t_10 = NULL;
17087 PyObject *__pyx_t_11 = NULL;
17088 __Pyx_RefNannySetupContext(
"atanh", 0);
17089 if (__pyx_optional_args) {
17090 if (__pyx_optional_args->__pyx_n > 0) {
17091 __pyx_v_i = __pyx_optional_args->i;
17102 __pyx_t_1 = (__pyx_v_i != Py_None);
17103 __pyx_t_2 = (__pyx_t_1 != 0);
17113 __Pyx_XDECREF(__pyx_r);
17114 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1808, __pyx_L1_error)
17115 __Pyx_GOTREF(__pyx_t_3);
17117 __pyx_t_4 =
atanh(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
17119 __Pyx_CppExn2PyErr();
17120 __PYX_ERR(0, 1808, __pyx_L1_error)
17122 __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)
17123 __Pyx_GOTREF(__pyx_t_5);
17124 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17125 __pyx_r = __pyx_t_5;
17147 __Pyx_PyThreadState_declare
17148 __Pyx_PyThreadState_assign
17149 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
17150 __Pyx_XGOTREF(__pyx_t_6);
17151 __Pyx_XGOTREF(__pyx_t_7);
17152 __Pyx_XGOTREF(__pyx_t_8);
17162 __Pyx_XDECREF(__pyx_r);
17163 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1811, __pyx_L4_error)
17164 __Pyx_GOTREF(__pyx_t_3);
17165 __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)
17166 __Pyx_GOTREF(__pyx_t_9);
17167 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17169 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
17170 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
17171 if (likely(__pyx_t_3)) {
17172 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
17173 __Pyx_INCREF(__pyx_t_3);
17174 __Pyx_INCREF(
function);
17175 __Pyx_DECREF_SET(__pyx_t_9,
function);
17178 __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);
17179 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17180 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1811, __pyx_L4_error)
17181 __Pyx_GOTREF(__pyx_t_5);
17182 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17183 __pyx_r = __pyx_t_5;
17185 goto __pyx_L8_try_return;
17196 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17197 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17198 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
17208 __Pyx_AddTraceback(
"PyClical.atanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17209 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1812, __pyx_L6_except_error)
17210 __Pyx_GOTREF(__pyx_t_5);
17211 __Pyx_GOTREF(__pyx_t_9);
17212 __Pyx_GOTREF(__pyx_t_3);
17221 __Pyx_XDECREF(__pyx_r);
17222 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1813, __pyx_L6_except_error)
17223 __Pyx_GOTREF(__pyx_t_10);
17224 __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)
17225 __Pyx_GOTREF(__pyx_t_11);
17226 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
17227 __pyx_r = __pyx_t_11;
17229 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17230 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17231 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17232 goto __pyx_L7_except_return;
17234 __pyx_L6_except_error:;
17243 __Pyx_XGIVEREF(__pyx_t_6);
17244 __Pyx_XGIVEREF(__pyx_t_7);
17245 __Pyx_XGIVEREF(__pyx_t_8);
17246 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17247 goto __pyx_L1_error;
17248 __pyx_L8_try_return:;
17249 __Pyx_XGIVEREF(__pyx_t_6);
17250 __Pyx_XGIVEREF(__pyx_t_7);
17251 __Pyx_XGIVEREF(__pyx_t_8);
17252 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17254 __pyx_L7_except_return:;
17255 __Pyx_XGIVEREF(__pyx_t_6);
17256 __Pyx_XGIVEREF(__pyx_t_7);
17257 __Pyx_XGIVEREF(__pyx_t_8);
17258 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17273 __Pyx_XDECREF(__pyx_t_3);
17274 __Pyx_XDECREF(__pyx_t_5);
17275 __Pyx_XDECREF(__pyx_t_9);
17276 __Pyx_XDECREF(__pyx_t_10);
17277 __Pyx_XDECREF(__pyx_t_11);
17278 __Pyx_AddTraceback(
"PyClical.atanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17281 __Pyx_XGIVEREF(__pyx_r);
17282 __Pyx_RefNannyFinishContext();
17287 static PyObject *__pyx_pw_8PyClical_73atanh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17288 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 ";
17289 static PyObject *__pyx_pw_8PyClical_73atanh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17290 PyObject *__pyx_v_obj = 0;
17291 PyObject *__pyx_v_i = 0;
17292 PyObject *__pyx_r = 0;
17293 __Pyx_RefNannyDeclarations
17294 __Pyx_RefNannySetupContext(
"atanh (wrapper)", 0);
17296 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
17297 PyObject* values[2] = {0,0};
17298 values[1] = ((PyObject *)Py_None);
17299 if (unlikely(__pyx_kwds)) {
17300 Py_ssize_t kw_args;
17301 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17302 switch (pos_args) {
17303 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17304 CYTHON_FALLTHROUGH;
17305 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17306 CYTHON_FALLTHROUGH;
17308 default:
goto __pyx_L5_argtuple_error;
17310 kw_args = PyDict_Size(__pyx_kwds);
17311 switch (pos_args) {
17313 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
17314 else goto __pyx_L5_argtuple_error;
17315 CYTHON_FALLTHROUGH;
17318 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
17319 if (value) { values[1] = value; kw_args--; }
17322 if (unlikely(kw_args > 0)) {
17323 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"atanh") < 0)) __PYX_ERR(0, 1798, __pyx_L3_error)
17326 switch (PyTuple_GET_SIZE(__pyx_args)) {
17327 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17328 CYTHON_FALLTHROUGH;
17329 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17331 default:
goto __pyx_L5_argtuple_error;
17334 __pyx_v_obj = values[0];
17335 __pyx_v_i = values[1];
17337 goto __pyx_L4_argument_unpacking_done;
17338 __pyx_L5_argtuple_error:;
17339 __Pyx_RaiseArgtupleInvalid(
"atanh", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1798, __pyx_L3_error)
17341 __Pyx_AddTraceback(
"PyClical.atanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17342 __Pyx_RefNannyFinishContext();
17344 __pyx_L4_argument_unpacking_done:;
17345 __pyx_r = __pyx_pf_8PyClical_72atanh(__pyx_self, __pyx_v_obj, __pyx_v_i);
17348 __Pyx_RefNannyFinishContext();
17352 static PyObject *__pyx_pf_8PyClical_72atanh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
17353 PyObject *__pyx_r = NULL;
17354 __Pyx_RefNannyDeclarations
17355 PyObject *__pyx_t_1 = NULL;
17356 struct __pyx_opt_args_8PyClical_atanh __pyx_t_2;
17357 __Pyx_RefNannySetupContext(
"atanh", 0);
17358 __Pyx_XDECREF(__pyx_r);
17359 __pyx_t_2.__pyx_n = 1;
17360 __pyx_t_2.i = __pyx_v_i;
17361 __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)
17362 __Pyx_GOTREF(__pyx_t_1);
17363 __pyx_r = __pyx_t_1;
17369 __Pyx_XDECREF(__pyx_t_1);
17370 __Pyx_AddTraceback(
"PyClical.atanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17373 __Pyx_XGIVEREF(__pyx_r);
17374 __Pyx_RefNannyFinishContext();
17386 static PyObject *__pyx_pw_8PyClical_75random_clifford(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17387 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) {
17388 PyObject *__pyx_v_fill = ((PyObject *)__pyx_float_1_0);
17389 PyObject *__pyx_r = NULL;
17390 __Pyx_RefNannyDeclarations
17391 PyObject *__pyx_t_1 = NULL;
17392 PyObject *__pyx_t_2 = NULL;
17394 PyObject *__pyx_t_4 = NULL;
17395 __Pyx_RefNannySetupContext(
"random_clifford", 0);
17396 if (__pyx_optional_args) {
17397 if (__pyx_optional_args->__pyx_n > 0) {
17398 __pyx_v_fill = __pyx_optional_args->fill;
17409 __Pyx_XDECREF(__pyx_r);
17410 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1822, __pyx_L1_error)
17411 __Pyx_GOTREF(__pyx_t_1);
17412 __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1822, __pyx_L1_error)
17413 __Pyx_GOTREF(__pyx_t_2);
17414 __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)
17415 __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)
17416 __Pyx_GOTREF(__pyx_t_4);
17417 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17418 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17419 __pyx_r = __pyx_t_4;
17433 __Pyx_XDECREF(__pyx_t_1);
17434 __Pyx_XDECREF(__pyx_t_2);
17435 __Pyx_XDECREF(__pyx_t_4);
17436 __Pyx_AddTraceback(
"PyClical.random_clifford", __pyx_clineno, __pyx_lineno, __pyx_filename);
17439 __Pyx_XGIVEREF(__pyx_r);
17440 __Pyx_RefNannyFinishContext();
17445 static PyObject *__pyx_pw_8PyClical_75random_clifford(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17446 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 ";
17447 static PyObject *__pyx_pw_8PyClical_75random_clifford(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17448 struct __pyx_obj_8PyClical_index_set *__pyx_v_ixt = 0;
17449 PyObject *__pyx_v_fill = 0;
17450 PyObject *__pyx_r = 0;
17451 __Pyx_RefNannyDeclarations
17452 __Pyx_RefNannySetupContext(
"random_clifford (wrapper)", 0);
17454 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ixt,&__pyx_n_s_fill,0};
17455 PyObject* values[2] = {0,0};
17456 values[1] = ((PyObject *)__pyx_float_1_0);
17457 if (unlikely(__pyx_kwds)) {
17458 Py_ssize_t kw_args;
17459 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17460 switch (pos_args) {
17461 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17462 CYTHON_FALLTHROUGH;
17463 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17464 CYTHON_FALLTHROUGH;
17466 default:
goto __pyx_L5_argtuple_error;
17468 kw_args = PyDict_Size(__pyx_kwds);
17469 switch (pos_args) {
17471 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ixt)) != 0)) kw_args--;
17472 else goto __pyx_L5_argtuple_error;
17473 CYTHON_FALLTHROUGH;
17476 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fill);
17477 if (value) { values[1] = value; kw_args--; }
17480 if (unlikely(kw_args > 0)) {
17481 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"random_clifford") < 0)) __PYX_ERR(0, 1815, __pyx_L3_error)
17484 switch (PyTuple_GET_SIZE(__pyx_args)) {
17485 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17486 CYTHON_FALLTHROUGH;
17487 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17489 default:
goto __pyx_L5_argtuple_error;
17492 __pyx_v_ixt = ((
struct __pyx_obj_8PyClical_index_set *)values[0]);
17493 __pyx_v_fill = values[1];
17495 goto __pyx_L4_argument_unpacking_done;
17496 __pyx_L5_argtuple_error:;
17497 __Pyx_RaiseArgtupleInvalid(
"random_clifford", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1815, __pyx_L3_error)
17499 __Pyx_AddTraceback(
"PyClical.random_clifford", __pyx_clineno, __pyx_lineno, __pyx_filename);
17500 __Pyx_RefNannyFinishContext();
17502 __pyx_L4_argument_unpacking_done:;
17503 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ixt), __pyx_ptype_8PyClical_index_set, 1,
"ixt", 0))) __PYX_ERR(0, 1815, __pyx_L1_error)
17504 __pyx_r = __pyx_pf_8PyClical_74random_clifford(__pyx_self, __pyx_v_ixt, __pyx_v_fill);
17511 __Pyx_RefNannyFinishContext();
17515 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) {
17516 PyObject *__pyx_r = NULL;
17517 __Pyx_RefNannyDeclarations
17518 PyObject *__pyx_t_1 = NULL;
17519 struct __pyx_opt_args_8PyClical_random_clifford __pyx_t_2;
17520 __Pyx_RefNannySetupContext(
"random_clifford", 0);
17521 __Pyx_XDECREF(__pyx_r);
17522 __pyx_t_2.__pyx_n = 1;
17523 __pyx_t_2.fill = __pyx_v_fill;
17524 __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)
17525 __Pyx_GOTREF(__pyx_t_1);
17526 __pyx_r = __pyx_t_1;
17532 __Pyx_XDECREF(__pyx_t_1);
17533 __Pyx_AddTraceback(
"PyClical.random_clifford", __pyx_clineno, __pyx_lineno, __pyx_filename);
17536 __Pyx_XGIVEREF(__pyx_r);
17537 __Pyx_RefNannyFinishContext();
17549 static PyObject *__pyx_pw_8PyClical_77cga3(PyObject *__pyx_self, PyObject *__pyx_v_obj);
17550 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cga3(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
17551 PyObject *__pyx_r = NULL;
17552 __Pyx_RefNannyDeclarations
17553 PyObject *__pyx_t_1 = NULL;
17554 PyObject *__pyx_t_2 = NULL;
17555 __Pyx_RefNannySetupContext(
"cga3", 0);
17564 __Pyx_XDECREF(__pyx_r);
17565 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1831, __pyx_L1_error)
17566 __Pyx_GOTREF(__pyx_t_1);
17567 __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)
17568 __Pyx_GOTREF(__pyx_t_2);
17569 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17570 __pyx_r = __pyx_t_2;
17584 __Pyx_XDECREF(__pyx_t_1);
17585 __Pyx_XDECREF(__pyx_t_2);
17586 __Pyx_AddTraceback(
"PyClical.cga3", __pyx_clineno, __pyx_lineno, __pyx_filename);
17589 __Pyx_XGIVEREF(__pyx_r);
17590 __Pyx_RefNannyFinishContext();
17595 static PyObject *__pyx_pw_8PyClical_77cga3(PyObject *__pyx_self, PyObject *__pyx_v_obj);
17596 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 ";
17597 static PyObject *__pyx_pw_8PyClical_77cga3(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
17598 PyObject *__pyx_r = 0;
17599 __Pyx_RefNannyDeclarations
17600 __Pyx_RefNannySetupContext(
"cga3 (wrapper)", 0);
17601 __pyx_r = __pyx_pf_8PyClical_76cga3(__pyx_self, ((PyObject *)__pyx_v_obj));
17604 __Pyx_RefNannyFinishContext();
17608 static PyObject *__pyx_pf_8PyClical_76cga3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
17609 PyObject *__pyx_r = NULL;
17610 __Pyx_RefNannyDeclarations
17611 PyObject *__pyx_t_1 = NULL;
17612 __Pyx_RefNannySetupContext(
"cga3", 0);
17613 __Pyx_XDECREF(__pyx_r);
17614 __pyx_t_1 = __pyx_f_8PyClical_cga3(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1824, __pyx_L1_error)
17615 __Pyx_GOTREF(__pyx_t_1);
17616 __pyx_r = __pyx_t_1;
17622 __Pyx_XDECREF(__pyx_t_1);
17623 __Pyx_AddTraceback(
"PyClical.cga3", __pyx_clineno, __pyx_lineno, __pyx_filename);
17626 __Pyx_XGIVEREF(__pyx_r);
17627 __Pyx_RefNannyFinishContext();
17639 static PyObject *__pyx_pw_8PyClical_79cga3std(PyObject *__pyx_self, PyObject *__pyx_v_obj);
17640 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cga3std(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
17641 PyObject *__pyx_r = NULL;
17642 __Pyx_RefNannyDeclarations
17643 PyObject *__pyx_t_1 = NULL;
17644 PyObject *__pyx_t_2 = NULL;
17645 __Pyx_RefNannySetupContext(
"cga3std", 0);
17654 __Pyx_XDECREF(__pyx_r);
17655 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1842, __pyx_L1_error)
17656 __Pyx_GOTREF(__pyx_t_1);
17657 __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)
17658 __Pyx_GOTREF(__pyx_t_2);
17659 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17660 __pyx_r = __pyx_t_2;
17674 __Pyx_XDECREF(__pyx_t_1);
17675 __Pyx_XDECREF(__pyx_t_2);
17676 __Pyx_AddTraceback(
"PyClical.cga3std", __pyx_clineno, __pyx_lineno, __pyx_filename);
17679 __Pyx_XGIVEREF(__pyx_r);
17680 __Pyx_RefNannyFinishContext();
17685 static PyObject *__pyx_pw_8PyClical_79cga3std(PyObject *__pyx_self, PyObject *__pyx_v_obj);
17686 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 ";
17687 static PyObject *__pyx_pw_8PyClical_79cga3std(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
17688 PyObject *__pyx_r = 0;
17689 __Pyx_RefNannyDeclarations
17690 __Pyx_RefNannySetupContext(
"cga3std (wrapper)", 0);
17691 __pyx_r = __pyx_pf_8PyClical_78cga3std(__pyx_self, ((PyObject *)__pyx_v_obj));
17694 __Pyx_RefNannyFinishContext();
17698 static PyObject *__pyx_pf_8PyClical_78cga3std(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
17699 PyObject *__pyx_r = NULL;
17700 __Pyx_RefNannyDeclarations
17701 PyObject *__pyx_t_1 = NULL;
17702 __Pyx_RefNannySetupContext(
"cga3std", 0);
17703 __Pyx_XDECREF(__pyx_r);
17704 __pyx_t_1 = __pyx_f_8PyClical_cga3std(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1833, __pyx_L1_error)
17705 __Pyx_GOTREF(__pyx_t_1);
17706 __pyx_r = __pyx_t_1;
17712 __Pyx_XDECREF(__pyx_t_1);
17713 __Pyx_AddTraceback(
"PyClical.cga3std", __pyx_clineno, __pyx_lineno, __pyx_filename);
17716 __Pyx_XGIVEREF(__pyx_r);
17717 __Pyx_RefNannyFinishContext();
17729 static PyObject *__pyx_pw_8PyClical_81agc3(PyObject *__pyx_self, PyObject *__pyx_v_obj);
17730 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_agc3(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
17731 PyObject *__pyx_r = NULL;
17732 __Pyx_RefNannyDeclarations
17733 PyObject *__pyx_t_1 = NULL;
17734 PyObject *__pyx_t_2 = NULL;
17735 __Pyx_RefNannySetupContext(
"agc3", 0);
17744 __Pyx_XDECREF(__pyx_r);
17745 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1853, __pyx_L1_error)
17746 __Pyx_GOTREF(__pyx_t_1);
17747 __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)
17748 __Pyx_GOTREF(__pyx_t_2);
17749 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17750 __pyx_r = __pyx_t_2;
17764 __Pyx_XDECREF(__pyx_t_1);
17765 __Pyx_XDECREF(__pyx_t_2);
17766 __Pyx_AddTraceback(
"PyClical.agc3", __pyx_clineno, __pyx_lineno, __pyx_filename);
17769 __Pyx_XGIVEREF(__pyx_r);
17770 __Pyx_RefNannyFinishContext();
17775 static PyObject *__pyx_pw_8PyClical_81agc3(PyObject *__pyx_self, PyObject *__pyx_v_obj);
17776 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 ";
17777 static PyObject *__pyx_pw_8PyClical_81agc3(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
17778 PyObject *__pyx_r = 0;
17779 __Pyx_RefNannyDeclarations
17780 __Pyx_RefNannySetupContext(
"agc3 (wrapper)", 0);
17781 __pyx_r = __pyx_pf_8PyClical_80agc3(__pyx_self, ((PyObject *)__pyx_v_obj));
17784 __Pyx_RefNannyFinishContext();
17788 static PyObject *__pyx_pf_8PyClical_80agc3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
17789 PyObject *__pyx_r = NULL;
17790 __Pyx_RefNannyDeclarations
17791 PyObject *__pyx_t_1 = NULL;
17792 __Pyx_RefNannySetupContext(
"agc3", 0);
17793 __Pyx_XDECREF(__pyx_r);
17794 __pyx_t_1 = __pyx_f_8PyClical_agc3(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1844, __pyx_L1_error)
17795 __Pyx_GOTREF(__pyx_t_1);
17796 __pyx_r = __pyx_t_1;
17802 __Pyx_XDECREF(__pyx_t_1);
17803 __Pyx_AddTraceback(
"PyClical.agc3", __pyx_clineno, __pyx_lineno, __pyx_filename);
17806 __Pyx_XGIVEREF(__pyx_r);
17807 __Pyx_RefNannyFinishContext();
17820 static PyObject *__pyx_pw_8PyClical_83e(PyObject *__pyx_self, PyObject *__pyx_v_obj);
17821 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 ";
17822 static PyMethodDef __pyx_mdef_8PyClical_83e = {
"e", (PyCFunction)__pyx_pw_8PyClical_83e, METH_O, __pyx_doc_8PyClical_82e};
17823 static PyObject *__pyx_pw_8PyClical_83e(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
17824 PyObject *__pyx_r = 0;
17825 __Pyx_RefNannyDeclarations
17826 __Pyx_RefNannySetupContext(
"e (wrapper)", 0);
17827 __pyx_r = __pyx_pf_8PyClical_82e(__pyx_self, ((PyObject *)__pyx_v_obj));
17830 __Pyx_RefNannyFinishContext();
17834 static PyObject *__pyx_pf_8PyClical_82e(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
17835 PyObject *__pyx_r = NULL;
17836 __Pyx_RefNannyDeclarations
17837 PyObject *__pyx_t_1 = NULL;
17838 PyObject *__pyx_t_2 = NULL;
17839 __Pyx_RefNannySetupContext(
"e", 0);
17848 __Pyx_XDECREF(__pyx_r);
17849 __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)
17850 __Pyx_GOTREF(__pyx_t_1);
17851 __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)
17852 __Pyx_GOTREF(__pyx_t_2);
17853 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17854 __pyx_r = __pyx_t_2;
17868 __Pyx_XDECREF(__pyx_t_1);
17869 __Pyx_XDECREF(__pyx_t_2);
17870 __Pyx_AddTraceback(
"PyClical.e", __pyx_clineno, __pyx_lineno, __pyx_filename);
17873 __Pyx_XGIVEREF(__pyx_r);
17874 __Pyx_RefNannyFinishContext();
17887 static PyObject *__pyx_pw_8PyClical_85istpq(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17888 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 ";
17889 static PyMethodDef __pyx_mdef_8PyClical_85istpq = {
"istpq", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_85istpq, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_84istpq};
17890 static PyObject *__pyx_pw_8PyClical_85istpq(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17891 PyObject *__pyx_v_p = 0;
17892 PyObject *__pyx_v_q = 0;
17893 PyObject *__pyx_r = 0;
17894 __Pyx_RefNannyDeclarations
17895 __Pyx_RefNannySetupContext(
"istpq (wrapper)", 0);
17897 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,&__pyx_n_s_q,0};
17898 PyObject* values[2] = {0,0};
17899 if (unlikely(__pyx_kwds)) {
17900 Py_ssize_t kw_args;
17901 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17902 switch (pos_args) {
17903 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17904 CYTHON_FALLTHROUGH;
17905 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17906 CYTHON_FALLTHROUGH;
17908 default:
goto __pyx_L5_argtuple_error;
17910 kw_args = PyDict_Size(__pyx_kwds);
17911 switch (pos_args) {
17913 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p)) != 0)) kw_args--;
17914 else goto __pyx_L5_argtuple_error;
17915 CYTHON_FALLTHROUGH;
17917 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q)) != 0)) kw_args--;
17919 __Pyx_RaiseArgtupleInvalid(
"istpq", 1, 2, 2, 1); __PYX_ERR(0, 1900, __pyx_L3_error)
17922 if (unlikely(kw_args > 0)) {
17923 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"istpq") < 0)) __PYX_ERR(0, 1900, __pyx_L3_error)
17925 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
17926 goto __pyx_L5_argtuple_error;
17928 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17929 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17931 __pyx_v_p = values[0];
17932 __pyx_v_q = values[1];
17934 goto __pyx_L4_argument_unpacking_done;
17935 __pyx_L5_argtuple_error:;
17936 __Pyx_RaiseArgtupleInvalid(
"istpq", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1900, __pyx_L3_error)
17938 __Pyx_AddTraceback(
"PyClical.istpq", __pyx_clineno, __pyx_lineno, __pyx_filename);
17939 __Pyx_RefNannyFinishContext();
17941 __pyx_L4_argument_unpacking_done:;
17942 __pyx_r = __pyx_pf_8PyClical_84istpq(__pyx_self, __pyx_v_p, __pyx_v_q);
17945 __Pyx_RefNannyFinishContext();
17949 static PyObject *__pyx_pf_8PyClical_84istpq(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_p, PyObject *__pyx_v_q) {
17950 PyObject *__pyx_r = NULL;
17951 __Pyx_RefNannyDeclarations
17952 PyObject *__pyx_t_1 = NULL;
17953 PyObject *__pyx_t_2 = NULL;
17954 PyObject *__pyx_t_3 = NULL;
17955 __Pyx_RefNannySetupContext(
"istpq", 0);
17964 __Pyx_XDECREF(__pyx_r);
17965 __pyx_t_1 = PyNumber_Negative(__pyx_v_q);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1907, __pyx_L1_error)
17966 __Pyx_GOTREF(__pyx_t_1);
17967 __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)
17968 __Pyx_GOTREF(__pyx_t_2);
17969 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1907, __pyx_L1_error)
17970 __Pyx_GOTREF(__pyx_t_3);
17971 __Pyx_GIVEREF(__pyx_t_1);
17972 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
17973 __Pyx_GIVEREF(__pyx_t_2);
17974 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
17977 __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)
17978 __Pyx_GOTREF(__pyx_t_2);
17979 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17980 __pyx_t_3 = PySet_New(__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1907, __pyx_L1_error)
17981 __Pyx_GOTREF(__pyx_t_3);
17982 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17983 __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)
17984 __Pyx_GOTREF(__pyx_t_2);
17985 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17986 __pyx_r = __pyx_t_2;
18000 __Pyx_XDECREF(__pyx_t_1);
18001 __Pyx_XDECREF(__pyx_t_2);
18002 __Pyx_XDECREF(__pyx_t_3);
18003 __Pyx_AddTraceback(
"PyClical.istpq", __pyx_clineno, __pyx_lineno, __pyx_filename);
18006 __Pyx_XGIVEREF(__pyx_r);
18007 __Pyx_RefNannyFinishContext();
18020 static PyObject *__pyx_pw_8PyClical_87_test(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused);
18021 static PyMethodDef __pyx_mdef_8PyClical_87_test = {
"_test", (PyCFunction)__pyx_pw_8PyClical_87_test, METH_NOARGS, 0};
18022 static PyObject *__pyx_pw_8PyClical_87_test(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
18023 PyObject *__pyx_r = 0;
18024 __Pyx_RefNannyDeclarations
18025 __Pyx_RefNannySetupContext(
"_test (wrapper)", 0);
18026 __pyx_r = __pyx_pf_8PyClical_86_test(__pyx_self);
18029 __Pyx_RefNannyFinishContext();
18033 static PyObject *__pyx_pf_8PyClical_86_test(CYTHON_UNUSED PyObject *__pyx_self) {
18034 PyObject *__pyx_v_PyClical = NULL;
18035 PyObject *__pyx_v_doctest = NULL;
18036 PyObject *__pyx_r = NULL;
18037 __Pyx_RefNannyDeclarations
18038 PyObject *__pyx_t_1 = NULL;
18039 PyObject *__pyx_t_2 = NULL;
18040 PyObject *__pyx_t_3 = NULL;
18041 __Pyx_RefNannySetupContext(
"_test", 0);
18050 __pyx_t_1 = __Pyx_Import(__pyx_n_s_PyClical, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1914, __pyx_L1_error)
18051 __Pyx_GOTREF(__pyx_t_1);
18052 __pyx_v_PyClical = __pyx_t_1;
18054 __pyx_t_1 = __Pyx_Import(__pyx_n_s_doctest, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1914, __pyx_L1_error)
18055 __Pyx_GOTREF(__pyx_t_1);
18056 __pyx_v_doctest = __pyx_t_1;
18066 __Pyx_XDECREF(__pyx_r);
18067 __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)
18068 __Pyx_GOTREF(__pyx_t_2);
18070 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
18071 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
18072 if (likely(__pyx_t_3)) {
18073 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
18074 __Pyx_INCREF(__pyx_t_3);
18075 __Pyx_INCREF(
function);
18076 __Pyx_DECREF_SET(__pyx_t_2,
function);
18079 __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);
18080 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18081 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1915, __pyx_L1_error)
18082 __Pyx_GOTREF(__pyx_t_1);
18083 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18084 __pyx_r = __pyx_t_1;
18098 __Pyx_XDECREF(__pyx_t_1);
18099 __Pyx_XDECREF(__pyx_t_2);
18100 __Pyx_XDECREF(__pyx_t_3);
18101 __Pyx_AddTraceback(
"PyClical._test", __pyx_clineno, __pyx_lineno, __pyx_filename);
18104 __Pyx_XDECREF(__pyx_v_PyClical);
18105 __Pyx_XDECREF(__pyx_v_doctest);
18106 __Pyx_XGIVEREF(__pyx_r);
18107 __Pyx_RefNannyFinishContext();
18110 static struct __pyx_vtabstruct_8PyClical_index_set __pyx_vtable_8PyClical_index_set;
18112 static PyObject *__pyx_tp_new_8PyClical_index_set(PyTypeObject *t, PyObject *a, PyObject *k) {
18113 struct __pyx_obj_8PyClical_index_set *p;
18115 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
18116 o = (*t->tp_alloc)(t, 0);
18118 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
18120 if (unlikely(!o))
return 0;
18121 p = ((
struct __pyx_obj_8PyClical_index_set *)o);
18122 p->__pyx_vtab = __pyx_vtabptr_8PyClical_index_set;
18123 if (unlikely(__pyx_pw_8PyClical_9index_set_3__cinit__(o, a, k) < 0))
goto bad;
18126 Py_DECREF(o); o = 0;
18130 static void __pyx_tp_dealloc_8PyClical_index_set(PyObject *o) {
18131 #if CYTHON_USE_TP_FINALIZE 18132 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))) {
18133 if (PyObject_CallFinalizerFromDealloc(o))
return;
18137 PyObject *etype, *eval, *etb;
18138 PyErr_Fetch(&etype, &eval, &etb);
18140 __pyx_pw_8PyClical_9index_set_5__dealloc__(o);
18142 PyErr_Restore(etype, eval, etb);
18144 (*Py_TYPE(o)->tp_free)(o);
18146 static PyObject *__pyx_sq_item_8PyClical_index_set(PyObject *o, Py_ssize_t
i) {
18148 PyObject *x = PyInt_FromSsize_t(
i);
if(!x)
return 0;
18149 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
18154 static int __pyx_mp_ass_subscript_8PyClical_index_set(PyObject *o, PyObject *
i, PyObject *v) {
18156 return __pyx_pw_8PyClical_9index_set_9__setitem__(o,
i, v);
18159 PyErr_Format(PyExc_NotImplementedError,
18160 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
18165 static PyMethodDef __pyx_methods_8PyClical_index_set[] = {
18166 {
"copy", (PyCFunction)__pyx_pw_8PyClical_9index_set_1copy, METH_NOARGS, __pyx_doc_8PyClical_9index_set_copy},
18167 {
"count", (PyCFunction)__pyx_pw_8PyClical_9index_set_32count, METH_NOARGS, __pyx_doc_8PyClical_9index_set_31count},
18168 {
"count_neg", (PyCFunction)__pyx_pw_8PyClical_9index_set_34count_neg, METH_NOARGS, __pyx_doc_8PyClical_9index_set_33count_neg},
18169 {
"count_pos", (PyCFunction)__pyx_pw_8PyClical_9index_set_36count_pos, METH_NOARGS, __pyx_doc_8PyClical_9index_set_35count_pos},
18170 {
"min", (PyCFunction)__pyx_pw_8PyClical_9index_set_38min, METH_NOARGS, __pyx_doc_8PyClical_9index_set_37min},
18171 {
"max", (PyCFunction)__pyx_pw_8PyClical_9index_set_40max, METH_NOARGS, __pyx_doc_8PyClical_9index_set_39max},
18172 {
"hash_fn", (PyCFunction)__pyx_pw_8PyClical_9index_set_42hash_fn, METH_NOARGS, __pyx_doc_8PyClical_9index_set_41hash_fn},
18173 {
"sign_of_mult", (PyCFunction)__pyx_pw_8PyClical_9index_set_44sign_of_mult, METH_O, __pyx_doc_8PyClical_9index_set_43sign_of_mult},
18174 {
"sign_of_square", (PyCFunction)__pyx_pw_8PyClical_9index_set_46sign_of_square, METH_NOARGS, __pyx_doc_8PyClical_9index_set_45sign_of_square},
18175 {
"__reduce_cython__", (PyCFunction)__pyx_pw_8PyClical_9index_set_52__reduce_cython__, METH_NOARGS, 0},
18176 {
"__setstate_cython__", (PyCFunction)__pyx_pw_8PyClical_9index_set_54__setstate_cython__, METH_O, 0},
18180 static PyNumberMethods __pyx_tp_as_number_index_set = {
18184 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18194 __pyx_pw_8PyClical_9index_set_18__invert__,
18197 __pyx_pw_8PyClical_9index_set_24__and__,
18198 __pyx_pw_8PyClical_9index_set_20__xor__,
18199 __pyx_pw_8PyClical_9index_set_28__or__,
18200 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18204 #if PY_MAJOR_VERSION < 3 18210 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18213 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18219 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18226 __pyx_pw_8PyClical_9index_set_26__iand__,
18227 __pyx_pw_8PyClical_9index_set_22__ixor__,
18228 __pyx_pw_8PyClical_9index_set_30__ior__,
18234 #if PY_VERSION_HEX >= 0x03050000 18237 #if PY_VERSION_HEX >= 0x03050000 18242 static PySequenceMethods __pyx_tp_as_sequence_index_set = {
18246 __pyx_sq_item_8PyClical_index_set,
18250 __pyx_pw_8PyClical_9index_set_13__contains__,
18255 static PyMappingMethods __pyx_tp_as_mapping_index_set = {
18257 __pyx_pw_8PyClical_9index_set_11__getitem__,
18258 __pyx_mp_ass_subscript_8PyClical_index_set,
18261 static PyTypeObject __pyx_type_8PyClical_index_set = {
18262 PyVarObject_HEAD_INIT(0, 0)
18263 "PyClical.index_set",
18264 sizeof(
struct __pyx_obj_8PyClical_index_set),
18266 __pyx_tp_dealloc_8PyClical_index_set,
18270 #if PY_MAJOR_VERSION < 3
18273 #if PY_MAJOR_VERSION >= 3
18276 __pyx_pw_8PyClical_9index_set_48__repr__,
18277 &__pyx_tp_as_number_index_set,
18278 &__pyx_tp_as_sequence_index_set,
18279 &__pyx_tp_as_mapping_index_set,
18282 __pyx_pw_8PyClical_9index_set_50__str__,
18286 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
18287 "\n Python class index_set wraps C++ class IndexSet.\n ",
18290 __pyx_pw_8PyClical_9index_set_7__richcmp__,
18292 __pyx_pw_8PyClical_9index_set_15__iter__,
18294 __pyx_methods_8PyClical_index_set,
18304 __pyx_tp_new_8PyClical_index_set,
18314 #if PY_VERSION_HEX >= 0x030400a1 18318 static struct __pyx_vtabstruct_8PyClical_clifford __pyx_vtable_8PyClical_clifford;
18320 static PyObject *__pyx_tp_new_8PyClical_clifford(PyTypeObject *t, PyObject *a, PyObject *k) {
18321 struct __pyx_obj_8PyClical_clifford *p;
18323 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
18324 o = (*t->tp_alloc)(t, 0);
18326 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
18328 if (unlikely(!o))
return 0;
18329 p = ((
struct __pyx_obj_8PyClical_clifford *)o);
18330 p->__pyx_vtab = __pyx_vtabptr_8PyClical_clifford;
18331 if (unlikely(__pyx_pw_8PyClical_8clifford_3__cinit__(o, a, k) < 0))
goto bad;
18334 Py_DECREF(o); o = 0;
18338 static void __pyx_tp_dealloc_8PyClical_clifford(PyObject *o) {
18339 #if CYTHON_USE_TP_FINALIZE 18340 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))) {
18341 if (PyObject_CallFinalizerFromDealloc(o))
return;
18345 PyObject *etype, *eval, *etb;
18346 PyErr_Fetch(&etype, &eval, &etb);
18348 __pyx_pw_8PyClical_8clifford_5__dealloc__(o);
18350 PyErr_Restore(etype, eval, etb);
18352 (*Py_TYPE(o)->tp_free)(o);
18354 static PyObject *__pyx_sq_item_8PyClical_clifford(PyObject *o, Py_ssize_t
i) {
18356 PyObject *x = PyInt_FromSsize_t(
i);
if(!x)
return 0;
18357 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
18362 static PyMethodDef __pyx_methods_8PyClical_clifford[] = {
18363 {
"copy", (PyCFunction)__pyx_pw_8PyClical_8clifford_1copy, METH_NOARGS, __pyx_doc_8PyClical_8clifford_copy},
18364 {
"reframe", (PyCFunction)__pyx_pw_8PyClical_8clifford_11reframe, METH_O, __pyx_doc_8PyClical_8clifford_10reframe},
18365 {
"inv", (PyCFunction)__pyx_pw_8PyClical_8clifford_49inv, METH_NOARGS, __pyx_doc_8PyClical_8clifford_48inv},
18366 {
"pow", (PyCFunction)__pyx_pw_8PyClical_8clifford_57pow, METH_O, __pyx_doc_8PyClical_8clifford_56pow},
18367 {
"outer_pow", (PyCFunction)__pyx_pw_8PyClical_8clifford_59outer_pow, METH_O, __pyx_doc_8PyClical_8clifford_58outer_pow},
18368 {
"scalar", (PyCFunction)__pyx_pw_8PyClical_8clifford_63scalar, METH_NOARGS, __pyx_doc_8PyClical_8clifford_62scalar},
18369 {
"pure", (PyCFunction)__pyx_pw_8PyClical_8clifford_65pure, METH_NOARGS, __pyx_doc_8PyClical_8clifford_64pure},
18370 {
"even", (PyCFunction)__pyx_pw_8PyClical_8clifford_67even, METH_NOARGS, __pyx_doc_8PyClical_8clifford_66even},
18371 {
"odd", (PyCFunction)__pyx_pw_8PyClical_8clifford_69odd, METH_NOARGS, __pyx_doc_8PyClical_8clifford_68odd},
18372 {
"vector_part", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_8clifford_71vector_part, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_8clifford_70vector_part},
18373 {
"involute", (PyCFunction)__pyx_pw_8PyClical_8clifford_73involute, METH_NOARGS, __pyx_doc_8PyClical_8clifford_72involute},
18374 {
"reverse", (PyCFunction)__pyx_pw_8PyClical_8clifford_75reverse, METH_NOARGS, __pyx_doc_8PyClical_8clifford_74reverse},
18375 {
"conj", (PyCFunction)__pyx_pw_8PyClical_8clifford_77conj, METH_NOARGS, __pyx_doc_8PyClical_8clifford_76conj},
18376 {
"quad", (PyCFunction)__pyx_pw_8PyClical_8clifford_79quad, METH_NOARGS, __pyx_doc_8PyClical_8clifford_78quad},
18377 {
"norm", (PyCFunction)__pyx_pw_8PyClical_8clifford_81norm, METH_NOARGS, __pyx_doc_8PyClical_8clifford_80norm},
18378 {
"abs", (PyCFunction)__pyx_pw_8PyClical_8clifford_83abs, METH_NOARGS, __pyx_doc_8PyClical_8clifford_82abs},
18379 {
"max_abs", (PyCFunction)__pyx_pw_8PyClical_8clifford_85max_abs, METH_NOARGS, __pyx_doc_8PyClical_8clifford_84max_abs},
18380 {
"truncated", (PyCFunction)__pyx_pw_8PyClical_8clifford_87truncated, METH_O, __pyx_doc_8PyClical_8clifford_86truncated},
18381 {
"isnan", (PyCFunction)__pyx_pw_8PyClical_8clifford_89isnan, METH_NOARGS, __pyx_doc_8PyClical_8clifford_88isnan},
18382 {
"frame", (PyCFunction)__pyx_pw_8PyClical_8clifford_91frame, METH_NOARGS, __pyx_doc_8PyClical_8clifford_90frame},
18383 {
"__reduce_cython__", (PyCFunction)__pyx_pw_8PyClical_8clifford_97__reduce_cython__, METH_NOARGS, 0},
18384 {
"__setstate_cython__", (PyCFunction)__pyx_pw_8PyClical_8clifford_99__setstate_cython__, METH_O, 0},
18388 static PyNumberMethods __pyx_tp_as_number_clifford = {
18389 __pyx_pw_8PyClical_8clifford_21__add__,
18390 __pyx_pw_8PyClical_8clifford_25__sub__,
18391 __pyx_pw_8PyClical_8clifford_29__mul__,
18392 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18393 __pyx_pw_8PyClical_8clifford_45__div__,
18395 __pyx_pw_8PyClical_8clifford_33__mod__,
18397 __pyx_pw_8PyClical_8clifford_55__pow__,
18398 __pyx_pw_8PyClical_8clifford_17__neg__,
18399 __pyx_pw_8PyClical_8clifford_19__pos__,
18405 __pyx_pw_8PyClical_8clifford_37__and__,
18406 __pyx_pw_8PyClical_8clifford_41__xor__,
18407 __pyx_pw_8PyClical_8clifford_51__or__,
18408 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18412 #if PY_MAJOR_VERSION < 3 18418 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18421 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18424 __pyx_pw_8PyClical_8clifford_23__iadd__,
18425 __pyx_pw_8PyClical_8clifford_27__isub__,
18426 __pyx_pw_8PyClical_8clifford_31__imul__,
18427 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18428 __pyx_pw_8PyClical_8clifford_47__idiv__,
18430 __pyx_pw_8PyClical_8clifford_35__imod__,
18434 __pyx_pw_8PyClical_8clifford_39__iand__,
18435 __pyx_pw_8PyClical_8clifford_43__ixor__,
18436 __pyx_pw_8PyClical_8clifford_53__ior__,
18442 #if PY_VERSION_HEX >= 0x03050000 18445 #if PY_VERSION_HEX >= 0x03050000 18450 static PySequenceMethods __pyx_tp_as_sequence_clifford = {
18454 __pyx_sq_item_8PyClical_clifford,
18458 __pyx_pw_8PyClical_8clifford_7__contains__,
18463 static PyMappingMethods __pyx_tp_as_mapping_clifford = {
18465 __pyx_pw_8PyClical_8clifford_15__getitem__,
18469 static PyTypeObject __pyx_type_8PyClical_clifford = {
18470 PyVarObject_HEAD_INIT(0, 0)
18471 "PyClical.clifford",
18472 sizeof(
struct __pyx_obj_8PyClical_clifford),
18474 __pyx_tp_dealloc_8PyClical_clifford,
18478 #if PY_MAJOR_VERSION < 3
18481 #if PY_MAJOR_VERSION >= 3
18484 __pyx_pw_8PyClical_8clifford_93__repr__,
18485 &__pyx_tp_as_number_clifford,
18486 &__pyx_tp_as_sequence_clifford,
18487 &__pyx_tp_as_mapping_clifford,
18489 __pyx_pw_8PyClical_8clifford_61__call__,
18490 __pyx_pw_8PyClical_8clifford_95__str__,
18494 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
18495 "\n Python class clifford wraps C++ class Clifford.\n ",
18498 __pyx_pw_8PyClical_8clifford_13__richcmp__,
18500 __pyx_pw_8PyClical_8clifford_9__iter__,
18502 __pyx_methods_8PyClical_clifford,
18512 __pyx_tp_new_8PyClical_clifford,
18522 #if PY_VERSION_HEX >= 0x030400a1 18527 static struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *__pyx_freelist_8PyClical___pyx_scope_struct____iter__[8];
18528 static int __pyx_freecount_8PyClical___pyx_scope_struct____iter__ = 0;
18530 static PyObject *__pyx_tp_new_8PyClical___pyx_scope_struct____iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
18532 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__)))) {
18533 o = (PyObject*)__pyx_freelist_8PyClical___pyx_scope_struct____iter__[--__pyx_freecount_8PyClical___pyx_scope_struct____iter__];
18534 memset(o, 0,
sizeof(
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__));
18535 (void) PyObject_INIT(o, t);
18536 PyObject_GC_Track(o);
18538 o = (*t->tp_alloc)(t, 0);
18539 if (unlikely(!o))
return 0;
18544 static void __pyx_tp_dealloc_8PyClical___pyx_scope_struct____iter__(PyObject *o) {
18545 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *p = (
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)o;
18546 PyObject_GC_UnTrack(o);
18547 Py_CLEAR(p->__pyx_v_idx);
18548 Py_CLEAR(p->__pyx_v_self);
18549 Py_CLEAR(p->__pyx_t_0);
18550 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__)))) {
18551 __pyx_freelist_8PyClical___pyx_scope_struct____iter__[__pyx_freecount_8PyClical___pyx_scope_struct____iter__++] = ((
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)o);
18553 (*Py_TYPE(o)->tp_free)(o);
18557 static int __pyx_tp_traverse_8PyClical___pyx_scope_struct____iter__(PyObject *o, visitproc v,
void *a) {
18559 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *p = (
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)o;
18560 if (p->__pyx_v_idx) {
18561 e = (*v)(p->__pyx_v_idx, a);
if (
e)
return e;
18563 if (p->__pyx_v_self) {
18564 e = (*v)(((PyObject *)p->__pyx_v_self), a);
if (
e)
return e;
18566 if (p->__pyx_t_0) {
18567 e = (*v)(p->__pyx_t_0, a);
if (
e)
return e;
18572 static PyTypeObject __pyx_type_8PyClical___pyx_scope_struct____iter__ = {
18573 PyVarObject_HEAD_INIT(0, 0)
18574 "PyClical.__pyx_scope_struct____iter__",
18575 sizeof(
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__),
18577 __pyx_tp_dealloc_8PyClical___pyx_scope_struct____iter__,
18581 #if PY_MAJOR_VERSION < 3
18584 #if PY_MAJOR_VERSION >= 3
18597 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
18599 __pyx_tp_traverse_8PyClical___pyx_scope_struct____iter__,
18615 __pyx_tp_new_8PyClical___pyx_scope_struct____iter__,
18625 #if PY_VERSION_HEX >= 0x030400a1 18630 static PyMethodDef __pyx_methods[] = {
18631 {
"compare", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_3compare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_2compare},
18632 {
"min_neg", (PyCFunction)__pyx_pw_8PyClical_5min_neg, METH_O, __pyx_doc_8PyClical_4min_neg},
18633 {
"max_pos", (PyCFunction)__pyx_pw_8PyClical_7max_pos, METH_O, __pyx_doc_8PyClical_6max_pos},
18634 {
"inv", (PyCFunction)__pyx_pw_8PyClical_11inv, METH_O, __pyx_doc_8PyClical_10inv},
18635 {
"scalar", (PyCFunction)__pyx_pw_8PyClical_13scalar, METH_O, __pyx_doc_8PyClical_12scalar},
18636 {
"real", (PyCFunction)__pyx_pw_8PyClical_15real, METH_O, __pyx_doc_8PyClical_14real},
18637 {
"imag", (PyCFunction)__pyx_pw_8PyClical_17imag, METH_O, __pyx_doc_8PyClical_16imag},
18638 {
"pure", (PyCFunction)__pyx_pw_8PyClical_19pure, METH_O, __pyx_doc_8PyClical_18pure},
18639 {
"even", (PyCFunction)__pyx_pw_8PyClical_21even, METH_O, __pyx_doc_8PyClical_20even},
18640 {
"odd", (PyCFunction)__pyx_pw_8PyClical_23odd, METH_O, __pyx_doc_8PyClical_22odd},
18641 {
"involute", (PyCFunction)__pyx_pw_8PyClical_25involute, METH_O, __pyx_doc_8PyClical_24involute},
18642 {
"reverse", (PyCFunction)__pyx_pw_8PyClical_27reverse, METH_O, __pyx_doc_8PyClical_26reverse},
18643 {
"conj", (PyCFunction)__pyx_pw_8PyClical_29conj, METH_O, __pyx_doc_8PyClical_28conj},
18644 {
"quad", (PyCFunction)__pyx_pw_8PyClical_31quad, METH_O, __pyx_doc_8PyClical_30quad},
18645 {
"norm", (PyCFunction)__pyx_pw_8PyClical_33norm, METH_O, __pyx_doc_8PyClical_32norm},
18646 {
"abs", (PyCFunction)__pyx_pw_8PyClical_35abs, METH_O, __pyx_doc_8PyClical_34abs},
18647 {
"max_abs", (PyCFunction)__pyx_pw_8PyClical_37max_abs, METH_O, __pyx_doc_8PyClical_36max_abs},
18648 {
"pow", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_39pow, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_38pow},
18649 {
"outer_pow", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_41outer_pow, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_40outer_pow},
18650 {
"complexifier", (PyCFunction)__pyx_pw_8PyClical_43complexifier, METH_O, __pyx_doc_8PyClical_42complexifier},
18651 {
"sqrt", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_45sqrt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_44sqrt},
18652 {
"exp", (PyCFunction)__pyx_pw_8PyClical_47exp, METH_O, __pyx_doc_8PyClical_46exp},
18653 {
"log", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_49log, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_48log},
18654 {
"cos", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_51cos, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_50cos},
18655 {
"acos", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_53acos, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_52acos},
18656 {
"cosh", (PyCFunction)__pyx_pw_8PyClical_55cosh, METH_O, __pyx_doc_8PyClical_54cosh},
18657 {
"acosh", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_57acosh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_56acosh},
18658 {
"sin", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_59sin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_58sin},
18659 {
"asin", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_61asin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_60asin},
18660 {
"sinh", (PyCFunction)__pyx_pw_8PyClical_63sinh, METH_O, __pyx_doc_8PyClical_62sinh},
18661 {
"asinh", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_65asinh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_64asinh},
18662 {
"tan", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_67tan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_66tan},
18663 {
"atan", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_69atan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_68atan},
18664 {
"tanh", (PyCFunction)__pyx_pw_8PyClical_71tanh, METH_O, __pyx_doc_8PyClical_70tanh},
18665 {
"atanh", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_73atanh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_72atanh},
18666 {
"random_clifford", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_75random_clifford, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_74random_clifford},
18667 {
"cga3", (PyCFunction)__pyx_pw_8PyClical_77cga3, METH_O, __pyx_doc_8PyClical_76cga3},
18668 {
"cga3std", (PyCFunction)__pyx_pw_8PyClical_79cga3std, METH_O, __pyx_doc_8PyClical_78cga3std},
18669 {
"agc3", (PyCFunction)__pyx_pw_8PyClical_81agc3, METH_O, __pyx_doc_8PyClical_80agc3},
18673 #if PY_MAJOR_VERSION >= 3 18674 #if CYTHON_PEP489_MULTI_PHASE_INIT 18675 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
18676 static int __pyx_pymod_exec_PyClical(PyObject* module);
18677 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
18678 {Py_mod_create, (
void*)__pyx_pymod_create},
18679 {Py_mod_exec, (
void*)__pyx_pymod_exec_PyClical},
18684 static struct PyModuleDef __pyx_moduledef = {
18685 PyModuleDef_HEAD_INIT,
18688 #if CYTHON_PEP489_MULTI_PHASE_INIT 18694 #if CYTHON_PEP489_MULTI_PHASE_INIT 18695 __pyx_moduledef_slots,
18704 #ifndef CYTHON_SMALL_CODE 18705 #if defined(__clang__) 18706 #define CYTHON_SMALL_CODE 18707 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) 18708 #define CYTHON_SMALL_CODE __attribute__((cold)) 18710 #define CYTHON_SMALL_CODE 18714 static __Pyx_StringTabEntry __pyx_string_tab[] = {
18715 {&__pyx_kp_s_, __pyx_k_,
sizeof(__pyx_k_), 0, 0, 1, 0},
18716 {&__pyx_kp_s_0_8_2, __pyx_k_0_8_2,
sizeof(__pyx_k_0_8_2), 0, 0, 1, 0},
18717 {&__pyx_kp_u_Abbreviation_for_clifford_index, __pyx_k_Abbreviation_for_clifford_index,
sizeof(__pyx_k_Abbreviation_for_clifford_index), 0, 1, 0, 0},
18718 {&__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},
18719 {&__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},
18720 {&__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},
18721 {&__pyx_kp_s_Cannot_initialize_clifford_objec, __pyx_k_Cannot_initialize_clifford_objec,
sizeof(__pyx_k_Cannot_initialize_clifford_objec), 0, 0, 1, 0},
18722 {&__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},
18723 {&__pyx_kp_s_Cannot_reframe, __pyx_k_Cannot_reframe,
sizeof(__pyx_k_Cannot_reframe), 0, 0, 1, 0},
18724 {&__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},
18725 {&__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},
18726 {&__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},
18727 {&__pyx_kp_u_Conjugation_reverse_o_involute, __pyx_k_Conjugation_reverse_o_involute,
sizeof(__pyx_k_Conjugation_reverse_o_involute), 0, 1, 0, 0},
18728 {&__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},
18729 {&__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},
18730 {&__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},
18731 {&__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},
18732 {&__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},
18733 {&__pyx_kp_u_Convert_Euclidean_3D_multivecto, __pyx_k_Convert_Euclidean_3D_multivecto,
sizeof(__pyx_k_Convert_Euclidean_3D_multivecto), 0, 1, 0, 0},
18734 {&__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},
18735 {&__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},
18736 {&__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},
18737 {&__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},
18738 {&__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},
18739 {&__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},
18740 {&__pyx_kp_u_Geometric_difference_print_clif, __pyx_k_Geometric_difference_print_clif,
sizeof(__pyx_k_Geometric_difference_print_clif), 0, 1, 0, 0},
18741 {&__pyx_kp_u_Geometric_difference_x_clifford, __pyx_k_Geometric_difference_x_clifford,
sizeof(__pyx_k_Geometric_difference_x_clifford), 0, 1, 0, 0},
18742 {&__pyx_kp_u_Geometric_multiplicative_invers, __pyx_k_Geometric_multiplicative_invers,
sizeof(__pyx_k_Geometric_multiplicative_invers), 0, 1, 0, 0},
18743 {&__pyx_kp_u_Geometric_multiplicative_invers_2, __pyx_k_Geometric_multiplicative_invers_2,
sizeof(__pyx_k_Geometric_multiplicative_invers_2), 0, 1, 0, 0},
18744 {&__pyx_kp_u_Geometric_product_print_cliffor, __pyx_k_Geometric_product_print_cliffor,
sizeof(__pyx_k_Geometric_product_print_cliffor), 0, 1, 0, 0},
18745 {&__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},
18746 {&__pyx_kp_u_Geometric_quotient_print_cliffo, __pyx_k_Geometric_quotient_print_cliffo,
sizeof(__pyx_k_Geometric_quotient_print_cliffo), 0, 1, 0, 0},
18747 {&__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},
18748 {&__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},
18749 {&__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},
18750 {&__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},
18751 {&__pyx_kp_u_Hyperbolic_cosine_of_multivecto, __pyx_k_Hyperbolic_cosine_of_multivecto,
sizeof(__pyx_k_Hyperbolic_cosine_of_multivecto), 0, 1, 0, 0},
18752 {&__pyx_kp_u_Hyperbolic_sine_of_multivector, __pyx_k_Hyperbolic_sine_of_multivector,
sizeof(__pyx_k_Hyperbolic_sine_of_multivector), 0, 1, 0, 0},
18753 {&__pyx_kp_u_Hyperbolic_tangent_of_multivect, __pyx_k_Hyperbolic_tangent_of_multivect,
sizeof(__pyx_k_Hyperbolic_tangent_of_multivect), 0, 1, 0, 0},
18754 {&__pyx_kp_u_Imaginary_part_deprecated_alway, __pyx_k_Imaginary_part_deprecated_alway,
sizeof(__pyx_k_Imaginary_part_deprecated_alway), 0, 1, 0, 0},
18755 {&__pyx_n_s_IndexError, __pyx_k_IndexError,
sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
18756 {&__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},
18757 {&__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},
18758 {&__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},
18759 {&__pyx_n_s_Integral, __pyx_k_Integral,
sizeof(__pyx_k_Integral), 0, 0, 1, 1},
18760 {&__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},
18761 {&__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},
18762 {&__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},
18763 {&__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},
18764 {&__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},
18765 {&__pyx_kp_u_Inverse_tangent_of_multivector, __pyx_k_Inverse_tangent_of_multivector,
sizeof(__pyx_k_Inverse_tangent_of_multivector), 0, 1, 0, 0},
18766 {&__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},
18767 {&__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},
18768 {&__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},
18769 {&__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},
18770 {&__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},
18771 {&__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},
18772 {&__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},
18773 {&__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},
18774 {&__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},
18775 {&__pyx_kp_u_Natural_logarithm_of_multivecto, __pyx_k_Natural_logarithm_of_multivecto,
sizeof(__pyx_k_Natural_logarithm_of_multivecto), 0, 1, 0, 0},
18776 {&__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},
18777 {&__pyx_n_s_NotImplemented, __pyx_k_NotImplemented,
sizeof(__pyx_k_NotImplemented), 0, 0, 1, 1},
18778 {&__pyx_kp_s_Not_applicable, __pyx_k_Not_applicable,
sizeof(__pyx_k_Not_applicable), 0, 0, 1, 0},
18779 {&__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},
18780 {&__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},
18781 {&__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},
18782 {&__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},
18783 {&__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},
18784 {&__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},
18785 {&__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},
18786 {&__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},
18787 {&__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},
18788 {&__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},
18789 {&__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},
18790 {&__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},
18791 {&__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},
18792 {&__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},
18793 {&__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},
18794 {&__pyx_n_s_PyClical, __pyx_k_PyClical,
sizeof(__pyx_k_PyClical), 0, 0, 1, 1},
18795 {&__pyx_kp_s_PyClical_pyx, __pyx_k_PyClical_pyx,
sizeof(__pyx_k_PyClical_pyx), 0, 0, 1, 0},
18796 {&__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},
18797 {&__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},
18798 {&__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},
18799 {&__pyx_n_s_Real, __pyx_k_Real,
sizeof(__pyx_k_Real), 0, 0, 1, 1},
18800 {&__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},
18801 {&__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},
18802 {&__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},
18803 {&__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},
18804 {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError,
sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
18805 {&__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},
18806 {&__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},
18807 {&__pyx_n_s_Sequence, __pyx_k_Sequence,
sizeof(__pyx_k_Sequence), 0, 0, 1, 1},
18808 {&__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},
18809 {&__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},
18810 {&__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},
18811 {&__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},
18812 {&__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},
18813 {&__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},
18814 {&__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},
18815 {&__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},
18816 {&__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},
18817 {&__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},
18818 {&__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},
18819 {&__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},
18820 {&__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},
18821 {&__pyx_kp_u_Symmetric_set_difference_exclus, __pyx_k_Symmetric_set_difference_exclus,
sizeof(__pyx_k_Symmetric_set_difference_exclus), 0, 1, 0, 0},
18822 {&__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},
18823 {&__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},
18824 {&__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},
18825 {&__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},
18826 {&__pyx_kp_u_The_informal_string_representat, __pyx_k_The_informal_string_representat,
sizeof(__pyx_k_The_informal_string_representat), 0, 1, 0, 0},
18827 {&__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},
18828 {&__pyx_kp_u_The_official_string_representat, __pyx_k_The_official_string_representat,
sizeof(__pyx_k_The_official_string_representat), 0, 1, 0, 0},
18829 {&__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},
18830 {&__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},
18831 {&__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},
18832 {&__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},
18833 {&__pyx_n_s_TypeError, __pyx_k_TypeError,
sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
18834 {&__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},
18835 {&__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},
18836 {&__pyx_n_s_ValueError, __pyx_k_ValueError,
sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
18837 {&__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},
18838 {&__pyx_kp_s__2, __pyx_k__2,
sizeof(__pyx_k__2), 0, 0, 1, 0},
18839 {&__pyx_kp_s__5, __pyx_k__5,
sizeof(__pyx_k__5), 0, 0, 1, 0},
18840 {&__pyx_kp_s__6, __pyx_k__6,
sizeof(__pyx_k__6), 0, 0, 1, 0},
18841 {&__pyx_kp_s__7, __pyx_k__7,
sizeof(__pyx_k__7), 0, 0, 1, 0},
18842 {&__pyx_kp_s__8, __pyx_k__8,
sizeof(__pyx_k__8), 0, 0, 1, 0},
18843 {&__pyx_kp_s__9, __pyx_k__9,
sizeof(__pyx_k__9), 0, 0, 1, 0},
18844 {&__pyx_kp_u_abs_line_1473, __pyx_k_abs_line_1473,
sizeof(__pyx_k_abs_line_1473), 0, 1, 0, 0},
18845 {&__pyx_n_s_acos, __pyx_k_acos,
sizeof(__pyx_k_acos), 0, 0, 1, 1},
18846 {&__pyx_kp_u_acos_line_1619, __pyx_k_acos_line_1619,
sizeof(__pyx_k_acos_line_1619), 0, 1, 0, 0},
18847 {&__pyx_n_s_acosh, __pyx_k_acosh,
sizeof(__pyx_k_acosh), 0, 0, 1, 1},
18848 {&__pyx_kp_u_acosh_line_1656, __pyx_k_acosh_line_1656,
sizeof(__pyx_k_acosh_line_1656), 0, 1, 0, 0},
18849 {&__pyx_kp_u_agc3_line_1844, __pyx_k_agc3_line_1844,
sizeof(__pyx_k_agc3_line_1844), 0, 1, 0, 0},
18850 {&__pyx_n_s_args, __pyx_k_args,
sizeof(__pyx_k_args), 0, 0, 1, 1},
18851 {&__pyx_kp_s_as_frame, __pyx_k_as_frame,
sizeof(__pyx_k_as_frame), 0, 0, 1, 0},
18852 {&__pyx_n_s_asin, __pyx_k_asin,
sizeof(__pyx_k_asin), 0, 0, 1, 1},
18853 {&__pyx_kp_u_asin_line_1698, __pyx_k_asin_line_1698,
sizeof(__pyx_k_asin_line_1698), 0, 1, 0, 0},
18854 {&__pyx_n_s_asinh, __pyx_k_asinh,
sizeof(__pyx_k_asinh), 0, 0, 1, 1},
18855 {&__pyx_kp_u_asinh_line_1733, __pyx_k_asinh_line_1733,
sizeof(__pyx_k_asinh_line_1733), 0, 1, 0, 0},
18856 {&__pyx_n_s_atan, __pyx_k_atan,
sizeof(__pyx_k_atan), 0, 0, 1, 1},
18857 {&__pyx_kp_u_atan_line_1769, __pyx_k_atan_line_1769,
sizeof(__pyx_k_atan_line_1769), 0, 1, 0, 0},
18858 {&__pyx_n_s_atanh, __pyx_k_atanh,
sizeof(__pyx_k_atanh), 0, 0, 1, 1},
18859 {&__pyx_kp_u_atanh_line_1798, __pyx_k_atanh_line_1798,
sizeof(__pyx_k_atanh_line_1798), 0, 1, 0, 0},
18860 {&__pyx_kp_u_cga3_line_1824, __pyx_k_cga3_line_1824,
sizeof(__pyx_k_cga3_line_1824), 0, 1, 0, 0},
18861 {&__pyx_kp_u_cga3std_line_1833, __pyx_k_cga3std_line_1833,
sizeof(__pyx_k_cga3std_line_1833), 0, 1, 0, 0},
18862 {&__pyx_n_s_cl, __pyx_k_cl,
sizeof(__pyx_k_cl), 0, 0, 1, 1},
18863 {&__pyx_n_s_clifford, __pyx_k_clifford,
sizeof(__pyx_k_clifford), 0, 0, 1, 1},
18864 {&__pyx_kp_u_clifford___add___line_739, __pyx_k_clifford___add___line_739,
sizeof(__pyx_k_clifford___add___line_739), 0, 1, 0, 0},
18865 {&__pyx_kp_u_clifford___and___line_835, __pyx_k_clifford___and___line_835,
sizeof(__pyx_k_clifford___and___line_835), 0, 1, 0, 0},
18866 {&__pyx_kp_u_clifford___call___line_1019, __pyx_k_clifford___call___line_1019,
sizeof(__pyx_k_clifford___call___line_1019), 0, 1, 0, 0},
18867 {&__pyx_kp_u_clifford___div___line_895, __pyx_k_clifford___div___line_895,
sizeof(__pyx_k_clifford___div___line_895), 0, 1, 0, 0},
18868 {&__pyx_kp_u_clifford___getitem___line_706, __pyx_k_clifford___getitem___line_706,
sizeof(__pyx_k_clifford___getitem___line_706), 0, 1, 0, 0},
18869 {&__pyx_kp_u_clifford___iadd___line_750, __pyx_k_clifford___iadd___line_750,
sizeof(__pyx_k_clifford___iadd___line_750), 0, 1, 0, 0},
18870 {&__pyx_kp_u_clifford___iand___line_850, __pyx_k_clifford___iand___line_850,
sizeof(__pyx_k_clifford___iand___line_850), 0, 1, 0, 0},
18871 {&__pyx_kp_u_clifford___idiv___line_910, __pyx_k_clifford___idiv___line_910,
sizeof(__pyx_k_clifford___idiv___line_910), 0, 1, 0, 0},
18872 {&__pyx_kp_u_clifford___imod___line_820, __pyx_k_clifford___imod___line_820,
sizeof(__pyx_k_clifford___imod___line_820), 0, 1, 0, 0},
18873 {&__pyx_kp_u_clifford___imul___line_792, __pyx_k_clifford___imul___line_792,
sizeof(__pyx_k_clifford___imul___line_792), 0, 1, 0, 0},
18874 {&__pyx_kp_u_clifford___ior___line_949, __pyx_k_clifford___ior___line_949,
sizeof(__pyx_k_clifford___ior___line_949), 0, 1, 0, 0},
18875 {&__pyx_kp_u_clifford___isub___line_770, __pyx_k_clifford___isub___line_770,
sizeof(__pyx_k_clifford___isub___line_770), 0, 1, 0, 0},
18876 {&__pyx_kp_u_clifford___iter___line_637, __pyx_k_clifford___iter___line_637,
sizeof(__pyx_k_clifford___iter___line_637), 0, 1, 0, 0},
18877 {&__pyx_kp_u_clifford___ixor___line_880, __pyx_k_clifford___ixor___line_880,
sizeof(__pyx_k_clifford___ixor___line_880), 0, 1, 0, 0},
18878 {&__pyx_kp_u_clifford___mod___line_805, __pyx_k_clifford___mod___line_805,
sizeof(__pyx_k_clifford___mod___line_805), 0, 1, 0, 0},
18879 {&__pyx_kp_u_clifford___mul___line_779, __pyx_k_clifford___mul___line_779,
sizeof(__pyx_k_clifford___mul___line_779), 0, 1, 0, 0},
18880 {&__pyx_kp_u_clifford___neg___line_721, __pyx_k_clifford___neg___line_721,
sizeof(__pyx_k_clifford___neg___line_721), 0, 1, 0, 0},
18881 {&__pyx_kp_u_clifford___or___line_938, __pyx_k_clifford___or___line_938,
sizeof(__pyx_k_clifford___or___line_938), 0, 1, 0, 0},
18882 {&__pyx_kp_u_clifford___pos___line_730, __pyx_k_clifford___pos___line_730,
sizeof(__pyx_k_clifford___pos___line_730), 0, 1, 0, 0},
18883 {&__pyx_kp_u_clifford___pow___line_960, __pyx_k_clifford___pow___line_960,
sizeof(__pyx_k_clifford___pow___line_960), 0, 1, 0, 0},
18884 {&__pyx_kp_u_clifford___repr___line_1225, __pyx_k_clifford___repr___line_1225,
sizeof(__pyx_k_clifford___repr___line_1225), 0, 1, 0, 0},
18885 {&__pyx_kp_u_clifford___str___line_1234, __pyx_k_clifford___str___line_1234,
sizeof(__pyx_k_clifford___str___line_1234), 0, 1, 0, 0},
18886 {&__pyx_kp_u_clifford___sub___line_759, __pyx_k_clifford___sub___line_759,
sizeof(__pyx_k_clifford___sub___line_759), 0, 1, 0, 0},
18887 {&__pyx_kp_u_clifford___xor___line_865, __pyx_k_clifford___xor___line_865,
sizeof(__pyx_k_clifford___xor___line_865), 0, 1, 0, 0},
18888 {&__pyx_kp_u_clifford_abs_line_1174, __pyx_k_clifford_abs_line_1174,
sizeof(__pyx_k_clifford_abs_line_1174), 0, 1, 0, 0},
18889 {&__pyx_kp_u_clifford_conj_line_1137, __pyx_k_clifford_conj_line_1137,
sizeof(__pyx_k_clifford_conj_line_1137), 0, 1, 0, 0},
18890 {&__pyx_kp_u_clifford_copy_line_554, __pyx_k_clifford_copy_line_554,
sizeof(__pyx_k_clifford_copy_line_554), 0, 1, 0, 0},
18891 {&__pyx_kp_u_clifford_even_line_1060, __pyx_k_clifford_even_line_1060,
sizeof(__pyx_k_clifford_even_line_1060), 0, 1, 0, 0},
18892 {&__pyx_kp_u_clifford_frame_line_1214, __pyx_k_clifford_frame_line_1214,
sizeof(__pyx_k_clifford_frame_line_1214), 0, 1, 0, 0},
18893 {&__pyx_n_s_clifford_hidden_doctests, __pyx_k_clifford_hidden_doctests,
sizeof(__pyx_k_clifford_hidden_doctests), 0, 0, 1, 1},
18894 {&__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},
18895 {&__pyx_kp_u_clifford_inv_line_925, __pyx_k_clifford_inv_line_925,
sizeof(__pyx_k_clifford_inv_line_925), 0, 1, 0, 0},
18896 {&__pyx_kp_u_clifford_involute_line_1106, __pyx_k_clifford_involute_line_1106,
sizeof(__pyx_k_clifford_involute_line_1106), 0, 1, 0, 0},
18897 {&__pyx_kp_u_clifford_isnan_line_1205, __pyx_k_clifford_isnan_line_1205,
sizeof(__pyx_k_clifford_isnan_line_1205), 0, 1, 0, 0},
18898 {&__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},
18899 {&__pyx_kp_u_clifford_norm_line_1163, __pyx_k_clifford_norm_line_1163,
sizeof(__pyx_k_clifford_norm_line_1163), 0, 1, 0, 0},
18900 {&__pyx_kp_u_clifford_odd_line_1069, __pyx_k_clifford_odd_line_1069,
sizeof(__pyx_k_clifford_odd_line_1069), 0, 1, 0, 0},
18901 {&__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},
18902 {&__pyx_kp_u_clifford_pow_line_979, __pyx_k_clifford_pow_line_979,
sizeof(__pyx_k_clifford_pow_line_979), 0, 1, 0, 0},
18903 {&__pyx_kp_u_clifford_pure_line_1049, __pyx_k_clifford_pure_line_1049,
sizeof(__pyx_k_clifford_pure_line_1049), 0, 1, 0, 0},
18904 {&__pyx_kp_u_clifford_quad_line_1152, __pyx_k_clifford_quad_line_1152,
sizeof(__pyx_k_clifford_quad_line_1152), 0, 1, 0, 0},
18905 {&__pyx_kp_u_clifford_reframe_line_648, __pyx_k_clifford_reframe_line_648,
sizeof(__pyx_k_clifford_reframe_line_648), 0, 1, 0, 0},
18906 {&__pyx_kp_u_clifford_reverse_line_1122, __pyx_k_clifford_reverse_line_1122,
sizeof(__pyx_k_clifford_reverse_line_1122), 0, 1, 0, 0},
18907 {&__pyx_kp_u_clifford_scalar_line_1038, __pyx_k_clifford_scalar_line_1038,
sizeof(__pyx_k_clifford_scalar_line_1038), 0, 1, 0, 0},
18908 {&__pyx_kp_u_clifford_truncated_line_1194, __pyx_k_clifford_truncated_line_1194,
sizeof(__pyx_k_clifford_truncated_line_1194), 0, 1, 0, 0},
18909 {&__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},
18910 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback,
sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
18911 {&__pyx_n_s_close, __pyx_k_close,
sizeof(__pyx_k_close), 0, 0, 1, 1},
18912 {&__pyx_n_s_collections, __pyx_k_collections,
sizeof(__pyx_k_collections), 0, 0, 1, 1},
18913 {&__pyx_kp_u_compare_line_490, __pyx_k_compare_line_490,
sizeof(__pyx_k_compare_line_490), 0, 1, 0, 0},
18914 {&__pyx_kp_u_complexifier_line_1527, __pyx_k_complexifier_line_1527,
sizeof(__pyx_k_complexifier_line_1527), 0, 1, 0, 0},
18915 {&__pyx_n_s_conj, __pyx_k_conj,
sizeof(__pyx_k_conj), 0, 0, 1, 1},
18916 {&__pyx_kp_u_conj_line_1436, __pyx_k_conj_line_1436,
sizeof(__pyx_k_conj_line_1436), 0, 1, 0, 0},
18917 {&__pyx_n_s_copy, __pyx_k_copy,
sizeof(__pyx_k_copy), 0, 0, 1, 1},
18918 {&__pyx_n_s_cos, __pyx_k_cos,
sizeof(__pyx_k_cos), 0, 0, 1, 1},
18919 {&__pyx_kp_u_cos_line_1602, __pyx_k_cos_line_1602,
sizeof(__pyx_k_cos_line_1602), 0, 1, 0, 0},
18920 {&__pyx_n_s_cosh, __pyx_k_cosh,
sizeof(__pyx_k_cosh), 0, 0, 1, 1},
18921 {&__pyx_kp_u_cosh_line_1640, __pyx_k_cosh_line_1640,
sizeof(__pyx_k_cosh_line_1640), 0, 1, 0, 0},
18922 {&__pyx_n_s_doctest, __pyx_k_doctest,
sizeof(__pyx_k_doctest), 0, 0, 1, 1},
18923 {&__pyx_n_s_e, __pyx_k_e,
sizeof(__pyx_k_e), 0, 0, 1, 1},
18924 {&__pyx_kp_u_e_line_1887, __pyx_k_e_line_1887,
sizeof(__pyx_k_e_line_1887), 0, 1, 0, 0},
18925 {&__pyx_n_s_even, __pyx_k_even,
sizeof(__pyx_k_even), 0, 0, 1, 1},
18926 {&__pyx_kp_u_even_line_1388, __pyx_k_even_line_1388,
sizeof(__pyx_k_even_line_1388), 0, 1, 0, 0},
18927 {&__pyx_n_s_exp, __pyx_k_exp,
sizeof(__pyx_k_exp), 0, 0, 1, 1},
18928 {&__pyx_kp_u_exp_line_1565, __pyx_k_exp_line_1565,
sizeof(__pyx_k_exp_line_1565), 0, 1, 0, 0},
18929 {&__pyx_n_s_fill, __pyx_k_fill,
sizeof(__pyx_k_fill), 0, 0, 1, 1},
18930 {&__pyx_n_s_frm, __pyx_k_frm,
sizeof(__pyx_k_frm), 0, 0, 1, 1},
18931 {&__pyx_kp_s_from, __pyx_k_from,
sizeof(__pyx_k_from), 0, 0, 1, 0},
18932 {&__pyx_n_s_getstate, __pyx_k_getstate,
sizeof(__pyx_k_getstate), 0, 0, 1, 1},
18933 {&__pyx_n_s_grade, __pyx_k_grade,
sizeof(__pyx_k_grade), 0, 0, 1, 1},
18934 {&__pyx_n_s_i, __pyx_k_i,
sizeof(__pyx_k_i), 0, 0, 1, 1},
18935 {&__pyx_kp_u_imag_line_1366, __pyx_k_imag_line_1366,
sizeof(__pyx_k_imag_line_1366), 0, 1, 0, 0},
18936 {&__pyx_n_s_import, __pyx_k_import,
sizeof(__pyx_k_import), 0, 0, 1, 1},
18937 {&__pyx_n_s_index_set, __pyx_k_index_set,
sizeof(__pyx_k_index_set), 0, 0, 1, 1},
18938 {&__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},
18939 {&__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},
18940 {&__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},
18941 {&__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},
18942 {&__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},
18943 {&__pyx_n_s_index_set___iter, __pyx_k_index_set___iter,
sizeof(__pyx_k_index_set___iter), 0, 0, 1, 1},
18944 {&__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},
18945 {&__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},
18946 {&__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},
18947 {&__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},
18948 {&__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},
18949 {&__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},
18950 {&__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},
18951 {&__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},
18952 {&__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},
18953 {&__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},
18954 {&__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},
18955 {&__pyx_n_s_index_set_hidden_doctests, __pyx_k_index_set_hidden_doctests,
sizeof(__pyx_k_index_set_hidden_doctests), 0, 0, 1, 1},
18956 {&__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},
18957 {&__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},
18958 {&__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},
18959 {&__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},
18960 {&__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},
18961 {&__pyx_n_s_inv, __pyx_k_inv,
sizeof(__pyx_k_inv), 0, 0, 1, 1},
18962 {&__pyx_kp_u_inv_line_1329, __pyx_k_inv_line_1329,
sizeof(__pyx_k_inv_line_1329), 0, 1, 0, 0},
18963 {&__pyx_kp_s_invalid, __pyx_k_invalid,
sizeof(__pyx_k_invalid), 0, 0, 1, 0},
18964 {&__pyx_kp_s_invalid_string, __pyx_k_invalid_string,
sizeof(__pyx_k_invalid_string), 0, 0, 1, 0},
18965 {&__pyx_n_s_involute, __pyx_k_involute,
sizeof(__pyx_k_involute), 0, 0, 1, 1},
18966 {&__pyx_kp_u_involute_line_1406, __pyx_k_involute_line_1406,
sizeof(__pyx_k_involute_line_1406), 0, 1, 0, 0},
18967 {&__pyx_n_s_ist, __pyx_k_ist,
sizeof(__pyx_k_ist), 0, 0, 1, 1},
18968 {&__pyx_n_s_istpq, __pyx_k_istpq,
sizeof(__pyx_k_istpq), 0, 0, 1, 1},
18969 {&__pyx_kp_u_istpq_line_1900, __pyx_k_istpq_line_1900,
sizeof(__pyx_k_istpq_line_1900), 0, 1, 0, 0},
18970 {&__pyx_n_s_iter, __pyx_k_iter,
sizeof(__pyx_k_iter), 0, 0, 1, 1},
18971 {&__pyx_n_s_ixt, __pyx_k_ixt,
sizeof(__pyx_k_ixt), 0, 0, 1, 1},
18972 {&__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},
18973 {&__pyx_n_s_lhs, __pyx_k_lhs,
sizeof(__pyx_k_lhs), 0, 0, 1, 1},
18974 {&__pyx_n_s_log, __pyx_k_log,
sizeof(__pyx_k_log), 0, 0, 1, 1},
18975 {&__pyx_kp_u_log_line_1579, __pyx_k_log_line_1579,
sizeof(__pyx_k_log_line_1579), 0, 1, 0, 0},
18976 {&__pyx_n_s_m, __pyx_k_m,
sizeof(__pyx_k_m), 0, 0, 1, 1},
18977 {&__pyx_n_s_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 0, 1, 1},
18978 {&__pyx_n_s_math, __pyx_k_math,
sizeof(__pyx_k_math), 0, 0, 1, 1},
18979 {&__pyx_n_s_max, __pyx_k_max,
sizeof(__pyx_k_max), 0, 0, 1, 1},
18980 {&__pyx_kp_u_max_abs_line_1482, __pyx_k_max_abs_line_1482,
sizeof(__pyx_k_max_abs_line_1482), 0, 1, 0, 0},
18981 {&__pyx_kp_u_max_pos_line_511, __pyx_k_max_pos_line_511,
sizeof(__pyx_k_max_pos_line_511), 0, 1, 0, 0},
18982 {&__pyx_n_s_min, __pyx_k_min,
sizeof(__pyx_k_min), 0, 0, 1, 1},
18983 {&__pyx_kp_u_min_neg_line_502, __pyx_k_min_neg_line_502,
sizeof(__pyx_k_min_neg_line_502), 0, 1, 0, 0},
18984 {&__pyx_n_s_name, __pyx_k_name,
sizeof(__pyx_k_name), 0, 0, 1, 1},
18985 {&__pyx_n_s_nbar3, __pyx_k_nbar3,
sizeof(__pyx_k_nbar3), 0, 0, 1, 1},
18986 {&__pyx_n_s_ninf3, __pyx_k_ninf3,
sizeof(__pyx_k_ninf3), 0, 0, 1, 1},
18987 {&__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},
18988 {&__pyx_n_s_norm, __pyx_k_norm,
sizeof(__pyx_k_norm), 0, 0, 1, 1},
18989 {&__pyx_kp_u_norm_line_1462, __pyx_k_norm_line_1462,
sizeof(__pyx_k_norm_line_1462), 0, 1, 0, 0},
18990 {&__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},
18991 {&__pyx_n_s_numbers, __pyx_k_numbers,
sizeof(__pyx_k_numbers), 0, 0, 1, 1},
18992 {&__pyx_n_s_obj, __pyx_k_obj,
sizeof(__pyx_k_obj), 0, 0, 1, 1},
18993 {&__pyx_n_s_odd, __pyx_k_odd,
sizeof(__pyx_k_odd), 0, 0, 1, 1},
18994 {&__pyx_kp_u_odd_line_1397, __pyx_k_odd_line_1397,
sizeof(__pyx_k_odd_line_1397), 0, 1, 0, 0},
18995 {&__pyx_n_s_other, __pyx_k_other,
sizeof(__pyx_k_other), 0, 0, 1, 1},
18996 {&__pyx_n_s_outer_pow, __pyx_k_outer_pow,
sizeof(__pyx_k_outer_pow), 0, 0, 1, 1},
18997 {&__pyx_kp_u_outer_pow_line_1518, __pyx_k_outer_pow_line_1518,
sizeof(__pyx_k_outer_pow_line_1518), 0, 1, 0, 0},
18998 {&__pyx_n_s_p, __pyx_k_p,
sizeof(__pyx_k_p), 0, 0, 1, 1},
18999 {&__pyx_n_s_pi, __pyx_k_pi,
sizeof(__pyx_k_pi), 0, 0, 1, 1},
19000 {&__pyx_n_s_pow, __pyx_k_pow,
sizeof(__pyx_k_pow), 0, 0, 1, 1},
19001 {&__pyx_kp_u_pow_line_1494, __pyx_k_pow_line_1494,
sizeof(__pyx_k_pow_line_1494), 0, 1, 0, 0},
19002 {&__pyx_n_s_pure, __pyx_k_pure,
sizeof(__pyx_k_pure), 0, 0, 1, 1},
19003 {&__pyx_kp_u_pure_line_1377, __pyx_k_pure_line_1377,
sizeof(__pyx_k_pure_line_1377), 0, 1, 0, 0},
19004 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable,
sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
19005 {&__pyx_n_s_q, __pyx_k_q,
sizeof(__pyx_k_q), 0, 0, 1, 1},
19006 {&__pyx_n_s_quad, __pyx_k_quad,
sizeof(__pyx_k_quad), 0, 0, 1, 1},
19007 {&__pyx_kp_u_quad_line_1451, __pyx_k_quad_line_1451,
sizeof(__pyx_k_quad_line_1451), 0, 1, 0, 0},
19008 {&__pyx_kp_u_random_clifford_line_1815, __pyx_k_random_clifford_line_1815,
sizeof(__pyx_k_random_clifford_line_1815), 0, 1, 0, 0},
19009 {&__pyx_n_s_range, __pyx_k_range,
sizeof(__pyx_k_range), 0, 0, 1, 1},
19010 {&__pyx_kp_u_real_line_1355, __pyx_k_real_line_1355,
sizeof(__pyx_k_real_line_1355), 0, 1, 0, 0},
19011 {&__pyx_n_s_reduce, __pyx_k_reduce,
sizeof(__pyx_k_reduce), 0, 0, 1, 1},
19012 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython,
sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
19013 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex,
sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
19014 {&__pyx_n_s_reverse, __pyx_k_reverse,
sizeof(__pyx_k_reverse), 0, 0, 1, 1},
19015 {&__pyx_kp_u_reverse_line_1421, __pyx_k_reverse_line_1421,
sizeof(__pyx_k_reverse_line_1421), 0, 1, 0, 0},
19016 {&__pyx_n_s_rhs, __pyx_k_rhs,
sizeof(__pyx_k_rhs), 0, 0, 1, 1},
19017 {&__pyx_n_s_scalar, __pyx_k_scalar,
sizeof(__pyx_k_scalar), 0, 0, 1, 1},
19018 {&__pyx_kp_u_scalar_line_1344, __pyx_k_scalar_line_1344,
sizeof(__pyx_k_scalar_line_1344), 0, 1, 0, 0},
19019 {&__pyx_n_s_send, __pyx_k_send,
sizeof(__pyx_k_send), 0, 0, 1, 1},
19020 {&__pyx_n_s_setstate, __pyx_k_setstate,
sizeof(__pyx_k_setstate), 0, 0, 1, 1},
19021 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython,
sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
19022 {&__pyx_n_s_sin, __pyx_k_sin,
sizeof(__pyx_k_sin), 0, 0, 1, 1},
19023 {&__pyx_kp_u_sin_line_1679, __pyx_k_sin_line_1679,
sizeof(__pyx_k_sin_line_1679), 0, 1, 0, 0},
19024 {&__pyx_n_s_sinh, __pyx_k_sinh,
sizeof(__pyx_k_sinh), 0, 0, 1, 1},
19025 {&__pyx_kp_u_sinh_line_1719, __pyx_k_sinh_line_1719,
sizeof(__pyx_k_sinh_line_1719), 0, 1, 0, 0},
19026 {&__pyx_n_s_sqrt, __pyx_k_sqrt,
sizeof(__pyx_k_sqrt), 0, 0, 1, 1},
19027 {&__pyx_kp_u_sqrt_line_1542, __pyx_k_sqrt_line_1542,
sizeof(__pyx_k_sqrt_line_1542), 0, 1, 0, 0},
19028 {&__pyx_n_s_tan, __pyx_k_tan,
sizeof(__pyx_k_tan), 0, 0, 1, 1},
19029 {&__pyx_kp_u_tan_line_1752, __pyx_k_tan_line_1752,
sizeof(__pyx_k_tan_line_1752), 0, 1, 0, 0},
19030 {&__pyx_n_s_tanh, __pyx_k_tanh,
sizeof(__pyx_k_tanh), 0, 0, 1, 1},
19031 {&__pyx_kp_u_tanh_line_1786, __pyx_k_tanh_line_1786,
sizeof(__pyx_k_tanh_line_1786), 0, 1, 0, 0},
19032 {&__pyx_n_s_tau, __pyx_k_tau,
sizeof(__pyx_k_tau), 0, 0, 1, 1},
19033 {&__pyx_n_s_test, __pyx_k_test,
sizeof(__pyx_k_test), 0, 0, 1, 1},
19034 {&__pyx_n_s_test_2, __pyx_k_test_2,
sizeof(__pyx_k_test_2), 0, 0, 1, 1},
19035 {&__pyx_n_s_testmod, __pyx_k_testmod,
sizeof(__pyx_k_testmod), 0, 0, 1, 1},
19036 {&__pyx_n_s_throw, __pyx_k_throw,
sizeof(__pyx_k_throw), 0, 0, 1, 1},
19037 {&__pyx_kp_s_to_frame, __pyx_k_to_frame,
sizeof(__pyx_k_to_frame), 0, 0, 1, 0},
19038 {&__pyx_kp_s_using, __pyx_k_using,
sizeof(__pyx_k_using), 0, 0, 1, 0},
19039 {&__pyx_kp_s_using_invalid, __pyx_k_using_invalid,
sizeof(__pyx_k_using_invalid), 0, 0, 1, 0},
19040 {&__pyx_kp_s_value, __pyx_k_value,
sizeof(__pyx_k_value), 0, 0, 1, 0},
19041 {&__pyx_n_s_version, __pyx_k_version,
sizeof(__pyx_k_version), 0, 0, 1, 1},
19042 {&__pyx_n_s_xrange, __pyx_k_xrange,
sizeof(__pyx_k_xrange), 0, 0, 1, 1},
19043 {0, 0, 0, 0, 0, 0, 0}
19045 static CYTHON_SMALL_CODE
int __Pyx_InitCachedBuiltins(
void) {
19046 __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError);
if (!__pyx_builtin_IndexError) __PYX_ERR(0, 102, __pyx_L1_error)
19047 __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError);
if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 104, __pyx_L1_error)
19048 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError);
if (!__pyx_builtin_TypeError) __PYX_ERR(0, 104, __pyx_L1_error)
19049 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError);
if (!__pyx_builtin_ValueError) __PYX_ERR(0, 105, __pyx_L1_error)
19050 __pyx_builtin_NotImplemented = __Pyx_GetBuiltinName(__pyx_n_s_NotImplemented);
if (!__pyx_builtin_NotImplemented) __PYX_ERR(0, 157, __pyx_L1_error)
19051 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_range) __PYX_ERR(0, 234, __pyx_L1_error)
19052 #if PY_MAJOR_VERSION >= 3 19053 __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_xrange) __PYX_ERR(0, 1098, __pyx_L1_error)
19055 __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange);
if (!__pyx_builtin_xrange) __PYX_ERR(0, 1098, __pyx_L1_error)
19062 static CYTHON_SMALL_CODE
int __Pyx_InitCachedConstants(
void) {
19063 __Pyx_RefNannyDeclarations
19064 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
19072 __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)
19073 __Pyx_GOTREF(__pyx_tuple__3);
19074 __Pyx_GIVEREF(__pyx_tuple__3);
19081 __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)
19082 __Pyx_GOTREF(__pyx_tuple__4);
19083 __Pyx_GIVEREF(__pyx_tuple__4);
19092 __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Not_applicable);
if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 635, __pyx_L1_error)
19093 __Pyx_GOTREF(__pyx_tuple__10);
19094 __Pyx_GIVEREF(__pyx_tuple__10);
19102 __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)
19103 __Pyx_GOTREF(__pyx_tuple__11);
19104 __Pyx_GIVEREF(__pyx_tuple__11);
19111 __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)
19112 __Pyx_GOTREF(__pyx_tuple__12);
19113 __Pyx_GIVEREF(__pyx_tuple__12);
19122 __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)
19131 __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)
19140 __pyx_tuple__15 = PyTuple_Pack(1, __pyx_float_1_0);
if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 1856, __pyx_L1_error)
19141 __Pyx_GOTREF(__pyx_tuple__15);
19142 __Pyx_GIVEREF(__pyx_tuple__15);
19151 __pyx_tuple__16 = PyTuple_Pack(1, __pyx_n_s_obj);
if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 1887, __pyx_L1_error)
19152 __Pyx_GOTREF(__pyx_tuple__16);
19153 __Pyx_GIVEREF(__pyx_tuple__16);
19154 __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)
19163 __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)
19164 __Pyx_GOTREF(__pyx_tuple__18);
19165 __Pyx_GIVEREF(__pyx_tuple__18);
19166 __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)
19175 __pyx_tuple__20 = PyTuple_Pack(1, __pyx_int_4);
if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 1909, __pyx_L1_error)
19176 __Pyx_GOTREF(__pyx_tuple__20);
19177 __Pyx_GIVEREF(__pyx_tuple__20);
19178 __pyx_tuple__21 = PyTuple_Pack(1, __pyx_int_neg_1);
if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 1909, __pyx_L1_error)
19179 __Pyx_GOTREF(__pyx_tuple__21);
19180 __Pyx_GIVEREF(__pyx_tuple__21);
19189 __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)
19190 __Pyx_GOTREF(__pyx_tuple__22);
19191 __Pyx_GIVEREF(__pyx_tuple__22);
19192 __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)
19193 __Pyx_RefNannyFinishContext();
19196 __Pyx_RefNannyFinishContext();
19200 static CYTHON_SMALL_CODE
int __Pyx_InitGlobals(
void) {
19201 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
19202 __pyx_float_0_0 =
PyFloat_FromDouble(0.0);
if (unlikely(!__pyx_float_0_0)) __PYX_ERR(0, 1, __pyx_L1_error)
19203 __pyx_float_1_0 =
PyFloat_FromDouble(1.0);
if (unlikely(!__pyx_float_1_0)) __PYX_ERR(0, 1, __pyx_L1_error)
19204 __pyx_float_2_0 =
PyFloat_FromDouble(2.0);
if (unlikely(!__pyx_float_2_0)) __PYX_ERR(0, 1, __pyx_L1_error)
19205 __pyx_float_8_0 =
PyFloat_FromDouble(8.0);
if (unlikely(!__pyx_float_8_0)) __PYX_ERR(0, 1, __pyx_L1_error)
19206 __pyx_int_0 = PyInt_FromLong(0);
if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
19207 __pyx_int_1 = PyInt_FromLong(1);
if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
19208 __pyx_int_4 = PyInt_FromLong(4);
if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error)
19209 __pyx_int_neg_1 = PyInt_FromLong(-1);
if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
19215 static CYTHON_SMALL_CODE
int __Pyx_modinit_global_init_code(
void);
19216 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_export_code(
void);
19217 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_export_code(
void);
19218 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_init_code(
void);
19219 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_import_code(
void);
19220 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_import_code(
void);
19221 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_import_code(
void);
19223 static int __Pyx_modinit_global_init_code(
void) {
19224 __Pyx_RefNannyDeclarations
19225 __Pyx_RefNannySetupContext(
"__Pyx_modinit_global_init_code", 0);
19227 __Pyx_RefNannyFinishContext();
19231 static int __Pyx_modinit_variable_export_code(
void) {
19232 __Pyx_RefNannyDeclarations
19233 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_export_code", 0);
19235 __Pyx_RefNannyFinishContext();
19239 static int __Pyx_modinit_function_export_code(
void) {
19240 __Pyx_RefNannyDeclarations
19241 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_export_code", 0);
19243 __Pyx_RefNannyFinishContext();
19247 static int __Pyx_modinit_type_init_code(
void) {
19248 __Pyx_RefNannyDeclarations
19249 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_init_code", 0);
19251 __pyx_vtabptr_8PyClical_index_set = &__pyx_vtable_8PyClical_index_set;
19252 __pyx_vtable_8PyClical_index_set.wrap = (PyObject *(*)(
struct __pyx_obj_8PyClical_index_set *,
IndexSet))__pyx_f_8PyClical_9index_set_wrap;
19253 __pyx_vtable_8PyClical_index_set.unwrap = (
IndexSet (*)(
struct __pyx_obj_8PyClical_index_set *))__pyx_f_8PyClical_9index_set_unwrap;
19254 __pyx_vtable_8PyClical_index_set.copy = (PyObject *(*)(
struct __pyx_obj_8PyClical_index_set *,
int __pyx_skip_dispatch))__pyx_f_8PyClical_9index_set_copy;
19255 if (PyType_Ready(&__pyx_type_8PyClical_index_set) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
19256 __pyx_type_8PyClical_index_set.tp_print = 0;
19257 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)) {
19258 __pyx_type_8PyClical_index_set.tp_getattro = __Pyx_PyObject_GenericGetAttr;
19260 #if CYTHON_COMPILING_IN_CPYTHON 19262 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__setitem__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19263 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19264 __pyx_wrapperbase_8PyClical_9index_set_8__setitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19265 __pyx_wrapperbase_8PyClical_9index_set_8__setitem__.doc = __pyx_doc_8PyClical_9index_set_8__setitem__;
19266 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_8__setitem__;
19270 #if CYTHON_COMPILING_IN_CPYTHON 19272 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__getitem__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19273 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19274 __pyx_wrapperbase_8PyClical_9index_set_10__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19275 __pyx_wrapperbase_8PyClical_9index_set_10__getitem__.doc = __pyx_doc_8PyClical_9index_set_10__getitem__;
19276 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_10__getitem__;
19280 #if CYTHON_COMPILING_IN_CPYTHON 19282 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__contains__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19283 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19284 __pyx_wrapperbase_8PyClical_9index_set_12__contains__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19285 __pyx_wrapperbase_8PyClical_9index_set_12__contains__.doc = __pyx_doc_8PyClical_9index_set_12__contains__;
19286 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_12__contains__;
19290 #if CYTHON_COMPILING_IN_CPYTHON 19292 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__iter__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19293 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19294 __pyx_wrapperbase_8PyClical_9index_set_14__iter__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19295 __pyx_wrapperbase_8PyClical_9index_set_14__iter__.doc = __pyx_doc_8PyClical_9index_set_14__iter__;
19296 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_14__iter__;
19300 #if CYTHON_COMPILING_IN_CPYTHON 19302 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__invert__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19303 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19304 __pyx_wrapperbase_8PyClical_9index_set_17__invert__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19305 __pyx_wrapperbase_8PyClical_9index_set_17__invert__.doc = __pyx_doc_8PyClical_9index_set_17__invert__;
19306 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_17__invert__;
19310 #if CYTHON_COMPILING_IN_CPYTHON 19312 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__xor__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19313 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19314 __pyx_wrapperbase_8PyClical_9index_set_19__xor__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19315 __pyx_wrapperbase_8PyClical_9index_set_19__xor__.doc = __pyx_doc_8PyClical_9index_set_19__xor__;
19316 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_19__xor__;
19320 #if CYTHON_COMPILING_IN_CPYTHON 19322 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__ixor__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19323 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19324 __pyx_wrapperbase_8PyClical_9index_set_21__ixor__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19325 __pyx_wrapperbase_8PyClical_9index_set_21__ixor__.doc = __pyx_doc_8PyClical_9index_set_21__ixor__;
19326 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_21__ixor__;
19330 #if CYTHON_COMPILING_IN_CPYTHON 19332 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__and__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19333 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19334 __pyx_wrapperbase_8PyClical_9index_set_23__and__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19335 __pyx_wrapperbase_8PyClical_9index_set_23__and__.doc = __pyx_doc_8PyClical_9index_set_23__and__;
19336 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_23__and__;
19340 #if CYTHON_COMPILING_IN_CPYTHON 19342 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__iand__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19343 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19344 __pyx_wrapperbase_8PyClical_9index_set_25__iand__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19345 __pyx_wrapperbase_8PyClical_9index_set_25__iand__.doc = __pyx_doc_8PyClical_9index_set_25__iand__;
19346 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_25__iand__;
19350 #if CYTHON_COMPILING_IN_CPYTHON 19352 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__or__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19353 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19354 __pyx_wrapperbase_8PyClical_9index_set_27__or__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19355 __pyx_wrapperbase_8PyClical_9index_set_27__or__.doc = __pyx_doc_8PyClical_9index_set_27__or__;
19356 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_27__or__;
19360 #if CYTHON_COMPILING_IN_CPYTHON 19362 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__ior__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19363 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19364 __pyx_wrapperbase_8PyClical_9index_set_29__ior__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19365 __pyx_wrapperbase_8PyClical_9index_set_29__ior__.doc = __pyx_doc_8PyClical_9index_set_29__ior__;
19366 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_29__ior__;
19370 #if CYTHON_COMPILING_IN_CPYTHON 19372 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__repr__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19373 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19374 __pyx_wrapperbase_8PyClical_9index_set_47__repr__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19375 __pyx_wrapperbase_8PyClical_9index_set_47__repr__.doc = __pyx_doc_8PyClical_9index_set_47__repr__;
19376 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_47__repr__;
19380 #if CYTHON_COMPILING_IN_CPYTHON 19382 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__str__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19383 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19384 __pyx_wrapperbase_8PyClical_9index_set_49__str__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19385 __pyx_wrapperbase_8PyClical_9index_set_49__str__.doc = __pyx_doc_8PyClical_9index_set_49__str__;
19386 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_49__str__;
19390 if (__Pyx_SetVtable(__pyx_type_8PyClical_index_set.tp_dict, __pyx_vtabptr_8PyClical_index_set) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
19391 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_index_set, (PyObject *)&__pyx_type_8PyClical_index_set) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
19392 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8PyClical_index_set) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
19393 __pyx_ptype_8PyClical_index_set = &__pyx_type_8PyClical_index_set;
19394 __pyx_vtabptr_8PyClical_clifford = &__pyx_vtable_8PyClical_clifford;
19395 __pyx_vtable_8PyClical_clifford.wrap = (PyObject *(*)(
struct __pyx_obj_8PyClical_clifford *,
Clifford))__pyx_f_8PyClical_8clifford_wrap;
19396 __pyx_vtable_8PyClical_clifford.unwrap = (
Clifford (*)(
struct __pyx_obj_8PyClical_clifford *))__pyx_f_8PyClical_8clifford_unwrap;
19397 __pyx_vtable_8PyClical_clifford.copy = (PyObject *(*)(
struct __pyx_obj_8PyClical_clifford *,
int __pyx_skip_dispatch))__pyx_f_8PyClical_8clifford_copy;
19398 if (PyType_Ready(&__pyx_type_8PyClical_clifford) < 0) __PYX_ERR(0, 535, __pyx_L1_error)
19399 __pyx_type_8PyClical_clifford.tp_print = 0;
19400 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8PyClical_clifford.tp_dictoffset && __pyx_type_8PyClical_clifford.tp_getattro == PyObject_GenericGetAttr)) {
19401 __pyx_type_8PyClical_clifford.tp_getattro = __Pyx_PyObject_GenericGetAttr;
19403 #if CYTHON_COMPILING_IN_CPYTHON 19405 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__contains__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19406 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19407 __pyx_wrapperbase_8PyClical_8clifford_6__contains__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19408 __pyx_wrapperbase_8PyClical_8clifford_6__contains__.doc = __pyx_doc_8PyClical_8clifford_6__contains__;
19409 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_6__contains__;
19413 #if CYTHON_COMPILING_IN_CPYTHON 19415 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__iter__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19416 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19417 __pyx_wrapperbase_8PyClical_8clifford_8__iter__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19418 __pyx_wrapperbase_8PyClical_8clifford_8__iter__.doc = __pyx_doc_8PyClical_8clifford_8__iter__;
19419 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_8__iter__;
19423 #if CYTHON_COMPILING_IN_CPYTHON 19425 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__getitem__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19426 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19427 __pyx_wrapperbase_8PyClical_8clifford_14__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19428 __pyx_wrapperbase_8PyClical_8clifford_14__getitem__.doc = __pyx_doc_8PyClical_8clifford_14__getitem__;
19429 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_14__getitem__;
19433 #if CYTHON_COMPILING_IN_CPYTHON 19435 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__neg__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19436 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19437 __pyx_wrapperbase_8PyClical_8clifford_16__neg__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19438 __pyx_wrapperbase_8PyClical_8clifford_16__neg__.doc = __pyx_doc_8PyClical_8clifford_16__neg__;
19439 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_16__neg__;
19443 #if CYTHON_COMPILING_IN_CPYTHON 19445 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__pos__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19446 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19447 __pyx_wrapperbase_8PyClical_8clifford_18__pos__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19448 __pyx_wrapperbase_8PyClical_8clifford_18__pos__.doc = __pyx_doc_8PyClical_8clifford_18__pos__;
19449 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_18__pos__;
19453 #if CYTHON_COMPILING_IN_CPYTHON 19455 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__add__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19456 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19457 __pyx_wrapperbase_8PyClical_8clifford_20__add__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19458 __pyx_wrapperbase_8PyClical_8clifford_20__add__.doc = __pyx_doc_8PyClical_8clifford_20__add__;
19459 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_20__add__;
19463 #if CYTHON_COMPILING_IN_CPYTHON 19465 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__iadd__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19466 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19467 __pyx_wrapperbase_8PyClical_8clifford_22__iadd__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19468 __pyx_wrapperbase_8PyClical_8clifford_22__iadd__.doc = __pyx_doc_8PyClical_8clifford_22__iadd__;
19469 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_22__iadd__;
19473 #if CYTHON_COMPILING_IN_CPYTHON 19475 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__sub__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19476 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19477 __pyx_wrapperbase_8PyClical_8clifford_24__sub__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19478 __pyx_wrapperbase_8PyClical_8clifford_24__sub__.doc = __pyx_doc_8PyClical_8clifford_24__sub__;
19479 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_24__sub__;
19483 #if CYTHON_COMPILING_IN_CPYTHON 19485 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__isub__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19486 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19487 __pyx_wrapperbase_8PyClical_8clifford_26__isub__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19488 __pyx_wrapperbase_8PyClical_8clifford_26__isub__.doc = __pyx_doc_8PyClical_8clifford_26__isub__;
19489 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_26__isub__;
19493 #if CYTHON_COMPILING_IN_CPYTHON 19495 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__mul__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19496 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19497 __pyx_wrapperbase_8PyClical_8clifford_28__mul__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19498 __pyx_wrapperbase_8PyClical_8clifford_28__mul__.doc = __pyx_doc_8PyClical_8clifford_28__mul__;
19499 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_28__mul__;
19503 #if CYTHON_COMPILING_IN_CPYTHON 19505 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__imul__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19506 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19507 __pyx_wrapperbase_8PyClical_8clifford_30__imul__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19508 __pyx_wrapperbase_8PyClical_8clifford_30__imul__.doc = __pyx_doc_8PyClical_8clifford_30__imul__;
19509 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_30__imul__;
19513 #if CYTHON_COMPILING_IN_CPYTHON 19515 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__mod__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19516 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19517 __pyx_wrapperbase_8PyClical_8clifford_32__mod__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19518 __pyx_wrapperbase_8PyClical_8clifford_32__mod__.doc = __pyx_doc_8PyClical_8clifford_32__mod__;
19519 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_32__mod__;
19523 #if CYTHON_COMPILING_IN_CPYTHON 19525 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__imod__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19526 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19527 __pyx_wrapperbase_8PyClical_8clifford_34__imod__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19528 __pyx_wrapperbase_8PyClical_8clifford_34__imod__.doc = __pyx_doc_8PyClical_8clifford_34__imod__;
19529 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_34__imod__;
19533 #if CYTHON_COMPILING_IN_CPYTHON 19535 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__and__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19536 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19537 __pyx_wrapperbase_8PyClical_8clifford_36__and__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19538 __pyx_wrapperbase_8PyClical_8clifford_36__and__.doc = __pyx_doc_8PyClical_8clifford_36__and__;
19539 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_36__and__;
19543 #if CYTHON_COMPILING_IN_CPYTHON 19545 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__iand__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19546 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19547 __pyx_wrapperbase_8PyClical_8clifford_38__iand__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19548 __pyx_wrapperbase_8PyClical_8clifford_38__iand__.doc = __pyx_doc_8PyClical_8clifford_38__iand__;
19549 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_38__iand__;
19553 #if CYTHON_COMPILING_IN_CPYTHON 19555 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__xor__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19556 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19557 __pyx_wrapperbase_8PyClical_8clifford_40__xor__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19558 __pyx_wrapperbase_8PyClical_8clifford_40__xor__.doc = __pyx_doc_8PyClical_8clifford_40__xor__;
19559 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_40__xor__;
19563 #if CYTHON_COMPILING_IN_CPYTHON 19565 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__ixor__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19566 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19567 __pyx_wrapperbase_8PyClical_8clifford_42__ixor__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19568 __pyx_wrapperbase_8PyClical_8clifford_42__ixor__.doc = __pyx_doc_8PyClical_8clifford_42__ixor__;
19569 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_42__ixor__;
19573 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 19574 #if CYTHON_COMPILING_IN_CPYTHON 19576 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__div__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19577 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19578 __pyx_wrapperbase_8PyClical_8clifford_44__div__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19579 __pyx_wrapperbase_8PyClical_8clifford_44__div__.doc = __pyx_doc_8PyClical_8clifford_44__div__;
19580 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_44__div__;
19585 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 19586 #if CYTHON_COMPILING_IN_CPYTHON 19588 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__idiv__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19589 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19590 __pyx_wrapperbase_8PyClical_8clifford_46__idiv__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19591 __pyx_wrapperbase_8PyClical_8clifford_46__idiv__.doc = __pyx_doc_8PyClical_8clifford_46__idiv__;
19592 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_46__idiv__;
19597 #if CYTHON_COMPILING_IN_CPYTHON 19599 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__or__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19600 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19601 __pyx_wrapperbase_8PyClical_8clifford_50__or__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19602 __pyx_wrapperbase_8PyClical_8clifford_50__or__.doc = __pyx_doc_8PyClical_8clifford_50__or__;
19603 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_50__or__;
19607 #if CYTHON_COMPILING_IN_CPYTHON 19609 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__ior__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19610 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19611 __pyx_wrapperbase_8PyClical_8clifford_52__ior__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19612 __pyx_wrapperbase_8PyClical_8clifford_52__ior__.doc = __pyx_doc_8PyClical_8clifford_52__ior__;
19613 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_52__ior__;
19617 #if CYTHON_COMPILING_IN_CPYTHON 19619 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__pow__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19620 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19621 __pyx_wrapperbase_8PyClical_8clifford_54__pow__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19622 __pyx_wrapperbase_8PyClical_8clifford_54__pow__.doc = __pyx_doc_8PyClical_8clifford_54__pow__;
19623 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_54__pow__;
19627 #if CYTHON_COMPILING_IN_CPYTHON 19629 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__call__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19630 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19631 __pyx_wrapperbase_8PyClical_8clifford_60__call__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19632 __pyx_wrapperbase_8PyClical_8clifford_60__call__.doc = __pyx_doc_8PyClical_8clifford_60__call__;
19633 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_60__call__;
19637 #if CYTHON_COMPILING_IN_CPYTHON 19639 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__repr__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19640 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19641 __pyx_wrapperbase_8PyClical_8clifford_92__repr__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19642 __pyx_wrapperbase_8PyClical_8clifford_92__repr__.doc = __pyx_doc_8PyClical_8clifford_92__repr__;
19643 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_92__repr__;
19647 #if CYTHON_COMPILING_IN_CPYTHON 19649 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__str__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19650 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19651 __pyx_wrapperbase_8PyClical_8clifford_94__str__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19652 __pyx_wrapperbase_8PyClical_8clifford_94__str__.doc = __pyx_doc_8PyClical_8clifford_94__str__;
19653 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_94__str__;
19657 if (__Pyx_SetVtable(__pyx_type_8PyClical_clifford.tp_dict, __pyx_vtabptr_8PyClical_clifford) < 0) __PYX_ERR(0, 535, __pyx_L1_error)
19658 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_clifford, (PyObject *)&__pyx_type_8PyClical_clifford) < 0) __PYX_ERR(0, 535, __pyx_L1_error)
19659 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8PyClical_clifford) < 0) __PYX_ERR(0, 535, __pyx_L1_error)
19660 __pyx_ptype_8PyClical_clifford = &__pyx_type_8PyClical_clifford;
19661 if (PyType_Ready(&__pyx_type_8PyClical___pyx_scope_struct____iter__) < 0) __PYX_ERR(0, 227, __pyx_L1_error)
19662 __pyx_type_8PyClical___pyx_scope_struct____iter__.tp_print = 0;
19663 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)) {
19664 __pyx_type_8PyClical___pyx_scope_struct____iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
19666 __pyx_ptype_8PyClical___pyx_scope_struct____iter__ = &__pyx_type_8PyClical___pyx_scope_struct____iter__;
19667 __Pyx_RefNannyFinishContext();
19670 __Pyx_RefNannyFinishContext();
19674 static int __Pyx_modinit_type_import_code(
void) {
19675 __Pyx_RefNannyDeclarations
19676 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_import_code", 0);
19678 __Pyx_RefNannyFinishContext();
19682 static int __Pyx_modinit_variable_import_code(
void) {
19683 __Pyx_RefNannyDeclarations
19684 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_import_code", 0);
19686 __Pyx_RefNannyFinishContext();
19690 static int __Pyx_modinit_function_import_code(
void) {
19691 __Pyx_RefNannyDeclarations
19692 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_import_code", 0);
19694 __Pyx_RefNannyFinishContext();
19699 #if PY_MAJOR_VERSION < 3 19700 #ifdef CYTHON_NO_PYINIT_EXPORT 19701 #define __Pyx_PyMODINIT_FUNC void 19703 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC 19706 #ifdef CYTHON_NO_PYINIT_EXPORT 19707 #define __Pyx_PyMODINIT_FUNC PyObject * 19709 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC 19714 #if PY_MAJOR_VERSION < 3 19715 __Pyx_PyMODINIT_FUNC initPyClical(
void) CYTHON_SMALL_CODE;
19716 __Pyx_PyMODINIT_FUNC initPyClical(
void)
19718 __Pyx_PyMODINIT_FUNC PyInit_PyClical(
void) CYTHON_SMALL_CODE;
19719 __Pyx_PyMODINIT_FUNC PyInit_PyClical(
void)
19720 #if CYTHON_PEP489_MULTI_PHASE_INIT 19722 return PyModuleDef_Init(&__pyx_moduledef);
19724 static CYTHON_SMALL_CODE
int __Pyx_check_single_interpreter(
void) {
19725 #if PY_VERSION_HEX >= 0x030700A1 19726 static PY_INT64_T main_interpreter_id = -1;
19727 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
19728 if (main_interpreter_id == -1) {
19729 main_interpreter_id = current_id;
19730 return (unlikely(current_id == -1)) ? -1 : 0;
19731 }
else if (unlikely(main_interpreter_id != current_id))
19733 static PyInterpreterState *main_interpreter = NULL;
19734 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
19735 if (!main_interpreter) {
19736 main_interpreter = current_interpreter;
19737 }
else if (unlikely(main_interpreter != current_interpreter))
19742 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
19747 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) {
19748 PyObject *value = PyObject_GetAttrString(spec, from_name);
19750 if (likely(value)) {
19751 if (allow_none || value != Py_None) {
19752 result = PyDict_SetItemString(moddict, to_name, value);
19755 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
19762 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
19763 PyObject *module = NULL, *moddict, *modname;
19764 if (__Pyx_check_single_interpreter())
19767 return __Pyx_NewRef(__pyx_m);
19768 modname = PyObject_GetAttrString(spec,
"name");
19769 if (unlikely(!modname))
goto bad;
19770 module = PyModule_NewObject(modname);
19771 Py_DECREF(modname);
19772 if (unlikely(!module))
goto bad;
19773 moddict = PyModule_GetDict(module);
19774 if (unlikely(!moddict))
goto bad;
19775 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__", 1) < 0))
goto bad;
19776 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__", 1) < 0))
goto bad;
19777 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__", 1) < 0))
goto bad;
19778 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__", 0) < 0))
goto bad;
19781 Py_XDECREF(module);
19786 static CYTHON_SMALL_CODE
int __pyx_pymod_exec_PyClical(PyObject *__pyx_pyinit_module)
19790 PyObject *__pyx_t_1 = NULL;
19791 PyObject *__pyx_t_2 = NULL;
19792 PyObject *__pyx_t_3 = NULL;
19794 __Pyx_RefNannyDeclarations
19795 #if CYTHON_PEP489_MULTI_PHASE_INIT 19797 if (__pyx_m == __pyx_pyinit_module)
return 0;
19798 PyErr_SetString(PyExc_RuntimeError,
"Module 'PyClical' has already been imported. Re-initialisation is not supported.");
19801 #elif PY_MAJOR_VERSION >= 3 19802 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
19804 #if CYTHON_REFNANNY 19805 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
19806 if (!__Pyx_RefNanny) {
19808 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
19809 if (!__Pyx_RefNanny)
19810 Py_FatalError(
"failed to import 'refnanny' module");
19813 __Pyx_RefNannySetupContext(
"__Pyx_PyMODINIT_FUNC PyInit_PyClical(void)", 0);
19814 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
19815 #ifdef __Pxy_PyFrame_Initialize_Offsets 19816 __Pxy_PyFrame_Initialize_Offsets();
19818 __pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
19819 __pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
19820 __pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
19821 #ifdef __Pyx_CyFunction_USED 19822 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
19824 #ifdef __Pyx_FusedFunction_USED 19825 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
19827 #ifdef __Pyx_Coroutine_USED 19828 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
19830 #ifdef __Pyx_Generator_USED 19831 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
19833 #ifdef __Pyx_AsyncGen_USED 19834 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
19836 #ifdef __Pyx_StopAsyncIteration_USED 19837 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
19841 #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS 19843 PyEval_InitThreads();
19847 #if CYTHON_PEP489_MULTI_PHASE_INIT 19848 __pyx_m = __pyx_pyinit_module;
19849 Py_INCREF(__pyx_m);
19851 #if PY_MAJOR_VERSION < 3 19852 __pyx_m = Py_InitModule4(
"PyClical", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
19854 __pyx_m = PyModule_Create(&__pyx_moduledef);
19856 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
19858 __pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
19859 Py_INCREF(__pyx_d);
19860 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
19861 __pyx_cython_runtime = PyImport_AddModule((
char *)
"cython_runtime");
if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
19862 #if CYTHON_COMPILING_IN_PYPY 19863 Py_INCREF(__pyx_b);
19865 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
19867 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
19868 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) 19869 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
19871 if (__pyx_module_is_main_PyClical) {
19872 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
19874 #if PY_MAJOR_VERSION >= 3 19876 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
19877 if (!PyDict_GetItemString(modules,
"PyClical")) {
19878 if (unlikely(PyDict_SetItemString(modules,
"PyClical", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
19883 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
19885 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
19887 (void)__Pyx_modinit_global_init_code();
19888 (void)__Pyx_modinit_variable_export_code();
19889 (void)__Pyx_modinit_function_export_code();
19890 if (unlikely(__Pyx_modinit_type_init_code() != 0))
goto __pyx_L1_error;
19891 (void)__Pyx_modinit_type_import_code();
19892 (void)__Pyx_modinit_variable_import_code();
19893 (void)__Pyx_modinit_function_import_code();
19895 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) 19896 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
19906 __pyx_t_1 = __Pyx_Import(__pyx_n_s_math, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
19907 __Pyx_GOTREF(__pyx_t_1);
19908 if (PyDict_SetItem(__pyx_d, __pyx_n_s_math, __pyx_t_1) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
19909 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19918 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numbers, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
19919 __Pyx_GOTREF(__pyx_t_1);
19920 if (PyDict_SetItem(__pyx_d, __pyx_n_s_numbers, __pyx_t_1) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
19921 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19930 __pyx_t_1 = __Pyx_Import(__pyx_n_s_collections, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error)
19931 __Pyx_GOTREF(__pyx_t_1);
19932 if (PyDict_SetItem(__pyx_d, __pyx_n_s_collections, __pyx_t_1) < 0) __PYX_ERR(0, 30, __pyx_L1_error)
19933 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19942 if (PyDict_SetItem(__pyx_d, __pyx_n_s_version, __pyx_kp_s_0_8_2) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
19951 __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)
19952 __Pyx_GOTREF(__pyx_t_1);
19953 if (PyDict_SetItem(__pyx_d, __pyx_n_s_index_set_hidden_doctests, __pyx_t_1) < 0) __PYX_ERR(0, 404, __pyx_L1_error)
19954 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19963 __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)
19964 __Pyx_GOTREF(__pyx_t_1);
19965 if (PyDict_SetItem(__pyx_d, __pyx_n_s_clifford_hidden_doctests, __pyx_t_1) < 0) __PYX_ERR(0, 1243, __pyx_L1_error)
19966 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19975 __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)
19976 __Pyx_GOTREF(__pyx_t_1);
19977 __pyx_t_2 = __pyx_f_8PyClical_atan(__pyx_t_1, 0, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1856, __pyx_L1_error)
19978 __Pyx_GOTREF(__pyx_t_2);
19979 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19980 __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_float_8_0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1856, __pyx_L1_error)
19981 __Pyx_GOTREF(__pyx_t_1);
19982 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19983 if (PyDict_SetItem(__pyx_d, __pyx_n_s_tau, __pyx_t_1) < 0) __PYX_ERR(0, 1856, __pyx_L1_error)
19984 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19993 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_tau);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1857, __pyx_L1_error)
19994 __Pyx_GOTREF(__pyx_t_1);
19995 __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)
19996 __Pyx_GOTREF(__pyx_t_2);
19997 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19998 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pi, __pyx_t_2) < 0) __PYX_ERR(0, 1857, __pyx_L1_error)
19999 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20008 if (PyDict_SetItem(__pyx_d, __pyx_n_s_cl, ((PyObject *)__pyx_ptype_8PyClical_clifford)) < 0) __PYX_ERR(0, 1859, __pyx_L1_error)
20017 if (PyDict_SetItem(__pyx_d, __pyx_n_s_ist, ((PyObject *)__pyx_ptype_8PyClical_index_set)) < 0) __PYX_ERR(0, 1879, __pyx_L1_error)
20026 __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)
20027 __Pyx_GOTREF(__pyx_t_2);
20028 if (PyDict_SetItem(__pyx_d, __pyx_n_s_e, __pyx_t_2) < 0) __PYX_ERR(0, 1887, __pyx_L1_error)
20029 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20038 __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)
20039 __Pyx_GOTREF(__pyx_t_2);
20040 if (PyDict_SetItem(__pyx_d, __pyx_n_s_istpq, __pyx_t_2) < 0) __PYX_ERR(0, 1900, __pyx_L1_error)
20041 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20050 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_e);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1909, __pyx_L1_error)
20051 __Pyx_GOTREF(__pyx_t_2);
20052 __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)
20053 __Pyx_GOTREF(__pyx_t_1);
20054 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20055 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_e);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1909, __pyx_L1_error)
20056 __Pyx_GOTREF(__pyx_t_2);
20057 __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)
20058 __Pyx_GOTREF(__pyx_t_3);
20059 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20060 __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1909, __pyx_L1_error)
20061 __Pyx_GOTREF(__pyx_t_2);
20062 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20063 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20064 if (PyDict_SetItem(__pyx_d, __pyx_n_s_ninf3, __pyx_t_2) < 0) __PYX_ERR(0, 1909, __pyx_L1_error)
20065 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20074 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_e);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1910, __pyx_L1_error)
20075 __Pyx_GOTREF(__pyx_t_2);
20076 __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)
20077 __Pyx_GOTREF(__pyx_t_3);
20078 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20079 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_e);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1910, __pyx_L1_error)
20080 __Pyx_GOTREF(__pyx_t_2);
20081 __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)
20082 __Pyx_GOTREF(__pyx_t_1);
20083 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20084 __pyx_t_2 = PyNumber_Subtract(__pyx_t_3, __pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1910, __pyx_L1_error)
20085 __Pyx_GOTREF(__pyx_t_2);
20086 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20087 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20088 if (PyDict_SetItem(__pyx_d, __pyx_n_s_nbar3, __pyx_t_2) < 0) __PYX_ERR(0, 1910, __pyx_L1_error)
20089 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20098 __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)
20099 __Pyx_GOTREF(__pyx_t_2);
20100 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1913, __pyx_L1_error)
20101 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20109 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1917, __pyx_L1_error)
20110 __Pyx_GOTREF(__pyx_t_2);
20111 __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)
20112 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20120 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_test);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1918, __pyx_L1_error)
20121 __Pyx_GOTREF(__pyx_t_2);
20122 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1918, __pyx_L1_error)
20123 __Pyx_GOTREF(__pyx_t_1);
20124 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20125 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20140 __pyx_t_1 = __Pyx_PyDict_NewPresized(107);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
20141 __Pyx_GOTREF(__pyx_t_1);
20142 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)
20143 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)
20144 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)
20145 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)
20146 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)
20147 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)
20148 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)
20149 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)
20150 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)
20151 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)
20152 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)
20153 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)
20154 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)
20155 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)
20156 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)
20157 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)
20158 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)
20159 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)
20160 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)
20161 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)
20162 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)
20163 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)
20164 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)
20165 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)
20166 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)
20167 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)
20168 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)
20169 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)
20170 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)
20171 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)
20172 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)
20173 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)
20174 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)
20175 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)
20176 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)
20177 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)
20178 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)
20179 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)
20180 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)
20181 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)
20182 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)
20183 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)
20184 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)
20185 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)
20186 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)
20187 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)
20188 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)
20189 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)
20190 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)
20191 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)
20192 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)
20193 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)
20194 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)
20195 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)
20196 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)
20197 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)
20198 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)
20199 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)
20200 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)
20201 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)
20202 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)
20203 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)
20204 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)
20205 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)
20206 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)
20207 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)
20208 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)
20209 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)
20210 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)
20211 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)
20212 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)
20213 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)
20214 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)
20215 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)
20216 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)
20217 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)
20218 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)
20219 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)
20220 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)
20221 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)
20222 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)
20223 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)
20224 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)
20225 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)
20226 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)
20227 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)
20228 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)
20229 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)
20230 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)
20231 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)
20232 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)
20233 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)
20234 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)
20235 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)
20236 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)
20237 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)
20238 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)
20239 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)
20240 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)
20241 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)
20242 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)
20243 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)
20244 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)
20245 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)
20246 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)
20247 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)
20248 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)
20249 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_2, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20250 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20256 __Pyx_XDECREF(__pyx_t_1);
20257 __Pyx_XDECREF(__pyx_t_2);
20258 __Pyx_XDECREF(__pyx_t_3);
20261 __Pyx_AddTraceback(
"init PyClical", __pyx_clineno, __pyx_lineno, __pyx_filename);
20264 }
else if (!PyErr_Occurred()) {
20265 PyErr_SetString(PyExc_ImportError,
"init PyClical");
20268 __Pyx_RefNannyFinishContext();
20269 #if CYTHON_PEP489_MULTI_PHASE_INIT 20270 return (__pyx_m != NULL) ? 0 : -1;
20271 #elif PY_MAJOR_VERSION >= 3 20280 #if CYTHON_REFNANNY 20281 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
20282 PyObject *m = NULL, *p = NULL;
20284 m = PyImport_ImportModule(modname);
20286 p = PyObject_GetAttrString(m,
"RefNannyAPI");
20288 r = PyLong_AsVoidPtr(p);
20292 return (__Pyx_RefNannyAPIStruct *)r;
20297 #if CYTHON_USE_TYPE_SLOTS 20298 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject*
obj, PyObject* attr_name) {
20299 PyTypeObject* tp = Py_TYPE(
obj);
20300 if (likely(tp->tp_getattro))
20301 return tp->tp_getattro(
obj, attr_name);
20302 #if PY_MAJOR_VERSION < 3 20303 if (likely(tp->tp_getattr))
20304 return tp->tp_getattr(
obj, PyString_AS_STRING(attr_name));
20306 return PyObject_GetAttr(
obj, attr_name);
20311 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
20312 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
20313 if (unlikely(!result)) {
20314 PyErr_Format(PyExc_NameError,
20315 #
if PY_MAJOR_VERSION >= 3
20316 "name '%U' is not defined", name);
20318 "name '%.200s' is not defined", PyString_AS_STRING(name));
20325 #if CYTHON_FAST_PYCCALL 20326 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
20327 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
20328 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
20329 PyObject *
self = PyCFunction_GET_SELF(func);
20330 int flags = PyCFunction_GET_FLAGS(func);
20331 assert(PyCFunction_Check(func));
20332 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
20333 assert(nargs >= 0);
20334 assert(nargs == 0 || args != NULL);
20338 assert(!PyErr_Occurred());
20339 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
20340 return (*((__Pyx_PyCFunctionFastWithKeywords)(
void*)meth)) (
self, args, nargs, NULL);
20342 return (*((__Pyx_PyCFunctionFast)(
void*)meth)) (
self, args, nargs);
20348 #if CYTHON_FAST_PYCALL 20349 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
20350 PyObject *globals) {
20352 PyThreadState *tstate = __Pyx_PyThreadState_Current;
20353 PyObject **fastlocals;
20356 assert(globals != NULL);
20361 assert(tstate != NULL);
20362 f = PyFrame_New(tstate, co, globals, NULL);
20366 fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
20367 for (
i = 0;
i < na;
i++) {
20369 fastlocals[
i] = *args++;
20371 result = PyEval_EvalFrameEx(f,0);
20372 ++tstate->recursion_depth;
20374 --tstate->recursion_depth;
20377 #if 1 || PY_VERSION_HEX < 0x030600B1 20378 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
int nargs, PyObject *kwargs) {
20379 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
20380 PyObject *globals = PyFunction_GET_GLOBALS(func);
20381 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
20383 #if PY_MAJOR_VERSION >= 3 20386 PyObject *kwtuple, **k;
20391 assert(kwargs == NULL || PyDict_Check(kwargs));
20392 nk = kwargs ? PyDict_Size(kwargs) : 0;
20393 if (Py_EnterRecursiveCall((
char*)
" while calling a Python object")) {
20397 #
if PY_MAJOR_VERSION >= 3
20398 co->co_kwonlyargcount == 0 &&
20400 likely(kwargs == NULL || nk == 0) &&
20401 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
20402 if (argdefs == NULL && co->co_argcount == nargs) {
20403 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
20406 else if (nargs == 0 && argdefs != NULL
20407 && co->co_argcount == Py_SIZE(argdefs)) {
20410 args = &PyTuple_GET_ITEM(argdefs, 0);
20411 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
20415 if (kwargs != NULL) {
20417 kwtuple = PyTuple_New(2 * nk);
20418 if (kwtuple == NULL) {
20422 k = &PyTuple_GET_ITEM(kwtuple, 0);
20424 while (PyDict_Next(kwargs, &pos, &k[
i], &k[
i+1])) {
20435 closure = PyFunction_GET_CLOSURE(func);
20436 #if PY_MAJOR_VERSION >= 3 20437 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
20439 if (argdefs != NULL) {
20440 d = &PyTuple_GET_ITEM(argdefs, 0);
20441 nd = Py_SIZE(argdefs);
20447 #if PY_MAJOR_VERSION >= 3 20448 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
20451 d, (
int)nd, kwdefs, closure);
20453 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
20456 d, (
int)nd, closure);
20458 Py_XDECREF(kwtuple);
20460 Py_LeaveRecursiveCall();
20467 #if CYTHON_COMPILING_IN_CPYTHON 20468 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
20470 ternaryfunc call = func->ob_type->tp_call;
20471 if (unlikely(!call))
20472 return PyObject_Call(func, arg, kw);
20473 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
20475 result = (*call)(func, arg, kw);
20476 Py_LeaveRecursiveCall();
20477 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
20480 "NULL result without error in PyObject_Call");
20487 #if CYTHON_COMPILING_IN_CPYTHON 20488 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
20489 PyObject *
self, *result;
20491 cfunc = PyCFunction_GET_FUNCTION(func);
20492 self = PyCFunction_GET_SELF(func);
20493 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
20495 result = cfunc(
self, arg);
20496 Py_LeaveRecursiveCall();
20497 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
20500 "NULL result without error in PyObject_Call");
20507 #if CYTHON_COMPILING_IN_CPYTHON 20508 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
20510 PyObject *args = PyTuple_New(1);
20511 if (unlikely(!args))
return NULL;
20513 PyTuple_SET_ITEM(args, 0, arg);
20514 result = __Pyx_PyObject_Call(func, args, NULL);
20518 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
20519 #if CYTHON_FAST_PYCALL 20520 if (PyFunction_Check(func)) {
20521 return __Pyx_PyFunction_FastCall(func, &arg, 1);
20524 if (likely(PyCFunction_Check(func))) {
20525 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
20526 return __Pyx_PyObject_CallMethO(func, arg);
20527 #if CYTHON_FAST_PYCCALL 20528 }
else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
20529 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
20533 return __Pyx__PyObject_CallOneArg(func, arg);
20536 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
20538 PyObject *args = PyTuple_Pack(1, arg);
20539 if (unlikely(!args))
return NULL;
20540 result = __Pyx_PyObject_Call(func, args, NULL);
20547 #if CYTHON_FAST_THREAD_STATE 20548 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
20549 PyObject *tmp_type, *tmp_value, *tmp_tb;
20550 tmp_type = tstate->curexc_type;
20551 tmp_value = tstate->curexc_value;
20552 tmp_tb = tstate->curexc_traceback;
20553 tstate->curexc_type = type;
20554 tstate->curexc_value = value;
20555 tstate->curexc_traceback = tb;
20556 Py_XDECREF(tmp_type);
20557 Py_XDECREF(tmp_value);
20558 Py_XDECREF(tmp_tb);
20560 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
20561 *type = tstate->curexc_type;
20562 *value = tstate->curexc_value;
20563 *tb = tstate->curexc_traceback;
20564 tstate->curexc_type = 0;
20565 tstate->curexc_value = 0;
20566 tstate->curexc_traceback = 0;
20571 static void __Pyx_WriteUnraisable(
const char *name, CYTHON_UNUSED
int clineno,
20572 CYTHON_UNUSED
int lineno, CYTHON_UNUSED
const char *filename,
20573 int full_traceback, CYTHON_UNUSED
int nogil) {
20574 PyObject *old_exc, *old_val, *old_tb;
20576 __Pyx_PyThreadState_declare
20578 PyGILState_STATE state;
20580 state = PyGILState_Ensure();
20582 else state = (PyGILState_STATE)-1;
20585 __Pyx_PyThreadState_assign
20586 __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
20587 if (full_traceback) {
20588 Py_XINCREF(old_exc);
20589 Py_XINCREF(old_val);
20590 Py_XINCREF(old_tb);
20591 __Pyx_ErrRestore(old_exc, old_val, old_tb);
20594 #if PY_MAJOR_VERSION < 3 20595 ctx = PyString_FromString(name);
20597 ctx = PyUnicode_FromString(name);
20599 __Pyx_ErrRestore(old_exc, old_val, old_tb);
20601 PyErr_WriteUnraisable(Py_None);
20603 PyErr_WriteUnraisable(ctx);
20608 PyGILState_Release(state);
20613 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS 20614 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *
obj) {
20615 PyObject *dict = Py_TYPE(
obj)->tp_dict;
20616 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
20618 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *
obj) {
20619 PyObject **dictptr = NULL;
20620 Py_ssize_t offset = Py_TYPE(
obj)->tp_dictoffset;
20622 #if CYTHON_COMPILING_IN_CPYTHON 20623 dictptr = (likely(offset > 0)) ? (PyObject **) ((
char *)
obj + offset) : _PyObject_GetDictPtr(
obj);
20625 dictptr = _PyObject_GetDictPtr(
obj);
20628 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
20630 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject*
obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
20631 PyObject *dict = Py_TYPE(
obj)->tp_dict;
20632 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
20634 return obj_dict_version == __Pyx_get_object_dict_version(
obj);
20639 #if CYTHON_COMPILING_IN_CPYTHON 20640 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
20641 #if CYTHON_FAST_PYCALL 20642 if (PyFunction_Check(func)) {
20643 return __Pyx_PyFunction_FastCall(func, NULL, 0);
20646 #ifdef __Pyx_CyFunction_USED 20647 if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
20649 if (likely(PyCFunction_Check(func)))
20652 if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
20653 return __Pyx_PyObject_CallMethO(func, NULL);
20656 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
20661 static void __Pyx_RaiseDoubleKeywordsError(
20662 const char* func_name,
20665 PyErr_Format(PyExc_TypeError,
20666 #
if PY_MAJOR_VERSION >= 3
20667 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
20669 "%s() got multiple values for keyword argument '%s'", func_name,
20670 PyString_AsString(kw_name));
20675 static int __Pyx_ParseOptionalKeywords(
20677 PyObject **argnames[],
20679 PyObject *values[],
20680 Py_ssize_t num_pos_args,
20681 const char* function_name)
20683 PyObject *key = 0, *value = 0;
20684 Py_ssize_t pos = 0;
20686 PyObject*** first_kw_arg = argnames + num_pos_args;
20687 while (PyDict_Next(kwds, &pos, &key, &value)) {
20688 name = first_kw_arg;
20689 while (*name && (**name != key)) name++;
20691 values[name-argnames] = value;
20694 name = first_kw_arg;
20695 #if PY_MAJOR_VERSION < 3 20696 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
20698 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
20699 && _PyString_Eq(**name, key)) {
20700 values[name-argnames] = value;
20705 if (*name)
continue;
20707 PyObject*** argname = argnames;
20708 while (argname != first_kw_arg) {
20709 if ((**argname == key) || (
20710 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
20711 && _PyString_Eq(**argname, key))) {
20712 goto arg_passed_twice;
20719 if (likely(PyUnicode_Check(key))) {
20721 int cmp = (**name == key) ? 0 :
20722 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
20723 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
20725 PyUnicode_Compare(**name, key);
20726 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
20728 values[name-argnames] = value;
20733 if (*name)
continue;
20735 PyObject*** argname = argnames;
20736 while (argname != first_kw_arg) {
20737 int cmp = (**argname == key) ? 0 :
20738 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
20739 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
20741 PyUnicode_Compare(**argname, key);
20742 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
20743 if (cmp == 0)
goto arg_passed_twice;
20748 goto invalid_keyword_type;
20750 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
20752 goto invalid_keyword;
20757 __Pyx_RaiseDoubleKeywordsError(function_name, key);
20759 invalid_keyword_type:
20760 PyErr_Format(PyExc_TypeError,
20761 "%.200s() keywords must be strings", function_name);
20764 PyErr_Format(PyExc_TypeError,
20765 #
if PY_MAJOR_VERSION < 3
20766 "%.200s() got an unexpected keyword argument '%.200s'",
20767 function_name, PyString_AsString(key));
20769 "%s() got an unexpected keyword argument '%U'",
20770 function_name, key);
20777 static void __Pyx_RaiseArgtupleInvalid(
20778 const char* func_name,
20780 Py_ssize_t num_min,
20781 Py_ssize_t num_max,
20782 Py_ssize_t num_found)
20784 Py_ssize_t num_expected;
20785 const char *more_or_less;
20786 if (num_found < num_min) {
20787 num_expected = num_min;
20788 more_or_less =
"at least";
20790 num_expected = num_max;
20791 more_or_less =
"at most";
20794 more_or_less =
"exactly";
20796 PyErr_Format(PyExc_TypeError,
20797 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
20798 func_name, more_or_less, num_expected,
20799 (num_expected == 1) ?
"" :
"s", num_found);
20803 #if CYTHON_USE_DICT_VERSIONS 20804 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
20806 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
20810 #if !CYTHON_AVOID_BORROWED_REFS 20811 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 20812 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
20813 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
20814 if (likely(result)) {
20815 return __Pyx_NewRef(result);
20816 }
else if (unlikely(PyErr_Occurred())) {
20820 result = PyDict_GetItem(__pyx_d, name);
20821 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
20822 if (likely(result)) {
20823 return __Pyx_NewRef(result);
20827 result = PyObject_GetItem(__pyx_d, name);
20828 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
20829 if (likely(result)) {
20830 return __Pyx_NewRef(result);
20834 return __Pyx_GetBuiltinName(name);
20838 #if CYTHON_USE_EXC_INFO_STACK 20839 static _PyErr_StackItem *
20840 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
20842 _PyErr_StackItem *exc_info = tstate->exc_info;
20843 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
20844 exc_info->previous_item != NULL)
20846 exc_info = exc_info->previous_item;
20853 #if CYTHON_FAST_THREAD_STATE 20854 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
20855 #if CYTHON_USE_EXC_INFO_STACK 20856 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
20857 *type = exc_info->exc_type;
20858 *value = exc_info->exc_value;
20859 *tb = exc_info->exc_traceback;
20861 *type = tstate->exc_type;
20862 *value = tstate->exc_value;
20863 *tb = tstate->exc_traceback;
20866 Py_XINCREF(*value);
20869 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
20870 PyObject *tmp_type, *tmp_value, *tmp_tb;
20871 #if CYTHON_USE_EXC_INFO_STACK 20872 _PyErr_StackItem *exc_info = tstate->exc_info;
20873 tmp_type = exc_info->exc_type;
20874 tmp_value = exc_info->exc_value;
20875 tmp_tb = exc_info->exc_traceback;
20876 exc_info->exc_type = type;
20877 exc_info->exc_value = value;
20878 exc_info->exc_traceback = tb;
20880 tmp_type = tstate->exc_type;
20881 tmp_value = tstate->exc_value;
20882 tmp_tb = tstate->exc_traceback;
20883 tstate->exc_type = type;
20884 tstate->exc_value = value;
20885 tstate->exc_traceback = tb;
20887 Py_XDECREF(tmp_type);
20888 Py_XDECREF(tmp_value);
20889 Py_XDECREF(tmp_tb);
20894 #if CYTHON_FAST_THREAD_STATE 20895 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
20897 n = PyTuple_GET_SIZE(tuple);
20898 #if PY_MAJOR_VERSION >= 3 20899 for (
i=0;
i<n;
i++) {
20900 if (exc_type == PyTuple_GET_ITEM(tuple,
i))
return 1;
20903 for (
i=0;
i<n;
i++) {
20904 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple,
i)))
return 1;
20908 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
20909 PyObject *exc_type = tstate->curexc_type;
20910 if (exc_type == err)
return 1;
20911 if (unlikely(!exc_type))
return 0;
20912 if (unlikely(PyTuple_Check(err)))
20913 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
20914 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
20919 #if CYTHON_FAST_THREAD_STATE 20920 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
20922 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
20925 PyObject *local_type, *local_value, *local_tb;
20926 #if CYTHON_FAST_THREAD_STATE 20927 PyObject *tmp_type, *tmp_value, *tmp_tb;
20928 local_type = tstate->curexc_type;
20929 local_value = tstate->curexc_value;
20930 local_tb = tstate->curexc_traceback;
20931 tstate->curexc_type = 0;
20932 tstate->curexc_value = 0;
20933 tstate->curexc_traceback = 0;
20935 PyErr_Fetch(&local_type, &local_value, &local_tb);
20937 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
20938 #if CYTHON_FAST_THREAD_STATE 20939 if (unlikely(tstate->curexc_type))
20941 if (unlikely(PyErr_Occurred()))
20944 #if PY_MAJOR_VERSION >= 3 20946 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
20950 Py_XINCREF(local_tb);
20951 Py_XINCREF(local_type);
20952 Py_XINCREF(local_value);
20953 *type = local_type;
20954 *value = local_value;
20956 #if CYTHON_FAST_THREAD_STATE 20957 #if CYTHON_USE_EXC_INFO_STACK 20959 _PyErr_StackItem *exc_info = tstate->exc_info;
20960 tmp_type = exc_info->exc_type;
20961 tmp_value = exc_info->exc_value;
20962 tmp_tb = exc_info->exc_traceback;
20963 exc_info->exc_type = local_type;
20964 exc_info->exc_value = local_value;
20965 exc_info->exc_traceback = local_tb;
20968 tmp_type = tstate->exc_type;
20969 tmp_value = tstate->exc_value;
20970 tmp_tb = tstate->exc_traceback;
20971 tstate->exc_type = local_type;
20972 tstate->exc_value = local_value;
20973 tstate->exc_traceback = local_tb;
20975 Py_XDECREF(tmp_type);
20976 Py_XDECREF(tmp_value);
20977 Py_XDECREF(tmp_tb);
20979 PyErr_SetExcInfo(local_type, local_value, local_tb);
20986 Py_XDECREF(local_type);
20987 Py_XDECREF(local_value);
20988 Py_XDECREF(local_tb);
20993 #if PY_MAJOR_VERSION < 3 20994 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
20995 CYTHON_UNUSED PyObject *cause) {
20996 __Pyx_PyThreadState_declare
20998 if (!value || value == Py_None)
21002 if (!tb || tb == Py_None)
21006 if (!PyTraceBack_Check(tb)) {
21007 PyErr_SetString(PyExc_TypeError,
21008 "raise: arg 3 must be a traceback or None");
21012 if (PyType_Check(type)) {
21013 #if CYTHON_COMPILING_IN_PYPY 21015 Py_INCREF(Py_None);
21019 PyErr_NormalizeException(&type, &value, &tb);
21022 PyErr_SetString(PyExc_TypeError,
21023 "instance exception may not have a separate value");
21027 type = (PyObject*) Py_TYPE(type);
21029 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
21030 PyErr_SetString(PyExc_TypeError,
21031 "raise: exception class must be a subclass of BaseException");
21035 __Pyx_PyThreadState_assign
21036 __Pyx_ErrRestore(type, value, tb);
21045 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
21046 PyObject* owned_instance = NULL;
21047 if (tb == Py_None) {
21049 }
else if (tb && !PyTraceBack_Check(tb)) {
21050 PyErr_SetString(PyExc_TypeError,
21051 "raise: arg 3 must be a traceback or None");
21054 if (value == Py_None)
21056 if (PyExceptionInstance_Check(type)) {
21058 PyErr_SetString(PyExc_TypeError,
21059 "instance exception may not have a separate value");
21063 type = (PyObject*) Py_TYPE(value);
21064 }
else if (PyExceptionClass_Check(type)) {
21065 PyObject *instance_class = NULL;
21066 if (value && PyExceptionInstance_Check(value)) {
21067 instance_class = (PyObject*) Py_TYPE(value);
21068 if (instance_class != type) {
21069 int is_subclass = PyObject_IsSubclass(instance_class, type);
21070 if (!is_subclass) {
21071 instance_class = NULL;
21072 }
else if (unlikely(is_subclass == -1)) {
21075 type = instance_class;
21079 if (!instance_class) {
21082 args = PyTuple_New(0);
21083 else if (PyTuple_Check(value)) {
21087 args = PyTuple_Pack(1, value);
21090 owned_instance = PyObject_Call(type, args, NULL);
21092 if (!owned_instance)
21094 value = owned_instance;
21095 if (!PyExceptionInstance_Check(value)) {
21096 PyErr_Format(PyExc_TypeError,
21097 "calling %R should have returned an instance of " 21098 "BaseException, not %R",
21099 type, Py_TYPE(value));
21104 PyErr_SetString(PyExc_TypeError,
21105 "raise: exception class must be a subclass of BaseException");
21109 PyObject *fixed_cause;
21110 if (cause == Py_None) {
21111 fixed_cause = NULL;
21112 }
else if (PyExceptionClass_Check(cause)) {
21113 fixed_cause = PyObject_CallObject(cause, NULL);
21114 if (fixed_cause == NULL)
21116 }
else if (PyExceptionInstance_Check(cause)) {
21117 fixed_cause = cause;
21118 Py_INCREF(fixed_cause);
21120 PyErr_SetString(PyExc_TypeError,
21121 "exception causes must derive from " 21125 PyException_SetCause(value, fixed_cause);
21127 PyErr_SetObject(type, value);
21129 #if CYTHON_COMPILING_IN_PYPY 21130 PyObject *tmp_type, *tmp_value, *tmp_tb;
21131 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
21133 PyErr_Restore(tmp_type, tmp_value, tb);
21134 Py_XDECREF(tmp_tb);
21136 PyThreadState *tstate = __Pyx_PyThreadState_Current;
21137 PyObject* tmp_tb = tstate->curexc_traceback;
21138 if (tb != tmp_tb) {
21140 tstate->curexc_traceback = tb;
21141 Py_XDECREF(tmp_tb);
21146 Py_XDECREF(owned_instance);
21152 #if !CYTHON_COMPILING_IN_PYPY 21153 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
long intval,
int inplace,
int zerodivision_check) {
21155 (void)zerodivision_check;
21156 #if PY_MAJOR_VERSION < 3 21157 if (likely(PyInt_CheckExact(op1))) {
21158 const long b = intval;
21160 long a = PyInt_AS_LONG(op1);
21161 x = (long)((
unsigned long)a + b);
21162 if (likely((x^a) >= 0 || (x^b) >= 0))
21163 return PyInt_FromLong(x);
21164 return PyLong_Type.tp_as_number->nb_add(op1, op2);
21167 #if CYTHON_USE_PYLONG_INTERNALS 21168 if (likely(PyLong_CheckExact(op1))) {
21169 const long b = intval;
21171 #ifdef HAVE_LONG_LONG 21172 const PY_LONG_LONG llb = intval;
21173 PY_LONG_LONG lla, llx;
21175 const digit* digits = ((PyLongObject*)op1)->ob_digit;
21176 const Py_ssize_t size = Py_SIZE(op1);
21177 if (likely(__Pyx_sst_abs(size) <= 1)) {
21178 a = likely(size) ? digits[0] : 0;
21179 if (size == -1) a = -a;
21183 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
21184 a = -(long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21186 #ifdef HAVE_LONG_LONG 21187 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
21188 lla = -(PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
21192 CYTHON_FALLTHROUGH;
21194 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
21195 a = (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21197 #ifdef HAVE_LONG_LONG 21198 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
21199 lla = (PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
21203 CYTHON_FALLTHROUGH;
21205 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
21206 a = -(long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21208 #ifdef HAVE_LONG_LONG 21209 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
21210 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]));
21214 CYTHON_FALLTHROUGH;
21216 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
21217 a = (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21219 #ifdef HAVE_LONG_LONG 21220 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
21221 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]));
21225 CYTHON_FALLTHROUGH;
21227 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
21228 a = -(long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21230 #ifdef HAVE_LONG_LONG 21231 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
21232 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]));
21236 CYTHON_FALLTHROUGH;
21238 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
21239 a = (long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21241 #ifdef HAVE_LONG_LONG 21242 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
21243 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]));
21247 CYTHON_FALLTHROUGH;
21248 default:
return PyLong_Type.tp_as_number->nb_add(op1, op2);
21252 return PyLong_FromLong(x);
21253 #ifdef HAVE_LONG_LONG 21256 return PyLong_FromLongLong(llx);
21262 if (PyFloat_CheckExact(op1)) {
21263 const long b = intval;
21264 double a = PyFloat_AS_DOUBLE(op1);
21266 PyFPE_START_PROTECT(
"add",
return NULL)
21267 result = ((double)a) + (double)b;
21268 PyFPE_END_PROTECT(result)
21271 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
21276 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
21279 r = PyObject_SetItem(o, j, v);
21283 static CYTHON_INLINE
int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t
i, PyObject *v,
int is_list,
21284 CYTHON_NCP_UNUSED
int wraparound, CYTHON_NCP_UNUSED
int boundscheck) {
21285 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS 21286 if (is_list || PyList_CheckExact(o)) {
21287 Py_ssize_t n = (!wraparound) ?
i : ((likely(
i >= 0)) ?
i :
i + PyList_GET_SIZE(o));
21288 if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) {
21289 PyObject* old = PyList_GET_ITEM(o, n);
21291 PyList_SET_ITEM(o, n, v);
21296 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
21297 if (likely(m && m->sq_ass_item)) {
21298 if (wraparound && unlikely(
i < 0) && likely(m->sq_length)) {
21299 Py_ssize_t l = m->sq_length(o);
21300 if (likely(l >= 0)) {
21303 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
21308 return m->sq_ass_item(o,
i, v);
21312 #if CYTHON_COMPILING_IN_PYPY 21313 if (is_list || (PySequence_Check(o) && !PyDict_Check(o)))
21315 if (is_list || PySequence_Check(o))
21318 return PySequence_SetItem(o,
i, v);
21321 return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(
i), v);
21325 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2) {
21326 PyObject *args, *result = NULL;
21327 #if CYTHON_FAST_PYCALL 21328 if (PyFunction_Check(
function)) {
21329 PyObject *args[2] = {arg1, arg2};
21330 return __Pyx_PyFunction_FastCall(
function, args, 2);
21333 #if CYTHON_FAST_PYCCALL 21334 if (__Pyx_PyFastCFunction_Check(
function)) {
21335 PyObject *args[2] = {arg1, arg2};
21336 return __Pyx_PyCFunction_FastCall(
function, args, 2);
21339 args = PyTuple_New(2);
21340 if (unlikely(!args))
goto done;
21342 PyTuple_SET_ITEM(args, 0, arg1);
21344 PyTuple_SET_ITEM(args, 1, arg2);
21345 Py_INCREF(
function);
21346 result = __Pyx_PyObject_Call(
function, args, NULL);
21348 Py_DECREF(
function);
21354 static int __Pyx__ArgTypeTest(PyObject *
obj, PyTypeObject *type,
const char *name,
int exact)
21356 if (unlikely(!type)) {
21357 PyErr_SetString(PyExc_SystemError,
"Missing type object");
21361 #if PY_MAJOR_VERSION == 2 21362 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(
obj)))
return 1;
21366 if (likely(__Pyx_TypeCheck(
obj, type)))
return 1;
21368 PyErr_Format(PyExc_TypeError,
21369 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
21370 name, type->tp_name, Py_TYPE(
obj)->tp_name);
21375 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level) {
21376 PyObject *empty_list = 0;
21377 PyObject *module = 0;
21378 PyObject *global_dict = 0;
21379 PyObject *empty_dict = 0;
21381 #if PY_MAJOR_VERSION < 3 21382 PyObject *py_import;
21383 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
21390 empty_list = PyList_New(0);
21395 global_dict = PyModule_GetDict(__pyx_m);
21398 empty_dict = PyDict_New();
21402 #if PY_MAJOR_VERSION >= 3 21404 if (strchr(__Pyx_MODULE_NAME,
'.')) {
21405 module = PyImport_ImportModuleLevelObject(
21406 name, global_dict, empty_dict, list, 1);
21408 if (!PyErr_ExceptionMatches(PyExc_ImportError))
21417 #if PY_MAJOR_VERSION < 3 21418 PyObject *py_level = PyInt_FromLong(level);
21421 module = PyObject_CallFunctionObjArgs(py_import,
21422 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
21423 Py_DECREF(py_level);
21425 module = PyImport_ImportModuleLevelObject(
21426 name, global_dict, empty_dict, list, level);
21431 #if PY_MAJOR_VERSION < 3 21432 Py_XDECREF(py_import);
21434 Py_XDECREF(empty_list);
21435 Py_XDECREF(empty_dict);
21440 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 21441 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
21442 PyErr_Format(PyExc_AttributeError,
21443 #
if PY_MAJOR_VERSION >= 3
21444 "'%.50s' object has no attribute '%U'",
21445 tp->tp_name, attr_name);
21447 "'%.50s' object has no attribute '%.400s'",
21448 tp->tp_name, PyString_AS_STRING(attr_name));
21452 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject*
obj, PyObject* attr_name) {
21454 PyTypeObject *tp = Py_TYPE(
obj);
21455 if (unlikely(!PyString_Check(attr_name))) {
21456 return PyObject_GenericGetAttr(
obj, attr_name);
21458 assert(!tp->tp_dictoffset);
21459 descr = _PyType_Lookup(tp, attr_name);
21460 if (unlikely(!descr)) {
21461 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
21464 #if PY_MAJOR_VERSION < 3 21465 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
21468 descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
21470 PyObject *res = f(descr,
obj, (PyObject *)tp);
21480 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 21481 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject*
obj, PyObject* attr_name) {
21482 if (unlikely(Py_TYPE(
obj)->tp_dictoffset)) {
21483 return PyObject_GenericGetAttr(
obj, attr_name);
21485 return __Pyx_PyObject_GenericGetAttrNoDict(
obj, attr_name);
21490 static int __Pyx_SetVtable(PyObject *dict,
void *vtable) {
21491 #if PY_VERSION_HEX >= 0x02070000 21492 PyObject *ob = PyCapsule_New(vtable, 0, 0);
21494 PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
21498 if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
21508 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
21510 PyObject *name_attr;
21511 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name);
21512 if (likely(name_attr)) {
21513 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
21517 if (unlikely(ret < 0)) {
21521 Py_XDECREF(name_attr);
21524 static int __Pyx_setup_reduce(PyObject* type_obj) {
21526 PyObject *object_reduce = NULL;
21527 PyObject *object_reduce_ex = NULL;
21528 PyObject *reduce = NULL;
21529 PyObject *reduce_ex = NULL;
21530 PyObject *reduce_cython = NULL;
21531 PyObject *setstate = NULL;
21532 PyObject *setstate_cython = NULL;
21533 #if CYTHON_USE_PYTYPE_LOOKUP 21534 if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate))
goto GOOD;
21536 if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate))
goto GOOD;
21538 #if CYTHON_USE_PYTYPE_LOOKUP 21539 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto BAD;
21541 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto BAD;
21543 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex);
if (unlikely(!reduce_ex))
goto BAD;
21544 if (reduce_ex == object_reduce_ex) {
21545 #if CYTHON_USE_PYTYPE_LOOKUP 21546 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto BAD;
21548 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto BAD;
21550 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce);
if (unlikely(!reduce))
goto BAD;
21551 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
21552 reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython);
if (unlikely(!reduce_cython))
goto BAD;
21553 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython);
if (unlikely(ret < 0))
goto BAD;
21554 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython);
if (unlikely(ret < 0))
goto BAD;
21555 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
21556 if (!setstate) PyErr_Clear();
21557 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
21558 setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython);
if (unlikely(!setstate_cython))
goto BAD;
21559 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython);
if (unlikely(ret < 0))
goto BAD;
21560 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython);
if (unlikely(ret < 0))
goto BAD;
21562 PyType_Modified((PyTypeObject*)type_obj);
21567 if (!PyErr_Occurred())
21568 PyErr_Format(PyExc_RuntimeError,
"Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
21571 #if !CYTHON_USE_PYTYPE_LOOKUP 21572 Py_XDECREF(object_reduce);
21573 Py_XDECREF(object_reduce_ex);
21575 Py_XDECREF(reduce);
21576 Py_XDECREF(reduce_ex);
21577 Py_XDECREF(reduce_cython);
21578 Py_XDECREF(setstate);
21579 Py_XDECREF(setstate_cython);
21584 #if !CYTHON_COMPILING_IN_PYPY 21585 static PyObject* __Pyx_PyFloat_DivideObjC(PyObject *op1, PyObject *op2,
double floatval,
int inplace,
int zerodivision_check) {
21586 const double b = floatval;
21589 (void)zerodivision_check;
21590 if (likely(PyFloat_CheckExact(op1))) {
21591 a = PyFloat_AS_DOUBLE(op1);
21594 #if PY_MAJOR_VERSION < 3 21595 if (likely(PyInt_CheckExact(op1))) {
21596 a = (double) PyInt_AS_LONG(op1);
21600 if (likely(PyLong_CheckExact(op1))) {
21601 #if CYTHON_USE_PYLONG_INTERNALS 21602 const digit* digits = ((PyLongObject*)op1)->ob_digit;
21603 const Py_ssize_t size = Py_SIZE(op1);
21605 case 0: a = 0.0;
break;
21606 case -1: a = -(double) digits[0];
break;
21607 case 1: a = (double) digits[0];
break;
21610 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
21611 a = (double) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21612 if ((8 *
sizeof(
unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
21618 CYTHON_FALLTHROUGH;
21621 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
21622 a = (double) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21623 if ((8 *
sizeof(
unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
21629 CYTHON_FALLTHROUGH;
21632 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
21633 a = (double) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21634 if ((8 *
sizeof(
unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
21640 CYTHON_FALLTHROUGH;
21645 a = PyLong_AsDouble(op1);
21646 if (unlikely(a == -1.0 && PyErr_Occurred()))
return NULL;
21650 return (inplace ? __Pyx_PyNumber_InPlaceDivide(op1, op2) : __Pyx_PyNumber_Divide(op1, op2));
21653 PyFPE_START_PROTECT(
"divide",
return NULL)
21655 PyFPE_END_PROTECT(result)
21661 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals) {
21662 #if CYTHON_COMPILING_IN_PYPY 21663 return PyObject_RichCompareBool(s1, s2, equals);
21666 return (equals == Py_EQ);
21667 }
else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
21668 const char *ps1, *ps2;
21669 Py_ssize_t length = PyBytes_GET_SIZE(s1);
21670 if (length != PyBytes_GET_SIZE(s2))
21671 return (equals == Py_NE);
21672 ps1 = PyBytes_AS_STRING(s1);
21673 ps2 = PyBytes_AS_STRING(s2);
21674 if (ps1[0] != ps2[0]) {
21675 return (equals == Py_NE);
21676 }
else if (length == 1) {
21677 return (equals == Py_EQ);
21680 #if CYTHON_USE_UNICODE_INTERNALS 21681 Py_hash_t hash1, hash2;
21682 hash1 = ((PyBytesObject*)s1)->ob_shash;
21683 hash2 = ((PyBytesObject*)s2)->ob_shash;
21684 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
21685 return (equals == Py_NE);
21688 result = memcmp(ps1, ps2, (
size_t)length);
21689 return (equals == Py_EQ) ? (result == 0) : (result != 0);
21691 }
else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
21692 return (equals == Py_NE);
21693 }
else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
21694 return (equals == Py_NE);
21697 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
21700 result = __Pyx_PyObject_IsTrue(py_result);
21701 Py_DECREF(py_result);
21708 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals) {
21709 #if CYTHON_COMPILING_IN_PYPY 21710 return PyObject_RichCompareBool(s1, s2, equals);
21712 #if PY_MAJOR_VERSION < 3 21713 PyObject* owned_ref = NULL;
21715 int s1_is_unicode, s2_is_unicode;
21719 s1_is_unicode = PyUnicode_CheckExact(s1);
21720 s2_is_unicode = PyUnicode_CheckExact(s2);
21721 #if PY_MAJOR_VERSION < 3 21722 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
21723 owned_ref = PyUnicode_FromObject(s2);
21724 if (unlikely(!owned_ref))
21728 }
else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
21729 owned_ref = PyUnicode_FromObject(s1);
21730 if (unlikely(!owned_ref))
21734 }
else if (((!s2_is_unicode) & (!s1_is_unicode))) {
21735 return __Pyx_PyBytes_Equals(s1, s2, equals);
21738 if (s1_is_unicode & s2_is_unicode) {
21741 void *data1, *data2;
21742 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
21744 length = __Pyx_PyUnicode_GET_LENGTH(s1);
21745 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
21748 #if CYTHON_USE_UNICODE_INTERNALS 21750 Py_hash_t hash1, hash2;
21751 #if CYTHON_PEP393_ENABLED 21752 hash1 = ((PyASCIIObject*)s1)->hash;
21753 hash2 = ((PyASCIIObject*)s2)->hash;
21755 hash1 = ((PyUnicodeObject*)s1)->hash;
21756 hash2 = ((PyUnicodeObject*)s2)->hash;
21758 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
21763 kind = __Pyx_PyUnicode_KIND(s1);
21764 if (kind != __Pyx_PyUnicode_KIND(s2)) {
21767 data1 = __Pyx_PyUnicode_DATA(s1);
21768 data2 = __Pyx_PyUnicode_DATA(s2);
21769 if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
21771 }
else if (length == 1) {
21774 int result = memcmp(data1, data2, (
size_t)(length * kind));
21775 #if PY_MAJOR_VERSION < 3 21776 Py_XDECREF(owned_ref);
21778 return (equals == Py_EQ) ? (result == 0) : (result != 0);
21780 }
else if ((s1 == Py_None) & s2_is_unicode) {
21782 }
else if ((s2 == Py_None) & s1_is_unicode) {
21786 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
21787 #if PY_MAJOR_VERSION < 3 21788 Py_XDECREF(owned_ref);
21792 result = __Pyx_PyObject_IsTrue(py_result);
21793 Py_DECREF(py_result);
21797 #if PY_MAJOR_VERSION < 3 21798 Py_XDECREF(owned_ref);
21800 return (equals == Py_EQ);
21802 #if PY_MAJOR_VERSION < 3 21803 Py_XDECREF(owned_ref);
21805 return (equals == Py_NE);
21810 #ifndef CYTHON_CLINE_IN_TRACEBACK 21811 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line) {
21812 PyObject *use_cline;
21813 PyObject *ptype, *pvalue, *ptraceback;
21814 #if CYTHON_COMPILING_IN_CPYTHON 21815 PyObject **cython_runtime_dict;
21817 if (unlikely(!__pyx_cython_runtime)) {
21820 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
21821 #if CYTHON_COMPILING_IN_CPYTHON 21822 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
21823 if (likely(cython_runtime_dict)) {
21824 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
21825 use_cline, *cython_runtime_dict,
21826 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
21830 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
21831 if (use_cline_obj) {
21832 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
21833 Py_DECREF(use_cline_obj);
21841 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
21843 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
21846 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
21852 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
21853 int start = 0, mid = 0, end = count - 1;
21854 if (end >= 0 && code_line > entries[end].code_line) {
21857 while (start < end) {
21858 mid = start + (end - start) / 2;
21859 if (code_line < entries[mid].code_line) {
21861 }
else if (code_line > entries[mid].code_line) {
21867 if (code_line <= entries[mid].code_line) {
21873 static PyCodeObject *__pyx_find_code_object(
int code_line) {
21874 PyCodeObject* code_object;
21876 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
21879 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
21880 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
21883 code_object = __pyx_code_cache.entries[pos].code_object;
21884 Py_INCREF(code_object);
21885 return code_object;
21887 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
21889 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
21890 if (unlikely(!code_line)) {
21893 if (unlikely(!entries)) {
21894 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
21895 if (likely(entries)) {
21896 __pyx_code_cache.entries = entries;
21897 __pyx_code_cache.max_count = 64;
21898 __pyx_code_cache.count = 1;
21899 entries[0].code_line = code_line;
21900 entries[0].code_object = code_object;
21901 Py_INCREF(code_object);
21905 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
21906 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
21907 PyCodeObject* tmp = entries[pos].code_object;
21908 entries[pos].code_object = code_object;
21912 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
21913 int new_max = __pyx_code_cache.max_count + 64;
21914 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
21915 __pyx_code_cache.entries, (
size_t)new_max*
sizeof(__Pyx_CodeObjectCacheEntry));
21916 if (unlikely(!entries)) {
21919 __pyx_code_cache.entries = entries;
21920 __pyx_code_cache.max_count = new_max;
21922 for (
i=__pyx_code_cache.count;
i>pos;
i--) {
21923 entries[
i] = entries[
i-1];
21925 entries[pos].code_line = code_line;
21926 entries[pos].code_object = code_object;
21927 __pyx_code_cache.count++;
21928 Py_INCREF(code_object);
21932 #include "compile.h" 21933 #include "frameobject.h" 21934 #include "traceback.h" 21935 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
21936 const char *funcname,
int c_line,
21937 int py_line,
const char *filename) {
21938 PyCodeObject *py_code = 0;
21939 PyObject *py_srcfile = 0;
21940 PyObject *py_funcname = 0;
21941 #if PY_MAJOR_VERSION < 3 21942 py_srcfile = PyString_FromString(filename);
21944 py_srcfile = PyUnicode_FromString(filename);
21946 if (!py_srcfile)
goto bad;
21948 #if PY_MAJOR_VERSION < 3 21949 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
21951 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
21955 #if PY_MAJOR_VERSION < 3 21956 py_funcname = PyString_FromString(funcname);
21958 py_funcname = PyUnicode_FromString(funcname);
21961 if (!py_funcname)
goto bad;
21962 py_code = __Pyx_PyCode_New(
21979 Py_DECREF(py_srcfile);
21980 Py_DECREF(py_funcname);
21983 Py_XDECREF(py_srcfile);
21984 Py_XDECREF(py_funcname);
21987 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
21988 int py_line,
const char *filename) {
21989 PyCodeObject *py_code = 0;
21990 PyFrameObject *py_frame = 0;
21991 PyThreadState *tstate = __Pyx_PyThreadState_Current;
21993 c_line = __Pyx_CLineForTraceback(tstate, c_line);
21995 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
21997 py_code = __Pyx_CreateCodeObjectForTraceback(
21998 funcname, c_line, py_line, filename);
21999 if (!py_code)
goto bad;
22000 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
22002 py_frame = PyFrame_New(
22008 if (!py_frame)
goto bad;
22009 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
22010 PyTraceBack_Here(py_frame);
22012 Py_XDECREF(py_code);
22013 Py_XDECREF(py_frame);
22017 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ 22018 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) 22019 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ 22020 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) 22021 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ 22023 func_type value = func_value;\ 22024 if (sizeof(target_type) < sizeof(func_type)) {\ 22025 if (unlikely(value != (func_type) (target_type) value)) {\ 22026 func_type zero = 0;\ 22027 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ 22028 return (target_type) -1;\ 22029 if (is_unsigned && unlikely(value < zero))\ 22030 goto raise_neg_overflow;\ 22032 goto raise_overflow;\ 22035 return (target_type) value;\ 22039 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value) {
22040 const int neg_one = (int) ((
int) 0 - (int) 1), const_zero = (int) 0;
22041 const int is_unsigned = neg_one > const_zero;
22043 if (
sizeof(
int) <
sizeof(long)) {
22044 return PyInt_FromLong((
long) value);
22045 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
22046 return PyLong_FromUnsignedLong((
unsigned long) value);
22047 #ifdef HAVE_LONG_LONG 22048 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
22049 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
22053 if (
sizeof(
int) <=
sizeof(
long)) {
22054 return PyInt_FromLong((
long) value);
22055 #ifdef HAVE_LONG_LONG 22056 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
22057 return PyLong_FromLongLong((PY_LONG_LONG) value);
22062 int one = 1;
int little = (int)*(
unsigned char *)&one;
22063 unsigned char *bytes = (
unsigned char *)&value;
22064 return _PyLong_FromByteArray(bytes,
sizeof(
int),
22065 little, !is_unsigned);
22070 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *x) {
22071 const int neg_one = (int) ((
int) 0 - (int) 1), const_zero = (int) 0;
22072 const int is_unsigned = neg_one > const_zero;
22073 #if PY_MAJOR_VERSION < 3 22074 if (likely(PyInt_Check(x))) {
22075 if (
sizeof(
int) <
sizeof(long)) {
22076 __PYX_VERIFY_RETURN_INT(
int,
long, PyInt_AS_LONG(x))
22078 long val = PyInt_AS_LONG(x);
22079 if (is_unsigned && unlikely(val < 0)) {
22080 goto raise_neg_overflow;
22086 if (likely(PyLong_Check(x))) {
22088 #if CYTHON_USE_PYLONG_INTERNALS 22089 const digit* digits = ((PyLongObject*)x)->ob_digit;
22090 switch (Py_SIZE(x)) {
22091 case 0:
return (
int) 0;
22092 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, digits[0])
22094 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
22095 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22096 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22097 }
else if (8 *
sizeof(
int) >= 2 * PyLong_SHIFT) {
22098 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
22103 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
22104 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22105 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22106 }
else if (8 *
sizeof(
int) >= 3 * PyLong_SHIFT) {
22107 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
22112 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
22113 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22114 __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])))
22115 }
else if (8 *
sizeof(
int) >= 4 * PyLong_SHIFT) {
22116 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
22122 #if CYTHON_COMPILING_IN_CPYTHON 22123 if (unlikely(Py_SIZE(x) < 0)) {
22124 goto raise_neg_overflow;
22128 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
22129 if (unlikely(result < 0))
22131 if (unlikely(result == 1))
22132 goto raise_neg_overflow;
22135 if (
sizeof(
int) <=
sizeof(
unsigned long)) {
22136 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
22137 #ifdef HAVE_LONG_LONG 22138 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
22139 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
22143 #if CYTHON_USE_PYLONG_INTERNALS 22144 const digit* digits = ((PyLongObject*)x)->ob_digit;
22145 switch (Py_SIZE(x)) {
22146 case 0:
return (
int) 0;
22147 case -1: __PYX_VERIFY_RETURN_INT(
int, sdigit, (sdigit) (-(sdigit)digits[0]))
22148 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, +digits[0])
22150 if (8 *
sizeof(
int) - 1 > 1 * PyLong_SHIFT) {
22151 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22152 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22153 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
22154 return (
int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
22159 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
22160 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22161 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22162 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
22163 return (
int) ((((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
22168 if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
22169 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22170 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22171 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
22172 return (
int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
22177 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
22178 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22179 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22180 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
22181 return (
int) ((((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
22186 if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
22187 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22188 __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])))
22189 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
22190 return (
int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
22195 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
22196 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22197 __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])))
22198 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
22199 return (
int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
22205 if (
sizeof(
int) <=
sizeof(long)) {
22206 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
22207 #ifdef HAVE_LONG_LONG 22208 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
22209 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
22214 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) 22215 PyErr_SetString(PyExc_RuntimeError,
22216 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
22219 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
22220 #if PY_MAJOR_VERSION < 3 22221 if (likely(v) && !PyLong_Check(v)) {
22223 v = PyNumber_Long(tmp);
22228 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
22229 unsigned char *bytes = (
unsigned char *)&val;
22230 int ret = _PyLong_AsByteArray((PyLongObject *)v,
22231 bytes,
sizeof(val),
22232 is_little, !is_unsigned);
22242 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
22243 if (!tmp)
return (
int) -1;
22244 val = __Pyx_PyInt_As_int(tmp);
22249 PyErr_SetString(PyExc_OverflowError,
22250 "value too large to convert to int");
22252 raise_neg_overflow:
22253 PyErr_SetString(PyExc_OverflowError,
22254 "can't convert negative value to int");
22259 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value) {
22260 const long neg_one = (long) ((
long) 0 - (long) 1), const_zero = (long) 0;
22261 const int is_unsigned = neg_one > const_zero;
22263 if (
sizeof(
long) <
sizeof(long)) {
22264 return PyInt_FromLong((
long) value);
22265 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
22266 return PyLong_FromUnsignedLong((
unsigned long) value);
22267 #ifdef HAVE_LONG_LONG 22268 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
22269 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
22273 if (
sizeof(
long) <=
sizeof(
long)) {
22274 return PyInt_FromLong((
long) value);
22275 #ifdef HAVE_LONG_LONG 22276 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
22277 return PyLong_FromLongLong((PY_LONG_LONG) value);
22282 int one = 1;
int little = (int)*(
unsigned char *)&one;
22283 unsigned char *bytes = (
unsigned char *)&value;
22284 return _PyLong_FromByteArray(bytes,
sizeof(
long),
22285 little, !is_unsigned);
22290 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *x) {
22291 const long neg_one = (long) ((
long) 0 - (long) 1), const_zero = (long) 0;
22292 const int is_unsigned = neg_one > const_zero;
22293 #if PY_MAJOR_VERSION < 3 22294 if (likely(PyInt_Check(x))) {
22295 if (
sizeof(
long) <
sizeof(long)) {
22296 __PYX_VERIFY_RETURN_INT(
long,
long, PyInt_AS_LONG(x))
22298 long val = PyInt_AS_LONG(x);
22299 if (is_unsigned && unlikely(val < 0)) {
22300 goto raise_neg_overflow;
22306 if (likely(PyLong_Check(x))) {
22308 #if CYTHON_USE_PYLONG_INTERNALS 22309 const digit* digits = ((PyLongObject*)x)->ob_digit;
22310 switch (Py_SIZE(x)) {
22311 case 0:
return (
long) 0;
22312 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, digits[0])
22314 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
22315 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22316 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22317 }
else if (8 *
sizeof(
long) >= 2 * PyLong_SHIFT) {
22318 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
22323 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
22324 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22325 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22326 }
else if (8 *
sizeof(
long) >= 3 * PyLong_SHIFT) {
22327 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
22332 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
22333 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22334 __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])))
22335 }
else if (8 *
sizeof(
long) >= 4 * PyLong_SHIFT) {
22336 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
22342 #if CYTHON_COMPILING_IN_CPYTHON 22343 if (unlikely(Py_SIZE(x) < 0)) {
22344 goto raise_neg_overflow;
22348 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
22349 if (unlikely(result < 0))
22351 if (unlikely(result == 1))
22352 goto raise_neg_overflow;
22355 if (
sizeof(
long) <=
sizeof(
unsigned long)) {
22356 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
22357 #ifdef HAVE_LONG_LONG 22358 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
22359 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
22363 #if CYTHON_USE_PYLONG_INTERNALS 22364 const digit* digits = ((PyLongObject*)x)->ob_digit;
22365 switch (Py_SIZE(x)) {
22366 case 0:
return (
long) 0;
22367 case -1: __PYX_VERIFY_RETURN_INT(
long, sdigit, (sdigit) (-(sdigit)digits[0]))
22368 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, +digits[0])
22370 if (8 *
sizeof(
long) - 1 > 1 * PyLong_SHIFT) {
22371 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22372 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22373 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
22374 return (
long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
22379 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
22380 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22381 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22382 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
22383 return (
long) ((((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
22388 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
22389 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22390 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22391 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
22392 return (
long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
22397 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
22398 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22399 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22400 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
22401 return (
long) ((((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
22406 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
22407 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22408 __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])))
22409 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
22410 return (
long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
22415 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
22416 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22417 __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])))
22418 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
22419 return (
long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
22425 if (
sizeof(
long) <=
sizeof(long)) {
22426 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
22427 #ifdef HAVE_LONG_LONG 22428 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
22429 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
22434 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) 22435 PyErr_SetString(PyExc_RuntimeError,
22436 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
22439 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
22440 #if PY_MAJOR_VERSION < 3 22441 if (likely(v) && !PyLong_Check(v)) {
22443 v = PyNumber_Long(tmp);
22448 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
22449 unsigned char *bytes = (
unsigned char *)&val;
22450 int ret = _PyLong_AsByteArray((PyLongObject *)v,
22451 bytes,
sizeof(val),
22452 is_little, !is_unsigned);
22462 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
22463 if (!tmp)
return (
long) -1;
22464 val = __Pyx_PyInt_As_long(tmp);
22469 PyErr_SetString(PyExc_OverflowError,
22470 "value too large to convert to long");
22472 raise_neg_overflow:
22473 PyErr_SetString(PyExc_OverflowError,
22474 "can't convert negative value to long");
22479 #if CYTHON_COMPILING_IN_CPYTHON 22480 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
22486 return b == &PyBaseObject_Type;
22488 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
22490 if (a == b)
return 1;
22494 n = PyTuple_GET_SIZE(mro);
22495 for (
i = 0;
i < n;
i++) {
22496 if (PyTuple_GET_ITEM(mro,
i) == (PyObject *)b)
22501 return __Pyx_InBases(a, b);
22503 #if PY_MAJOR_VERSION == 2 22504 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
22505 PyObject *exception, *value, *tb;
22507 __Pyx_PyThreadState_declare
22508 __Pyx_PyThreadState_assign
22509 __Pyx_ErrFetch(&exception, &value, &tb);
22510 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
22511 if (unlikely(res == -1)) {
22512 PyErr_WriteUnraisable(err);
22516 res = PyObject_IsSubclass(err, exc_type2);
22517 if (unlikely(res == -1)) {
22518 PyErr_WriteUnraisable(err);
22522 __Pyx_ErrRestore(exception, value, tb);
22526 static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
22527 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
22529 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
22534 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
22536 assert(PyExceptionClass_Check(exc_type));
22537 n = PyTuple_GET_SIZE(tuple);
22538 #if PY_MAJOR_VERSION >= 3 22539 for (
i=0;
i<n;
i++) {
22540 if (exc_type == PyTuple_GET_ITEM(tuple,
i))
return 1;
22543 for (
i=0;
i<n;
i++) {
22544 PyObject *t = PyTuple_GET_ITEM(tuple,
i);
22545 #if PY_MAJOR_VERSION < 3 22546 if (likely(exc_type == t))
return 1;
22548 if (likely(PyExceptionClass_Check(t))) {
22549 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
22555 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
22556 if (likely(err == exc_type))
return 1;
22557 if (likely(PyExceptionClass_Check(err))) {
22558 if (likely(PyExceptionClass_Check(exc_type))) {
22559 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
22560 }
else if (likely(PyTuple_Check(exc_type))) {
22561 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
22565 return PyErr_GivenExceptionMatches(err, exc_type);
22567 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
22568 assert(PyExceptionClass_Check(exc_type1));
22569 assert(PyExceptionClass_Check(exc_type2));
22570 if (likely(err == exc_type1 || err == exc_type2))
return 1;
22571 if (likely(PyExceptionClass_Check(err))) {
22572 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
22574 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
22579 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
22580 PyObject* fake_module;
22581 PyTypeObject* cached_type = NULL;
22582 fake_module = PyImport_AddModule((
char*)
"_cython_" CYTHON_ABI);
22583 if (!fake_module)
return NULL;
22584 Py_INCREF(fake_module);
22585 cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
22587 if (!PyType_Check((PyObject*)cached_type)) {
22588 PyErr_Format(PyExc_TypeError,
22589 "Shared Cython type %.200s is not a type object",
22593 if (cached_type->tp_basicsize != type->tp_basicsize) {
22594 PyErr_Format(PyExc_TypeError,
22595 "Shared Cython type %.200s has the wrong size, try recompiling",
22600 if (!PyErr_ExceptionMatches(PyExc_AttributeError))
goto bad;
22602 if (PyType_Ready(type) < 0)
goto bad;
22603 if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
22606 cached_type = type;
22609 Py_DECREF(fake_module);
22610 return cached_type;
22612 Py_XDECREF(cached_type);
22613 cached_type = NULL;
22618 #if CYTHON_FAST_THREAD_STATE 22619 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
22620 PyObject *tmp_type, *tmp_value, *tmp_tb;
22621 #if CYTHON_USE_EXC_INFO_STACK 22622 _PyErr_StackItem *exc_info = tstate->exc_info;
22623 tmp_type = exc_info->exc_type;
22624 tmp_value = exc_info->exc_value;
22625 tmp_tb = exc_info->exc_traceback;
22626 exc_info->exc_type = *type;
22627 exc_info->exc_value = *value;
22628 exc_info->exc_traceback = *tb;
22630 tmp_type = tstate->exc_type;
22631 tmp_value = tstate->exc_value;
22632 tmp_tb = tstate->exc_traceback;
22633 tstate->exc_type = *type;
22634 tstate->exc_value = *value;
22635 tstate->exc_traceback = *tb;
22638 *value = tmp_value;
22642 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
22643 PyObject *tmp_type, *tmp_value, *tmp_tb;
22644 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
22645 PyErr_SetExcInfo(*type, *value, *tb);
22647 *value = tmp_value;
22653 static int __Pyx_PyObject_GetMethod(PyObject *
obj, PyObject *name, PyObject **method) {
22655 #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP 22656 PyTypeObject *tp = Py_TYPE(
obj);
22658 descrgetfunc f = NULL;
22659 PyObject **dictptr, *dict;
22660 int meth_found = 0;
22661 assert (*method == NULL);
22662 if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
22663 attr = __Pyx_PyObject_GetAttrStr(
obj, name);
22666 if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
22669 descr = _PyType_Lookup(tp, name);
22670 if (likely(descr != NULL)) {
22672 #if PY_MAJOR_VERSION >= 3 22673 #ifdef __Pyx_CyFunction_USED 22674 if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
22676 if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type)))
22679 #ifdef __Pyx_CyFunction_USED 22680 if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
22682 if (likely(PyFunction_Check(descr)))
22688 f = Py_TYPE(descr)->tp_descr_get;
22689 if (f != NULL && PyDescr_IsData(descr)) {
22690 attr = f(descr,
obj, (PyObject *)Py_TYPE(
obj));
22696 dictptr = _PyObject_GetDictPtr(
obj);
22697 if (dictptr != NULL && (dict = *dictptr) != NULL) {
22699 attr = __Pyx_PyDict_GetItemStr(dict, name);
22700 if (attr != NULL) {
22713 attr = f(descr,
obj, (PyObject *)Py_TYPE(
obj));
22717 if (descr != NULL) {
22721 PyErr_Format(PyExc_AttributeError,
22722 #
if PY_MAJOR_VERSION >= 3
22723 "'%.50s' object has no attribute '%U'",
22724 tp->tp_name, name);
22726 "'%.50s' object has no attribute '%.400s'",
22727 tp->tp_name, PyString_AS_STRING(name));
22731 attr = __Pyx_PyObject_GetAttrStr(
obj, name);
22735 #if CYTHON_UNPACK_METHODS 22736 if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) ==
obj)) {
22737 PyObject *
function = PyMethod_GET_FUNCTION(attr);
22738 Py_INCREF(
function);
22740 *method =
function;
22749 static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
22750 PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
22754 static PyObject* __Pyx_PyObject_CallMethod1(PyObject*
obj, PyObject* method_name, PyObject* arg) {
22755 PyObject *method = NULL, *result;
22756 int is_method = __Pyx_PyObject_GetMethod(
obj, method_name, &method);
22757 if (likely(is_method)) {
22758 result = __Pyx_PyObject_Call2Args(method,
obj, arg);
22762 if (unlikely(!method))
return NULL;
22763 return __Pyx__PyObject_CallMethod1(method, arg);
22767 #include <structmember.h> 22768 #include <frameobject.h> 22769 #define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom) 22770 static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) {
22771 PyObject *et, *ev, *tb;
22772 PyObject *value = NULL;
22773 __Pyx_ErrFetch(&et, &ev, &tb);
22777 Py_INCREF(Py_None);
22781 if (likely(et == PyExc_StopIteration)) {
22783 Py_INCREF(Py_None);
22786 #if PY_VERSION_HEX >= 0x030300A0 22787 else if (Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) {
22788 value = ((PyStopIterationObject *)ev)->value;
22793 else if (unlikely(PyTuple_Check(ev))) {
22794 if (PyTuple_GET_SIZE(ev) >= 1) {
22795 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 22796 value = PyTuple_GET_ITEM(ev, 0);
22799 value = PySequence_ITEM(ev, 0);
22802 Py_INCREF(Py_None);
22807 else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
22810 if (likely(value)) {
22816 }
else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
22817 __Pyx_ErrRestore(et, ev, tb);
22820 PyErr_NormalizeException(&et, &ev, &tb);
22821 if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
22822 __Pyx_ErrRestore(et, ev, tb);
22827 #if PY_VERSION_HEX >= 0x030300A0 22828 value = ((PyStopIterationObject *)ev)->value;
22833 PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args);
22835 if (likely(args)) {
22836 value = PySequence_GetItem(args, 0);
22839 if (unlikely(!value)) {
22840 __Pyx_ErrRestore(NULL, NULL, NULL);
22841 Py_INCREF(Py_None);
22849 static CYTHON_INLINE
22850 void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) {
22851 PyObject *t, *v, *tb;
22852 t = exc_state->exc_type;
22853 v = exc_state->exc_value;
22854 tb = exc_state->exc_traceback;
22855 exc_state->exc_type = NULL;
22856 exc_state->exc_value = NULL;
22857 exc_state->exc_traceback = NULL;
22862 #define __Pyx_Coroutine_AlreadyRunningError(gen) (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL) 22863 static void __Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject *gen) {
22866 #ifdef __Pyx_Coroutine_USED 22867 }
else if (__Pyx_Coroutine_Check((PyObject*)gen)) {
22868 msg =
"coroutine already executing";
22870 #ifdef __Pyx_AsyncGen_USED 22871 }
else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
22872 msg =
"async generator already executing";
22875 msg =
"generator already executing";
22877 PyErr_SetString(PyExc_ValueError, msg);
22879 #define __Pyx_Coroutine_NotStartedError(gen) (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL) 22880 static void __Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject *gen) {
22883 #ifdef __Pyx_Coroutine_USED 22884 }
else if (__Pyx_Coroutine_Check(gen)) {
22885 msg =
"can't send non-None value to a just-started coroutine";
22887 #ifdef __Pyx_AsyncGen_USED 22888 }
else if (__Pyx_AsyncGen_CheckExact(gen)) {
22889 msg =
"can't send non-None value to a just-started async generator";
22892 msg =
"can't send non-None value to a just-started generator";
22894 PyErr_SetString(PyExc_TypeError, msg);
22896 #define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing) (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL) 22897 static void __Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject *gen, PyObject *value, CYTHON_UNUSED
int closing) {
22898 #ifdef __Pyx_Coroutine_USED 22899 if (!closing && __Pyx_Coroutine_Check(gen)) {
22900 PyErr_SetString(PyExc_RuntimeError,
"cannot reuse already awaited coroutine");
22904 #ifdef __Pyx_AsyncGen_USED 22905 if (__Pyx_AsyncGen_CheckExact(gen))
22906 PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration);
22909 PyErr_SetNone(PyExc_StopIteration);
22913 PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *
self, PyObject *value,
int closing) {
22914 __Pyx_PyThreadState_declare
22915 PyThreadState *tstate;
22916 __Pyx_ExcInfoStruct *exc_state;
22918 assert(!self->is_running);
22919 if (unlikely(self->resume_label == 0)) {
22920 if (unlikely(value && value != Py_None)) {
22921 return __Pyx_Coroutine_NotStartedError((PyObject*)
self);
22924 if (unlikely(self->resume_label == -1)) {
22925 return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)
self, value, closing);
22927 #if CYTHON_FAST_THREAD_STATE 22928 __Pyx_PyThreadState_assign
22929 tstate = __pyx_tstate;
22931 tstate = __Pyx_PyThreadState_Current;
22933 exc_state = &
self->gi_exc_state;
22934 if (exc_state->exc_type) {
22935 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON 22937 if (exc_state->exc_traceback) {
22938 PyTracebackObject *tb = (PyTracebackObject *) exc_state->exc_traceback;
22939 PyFrameObject *f = tb->tb_frame;
22940 Py_XINCREF(tstate->frame);
22941 assert(f->f_back == NULL);
22942 f->f_back = tstate->frame;
22946 #if CYTHON_USE_EXC_INFO_STACK 22947 exc_state->previous_item = tstate->exc_info;
22948 tstate->exc_info = exc_state;
22950 if (exc_state->exc_type) {
22951 __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
22953 __Pyx_Coroutine_ExceptionClear(exc_state);
22954 __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
22957 self->is_running = 1;
22958 retval =
self->body((PyObject *)
self, tstate, value);
22959 self->is_running = 0;
22960 #if CYTHON_USE_EXC_INFO_STACK 22961 exc_state = &
self->gi_exc_state;
22962 tstate->exc_info = exc_state->previous_item;
22963 exc_state->previous_item = NULL;
22964 __Pyx_Coroutine_ResetFrameBackpointer(exc_state);
22968 static CYTHON_INLINE
void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) {
22969 PyObject *exc_tb = exc_state->exc_traceback;
22970 if (likely(exc_tb)) {
22971 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON 22973 PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
22974 PyFrameObject *f = tb->tb_frame;
22975 Py_CLEAR(f->f_back);
22979 static CYTHON_INLINE
22980 PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *retval) {
22981 if (unlikely(!retval)) {
22982 __Pyx_PyThreadState_declare
22983 __Pyx_PyThreadState_assign
22984 if (!__Pyx_PyErr_Occurred()) {
22985 PyObject *exc = PyExc_StopIteration;
22986 #ifdef __Pyx_AsyncGen_USED 22987 if (__Pyx_AsyncGen_CheckExact(gen))
22988 exc = __Pyx_PyExc_StopAsyncIteration;
22990 __Pyx_PyErr_SetNone(exc);
22995 static CYTHON_INLINE
22996 PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
22998 PyObject *val = NULL;
22999 __Pyx_Coroutine_Undelegate(gen);
23000 __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
23001 ret = __Pyx_Coroutine_SendEx(gen, val, 0);
23005 static PyObject *__Pyx_Coroutine_Send(PyObject *
self, PyObject *value) {
23007 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*)
self;
23008 PyObject *yf = gen->yieldfrom;
23009 if (unlikely(gen->is_running))
23010 return __Pyx_Coroutine_AlreadyRunningError(gen);
23013 gen->is_running = 1;
23014 #ifdef __Pyx_Generator_USED 23015 if (__Pyx_Generator_CheckExact(yf)) {
23016 ret = __Pyx_Coroutine_Send(yf, value);
23019 #ifdef __Pyx_Coroutine_USED 23020 if (__Pyx_Coroutine_Check(yf)) {
23021 ret = __Pyx_Coroutine_Send(yf, value);
23024 #ifdef __Pyx_AsyncGen_USED 23025 if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
23026 ret = __Pyx_async_gen_asend_send(yf, value);
23029 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) 23030 if (PyGen_CheckExact(yf)) {
23031 ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
23034 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) 23035 if (PyCoro_CheckExact(yf)) {
23036 ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
23040 if (value == Py_None)
23041 ret = Py_TYPE(yf)->tp_iternext(yf);
23043 ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
23045 gen->is_running = 0;
23049 retval = __Pyx_Coroutine_FinishDelegation(gen);
23051 retval = __Pyx_Coroutine_SendEx(gen, value, 0);
23053 return __Pyx_Coroutine_MethodReturn(
self, retval);
23055 static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
23056 PyObject *retval = NULL;
23058 #ifdef __Pyx_Generator_USED 23059 if (__Pyx_Generator_CheckExact(yf)) {
23060 retval = __Pyx_Coroutine_Close(yf);
23065 #ifdef __Pyx_Coroutine_USED 23066 if (__Pyx_Coroutine_Check(yf)) {
23067 retval = __Pyx_Coroutine_Close(yf);
23071 if (__Pyx_CoroutineAwait_CheckExact(yf)) {
23072 retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL);
23077 #ifdef __Pyx_AsyncGen_USED 23078 if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
23079 retval = __Pyx_async_gen_asend_close(yf, NULL);
23081 if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
23082 retval = __Pyx_async_gen_athrow_close(yf, NULL);
23087 gen->is_running = 1;
23088 meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close);
23089 if (unlikely(!meth)) {
23090 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
23091 PyErr_WriteUnraisable(yf);
23095 retval = PyObject_CallFunction(meth, NULL);
23100 gen->is_running = 0;
23102 Py_XDECREF(retval);
23105 static PyObject *__Pyx_Generator_Next(PyObject *
self) {
23106 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*)
self;
23107 PyObject *yf = gen->yieldfrom;
23108 if (unlikely(gen->is_running))
23109 return __Pyx_Coroutine_AlreadyRunningError(gen);
23112 gen->is_running = 1;
23113 #ifdef __Pyx_Generator_USED 23114 if (__Pyx_Generator_CheckExact(yf)) {
23115 ret = __Pyx_Generator_Next(yf);
23118 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) 23119 if (PyGen_CheckExact(yf)) {
23120 ret = _PyGen_Send((PyGenObject*)yf, NULL);
23123 #ifdef __Pyx_Coroutine_USED 23124 if (__Pyx_Coroutine_Check(yf)) {
23125 ret = __Pyx_Coroutine_Send(yf, Py_None);
23128 ret = Py_TYPE(yf)->tp_iternext(yf);
23129 gen->is_running = 0;
23133 return __Pyx_Coroutine_FinishDelegation(gen);
23135 return __Pyx_Coroutine_SendEx(gen, Py_None, 0);
23137 static PyObject *__Pyx_Coroutine_Close_Method(PyObject *
self, CYTHON_UNUSED PyObject *arg) {
23138 return __Pyx_Coroutine_Close(
self);
23140 static PyObject *__Pyx_Coroutine_Close(PyObject *
self) {
23141 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
23142 PyObject *retval, *raised_exception;
23143 PyObject *yf = gen->yieldfrom;
23145 if (unlikely(gen->is_running))
23146 return __Pyx_Coroutine_AlreadyRunningError(gen);
23149 err = __Pyx_Coroutine_CloseIter(gen, yf);
23150 __Pyx_Coroutine_Undelegate(gen);
23154 PyErr_SetNone(PyExc_GeneratorExit);
23155 retval = __Pyx_Coroutine_SendEx(gen, NULL, 1);
23156 if (unlikely(retval)) {
23160 #ifdef __Pyx_Coroutine_USED 23161 }
else if (__Pyx_Coroutine_Check(
self)) {
23162 msg =
"coroutine ignored GeneratorExit";
23164 #ifdef __Pyx_AsyncGen_USED 23165 }
else if (__Pyx_AsyncGen_CheckExact(
self)) {
23166 #if PY_VERSION_HEX < 0x03060000 23167 msg =
"async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)";
23169 msg =
"async generator ignored GeneratorExit";
23173 msg =
"generator ignored GeneratorExit";
23175 PyErr_SetString(PyExc_RuntimeError, msg);
23178 raised_exception = PyErr_Occurred();
23179 if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) {
23180 if (raised_exception) PyErr_Clear();
23181 Py_INCREF(Py_None);
23186 static PyObject *__Pyx__Coroutine_Throw(PyObject *
self, PyObject *typ, PyObject *val, PyObject *tb,
23187 PyObject *args,
int close_on_genexit) {
23188 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
23189 PyObject *yf = gen->yieldfrom;
23190 if (unlikely(gen->is_running))
23191 return __Pyx_Coroutine_AlreadyRunningError(gen);
23195 if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
23196 int err = __Pyx_Coroutine_CloseIter(gen, yf);
23198 __Pyx_Coroutine_Undelegate(gen);
23200 return __Pyx_Coroutine_MethodReturn(
self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
23203 gen->is_running = 1;
23205 #ifdef __Pyx_Generator_USED
23206 || __Pyx_Generator_CheckExact(yf)
23208 #ifdef __Pyx_Coroutine_USED
23209 || __Pyx_Coroutine_Check(yf)
23212 ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
23213 #ifdef __Pyx_Coroutine_USED 23214 }
else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
23215 ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
23218 PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw);
23219 if (unlikely(!meth)) {
23221 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
23222 gen->is_running = 0;
23226 __Pyx_Coroutine_Undelegate(gen);
23227 gen->is_running = 0;
23230 if (likely(args)) {
23231 ret = PyObject_CallObject(meth, args);
23233 ret = PyObject_CallFunctionObjArgs(meth, typ, val, tb, NULL);
23237 gen->is_running = 0;
23240 ret = __Pyx_Coroutine_FinishDelegation(gen);
23242 return __Pyx_Coroutine_MethodReturn(
self, ret);
23245 __Pyx_Raise(typ, val, tb, NULL);
23246 return __Pyx_Coroutine_MethodReturn(
self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
23248 static PyObject *__Pyx_Coroutine_Throw(PyObject *
self, PyObject *args) {
23250 PyObject *val = NULL;
23251 PyObject *tb = NULL;
23252 if (!PyArg_UnpackTuple(args, (
char *)
"throw", 1, 3, &typ, &val, &tb))
23254 return __Pyx__Coroutine_Throw(
self, typ, val, tb, args, 1);
23256 static CYTHON_INLINE
int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit,
void *arg) {
23257 Py_VISIT(exc_state->exc_type);
23258 Py_VISIT(exc_state->exc_value);
23259 Py_VISIT(exc_state->exc_traceback);
23262 static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit,
void *arg) {
23263 Py_VISIT(gen->closure);
23264 Py_VISIT(gen->classobj);
23265 Py_VISIT(gen->yieldfrom);
23266 return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg);
23268 static int __Pyx_Coroutine_clear(PyObject *
self) {
23269 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
23270 Py_CLEAR(gen->closure);
23271 Py_CLEAR(gen->classobj);
23272 Py_CLEAR(gen->yieldfrom);
23273 __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state);
23274 #ifdef __Pyx_AsyncGen_USED 23275 if (__Pyx_AsyncGen_CheckExact(
self)) {
23276 Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
23279 Py_CLEAR(gen->gi_code);
23280 Py_CLEAR(gen->gi_name);
23281 Py_CLEAR(gen->gi_qualname);
23282 Py_CLEAR(gen->gi_modulename);
23285 static void __Pyx_Coroutine_dealloc(PyObject *
self) {
23286 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
23287 PyObject_GC_UnTrack(gen);
23288 if (gen->gi_weakreflist != NULL)
23289 PyObject_ClearWeakRefs(
self);
23290 if (gen->resume_label >= 0) {
23291 PyObject_GC_Track(
self);
23292 #if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE 23293 if (PyObject_CallFinalizerFromDealloc(
self))
23295 Py_TYPE(gen)->tp_del(
self);
23296 if (self->ob_refcnt > 0)
23301 PyObject_GC_UnTrack(
self);
23303 #ifdef __Pyx_AsyncGen_USED 23304 if (__Pyx_AsyncGen_CheckExact(
self)) {
23308 Py_CLEAR(((__pyx_PyAsyncGenObject*)
self)->ag_finalizer);
23311 __Pyx_Coroutine_clear(
self);
23312 PyObject_GC_Del(gen);
23314 static void __Pyx_Coroutine_del(PyObject *
self) {
23315 PyObject *error_type, *error_value, *error_traceback;
23316 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
23317 __Pyx_PyThreadState_declare
23318 if (gen->resume_label < 0) {
23321 #if !CYTHON_USE_TP_FINALIZE 23322 assert(self->ob_refcnt == 0);
23323 self->ob_refcnt = 1;
23325 __Pyx_PyThreadState_assign
23326 __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
23327 #ifdef __Pyx_AsyncGen_USED 23328 if (__Pyx_AsyncGen_CheckExact(
self)) {
23329 __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)
self;
23330 PyObject *finalizer = agen->ag_finalizer;
23331 if (finalizer && !agen->ag_closed) {
23332 PyObject *res = __Pyx_PyObject_CallOneArg(finalizer,
self);
23333 if (unlikely(!res)) {
23334 PyErr_WriteUnraisable(
self);
23338 __Pyx_ErrRestore(error_type, error_value, error_traceback);
23343 if (unlikely(gen->resume_label == 0 && !error_value)) {
23344 #ifdef __Pyx_Coroutine_USED 23345 #ifdef __Pyx_Generator_USED 23346 if (!__Pyx_Generator_CheckExact(
self))
23349 PyObject_GC_UnTrack(
self);
23350 #if PY_MAJOR_VERSION >= 3 || defined(PyErr_WarnFormat) 23351 if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1,
"coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
23352 PyErr_WriteUnraisable(
self);
23356 #if CYTHON_COMPILING_IN_PYPY 23358 cmsg = (
char*)
"coroutine was never awaited";
23361 PyObject *qualname;
23362 qualname = gen->gi_qualname;
23363 cname = PyString_AS_STRING(qualname);
23364 msg = PyString_FromFormat(
"coroutine '%.50s' was never awaited", cname);
23365 if (unlikely(!msg)) {
23367 cmsg = (
char*)
"coroutine was never awaited";
23369 cmsg = PyString_AS_STRING(msg);
23372 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0))
23373 PyErr_WriteUnraisable(
self);
23376 PyObject_GC_Track(
self);
23380 PyObject *res = __Pyx_Coroutine_Close(
self);
23381 if (unlikely(!res)) {
23382 if (PyErr_Occurred())
23383 PyErr_WriteUnraisable(
self);
23388 __Pyx_ErrRestore(error_type, error_value, error_traceback);
23389 #if !CYTHON_USE_TP_FINALIZE 23390 assert(self->ob_refcnt > 0);
23391 if (--self->ob_refcnt == 0) {
23395 Py_ssize_t refcnt =
self->ob_refcnt;
23396 _Py_NewReference(
self);
23397 self->ob_refcnt = refcnt;
23399 #if CYTHON_COMPILING_IN_CPYTHON 23400 assert(PyType_IS_GC(self->ob_type) &&
23401 _Py_AS_GC(
self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
23404 #ifdef COUNT_ALLOCS 23405 --Py_TYPE(
self)->tp_frees;
23406 --Py_TYPE(
self)->tp_allocs;
23411 __Pyx_Coroutine_get_name(__pyx_CoroutineObject *
self, CYTHON_UNUSED
void *context)
23413 PyObject *name =
self->gi_name;
23414 if (unlikely(!name)) name = Py_None;
23419 __Pyx_Coroutine_set_name(__pyx_CoroutineObject *
self, PyObject *value, CYTHON_UNUSED
void *context)
23422 #if PY_MAJOR_VERSION >= 3 23423 if (unlikely(value == NULL || !PyUnicode_Check(value)))
23425 if (unlikely(value == NULL || !PyString_Check(value)))
23428 PyErr_SetString(PyExc_TypeError,
23429 "__name__ must be set to a string object");
23432 tmp =
self->gi_name;
23434 self->gi_name = value;
23439 __Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *
self, CYTHON_UNUSED
void *context)
23441 PyObject *name =
self->gi_qualname;
23442 if (unlikely(!name)) name = Py_None;
23447 __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *
self, PyObject *value, CYTHON_UNUSED
void *context)
23450 #if PY_MAJOR_VERSION >= 3 23451 if (unlikely(value == NULL || !PyUnicode_Check(value)))
23453 if (unlikely(value == NULL || !PyString_Check(value)))
23456 PyErr_SetString(PyExc_TypeError,
23457 "__qualname__ must be set to a string object");
23460 tmp =
self->gi_qualname;
23462 self->gi_qualname = value;
23466 static __pyx_CoroutineObject *__Pyx__Coroutine_New(
23467 PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
23468 PyObject *name, PyObject *qualname, PyObject *module_name) {
23469 __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
23470 if (unlikely(!gen))
23472 return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name);
23474 static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
23475 __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
23476 PyObject *name, PyObject *qualname, PyObject *module_name) {
23478 gen->closure = closure;
23479 Py_XINCREF(closure);
23480 gen->is_running = 0;
23481 gen->resume_label = 0;
23482 gen->classobj = NULL;
23483 gen->yieldfrom = NULL;
23484 gen->gi_exc_state.exc_type = NULL;
23485 gen->gi_exc_state.exc_value = NULL;
23486 gen->gi_exc_state.exc_traceback = NULL;
23487 #if CYTHON_USE_EXC_INFO_STACK 23488 gen->gi_exc_state.previous_item = NULL;
23490 gen->gi_weakreflist = NULL;
23491 Py_XINCREF(qualname);
23492 gen->gi_qualname = qualname;
23494 gen->gi_name = name;
23495 Py_XINCREF(module_name);
23496 gen->gi_modulename = module_name;
23498 gen->gi_code = code;
23499 PyObject_GC_Track(gen);
23504 static PyObject* __Pyx_Coroutine_patch_module(PyObject* module,
const char* py_code) {
23505 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) 23507 PyObject *globals, *result_obj;
23508 globals = PyDict_New();
if (unlikely(!globals))
goto ignore;
23509 result = PyDict_SetItemString(globals,
"_cython_coroutine_type",
23510 #ifdef __Pyx_Coroutine_USED
23511 (PyObject*)__pyx_CoroutineType);
23515 if (unlikely(result < 0))
goto ignore;
23516 result = PyDict_SetItemString(globals,
"_cython_generator_type",
23517 #ifdef __Pyx_Generator_USED
23518 (PyObject*)__pyx_GeneratorType);
23522 if (unlikely(result < 0))
goto ignore;
23523 if (unlikely(PyDict_SetItemString(globals,
"_module", module) < 0))
goto ignore;
23524 if (unlikely(PyDict_SetItemString(globals,
"__builtins__", __pyx_b) < 0))
goto ignore;
23525 result_obj = PyRun_String(py_code, Py_file_input, globals, globals);
23526 if (unlikely(!result_obj))
goto ignore;
23527 Py_DECREF(result_obj);
23528 Py_DECREF(globals);
23531 Py_XDECREF(globals);
23532 PyErr_WriteUnraisable(module);
23533 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
"Cython module failed to patch module with custom type", 1) < 0)) {
23544 #ifndef CYTHON_REGISTER_ABCS 23545 #define CYTHON_REGISTER_ABCS 1 23547 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) 23548 static PyObject* __Pyx_patch_abc_module(PyObject *module);
23549 static PyObject* __Pyx_patch_abc_module(PyObject *module) {
23550 module = __Pyx_Coroutine_patch_module(
23552 "if _cython_generator_type is not None:\n" 23553 " try: Generator = _module.Generator\n" 23554 " except AttributeError: pass\n" 23555 " else: Generator.register(_cython_generator_type)\n" 23556 "if _cython_coroutine_type is not None:\n" 23557 " try: Coroutine = _module.Coroutine\n" 23558 " except AttributeError: pass\n" 23559 " else: Coroutine.register(_cython_coroutine_type)\n" 23564 static int __Pyx_patch_abc(
void) {
23565 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) 23566 static int abc_patched = 0;
23567 if (CYTHON_REGISTER_ABCS && !abc_patched) {
23569 module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ?
"collections.abc" :
"collections");
23571 PyErr_WriteUnraisable(NULL);
23572 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
23573 ((PY_MAJOR_VERSION >= 3) ?
23574 "Cython module failed to register with collections.abc module" :
23575 "Cython module failed to register with collections module"), 1) < 0)) {
23579 module = __Pyx_patch_abc_module(module);
23581 if (unlikely(!module))
23585 module = PyImport_ImportModule(
"backports_abc");
23587 module = __Pyx_patch_abc_module(module);
23588 Py_XDECREF(module);
23595 if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL);
23601 static PyMethodDef __pyx_Generator_methods[] = {
23602 {
"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
23603 (
char*) PyDoc_STR(
"send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
23604 {
"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
23605 (
char*) PyDoc_STR(
"throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
23606 {
"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS,
23607 (
char*) PyDoc_STR(
"close() -> raise GeneratorExit inside generator.")},
23610 static PyMemberDef __pyx_Generator_memberlist[] = {
23611 {(
char *)
"gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL},
23612 {(
char*)
"gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
23613 (
char*) PyDoc_STR(
"object being iterated by 'yield from', or None")},
23614 {(
char*)
"gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
23617 static PyGetSetDef __pyx_Generator_getsets[] = {
23618 {(
char *)
"__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
23619 (
char*) PyDoc_STR(
"name of the generator"), 0},
23620 {(
char *)
"__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
23621 (
char*) PyDoc_STR(
"qualified name of the generator"), 0},
23624 static PyTypeObject __pyx_GeneratorType_type = {
23625 PyVarObject_HEAD_INIT(0, 0)
23627 sizeof(__pyx_CoroutineObject),
23629 (destructor) __Pyx_Coroutine_dealloc,
23644 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
23646 (traverseproc) __Pyx_Coroutine_traverse,
23649 offsetof(__pyx_CoroutineObject, gi_weakreflist),
23651 (iternextfunc) __Pyx_Generator_Next,
23652 __pyx_Generator_methods,
23653 __pyx_Generator_memberlist,
23654 __pyx_Generator_getsets,
23670 #
if CYTHON_USE_TP_FINALIZE
23673 __Pyx_Coroutine_del,
23676 #
if CYTHON_USE_TP_FINALIZE
23677 __Pyx_Coroutine_del,
23678 #elif PY_VERSION_HEX >= 0x030400a1
23682 static int __pyx_Generator_init(
void) {
23683 __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
23684 __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
23685 __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
23686 if (unlikely(!__pyx_GeneratorType)) {
23693 static int __Pyx_check_binary_version(
void) {
23694 char ctversion[4], rtversion[4];
23695 PyOS_snprintf(ctversion, 4,
"%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
23696 PyOS_snprintf(rtversion, 4,
"%s", Py_GetVersion());
23697 if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
23699 PyOS_snprintf(message,
sizeof(message),
23700 "compiletime version %s of module '%.100s' " 23701 "does not match runtime version %s",
23702 ctversion, __Pyx_MODULE_NAME, rtversion);
23703 return PyErr_WarnEx(NULL, message, 1);
23709 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
23711 #if PY_MAJOR_VERSION < 3 23712 if (t->is_unicode) {
23713 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
23714 }
else if (t->intern) {
23715 *t->p = PyString_InternFromString(t->s);
23717 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
23720 if (t->is_unicode | t->is_str) {
23722 *t->p = PyUnicode_InternFromString(t->s);
23723 }
else if (t->encoding) {
23724 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
23726 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
23729 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
23734 if (PyObject_Hash(*t->p) == -1)
23741 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
23742 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
23744 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
23746 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
23748 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 23749 #if !CYTHON_PEP393_ENABLED 23750 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
23752 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
23753 if (!defenc)
return NULL;
23754 defenc_c = PyBytes_AS_STRING(defenc);
23755 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 23757 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
23759 for (c = defenc_c; c < end; c++) {
23760 if ((
unsigned char) (*c) >= 128) {
23761 PyUnicode_AsASCIIString(o);
23767 *length = PyBytes_GET_SIZE(defenc);
23771 static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
23772 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
23773 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 23774 if (likely(PyUnicode_IS_ASCII(o))) {
23775 *length = PyUnicode_GET_LENGTH(o);
23776 return PyUnicode_AsUTF8(o);
23778 PyUnicode_AsASCIIString(o);
23782 return PyUnicode_AsUTF8AndSize(o, length);
23787 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
23788 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 23790 #
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
23791 __Pyx_sys_getdefaultencoding_not_ascii &&
23793 PyUnicode_Check(o)) {
23794 return __Pyx_PyUnicode_AsStringAndSize(o, length);
23797 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) 23798 if (PyByteArray_Check(o)) {
23799 *length = PyByteArray_GET_SIZE(o);
23800 return PyByteArray_AS_STRING(o);
23805 int r = PyBytes_AsStringAndSize(o, &result, length);
23806 if (unlikely(r < 0)) {
23813 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
23814 int is_true = x == Py_True;
23815 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
23816 else return PyObject_IsTrue(x);
23818 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
23820 if (unlikely(!x))
return -1;
23821 retval = __Pyx_PyObject_IsTrue(x);
23825 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result,
const char* type_name) {
23826 #if PY_MAJOR_VERSION >= 3 23827 if (PyLong_Check(result)) {
23828 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
23829 "__int__ returned non-int (type %.200s). " 23830 "The ability to return an instance of a strict subclass of int " 23831 "is deprecated, and may be removed in a future version of Python.",
23832 Py_TYPE(result)->tp_name)) {
23839 PyErr_Format(PyExc_TypeError,
23840 "__%.4s__ returned non-%.4s (type %.200s)",
23841 type_name, type_name, Py_TYPE(result)->tp_name);
23845 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
23846 #if CYTHON_USE_TYPE_SLOTS 23847 PyNumberMethods *m;
23849 const char *name = NULL;
23850 PyObject *res = NULL;
23851 #if PY_MAJOR_VERSION < 3 23852 if (likely(PyInt_Check(x) || PyLong_Check(x)))
23854 if (likely(PyLong_Check(x)))
23856 return __Pyx_NewRef(x);
23857 #if CYTHON_USE_TYPE_SLOTS 23858 m = Py_TYPE(x)->tp_as_number;
23859 #if PY_MAJOR_VERSION < 3 23860 if (m && m->nb_int) {
23862 res = m->nb_int(x);
23864 else if (m && m->nb_long) {
23866 res = m->nb_long(x);
23869 if (likely(m && m->nb_int)) {
23871 res = m->nb_int(x);
23875 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
23876 res = PyNumber_Int(x);
23880 #if PY_MAJOR_VERSION < 3 23881 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
23883 if (unlikely(!PyLong_CheckExact(res))) {
23885 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
23888 else if (!PyErr_Occurred()) {
23889 PyErr_SetString(PyExc_TypeError,
23890 "an integer is required");
23894 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
23897 #if PY_MAJOR_VERSION < 3 23898 if (likely(PyInt_CheckExact(b))) {
23899 if (
sizeof(Py_ssize_t) >=
sizeof(
long))
23900 return PyInt_AS_LONG(b);
23902 return PyInt_AsSsize_t(b);
23905 if (likely(PyLong_CheckExact(b))) {
23906 #if CYTHON_USE_PYLONG_INTERNALS 23907 const digit* digits = ((PyLongObject*)b)->ob_digit;
23908 const Py_ssize_t size = Py_SIZE(b);
23909 if (likely(__Pyx_sst_abs(size) <= 1)) {
23910 ival = likely(size) ? digits[0] : 0;
23911 if (size == -1) ival = -ival;
23916 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
23917 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
23921 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
23922 return -(Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
23926 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
23927 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
23931 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
23932 return -(Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
23936 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
23937 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]));
23941 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
23942 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]));
23948 return PyLong_AsSsize_t(b);
23950 x = PyNumber_Index(b);
23952 ival = PyInt_AsSsize_t(x);
23956 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
23957 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
23959 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
23960 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)].