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_28_3" 65 #define CYTHON_FUTURE_DIVISION 0 68 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) 70 #if !defined(WIN32) && !defined(MS_WINDOWS) 82 #define DL_IMPORT(t) t 85 #define DL_EXPORT(t) t 88 #ifndef HAVE_LONG_LONG 89 #if PY_VERSION_HEX >= 0x02070000 90 #define HAVE_LONG_LONG 94 #define PY_LONG_LONG LONG_LONG 97 #define Py_HUGE_VAL HUGE_VAL 100 #define CYTHON_COMPILING_IN_PYPY 1 101 #define CYTHON_COMPILING_IN_PYSTON 0 102 #define CYTHON_COMPILING_IN_CPYTHON 0 103 #undef CYTHON_USE_TYPE_SLOTS 104 #define CYTHON_USE_TYPE_SLOTS 0 105 #undef CYTHON_USE_PYTYPE_LOOKUP 106 #define CYTHON_USE_PYTYPE_LOOKUP 0 107 #if PY_VERSION_HEX < 0x03050000 108 #undef CYTHON_USE_ASYNC_SLOTS 109 #define CYTHON_USE_ASYNC_SLOTS 0 110 #elif !defined(CYTHON_USE_ASYNC_SLOTS) 111 #define CYTHON_USE_ASYNC_SLOTS 1 113 #undef CYTHON_USE_PYLIST_INTERNALS 114 #define CYTHON_USE_PYLIST_INTERNALS 0 115 #undef CYTHON_USE_UNICODE_INTERNALS 116 #define CYTHON_USE_UNICODE_INTERNALS 0 117 #undef CYTHON_USE_UNICODE_WRITER 118 #define CYTHON_USE_UNICODE_WRITER 0 119 #undef CYTHON_USE_PYLONG_INTERNALS 120 #define CYTHON_USE_PYLONG_INTERNALS 0 121 #undef CYTHON_AVOID_BORROWED_REFS 122 #define CYTHON_AVOID_BORROWED_REFS 1 123 #undef CYTHON_ASSUME_SAFE_MACROS 124 #define CYTHON_ASSUME_SAFE_MACROS 0 125 #undef CYTHON_UNPACK_METHODS 126 #define CYTHON_UNPACK_METHODS 0 127 #undef CYTHON_FAST_THREAD_STATE 128 #define CYTHON_FAST_THREAD_STATE 0 129 #undef CYTHON_FAST_PYCALL 130 #define CYTHON_FAST_PYCALL 0 131 #undef CYTHON_PEP489_MULTI_PHASE_INIT 132 #define CYTHON_PEP489_MULTI_PHASE_INIT 0 133 #undef CYTHON_USE_TP_FINALIZE 134 #define CYTHON_USE_TP_FINALIZE 0 135 #elif defined(PYSTON_VERSION) 136 #define CYTHON_COMPILING_IN_PYPY 0 137 #define CYTHON_COMPILING_IN_PYSTON 1 138 #define CYTHON_COMPILING_IN_CPYTHON 0 139 #ifndef CYTHON_USE_TYPE_SLOTS 140 #define CYTHON_USE_TYPE_SLOTS 1 142 #undef CYTHON_USE_PYTYPE_LOOKUP 143 #define CYTHON_USE_PYTYPE_LOOKUP 0 144 #undef CYTHON_USE_ASYNC_SLOTS 145 #define CYTHON_USE_ASYNC_SLOTS 0 146 #undef CYTHON_USE_PYLIST_INTERNALS 147 #define CYTHON_USE_PYLIST_INTERNALS 0 148 #ifndef CYTHON_USE_UNICODE_INTERNALS 149 #define CYTHON_USE_UNICODE_INTERNALS 1 151 #undef CYTHON_USE_UNICODE_WRITER 152 #define CYTHON_USE_UNICODE_WRITER 0 153 #undef CYTHON_USE_PYLONG_INTERNALS 154 #define CYTHON_USE_PYLONG_INTERNALS 0 155 #ifndef CYTHON_AVOID_BORROWED_REFS 156 #define CYTHON_AVOID_BORROWED_REFS 0 158 #ifndef CYTHON_ASSUME_SAFE_MACROS 159 #define CYTHON_ASSUME_SAFE_MACROS 1 161 #ifndef CYTHON_UNPACK_METHODS 162 #define CYTHON_UNPACK_METHODS 1 164 #undef CYTHON_FAST_THREAD_STATE 165 #define CYTHON_FAST_THREAD_STATE 0 166 #undef CYTHON_FAST_PYCALL 167 #define CYTHON_FAST_PYCALL 0 168 #undef CYTHON_PEP489_MULTI_PHASE_INIT 169 #define CYTHON_PEP489_MULTI_PHASE_INIT 0 170 #undef CYTHON_USE_TP_FINALIZE 171 #define CYTHON_USE_TP_FINALIZE 0 173 #define CYTHON_COMPILING_IN_PYPY 0 174 #define CYTHON_COMPILING_IN_PYSTON 0 175 #define CYTHON_COMPILING_IN_CPYTHON 1 176 #ifndef CYTHON_USE_TYPE_SLOTS 177 #define CYTHON_USE_TYPE_SLOTS 1 179 #if PY_VERSION_HEX < 0x02070000 180 #undef CYTHON_USE_PYTYPE_LOOKUP 181 #define CYTHON_USE_PYTYPE_LOOKUP 0 182 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) 183 #define CYTHON_USE_PYTYPE_LOOKUP 1 185 #if PY_MAJOR_VERSION < 3 186 #undef CYTHON_USE_ASYNC_SLOTS 187 #define CYTHON_USE_ASYNC_SLOTS 0 188 #elif !defined(CYTHON_USE_ASYNC_SLOTS) 189 #define CYTHON_USE_ASYNC_SLOTS 1 191 #if PY_VERSION_HEX < 0x02070000 192 #undef CYTHON_USE_PYLONG_INTERNALS 193 #define CYTHON_USE_PYLONG_INTERNALS 0 194 #elif !defined(CYTHON_USE_PYLONG_INTERNALS) 195 #define CYTHON_USE_PYLONG_INTERNALS 1 197 #ifndef CYTHON_USE_PYLIST_INTERNALS 198 #define CYTHON_USE_PYLIST_INTERNALS 1 200 #ifndef CYTHON_USE_UNICODE_INTERNALS 201 #define CYTHON_USE_UNICODE_INTERNALS 1 203 #if PY_VERSION_HEX < 0x030300F0 204 #undef CYTHON_USE_UNICODE_WRITER 205 #define CYTHON_USE_UNICODE_WRITER 0 206 #elif !defined(CYTHON_USE_UNICODE_WRITER) 207 #define CYTHON_USE_UNICODE_WRITER 1 209 #ifndef CYTHON_AVOID_BORROWED_REFS 210 #define CYTHON_AVOID_BORROWED_REFS 0 212 #ifndef CYTHON_ASSUME_SAFE_MACROS 213 #define CYTHON_ASSUME_SAFE_MACROS 1 215 #ifndef CYTHON_UNPACK_METHODS 216 #define CYTHON_UNPACK_METHODS 1 218 #ifndef CYTHON_FAST_THREAD_STATE 219 #define CYTHON_FAST_THREAD_STATE 1 221 #ifndef CYTHON_FAST_PYCALL 222 #define CYTHON_FAST_PYCALL 1 224 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT 225 #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000) 227 #ifndef CYTHON_USE_TP_FINALIZE 228 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) 231 #if !defined(CYTHON_FAST_PYCCALL) 232 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) 234 #if CYTHON_USE_PYLONG_INTERNALS 235 #include "longintrepr.h" 240 #ifndef __has_attribute 241 #define __has_attribute(x) 0 243 #ifndef __has_cpp_attribute 244 #define __has_cpp_attribute(x) 0 246 #ifndef CYTHON_RESTRICT 247 #if defined(__GNUC__) 248 #define CYTHON_RESTRICT __restrict__ 249 #elif defined(_MSC_VER) && _MSC_VER >= 1400 250 #define CYTHON_RESTRICT __restrict 251 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 252 #define CYTHON_RESTRICT restrict 254 #define CYTHON_RESTRICT 257 #ifndef CYTHON_UNUSED 258 # if defined(__GNUC__) 259 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) 260 # define CYTHON_UNUSED __attribute__ ((__unused__)) 262 # define CYTHON_UNUSED 264 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) 265 # define CYTHON_UNUSED __attribute__ ((__unused__)) 267 # define CYTHON_UNUSED 270 #ifndef CYTHON_MAYBE_UNUSED_VAR 271 # if defined(__cplusplus) 272 template<
class T>
void CYTHON_MAYBE_UNUSED_VAR(
const T& ) { }
274 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) 277 #ifndef CYTHON_NCP_UNUSED 278 # if CYTHON_COMPILING_IN_CPYTHON 279 # define CYTHON_NCP_UNUSED 281 # define CYTHON_NCP_UNUSED CYTHON_UNUSED 284 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) 286 #ifndef _MSC_STDINT_H_ 288 typedef unsigned char uint8_t;
289 typedef unsigned int uint32_t;
291 typedef unsigned __int8 uint8_t;
292 typedef unsigned __int32 uint32_t;
298 #ifndef CYTHON_FALLTHROUGH 299 #if defined(__cplusplus) && __cplusplus >= 201103L 300 #if __has_cpp_attribute(fallthrough) 301 #define CYTHON_FALLTHROUGH [[fallthrough]] 302 #elif __has_cpp_attribute(clang::fallthrough) 303 #define CYTHON_FALLTHROUGH [[clang::fallthrough]] 304 #elif __has_cpp_attribute(gnu::fallthrough) 305 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] 308 #ifndef CYTHON_FALLTHROUGH 309 #if __has_attribute(fallthrough) 310 #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) 312 #define CYTHON_FALLTHROUGH 315 #if defined(__clang__ ) && defined(__apple_build_version__) 316 #if __apple_build_version__ < 7000000 317 #undef CYTHON_FALLTHROUGH 318 #define CYTHON_FALLTHROUGH 324 #error "Cython files generated with the C++ option must be compiled with a C++ compiler." 326 #ifndef CYTHON_INLINE 327 #if defined(__clang__) 328 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) 330 #define CYTHON_INLINE inline 334 void __Pyx_call_destructor(T& x) {
338 class __Pyx_FakeReference {
340 __Pyx_FakeReference() : ptr(NULL) { }
341 __Pyx_FakeReference(
const T& ref) : ptr(const_cast<T*>(&ref)) { }
342 T *operator->() {
return ptr; }
344 operator T&() {
return *ptr; }
345 template<
typename U>
bool operator ==(U other) {
return *ptr == other; }
346 template<
typename U>
bool operator !=(U other) {
return *ptr != other; }
351 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) 352 #define Py_OptimizeFlag 0 354 #define __PYX_BUILD_PY_SSIZE_T "n" 355 #define CYTHON_FORMAT_SSIZE_T "z" 356 #if PY_MAJOR_VERSION < 3 357 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" 358 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ 359 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) 360 #define __Pyx_DefaultClassType PyClass_Type 362 #define __Pyx_BUILTIN_MODULE_NAME "builtins" 363 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ 364 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) 365 #define __Pyx_DefaultClassType PyType_Type 367 #ifndef Py_TPFLAGS_CHECKTYPES 368 #define Py_TPFLAGS_CHECKTYPES 0 370 #ifndef Py_TPFLAGS_HAVE_INDEX 371 #define Py_TPFLAGS_HAVE_INDEX 0 373 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER 374 #define Py_TPFLAGS_HAVE_NEWBUFFER 0 376 #ifndef Py_TPFLAGS_HAVE_FINALIZE 377 #define Py_TPFLAGS_HAVE_FINALIZE 0 379 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) 380 #ifndef METH_FASTCALL 381 #define METH_FASTCALL 0x80 383 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *
self, PyObject *
const *args, Py_ssize_t nargs);
384 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *
self, PyObject *
const *args,
385 Py_ssize_t nargs, PyObject *kwnames);
387 #define __Pyx_PyCFunctionFast _PyCFunctionFast 388 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords 390 #if CYTHON_FAST_PYCCALL 391 #define __Pyx_PyFastCFunction_Check(func)\ 392 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS))))) 394 #define __Pyx_PyFastCFunction_Check(func) 0 396 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) 397 #define PyObject_Malloc(s) PyMem_Malloc(s) 398 #define PyObject_Free(p) PyMem_Free(p) 399 #define PyObject_Realloc(p) PyMem_Realloc(p) 401 #if CYTHON_COMPILING_IN_PYSTON 402 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) 403 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) 405 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) 406 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) 408 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 409 #define __Pyx_PyThreadState_Current PyThreadState_GET() 410 #elif PY_VERSION_HEX >= 0x03060000 411 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() 412 #elif PY_VERSION_HEX >= 0x03000000 413 #define __Pyx_PyThreadState_Current PyThreadState_GET() 415 #define __Pyx_PyThreadState_Current _PyThreadState_Current 417 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) 418 #include "pythread.h" 419 #define Py_tss_NEEDS_INIT 0 420 typedef int Py_tss_t;
421 static CYTHON_INLINE
int PyThread_tss_create(Py_tss_t *key) {
422 *key = PyThread_create_key();
425 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(
void) {
426 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(
sizeof(Py_tss_t));
427 *key = Py_tss_NEEDS_INIT;
430 static CYTHON_INLINE
void PyThread_tss_free(Py_tss_t *key) {
433 static CYTHON_INLINE
int PyThread_tss_is_created(Py_tss_t *key) {
434 return *key != Py_tss_NEEDS_INIT;
436 static CYTHON_INLINE
void PyThread_tss_delete(Py_tss_t *key) {
437 PyThread_delete_key(*key);
438 *key = Py_tss_NEEDS_INIT;
440 static CYTHON_INLINE
int PyThread_tss_set(Py_tss_t *key,
void *value) {
441 return PyThread_set_key_value(*key, value);
443 static CYTHON_INLINE
void * PyThread_tss_get(Py_tss_t *key) {
444 return PyThread_get_key_value(*key);
446 #endif // TSS (Thread Specific Storage) API 447 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) 448 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) 450 #define __Pyx_PyDict_NewPresized(n) PyDict_New() 452 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION 453 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) 454 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) 456 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) 457 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) 459 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS 460 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) 462 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) 464 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) 465 #define CYTHON_PEP393_ENABLED 1 466 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 467 0 : _PyUnicode_Ready((PyObject *)(op))) 468 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) 469 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) 470 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) 471 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) 472 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) 473 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) 474 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) 475 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) 477 #define CYTHON_PEP393_ENABLED 0 478 #define PyUnicode_1BYTE_KIND 1 479 #define PyUnicode_2BYTE_KIND 2 480 #define PyUnicode_4BYTE_KIND 4 481 #define __Pyx_PyUnicode_READY(op) (0) 482 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) 483 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) 484 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) 485 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) 486 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) 487 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) 488 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) 489 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) 491 #if CYTHON_COMPILING_IN_PYPY 492 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) 493 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) 495 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) 496 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ 497 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) 499 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) 500 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) 502 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) 503 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) 505 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) 506 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) 508 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) 509 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) 510 #if PY_MAJOR_VERSION >= 3 511 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) 513 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) 515 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) 516 #define PyObject_ASCII(o) PyObject_Repr(o) 518 #if PY_MAJOR_VERSION >= 3 519 #define PyBaseString_Type PyUnicode_Type 520 #define PyStringObject PyUnicodeObject 521 #define PyString_Type PyUnicode_Type 522 #define PyString_Check PyUnicode_Check 523 #define PyString_CheckExact PyUnicode_CheckExact 524 #define PyObject_Unicode PyObject_Str 526 #if PY_MAJOR_VERSION >= 3 527 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) 528 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) 530 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) 531 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) 533 #ifndef PySet_CheckExact 534 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) 536 #if CYTHON_ASSUME_SAFE_MACROS 537 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) 539 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) 541 #if PY_MAJOR_VERSION >= 3 542 #define PyIntObject PyLongObject 543 #define PyInt_Type PyLong_Type 544 #define PyInt_Check(op) PyLong_Check(op) 545 #define PyInt_CheckExact(op) PyLong_CheckExact(op) 546 #define PyInt_FromString PyLong_FromString 547 #define PyInt_FromUnicode PyLong_FromUnicode 548 #define PyInt_FromLong PyLong_FromLong 549 #define PyInt_FromSize_t PyLong_FromSize_t 550 #define PyInt_FromSsize_t PyLong_FromSsize_t 551 #define PyInt_AsLong PyLong_AsLong 552 #define PyInt_AS_LONG PyLong_AS_LONG 553 #define PyInt_AsSsize_t PyLong_AsSsize_t 554 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask 555 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask 556 #define PyNumber_Int PyNumber_Long 558 #if PY_MAJOR_VERSION >= 3 559 #define PyBoolObject PyLongObject 561 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY 562 #ifndef PyUnicode_InternFromString 563 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) 566 #if PY_VERSION_HEX < 0x030200A4 567 typedef long Py_hash_t;
568 #define __Pyx_PyInt_FromHash_t PyInt_FromLong 569 #define __Pyx_PyInt_AsHash_t PyInt_AsLong 571 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t 572 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t 574 #if PY_MAJOR_VERSION >= 3 575 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) 577 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) 579 #if CYTHON_USE_ASYNC_SLOTS 580 #if PY_VERSION_HEX >= 0x030500B1 581 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods 582 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) 584 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) 587 #define __Pyx_PyType_AsAsync(obj) NULL 589 #ifndef __Pyx_PyAsyncMethodsStruct 594 } __Pyx_PyAsyncMethodsStruct;
597 #if defined(WIN32) || defined(MS_WINDOWS) 598 #define _USE_MATH_DEFINES 602 #define __PYX_NAN() ((float) NAN) 604 static CYTHON_INLINE
float __PYX_NAN() {
606 memset(&value, 0xFF,
sizeof(value));
610 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) 611 #define __Pyx_truncl trunc 613 #define __Pyx_truncl truncl 617 #define __PYX_ERR(f_index, lineno, Ln_error) \ 619 __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ 622 #ifndef __PYX_EXTERN_C 624 #define __PYX_EXTERN_C extern "C" 626 #define __PYX_EXTERN_C extern 630 #define __PYX_HAVE__PyClical 631 #define __PYX_HAVE_API__PyClical 643 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) 644 #define CYTHON_WITHOUT_ASSERTIONS 647 typedef struct {PyObject **p;
const char *s;
const Py_ssize_t n;
const char* encoding;
648 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
650 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 651 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 652 #define __PYX_DEFAULT_STRING_ENCODING "" 653 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString 654 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize 655 #define __Pyx_uchar_cast(c) ((unsigned char)c) 656 #define __Pyx_long_cast(x) ((long)x) 657 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ 658 (sizeof(type) < sizeof(Py_ssize_t)) ||\ 659 (sizeof(type) > sizeof(Py_ssize_t) &&\ 660 likely(v < (type)PY_SSIZE_T_MAX ||\ 661 v == (type)PY_SSIZE_T_MAX) &&\ 662 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ 663 v == (type)PY_SSIZE_T_MIN))) ||\ 664 (sizeof(type) == sizeof(Py_ssize_t) &&\ 665 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ 666 v == (type)PY_SSIZE_T_MAX))) ) 667 #if defined (__cplusplus) && __cplusplus >= 201103L 669 #define __Pyx_sst_abs(value) std::abs(value) 670 #elif SIZEOF_INT >= SIZEOF_SIZE_T 671 #define __Pyx_sst_abs(value) abs(value) 672 #elif SIZEOF_LONG >= SIZEOF_SIZE_T 673 #define __Pyx_sst_abs(value) labs(value) 674 #elif defined (_MSC_VER) 675 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) 676 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 677 #define __Pyx_sst_abs(value) llabs(value) 678 #elif defined (__GNUC__) 679 #define __Pyx_sst_abs(value) __builtin_llabs(value) 681 #define __Pyx_sst_abs(value) ((value<0) ? -value : value) 683 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
684 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
685 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) 686 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) 687 #define __Pyx_PyBytes_FromString PyBytes_FromString 688 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize 689 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
690 #if PY_MAJOR_VERSION < 3 691 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString 692 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize 694 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString 695 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize 697 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) 698 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) 699 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) 700 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) 701 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) 702 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) 703 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) 704 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) 705 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) 706 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) 707 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) 708 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) 709 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) 710 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) 711 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) 712 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) 713 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *u) {
714 const Py_UNICODE *u_end = u;
716 return (
size_t)(u_end - u - 1);
718 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) 719 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode 720 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode 721 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) 722 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) 723 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
724 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
725 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
726 #define __Pyx_PySequence_Tuple(obj)\ 727 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) 728 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
729 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
730 #if CYTHON_ASSUME_SAFE_MACROS 731 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) 733 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) 735 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) 736 #if PY_MAJOR_VERSION >= 3 737 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) 739 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) 741 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) 742 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 743 static int __Pyx_sys_getdefaultencoding_not_ascii;
744 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
746 PyObject* default_encoding = NULL;
747 PyObject* ascii_chars_u = NULL;
748 PyObject* ascii_chars_b = NULL;
749 const char* default_encoding_c;
750 sys = PyImport_ImportModule(
"sys");
752 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
754 if (!default_encoding)
goto bad;
755 default_encoding_c = PyBytes_AsString(default_encoding);
756 if (!default_encoding_c)
goto bad;
757 if (strcmp(default_encoding_c,
"ascii") == 0) {
758 __Pyx_sys_getdefaultencoding_not_ascii = 0;
760 char ascii_chars[128];
762 for (c = 0; c < 128; c++) {
765 __Pyx_sys_getdefaultencoding_not_ascii = 1;
766 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
767 if (!ascii_chars_u)
goto bad;
768 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
769 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
772 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
776 Py_DECREF(ascii_chars_u);
777 Py_DECREF(ascii_chars_b);
779 Py_DECREF(default_encoding);
782 Py_XDECREF(default_encoding);
783 Py_XDECREF(ascii_chars_u);
784 Py_XDECREF(ascii_chars_b);
788 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 789 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) 791 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) 792 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 793 static char* __PYX_DEFAULT_STRING_ENCODING;
794 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
796 PyObject* default_encoding = NULL;
797 char* default_encoding_c;
798 sys = PyImport_ImportModule(
"sys");
800 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
802 if (!default_encoding)
goto bad;
803 default_encoding_c = PyBytes_AsString(default_encoding);
804 if (!default_encoding_c)
goto bad;
805 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c));
806 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
807 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
808 Py_DECREF(default_encoding);
811 Py_XDECREF(default_encoding);
819 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) 820 #define likely(x) __builtin_expect(!!(x), 1) 821 #define unlikely(x) __builtin_expect(!!(x), 0) 823 #define likely(x) (x) 824 #define unlikely(x) (x) 826 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
828 static PyObject *__pyx_m = NULL;
829 static PyObject *__pyx_d;
830 static PyObject *__pyx_b;
831 static PyObject *__pyx_cython_runtime = NULL;
832 static PyObject *__pyx_empty_tuple;
833 static PyObject *__pyx_empty_bytes;
834 static PyObject *__pyx_empty_unicode;
835 static int __pyx_lineno;
836 static int __pyx_clineno = 0;
837 static const char * __pyx_cfilenm= __FILE__;
838 static const char *__pyx_filename;
841 static const char *__pyx_f[] = {
847 struct __pyx_obj_8PyClical_index_set;
848 struct __pyx_obj_8PyClical_clifford;
849 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__;
850 struct __pyx_opt_args_8PyClical_sqrt;
851 struct __pyx_opt_args_8PyClical_log;
852 struct __pyx_opt_args_8PyClical_cos;
853 struct __pyx_opt_args_8PyClical_acos;
854 struct __pyx_opt_args_8PyClical_acosh;
855 struct __pyx_opt_args_8PyClical_sin;
856 struct __pyx_opt_args_8PyClical_asin;
857 struct __pyx_opt_args_8PyClical_asinh;
858 struct __pyx_opt_args_8PyClical_tan;
859 struct __pyx_opt_args_8PyClical_atan;
860 struct __pyx_opt_args_8PyClical_atanh;
861 struct __pyx_opt_args_8PyClical_random_clifford;
870 struct __pyx_opt_args_8PyClical_sqrt {
882 struct __pyx_opt_args_8PyClical_log {
894 struct __pyx_opt_args_8PyClical_cos {
906 struct __pyx_opt_args_8PyClical_acos {
918 struct __pyx_opt_args_8PyClical_acosh {
930 struct __pyx_opt_args_8PyClical_sin {
942 struct __pyx_opt_args_8PyClical_asin {
954 struct __pyx_opt_args_8PyClical_asinh {
966 struct __pyx_opt_args_8PyClical_tan {
978 struct __pyx_opt_args_8PyClical_atan {
990 struct __pyx_opt_args_8PyClical_atanh {
1002 struct __pyx_opt_args_8PyClical_random_clifford {
1014 struct __pyx_obj_8PyClical_index_set {
1016 struct __pyx_vtabstruct_8PyClical_index_set *__pyx_vtab;
1028 struct __pyx_obj_8PyClical_clifford {
1030 struct __pyx_vtabstruct_8PyClical_clifford *__pyx_vtab;
1042 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ {
1044 PyObject *__pyx_v_idx;
1045 struct __pyx_obj_8PyClical_index_set *__pyx_v_self;
1046 PyObject *__pyx_t_0;
1047 Py_ssize_t __pyx_t_1;
1048 PyObject *(*__pyx_t_2)(PyObject *);
1061 struct __pyx_vtabstruct_8PyClical_index_set {
1062 PyObject *(*wrap)(
struct __pyx_obj_8PyClical_index_set *,
IndexSet);
1063 IndexSet (*unwrap)(
struct __pyx_obj_8PyClical_index_set *);
1064 PyObject *(*copy)(
struct __pyx_obj_8PyClical_index_set *,
int __pyx_skip_dispatch);
1066 static struct __pyx_vtabstruct_8PyClical_index_set *__pyx_vtabptr_8PyClical_index_set;
1067 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_9index_set_wrap(
struct __pyx_obj_8PyClical_index_set *,
IndexSet);
1068 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_9index_set_unwrap(
struct __pyx_obj_8PyClical_index_set *);
1079 struct __pyx_vtabstruct_8PyClical_clifford {
1080 PyObject *(*wrap)(
struct __pyx_obj_8PyClical_clifford *,
Clifford);
1081 Clifford (*unwrap)(
struct __pyx_obj_8PyClical_clifford *);
1082 PyObject *(*copy)(
struct __pyx_obj_8PyClical_clifford *,
int __pyx_skip_dispatch);
1084 static struct __pyx_vtabstruct_8PyClical_clifford *__pyx_vtabptr_8PyClical_clifford;
1085 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_8clifford_wrap(
struct __pyx_obj_8PyClical_clifford *,
Clifford);
1086 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_8clifford_unwrap(
struct __pyx_obj_8PyClical_clifford *);
1090 #ifndef CYTHON_REFNANNY 1091 #define CYTHON_REFNANNY 0 1095 void (*INCREF)(
void*, PyObject*, int);
1096 void (*DECREF)(
void*, PyObject*, int);
1097 void (*GOTREF)(
void*, PyObject*, int);
1098 void (*GIVEREF)(
void*, PyObject*, int);
1099 void* (*SetupContext)(
const char*, int,
const char*);
1100 void (*FinishContext)(
void**);
1101 } __Pyx_RefNannyAPIStruct;
1102 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1103 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1104 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; 1106 #define __Pyx_RefNannySetupContext(name, acquire_gil)\ 1108 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ 1109 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ 1110 PyGILState_Release(__pyx_gilstate_save);\ 1112 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ 1115 #define __Pyx_RefNannySetupContext(name, acquire_gil)\ 1116 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) 1118 #define __Pyx_RefNannyFinishContext()\ 1119 __Pyx_RefNanny->FinishContext(&__pyx_refnanny) 1120 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1121 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1122 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1123 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1124 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) 1125 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) 1126 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) 1127 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) 1129 #define __Pyx_RefNannyDeclarations 1130 #define __Pyx_RefNannySetupContext(name, acquire_gil) 1131 #define __Pyx_RefNannyFinishContext() 1132 #define __Pyx_INCREF(r) Py_INCREF(r) 1133 #define __Pyx_DECREF(r) Py_DECREF(r) 1134 #define __Pyx_GOTREF(r) 1135 #define __Pyx_GIVEREF(r) 1136 #define __Pyx_XINCREF(r) Py_XINCREF(r) 1137 #define __Pyx_XDECREF(r) Py_XDECREF(r) 1138 #define __Pyx_XGOTREF(r) 1139 #define __Pyx_XGIVEREF(r) 1141 #define __Pyx_XDECREF_SET(r, v) do {\ 1142 PyObject *tmp = (PyObject *) r;\ 1143 r = v; __Pyx_XDECREF(tmp);\ 1145 #define __Pyx_DECREF_SET(r, v) do {\ 1146 PyObject *tmp = (PyObject *) r;\ 1147 r = v; __Pyx_DECREF(tmp);\ 1149 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) 1150 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) 1153 #if CYTHON_USE_TYPE_SLOTS 1154 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject*
obj, PyObject* attr_name);
1156 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) 1160 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1163 #if CYTHON_FAST_PYCCALL 1164 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1166 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) 1170 #if CYTHON_FAST_PYCALL 1171 #define __Pyx_PyFunction_FastCall(func, args, nargs)\ 1172 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) 1173 #if 1 || PY_VERSION_HEX < 0x030600B1 1174 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
int nargs, PyObject *kwargs);
1176 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) 1181 #if CYTHON_COMPILING_IN_CPYTHON 1182 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1184 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) 1188 #if CYTHON_COMPILING_IN_CPYTHON 1189 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1193 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1196 #if CYTHON_FAST_THREAD_STATE 1197 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; 1198 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; 1199 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type 1201 #define __Pyx_PyThreadState_declare 1202 #define __Pyx_PyThreadState_assign 1203 #define __Pyx_PyErr_Occurred() PyErr_Occurred() 1207 #if CYTHON_FAST_THREAD_STATE 1208 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) 1209 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) 1210 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) 1211 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) 1212 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) 1213 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1214 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1215 #if CYTHON_COMPILING_IN_CPYTHON 1216 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) 1218 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) 1221 #define __Pyx_PyErr_Clear() PyErr_Clear() 1222 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) 1223 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) 1224 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) 1225 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) 1226 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) 1227 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) 1228 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) 1232 static void __Pyx_WriteUnraisable(
const char *name,
int clineno,
1233 int lineno,
const char *filename,
1234 int full_traceback,
int nogil);
1237 #if CYTHON_COMPILING_IN_CPYTHON 1238 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1240 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) 1244 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
1247 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1248 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1249 const char* function_name);
1252 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1253 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1256 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
1259 #if CYTHON_FAST_THREAD_STATE 1260 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) 1261 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1262 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) 1263 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1265 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) 1266 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) 1270 #if CYTHON_FAST_THREAD_STATE 1271 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) 1272 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1274 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) 1278 #if CYTHON_FAST_THREAD_STATE 1279 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) 1280 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1282 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1286 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1289 #if !CYTHON_COMPILING_IN_PYPY 1290 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2,
long intval,
int inplace);
1292 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\ 1293 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) 1297 static CYTHON_INLINE
int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq,
int eq) {
1298 int result = PySequence_Contains(seq, item);
1299 return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
1303 #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ 1304 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ 1305 __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\ 1306 (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\ 1307 __Pyx_SetItemInt_Generic(o, to_py_func(i), v))) 1308 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
1309 static CYTHON_INLINE
int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t
i, PyObject *v,
1310 int is_list,
int wraparound,
int boundscheck);
1313 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ 1314 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\ 1315 __Pyx__ArgTypeTest(obj, type, name, exact)) 1316 static int __Pyx__ArgTypeTest(PyObject *
obj, PyTypeObject *type,
const char *name,
int exact);
1319 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
1325 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 1326 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject*
obj, PyObject* attr_name);
1328 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr 1332 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 1333 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject*
obj, PyObject* attr_name);
1335 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr 1339 static int __Pyx_SetVtable(PyObject *dict,
void *vtable);
1342 static int __Pyx_setup_reduce(PyObject* type_obj);
1345 #if !CYTHON_COMPILING_IN_PYPY 1346 static PyObject* __Pyx_PyFloat_DivideObjC(PyObject *op1, PyObject *op2,
double floatval,
int inplace);
1348 #define __Pyx_PyFloat_DivideObjC(op1, op2, floatval, inplace)\ 1349 ((inplace ? __Pyx_PyNumber_InPlaceDivide(op1, op2) : __Pyx_PyNumber_Divide(op1, op2))) 1353 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals);
1356 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals);
1359 #if PY_MAJOR_VERSION >= 3 1360 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals 1362 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals 1366 #ifdef CYTHON_CLINE_IN_TRACEBACK 1367 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) 1369 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
1374 PyCodeObject* code_object;
1376 } __Pyx_CodeObjectCacheEntry;
1377 struct __Pyx_CodeObjectCache {
1380 __Pyx_CodeObjectCacheEntry* entries;
1382 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1383 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
1384 static PyCodeObject *__pyx_find_code_object(
int code_line);
1385 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
1388 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
1389 int py_line,
const char *filename);
1392 #ifndef __Pyx_CppExn2PyErr 1395 #include <stdexcept> 1397 static void __Pyx_CppExn2PyErr() {
1399 if (PyErr_Occurred())
1403 }
catch (
const std::bad_alloc& exn) {
1404 PyErr_SetString(PyExc_MemoryError, exn.what());
1405 }
catch (
const std::bad_cast& exn) {
1406 PyErr_SetString(PyExc_TypeError, exn.what());
1407 }
catch (
const std::bad_typeid& exn) {
1408 PyErr_SetString(PyExc_TypeError, exn.what());
1409 }
catch (
const std::domain_error& exn) {
1410 PyErr_SetString(PyExc_ValueError, exn.what());
1411 }
catch (
const std::invalid_argument& exn) {
1412 PyErr_SetString(PyExc_ValueError, exn.what());
1413 }
catch (
const std::ios_base::failure& exn) {
1414 PyErr_SetString(PyExc_IOError, exn.what());
1415 }
catch (
const std::out_of_range& exn) {
1416 PyErr_SetString(PyExc_IndexError, exn.what());
1417 }
catch (
const std::overflow_error& exn) {
1418 PyErr_SetString(PyExc_OverflowError, exn.what());
1419 }
catch (
const std::range_error& exn) {
1420 PyErr_SetString(PyExc_ArithmeticError, exn.what());
1421 }
catch (
const std::underflow_error& exn) {
1422 PyErr_SetString(PyExc_ArithmeticError, exn.what());
1423 }
catch (
const std::exception& exn) {
1424 PyErr_SetString(PyExc_RuntimeError, exn.what());
1428 PyErr_SetString(PyExc_RuntimeError,
"Unknown exception");
1434 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
1437 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
1440 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
1443 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
1446 #if CYTHON_COMPILING_IN_CPYTHON 1447 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) 1448 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1449 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1450 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1452 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) 1453 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) 1454 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) 1456 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) 1459 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
1462 #if CYTHON_FAST_THREAD_STATE 1463 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) 1464 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1466 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
1470 static PyObject* __Pyx_PyObject_CallMethod1(PyObject*
obj, PyObject* method_name, PyObject* arg);
1471 static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg);
1474 typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyThreadState *, PyObject *);
1477 __pyx_coroutine_body_t body;
1480 PyObject *exc_value;
1481 PyObject *exc_traceback;
1482 PyObject *gi_weakreflist;
1484 PyObject *yieldfrom;
1486 PyObject *gi_qualname;
1487 PyObject *gi_modulename;
1491 } __pyx_CoroutineObject;
1492 static __pyx_CoroutineObject *__Pyx__Coroutine_New(
1493 PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
1494 PyObject *name, PyObject *qualname, PyObject *module_name);
1495 static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
1496 __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
1497 PyObject *name, PyObject *qualname, PyObject *module_name);
1498 static int __Pyx_Coroutine_clear(PyObject *
self);
1499 static PyObject *__Pyx_Coroutine_Send(PyObject *
self, PyObject *value);
1500 static PyObject *__Pyx_Coroutine_Close(PyObject *
self);
1501 static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
1502 #define __Pyx_Coroutine_SwapException(self) {\ 1503 __Pyx_ExceptionSwap(&(self)->exc_type, &(self)->exc_value, &(self)->exc_traceback);\ 1504 __Pyx_Coroutine_ResetFrameBackpointer(self);\ 1506 #define __Pyx_Coroutine_ResetAndClearException(self) {\ 1507 __Pyx_ExceptionReset((self)->exc_type, (self)->exc_value, (self)->exc_traceback);\ 1508 (self)->exc_type = (self)->exc_value = (self)->exc_traceback = NULL;\ 1510 #if CYTHON_FAST_THREAD_STATE 1511 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ 1512 __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue) 1514 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ 1515 __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue) 1517 static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue);
1518 static CYTHON_INLINE
void __Pyx_Coroutine_ResetFrameBackpointer(__pyx_CoroutineObject *
self);
1521 static PyObject* __Pyx_Coroutine_patch_module(PyObject* module,
const char* py_code);
1524 static int __Pyx_patch_abc(
void);
1527 #define __Pyx_Generator_USED 1528 static PyTypeObject *__pyx_GeneratorType = 0;
1529 #define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType) 1530 #define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\ 1531 __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name) 1532 static PyObject *__Pyx_Generator_Next(PyObject *
self);
1533 static int __pyx_Generator_init(
void);
1536 static int __Pyx_check_binary_version(
void);
1539 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1541 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_9index_set_wrap(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self,
IndexSet __pyx_v_other);
1542 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_9index_set_unwrap(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
1543 static PyObject *__pyx_f_8PyClical_9index_set_copy(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self,
int __pyx_skip_dispatch);
1544 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_8clifford_wrap(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self,
Clifford __pyx_v_other);
1545 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_8clifford_unwrap(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
1546 static PyObject *__pyx_f_8PyClical_8clifford_copy(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self,
int __pyx_skip_dispatch);
1553 static PyTypeObject *__pyx_ptype_8PyClical_index_set = 0;
1554 static PyTypeObject *__pyx_ptype_8PyClical_clifford = 0;
1555 static PyTypeObject *__pyx_ptype_8PyClical___pyx_scope_struct____iter__ = 0;
1556 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_toIndexSet(PyObject *);
1557 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_compare(PyObject *, PyObject *,
int __pyx_skip_dispatch);
1558 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_min_neg(PyObject *,
int __pyx_skip_dispatch);
1559 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_max_pos(PyObject *,
int __pyx_skip_dispatch);
1560 static CYTHON_INLINE std::vector<scalar_t> __pyx_f_8PyClical_list_to_vector(PyObject *);
1561 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_toClifford(PyObject *);
1562 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_inv(PyObject *,
int __pyx_skip_dispatch);
1563 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_scalar(PyObject *,
int __pyx_skip_dispatch);
1564 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_real(PyObject *,
int __pyx_skip_dispatch);
1565 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_imag(PyObject *,
int __pyx_skip_dispatch);
1566 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_pure(PyObject *,
int __pyx_skip_dispatch);
1567 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_even(PyObject *,
int __pyx_skip_dispatch);
1568 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_odd(PyObject *,
int __pyx_skip_dispatch);
1569 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_involute(PyObject *,
int __pyx_skip_dispatch);
1570 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_reverse(PyObject *,
int __pyx_skip_dispatch);
1571 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_conj(PyObject *,
int __pyx_skip_dispatch);
1572 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_quad(PyObject *,
int __pyx_skip_dispatch);
1573 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_norm(PyObject *,
int __pyx_skip_dispatch);
1574 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_abs(PyObject *,
int __pyx_skip_dispatch);
1575 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_max_abs(PyObject *,
int __pyx_skip_dispatch);
1576 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_pow(PyObject *, PyObject *,
int __pyx_skip_dispatch);
1577 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_outer_pow(PyObject *, PyObject *,
int __pyx_skip_dispatch);
1578 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_complexifier(PyObject *,
int __pyx_skip_dispatch);
1579 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_sqrt(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_sqrt *__pyx_optional_args);
1580 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_exp(PyObject *,
int __pyx_skip_dispatch);
1581 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_log(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_log *__pyx_optional_args);
1582 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cos(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_cos *__pyx_optional_args);
1583 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_acos(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_acos *__pyx_optional_args);
1584 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cosh(PyObject *,
int __pyx_skip_dispatch);
1585 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_acosh(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_acosh *__pyx_optional_args);
1586 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_sin(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_sin *__pyx_optional_args);
1587 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_asin(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_asin *__pyx_optional_args);
1588 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_sinh(PyObject *,
int __pyx_skip_dispatch);
1589 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_asinh(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_asinh *__pyx_optional_args);
1590 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_tan(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_tan *__pyx_optional_args);
1591 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_atan(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_atan *__pyx_optional_args);
1592 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_tanh(PyObject *,
int __pyx_skip_dispatch);
1593 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_atanh(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_atanh *__pyx_optional_args);
1594 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);
1595 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cga3(PyObject *,
int __pyx_skip_dispatch);
1596 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cga3std(PyObject *,
int __pyx_skip_dispatch);
1597 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_agc3(PyObject *,
int __pyx_skip_dispatch);
1598 #define __Pyx_MODULE_NAME "PyClical" 1599 extern int __pyx_module_is_main_PyClical;
1600 int __pyx_module_is_main_PyClical = 0;
1603 static PyObject *__pyx_builtin_IndexError;
1604 static PyObject *__pyx_builtin_RuntimeError;
1605 static PyObject *__pyx_builtin_TypeError;
1606 static PyObject *__pyx_builtin_ValueError;
1607 static PyObject *__pyx_builtin_NotImplemented;
1608 static PyObject *__pyx_builtin_range;
1609 static PyObject *__pyx_builtin_xrange;
1610 static const char __pyx_k_[] =
".";
1611 static const char __pyx_k_e[] =
"e";
1612 static const char __pyx_k_i[] =
"i";
1613 static const char __pyx_k_m[] =
"m";
1614 static const char __pyx_k_p[] =
"p";
1615 static const char __pyx_k_q[] =
"q";
1616 static const char __pyx_k__2[] =
" ";
1617 static const char __pyx_k__5[] =
":";
1618 static const char __pyx_k__6[] =
"\n\t";
1619 static const char __pyx_k__7[] =
" (";
1620 static const char __pyx_k__8[] =
", ";
1621 static const char __pyx_k__9[] =
").";
1622 static const char __pyx_k_cl[] =
"cl";
1623 static const char __pyx_k_pi[] =
"pi";
1624 static const char __pyx_k_cos[] =
"cos";
1625 static const char __pyx_k_exp[] =
"exp";
1626 static const char __pyx_k_frm[] =
"frm";
1627 static const char __pyx_k_inv[] =
"inv";
1628 static const char __pyx_k_ist[] =
"ist";
1629 static const char __pyx_k_ixt[] =
"ixt";
1630 static const char __pyx_k_lhs[] =
"lhs";
1631 static const char __pyx_k_log[] =
"log";
1632 static const char __pyx_k_max[] =
"max";
1633 static const char __pyx_k_min[] =
"min";
1634 static const char __pyx_k_obj[] =
"obj";
1635 static const char __pyx_k_odd[] =
"odd";
1636 static const char __pyx_k_pow[] =
"pow";
1637 static const char __pyx_k_rhs[] =
"rhs";
1638 static const char __pyx_k_sin[] =
"sin";
1639 static const char __pyx_k_tan[] =
"tan";
1640 static const char __pyx_k_tau[] =
"tau";
1641 static const char __pyx_k_Real[] =
"Real";
1642 static const char __pyx_k_acos[] =
"acos";
1643 static const char __pyx_k_args[] =
"args";
1644 static const char __pyx_k_asin[] =
"asin";
1645 static const char __pyx_k_atan[] =
"atan";
1646 static const char __pyx_k_conj[] =
"conj";
1647 static const char __pyx_k_copy[] =
"copy";
1648 static const char __pyx_k_cosh[] =
"cosh";
1649 static const char __pyx_k_even[] =
"even";
1650 static const char __pyx_k_fill[] =
"fill";
1651 static const char __pyx_k_from[] =
" from ";
1652 static const char __pyx_k_iter[] =
"__iter__";
1653 static const char __pyx_k_main[] =
"__main__";
1654 static const char __pyx_k_math[] =
"math";
1655 static const char __pyx_k_name[] =
"__name__";
1656 static const char __pyx_k_norm[] =
"norm";
1657 static const char __pyx_k_pure[] =
"pure";
1658 static const char __pyx_k_quad[] =
"quad";
1659 static const char __pyx_k_send[] =
"send";
1660 static const char __pyx_k_sinh[] =
"sinh";
1661 static const char __pyx_k_sqrt[] =
"sqrt";
1662 static const char __pyx_k_tanh[] =
"tanh";
1663 static const char __pyx_k_test[] =
"_test";
1664 static const char __pyx_k_0_8_2[] =
"0.8.2";
1665 static const char __pyx_k_acosh[] =
"acosh";
1666 static const char __pyx_k_asinh[] =
"asinh";
1667 static const char __pyx_k_atanh[] =
"atanh";
1668 static const char __pyx_k_close[] =
"close";
1669 static const char __pyx_k_grade[] =
"grade";
1670 static const char __pyx_k_istpq[] =
"istpq";
1671 static const char __pyx_k_nbar3[] =
"nbar3";
1672 static const char __pyx_k_ninf3[] =
"ninf3";
1673 static const char __pyx_k_other[] =
"other";
1674 static const char __pyx_k_range[] =
"range";
1675 static const char __pyx_k_throw[] =
"throw";
1676 static const char __pyx_k_using[] =
" using (";
1677 static const char __pyx_k_value[] =
" value ";
1678 static const char __pyx_k_import[] =
"__import__";
1679 static const char __pyx_k_reduce[] =
"__reduce__";
1680 static const char __pyx_k_scalar[] =
"scalar";
1681 static const char __pyx_k_test_2[] =
"__test__";
1682 static const char __pyx_k_xrange[] =
"xrange";
1683 static const char __pyx_k_doctest[] =
"doctest";
1684 static const char __pyx_k_invalid[] =
" invalid ";
1685 static const char __pyx_k_numbers[] =
"numbers";
1686 static const char __pyx_k_reverse[] =
"reverse";
1687 static const char __pyx_k_testmod[] =
"testmod";
1688 static const char __pyx_k_version[] =
"__version__";
1689 static const char __pyx_k_Integral[] =
"Integral";
1690 static const char __pyx_k_PyClical[] =
"PyClical";
1691 static const char __pyx_k_Sequence[] =
"Sequence";
1692 static const char __pyx_k_as_frame[] =
" as frame:\n\t";
1693 static const char __pyx_k_getstate[] =
"__getstate__";
1694 static const char __pyx_k_involute[] =
"involute";
1695 static const char __pyx_k_setstate[] =
"__setstate__";
1696 static const char __pyx_k_to_frame[] =
" to frame ";
1697 static const char __pyx_k_TypeError[] =
"TypeError";
1698 static const char __pyx_k_outer_pow[] =
"outer_pow";
1699 static const char __pyx_k_reduce_ex[] =
"__reduce_ex__";
1700 static const char __pyx_k_IndexError[] =
"IndexError";
1701 static const char __pyx_k_ValueError[] =
"ValueError";
1702 static const char __pyx_k_pyx_vtable[] =
"__pyx_vtable__";
1703 static const char __pyx_k_collections[] =
"collections";
1704 static const char __pyx_k_e_line_1887[] =
"e (line 1887)";
1705 static const char __pyx_k_PyClical_pyx[] =
"PyClical.pyx";
1706 static const char __pyx_k_RuntimeError[] =
"RuntimeError";
1707 static const char __pyx_k_abs_line_1473[] =
"abs (line 1473)";
1708 static const char __pyx_k_cos_line_1602[] =
"cos (line 1602)";
1709 static const char __pyx_k_exp_line_1565[] =
"exp (line 1565)";
1710 static const char __pyx_k_inv_line_1329[] =
"inv (line 1329)";
1711 static const char __pyx_k_log_line_1579[] =
"log (line 1579)";
1712 static const char __pyx_k_odd_line_1397[] =
"odd (line 1397)";
1713 static const char __pyx_k_pow_line_1494[] =
"pow (line 1494)";
1714 static const char __pyx_k_reduce_cython[] =
"__reduce_cython__";
1715 static const char __pyx_k_sin_line_1679[] =
"sin (line 1679)";
1716 static const char __pyx_k_tan_line_1752[] =
"tan (line 1752)";
1717 static const char __pyx_k_using_invalid[] =
" using invalid ";
1718 static const char __pyx_k_Cannot_reframe[] =
"Cannot reframe";
1719 static const char __pyx_k_NotImplemented[] =
"NotImplemented";
1720 static const char __pyx_k_Not_applicable[] =
"Not applicable.";
1721 static const char __pyx_k_acos_line_1619[] =
"acos (line 1619)";
1722 static const char __pyx_k_agc3_line_1844[] =
"agc3 (line 1844)";
1723 static const char __pyx_k_asin_line_1698[] =
"asin (line 1698)";
1724 static const char __pyx_k_atan_line_1769[] =
"atan (line 1769)";
1725 static const char __pyx_k_cga3_line_1824[] =
"cga3 (line 1824)";
1726 static const char __pyx_k_conj_line_1436[] =
"conj (line 1436)";
1727 static const char __pyx_k_cosh_line_1640[] =
"cosh (line 1640)";
1728 static const char __pyx_k_even_line_1388[] =
"even (line 1388)";
1729 static const char __pyx_k_imag_line_1366[] =
"imag (line 1366)";
1730 static const char __pyx_k_invalid_string[] =
" invalid string ";
1731 static const char __pyx_k_norm_line_1462[] =
"norm (line 1462)";
1732 static const char __pyx_k_pure_line_1377[] =
"pure (line 1377)";
1733 static const char __pyx_k_quad_line_1451[] =
"quad (line 1451)";
1734 static const char __pyx_k_real_line_1355[] =
"real (line 1355)";
1735 static const char __pyx_k_sinh_line_1719[] =
"sinh (line 1719)";
1736 static const char __pyx_k_sqrt_line_1542[] =
"sqrt (line 1542)";
1737 static const char __pyx_k_tanh_line_1786[] =
"tanh (line 1786)";
1738 static const char __pyx_k_acosh_line_1656[] =
"acosh (line 1656)";
1739 static const char __pyx_k_asinh_line_1733[] =
"asinh (line 1733)";
1740 static const char __pyx_k_atanh_line_1798[] =
"atanh (line 1798)";
1741 static const char __pyx_k_istpq_line_1900[] =
"istpq (line 1900)";
1742 static const char __pyx_k_setstate_cython[] =
"__setstate_cython__";
1743 static const char __pyx_k_compare_line_490[] =
"compare (line 490)";
1744 static const char __pyx_k_index_set___iter[] =
"index_set.__iter__";
1745 static const char __pyx_k_max_pos_line_511[] =
"max_pos (line 511)";
1746 static const char __pyx_k_min_neg_line_502[] =
"min_neg (line 502)";
1747 static const char __pyx_k_scalar_line_1344[] =
"scalar (line 1344)";
1748 static const char __pyx_k_cga3std_line_1833[] =
"cga3std (line 1833)";
1749 static const char __pyx_k_max_abs_line_1482[] =
"max_abs (line 1482)";
1750 static const char __pyx_k_reverse_line_1421[] =
"reverse (line 1421)";
1751 static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
1752 static const char __pyx_k_involute_line_1406[] =
"involute (line 1406)";
1753 static const char __pyx_k_outer_pow_line_1518[] =
"outer_pow (line 1518)";
1754 static const char __pyx_k_clifford_inv_line_925[] =
"clifford.inv (line 925)";
1755 static const char __pyx_k_clifford_pow_line_979[] =
"clifford.pow (line 979)";
1756 static const char __pyx_k_clifford_abs_line_1174[] =
"clifford.abs (line 1174)";
1757 static const char __pyx_k_clifford_copy_line_554[] =
"clifford.copy (line 554)";
1758 static const char __pyx_k_clifford_odd_line_1069[] =
"clifford.odd (line 1069)";
1759 static const char __pyx_k_complexifier_line_1527[] =
"complexifier (line 1527)";
1760 static const char __pyx_k_index_set_copy_line_64[] =
"index_set.copy (line 64)";
1761 static const char __pyx_k_index_set_max_line_349[] =
"index_set.max (line 349)";
1762 static const char __pyx_k_index_set_min_line_340[] =
"index_set.min (line 340)";
1763 static const char __pyx_k_clifford_conj_line_1137[] =
"clifford.conj (line 1137)";
1764 static const char __pyx_k_clifford_even_line_1060[] =
"clifford.even (line 1060)";
1765 static const char __pyx_k_clifford_norm_line_1163[] =
"clifford.norm (line 1163)";
1766 static const char __pyx_k_clifford_pure_line_1049[] =
"clifford.pure (line 1049)";
1767 static const char __pyx_k_clifford_quad_line_1152[] =
"clifford.quad (line 1152)";
1768 static const char __pyx_k_Unary_print_clifford_1_1[] =
"\n Unary -.\n\n >>> print -clifford(\"{1}\")\n -{1}\n ";
1769 static const char __pyx_k_clifford___or___line_938[] =
"clifford.__or__ (line 938)";
1770 static const char __pyx_k_clifford_frame_line_1214[] =
"clifford.frame (line 1214)";
1771 static const char __pyx_k_clifford_hidden_doctests[] =
"clifford_hidden_doctests";
1772 static const char __pyx_k_clifford_isnan_line_1205[] =
"clifford.isnan (line 1205)";
1773 static const char __pyx_k_index_set_count_line_313[] =
"index_set.count (line 313)";
1774 static const char __pyx_k_clifford___add___line_739[] =
"clifford.__add__ (line 739)";
1775 static const char __pyx_k_clifford___and___line_835[] =
"clifford.__and__ (line 835)";
1776 static const char __pyx_k_clifford___div___line_895[] =
"clifford.__div__ (line 895)";
1777 static const char __pyx_k_clifford___ior___line_949[] =
"clifford.__ior__ (line 949)";
1778 static const char __pyx_k_clifford___mod___line_805[] =
"clifford.__mod__ (line 805)";
1779 static const char __pyx_k_clifford___mul___line_779[] =
"clifford.__mul__ (line 779)";
1780 static const char __pyx_k_clifford___neg___line_721[] =
"clifford.__neg__ (line 721)";
1781 static const char __pyx_k_clifford___pos___line_730[] =
"clifford.__pos__ (line 730)";
1782 static const char __pyx_k_clifford___pow___line_960[] =
"clifford.__pow__ (line 960)";
1783 static const char __pyx_k_clifford___sub___line_759[] =
"clifford.__sub__ (line 759)";
1784 static const char __pyx_k_clifford___xor___line_865[] =
"clifford.__xor__ (line 865)";
1785 static const char __pyx_k_clifford_reframe_line_648[] =
"clifford.reframe (line 648)";
1786 static const char __pyx_k_clifford_scalar_line_1038[] =
"clifford.scalar (line 1038)";
1787 static const char __pyx_k_index_set___or___line_291[] =
"index_set.__or__ (line 291)";
1788 static const char __pyx_k_index_set_hidden_doctests[] =
"index_set_hidden_doctests";
1789 static const char __pyx_k_random_clifford_line_1815[] =
"random_clifford (line 1815)";
1790 static const char __pyx_k_Cannot_take_vector_part_of[] =
"Cannot take vector part of ";
1791 static const char __pyx_k_Unary_print_clifford_1_1_2[] =
"\n Unary +.\n\n >>> print +clifford(\"{1}\")\n {1}\n ";
1792 static const char __pyx_k_clifford___iadd___line_750[] =
"clifford.__iadd__ (line 750)";
1793 static const char __pyx_k_clifford___iand___line_850[] =
"clifford.__iand__ (line 850)";
1794 static const char __pyx_k_clifford___idiv___line_910[] =
"clifford.__idiv__ (line 910)";
1795 static const char __pyx_k_clifford___imod___line_820[] =
"clifford.__imod__ (line 820)";
1796 static const char __pyx_k_clifford___imul___line_792[] =
"clifford.__imul__ (line 792)";
1797 static const char __pyx_k_clifford___isub___line_770[] =
"clifford.__isub__ (line 770)";
1798 static const char __pyx_k_clifford___iter___line_637[] =
"clifford.__iter__ (line 637)";
1799 static const char __pyx_k_clifford___ixor___line_880[] =
"clifford.__ixor__ (line 880)";
1800 static const char __pyx_k_clifford___str___line_1234[] =
"clifford.__str__ (line 1234)";
1801 static const char __pyx_k_clifford_max_abs_line_1183[] =
"clifford.max_abs (line 1183)";
1802 static const char __pyx_k_clifford_reverse_line_1122[] =
"clifford.reverse (line 1122)";
1803 static const char __pyx_k_index_set___and___line_269[] =
"index_set.__and__ (line 269)";
1804 static const char __pyx_k_index_set___ior___line_302[] =
"index_set.__ior__ (line 302)";
1805 static const char __pyx_k_index_set___str___line_393[] =
"index_set.__str__ (line 393)";
1806 static const char __pyx_k_index_set___xor___line_247[] =
"index_set.__xor__ (line 247)";
1807 static const char __pyx_k_clifford___call___line_1019[] =
"clifford.__call__ (line 1019)";
1808 static const char __pyx_k_clifford___repr___line_1225[] =
"clifford.__repr__ (line 1225)";
1809 static const char __pyx_k_clifford_involute_line_1106[] =
"clifford.involute (line 1106)";
1810 static const char __pyx_k_index_set___iand___line_280[] =
"index_set.__iand__ (line 280)";
1811 static const char __pyx_k_index_set___iter___line_227[] =
"index_set.__iter__ (line 227)";
1812 static const char __pyx_k_index_set___ixor___line_258[] =
"index_set.__ixor__ (line 258)";
1813 static const char __pyx_k_index_set___repr___line_382[] =
"index_set.__repr__ (line 382)";
1814 static const char __pyx_k_clifford_outer_pow_line_1003[] =
"clifford.outer_pow (line 1003)";
1815 static const char __pyx_k_clifford_truncated_line_1194[] =
"clifford.truncated (line 1194)";
1816 static const char __pyx_k_index_set_count_neg_line_322[] =
"index_set.count_neg (line 322)";
1817 static const char __pyx_k_index_set_count_pos_line_331[] =
"index_set.count_pos (line 331)";
1818 static const char __pyx_k_clifford___getitem___line_706[] =
"clifford.__getitem__ (line 706)";
1819 static const char __pyx_k_index_set___invert___line_238[] =
"index_set.__invert__ (line 238)";
1820 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 ";
1821 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 ";
1822 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 ";
1823 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 ";
1824 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 ";
1825 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 ";
1826 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 ";
1827 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 ";
1828 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 ";
1829 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 ";
1830 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 ";
1831 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 ";
1832 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 ";
1833 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 ";
1834 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 ";
1835 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 ";
1836 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 ";
1837 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 ";
1838 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 ";
1839 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 ";
1840 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 ";
1841 static const char __pyx_k_clifford_vector_part_line_1078[] =
"clifford.vector_part (line 1078)";
1842 static const char __pyx_k_index_set___getitem___line_189[] =
"index_set.__getitem__ (line 189)";
1843 static const char __pyx_k_index_set___setitem___line_177[] =
"index_set.__setitem__ (line 177)";
1844 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 ";
1845 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 ";
1846 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 ";
1847 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 ";
1848 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 ";
1849 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 ";
1850 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 ";
1851 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 ";
1852 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 ";
1853 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 ";
1854 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 ";
1855 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 ";
1856 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 ";
1857 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 ";
1858 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 ";
1859 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 ";
1860 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 ";
1861 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 ";
1862 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 ";
1863 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 ";
1864 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 ";
1865 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 ";
1866 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 ";
1867 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 ";
1868 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 ";
1869 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 ";
1870 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 ";
1871 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 ";
1872 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 ";
1873 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 ";
1874 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 ";
1875 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 ";
1876 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 ";
1877 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 ";
1878 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 ";
1879 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 ";
1880 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 ";
1881 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 ";
1882 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 ";
1883 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 ";
1884 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 ";
1885 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 ";
1886 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 ";
1887 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 ";
1888 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 ";
1889 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 ";
1890 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 ";
1891 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 ";
1892 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 ";
1893 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 ";
1894 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 ";
1895 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 ";
1896 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 ";
1897 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 ";
1898 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 ";
1899 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 ";
1900 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 ";
1901 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 ";
1902 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 ";
1903 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 ";
1904 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 ";
1905 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 ";
1906 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 ";
1907 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 ";
1908 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 ";
1909 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 ";
1910 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 ";
1911 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 ";
1912 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 ";
1913 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 ";
1914 static const char __pyx_k_This_comparison_operator_is_not[] =
"This comparison operator is not implemented for ";
1915 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 ";
1916 static const char __pyx_k_index_set_sign_of_mult_line_364[] =
"index_set.sign_of_mult (line 364)";
1917 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 ";
1918 static const char __pyx_k_Cannot_initialize_clifford_objec[] =
"Cannot initialize clifford object from";
1919 static const char __pyx_k_Cannot_initialize_index_set_obje[] =
"Cannot initialize index_set object from";
1920 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 ";
1921 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 ";
1922 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 ";
1923 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 ";
1924 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 ";
1925 static const char __pyx_k_clifford_hidden_doctests_line_12[] =
"clifford_hidden_doctests (line 1243)";
1926 static const char __pyx_k_index_set_hidden_doctests_line_4[] =
"index_set_hidden_doctests (line 404)";
1927 static const char __pyx_k_index_set_sign_of_square_line_37[] =
"index_set.sign_of_square (line 373)";
1928 static const char __pyx_k_no_default___reduce___due_to_non[] =
"no default __reduce__ due to non-trivial __cinit__";
1929 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 ";
1930 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 ";
1931 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 ";
1932 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 ";
1933 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 ";
1934 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 ";
1935 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 ";
1936 static PyObject *__pyx_kp_s_;
1937 static PyObject *__pyx_kp_s_0_8_2;
1938 static PyObject *__pyx_kp_u_Abbreviation_for_clifford_index;
1939 static PyObject *__pyx_kp_u_Abbreviation_for_index_set_q_p;
1940 static PyObject *__pyx_kp_u_Absolute_value_of_multivector_m;
1941 static PyObject *__pyx_kp_u_Absolute_value_square_root_of_n;
1942 static PyObject *__pyx_kp_s_Cannot_initialize_clifford_objec;
1943 static PyObject *__pyx_kp_s_Cannot_initialize_index_set_obje;
1944 static PyObject *__pyx_kp_s_Cannot_reframe;
1945 static PyObject *__pyx_kp_s_Cannot_take_vector_part_of;
1946 static PyObject *__pyx_kp_u_Cardinality_Number_of_indices_i;
1947 static PyObject *__pyx_kp_u_Check_if_a_multivector_contains;
1948 static PyObject *__pyx_kp_u_Conjugation_reverse_o_involute;
1949 static PyObject *__pyx_kp_u_Conjugation_reverse_o_involute_2;
1950 static PyObject *__pyx_kp_u_Contraction_print_clifford_1_cl;
1951 static PyObject *__pyx_kp_u_Contraction_x_clifford_1_x_clif;
1952 static PyObject *__pyx_kp_u_Convert_CGA3_null_vector_to_Euc;
1953 static PyObject *__pyx_kp_u_Convert_CGA3_null_vector_to_sta;
1954 static PyObject *__pyx_kp_u_Convert_Euclidean_3D_multivecto;
1955 static PyObject *__pyx_kp_u_Copy_this_clifford_object_x_cli;
1956 static PyObject *__pyx_kp_u_Copy_this_index_set_object_s_in;
1957 static PyObject *__pyx_kp_u_Cosine_of_multivector_with_opti;
1958 static PyObject *__pyx_kp_u_Even_part_of_multivector_sum_of;
1959 static PyObject *__pyx_kp_u_Even_part_of_multivector_sum_of_2;
1960 static PyObject *__pyx_kp_u_Exponential_of_multivector_x_cl;
1961 static PyObject *__pyx_kp_u_Geometric_difference_print_clif;
1962 static PyObject *__pyx_kp_u_Geometric_difference_x_clifford;
1963 static PyObject *__pyx_kp_u_Geometric_multiplicative_invers;
1964 static PyObject *__pyx_kp_u_Geometric_multiplicative_invers_2;
1965 static PyObject *__pyx_kp_u_Geometric_product_print_cliffor;
1966 static PyObject *__pyx_kp_u_Geometric_product_x_clifford_2;
1967 static PyObject *__pyx_kp_u_Geometric_quotient_print_cliffo;
1968 static PyObject *__pyx_kp_u_Geometric_quotient_x_clifford_1;
1969 static PyObject *__pyx_kp_u_Geometric_sum_print_clifford_1;
1970 static PyObject *__pyx_kp_u_Geometric_sum_x_clifford_1_x_cl;
1971 static PyObject *__pyx_kp_u_Get_the_value_of_an_index_set_o;
1972 static PyObject *__pyx_kp_u_Hyperbolic_cosine_of_multivecto;
1973 static PyObject *__pyx_kp_u_Hyperbolic_sine_of_multivector;
1974 static PyObject *__pyx_kp_u_Hyperbolic_tangent_of_multivect;
1975 static PyObject *__pyx_kp_u_Imaginary_part_deprecated_alway;
1976 static PyObject *__pyx_n_s_IndexError;
1977 static PyObject *__pyx_kp_u_Inner_product_print_clifford_1;
1978 static PyObject *__pyx_kp_u_Inner_product_x_clifford_1_x_cl;
1979 static PyObject *__pyx_kp_u_Integer_power_of_multivector_ob;
1980 static PyObject *__pyx_n_s_Integral;
1981 static PyObject *__pyx_kp_u_Inverse_cosine_of_multivector_w;
1982 static PyObject *__pyx_kp_u_Inverse_hyperbolic_cosine_of_mu;
1983 static PyObject *__pyx_kp_u_Inverse_hyperbolic_sine_of_mult;
1984 static PyObject *__pyx_kp_u_Inverse_hyperbolic_tangent_of_m;
1985 static PyObject *__pyx_kp_u_Inverse_sine_of_multivector_wit;
1986 static PyObject *__pyx_kp_u_Inverse_tangent_of_multivector;
1987 static PyObject *__pyx_kp_u_Iterate_over_the_indices_of_an;
1988 static PyObject *__pyx_kp_u_Main_involution_each_i_is_repla;
1989 static PyObject *__pyx_kp_u_Main_involution_each_i_is_repla_2;
1990 static PyObject *__pyx_kp_u_Maximum_absolute_value_of_coord;
1991 static PyObject *__pyx_kp_u_Maximum_member_index_set_1_1_2;
1992 static PyObject *__pyx_kp_u_Maximum_of_absolute_values_of_c;
1993 static PyObject *__pyx_kp_u_Maximum_positive_index_or_0_if;
1994 static PyObject *__pyx_kp_u_Minimum_member_index_set_1_1_2;
1995 static PyObject *__pyx_kp_u_Minimum_negative_index_or_0_if;
1996 static PyObject *__pyx_kp_u_Natural_logarithm_of_multivecto;
1997 static PyObject *__pyx_kp_u_Norm_sum_of_squares_of_coordina;
1998 static PyObject *__pyx_n_s_NotImplemented;
1999 static PyObject *__pyx_kp_s_Not_applicable;
2000 static PyObject *__pyx_kp_u_Not_applicable_for_a_in_cliffor;
2001 static PyObject *__pyx_kp_u_Number_of_negative_indices_incl;
2002 static PyObject *__pyx_kp_u_Number_of_positive_indices_incl;
2003 static PyObject *__pyx_kp_u_Odd_part_of_multivector_sum_of;
2004 static PyObject *__pyx_kp_u_Odd_part_of_multivector_sum_of_2;
2005 static PyObject *__pyx_kp_u_Outer_product_power_of_multivec;
2006 static PyObject *__pyx_kp_u_Outer_product_power_x_clifford;
2007 static PyObject *__pyx_kp_u_Outer_product_print_clifford_1;
2008 static PyObject *__pyx_kp_u_Outer_product_x_clifford_1_x_cl;
2009 static PyObject *__pyx_kp_u_Power_self_to_the_m_x_clifford;
2010 static PyObject *__pyx_kp_u_Power_self_to_the_m_x_clifford_2;
2011 static PyObject *__pyx_kp_u_Pure_grade_vector_part_print_cl;
2012 static PyObject *__pyx_kp_u_Pure_part_print_clifford_1_1_1;
2013 static PyObject *__pyx_kp_u_Pure_part_print_pure_clifford_1;
2014 static PyObject *__pyx_kp_u_Put_self_into_a_larger_frame_co;
2015 static PyObject *__pyx_n_s_PyClical;
2016 static PyObject *__pyx_kp_s_PyClical_pyx;
2017 static PyObject *__pyx_kp_u_Quadratic_form_rev_x_x_0_print;
2018 static PyObject *__pyx_kp_u_Quadratic_form_rev_x_x_0_print_2;
2019 static PyObject *__pyx_kp_u_Random_multivector_within_a_fra;
2020 static PyObject *__pyx_n_s_Real;
2021 static PyObject *__pyx_kp_u_Real_part_synonym_for_scalar_pa;
2022 static PyObject *__pyx_kp_u_Remove_all_terms_of_self_with_r;
2023 static PyObject *__pyx_kp_u_Reversion_eg_1_2_2_1_print_reve;
2024 static PyObject *__pyx_kp_u_Reversion_eg_clifford_1_cliffor;
2025 static PyObject *__pyx_n_s_RuntimeError;
2026 static PyObject *__pyx_kp_u_Scalar_part_clifford_1_1_1_2_sc;
2027 static PyObject *__pyx_kp_u_Scalar_part_scalar_clifford_1_1;
2028 static PyObject *__pyx_n_s_Sequence;
2029 static PyObject *__pyx_kp_u_Set_complement_not_print_index;
2030 static PyObject *__pyx_kp_u_Set_intersection_and_print_inde;
2031 static PyObject *__pyx_kp_u_Set_intersection_and_x_index_se;
2032 static PyObject *__pyx_kp_u_Set_the_value_of_an_index_set_o;
2033 static PyObject *__pyx_kp_u_Set_union_or_print_index_set_1;
2034 static PyObject *__pyx_kp_u_Set_union_or_x_index_set_1_x_in;
2035 static PyObject *__pyx_kp_u_Sign_of_geometric_product_of_tw;
2036 static PyObject *__pyx_kp_u_Sign_of_geometric_square_of_a_C;
2037 static PyObject *__pyx_kp_u_Sine_of_multivector_with_option;
2038 static PyObject *__pyx_kp_u_Square_root_of_1_which_commutes;
2039 static PyObject *__pyx_kp_u_Square_root_of_multivector_with;
2040 static PyObject *__pyx_kp_u_Subalgebra_generated_by_all_gen;
2041 static PyObject *__pyx_kp_u_Subscripting_map_from_index_set;
2042 static PyObject *__pyx_kp_u_Symmetric_set_difference_exclus;
2043 static PyObject *__pyx_kp_u_Symmetric_set_difference_exclus_2;
2044 static PyObject *__pyx_kp_u_Tangent_of_multivector_with_opt;
2045 static PyObject *__pyx_kp_u_Tests_for_functions_that_Doctes;
2046 static PyObject *__pyx_kp_u_Tests_for_functions_that_Doctes_2;
2047 static PyObject *__pyx_kp_u_The_informal_string_representat;
2048 static PyObject *__pyx_kp_u_The_informal_string_representat_2;
2049 static PyObject *__pyx_kp_u_The_official_string_representat;
2050 static PyObject *__pyx_kp_u_The_official_string_representat_2;
2051 static PyObject *__pyx_kp_s_This_comparison_operator_is_not;
2052 static PyObject *__pyx_kp_u_Transform_left_hand_side_using;
2053 static PyObject *__pyx_kp_u_Transform_left_hand_side_using_2;
2054 static PyObject *__pyx_n_s_TypeError;
2055 static PyObject *__pyx_kp_u_Unary_print_clifford_1_1;
2056 static PyObject *__pyx_kp_u_Unary_print_clifford_1_1_2;
2057 static PyObject *__pyx_n_s_ValueError;
2058 static PyObject *__pyx_kp_u_Vector_part_of_multivector_as_a;
2059 static PyObject *__pyx_kp_s__2;
2060 static PyObject *__pyx_kp_s__5;
2061 static PyObject *__pyx_kp_s__6;
2062 static PyObject *__pyx_kp_s__7;
2063 static PyObject *__pyx_kp_s__8;
2064 static PyObject *__pyx_kp_s__9;
2065 static PyObject *__pyx_kp_u_abs_line_1473;
2066 static PyObject *__pyx_n_s_acos;
2067 static PyObject *__pyx_kp_u_acos_line_1619;
2068 static PyObject *__pyx_n_s_acosh;
2069 static PyObject *__pyx_kp_u_acosh_line_1656;
2070 static PyObject *__pyx_kp_u_agc3_line_1844;
2071 static PyObject *__pyx_n_s_args;
2072 static PyObject *__pyx_kp_s_as_frame;
2073 static PyObject *__pyx_n_s_asin;
2074 static PyObject *__pyx_kp_u_asin_line_1698;
2075 static PyObject *__pyx_n_s_asinh;
2076 static PyObject *__pyx_kp_u_asinh_line_1733;
2077 static PyObject *__pyx_n_s_atan;
2078 static PyObject *__pyx_kp_u_atan_line_1769;
2079 static PyObject *__pyx_n_s_atanh;
2080 static PyObject *__pyx_kp_u_atanh_line_1798;
2081 static PyObject *__pyx_kp_u_cga3_line_1824;
2082 static PyObject *__pyx_kp_u_cga3std_line_1833;
2083 static PyObject *__pyx_n_s_cl;
2084 static PyObject *__pyx_kp_u_clifford___add___line_739;
2085 static PyObject *__pyx_kp_u_clifford___and___line_835;
2086 static PyObject *__pyx_kp_u_clifford___call___line_1019;
2087 static PyObject *__pyx_kp_u_clifford___div___line_895;
2088 static PyObject *__pyx_kp_u_clifford___getitem___line_706;
2089 static PyObject *__pyx_kp_u_clifford___iadd___line_750;
2090 static PyObject *__pyx_kp_u_clifford___iand___line_850;
2091 static PyObject *__pyx_kp_u_clifford___idiv___line_910;
2092 static PyObject *__pyx_kp_u_clifford___imod___line_820;
2093 static PyObject *__pyx_kp_u_clifford___imul___line_792;
2094 static PyObject *__pyx_kp_u_clifford___ior___line_949;
2095 static PyObject *__pyx_kp_u_clifford___isub___line_770;
2096 static PyObject *__pyx_kp_u_clifford___iter___line_637;
2097 static PyObject *__pyx_kp_u_clifford___ixor___line_880;
2098 static PyObject *__pyx_kp_u_clifford___mod___line_805;
2099 static PyObject *__pyx_kp_u_clifford___mul___line_779;
2100 static PyObject *__pyx_kp_u_clifford___neg___line_721;
2101 static PyObject *__pyx_kp_u_clifford___or___line_938;
2102 static PyObject *__pyx_kp_u_clifford___pos___line_730;
2103 static PyObject *__pyx_kp_u_clifford___pow___line_960;
2104 static PyObject *__pyx_kp_u_clifford___repr___line_1225;
2105 static PyObject *__pyx_kp_u_clifford___str___line_1234;
2106 static PyObject *__pyx_kp_u_clifford___sub___line_759;
2107 static PyObject *__pyx_kp_u_clifford___xor___line_865;
2108 static PyObject *__pyx_kp_u_clifford_abs_line_1174;
2109 static PyObject *__pyx_kp_u_clifford_conj_line_1137;
2110 static PyObject *__pyx_kp_u_clifford_copy_line_554;
2111 static PyObject *__pyx_kp_u_clifford_even_line_1060;
2112 static PyObject *__pyx_kp_u_clifford_frame_line_1214;
2113 static PyObject *__pyx_n_s_clifford_hidden_doctests;
2114 static PyObject *__pyx_kp_u_clifford_hidden_doctests_line_12;
2115 static PyObject *__pyx_kp_u_clifford_inv_line_925;
2116 static PyObject *__pyx_kp_u_clifford_involute_line_1106;
2117 static PyObject *__pyx_kp_u_clifford_isnan_line_1205;
2118 static PyObject *__pyx_kp_u_clifford_max_abs_line_1183;
2119 static PyObject *__pyx_kp_u_clifford_norm_line_1163;
2120 static PyObject *__pyx_kp_u_clifford_odd_line_1069;
2121 static PyObject *__pyx_kp_u_clifford_outer_pow_line_1003;
2122 static PyObject *__pyx_kp_u_clifford_pow_line_979;
2123 static PyObject *__pyx_kp_u_clifford_pure_line_1049;
2124 static PyObject *__pyx_kp_u_clifford_quad_line_1152;
2125 static PyObject *__pyx_kp_u_clifford_reframe_line_648;
2126 static PyObject *__pyx_kp_u_clifford_reverse_line_1122;
2127 static PyObject *__pyx_kp_u_clifford_scalar_line_1038;
2128 static PyObject *__pyx_kp_u_clifford_truncated_line_1194;
2129 static PyObject *__pyx_kp_u_clifford_vector_part_line_1078;
2130 static PyObject *__pyx_n_s_cline_in_traceback;
2131 static PyObject *__pyx_n_s_close;
2132 static PyObject *__pyx_n_s_collections;
2133 static PyObject *__pyx_kp_u_compare_line_490;
2134 static PyObject *__pyx_kp_u_complexifier_line_1527;
2135 static PyObject *__pyx_n_s_conj;
2136 static PyObject *__pyx_kp_u_conj_line_1436;
2137 static PyObject *__pyx_n_s_copy;
2138 static PyObject *__pyx_n_s_cos;
2139 static PyObject *__pyx_kp_u_cos_line_1602;
2140 static PyObject *__pyx_n_s_cosh;
2141 static PyObject *__pyx_kp_u_cosh_line_1640;
2142 static PyObject *__pyx_n_s_doctest;
2143 static PyObject *__pyx_n_s_e;
2144 static PyObject *__pyx_kp_u_e_line_1887;
2145 static PyObject *__pyx_n_s_even;
2146 static PyObject *__pyx_kp_u_even_line_1388;
2147 static PyObject *__pyx_n_s_exp;
2148 static PyObject *__pyx_kp_u_exp_line_1565;
2149 static PyObject *__pyx_n_s_fill;
2150 static PyObject *__pyx_n_s_frm;
2151 static PyObject *__pyx_kp_s_from;
2152 static PyObject *__pyx_n_s_getstate;
2153 static PyObject *__pyx_n_s_grade;
2154 static PyObject *__pyx_n_s_i;
2155 static PyObject *__pyx_kp_u_imag_line_1366;
2156 static PyObject *__pyx_n_s_import;
2157 static PyObject *__pyx_kp_u_index_set___and___line_269;
2158 static PyObject *__pyx_kp_u_index_set___getitem___line_189;
2159 static PyObject *__pyx_kp_u_index_set___iand___line_280;
2160 static PyObject *__pyx_kp_u_index_set___invert___line_238;
2161 static PyObject *__pyx_kp_u_index_set___ior___line_302;
2162 static PyObject *__pyx_n_s_index_set___iter;
2163 static PyObject *__pyx_kp_u_index_set___iter___line_227;
2164 static PyObject *__pyx_kp_u_index_set___ixor___line_258;
2165 static PyObject *__pyx_kp_u_index_set___or___line_291;
2166 static PyObject *__pyx_kp_u_index_set___repr___line_382;
2167 static PyObject *__pyx_kp_u_index_set___setitem___line_177;
2168 static PyObject *__pyx_kp_u_index_set___str___line_393;
2169 static PyObject *__pyx_kp_u_index_set___xor___line_247;
2170 static PyObject *__pyx_kp_u_index_set_copy_line_64;
2171 static PyObject *__pyx_kp_u_index_set_count_line_313;
2172 static PyObject *__pyx_kp_u_index_set_count_neg_line_322;
2173 static PyObject *__pyx_kp_u_index_set_count_pos_line_331;
2174 static PyObject *__pyx_n_s_index_set_hidden_doctests;
2175 static PyObject *__pyx_kp_u_index_set_hidden_doctests_line_4;
2176 static PyObject *__pyx_kp_u_index_set_max_line_349;
2177 static PyObject *__pyx_kp_u_index_set_min_line_340;
2178 static PyObject *__pyx_kp_u_index_set_sign_of_mult_line_364;
2179 static PyObject *__pyx_kp_u_index_set_sign_of_square_line_37;
2180 static PyObject *__pyx_n_s_inv;
2181 static PyObject *__pyx_kp_u_inv_line_1329;
2182 static PyObject *__pyx_kp_s_invalid;
2183 static PyObject *__pyx_kp_s_invalid_string;
2184 static PyObject *__pyx_n_s_involute;
2185 static PyObject *__pyx_kp_u_involute_line_1406;
2186 static PyObject *__pyx_n_s_ist;
2187 static PyObject *__pyx_n_s_istpq;
2188 static PyObject *__pyx_kp_u_istpq_line_1900;
2189 static PyObject *__pyx_n_s_iter;
2190 static PyObject *__pyx_n_s_ixt;
2191 static PyObject *__pyx_kp_u_lexicographic_compare_eg_3_4_5;
2192 static PyObject *__pyx_n_s_lhs;
2193 static PyObject *__pyx_n_s_log;
2194 static PyObject *__pyx_kp_u_log_line_1579;
2195 static PyObject *__pyx_n_s_m;
2196 static PyObject *__pyx_n_s_main;
2197 static PyObject *__pyx_n_s_math;
2198 static PyObject *__pyx_n_s_max;
2199 static PyObject *__pyx_kp_u_max_abs_line_1482;
2200 static PyObject *__pyx_kp_u_max_pos_line_511;
2201 static PyObject *__pyx_n_s_min;
2202 static PyObject *__pyx_kp_u_min_neg_line_502;
2203 static PyObject *__pyx_n_s_name;
2204 static PyObject *__pyx_n_s_nbar3;
2205 static PyObject *__pyx_n_s_ninf3;
2206 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2207 static PyObject *__pyx_n_s_norm;
2208 static PyObject *__pyx_kp_u_norm_line_1462;
2209 static PyObject *__pyx_kp_u_norm_sum_of_squares_of_coordina;
2210 static PyObject *__pyx_n_s_numbers;
2211 static PyObject *__pyx_n_s_obj;
2212 static PyObject *__pyx_n_s_odd;
2213 static PyObject *__pyx_kp_u_odd_line_1397;
2214 static PyObject *__pyx_n_s_other;
2215 static PyObject *__pyx_n_s_outer_pow;
2216 static PyObject *__pyx_kp_u_outer_pow_line_1518;
2217 static PyObject *__pyx_n_s_p;
2218 static PyObject *__pyx_n_s_pi;
2219 static PyObject *__pyx_n_s_pow;
2220 static PyObject *__pyx_kp_u_pow_line_1494;
2221 static PyObject *__pyx_n_s_pure;
2222 static PyObject *__pyx_kp_u_pure_line_1377;
2223 static PyObject *__pyx_n_s_pyx_vtable;
2224 static PyObject *__pyx_n_s_q;
2225 static PyObject *__pyx_n_s_quad;
2226 static PyObject *__pyx_kp_u_quad_line_1451;
2227 static PyObject *__pyx_kp_u_random_clifford_line_1815;
2228 static PyObject *__pyx_n_s_range;
2229 static PyObject *__pyx_kp_u_real_line_1355;
2230 static PyObject *__pyx_n_s_reduce;
2231 static PyObject *__pyx_n_s_reduce_cython;
2232 static PyObject *__pyx_n_s_reduce_ex;
2233 static PyObject *__pyx_n_s_reverse;
2234 static PyObject *__pyx_kp_u_reverse_line_1421;
2235 static PyObject *__pyx_n_s_rhs;
2236 static PyObject *__pyx_n_s_scalar;
2237 static PyObject *__pyx_kp_u_scalar_line_1344;
2238 static PyObject *__pyx_n_s_send;
2239 static PyObject *__pyx_n_s_setstate;
2240 static PyObject *__pyx_n_s_setstate_cython;
2241 static PyObject *__pyx_n_s_sin;
2242 static PyObject *__pyx_kp_u_sin_line_1679;
2243 static PyObject *__pyx_n_s_sinh;
2244 static PyObject *__pyx_kp_u_sinh_line_1719;
2245 static PyObject *__pyx_n_s_sqrt;
2246 static PyObject *__pyx_kp_u_sqrt_line_1542;
2247 static PyObject *__pyx_n_s_tan;
2248 static PyObject *__pyx_kp_u_tan_line_1752;
2249 static PyObject *__pyx_n_s_tanh;
2250 static PyObject *__pyx_kp_u_tanh_line_1786;
2251 static PyObject *__pyx_n_s_tau;
2252 static PyObject *__pyx_n_s_test;
2253 static PyObject *__pyx_n_s_test_2;
2254 static PyObject *__pyx_n_s_testmod;
2255 static PyObject *__pyx_n_s_throw;
2256 static PyObject *__pyx_kp_s_to_frame;
2257 static PyObject *__pyx_kp_s_using;
2258 static PyObject *__pyx_kp_s_using_invalid;
2259 static PyObject *__pyx_kp_s_value;
2260 static PyObject *__pyx_n_s_version;
2261 static PyObject *__pyx_n_s_xrange;
2262 static PyObject *__pyx_pf_8PyClical_9index_set_copy(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2263 static int __pyx_pf_8PyClical_9index_set_2__cinit__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_other);
2264 static void __pyx_pf_8PyClical_9index_set_4__dealloc__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2265 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);
2266 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);
2267 static PyObject *__pyx_pf_8PyClical_9index_set_10__getitem__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_idx);
2268 static int __pyx_pf_8PyClical_9index_set_12__contains__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_idx);
2269 static PyObject *__pyx_pf_8PyClical_9index_set_14__iter__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2270 static PyObject *__pyx_pf_8PyClical_9index_set_17__invert__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2271 static PyObject *__pyx_pf_8PyClical_9index_set_19__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2272 static PyObject *__pyx_pf_8PyClical_9index_set_21__ixor__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs);
2273 static PyObject *__pyx_pf_8PyClical_9index_set_23__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2274 static PyObject *__pyx_pf_8PyClical_9index_set_25__iand__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs);
2275 static PyObject *__pyx_pf_8PyClical_9index_set_27__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2276 static PyObject *__pyx_pf_8PyClical_9index_set_29__ior__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs);
2277 static PyObject *__pyx_pf_8PyClical_9index_set_31count(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2278 static PyObject *__pyx_pf_8PyClical_9index_set_33count_neg(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2279 static PyObject *__pyx_pf_8PyClical_9index_set_35count_pos(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2280 static PyObject *__pyx_pf_8PyClical_9index_set_37min(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2281 static PyObject *__pyx_pf_8PyClical_9index_set_39max(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2282 static PyObject *__pyx_pf_8PyClical_9index_set_41hash_fn(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2283 static PyObject *__pyx_pf_8PyClical_9index_set_43sign_of_mult(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs);
2284 static PyObject *__pyx_pf_8PyClical_9index_set_45sign_of_square(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2285 static PyObject *__pyx_pf_8PyClical_9index_set_47__repr__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2286 static PyObject *__pyx_pf_8PyClical_9index_set_49__str__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2287 static PyObject *__pyx_pf_8PyClical_9index_set_51__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2288 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);
2289 static PyObject *__pyx_pf_8PyClical_index_set_hidden_doctests(CYTHON_UNUSED PyObject *__pyx_self);
2290 static PyObject *__pyx_pf_8PyClical_2compare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2291 static PyObject *__pyx_pf_8PyClical_4min_neg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2292 static PyObject *__pyx_pf_8PyClical_6max_pos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2293 static PyObject *__pyx_pf_8PyClical_8clifford_copy(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2294 static int __pyx_pf_8PyClical_8clifford_2__cinit__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_ixt);
2295 static void __pyx_pf_8PyClical_8clifford_4__dealloc__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2296 static int __pyx_pf_8PyClical_8clifford_6__contains__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_x);
2297 static PyObject *__pyx_pf_8PyClical_8clifford_8__iter__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2298 static PyObject *__pyx_pf_8PyClical_8clifford_10reframe(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_ixt);
2299 static PyObject *__pyx_pf_8PyClical_8clifford_12__richcmp__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op);
2300 static PyObject *__pyx_pf_8PyClical_8clifford_14__getitem__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_ixt);
2301 static PyObject *__pyx_pf_8PyClical_8clifford_16__neg__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2302 static PyObject *__pyx_pf_8PyClical_8clifford_18__pos__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2303 static PyObject *__pyx_pf_8PyClical_8clifford_20__add__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2304 static PyObject *__pyx_pf_8PyClical_8clifford_22__iadd__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2305 static PyObject *__pyx_pf_8PyClical_8clifford_24__sub__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2306 static PyObject *__pyx_pf_8PyClical_8clifford_26__isub__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2307 static PyObject *__pyx_pf_8PyClical_8clifford_28__mul__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2308 static PyObject *__pyx_pf_8PyClical_8clifford_30__imul__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2309 static PyObject *__pyx_pf_8PyClical_8clifford_32__mod__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2310 static PyObject *__pyx_pf_8PyClical_8clifford_34__imod__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2311 static PyObject *__pyx_pf_8PyClical_8clifford_36__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2312 static PyObject *__pyx_pf_8PyClical_8clifford_38__iand__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2313 static PyObject *__pyx_pf_8PyClical_8clifford_40__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2314 static PyObject *__pyx_pf_8PyClical_8clifford_42__ixor__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2315 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 2316 static PyObject *__pyx_pf_8PyClical_8clifford_44__div__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2318 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 2319 static PyObject *__pyx_pf_8PyClical_8clifford_46__idiv__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2321 static PyObject *__pyx_pf_8PyClical_8clifford_48inv(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2322 static PyObject *__pyx_pf_8PyClical_8clifford_50__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2323 static PyObject *__pyx_pf_8PyClical_8clifford_52__ior__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2324 static PyObject *__pyx_pf_8PyClical_8clifford_54__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_m, CYTHON_UNUSED PyObject *__pyx_v_dummy);
2325 static PyObject *__pyx_pf_8PyClical_8clifford_56pow(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_m);
2326 static PyObject *__pyx_pf_8PyClical_8clifford_58outer_pow(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_m);
2327 static PyObject *__pyx_pf_8PyClical_8clifford_60__call__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_grade);
2328 static PyObject *__pyx_pf_8PyClical_8clifford_62scalar(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2329 static PyObject *__pyx_pf_8PyClical_8clifford_64pure(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2330 static PyObject *__pyx_pf_8PyClical_8clifford_66even(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2331 static PyObject *__pyx_pf_8PyClical_8clifford_68odd(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2332 static PyObject *__pyx_pf_8PyClical_8clifford_70vector_part(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_frm);
2333 static PyObject *__pyx_pf_8PyClical_8clifford_72involute(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2334 static PyObject *__pyx_pf_8PyClical_8clifford_74reverse(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2335 static PyObject *__pyx_pf_8PyClical_8clifford_76conj(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2336 static PyObject *__pyx_pf_8PyClical_8clifford_78quad(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2337 static PyObject *__pyx_pf_8PyClical_8clifford_80norm(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2338 static PyObject *__pyx_pf_8PyClical_8clifford_82abs(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2339 static PyObject *__pyx_pf_8PyClical_8clifford_84max_abs(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2340 static PyObject *__pyx_pf_8PyClical_8clifford_86truncated(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_limit);
2341 static PyObject *__pyx_pf_8PyClical_8clifford_88isnan(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2342 static PyObject *__pyx_pf_8PyClical_8clifford_90frame(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2343 static PyObject *__pyx_pf_8PyClical_8clifford_92__repr__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2344 static PyObject *__pyx_pf_8PyClical_8clifford_94__str__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2345 static PyObject *__pyx_pf_8PyClical_8clifford_96__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2346 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);
2347 static PyObject *__pyx_pf_8PyClical_8clifford_hidden_doctests(CYTHON_UNUSED PyObject *__pyx_self);
2348 static PyObject *__pyx_pf_8PyClical_10inv(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2349 static PyObject *__pyx_pf_8PyClical_12scalar(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2350 static PyObject *__pyx_pf_8PyClical_14real(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2351 static PyObject *__pyx_pf_8PyClical_16imag(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2352 static PyObject *__pyx_pf_8PyClical_18pure(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2353 static PyObject *__pyx_pf_8PyClical_20even(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2354 static PyObject *__pyx_pf_8PyClical_22odd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2355 static PyObject *__pyx_pf_8PyClical_24involute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2356 static PyObject *__pyx_pf_8PyClical_26reverse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2357 static PyObject *__pyx_pf_8PyClical_28conj(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2358 static PyObject *__pyx_pf_8PyClical_30quad(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2359 static PyObject *__pyx_pf_8PyClical_32norm(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2360 static PyObject *__pyx_pf_8PyClical_34abs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2361 static PyObject *__pyx_pf_8PyClical_36max_abs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2362 static PyObject *__pyx_pf_8PyClical_38pow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_m);
2363 static PyObject *__pyx_pf_8PyClical_40outer_pow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_m);
2364 static PyObject *__pyx_pf_8PyClical_42complexifier(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2365 static PyObject *__pyx_pf_8PyClical_44sqrt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2366 static PyObject *__pyx_pf_8PyClical_46exp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2367 static PyObject *__pyx_pf_8PyClical_48log(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2368 static PyObject *__pyx_pf_8PyClical_50cos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2369 static PyObject *__pyx_pf_8PyClical_52acos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2370 static PyObject *__pyx_pf_8PyClical_54cosh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2371 static PyObject *__pyx_pf_8PyClical_56acosh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2372 static PyObject *__pyx_pf_8PyClical_58sin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2373 static PyObject *__pyx_pf_8PyClical_60asin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2374 static PyObject *__pyx_pf_8PyClical_62sinh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2375 static PyObject *__pyx_pf_8PyClical_64asinh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2376 static PyObject *__pyx_pf_8PyClical_66tan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2377 static PyObject *__pyx_pf_8PyClical_68atan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2378 static PyObject *__pyx_pf_8PyClical_70tanh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2379 static PyObject *__pyx_pf_8PyClical_72atanh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2380 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);
2381 static PyObject *__pyx_pf_8PyClical_76cga3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2382 static PyObject *__pyx_pf_8PyClical_78cga3std(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2383 static PyObject *__pyx_pf_8PyClical_80agc3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2384 static PyObject *__pyx_pf_8PyClical_82e(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2385 static PyObject *__pyx_pf_8PyClical_84istpq(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_p, PyObject *__pyx_v_q);
2386 static PyObject *__pyx_pf_8PyClical_86_test(CYTHON_UNUSED PyObject *__pyx_self);
2387 static PyObject *__pyx_tp_new_8PyClical_index_set(PyTypeObject *t, PyObject *a, PyObject *k);
2388 static PyObject *__pyx_tp_new_8PyClical_clifford(PyTypeObject *t, PyObject *a, PyObject *k);
2389 static PyObject *__pyx_tp_new_8PyClical___pyx_scope_struct____iter__(PyTypeObject *t, PyObject *a, PyObject *k);
2390 static PyObject *__pyx_float_0_0;
2391 static PyObject *__pyx_float_1_0;
2392 static PyObject *__pyx_float_2_0;
2393 static PyObject *__pyx_float_8_0;
2394 static PyObject *__pyx_int_0;
2395 static PyObject *__pyx_int_1;
2396 static PyObject *__pyx_int_4;
2397 static PyObject *__pyx_int_neg_1;
2398 static PyObject *__pyx_tuple__3;
2399 static PyObject *__pyx_tuple__4;
2400 static PyObject *__pyx_tuple__10;
2401 static PyObject *__pyx_tuple__11;
2402 static PyObject *__pyx_tuple__12;
2403 static PyObject *__pyx_tuple__13;
2404 static PyObject *__pyx_tuple__16;
2405 static PyObject *__pyx_tuple__17;
2406 static PyObject *__pyx_tuple__19;
2407 static PyObject *__pyx_tuple__21;
2408 static PyObject *__pyx_tuple__22;
2409 static PyObject *__pyx_tuple__23;
2410 static PyObject *__pyx_tuple__24;
2411 static PyObject *__pyx_tuple__25;
2412 static PyObject *__pyx_codeobj__14;
2413 static PyObject *__pyx_codeobj__15;
2414 static PyObject *__pyx_codeobj__18;
2415 static PyObject *__pyx_codeobj__20;
2416 static PyObject *__pyx_codeobj__26;
2427 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_toIndexSet(PyObject *__pyx_v_obj) {
2429 __Pyx_RefNannyDeclarations
2430 PyObject *__pyx_t_1 = NULL;
2431 __Pyx_RefNannySetupContext(
"toIndexSet", 0);
2440 __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)
2441 __Pyx_GOTREF(__pyx_t_1);
2442 __pyx_r = (((
struct __pyx_obj_8PyClical_index_set *)__pyx_t_1)->instance[0]);
2443 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2456 __Pyx_XDECREF(__pyx_t_1);
2457 __Pyx_WriteUnraisable(
"PyClical.toIndexSet", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
2458 __Pyx_pretend_to_initialize(&__pyx_r);
2460 __Pyx_RefNannyFinishContext();
2472 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_9index_set_wrap(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self,
IndexSet __pyx_v_other) {
2473 PyObject *__pyx_r = NULL;
2474 __Pyx_RefNannyDeclarations
2475 __Pyx_RefNannySetupContext(
"wrap", 0);
2484 (__pyx_v_self->instance[0]) = __pyx_v_other;
2493 __Pyx_XDECREF(__pyx_r);
2494 __Pyx_INCREF(((PyObject *)__pyx_v_self));
2495 __pyx_r = ((PyObject *)__pyx_v_self);
2508 __Pyx_XGIVEREF(__pyx_r);
2509 __Pyx_RefNannyFinishContext();
2521 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_9index_set_unwrap(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
2523 __Pyx_RefNannyDeclarations
2524 __Pyx_RefNannySetupContext(
"unwrap", 0);
2533 __pyx_r = (__pyx_v_self->instance[0]);
2546 __Pyx_RefNannyFinishContext();
2558 static PyObject *__pyx_pw_8PyClical_9index_set_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
2559 static PyObject *__pyx_f_8PyClical_9index_set_copy(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self,
int __pyx_skip_dispatch) {
2560 PyObject *__pyx_r = NULL;
2561 __Pyx_RefNannyDeclarations
2562 PyObject *__pyx_t_1 = NULL;
2563 PyObject *__pyx_t_2 = NULL;
2564 PyObject *__pyx_t_3 = NULL;
2565 PyObject *__pyx_t_4 = NULL;
2566 __Pyx_RefNannySetupContext(
"copy", 0);
2568 if (unlikely(__pyx_skip_dispatch)) ;
2570 else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
2571 __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)
2572 __Pyx_GOTREF(__pyx_t_1);
2573 if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_8PyClical_9index_set_1copy)) {
2574 __Pyx_XDECREF(__pyx_r);
2575 __Pyx_INCREF(__pyx_t_1);
2576 __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
2577 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
2578 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
2579 if (likely(__pyx_t_4)) {
2580 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
2581 __Pyx_INCREF(__pyx_t_4);
2582 __Pyx_INCREF(
function);
2583 __Pyx_DECREF_SET(__pyx_t_3,
function);
2587 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error)
2588 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2590 __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error)
2592 __Pyx_GOTREF(__pyx_t_2);
2593 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2594 __pyx_r = __pyx_t_2;
2596 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2599 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2609 __Pyx_XDECREF(__pyx_r);
2610 __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)
2611 __Pyx_GOTREF(__pyx_t_1);
2612 __pyx_r = __pyx_t_1;
2626 __Pyx_XDECREF(__pyx_t_1);
2627 __Pyx_XDECREF(__pyx_t_2);
2628 __Pyx_XDECREF(__pyx_t_3);
2629 __Pyx_XDECREF(__pyx_t_4);
2630 __Pyx_AddTraceback(
"PyClical.index_set.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
2633 __Pyx_XGIVEREF(__pyx_r);
2634 __Pyx_RefNannyFinishContext();
2639 static PyObject *__pyx_pw_8PyClical_9index_set_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
2640 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 ";
2641 static PyObject *__pyx_pw_8PyClical_9index_set_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
2642 PyObject *__pyx_r = 0;
2643 __Pyx_RefNannyDeclarations
2644 __Pyx_RefNannySetupContext(
"copy (wrapper)", 0);
2645 __pyx_r = __pyx_pf_8PyClical_9index_set_copy(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
2648 __Pyx_RefNannyFinishContext();
2652 static PyObject *__pyx_pf_8PyClical_9index_set_copy(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
2653 PyObject *__pyx_r = NULL;
2654 __Pyx_RefNannyDeclarations
2655 PyObject *__pyx_t_1 = NULL;
2656 __Pyx_RefNannySetupContext(
"copy", 0);
2657 __Pyx_XDECREF(__pyx_r);
2658 __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)
2659 __Pyx_GOTREF(__pyx_t_1);
2660 __pyx_r = __pyx_t_1;
2666 __Pyx_XDECREF(__pyx_t_1);
2667 __Pyx_AddTraceback(
"PyClical.index_set.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
2670 __Pyx_XGIVEREF(__pyx_r);
2671 __Pyx_RefNannyFinishContext();
2684 static int __pyx_pw_8PyClical_9index_set_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2685 static int __pyx_pw_8PyClical_9index_set_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2686 PyObject *__pyx_v_other = 0;
2688 __Pyx_RefNannyDeclarations
2689 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
2691 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,0};
2692 PyObject* values[1] = {0};
2693 values[0] = ((PyObject *)__pyx_int_0);
2694 if (unlikely(__pyx_kwds)) {
2696 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2698 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2701 default:
goto __pyx_L5_argtuple_error;
2703 kw_args = PyDict_Size(__pyx_kwds);
2707 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other);
2708 if (value) { values[0] = value; kw_args--; }
2711 if (unlikely(kw_args > 0)) {
2712 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(0, 73, __pyx_L3_error)
2715 switch (PyTuple_GET_SIZE(__pyx_args)) {
2716 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2719 default:
goto __pyx_L5_argtuple_error;
2722 __pyx_v_other = values[0];
2724 goto __pyx_L4_argument_unpacking_done;
2725 __pyx_L5_argtuple_error:;
2726 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 73, __pyx_L3_error)
2728 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2729 __Pyx_RefNannyFinishContext();
2731 __pyx_L4_argument_unpacking_done:;
2732 __pyx_r = __pyx_pf_8PyClical_9index_set_2__cinit__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), __pyx_v_other);
2735 __Pyx_RefNannyFinishContext();
2739 static int __pyx_pf_8PyClical_9index_set_2__cinit__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_other) {
2740 PyObject *__pyx_v_error_msg_prefix = NULL;
2741 PyObject *__pyx_v_idx = NULL;
2743 __Pyx_RefNannyDeclarations
2747 PyObject *__pyx_t_4 = NULL;
2748 PyObject *__pyx_t_5 = NULL;
2751 PyObject *__pyx_t_8 = NULL;
2752 PyObject *__pyx_t_9 = NULL;
2753 PyObject *__pyx_t_10 = NULL;
2754 Py_ssize_t __pyx_t_11;
2755 PyObject *(*__pyx_t_12)(PyObject *);
2756 PyObject *__pyx_t_13 = NULL;
2757 PyObject *__pyx_t_14 = NULL;
2758 PyObject *__pyx_t_15 = NULL;
2759 PyObject *__pyx_t_16 = NULL;
2761 __Pyx_RefNannySetupContext(
"__cinit__", 0);
2770 __Pyx_INCREF(__pyx_kp_s_Cannot_initialize_index_set_obje);
2771 __pyx_v_error_msg_prefix = __pyx_kp_s_Cannot_initialize_index_set_obje;
2780 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8PyClical_index_set);
2781 __pyx_t_2 = (__pyx_t_1 != 0);
2792 __pyx_t_3 =
new IndexSet(__pyx_f_8PyClical_9index_set_unwrap(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_other)));
2794 __Pyx_CppExn2PyErr();
2795 __PYX_ERR(0, 94, __pyx_L1_error)
2797 __pyx_v_self->instance = __pyx_t_3;
2816 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numbers);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 95, __pyx_L1_error)
2817 __Pyx_GOTREF(__pyx_t_4);
2818 __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)
2819 __Pyx_GOTREF(__pyx_t_5);
2820 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2821 __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)
2822 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2823 __pyx_t_1 = (__pyx_t_2 != 0);
2833 __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)
2835 __pyx_t_3 =
new IndexSet(((
int)__pyx_t_6));
2837 __Pyx_CppExn2PyErr();
2838 __PYX_ERR(0, 96, __pyx_L1_error)
2840 __pyx_v_self->instance = __pyx_t_3;
2859 __pyx_t_2 = PySet_Check(__pyx_v_other);
2860 __pyx_t_7 = (__pyx_t_2 != 0);
2863 __pyx_t_1 = __pyx_t_7;
2864 goto __pyx_L4_bool_binop_done;
2866 __pyx_t_7 = PyFrozenSet_Check(__pyx_v_other);
2867 __pyx_t_2 = (__pyx_t_7 != 0);
2868 __pyx_t_1 = __pyx_t_2;
2869 __pyx_L4_bool_binop_done:;
2870 __pyx_t_2 = (__pyx_t_1 != 0);
2881 __Pyx_PyThreadState_declare
2882 __Pyx_PyThreadState_assign
2883 __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
2884 __Pyx_XGOTREF(__pyx_t_8);
2885 __Pyx_XGOTREF(__pyx_t_9);
2886 __Pyx_XGOTREF(__pyx_t_10);
2897 __pyx_v_self->instance = __pyx_t_3;
2906 if (likely(PyList_CheckExact(__pyx_v_other)) || PyTuple_CheckExact(__pyx_v_other)) {
2907 __pyx_t_5 = __pyx_v_other; __Pyx_INCREF(__pyx_t_5); __pyx_t_11 = 0;
2910 __pyx_t_11 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_other);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 100, __pyx_L6_error)
2911 __Pyx_GOTREF(__pyx_t_5);
2912 __pyx_t_12 = Py_TYPE(__pyx_t_5)->tp_iternext;
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 100, __pyx_L6_error)
2915 if (likely(!__pyx_t_12)) {
2916 if (likely(PyList_CheckExact(__pyx_t_5))) {
2917 if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_5))
break;
2918 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 2919 __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)
2921 __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)
2922 __Pyx_GOTREF(__pyx_t_4);
2925 if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_5))
break;
2926 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 2927 __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)
2929 __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)
2930 __Pyx_GOTREF(__pyx_t_4);
2934 __pyx_t_4 = __pyx_t_12(__pyx_t_5);
2935 if (unlikely(!__pyx_t_4)) {
2936 PyObject* exc_type = PyErr_Occurred();
2938 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
2939 else __PYX_ERR(0, 100, __pyx_L6_error)
2943 __Pyx_GOTREF(__pyx_t_4);
2945 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_4);
2955 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self), __pyx_v_idx, Py_True) < 0)) __PYX_ERR(0, 101, __pyx_L6_error)
2965 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2975 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
2976 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
2977 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
2978 goto __pyx_L11_try_end;
2980 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
2981 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
2990 __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_IndexError);
2992 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2993 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_13) < 0) __PYX_ERR(0, 102, __pyx_L8_except_error)
2994 __Pyx_GOTREF(__pyx_t_5);
2995 __Pyx_GOTREF(__pyx_t_4);
2996 __Pyx_GOTREF(__pyx_t_13);
3005 __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)
3006 __Pyx_GOTREF(__pyx_t_14);
3007 __pyx_t_15 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 103, __pyx_L8_except_error)
3008 __Pyx_GOTREF(__pyx_t_15);
3009 __pyx_t_16 = PyNumber_Add(__pyx_t_14, __pyx_t_15);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 103, __pyx_L8_except_error)
3010 __Pyx_GOTREF(__pyx_t_16);
3011 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3012 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3013 __pyx_t_15 = PyNumber_Add(__pyx_t_16, __pyx_kp_s_);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 103, __pyx_L8_except_error)
3014 __Pyx_GOTREF(__pyx_t_15);
3015 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3016 __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)
3017 __Pyx_GOTREF(__pyx_t_16);
3018 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3019 __Pyx_Raise(__pyx_t_16, 0, 0, 0);
3020 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3021 __PYX_ERR(0, 103, __pyx_L8_except_error)
3031 __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
3033 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3034 if (__Pyx_GetException(&__pyx_t_13, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(0, 104, __pyx_L8_except_error)
3035 __Pyx_GOTREF(__pyx_t_13);
3036 __Pyx_GOTREF(__pyx_t_4);
3037 __Pyx_GOTREF(__pyx_t_5);
3046 __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)
3047 __Pyx_GOTREF(__pyx_t_16);
3048 __pyx_t_15 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 105, __pyx_L8_except_error)
3049 __Pyx_GOTREF(__pyx_t_15);
3050 __pyx_t_14 = PyNumber_Add(__pyx_t_16, __pyx_t_15);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 105, __pyx_L8_except_error)
3051 __Pyx_GOTREF(__pyx_t_14);
3052 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3053 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3054 __pyx_t_15 = PyNumber_Add(__pyx_t_14, __pyx_kp_s_);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 105, __pyx_L8_except_error)
3055 __Pyx_GOTREF(__pyx_t_15);
3056 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3057 __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)
3058 __Pyx_GOTREF(__pyx_t_14);
3059 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3060 __Pyx_Raise(__pyx_t_14, 0, 0, 0);
3061 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3062 __PYX_ERR(0, 105, __pyx_L8_except_error)
3064 goto __pyx_L8_except_error;
3065 __pyx_L8_except_error:;
3074 __Pyx_XGIVEREF(__pyx_t_8);
3075 __Pyx_XGIVEREF(__pyx_t_9);
3076 __Pyx_XGIVEREF(__pyx_t_10);
3077 __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
3078 goto __pyx_L1_error;
3099 __pyx_t_2 = PyString_Check(__pyx_v_other);
3100 __pyx_t_1 = (__pyx_t_2 != 0);
3101 if (likely(__pyx_t_1)) {
3111 __Pyx_PyThreadState_declare
3112 __Pyx_PyThreadState_assign
3113 __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
3114 __Pyx_XGOTREF(__pyx_t_10);
3115 __Pyx_XGOTREF(__pyx_t_9);
3116 __Pyx_XGOTREF(__pyx_t_8);
3126 __pyx_t_17 = __Pyx_PyObject_AsWritableString(__pyx_v_other);
if (unlikely((!__pyx_t_17) && PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L18_error)
3128 __pyx_t_3 =
new IndexSet(((
char *)__pyx_t_17));
3130 __Pyx_CppExn2PyErr();
3131 __PYX_ERR(0, 108, __pyx_L18_error)
3133 __pyx_v_self->instance = __pyx_t_3;
3143 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3144 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
3145 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3146 goto __pyx_L23_try_end;
3148 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
3149 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
3150 __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
3151 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
3152 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3153 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3162 __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
3164 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3165 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_13) < 0) __PYX_ERR(0, 109, __pyx_L20_except_error)
3166 __Pyx_GOTREF(__pyx_t_5);
3167 __Pyx_GOTREF(__pyx_t_4);
3168 __Pyx_GOTREF(__pyx_t_13);
3177 __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)
3178 __Pyx_GOTREF(__pyx_t_14);
3179 __pyx_t_15 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 110, __pyx_L20_except_error)
3180 __Pyx_GOTREF(__pyx_t_15);
3181 __pyx_t_16 = PyNumber_Add(__pyx_t_14, __pyx_t_15);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 110, __pyx_L20_except_error)
3182 __Pyx_GOTREF(__pyx_t_16);
3183 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3184 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3185 __pyx_t_15 = PyNumber_Add(__pyx_t_16, __pyx_kp_s_);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 110, __pyx_L20_except_error)
3186 __Pyx_GOTREF(__pyx_t_15);
3187 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3188 __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)
3189 __Pyx_GOTREF(__pyx_t_16);
3190 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3191 __Pyx_Raise(__pyx_t_16, 0, 0, 0);
3192 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3193 __PYX_ERR(0, 110, __pyx_L20_except_error)
3195 goto __pyx_L20_except_error;
3196 __pyx_L20_except_error:;
3205 __Pyx_XGIVEREF(__pyx_t_10);
3206 __Pyx_XGIVEREF(__pyx_t_9);
3207 __Pyx_XGIVEREF(__pyx_t_8);
3208 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8);
3209 goto __pyx_L1_error;
3231 __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)
3232 __Pyx_GOTREF(__pyx_t_13);
3233 __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)
3234 __Pyx_GOTREF(__pyx_t_4);
3235 __pyx_t_5 = PyNumber_Add(__pyx_t_13, __pyx_t_4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 112, __pyx_L1_error)
3236 __Pyx_GOTREF(__pyx_t_5);
3237 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
3238 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3239 __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_kp_s_);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 112, __pyx_L1_error)
3240 __Pyx_GOTREF(__pyx_t_4);
3241 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3242 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 112, __pyx_L1_error)
3243 __Pyx_GOTREF(__pyx_t_5);
3244 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3245 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
3246 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3247 __PYX_ERR(0, 112, __pyx_L1_error)
3263 __Pyx_XDECREF(__pyx_t_4);
3264 __Pyx_XDECREF(__pyx_t_5);
3265 __Pyx_XDECREF(__pyx_t_13);
3266 __Pyx_XDECREF(__pyx_t_14);
3267 __Pyx_XDECREF(__pyx_t_15);
3268 __Pyx_XDECREF(__pyx_t_16);
3269 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3272 __Pyx_XDECREF(__pyx_v_error_msg_prefix);
3273 __Pyx_XDECREF(__pyx_v_idx);
3274 __Pyx_RefNannyFinishContext();
3287 static void __pyx_pw_8PyClical_9index_set_5__dealloc__(PyObject *__pyx_v_self);
3288 static void __pyx_pw_8PyClical_9index_set_5__dealloc__(PyObject *__pyx_v_self) {
3289 __Pyx_RefNannyDeclarations
3290 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
3291 __pyx_pf_8PyClical_9index_set_4__dealloc__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
3294 __Pyx_RefNannyFinishContext();
3297 static void __pyx_pf_8PyClical_9index_set_4__dealloc__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
3298 __Pyx_RefNannyDeclarations
3299 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
3308 delete __pyx_v_self->instance;
3319 __Pyx_RefNannyFinishContext();
3331 static PyObject *__pyx_pw_8PyClical_9index_set_7__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op);
3332 static PyObject *__pyx_pw_8PyClical_9index_set_7__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op) {
3333 PyObject *__pyx_r = 0;
3334 __Pyx_RefNannyDeclarations
3335 __Pyx_RefNannySetupContext(
"__richcmp__ (wrapper)", 0);
3336 __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));
3339 __Pyx_RefNannyFinishContext();
3343 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) {
3344 PyObject *__pyx_v_eq = NULL;
3345 PyObject *__pyx_v_lt = NULL;
3346 PyObject *__pyx_r = NULL;
3347 __Pyx_RefNannyDeclarations
3351 PyObject *__pyx_t_4 = NULL;
3352 __Pyx_RefNannySetupContext(
"__richcmp__", 0);
3361 __pyx_t_2 = (((PyObject *)__pyx_v_lhs) == Py_None);
3362 __pyx_t_3 = (__pyx_t_2 != 0);
3365 __pyx_t_1 = __pyx_t_3;
3366 goto __pyx_L4_bool_binop_done;
3368 __pyx_t_3 = (__pyx_v_rhs == Py_None);
3369 __pyx_t_2 = (__pyx_t_3 != 0);
3370 __pyx_t_1 = __pyx_t_2;
3371 __pyx_L4_bool_binop_done:;
3381 __pyx_t_1 = (((PyObject *)__pyx_v_lhs) == __pyx_v_rhs);
3382 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 142, __pyx_L1_error)
3383 __Pyx_GOTREF(__pyx_t_4);
3384 __pyx_v_eq = __pyx_t_4;
3394 switch (__pyx_v_op) {
3404 __Pyx_XDECREF(__pyx_r);
3405 __Pyx_INCREF(__pyx_v_eq);
3406 __pyx_r = __pyx_v_eq;
3434 __Pyx_XDECREF(__pyx_r);
3435 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_eq);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 146, __pyx_L1_error)
3436 __pyx_t_4 = __Pyx_PyBool_FromLong((!__pyx_t_1));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error)
3437 __Pyx_GOTREF(__pyx_t_4);
3438 __pyx_r = __pyx_t_4;
3459 switch (__pyx_v_op) {
3469 __Pyx_XDECREF(__pyx_r);
3470 __Pyx_INCREF(Py_False);
3499 __Pyx_XDECREF(__pyx_r);
3500 __Pyx_INCREF(__pyx_v_eq);
3501 __pyx_r = __pyx_v_eq;
3529 __Pyx_XDECREF(__pyx_r);
3530 __Pyx_INCREF(Py_False);
3559 __Pyx_XDECREF(__pyx_r);
3560 __Pyx_INCREF(__pyx_v_eq);
3561 __pyx_r = __pyx_v_eq;
3581 __Pyx_XDECREF(__pyx_r);
3582 __Pyx_INCREF(__pyx_builtin_NotImplemented);
3583 __pyx_r = __pyx_builtin_NotImplemented;
3607 __pyx_t_1 = (__pyx_f_8PyClical_toIndexSet(((PyObject *)__pyx_v_lhs)) == __pyx_f_8PyClical_toIndexSet(__pyx_v_rhs));
3608 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error)
3609 __Pyx_GOTREF(__pyx_t_4);
3610 __pyx_v_eq = __pyx_t_4;
3620 switch (__pyx_v_op) {
3630 __Pyx_XDECREF(__pyx_r);
3631 __Pyx_INCREF(__pyx_v_eq);
3632 __pyx_r = __pyx_v_eq;
3660 __Pyx_XDECREF(__pyx_r);
3661 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_eq);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 163, __pyx_L1_error)
3662 __pyx_t_4 = __Pyx_PyBool_FromLong((!__pyx_t_1));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error)
3663 __Pyx_GOTREF(__pyx_t_4);
3664 __pyx_r = __pyx_t_4;
3685 __pyx_t_1 = (__pyx_f_8PyClical_toIndexSet(((PyObject *)__pyx_v_lhs)) < __pyx_f_8PyClical_toIndexSet(__pyx_v_rhs));
3686 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error)
3687 __Pyx_GOTREF(__pyx_t_4);
3688 __pyx_v_lt = __pyx_t_4;
3698 switch (__pyx_v_op) {
3708 __Pyx_XDECREF(__pyx_r);
3709 __Pyx_INCREF(__pyx_v_lt);
3710 __pyx_r = __pyx_v_lt;
3738 __Pyx_XDECREF(__pyx_r);
3739 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_lt);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 169, __pyx_L1_error)
3742 __Pyx_INCREF(__pyx_v_lt);
3743 __pyx_t_4 = __pyx_v_lt;
3744 goto __pyx_L6_bool_binop_done;
3746 __Pyx_INCREF(__pyx_v_eq);
3747 __pyx_t_4 = __pyx_v_eq;
3748 __pyx_L6_bool_binop_done:;
3749 __pyx_r = __pyx_t_4;
3778 __Pyx_XDECREF(__pyx_r);
3779 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_lt);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 171, __pyx_L1_error)
3782 __pyx_t_1 = __pyx_t_2;
3783 goto __pyx_L8_bool_binop_done;
3785 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_eq);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 171, __pyx_L1_error)
3786 __pyx_t_1 = __pyx_t_2;
3787 __pyx_L8_bool_binop_done:;
3788 __pyx_t_4 = __Pyx_PyBool_FromLong((!__pyx_t_1));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error)
3789 __Pyx_GOTREF(__pyx_t_4);
3790 __pyx_r = __pyx_t_4;
3819 __Pyx_XDECREF(__pyx_r);
3820 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_lt);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 173, __pyx_L1_error)
3821 __pyx_t_4 = __Pyx_PyBool_FromLong((!__pyx_t_1));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 173, __pyx_L1_error)
3822 __Pyx_GOTREF(__pyx_t_4);
3823 __pyx_r = __pyx_t_4;
3844 __Pyx_XDECREF(__pyx_r);
3845 __Pyx_INCREF(__pyx_builtin_NotImplemented);
3846 __pyx_r = __pyx_builtin_NotImplemented;
3864 __Pyx_XDECREF(__pyx_t_4);
3865 __Pyx_AddTraceback(
"PyClical.index_set.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3868 __Pyx_XDECREF(__pyx_v_eq);
3869 __Pyx_XDECREF(__pyx_v_lt);
3870 __Pyx_XGIVEREF(__pyx_r);
3871 __Pyx_RefNannyFinishContext();
3884 static int __pyx_pw_8PyClical_9index_set_9__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx, PyObject *__pyx_v_val);
3885 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 ";
3886 #if CYTHON_COMPILING_IN_CPYTHON 3887 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_8__setitem__;
3889 static int __pyx_pw_8PyClical_9index_set_9__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx, PyObject *__pyx_v_val) {
3891 __Pyx_RefNannyDeclarations
3892 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
3893 __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));
3896 __Pyx_RefNannyFinishContext();
3900 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) {
3902 __Pyx_RefNannyDeclarations
3905 __Pyx_RefNannySetupContext(
"__setitem__", 0);
3914 __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)
3915 __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)
3917 __pyx_v_self->instance->set(__pyx_t_1, __pyx_t_2);
3919 __Pyx_CppExn2PyErr();
3920 __PYX_ERR(0, 186, __pyx_L1_error)
3943 __Pyx_AddTraceback(
"PyClical.index_set.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3946 __Pyx_RefNannyFinishContext();
3959 static PyObject *__pyx_pw_8PyClical_9index_set_11__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx);
3960 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 ";
3961 #if CYTHON_COMPILING_IN_CPYTHON 3962 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_10__getitem__;
3964 static PyObject *__pyx_pw_8PyClical_9index_set_11__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx) {
3965 PyObject *__pyx_r = 0;
3966 __Pyx_RefNannyDeclarations
3967 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
3968 __pyx_r = __pyx_pf_8PyClical_9index_set_10__getitem__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_idx));
3971 __Pyx_RefNannyFinishContext();
3975 static PyObject *__pyx_pf_8PyClical_9index_set_10__getitem__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_idx) {
3976 PyObject *__pyx_r = NULL;
3977 __Pyx_RefNannyDeclarations
3979 PyObject *__pyx_t_2 = NULL;
3980 __Pyx_RefNannySetupContext(
"__getitem__", 0);
3989 __Pyx_XDECREF(__pyx_r);
3990 __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)
3991 __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)
3992 __Pyx_GOTREF(__pyx_t_2);
3993 __pyx_r = __pyx_t_2;
4007 __Pyx_XDECREF(__pyx_t_2);
4008 __Pyx_AddTraceback(
"PyClical.index_set.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4011 __Pyx_XGIVEREF(__pyx_r);
4012 __Pyx_RefNannyFinishContext();
4025 static int __pyx_pw_8PyClical_9index_set_13__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx);
4026 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 ";
4027 #if CYTHON_COMPILING_IN_CPYTHON 4028 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_12__contains__;
4030 static int __pyx_pw_8PyClical_9index_set_13__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx) {
4032 __Pyx_RefNannyDeclarations
4033 __Pyx_RefNannySetupContext(
"__contains__ (wrapper)", 0);
4034 __pyx_r = __pyx_pf_8PyClical_9index_set_12__contains__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_idx));
4037 __Pyx_RefNannyFinishContext();
4041 static int __pyx_pf_8PyClical_9index_set_12__contains__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_idx) {
4043 __Pyx_RefNannyDeclarations
4045 __Pyx_RefNannySetupContext(
"__contains__", 0);
4054 __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)
4055 __pyx_r = __pyx_v_self->instance->operator[](__pyx_t_1);
4068 __Pyx_AddTraceback(
"PyClical.index_set.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4071 __Pyx_RefNannyFinishContext();
4074 static PyObject *__pyx_gb_8PyClical_9index_set_16generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value);
4085 static PyObject *__pyx_pw_8PyClical_9index_set_15__iter__(PyObject *__pyx_v_self);
4086 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 ";
4087 #if CYTHON_COMPILING_IN_CPYTHON 4088 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_14__iter__;
4090 static PyObject *__pyx_pw_8PyClical_9index_set_15__iter__(PyObject *__pyx_v_self) {
4091 PyObject *__pyx_r = 0;
4092 __Pyx_RefNannyDeclarations
4093 __Pyx_RefNannySetupContext(
"__iter__ (wrapper)", 0);
4094 __pyx_r = __pyx_pf_8PyClical_9index_set_14__iter__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
4097 __Pyx_RefNannyFinishContext();
4101 static PyObject *__pyx_pf_8PyClical_9index_set_14__iter__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
4102 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *__pyx_cur_scope;
4103 PyObject *__pyx_r = NULL;
4104 __Pyx_RefNannyDeclarations
4105 __Pyx_RefNannySetupContext(
"__iter__", 0);
4106 __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);
4107 if (unlikely(!__pyx_cur_scope)) {
4108 __pyx_cur_scope = ((
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)Py_None);
4109 __Pyx_INCREF(Py_None);
4110 __PYX_ERR(0, 227, __pyx_L1_error)
4112 __Pyx_GOTREF(__pyx_cur_scope);
4114 __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
4115 __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
4116 __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
4118 __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)
4119 __Pyx_DECREF(__pyx_cur_scope);
4120 __Pyx_RefNannyFinishContext();
4121 return (PyObject *) gen;
4126 __Pyx_AddTraceback(
"PyClical.index_set.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4128 __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
4129 __Pyx_XGIVEREF(__pyx_r);
4130 __Pyx_RefNannyFinishContext();
4134 static PyObject *__pyx_gb_8PyClical_9index_set_16generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value)
4136 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *__pyx_cur_scope = ((
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)__pyx_generator->closure);
4137 PyObject *__pyx_r = NULL;
4138 PyObject *__pyx_t_1 = NULL;
4139 PyObject *__pyx_t_2 = NULL;
4140 PyObject *__pyx_t_3 = NULL;
4141 PyObject *__pyx_t_4 = NULL;
4142 Py_ssize_t __pyx_t_5;
4143 PyObject *(*__pyx_t_6)(PyObject *);
4146 __Pyx_RefNannyDeclarations
4147 __Pyx_RefNannySetupContext(
"__iter__", 0);
4148 switch (__pyx_generator->resume_label) {
4149 case 0:
goto __pyx_L3_first_run;
4150 case 1:
goto __pyx_L7_resume_from_yield;
4152 __Pyx_RefNannyFinishContext();
4155 __pyx_L3_first_run:;
4156 if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 227, __pyx_L1_error)
4165 __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)
4166 __Pyx_GOTREF(__pyx_t_2);
4168 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
4169 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
4170 if (likely(__pyx_t_3)) {
4171 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
4172 __Pyx_INCREF(__pyx_t_3);
4173 __Pyx_INCREF(
function);
4174 __Pyx_DECREF_SET(__pyx_t_2,
function);
4178 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error)
4179 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4181 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error)
4183 __Pyx_GOTREF(__pyx_t_1);
4184 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4185 __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)
4186 __Pyx_GOTREF(__pyx_t_3);
4188 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4189 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
4190 if (likely(__pyx_t_4)) {
4191 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4192 __Pyx_INCREF(__pyx_t_4);
4193 __Pyx_INCREF(
function);
4194 __Pyx_DECREF_SET(__pyx_t_3,
function);
4198 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error)
4199 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4201 __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error)
4203 __Pyx_GOTREF(__pyx_t_2);
4204 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4205 __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 234, __pyx_L1_error)
4206 __Pyx_GOTREF(__pyx_t_3);
4207 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4208 __pyx_t_2 = PyTuple_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error)
4209 __Pyx_GOTREF(__pyx_t_2);
4210 __Pyx_GIVEREF(__pyx_t_1);
4211 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
4212 __Pyx_GIVEREF(__pyx_t_3);
4213 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
4216 __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)
4217 __Pyx_GOTREF(__pyx_t_3);
4218 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4219 if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
4220 __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
4223 __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error)
4224 __Pyx_GOTREF(__pyx_t_2);
4225 __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext;
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error)
4227 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4229 if (likely(!__pyx_t_6)) {
4230 if (likely(PyList_CheckExact(__pyx_t_2))) {
4231 if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2))
break;
4232 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 4233 __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)
4235 __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)
4236 __Pyx_GOTREF(__pyx_t_3);
4239 if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2))
break;
4240 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 4241 __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)
4243 __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)
4244 __Pyx_GOTREF(__pyx_t_3);
4248 __pyx_t_3 = __pyx_t_6(__pyx_t_2);
4249 if (unlikely(!__pyx_t_3)) {
4250 PyObject* exc_type = PyErr_Occurred();
4252 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
4253 else __PYX_ERR(0, 234, __pyx_L1_error)
4257 __Pyx_GOTREF(__pyx_t_3);
4259 __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_idx);
4260 __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_idx, __pyx_t_3);
4261 __Pyx_GIVEREF(__pyx_t_3);
4271 __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)
4272 __pyx_t_8 = (__pyx_t_7 != 0);
4282 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_idx);
4283 __pyx_r = __pyx_cur_scope->__pyx_v_idx;
4284 __Pyx_XGIVEREF(__pyx_t_2);
4285 __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
4286 __pyx_cur_scope->__pyx_t_1 = __pyx_t_5;
4287 __pyx_cur_scope->__pyx_t_2 = __pyx_t_6;
4288 __Pyx_XGIVEREF(__pyx_r);
4289 __Pyx_RefNannyFinishContext();
4290 __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
4292 __pyx_generator->resume_label = 1;
4294 __pyx_L7_resume_from_yield:;
4295 __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
4296 __pyx_cur_scope->__pyx_t_0 = 0;
4297 __Pyx_XGOTREF(__pyx_t_2);
4298 __pyx_t_5 = __pyx_cur_scope->__pyx_t_1;
4299 __pyx_t_6 = __pyx_cur_scope->__pyx_t_2;
4300 if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 236, __pyx_L1_error)
4319 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4320 CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
4331 PyErr_SetNone(PyExc_StopIteration);
4334 __Pyx_XDECREF(__pyx_t_1);
4335 __Pyx_XDECREF(__pyx_t_2);
4336 __Pyx_XDECREF(__pyx_t_3);
4337 __Pyx_XDECREF(__pyx_t_4);
4338 __Pyx_AddTraceback(
"__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4340 __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
4341 __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
4342 __pyx_generator->resume_label = -1;
4343 __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
4344 __Pyx_RefNannyFinishContext();
4357 static PyObject *__pyx_pw_8PyClical_9index_set_18__invert__(PyObject *__pyx_v_self);
4358 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 ";
4359 #if CYTHON_COMPILING_IN_CPYTHON 4360 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_17__invert__;
4362 static PyObject *__pyx_pw_8PyClical_9index_set_18__invert__(PyObject *__pyx_v_self) {
4363 PyObject *__pyx_r = 0;
4364 __Pyx_RefNannyDeclarations
4365 __Pyx_RefNannySetupContext(
"__invert__ (wrapper)", 0);
4366 __pyx_r = __pyx_pf_8PyClical_9index_set_17__invert__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
4369 __Pyx_RefNannyFinishContext();
4373 static PyObject *__pyx_pf_8PyClical_9index_set_17__invert__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
4374 PyObject *__pyx_r = NULL;
4375 __Pyx_RefNannyDeclarations
4376 PyObject *__pyx_t_1 = NULL;
4377 PyObject *__pyx_t_2 = NULL;
4378 __Pyx_RefNannySetupContext(
"__invert__", 0);
4387 __Pyx_XDECREF(__pyx_r);
4388 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_index_set));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 245, __pyx_L1_error)
4389 __Pyx_GOTREF(__pyx_t_1);
4390 __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)
4391 __Pyx_GOTREF(__pyx_t_2);
4392 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4393 __pyx_r = __pyx_t_2;
4407 __Pyx_XDECREF(__pyx_t_1);
4408 __Pyx_XDECREF(__pyx_t_2);
4409 __Pyx_AddTraceback(
"PyClical.index_set.__invert__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4412 __Pyx_XGIVEREF(__pyx_r);
4413 __Pyx_RefNannyFinishContext();
4426 static PyObject *__pyx_pw_8PyClical_9index_set_20__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
4427 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 ";
4428 #if CYTHON_COMPILING_IN_CPYTHON 4429 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_19__xor__;
4431 static PyObject *__pyx_pw_8PyClical_9index_set_20__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4432 PyObject *__pyx_r = 0;
4433 __Pyx_RefNannyDeclarations
4434 __Pyx_RefNannySetupContext(
"__xor__ (wrapper)", 0);
4435 __pyx_r = __pyx_pf_8PyClical_9index_set_19__xor__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
4438 __Pyx_RefNannyFinishContext();
4442 static PyObject *__pyx_pf_8PyClical_9index_set_19__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4443 PyObject *__pyx_r = NULL;
4444 __Pyx_RefNannyDeclarations
4445 PyObject *__pyx_t_1 = NULL;
4446 PyObject *__pyx_t_2 = NULL;
4447 __Pyx_RefNannySetupContext(
"__xor__", 0);
4456 __Pyx_XDECREF(__pyx_r);
4457 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_index_set));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error)
4458 __Pyx_GOTREF(__pyx_t_1);
4459 __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)
4460 __Pyx_GOTREF(__pyx_t_2);
4461 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4462 __pyx_r = __pyx_t_2;
4476 __Pyx_XDECREF(__pyx_t_1);
4477 __Pyx_XDECREF(__pyx_t_2);
4478 __Pyx_AddTraceback(
"PyClical.index_set.__xor__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4481 __Pyx_XGIVEREF(__pyx_r);
4482 __Pyx_RefNannyFinishContext();
4495 static PyObject *__pyx_pw_8PyClical_9index_set_22__ixor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
4496 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 ";
4497 #if CYTHON_COMPILING_IN_CPYTHON 4498 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_21__ixor__;
4500 static PyObject *__pyx_pw_8PyClical_9index_set_22__ixor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
4501 PyObject *__pyx_r = 0;
4502 __Pyx_RefNannyDeclarations
4503 __Pyx_RefNannySetupContext(
"__ixor__ (wrapper)", 0);
4504 __pyx_r = __pyx_pf_8PyClical_9index_set_21__ixor__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
4507 __Pyx_RefNannyFinishContext();
4511 static PyObject *__pyx_pf_8PyClical_9index_set_21__ixor__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs) {
4512 PyObject *__pyx_r = NULL;
4513 __Pyx_RefNannyDeclarations
4514 PyObject *__pyx_t_1 = NULL;
4515 __Pyx_RefNannySetupContext(
"__ixor__", 0);
4524 __Pyx_XDECREF(__pyx_r);
4525 __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)
4526 __Pyx_GOTREF(__pyx_t_1);
4527 __pyx_r = __pyx_t_1;
4541 __Pyx_XDECREF(__pyx_t_1);
4542 __Pyx_AddTraceback(
"PyClical.index_set.__ixor__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4545 __Pyx_XGIVEREF(__pyx_r);
4546 __Pyx_RefNannyFinishContext();
4559 static PyObject *__pyx_pw_8PyClical_9index_set_24__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
4560 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 ";
4561 #if CYTHON_COMPILING_IN_CPYTHON 4562 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_23__and__;
4564 static PyObject *__pyx_pw_8PyClical_9index_set_24__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4565 PyObject *__pyx_r = 0;
4566 __Pyx_RefNannyDeclarations
4567 __Pyx_RefNannySetupContext(
"__and__ (wrapper)", 0);
4568 __pyx_r = __pyx_pf_8PyClical_9index_set_23__and__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
4571 __Pyx_RefNannyFinishContext();
4575 static PyObject *__pyx_pf_8PyClical_9index_set_23__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4576 PyObject *__pyx_r = NULL;
4577 __Pyx_RefNannyDeclarations
4578 PyObject *__pyx_t_1 = NULL;
4579 PyObject *__pyx_t_2 = NULL;
4580 __Pyx_RefNannySetupContext(
"__and__", 0);
4589 __Pyx_XDECREF(__pyx_r);
4590 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_index_set));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __pyx_L1_error)
4591 __Pyx_GOTREF(__pyx_t_1);
4592 __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)
4593 __Pyx_GOTREF(__pyx_t_2);
4594 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4595 __pyx_r = __pyx_t_2;
4609 __Pyx_XDECREF(__pyx_t_1);
4610 __Pyx_XDECREF(__pyx_t_2);
4611 __Pyx_AddTraceback(
"PyClical.index_set.__and__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4614 __Pyx_XGIVEREF(__pyx_r);
4615 __Pyx_RefNannyFinishContext();
4628 static PyObject *__pyx_pw_8PyClical_9index_set_26__iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
4629 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 ";
4630 #if CYTHON_COMPILING_IN_CPYTHON 4631 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_25__iand__;
4633 static PyObject *__pyx_pw_8PyClical_9index_set_26__iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
4634 PyObject *__pyx_r = 0;
4635 __Pyx_RefNannyDeclarations
4636 __Pyx_RefNannySetupContext(
"__iand__ (wrapper)", 0);
4637 __pyx_r = __pyx_pf_8PyClical_9index_set_25__iand__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
4640 __Pyx_RefNannyFinishContext();
4644 static PyObject *__pyx_pf_8PyClical_9index_set_25__iand__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs) {
4645 PyObject *__pyx_r = NULL;
4646 __Pyx_RefNannyDeclarations
4647 PyObject *__pyx_t_1 = NULL;
4648 __Pyx_RefNannySetupContext(
"__iand__", 0);
4657 __Pyx_XDECREF(__pyx_r);
4658 __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)
4659 __Pyx_GOTREF(__pyx_t_1);
4660 __pyx_r = __pyx_t_1;
4674 __Pyx_XDECREF(__pyx_t_1);
4675 __Pyx_AddTraceback(
"PyClical.index_set.__iand__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4678 __Pyx_XGIVEREF(__pyx_r);
4679 __Pyx_RefNannyFinishContext();
4692 static PyObject *__pyx_pw_8PyClical_9index_set_28__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
4693 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 ";
4694 #if CYTHON_COMPILING_IN_CPYTHON 4695 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_27__or__;
4697 static PyObject *__pyx_pw_8PyClical_9index_set_28__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4698 PyObject *__pyx_r = 0;
4699 __Pyx_RefNannyDeclarations
4700 __Pyx_RefNannySetupContext(
"__or__ (wrapper)", 0);
4701 __pyx_r = __pyx_pf_8PyClical_9index_set_27__or__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
4704 __Pyx_RefNannyFinishContext();
4708 static PyObject *__pyx_pf_8PyClical_9index_set_27__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4709 PyObject *__pyx_r = NULL;
4710 __Pyx_RefNannyDeclarations
4711 PyObject *__pyx_t_1 = NULL;
4712 PyObject *__pyx_t_2 = NULL;
4713 __Pyx_RefNannySetupContext(
"__or__", 0);
4722 __Pyx_XDECREF(__pyx_r);
4723 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_index_set));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error)
4724 __Pyx_GOTREF(__pyx_t_1);
4725 __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)
4726 __Pyx_GOTREF(__pyx_t_2);
4727 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4728 __pyx_r = __pyx_t_2;
4742 __Pyx_XDECREF(__pyx_t_1);
4743 __Pyx_XDECREF(__pyx_t_2);
4744 __Pyx_AddTraceback(
"PyClical.index_set.__or__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4747 __Pyx_XGIVEREF(__pyx_r);
4748 __Pyx_RefNannyFinishContext();
4761 static PyObject *__pyx_pw_8PyClical_9index_set_30__ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
4762 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 ";
4763 #if CYTHON_COMPILING_IN_CPYTHON 4764 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_29__ior__;
4766 static PyObject *__pyx_pw_8PyClical_9index_set_30__ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
4767 PyObject *__pyx_r = 0;
4768 __Pyx_RefNannyDeclarations
4769 __Pyx_RefNannySetupContext(
"__ior__ (wrapper)", 0);
4770 __pyx_r = __pyx_pf_8PyClical_9index_set_29__ior__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
4773 __Pyx_RefNannyFinishContext();
4777 static PyObject *__pyx_pf_8PyClical_9index_set_29__ior__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs) {
4778 PyObject *__pyx_r = NULL;
4779 __Pyx_RefNannyDeclarations
4780 PyObject *__pyx_t_1 = NULL;
4781 __Pyx_RefNannySetupContext(
"__ior__", 0);
4790 __Pyx_XDECREF(__pyx_r);
4791 __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)
4792 __Pyx_GOTREF(__pyx_t_1);
4793 __pyx_r = __pyx_t_1;
4807 __Pyx_XDECREF(__pyx_t_1);
4808 __Pyx_AddTraceback(
"PyClical.index_set.__ior__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4811 __Pyx_XGIVEREF(__pyx_r);
4812 __Pyx_RefNannyFinishContext();
4825 static PyObject *__pyx_pw_8PyClical_9index_set_32count(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4826 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 ";
4827 static PyObject *__pyx_pw_8PyClical_9index_set_32count(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4828 PyObject *__pyx_r = 0;
4829 __Pyx_RefNannyDeclarations
4830 __Pyx_RefNannySetupContext(
"count (wrapper)", 0);
4831 __pyx_r = __pyx_pf_8PyClical_9index_set_31count(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
4834 __Pyx_RefNannyFinishContext();
4838 static PyObject *__pyx_pf_8PyClical_9index_set_31count(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
4839 PyObject *__pyx_r = NULL;
4840 __Pyx_RefNannyDeclarations
4841 PyObject *__pyx_t_1 = NULL;
4842 __Pyx_RefNannySetupContext(
"count", 0);
4851 __Pyx_XDECREF(__pyx_r);
4852 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->instance->count());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error)
4853 __Pyx_GOTREF(__pyx_t_1);
4854 __pyx_r = __pyx_t_1;
4868 __Pyx_XDECREF(__pyx_t_1);
4869 __Pyx_AddTraceback(
"PyClical.index_set.count", __pyx_clineno, __pyx_lineno, __pyx_filename);
4872 __Pyx_XGIVEREF(__pyx_r);
4873 __Pyx_RefNannyFinishContext();
4886 static PyObject *__pyx_pw_8PyClical_9index_set_34count_neg(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4887 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 ";
4888 static PyObject *__pyx_pw_8PyClical_9index_set_34count_neg(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4889 PyObject *__pyx_r = 0;
4890 __Pyx_RefNannyDeclarations
4891 __Pyx_RefNannySetupContext(
"count_neg (wrapper)", 0);
4892 __pyx_r = __pyx_pf_8PyClical_9index_set_33count_neg(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
4895 __Pyx_RefNannyFinishContext();
4899 static PyObject *__pyx_pf_8PyClical_9index_set_33count_neg(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
4900 PyObject *__pyx_r = NULL;
4901 __Pyx_RefNannyDeclarations
4902 PyObject *__pyx_t_1 = NULL;
4903 __Pyx_RefNannySetupContext(
"count_neg", 0);
4912 __Pyx_XDECREF(__pyx_r);
4913 __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)
4914 __Pyx_GOTREF(__pyx_t_1);
4915 __pyx_r = __pyx_t_1;
4929 __Pyx_XDECREF(__pyx_t_1);
4930 __Pyx_AddTraceback(
"PyClical.index_set.count_neg", __pyx_clineno, __pyx_lineno, __pyx_filename);
4933 __Pyx_XGIVEREF(__pyx_r);
4934 __Pyx_RefNannyFinishContext();
4947 static PyObject *__pyx_pw_8PyClical_9index_set_36count_pos(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4948 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 ";
4949 static PyObject *__pyx_pw_8PyClical_9index_set_36count_pos(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4950 PyObject *__pyx_r = 0;
4951 __Pyx_RefNannyDeclarations
4952 __Pyx_RefNannySetupContext(
"count_pos (wrapper)", 0);
4953 __pyx_r = __pyx_pf_8PyClical_9index_set_35count_pos(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
4956 __Pyx_RefNannyFinishContext();
4960 static PyObject *__pyx_pf_8PyClical_9index_set_35count_pos(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
4961 PyObject *__pyx_r = NULL;
4962 __Pyx_RefNannyDeclarations
4963 PyObject *__pyx_t_1 = NULL;
4964 __Pyx_RefNannySetupContext(
"count_pos", 0);
4973 __Pyx_XDECREF(__pyx_r);
4974 __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)
4975 __Pyx_GOTREF(__pyx_t_1);
4976 __pyx_r = __pyx_t_1;
4990 __Pyx_XDECREF(__pyx_t_1);
4991 __Pyx_AddTraceback(
"PyClical.index_set.count_pos", __pyx_clineno, __pyx_lineno, __pyx_filename);
4994 __Pyx_XGIVEREF(__pyx_r);
4995 __Pyx_RefNannyFinishContext();
5008 static PyObject *__pyx_pw_8PyClical_9index_set_38min(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5009 static char __pyx_doc_8PyClical_9index_set_37min[] =
"\n Minimum member.\n\n >>> index_set({-1,1,2}).min()\n -1\n ";
5010 static PyObject *__pyx_pw_8PyClical_9index_set_38min(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5011 PyObject *__pyx_r = 0;
5012 __Pyx_RefNannyDeclarations
5013 __Pyx_RefNannySetupContext(
"min (wrapper)", 0);
5014 __pyx_r = __pyx_pf_8PyClical_9index_set_37min(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5017 __Pyx_RefNannyFinishContext();
5021 static PyObject *__pyx_pf_8PyClical_9index_set_37min(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5022 PyObject *__pyx_r = NULL;
5023 __Pyx_RefNannyDeclarations
5024 PyObject *__pyx_t_1 = NULL;
5025 __Pyx_RefNannySetupContext(
"min", 0);
5034 __Pyx_XDECREF(__pyx_r);
5035 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->instance->min());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 347, __pyx_L1_error)
5036 __Pyx_GOTREF(__pyx_t_1);
5037 __pyx_r = __pyx_t_1;
5051 __Pyx_XDECREF(__pyx_t_1);
5052 __Pyx_AddTraceback(
"PyClical.index_set.min", __pyx_clineno, __pyx_lineno, __pyx_filename);
5055 __Pyx_XGIVEREF(__pyx_r);
5056 __Pyx_RefNannyFinishContext();
5069 static PyObject *__pyx_pw_8PyClical_9index_set_40max(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5070 static char __pyx_doc_8PyClical_9index_set_39max[] =
"\n Maximum member.\n\n >>> index_set({-1,1,2}).max()\n 2\n ";
5071 static PyObject *__pyx_pw_8PyClical_9index_set_40max(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5072 PyObject *__pyx_r = 0;
5073 __Pyx_RefNannyDeclarations
5074 __Pyx_RefNannySetupContext(
"max (wrapper)", 0);
5075 __pyx_r = __pyx_pf_8PyClical_9index_set_39max(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5078 __Pyx_RefNannyFinishContext();
5082 static PyObject *__pyx_pf_8PyClical_9index_set_39max(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5083 PyObject *__pyx_r = NULL;
5084 __Pyx_RefNannyDeclarations
5085 PyObject *__pyx_t_1 = NULL;
5086 __Pyx_RefNannySetupContext(
"max", 0);
5095 __Pyx_XDECREF(__pyx_r);
5096 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->instance->max());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error)
5097 __Pyx_GOTREF(__pyx_t_1);
5098 __pyx_r = __pyx_t_1;
5112 __Pyx_XDECREF(__pyx_t_1);
5113 __Pyx_AddTraceback(
"PyClical.index_set.max", __pyx_clineno, __pyx_lineno, __pyx_filename);
5116 __Pyx_XGIVEREF(__pyx_r);
5117 __Pyx_RefNannyFinishContext();
5130 static PyObject *__pyx_pw_8PyClical_9index_set_42hash_fn(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5131 static char __pyx_doc_8PyClical_9index_set_41hash_fn[] =
"\n Hash function.\n ";
5132 static PyObject *__pyx_pw_8PyClical_9index_set_42hash_fn(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5133 PyObject *__pyx_r = 0;
5134 __Pyx_RefNannyDeclarations
5135 __Pyx_RefNannySetupContext(
"hash_fn (wrapper)", 0);
5136 __pyx_r = __pyx_pf_8PyClical_9index_set_41hash_fn(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5139 __Pyx_RefNannyFinishContext();
5143 static PyObject *__pyx_pf_8PyClical_9index_set_41hash_fn(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5144 PyObject *__pyx_r = NULL;
5145 __Pyx_RefNannyDeclarations
5146 PyObject *__pyx_t_1 = NULL;
5147 __Pyx_RefNannySetupContext(
"hash_fn", 0);
5156 __Pyx_XDECREF(__pyx_r);
5157 __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)
5158 __Pyx_GOTREF(__pyx_t_1);
5159 __pyx_r = __pyx_t_1;
5173 __Pyx_XDECREF(__pyx_t_1);
5174 __Pyx_AddTraceback(
"PyClical.index_set.hash_fn", __pyx_clineno, __pyx_lineno, __pyx_filename);
5177 __Pyx_XGIVEREF(__pyx_r);
5178 __Pyx_RefNannyFinishContext();
5191 static PyObject *__pyx_pw_8PyClical_9index_set_44sign_of_mult(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
5192 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 ";
5193 static PyObject *__pyx_pw_8PyClical_9index_set_44sign_of_mult(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
5194 PyObject *__pyx_r = 0;
5195 __Pyx_RefNannyDeclarations
5196 __Pyx_RefNannySetupContext(
"sign_of_mult (wrapper)", 0);
5197 __pyx_r = __pyx_pf_8PyClical_9index_set_43sign_of_mult(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
5200 __Pyx_RefNannyFinishContext();
5204 static PyObject *__pyx_pf_8PyClical_9index_set_43sign_of_mult(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs) {
5205 PyObject *__pyx_r = NULL;
5206 __Pyx_RefNannyDeclarations
5207 PyObject *__pyx_t_1 = NULL;
5208 __Pyx_RefNannySetupContext(
"sign_of_mult", 0);
5217 __Pyx_XDECREF(__pyx_r);
5218 __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)
5219 __Pyx_GOTREF(__pyx_t_1);
5220 __pyx_r = __pyx_t_1;
5234 __Pyx_XDECREF(__pyx_t_1);
5235 __Pyx_AddTraceback(
"PyClical.index_set.sign_of_mult", __pyx_clineno, __pyx_lineno, __pyx_filename);
5238 __Pyx_XGIVEREF(__pyx_r);
5239 __Pyx_RefNannyFinishContext();
5252 static PyObject *__pyx_pw_8PyClical_9index_set_46sign_of_square(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5253 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 ";
5254 static PyObject *__pyx_pw_8PyClical_9index_set_46sign_of_square(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5255 PyObject *__pyx_r = 0;
5256 __Pyx_RefNannyDeclarations
5257 __Pyx_RefNannySetupContext(
"sign_of_square (wrapper)", 0);
5258 __pyx_r = __pyx_pf_8PyClical_9index_set_45sign_of_square(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5261 __Pyx_RefNannyFinishContext();
5265 static PyObject *__pyx_pf_8PyClical_9index_set_45sign_of_square(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5266 PyObject *__pyx_r = NULL;
5267 __Pyx_RefNannyDeclarations
5268 PyObject *__pyx_t_1 = NULL;
5269 __Pyx_RefNannySetupContext(
"sign_of_square", 0);
5278 __Pyx_XDECREF(__pyx_r);
5279 __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)
5280 __Pyx_GOTREF(__pyx_t_1);
5281 __pyx_r = __pyx_t_1;
5295 __Pyx_XDECREF(__pyx_t_1);
5296 __Pyx_AddTraceback(
"PyClical.index_set.sign_of_square", __pyx_clineno, __pyx_lineno, __pyx_filename);
5299 __Pyx_XGIVEREF(__pyx_r);
5300 __Pyx_RefNannyFinishContext();
5313 static PyObject *__pyx_pw_8PyClical_9index_set_48__repr__(PyObject *__pyx_v_self);
5314 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 ";
5315 #if CYTHON_COMPILING_IN_CPYTHON 5316 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_47__repr__;
5318 static PyObject *__pyx_pw_8PyClical_9index_set_48__repr__(PyObject *__pyx_v_self) {
5319 PyObject *__pyx_r = 0;
5320 __Pyx_RefNannyDeclarations
5321 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
5322 __pyx_r = __pyx_pf_8PyClical_9index_set_47__repr__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5325 __Pyx_RefNannyFinishContext();
5329 static PyObject *__pyx_pf_8PyClical_9index_set_47__repr__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5330 PyObject *__pyx_r = NULL;
5331 __Pyx_RefNannyDeclarations
5332 PyObject *__pyx_t_1 = NULL;
5333 __Pyx_RefNannySetupContext(
"__repr__", 0);
5342 __Pyx_XDECREF(__pyx_r);
5343 __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)
5344 __Pyx_GOTREF(__pyx_t_1);
5345 __pyx_r = __pyx_t_1;
5359 __Pyx_XDECREF(__pyx_t_1);
5360 __Pyx_AddTraceback(
"PyClical.index_set.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5363 __Pyx_XGIVEREF(__pyx_r);
5364 __Pyx_RefNannyFinishContext();
5377 static PyObject *__pyx_pw_8PyClical_9index_set_50__str__(PyObject *__pyx_v_self);
5378 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 ";
5379 #if CYTHON_COMPILING_IN_CPYTHON 5380 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_49__str__;
5382 static PyObject *__pyx_pw_8PyClical_9index_set_50__str__(PyObject *__pyx_v_self) {
5383 PyObject *__pyx_r = 0;
5384 __Pyx_RefNannyDeclarations
5385 __Pyx_RefNannySetupContext(
"__str__ (wrapper)", 0);
5386 __pyx_r = __pyx_pf_8PyClical_9index_set_49__str__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5389 __Pyx_RefNannyFinishContext();
5393 static PyObject *__pyx_pf_8PyClical_9index_set_49__str__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5394 PyObject *__pyx_r = NULL;
5395 __Pyx_RefNannyDeclarations
5396 PyObject *__pyx_t_1 = NULL;
5397 __Pyx_RefNannySetupContext(
"__str__", 0);
5406 __Pyx_XDECREF(__pyx_r);
5407 __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)
5408 __Pyx_GOTREF(__pyx_t_1);
5409 __pyx_r = __pyx_t_1;
5423 __Pyx_XDECREF(__pyx_t_1);
5424 __Pyx_AddTraceback(
"PyClical.index_set.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5427 __Pyx_XGIVEREF(__pyx_r);
5428 __Pyx_RefNannyFinishContext();
5439 static PyObject *__pyx_pw_8PyClical_9index_set_52__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5440 static PyObject *__pyx_pw_8PyClical_9index_set_52__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5441 PyObject *__pyx_r = 0;
5442 __Pyx_RefNannyDeclarations
5443 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
5444 __pyx_r = __pyx_pf_8PyClical_9index_set_51__reduce_cython__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5447 __Pyx_RefNannyFinishContext();
5451 static PyObject *__pyx_pf_8PyClical_9index_set_51__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5452 PyObject *__pyx_r = NULL;
5453 __Pyx_RefNannyDeclarations
5454 PyObject *__pyx_t_1 = NULL;
5455 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
5463 __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)
5464 __Pyx_GOTREF(__pyx_t_1);
5465 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5466 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5467 __PYX_ERR(1, 2, __pyx_L1_error)
5477 __Pyx_XDECREF(__pyx_t_1);
5478 __Pyx_AddTraceback(
"PyClical.index_set.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5480 __Pyx_XGIVEREF(__pyx_r);
5481 __Pyx_RefNannyFinishContext();
5493 static PyObject *__pyx_pw_8PyClical_9index_set_54__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
5494 static PyObject *__pyx_pw_8PyClical_9index_set_54__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
5495 PyObject *__pyx_r = 0;
5496 __Pyx_RefNannyDeclarations
5497 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
5498 __pyx_r = __pyx_pf_8PyClical_9index_set_53__setstate_cython__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
5501 __Pyx_RefNannyFinishContext();
5505 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) {
5506 PyObject *__pyx_r = NULL;
5507 __Pyx_RefNannyDeclarations
5508 PyObject *__pyx_t_1 = NULL;
5509 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
5516 __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)
5517 __Pyx_GOTREF(__pyx_t_1);
5518 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5519 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5520 __PYX_ERR(1, 4, __pyx_L1_error)
5531 __Pyx_XDECREF(__pyx_t_1);
5532 __Pyx_AddTraceback(
"PyClical.index_set.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5534 __Pyx_XGIVEREF(__pyx_r);
5535 __Pyx_RefNannyFinishContext();
5548 static PyObject *__pyx_pw_8PyClical_1index_set_hidden_doctests(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused);
5549 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 ";
5550 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};
5551 static PyObject *__pyx_pw_8PyClical_1index_set_hidden_doctests(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
5552 PyObject *__pyx_r = 0;
5553 __Pyx_RefNannyDeclarations
5554 __Pyx_RefNannySetupContext(
"index_set_hidden_doctests (wrapper)", 0);
5555 __pyx_r = __pyx_pf_8PyClical_index_set_hidden_doctests(__pyx_self);
5558 __Pyx_RefNannyFinishContext();
5562 static PyObject *__pyx_pf_8PyClical_index_set_hidden_doctests(CYTHON_UNUSED PyObject *__pyx_self) {
5563 PyObject *__pyx_r = NULL;
5564 __Pyx_RefNannyDeclarations
5565 __Pyx_RefNannySetupContext(
"index_set_hidden_doctests", 0);
5574 __Pyx_XDECREF(__pyx_r);
5575 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5588 __Pyx_XGIVEREF(__pyx_r);
5589 __Pyx_RefNannyFinishContext();
5601 static PyObject *__pyx_pw_8PyClical_3compare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5602 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_compare(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs, CYTHON_UNUSED
int __pyx_skip_dispatch) {
5603 PyObject *__pyx_r = NULL;
5604 __Pyx_RefNannyDeclarations
5605 PyObject *__pyx_t_1 = NULL;
5606 __Pyx_RefNannySetupContext(
"compare", 0);
5615 __Pyx_XDECREF(__pyx_r);
5616 __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)
5617 __Pyx_GOTREF(__pyx_t_1);
5618 __pyx_r = __pyx_t_1;
5632 __Pyx_XDECREF(__pyx_t_1);
5633 __Pyx_AddTraceback(
"PyClical.compare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5636 __Pyx_XGIVEREF(__pyx_r);
5637 __Pyx_RefNannyFinishContext();
5642 static PyObject *__pyx_pw_8PyClical_3compare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5643 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 ";
5644 static PyObject *__pyx_pw_8PyClical_3compare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5645 PyObject *__pyx_v_lhs = 0;
5646 PyObject *__pyx_v_rhs = 0;
5647 PyObject *__pyx_r = 0;
5648 __Pyx_RefNannyDeclarations
5649 __Pyx_RefNannySetupContext(
"compare (wrapper)", 0);
5651 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lhs,&__pyx_n_s_rhs,0};
5652 PyObject* values[2] = {0,0};
5653 if (unlikely(__pyx_kwds)) {
5655 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5657 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5659 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5662 default:
goto __pyx_L5_argtuple_error;
5664 kw_args = PyDict_Size(__pyx_kwds);
5667 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lhs)) != 0)) kw_args--;
5668 else goto __pyx_L5_argtuple_error;
5671 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rhs)) != 0)) kw_args--;
5673 __Pyx_RaiseArgtupleInvalid(
"compare", 1, 2, 2, 1); __PYX_ERR(0, 490, __pyx_L3_error)
5676 if (unlikely(kw_args > 0)) {
5677 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"compare") < 0)) __PYX_ERR(0, 490, __pyx_L3_error)
5679 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5680 goto __pyx_L5_argtuple_error;
5682 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5683 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5685 __pyx_v_lhs = values[0];
5686 __pyx_v_rhs = values[1];
5688 goto __pyx_L4_argument_unpacking_done;
5689 __pyx_L5_argtuple_error:;
5690 __Pyx_RaiseArgtupleInvalid(
"compare", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 490, __pyx_L3_error)
5692 __Pyx_AddTraceback(
"PyClical.compare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5693 __Pyx_RefNannyFinishContext();
5695 __pyx_L4_argument_unpacking_done:;
5696 __pyx_r = __pyx_pf_8PyClical_2compare(__pyx_self, __pyx_v_lhs, __pyx_v_rhs);
5699 __Pyx_RefNannyFinishContext();
5703 static PyObject *__pyx_pf_8PyClical_2compare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
5704 PyObject *__pyx_r = NULL;
5705 __Pyx_RefNannyDeclarations
5706 PyObject *__pyx_t_1 = NULL;
5707 __Pyx_RefNannySetupContext(
"compare", 0);
5708 __Pyx_XDECREF(__pyx_r);
5709 __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)
5710 __Pyx_GOTREF(__pyx_t_1);
5711 __pyx_r = __pyx_t_1;
5717 __Pyx_XDECREF(__pyx_t_1);
5718 __Pyx_AddTraceback(
"PyClical.compare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5721 __Pyx_XGIVEREF(__pyx_r);
5722 __Pyx_RefNannyFinishContext();
5734 static PyObject *__pyx_pw_8PyClical_5min_neg(PyObject *__pyx_self, PyObject *__pyx_v_obj);
5735 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_min_neg(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
5736 PyObject *__pyx_r = NULL;
5737 __Pyx_RefNannyDeclarations
5738 PyObject *__pyx_t_1 = NULL;
5739 __Pyx_RefNannySetupContext(
"min_neg", 0);
5748 __Pyx_XDECREF(__pyx_r);
5749 __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)
5750 __Pyx_GOTREF(__pyx_t_1);
5751 __pyx_r = __pyx_t_1;
5765 __Pyx_XDECREF(__pyx_t_1);
5766 __Pyx_AddTraceback(
"PyClical.min_neg", __pyx_clineno, __pyx_lineno, __pyx_filename);
5769 __Pyx_XGIVEREF(__pyx_r);
5770 __Pyx_RefNannyFinishContext();
5775 static PyObject *__pyx_pw_8PyClical_5min_neg(PyObject *__pyx_self, PyObject *__pyx_v_obj);
5776 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 ";
5777 static PyObject *__pyx_pw_8PyClical_5min_neg(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
5778 PyObject *__pyx_r = 0;
5779 __Pyx_RefNannyDeclarations
5780 __Pyx_RefNannySetupContext(
"min_neg (wrapper)", 0);
5781 __pyx_r = __pyx_pf_8PyClical_4min_neg(__pyx_self, ((PyObject *)__pyx_v_obj));
5784 __Pyx_RefNannyFinishContext();
5788 static PyObject *__pyx_pf_8PyClical_4min_neg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
5789 PyObject *__pyx_r = NULL;
5790 __Pyx_RefNannyDeclarations
5791 PyObject *__pyx_t_1 = NULL;
5792 __Pyx_RefNannySetupContext(
"min_neg", 0);
5793 __Pyx_XDECREF(__pyx_r);
5794 __pyx_t_1 = __pyx_f_8PyClical_min_neg(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 502, __pyx_L1_error)
5795 __Pyx_GOTREF(__pyx_t_1);
5796 __pyx_r = __pyx_t_1;
5802 __Pyx_XDECREF(__pyx_t_1);
5803 __Pyx_AddTraceback(
"PyClical.min_neg", __pyx_clineno, __pyx_lineno, __pyx_filename);
5806 __Pyx_XGIVEREF(__pyx_r);
5807 __Pyx_RefNannyFinishContext();
5819 static PyObject *__pyx_pw_8PyClical_7max_pos(PyObject *__pyx_self, PyObject *__pyx_v_obj);
5820 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_max_pos(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
5821 PyObject *__pyx_r = NULL;
5822 __Pyx_RefNannyDeclarations
5823 PyObject *__pyx_t_1 = NULL;
5824 __Pyx_RefNannySetupContext(
"max_pos", 0);
5833 __Pyx_XDECREF(__pyx_r);
5834 __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)
5835 __Pyx_GOTREF(__pyx_t_1);
5836 __pyx_r = __pyx_t_1;
5850 __Pyx_XDECREF(__pyx_t_1);
5851 __Pyx_AddTraceback(
"PyClical.max_pos", __pyx_clineno, __pyx_lineno, __pyx_filename);
5854 __Pyx_XGIVEREF(__pyx_r);
5855 __Pyx_RefNannyFinishContext();
5860 static PyObject *__pyx_pw_8PyClical_7max_pos(PyObject *__pyx_self, PyObject *__pyx_v_obj);
5861 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 ";
5862 static PyObject *__pyx_pw_8PyClical_7max_pos(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
5863 PyObject *__pyx_r = 0;
5864 __Pyx_RefNannyDeclarations
5865 __Pyx_RefNannySetupContext(
"max_pos (wrapper)", 0);
5866 __pyx_r = __pyx_pf_8PyClical_6max_pos(__pyx_self, ((PyObject *)__pyx_v_obj));
5869 __Pyx_RefNannyFinishContext();
5873 static PyObject *__pyx_pf_8PyClical_6max_pos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
5874 PyObject *__pyx_r = NULL;
5875 __Pyx_RefNannyDeclarations
5876 PyObject *__pyx_t_1 = NULL;
5877 __Pyx_RefNannySetupContext(
"max_pos", 0);
5878 __Pyx_XDECREF(__pyx_r);
5879 __pyx_t_1 = __pyx_f_8PyClical_max_pos(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 511, __pyx_L1_error)
5880 __Pyx_GOTREF(__pyx_t_1);
5881 __pyx_r = __pyx_t_1;
5887 __Pyx_XDECREF(__pyx_t_1);
5888 __Pyx_AddTraceback(
"PyClical.max_pos", __pyx_clineno, __pyx_lineno, __pyx_filename);
5891 __Pyx_XGIVEREF(__pyx_r);
5892 __Pyx_RefNannyFinishContext();
5904 static CYTHON_INLINE std::vector<scalar_t> __pyx_f_8PyClical_list_to_vector(PyObject *__pyx_v_lst) {
5905 std::vector<scalar_t> __pyx_v_v;
5906 PyObject *__pyx_v_s = NULL;
5907 std::vector<scalar_t> __pyx_r;
5908 __Pyx_RefNannyDeclarations
5909 PyObject *__pyx_t_1 = NULL;
5910 Py_ssize_t __pyx_t_2;
5911 PyObject *(*__pyx_t_3)(PyObject *);
5912 PyObject *__pyx_t_4 = NULL;
5914 __Pyx_RefNannySetupContext(
"list_to_vector", 0);
5923 if (likely(PyList_CheckExact(__pyx_v_lst)) || PyTuple_CheckExact(__pyx_v_lst)) {
5924 __pyx_t_1 = __pyx_v_lst; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
5927 __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_lst);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error)
5928 __Pyx_GOTREF(__pyx_t_1);
5929 __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 525, __pyx_L1_error)
5932 if (likely(!__pyx_t_3)) {
5933 if (likely(PyList_CheckExact(__pyx_t_1))) {
5934 if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1))
break;
5935 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 5936 __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)
5938 __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)
5939 __Pyx_GOTREF(__pyx_t_4);
5942 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1))
break;
5943 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 5944 __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)
5946 __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)
5947 __Pyx_GOTREF(__pyx_t_4);
5951 __pyx_t_4 = __pyx_t_3(__pyx_t_1);
5952 if (unlikely(!__pyx_t_4)) {
5953 PyObject* exc_type = PyErr_Occurred();
5955 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
5956 else __PYX_ERR(0, 525, __pyx_L1_error)
5960 __Pyx_GOTREF(__pyx_t_4);
5962 __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_4);
5972 __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)
5974 __pyx_v_v.push_back(((
scalar_t)__pyx_t_5));
5976 __Pyx_CppExn2PyErr();
5977 __PYX_ERR(0, 526, __pyx_L1_error)
5988 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5997 __pyx_r = __pyx_v_v;
6010 __Pyx_XDECREF(__pyx_t_1);
6011 __Pyx_XDECREF(__pyx_t_4);
6012 __Pyx_WriteUnraisable(
"PyClical.list_to_vector", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6013 __Pyx_pretend_to_initialize(&__pyx_r);
6015 __Pyx_XDECREF(__pyx_v_s);
6016 __Pyx_RefNannyFinishContext();
6028 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_toClifford(PyObject *__pyx_v_obj) {
6030 __Pyx_RefNannyDeclarations
6031 PyObject *__pyx_t_1 = NULL;
6032 __Pyx_RefNannySetupContext(
"toClifford", 0);
6041 __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)
6042 __Pyx_GOTREF(__pyx_t_1);
6043 __pyx_r = (((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_1)->instance[0]);
6044 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6057 __Pyx_XDECREF(__pyx_t_1);
6058 __Pyx_WriteUnraisable(
"PyClical.toClifford", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6059 __Pyx_pretend_to_initialize(&__pyx_r);
6061 __Pyx_RefNannyFinishContext();
6073 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_8clifford_wrap(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self,
Clifford __pyx_v_other) {
6074 PyObject *__pyx_r = NULL;
6075 __Pyx_RefNannyDeclarations
6076 __Pyx_RefNannySetupContext(
"wrap", 0);
6085 (__pyx_v_self->instance[0]) = __pyx_v_other;
6094 __Pyx_XDECREF(__pyx_r);
6095 __Pyx_INCREF(((PyObject *)__pyx_v_self));
6096 __pyx_r = ((PyObject *)__pyx_v_self);
6109 __Pyx_XGIVEREF(__pyx_r);
6110 __Pyx_RefNannyFinishContext();
6122 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_8clifford_unwrap(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
6124 __Pyx_RefNannyDeclarations
6125 __Pyx_RefNannySetupContext(
"unwrap", 0);
6134 __pyx_r = (__pyx_v_self->instance[0]);
6147 __Pyx_RefNannyFinishContext();
6159 static PyObject *__pyx_pw_8PyClical_8clifford_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
6160 static PyObject *__pyx_f_8PyClical_8clifford_copy(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self,
int __pyx_skip_dispatch) {
6161 PyObject *__pyx_r = NULL;
6162 __Pyx_RefNannyDeclarations
6163 PyObject *__pyx_t_1 = NULL;
6164 PyObject *__pyx_t_2 = NULL;
6165 PyObject *__pyx_t_3 = NULL;
6166 PyObject *__pyx_t_4 = NULL;
6167 __Pyx_RefNannySetupContext(
"copy", 0);
6169 if (unlikely(__pyx_skip_dispatch)) ;
6171 else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
6172 __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)
6173 __Pyx_GOTREF(__pyx_t_1);
6174 if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_8PyClical_8clifford_1copy)) {
6175 __Pyx_XDECREF(__pyx_r);
6176 __Pyx_INCREF(__pyx_t_1);
6177 __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
6178 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
6179 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
6180 if (likely(__pyx_t_4)) {
6181 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
6182 __Pyx_INCREF(__pyx_t_4);
6183 __Pyx_INCREF(
function);
6184 __Pyx_DECREF_SET(__pyx_t_3,
function);
6188 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 554, __pyx_L1_error)
6189 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6191 __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 554, __pyx_L1_error)
6193 __Pyx_GOTREF(__pyx_t_2);
6194 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6195 __pyx_r = __pyx_t_2;
6197 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6200 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6210 __Pyx_XDECREF(__pyx_r);
6211 __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)
6212 __Pyx_GOTREF(__pyx_t_1);
6213 __pyx_r = __pyx_t_1;
6227 __Pyx_XDECREF(__pyx_t_1);
6228 __Pyx_XDECREF(__pyx_t_2);
6229 __Pyx_XDECREF(__pyx_t_3);
6230 __Pyx_XDECREF(__pyx_t_4);
6231 __Pyx_AddTraceback(
"PyClical.clifford.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
6234 __Pyx_XGIVEREF(__pyx_r);
6235 __Pyx_RefNannyFinishContext();
6240 static PyObject *__pyx_pw_8PyClical_8clifford_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
6241 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 ";
6242 static PyObject *__pyx_pw_8PyClical_8clifford_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
6243 PyObject *__pyx_r = 0;
6244 __Pyx_RefNannyDeclarations
6245 __Pyx_RefNannySetupContext(
"copy (wrapper)", 0);
6246 __pyx_r = __pyx_pf_8PyClical_8clifford_copy(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
6249 __Pyx_RefNannyFinishContext();
6253 static PyObject *__pyx_pf_8PyClical_8clifford_copy(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
6254 PyObject *__pyx_r = NULL;
6255 __Pyx_RefNannyDeclarations
6256 PyObject *__pyx_t_1 = NULL;
6257 __Pyx_RefNannySetupContext(
"copy", 0);
6258 __Pyx_XDECREF(__pyx_r);
6259 __pyx_t_1 = __pyx_f_8PyClical_8clifford_copy(__pyx_v_self, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 554, __pyx_L1_error)
6260 __Pyx_GOTREF(__pyx_t_1);
6261 __pyx_r = __pyx_t_1;
6267 __Pyx_XDECREF(__pyx_t_1);
6268 __Pyx_AddTraceback(
"PyClical.clifford.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
6271 __Pyx_XGIVEREF(__pyx_r);
6272 __Pyx_RefNannyFinishContext();
6285 static int __pyx_pw_8PyClical_8clifford_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6286 static int __pyx_pw_8PyClical_8clifford_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6287 PyObject *__pyx_v_other = 0;
6288 PyObject *__pyx_v_ixt = 0;
6290 __Pyx_RefNannyDeclarations
6291 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
6293 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_ixt,0};
6294 PyObject* values[2] = {0,0};
6295 values[0] = ((PyObject *)__pyx_int_0);
6296 values[1] = ((PyObject *)Py_None);
6297 if (unlikely(__pyx_kwds)) {
6299 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6301 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6303 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6306 default:
goto __pyx_L5_argtuple_error;
6308 kw_args = PyDict_Size(__pyx_kwds);
6312 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other);
6313 if (value) { values[0] = value; kw_args--; }
6318 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ixt);
6319 if (value) { values[1] = value; kw_args--; }
6322 if (unlikely(kw_args > 0)) {
6323 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(0, 563, __pyx_L3_error)
6326 switch (PyTuple_GET_SIZE(__pyx_args)) {
6327 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6329 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6332 default:
goto __pyx_L5_argtuple_error;
6335 __pyx_v_other = values[0];
6336 __pyx_v_ixt = values[1];
6338 goto __pyx_L4_argument_unpacking_done;
6339 __pyx_L5_argtuple_error:;
6340 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 563, __pyx_L3_error)
6342 __Pyx_AddTraceback(
"PyClical.clifford.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6343 __Pyx_RefNannyFinishContext();
6345 __pyx_L4_argument_unpacking_done:;
6346 __pyx_r = __pyx_pf_8PyClical_8clifford_2__cinit__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), __pyx_v_other, __pyx_v_ixt);
6349 __Pyx_RefNannyFinishContext();
6353 static int __pyx_pf_8PyClical_8clifford_2__cinit__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_ixt) {
6354 PyObject *__pyx_v_error_msg_prefix = NULL;
6355 PyObject *__pyx_v_err = NULL;
6357 __Pyx_RefNannyDeclarations
6360 PyObject *__pyx_t_3 = NULL;
6361 PyObject *__pyx_t_4 = NULL;
6362 PyObject *__pyx_t_5 = NULL;
6364 PyObject *__pyx_t_7 = NULL;
6365 PyObject *__pyx_t_8 = NULL;
6367 PyObject *__pyx_t_10 = NULL;
6368 PyObject *__pyx_t_11 = NULL;
6369 PyObject *__pyx_t_12 = NULL;
6372 PyObject *__pyx_t_15 = NULL;
6373 PyObject *__pyx_t_16 = NULL;
6374 PyObject *__pyx_t_17 = NULL;
6375 PyObject *__pyx_t_18 = NULL;
6376 __Pyx_RefNannySetupContext(
"__cinit__", 0);
6385 __Pyx_INCREF(__pyx_kp_s_Cannot_initialize_clifford_objec);
6386 __pyx_v_error_msg_prefix = __pyx_kp_s_Cannot_initialize_clifford_objec;
6395 __pyx_t_1 = (__pyx_v_ixt == Py_None);
6396 __pyx_t_2 = (__pyx_t_1 != 0);
6407 __Pyx_PyThreadState_declare
6408 __Pyx_PyThreadState_assign
6409 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
6410 __Pyx_XGOTREF(__pyx_t_3);
6411 __Pyx_XGOTREF(__pyx_t_4);
6412 __Pyx_XGOTREF(__pyx_t_5);
6422 __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8PyClical_clifford);
6423 __pyx_t_1 = (__pyx_t_2 != 0);
6434 __pyx_t_6 =
new Clifford(__pyx_f_8PyClical_8clifford_unwrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_other)));
6436 __Pyx_CppExn2PyErr();
6437 __PYX_ERR(0, 592, __pyx_L4_error)
6439 __pyx_v_self->instance = __pyx_t_6;
6458 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8PyClical_index_set);
6459 __pyx_t_2 = (__pyx_t_1 != 0);
6470 __pyx_t_6 =
new Clifford(__pyx_f_8PyClical_9index_set_unwrap(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_other)), ((
scalar_t)1.0));
6472 __Pyx_CppExn2PyErr();
6473 __PYX_ERR(0, 594, __pyx_L4_error)
6475 __pyx_v_self->instance = __pyx_t_6;
6494 __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numbers);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 595, __pyx_L4_error)
6495 __Pyx_GOTREF(__pyx_t_7);
6496 __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)
6497 __Pyx_GOTREF(__pyx_t_8);
6498 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6499 __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)
6500 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6501 __pyx_t_1 = (__pyx_t_2 != 0);
6511 __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)
6515 __Pyx_CppExn2PyErr();
6516 __PYX_ERR(0, 596, __pyx_L4_error)
6518 __pyx_v_self->instance = __pyx_t_6;
6537 __pyx_t_1 = PyString_Check(__pyx_v_other);
6538 __pyx_t_2 = (__pyx_t_1 != 0);
6539 if (likely(__pyx_t_2)) {
6549 __Pyx_PyThreadState_declare
6550 __Pyx_PyThreadState_assign
6551 __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
6552 __Pyx_XGOTREF(__pyx_t_10);
6553 __Pyx_XGOTREF(__pyx_t_11);
6554 __Pyx_XGOTREF(__pyx_t_12);
6564 __pyx_t_13 = __Pyx_PyObject_AsWritableString(__pyx_v_other);
if (unlikely((!__pyx_t_13) && PyErr_Occurred())) __PYX_ERR(0, 599, __pyx_L11_error)
6566 __pyx_t_6 =
new Clifford(((
char *)__pyx_t_13));
6568 __Pyx_CppExn2PyErr();
6569 __PYX_ERR(0, 599, __pyx_L11_error)
6571 __pyx_v_self->instance = __pyx_t_6;
6581 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
6582 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
6583 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
6584 goto __pyx_L16_try_end;
6586 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6587 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
6596 __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
6598 __Pyx_AddTraceback(
"PyClical.clifford.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6599 if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_15) < 0) __PYX_ERR(0, 600, __pyx_L13_except_error)
6600 __Pyx_GOTREF(__pyx_t_8);
6601 __Pyx_GOTREF(__pyx_t_7);
6602 __Pyx_GOTREF(__pyx_t_15);
6611 __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)
6612 __Pyx_GOTREF(__pyx_t_16);
6613 __pyx_t_17 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 601, __pyx_L13_except_error)
6614 __Pyx_GOTREF(__pyx_t_17);
6615 __pyx_t_18 = PyNumber_Add(__pyx_t_16, __pyx_t_17);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 601, __pyx_L13_except_error)
6616 __Pyx_GOTREF(__pyx_t_18);
6617 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6618 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6619 __pyx_t_17 = PyNumber_Add(__pyx_t_18, __pyx_kp_s_);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 601, __pyx_L13_except_error)
6620 __Pyx_GOTREF(__pyx_t_17);
6621 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6622 __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)
6623 __Pyx_GOTREF(__pyx_t_18);
6624 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6625 __Pyx_Raise(__pyx_t_18, 0, 0, 0);
6626 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6627 __PYX_ERR(0, 601, __pyx_L13_except_error)
6629 goto __pyx_L13_except_error;
6630 __pyx_L13_except_error:;
6639 __Pyx_XGIVEREF(__pyx_t_10);
6640 __Pyx_XGIVEREF(__pyx_t_11);
6641 __Pyx_XGIVEREF(__pyx_t_12);
6642 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
6643 goto __pyx_L4_error;
6665 __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)
6666 __Pyx_GOTREF(__pyx_t_15);
6667 __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)
6668 __Pyx_GOTREF(__pyx_t_7);
6669 __pyx_t_8 = PyNumber_Add(__pyx_t_15, __pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 603, __pyx_L4_error)
6670 __Pyx_GOTREF(__pyx_t_8);
6671 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6672 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6673 __pyx_t_7 = PyNumber_Add(__pyx_t_8, __pyx_kp_s_);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 603, __pyx_L4_error)
6674 __Pyx_GOTREF(__pyx_t_7);
6675 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6676 __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 603, __pyx_L4_error)
6677 __Pyx_GOTREF(__pyx_t_8);
6678 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6679 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
6680 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6681 __PYX_ERR(0, 603, __pyx_L4_error)
6693 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6694 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6695 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
6696 goto __pyx_L9_try_end;
6698 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
6699 __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
6700 __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
6701 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
6702 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6703 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
6712 __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
6714 __Pyx_AddTraceback(
"PyClical.clifford.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6715 if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_15) < 0) __PYX_ERR(0, 604, __pyx_L6_except_error)
6716 __Pyx_GOTREF(__pyx_t_8);
6717 __Pyx_GOTREF(__pyx_t_7);
6718 __Pyx_GOTREF(__pyx_t_15);
6719 __Pyx_INCREF(__pyx_t_7);
6720 __pyx_v_err = __pyx_t_7;
6729 __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)
6730 __Pyx_GOTREF(__pyx_t_18);
6731 __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)
6732 __Pyx_GOTREF(__pyx_t_17);
6733 __pyx_t_16 = PyNumber_Add(__pyx_t_18, __pyx_t_17);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 605, __pyx_L6_except_error)
6734 __Pyx_GOTREF(__pyx_t_16);
6735 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6736 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6745 __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)
6746 __Pyx_GOTREF(__pyx_t_17);
6747 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6748 __pyx_t_16 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 606, __pyx_L6_except_error)
6749 __Pyx_GOTREF(__pyx_t_16);
6750 __pyx_t_18 = PyNumber_Add(__pyx_t_17, __pyx_t_16);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 606, __pyx_L6_except_error)
6751 __Pyx_GOTREF(__pyx_t_18);
6752 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6753 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6754 __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)
6755 __Pyx_GOTREF(__pyx_t_16);
6756 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6765 __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)
6766 __Pyx_GOTREF(__pyx_t_18);
6767 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6768 __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)
6769 __Pyx_GOTREF(__pyx_t_16);
6770 __pyx_t_17 = PyNumber_Add(__pyx_t_18, __pyx_t_16);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 607, __pyx_L6_except_error)
6771 __Pyx_GOTREF(__pyx_t_17);
6772 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6773 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6782 __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)
6783 __Pyx_GOTREF(__pyx_t_16);
6784 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6785 __Pyx_Raise(__pyx_t_16, 0, 0, 0);
6786 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6787 __PYX_ERR(0, 605, __pyx_L6_except_error)
6789 goto __pyx_L6_except_error;
6790 __pyx_L6_except_error:;
6799 __Pyx_XGIVEREF(__pyx_t_3);
6800 __Pyx_XGIVEREF(__pyx_t_4);
6801 __Pyx_XGIVEREF(__pyx_t_5);
6802 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
6803 goto __pyx_L1_error;
6824 __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_ixt, __pyx_ptype_8PyClical_index_set);
6825 __pyx_t_1 = (__pyx_t_2 != 0);
6826 if (likely(__pyx_t_1)) {
6835 __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_numbers);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 609, __pyx_L1_error)
6836 __Pyx_GOTREF(__pyx_t_15);
6837 __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)
6838 __Pyx_GOTREF(__pyx_t_7);
6839 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6840 __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)
6841 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6842 __pyx_t_2 = (__pyx_t_1 != 0);
6852 __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)
6854 __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));
6856 __Pyx_CppExn2PyErr();
6857 __PYX_ERR(0, 610, __pyx_L1_error)
6859 __pyx_v_self->instance = __pyx_t_6;
6878 __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_collections);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 611, __pyx_L1_error)
6879 __Pyx_GOTREF(__pyx_t_7);
6880 __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)
6881 __Pyx_GOTREF(__pyx_t_15);
6882 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6883 __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)
6884 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6885 __pyx_t_1 = (__pyx_t_2 != 0);
6886 if (likely(__pyx_t_1)) {
6896 __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)));
6898 __Pyx_CppExn2PyErr();
6899 __PYX_ERR(0, 612, __pyx_L1_error)
6901 __pyx_v_self->instance = __pyx_t_6;
6921 __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)
6922 __Pyx_GOTREF(__pyx_t_15);
6923 __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)
6924 __Pyx_GOTREF(__pyx_t_7);
6925 __pyx_t_8 = PyNumber_Add(__pyx_t_15, __pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 614, __pyx_L1_error)
6926 __Pyx_GOTREF(__pyx_t_8);
6927 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6928 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6937 __pyx_t_7 = PyNumber_Add(__pyx_t_8, __pyx_kp_s__8);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 615, __pyx_L1_error)
6938 __Pyx_GOTREF(__pyx_t_7);
6939 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6940 __pyx_t_8 = PyObject_Repr(__pyx_v_ixt);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 615, __pyx_L1_error)
6941 __Pyx_GOTREF(__pyx_t_8);
6942 __pyx_t_15 = PyNumber_Add(__pyx_t_7, __pyx_t_8);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 615, __pyx_L1_error)
6943 __Pyx_GOTREF(__pyx_t_15);
6944 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6945 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6946 __pyx_t_8 = PyNumber_Add(__pyx_t_15, __pyx_kp_s__9);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 615, __pyx_L1_error)
6947 __Pyx_GOTREF(__pyx_t_8);
6948 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6957 __pyx_t_15 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_8);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 614, __pyx_L1_error)
6958 __Pyx_GOTREF(__pyx_t_15);
6959 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6960 __Pyx_Raise(__pyx_t_15, 0, 0, 0);
6961 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6962 __PYX_ERR(0, 614, __pyx_L1_error)
6984 __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)
6985 __Pyx_GOTREF(__pyx_t_15);
6986 __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)
6987 __Pyx_GOTREF(__pyx_t_8);
6988 __pyx_t_7 = PyNumber_Add(__pyx_t_15, __pyx_t_8);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 617, __pyx_L1_error)
6989 __Pyx_GOTREF(__pyx_t_7);
6990 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6991 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7000 __pyx_t_8 = PyNumber_Add(__pyx_t_7, __pyx_kp_s__8);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 618, __pyx_L1_error)
7001 __Pyx_GOTREF(__pyx_t_8);
7002 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7003 __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)
7004 __Pyx_GOTREF(__pyx_t_7);
7005 __pyx_t_15 = PyNumber_Add(__pyx_t_8, __pyx_t_7);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 618, __pyx_L1_error)
7006 __Pyx_GOTREF(__pyx_t_15);
7007 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7008 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7009 __pyx_t_7 = PyNumber_Add(__pyx_t_15, __pyx_kp_s__9);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 618, __pyx_L1_error)
7010 __Pyx_GOTREF(__pyx_t_7);
7011 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7020 __pyx_t_15 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 617, __pyx_L1_error)
7021 __Pyx_GOTREF(__pyx_t_15);
7022 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7023 __Pyx_Raise(__pyx_t_15, 0, 0, 0);
7024 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7025 __PYX_ERR(0, 617, __pyx_L1_error)
7041 __Pyx_XDECREF(__pyx_t_7);
7042 __Pyx_XDECREF(__pyx_t_8);
7043 __Pyx_XDECREF(__pyx_t_15);
7044 __Pyx_XDECREF(__pyx_t_16);
7045 __Pyx_XDECREF(__pyx_t_17);
7046 __Pyx_XDECREF(__pyx_t_18);
7047 __Pyx_AddTraceback(
"PyClical.clifford.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7050 __Pyx_XDECREF(__pyx_v_error_msg_prefix);
7051 __Pyx_XDECREF(__pyx_v_err);
7052 __Pyx_RefNannyFinishContext();
7065 static void __pyx_pw_8PyClical_8clifford_5__dealloc__(PyObject *__pyx_v_self);
7066 static void __pyx_pw_8PyClical_8clifford_5__dealloc__(PyObject *__pyx_v_self) {
7067 __Pyx_RefNannyDeclarations
7068 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
7069 __pyx_pf_8PyClical_8clifford_4__dealloc__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
7072 __Pyx_RefNannyFinishContext();
7075 static void __pyx_pf_8PyClical_8clifford_4__dealloc__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
7076 __Pyx_RefNannyDeclarations
7077 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
7086 delete __pyx_v_self->instance;
7097 __Pyx_RefNannyFinishContext();
7109 static int __pyx_pw_8PyClical_8clifford_7__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_x);
7110 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 ";
7111 #if CYTHON_COMPILING_IN_CPYTHON 7112 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_6__contains__;
7114 static int __pyx_pw_8PyClical_8clifford_7__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_x) {
7116 __Pyx_RefNannyDeclarations
7117 __Pyx_RefNannySetupContext(
"__contains__ (wrapper)", 0);
7118 __pyx_r = __pyx_pf_8PyClical_8clifford_6__contains__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_x));
7121 __Pyx_RefNannyFinishContext();
7125 static int __pyx_pf_8PyClical_8clifford_6__contains__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_x) {
7127 __Pyx_RefNannyDeclarations
7128 PyObject *__pyx_t_1 = NULL;
7129 __Pyx_RefNannySetupContext(
"__contains__", 0);
7138 __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)
7139 __Pyx_GOTREF(__pyx_t_1);
7140 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
7141 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7142 __PYX_ERR(0, 635, __pyx_L1_error)
7154 __Pyx_XDECREF(__pyx_t_1);
7155 __Pyx_AddTraceback(
"PyClical.clifford.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7157 __Pyx_RefNannyFinishContext();
7170 static PyObject *__pyx_pw_8PyClical_8clifford_9__iter__(PyObject *__pyx_v_self);
7171 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 ";
7172 #if CYTHON_COMPILING_IN_CPYTHON 7173 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_8__iter__;
7175 static PyObject *__pyx_pw_8PyClical_8clifford_9__iter__(PyObject *__pyx_v_self) {
7176 PyObject *__pyx_r = 0;
7177 __Pyx_RefNannyDeclarations
7178 __Pyx_RefNannySetupContext(
"__iter__ (wrapper)", 0);
7179 __pyx_r = __pyx_pf_8PyClical_8clifford_8__iter__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
7182 __Pyx_RefNannyFinishContext();
7186 static PyObject *__pyx_pf_8PyClical_8clifford_8__iter__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
7187 PyObject *__pyx_r = NULL;
7188 __Pyx_RefNannyDeclarations
7189 PyObject *__pyx_t_1 = NULL;
7190 __Pyx_RefNannySetupContext(
"__iter__", 0);
7199 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 646, __pyx_L1_error)
7200 __Pyx_GOTREF(__pyx_t_1);
7201 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
7202 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7203 __PYX_ERR(0, 646, __pyx_L1_error)
7215 __Pyx_XDECREF(__pyx_t_1);
7216 __Pyx_AddTraceback(
"PyClical.clifford.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7218 __Pyx_XGIVEREF(__pyx_r);
7219 __Pyx_RefNannyFinishContext();
7232 static PyObject *__pyx_pw_8PyClical_8clifford_11reframe(PyObject *__pyx_v_self, PyObject *__pyx_v_ixt);
7233 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 ";
7234 static PyObject *__pyx_pw_8PyClical_8clifford_11reframe(PyObject *__pyx_v_self, PyObject *__pyx_v_ixt) {
7235 PyObject *__pyx_r = 0;
7236 __Pyx_RefNannyDeclarations
7237 __Pyx_RefNannySetupContext(
"reframe (wrapper)", 0);
7238 __pyx_r = __pyx_pf_8PyClical_8clifford_10reframe(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_ixt));
7241 __Pyx_RefNannyFinishContext();
7245 static PyObject *__pyx_pf_8PyClical_8clifford_10reframe(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_ixt) {
7246 PyObject *__pyx_v_error_msg_prefix = NULL;
7247 struct __pyx_obj_8PyClical_clifford *__pyx_v_result = NULL;
7248 PyObject *__pyx_v_err = NULL;
7249 PyObject *__pyx_r = NULL;
7250 __Pyx_RefNannyDeclarations
7253 PyObject *__pyx_t_3 = NULL;
7254 PyObject *__pyx_t_4 = NULL;
7255 PyObject *__pyx_t_5 = NULL;
7256 PyObject *__pyx_t_6 = NULL;
7259 PyObject *__pyx_t_9 = NULL;
7260 PyObject *__pyx_t_10 = NULL;
7261 PyObject *__pyx_t_11 = NULL;
7262 PyObject *__pyx_t_12 = NULL;
7263 PyObject *__pyx_t_13 = NULL;
7264 __Pyx_RefNannySetupContext(
"reframe", 0);
7273 __Pyx_INCREF(__pyx_kp_s_Cannot_reframe);
7274 __pyx_v_error_msg_prefix = __pyx_kp_s_Cannot_reframe;
7283 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_ixt, __pyx_ptype_8PyClical_index_set);
7284 __pyx_t_2 = (__pyx_t_1 != 0);
7285 if (likely(__pyx_t_2)) {
7295 __Pyx_PyThreadState_declare
7296 __Pyx_PyThreadState_assign
7297 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
7298 __Pyx_XGOTREF(__pyx_t_3);
7299 __Pyx_XGOTREF(__pyx_t_4);
7300 __Pyx_XGOTREF(__pyx_t_5);
7310 __pyx_t_6 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 661, __pyx_L4_error)
7311 __Pyx_GOTREF(__pyx_t_6);
7312 __pyx_v_result = ((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_6);
7323 __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)));
7325 __Pyx_CppExn2PyErr();
7326 __PYX_ERR(0, 662, __pyx_L4_error)
7328 __pyx_v_result->instance = __pyx_t_7;
7338 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7339 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7340 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
7341 goto __pyx_L9_try_end;
7343 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
7352 __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
7354 __Pyx_AddTraceback(
"PyClical.clifford.reframe", __pyx_clineno, __pyx_lineno, __pyx_filename);
7355 if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 663, __pyx_L6_except_error)
7356 __Pyx_GOTREF(__pyx_t_6);
7357 __Pyx_GOTREF(__pyx_t_9);
7358 __Pyx_GOTREF(__pyx_t_10);
7359 __Pyx_INCREF(__pyx_t_9);
7360 __pyx_v_err = __pyx_t_9;
7369 __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)
7370 __Pyx_GOTREF(__pyx_t_11);
7371 __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)
7372 __Pyx_GOTREF(__pyx_t_12);
7373 __pyx_t_13 = PyNumber_Add(__pyx_t_11, __pyx_t_12);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 664, __pyx_L6_except_error)
7374 __Pyx_GOTREF(__pyx_t_13);
7375 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7376 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7377 __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)
7378 __Pyx_GOTREF(__pyx_t_12);
7379 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7388 __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)
7389 __Pyx_GOTREF(__pyx_t_13);
7390 __pyx_t_11 = PyNumber_Add(__pyx_t_12, __pyx_t_13);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 665, __pyx_L6_except_error)
7391 __Pyx_GOTREF(__pyx_t_11);
7392 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7393 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7394 __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)
7395 __Pyx_GOTREF(__pyx_t_13);
7396 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7405 __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)
7406 __Pyx_GOTREF(__pyx_t_11);
7407 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7408 __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)
7409 __Pyx_GOTREF(__pyx_t_13);
7410 __pyx_t_12 = PyNumber_Add(__pyx_t_11, __pyx_t_13);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 666, __pyx_L6_except_error)
7411 __Pyx_GOTREF(__pyx_t_12);
7412 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7413 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7422 __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)
7423 __Pyx_GOTREF(__pyx_t_13);
7424 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7425 __Pyx_Raise(__pyx_t_13, 0, 0, 0);
7426 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7427 __PYX_ERR(0, 664, __pyx_L6_except_error)
7429 goto __pyx_L6_except_error;
7430 __pyx_L6_except_error:;
7439 __Pyx_XGIVEREF(__pyx_t_3);
7440 __Pyx_XGIVEREF(__pyx_t_4);
7441 __Pyx_XGIVEREF(__pyx_t_5);
7442 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
7443 goto __pyx_L1_error;
7465 __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)
7466 __Pyx_GOTREF(__pyx_t_10);
7467 __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)
7468 __Pyx_GOTREF(__pyx_t_9);
7469 __pyx_t_6 = PyNumber_Add(__pyx_t_10, __pyx_t_9);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 668, __pyx_L1_error)
7470 __Pyx_GOTREF(__pyx_t_6);
7471 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7472 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7473 __pyx_t_9 = PyNumber_Add(__pyx_t_6, __pyx_kp_s__9);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 668, __pyx_L1_error)
7474 __Pyx_GOTREF(__pyx_t_9);
7475 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7476 __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_9);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 668, __pyx_L1_error)
7477 __Pyx_GOTREF(__pyx_t_6);
7478 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7479 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
7480 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7481 __PYX_ERR(0, 668, __pyx_L1_error)
7492 __Pyx_XDECREF(__pyx_r);
7493 __Pyx_INCREF(((PyObject *)__pyx_v_result));
7494 __pyx_r = ((PyObject *)__pyx_v_result);
7507 __Pyx_XDECREF(__pyx_t_6);
7508 __Pyx_XDECREF(__pyx_t_9);
7509 __Pyx_XDECREF(__pyx_t_10);
7510 __Pyx_XDECREF(__pyx_t_11);
7511 __Pyx_XDECREF(__pyx_t_12);
7512 __Pyx_XDECREF(__pyx_t_13);
7513 __Pyx_AddTraceback(
"PyClical.clifford.reframe", __pyx_clineno, __pyx_lineno, __pyx_filename);
7516 __Pyx_XDECREF(__pyx_v_error_msg_prefix);
7517 __Pyx_XDECREF((PyObject *)__pyx_v_result);
7518 __Pyx_XDECREF(__pyx_v_err);
7519 __Pyx_XGIVEREF(__pyx_r);
7520 __Pyx_RefNannyFinishContext();
7533 static PyObject *__pyx_pw_8PyClical_8clifford_13__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op);
7534 static PyObject *__pyx_pw_8PyClical_8clifford_13__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op) {
7535 PyObject *__pyx_r = 0;
7536 __Pyx_RefNannyDeclarations
7537 __Pyx_RefNannySetupContext(
"__richcmp__ (wrapper)", 0);
7538 __pyx_r = __pyx_pf_8PyClical_8clifford_12__richcmp__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs), ((
int)__pyx_v_op));
7541 __Pyx_RefNannyFinishContext();
7545 static PyObject *__pyx_pf_8PyClical_8clifford_12__richcmp__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op) {
7546 PyObject *__pyx_r = NULL;
7547 __Pyx_RefNannyDeclarations
7551 PyObject *__pyx_t_4 = NULL;
7552 PyObject *__pyx_t_5 = NULL;
7553 PyObject *__pyx_t_6 = NULL;
7554 __Pyx_RefNannySetupContext(
"__richcmp__", 0);
7563 __pyx_t_1 = ((__pyx_v_op == 2) != 0);
7573 __pyx_t_2 = (((PyObject *)__pyx_v_lhs) == Py_None);
7574 __pyx_t_3 = (__pyx_t_2 != 0);
7577 __pyx_t_1 = __pyx_t_3;
7578 goto __pyx_L5_bool_binop_done;
7580 __pyx_t_3 = (__pyx_v_rhs == Py_None);
7581 __pyx_t_2 = (__pyx_t_3 != 0);
7582 __pyx_t_1 = __pyx_t_2;
7583 __pyx_L5_bool_binop_done:;
7593 __Pyx_XDECREF(__pyx_r);
7594 __pyx_t_1 = (((PyObject *)__pyx_v_lhs) == __pyx_v_rhs);
7595 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error)
7596 __Pyx_GOTREF(__pyx_t_4);
7597 __pyx_r = __pyx_t_4;
7618 __Pyx_XDECREF(__pyx_r);
7619 __pyx_t_1 = (__pyx_f_8PyClical_toClifford(((PyObject *)__pyx_v_lhs)) == __pyx_f_8PyClical_toClifford(__pyx_v_rhs));
7620 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 694, __pyx_L1_error)
7621 __Pyx_GOTREF(__pyx_t_4);
7622 __pyx_r = __pyx_t_4;
7643 __pyx_t_1 = ((__pyx_v_op == 3) != 0);
7653 __pyx_t_2 = (((PyObject *)__pyx_v_lhs) == Py_None);
7654 __pyx_t_3 = (__pyx_t_2 != 0);
7657 __pyx_t_1 = __pyx_t_3;
7658 goto __pyx_L8_bool_binop_done;
7660 __pyx_t_3 = (__pyx_v_rhs == Py_None);
7661 __pyx_t_2 = (__pyx_t_3 != 0);
7662 __pyx_t_1 = __pyx_t_2;
7663 __pyx_L8_bool_binop_done:;
7673 __Pyx_XDECREF(__pyx_r);
7674 __pyx_t_1 = (((PyObject *)__pyx_v_lhs) == __pyx_v_rhs);
7675 __pyx_t_4 = __Pyx_PyBool_FromLong((!((!(!__pyx_t_1)) != 0)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 697, __pyx_L1_error)
7676 __Pyx_GOTREF(__pyx_t_4);
7677 __pyx_r = __pyx_t_4;
7698 __Pyx_XDECREF(__pyx_r);
7699 __pyx_t_1 = (__pyx_f_8PyClical_toClifford(((PyObject *)__pyx_v_lhs)) != __pyx_f_8PyClical_toClifford(__pyx_v_rhs));
7700 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 699, __pyx_L1_error)
7701 __Pyx_GOTREF(__pyx_t_4);
7702 __pyx_r = __pyx_t_4;
7723 __pyx_t_2 = __Pyx_TypeCheck(((PyObject *)__pyx_v_lhs), __pyx_ptype_8PyClical_clifford);
7724 __pyx_t_3 = (__pyx_t_2 != 0);
7727 __pyx_t_1 = __pyx_t_3;
7728 goto __pyx_L10_bool_binop_done;
7730 __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_rhs, __pyx_ptype_8PyClical_clifford);
7731 __pyx_t_2 = (__pyx_t_3 != 0);
7732 __pyx_t_1 = __pyx_t_2;
7733 __pyx_L10_bool_binop_done:;
7734 if (unlikely(__pyx_t_1)) {
7743 __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)
7744 __Pyx_GOTREF(__pyx_t_4);
7745 __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)
7746 __Pyx_GOTREF(__pyx_t_5);
7747 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7748 __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_kp_s__8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 702, __pyx_L1_error)
7749 __Pyx_GOTREF(__pyx_t_4);
7750 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7751 __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)
7752 __Pyx_GOTREF(__pyx_t_5);
7753 __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_t_5);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 702, __pyx_L1_error)
7754 __Pyx_GOTREF(__pyx_t_6);
7755 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7756 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7757 __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_kp_s_);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 702, __pyx_L1_error)
7758 __Pyx_GOTREF(__pyx_t_5);
7759 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7768 __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_5);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 701, __pyx_L1_error)
7769 __Pyx_GOTREF(__pyx_t_6);
7770 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7771 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
7772 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7773 __PYX_ERR(0, 701, __pyx_L1_error)
7792 __Pyx_XDECREF(__pyx_r);
7793 __Pyx_INCREF(__pyx_builtin_NotImplemented);
7794 __pyx_r = __pyx_builtin_NotImplemented;
7808 __Pyx_XDECREF(__pyx_t_4);
7809 __Pyx_XDECREF(__pyx_t_5);
7810 __Pyx_XDECREF(__pyx_t_6);
7811 __Pyx_AddTraceback(
"PyClical.clifford.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7814 __Pyx_XGIVEREF(__pyx_r);
7815 __Pyx_RefNannyFinishContext();
7828 static PyObject *__pyx_pw_8PyClical_8clifford_15__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ixt);
7829 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 ";
7830 #if CYTHON_COMPILING_IN_CPYTHON 7831 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_14__getitem__;
7833 static PyObject *__pyx_pw_8PyClical_8clifford_15__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ixt) {
7834 PyObject *__pyx_r = 0;
7835 __Pyx_RefNannyDeclarations
7836 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
7837 __pyx_r = __pyx_pf_8PyClical_8clifford_14__getitem__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_ixt));
7840 __Pyx_RefNannyFinishContext();
7844 static PyObject *__pyx_pf_8PyClical_8clifford_14__getitem__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_ixt) {
7845 PyObject *__pyx_r = NULL;
7846 __Pyx_RefNannyDeclarations
7847 PyObject *__pyx_t_1 = NULL;
7848 __Pyx_RefNannySetupContext(
"__getitem__", 0);
7857 __Pyx_XDECREF(__pyx_r);
7858 __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)
7859 __Pyx_GOTREF(__pyx_t_1);
7860 __pyx_r = __pyx_t_1;
7874 __Pyx_XDECREF(__pyx_t_1);
7875 __Pyx_AddTraceback(
"PyClical.clifford.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7878 __Pyx_XGIVEREF(__pyx_r);
7879 __Pyx_RefNannyFinishContext();
7892 static PyObject *__pyx_pw_8PyClical_8clifford_17__neg__(PyObject *__pyx_v_self);
7893 static char __pyx_doc_8PyClical_8clifford_16__neg__[] =
"\n Unary -.\n\n >>> print -clifford(\"{1}\")\n -{1}\n ";
7894 #if CYTHON_COMPILING_IN_CPYTHON 7895 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_16__neg__;
7897 static PyObject *__pyx_pw_8PyClical_8clifford_17__neg__(PyObject *__pyx_v_self) {
7898 PyObject *__pyx_r = 0;
7899 __Pyx_RefNannyDeclarations
7900 __Pyx_RefNannySetupContext(
"__neg__ (wrapper)", 0);
7901 __pyx_r = __pyx_pf_8PyClical_8clifford_16__neg__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
7904 __Pyx_RefNannyFinishContext();
7908 static PyObject *__pyx_pf_8PyClical_8clifford_16__neg__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
7909 PyObject *__pyx_r = NULL;
7910 __Pyx_RefNannyDeclarations
7911 PyObject *__pyx_t_1 = NULL;
7912 PyObject *__pyx_t_2 = NULL;
7913 __Pyx_RefNannySetupContext(
"__neg__", 0);
7922 __Pyx_XDECREF(__pyx_r);
7923 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 728, __pyx_L1_error)
7924 __Pyx_GOTREF(__pyx_t_1);
7925 __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)
7926 __Pyx_GOTREF(__pyx_t_2);
7927 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7928 __pyx_r = __pyx_t_2;
7942 __Pyx_XDECREF(__pyx_t_1);
7943 __Pyx_XDECREF(__pyx_t_2);
7944 __Pyx_AddTraceback(
"PyClical.clifford.__neg__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7947 __Pyx_XGIVEREF(__pyx_r);
7948 __Pyx_RefNannyFinishContext();
7961 static PyObject *__pyx_pw_8PyClical_8clifford_19__pos__(PyObject *__pyx_v_self);
7962 static char __pyx_doc_8PyClical_8clifford_18__pos__[] =
"\n Unary +.\n\n >>> print +clifford(\"{1}\")\n {1}\n ";
7963 #if CYTHON_COMPILING_IN_CPYTHON 7964 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_18__pos__;
7966 static PyObject *__pyx_pw_8PyClical_8clifford_19__pos__(PyObject *__pyx_v_self) {
7967 PyObject *__pyx_r = 0;
7968 __Pyx_RefNannyDeclarations
7969 __Pyx_RefNannySetupContext(
"__pos__ (wrapper)", 0);
7970 __pyx_r = __pyx_pf_8PyClical_8clifford_18__pos__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
7973 __Pyx_RefNannyFinishContext();
7977 static PyObject *__pyx_pf_8PyClical_8clifford_18__pos__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
7978 PyObject *__pyx_r = NULL;
7979 __Pyx_RefNannyDeclarations
7980 PyObject *__pyx_t_1 = NULL;
7981 __Pyx_RefNannySetupContext(
"__pos__", 0);
7990 __Pyx_XDECREF(__pyx_r);
7991 __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)
7992 __Pyx_GOTREF(__pyx_t_1);
7993 __pyx_r = __pyx_t_1;
8007 __Pyx_XDECREF(__pyx_t_1);
8008 __Pyx_AddTraceback(
"PyClical.clifford.__pos__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8011 __Pyx_XGIVEREF(__pyx_r);
8012 __Pyx_RefNannyFinishContext();
8025 static PyObject *__pyx_pw_8PyClical_8clifford_21__add__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8026 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 ";
8027 #if CYTHON_COMPILING_IN_CPYTHON 8028 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_20__add__;
8030 static PyObject *__pyx_pw_8PyClical_8clifford_21__add__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8031 PyObject *__pyx_r = 0;
8032 __Pyx_RefNannyDeclarations
8033 __Pyx_RefNannySetupContext(
"__add__ (wrapper)", 0);
8034 __pyx_r = __pyx_pf_8PyClical_8clifford_20__add__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8037 __Pyx_RefNannyFinishContext();
8041 static PyObject *__pyx_pf_8PyClical_8clifford_20__add__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8042 PyObject *__pyx_r = NULL;
8043 __Pyx_RefNannyDeclarations
8044 PyObject *__pyx_t_1 = NULL;
8045 PyObject *__pyx_t_2 = NULL;
8046 __Pyx_RefNannySetupContext(
"__add__", 0);
8055 __Pyx_XDECREF(__pyx_r);
8056 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 748, __pyx_L1_error)
8057 __Pyx_GOTREF(__pyx_t_1);
8058 __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)
8059 __Pyx_GOTREF(__pyx_t_2);
8060 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8061 __pyx_r = __pyx_t_2;
8075 __Pyx_XDECREF(__pyx_t_1);
8076 __Pyx_XDECREF(__pyx_t_2);
8077 __Pyx_AddTraceback(
"PyClical.clifford.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8080 __Pyx_XGIVEREF(__pyx_r);
8081 __Pyx_RefNannyFinishContext();
8094 static PyObject *__pyx_pw_8PyClical_8clifford_23__iadd__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8095 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 ";
8096 #if CYTHON_COMPILING_IN_CPYTHON 8097 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_22__iadd__;
8099 static PyObject *__pyx_pw_8PyClical_8clifford_23__iadd__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8100 PyObject *__pyx_r = 0;
8101 __Pyx_RefNannyDeclarations
8102 __Pyx_RefNannySetupContext(
"__iadd__ (wrapper)", 0);
8103 __pyx_r = __pyx_pf_8PyClical_8clifford_22__iadd__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8106 __Pyx_RefNannyFinishContext();
8110 static PyObject *__pyx_pf_8PyClical_8clifford_22__iadd__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8111 PyObject *__pyx_r = NULL;
8112 __Pyx_RefNannyDeclarations
8113 PyObject *__pyx_t_1 = NULL;
8114 __Pyx_RefNannySetupContext(
"__iadd__", 0);
8123 __Pyx_XDECREF(__pyx_r);
8124 __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)
8125 __Pyx_GOTREF(__pyx_t_1);
8126 __pyx_r = __pyx_t_1;
8140 __Pyx_XDECREF(__pyx_t_1);
8141 __Pyx_AddTraceback(
"PyClical.clifford.__iadd__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8144 __Pyx_XGIVEREF(__pyx_r);
8145 __Pyx_RefNannyFinishContext();
8158 static PyObject *__pyx_pw_8PyClical_8clifford_25__sub__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8159 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 ";
8160 #if CYTHON_COMPILING_IN_CPYTHON 8161 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_24__sub__;
8163 static PyObject *__pyx_pw_8PyClical_8clifford_25__sub__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8164 PyObject *__pyx_r = 0;
8165 __Pyx_RefNannyDeclarations
8166 __Pyx_RefNannySetupContext(
"__sub__ (wrapper)", 0);
8167 __pyx_r = __pyx_pf_8PyClical_8clifford_24__sub__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8170 __Pyx_RefNannyFinishContext();
8174 static PyObject *__pyx_pf_8PyClical_8clifford_24__sub__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8175 PyObject *__pyx_r = NULL;
8176 __Pyx_RefNannyDeclarations
8177 PyObject *__pyx_t_1 = NULL;
8178 PyObject *__pyx_t_2 = NULL;
8179 __Pyx_RefNannySetupContext(
"__sub__", 0);
8188 __Pyx_XDECREF(__pyx_r);
8189 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 768, __pyx_L1_error)
8190 __Pyx_GOTREF(__pyx_t_1);
8191 __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)
8192 __Pyx_GOTREF(__pyx_t_2);
8193 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8194 __pyx_r = __pyx_t_2;
8208 __Pyx_XDECREF(__pyx_t_1);
8209 __Pyx_XDECREF(__pyx_t_2);
8210 __Pyx_AddTraceback(
"PyClical.clifford.__sub__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8213 __Pyx_XGIVEREF(__pyx_r);
8214 __Pyx_RefNannyFinishContext();
8227 static PyObject *__pyx_pw_8PyClical_8clifford_27__isub__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8228 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 ";
8229 #if CYTHON_COMPILING_IN_CPYTHON 8230 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_26__isub__;
8232 static PyObject *__pyx_pw_8PyClical_8clifford_27__isub__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8233 PyObject *__pyx_r = 0;
8234 __Pyx_RefNannyDeclarations
8235 __Pyx_RefNannySetupContext(
"__isub__ (wrapper)", 0);
8236 __pyx_r = __pyx_pf_8PyClical_8clifford_26__isub__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8239 __Pyx_RefNannyFinishContext();
8243 static PyObject *__pyx_pf_8PyClical_8clifford_26__isub__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8244 PyObject *__pyx_r = NULL;
8245 __Pyx_RefNannyDeclarations
8246 PyObject *__pyx_t_1 = NULL;
8247 __Pyx_RefNannySetupContext(
"__isub__", 0);
8256 __Pyx_XDECREF(__pyx_r);
8257 __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)
8258 __Pyx_GOTREF(__pyx_t_1);
8259 __pyx_r = __pyx_t_1;
8273 __Pyx_XDECREF(__pyx_t_1);
8274 __Pyx_AddTraceback(
"PyClical.clifford.__isub__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8277 __Pyx_XGIVEREF(__pyx_r);
8278 __Pyx_RefNannyFinishContext();
8291 static PyObject *__pyx_pw_8PyClical_8clifford_29__mul__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8292 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 ";
8293 #if CYTHON_COMPILING_IN_CPYTHON 8294 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_28__mul__;
8296 static PyObject *__pyx_pw_8PyClical_8clifford_29__mul__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8297 PyObject *__pyx_r = 0;
8298 __Pyx_RefNannyDeclarations
8299 __Pyx_RefNannySetupContext(
"__mul__ (wrapper)", 0);
8300 __pyx_r = __pyx_pf_8PyClical_8clifford_28__mul__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8303 __Pyx_RefNannyFinishContext();
8307 static PyObject *__pyx_pf_8PyClical_8clifford_28__mul__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8308 PyObject *__pyx_r = NULL;
8309 __Pyx_RefNannyDeclarations
8310 PyObject *__pyx_t_1 = NULL;
8311 PyObject *__pyx_t_2 = NULL;
8312 __Pyx_RefNannySetupContext(
"__mul__", 0);
8321 __Pyx_XDECREF(__pyx_r);
8322 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 790, __pyx_L1_error)
8323 __Pyx_GOTREF(__pyx_t_1);
8324 __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)
8325 __Pyx_GOTREF(__pyx_t_2);
8326 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8327 __pyx_r = __pyx_t_2;
8341 __Pyx_XDECREF(__pyx_t_1);
8342 __Pyx_XDECREF(__pyx_t_2);
8343 __Pyx_AddTraceback(
"PyClical.clifford.__mul__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8346 __Pyx_XGIVEREF(__pyx_r);
8347 __Pyx_RefNannyFinishContext();
8360 static PyObject *__pyx_pw_8PyClical_8clifford_31__imul__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8361 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 ";
8362 #if CYTHON_COMPILING_IN_CPYTHON 8363 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_30__imul__;
8365 static PyObject *__pyx_pw_8PyClical_8clifford_31__imul__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8366 PyObject *__pyx_r = 0;
8367 __Pyx_RefNannyDeclarations
8368 __Pyx_RefNannySetupContext(
"__imul__ (wrapper)", 0);
8369 __pyx_r = __pyx_pf_8PyClical_8clifford_30__imul__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8372 __Pyx_RefNannyFinishContext();
8376 static PyObject *__pyx_pf_8PyClical_8clifford_30__imul__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8377 PyObject *__pyx_r = NULL;
8378 __Pyx_RefNannyDeclarations
8379 PyObject *__pyx_t_1 = NULL;
8380 __Pyx_RefNannySetupContext(
"__imul__", 0);
8389 __Pyx_XDECREF(__pyx_r);
8390 __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)
8391 __Pyx_GOTREF(__pyx_t_1);
8392 __pyx_r = __pyx_t_1;
8406 __Pyx_XDECREF(__pyx_t_1);
8407 __Pyx_AddTraceback(
"PyClical.clifford.__imul__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8410 __Pyx_XGIVEREF(__pyx_r);
8411 __Pyx_RefNannyFinishContext();
8424 static PyObject *__pyx_pw_8PyClical_8clifford_33__mod__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8425 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 ";
8426 #if CYTHON_COMPILING_IN_CPYTHON 8427 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_32__mod__;
8429 static PyObject *__pyx_pw_8PyClical_8clifford_33__mod__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8430 PyObject *__pyx_r = 0;
8431 __Pyx_RefNannyDeclarations
8432 __Pyx_RefNannySetupContext(
"__mod__ (wrapper)", 0);
8433 __pyx_r = __pyx_pf_8PyClical_8clifford_32__mod__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8436 __Pyx_RefNannyFinishContext();
8440 static PyObject *__pyx_pf_8PyClical_8clifford_32__mod__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8441 PyObject *__pyx_r = NULL;
8442 __Pyx_RefNannyDeclarations
8443 PyObject *__pyx_t_1 = NULL;
8444 PyObject *__pyx_t_2 = NULL;
8445 __Pyx_RefNannySetupContext(
"__mod__", 0);
8454 __Pyx_XDECREF(__pyx_r);
8455 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 818, __pyx_L1_error)
8456 __Pyx_GOTREF(__pyx_t_1);
8457 __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)
8458 __Pyx_GOTREF(__pyx_t_2);
8459 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8460 __pyx_r = __pyx_t_2;
8474 __Pyx_XDECREF(__pyx_t_1);
8475 __Pyx_XDECREF(__pyx_t_2);
8476 __Pyx_AddTraceback(
"PyClical.clifford.__mod__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8479 __Pyx_XGIVEREF(__pyx_r);
8480 __Pyx_RefNannyFinishContext();
8493 static PyObject *__pyx_pw_8PyClical_8clifford_35__imod__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8494 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 ";
8495 #if CYTHON_COMPILING_IN_CPYTHON 8496 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_34__imod__;
8498 static PyObject *__pyx_pw_8PyClical_8clifford_35__imod__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8499 PyObject *__pyx_r = 0;
8500 __Pyx_RefNannyDeclarations
8501 __Pyx_RefNannySetupContext(
"__imod__ (wrapper)", 0);
8502 __pyx_r = __pyx_pf_8PyClical_8clifford_34__imod__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8505 __Pyx_RefNannyFinishContext();
8509 static PyObject *__pyx_pf_8PyClical_8clifford_34__imod__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8510 PyObject *__pyx_r = NULL;
8511 __Pyx_RefNannyDeclarations
8512 PyObject *__pyx_t_1 = NULL;
8513 __Pyx_RefNannySetupContext(
"__imod__", 0);
8522 __Pyx_XDECREF(__pyx_r);
8523 __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)
8524 __Pyx_GOTREF(__pyx_t_1);
8525 __pyx_r = __pyx_t_1;
8539 __Pyx_XDECREF(__pyx_t_1);
8540 __Pyx_AddTraceback(
"PyClical.clifford.__imod__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8543 __Pyx_XGIVEREF(__pyx_r);
8544 __Pyx_RefNannyFinishContext();
8557 static PyObject *__pyx_pw_8PyClical_8clifford_37__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8558 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 ";
8559 #if CYTHON_COMPILING_IN_CPYTHON 8560 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_36__and__;
8562 static PyObject *__pyx_pw_8PyClical_8clifford_37__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8563 PyObject *__pyx_r = 0;
8564 __Pyx_RefNannyDeclarations
8565 __Pyx_RefNannySetupContext(
"__and__ (wrapper)", 0);
8566 __pyx_r = __pyx_pf_8PyClical_8clifford_36__and__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8569 __Pyx_RefNannyFinishContext();
8573 static PyObject *__pyx_pf_8PyClical_8clifford_36__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8574 PyObject *__pyx_r = NULL;
8575 __Pyx_RefNannyDeclarations
8576 PyObject *__pyx_t_1 = NULL;
8577 PyObject *__pyx_t_2 = NULL;
8578 __Pyx_RefNannySetupContext(
"__and__", 0);
8587 __Pyx_XDECREF(__pyx_r);
8588 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 848, __pyx_L1_error)
8589 __Pyx_GOTREF(__pyx_t_1);
8590 __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)
8591 __Pyx_GOTREF(__pyx_t_2);
8592 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8593 __pyx_r = __pyx_t_2;
8607 __Pyx_XDECREF(__pyx_t_1);
8608 __Pyx_XDECREF(__pyx_t_2);
8609 __Pyx_AddTraceback(
"PyClical.clifford.__and__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8612 __Pyx_XGIVEREF(__pyx_r);
8613 __Pyx_RefNannyFinishContext();
8626 static PyObject *__pyx_pw_8PyClical_8clifford_39__iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8627 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 ";
8628 #if CYTHON_COMPILING_IN_CPYTHON 8629 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_38__iand__;
8631 static PyObject *__pyx_pw_8PyClical_8clifford_39__iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8632 PyObject *__pyx_r = 0;
8633 __Pyx_RefNannyDeclarations
8634 __Pyx_RefNannySetupContext(
"__iand__ (wrapper)", 0);
8635 __pyx_r = __pyx_pf_8PyClical_8clifford_38__iand__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8638 __Pyx_RefNannyFinishContext();
8642 static PyObject *__pyx_pf_8PyClical_8clifford_38__iand__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8643 PyObject *__pyx_r = NULL;
8644 __Pyx_RefNannyDeclarations
8645 PyObject *__pyx_t_1 = NULL;
8646 __Pyx_RefNannySetupContext(
"__iand__", 0);
8655 __Pyx_XDECREF(__pyx_r);
8656 __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)
8657 __Pyx_GOTREF(__pyx_t_1);
8658 __pyx_r = __pyx_t_1;
8672 __Pyx_XDECREF(__pyx_t_1);
8673 __Pyx_AddTraceback(
"PyClical.clifford.__iand__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8676 __Pyx_XGIVEREF(__pyx_r);
8677 __Pyx_RefNannyFinishContext();
8690 static PyObject *__pyx_pw_8PyClical_8clifford_41__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8691 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 ";
8692 #if CYTHON_COMPILING_IN_CPYTHON 8693 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_40__xor__;
8695 static PyObject *__pyx_pw_8PyClical_8clifford_41__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8696 PyObject *__pyx_r = 0;
8697 __Pyx_RefNannyDeclarations
8698 __Pyx_RefNannySetupContext(
"__xor__ (wrapper)", 0);
8699 __pyx_r = __pyx_pf_8PyClical_8clifford_40__xor__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8702 __Pyx_RefNannyFinishContext();
8706 static PyObject *__pyx_pf_8PyClical_8clifford_40__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8707 PyObject *__pyx_r = NULL;
8708 __Pyx_RefNannyDeclarations
8709 PyObject *__pyx_t_1 = NULL;
8710 PyObject *__pyx_t_2 = NULL;
8711 __Pyx_RefNannySetupContext(
"__xor__", 0);
8720 __Pyx_XDECREF(__pyx_r);
8721 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 878, __pyx_L1_error)
8722 __Pyx_GOTREF(__pyx_t_1);
8723 __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)
8724 __Pyx_GOTREF(__pyx_t_2);
8725 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8726 __pyx_r = __pyx_t_2;
8740 __Pyx_XDECREF(__pyx_t_1);
8741 __Pyx_XDECREF(__pyx_t_2);
8742 __Pyx_AddTraceback(
"PyClical.clifford.__xor__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8745 __Pyx_XGIVEREF(__pyx_r);
8746 __Pyx_RefNannyFinishContext();
8759 static PyObject *__pyx_pw_8PyClical_8clifford_43__ixor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8760 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 ";
8761 #if CYTHON_COMPILING_IN_CPYTHON 8762 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_42__ixor__;
8764 static PyObject *__pyx_pw_8PyClical_8clifford_43__ixor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8765 PyObject *__pyx_r = 0;
8766 __Pyx_RefNannyDeclarations
8767 __Pyx_RefNannySetupContext(
"__ixor__ (wrapper)", 0);
8768 __pyx_r = __pyx_pf_8PyClical_8clifford_42__ixor__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8771 __Pyx_RefNannyFinishContext();
8775 static PyObject *__pyx_pf_8PyClical_8clifford_42__ixor__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8776 PyObject *__pyx_r = NULL;
8777 __Pyx_RefNannyDeclarations
8778 PyObject *__pyx_t_1 = NULL;
8779 __Pyx_RefNannySetupContext(
"__ixor__", 0);
8788 __Pyx_XDECREF(__pyx_r);
8789 __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)
8790 __Pyx_GOTREF(__pyx_t_1);
8791 __pyx_r = __pyx_t_1;
8805 __Pyx_XDECREF(__pyx_t_1);
8806 __Pyx_AddTraceback(
"PyClical.clifford.__ixor__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8809 __Pyx_XGIVEREF(__pyx_r);
8810 __Pyx_RefNannyFinishContext();
8823 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 8824 static PyObject *__pyx_pw_8PyClical_8clifford_45__div__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8825 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 ";
8826 #if CYTHON_COMPILING_IN_CPYTHON 8827 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_44__div__;
8829 static PyObject *__pyx_pw_8PyClical_8clifford_45__div__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8830 PyObject *__pyx_r = 0;
8831 __Pyx_RefNannyDeclarations
8832 __Pyx_RefNannySetupContext(
"__div__ (wrapper)", 0);
8833 __pyx_r = __pyx_pf_8PyClical_8clifford_44__div__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8836 __Pyx_RefNannyFinishContext();
8841 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 8842 static PyObject *__pyx_pf_8PyClical_8clifford_44__div__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8843 PyObject *__pyx_r = NULL;
8844 __Pyx_RefNannyDeclarations
8845 PyObject *__pyx_t_1 = NULL;
8846 PyObject *__pyx_t_2 = NULL;
8847 __Pyx_RefNannySetupContext(
"__div__", 0);
8856 __Pyx_XDECREF(__pyx_r);
8857 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 908, __pyx_L1_error)
8858 __Pyx_GOTREF(__pyx_t_1);
8859 __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)
8860 __Pyx_GOTREF(__pyx_t_2);
8861 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8862 __pyx_r = __pyx_t_2;
8876 __Pyx_XDECREF(__pyx_t_1);
8877 __Pyx_XDECREF(__pyx_t_2);
8878 __Pyx_AddTraceback(
"PyClical.clifford.__div__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8881 __Pyx_XGIVEREF(__pyx_r);
8882 __Pyx_RefNannyFinishContext();
8896 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 8897 static PyObject *__pyx_pw_8PyClical_8clifford_47__idiv__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8898 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 ";
8899 #if CYTHON_COMPILING_IN_CPYTHON 8900 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_46__idiv__;
8902 static PyObject *__pyx_pw_8PyClical_8clifford_47__idiv__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8903 PyObject *__pyx_r = 0;
8904 __Pyx_RefNannyDeclarations
8905 __Pyx_RefNannySetupContext(
"__idiv__ (wrapper)", 0);
8906 __pyx_r = __pyx_pf_8PyClical_8clifford_46__idiv__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8909 __Pyx_RefNannyFinishContext();
8914 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 8915 static PyObject *__pyx_pf_8PyClical_8clifford_46__idiv__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8916 PyObject *__pyx_r = NULL;
8917 __Pyx_RefNannyDeclarations
8918 PyObject *__pyx_t_1 = NULL;
8919 __Pyx_RefNannySetupContext(
"__idiv__", 0);
8928 __Pyx_XDECREF(__pyx_r);
8929 __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)
8930 __Pyx_GOTREF(__pyx_t_1);
8931 __pyx_r = __pyx_t_1;
8945 __Pyx_XDECREF(__pyx_t_1);
8946 __Pyx_AddTraceback(
"PyClical.clifford.__idiv__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8949 __Pyx_XGIVEREF(__pyx_r);
8950 __Pyx_RefNannyFinishContext();
8964 static PyObject *__pyx_pw_8PyClical_8clifford_49inv(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
8965 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 ";
8966 static PyObject *__pyx_pw_8PyClical_8clifford_49inv(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
8967 PyObject *__pyx_r = 0;
8968 __Pyx_RefNannyDeclarations
8969 __Pyx_RefNannySetupContext(
"inv (wrapper)", 0);
8970 __pyx_r = __pyx_pf_8PyClical_8clifford_48inv(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
8973 __Pyx_RefNannyFinishContext();
8977 static PyObject *__pyx_pf_8PyClical_8clifford_48inv(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
8978 PyObject *__pyx_r = NULL;
8979 __Pyx_RefNannyDeclarations
8980 PyObject *__pyx_t_1 = NULL;
8981 PyObject *__pyx_t_2 = NULL;
8982 __Pyx_RefNannySetupContext(
"inv", 0);
8991 __Pyx_XDECREF(__pyx_r);
8992 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 936, __pyx_L1_error)
8993 __Pyx_GOTREF(__pyx_t_1);
8994 __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)
8995 __Pyx_GOTREF(__pyx_t_2);
8996 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8997 __pyx_r = __pyx_t_2;
9011 __Pyx_XDECREF(__pyx_t_1);
9012 __Pyx_XDECREF(__pyx_t_2);
9013 __Pyx_AddTraceback(
"PyClical.clifford.inv", __pyx_clineno, __pyx_lineno, __pyx_filename);
9016 __Pyx_XGIVEREF(__pyx_r);
9017 __Pyx_RefNannyFinishContext();
9030 static PyObject *__pyx_pw_8PyClical_8clifford_51__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
9031 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 ";
9032 #if CYTHON_COMPILING_IN_CPYTHON 9033 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_50__or__;
9035 static PyObject *__pyx_pw_8PyClical_8clifford_51__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
9036 PyObject *__pyx_r = 0;
9037 __Pyx_RefNannyDeclarations
9038 __Pyx_RefNannySetupContext(
"__or__ (wrapper)", 0);
9039 __pyx_r = __pyx_pf_8PyClical_8clifford_50__or__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
9042 __Pyx_RefNannyFinishContext();
9046 static PyObject *__pyx_pf_8PyClical_8clifford_50__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
9047 PyObject *__pyx_r = NULL;
9048 __Pyx_RefNannyDeclarations
9049 PyObject *__pyx_t_1 = NULL;
9050 PyObject *__pyx_t_2 = NULL;
9051 __Pyx_RefNannySetupContext(
"__or__", 0);
9060 __Pyx_XDECREF(__pyx_r);
9061 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 947, __pyx_L1_error)
9062 __Pyx_GOTREF(__pyx_t_1);
9063 __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)
9064 __Pyx_GOTREF(__pyx_t_2);
9065 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9066 __pyx_r = __pyx_t_2;
9080 __Pyx_XDECREF(__pyx_t_1);
9081 __Pyx_XDECREF(__pyx_t_2);
9082 __Pyx_AddTraceback(
"PyClical.clifford.__or__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9085 __Pyx_XGIVEREF(__pyx_r);
9086 __Pyx_RefNannyFinishContext();
9099 static PyObject *__pyx_pw_8PyClical_8clifford_53__ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
9100 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 ";
9101 #if CYTHON_COMPILING_IN_CPYTHON 9102 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_52__ior__;
9104 static PyObject *__pyx_pw_8PyClical_8clifford_53__ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
9105 PyObject *__pyx_r = 0;
9106 __Pyx_RefNannyDeclarations
9107 __Pyx_RefNannySetupContext(
"__ior__ (wrapper)", 0);
9108 __pyx_r = __pyx_pf_8PyClical_8clifford_52__ior__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
9111 __Pyx_RefNannyFinishContext();
9115 static PyObject *__pyx_pf_8PyClical_8clifford_52__ior__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
9116 PyObject *__pyx_r = NULL;
9117 __Pyx_RefNannyDeclarations
9118 PyObject *__pyx_t_1 = NULL;
9119 __Pyx_RefNannySetupContext(
"__ior__", 0);
9128 __Pyx_XDECREF(__pyx_r);
9129 __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)
9130 __Pyx_GOTREF(__pyx_t_1);
9131 __pyx_r = __pyx_t_1;
9145 __Pyx_XDECREF(__pyx_t_1);
9146 __Pyx_AddTraceback(
"PyClical.clifford.__ior__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9149 __Pyx_XGIVEREF(__pyx_r);
9150 __Pyx_RefNannyFinishContext();
9163 static PyObject *__pyx_pw_8PyClical_8clifford_55__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_m, PyObject *__pyx_v_dummy);
9164 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 ";
9165 #if CYTHON_COMPILING_IN_CPYTHON 9166 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_54__pow__;
9168 static PyObject *__pyx_pw_8PyClical_8clifford_55__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_m, PyObject *__pyx_v_dummy) {
9169 PyObject *__pyx_r = 0;
9170 __Pyx_RefNannyDeclarations
9171 __Pyx_RefNannySetupContext(
"__pow__ (wrapper)", 0);
9172 __pyx_r = __pyx_pf_8PyClical_8clifford_54__pow__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_m), ((PyObject *)__pyx_v_dummy));
9175 __Pyx_RefNannyFinishContext();
9179 static PyObject *__pyx_pf_8PyClical_8clifford_54__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_m, CYTHON_UNUSED PyObject *__pyx_v_dummy) {
9180 PyObject *__pyx_r = NULL;
9181 __Pyx_RefNannyDeclarations
9182 PyObject *__pyx_t_1 = NULL;
9183 __Pyx_RefNannySetupContext(
"__pow__", 0);
9192 __Pyx_XDECREF(__pyx_r);
9193 __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)
9194 __Pyx_GOTREF(__pyx_t_1);
9195 __pyx_r = __pyx_t_1;
9209 __Pyx_XDECREF(__pyx_t_1);
9210 __Pyx_AddTraceback(
"PyClical.clifford.__pow__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9213 __Pyx_XGIVEREF(__pyx_r);
9214 __Pyx_RefNannyFinishContext();
9227 static PyObject *__pyx_pw_8PyClical_8clifford_57pow(PyObject *__pyx_v_self, PyObject *__pyx_v_m);
9228 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 ";
9229 static PyObject *__pyx_pw_8PyClical_8clifford_57pow(PyObject *__pyx_v_self, PyObject *__pyx_v_m) {
9230 PyObject *__pyx_r = 0;
9231 __Pyx_RefNannyDeclarations
9232 __Pyx_RefNannySetupContext(
"pow (wrapper)", 0);
9233 __pyx_r = __pyx_pf_8PyClical_8clifford_56pow(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_m));
9236 __Pyx_RefNannyFinishContext();
9240 static PyObject *__pyx_pf_8PyClical_8clifford_56pow(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_m) {
9241 PyObject *__pyx_r = NULL;
9242 __Pyx_RefNannyDeclarations
9243 PyObject *__pyx_t_1 = NULL;
9244 PyObject *__pyx_t_2 = NULL;
9248 __Pyx_RefNannySetupContext(
"pow", 0);
9257 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numbers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __pyx_L1_error)
9258 __Pyx_GOTREF(__pyx_t_1);
9259 __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)
9260 __Pyx_GOTREF(__pyx_t_2);
9261 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9262 __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)
9263 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9264 __pyx_t_4 = (__pyx_t_3 != 0);
9274 __Pyx_XDECREF(__pyx_r);
9275 __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 999, __pyx_L1_error)
9276 __Pyx_GOTREF(__pyx_t_2);
9277 __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)
9278 __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)
9279 __Pyx_GOTREF(__pyx_t_1);
9280 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9281 __pyx_r = __pyx_t_1;
9302 __Pyx_XDECREF(__pyx_r);
9303 __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)
9304 __Pyx_GOTREF(__pyx_t_1);
9305 __pyx_t_2 = PyNumber_Multiply(__pyx_v_m, __pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1001, __pyx_L1_error)
9306 __Pyx_GOTREF(__pyx_t_2);
9307 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9308 __pyx_t_1 = __pyx_f_8PyClical_exp(__pyx_t_2, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1001, __pyx_L1_error)
9309 __Pyx_GOTREF(__pyx_t_1);
9310 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9311 __pyx_r = __pyx_t_1;
9326 __Pyx_XDECREF(__pyx_t_1);
9327 __Pyx_XDECREF(__pyx_t_2);
9328 __Pyx_AddTraceback(
"PyClical.clifford.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
9331 __Pyx_XGIVEREF(__pyx_r);
9332 __Pyx_RefNannyFinishContext();
9345 static PyObject *__pyx_pw_8PyClical_8clifford_59outer_pow(PyObject *__pyx_v_self, PyObject *__pyx_v_m);
9346 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 ";
9347 static PyObject *__pyx_pw_8PyClical_8clifford_59outer_pow(PyObject *__pyx_v_self, PyObject *__pyx_v_m) {
9348 PyObject *__pyx_r = 0;
9349 __Pyx_RefNannyDeclarations
9350 __Pyx_RefNannySetupContext(
"outer_pow (wrapper)", 0);
9351 __pyx_r = __pyx_pf_8PyClical_8clifford_58outer_pow(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_m));
9354 __Pyx_RefNannyFinishContext();
9358 static PyObject *__pyx_pf_8PyClical_8clifford_58outer_pow(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_m) {
9359 PyObject *__pyx_r = NULL;
9360 __Pyx_RefNannyDeclarations
9361 PyObject *__pyx_t_1 = NULL;
9363 PyObject *__pyx_t_3 = NULL;
9364 __Pyx_RefNannySetupContext(
"outer_pow", 0);
9373 __Pyx_XDECREF(__pyx_r);
9374 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1017, __pyx_L1_error)
9375 __Pyx_GOTREF(__pyx_t_1);
9376 __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)
9377 __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)
9378 __Pyx_GOTREF(__pyx_t_3);
9379 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9380 __pyx_r = __pyx_t_3;
9394 __Pyx_XDECREF(__pyx_t_1);
9395 __Pyx_XDECREF(__pyx_t_3);
9396 __Pyx_AddTraceback(
"PyClical.clifford.outer_pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
9399 __Pyx_XGIVEREF(__pyx_r);
9400 __Pyx_RefNannyFinishContext();
9413 static PyObject *__pyx_pw_8PyClical_8clifford_61__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
9414 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 ";
9415 #if CYTHON_COMPILING_IN_CPYTHON 9416 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_60__call__;
9418 static PyObject *__pyx_pw_8PyClical_8clifford_61__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9419 PyObject *__pyx_v_grade = 0;
9420 PyObject *__pyx_r = 0;
9421 __Pyx_RefNannyDeclarations
9422 __Pyx_RefNannySetupContext(
"__call__ (wrapper)", 0);
9424 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_grade,0};
9425 PyObject* values[1] = {0};
9426 if (unlikely(__pyx_kwds)) {
9428 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9430 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9433 default:
goto __pyx_L5_argtuple_error;
9435 kw_args = PyDict_Size(__pyx_kwds);
9438 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_grade)) != 0)) kw_args--;
9439 else goto __pyx_L5_argtuple_error;
9441 if (unlikely(kw_args > 0)) {
9442 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__call__") < 0)) __PYX_ERR(0, 1019, __pyx_L3_error)
9444 }
else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
9445 goto __pyx_L5_argtuple_error;
9447 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9449 __pyx_v_grade = values[0];
9451 goto __pyx_L4_argument_unpacking_done;
9452 __pyx_L5_argtuple_error:;
9453 __Pyx_RaiseArgtupleInvalid(
"__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1019, __pyx_L3_error)
9455 __Pyx_AddTraceback(
"PyClical.clifford.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9456 __Pyx_RefNannyFinishContext();
9458 __pyx_L4_argument_unpacking_done:;
9459 __pyx_r = __pyx_pf_8PyClical_8clifford_60__call__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), __pyx_v_grade);
9462 __Pyx_RefNannyFinishContext();
9466 static PyObject *__pyx_pf_8PyClical_8clifford_60__call__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_grade) {
9467 PyObject *__pyx_r = NULL;
9468 __Pyx_RefNannyDeclarations
9469 PyObject *__pyx_t_1 = NULL;
9471 PyObject *__pyx_t_3 = NULL;
9472 __Pyx_RefNannySetupContext(
"__call__", 0);
9481 __Pyx_XDECREF(__pyx_r);
9482 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1036, __pyx_L1_error)
9483 __Pyx_GOTREF(__pyx_t_1);
9484 __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)
9485 __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)
9486 __Pyx_GOTREF(__pyx_t_3);
9487 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9488 __pyx_r = __pyx_t_3;
9502 __Pyx_XDECREF(__pyx_t_1);
9503 __Pyx_XDECREF(__pyx_t_3);
9504 __Pyx_AddTraceback(
"PyClical.clifford.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9507 __Pyx_XGIVEREF(__pyx_r);
9508 __Pyx_RefNannyFinishContext();
9521 static PyObject *__pyx_pw_8PyClical_8clifford_63scalar(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9522 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 ";
9523 static PyObject *__pyx_pw_8PyClical_8clifford_63scalar(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9524 PyObject *__pyx_r = 0;
9525 __Pyx_RefNannyDeclarations
9526 __Pyx_RefNannySetupContext(
"scalar (wrapper)", 0);
9527 __pyx_r = __pyx_pf_8PyClical_8clifford_62scalar(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
9530 __Pyx_RefNannyFinishContext();
9534 static PyObject *__pyx_pf_8PyClical_8clifford_62scalar(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
9535 PyObject *__pyx_r = NULL;
9536 __Pyx_RefNannyDeclarations
9537 PyObject *__pyx_t_1 = NULL;
9538 __Pyx_RefNannySetupContext(
"scalar", 0);
9547 __Pyx_XDECREF(__pyx_r);
9548 __pyx_t_1 =
PyFloat_FromDouble(__pyx_v_self->instance->scalar());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1047, __pyx_L1_error)
9549 __Pyx_GOTREF(__pyx_t_1);
9550 __pyx_r = __pyx_t_1;
9564 __Pyx_XDECREF(__pyx_t_1);
9565 __Pyx_AddTraceback(
"PyClical.clifford.scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
9568 __Pyx_XGIVEREF(__pyx_r);
9569 __Pyx_RefNannyFinishContext();
9582 static PyObject *__pyx_pw_8PyClical_8clifford_65pure(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9583 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 ";
9584 static PyObject *__pyx_pw_8PyClical_8clifford_65pure(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9585 PyObject *__pyx_r = 0;
9586 __Pyx_RefNannyDeclarations
9587 __Pyx_RefNannySetupContext(
"pure (wrapper)", 0);
9588 __pyx_r = __pyx_pf_8PyClical_8clifford_64pure(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
9591 __Pyx_RefNannyFinishContext();
9595 static PyObject *__pyx_pf_8PyClical_8clifford_64pure(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
9596 PyObject *__pyx_r = NULL;
9597 __Pyx_RefNannyDeclarations
9598 PyObject *__pyx_t_1 = NULL;
9599 PyObject *__pyx_t_2 = NULL;
9600 __Pyx_RefNannySetupContext(
"pure", 0);
9609 __Pyx_XDECREF(__pyx_r);
9610 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1058, __pyx_L1_error)
9611 __Pyx_GOTREF(__pyx_t_1);
9612 __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)
9613 __Pyx_GOTREF(__pyx_t_2);
9614 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9615 __pyx_r = __pyx_t_2;
9629 __Pyx_XDECREF(__pyx_t_1);
9630 __Pyx_XDECREF(__pyx_t_2);
9631 __Pyx_AddTraceback(
"PyClical.clifford.pure", __pyx_clineno, __pyx_lineno, __pyx_filename);
9634 __Pyx_XGIVEREF(__pyx_r);
9635 __Pyx_RefNannyFinishContext();
9648 static PyObject *__pyx_pw_8PyClical_8clifford_67even(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9649 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 ";
9650 static PyObject *__pyx_pw_8PyClical_8clifford_67even(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9651 PyObject *__pyx_r = 0;
9652 __Pyx_RefNannyDeclarations
9653 __Pyx_RefNannySetupContext(
"even (wrapper)", 0);
9654 __pyx_r = __pyx_pf_8PyClical_8clifford_66even(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
9657 __Pyx_RefNannyFinishContext();
9661 static PyObject *__pyx_pf_8PyClical_8clifford_66even(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
9662 PyObject *__pyx_r = NULL;
9663 __Pyx_RefNannyDeclarations
9664 PyObject *__pyx_t_1 = NULL;
9665 PyObject *__pyx_t_2 = NULL;
9666 __Pyx_RefNannySetupContext(
"even", 0);
9675 __Pyx_XDECREF(__pyx_r);
9676 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1067, __pyx_L1_error)
9677 __Pyx_GOTREF(__pyx_t_1);
9678 __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)
9679 __Pyx_GOTREF(__pyx_t_2);
9680 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9681 __pyx_r = __pyx_t_2;
9695 __Pyx_XDECREF(__pyx_t_1);
9696 __Pyx_XDECREF(__pyx_t_2);
9697 __Pyx_AddTraceback(
"PyClical.clifford.even", __pyx_clineno, __pyx_lineno, __pyx_filename);
9700 __Pyx_XGIVEREF(__pyx_r);
9701 __Pyx_RefNannyFinishContext();
9714 static PyObject *__pyx_pw_8PyClical_8clifford_69odd(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9715 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 ";
9716 static PyObject *__pyx_pw_8PyClical_8clifford_69odd(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9717 PyObject *__pyx_r = 0;
9718 __Pyx_RefNannyDeclarations
9719 __Pyx_RefNannySetupContext(
"odd (wrapper)", 0);
9720 __pyx_r = __pyx_pf_8PyClical_8clifford_68odd(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
9723 __Pyx_RefNannyFinishContext();
9727 static PyObject *__pyx_pf_8PyClical_8clifford_68odd(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
9728 PyObject *__pyx_r = NULL;
9729 __Pyx_RefNannyDeclarations
9730 PyObject *__pyx_t_1 = NULL;
9731 PyObject *__pyx_t_2 = NULL;
9732 __Pyx_RefNannySetupContext(
"odd", 0);
9741 __Pyx_XDECREF(__pyx_r);
9742 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1076, __pyx_L1_error)
9743 __Pyx_GOTREF(__pyx_t_1);
9744 __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)
9745 __Pyx_GOTREF(__pyx_t_2);
9746 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9747 __pyx_r = __pyx_t_2;
9761 __Pyx_XDECREF(__pyx_t_1);
9762 __Pyx_XDECREF(__pyx_t_2);
9763 __Pyx_AddTraceback(
"PyClical.clifford.odd", __pyx_clineno, __pyx_lineno, __pyx_filename);
9766 __Pyx_XGIVEREF(__pyx_r);
9767 __Pyx_RefNannyFinishContext();
9780 static PyObject *__pyx_pw_8PyClical_8clifford_71vector_part(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
9781 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 ";
9782 static PyObject *__pyx_pw_8PyClical_8clifford_71vector_part(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9783 PyObject *__pyx_v_frm = 0;
9784 PyObject *__pyx_r = 0;
9785 __Pyx_RefNannyDeclarations
9786 __Pyx_RefNannySetupContext(
"vector_part (wrapper)", 0);
9788 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frm,0};
9789 PyObject* values[1] = {0};
9790 values[0] = ((PyObject *)Py_None);
9791 if (unlikely(__pyx_kwds)) {
9793 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9795 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9798 default:
goto __pyx_L5_argtuple_error;
9800 kw_args = PyDict_Size(__pyx_kwds);
9804 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_frm);
9805 if (value) { values[0] = value; kw_args--; }
9808 if (unlikely(kw_args > 0)) {
9809 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"vector_part") < 0)) __PYX_ERR(0, 1078, __pyx_L3_error)
9812 switch (PyTuple_GET_SIZE(__pyx_args)) {
9813 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9816 default:
goto __pyx_L5_argtuple_error;
9819 __pyx_v_frm = values[0];
9821 goto __pyx_L4_argument_unpacking_done;
9822 __pyx_L5_argtuple_error:;
9823 __Pyx_RaiseArgtupleInvalid(
"vector_part", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1078, __pyx_L3_error)
9825 __Pyx_AddTraceback(
"PyClical.clifford.vector_part", __pyx_clineno, __pyx_lineno, __pyx_filename);
9826 __Pyx_RefNannyFinishContext();
9828 __pyx_L4_argument_unpacking_done:;
9829 __pyx_r = __pyx_pf_8PyClical_8clifford_70vector_part(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), __pyx_v_frm);
9832 __Pyx_RefNannyFinishContext();
9836 static PyObject *__pyx_pf_8PyClical_8clifford_70vector_part(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_frm) {
9837 PyObject *__pyx_v_error_msg_prefix = NULL;
9838 std::vector<scalar_t> __pyx_v_vec;
9841 PyObject *__pyx_v_lst = NULL;
9842 PyObject *__pyx_v_err = NULL;
9843 PyObject *__pyx_r = NULL;
9844 __Pyx_RefNannyDeclarations
9845 PyObject *__pyx_t_1 = NULL;
9846 PyObject *__pyx_t_2 = NULL;
9847 PyObject *__pyx_t_3 = NULL;
9850 std::vector<scalar_t> __pyx_t_6;
9851 PyObject *__pyx_t_7 = NULL;
9855 PyObject *__pyx_t_11 = NULL;
9856 PyObject *__pyx_t_12 = NULL;
9857 PyObject *__pyx_t_13 = NULL;
9858 PyObject *__pyx_t_14 = NULL;
9859 PyObject *__pyx_t_15 = NULL;
9860 __Pyx_RefNannySetupContext(
"vector_part", 0);
9869 __Pyx_INCREF(__pyx_kp_s_Cannot_take_vector_part_of);
9870 __pyx_v_error_msg_prefix = __pyx_kp_s_Cannot_take_vector_part_of;
9880 __Pyx_PyThreadState_declare
9881 __Pyx_PyThreadState_assign
9882 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
9883 __Pyx_XGOTREF(__pyx_t_1);
9884 __Pyx_XGOTREF(__pyx_t_2);
9885 __Pyx_XGOTREF(__pyx_t_3);
9895 __pyx_t_4 = (__pyx_v_frm == Py_None);
9896 __pyx_t_5 = (__pyx_t_4 != 0);
9906 __pyx_t_6 = __pyx_v_self->instance->vector_part();
9907 __pyx_v_vec = __pyx_t_6;
9928 __pyx_t_6 = __pyx_v_self->instance->vector_part(__pyx_f_8PyClical_9index_set_unwrap(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_frm)));
9930 __Pyx_CppExn2PyErr();
9931 __PYX_ERR(0, 1095, __pyx_L3_error)
9933 __pyx_v_vec = __pyx_t_6;
9944 __pyx_v_n = __pyx_v_vec.size();
9953 __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)
9954 __Pyx_GOTREF(__pyx_t_7);
9955 { Py_ssize_t __pyx_temp;
9956 for (__pyx_temp=0; __pyx_temp < __pyx_v_n; __pyx_temp++) {
9957 __Pyx_INCREF(__pyx_float_0_0);
9958 __Pyx_GIVEREF(__pyx_float_0_0);
9959 PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_float_0_0);
9962 __pyx_v_lst = ((PyObject*)__pyx_t_7);
9972 __pyx_t_8 = __pyx_v_n;
9973 __pyx_t_9 = __pyx_t_8;
9974 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
9975 __pyx_v_i = __pyx_t_10;
9984 __pyx_t_7 =
PyFloat_FromDouble((__pyx_v_vec[__pyx_v_i]));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1099, __pyx_L3_error)
9985 __Pyx_GOTREF(__pyx_t_7);
9986 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)
9987 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9997 __Pyx_XDECREF(__pyx_r);
9998 __Pyx_INCREF(__pyx_v_lst);
9999 __pyx_r = __pyx_v_lst;
10000 goto __pyx_L7_try_return;
10011 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10020 __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
10022 __Pyx_AddTraceback(
"PyClical.clifford.vector_part", __pyx_clineno, __pyx_lineno, __pyx_filename);
10023 if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_11, &__pyx_t_12) < 0) __PYX_ERR(0, 1101, __pyx_L5_except_error)
10024 __Pyx_GOTREF(__pyx_t_7);
10025 __Pyx_GOTREF(__pyx_t_11);
10026 __Pyx_GOTREF(__pyx_t_12);
10027 __Pyx_INCREF(__pyx_t_11);
10028 __pyx_v_err = __pyx_t_11;
10037 __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)
10038 __Pyx_GOTREF(__pyx_t_13);
10039 __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)
10040 __Pyx_GOTREF(__pyx_t_14);
10041 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
10042 __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)
10043 __Pyx_GOTREF(__pyx_t_13);
10044 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
10053 __pyx_t_14 = PyObject_Repr(__pyx_v_frm);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1103, __pyx_L5_except_error)
10054 __Pyx_GOTREF(__pyx_t_14);
10055 __pyx_t_15 = PyNumber_Add(__pyx_t_13, __pyx_t_14);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1103, __pyx_L5_except_error)
10056 __Pyx_GOTREF(__pyx_t_15);
10057 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
10058 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
10059 __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)
10060 __Pyx_GOTREF(__pyx_t_14);
10061 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
10070 __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)
10071 __Pyx_GOTREF(__pyx_t_15);
10072 __pyx_t_13 = PyNumber_Add(__pyx_t_14, __pyx_t_15);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1104, __pyx_L5_except_error)
10073 __Pyx_GOTREF(__pyx_t_13);
10074 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
10075 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
10084 __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)
10085 __Pyx_GOTREF(__pyx_t_15);
10086 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
10087 __Pyx_Raise(__pyx_t_15, 0, 0, 0);
10088 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
10089 __PYX_ERR(0, 1102, __pyx_L5_except_error)
10091 goto __pyx_L5_except_error;
10092 __pyx_L5_except_error:;
10101 __Pyx_XGIVEREF(__pyx_t_1);
10102 __Pyx_XGIVEREF(__pyx_t_2);
10103 __Pyx_XGIVEREF(__pyx_t_3);
10104 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
10105 goto __pyx_L1_error;
10106 __pyx_L7_try_return:;
10107 __Pyx_XGIVEREF(__pyx_t_1);
10108 __Pyx_XGIVEREF(__pyx_t_2);
10109 __Pyx_XGIVEREF(__pyx_t_3);
10110 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
10124 __Pyx_XDECREF(__pyx_t_7);
10125 __Pyx_XDECREF(__pyx_t_11);
10126 __Pyx_XDECREF(__pyx_t_12);
10127 __Pyx_XDECREF(__pyx_t_13);
10128 __Pyx_XDECREF(__pyx_t_14);
10129 __Pyx_XDECREF(__pyx_t_15);
10130 __Pyx_AddTraceback(
"PyClical.clifford.vector_part", __pyx_clineno, __pyx_lineno, __pyx_filename);
10133 __Pyx_XDECREF(__pyx_v_error_msg_prefix);
10134 __Pyx_XDECREF(__pyx_v_lst);
10135 __Pyx_XDECREF(__pyx_v_err);
10136 __Pyx_XGIVEREF(__pyx_r);
10137 __Pyx_RefNannyFinishContext();
10150 static PyObject *__pyx_pw_8PyClical_8clifford_73involute(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10151 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 ";
10152 static PyObject *__pyx_pw_8PyClical_8clifford_73involute(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10153 PyObject *__pyx_r = 0;
10154 __Pyx_RefNannyDeclarations
10155 __Pyx_RefNannySetupContext(
"involute (wrapper)", 0);
10156 __pyx_r = __pyx_pf_8PyClical_8clifford_72involute(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10159 __Pyx_RefNannyFinishContext();
10163 static PyObject *__pyx_pf_8PyClical_8clifford_72involute(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10164 PyObject *__pyx_r = NULL;
10165 __Pyx_RefNannyDeclarations
10166 PyObject *__pyx_t_1 = NULL;
10167 PyObject *__pyx_t_2 = NULL;
10168 __Pyx_RefNannySetupContext(
"involute", 0);
10177 __Pyx_XDECREF(__pyx_r);
10178 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1120, __pyx_L1_error)
10179 __Pyx_GOTREF(__pyx_t_1);
10180 __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)
10181 __Pyx_GOTREF(__pyx_t_2);
10182 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10183 __pyx_r = __pyx_t_2;
10197 __Pyx_XDECREF(__pyx_t_1);
10198 __Pyx_XDECREF(__pyx_t_2);
10199 __Pyx_AddTraceback(
"PyClical.clifford.involute", __pyx_clineno, __pyx_lineno, __pyx_filename);
10202 __Pyx_XGIVEREF(__pyx_r);
10203 __Pyx_RefNannyFinishContext();
10216 static PyObject *__pyx_pw_8PyClical_8clifford_75reverse(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10217 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 ";
10218 static PyObject *__pyx_pw_8PyClical_8clifford_75reverse(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10219 PyObject *__pyx_r = 0;
10220 __Pyx_RefNannyDeclarations
10221 __Pyx_RefNannySetupContext(
"reverse (wrapper)", 0);
10222 __pyx_r = __pyx_pf_8PyClical_8clifford_74reverse(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10225 __Pyx_RefNannyFinishContext();
10229 static PyObject *__pyx_pf_8PyClical_8clifford_74reverse(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10230 PyObject *__pyx_r = NULL;
10231 __Pyx_RefNannyDeclarations
10232 PyObject *__pyx_t_1 = NULL;
10233 PyObject *__pyx_t_2 = NULL;
10234 __Pyx_RefNannySetupContext(
"reverse", 0);
10243 __Pyx_XDECREF(__pyx_r);
10244 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1135, __pyx_L1_error)
10245 __Pyx_GOTREF(__pyx_t_1);
10246 __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)
10247 __Pyx_GOTREF(__pyx_t_2);
10248 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10249 __pyx_r = __pyx_t_2;
10263 __Pyx_XDECREF(__pyx_t_1);
10264 __Pyx_XDECREF(__pyx_t_2);
10265 __Pyx_AddTraceback(
"PyClical.clifford.reverse", __pyx_clineno, __pyx_lineno, __pyx_filename);
10268 __Pyx_XGIVEREF(__pyx_r);
10269 __Pyx_RefNannyFinishContext();
10282 static PyObject *__pyx_pw_8PyClical_8clifford_77conj(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10283 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 ";
10284 static PyObject *__pyx_pw_8PyClical_8clifford_77conj(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10285 PyObject *__pyx_r = 0;
10286 __Pyx_RefNannyDeclarations
10287 __Pyx_RefNannySetupContext(
"conj (wrapper)", 0);
10288 __pyx_r = __pyx_pf_8PyClical_8clifford_76conj(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10291 __Pyx_RefNannyFinishContext();
10295 static PyObject *__pyx_pf_8PyClical_8clifford_76conj(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10296 PyObject *__pyx_r = NULL;
10297 __Pyx_RefNannyDeclarations
10298 PyObject *__pyx_t_1 = NULL;
10299 PyObject *__pyx_t_2 = NULL;
10300 __Pyx_RefNannySetupContext(
"conj", 0);
10309 __Pyx_XDECREF(__pyx_r);
10310 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1150, __pyx_L1_error)
10311 __Pyx_GOTREF(__pyx_t_1);
10312 __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)
10313 __Pyx_GOTREF(__pyx_t_2);
10314 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10315 __pyx_r = __pyx_t_2;
10329 __Pyx_XDECREF(__pyx_t_1);
10330 __Pyx_XDECREF(__pyx_t_2);
10331 __Pyx_AddTraceback(
"PyClical.clifford.conj", __pyx_clineno, __pyx_lineno, __pyx_filename);
10334 __Pyx_XGIVEREF(__pyx_r);
10335 __Pyx_RefNannyFinishContext();
10348 static PyObject *__pyx_pw_8PyClical_8clifford_79quad(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10349 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 ";
10350 static PyObject *__pyx_pw_8PyClical_8clifford_79quad(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10351 PyObject *__pyx_r = 0;
10352 __Pyx_RefNannyDeclarations
10353 __Pyx_RefNannySetupContext(
"quad (wrapper)", 0);
10354 __pyx_r = __pyx_pf_8PyClical_8clifford_78quad(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10357 __Pyx_RefNannyFinishContext();
10361 static PyObject *__pyx_pf_8PyClical_8clifford_78quad(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10362 PyObject *__pyx_r = NULL;
10363 __Pyx_RefNannyDeclarations
10364 PyObject *__pyx_t_1 = NULL;
10365 __Pyx_RefNannySetupContext(
"quad", 0);
10374 __Pyx_XDECREF(__pyx_r);
10375 __pyx_t_1 =
PyFloat_FromDouble(__pyx_v_self->instance->quad());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1161, __pyx_L1_error)
10376 __Pyx_GOTREF(__pyx_t_1);
10377 __pyx_r = __pyx_t_1;
10391 __Pyx_XDECREF(__pyx_t_1);
10392 __Pyx_AddTraceback(
"PyClical.clifford.quad", __pyx_clineno, __pyx_lineno, __pyx_filename);
10395 __Pyx_XGIVEREF(__pyx_r);
10396 __Pyx_RefNannyFinishContext();
10409 static PyObject *__pyx_pw_8PyClical_8clifford_81norm(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10410 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 ";
10411 static PyObject *__pyx_pw_8PyClical_8clifford_81norm(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10412 PyObject *__pyx_r = 0;
10413 __Pyx_RefNannyDeclarations
10414 __Pyx_RefNannySetupContext(
"norm (wrapper)", 0);
10415 __pyx_r = __pyx_pf_8PyClical_8clifford_80norm(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10418 __Pyx_RefNannyFinishContext();
10422 static PyObject *__pyx_pf_8PyClical_8clifford_80norm(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10423 PyObject *__pyx_r = NULL;
10424 __Pyx_RefNannyDeclarations
10425 PyObject *__pyx_t_1 = NULL;
10426 __Pyx_RefNannySetupContext(
"norm", 0);
10435 __Pyx_XDECREF(__pyx_r);
10436 __pyx_t_1 =
PyFloat_FromDouble(__pyx_v_self->instance->norm());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1172, __pyx_L1_error)
10437 __Pyx_GOTREF(__pyx_t_1);
10438 __pyx_r = __pyx_t_1;
10452 __Pyx_XDECREF(__pyx_t_1);
10453 __Pyx_AddTraceback(
"PyClical.clifford.norm", __pyx_clineno, __pyx_lineno, __pyx_filename);
10456 __Pyx_XGIVEREF(__pyx_r);
10457 __Pyx_RefNannyFinishContext();
10470 static PyObject *__pyx_pw_8PyClical_8clifford_83abs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10471 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 ";
10472 static PyObject *__pyx_pw_8PyClical_8clifford_83abs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10473 PyObject *__pyx_r = 0;
10474 __Pyx_RefNannyDeclarations
10475 __Pyx_RefNannySetupContext(
"abs (wrapper)", 0);
10476 __pyx_r = __pyx_pf_8PyClical_8clifford_82abs(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10479 __Pyx_RefNannyFinishContext();
10483 static PyObject *__pyx_pf_8PyClical_8clifford_82abs(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10484 PyObject *__pyx_r = NULL;
10485 __Pyx_RefNannyDeclarations
10486 PyObject *__pyx_t_1 = NULL;
10487 __Pyx_RefNannySetupContext(
"abs", 0);
10496 __Pyx_XDECREF(__pyx_r);
10497 __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)
10498 __Pyx_GOTREF(__pyx_t_1);
10499 __pyx_r = __pyx_t_1;
10513 __Pyx_XDECREF(__pyx_t_1);
10514 __Pyx_AddTraceback(
"PyClical.clifford.abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
10517 __Pyx_XGIVEREF(__pyx_r);
10518 __Pyx_RefNannyFinishContext();
10531 static PyObject *__pyx_pw_8PyClical_8clifford_85max_abs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10532 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 ";
10533 static PyObject *__pyx_pw_8PyClical_8clifford_85max_abs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10534 PyObject *__pyx_r = 0;
10535 __Pyx_RefNannyDeclarations
10536 __Pyx_RefNannySetupContext(
"max_abs (wrapper)", 0);
10537 __pyx_r = __pyx_pf_8PyClical_8clifford_84max_abs(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10540 __Pyx_RefNannyFinishContext();
10544 static PyObject *__pyx_pf_8PyClical_8clifford_84max_abs(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10545 PyObject *__pyx_r = NULL;
10546 __Pyx_RefNannyDeclarations
10547 PyObject *__pyx_t_1 = NULL;
10548 __Pyx_RefNannySetupContext(
"max_abs", 0);
10557 __Pyx_XDECREF(__pyx_r);
10558 __pyx_t_1 =
PyFloat_FromDouble(__pyx_v_self->instance->max_abs());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1192, __pyx_L1_error)
10559 __Pyx_GOTREF(__pyx_t_1);
10560 __pyx_r = __pyx_t_1;
10574 __Pyx_XDECREF(__pyx_t_1);
10575 __Pyx_AddTraceback(
"PyClical.clifford.max_abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
10578 __Pyx_XGIVEREF(__pyx_r);
10579 __Pyx_RefNannyFinishContext();
10592 static PyObject *__pyx_pw_8PyClical_8clifford_87truncated(PyObject *__pyx_v_self, PyObject *__pyx_v_limit);
10593 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 ";
10594 static PyObject *__pyx_pw_8PyClical_8clifford_87truncated(PyObject *__pyx_v_self, PyObject *__pyx_v_limit) {
10595 PyObject *__pyx_r = 0;
10596 __Pyx_RefNannyDeclarations
10597 __Pyx_RefNannySetupContext(
"truncated (wrapper)", 0);
10598 __pyx_r = __pyx_pf_8PyClical_8clifford_86truncated(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_limit));
10601 __Pyx_RefNannyFinishContext();
10605 static PyObject *__pyx_pf_8PyClical_8clifford_86truncated(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_limit) {
10606 PyObject *__pyx_r = NULL;
10607 __Pyx_RefNannyDeclarations
10608 PyObject *__pyx_t_1 = NULL;
10610 PyObject *__pyx_t_3 = NULL;
10611 __Pyx_RefNannySetupContext(
"truncated", 0);
10620 __Pyx_XDECREF(__pyx_r);
10621 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1203, __pyx_L1_error)
10622 __Pyx_GOTREF(__pyx_t_1);
10623 __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)
10624 __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)
10625 __Pyx_GOTREF(__pyx_t_3);
10626 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10627 __pyx_r = __pyx_t_3;
10641 __Pyx_XDECREF(__pyx_t_1);
10642 __Pyx_XDECREF(__pyx_t_3);
10643 __Pyx_AddTraceback(
"PyClical.clifford.truncated", __pyx_clineno, __pyx_lineno, __pyx_filename);
10646 __Pyx_XGIVEREF(__pyx_r);
10647 __Pyx_RefNannyFinishContext();
10660 static PyObject *__pyx_pw_8PyClical_8clifford_89isnan(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10661 static char __pyx_doc_8PyClical_8clifford_88isnan[] =
"\n Check if a multivector contains any IEEE NaN values.\n\n >>> clifford().isnan()\n False\n ";
10662 static PyObject *__pyx_pw_8PyClical_8clifford_89isnan(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10663 PyObject *__pyx_r = 0;
10664 __Pyx_RefNannyDeclarations
10665 __Pyx_RefNannySetupContext(
"isnan (wrapper)", 0);
10666 __pyx_r = __pyx_pf_8PyClical_8clifford_88isnan(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10669 __Pyx_RefNannyFinishContext();
10673 static PyObject *__pyx_pf_8PyClical_8clifford_88isnan(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10674 PyObject *__pyx_r = NULL;
10675 __Pyx_RefNannyDeclarations
10676 PyObject *__pyx_t_1 = NULL;
10677 __Pyx_RefNannySetupContext(
"isnan", 0);
10686 __Pyx_XDECREF(__pyx_r);
10687 __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->instance->isnan());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1212, __pyx_L1_error)
10688 __Pyx_GOTREF(__pyx_t_1);
10689 __pyx_r = __pyx_t_1;
10703 __Pyx_XDECREF(__pyx_t_1);
10704 __Pyx_AddTraceback(
"PyClical.clifford.isnan", __pyx_clineno, __pyx_lineno, __pyx_filename);
10707 __Pyx_XGIVEREF(__pyx_r);
10708 __Pyx_RefNannyFinishContext();
10721 static PyObject *__pyx_pw_8PyClical_8clifford_91frame(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10722 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 ";
10723 static PyObject *__pyx_pw_8PyClical_8clifford_91frame(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10724 PyObject *__pyx_r = 0;
10725 __Pyx_RefNannyDeclarations
10726 __Pyx_RefNannySetupContext(
"frame (wrapper)", 0);
10727 __pyx_r = __pyx_pf_8PyClical_8clifford_90frame(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10730 __Pyx_RefNannyFinishContext();
10734 static PyObject *__pyx_pf_8PyClical_8clifford_90frame(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10735 PyObject *__pyx_r = NULL;
10736 __Pyx_RefNannyDeclarations
10737 PyObject *__pyx_t_1 = NULL;
10738 PyObject *__pyx_t_2 = NULL;
10739 __Pyx_RefNannySetupContext(
"frame", 0);
10748 __Pyx_XDECREF(__pyx_r);
10749 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_index_set));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1223, __pyx_L1_error)
10750 __Pyx_GOTREF(__pyx_t_1);
10751 __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)
10752 __Pyx_GOTREF(__pyx_t_2);
10753 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10754 __pyx_r = __pyx_t_2;
10768 __Pyx_XDECREF(__pyx_t_1);
10769 __Pyx_XDECREF(__pyx_t_2);
10770 __Pyx_AddTraceback(
"PyClical.clifford.frame", __pyx_clineno, __pyx_lineno, __pyx_filename);
10773 __Pyx_XGIVEREF(__pyx_r);
10774 __Pyx_RefNannyFinishContext();
10787 static PyObject *__pyx_pw_8PyClical_8clifford_93__repr__(PyObject *__pyx_v_self);
10788 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 ";
10789 #if CYTHON_COMPILING_IN_CPYTHON 10790 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_92__repr__;
10792 static PyObject *__pyx_pw_8PyClical_8clifford_93__repr__(PyObject *__pyx_v_self) {
10793 PyObject *__pyx_r = 0;
10794 __Pyx_RefNannyDeclarations
10795 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
10796 __pyx_r = __pyx_pf_8PyClical_8clifford_92__repr__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10799 __Pyx_RefNannyFinishContext();
10803 static PyObject *__pyx_pf_8PyClical_8clifford_92__repr__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10804 PyObject *__pyx_r = NULL;
10805 __Pyx_RefNannyDeclarations
10806 PyObject *__pyx_t_1 = NULL;
10807 __Pyx_RefNannySetupContext(
"__repr__", 0);
10816 __Pyx_XDECREF(__pyx_r);
10817 __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)
10818 __Pyx_GOTREF(__pyx_t_1);
10819 __pyx_r = __pyx_t_1;
10833 __Pyx_XDECREF(__pyx_t_1);
10834 __Pyx_AddTraceback(
"PyClical.clifford.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10837 __Pyx_XGIVEREF(__pyx_r);
10838 __Pyx_RefNannyFinishContext();
10851 static PyObject *__pyx_pw_8PyClical_8clifford_95__str__(PyObject *__pyx_v_self);
10852 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 ";
10853 #if CYTHON_COMPILING_IN_CPYTHON 10854 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_94__str__;
10856 static PyObject *__pyx_pw_8PyClical_8clifford_95__str__(PyObject *__pyx_v_self) {
10857 PyObject *__pyx_r = 0;
10858 __Pyx_RefNannyDeclarations
10859 __Pyx_RefNannySetupContext(
"__str__ (wrapper)", 0);
10860 __pyx_r = __pyx_pf_8PyClical_8clifford_94__str__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10863 __Pyx_RefNannyFinishContext();
10867 static PyObject *__pyx_pf_8PyClical_8clifford_94__str__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10868 PyObject *__pyx_r = NULL;
10869 __Pyx_RefNannyDeclarations
10870 PyObject *__pyx_t_1 = NULL;
10871 __Pyx_RefNannySetupContext(
"__str__", 0);
10880 __Pyx_XDECREF(__pyx_r);
10881 __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)
10882 __Pyx_GOTREF(__pyx_t_1);
10883 __pyx_r = __pyx_t_1;
10897 __Pyx_XDECREF(__pyx_t_1);
10898 __Pyx_AddTraceback(
"PyClical.clifford.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10901 __Pyx_XGIVEREF(__pyx_r);
10902 __Pyx_RefNannyFinishContext();
10913 static PyObject *__pyx_pw_8PyClical_8clifford_97__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10914 static PyObject *__pyx_pw_8PyClical_8clifford_97__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10915 PyObject *__pyx_r = 0;
10916 __Pyx_RefNannyDeclarations
10917 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
10918 __pyx_r = __pyx_pf_8PyClical_8clifford_96__reduce_cython__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10921 __Pyx_RefNannyFinishContext();
10925 static PyObject *__pyx_pf_8PyClical_8clifford_96__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10926 PyObject *__pyx_r = NULL;
10927 __Pyx_RefNannyDeclarations
10928 PyObject *__pyx_t_1 = NULL;
10929 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
10937 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__12, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
10938 __Pyx_GOTREF(__pyx_t_1);
10939 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
10940 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10941 __PYX_ERR(1, 2, __pyx_L1_error)
10951 __Pyx_XDECREF(__pyx_t_1);
10952 __Pyx_AddTraceback(
"PyClical.clifford.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10954 __Pyx_XGIVEREF(__pyx_r);
10955 __Pyx_RefNannyFinishContext();
10967 static PyObject *__pyx_pw_8PyClical_8clifford_99__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
10968 static PyObject *__pyx_pw_8PyClical_8clifford_99__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10969 PyObject *__pyx_r = 0;
10970 __Pyx_RefNannyDeclarations
10971 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
10972 __pyx_r = __pyx_pf_8PyClical_8clifford_98__setstate_cython__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
10975 __Pyx_RefNannyFinishContext();
10979 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) {
10980 PyObject *__pyx_r = NULL;
10981 __Pyx_RefNannyDeclarations
10982 PyObject *__pyx_t_1 = NULL;
10983 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
10990 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__13, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
10991 __Pyx_GOTREF(__pyx_t_1);
10992 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
10993 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10994 __PYX_ERR(1, 4, __pyx_L1_error)
11005 __Pyx_XDECREF(__pyx_t_1);
11006 __Pyx_AddTraceback(
"PyClical.clifford.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11008 __Pyx_XGIVEREF(__pyx_r);
11009 __Pyx_RefNannyFinishContext();
11022 static PyObject *__pyx_pw_8PyClical_9clifford_hidden_doctests(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused);
11023 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 ";
11024 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};
11025 static PyObject *__pyx_pw_8PyClical_9clifford_hidden_doctests(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
11026 PyObject *__pyx_r = 0;
11027 __Pyx_RefNannyDeclarations
11028 __Pyx_RefNannySetupContext(
"clifford_hidden_doctests (wrapper)", 0);
11029 __pyx_r = __pyx_pf_8PyClical_8clifford_hidden_doctests(__pyx_self);
11032 __Pyx_RefNannyFinishContext();
11036 static PyObject *__pyx_pf_8PyClical_8clifford_hidden_doctests(CYTHON_UNUSED PyObject *__pyx_self) {
11037 PyObject *__pyx_r = NULL;
11038 __Pyx_RefNannyDeclarations
11039 __Pyx_RefNannySetupContext(
"clifford_hidden_doctests", 0);
11048 __Pyx_XDECREF(__pyx_r);
11049 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11062 __Pyx_XGIVEREF(__pyx_r);
11063 __Pyx_RefNannyFinishContext();
11075 static PyObject *__pyx_pw_8PyClical_11inv(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11076 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_inv(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11077 PyObject *__pyx_r = NULL;
11078 __Pyx_RefNannyDeclarations
11079 PyObject *__pyx_t_1 = NULL;
11080 PyObject *__pyx_t_2 = NULL;
11081 PyObject *__pyx_t_3 = NULL;
11082 __Pyx_RefNannySetupContext(
"inv", 0);
11091 __Pyx_XDECREF(__pyx_r);
11092 __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)
11093 __Pyx_GOTREF(__pyx_t_2);
11094 __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)
11095 __Pyx_GOTREF(__pyx_t_3);
11096 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11098 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11099 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11100 if (likely(__pyx_t_2)) {
11101 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
11102 __Pyx_INCREF(__pyx_t_2);
11103 __Pyx_INCREF(
function);
11104 __Pyx_DECREF_SET(__pyx_t_3,
function);
11108 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1342, __pyx_L1_error)
11109 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11111 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1342, __pyx_L1_error)
11113 __Pyx_GOTREF(__pyx_t_1);
11114 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11115 __pyx_r = __pyx_t_1;
11129 __Pyx_XDECREF(__pyx_t_1);
11130 __Pyx_XDECREF(__pyx_t_2);
11131 __Pyx_XDECREF(__pyx_t_3);
11132 __Pyx_AddTraceback(
"PyClical.inv", __pyx_clineno, __pyx_lineno, __pyx_filename);
11135 __Pyx_XGIVEREF(__pyx_r);
11136 __Pyx_RefNannyFinishContext();
11141 static PyObject *__pyx_pw_8PyClical_11inv(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11142 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 ";
11143 static PyObject *__pyx_pw_8PyClical_11inv(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11144 PyObject *__pyx_r = 0;
11145 __Pyx_RefNannyDeclarations
11146 __Pyx_RefNannySetupContext(
"inv (wrapper)", 0);
11147 __pyx_r = __pyx_pf_8PyClical_10inv(__pyx_self, ((PyObject *)__pyx_v_obj));
11150 __Pyx_RefNannyFinishContext();
11154 static PyObject *__pyx_pf_8PyClical_10inv(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11155 PyObject *__pyx_r = NULL;
11156 __Pyx_RefNannyDeclarations
11157 PyObject *__pyx_t_1 = NULL;
11158 __Pyx_RefNannySetupContext(
"inv", 0);
11159 __Pyx_XDECREF(__pyx_r);
11160 __pyx_t_1 = __pyx_f_8PyClical_inv(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1329, __pyx_L1_error)
11161 __Pyx_GOTREF(__pyx_t_1);
11162 __pyx_r = __pyx_t_1;
11168 __Pyx_XDECREF(__pyx_t_1);
11169 __Pyx_AddTraceback(
"PyClical.inv", __pyx_clineno, __pyx_lineno, __pyx_filename);
11172 __Pyx_XGIVEREF(__pyx_r);
11173 __Pyx_RefNannyFinishContext();
11185 static PyObject *__pyx_pw_8PyClical_13scalar(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11186 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_scalar(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11187 PyObject *__pyx_r = NULL;
11188 __Pyx_RefNannyDeclarations
11189 PyObject *__pyx_t_1 = NULL;
11190 PyObject *__pyx_t_2 = NULL;
11191 PyObject *__pyx_t_3 = NULL;
11192 __Pyx_RefNannySetupContext(
"scalar", 0);
11201 __Pyx_XDECREF(__pyx_r);
11202 __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)
11203 __Pyx_GOTREF(__pyx_t_2);
11204 __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)
11205 __Pyx_GOTREF(__pyx_t_3);
11206 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11208 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11209 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11210 if (likely(__pyx_t_2)) {
11211 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
11212 __Pyx_INCREF(__pyx_t_2);
11213 __Pyx_INCREF(
function);
11214 __Pyx_DECREF_SET(__pyx_t_3,
function);
11218 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1353, __pyx_L1_error)
11219 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11221 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1353, __pyx_L1_error)
11223 __Pyx_GOTREF(__pyx_t_1);
11224 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11225 __pyx_r = __pyx_t_1;
11239 __Pyx_XDECREF(__pyx_t_1);
11240 __Pyx_XDECREF(__pyx_t_2);
11241 __Pyx_XDECREF(__pyx_t_3);
11242 __Pyx_AddTraceback(
"PyClical.scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
11245 __Pyx_XGIVEREF(__pyx_r);
11246 __Pyx_RefNannyFinishContext();
11251 static PyObject *__pyx_pw_8PyClical_13scalar(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11252 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 ";
11253 static PyObject *__pyx_pw_8PyClical_13scalar(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11254 PyObject *__pyx_r = 0;
11255 __Pyx_RefNannyDeclarations
11256 __Pyx_RefNannySetupContext(
"scalar (wrapper)", 0);
11257 __pyx_r = __pyx_pf_8PyClical_12scalar(__pyx_self, ((PyObject *)__pyx_v_obj));
11260 __Pyx_RefNannyFinishContext();
11264 static PyObject *__pyx_pf_8PyClical_12scalar(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11265 PyObject *__pyx_r = NULL;
11266 __Pyx_RefNannyDeclarations
11267 PyObject *__pyx_t_1 = NULL;
11268 __Pyx_RefNannySetupContext(
"scalar", 0);
11269 __Pyx_XDECREF(__pyx_r);
11270 __pyx_t_1 = __pyx_f_8PyClical_scalar(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1344, __pyx_L1_error)
11271 __Pyx_GOTREF(__pyx_t_1);
11272 __pyx_r = __pyx_t_1;
11278 __Pyx_XDECREF(__pyx_t_1);
11279 __Pyx_AddTraceback(
"PyClical.scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
11282 __Pyx_XGIVEREF(__pyx_r);
11283 __Pyx_RefNannyFinishContext();
11295 static PyObject *__pyx_pw_8PyClical_15real(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11296 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_real(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11297 PyObject *__pyx_r = NULL;
11298 __Pyx_RefNannyDeclarations
11299 PyObject *__pyx_t_1 = NULL;
11300 PyObject *__pyx_t_2 = NULL;
11301 PyObject *__pyx_t_3 = NULL;
11302 __Pyx_RefNannySetupContext(
"real", 0);
11311 __Pyx_XDECREF(__pyx_r);
11312 __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)
11313 __Pyx_GOTREF(__pyx_t_2);
11314 __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)
11315 __Pyx_GOTREF(__pyx_t_3);
11316 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11318 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11319 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11320 if (likely(__pyx_t_2)) {
11321 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
11322 __Pyx_INCREF(__pyx_t_2);
11323 __Pyx_INCREF(
function);
11324 __Pyx_DECREF_SET(__pyx_t_3,
function);
11328 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1364, __pyx_L1_error)
11329 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11331 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1364, __pyx_L1_error)
11333 __Pyx_GOTREF(__pyx_t_1);
11334 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11335 __pyx_r = __pyx_t_1;
11349 __Pyx_XDECREF(__pyx_t_1);
11350 __Pyx_XDECREF(__pyx_t_2);
11351 __Pyx_XDECREF(__pyx_t_3);
11352 __Pyx_AddTraceback(
"PyClical.real", __pyx_clineno, __pyx_lineno, __pyx_filename);
11355 __Pyx_XGIVEREF(__pyx_r);
11356 __Pyx_RefNannyFinishContext();
11361 static PyObject *__pyx_pw_8PyClical_15real(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11362 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 ";
11363 static PyObject *__pyx_pw_8PyClical_15real(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11364 PyObject *__pyx_r = 0;
11365 __Pyx_RefNannyDeclarations
11366 __Pyx_RefNannySetupContext(
"real (wrapper)", 0);
11367 __pyx_r = __pyx_pf_8PyClical_14real(__pyx_self, ((PyObject *)__pyx_v_obj));
11370 __Pyx_RefNannyFinishContext();
11374 static PyObject *__pyx_pf_8PyClical_14real(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11375 PyObject *__pyx_r = NULL;
11376 __Pyx_RefNannyDeclarations
11377 PyObject *__pyx_t_1 = NULL;
11378 __Pyx_RefNannySetupContext(
"real", 0);
11379 __Pyx_XDECREF(__pyx_r);
11380 __pyx_t_1 = __pyx_f_8PyClical_real(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1355, __pyx_L1_error)
11381 __Pyx_GOTREF(__pyx_t_1);
11382 __pyx_r = __pyx_t_1;
11388 __Pyx_XDECREF(__pyx_t_1);
11389 __Pyx_AddTraceback(
"PyClical.real", __pyx_clineno, __pyx_lineno, __pyx_filename);
11392 __Pyx_XGIVEREF(__pyx_r);
11393 __Pyx_RefNannyFinishContext();
11405 static PyObject *__pyx_pw_8PyClical_17imag(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11406 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_imag(CYTHON_UNUSED PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11407 PyObject *__pyx_r = NULL;
11408 __Pyx_RefNannyDeclarations
11409 __Pyx_RefNannySetupContext(
"imag", 0);
11418 __Pyx_XDECREF(__pyx_r);
11419 __Pyx_INCREF(__pyx_float_0_0);
11420 __pyx_r = __pyx_float_0_0;
11433 __Pyx_XGIVEREF(__pyx_r);
11434 __Pyx_RefNannyFinishContext();
11439 static PyObject *__pyx_pw_8PyClical_17imag(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11440 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 ";
11441 static PyObject *__pyx_pw_8PyClical_17imag(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11442 PyObject *__pyx_r = 0;
11443 __Pyx_RefNannyDeclarations
11444 __Pyx_RefNannySetupContext(
"imag (wrapper)", 0);
11445 __pyx_r = __pyx_pf_8PyClical_16imag(__pyx_self, ((PyObject *)__pyx_v_obj));
11448 __Pyx_RefNannyFinishContext();
11452 static PyObject *__pyx_pf_8PyClical_16imag(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11453 PyObject *__pyx_r = NULL;
11454 __Pyx_RefNannyDeclarations
11455 PyObject *__pyx_t_1 = NULL;
11456 __Pyx_RefNannySetupContext(
"imag", 0);
11457 __Pyx_XDECREF(__pyx_r);
11458 __pyx_t_1 = __pyx_f_8PyClical_imag(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1366, __pyx_L1_error)
11459 __Pyx_GOTREF(__pyx_t_1);
11460 __pyx_r = __pyx_t_1;
11466 __Pyx_XDECREF(__pyx_t_1);
11467 __Pyx_AddTraceback(
"PyClical.imag", __pyx_clineno, __pyx_lineno, __pyx_filename);
11470 __Pyx_XGIVEREF(__pyx_r);
11471 __Pyx_RefNannyFinishContext();
11483 static PyObject *__pyx_pw_8PyClical_19pure(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11484 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_pure(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11485 PyObject *__pyx_r = NULL;
11486 __Pyx_RefNannyDeclarations
11487 PyObject *__pyx_t_1 = NULL;
11488 PyObject *__pyx_t_2 = NULL;
11489 PyObject *__pyx_t_3 = NULL;
11490 __Pyx_RefNannySetupContext(
"pure", 0);
11499 __Pyx_XDECREF(__pyx_r);
11500 __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)
11501 __Pyx_GOTREF(__pyx_t_2);
11502 __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)
11503 __Pyx_GOTREF(__pyx_t_3);
11504 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11506 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11507 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11508 if (likely(__pyx_t_2)) {
11509 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
11510 __Pyx_INCREF(__pyx_t_2);
11511 __Pyx_INCREF(
function);
11512 __Pyx_DECREF_SET(__pyx_t_3,
function);
11516 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1386, __pyx_L1_error)
11517 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11519 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1386, __pyx_L1_error)
11521 __Pyx_GOTREF(__pyx_t_1);
11522 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11523 __pyx_r = __pyx_t_1;
11537 __Pyx_XDECREF(__pyx_t_1);
11538 __Pyx_XDECREF(__pyx_t_2);
11539 __Pyx_XDECREF(__pyx_t_3);
11540 __Pyx_AddTraceback(
"PyClical.pure", __pyx_clineno, __pyx_lineno, __pyx_filename);
11543 __Pyx_XGIVEREF(__pyx_r);
11544 __Pyx_RefNannyFinishContext();
11549 static PyObject *__pyx_pw_8PyClical_19pure(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11550 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 ";
11551 static PyObject *__pyx_pw_8PyClical_19pure(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11552 PyObject *__pyx_r = 0;
11553 __Pyx_RefNannyDeclarations
11554 __Pyx_RefNannySetupContext(
"pure (wrapper)", 0);
11555 __pyx_r = __pyx_pf_8PyClical_18pure(__pyx_self, ((PyObject *)__pyx_v_obj));
11558 __Pyx_RefNannyFinishContext();
11562 static PyObject *__pyx_pf_8PyClical_18pure(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11563 PyObject *__pyx_r = NULL;
11564 __Pyx_RefNannyDeclarations
11565 PyObject *__pyx_t_1 = NULL;
11566 __Pyx_RefNannySetupContext(
"pure", 0);
11567 __Pyx_XDECREF(__pyx_r);
11568 __pyx_t_1 = __pyx_f_8PyClical_pure(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1377, __pyx_L1_error)
11569 __Pyx_GOTREF(__pyx_t_1);
11570 __pyx_r = __pyx_t_1;
11576 __Pyx_XDECREF(__pyx_t_1);
11577 __Pyx_AddTraceback(
"PyClical.pure", __pyx_clineno, __pyx_lineno, __pyx_filename);
11580 __Pyx_XGIVEREF(__pyx_r);
11581 __Pyx_RefNannyFinishContext();
11593 static PyObject *__pyx_pw_8PyClical_21even(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11594 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_even(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11595 PyObject *__pyx_r = NULL;
11596 __Pyx_RefNannyDeclarations
11597 PyObject *__pyx_t_1 = NULL;
11598 PyObject *__pyx_t_2 = NULL;
11599 PyObject *__pyx_t_3 = NULL;
11600 __Pyx_RefNannySetupContext(
"even", 0);
11609 __Pyx_XDECREF(__pyx_r);
11610 __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)
11611 __Pyx_GOTREF(__pyx_t_2);
11612 __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)
11613 __Pyx_GOTREF(__pyx_t_3);
11614 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11616 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11617 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11618 if (likely(__pyx_t_2)) {
11619 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
11620 __Pyx_INCREF(__pyx_t_2);
11621 __Pyx_INCREF(
function);
11622 __Pyx_DECREF_SET(__pyx_t_3,
function);
11626 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1395, __pyx_L1_error)
11627 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11629 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1395, __pyx_L1_error)
11631 __Pyx_GOTREF(__pyx_t_1);
11632 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11633 __pyx_r = __pyx_t_1;
11647 __Pyx_XDECREF(__pyx_t_1);
11648 __Pyx_XDECREF(__pyx_t_2);
11649 __Pyx_XDECREF(__pyx_t_3);
11650 __Pyx_AddTraceback(
"PyClical.even", __pyx_clineno, __pyx_lineno, __pyx_filename);
11653 __Pyx_XGIVEREF(__pyx_r);
11654 __Pyx_RefNannyFinishContext();
11659 static PyObject *__pyx_pw_8PyClical_21even(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11660 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 ";
11661 static PyObject *__pyx_pw_8PyClical_21even(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11662 PyObject *__pyx_r = 0;
11663 __Pyx_RefNannyDeclarations
11664 __Pyx_RefNannySetupContext(
"even (wrapper)", 0);
11665 __pyx_r = __pyx_pf_8PyClical_20even(__pyx_self, ((PyObject *)__pyx_v_obj));
11668 __Pyx_RefNannyFinishContext();
11672 static PyObject *__pyx_pf_8PyClical_20even(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11673 PyObject *__pyx_r = NULL;
11674 __Pyx_RefNannyDeclarations
11675 PyObject *__pyx_t_1 = NULL;
11676 __Pyx_RefNannySetupContext(
"even", 0);
11677 __Pyx_XDECREF(__pyx_r);
11678 __pyx_t_1 = __pyx_f_8PyClical_even(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1388, __pyx_L1_error)
11679 __Pyx_GOTREF(__pyx_t_1);
11680 __pyx_r = __pyx_t_1;
11686 __Pyx_XDECREF(__pyx_t_1);
11687 __Pyx_AddTraceback(
"PyClical.even", __pyx_clineno, __pyx_lineno, __pyx_filename);
11690 __Pyx_XGIVEREF(__pyx_r);
11691 __Pyx_RefNannyFinishContext();
11703 static PyObject *__pyx_pw_8PyClical_23odd(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11704 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_odd(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11705 PyObject *__pyx_r = NULL;
11706 __Pyx_RefNannyDeclarations
11707 PyObject *__pyx_t_1 = NULL;
11708 PyObject *__pyx_t_2 = NULL;
11709 PyObject *__pyx_t_3 = NULL;
11710 __Pyx_RefNannySetupContext(
"odd", 0);
11719 __Pyx_XDECREF(__pyx_r);
11720 __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)
11721 __Pyx_GOTREF(__pyx_t_2);
11722 __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)
11723 __Pyx_GOTREF(__pyx_t_3);
11724 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11726 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11727 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11728 if (likely(__pyx_t_2)) {
11729 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
11730 __Pyx_INCREF(__pyx_t_2);
11731 __Pyx_INCREF(
function);
11732 __Pyx_DECREF_SET(__pyx_t_3,
function);
11736 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1404, __pyx_L1_error)
11737 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11739 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1404, __pyx_L1_error)
11741 __Pyx_GOTREF(__pyx_t_1);
11742 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11743 __pyx_r = __pyx_t_1;
11757 __Pyx_XDECREF(__pyx_t_1);
11758 __Pyx_XDECREF(__pyx_t_2);
11759 __Pyx_XDECREF(__pyx_t_3);
11760 __Pyx_AddTraceback(
"PyClical.odd", __pyx_clineno, __pyx_lineno, __pyx_filename);
11763 __Pyx_XGIVEREF(__pyx_r);
11764 __Pyx_RefNannyFinishContext();
11769 static PyObject *__pyx_pw_8PyClical_23odd(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11770 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 ";
11771 static PyObject *__pyx_pw_8PyClical_23odd(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11772 PyObject *__pyx_r = 0;
11773 __Pyx_RefNannyDeclarations
11774 __Pyx_RefNannySetupContext(
"odd (wrapper)", 0);
11775 __pyx_r = __pyx_pf_8PyClical_22odd(__pyx_self, ((PyObject *)__pyx_v_obj));
11778 __Pyx_RefNannyFinishContext();
11782 static PyObject *__pyx_pf_8PyClical_22odd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11783 PyObject *__pyx_r = NULL;
11784 __Pyx_RefNannyDeclarations
11785 PyObject *__pyx_t_1 = NULL;
11786 __Pyx_RefNannySetupContext(
"odd", 0);
11787 __Pyx_XDECREF(__pyx_r);
11788 __pyx_t_1 = __pyx_f_8PyClical_odd(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1397, __pyx_L1_error)
11789 __Pyx_GOTREF(__pyx_t_1);
11790 __pyx_r = __pyx_t_1;
11796 __Pyx_XDECREF(__pyx_t_1);
11797 __Pyx_AddTraceback(
"PyClical.odd", __pyx_clineno, __pyx_lineno, __pyx_filename);
11800 __Pyx_XGIVEREF(__pyx_r);
11801 __Pyx_RefNannyFinishContext();
11813 static PyObject *__pyx_pw_8PyClical_25involute(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11814 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_involute(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11815 PyObject *__pyx_r = NULL;
11816 __Pyx_RefNannyDeclarations
11817 PyObject *__pyx_t_1 = NULL;
11818 PyObject *__pyx_t_2 = NULL;
11819 PyObject *__pyx_t_3 = NULL;
11820 __Pyx_RefNannySetupContext(
"involute", 0);
11829 __Pyx_XDECREF(__pyx_r);
11830 __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)
11831 __Pyx_GOTREF(__pyx_t_2);
11832 __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)
11833 __Pyx_GOTREF(__pyx_t_3);
11834 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11836 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11837 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11838 if (likely(__pyx_t_2)) {
11839 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
11840 __Pyx_INCREF(__pyx_t_2);
11841 __Pyx_INCREF(
function);
11842 __Pyx_DECREF_SET(__pyx_t_3,
function);
11846 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1419, __pyx_L1_error)
11847 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11849 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1419, __pyx_L1_error)
11851 __Pyx_GOTREF(__pyx_t_1);
11852 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11853 __pyx_r = __pyx_t_1;
11867 __Pyx_XDECREF(__pyx_t_1);
11868 __Pyx_XDECREF(__pyx_t_2);
11869 __Pyx_XDECREF(__pyx_t_3);
11870 __Pyx_AddTraceback(
"PyClical.involute", __pyx_clineno, __pyx_lineno, __pyx_filename);
11873 __Pyx_XGIVEREF(__pyx_r);
11874 __Pyx_RefNannyFinishContext();
11879 static PyObject *__pyx_pw_8PyClical_25involute(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11880 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 ";
11881 static PyObject *__pyx_pw_8PyClical_25involute(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11882 PyObject *__pyx_r = 0;
11883 __Pyx_RefNannyDeclarations
11884 __Pyx_RefNannySetupContext(
"involute (wrapper)", 0);
11885 __pyx_r = __pyx_pf_8PyClical_24involute(__pyx_self, ((PyObject *)__pyx_v_obj));
11888 __Pyx_RefNannyFinishContext();
11892 static PyObject *__pyx_pf_8PyClical_24involute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11893 PyObject *__pyx_r = NULL;
11894 __Pyx_RefNannyDeclarations
11895 PyObject *__pyx_t_1 = NULL;
11896 __Pyx_RefNannySetupContext(
"involute", 0);
11897 __Pyx_XDECREF(__pyx_r);
11898 __pyx_t_1 = __pyx_f_8PyClical_involute(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1406, __pyx_L1_error)
11899 __Pyx_GOTREF(__pyx_t_1);
11900 __pyx_r = __pyx_t_1;
11906 __Pyx_XDECREF(__pyx_t_1);
11907 __Pyx_AddTraceback(
"PyClical.involute", __pyx_clineno, __pyx_lineno, __pyx_filename);
11910 __Pyx_XGIVEREF(__pyx_r);
11911 __Pyx_RefNannyFinishContext();
11923 static PyObject *__pyx_pw_8PyClical_27reverse(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11924 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_reverse(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11925 PyObject *__pyx_r = NULL;
11926 __Pyx_RefNannyDeclarations
11927 PyObject *__pyx_t_1 = NULL;
11928 PyObject *__pyx_t_2 = NULL;
11929 PyObject *__pyx_t_3 = NULL;
11930 __Pyx_RefNannySetupContext(
"reverse", 0);
11939 __Pyx_XDECREF(__pyx_r);
11940 __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)
11941 __Pyx_GOTREF(__pyx_t_2);
11942 __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)
11943 __Pyx_GOTREF(__pyx_t_3);
11944 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11946 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11947 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11948 if (likely(__pyx_t_2)) {
11949 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
11950 __Pyx_INCREF(__pyx_t_2);
11951 __Pyx_INCREF(
function);
11952 __Pyx_DECREF_SET(__pyx_t_3,
function);
11956 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1434, __pyx_L1_error)
11957 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11959 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1434, __pyx_L1_error)
11961 __Pyx_GOTREF(__pyx_t_1);
11962 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11963 __pyx_r = __pyx_t_1;
11977 __Pyx_XDECREF(__pyx_t_1);
11978 __Pyx_XDECREF(__pyx_t_2);
11979 __Pyx_XDECREF(__pyx_t_3);
11980 __Pyx_AddTraceback(
"PyClical.reverse", __pyx_clineno, __pyx_lineno, __pyx_filename);
11983 __Pyx_XGIVEREF(__pyx_r);
11984 __Pyx_RefNannyFinishContext();
11989 static PyObject *__pyx_pw_8PyClical_27reverse(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11990 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 ";
11991 static PyObject *__pyx_pw_8PyClical_27reverse(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11992 PyObject *__pyx_r = 0;
11993 __Pyx_RefNannyDeclarations
11994 __Pyx_RefNannySetupContext(
"reverse (wrapper)", 0);
11995 __pyx_r = __pyx_pf_8PyClical_26reverse(__pyx_self, ((PyObject *)__pyx_v_obj));
11998 __Pyx_RefNannyFinishContext();
12002 static PyObject *__pyx_pf_8PyClical_26reverse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12003 PyObject *__pyx_r = NULL;
12004 __Pyx_RefNannyDeclarations
12005 PyObject *__pyx_t_1 = NULL;
12006 __Pyx_RefNannySetupContext(
"reverse", 0);
12007 __Pyx_XDECREF(__pyx_r);
12008 __pyx_t_1 = __pyx_f_8PyClical_reverse(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1421, __pyx_L1_error)
12009 __Pyx_GOTREF(__pyx_t_1);
12010 __pyx_r = __pyx_t_1;
12016 __Pyx_XDECREF(__pyx_t_1);
12017 __Pyx_AddTraceback(
"PyClical.reverse", __pyx_clineno, __pyx_lineno, __pyx_filename);
12020 __Pyx_XGIVEREF(__pyx_r);
12021 __Pyx_RefNannyFinishContext();
12033 static PyObject *__pyx_pw_8PyClical_29conj(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12034 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_conj(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12035 PyObject *__pyx_r = NULL;
12036 __Pyx_RefNannyDeclarations
12037 PyObject *__pyx_t_1 = NULL;
12038 PyObject *__pyx_t_2 = NULL;
12039 PyObject *__pyx_t_3 = NULL;
12040 __Pyx_RefNannySetupContext(
"conj", 0);
12049 __Pyx_XDECREF(__pyx_r);
12050 __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)
12051 __Pyx_GOTREF(__pyx_t_2);
12052 __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)
12053 __Pyx_GOTREF(__pyx_t_3);
12054 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12056 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
12057 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
12058 if (likely(__pyx_t_2)) {
12059 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
12060 __Pyx_INCREF(__pyx_t_2);
12061 __Pyx_INCREF(
function);
12062 __Pyx_DECREF_SET(__pyx_t_3,
function);
12066 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1449, __pyx_L1_error)
12067 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12069 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1449, __pyx_L1_error)
12071 __Pyx_GOTREF(__pyx_t_1);
12072 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12073 __pyx_r = __pyx_t_1;
12087 __Pyx_XDECREF(__pyx_t_1);
12088 __Pyx_XDECREF(__pyx_t_2);
12089 __Pyx_XDECREF(__pyx_t_3);
12090 __Pyx_AddTraceback(
"PyClical.conj", __pyx_clineno, __pyx_lineno, __pyx_filename);
12093 __Pyx_XGIVEREF(__pyx_r);
12094 __Pyx_RefNannyFinishContext();
12099 static PyObject *__pyx_pw_8PyClical_29conj(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12100 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 ";
12101 static PyObject *__pyx_pw_8PyClical_29conj(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12102 PyObject *__pyx_r = 0;
12103 __Pyx_RefNannyDeclarations
12104 __Pyx_RefNannySetupContext(
"conj (wrapper)", 0);
12105 __pyx_r = __pyx_pf_8PyClical_28conj(__pyx_self, ((PyObject *)__pyx_v_obj));
12108 __Pyx_RefNannyFinishContext();
12112 static PyObject *__pyx_pf_8PyClical_28conj(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12113 PyObject *__pyx_r = NULL;
12114 __Pyx_RefNannyDeclarations
12115 PyObject *__pyx_t_1 = NULL;
12116 __Pyx_RefNannySetupContext(
"conj", 0);
12117 __Pyx_XDECREF(__pyx_r);
12118 __pyx_t_1 = __pyx_f_8PyClical_conj(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1436, __pyx_L1_error)
12119 __Pyx_GOTREF(__pyx_t_1);
12120 __pyx_r = __pyx_t_1;
12126 __Pyx_XDECREF(__pyx_t_1);
12127 __Pyx_AddTraceback(
"PyClical.conj", __pyx_clineno, __pyx_lineno, __pyx_filename);
12130 __Pyx_XGIVEREF(__pyx_r);
12131 __Pyx_RefNannyFinishContext();
12143 static PyObject *__pyx_pw_8PyClical_31quad(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12144 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_quad(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12145 PyObject *__pyx_r = NULL;
12146 __Pyx_RefNannyDeclarations
12147 PyObject *__pyx_t_1 = NULL;
12148 PyObject *__pyx_t_2 = NULL;
12149 PyObject *__pyx_t_3 = NULL;
12150 __Pyx_RefNannySetupContext(
"quad", 0);
12159 __Pyx_XDECREF(__pyx_r);
12160 __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)
12161 __Pyx_GOTREF(__pyx_t_2);
12162 __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)
12163 __Pyx_GOTREF(__pyx_t_3);
12164 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12166 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
12167 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
12168 if (likely(__pyx_t_2)) {
12169 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
12170 __Pyx_INCREF(__pyx_t_2);
12171 __Pyx_INCREF(
function);
12172 __Pyx_DECREF_SET(__pyx_t_3,
function);
12176 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1460, __pyx_L1_error)
12177 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12179 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1460, __pyx_L1_error)
12181 __Pyx_GOTREF(__pyx_t_1);
12182 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12183 __pyx_r = __pyx_t_1;
12197 __Pyx_XDECREF(__pyx_t_1);
12198 __Pyx_XDECREF(__pyx_t_2);
12199 __Pyx_XDECREF(__pyx_t_3);
12200 __Pyx_AddTraceback(
"PyClical.quad", __pyx_clineno, __pyx_lineno, __pyx_filename);
12203 __Pyx_XGIVEREF(__pyx_r);
12204 __Pyx_RefNannyFinishContext();
12209 static PyObject *__pyx_pw_8PyClical_31quad(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12210 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 ";
12211 static PyObject *__pyx_pw_8PyClical_31quad(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12212 PyObject *__pyx_r = 0;
12213 __Pyx_RefNannyDeclarations
12214 __Pyx_RefNannySetupContext(
"quad (wrapper)", 0);
12215 __pyx_r = __pyx_pf_8PyClical_30quad(__pyx_self, ((PyObject *)__pyx_v_obj));
12218 __Pyx_RefNannyFinishContext();
12222 static PyObject *__pyx_pf_8PyClical_30quad(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12223 PyObject *__pyx_r = NULL;
12224 __Pyx_RefNannyDeclarations
12225 PyObject *__pyx_t_1 = NULL;
12226 __Pyx_RefNannySetupContext(
"quad", 0);
12227 __Pyx_XDECREF(__pyx_r);
12228 __pyx_t_1 = __pyx_f_8PyClical_quad(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1451, __pyx_L1_error)
12229 __Pyx_GOTREF(__pyx_t_1);
12230 __pyx_r = __pyx_t_1;
12236 __Pyx_XDECREF(__pyx_t_1);
12237 __Pyx_AddTraceback(
"PyClical.quad", __pyx_clineno, __pyx_lineno, __pyx_filename);
12240 __Pyx_XGIVEREF(__pyx_r);
12241 __Pyx_RefNannyFinishContext();
12253 static PyObject *__pyx_pw_8PyClical_33norm(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12254 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_norm(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12255 PyObject *__pyx_r = NULL;
12256 __Pyx_RefNannyDeclarations
12257 PyObject *__pyx_t_1 = NULL;
12258 PyObject *__pyx_t_2 = NULL;
12259 PyObject *__pyx_t_3 = NULL;
12260 __Pyx_RefNannySetupContext(
"norm", 0);
12269 __Pyx_XDECREF(__pyx_r);
12270 __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)
12271 __Pyx_GOTREF(__pyx_t_2);
12272 __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)
12273 __Pyx_GOTREF(__pyx_t_3);
12274 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12276 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
12277 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
12278 if (likely(__pyx_t_2)) {
12279 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
12280 __Pyx_INCREF(__pyx_t_2);
12281 __Pyx_INCREF(
function);
12282 __Pyx_DECREF_SET(__pyx_t_3,
function);
12286 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1471, __pyx_L1_error)
12287 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12289 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1471, __pyx_L1_error)
12291 __Pyx_GOTREF(__pyx_t_1);
12292 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12293 __pyx_r = __pyx_t_1;
12307 __Pyx_XDECREF(__pyx_t_1);
12308 __Pyx_XDECREF(__pyx_t_2);
12309 __Pyx_XDECREF(__pyx_t_3);
12310 __Pyx_AddTraceback(
"PyClical.norm", __pyx_clineno, __pyx_lineno, __pyx_filename);
12313 __Pyx_XGIVEREF(__pyx_r);
12314 __Pyx_RefNannyFinishContext();
12319 static PyObject *__pyx_pw_8PyClical_33norm(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12320 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 ";
12321 static PyObject *__pyx_pw_8PyClical_33norm(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12322 PyObject *__pyx_r = 0;
12323 __Pyx_RefNannyDeclarations
12324 __Pyx_RefNannySetupContext(
"norm (wrapper)", 0);
12325 __pyx_r = __pyx_pf_8PyClical_32norm(__pyx_self, ((PyObject *)__pyx_v_obj));
12328 __Pyx_RefNannyFinishContext();
12332 static PyObject *__pyx_pf_8PyClical_32norm(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12333 PyObject *__pyx_r = NULL;
12334 __Pyx_RefNannyDeclarations
12335 PyObject *__pyx_t_1 = NULL;
12336 __Pyx_RefNannySetupContext(
"norm", 0);
12337 __Pyx_XDECREF(__pyx_r);
12338 __pyx_t_1 = __pyx_f_8PyClical_norm(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1462, __pyx_L1_error)
12339 __Pyx_GOTREF(__pyx_t_1);
12340 __pyx_r = __pyx_t_1;
12346 __Pyx_XDECREF(__pyx_t_1);
12347 __Pyx_AddTraceback(
"PyClical.norm", __pyx_clineno, __pyx_lineno, __pyx_filename);
12350 __Pyx_XGIVEREF(__pyx_r);
12351 __Pyx_RefNannyFinishContext();
12363 static PyObject *__pyx_pw_8PyClical_35abs(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12364 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_abs(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12365 PyObject *__pyx_r = NULL;
12366 __Pyx_RefNannyDeclarations
12367 PyObject *__pyx_t_1 = NULL;
12368 __Pyx_RefNannySetupContext(
"abs", 0);
12377 __Pyx_XDECREF(__pyx_r);
12378 __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)
12379 __Pyx_GOTREF(__pyx_t_1);
12380 __pyx_r = __pyx_t_1;
12394 __Pyx_XDECREF(__pyx_t_1);
12395 __Pyx_AddTraceback(
"PyClical.abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
12398 __Pyx_XGIVEREF(__pyx_r);
12399 __Pyx_RefNannyFinishContext();
12404 static PyObject *__pyx_pw_8PyClical_35abs(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12405 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 ";
12406 static PyObject *__pyx_pw_8PyClical_35abs(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12407 PyObject *__pyx_r = 0;
12408 __Pyx_RefNannyDeclarations
12409 __Pyx_RefNannySetupContext(
"abs (wrapper)", 0);
12410 __pyx_r = __pyx_pf_8PyClical_34abs(__pyx_self, ((PyObject *)__pyx_v_obj));
12413 __Pyx_RefNannyFinishContext();
12417 static PyObject *__pyx_pf_8PyClical_34abs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12418 PyObject *__pyx_r = NULL;
12419 __Pyx_RefNannyDeclarations
12420 PyObject *__pyx_t_1 = NULL;
12421 __Pyx_RefNannySetupContext(
"abs", 0);
12422 __Pyx_XDECREF(__pyx_r);
12423 __pyx_t_1 = __pyx_f_8PyClical_abs(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1473, __pyx_L1_error)
12424 __Pyx_GOTREF(__pyx_t_1);
12425 __pyx_r = __pyx_t_1;
12431 __Pyx_XDECREF(__pyx_t_1);
12432 __Pyx_AddTraceback(
"PyClical.abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
12435 __Pyx_XGIVEREF(__pyx_r);
12436 __Pyx_RefNannyFinishContext();
12448 static PyObject *__pyx_pw_8PyClical_37max_abs(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12449 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_max_abs(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12450 PyObject *__pyx_r = NULL;
12451 __Pyx_RefNannyDeclarations
12452 PyObject *__pyx_t_1 = NULL;
12453 __Pyx_RefNannySetupContext(
"max_abs", 0);
12462 __Pyx_XDECREF(__pyx_r);
12463 __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)
12464 __Pyx_GOTREF(__pyx_t_1);
12465 __pyx_r = __pyx_t_1;
12479 __Pyx_XDECREF(__pyx_t_1);
12480 __Pyx_AddTraceback(
"PyClical.max_abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
12483 __Pyx_XGIVEREF(__pyx_r);
12484 __Pyx_RefNannyFinishContext();
12489 static PyObject *__pyx_pw_8PyClical_37max_abs(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12490 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 ";
12491 static PyObject *__pyx_pw_8PyClical_37max_abs(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12492 PyObject *__pyx_r = 0;
12493 __Pyx_RefNannyDeclarations
12494 __Pyx_RefNannySetupContext(
"max_abs (wrapper)", 0);
12495 __pyx_r = __pyx_pf_8PyClical_36max_abs(__pyx_self, ((PyObject *)__pyx_v_obj));
12498 __Pyx_RefNannyFinishContext();
12502 static PyObject *__pyx_pf_8PyClical_36max_abs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12503 PyObject *__pyx_r = NULL;
12504 __Pyx_RefNannyDeclarations
12505 PyObject *__pyx_t_1 = NULL;
12506 __Pyx_RefNannySetupContext(
"max_abs", 0);
12507 __Pyx_XDECREF(__pyx_r);
12508 __pyx_t_1 = __pyx_f_8PyClical_max_abs(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1482, __pyx_L1_error)
12509 __Pyx_GOTREF(__pyx_t_1);
12510 __pyx_r = __pyx_t_1;
12516 __Pyx_XDECREF(__pyx_t_1);
12517 __Pyx_AddTraceback(
"PyClical.max_abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
12520 __Pyx_XGIVEREF(__pyx_r);
12521 __Pyx_RefNannyFinishContext();
12533 static PyObject *__pyx_pw_8PyClical_39pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
12534 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_pow(PyObject *__pyx_v_obj, PyObject *__pyx_v_m, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12535 PyObject *__pyx_r = NULL;
12536 __Pyx_RefNannyDeclarations
12537 PyObject *__pyx_t_1 = NULL;
12538 PyObject *__pyx_t_2 = NULL;
12539 PyObject *__pyx_t_3 = NULL;
12540 PyObject *__pyx_t_4 = NULL;
12541 PyObject *__pyx_t_5 = NULL;
12542 PyObject *__pyx_t_6 = NULL;
12544 PyObject *__pyx_t_8 = NULL;
12545 PyObject *__pyx_t_9 = NULL;
12546 PyObject *__pyx_t_10 = NULL;
12547 PyObject *__pyx_t_11 = NULL;
12548 __Pyx_RefNannySetupContext(
"pow", 0);
12558 __Pyx_PyThreadState_declare
12559 __Pyx_PyThreadState_assign
12560 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
12561 __Pyx_XGOTREF(__pyx_t_1);
12562 __Pyx_XGOTREF(__pyx_t_2);
12563 __Pyx_XGOTREF(__pyx_t_3);
12573 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1514, __pyx_L3_error)
12574 __Pyx_GOTREF(__pyx_t_5);
12575 __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)
12576 __Pyx_GOTREF(__pyx_t_6);
12577 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12580 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
12581 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
12582 if (likely(__pyx_t_5)) {
12583 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
12584 __Pyx_INCREF(__pyx_t_5);
12585 __Pyx_INCREF(
function);
12586 __Pyx_DECREF_SET(__pyx_t_6,
function);
12590 #if CYTHON_FAST_PYCALL 12591 if (PyFunction_Check(__pyx_t_6)) {
12592 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_obj, __pyx_v_m};
12593 __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)
12594 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12595 __Pyx_GOTREF(__pyx_t_4);
12598 #if CYTHON_FAST_PYCCALL 12599 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
12600 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_obj, __pyx_v_m};
12601 __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)
12602 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12603 __Pyx_GOTREF(__pyx_t_4);
12607 __pyx_t_8 = PyTuple_New(2+__pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1514, __pyx_L3_error)
12608 __Pyx_GOTREF(__pyx_t_8);
12610 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
12612 __Pyx_INCREF(__pyx_v_obj);
12613 __Pyx_GIVEREF(__pyx_v_obj);
12614 PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_obj);
12615 __Pyx_INCREF(__pyx_v_m);
12616 __Pyx_GIVEREF(__pyx_v_m);
12617 PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_m);
12618 __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)
12619 __Pyx_GOTREF(__pyx_t_4);
12620 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12622 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12623 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12633 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12634 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12635 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12636 goto __pyx_L8_try_end;
12638 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12639 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
12640 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12641 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12651 __Pyx_AddTraceback(
"PyClical.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
12652 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_8) < 0) __PYX_ERR(0, 1515, __pyx_L5_except_error)
12653 __Pyx_GOTREF(__pyx_t_4);
12654 __Pyx_GOTREF(__pyx_t_6);
12655 __Pyx_GOTREF(__pyx_t_8);
12664 __Pyx_XDECREF(__pyx_r);
12665 __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)
12666 __Pyx_GOTREF(__pyx_t_9);
12667 __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)
12668 __Pyx_GOTREF(__pyx_t_10);
12669 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12671 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
12672 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
12673 if (likely(__pyx_t_9)) {
12674 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_10);
12675 __Pyx_INCREF(__pyx_t_9);
12676 __Pyx_INCREF(
function);
12677 __Pyx_DECREF_SET(__pyx_t_10,
function);
12681 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_m);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1516, __pyx_L5_except_error)
12682 __Pyx_GOTREF(__pyx_t_5);
12684 #if CYTHON_FAST_PYCALL 12685 if (PyFunction_Check(__pyx_t_10)) {
12686 PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_v_m};
12687 __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1516, __pyx_L5_except_error)
12688 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
12689 __Pyx_GOTREF(__pyx_t_5);
12692 #if CYTHON_FAST_PYCCALL 12693 if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
12694 PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_v_m};
12695 __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1516, __pyx_L5_except_error)
12696 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
12697 __Pyx_GOTREF(__pyx_t_5);
12701 __pyx_t_11 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1516, __pyx_L5_except_error)
12702 __Pyx_GOTREF(__pyx_t_11);
12703 __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
12704 __Pyx_INCREF(__pyx_v_m);
12705 __Pyx_GIVEREF(__pyx_v_m);
12706 PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_v_m);
12707 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1516, __pyx_L5_except_error)
12708 __Pyx_GOTREF(__pyx_t_5);
12709 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
12712 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12713 __pyx_r = __pyx_t_5;
12715 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12716 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12717 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12718 goto __pyx_L6_except_return;
12720 __pyx_L5_except_error:;
12729 __Pyx_XGIVEREF(__pyx_t_1);
12730 __Pyx_XGIVEREF(__pyx_t_2);
12731 __Pyx_XGIVEREF(__pyx_t_3);
12732 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
12733 goto __pyx_L1_error;
12734 __pyx_L6_except_return:;
12735 __Pyx_XGIVEREF(__pyx_t_1);
12736 __Pyx_XGIVEREF(__pyx_t_2);
12737 __Pyx_XGIVEREF(__pyx_t_3);
12738 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
12752 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12755 __Pyx_XDECREF(__pyx_t_4);
12756 __Pyx_XDECREF(__pyx_t_5);
12757 __Pyx_XDECREF(__pyx_t_6);
12758 __Pyx_XDECREF(__pyx_t_8);
12759 __Pyx_XDECREF(__pyx_t_9);
12760 __Pyx_XDECREF(__pyx_t_10);
12761 __Pyx_XDECREF(__pyx_t_11);
12762 __Pyx_AddTraceback(
"PyClical.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
12765 __Pyx_XGIVEREF(__pyx_r);
12766 __Pyx_RefNannyFinishContext();
12771 static PyObject *__pyx_pw_8PyClical_39pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
12772 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 ";
12773 static PyObject *__pyx_pw_8PyClical_39pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
12774 PyObject *__pyx_v_obj = 0;
12775 PyObject *__pyx_v_m = 0;
12776 PyObject *__pyx_r = 0;
12777 __Pyx_RefNannyDeclarations
12778 __Pyx_RefNannySetupContext(
"pow (wrapper)", 0);
12780 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_m,0};
12781 PyObject* values[2] = {0,0};
12782 if (unlikely(__pyx_kwds)) {
12783 Py_ssize_t kw_args;
12784 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
12785 switch (pos_args) {
12786 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12787 CYTHON_FALLTHROUGH;
12788 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12789 CYTHON_FALLTHROUGH;
12791 default:
goto __pyx_L5_argtuple_error;
12793 kw_args = PyDict_Size(__pyx_kwds);
12794 switch (pos_args) {
12796 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
12797 else goto __pyx_L5_argtuple_error;
12798 CYTHON_FALLTHROUGH;
12800 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
12802 __Pyx_RaiseArgtupleInvalid(
"pow", 1, 2, 2, 1); __PYX_ERR(0, 1494, __pyx_L3_error)
12805 if (unlikely(kw_args > 0)) {
12806 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"pow") < 0)) __PYX_ERR(0, 1494, __pyx_L3_error)
12808 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
12809 goto __pyx_L5_argtuple_error;
12811 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12812 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12814 __pyx_v_obj = values[0];
12815 __pyx_v_m = values[1];
12817 goto __pyx_L4_argument_unpacking_done;
12818 __pyx_L5_argtuple_error:;
12819 __Pyx_RaiseArgtupleInvalid(
"pow", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1494, __pyx_L3_error)
12821 __Pyx_AddTraceback(
"PyClical.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
12822 __Pyx_RefNannyFinishContext();
12824 __pyx_L4_argument_unpacking_done:;
12825 __pyx_r = __pyx_pf_8PyClical_38pow(__pyx_self, __pyx_v_obj, __pyx_v_m);
12828 __Pyx_RefNannyFinishContext();
12832 static PyObject *__pyx_pf_8PyClical_38pow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_m) {
12833 PyObject *__pyx_r = NULL;
12834 __Pyx_RefNannyDeclarations
12835 PyObject *__pyx_t_1 = NULL;
12836 __Pyx_RefNannySetupContext(
"pow", 0);
12837 __Pyx_XDECREF(__pyx_r);
12838 __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)
12839 __Pyx_GOTREF(__pyx_t_1);
12840 __pyx_r = __pyx_t_1;
12846 __Pyx_XDECREF(__pyx_t_1);
12847 __Pyx_AddTraceback(
"PyClical.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
12850 __Pyx_XGIVEREF(__pyx_r);
12851 __Pyx_RefNannyFinishContext();
12863 static PyObject *__pyx_pw_8PyClical_41outer_pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
12864 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_outer_pow(PyObject *__pyx_v_obj, PyObject *__pyx_v_m, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12865 PyObject *__pyx_r = NULL;
12866 __Pyx_RefNannyDeclarations
12867 PyObject *__pyx_t_1 = NULL;
12868 PyObject *__pyx_t_2 = NULL;
12869 PyObject *__pyx_t_3 = NULL;
12870 PyObject *__pyx_t_4 = NULL;
12871 __Pyx_RefNannySetupContext(
"outer_pow", 0);
12880 __Pyx_XDECREF(__pyx_r);
12881 __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)
12882 __Pyx_GOTREF(__pyx_t_2);
12883 __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)
12884 __Pyx_GOTREF(__pyx_t_3);
12885 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12887 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
12888 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
12889 if (likely(__pyx_t_2)) {
12890 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
12891 __Pyx_INCREF(__pyx_t_2);
12892 __Pyx_INCREF(
function);
12893 __Pyx_DECREF_SET(__pyx_t_3,
function);
12897 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_m);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1525, __pyx_L1_error)
12898 __Pyx_GOTREF(__pyx_t_1);
12900 #if CYTHON_FAST_PYCALL 12901 if (PyFunction_Check(__pyx_t_3)) {
12902 PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_v_m};
12903 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1525, __pyx_L1_error)
12904 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12905 __Pyx_GOTREF(__pyx_t_1);
12908 #if CYTHON_FAST_PYCCALL 12909 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
12910 PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_v_m};
12911 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1525, __pyx_L1_error)
12912 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12913 __Pyx_GOTREF(__pyx_t_1);
12917 __pyx_t_4 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1525, __pyx_L1_error)
12918 __Pyx_GOTREF(__pyx_t_4);
12919 __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL;
12920 __Pyx_INCREF(__pyx_v_m);
12921 __Pyx_GIVEREF(__pyx_v_m);
12922 PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_m);
12923 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1525, __pyx_L1_error)
12924 __Pyx_GOTREF(__pyx_t_1);
12925 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12928 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12929 __pyx_r = __pyx_t_1;
12943 __Pyx_XDECREF(__pyx_t_1);
12944 __Pyx_XDECREF(__pyx_t_2);
12945 __Pyx_XDECREF(__pyx_t_3);
12946 __Pyx_XDECREF(__pyx_t_4);
12947 __Pyx_AddTraceback(
"PyClical.outer_pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
12950 __Pyx_XGIVEREF(__pyx_r);
12951 __Pyx_RefNannyFinishContext();
12956 static PyObject *__pyx_pw_8PyClical_41outer_pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
12957 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 ";
12958 static PyObject *__pyx_pw_8PyClical_41outer_pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
12959 PyObject *__pyx_v_obj = 0;
12960 PyObject *__pyx_v_m = 0;
12961 PyObject *__pyx_r = 0;
12962 __Pyx_RefNannyDeclarations
12963 __Pyx_RefNannySetupContext(
"outer_pow (wrapper)", 0);
12965 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_m,0};
12966 PyObject* values[2] = {0,0};
12967 if (unlikely(__pyx_kwds)) {
12968 Py_ssize_t kw_args;
12969 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
12970 switch (pos_args) {
12971 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12972 CYTHON_FALLTHROUGH;
12973 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12974 CYTHON_FALLTHROUGH;
12976 default:
goto __pyx_L5_argtuple_error;
12978 kw_args = PyDict_Size(__pyx_kwds);
12979 switch (pos_args) {
12981 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
12982 else goto __pyx_L5_argtuple_error;
12983 CYTHON_FALLTHROUGH;
12985 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
12987 __Pyx_RaiseArgtupleInvalid(
"outer_pow", 1, 2, 2, 1); __PYX_ERR(0, 1518, __pyx_L3_error)
12990 if (unlikely(kw_args > 0)) {
12991 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"outer_pow") < 0)) __PYX_ERR(0, 1518, __pyx_L3_error)
12993 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
12994 goto __pyx_L5_argtuple_error;
12996 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12997 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12999 __pyx_v_obj = values[0];
13000 __pyx_v_m = values[1];
13002 goto __pyx_L4_argument_unpacking_done;
13003 __pyx_L5_argtuple_error:;
13004 __Pyx_RaiseArgtupleInvalid(
"outer_pow", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1518, __pyx_L3_error)
13006 __Pyx_AddTraceback(
"PyClical.outer_pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
13007 __Pyx_RefNannyFinishContext();
13009 __pyx_L4_argument_unpacking_done:;
13010 __pyx_r = __pyx_pf_8PyClical_40outer_pow(__pyx_self, __pyx_v_obj, __pyx_v_m);
13013 __Pyx_RefNannyFinishContext();
13017 static PyObject *__pyx_pf_8PyClical_40outer_pow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_m) {
13018 PyObject *__pyx_r = NULL;
13019 __Pyx_RefNannyDeclarations
13020 PyObject *__pyx_t_1 = NULL;
13021 __Pyx_RefNannySetupContext(
"outer_pow", 0);
13022 __Pyx_XDECREF(__pyx_r);
13023 __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)
13024 __Pyx_GOTREF(__pyx_t_1);
13025 __pyx_r = __pyx_t_1;
13031 __Pyx_XDECREF(__pyx_t_1);
13032 __Pyx_AddTraceback(
"PyClical.outer_pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
13035 __Pyx_XGIVEREF(__pyx_r);
13036 __Pyx_RefNannyFinishContext();
13048 static PyObject *__pyx_pw_8PyClical_43complexifier(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13049 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_complexifier(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
13050 PyObject *__pyx_r = NULL;
13051 __Pyx_RefNannyDeclarations
13052 PyObject *__pyx_t_1 = NULL;
13053 PyObject *__pyx_t_2 = NULL;
13054 __Pyx_RefNannySetupContext(
"complexifier", 0);
13063 __Pyx_XDECREF(__pyx_r);
13064 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1540, __pyx_L1_error)
13065 __Pyx_GOTREF(__pyx_t_1);
13066 __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)
13067 __Pyx_GOTREF(__pyx_t_2);
13068 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13069 __pyx_r = __pyx_t_2;
13083 __Pyx_XDECREF(__pyx_t_1);
13084 __Pyx_XDECREF(__pyx_t_2);
13085 __Pyx_AddTraceback(
"PyClical.complexifier", __pyx_clineno, __pyx_lineno, __pyx_filename);
13088 __Pyx_XGIVEREF(__pyx_r);
13089 __Pyx_RefNannyFinishContext();
13094 static PyObject *__pyx_pw_8PyClical_43complexifier(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13095 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 ";
13096 static PyObject *__pyx_pw_8PyClical_43complexifier(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13097 PyObject *__pyx_r = 0;
13098 __Pyx_RefNannyDeclarations
13099 __Pyx_RefNannySetupContext(
"complexifier (wrapper)", 0);
13100 __pyx_r = __pyx_pf_8PyClical_42complexifier(__pyx_self, ((PyObject *)__pyx_v_obj));
13103 __Pyx_RefNannyFinishContext();
13107 static PyObject *__pyx_pf_8PyClical_42complexifier(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13108 PyObject *__pyx_r = NULL;
13109 __Pyx_RefNannyDeclarations
13110 PyObject *__pyx_t_1 = NULL;
13111 __Pyx_RefNannySetupContext(
"complexifier", 0);
13112 __Pyx_XDECREF(__pyx_r);
13113 __pyx_t_1 = __pyx_f_8PyClical_complexifier(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1527, __pyx_L1_error)
13114 __Pyx_GOTREF(__pyx_t_1);
13115 __pyx_r = __pyx_t_1;
13121 __Pyx_XDECREF(__pyx_t_1);
13122 __Pyx_AddTraceback(
"PyClical.complexifier", __pyx_clineno, __pyx_lineno, __pyx_filename);
13125 __Pyx_XGIVEREF(__pyx_r);
13126 __Pyx_RefNannyFinishContext();
13138 static PyObject *__pyx_pw_8PyClical_45sqrt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13139 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) {
13140 PyObject *__pyx_v_i = ((PyObject *)Py_None);
13141 PyObject *__pyx_r = NULL;
13142 __Pyx_RefNannyDeclarations
13145 PyObject *__pyx_t_3 = NULL;
13147 PyObject *__pyx_t_5 = NULL;
13148 PyObject *__pyx_t_6 = NULL;
13149 PyObject *__pyx_t_7 = NULL;
13150 PyObject *__pyx_t_8 = NULL;
13151 PyObject *__pyx_t_9 = NULL;
13152 PyObject *__pyx_t_10 = NULL;
13153 PyObject *__pyx_t_11 = NULL;
13154 __Pyx_RefNannySetupContext(
"sqrt", 0);
13155 if (__pyx_optional_args) {
13156 if (__pyx_optional_args->__pyx_n > 0) {
13157 __pyx_v_i = __pyx_optional_args->i;
13168 __pyx_t_1 = (__pyx_v_i != Py_None);
13169 __pyx_t_2 = (__pyx_t_1 != 0);
13179 __Pyx_XDECREF(__pyx_r);
13180 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1558, __pyx_L1_error)
13181 __Pyx_GOTREF(__pyx_t_3);
13183 __pyx_t_4 =
sqrt(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
13185 __Pyx_CppExn2PyErr();
13186 __PYX_ERR(0, 1558, __pyx_L1_error)
13188 __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)
13189 __Pyx_GOTREF(__pyx_t_5);
13190 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13191 __pyx_r = __pyx_t_5;
13213 __Pyx_PyThreadState_declare
13214 __Pyx_PyThreadState_assign
13215 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
13216 __Pyx_XGOTREF(__pyx_t_6);
13217 __Pyx_XGOTREF(__pyx_t_7);
13218 __Pyx_XGOTREF(__pyx_t_8);
13228 __Pyx_XDECREF(__pyx_r);
13229 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1561, __pyx_L4_error)
13230 __Pyx_GOTREF(__pyx_t_3);
13231 __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)
13232 __Pyx_GOTREF(__pyx_t_9);
13233 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13235 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
13236 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
13237 if (likely(__pyx_t_3)) {
13238 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
13239 __Pyx_INCREF(__pyx_t_3);
13240 __Pyx_INCREF(
function);
13241 __Pyx_DECREF_SET(__pyx_t_9,
function);
13245 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1561, __pyx_L4_error)
13246 __Pyx_GOTREF(__pyx_t_5);
13248 #if CYTHON_FAST_PYCALL 13249 if (PyFunction_Check(__pyx_t_9)) {
13250 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
13251 __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1561, __pyx_L4_error)
13252 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13253 __Pyx_GOTREF(__pyx_t_5);
13256 #if CYTHON_FAST_PYCCALL 13257 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
13258 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
13259 __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1561, __pyx_L4_error)
13260 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13261 __Pyx_GOTREF(__pyx_t_5);
13265 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1561, __pyx_L4_error)
13266 __Pyx_GOTREF(__pyx_t_10);
13267 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
13268 __Pyx_INCREF(__pyx_v_obj);
13269 __Pyx_GIVEREF(__pyx_v_obj);
13270 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
13271 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1561, __pyx_L4_error)
13272 __Pyx_GOTREF(__pyx_t_5);
13273 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13276 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13277 __pyx_r = __pyx_t_5;
13279 goto __pyx_L8_try_return;
13290 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13291 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
13292 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
13293 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13303 __Pyx_AddTraceback(
"PyClical.sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename);
13304 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1562, __pyx_L6_except_error)
13305 __Pyx_GOTREF(__pyx_t_5);
13306 __Pyx_GOTREF(__pyx_t_9);
13307 __Pyx_GOTREF(__pyx_t_10);
13316 __Pyx_XDECREF(__pyx_r);
13317 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1563, __pyx_L6_except_error)
13318 __Pyx_GOTREF(__pyx_t_3);
13319 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_3),
sqrt(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1563, __pyx_L6_except_error)
13320 __Pyx_GOTREF(__pyx_t_11);
13321 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13322 __pyx_r = __pyx_t_11;
13324 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13325 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13326 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13327 goto __pyx_L7_except_return;
13329 __pyx_L6_except_error:;
13338 __Pyx_XGIVEREF(__pyx_t_6);
13339 __Pyx_XGIVEREF(__pyx_t_7);
13340 __Pyx_XGIVEREF(__pyx_t_8);
13341 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
13342 goto __pyx_L1_error;
13343 __pyx_L8_try_return:;
13344 __Pyx_XGIVEREF(__pyx_t_6);
13345 __Pyx_XGIVEREF(__pyx_t_7);
13346 __Pyx_XGIVEREF(__pyx_t_8);
13347 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
13349 __pyx_L7_except_return:;
13350 __Pyx_XGIVEREF(__pyx_t_6);
13351 __Pyx_XGIVEREF(__pyx_t_7);
13352 __Pyx_XGIVEREF(__pyx_t_8);
13353 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
13368 __Pyx_XDECREF(__pyx_t_3);
13369 __Pyx_XDECREF(__pyx_t_5);
13370 __Pyx_XDECREF(__pyx_t_9);
13371 __Pyx_XDECREF(__pyx_t_10);
13372 __Pyx_XDECREF(__pyx_t_11);
13373 __Pyx_AddTraceback(
"PyClical.sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename);
13376 __Pyx_XGIVEREF(__pyx_r);
13377 __Pyx_RefNannyFinishContext();
13382 static PyObject *__pyx_pw_8PyClical_45sqrt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13383 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 ";
13384 static PyObject *__pyx_pw_8PyClical_45sqrt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13385 PyObject *__pyx_v_obj = 0;
13386 PyObject *__pyx_v_i = 0;
13387 PyObject *__pyx_r = 0;
13388 __Pyx_RefNannyDeclarations
13389 __Pyx_RefNannySetupContext(
"sqrt (wrapper)", 0);
13391 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
13392 PyObject* values[2] = {0,0};
13393 values[1] = ((PyObject *)Py_None);
13394 if (unlikely(__pyx_kwds)) {
13395 Py_ssize_t kw_args;
13396 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13397 switch (pos_args) {
13398 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13399 CYTHON_FALLTHROUGH;
13400 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13401 CYTHON_FALLTHROUGH;
13403 default:
goto __pyx_L5_argtuple_error;
13405 kw_args = PyDict_Size(__pyx_kwds);
13406 switch (pos_args) {
13408 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
13409 else goto __pyx_L5_argtuple_error;
13410 CYTHON_FALLTHROUGH;
13413 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
13414 if (value) { values[1] = value; kw_args--; }
13417 if (unlikely(kw_args > 0)) {
13418 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"sqrt") < 0)) __PYX_ERR(0, 1542, __pyx_L3_error)
13421 switch (PyTuple_GET_SIZE(__pyx_args)) {
13422 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13423 CYTHON_FALLTHROUGH;
13424 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13426 default:
goto __pyx_L5_argtuple_error;
13429 __pyx_v_obj = values[0];
13430 __pyx_v_i = values[1];
13432 goto __pyx_L4_argument_unpacking_done;
13433 __pyx_L5_argtuple_error:;
13434 __Pyx_RaiseArgtupleInvalid(
"sqrt", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1542, __pyx_L3_error)
13436 __Pyx_AddTraceback(
"PyClical.sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename);
13437 __Pyx_RefNannyFinishContext();
13439 __pyx_L4_argument_unpacking_done:;
13440 __pyx_r = __pyx_pf_8PyClical_44sqrt(__pyx_self, __pyx_v_obj, __pyx_v_i);
13443 __Pyx_RefNannyFinishContext();
13447 static PyObject *__pyx_pf_8PyClical_44sqrt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
13448 PyObject *__pyx_r = NULL;
13449 __Pyx_RefNannyDeclarations
13450 PyObject *__pyx_t_1 = NULL;
13451 struct __pyx_opt_args_8PyClical_sqrt __pyx_t_2;
13452 __Pyx_RefNannySetupContext(
"sqrt", 0);
13453 __Pyx_XDECREF(__pyx_r);
13454 __pyx_t_2.__pyx_n = 1;
13455 __pyx_t_2.i = __pyx_v_i;
13456 __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)
13457 __Pyx_GOTREF(__pyx_t_1);
13458 __pyx_r = __pyx_t_1;
13464 __Pyx_XDECREF(__pyx_t_1);
13465 __Pyx_AddTraceback(
"PyClical.sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename);
13468 __Pyx_XGIVEREF(__pyx_r);
13469 __Pyx_RefNannyFinishContext();
13481 static PyObject *__pyx_pw_8PyClical_47exp(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13482 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_exp(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
13483 PyObject *__pyx_r = NULL;
13484 __Pyx_RefNannyDeclarations
13485 PyObject *__pyx_t_1 = NULL;
13486 PyObject *__pyx_t_2 = NULL;
13487 PyObject *__pyx_t_3 = NULL;
13488 PyObject *__pyx_t_4 = NULL;
13489 PyObject *__pyx_t_5 = NULL;
13490 PyObject *__pyx_t_6 = NULL;
13491 PyObject *__pyx_t_7 = NULL;
13492 PyObject *__pyx_t_8 = NULL;
13493 __Pyx_RefNannySetupContext(
"exp", 0);
13503 __Pyx_PyThreadState_declare
13504 __Pyx_PyThreadState_assign
13505 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
13506 __Pyx_XGOTREF(__pyx_t_1);
13507 __Pyx_XGOTREF(__pyx_t_2);
13508 __Pyx_XGOTREF(__pyx_t_3);
13518 __Pyx_XDECREF(__pyx_r);
13519 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1575, __pyx_L3_error)
13520 __Pyx_GOTREF(__pyx_t_5);
13521 __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)
13522 __Pyx_GOTREF(__pyx_t_6);
13523 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13525 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
13526 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
13527 if (likely(__pyx_t_5)) {
13528 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
13529 __Pyx_INCREF(__pyx_t_5);
13530 __Pyx_INCREF(
function);
13531 __Pyx_DECREF_SET(__pyx_t_6,
function);
13535 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_obj);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1575, __pyx_L3_error)
13536 __Pyx_GOTREF(__pyx_t_4);
13538 #if CYTHON_FAST_PYCALL 13539 if (PyFunction_Check(__pyx_t_6)) {
13540 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_obj};
13541 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1575, __pyx_L3_error)
13542 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13543 __Pyx_GOTREF(__pyx_t_4);
13546 #if CYTHON_FAST_PYCCALL 13547 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
13548 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_obj};
13549 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1575, __pyx_L3_error)
13550 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13551 __Pyx_GOTREF(__pyx_t_4);
13555 __pyx_t_7 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1575, __pyx_L3_error)
13556 __Pyx_GOTREF(__pyx_t_7);
13557 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
13558 __Pyx_INCREF(__pyx_v_obj);
13559 __Pyx_GIVEREF(__pyx_v_obj);
13560 PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_obj);
13561 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1575, __pyx_L3_error)
13562 __Pyx_GOTREF(__pyx_t_4);
13563 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13566 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13567 __pyx_r = __pyx_t_4;
13569 goto __pyx_L7_try_return;
13580 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13581 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
13582 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
13583 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
13593 __Pyx_AddTraceback(
"PyClical.exp", __pyx_clineno, __pyx_lineno, __pyx_filename);
13594 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1576, __pyx_L5_except_error)
13595 __Pyx_GOTREF(__pyx_t_4);
13596 __Pyx_GOTREF(__pyx_t_6);
13597 __Pyx_GOTREF(__pyx_t_7);
13606 __Pyx_XDECREF(__pyx_r);
13607 __pyx_t_5 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1577, __pyx_L5_except_error)
13608 __Pyx_GOTREF(__pyx_t_5);
13609 __pyx_t_8 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_5),
exp(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1577, __pyx_L5_except_error)
13610 __Pyx_GOTREF(__pyx_t_8);
13611 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13612 __pyx_r = __pyx_t_8;
13614 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13615 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13616 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13617 goto __pyx_L6_except_return;
13619 __pyx_L5_except_error:;
13628 __Pyx_XGIVEREF(__pyx_t_1);
13629 __Pyx_XGIVEREF(__pyx_t_2);
13630 __Pyx_XGIVEREF(__pyx_t_3);
13631 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
13632 goto __pyx_L1_error;
13633 __pyx_L7_try_return:;
13634 __Pyx_XGIVEREF(__pyx_t_1);
13635 __Pyx_XGIVEREF(__pyx_t_2);
13636 __Pyx_XGIVEREF(__pyx_t_3);
13637 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
13639 __pyx_L6_except_return:;
13640 __Pyx_XGIVEREF(__pyx_t_1);
13641 __Pyx_XGIVEREF(__pyx_t_2);
13642 __Pyx_XGIVEREF(__pyx_t_3);
13643 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
13657 __Pyx_XDECREF(__pyx_t_4);
13658 __Pyx_XDECREF(__pyx_t_5);
13659 __Pyx_XDECREF(__pyx_t_6);
13660 __Pyx_XDECREF(__pyx_t_7);
13661 __Pyx_XDECREF(__pyx_t_8);
13662 __Pyx_AddTraceback(
"PyClical.exp", __pyx_clineno, __pyx_lineno, __pyx_filename);
13665 __Pyx_XGIVEREF(__pyx_r);
13666 __Pyx_RefNannyFinishContext();
13671 static PyObject *__pyx_pw_8PyClical_47exp(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13672 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 ";
13673 static PyObject *__pyx_pw_8PyClical_47exp(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13674 PyObject *__pyx_r = 0;
13675 __Pyx_RefNannyDeclarations
13676 __Pyx_RefNannySetupContext(
"exp (wrapper)", 0);
13677 __pyx_r = __pyx_pf_8PyClical_46exp(__pyx_self, ((PyObject *)__pyx_v_obj));
13680 __Pyx_RefNannyFinishContext();
13684 static PyObject *__pyx_pf_8PyClical_46exp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13685 PyObject *__pyx_r = NULL;
13686 __Pyx_RefNannyDeclarations
13687 PyObject *__pyx_t_1 = NULL;
13688 __Pyx_RefNannySetupContext(
"exp", 0);
13689 __Pyx_XDECREF(__pyx_r);
13690 __pyx_t_1 = __pyx_f_8PyClical_exp(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1565, __pyx_L1_error)
13691 __Pyx_GOTREF(__pyx_t_1);
13692 __pyx_r = __pyx_t_1;
13698 __Pyx_XDECREF(__pyx_t_1);
13699 __Pyx_AddTraceback(
"PyClical.exp", __pyx_clineno, __pyx_lineno, __pyx_filename);
13702 __Pyx_XGIVEREF(__pyx_r);
13703 __Pyx_RefNannyFinishContext();
13715 static PyObject *__pyx_pw_8PyClical_49log(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13716 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) {
13717 PyObject *__pyx_v_i = ((PyObject *)Py_None);
13718 PyObject *__pyx_r = NULL;
13719 __Pyx_RefNannyDeclarations
13722 PyObject *__pyx_t_3 = NULL;
13724 PyObject *__pyx_t_5 = NULL;
13725 PyObject *__pyx_t_6 = NULL;
13726 PyObject *__pyx_t_7 = NULL;
13727 PyObject *__pyx_t_8 = NULL;
13728 PyObject *__pyx_t_9 = NULL;
13729 PyObject *__pyx_t_10 = NULL;
13730 PyObject *__pyx_t_11 = NULL;
13731 __Pyx_RefNannySetupContext(
"log", 0);
13732 if (__pyx_optional_args) {
13733 if (__pyx_optional_args->__pyx_n > 0) {
13734 __pyx_v_i = __pyx_optional_args->i;
13745 __pyx_t_1 = (__pyx_v_i != Py_None);
13746 __pyx_t_2 = (__pyx_t_1 != 0);
13756 __Pyx_XDECREF(__pyx_r);
13757 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1595, __pyx_L1_error)
13758 __Pyx_GOTREF(__pyx_t_3);
13760 __pyx_t_4 =
log(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
13762 __Pyx_CppExn2PyErr();
13763 __PYX_ERR(0, 1595, __pyx_L1_error)
13765 __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)
13766 __Pyx_GOTREF(__pyx_t_5);
13767 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13768 __pyx_r = __pyx_t_5;
13790 __Pyx_PyThreadState_declare
13791 __Pyx_PyThreadState_assign
13792 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
13793 __Pyx_XGOTREF(__pyx_t_6);
13794 __Pyx_XGOTREF(__pyx_t_7);
13795 __Pyx_XGOTREF(__pyx_t_8);
13805 __Pyx_XDECREF(__pyx_r);
13806 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1598, __pyx_L4_error)
13807 __Pyx_GOTREF(__pyx_t_3);
13808 __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)
13809 __Pyx_GOTREF(__pyx_t_9);
13810 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13812 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
13813 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
13814 if (likely(__pyx_t_3)) {
13815 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
13816 __Pyx_INCREF(__pyx_t_3);
13817 __Pyx_INCREF(
function);
13818 __Pyx_DECREF_SET(__pyx_t_9,
function);
13822 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1598, __pyx_L4_error)
13823 __Pyx_GOTREF(__pyx_t_5);
13825 #if CYTHON_FAST_PYCALL 13826 if (PyFunction_Check(__pyx_t_9)) {
13827 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
13828 __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1598, __pyx_L4_error)
13829 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13830 __Pyx_GOTREF(__pyx_t_5);
13833 #if CYTHON_FAST_PYCCALL 13834 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
13835 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
13836 __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1598, __pyx_L4_error)
13837 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13838 __Pyx_GOTREF(__pyx_t_5);
13842 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1598, __pyx_L4_error)
13843 __Pyx_GOTREF(__pyx_t_10);
13844 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
13845 __Pyx_INCREF(__pyx_v_obj);
13846 __Pyx_GIVEREF(__pyx_v_obj);
13847 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
13848 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1598, __pyx_L4_error)
13849 __Pyx_GOTREF(__pyx_t_5);
13850 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13853 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13854 __pyx_r = __pyx_t_5;
13856 goto __pyx_L8_try_return;
13867 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13868 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
13869 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
13870 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13880 __Pyx_AddTraceback(
"PyClical.log", __pyx_clineno, __pyx_lineno, __pyx_filename);
13881 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1599, __pyx_L6_except_error)
13882 __Pyx_GOTREF(__pyx_t_5);
13883 __Pyx_GOTREF(__pyx_t_9);
13884 __Pyx_GOTREF(__pyx_t_10);
13893 __Pyx_XDECREF(__pyx_r);
13894 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1600, __pyx_L6_except_error)
13895 __Pyx_GOTREF(__pyx_t_3);
13896 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_3),
log(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1600, __pyx_L6_except_error)
13897 __Pyx_GOTREF(__pyx_t_11);
13898 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13899 __pyx_r = __pyx_t_11;
13901 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13902 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13903 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13904 goto __pyx_L7_except_return;
13906 __pyx_L6_except_error:;
13915 __Pyx_XGIVEREF(__pyx_t_6);
13916 __Pyx_XGIVEREF(__pyx_t_7);
13917 __Pyx_XGIVEREF(__pyx_t_8);
13918 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
13919 goto __pyx_L1_error;
13920 __pyx_L8_try_return:;
13921 __Pyx_XGIVEREF(__pyx_t_6);
13922 __Pyx_XGIVEREF(__pyx_t_7);
13923 __Pyx_XGIVEREF(__pyx_t_8);
13924 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
13926 __pyx_L7_except_return:;
13927 __Pyx_XGIVEREF(__pyx_t_6);
13928 __Pyx_XGIVEREF(__pyx_t_7);
13929 __Pyx_XGIVEREF(__pyx_t_8);
13930 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
13945 __Pyx_XDECREF(__pyx_t_3);
13946 __Pyx_XDECREF(__pyx_t_5);
13947 __Pyx_XDECREF(__pyx_t_9);
13948 __Pyx_XDECREF(__pyx_t_10);
13949 __Pyx_XDECREF(__pyx_t_11);
13950 __Pyx_AddTraceback(
"PyClical.log", __pyx_clineno, __pyx_lineno, __pyx_filename);
13953 __Pyx_XGIVEREF(__pyx_r);
13954 __Pyx_RefNannyFinishContext();
13959 static PyObject *__pyx_pw_8PyClical_49log(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13960 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 ";
13961 static PyObject *__pyx_pw_8PyClical_49log(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13962 PyObject *__pyx_v_obj = 0;
13963 PyObject *__pyx_v_i = 0;
13964 PyObject *__pyx_r = 0;
13965 __Pyx_RefNannyDeclarations
13966 __Pyx_RefNannySetupContext(
"log (wrapper)", 0);
13968 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
13969 PyObject* values[2] = {0,0};
13970 values[1] = ((PyObject *)Py_None);
13971 if (unlikely(__pyx_kwds)) {
13972 Py_ssize_t kw_args;
13973 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13974 switch (pos_args) {
13975 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13976 CYTHON_FALLTHROUGH;
13977 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13978 CYTHON_FALLTHROUGH;
13980 default:
goto __pyx_L5_argtuple_error;
13982 kw_args = PyDict_Size(__pyx_kwds);
13983 switch (pos_args) {
13985 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
13986 else goto __pyx_L5_argtuple_error;
13987 CYTHON_FALLTHROUGH;
13990 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
13991 if (value) { values[1] = value; kw_args--; }
13994 if (unlikely(kw_args > 0)) {
13995 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"log") < 0)) __PYX_ERR(0, 1579, __pyx_L3_error)
13998 switch (PyTuple_GET_SIZE(__pyx_args)) {
13999 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14000 CYTHON_FALLTHROUGH;
14001 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14003 default:
goto __pyx_L5_argtuple_error;
14006 __pyx_v_obj = values[0];
14007 __pyx_v_i = values[1];
14009 goto __pyx_L4_argument_unpacking_done;
14010 __pyx_L5_argtuple_error:;
14011 __Pyx_RaiseArgtupleInvalid(
"log", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1579, __pyx_L3_error)
14013 __Pyx_AddTraceback(
"PyClical.log", __pyx_clineno, __pyx_lineno, __pyx_filename);
14014 __Pyx_RefNannyFinishContext();
14016 __pyx_L4_argument_unpacking_done:;
14017 __pyx_r = __pyx_pf_8PyClical_48log(__pyx_self, __pyx_v_obj, __pyx_v_i);
14020 __Pyx_RefNannyFinishContext();
14024 static PyObject *__pyx_pf_8PyClical_48log(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
14025 PyObject *__pyx_r = NULL;
14026 __Pyx_RefNannyDeclarations
14027 PyObject *__pyx_t_1 = NULL;
14028 struct __pyx_opt_args_8PyClical_log __pyx_t_2;
14029 __Pyx_RefNannySetupContext(
"log", 0);
14030 __Pyx_XDECREF(__pyx_r);
14031 __pyx_t_2.__pyx_n = 1;
14032 __pyx_t_2.i = __pyx_v_i;
14033 __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)
14034 __Pyx_GOTREF(__pyx_t_1);
14035 __pyx_r = __pyx_t_1;
14041 __Pyx_XDECREF(__pyx_t_1);
14042 __Pyx_AddTraceback(
"PyClical.log", __pyx_clineno, __pyx_lineno, __pyx_filename);
14045 __Pyx_XGIVEREF(__pyx_r);
14046 __Pyx_RefNannyFinishContext();
14058 static PyObject *__pyx_pw_8PyClical_51cos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14059 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) {
14060 PyObject *__pyx_v_i = ((PyObject *)Py_None);
14061 PyObject *__pyx_r = NULL;
14062 __Pyx_RefNannyDeclarations
14065 PyObject *__pyx_t_3 = NULL;
14067 PyObject *__pyx_t_5 = NULL;
14068 PyObject *__pyx_t_6 = NULL;
14069 PyObject *__pyx_t_7 = NULL;
14070 PyObject *__pyx_t_8 = NULL;
14071 PyObject *__pyx_t_9 = NULL;
14072 PyObject *__pyx_t_10 = NULL;
14073 PyObject *__pyx_t_11 = NULL;
14074 __Pyx_RefNannySetupContext(
"cos", 0);
14075 if (__pyx_optional_args) {
14076 if (__pyx_optional_args->__pyx_n > 0) {
14077 __pyx_v_i = __pyx_optional_args->i;
14088 __pyx_t_1 = (__pyx_v_i != Py_None);
14089 __pyx_t_2 = (__pyx_t_1 != 0);
14099 __Pyx_XDECREF(__pyx_r);
14100 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1612, __pyx_L1_error)
14101 __Pyx_GOTREF(__pyx_t_3);
14103 __pyx_t_4 =
cos(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
14105 __Pyx_CppExn2PyErr();
14106 __PYX_ERR(0, 1612, __pyx_L1_error)
14108 __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)
14109 __Pyx_GOTREF(__pyx_t_5);
14110 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14111 __pyx_r = __pyx_t_5;
14133 __Pyx_PyThreadState_declare
14134 __Pyx_PyThreadState_assign
14135 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
14136 __Pyx_XGOTREF(__pyx_t_6);
14137 __Pyx_XGOTREF(__pyx_t_7);
14138 __Pyx_XGOTREF(__pyx_t_8);
14148 __Pyx_XDECREF(__pyx_r);
14149 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1615, __pyx_L4_error)
14150 __Pyx_GOTREF(__pyx_t_3);
14151 __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)
14152 __Pyx_GOTREF(__pyx_t_9);
14153 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14155 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
14156 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
14157 if (likely(__pyx_t_3)) {
14158 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
14159 __Pyx_INCREF(__pyx_t_3);
14160 __Pyx_INCREF(
function);
14161 __Pyx_DECREF_SET(__pyx_t_9,
function);
14165 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1615, __pyx_L4_error)
14166 __Pyx_GOTREF(__pyx_t_5);
14168 #if CYTHON_FAST_PYCALL 14169 if (PyFunction_Check(__pyx_t_9)) {
14170 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
14171 __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1615, __pyx_L4_error)
14172 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14173 __Pyx_GOTREF(__pyx_t_5);
14176 #if CYTHON_FAST_PYCCALL 14177 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
14178 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
14179 __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1615, __pyx_L4_error)
14180 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14181 __Pyx_GOTREF(__pyx_t_5);
14185 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1615, __pyx_L4_error)
14186 __Pyx_GOTREF(__pyx_t_10);
14187 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
14188 __Pyx_INCREF(__pyx_v_obj);
14189 __Pyx_GIVEREF(__pyx_v_obj);
14190 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
14191 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1615, __pyx_L4_error)
14192 __Pyx_GOTREF(__pyx_t_5);
14193 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14196 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14197 __pyx_r = __pyx_t_5;
14199 goto __pyx_L8_try_return;
14210 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14211 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
14212 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
14213 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14223 __Pyx_AddTraceback(
"PyClical.cos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14224 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1616, __pyx_L6_except_error)
14225 __Pyx_GOTREF(__pyx_t_5);
14226 __Pyx_GOTREF(__pyx_t_9);
14227 __Pyx_GOTREF(__pyx_t_10);
14236 __Pyx_XDECREF(__pyx_r);
14237 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1617, __pyx_L6_except_error)
14238 __Pyx_GOTREF(__pyx_t_3);
14239 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_3),
cos(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1617, __pyx_L6_except_error)
14240 __Pyx_GOTREF(__pyx_t_11);
14241 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14242 __pyx_r = __pyx_t_11;
14244 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14245 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14246 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14247 goto __pyx_L7_except_return;
14249 __pyx_L6_except_error:;
14258 __Pyx_XGIVEREF(__pyx_t_6);
14259 __Pyx_XGIVEREF(__pyx_t_7);
14260 __Pyx_XGIVEREF(__pyx_t_8);
14261 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14262 goto __pyx_L1_error;
14263 __pyx_L8_try_return:;
14264 __Pyx_XGIVEREF(__pyx_t_6);
14265 __Pyx_XGIVEREF(__pyx_t_7);
14266 __Pyx_XGIVEREF(__pyx_t_8);
14267 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14269 __pyx_L7_except_return:;
14270 __Pyx_XGIVEREF(__pyx_t_6);
14271 __Pyx_XGIVEREF(__pyx_t_7);
14272 __Pyx_XGIVEREF(__pyx_t_8);
14273 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14288 __Pyx_XDECREF(__pyx_t_3);
14289 __Pyx_XDECREF(__pyx_t_5);
14290 __Pyx_XDECREF(__pyx_t_9);
14291 __Pyx_XDECREF(__pyx_t_10);
14292 __Pyx_XDECREF(__pyx_t_11);
14293 __Pyx_AddTraceback(
"PyClical.cos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14296 __Pyx_XGIVEREF(__pyx_r);
14297 __Pyx_RefNannyFinishContext();
14302 static PyObject *__pyx_pw_8PyClical_51cos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14303 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 ";
14304 static PyObject *__pyx_pw_8PyClical_51cos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14305 PyObject *__pyx_v_obj = 0;
14306 PyObject *__pyx_v_i = 0;
14307 PyObject *__pyx_r = 0;
14308 __Pyx_RefNannyDeclarations
14309 __Pyx_RefNannySetupContext(
"cos (wrapper)", 0);
14311 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
14312 PyObject* values[2] = {0,0};
14313 values[1] = ((PyObject *)Py_None);
14314 if (unlikely(__pyx_kwds)) {
14315 Py_ssize_t kw_args;
14316 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14317 switch (pos_args) {
14318 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14319 CYTHON_FALLTHROUGH;
14320 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14321 CYTHON_FALLTHROUGH;
14323 default:
goto __pyx_L5_argtuple_error;
14325 kw_args = PyDict_Size(__pyx_kwds);
14326 switch (pos_args) {
14328 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
14329 else goto __pyx_L5_argtuple_error;
14330 CYTHON_FALLTHROUGH;
14333 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
14334 if (value) { values[1] = value; kw_args--; }
14337 if (unlikely(kw_args > 0)) {
14338 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"cos") < 0)) __PYX_ERR(0, 1602, __pyx_L3_error)
14341 switch (PyTuple_GET_SIZE(__pyx_args)) {
14342 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14343 CYTHON_FALLTHROUGH;
14344 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14346 default:
goto __pyx_L5_argtuple_error;
14349 __pyx_v_obj = values[0];
14350 __pyx_v_i = values[1];
14352 goto __pyx_L4_argument_unpacking_done;
14353 __pyx_L5_argtuple_error:;
14354 __Pyx_RaiseArgtupleInvalid(
"cos", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1602, __pyx_L3_error)
14356 __Pyx_AddTraceback(
"PyClical.cos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14357 __Pyx_RefNannyFinishContext();
14359 __pyx_L4_argument_unpacking_done:;
14360 __pyx_r = __pyx_pf_8PyClical_50cos(__pyx_self, __pyx_v_obj, __pyx_v_i);
14363 __Pyx_RefNannyFinishContext();
14367 static PyObject *__pyx_pf_8PyClical_50cos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
14368 PyObject *__pyx_r = NULL;
14369 __Pyx_RefNannyDeclarations
14370 PyObject *__pyx_t_1 = NULL;
14371 struct __pyx_opt_args_8PyClical_cos __pyx_t_2;
14372 __Pyx_RefNannySetupContext(
"cos", 0);
14373 __Pyx_XDECREF(__pyx_r);
14374 __pyx_t_2.__pyx_n = 1;
14375 __pyx_t_2.i = __pyx_v_i;
14376 __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)
14377 __Pyx_GOTREF(__pyx_t_1);
14378 __pyx_r = __pyx_t_1;
14384 __Pyx_XDECREF(__pyx_t_1);
14385 __Pyx_AddTraceback(
"PyClical.cos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14388 __Pyx_XGIVEREF(__pyx_r);
14389 __Pyx_RefNannyFinishContext();
14401 static PyObject *__pyx_pw_8PyClical_53acos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14402 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) {
14403 PyObject *__pyx_v_i = ((PyObject *)Py_None);
14404 PyObject *__pyx_r = NULL;
14405 __Pyx_RefNannyDeclarations
14408 PyObject *__pyx_t_3 = NULL;
14410 PyObject *__pyx_t_5 = NULL;
14411 PyObject *__pyx_t_6 = NULL;
14412 PyObject *__pyx_t_7 = NULL;
14413 PyObject *__pyx_t_8 = NULL;
14414 PyObject *__pyx_t_9 = NULL;
14415 PyObject *__pyx_t_10 = NULL;
14416 PyObject *__pyx_t_11 = NULL;
14417 __Pyx_RefNannySetupContext(
"acos", 0);
14418 if (__pyx_optional_args) {
14419 if (__pyx_optional_args->__pyx_n > 0) {
14420 __pyx_v_i = __pyx_optional_args->i;
14431 __pyx_t_1 = (__pyx_v_i != Py_None);
14432 __pyx_t_2 = (__pyx_t_1 != 0);
14442 __Pyx_XDECREF(__pyx_r);
14443 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1633, __pyx_L1_error)
14444 __Pyx_GOTREF(__pyx_t_3);
14446 __pyx_t_4 =
acos(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
14448 __Pyx_CppExn2PyErr();
14449 __PYX_ERR(0, 1633, __pyx_L1_error)
14451 __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)
14452 __Pyx_GOTREF(__pyx_t_5);
14453 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14454 __pyx_r = __pyx_t_5;
14476 __Pyx_PyThreadState_declare
14477 __Pyx_PyThreadState_assign
14478 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
14479 __Pyx_XGOTREF(__pyx_t_6);
14480 __Pyx_XGOTREF(__pyx_t_7);
14481 __Pyx_XGOTREF(__pyx_t_8);
14491 __Pyx_XDECREF(__pyx_r);
14492 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1636, __pyx_L4_error)
14493 __Pyx_GOTREF(__pyx_t_3);
14494 __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)
14495 __Pyx_GOTREF(__pyx_t_9);
14496 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14498 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
14499 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
14500 if (likely(__pyx_t_3)) {
14501 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
14502 __Pyx_INCREF(__pyx_t_3);
14503 __Pyx_INCREF(
function);
14504 __Pyx_DECREF_SET(__pyx_t_9,
function);
14508 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1636, __pyx_L4_error)
14509 __Pyx_GOTREF(__pyx_t_5);
14511 #if CYTHON_FAST_PYCALL 14512 if (PyFunction_Check(__pyx_t_9)) {
14513 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
14514 __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1636, __pyx_L4_error)
14515 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14516 __Pyx_GOTREF(__pyx_t_5);
14519 #if CYTHON_FAST_PYCCALL 14520 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
14521 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
14522 __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1636, __pyx_L4_error)
14523 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14524 __Pyx_GOTREF(__pyx_t_5);
14528 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1636, __pyx_L4_error)
14529 __Pyx_GOTREF(__pyx_t_10);
14530 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
14531 __Pyx_INCREF(__pyx_v_obj);
14532 __Pyx_GIVEREF(__pyx_v_obj);
14533 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
14534 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1636, __pyx_L4_error)
14535 __Pyx_GOTREF(__pyx_t_5);
14536 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14539 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14540 __pyx_r = __pyx_t_5;
14542 goto __pyx_L8_try_return;
14553 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14554 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
14555 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
14556 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14566 __Pyx_AddTraceback(
"PyClical.acos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14567 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1637, __pyx_L6_except_error)
14568 __Pyx_GOTREF(__pyx_t_5);
14569 __Pyx_GOTREF(__pyx_t_9);
14570 __Pyx_GOTREF(__pyx_t_10);
14579 __Pyx_XDECREF(__pyx_r);
14580 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1638, __pyx_L6_except_error)
14581 __Pyx_GOTREF(__pyx_t_3);
14582 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_3),
acos(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1638, __pyx_L6_except_error)
14583 __Pyx_GOTREF(__pyx_t_11);
14584 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14585 __pyx_r = __pyx_t_11;
14587 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14588 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14589 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14590 goto __pyx_L7_except_return;
14592 __pyx_L6_except_error:;
14601 __Pyx_XGIVEREF(__pyx_t_6);
14602 __Pyx_XGIVEREF(__pyx_t_7);
14603 __Pyx_XGIVEREF(__pyx_t_8);
14604 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14605 goto __pyx_L1_error;
14606 __pyx_L8_try_return:;
14607 __Pyx_XGIVEREF(__pyx_t_6);
14608 __Pyx_XGIVEREF(__pyx_t_7);
14609 __Pyx_XGIVEREF(__pyx_t_8);
14610 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14612 __pyx_L7_except_return:;
14613 __Pyx_XGIVEREF(__pyx_t_6);
14614 __Pyx_XGIVEREF(__pyx_t_7);
14615 __Pyx_XGIVEREF(__pyx_t_8);
14616 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14631 __Pyx_XDECREF(__pyx_t_3);
14632 __Pyx_XDECREF(__pyx_t_5);
14633 __Pyx_XDECREF(__pyx_t_9);
14634 __Pyx_XDECREF(__pyx_t_10);
14635 __Pyx_XDECREF(__pyx_t_11);
14636 __Pyx_AddTraceback(
"PyClical.acos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14639 __Pyx_XGIVEREF(__pyx_r);
14640 __Pyx_RefNannyFinishContext();
14645 static PyObject *__pyx_pw_8PyClical_53acos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14646 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 ";
14647 static PyObject *__pyx_pw_8PyClical_53acos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14648 PyObject *__pyx_v_obj = 0;
14649 PyObject *__pyx_v_i = 0;
14650 PyObject *__pyx_r = 0;
14651 __Pyx_RefNannyDeclarations
14652 __Pyx_RefNannySetupContext(
"acos (wrapper)", 0);
14654 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
14655 PyObject* values[2] = {0,0};
14656 values[1] = ((PyObject *)Py_None);
14657 if (unlikely(__pyx_kwds)) {
14658 Py_ssize_t kw_args;
14659 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14660 switch (pos_args) {
14661 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14662 CYTHON_FALLTHROUGH;
14663 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14664 CYTHON_FALLTHROUGH;
14666 default:
goto __pyx_L5_argtuple_error;
14668 kw_args = PyDict_Size(__pyx_kwds);
14669 switch (pos_args) {
14671 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
14672 else goto __pyx_L5_argtuple_error;
14673 CYTHON_FALLTHROUGH;
14676 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
14677 if (value) { values[1] = value; kw_args--; }
14680 if (unlikely(kw_args > 0)) {
14681 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"acos") < 0)) __PYX_ERR(0, 1619, __pyx_L3_error)
14684 switch (PyTuple_GET_SIZE(__pyx_args)) {
14685 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14686 CYTHON_FALLTHROUGH;
14687 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14689 default:
goto __pyx_L5_argtuple_error;
14692 __pyx_v_obj = values[0];
14693 __pyx_v_i = values[1];
14695 goto __pyx_L4_argument_unpacking_done;
14696 __pyx_L5_argtuple_error:;
14697 __Pyx_RaiseArgtupleInvalid(
"acos", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1619, __pyx_L3_error)
14699 __Pyx_AddTraceback(
"PyClical.acos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14700 __Pyx_RefNannyFinishContext();
14702 __pyx_L4_argument_unpacking_done:;
14703 __pyx_r = __pyx_pf_8PyClical_52acos(__pyx_self, __pyx_v_obj, __pyx_v_i);
14706 __Pyx_RefNannyFinishContext();
14710 static PyObject *__pyx_pf_8PyClical_52acos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
14711 PyObject *__pyx_r = NULL;
14712 __Pyx_RefNannyDeclarations
14713 PyObject *__pyx_t_1 = NULL;
14714 struct __pyx_opt_args_8PyClical_acos __pyx_t_2;
14715 __Pyx_RefNannySetupContext(
"acos", 0);
14716 __Pyx_XDECREF(__pyx_r);
14717 __pyx_t_2.__pyx_n = 1;
14718 __pyx_t_2.i = __pyx_v_i;
14719 __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)
14720 __Pyx_GOTREF(__pyx_t_1);
14721 __pyx_r = __pyx_t_1;
14727 __Pyx_XDECREF(__pyx_t_1);
14728 __Pyx_AddTraceback(
"PyClical.acos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14731 __Pyx_XGIVEREF(__pyx_r);
14732 __Pyx_RefNannyFinishContext();
14744 static PyObject *__pyx_pw_8PyClical_55cosh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
14745 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cosh(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
14746 PyObject *__pyx_r = NULL;
14747 __Pyx_RefNannyDeclarations
14748 PyObject *__pyx_t_1 = NULL;
14749 PyObject *__pyx_t_2 = NULL;
14750 PyObject *__pyx_t_3 = NULL;
14751 PyObject *__pyx_t_4 = NULL;
14752 PyObject *__pyx_t_5 = NULL;
14753 PyObject *__pyx_t_6 = NULL;
14754 PyObject *__pyx_t_7 = NULL;
14755 PyObject *__pyx_t_8 = NULL;
14756 __Pyx_RefNannySetupContext(
"cosh", 0);
14766 __Pyx_PyThreadState_declare
14767 __Pyx_PyThreadState_assign
14768 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
14769 __Pyx_XGOTREF(__pyx_t_1);
14770 __Pyx_XGOTREF(__pyx_t_2);
14771 __Pyx_XGOTREF(__pyx_t_3);
14781 __Pyx_XDECREF(__pyx_r);
14782 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1652, __pyx_L3_error)
14783 __Pyx_GOTREF(__pyx_t_5);
14784 __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)
14785 __Pyx_GOTREF(__pyx_t_6);
14786 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14788 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
14789 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
14790 if (likely(__pyx_t_5)) {
14791 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
14792 __Pyx_INCREF(__pyx_t_5);
14793 __Pyx_INCREF(
function);
14794 __Pyx_DECREF_SET(__pyx_t_6,
function);
14798 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_obj);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1652, __pyx_L3_error)
14799 __Pyx_GOTREF(__pyx_t_4);
14801 #if CYTHON_FAST_PYCALL 14802 if (PyFunction_Check(__pyx_t_6)) {
14803 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_obj};
14804 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1652, __pyx_L3_error)
14805 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14806 __Pyx_GOTREF(__pyx_t_4);
14809 #if CYTHON_FAST_PYCCALL 14810 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
14811 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_obj};
14812 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1652, __pyx_L3_error)
14813 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14814 __Pyx_GOTREF(__pyx_t_4);
14818 __pyx_t_7 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1652, __pyx_L3_error)
14819 __Pyx_GOTREF(__pyx_t_7);
14820 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
14821 __Pyx_INCREF(__pyx_v_obj);
14822 __Pyx_GIVEREF(__pyx_v_obj);
14823 PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_obj);
14824 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1652, __pyx_L3_error)
14825 __Pyx_GOTREF(__pyx_t_4);
14826 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14829 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14830 __pyx_r = __pyx_t_4;
14832 goto __pyx_L7_try_return;
14843 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14844 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
14845 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
14846 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
14856 __Pyx_AddTraceback(
"PyClical.cosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
14857 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1653, __pyx_L5_except_error)
14858 __Pyx_GOTREF(__pyx_t_4);
14859 __Pyx_GOTREF(__pyx_t_6);
14860 __Pyx_GOTREF(__pyx_t_7);
14869 __Pyx_XDECREF(__pyx_r);
14870 __pyx_t_5 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1654, __pyx_L5_except_error)
14871 __Pyx_GOTREF(__pyx_t_5);
14872 __pyx_t_8 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_5),
cosh(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1654, __pyx_L5_except_error)
14873 __Pyx_GOTREF(__pyx_t_8);
14874 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14875 __pyx_r = __pyx_t_8;
14877 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14878 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14879 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14880 goto __pyx_L6_except_return;
14882 __pyx_L5_except_error:;
14891 __Pyx_XGIVEREF(__pyx_t_1);
14892 __Pyx_XGIVEREF(__pyx_t_2);
14893 __Pyx_XGIVEREF(__pyx_t_3);
14894 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
14895 goto __pyx_L1_error;
14896 __pyx_L7_try_return:;
14897 __Pyx_XGIVEREF(__pyx_t_1);
14898 __Pyx_XGIVEREF(__pyx_t_2);
14899 __Pyx_XGIVEREF(__pyx_t_3);
14900 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
14902 __pyx_L6_except_return:;
14903 __Pyx_XGIVEREF(__pyx_t_1);
14904 __Pyx_XGIVEREF(__pyx_t_2);
14905 __Pyx_XGIVEREF(__pyx_t_3);
14906 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
14920 __Pyx_XDECREF(__pyx_t_4);
14921 __Pyx_XDECREF(__pyx_t_5);
14922 __Pyx_XDECREF(__pyx_t_6);
14923 __Pyx_XDECREF(__pyx_t_7);
14924 __Pyx_XDECREF(__pyx_t_8);
14925 __Pyx_AddTraceback(
"PyClical.cosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
14928 __Pyx_XGIVEREF(__pyx_r);
14929 __Pyx_RefNannyFinishContext();
14934 static PyObject *__pyx_pw_8PyClical_55cosh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
14935 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 ";
14936 static PyObject *__pyx_pw_8PyClical_55cosh(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
14937 PyObject *__pyx_r = 0;
14938 __Pyx_RefNannyDeclarations
14939 __Pyx_RefNannySetupContext(
"cosh (wrapper)", 0);
14940 __pyx_r = __pyx_pf_8PyClical_54cosh(__pyx_self, ((PyObject *)__pyx_v_obj));
14943 __Pyx_RefNannyFinishContext();
14947 static PyObject *__pyx_pf_8PyClical_54cosh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
14948 PyObject *__pyx_r = NULL;
14949 __Pyx_RefNannyDeclarations
14950 PyObject *__pyx_t_1 = NULL;
14951 __Pyx_RefNannySetupContext(
"cosh", 0);
14952 __Pyx_XDECREF(__pyx_r);
14953 __pyx_t_1 = __pyx_f_8PyClical_cosh(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1640, __pyx_L1_error)
14954 __Pyx_GOTREF(__pyx_t_1);
14955 __pyx_r = __pyx_t_1;
14961 __Pyx_XDECREF(__pyx_t_1);
14962 __Pyx_AddTraceback(
"PyClical.cosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
14965 __Pyx_XGIVEREF(__pyx_r);
14966 __Pyx_RefNannyFinishContext();
14978 static PyObject *__pyx_pw_8PyClical_57acosh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14979 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) {
14980 PyObject *__pyx_v_i = ((PyObject *)Py_None);
14981 PyObject *__pyx_r = NULL;
14982 __Pyx_RefNannyDeclarations
14985 PyObject *__pyx_t_3 = NULL;
14987 PyObject *__pyx_t_5 = NULL;
14988 PyObject *__pyx_t_6 = NULL;
14989 PyObject *__pyx_t_7 = NULL;
14990 PyObject *__pyx_t_8 = NULL;
14991 PyObject *__pyx_t_9 = NULL;
14992 PyObject *__pyx_t_10 = NULL;
14993 PyObject *__pyx_t_11 = NULL;
14994 __Pyx_RefNannySetupContext(
"acosh", 0);
14995 if (__pyx_optional_args) {
14996 if (__pyx_optional_args->__pyx_n > 0) {
14997 __pyx_v_i = __pyx_optional_args->i;
15008 __pyx_t_1 = (__pyx_v_i != Py_None);
15009 __pyx_t_2 = (__pyx_t_1 != 0);
15019 __Pyx_XDECREF(__pyx_r);
15020 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1672, __pyx_L1_error)
15021 __Pyx_GOTREF(__pyx_t_3);
15023 __pyx_t_4 =
acosh(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
15025 __Pyx_CppExn2PyErr();
15026 __PYX_ERR(0, 1672, __pyx_L1_error)
15028 __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)
15029 __Pyx_GOTREF(__pyx_t_5);
15030 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15031 __pyx_r = __pyx_t_5;
15053 __Pyx_PyThreadState_declare
15054 __Pyx_PyThreadState_assign
15055 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
15056 __Pyx_XGOTREF(__pyx_t_6);
15057 __Pyx_XGOTREF(__pyx_t_7);
15058 __Pyx_XGOTREF(__pyx_t_8);
15068 __Pyx_XDECREF(__pyx_r);
15069 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1675, __pyx_L4_error)
15070 __Pyx_GOTREF(__pyx_t_3);
15071 __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)
15072 __Pyx_GOTREF(__pyx_t_9);
15073 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15075 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
15076 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
15077 if (likely(__pyx_t_3)) {
15078 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
15079 __Pyx_INCREF(__pyx_t_3);
15080 __Pyx_INCREF(
function);
15081 __Pyx_DECREF_SET(__pyx_t_9,
function);
15085 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1675, __pyx_L4_error)
15086 __Pyx_GOTREF(__pyx_t_5);
15088 #if CYTHON_FAST_PYCALL 15089 if (PyFunction_Check(__pyx_t_9)) {
15090 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
15091 __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1675, __pyx_L4_error)
15092 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15093 __Pyx_GOTREF(__pyx_t_5);
15096 #if CYTHON_FAST_PYCCALL 15097 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
15098 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
15099 __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1675, __pyx_L4_error)
15100 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15101 __Pyx_GOTREF(__pyx_t_5);
15105 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1675, __pyx_L4_error)
15106 __Pyx_GOTREF(__pyx_t_10);
15107 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
15108 __Pyx_INCREF(__pyx_v_obj);
15109 __Pyx_GIVEREF(__pyx_v_obj);
15110 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
15111 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1675, __pyx_L4_error)
15112 __Pyx_GOTREF(__pyx_t_5);
15113 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15116 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15117 __pyx_r = __pyx_t_5;
15119 goto __pyx_L8_try_return;
15130 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15131 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
15132 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
15133 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15143 __Pyx_AddTraceback(
"PyClical.acosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15144 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1676, __pyx_L6_except_error)
15145 __Pyx_GOTREF(__pyx_t_5);
15146 __Pyx_GOTREF(__pyx_t_9);
15147 __Pyx_GOTREF(__pyx_t_10);
15156 __Pyx_XDECREF(__pyx_r);
15157 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1677, __pyx_L6_except_error)
15158 __Pyx_GOTREF(__pyx_t_3);
15159 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_3),
acosh(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1677, __pyx_L6_except_error)
15160 __Pyx_GOTREF(__pyx_t_11);
15161 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15162 __pyx_r = __pyx_t_11;
15164 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15165 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15166 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15167 goto __pyx_L7_except_return;
15169 __pyx_L6_except_error:;
15178 __Pyx_XGIVEREF(__pyx_t_6);
15179 __Pyx_XGIVEREF(__pyx_t_7);
15180 __Pyx_XGIVEREF(__pyx_t_8);
15181 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15182 goto __pyx_L1_error;
15183 __pyx_L8_try_return:;
15184 __Pyx_XGIVEREF(__pyx_t_6);
15185 __Pyx_XGIVEREF(__pyx_t_7);
15186 __Pyx_XGIVEREF(__pyx_t_8);
15187 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15189 __pyx_L7_except_return:;
15190 __Pyx_XGIVEREF(__pyx_t_6);
15191 __Pyx_XGIVEREF(__pyx_t_7);
15192 __Pyx_XGIVEREF(__pyx_t_8);
15193 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15208 __Pyx_XDECREF(__pyx_t_3);
15209 __Pyx_XDECREF(__pyx_t_5);
15210 __Pyx_XDECREF(__pyx_t_9);
15211 __Pyx_XDECREF(__pyx_t_10);
15212 __Pyx_XDECREF(__pyx_t_11);
15213 __Pyx_AddTraceback(
"PyClical.acosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15216 __Pyx_XGIVEREF(__pyx_r);
15217 __Pyx_RefNannyFinishContext();
15222 static PyObject *__pyx_pw_8PyClical_57acosh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15223 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 ";
15224 static PyObject *__pyx_pw_8PyClical_57acosh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15225 PyObject *__pyx_v_obj = 0;
15226 PyObject *__pyx_v_i = 0;
15227 PyObject *__pyx_r = 0;
15228 __Pyx_RefNannyDeclarations
15229 __Pyx_RefNannySetupContext(
"acosh (wrapper)", 0);
15231 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
15232 PyObject* values[2] = {0,0};
15233 values[1] = ((PyObject *)Py_None);
15234 if (unlikely(__pyx_kwds)) {
15235 Py_ssize_t kw_args;
15236 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15237 switch (pos_args) {
15238 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15239 CYTHON_FALLTHROUGH;
15240 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15241 CYTHON_FALLTHROUGH;
15243 default:
goto __pyx_L5_argtuple_error;
15245 kw_args = PyDict_Size(__pyx_kwds);
15246 switch (pos_args) {
15248 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
15249 else goto __pyx_L5_argtuple_error;
15250 CYTHON_FALLTHROUGH;
15253 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
15254 if (value) { values[1] = value; kw_args--; }
15257 if (unlikely(kw_args > 0)) {
15258 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"acosh") < 0)) __PYX_ERR(0, 1656, __pyx_L3_error)
15261 switch (PyTuple_GET_SIZE(__pyx_args)) {
15262 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15263 CYTHON_FALLTHROUGH;
15264 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15266 default:
goto __pyx_L5_argtuple_error;
15269 __pyx_v_obj = values[0];
15270 __pyx_v_i = values[1];
15272 goto __pyx_L4_argument_unpacking_done;
15273 __pyx_L5_argtuple_error:;
15274 __Pyx_RaiseArgtupleInvalid(
"acosh", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1656, __pyx_L3_error)
15276 __Pyx_AddTraceback(
"PyClical.acosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15277 __Pyx_RefNannyFinishContext();
15279 __pyx_L4_argument_unpacking_done:;
15280 __pyx_r = __pyx_pf_8PyClical_56acosh(__pyx_self, __pyx_v_obj, __pyx_v_i);
15283 __Pyx_RefNannyFinishContext();
15287 static PyObject *__pyx_pf_8PyClical_56acosh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
15288 PyObject *__pyx_r = NULL;
15289 __Pyx_RefNannyDeclarations
15290 PyObject *__pyx_t_1 = NULL;
15291 struct __pyx_opt_args_8PyClical_acosh __pyx_t_2;
15292 __Pyx_RefNannySetupContext(
"acosh", 0);
15293 __Pyx_XDECREF(__pyx_r);
15294 __pyx_t_2.__pyx_n = 1;
15295 __pyx_t_2.i = __pyx_v_i;
15296 __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)
15297 __Pyx_GOTREF(__pyx_t_1);
15298 __pyx_r = __pyx_t_1;
15304 __Pyx_XDECREF(__pyx_t_1);
15305 __Pyx_AddTraceback(
"PyClical.acosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15308 __Pyx_XGIVEREF(__pyx_r);
15309 __Pyx_RefNannyFinishContext();
15321 static PyObject *__pyx_pw_8PyClical_59sin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15322 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) {
15323 PyObject *__pyx_v_i = ((PyObject *)Py_None);
15324 PyObject *__pyx_r = NULL;
15325 __Pyx_RefNannyDeclarations
15328 PyObject *__pyx_t_3 = NULL;
15330 PyObject *__pyx_t_5 = NULL;
15331 PyObject *__pyx_t_6 = NULL;
15332 PyObject *__pyx_t_7 = NULL;
15333 PyObject *__pyx_t_8 = NULL;
15334 PyObject *__pyx_t_9 = NULL;
15335 PyObject *__pyx_t_10 = NULL;
15336 PyObject *__pyx_t_11 = NULL;
15337 __Pyx_RefNannySetupContext(
"sin", 0);
15338 if (__pyx_optional_args) {
15339 if (__pyx_optional_args->__pyx_n > 0) {
15340 __pyx_v_i = __pyx_optional_args->i;
15351 __pyx_t_1 = (__pyx_v_i != Py_None);
15352 __pyx_t_2 = (__pyx_t_1 != 0);
15362 __Pyx_XDECREF(__pyx_r);
15363 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1691, __pyx_L1_error)
15364 __Pyx_GOTREF(__pyx_t_3);
15366 __pyx_t_4 =
sin(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
15368 __Pyx_CppExn2PyErr();
15369 __PYX_ERR(0, 1691, __pyx_L1_error)
15371 __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)
15372 __Pyx_GOTREF(__pyx_t_5);
15373 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15374 __pyx_r = __pyx_t_5;
15396 __Pyx_PyThreadState_declare
15397 __Pyx_PyThreadState_assign
15398 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
15399 __Pyx_XGOTREF(__pyx_t_6);
15400 __Pyx_XGOTREF(__pyx_t_7);
15401 __Pyx_XGOTREF(__pyx_t_8);
15411 __Pyx_XDECREF(__pyx_r);
15412 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1694, __pyx_L4_error)
15413 __Pyx_GOTREF(__pyx_t_3);
15414 __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)
15415 __Pyx_GOTREF(__pyx_t_9);
15416 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15418 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
15419 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
15420 if (likely(__pyx_t_3)) {
15421 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
15422 __Pyx_INCREF(__pyx_t_3);
15423 __Pyx_INCREF(
function);
15424 __Pyx_DECREF_SET(__pyx_t_9,
function);
15428 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1694, __pyx_L4_error)
15429 __Pyx_GOTREF(__pyx_t_5);
15431 #if CYTHON_FAST_PYCALL 15432 if (PyFunction_Check(__pyx_t_9)) {
15433 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
15434 __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1694, __pyx_L4_error)
15435 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15436 __Pyx_GOTREF(__pyx_t_5);
15439 #if CYTHON_FAST_PYCCALL 15440 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
15441 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
15442 __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1694, __pyx_L4_error)
15443 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15444 __Pyx_GOTREF(__pyx_t_5);
15448 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1694, __pyx_L4_error)
15449 __Pyx_GOTREF(__pyx_t_10);
15450 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
15451 __Pyx_INCREF(__pyx_v_obj);
15452 __Pyx_GIVEREF(__pyx_v_obj);
15453 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
15454 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1694, __pyx_L4_error)
15455 __Pyx_GOTREF(__pyx_t_5);
15456 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15459 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15460 __pyx_r = __pyx_t_5;
15462 goto __pyx_L8_try_return;
15473 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15474 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
15475 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
15476 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15486 __Pyx_AddTraceback(
"PyClical.sin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15487 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1695, __pyx_L6_except_error)
15488 __Pyx_GOTREF(__pyx_t_5);
15489 __Pyx_GOTREF(__pyx_t_9);
15490 __Pyx_GOTREF(__pyx_t_10);
15499 __Pyx_XDECREF(__pyx_r);
15500 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1696, __pyx_L6_except_error)
15501 __Pyx_GOTREF(__pyx_t_3);
15502 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_3),
sin(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1696, __pyx_L6_except_error)
15503 __Pyx_GOTREF(__pyx_t_11);
15504 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15505 __pyx_r = __pyx_t_11;
15507 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15508 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15509 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15510 goto __pyx_L7_except_return;
15512 __pyx_L6_except_error:;
15521 __Pyx_XGIVEREF(__pyx_t_6);
15522 __Pyx_XGIVEREF(__pyx_t_7);
15523 __Pyx_XGIVEREF(__pyx_t_8);
15524 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15525 goto __pyx_L1_error;
15526 __pyx_L8_try_return:;
15527 __Pyx_XGIVEREF(__pyx_t_6);
15528 __Pyx_XGIVEREF(__pyx_t_7);
15529 __Pyx_XGIVEREF(__pyx_t_8);
15530 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15532 __pyx_L7_except_return:;
15533 __Pyx_XGIVEREF(__pyx_t_6);
15534 __Pyx_XGIVEREF(__pyx_t_7);
15535 __Pyx_XGIVEREF(__pyx_t_8);
15536 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15551 __Pyx_XDECREF(__pyx_t_3);
15552 __Pyx_XDECREF(__pyx_t_5);
15553 __Pyx_XDECREF(__pyx_t_9);
15554 __Pyx_XDECREF(__pyx_t_10);
15555 __Pyx_XDECREF(__pyx_t_11);
15556 __Pyx_AddTraceback(
"PyClical.sin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15559 __Pyx_XGIVEREF(__pyx_r);
15560 __Pyx_RefNannyFinishContext();
15565 static PyObject *__pyx_pw_8PyClical_59sin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15566 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 ";
15567 static PyObject *__pyx_pw_8PyClical_59sin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15568 PyObject *__pyx_v_obj = 0;
15569 PyObject *__pyx_v_i = 0;
15570 PyObject *__pyx_r = 0;
15571 __Pyx_RefNannyDeclarations
15572 __Pyx_RefNannySetupContext(
"sin (wrapper)", 0);
15574 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
15575 PyObject* values[2] = {0,0};
15576 values[1] = ((PyObject *)Py_None);
15577 if (unlikely(__pyx_kwds)) {
15578 Py_ssize_t kw_args;
15579 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15580 switch (pos_args) {
15581 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15582 CYTHON_FALLTHROUGH;
15583 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15584 CYTHON_FALLTHROUGH;
15586 default:
goto __pyx_L5_argtuple_error;
15588 kw_args = PyDict_Size(__pyx_kwds);
15589 switch (pos_args) {
15591 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
15592 else goto __pyx_L5_argtuple_error;
15593 CYTHON_FALLTHROUGH;
15596 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
15597 if (value) { values[1] = value; kw_args--; }
15600 if (unlikely(kw_args > 0)) {
15601 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"sin") < 0)) __PYX_ERR(0, 1679, __pyx_L3_error)
15604 switch (PyTuple_GET_SIZE(__pyx_args)) {
15605 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15606 CYTHON_FALLTHROUGH;
15607 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15609 default:
goto __pyx_L5_argtuple_error;
15612 __pyx_v_obj = values[0];
15613 __pyx_v_i = values[1];
15615 goto __pyx_L4_argument_unpacking_done;
15616 __pyx_L5_argtuple_error:;
15617 __Pyx_RaiseArgtupleInvalid(
"sin", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1679, __pyx_L3_error)
15619 __Pyx_AddTraceback(
"PyClical.sin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15620 __Pyx_RefNannyFinishContext();
15622 __pyx_L4_argument_unpacking_done:;
15623 __pyx_r = __pyx_pf_8PyClical_58sin(__pyx_self, __pyx_v_obj, __pyx_v_i);
15626 __Pyx_RefNannyFinishContext();
15630 static PyObject *__pyx_pf_8PyClical_58sin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
15631 PyObject *__pyx_r = NULL;
15632 __Pyx_RefNannyDeclarations
15633 PyObject *__pyx_t_1 = NULL;
15634 struct __pyx_opt_args_8PyClical_sin __pyx_t_2;
15635 __Pyx_RefNannySetupContext(
"sin", 0);
15636 __Pyx_XDECREF(__pyx_r);
15637 __pyx_t_2.__pyx_n = 1;
15638 __pyx_t_2.i = __pyx_v_i;
15639 __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)
15640 __Pyx_GOTREF(__pyx_t_1);
15641 __pyx_r = __pyx_t_1;
15647 __Pyx_XDECREF(__pyx_t_1);
15648 __Pyx_AddTraceback(
"PyClical.sin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15651 __Pyx_XGIVEREF(__pyx_r);
15652 __Pyx_RefNannyFinishContext();
15664 static PyObject *__pyx_pw_8PyClical_61asin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15665 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) {
15666 PyObject *__pyx_v_i = ((PyObject *)Py_None);
15667 PyObject *__pyx_r = NULL;
15668 __Pyx_RefNannyDeclarations
15671 PyObject *__pyx_t_3 = NULL;
15673 PyObject *__pyx_t_5 = NULL;
15674 PyObject *__pyx_t_6 = NULL;
15675 PyObject *__pyx_t_7 = NULL;
15676 PyObject *__pyx_t_8 = NULL;
15677 PyObject *__pyx_t_9 = NULL;
15678 PyObject *__pyx_t_10 = NULL;
15679 PyObject *__pyx_t_11 = NULL;
15680 __Pyx_RefNannySetupContext(
"asin", 0);
15681 if (__pyx_optional_args) {
15682 if (__pyx_optional_args->__pyx_n > 0) {
15683 __pyx_v_i = __pyx_optional_args->i;
15694 __pyx_t_1 = (__pyx_v_i != Py_None);
15695 __pyx_t_2 = (__pyx_t_1 != 0);
15705 __Pyx_XDECREF(__pyx_r);
15706 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1712, __pyx_L1_error)
15707 __Pyx_GOTREF(__pyx_t_3);
15709 __pyx_t_4 =
asin(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
15711 __Pyx_CppExn2PyErr();
15712 __PYX_ERR(0, 1712, __pyx_L1_error)
15714 __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)
15715 __Pyx_GOTREF(__pyx_t_5);
15716 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15717 __pyx_r = __pyx_t_5;
15739 __Pyx_PyThreadState_declare
15740 __Pyx_PyThreadState_assign
15741 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
15742 __Pyx_XGOTREF(__pyx_t_6);
15743 __Pyx_XGOTREF(__pyx_t_7);
15744 __Pyx_XGOTREF(__pyx_t_8);
15754 __Pyx_XDECREF(__pyx_r);
15755 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1715, __pyx_L4_error)
15756 __Pyx_GOTREF(__pyx_t_3);
15757 __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)
15758 __Pyx_GOTREF(__pyx_t_9);
15759 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15761 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
15762 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
15763 if (likely(__pyx_t_3)) {
15764 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
15765 __Pyx_INCREF(__pyx_t_3);
15766 __Pyx_INCREF(
function);
15767 __Pyx_DECREF_SET(__pyx_t_9,
function);
15771 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1715, __pyx_L4_error)
15772 __Pyx_GOTREF(__pyx_t_5);
15774 #if CYTHON_FAST_PYCALL 15775 if (PyFunction_Check(__pyx_t_9)) {
15776 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
15777 __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1715, __pyx_L4_error)
15778 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15779 __Pyx_GOTREF(__pyx_t_5);
15782 #if CYTHON_FAST_PYCCALL 15783 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
15784 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
15785 __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1715, __pyx_L4_error)
15786 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15787 __Pyx_GOTREF(__pyx_t_5);
15791 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1715, __pyx_L4_error)
15792 __Pyx_GOTREF(__pyx_t_10);
15793 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
15794 __Pyx_INCREF(__pyx_v_obj);
15795 __Pyx_GIVEREF(__pyx_v_obj);
15796 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
15797 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1715, __pyx_L4_error)
15798 __Pyx_GOTREF(__pyx_t_5);
15799 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15802 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15803 __pyx_r = __pyx_t_5;
15805 goto __pyx_L8_try_return;
15816 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15817 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
15818 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
15819 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15829 __Pyx_AddTraceback(
"PyClical.asin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15830 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1716, __pyx_L6_except_error)
15831 __Pyx_GOTREF(__pyx_t_5);
15832 __Pyx_GOTREF(__pyx_t_9);
15833 __Pyx_GOTREF(__pyx_t_10);
15842 __Pyx_XDECREF(__pyx_r);
15843 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1717, __pyx_L6_except_error)
15844 __Pyx_GOTREF(__pyx_t_3);
15845 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_3),
asin(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1717, __pyx_L6_except_error)
15846 __Pyx_GOTREF(__pyx_t_11);
15847 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15848 __pyx_r = __pyx_t_11;
15850 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15851 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15852 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15853 goto __pyx_L7_except_return;
15855 __pyx_L6_except_error:;
15864 __Pyx_XGIVEREF(__pyx_t_6);
15865 __Pyx_XGIVEREF(__pyx_t_7);
15866 __Pyx_XGIVEREF(__pyx_t_8);
15867 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15868 goto __pyx_L1_error;
15869 __pyx_L8_try_return:;
15870 __Pyx_XGIVEREF(__pyx_t_6);
15871 __Pyx_XGIVEREF(__pyx_t_7);
15872 __Pyx_XGIVEREF(__pyx_t_8);
15873 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15875 __pyx_L7_except_return:;
15876 __Pyx_XGIVEREF(__pyx_t_6);
15877 __Pyx_XGIVEREF(__pyx_t_7);
15878 __Pyx_XGIVEREF(__pyx_t_8);
15879 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15894 __Pyx_XDECREF(__pyx_t_3);
15895 __Pyx_XDECREF(__pyx_t_5);
15896 __Pyx_XDECREF(__pyx_t_9);
15897 __Pyx_XDECREF(__pyx_t_10);
15898 __Pyx_XDECREF(__pyx_t_11);
15899 __Pyx_AddTraceback(
"PyClical.asin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15902 __Pyx_XGIVEREF(__pyx_r);
15903 __Pyx_RefNannyFinishContext();
15908 static PyObject *__pyx_pw_8PyClical_61asin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15909 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 ";
15910 static PyObject *__pyx_pw_8PyClical_61asin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15911 PyObject *__pyx_v_obj = 0;
15912 PyObject *__pyx_v_i = 0;
15913 PyObject *__pyx_r = 0;
15914 __Pyx_RefNannyDeclarations
15915 __Pyx_RefNannySetupContext(
"asin (wrapper)", 0);
15917 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
15918 PyObject* values[2] = {0,0};
15919 values[1] = ((PyObject *)Py_None);
15920 if (unlikely(__pyx_kwds)) {
15921 Py_ssize_t kw_args;
15922 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15923 switch (pos_args) {
15924 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15925 CYTHON_FALLTHROUGH;
15926 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15927 CYTHON_FALLTHROUGH;
15929 default:
goto __pyx_L5_argtuple_error;
15931 kw_args = PyDict_Size(__pyx_kwds);
15932 switch (pos_args) {
15934 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
15935 else goto __pyx_L5_argtuple_error;
15936 CYTHON_FALLTHROUGH;
15939 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
15940 if (value) { values[1] = value; kw_args--; }
15943 if (unlikely(kw_args > 0)) {
15944 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"asin") < 0)) __PYX_ERR(0, 1698, __pyx_L3_error)
15947 switch (PyTuple_GET_SIZE(__pyx_args)) {
15948 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15949 CYTHON_FALLTHROUGH;
15950 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15952 default:
goto __pyx_L5_argtuple_error;
15955 __pyx_v_obj = values[0];
15956 __pyx_v_i = values[1];
15958 goto __pyx_L4_argument_unpacking_done;
15959 __pyx_L5_argtuple_error:;
15960 __Pyx_RaiseArgtupleInvalid(
"asin", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1698, __pyx_L3_error)
15962 __Pyx_AddTraceback(
"PyClical.asin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15963 __Pyx_RefNannyFinishContext();
15965 __pyx_L4_argument_unpacking_done:;
15966 __pyx_r = __pyx_pf_8PyClical_60asin(__pyx_self, __pyx_v_obj, __pyx_v_i);
15969 __Pyx_RefNannyFinishContext();
15973 static PyObject *__pyx_pf_8PyClical_60asin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
15974 PyObject *__pyx_r = NULL;
15975 __Pyx_RefNannyDeclarations
15976 PyObject *__pyx_t_1 = NULL;
15977 struct __pyx_opt_args_8PyClical_asin __pyx_t_2;
15978 __Pyx_RefNannySetupContext(
"asin", 0);
15979 __Pyx_XDECREF(__pyx_r);
15980 __pyx_t_2.__pyx_n = 1;
15981 __pyx_t_2.i = __pyx_v_i;
15982 __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)
15983 __Pyx_GOTREF(__pyx_t_1);
15984 __pyx_r = __pyx_t_1;
15990 __Pyx_XDECREF(__pyx_t_1);
15991 __Pyx_AddTraceback(
"PyClical.asin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15994 __Pyx_XGIVEREF(__pyx_r);
15995 __Pyx_RefNannyFinishContext();
16007 static PyObject *__pyx_pw_8PyClical_63sinh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
16008 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_sinh(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
16009 PyObject *__pyx_r = NULL;
16010 __Pyx_RefNannyDeclarations
16011 PyObject *__pyx_t_1 = NULL;
16012 PyObject *__pyx_t_2 = NULL;
16013 PyObject *__pyx_t_3 = NULL;
16014 PyObject *__pyx_t_4 = NULL;
16015 PyObject *__pyx_t_5 = NULL;
16016 PyObject *__pyx_t_6 = NULL;
16017 PyObject *__pyx_t_7 = NULL;
16018 PyObject *__pyx_t_8 = NULL;
16019 __Pyx_RefNannySetupContext(
"sinh", 0);
16029 __Pyx_PyThreadState_declare
16030 __Pyx_PyThreadState_assign
16031 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
16032 __Pyx_XGOTREF(__pyx_t_1);
16033 __Pyx_XGOTREF(__pyx_t_2);
16034 __Pyx_XGOTREF(__pyx_t_3);
16044 __Pyx_XDECREF(__pyx_r);
16045 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1729, __pyx_L3_error)
16046 __Pyx_GOTREF(__pyx_t_5);
16047 __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)
16048 __Pyx_GOTREF(__pyx_t_6);
16049 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16051 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
16052 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
16053 if (likely(__pyx_t_5)) {
16054 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
16055 __Pyx_INCREF(__pyx_t_5);
16056 __Pyx_INCREF(
function);
16057 __Pyx_DECREF_SET(__pyx_t_6,
function);
16061 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_obj);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1729, __pyx_L3_error)
16062 __Pyx_GOTREF(__pyx_t_4);
16064 #if CYTHON_FAST_PYCALL 16065 if (PyFunction_Check(__pyx_t_6)) {
16066 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_obj};
16067 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1729, __pyx_L3_error)
16068 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16069 __Pyx_GOTREF(__pyx_t_4);
16072 #if CYTHON_FAST_PYCCALL 16073 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
16074 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_obj};
16075 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1729, __pyx_L3_error)
16076 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16077 __Pyx_GOTREF(__pyx_t_4);
16081 __pyx_t_7 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1729, __pyx_L3_error)
16082 __Pyx_GOTREF(__pyx_t_7);
16083 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
16084 __Pyx_INCREF(__pyx_v_obj);
16085 __Pyx_GIVEREF(__pyx_v_obj);
16086 PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_obj);
16087 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1729, __pyx_L3_error)
16088 __Pyx_GOTREF(__pyx_t_4);
16089 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16092 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16093 __pyx_r = __pyx_t_4;
16095 goto __pyx_L7_try_return;
16106 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16107 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
16108 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
16109 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
16119 __Pyx_AddTraceback(
"PyClical.sinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16120 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1730, __pyx_L5_except_error)
16121 __Pyx_GOTREF(__pyx_t_4);
16122 __Pyx_GOTREF(__pyx_t_6);
16123 __Pyx_GOTREF(__pyx_t_7);
16132 __Pyx_XDECREF(__pyx_r);
16133 __pyx_t_5 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1731, __pyx_L5_except_error)
16134 __Pyx_GOTREF(__pyx_t_5);
16135 __pyx_t_8 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_5),
sinh(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1731, __pyx_L5_except_error)
16136 __Pyx_GOTREF(__pyx_t_8);
16137 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16138 __pyx_r = __pyx_t_8;
16140 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16141 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16142 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16143 goto __pyx_L6_except_return;
16145 __pyx_L5_except_error:;
16154 __Pyx_XGIVEREF(__pyx_t_1);
16155 __Pyx_XGIVEREF(__pyx_t_2);
16156 __Pyx_XGIVEREF(__pyx_t_3);
16157 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
16158 goto __pyx_L1_error;
16159 __pyx_L7_try_return:;
16160 __Pyx_XGIVEREF(__pyx_t_1);
16161 __Pyx_XGIVEREF(__pyx_t_2);
16162 __Pyx_XGIVEREF(__pyx_t_3);
16163 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
16165 __pyx_L6_except_return:;
16166 __Pyx_XGIVEREF(__pyx_t_1);
16167 __Pyx_XGIVEREF(__pyx_t_2);
16168 __Pyx_XGIVEREF(__pyx_t_3);
16169 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
16183 __Pyx_XDECREF(__pyx_t_4);
16184 __Pyx_XDECREF(__pyx_t_5);
16185 __Pyx_XDECREF(__pyx_t_6);
16186 __Pyx_XDECREF(__pyx_t_7);
16187 __Pyx_XDECREF(__pyx_t_8);
16188 __Pyx_AddTraceback(
"PyClical.sinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16191 __Pyx_XGIVEREF(__pyx_r);
16192 __Pyx_RefNannyFinishContext();
16197 static PyObject *__pyx_pw_8PyClical_63sinh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
16198 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 ";
16199 static PyObject *__pyx_pw_8PyClical_63sinh(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
16200 PyObject *__pyx_r = 0;
16201 __Pyx_RefNannyDeclarations
16202 __Pyx_RefNannySetupContext(
"sinh (wrapper)", 0);
16203 __pyx_r = __pyx_pf_8PyClical_62sinh(__pyx_self, ((PyObject *)__pyx_v_obj));
16206 __Pyx_RefNannyFinishContext();
16210 static PyObject *__pyx_pf_8PyClical_62sinh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
16211 PyObject *__pyx_r = NULL;
16212 __Pyx_RefNannyDeclarations
16213 PyObject *__pyx_t_1 = NULL;
16214 __Pyx_RefNannySetupContext(
"sinh", 0);
16215 __Pyx_XDECREF(__pyx_r);
16216 __pyx_t_1 = __pyx_f_8PyClical_sinh(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1719, __pyx_L1_error)
16217 __Pyx_GOTREF(__pyx_t_1);
16218 __pyx_r = __pyx_t_1;
16224 __Pyx_XDECREF(__pyx_t_1);
16225 __Pyx_AddTraceback(
"PyClical.sinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16228 __Pyx_XGIVEREF(__pyx_r);
16229 __Pyx_RefNannyFinishContext();
16241 static PyObject *__pyx_pw_8PyClical_65asinh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16242 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) {
16243 PyObject *__pyx_v_i = ((PyObject *)Py_None);
16244 PyObject *__pyx_r = NULL;
16245 __Pyx_RefNannyDeclarations
16248 PyObject *__pyx_t_3 = NULL;
16250 PyObject *__pyx_t_5 = NULL;
16251 PyObject *__pyx_t_6 = NULL;
16252 PyObject *__pyx_t_7 = NULL;
16253 PyObject *__pyx_t_8 = NULL;
16254 PyObject *__pyx_t_9 = NULL;
16255 PyObject *__pyx_t_10 = NULL;
16256 PyObject *__pyx_t_11 = NULL;
16257 __Pyx_RefNannySetupContext(
"asinh", 0);
16258 if (__pyx_optional_args) {
16259 if (__pyx_optional_args->__pyx_n > 0) {
16260 __pyx_v_i = __pyx_optional_args->i;
16271 __pyx_t_1 = (__pyx_v_i != Py_None);
16272 __pyx_t_2 = (__pyx_t_1 != 0);
16282 __Pyx_XDECREF(__pyx_r);
16283 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1745, __pyx_L1_error)
16284 __Pyx_GOTREF(__pyx_t_3);
16286 __pyx_t_4 =
asinh(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
16288 __Pyx_CppExn2PyErr();
16289 __PYX_ERR(0, 1745, __pyx_L1_error)
16291 __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)
16292 __Pyx_GOTREF(__pyx_t_5);
16293 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16294 __pyx_r = __pyx_t_5;
16316 __Pyx_PyThreadState_declare
16317 __Pyx_PyThreadState_assign
16318 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
16319 __Pyx_XGOTREF(__pyx_t_6);
16320 __Pyx_XGOTREF(__pyx_t_7);
16321 __Pyx_XGOTREF(__pyx_t_8);
16331 __Pyx_XDECREF(__pyx_r);
16332 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1748, __pyx_L4_error)
16333 __Pyx_GOTREF(__pyx_t_3);
16334 __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)
16335 __Pyx_GOTREF(__pyx_t_9);
16336 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16338 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
16339 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
16340 if (likely(__pyx_t_3)) {
16341 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
16342 __Pyx_INCREF(__pyx_t_3);
16343 __Pyx_INCREF(
function);
16344 __Pyx_DECREF_SET(__pyx_t_9,
function);
16348 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1748, __pyx_L4_error)
16349 __Pyx_GOTREF(__pyx_t_5);
16351 #if CYTHON_FAST_PYCALL 16352 if (PyFunction_Check(__pyx_t_9)) {
16353 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
16354 __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1748, __pyx_L4_error)
16355 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16356 __Pyx_GOTREF(__pyx_t_5);
16359 #if CYTHON_FAST_PYCCALL 16360 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
16361 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
16362 __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1748, __pyx_L4_error)
16363 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16364 __Pyx_GOTREF(__pyx_t_5);
16368 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1748, __pyx_L4_error)
16369 __Pyx_GOTREF(__pyx_t_10);
16370 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
16371 __Pyx_INCREF(__pyx_v_obj);
16372 __Pyx_GIVEREF(__pyx_v_obj);
16373 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
16374 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1748, __pyx_L4_error)
16375 __Pyx_GOTREF(__pyx_t_5);
16376 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16379 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16380 __pyx_r = __pyx_t_5;
16382 goto __pyx_L8_try_return;
16393 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16394 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
16395 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
16396 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16406 __Pyx_AddTraceback(
"PyClical.asinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16407 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1749, __pyx_L6_except_error)
16408 __Pyx_GOTREF(__pyx_t_5);
16409 __Pyx_GOTREF(__pyx_t_9);
16410 __Pyx_GOTREF(__pyx_t_10);
16419 __Pyx_XDECREF(__pyx_r);
16420 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1750, __pyx_L6_except_error)
16421 __Pyx_GOTREF(__pyx_t_3);
16422 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_3),
asinh(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1750, __pyx_L6_except_error)
16423 __Pyx_GOTREF(__pyx_t_11);
16424 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16425 __pyx_r = __pyx_t_11;
16427 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16428 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16429 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16430 goto __pyx_L7_except_return;
16432 __pyx_L6_except_error:;
16441 __Pyx_XGIVEREF(__pyx_t_6);
16442 __Pyx_XGIVEREF(__pyx_t_7);
16443 __Pyx_XGIVEREF(__pyx_t_8);
16444 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16445 goto __pyx_L1_error;
16446 __pyx_L8_try_return:;
16447 __Pyx_XGIVEREF(__pyx_t_6);
16448 __Pyx_XGIVEREF(__pyx_t_7);
16449 __Pyx_XGIVEREF(__pyx_t_8);
16450 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16452 __pyx_L7_except_return:;
16453 __Pyx_XGIVEREF(__pyx_t_6);
16454 __Pyx_XGIVEREF(__pyx_t_7);
16455 __Pyx_XGIVEREF(__pyx_t_8);
16456 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16471 __Pyx_XDECREF(__pyx_t_3);
16472 __Pyx_XDECREF(__pyx_t_5);
16473 __Pyx_XDECREF(__pyx_t_9);
16474 __Pyx_XDECREF(__pyx_t_10);
16475 __Pyx_XDECREF(__pyx_t_11);
16476 __Pyx_AddTraceback(
"PyClical.asinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16479 __Pyx_XGIVEREF(__pyx_r);
16480 __Pyx_RefNannyFinishContext();
16485 static PyObject *__pyx_pw_8PyClical_65asinh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16486 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 ";
16487 static PyObject *__pyx_pw_8PyClical_65asinh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16488 PyObject *__pyx_v_obj = 0;
16489 PyObject *__pyx_v_i = 0;
16490 PyObject *__pyx_r = 0;
16491 __Pyx_RefNannyDeclarations
16492 __Pyx_RefNannySetupContext(
"asinh (wrapper)", 0);
16494 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
16495 PyObject* values[2] = {0,0};
16496 values[1] = ((PyObject *)Py_None);
16497 if (unlikely(__pyx_kwds)) {
16498 Py_ssize_t kw_args;
16499 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16500 switch (pos_args) {
16501 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16502 CYTHON_FALLTHROUGH;
16503 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16504 CYTHON_FALLTHROUGH;
16506 default:
goto __pyx_L5_argtuple_error;
16508 kw_args = PyDict_Size(__pyx_kwds);
16509 switch (pos_args) {
16511 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
16512 else goto __pyx_L5_argtuple_error;
16513 CYTHON_FALLTHROUGH;
16516 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
16517 if (value) { values[1] = value; kw_args--; }
16520 if (unlikely(kw_args > 0)) {
16521 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"asinh") < 0)) __PYX_ERR(0, 1733, __pyx_L3_error)
16524 switch (PyTuple_GET_SIZE(__pyx_args)) {
16525 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16526 CYTHON_FALLTHROUGH;
16527 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16529 default:
goto __pyx_L5_argtuple_error;
16532 __pyx_v_obj = values[0];
16533 __pyx_v_i = values[1];
16535 goto __pyx_L4_argument_unpacking_done;
16536 __pyx_L5_argtuple_error:;
16537 __Pyx_RaiseArgtupleInvalid(
"asinh", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1733, __pyx_L3_error)
16539 __Pyx_AddTraceback(
"PyClical.asinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16540 __Pyx_RefNannyFinishContext();
16542 __pyx_L4_argument_unpacking_done:;
16543 __pyx_r = __pyx_pf_8PyClical_64asinh(__pyx_self, __pyx_v_obj, __pyx_v_i);
16546 __Pyx_RefNannyFinishContext();
16550 static PyObject *__pyx_pf_8PyClical_64asinh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
16551 PyObject *__pyx_r = NULL;
16552 __Pyx_RefNannyDeclarations
16553 PyObject *__pyx_t_1 = NULL;
16554 struct __pyx_opt_args_8PyClical_asinh __pyx_t_2;
16555 __Pyx_RefNannySetupContext(
"asinh", 0);
16556 __Pyx_XDECREF(__pyx_r);
16557 __pyx_t_2.__pyx_n = 1;
16558 __pyx_t_2.i = __pyx_v_i;
16559 __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)
16560 __Pyx_GOTREF(__pyx_t_1);
16561 __pyx_r = __pyx_t_1;
16567 __Pyx_XDECREF(__pyx_t_1);
16568 __Pyx_AddTraceback(
"PyClical.asinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16571 __Pyx_XGIVEREF(__pyx_r);
16572 __Pyx_RefNannyFinishContext();
16584 static PyObject *__pyx_pw_8PyClical_67tan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16585 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) {
16586 PyObject *__pyx_v_i = ((PyObject *)Py_None);
16587 PyObject *__pyx_r = NULL;
16588 __Pyx_RefNannyDeclarations
16591 PyObject *__pyx_t_3 = NULL;
16593 PyObject *__pyx_t_5 = NULL;
16594 PyObject *__pyx_t_6 = NULL;
16595 PyObject *__pyx_t_7 = NULL;
16596 PyObject *__pyx_t_8 = NULL;
16597 PyObject *__pyx_t_9 = NULL;
16598 PyObject *__pyx_t_10 = NULL;
16599 PyObject *__pyx_t_11 = NULL;
16600 __Pyx_RefNannySetupContext(
"tan", 0);
16601 if (__pyx_optional_args) {
16602 if (__pyx_optional_args->__pyx_n > 0) {
16603 __pyx_v_i = __pyx_optional_args->i;
16614 __pyx_t_1 = (__pyx_v_i != Py_None);
16615 __pyx_t_2 = (__pyx_t_1 != 0);
16625 __Pyx_XDECREF(__pyx_r);
16626 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1762, __pyx_L1_error)
16627 __Pyx_GOTREF(__pyx_t_3);
16629 __pyx_t_4 =
tan(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
16631 __Pyx_CppExn2PyErr();
16632 __PYX_ERR(0, 1762, __pyx_L1_error)
16634 __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)
16635 __Pyx_GOTREF(__pyx_t_5);
16636 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16637 __pyx_r = __pyx_t_5;
16659 __Pyx_PyThreadState_declare
16660 __Pyx_PyThreadState_assign
16661 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
16662 __Pyx_XGOTREF(__pyx_t_6);
16663 __Pyx_XGOTREF(__pyx_t_7);
16664 __Pyx_XGOTREF(__pyx_t_8);
16674 __Pyx_XDECREF(__pyx_r);
16675 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1765, __pyx_L4_error)
16676 __Pyx_GOTREF(__pyx_t_3);
16677 __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)
16678 __Pyx_GOTREF(__pyx_t_9);
16679 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16681 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
16682 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
16683 if (likely(__pyx_t_3)) {
16684 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
16685 __Pyx_INCREF(__pyx_t_3);
16686 __Pyx_INCREF(
function);
16687 __Pyx_DECREF_SET(__pyx_t_9,
function);
16691 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1765, __pyx_L4_error)
16692 __Pyx_GOTREF(__pyx_t_5);
16694 #if CYTHON_FAST_PYCALL 16695 if (PyFunction_Check(__pyx_t_9)) {
16696 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
16697 __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1765, __pyx_L4_error)
16698 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16699 __Pyx_GOTREF(__pyx_t_5);
16702 #if CYTHON_FAST_PYCCALL 16703 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
16704 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
16705 __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1765, __pyx_L4_error)
16706 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16707 __Pyx_GOTREF(__pyx_t_5);
16711 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1765, __pyx_L4_error)
16712 __Pyx_GOTREF(__pyx_t_10);
16713 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
16714 __Pyx_INCREF(__pyx_v_obj);
16715 __Pyx_GIVEREF(__pyx_v_obj);
16716 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
16717 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1765, __pyx_L4_error)
16718 __Pyx_GOTREF(__pyx_t_5);
16719 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16722 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16723 __pyx_r = __pyx_t_5;
16725 goto __pyx_L8_try_return;
16736 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16737 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
16738 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
16739 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16749 __Pyx_AddTraceback(
"PyClical.tan", __pyx_clineno, __pyx_lineno, __pyx_filename);
16750 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1766, __pyx_L6_except_error)
16751 __Pyx_GOTREF(__pyx_t_5);
16752 __Pyx_GOTREF(__pyx_t_9);
16753 __Pyx_GOTREF(__pyx_t_10);
16762 __Pyx_XDECREF(__pyx_r);
16763 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1767, __pyx_L6_except_error)
16764 __Pyx_GOTREF(__pyx_t_3);
16765 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_3),
tan(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1767, __pyx_L6_except_error)
16766 __Pyx_GOTREF(__pyx_t_11);
16767 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16768 __pyx_r = __pyx_t_11;
16770 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16771 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16772 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16773 goto __pyx_L7_except_return;
16775 __pyx_L6_except_error:;
16784 __Pyx_XGIVEREF(__pyx_t_6);
16785 __Pyx_XGIVEREF(__pyx_t_7);
16786 __Pyx_XGIVEREF(__pyx_t_8);
16787 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16788 goto __pyx_L1_error;
16789 __pyx_L8_try_return:;
16790 __Pyx_XGIVEREF(__pyx_t_6);
16791 __Pyx_XGIVEREF(__pyx_t_7);
16792 __Pyx_XGIVEREF(__pyx_t_8);
16793 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16795 __pyx_L7_except_return:;
16796 __Pyx_XGIVEREF(__pyx_t_6);
16797 __Pyx_XGIVEREF(__pyx_t_7);
16798 __Pyx_XGIVEREF(__pyx_t_8);
16799 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16814 __Pyx_XDECREF(__pyx_t_3);
16815 __Pyx_XDECREF(__pyx_t_5);
16816 __Pyx_XDECREF(__pyx_t_9);
16817 __Pyx_XDECREF(__pyx_t_10);
16818 __Pyx_XDECREF(__pyx_t_11);
16819 __Pyx_AddTraceback(
"PyClical.tan", __pyx_clineno, __pyx_lineno, __pyx_filename);
16822 __Pyx_XGIVEREF(__pyx_r);
16823 __Pyx_RefNannyFinishContext();
16828 static PyObject *__pyx_pw_8PyClical_67tan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16829 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 ";
16830 static PyObject *__pyx_pw_8PyClical_67tan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16831 PyObject *__pyx_v_obj = 0;
16832 PyObject *__pyx_v_i = 0;
16833 PyObject *__pyx_r = 0;
16834 __Pyx_RefNannyDeclarations
16835 __Pyx_RefNannySetupContext(
"tan (wrapper)", 0);
16837 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
16838 PyObject* values[2] = {0,0};
16839 values[1] = ((PyObject *)Py_None);
16840 if (unlikely(__pyx_kwds)) {
16841 Py_ssize_t kw_args;
16842 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16843 switch (pos_args) {
16844 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16845 CYTHON_FALLTHROUGH;
16846 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16847 CYTHON_FALLTHROUGH;
16849 default:
goto __pyx_L5_argtuple_error;
16851 kw_args = PyDict_Size(__pyx_kwds);
16852 switch (pos_args) {
16854 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
16855 else goto __pyx_L5_argtuple_error;
16856 CYTHON_FALLTHROUGH;
16859 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
16860 if (value) { values[1] = value; kw_args--; }
16863 if (unlikely(kw_args > 0)) {
16864 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"tan") < 0)) __PYX_ERR(0, 1752, __pyx_L3_error)
16867 switch (PyTuple_GET_SIZE(__pyx_args)) {
16868 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16869 CYTHON_FALLTHROUGH;
16870 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16872 default:
goto __pyx_L5_argtuple_error;
16875 __pyx_v_obj = values[0];
16876 __pyx_v_i = values[1];
16878 goto __pyx_L4_argument_unpacking_done;
16879 __pyx_L5_argtuple_error:;
16880 __Pyx_RaiseArgtupleInvalid(
"tan", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1752, __pyx_L3_error)
16882 __Pyx_AddTraceback(
"PyClical.tan", __pyx_clineno, __pyx_lineno, __pyx_filename);
16883 __Pyx_RefNannyFinishContext();
16885 __pyx_L4_argument_unpacking_done:;
16886 __pyx_r = __pyx_pf_8PyClical_66tan(__pyx_self, __pyx_v_obj, __pyx_v_i);
16889 __Pyx_RefNannyFinishContext();
16893 static PyObject *__pyx_pf_8PyClical_66tan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
16894 PyObject *__pyx_r = NULL;
16895 __Pyx_RefNannyDeclarations
16896 PyObject *__pyx_t_1 = NULL;
16897 struct __pyx_opt_args_8PyClical_tan __pyx_t_2;
16898 __Pyx_RefNannySetupContext(
"tan", 0);
16899 __Pyx_XDECREF(__pyx_r);
16900 __pyx_t_2.__pyx_n = 1;
16901 __pyx_t_2.i = __pyx_v_i;
16902 __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)
16903 __Pyx_GOTREF(__pyx_t_1);
16904 __pyx_r = __pyx_t_1;
16910 __Pyx_XDECREF(__pyx_t_1);
16911 __Pyx_AddTraceback(
"PyClical.tan", __pyx_clineno, __pyx_lineno, __pyx_filename);
16914 __Pyx_XGIVEREF(__pyx_r);
16915 __Pyx_RefNannyFinishContext();
16927 static PyObject *__pyx_pw_8PyClical_69atan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16928 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) {
16929 PyObject *__pyx_v_i = ((PyObject *)Py_None);
16930 PyObject *__pyx_r = NULL;
16931 __Pyx_RefNannyDeclarations
16934 PyObject *__pyx_t_3 = NULL;
16936 PyObject *__pyx_t_5 = NULL;
16937 PyObject *__pyx_t_6 = NULL;
16938 PyObject *__pyx_t_7 = NULL;
16939 PyObject *__pyx_t_8 = NULL;
16940 PyObject *__pyx_t_9 = NULL;
16941 PyObject *__pyx_t_10 = NULL;
16942 PyObject *__pyx_t_11 = NULL;
16943 __Pyx_RefNannySetupContext(
"atan", 0);
16944 if (__pyx_optional_args) {
16945 if (__pyx_optional_args->__pyx_n > 0) {
16946 __pyx_v_i = __pyx_optional_args->i;
16957 __pyx_t_1 = (__pyx_v_i != Py_None);
16958 __pyx_t_2 = (__pyx_t_1 != 0);
16968 __Pyx_XDECREF(__pyx_r);
16969 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1779, __pyx_L1_error)
16970 __Pyx_GOTREF(__pyx_t_3);
16972 __pyx_t_4 =
atan(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
16974 __Pyx_CppExn2PyErr();
16975 __PYX_ERR(0, 1779, __pyx_L1_error)
16977 __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)
16978 __Pyx_GOTREF(__pyx_t_5);
16979 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16980 __pyx_r = __pyx_t_5;
17002 __Pyx_PyThreadState_declare
17003 __Pyx_PyThreadState_assign
17004 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
17005 __Pyx_XGOTREF(__pyx_t_6);
17006 __Pyx_XGOTREF(__pyx_t_7);
17007 __Pyx_XGOTREF(__pyx_t_8);
17017 __Pyx_XDECREF(__pyx_r);
17018 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1782, __pyx_L4_error)
17019 __Pyx_GOTREF(__pyx_t_3);
17020 __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)
17021 __Pyx_GOTREF(__pyx_t_9);
17022 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17024 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
17025 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
17026 if (likely(__pyx_t_3)) {
17027 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
17028 __Pyx_INCREF(__pyx_t_3);
17029 __Pyx_INCREF(
function);
17030 __Pyx_DECREF_SET(__pyx_t_9,
function);
17034 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1782, __pyx_L4_error)
17035 __Pyx_GOTREF(__pyx_t_5);
17037 #if CYTHON_FAST_PYCALL 17038 if (PyFunction_Check(__pyx_t_9)) {
17039 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
17040 __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1782, __pyx_L4_error)
17041 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17042 __Pyx_GOTREF(__pyx_t_5);
17045 #if CYTHON_FAST_PYCCALL 17046 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
17047 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
17048 __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1782, __pyx_L4_error)
17049 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17050 __Pyx_GOTREF(__pyx_t_5);
17054 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1782, __pyx_L4_error)
17055 __Pyx_GOTREF(__pyx_t_10);
17056 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
17057 __Pyx_INCREF(__pyx_v_obj);
17058 __Pyx_GIVEREF(__pyx_v_obj);
17059 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
17060 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1782, __pyx_L4_error)
17061 __Pyx_GOTREF(__pyx_t_5);
17062 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
17065 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17066 __pyx_r = __pyx_t_5;
17068 goto __pyx_L8_try_return;
17079 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17080 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
17081 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
17082 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17092 __Pyx_AddTraceback(
"PyClical.atan", __pyx_clineno, __pyx_lineno, __pyx_filename);
17093 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1783, __pyx_L6_except_error)
17094 __Pyx_GOTREF(__pyx_t_5);
17095 __Pyx_GOTREF(__pyx_t_9);
17096 __Pyx_GOTREF(__pyx_t_10);
17105 __Pyx_XDECREF(__pyx_r);
17106 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1784, __pyx_L6_except_error)
17107 __Pyx_GOTREF(__pyx_t_3);
17108 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_3),
atan(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1784, __pyx_L6_except_error)
17109 __Pyx_GOTREF(__pyx_t_11);
17110 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17111 __pyx_r = __pyx_t_11;
17113 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17114 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17115 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
17116 goto __pyx_L7_except_return;
17118 __pyx_L6_except_error:;
17127 __Pyx_XGIVEREF(__pyx_t_6);
17128 __Pyx_XGIVEREF(__pyx_t_7);
17129 __Pyx_XGIVEREF(__pyx_t_8);
17130 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17131 goto __pyx_L1_error;
17132 __pyx_L8_try_return:;
17133 __Pyx_XGIVEREF(__pyx_t_6);
17134 __Pyx_XGIVEREF(__pyx_t_7);
17135 __Pyx_XGIVEREF(__pyx_t_8);
17136 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17138 __pyx_L7_except_return:;
17139 __Pyx_XGIVEREF(__pyx_t_6);
17140 __Pyx_XGIVEREF(__pyx_t_7);
17141 __Pyx_XGIVEREF(__pyx_t_8);
17142 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17157 __Pyx_XDECREF(__pyx_t_3);
17158 __Pyx_XDECREF(__pyx_t_5);
17159 __Pyx_XDECREF(__pyx_t_9);
17160 __Pyx_XDECREF(__pyx_t_10);
17161 __Pyx_XDECREF(__pyx_t_11);
17162 __Pyx_AddTraceback(
"PyClical.atan", __pyx_clineno, __pyx_lineno, __pyx_filename);
17165 __Pyx_XGIVEREF(__pyx_r);
17166 __Pyx_RefNannyFinishContext();
17171 static PyObject *__pyx_pw_8PyClical_69atan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17172 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 ";
17173 static PyObject *__pyx_pw_8PyClical_69atan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17174 PyObject *__pyx_v_obj = 0;
17175 PyObject *__pyx_v_i = 0;
17176 PyObject *__pyx_r = 0;
17177 __Pyx_RefNannyDeclarations
17178 __Pyx_RefNannySetupContext(
"atan (wrapper)", 0);
17180 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
17181 PyObject* values[2] = {0,0};
17182 values[1] = ((PyObject *)Py_None);
17183 if (unlikely(__pyx_kwds)) {
17184 Py_ssize_t kw_args;
17185 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17186 switch (pos_args) {
17187 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17188 CYTHON_FALLTHROUGH;
17189 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17190 CYTHON_FALLTHROUGH;
17192 default:
goto __pyx_L5_argtuple_error;
17194 kw_args = PyDict_Size(__pyx_kwds);
17195 switch (pos_args) {
17197 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
17198 else goto __pyx_L5_argtuple_error;
17199 CYTHON_FALLTHROUGH;
17202 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
17203 if (value) { values[1] = value; kw_args--; }
17206 if (unlikely(kw_args > 0)) {
17207 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"atan") < 0)) __PYX_ERR(0, 1769, __pyx_L3_error)
17210 switch (PyTuple_GET_SIZE(__pyx_args)) {
17211 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17212 CYTHON_FALLTHROUGH;
17213 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17215 default:
goto __pyx_L5_argtuple_error;
17218 __pyx_v_obj = values[0];
17219 __pyx_v_i = values[1];
17221 goto __pyx_L4_argument_unpacking_done;
17222 __pyx_L5_argtuple_error:;
17223 __Pyx_RaiseArgtupleInvalid(
"atan", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1769, __pyx_L3_error)
17225 __Pyx_AddTraceback(
"PyClical.atan", __pyx_clineno, __pyx_lineno, __pyx_filename);
17226 __Pyx_RefNannyFinishContext();
17228 __pyx_L4_argument_unpacking_done:;
17229 __pyx_r = __pyx_pf_8PyClical_68atan(__pyx_self, __pyx_v_obj, __pyx_v_i);
17232 __Pyx_RefNannyFinishContext();
17236 static PyObject *__pyx_pf_8PyClical_68atan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
17237 PyObject *__pyx_r = NULL;
17238 __Pyx_RefNannyDeclarations
17239 PyObject *__pyx_t_1 = NULL;
17240 struct __pyx_opt_args_8PyClical_atan __pyx_t_2;
17241 __Pyx_RefNannySetupContext(
"atan", 0);
17242 __Pyx_XDECREF(__pyx_r);
17243 __pyx_t_2.__pyx_n = 1;
17244 __pyx_t_2.i = __pyx_v_i;
17245 __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)
17246 __Pyx_GOTREF(__pyx_t_1);
17247 __pyx_r = __pyx_t_1;
17253 __Pyx_XDECREF(__pyx_t_1);
17254 __Pyx_AddTraceback(
"PyClical.atan", __pyx_clineno, __pyx_lineno, __pyx_filename);
17257 __Pyx_XGIVEREF(__pyx_r);
17258 __Pyx_RefNannyFinishContext();
17270 static PyObject *__pyx_pw_8PyClical_71tanh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
17271 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_tanh(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
17272 PyObject *__pyx_r = NULL;
17273 __Pyx_RefNannyDeclarations
17274 PyObject *__pyx_t_1 = NULL;
17275 PyObject *__pyx_t_2 = NULL;
17276 PyObject *__pyx_t_3 = NULL;
17277 PyObject *__pyx_t_4 = NULL;
17278 PyObject *__pyx_t_5 = NULL;
17279 PyObject *__pyx_t_6 = NULL;
17280 PyObject *__pyx_t_7 = NULL;
17281 PyObject *__pyx_t_8 = NULL;
17282 __Pyx_RefNannySetupContext(
"tanh", 0);
17292 __Pyx_PyThreadState_declare
17293 __Pyx_PyThreadState_assign
17294 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
17295 __Pyx_XGOTREF(__pyx_t_1);
17296 __Pyx_XGOTREF(__pyx_t_2);
17297 __Pyx_XGOTREF(__pyx_t_3);
17307 __Pyx_XDECREF(__pyx_r);
17308 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1794, __pyx_L3_error)
17309 __Pyx_GOTREF(__pyx_t_5);
17310 __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)
17311 __Pyx_GOTREF(__pyx_t_6);
17312 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17314 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
17315 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
17316 if (likely(__pyx_t_5)) {
17317 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
17318 __Pyx_INCREF(__pyx_t_5);
17319 __Pyx_INCREF(
function);
17320 __Pyx_DECREF_SET(__pyx_t_6,
function);
17324 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_obj);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1794, __pyx_L3_error)
17325 __Pyx_GOTREF(__pyx_t_4);
17327 #if CYTHON_FAST_PYCALL 17328 if (PyFunction_Check(__pyx_t_6)) {
17329 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_obj};
17330 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1794, __pyx_L3_error)
17331 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17332 __Pyx_GOTREF(__pyx_t_4);
17335 #if CYTHON_FAST_PYCCALL 17336 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
17337 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_obj};
17338 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1794, __pyx_L3_error)
17339 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17340 __Pyx_GOTREF(__pyx_t_4);
17344 __pyx_t_7 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1794, __pyx_L3_error)
17345 __Pyx_GOTREF(__pyx_t_7);
17346 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
17347 __Pyx_INCREF(__pyx_v_obj);
17348 __Pyx_GIVEREF(__pyx_v_obj);
17349 PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_obj);
17350 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1794, __pyx_L3_error)
17351 __Pyx_GOTREF(__pyx_t_4);
17352 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
17355 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17356 __pyx_r = __pyx_t_4;
17358 goto __pyx_L7_try_return;
17369 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17370 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
17371 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
17372 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
17382 __Pyx_AddTraceback(
"PyClical.tanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17383 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1795, __pyx_L5_except_error)
17384 __Pyx_GOTREF(__pyx_t_4);
17385 __Pyx_GOTREF(__pyx_t_6);
17386 __Pyx_GOTREF(__pyx_t_7);
17395 __Pyx_XDECREF(__pyx_r);
17396 __pyx_t_5 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1796, __pyx_L5_except_error)
17397 __Pyx_GOTREF(__pyx_t_5);
17398 __pyx_t_8 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_5),
tanh(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1796, __pyx_L5_except_error)
17399 __Pyx_GOTREF(__pyx_t_8);
17400 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17401 __pyx_r = __pyx_t_8;
17403 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17404 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17405 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
17406 goto __pyx_L6_except_return;
17408 __pyx_L5_except_error:;
17417 __Pyx_XGIVEREF(__pyx_t_1);
17418 __Pyx_XGIVEREF(__pyx_t_2);
17419 __Pyx_XGIVEREF(__pyx_t_3);
17420 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
17421 goto __pyx_L1_error;
17422 __pyx_L7_try_return:;
17423 __Pyx_XGIVEREF(__pyx_t_1);
17424 __Pyx_XGIVEREF(__pyx_t_2);
17425 __Pyx_XGIVEREF(__pyx_t_3);
17426 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
17428 __pyx_L6_except_return:;
17429 __Pyx_XGIVEREF(__pyx_t_1);
17430 __Pyx_XGIVEREF(__pyx_t_2);
17431 __Pyx_XGIVEREF(__pyx_t_3);
17432 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
17446 __Pyx_XDECREF(__pyx_t_4);
17447 __Pyx_XDECREF(__pyx_t_5);
17448 __Pyx_XDECREF(__pyx_t_6);
17449 __Pyx_XDECREF(__pyx_t_7);
17450 __Pyx_XDECREF(__pyx_t_8);
17451 __Pyx_AddTraceback(
"PyClical.tanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17454 __Pyx_XGIVEREF(__pyx_r);
17455 __Pyx_RefNannyFinishContext();
17460 static PyObject *__pyx_pw_8PyClical_71tanh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
17461 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 ";
17462 static PyObject *__pyx_pw_8PyClical_71tanh(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
17463 PyObject *__pyx_r = 0;
17464 __Pyx_RefNannyDeclarations
17465 __Pyx_RefNannySetupContext(
"tanh (wrapper)", 0);
17466 __pyx_r = __pyx_pf_8PyClical_70tanh(__pyx_self, ((PyObject *)__pyx_v_obj));
17469 __Pyx_RefNannyFinishContext();
17473 static PyObject *__pyx_pf_8PyClical_70tanh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
17474 PyObject *__pyx_r = NULL;
17475 __Pyx_RefNannyDeclarations
17476 PyObject *__pyx_t_1 = NULL;
17477 __Pyx_RefNannySetupContext(
"tanh", 0);
17478 __Pyx_XDECREF(__pyx_r);
17479 __pyx_t_1 = __pyx_f_8PyClical_tanh(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1786, __pyx_L1_error)
17480 __Pyx_GOTREF(__pyx_t_1);
17481 __pyx_r = __pyx_t_1;
17487 __Pyx_XDECREF(__pyx_t_1);
17488 __Pyx_AddTraceback(
"PyClical.tanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17491 __Pyx_XGIVEREF(__pyx_r);
17492 __Pyx_RefNannyFinishContext();
17504 static PyObject *__pyx_pw_8PyClical_73atanh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17505 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) {
17506 PyObject *__pyx_v_i = ((PyObject *)Py_None);
17507 PyObject *__pyx_r = NULL;
17508 __Pyx_RefNannyDeclarations
17511 PyObject *__pyx_t_3 = NULL;
17513 PyObject *__pyx_t_5 = NULL;
17514 PyObject *__pyx_t_6 = NULL;
17515 PyObject *__pyx_t_7 = NULL;
17516 PyObject *__pyx_t_8 = NULL;
17517 PyObject *__pyx_t_9 = NULL;
17518 PyObject *__pyx_t_10 = NULL;
17519 PyObject *__pyx_t_11 = NULL;
17520 __Pyx_RefNannySetupContext(
"atanh", 0);
17521 if (__pyx_optional_args) {
17522 if (__pyx_optional_args->__pyx_n > 0) {
17523 __pyx_v_i = __pyx_optional_args->i;
17534 __pyx_t_1 = (__pyx_v_i != Py_None);
17535 __pyx_t_2 = (__pyx_t_1 != 0);
17545 __Pyx_XDECREF(__pyx_r);
17546 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1808, __pyx_L1_error)
17547 __Pyx_GOTREF(__pyx_t_3);
17549 __pyx_t_4 =
atanh(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
17551 __Pyx_CppExn2PyErr();
17552 __PYX_ERR(0, 1808, __pyx_L1_error)
17554 __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)
17555 __Pyx_GOTREF(__pyx_t_5);
17556 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17557 __pyx_r = __pyx_t_5;
17579 __Pyx_PyThreadState_declare
17580 __Pyx_PyThreadState_assign
17581 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
17582 __Pyx_XGOTREF(__pyx_t_6);
17583 __Pyx_XGOTREF(__pyx_t_7);
17584 __Pyx_XGOTREF(__pyx_t_8);
17594 __Pyx_XDECREF(__pyx_r);
17595 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1811, __pyx_L4_error)
17596 __Pyx_GOTREF(__pyx_t_3);
17597 __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)
17598 __Pyx_GOTREF(__pyx_t_9);
17599 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17601 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
17602 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
17603 if (likely(__pyx_t_3)) {
17604 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
17605 __Pyx_INCREF(__pyx_t_3);
17606 __Pyx_INCREF(
function);
17607 __Pyx_DECREF_SET(__pyx_t_9,
function);
17611 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1811, __pyx_L4_error)
17612 __Pyx_GOTREF(__pyx_t_5);
17614 #if CYTHON_FAST_PYCALL 17615 if (PyFunction_Check(__pyx_t_9)) {
17616 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
17617 __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1811, __pyx_L4_error)
17618 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17619 __Pyx_GOTREF(__pyx_t_5);
17622 #if CYTHON_FAST_PYCCALL 17623 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
17624 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
17625 __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1811, __pyx_L4_error)
17626 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17627 __Pyx_GOTREF(__pyx_t_5);
17631 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1811, __pyx_L4_error)
17632 __Pyx_GOTREF(__pyx_t_10);
17633 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
17634 __Pyx_INCREF(__pyx_v_obj);
17635 __Pyx_GIVEREF(__pyx_v_obj);
17636 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
17637 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1811, __pyx_L4_error)
17638 __Pyx_GOTREF(__pyx_t_5);
17639 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
17642 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17643 __pyx_r = __pyx_t_5;
17645 goto __pyx_L8_try_return;
17656 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17657 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
17658 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
17659 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17669 __Pyx_AddTraceback(
"PyClical.atanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17670 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1812, __pyx_L6_except_error)
17671 __Pyx_GOTREF(__pyx_t_5);
17672 __Pyx_GOTREF(__pyx_t_9);
17673 __Pyx_GOTREF(__pyx_t_10);
17682 __Pyx_XDECREF(__pyx_r);
17683 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1813, __pyx_L6_except_error)
17684 __Pyx_GOTREF(__pyx_t_3);
17685 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_3),
atanh(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1813, __pyx_L6_except_error)
17686 __Pyx_GOTREF(__pyx_t_11);
17687 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17688 __pyx_r = __pyx_t_11;
17690 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17691 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17692 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
17693 goto __pyx_L7_except_return;
17695 __pyx_L6_except_error:;
17704 __Pyx_XGIVEREF(__pyx_t_6);
17705 __Pyx_XGIVEREF(__pyx_t_7);
17706 __Pyx_XGIVEREF(__pyx_t_8);
17707 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17708 goto __pyx_L1_error;
17709 __pyx_L8_try_return:;
17710 __Pyx_XGIVEREF(__pyx_t_6);
17711 __Pyx_XGIVEREF(__pyx_t_7);
17712 __Pyx_XGIVEREF(__pyx_t_8);
17713 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17715 __pyx_L7_except_return:;
17716 __Pyx_XGIVEREF(__pyx_t_6);
17717 __Pyx_XGIVEREF(__pyx_t_7);
17718 __Pyx_XGIVEREF(__pyx_t_8);
17719 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17734 __Pyx_XDECREF(__pyx_t_3);
17735 __Pyx_XDECREF(__pyx_t_5);
17736 __Pyx_XDECREF(__pyx_t_9);
17737 __Pyx_XDECREF(__pyx_t_10);
17738 __Pyx_XDECREF(__pyx_t_11);
17739 __Pyx_AddTraceback(
"PyClical.atanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17742 __Pyx_XGIVEREF(__pyx_r);
17743 __Pyx_RefNannyFinishContext();
17748 static PyObject *__pyx_pw_8PyClical_73atanh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17749 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 ";
17750 static PyObject *__pyx_pw_8PyClical_73atanh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17751 PyObject *__pyx_v_obj = 0;
17752 PyObject *__pyx_v_i = 0;
17753 PyObject *__pyx_r = 0;
17754 __Pyx_RefNannyDeclarations
17755 __Pyx_RefNannySetupContext(
"atanh (wrapper)", 0);
17757 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
17758 PyObject* values[2] = {0,0};
17759 values[1] = ((PyObject *)Py_None);
17760 if (unlikely(__pyx_kwds)) {
17761 Py_ssize_t kw_args;
17762 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17763 switch (pos_args) {
17764 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17765 CYTHON_FALLTHROUGH;
17766 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17767 CYTHON_FALLTHROUGH;
17769 default:
goto __pyx_L5_argtuple_error;
17771 kw_args = PyDict_Size(__pyx_kwds);
17772 switch (pos_args) {
17774 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
17775 else goto __pyx_L5_argtuple_error;
17776 CYTHON_FALLTHROUGH;
17779 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
17780 if (value) { values[1] = value; kw_args--; }
17783 if (unlikely(kw_args > 0)) {
17784 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"atanh") < 0)) __PYX_ERR(0, 1798, __pyx_L3_error)
17787 switch (PyTuple_GET_SIZE(__pyx_args)) {
17788 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17789 CYTHON_FALLTHROUGH;
17790 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17792 default:
goto __pyx_L5_argtuple_error;
17795 __pyx_v_obj = values[0];
17796 __pyx_v_i = values[1];
17798 goto __pyx_L4_argument_unpacking_done;
17799 __pyx_L5_argtuple_error:;
17800 __Pyx_RaiseArgtupleInvalid(
"atanh", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1798, __pyx_L3_error)
17802 __Pyx_AddTraceback(
"PyClical.atanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17803 __Pyx_RefNannyFinishContext();
17805 __pyx_L4_argument_unpacking_done:;
17806 __pyx_r = __pyx_pf_8PyClical_72atanh(__pyx_self, __pyx_v_obj, __pyx_v_i);
17809 __Pyx_RefNannyFinishContext();
17813 static PyObject *__pyx_pf_8PyClical_72atanh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
17814 PyObject *__pyx_r = NULL;
17815 __Pyx_RefNannyDeclarations
17816 PyObject *__pyx_t_1 = NULL;
17817 struct __pyx_opt_args_8PyClical_atanh __pyx_t_2;
17818 __Pyx_RefNannySetupContext(
"atanh", 0);
17819 __Pyx_XDECREF(__pyx_r);
17820 __pyx_t_2.__pyx_n = 1;
17821 __pyx_t_2.i = __pyx_v_i;
17822 __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)
17823 __Pyx_GOTREF(__pyx_t_1);
17824 __pyx_r = __pyx_t_1;
17830 __Pyx_XDECREF(__pyx_t_1);
17831 __Pyx_AddTraceback(
"PyClical.atanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17834 __Pyx_XGIVEREF(__pyx_r);
17835 __Pyx_RefNannyFinishContext();
17847 static PyObject *__pyx_pw_8PyClical_75random_clifford(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17848 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) {
17849 PyObject *__pyx_v_fill = ((PyObject *)__pyx_float_1_0);
17850 PyObject *__pyx_r = NULL;
17851 __Pyx_RefNannyDeclarations
17852 PyObject *__pyx_t_1 = NULL;
17853 PyObject *__pyx_t_2 = NULL;
17855 PyObject *__pyx_t_4 = NULL;
17856 __Pyx_RefNannySetupContext(
"random_clifford", 0);
17857 if (__pyx_optional_args) {
17858 if (__pyx_optional_args->__pyx_n > 0) {
17859 __pyx_v_fill = __pyx_optional_args->fill;
17870 __Pyx_XDECREF(__pyx_r);
17871 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1822, __pyx_L1_error)
17872 __Pyx_GOTREF(__pyx_t_1);
17873 __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1822, __pyx_L1_error)
17874 __Pyx_GOTREF(__pyx_t_2);
17875 __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)
17876 __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)
17877 __Pyx_GOTREF(__pyx_t_4);
17878 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17879 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17880 __pyx_r = __pyx_t_4;
17894 __Pyx_XDECREF(__pyx_t_1);
17895 __Pyx_XDECREF(__pyx_t_2);
17896 __Pyx_XDECREF(__pyx_t_4);
17897 __Pyx_AddTraceback(
"PyClical.random_clifford", __pyx_clineno, __pyx_lineno, __pyx_filename);
17900 __Pyx_XGIVEREF(__pyx_r);
17901 __Pyx_RefNannyFinishContext();
17906 static PyObject *__pyx_pw_8PyClical_75random_clifford(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17907 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 ";
17908 static PyObject *__pyx_pw_8PyClical_75random_clifford(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17909 struct __pyx_obj_8PyClical_index_set *__pyx_v_ixt = 0;
17910 PyObject *__pyx_v_fill = 0;
17911 PyObject *__pyx_r = 0;
17912 __Pyx_RefNannyDeclarations
17913 __Pyx_RefNannySetupContext(
"random_clifford (wrapper)", 0);
17915 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ixt,&__pyx_n_s_fill,0};
17916 PyObject* values[2] = {0,0};
17917 values[1] = ((PyObject *)__pyx_float_1_0);
17918 if (unlikely(__pyx_kwds)) {
17919 Py_ssize_t kw_args;
17920 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17921 switch (pos_args) {
17922 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17923 CYTHON_FALLTHROUGH;
17924 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17925 CYTHON_FALLTHROUGH;
17927 default:
goto __pyx_L5_argtuple_error;
17929 kw_args = PyDict_Size(__pyx_kwds);
17930 switch (pos_args) {
17932 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ixt)) != 0)) kw_args--;
17933 else goto __pyx_L5_argtuple_error;
17934 CYTHON_FALLTHROUGH;
17937 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fill);
17938 if (value) { values[1] = value; kw_args--; }
17941 if (unlikely(kw_args > 0)) {
17942 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"random_clifford") < 0)) __PYX_ERR(0, 1815, __pyx_L3_error)
17945 switch (PyTuple_GET_SIZE(__pyx_args)) {
17946 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17947 CYTHON_FALLTHROUGH;
17948 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17950 default:
goto __pyx_L5_argtuple_error;
17953 __pyx_v_ixt = ((
struct __pyx_obj_8PyClical_index_set *)values[0]);
17954 __pyx_v_fill = values[1];
17956 goto __pyx_L4_argument_unpacking_done;
17957 __pyx_L5_argtuple_error:;
17958 __Pyx_RaiseArgtupleInvalid(
"random_clifford", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1815, __pyx_L3_error)
17960 __Pyx_AddTraceback(
"PyClical.random_clifford", __pyx_clineno, __pyx_lineno, __pyx_filename);
17961 __Pyx_RefNannyFinishContext();
17963 __pyx_L4_argument_unpacking_done:;
17964 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ixt), __pyx_ptype_8PyClical_index_set, 1,
"ixt", 0))) __PYX_ERR(0, 1815, __pyx_L1_error)
17965 __pyx_r = __pyx_pf_8PyClical_74random_clifford(__pyx_self, __pyx_v_ixt, __pyx_v_fill);
17972 __Pyx_RefNannyFinishContext();
17976 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) {
17977 PyObject *__pyx_r = NULL;
17978 __Pyx_RefNannyDeclarations
17979 PyObject *__pyx_t_1 = NULL;
17980 struct __pyx_opt_args_8PyClical_random_clifford __pyx_t_2;
17981 __Pyx_RefNannySetupContext(
"random_clifford", 0);
17982 __Pyx_XDECREF(__pyx_r);
17983 __pyx_t_2.__pyx_n = 1;
17984 __pyx_t_2.fill = __pyx_v_fill;
17985 __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)
17986 __Pyx_GOTREF(__pyx_t_1);
17987 __pyx_r = __pyx_t_1;
17993 __Pyx_XDECREF(__pyx_t_1);
17994 __Pyx_AddTraceback(
"PyClical.random_clifford", __pyx_clineno, __pyx_lineno, __pyx_filename);
17997 __Pyx_XGIVEREF(__pyx_r);
17998 __Pyx_RefNannyFinishContext();
18010 static PyObject *__pyx_pw_8PyClical_77cga3(PyObject *__pyx_self, PyObject *__pyx_v_obj);
18011 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cga3(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
18012 PyObject *__pyx_r = NULL;
18013 __Pyx_RefNannyDeclarations
18014 PyObject *__pyx_t_1 = NULL;
18015 PyObject *__pyx_t_2 = NULL;
18016 __Pyx_RefNannySetupContext(
"cga3", 0);
18025 __Pyx_XDECREF(__pyx_r);
18026 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1831, __pyx_L1_error)
18027 __Pyx_GOTREF(__pyx_t_1);
18028 __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)
18029 __Pyx_GOTREF(__pyx_t_2);
18030 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18031 __pyx_r = __pyx_t_2;
18045 __Pyx_XDECREF(__pyx_t_1);
18046 __Pyx_XDECREF(__pyx_t_2);
18047 __Pyx_AddTraceback(
"PyClical.cga3", __pyx_clineno, __pyx_lineno, __pyx_filename);
18050 __Pyx_XGIVEREF(__pyx_r);
18051 __Pyx_RefNannyFinishContext();
18056 static PyObject *__pyx_pw_8PyClical_77cga3(PyObject *__pyx_self, PyObject *__pyx_v_obj);
18057 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 ";
18058 static PyObject *__pyx_pw_8PyClical_77cga3(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18059 PyObject *__pyx_r = 0;
18060 __Pyx_RefNannyDeclarations
18061 __Pyx_RefNannySetupContext(
"cga3 (wrapper)", 0);
18062 __pyx_r = __pyx_pf_8PyClical_76cga3(__pyx_self, ((PyObject *)__pyx_v_obj));
18065 __Pyx_RefNannyFinishContext();
18069 static PyObject *__pyx_pf_8PyClical_76cga3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18070 PyObject *__pyx_r = NULL;
18071 __Pyx_RefNannyDeclarations
18072 PyObject *__pyx_t_1 = NULL;
18073 __Pyx_RefNannySetupContext(
"cga3", 0);
18074 __Pyx_XDECREF(__pyx_r);
18075 __pyx_t_1 = __pyx_f_8PyClical_cga3(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1824, __pyx_L1_error)
18076 __Pyx_GOTREF(__pyx_t_1);
18077 __pyx_r = __pyx_t_1;
18083 __Pyx_XDECREF(__pyx_t_1);
18084 __Pyx_AddTraceback(
"PyClical.cga3", __pyx_clineno, __pyx_lineno, __pyx_filename);
18087 __Pyx_XGIVEREF(__pyx_r);
18088 __Pyx_RefNannyFinishContext();
18100 static PyObject *__pyx_pw_8PyClical_79cga3std(PyObject *__pyx_self, PyObject *__pyx_v_obj);
18101 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cga3std(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
18102 PyObject *__pyx_r = NULL;
18103 __Pyx_RefNannyDeclarations
18104 PyObject *__pyx_t_1 = NULL;
18105 PyObject *__pyx_t_2 = NULL;
18106 __Pyx_RefNannySetupContext(
"cga3std", 0);
18115 __Pyx_XDECREF(__pyx_r);
18116 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1842, __pyx_L1_error)
18117 __Pyx_GOTREF(__pyx_t_1);
18118 __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)
18119 __Pyx_GOTREF(__pyx_t_2);
18120 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18121 __pyx_r = __pyx_t_2;
18135 __Pyx_XDECREF(__pyx_t_1);
18136 __Pyx_XDECREF(__pyx_t_2);
18137 __Pyx_AddTraceback(
"PyClical.cga3std", __pyx_clineno, __pyx_lineno, __pyx_filename);
18140 __Pyx_XGIVEREF(__pyx_r);
18141 __Pyx_RefNannyFinishContext();
18146 static PyObject *__pyx_pw_8PyClical_79cga3std(PyObject *__pyx_self, PyObject *__pyx_v_obj);
18147 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 ";
18148 static PyObject *__pyx_pw_8PyClical_79cga3std(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18149 PyObject *__pyx_r = 0;
18150 __Pyx_RefNannyDeclarations
18151 __Pyx_RefNannySetupContext(
"cga3std (wrapper)", 0);
18152 __pyx_r = __pyx_pf_8PyClical_78cga3std(__pyx_self, ((PyObject *)__pyx_v_obj));
18155 __Pyx_RefNannyFinishContext();
18159 static PyObject *__pyx_pf_8PyClical_78cga3std(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18160 PyObject *__pyx_r = NULL;
18161 __Pyx_RefNannyDeclarations
18162 PyObject *__pyx_t_1 = NULL;
18163 __Pyx_RefNannySetupContext(
"cga3std", 0);
18164 __Pyx_XDECREF(__pyx_r);
18165 __pyx_t_1 = __pyx_f_8PyClical_cga3std(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1833, __pyx_L1_error)
18166 __Pyx_GOTREF(__pyx_t_1);
18167 __pyx_r = __pyx_t_1;
18173 __Pyx_XDECREF(__pyx_t_1);
18174 __Pyx_AddTraceback(
"PyClical.cga3std", __pyx_clineno, __pyx_lineno, __pyx_filename);
18177 __Pyx_XGIVEREF(__pyx_r);
18178 __Pyx_RefNannyFinishContext();
18190 static PyObject *__pyx_pw_8PyClical_81agc3(PyObject *__pyx_self, PyObject *__pyx_v_obj);
18191 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_agc3(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
18192 PyObject *__pyx_r = NULL;
18193 __Pyx_RefNannyDeclarations
18194 PyObject *__pyx_t_1 = NULL;
18195 PyObject *__pyx_t_2 = NULL;
18196 __Pyx_RefNannySetupContext(
"agc3", 0);
18205 __Pyx_XDECREF(__pyx_r);
18206 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1853, __pyx_L1_error)
18207 __Pyx_GOTREF(__pyx_t_1);
18208 __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)
18209 __Pyx_GOTREF(__pyx_t_2);
18210 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18211 __pyx_r = __pyx_t_2;
18225 __Pyx_XDECREF(__pyx_t_1);
18226 __Pyx_XDECREF(__pyx_t_2);
18227 __Pyx_AddTraceback(
"PyClical.agc3", __pyx_clineno, __pyx_lineno, __pyx_filename);
18230 __Pyx_XGIVEREF(__pyx_r);
18231 __Pyx_RefNannyFinishContext();
18236 static PyObject *__pyx_pw_8PyClical_81agc3(PyObject *__pyx_self, PyObject *__pyx_v_obj);
18237 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 ";
18238 static PyObject *__pyx_pw_8PyClical_81agc3(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18239 PyObject *__pyx_r = 0;
18240 __Pyx_RefNannyDeclarations
18241 __Pyx_RefNannySetupContext(
"agc3 (wrapper)", 0);
18242 __pyx_r = __pyx_pf_8PyClical_80agc3(__pyx_self, ((PyObject *)__pyx_v_obj));
18245 __Pyx_RefNannyFinishContext();
18249 static PyObject *__pyx_pf_8PyClical_80agc3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18250 PyObject *__pyx_r = NULL;
18251 __Pyx_RefNannyDeclarations
18252 PyObject *__pyx_t_1 = NULL;
18253 __Pyx_RefNannySetupContext(
"agc3", 0);
18254 __Pyx_XDECREF(__pyx_r);
18255 __pyx_t_1 = __pyx_f_8PyClical_agc3(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1844, __pyx_L1_error)
18256 __Pyx_GOTREF(__pyx_t_1);
18257 __pyx_r = __pyx_t_1;
18263 __Pyx_XDECREF(__pyx_t_1);
18264 __Pyx_AddTraceback(
"PyClical.agc3", __pyx_clineno, __pyx_lineno, __pyx_filename);
18267 __Pyx_XGIVEREF(__pyx_r);
18268 __Pyx_RefNannyFinishContext();
18281 static PyObject *__pyx_pw_8PyClical_83e(PyObject *__pyx_self, PyObject *__pyx_v_obj);
18282 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 ";
18283 static PyMethodDef __pyx_mdef_8PyClical_83e = {
"e", (PyCFunction)__pyx_pw_8PyClical_83e, METH_O, __pyx_doc_8PyClical_82e};
18284 static PyObject *__pyx_pw_8PyClical_83e(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18285 PyObject *__pyx_r = 0;
18286 __Pyx_RefNannyDeclarations
18287 __Pyx_RefNannySetupContext(
"e (wrapper)", 0);
18288 __pyx_r = __pyx_pf_8PyClical_82e(__pyx_self, ((PyObject *)__pyx_v_obj));
18291 __Pyx_RefNannyFinishContext();
18295 static PyObject *__pyx_pf_8PyClical_82e(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18296 PyObject *__pyx_r = NULL;
18297 __Pyx_RefNannyDeclarations
18298 PyObject *__pyx_t_1 = NULL;
18299 PyObject *__pyx_t_2 = NULL;
18300 __Pyx_RefNannySetupContext(
"e", 0);
18309 __Pyx_XDECREF(__pyx_r);
18310 __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)
18311 __Pyx_GOTREF(__pyx_t_1);
18312 __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)
18313 __Pyx_GOTREF(__pyx_t_2);
18314 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18315 __pyx_r = __pyx_t_2;
18329 __Pyx_XDECREF(__pyx_t_1);
18330 __Pyx_XDECREF(__pyx_t_2);
18331 __Pyx_AddTraceback(
"PyClical.e", __pyx_clineno, __pyx_lineno, __pyx_filename);
18334 __Pyx_XGIVEREF(__pyx_r);
18335 __Pyx_RefNannyFinishContext();
18348 static PyObject *__pyx_pw_8PyClical_85istpq(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
18349 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 ";
18350 static PyMethodDef __pyx_mdef_8PyClical_85istpq = {
"istpq", (PyCFunction)__pyx_pw_8PyClical_85istpq, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_84istpq};
18351 static PyObject *__pyx_pw_8PyClical_85istpq(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18352 PyObject *__pyx_v_p = 0;
18353 PyObject *__pyx_v_q = 0;
18354 PyObject *__pyx_r = 0;
18355 __Pyx_RefNannyDeclarations
18356 __Pyx_RefNannySetupContext(
"istpq (wrapper)", 0);
18358 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,&__pyx_n_s_q,0};
18359 PyObject* values[2] = {0,0};
18360 if (unlikely(__pyx_kwds)) {
18361 Py_ssize_t kw_args;
18362 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
18363 switch (pos_args) {
18364 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18365 CYTHON_FALLTHROUGH;
18366 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18367 CYTHON_FALLTHROUGH;
18369 default:
goto __pyx_L5_argtuple_error;
18371 kw_args = PyDict_Size(__pyx_kwds);
18372 switch (pos_args) {
18374 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p)) != 0)) kw_args--;
18375 else goto __pyx_L5_argtuple_error;
18376 CYTHON_FALLTHROUGH;
18378 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q)) != 0)) kw_args--;
18380 __Pyx_RaiseArgtupleInvalid(
"istpq", 1, 2, 2, 1); __PYX_ERR(0, 1900, __pyx_L3_error)
18383 if (unlikely(kw_args > 0)) {
18384 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"istpq") < 0)) __PYX_ERR(0, 1900, __pyx_L3_error)
18386 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
18387 goto __pyx_L5_argtuple_error;
18389 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18390 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18392 __pyx_v_p = values[0];
18393 __pyx_v_q = values[1];
18395 goto __pyx_L4_argument_unpacking_done;
18396 __pyx_L5_argtuple_error:;
18397 __Pyx_RaiseArgtupleInvalid(
"istpq", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1900, __pyx_L3_error)
18399 __Pyx_AddTraceback(
"PyClical.istpq", __pyx_clineno, __pyx_lineno, __pyx_filename);
18400 __Pyx_RefNannyFinishContext();
18402 __pyx_L4_argument_unpacking_done:;
18403 __pyx_r = __pyx_pf_8PyClical_84istpq(__pyx_self, __pyx_v_p, __pyx_v_q);
18406 __Pyx_RefNannyFinishContext();
18410 static PyObject *__pyx_pf_8PyClical_84istpq(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_p, PyObject *__pyx_v_q) {
18411 PyObject *__pyx_r = NULL;
18412 __Pyx_RefNannyDeclarations
18413 PyObject *__pyx_t_1 = NULL;
18414 PyObject *__pyx_t_2 = NULL;
18415 PyObject *__pyx_t_3 = NULL;
18416 __Pyx_RefNannySetupContext(
"istpq", 0);
18425 __Pyx_XDECREF(__pyx_r);
18426 __pyx_t_1 = PyNumber_Negative(__pyx_v_q);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1907, __pyx_L1_error)
18427 __Pyx_GOTREF(__pyx_t_1);
18428 __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_p, __pyx_int_1, 1, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1907, __pyx_L1_error)
18429 __Pyx_GOTREF(__pyx_t_2);
18430 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1907, __pyx_L1_error)
18431 __Pyx_GOTREF(__pyx_t_3);
18432 __Pyx_GIVEREF(__pyx_t_1);
18433 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
18434 __Pyx_GIVEREF(__pyx_t_2);
18435 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
18438 __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)
18439 __Pyx_GOTREF(__pyx_t_2);
18440 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18441 __pyx_t_3 = PySet_New(__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1907, __pyx_L1_error)
18442 __Pyx_GOTREF(__pyx_t_3);
18443 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18444 __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)
18445 __Pyx_GOTREF(__pyx_t_2);
18446 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18447 __pyx_r = __pyx_t_2;
18461 __Pyx_XDECREF(__pyx_t_1);
18462 __Pyx_XDECREF(__pyx_t_2);
18463 __Pyx_XDECREF(__pyx_t_3);
18464 __Pyx_AddTraceback(
"PyClical.istpq", __pyx_clineno, __pyx_lineno, __pyx_filename);
18467 __Pyx_XGIVEREF(__pyx_r);
18468 __Pyx_RefNannyFinishContext();
18481 static PyObject *__pyx_pw_8PyClical_87_test(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused);
18482 static PyMethodDef __pyx_mdef_8PyClical_87_test = {
"_test", (PyCFunction)__pyx_pw_8PyClical_87_test, METH_NOARGS, 0};
18483 static PyObject *__pyx_pw_8PyClical_87_test(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
18484 PyObject *__pyx_r = 0;
18485 __Pyx_RefNannyDeclarations
18486 __Pyx_RefNannySetupContext(
"_test (wrapper)", 0);
18487 __pyx_r = __pyx_pf_8PyClical_86_test(__pyx_self);
18490 __Pyx_RefNannyFinishContext();
18494 static PyObject *__pyx_pf_8PyClical_86_test(CYTHON_UNUSED PyObject *__pyx_self) {
18495 PyObject *__pyx_v_PyClical = NULL;
18496 PyObject *__pyx_v_doctest = NULL;
18497 PyObject *__pyx_r = NULL;
18498 __Pyx_RefNannyDeclarations
18499 PyObject *__pyx_t_1 = NULL;
18500 PyObject *__pyx_t_2 = NULL;
18501 PyObject *__pyx_t_3 = NULL;
18502 PyObject *__pyx_t_4 = NULL;
18503 __Pyx_RefNannySetupContext(
"_test", 0);
18512 __pyx_t_1 = __Pyx_Import(__pyx_n_s_PyClical, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1914, __pyx_L1_error)
18513 __Pyx_GOTREF(__pyx_t_1);
18514 __pyx_v_PyClical = __pyx_t_1;
18516 __pyx_t_1 = __Pyx_Import(__pyx_n_s_doctest, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1914, __pyx_L1_error)
18517 __Pyx_GOTREF(__pyx_t_1);
18518 __pyx_v_doctest = __pyx_t_1;
18528 __Pyx_XDECREF(__pyx_r);
18529 __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)
18530 __Pyx_GOTREF(__pyx_t_2);
18532 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
18533 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
18534 if (likely(__pyx_t_3)) {
18535 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
18536 __Pyx_INCREF(__pyx_t_3);
18537 __Pyx_INCREF(
function);
18538 __Pyx_DECREF_SET(__pyx_t_2,
function);
18542 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_PyClical);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1915, __pyx_L1_error)
18543 __Pyx_GOTREF(__pyx_t_1);
18545 #if CYTHON_FAST_PYCALL 18546 if (PyFunction_Check(__pyx_t_2)) {
18547 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_PyClical};
18548 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1915, __pyx_L1_error)
18549 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18550 __Pyx_GOTREF(__pyx_t_1);
18553 #if CYTHON_FAST_PYCCALL 18554 if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
18555 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_PyClical};
18556 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1915, __pyx_L1_error)
18557 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18558 __Pyx_GOTREF(__pyx_t_1);
18562 __pyx_t_4 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1915, __pyx_L1_error)
18563 __Pyx_GOTREF(__pyx_t_4);
18564 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
18565 __Pyx_INCREF(__pyx_v_PyClical);
18566 __Pyx_GIVEREF(__pyx_v_PyClical);
18567 PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_PyClical);
18568 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1915, __pyx_L1_error)
18569 __Pyx_GOTREF(__pyx_t_1);
18570 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18573 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18574 __pyx_r = __pyx_t_1;
18588 __Pyx_XDECREF(__pyx_t_1);
18589 __Pyx_XDECREF(__pyx_t_2);
18590 __Pyx_XDECREF(__pyx_t_3);
18591 __Pyx_XDECREF(__pyx_t_4);
18592 __Pyx_AddTraceback(
"PyClical._test", __pyx_clineno, __pyx_lineno, __pyx_filename);
18595 __Pyx_XDECREF(__pyx_v_PyClical);
18596 __Pyx_XDECREF(__pyx_v_doctest);
18597 __Pyx_XGIVEREF(__pyx_r);
18598 __Pyx_RefNannyFinishContext();
18601 static struct __pyx_vtabstruct_8PyClical_index_set __pyx_vtable_8PyClical_index_set;
18603 static PyObject *__pyx_tp_new_8PyClical_index_set(PyTypeObject *t, PyObject *a, PyObject *k) {
18604 struct __pyx_obj_8PyClical_index_set *p;
18606 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
18607 o = (*t->tp_alloc)(t, 0);
18609 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
18611 if (unlikely(!o))
return 0;
18612 p = ((
struct __pyx_obj_8PyClical_index_set *)o);
18613 p->__pyx_vtab = __pyx_vtabptr_8PyClical_index_set;
18614 if (unlikely(__pyx_pw_8PyClical_9index_set_3__cinit__(o, a, k) < 0))
goto bad;
18617 Py_DECREF(o); o = 0;
18621 static void __pyx_tp_dealloc_8PyClical_index_set(PyObject *o) {
18622 #if CYTHON_USE_TP_FINALIZE 18623 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))) {
18624 if (PyObject_CallFinalizerFromDealloc(o))
return;
18628 PyObject *etype, *eval, *etb;
18629 PyErr_Fetch(&etype, &eval, &etb);
18631 __pyx_pw_8PyClical_9index_set_5__dealloc__(o);
18633 PyErr_Restore(etype, eval, etb);
18635 (*Py_TYPE(o)->tp_free)(o);
18637 static PyObject *__pyx_sq_item_8PyClical_index_set(PyObject *o, Py_ssize_t
i) {
18639 PyObject *x = PyInt_FromSsize_t(
i);
if(!x)
return 0;
18640 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
18645 static int __pyx_mp_ass_subscript_8PyClical_index_set(PyObject *o, PyObject *
i, PyObject *v) {
18647 return __pyx_pw_8PyClical_9index_set_9__setitem__(o,
i, v);
18650 PyErr_Format(PyExc_NotImplementedError,
18651 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
18656 static PyMethodDef __pyx_methods_8PyClical_index_set[] = {
18657 {
"copy", (PyCFunction)__pyx_pw_8PyClical_9index_set_1copy, METH_NOARGS, __pyx_doc_8PyClical_9index_set_copy},
18658 {
"count", (PyCFunction)__pyx_pw_8PyClical_9index_set_32count, METH_NOARGS, __pyx_doc_8PyClical_9index_set_31count},
18659 {
"count_neg", (PyCFunction)__pyx_pw_8PyClical_9index_set_34count_neg, METH_NOARGS, __pyx_doc_8PyClical_9index_set_33count_neg},
18660 {
"count_pos", (PyCFunction)__pyx_pw_8PyClical_9index_set_36count_pos, METH_NOARGS, __pyx_doc_8PyClical_9index_set_35count_pos},
18661 {
"min", (PyCFunction)__pyx_pw_8PyClical_9index_set_38min, METH_NOARGS, __pyx_doc_8PyClical_9index_set_37min},
18662 {
"max", (PyCFunction)__pyx_pw_8PyClical_9index_set_40max, METH_NOARGS, __pyx_doc_8PyClical_9index_set_39max},
18663 {
"hash_fn", (PyCFunction)__pyx_pw_8PyClical_9index_set_42hash_fn, METH_NOARGS, __pyx_doc_8PyClical_9index_set_41hash_fn},
18664 {
"sign_of_mult", (PyCFunction)__pyx_pw_8PyClical_9index_set_44sign_of_mult, METH_O, __pyx_doc_8PyClical_9index_set_43sign_of_mult},
18665 {
"sign_of_square", (PyCFunction)__pyx_pw_8PyClical_9index_set_46sign_of_square, METH_NOARGS, __pyx_doc_8PyClical_9index_set_45sign_of_square},
18666 {
"__reduce_cython__", (PyCFunction)__pyx_pw_8PyClical_9index_set_52__reduce_cython__, METH_NOARGS, 0},
18667 {
"__setstate_cython__", (PyCFunction)__pyx_pw_8PyClical_9index_set_54__setstate_cython__, METH_O, 0},
18671 static PyNumberMethods __pyx_tp_as_number_index_set = {
18675 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18685 __pyx_pw_8PyClical_9index_set_18__invert__,
18688 __pyx_pw_8PyClical_9index_set_24__and__,
18689 __pyx_pw_8PyClical_9index_set_20__xor__,
18690 __pyx_pw_8PyClical_9index_set_28__or__,
18691 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18695 #if PY_MAJOR_VERSION < 3 18701 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18704 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18710 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18717 __pyx_pw_8PyClical_9index_set_26__iand__,
18718 __pyx_pw_8PyClical_9index_set_22__ixor__,
18719 __pyx_pw_8PyClical_9index_set_30__ior__,
18725 #if PY_VERSION_HEX >= 0x03050000 18728 #if PY_VERSION_HEX >= 0x03050000 18733 static PySequenceMethods __pyx_tp_as_sequence_index_set = {
18737 __pyx_sq_item_8PyClical_index_set,
18741 __pyx_pw_8PyClical_9index_set_13__contains__,
18746 static PyMappingMethods __pyx_tp_as_mapping_index_set = {
18748 __pyx_pw_8PyClical_9index_set_11__getitem__,
18749 __pyx_mp_ass_subscript_8PyClical_index_set,
18752 static PyTypeObject __pyx_type_8PyClical_index_set = {
18753 PyVarObject_HEAD_INIT(0, 0)
18754 "PyClical.index_set",
18755 sizeof(
struct __pyx_obj_8PyClical_index_set),
18757 __pyx_tp_dealloc_8PyClical_index_set,
18761 #if PY_MAJOR_VERSION < 3
18764 #if PY_MAJOR_VERSION >= 3
18767 __pyx_pw_8PyClical_9index_set_48__repr__,
18768 &__pyx_tp_as_number_index_set,
18769 &__pyx_tp_as_sequence_index_set,
18770 &__pyx_tp_as_mapping_index_set,
18773 __pyx_pw_8PyClical_9index_set_50__str__,
18777 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
18778 "\n Python class index_set wraps C++ class IndexSet.\n ",
18781 __pyx_pw_8PyClical_9index_set_7__richcmp__,
18783 __pyx_pw_8PyClical_9index_set_15__iter__,
18785 __pyx_methods_8PyClical_index_set,
18795 __pyx_tp_new_8PyClical_index_set,
18805 #if PY_VERSION_HEX >= 0x030400a1 18809 static struct __pyx_vtabstruct_8PyClical_clifford __pyx_vtable_8PyClical_clifford;
18811 static PyObject *__pyx_tp_new_8PyClical_clifford(PyTypeObject *t, PyObject *a, PyObject *k) {
18812 struct __pyx_obj_8PyClical_clifford *p;
18814 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
18815 o = (*t->tp_alloc)(t, 0);
18817 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
18819 if (unlikely(!o))
return 0;
18820 p = ((
struct __pyx_obj_8PyClical_clifford *)o);
18821 p->__pyx_vtab = __pyx_vtabptr_8PyClical_clifford;
18822 if (unlikely(__pyx_pw_8PyClical_8clifford_3__cinit__(o, a, k) < 0))
goto bad;
18825 Py_DECREF(o); o = 0;
18829 static void __pyx_tp_dealloc_8PyClical_clifford(PyObject *o) {
18830 #if CYTHON_USE_TP_FINALIZE 18831 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))) {
18832 if (PyObject_CallFinalizerFromDealloc(o))
return;
18836 PyObject *etype, *eval, *etb;
18837 PyErr_Fetch(&etype, &eval, &etb);
18839 __pyx_pw_8PyClical_8clifford_5__dealloc__(o);
18841 PyErr_Restore(etype, eval, etb);
18843 (*Py_TYPE(o)->tp_free)(o);
18845 static PyObject *__pyx_sq_item_8PyClical_clifford(PyObject *o, Py_ssize_t
i) {
18847 PyObject *x = PyInt_FromSsize_t(
i);
if(!x)
return 0;
18848 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
18853 static PyMethodDef __pyx_methods_8PyClical_clifford[] = {
18854 {
"copy", (PyCFunction)__pyx_pw_8PyClical_8clifford_1copy, METH_NOARGS, __pyx_doc_8PyClical_8clifford_copy},
18855 {
"reframe", (PyCFunction)__pyx_pw_8PyClical_8clifford_11reframe, METH_O, __pyx_doc_8PyClical_8clifford_10reframe},
18856 {
"inv", (PyCFunction)__pyx_pw_8PyClical_8clifford_49inv, METH_NOARGS, __pyx_doc_8PyClical_8clifford_48inv},
18857 {
"pow", (PyCFunction)__pyx_pw_8PyClical_8clifford_57pow, METH_O, __pyx_doc_8PyClical_8clifford_56pow},
18858 {
"outer_pow", (PyCFunction)__pyx_pw_8PyClical_8clifford_59outer_pow, METH_O, __pyx_doc_8PyClical_8clifford_58outer_pow},
18859 {
"scalar", (PyCFunction)__pyx_pw_8PyClical_8clifford_63scalar, METH_NOARGS, __pyx_doc_8PyClical_8clifford_62scalar},
18860 {
"pure", (PyCFunction)__pyx_pw_8PyClical_8clifford_65pure, METH_NOARGS, __pyx_doc_8PyClical_8clifford_64pure},
18861 {
"even", (PyCFunction)__pyx_pw_8PyClical_8clifford_67even, METH_NOARGS, __pyx_doc_8PyClical_8clifford_66even},
18862 {
"odd", (PyCFunction)__pyx_pw_8PyClical_8clifford_69odd, METH_NOARGS, __pyx_doc_8PyClical_8clifford_68odd},
18863 {
"vector_part", (PyCFunction)__pyx_pw_8PyClical_8clifford_71vector_part, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_8clifford_70vector_part},
18864 {
"involute", (PyCFunction)__pyx_pw_8PyClical_8clifford_73involute, METH_NOARGS, __pyx_doc_8PyClical_8clifford_72involute},
18865 {
"reverse", (PyCFunction)__pyx_pw_8PyClical_8clifford_75reverse, METH_NOARGS, __pyx_doc_8PyClical_8clifford_74reverse},
18866 {
"conj", (PyCFunction)__pyx_pw_8PyClical_8clifford_77conj, METH_NOARGS, __pyx_doc_8PyClical_8clifford_76conj},
18867 {
"quad", (PyCFunction)__pyx_pw_8PyClical_8clifford_79quad, METH_NOARGS, __pyx_doc_8PyClical_8clifford_78quad},
18868 {
"norm", (PyCFunction)__pyx_pw_8PyClical_8clifford_81norm, METH_NOARGS, __pyx_doc_8PyClical_8clifford_80norm},
18869 {
"abs", (PyCFunction)__pyx_pw_8PyClical_8clifford_83abs, METH_NOARGS, __pyx_doc_8PyClical_8clifford_82abs},
18870 {
"max_abs", (PyCFunction)__pyx_pw_8PyClical_8clifford_85max_abs, METH_NOARGS, __pyx_doc_8PyClical_8clifford_84max_abs},
18871 {
"truncated", (PyCFunction)__pyx_pw_8PyClical_8clifford_87truncated, METH_O, __pyx_doc_8PyClical_8clifford_86truncated},
18872 {
"isnan", (PyCFunction)__pyx_pw_8PyClical_8clifford_89isnan, METH_NOARGS, __pyx_doc_8PyClical_8clifford_88isnan},
18873 {
"frame", (PyCFunction)__pyx_pw_8PyClical_8clifford_91frame, METH_NOARGS, __pyx_doc_8PyClical_8clifford_90frame},
18874 {
"__reduce_cython__", (PyCFunction)__pyx_pw_8PyClical_8clifford_97__reduce_cython__, METH_NOARGS, 0},
18875 {
"__setstate_cython__", (PyCFunction)__pyx_pw_8PyClical_8clifford_99__setstate_cython__, METH_O, 0},
18879 static PyNumberMethods __pyx_tp_as_number_clifford = {
18880 __pyx_pw_8PyClical_8clifford_21__add__,
18881 __pyx_pw_8PyClical_8clifford_25__sub__,
18882 __pyx_pw_8PyClical_8clifford_29__mul__,
18883 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18884 __pyx_pw_8PyClical_8clifford_45__div__,
18886 __pyx_pw_8PyClical_8clifford_33__mod__,
18888 __pyx_pw_8PyClical_8clifford_55__pow__,
18889 __pyx_pw_8PyClical_8clifford_17__neg__,
18890 __pyx_pw_8PyClical_8clifford_19__pos__,
18896 __pyx_pw_8PyClical_8clifford_37__and__,
18897 __pyx_pw_8PyClical_8clifford_41__xor__,
18898 __pyx_pw_8PyClical_8clifford_51__or__,
18899 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18903 #if PY_MAJOR_VERSION < 3 18909 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18912 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18915 __pyx_pw_8PyClical_8clifford_23__iadd__,
18916 __pyx_pw_8PyClical_8clifford_27__isub__,
18917 __pyx_pw_8PyClical_8clifford_31__imul__,
18918 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18919 __pyx_pw_8PyClical_8clifford_47__idiv__,
18921 __pyx_pw_8PyClical_8clifford_35__imod__,
18925 __pyx_pw_8PyClical_8clifford_39__iand__,
18926 __pyx_pw_8PyClical_8clifford_43__ixor__,
18927 __pyx_pw_8PyClical_8clifford_53__ior__,
18933 #if PY_VERSION_HEX >= 0x03050000 18936 #if PY_VERSION_HEX >= 0x03050000 18941 static PySequenceMethods __pyx_tp_as_sequence_clifford = {
18945 __pyx_sq_item_8PyClical_clifford,
18949 __pyx_pw_8PyClical_8clifford_7__contains__,
18954 static PyMappingMethods __pyx_tp_as_mapping_clifford = {
18956 __pyx_pw_8PyClical_8clifford_15__getitem__,
18960 static PyTypeObject __pyx_type_8PyClical_clifford = {
18961 PyVarObject_HEAD_INIT(0, 0)
18962 "PyClical.clifford",
18963 sizeof(
struct __pyx_obj_8PyClical_clifford),
18965 __pyx_tp_dealloc_8PyClical_clifford,
18969 #if PY_MAJOR_VERSION < 3
18972 #if PY_MAJOR_VERSION >= 3
18975 __pyx_pw_8PyClical_8clifford_93__repr__,
18976 &__pyx_tp_as_number_clifford,
18977 &__pyx_tp_as_sequence_clifford,
18978 &__pyx_tp_as_mapping_clifford,
18980 __pyx_pw_8PyClical_8clifford_61__call__,
18981 __pyx_pw_8PyClical_8clifford_95__str__,
18985 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
18986 "\n Python class clifford wraps C++ class Clifford.\n ",
18989 __pyx_pw_8PyClical_8clifford_13__richcmp__,
18991 __pyx_pw_8PyClical_8clifford_9__iter__,
18993 __pyx_methods_8PyClical_clifford,
19003 __pyx_tp_new_8PyClical_clifford,
19013 #if PY_VERSION_HEX >= 0x030400a1 19018 static struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *__pyx_freelist_8PyClical___pyx_scope_struct____iter__[8];
19019 static int __pyx_freecount_8PyClical___pyx_scope_struct____iter__ = 0;
19021 static PyObject *__pyx_tp_new_8PyClical___pyx_scope_struct____iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
19023 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__)))) {
19024 o = (PyObject*)__pyx_freelist_8PyClical___pyx_scope_struct____iter__[--__pyx_freecount_8PyClical___pyx_scope_struct____iter__];
19025 memset(o, 0,
sizeof(
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__));
19026 (void) PyObject_INIT(o, t);
19027 PyObject_GC_Track(o);
19029 o = (*t->tp_alloc)(t, 0);
19030 if (unlikely(!o))
return 0;
19035 static void __pyx_tp_dealloc_8PyClical___pyx_scope_struct____iter__(PyObject *o) {
19036 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *p = (
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)o;
19037 PyObject_GC_UnTrack(o);
19038 Py_CLEAR(p->__pyx_v_idx);
19039 Py_CLEAR(p->__pyx_v_self);
19040 Py_CLEAR(p->__pyx_t_0);
19041 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__)))) {
19042 __pyx_freelist_8PyClical___pyx_scope_struct____iter__[__pyx_freecount_8PyClical___pyx_scope_struct____iter__++] = ((
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)o);
19044 (*Py_TYPE(o)->tp_free)(o);
19048 static int __pyx_tp_traverse_8PyClical___pyx_scope_struct____iter__(PyObject *o, visitproc v,
void *a) {
19050 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *p = (
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)o;
19051 if (p->__pyx_v_idx) {
19052 e = (*v)(p->__pyx_v_idx, a);
if (
e)
return e;
19054 if (p->__pyx_v_self) {
19055 e = (*v)(((PyObject *)p->__pyx_v_self), a);
if (
e)
return e;
19057 if (p->__pyx_t_0) {
19058 e = (*v)(p->__pyx_t_0, a);
if (
e)
return e;
19063 static PyTypeObject __pyx_type_8PyClical___pyx_scope_struct____iter__ = {
19064 PyVarObject_HEAD_INIT(0, 0)
19065 "PyClical.__pyx_scope_struct____iter__",
19066 sizeof(
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__),
19068 __pyx_tp_dealloc_8PyClical___pyx_scope_struct____iter__,
19072 #if PY_MAJOR_VERSION < 3
19075 #if PY_MAJOR_VERSION >= 3
19088 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
19090 __pyx_tp_traverse_8PyClical___pyx_scope_struct____iter__,
19106 __pyx_tp_new_8PyClical___pyx_scope_struct____iter__,
19116 #if PY_VERSION_HEX >= 0x030400a1 19121 static PyMethodDef __pyx_methods[] = {
19122 {
"compare", (PyCFunction)__pyx_pw_8PyClical_3compare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_2compare},
19123 {
"min_neg", (PyCFunction)__pyx_pw_8PyClical_5min_neg, METH_O, __pyx_doc_8PyClical_4min_neg},
19124 {
"max_pos", (PyCFunction)__pyx_pw_8PyClical_7max_pos, METH_O, __pyx_doc_8PyClical_6max_pos},
19125 {
"inv", (PyCFunction)__pyx_pw_8PyClical_11inv, METH_O, __pyx_doc_8PyClical_10inv},
19126 {
"scalar", (PyCFunction)__pyx_pw_8PyClical_13scalar, METH_O, __pyx_doc_8PyClical_12scalar},
19127 {
"real", (PyCFunction)__pyx_pw_8PyClical_15real, METH_O, __pyx_doc_8PyClical_14real},
19128 {
"imag", (PyCFunction)__pyx_pw_8PyClical_17imag, METH_O, __pyx_doc_8PyClical_16imag},
19129 {
"pure", (PyCFunction)__pyx_pw_8PyClical_19pure, METH_O, __pyx_doc_8PyClical_18pure},
19130 {
"even", (PyCFunction)__pyx_pw_8PyClical_21even, METH_O, __pyx_doc_8PyClical_20even},
19131 {
"odd", (PyCFunction)__pyx_pw_8PyClical_23odd, METH_O, __pyx_doc_8PyClical_22odd},
19132 {
"involute", (PyCFunction)__pyx_pw_8PyClical_25involute, METH_O, __pyx_doc_8PyClical_24involute},
19133 {
"reverse", (PyCFunction)__pyx_pw_8PyClical_27reverse, METH_O, __pyx_doc_8PyClical_26reverse},
19134 {
"conj", (PyCFunction)__pyx_pw_8PyClical_29conj, METH_O, __pyx_doc_8PyClical_28conj},
19135 {
"quad", (PyCFunction)__pyx_pw_8PyClical_31quad, METH_O, __pyx_doc_8PyClical_30quad},
19136 {
"norm", (PyCFunction)__pyx_pw_8PyClical_33norm, METH_O, __pyx_doc_8PyClical_32norm},
19137 {
"abs", (PyCFunction)__pyx_pw_8PyClical_35abs, METH_O, __pyx_doc_8PyClical_34abs},
19138 {
"max_abs", (PyCFunction)__pyx_pw_8PyClical_37max_abs, METH_O, __pyx_doc_8PyClical_36max_abs},
19139 {
"pow", (PyCFunction)__pyx_pw_8PyClical_39pow, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_38pow},
19140 {
"outer_pow", (PyCFunction)__pyx_pw_8PyClical_41outer_pow, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_40outer_pow},
19141 {
"complexifier", (PyCFunction)__pyx_pw_8PyClical_43complexifier, METH_O, __pyx_doc_8PyClical_42complexifier},
19142 {
"sqrt", (PyCFunction)__pyx_pw_8PyClical_45sqrt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_44sqrt},
19143 {
"exp", (PyCFunction)__pyx_pw_8PyClical_47exp, METH_O, __pyx_doc_8PyClical_46exp},
19144 {
"log", (PyCFunction)__pyx_pw_8PyClical_49log, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_48log},
19145 {
"cos", (PyCFunction)__pyx_pw_8PyClical_51cos, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_50cos},
19146 {
"acos", (PyCFunction)__pyx_pw_8PyClical_53acos, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_52acos},
19147 {
"cosh", (PyCFunction)__pyx_pw_8PyClical_55cosh, METH_O, __pyx_doc_8PyClical_54cosh},
19148 {
"acosh", (PyCFunction)__pyx_pw_8PyClical_57acosh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_56acosh},
19149 {
"sin", (PyCFunction)__pyx_pw_8PyClical_59sin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_58sin},
19150 {
"asin", (PyCFunction)__pyx_pw_8PyClical_61asin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_60asin},
19151 {
"sinh", (PyCFunction)__pyx_pw_8PyClical_63sinh, METH_O, __pyx_doc_8PyClical_62sinh},
19152 {
"asinh", (PyCFunction)__pyx_pw_8PyClical_65asinh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_64asinh},
19153 {
"tan", (PyCFunction)__pyx_pw_8PyClical_67tan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_66tan},
19154 {
"atan", (PyCFunction)__pyx_pw_8PyClical_69atan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_68atan},
19155 {
"tanh", (PyCFunction)__pyx_pw_8PyClical_71tanh, METH_O, __pyx_doc_8PyClical_70tanh},
19156 {
"atanh", (PyCFunction)__pyx_pw_8PyClical_73atanh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_72atanh},
19157 {
"random_clifford", (PyCFunction)__pyx_pw_8PyClical_75random_clifford, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_74random_clifford},
19158 {
"cga3", (PyCFunction)__pyx_pw_8PyClical_77cga3, METH_O, __pyx_doc_8PyClical_76cga3},
19159 {
"cga3std", (PyCFunction)__pyx_pw_8PyClical_79cga3std, METH_O, __pyx_doc_8PyClical_78cga3std},
19160 {
"agc3", (PyCFunction)__pyx_pw_8PyClical_81agc3, METH_O, __pyx_doc_8PyClical_80agc3},
19164 #if PY_MAJOR_VERSION >= 3 19165 #if CYTHON_PEP489_MULTI_PHASE_INIT 19166 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
19167 static int __pyx_pymod_exec_PyClical(PyObject* module);
19168 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
19169 {Py_mod_create, (
void*)__pyx_pymod_create},
19170 {Py_mod_exec, (
void*)__pyx_pymod_exec_PyClical},
19175 static struct PyModuleDef __pyx_moduledef = {
19176 PyModuleDef_HEAD_INIT,
19179 #if CYTHON_PEP489_MULTI_PHASE_INIT 19185 #if CYTHON_PEP489_MULTI_PHASE_INIT 19186 __pyx_moduledef_slots,
19196 static __Pyx_StringTabEntry __pyx_string_tab[] = {
19197 {&__pyx_kp_s_, __pyx_k_,
sizeof(__pyx_k_), 0, 0, 1, 0},
19198 {&__pyx_kp_s_0_8_2, __pyx_k_0_8_2,
sizeof(__pyx_k_0_8_2), 0, 0, 1, 0},
19199 {&__pyx_kp_u_Abbreviation_for_clifford_index, __pyx_k_Abbreviation_for_clifford_index,
sizeof(__pyx_k_Abbreviation_for_clifford_index), 0, 1, 0, 0},
19200 {&__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},
19201 {&__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},
19202 {&__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},
19203 {&__pyx_kp_s_Cannot_initialize_clifford_objec, __pyx_k_Cannot_initialize_clifford_objec,
sizeof(__pyx_k_Cannot_initialize_clifford_objec), 0, 0, 1, 0},
19204 {&__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},
19205 {&__pyx_kp_s_Cannot_reframe, __pyx_k_Cannot_reframe,
sizeof(__pyx_k_Cannot_reframe), 0, 0, 1, 0},
19206 {&__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},
19207 {&__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},
19208 {&__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},
19209 {&__pyx_kp_u_Conjugation_reverse_o_involute, __pyx_k_Conjugation_reverse_o_involute,
sizeof(__pyx_k_Conjugation_reverse_o_involute), 0, 1, 0, 0},
19210 {&__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},
19211 {&__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},
19212 {&__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},
19213 {&__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},
19214 {&__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},
19215 {&__pyx_kp_u_Convert_Euclidean_3D_multivecto, __pyx_k_Convert_Euclidean_3D_multivecto,
sizeof(__pyx_k_Convert_Euclidean_3D_multivecto), 0, 1, 0, 0},
19216 {&__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},
19217 {&__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},
19218 {&__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},
19219 {&__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},
19220 {&__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},
19221 {&__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},
19222 {&__pyx_kp_u_Geometric_difference_print_clif, __pyx_k_Geometric_difference_print_clif,
sizeof(__pyx_k_Geometric_difference_print_clif), 0, 1, 0, 0},
19223 {&__pyx_kp_u_Geometric_difference_x_clifford, __pyx_k_Geometric_difference_x_clifford,
sizeof(__pyx_k_Geometric_difference_x_clifford), 0, 1, 0, 0},
19224 {&__pyx_kp_u_Geometric_multiplicative_invers, __pyx_k_Geometric_multiplicative_invers,
sizeof(__pyx_k_Geometric_multiplicative_invers), 0, 1, 0, 0},
19225 {&__pyx_kp_u_Geometric_multiplicative_invers_2, __pyx_k_Geometric_multiplicative_invers_2,
sizeof(__pyx_k_Geometric_multiplicative_invers_2), 0, 1, 0, 0},
19226 {&__pyx_kp_u_Geometric_product_print_cliffor, __pyx_k_Geometric_product_print_cliffor,
sizeof(__pyx_k_Geometric_product_print_cliffor), 0, 1, 0, 0},
19227 {&__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},
19228 {&__pyx_kp_u_Geometric_quotient_print_cliffo, __pyx_k_Geometric_quotient_print_cliffo,
sizeof(__pyx_k_Geometric_quotient_print_cliffo), 0, 1, 0, 0},
19229 {&__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},
19230 {&__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},
19231 {&__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},
19232 {&__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},
19233 {&__pyx_kp_u_Hyperbolic_cosine_of_multivecto, __pyx_k_Hyperbolic_cosine_of_multivecto,
sizeof(__pyx_k_Hyperbolic_cosine_of_multivecto), 0, 1, 0, 0},
19234 {&__pyx_kp_u_Hyperbolic_sine_of_multivector, __pyx_k_Hyperbolic_sine_of_multivector,
sizeof(__pyx_k_Hyperbolic_sine_of_multivector), 0, 1, 0, 0},
19235 {&__pyx_kp_u_Hyperbolic_tangent_of_multivect, __pyx_k_Hyperbolic_tangent_of_multivect,
sizeof(__pyx_k_Hyperbolic_tangent_of_multivect), 0, 1, 0, 0},
19236 {&__pyx_kp_u_Imaginary_part_deprecated_alway, __pyx_k_Imaginary_part_deprecated_alway,
sizeof(__pyx_k_Imaginary_part_deprecated_alway), 0, 1, 0, 0},
19237 {&__pyx_n_s_IndexError, __pyx_k_IndexError,
sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
19238 {&__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},
19239 {&__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},
19240 {&__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},
19241 {&__pyx_n_s_Integral, __pyx_k_Integral,
sizeof(__pyx_k_Integral), 0, 0, 1, 1},
19242 {&__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},
19243 {&__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},
19244 {&__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},
19245 {&__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},
19246 {&__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},
19247 {&__pyx_kp_u_Inverse_tangent_of_multivector, __pyx_k_Inverse_tangent_of_multivector,
sizeof(__pyx_k_Inverse_tangent_of_multivector), 0, 1, 0, 0},
19248 {&__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},
19249 {&__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},
19250 {&__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},
19251 {&__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},
19252 {&__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},
19253 {&__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},
19254 {&__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},
19255 {&__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},
19256 {&__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},
19257 {&__pyx_kp_u_Natural_logarithm_of_multivecto, __pyx_k_Natural_logarithm_of_multivecto,
sizeof(__pyx_k_Natural_logarithm_of_multivecto), 0, 1, 0, 0},
19258 {&__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},
19259 {&__pyx_n_s_NotImplemented, __pyx_k_NotImplemented,
sizeof(__pyx_k_NotImplemented), 0, 0, 1, 1},
19260 {&__pyx_kp_s_Not_applicable, __pyx_k_Not_applicable,
sizeof(__pyx_k_Not_applicable), 0, 0, 1, 0},
19261 {&__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},
19262 {&__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},
19263 {&__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},
19264 {&__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},
19265 {&__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},
19266 {&__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},
19267 {&__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},
19268 {&__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},
19269 {&__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},
19270 {&__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},
19271 {&__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},
19272 {&__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},
19273 {&__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},
19274 {&__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},
19275 {&__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},
19276 {&__pyx_n_s_PyClical, __pyx_k_PyClical,
sizeof(__pyx_k_PyClical), 0, 0, 1, 1},
19277 {&__pyx_kp_s_PyClical_pyx, __pyx_k_PyClical_pyx,
sizeof(__pyx_k_PyClical_pyx), 0, 0, 1, 0},
19278 {&__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},
19279 {&__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},
19280 {&__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},
19281 {&__pyx_n_s_Real, __pyx_k_Real,
sizeof(__pyx_k_Real), 0, 0, 1, 1},
19282 {&__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},
19283 {&__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},
19284 {&__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},
19285 {&__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},
19286 {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError,
sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
19287 {&__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},
19288 {&__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},
19289 {&__pyx_n_s_Sequence, __pyx_k_Sequence,
sizeof(__pyx_k_Sequence), 0, 0, 1, 1},
19290 {&__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},
19291 {&__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},
19292 {&__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},
19293 {&__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},
19294 {&__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},
19295 {&__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},
19296 {&__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},
19297 {&__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},
19298 {&__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},
19299 {&__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},
19300 {&__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},
19301 {&__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},
19302 {&__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},
19303 {&__pyx_kp_u_Symmetric_set_difference_exclus, __pyx_k_Symmetric_set_difference_exclus,
sizeof(__pyx_k_Symmetric_set_difference_exclus), 0, 1, 0, 0},
19304 {&__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},
19305 {&__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},
19306 {&__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},
19307 {&__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},
19308 {&__pyx_kp_u_The_informal_string_representat, __pyx_k_The_informal_string_representat,
sizeof(__pyx_k_The_informal_string_representat), 0, 1, 0, 0},
19309 {&__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},
19310 {&__pyx_kp_u_The_official_string_representat, __pyx_k_The_official_string_representat,
sizeof(__pyx_k_The_official_string_representat), 0, 1, 0, 0},
19311 {&__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},
19312 {&__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},
19313 {&__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},
19314 {&__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},
19315 {&__pyx_n_s_TypeError, __pyx_k_TypeError,
sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
19316 {&__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},
19317 {&__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},
19318 {&__pyx_n_s_ValueError, __pyx_k_ValueError,
sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
19319 {&__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},
19320 {&__pyx_kp_s__2, __pyx_k__2,
sizeof(__pyx_k__2), 0, 0, 1, 0},
19321 {&__pyx_kp_s__5, __pyx_k__5,
sizeof(__pyx_k__5), 0, 0, 1, 0},
19322 {&__pyx_kp_s__6, __pyx_k__6,
sizeof(__pyx_k__6), 0, 0, 1, 0},
19323 {&__pyx_kp_s__7, __pyx_k__7,
sizeof(__pyx_k__7), 0, 0, 1, 0},
19324 {&__pyx_kp_s__8, __pyx_k__8,
sizeof(__pyx_k__8), 0, 0, 1, 0},
19325 {&__pyx_kp_s__9, __pyx_k__9,
sizeof(__pyx_k__9), 0, 0, 1, 0},
19326 {&__pyx_kp_u_abs_line_1473, __pyx_k_abs_line_1473,
sizeof(__pyx_k_abs_line_1473), 0, 1, 0, 0},
19327 {&__pyx_n_s_acos, __pyx_k_acos,
sizeof(__pyx_k_acos), 0, 0, 1, 1},
19328 {&__pyx_kp_u_acos_line_1619, __pyx_k_acos_line_1619,
sizeof(__pyx_k_acos_line_1619), 0, 1, 0, 0},
19329 {&__pyx_n_s_acosh, __pyx_k_acosh,
sizeof(__pyx_k_acosh), 0, 0, 1, 1},
19330 {&__pyx_kp_u_acosh_line_1656, __pyx_k_acosh_line_1656,
sizeof(__pyx_k_acosh_line_1656), 0, 1, 0, 0},
19331 {&__pyx_kp_u_agc3_line_1844, __pyx_k_agc3_line_1844,
sizeof(__pyx_k_agc3_line_1844), 0, 1, 0, 0},
19332 {&__pyx_n_s_args, __pyx_k_args,
sizeof(__pyx_k_args), 0, 0, 1, 1},
19333 {&__pyx_kp_s_as_frame, __pyx_k_as_frame,
sizeof(__pyx_k_as_frame), 0, 0, 1, 0},
19334 {&__pyx_n_s_asin, __pyx_k_asin,
sizeof(__pyx_k_asin), 0, 0, 1, 1},
19335 {&__pyx_kp_u_asin_line_1698, __pyx_k_asin_line_1698,
sizeof(__pyx_k_asin_line_1698), 0, 1, 0, 0},
19336 {&__pyx_n_s_asinh, __pyx_k_asinh,
sizeof(__pyx_k_asinh), 0, 0, 1, 1},
19337 {&__pyx_kp_u_asinh_line_1733, __pyx_k_asinh_line_1733,
sizeof(__pyx_k_asinh_line_1733), 0, 1, 0, 0},
19338 {&__pyx_n_s_atan, __pyx_k_atan,
sizeof(__pyx_k_atan), 0, 0, 1, 1},
19339 {&__pyx_kp_u_atan_line_1769, __pyx_k_atan_line_1769,
sizeof(__pyx_k_atan_line_1769), 0, 1, 0, 0},
19340 {&__pyx_n_s_atanh, __pyx_k_atanh,
sizeof(__pyx_k_atanh), 0, 0, 1, 1},
19341 {&__pyx_kp_u_atanh_line_1798, __pyx_k_atanh_line_1798,
sizeof(__pyx_k_atanh_line_1798), 0, 1, 0, 0},
19342 {&__pyx_kp_u_cga3_line_1824, __pyx_k_cga3_line_1824,
sizeof(__pyx_k_cga3_line_1824), 0, 1, 0, 0},
19343 {&__pyx_kp_u_cga3std_line_1833, __pyx_k_cga3std_line_1833,
sizeof(__pyx_k_cga3std_line_1833), 0, 1, 0, 0},
19344 {&__pyx_n_s_cl, __pyx_k_cl,
sizeof(__pyx_k_cl), 0, 0, 1, 1},
19345 {&__pyx_kp_u_clifford___add___line_739, __pyx_k_clifford___add___line_739,
sizeof(__pyx_k_clifford___add___line_739), 0, 1, 0, 0},
19346 {&__pyx_kp_u_clifford___and___line_835, __pyx_k_clifford___and___line_835,
sizeof(__pyx_k_clifford___and___line_835), 0, 1, 0, 0},
19347 {&__pyx_kp_u_clifford___call___line_1019, __pyx_k_clifford___call___line_1019,
sizeof(__pyx_k_clifford___call___line_1019), 0, 1, 0, 0},
19348 {&__pyx_kp_u_clifford___div___line_895, __pyx_k_clifford___div___line_895,
sizeof(__pyx_k_clifford___div___line_895), 0, 1, 0, 0},
19349 {&__pyx_kp_u_clifford___getitem___line_706, __pyx_k_clifford___getitem___line_706,
sizeof(__pyx_k_clifford___getitem___line_706), 0, 1, 0, 0},
19350 {&__pyx_kp_u_clifford___iadd___line_750, __pyx_k_clifford___iadd___line_750,
sizeof(__pyx_k_clifford___iadd___line_750), 0, 1, 0, 0},
19351 {&__pyx_kp_u_clifford___iand___line_850, __pyx_k_clifford___iand___line_850,
sizeof(__pyx_k_clifford___iand___line_850), 0, 1, 0, 0},
19352 {&__pyx_kp_u_clifford___idiv___line_910, __pyx_k_clifford___idiv___line_910,
sizeof(__pyx_k_clifford___idiv___line_910), 0, 1, 0, 0},
19353 {&__pyx_kp_u_clifford___imod___line_820, __pyx_k_clifford___imod___line_820,
sizeof(__pyx_k_clifford___imod___line_820), 0, 1, 0, 0},
19354 {&__pyx_kp_u_clifford___imul___line_792, __pyx_k_clifford___imul___line_792,
sizeof(__pyx_k_clifford___imul___line_792), 0, 1, 0, 0},
19355 {&__pyx_kp_u_clifford___ior___line_949, __pyx_k_clifford___ior___line_949,
sizeof(__pyx_k_clifford___ior___line_949), 0, 1, 0, 0},
19356 {&__pyx_kp_u_clifford___isub___line_770, __pyx_k_clifford___isub___line_770,
sizeof(__pyx_k_clifford___isub___line_770), 0, 1, 0, 0},
19357 {&__pyx_kp_u_clifford___iter___line_637, __pyx_k_clifford___iter___line_637,
sizeof(__pyx_k_clifford___iter___line_637), 0, 1, 0, 0},
19358 {&__pyx_kp_u_clifford___ixor___line_880, __pyx_k_clifford___ixor___line_880,
sizeof(__pyx_k_clifford___ixor___line_880), 0, 1, 0, 0},
19359 {&__pyx_kp_u_clifford___mod___line_805, __pyx_k_clifford___mod___line_805,
sizeof(__pyx_k_clifford___mod___line_805), 0, 1, 0, 0},
19360 {&__pyx_kp_u_clifford___mul___line_779, __pyx_k_clifford___mul___line_779,
sizeof(__pyx_k_clifford___mul___line_779), 0, 1, 0, 0},
19361 {&__pyx_kp_u_clifford___neg___line_721, __pyx_k_clifford___neg___line_721,
sizeof(__pyx_k_clifford___neg___line_721), 0, 1, 0, 0},
19362 {&__pyx_kp_u_clifford___or___line_938, __pyx_k_clifford___or___line_938,
sizeof(__pyx_k_clifford___or___line_938), 0, 1, 0, 0},
19363 {&__pyx_kp_u_clifford___pos___line_730, __pyx_k_clifford___pos___line_730,
sizeof(__pyx_k_clifford___pos___line_730), 0, 1, 0, 0},
19364 {&__pyx_kp_u_clifford___pow___line_960, __pyx_k_clifford___pow___line_960,
sizeof(__pyx_k_clifford___pow___line_960), 0, 1, 0, 0},
19365 {&__pyx_kp_u_clifford___repr___line_1225, __pyx_k_clifford___repr___line_1225,
sizeof(__pyx_k_clifford___repr___line_1225), 0, 1, 0, 0},
19366 {&__pyx_kp_u_clifford___str___line_1234, __pyx_k_clifford___str___line_1234,
sizeof(__pyx_k_clifford___str___line_1234), 0, 1, 0, 0},
19367 {&__pyx_kp_u_clifford___sub___line_759, __pyx_k_clifford___sub___line_759,
sizeof(__pyx_k_clifford___sub___line_759), 0, 1, 0, 0},
19368 {&__pyx_kp_u_clifford___xor___line_865, __pyx_k_clifford___xor___line_865,
sizeof(__pyx_k_clifford___xor___line_865), 0, 1, 0, 0},
19369 {&__pyx_kp_u_clifford_abs_line_1174, __pyx_k_clifford_abs_line_1174,
sizeof(__pyx_k_clifford_abs_line_1174), 0, 1, 0, 0},
19370 {&__pyx_kp_u_clifford_conj_line_1137, __pyx_k_clifford_conj_line_1137,
sizeof(__pyx_k_clifford_conj_line_1137), 0, 1, 0, 0},
19371 {&__pyx_kp_u_clifford_copy_line_554, __pyx_k_clifford_copy_line_554,
sizeof(__pyx_k_clifford_copy_line_554), 0, 1, 0, 0},
19372 {&__pyx_kp_u_clifford_even_line_1060, __pyx_k_clifford_even_line_1060,
sizeof(__pyx_k_clifford_even_line_1060), 0, 1, 0, 0},
19373 {&__pyx_kp_u_clifford_frame_line_1214, __pyx_k_clifford_frame_line_1214,
sizeof(__pyx_k_clifford_frame_line_1214), 0, 1, 0, 0},
19374 {&__pyx_n_s_clifford_hidden_doctests, __pyx_k_clifford_hidden_doctests,
sizeof(__pyx_k_clifford_hidden_doctests), 0, 0, 1, 1},
19375 {&__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},
19376 {&__pyx_kp_u_clifford_inv_line_925, __pyx_k_clifford_inv_line_925,
sizeof(__pyx_k_clifford_inv_line_925), 0, 1, 0, 0},
19377 {&__pyx_kp_u_clifford_involute_line_1106, __pyx_k_clifford_involute_line_1106,
sizeof(__pyx_k_clifford_involute_line_1106), 0, 1, 0, 0},
19378 {&__pyx_kp_u_clifford_isnan_line_1205, __pyx_k_clifford_isnan_line_1205,
sizeof(__pyx_k_clifford_isnan_line_1205), 0, 1, 0, 0},
19379 {&__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},
19380 {&__pyx_kp_u_clifford_norm_line_1163, __pyx_k_clifford_norm_line_1163,
sizeof(__pyx_k_clifford_norm_line_1163), 0, 1, 0, 0},
19381 {&__pyx_kp_u_clifford_odd_line_1069, __pyx_k_clifford_odd_line_1069,
sizeof(__pyx_k_clifford_odd_line_1069), 0, 1, 0, 0},
19382 {&__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},
19383 {&__pyx_kp_u_clifford_pow_line_979, __pyx_k_clifford_pow_line_979,
sizeof(__pyx_k_clifford_pow_line_979), 0, 1, 0, 0},
19384 {&__pyx_kp_u_clifford_pure_line_1049, __pyx_k_clifford_pure_line_1049,
sizeof(__pyx_k_clifford_pure_line_1049), 0, 1, 0, 0},
19385 {&__pyx_kp_u_clifford_quad_line_1152, __pyx_k_clifford_quad_line_1152,
sizeof(__pyx_k_clifford_quad_line_1152), 0, 1, 0, 0},
19386 {&__pyx_kp_u_clifford_reframe_line_648, __pyx_k_clifford_reframe_line_648,
sizeof(__pyx_k_clifford_reframe_line_648), 0, 1, 0, 0},
19387 {&__pyx_kp_u_clifford_reverse_line_1122, __pyx_k_clifford_reverse_line_1122,
sizeof(__pyx_k_clifford_reverse_line_1122), 0, 1, 0, 0},
19388 {&__pyx_kp_u_clifford_scalar_line_1038, __pyx_k_clifford_scalar_line_1038,
sizeof(__pyx_k_clifford_scalar_line_1038), 0, 1, 0, 0},
19389 {&__pyx_kp_u_clifford_truncated_line_1194, __pyx_k_clifford_truncated_line_1194,
sizeof(__pyx_k_clifford_truncated_line_1194), 0, 1, 0, 0},
19390 {&__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},
19391 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback,
sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
19392 {&__pyx_n_s_close, __pyx_k_close,
sizeof(__pyx_k_close), 0, 0, 1, 1},
19393 {&__pyx_n_s_collections, __pyx_k_collections,
sizeof(__pyx_k_collections), 0, 0, 1, 1},
19394 {&__pyx_kp_u_compare_line_490, __pyx_k_compare_line_490,
sizeof(__pyx_k_compare_line_490), 0, 1, 0, 0},
19395 {&__pyx_kp_u_complexifier_line_1527, __pyx_k_complexifier_line_1527,
sizeof(__pyx_k_complexifier_line_1527), 0, 1, 0, 0},
19396 {&__pyx_n_s_conj, __pyx_k_conj,
sizeof(__pyx_k_conj), 0, 0, 1, 1},
19397 {&__pyx_kp_u_conj_line_1436, __pyx_k_conj_line_1436,
sizeof(__pyx_k_conj_line_1436), 0, 1, 0, 0},
19398 {&__pyx_n_s_copy, __pyx_k_copy,
sizeof(__pyx_k_copy), 0, 0, 1, 1},
19399 {&__pyx_n_s_cos, __pyx_k_cos,
sizeof(__pyx_k_cos), 0, 0, 1, 1},
19400 {&__pyx_kp_u_cos_line_1602, __pyx_k_cos_line_1602,
sizeof(__pyx_k_cos_line_1602), 0, 1, 0, 0},
19401 {&__pyx_n_s_cosh, __pyx_k_cosh,
sizeof(__pyx_k_cosh), 0, 0, 1, 1},
19402 {&__pyx_kp_u_cosh_line_1640, __pyx_k_cosh_line_1640,
sizeof(__pyx_k_cosh_line_1640), 0, 1, 0, 0},
19403 {&__pyx_n_s_doctest, __pyx_k_doctest,
sizeof(__pyx_k_doctest), 0, 0, 1, 1},
19404 {&__pyx_n_s_e, __pyx_k_e,
sizeof(__pyx_k_e), 0, 0, 1, 1},
19405 {&__pyx_kp_u_e_line_1887, __pyx_k_e_line_1887,
sizeof(__pyx_k_e_line_1887), 0, 1, 0, 0},
19406 {&__pyx_n_s_even, __pyx_k_even,
sizeof(__pyx_k_even), 0, 0, 1, 1},
19407 {&__pyx_kp_u_even_line_1388, __pyx_k_even_line_1388,
sizeof(__pyx_k_even_line_1388), 0, 1, 0, 0},
19408 {&__pyx_n_s_exp, __pyx_k_exp,
sizeof(__pyx_k_exp), 0, 0, 1, 1},
19409 {&__pyx_kp_u_exp_line_1565, __pyx_k_exp_line_1565,
sizeof(__pyx_k_exp_line_1565), 0, 1, 0, 0},
19410 {&__pyx_n_s_fill, __pyx_k_fill,
sizeof(__pyx_k_fill), 0, 0, 1, 1},
19411 {&__pyx_n_s_frm, __pyx_k_frm,
sizeof(__pyx_k_frm), 0, 0, 1, 1},
19412 {&__pyx_kp_s_from, __pyx_k_from,
sizeof(__pyx_k_from), 0, 0, 1, 0},
19413 {&__pyx_n_s_getstate, __pyx_k_getstate,
sizeof(__pyx_k_getstate), 0, 0, 1, 1},
19414 {&__pyx_n_s_grade, __pyx_k_grade,
sizeof(__pyx_k_grade), 0, 0, 1, 1},
19415 {&__pyx_n_s_i, __pyx_k_i,
sizeof(__pyx_k_i), 0, 0, 1, 1},
19416 {&__pyx_kp_u_imag_line_1366, __pyx_k_imag_line_1366,
sizeof(__pyx_k_imag_line_1366), 0, 1, 0, 0},
19417 {&__pyx_n_s_import, __pyx_k_import,
sizeof(__pyx_k_import), 0, 0, 1, 1},
19418 {&__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},
19419 {&__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},
19420 {&__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},
19421 {&__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},
19422 {&__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},
19423 {&__pyx_n_s_index_set___iter, __pyx_k_index_set___iter,
sizeof(__pyx_k_index_set___iter), 0, 0, 1, 1},
19424 {&__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},
19425 {&__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},
19426 {&__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},
19427 {&__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},
19428 {&__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},
19429 {&__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},
19430 {&__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},
19431 {&__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},
19432 {&__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},
19433 {&__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},
19434 {&__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},
19435 {&__pyx_n_s_index_set_hidden_doctests, __pyx_k_index_set_hidden_doctests,
sizeof(__pyx_k_index_set_hidden_doctests), 0, 0, 1, 1},
19436 {&__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},
19437 {&__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},
19438 {&__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},
19439 {&__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},
19440 {&__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},
19441 {&__pyx_n_s_inv, __pyx_k_inv,
sizeof(__pyx_k_inv), 0, 0, 1, 1},
19442 {&__pyx_kp_u_inv_line_1329, __pyx_k_inv_line_1329,
sizeof(__pyx_k_inv_line_1329), 0, 1, 0, 0},
19443 {&__pyx_kp_s_invalid, __pyx_k_invalid,
sizeof(__pyx_k_invalid), 0, 0, 1, 0},
19444 {&__pyx_kp_s_invalid_string, __pyx_k_invalid_string,
sizeof(__pyx_k_invalid_string), 0, 0, 1, 0},
19445 {&__pyx_n_s_involute, __pyx_k_involute,
sizeof(__pyx_k_involute), 0, 0, 1, 1},
19446 {&__pyx_kp_u_involute_line_1406, __pyx_k_involute_line_1406,
sizeof(__pyx_k_involute_line_1406), 0, 1, 0, 0},
19447 {&__pyx_n_s_ist, __pyx_k_ist,
sizeof(__pyx_k_ist), 0, 0, 1, 1},
19448 {&__pyx_n_s_istpq, __pyx_k_istpq,
sizeof(__pyx_k_istpq), 0, 0, 1, 1},
19449 {&__pyx_kp_u_istpq_line_1900, __pyx_k_istpq_line_1900,
sizeof(__pyx_k_istpq_line_1900), 0, 1, 0, 0},
19450 {&__pyx_n_s_iter, __pyx_k_iter,
sizeof(__pyx_k_iter), 0, 0, 1, 1},
19451 {&__pyx_n_s_ixt, __pyx_k_ixt,
sizeof(__pyx_k_ixt), 0, 0, 1, 1},
19452 {&__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},
19453 {&__pyx_n_s_lhs, __pyx_k_lhs,
sizeof(__pyx_k_lhs), 0, 0, 1, 1},
19454 {&__pyx_n_s_log, __pyx_k_log,
sizeof(__pyx_k_log), 0, 0, 1, 1},
19455 {&__pyx_kp_u_log_line_1579, __pyx_k_log_line_1579,
sizeof(__pyx_k_log_line_1579), 0, 1, 0, 0},
19456 {&__pyx_n_s_m, __pyx_k_m,
sizeof(__pyx_k_m), 0, 0, 1, 1},
19457 {&__pyx_n_s_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 0, 1, 1},
19458 {&__pyx_n_s_math, __pyx_k_math,
sizeof(__pyx_k_math), 0, 0, 1, 1},
19459 {&__pyx_n_s_max, __pyx_k_max,
sizeof(__pyx_k_max), 0, 0, 1, 1},
19460 {&__pyx_kp_u_max_abs_line_1482, __pyx_k_max_abs_line_1482,
sizeof(__pyx_k_max_abs_line_1482), 0, 1, 0, 0},
19461 {&__pyx_kp_u_max_pos_line_511, __pyx_k_max_pos_line_511,
sizeof(__pyx_k_max_pos_line_511), 0, 1, 0, 0},
19462 {&__pyx_n_s_min, __pyx_k_min,
sizeof(__pyx_k_min), 0, 0, 1, 1},
19463 {&__pyx_kp_u_min_neg_line_502, __pyx_k_min_neg_line_502,
sizeof(__pyx_k_min_neg_line_502), 0, 1, 0, 0},
19464 {&__pyx_n_s_name, __pyx_k_name,
sizeof(__pyx_k_name), 0, 0, 1, 1},
19465 {&__pyx_n_s_nbar3, __pyx_k_nbar3,
sizeof(__pyx_k_nbar3), 0, 0, 1, 1},
19466 {&__pyx_n_s_ninf3, __pyx_k_ninf3,
sizeof(__pyx_k_ninf3), 0, 0, 1, 1},
19467 {&__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},
19468 {&__pyx_n_s_norm, __pyx_k_norm,
sizeof(__pyx_k_norm), 0, 0, 1, 1},
19469 {&__pyx_kp_u_norm_line_1462, __pyx_k_norm_line_1462,
sizeof(__pyx_k_norm_line_1462), 0, 1, 0, 0},
19470 {&__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},
19471 {&__pyx_n_s_numbers, __pyx_k_numbers,
sizeof(__pyx_k_numbers), 0, 0, 1, 1},
19472 {&__pyx_n_s_obj, __pyx_k_obj,
sizeof(__pyx_k_obj), 0, 0, 1, 1},
19473 {&__pyx_n_s_odd, __pyx_k_odd,
sizeof(__pyx_k_odd), 0, 0, 1, 1},
19474 {&__pyx_kp_u_odd_line_1397, __pyx_k_odd_line_1397,
sizeof(__pyx_k_odd_line_1397), 0, 1, 0, 0},
19475 {&__pyx_n_s_other, __pyx_k_other,
sizeof(__pyx_k_other), 0, 0, 1, 1},
19476 {&__pyx_n_s_outer_pow, __pyx_k_outer_pow,
sizeof(__pyx_k_outer_pow), 0, 0, 1, 1},
19477 {&__pyx_kp_u_outer_pow_line_1518, __pyx_k_outer_pow_line_1518,
sizeof(__pyx_k_outer_pow_line_1518), 0, 1, 0, 0},
19478 {&__pyx_n_s_p, __pyx_k_p,
sizeof(__pyx_k_p), 0, 0, 1, 1},
19479 {&__pyx_n_s_pi, __pyx_k_pi,
sizeof(__pyx_k_pi), 0, 0, 1, 1},
19480 {&__pyx_n_s_pow, __pyx_k_pow,
sizeof(__pyx_k_pow), 0, 0, 1, 1},
19481 {&__pyx_kp_u_pow_line_1494, __pyx_k_pow_line_1494,
sizeof(__pyx_k_pow_line_1494), 0, 1, 0, 0},
19482 {&__pyx_n_s_pure, __pyx_k_pure,
sizeof(__pyx_k_pure), 0, 0, 1, 1},
19483 {&__pyx_kp_u_pure_line_1377, __pyx_k_pure_line_1377,
sizeof(__pyx_k_pure_line_1377), 0, 1, 0, 0},
19484 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable,
sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
19485 {&__pyx_n_s_q, __pyx_k_q,
sizeof(__pyx_k_q), 0, 0, 1, 1},
19486 {&__pyx_n_s_quad, __pyx_k_quad,
sizeof(__pyx_k_quad), 0, 0, 1, 1},
19487 {&__pyx_kp_u_quad_line_1451, __pyx_k_quad_line_1451,
sizeof(__pyx_k_quad_line_1451), 0, 1, 0, 0},
19488 {&__pyx_kp_u_random_clifford_line_1815, __pyx_k_random_clifford_line_1815,
sizeof(__pyx_k_random_clifford_line_1815), 0, 1, 0, 0},
19489 {&__pyx_n_s_range, __pyx_k_range,
sizeof(__pyx_k_range), 0, 0, 1, 1},
19490 {&__pyx_kp_u_real_line_1355, __pyx_k_real_line_1355,
sizeof(__pyx_k_real_line_1355), 0, 1, 0, 0},
19491 {&__pyx_n_s_reduce, __pyx_k_reduce,
sizeof(__pyx_k_reduce), 0, 0, 1, 1},
19492 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython,
sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
19493 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex,
sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
19494 {&__pyx_n_s_reverse, __pyx_k_reverse,
sizeof(__pyx_k_reverse), 0, 0, 1, 1},
19495 {&__pyx_kp_u_reverse_line_1421, __pyx_k_reverse_line_1421,
sizeof(__pyx_k_reverse_line_1421), 0, 1, 0, 0},
19496 {&__pyx_n_s_rhs, __pyx_k_rhs,
sizeof(__pyx_k_rhs), 0, 0, 1, 1},
19497 {&__pyx_n_s_scalar, __pyx_k_scalar,
sizeof(__pyx_k_scalar), 0, 0, 1, 1},
19498 {&__pyx_kp_u_scalar_line_1344, __pyx_k_scalar_line_1344,
sizeof(__pyx_k_scalar_line_1344), 0, 1, 0, 0},
19499 {&__pyx_n_s_send, __pyx_k_send,
sizeof(__pyx_k_send), 0, 0, 1, 1},
19500 {&__pyx_n_s_setstate, __pyx_k_setstate,
sizeof(__pyx_k_setstate), 0, 0, 1, 1},
19501 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython,
sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
19502 {&__pyx_n_s_sin, __pyx_k_sin,
sizeof(__pyx_k_sin), 0, 0, 1, 1},
19503 {&__pyx_kp_u_sin_line_1679, __pyx_k_sin_line_1679,
sizeof(__pyx_k_sin_line_1679), 0, 1, 0, 0},
19504 {&__pyx_n_s_sinh, __pyx_k_sinh,
sizeof(__pyx_k_sinh), 0, 0, 1, 1},
19505 {&__pyx_kp_u_sinh_line_1719, __pyx_k_sinh_line_1719,
sizeof(__pyx_k_sinh_line_1719), 0, 1, 0, 0},
19506 {&__pyx_n_s_sqrt, __pyx_k_sqrt,
sizeof(__pyx_k_sqrt), 0, 0, 1, 1},
19507 {&__pyx_kp_u_sqrt_line_1542, __pyx_k_sqrt_line_1542,
sizeof(__pyx_k_sqrt_line_1542), 0, 1, 0, 0},
19508 {&__pyx_n_s_tan, __pyx_k_tan,
sizeof(__pyx_k_tan), 0, 0, 1, 1},
19509 {&__pyx_kp_u_tan_line_1752, __pyx_k_tan_line_1752,
sizeof(__pyx_k_tan_line_1752), 0, 1, 0, 0},
19510 {&__pyx_n_s_tanh, __pyx_k_tanh,
sizeof(__pyx_k_tanh), 0, 0, 1, 1},
19511 {&__pyx_kp_u_tanh_line_1786, __pyx_k_tanh_line_1786,
sizeof(__pyx_k_tanh_line_1786), 0, 1, 0, 0},
19512 {&__pyx_n_s_tau, __pyx_k_tau,
sizeof(__pyx_k_tau), 0, 0, 1, 1},
19513 {&__pyx_n_s_test, __pyx_k_test,
sizeof(__pyx_k_test), 0, 0, 1, 1},
19514 {&__pyx_n_s_test_2, __pyx_k_test_2,
sizeof(__pyx_k_test_2), 0, 0, 1, 1},
19515 {&__pyx_n_s_testmod, __pyx_k_testmod,
sizeof(__pyx_k_testmod), 0, 0, 1, 1},
19516 {&__pyx_n_s_throw, __pyx_k_throw,
sizeof(__pyx_k_throw), 0, 0, 1, 1},
19517 {&__pyx_kp_s_to_frame, __pyx_k_to_frame,
sizeof(__pyx_k_to_frame), 0, 0, 1, 0},
19518 {&__pyx_kp_s_using, __pyx_k_using,
sizeof(__pyx_k_using), 0, 0, 1, 0},
19519 {&__pyx_kp_s_using_invalid, __pyx_k_using_invalid,
sizeof(__pyx_k_using_invalid), 0, 0, 1, 0},
19520 {&__pyx_kp_s_value, __pyx_k_value,
sizeof(__pyx_k_value), 0, 0, 1, 0},
19521 {&__pyx_n_s_version, __pyx_k_version,
sizeof(__pyx_k_version), 0, 0, 1, 1},
19522 {&__pyx_n_s_xrange, __pyx_k_xrange,
sizeof(__pyx_k_xrange), 0, 0, 1, 1},
19523 {0, 0, 0, 0, 0, 0, 0}
19525 static int __Pyx_InitCachedBuiltins(
void) {
19526 __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError);
if (!__pyx_builtin_IndexError) __PYX_ERR(0, 102, __pyx_L1_error)
19527 __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError);
if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 104, __pyx_L1_error)
19528 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError);
if (!__pyx_builtin_TypeError) __PYX_ERR(0, 104, __pyx_L1_error)
19529 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError);
if (!__pyx_builtin_ValueError) __PYX_ERR(0, 105, __pyx_L1_error)
19530 __pyx_builtin_NotImplemented = __Pyx_GetBuiltinName(__pyx_n_s_NotImplemented);
if (!__pyx_builtin_NotImplemented) __PYX_ERR(0, 157, __pyx_L1_error)
19531 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_range) __PYX_ERR(0, 234, __pyx_L1_error)
19532 #if PY_MAJOR_VERSION >= 3 19533 __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_xrange) __PYX_ERR(0, 1098, __pyx_L1_error)
19535 __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange);
if (!__pyx_builtin_xrange) __PYX_ERR(0, 1098, __pyx_L1_error)
19542 static int __Pyx_InitCachedConstants(
void) {
19543 __Pyx_RefNannyDeclarations
19544 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
19552 __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)
19553 __Pyx_GOTREF(__pyx_tuple__3);
19554 __Pyx_GIVEREF(__pyx_tuple__3);
19561 __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)
19562 __Pyx_GOTREF(__pyx_tuple__4);
19563 __Pyx_GIVEREF(__pyx_tuple__4);
19572 __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Not_applicable);
if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 635, __pyx_L1_error)
19573 __Pyx_GOTREF(__pyx_tuple__10);
19574 __Pyx_GIVEREF(__pyx_tuple__10);
19583 __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Not_applicable);
if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 646, __pyx_L1_error)
19584 __Pyx_GOTREF(__pyx_tuple__11);
19585 __Pyx_GIVEREF(__pyx_tuple__11);
19593 __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 2, __pyx_L1_error)
19594 __Pyx_GOTREF(__pyx_tuple__12);
19595 __Pyx_GIVEREF(__pyx_tuple__12);
19602 __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 4, __pyx_L1_error)
19603 __Pyx_GOTREF(__pyx_tuple__13);
19604 __Pyx_GIVEREF(__pyx_tuple__13);
19613 __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_index_set_hidden_doctests, 404, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 404, __pyx_L1_error)
19622 __pyx_codeobj__15 = (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__15)) __PYX_ERR(0, 1243, __pyx_L1_error)
19631 __pyx_tuple__16 = PyTuple_Pack(1, __pyx_float_1_0);
if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 1856, __pyx_L1_error)
19632 __Pyx_GOTREF(__pyx_tuple__16);
19633 __Pyx_GIVEREF(__pyx_tuple__16);
19642 __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_obj);
if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 1887, __pyx_L1_error)
19643 __Pyx_GOTREF(__pyx_tuple__17);
19644 __Pyx_GIVEREF(__pyx_tuple__17);
19645 __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_PyClical_pyx, __pyx_n_s_e, 1887, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 1887, __pyx_L1_error)
19654 __pyx_tuple__19 = PyTuple_Pack(2, __pyx_n_s_p, __pyx_n_s_q);
if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 1900, __pyx_L1_error)
19655 __Pyx_GOTREF(__pyx_tuple__19);
19656 __Pyx_GIVEREF(__pyx_tuple__19);
19657 __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_PyClical_pyx, __pyx_n_s_istpq, 1900, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 1900, __pyx_L1_error)
19666 __pyx_tuple__21 = PyTuple_Pack(1, __pyx_int_4);
if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 1909, __pyx_L1_error)
19667 __Pyx_GOTREF(__pyx_tuple__21);
19668 __Pyx_GIVEREF(__pyx_tuple__21);
19669 __pyx_tuple__22 = PyTuple_Pack(1, __pyx_int_neg_1);
if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 1909, __pyx_L1_error)
19670 __Pyx_GOTREF(__pyx_tuple__22);
19671 __Pyx_GIVEREF(__pyx_tuple__22);
19680 __pyx_tuple__23 = PyTuple_Pack(1, __pyx_int_4);
if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 1910, __pyx_L1_error)
19681 __Pyx_GOTREF(__pyx_tuple__23);
19682 __Pyx_GIVEREF(__pyx_tuple__23);
19683 __pyx_tuple__24 = PyTuple_Pack(1, __pyx_int_neg_1);
if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 1910, __pyx_L1_error)
19684 __Pyx_GOTREF(__pyx_tuple__24);
19685 __Pyx_GIVEREF(__pyx_tuple__24);
19694 __pyx_tuple__25 = PyTuple_Pack(2, __pyx_n_s_PyClical, __pyx_n_s_doctest);
if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 1913, __pyx_L1_error)
19695 __Pyx_GOTREF(__pyx_tuple__25);
19696 __Pyx_GIVEREF(__pyx_tuple__25);
19697 __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_PyClical_pyx, __pyx_n_s_test, 1913, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 1913, __pyx_L1_error)
19698 __Pyx_RefNannyFinishContext();
19701 __Pyx_RefNannyFinishContext();
19705 static int __Pyx_InitGlobals(
void) {
19706 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
19707 __pyx_float_0_0 =
PyFloat_FromDouble(0.0);
if (unlikely(!__pyx_float_0_0)) __PYX_ERR(0, 1, __pyx_L1_error)
19708 __pyx_float_1_0 =
PyFloat_FromDouble(1.0);
if (unlikely(!__pyx_float_1_0)) __PYX_ERR(0, 1, __pyx_L1_error)
19709 __pyx_float_2_0 =
PyFloat_FromDouble(2.0);
if (unlikely(!__pyx_float_2_0)) __PYX_ERR(0, 1, __pyx_L1_error)
19710 __pyx_float_8_0 =
PyFloat_FromDouble(8.0);
if (unlikely(!__pyx_float_8_0)) __PYX_ERR(0, 1, __pyx_L1_error)
19711 __pyx_int_0 = PyInt_FromLong(0);
if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
19712 __pyx_int_1 = PyInt_FromLong(1);
if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
19713 __pyx_int_4 = PyInt_FromLong(4);
if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error)
19714 __pyx_int_neg_1 = PyInt_FromLong(-1);
if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
19720 static int __Pyx_modinit_global_init_code(
void);
19721 static int __Pyx_modinit_variable_export_code(
void);
19722 static int __Pyx_modinit_function_export_code(
void);
19723 static int __Pyx_modinit_type_init_code(
void);
19724 static int __Pyx_modinit_type_import_code(
void);
19725 static int __Pyx_modinit_variable_import_code(
void);
19726 static int __Pyx_modinit_function_import_code(
void);
19728 static int __Pyx_modinit_global_init_code(
void) {
19729 __Pyx_RefNannyDeclarations
19730 __Pyx_RefNannySetupContext(
"__Pyx_modinit_global_init_code", 0);
19732 __Pyx_RefNannyFinishContext();
19736 static int __Pyx_modinit_variable_export_code(
void) {
19737 __Pyx_RefNannyDeclarations
19738 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_export_code", 0);
19740 __Pyx_RefNannyFinishContext();
19744 static int __Pyx_modinit_function_export_code(
void) {
19745 __Pyx_RefNannyDeclarations
19746 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_export_code", 0);
19748 __Pyx_RefNannyFinishContext();
19752 static int __Pyx_modinit_type_init_code(
void) {
19753 __Pyx_RefNannyDeclarations
19754 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_init_code", 0);
19756 __pyx_vtabptr_8PyClical_index_set = &__pyx_vtable_8PyClical_index_set;
19757 __pyx_vtable_8PyClical_index_set.wrap = (PyObject *(*)(
struct __pyx_obj_8PyClical_index_set *,
IndexSet))__pyx_f_8PyClical_9index_set_wrap;
19758 __pyx_vtable_8PyClical_index_set.unwrap = (
IndexSet (*)(
struct __pyx_obj_8PyClical_index_set *))__pyx_f_8PyClical_9index_set_unwrap;
19759 __pyx_vtable_8PyClical_index_set.copy = (PyObject *(*)(
struct __pyx_obj_8PyClical_index_set *,
int __pyx_skip_dispatch))__pyx_f_8PyClical_9index_set_copy;
19760 if (PyType_Ready(&__pyx_type_8PyClical_index_set) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
19761 __pyx_type_8PyClical_index_set.tp_print = 0;
19762 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)) {
19763 __pyx_type_8PyClical_index_set.tp_getattro = __Pyx_PyObject_GenericGetAttr;
19765 #if CYTHON_COMPILING_IN_CPYTHON 19767 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__setitem__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19768 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19769 __pyx_wrapperbase_8PyClical_9index_set_8__setitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19770 __pyx_wrapperbase_8PyClical_9index_set_8__setitem__.doc = __pyx_doc_8PyClical_9index_set_8__setitem__;
19771 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_8__setitem__;
19775 #if CYTHON_COMPILING_IN_CPYTHON 19777 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__getitem__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19778 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19779 __pyx_wrapperbase_8PyClical_9index_set_10__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19780 __pyx_wrapperbase_8PyClical_9index_set_10__getitem__.doc = __pyx_doc_8PyClical_9index_set_10__getitem__;
19781 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_10__getitem__;
19785 #if CYTHON_COMPILING_IN_CPYTHON 19787 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__contains__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19788 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19789 __pyx_wrapperbase_8PyClical_9index_set_12__contains__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19790 __pyx_wrapperbase_8PyClical_9index_set_12__contains__.doc = __pyx_doc_8PyClical_9index_set_12__contains__;
19791 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_12__contains__;
19795 #if CYTHON_COMPILING_IN_CPYTHON 19797 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__iter__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19798 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19799 __pyx_wrapperbase_8PyClical_9index_set_14__iter__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19800 __pyx_wrapperbase_8PyClical_9index_set_14__iter__.doc = __pyx_doc_8PyClical_9index_set_14__iter__;
19801 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_14__iter__;
19805 #if CYTHON_COMPILING_IN_CPYTHON 19807 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__invert__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19808 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19809 __pyx_wrapperbase_8PyClical_9index_set_17__invert__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19810 __pyx_wrapperbase_8PyClical_9index_set_17__invert__.doc = __pyx_doc_8PyClical_9index_set_17__invert__;
19811 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_17__invert__;
19815 #if CYTHON_COMPILING_IN_CPYTHON 19817 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__xor__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19818 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19819 __pyx_wrapperbase_8PyClical_9index_set_19__xor__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19820 __pyx_wrapperbase_8PyClical_9index_set_19__xor__.doc = __pyx_doc_8PyClical_9index_set_19__xor__;
19821 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_19__xor__;
19825 #if CYTHON_COMPILING_IN_CPYTHON 19827 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__ixor__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19828 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19829 __pyx_wrapperbase_8PyClical_9index_set_21__ixor__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19830 __pyx_wrapperbase_8PyClical_9index_set_21__ixor__.doc = __pyx_doc_8PyClical_9index_set_21__ixor__;
19831 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_21__ixor__;
19835 #if CYTHON_COMPILING_IN_CPYTHON 19837 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__and__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19838 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19839 __pyx_wrapperbase_8PyClical_9index_set_23__and__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19840 __pyx_wrapperbase_8PyClical_9index_set_23__and__.doc = __pyx_doc_8PyClical_9index_set_23__and__;
19841 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_23__and__;
19845 #if CYTHON_COMPILING_IN_CPYTHON 19847 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__iand__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19848 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19849 __pyx_wrapperbase_8PyClical_9index_set_25__iand__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19850 __pyx_wrapperbase_8PyClical_9index_set_25__iand__.doc = __pyx_doc_8PyClical_9index_set_25__iand__;
19851 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_25__iand__;
19855 #if CYTHON_COMPILING_IN_CPYTHON 19857 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__or__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19858 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19859 __pyx_wrapperbase_8PyClical_9index_set_27__or__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19860 __pyx_wrapperbase_8PyClical_9index_set_27__or__.doc = __pyx_doc_8PyClical_9index_set_27__or__;
19861 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_27__or__;
19865 #if CYTHON_COMPILING_IN_CPYTHON 19867 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__ior__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19868 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19869 __pyx_wrapperbase_8PyClical_9index_set_29__ior__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19870 __pyx_wrapperbase_8PyClical_9index_set_29__ior__.doc = __pyx_doc_8PyClical_9index_set_29__ior__;
19871 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_29__ior__;
19875 #if CYTHON_COMPILING_IN_CPYTHON 19877 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__repr__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19878 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19879 __pyx_wrapperbase_8PyClical_9index_set_47__repr__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19880 __pyx_wrapperbase_8PyClical_9index_set_47__repr__.doc = __pyx_doc_8PyClical_9index_set_47__repr__;
19881 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_47__repr__;
19885 #if CYTHON_COMPILING_IN_CPYTHON 19887 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__str__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19888 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19889 __pyx_wrapperbase_8PyClical_9index_set_49__str__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19890 __pyx_wrapperbase_8PyClical_9index_set_49__str__.doc = __pyx_doc_8PyClical_9index_set_49__str__;
19891 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_49__str__;
19895 if (__Pyx_SetVtable(__pyx_type_8PyClical_index_set.tp_dict, __pyx_vtabptr_8PyClical_index_set) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
19896 if (PyObject_SetAttrString(__pyx_m,
"index_set", (PyObject *)&__pyx_type_8PyClical_index_set) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
19897 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8PyClical_index_set) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
19898 __pyx_ptype_8PyClical_index_set = &__pyx_type_8PyClical_index_set;
19899 __pyx_vtabptr_8PyClical_clifford = &__pyx_vtable_8PyClical_clifford;
19900 __pyx_vtable_8PyClical_clifford.wrap = (PyObject *(*)(
struct __pyx_obj_8PyClical_clifford *,
Clifford))__pyx_f_8PyClical_8clifford_wrap;
19901 __pyx_vtable_8PyClical_clifford.unwrap = (
Clifford (*)(
struct __pyx_obj_8PyClical_clifford *))__pyx_f_8PyClical_8clifford_unwrap;
19902 __pyx_vtable_8PyClical_clifford.copy = (PyObject *(*)(
struct __pyx_obj_8PyClical_clifford *,
int __pyx_skip_dispatch))__pyx_f_8PyClical_8clifford_copy;
19903 if (PyType_Ready(&__pyx_type_8PyClical_clifford) < 0) __PYX_ERR(0, 535, __pyx_L1_error)
19904 __pyx_type_8PyClical_clifford.tp_print = 0;
19905 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8PyClical_clifford.tp_dictoffset && __pyx_type_8PyClical_clifford.tp_getattro == PyObject_GenericGetAttr)) {
19906 __pyx_type_8PyClical_clifford.tp_getattro = __Pyx_PyObject_GenericGetAttr;
19908 #if CYTHON_COMPILING_IN_CPYTHON 19910 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__contains__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19911 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19912 __pyx_wrapperbase_8PyClical_8clifford_6__contains__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19913 __pyx_wrapperbase_8PyClical_8clifford_6__contains__.doc = __pyx_doc_8PyClical_8clifford_6__contains__;
19914 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_6__contains__;
19918 #if CYTHON_COMPILING_IN_CPYTHON 19920 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__iter__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19921 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19922 __pyx_wrapperbase_8PyClical_8clifford_8__iter__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19923 __pyx_wrapperbase_8PyClical_8clifford_8__iter__.doc = __pyx_doc_8PyClical_8clifford_8__iter__;
19924 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_8__iter__;
19928 #if CYTHON_COMPILING_IN_CPYTHON 19930 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__getitem__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19931 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19932 __pyx_wrapperbase_8PyClical_8clifford_14__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19933 __pyx_wrapperbase_8PyClical_8clifford_14__getitem__.doc = __pyx_doc_8PyClical_8clifford_14__getitem__;
19934 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_14__getitem__;
19938 #if CYTHON_COMPILING_IN_CPYTHON 19940 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__neg__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19941 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19942 __pyx_wrapperbase_8PyClical_8clifford_16__neg__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19943 __pyx_wrapperbase_8PyClical_8clifford_16__neg__.doc = __pyx_doc_8PyClical_8clifford_16__neg__;
19944 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_16__neg__;
19948 #if CYTHON_COMPILING_IN_CPYTHON 19950 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__pos__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19951 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19952 __pyx_wrapperbase_8PyClical_8clifford_18__pos__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19953 __pyx_wrapperbase_8PyClical_8clifford_18__pos__.doc = __pyx_doc_8PyClical_8clifford_18__pos__;
19954 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_18__pos__;
19958 #if CYTHON_COMPILING_IN_CPYTHON 19960 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__add__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19961 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19962 __pyx_wrapperbase_8PyClical_8clifford_20__add__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19963 __pyx_wrapperbase_8PyClical_8clifford_20__add__.doc = __pyx_doc_8PyClical_8clifford_20__add__;
19964 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_20__add__;
19968 #if CYTHON_COMPILING_IN_CPYTHON 19970 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__iadd__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19971 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19972 __pyx_wrapperbase_8PyClical_8clifford_22__iadd__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19973 __pyx_wrapperbase_8PyClical_8clifford_22__iadd__.doc = __pyx_doc_8PyClical_8clifford_22__iadd__;
19974 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_22__iadd__;
19978 #if CYTHON_COMPILING_IN_CPYTHON 19980 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__sub__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19981 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19982 __pyx_wrapperbase_8PyClical_8clifford_24__sub__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19983 __pyx_wrapperbase_8PyClical_8clifford_24__sub__.doc = __pyx_doc_8PyClical_8clifford_24__sub__;
19984 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_24__sub__;
19988 #if CYTHON_COMPILING_IN_CPYTHON 19990 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__isub__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19991 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19992 __pyx_wrapperbase_8PyClical_8clifford_26__isub__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19993 __pyx_wrapperbase_8PyClical_8clifford_26__isub__.doc = __pyx_doc_8PyClical_8clifford_26__isub__;
19994 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_26__isub__;
19998 #if CYTHON_COMPILING_IN_CPYTHON 20000 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__mul__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20001 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20002 __pyx_wrapperbase_8PyClical_8clifford_28__mul__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20003 __pyx_wrapperbase_8PyClical_8clifford_28__mul__.doc = __pyx_doc_8PyClical_8clifford_28__mul__;
20004 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_28__mul__;
20008 #if CYTHON_COMPILING_IN_CPYTHON 20010 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__imul__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20011 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20012 __pyx_wrapperbase_8PyClical_8clifford_30__imul__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20013 __pyx_wrapperbase_8PyClical_8clifford_30__imul__.doc = __pyx_doc_8PyClical_8clifford_30__imul__;
20014 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_30__imul__;
20018 #if CYTHON_COMPILING_IN_CPYTHON 20020 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__mod__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20021 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20022 __pyx_wrapperbase_8PyClical_8clifford_32__mod__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20023 __pyx_wrapperbase_8PyClical_8clifford_32__mod__.doc = __pyx_doc_8PyClical_8clifford_32__mod__;
20024 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_32__mod__;
20028 #if CYTHON_COMPILING_IN_CPYTHON 20030 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__imod__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20031 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20032 __pyx_wrapperbase_8PyClical_8clifford_34__imod__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20033 __pyx_wrapperbase_8PyClical_8clifford_34__imod__.doc = __pyx_doc_8PyClical_8clifford_34__imod__;
20034 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_34__imod__;
20038 #if CYTHON_COMPILING_IN_CPYTHON 20040 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__and__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20041 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20042 __pyx_wrapperbase_8PyClical_8clifford_36__and__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20043 __pyx_wrapperbase_8PyClical_8clifford_36__and__.doc = __pyx_doc_8PyClical_8clifford_36__and__;
20044 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_36__and__;
20048 #if CYTHON_COMPILING_IN_CPYTHON 20050 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__iand__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20051 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20052 __pyx_wrapperbase_8PyClical_8clifford_38__iand__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20053 __pyx_wrapperbase_8PyClical_8clifford_38__iand__.doc = __pyx_doc_8PyClical_8clifford_38__iand__;
20054 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_38__iand__;
20058 #if CYTHON_COMPILING_IN_CPYTHON 20060 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__xor__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20061 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20062 __pyx_wrapperbase_8PyClical_8clifford_40__xor__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20063 __pyx_wrapperbase_8PyClical_8clifford_40__xor__.doc = __pyx_doc_8PyClical_8clifford_40__xor__;
20064 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_40__xor__;
20068 #if CYTHON_COMPILING_IN_CPYTHON 20070 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__ixor__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20071 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20072 __pyx_wrapperbase_8PyClical_8clifford_42__ixor__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20073 __pyx_wrapperbase_8PyClical_8clifford_42__ixor__.doc = __pyx_doc_8PyClical_8clifford_42__ixor__;
20074 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_42__ixor__;
20078 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 20079 #if CYTHON_COMPILING_IN_CPYTHON 20081 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__div__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20082 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20083 __pyx_wrapperbase_8PyClical_8clifford_44__div__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20084 __pyx_wrapperbase_8PyClical_8clifford_44__div__.doc = __pyx_doc_8PyClical_8clifford_44__div__;
20085 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_44__div__;
20090 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 20091 #if CYTHON_COMPILING_IN_CPYTHON 20093 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__idiv__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20094 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20095 __pyx_wrapperbase_8PyClical_8clifford_46__idiv__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20096 __pyx_wrapperbase_8PyClical_8clifford_46__idiv__.doc = __pyx_doc_8PyClical_8clifford_46__idiv__;
20097 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_46__idiv__;
20102 #if CYTHON_COMPILING_IN_CPYTHON 20104 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__or__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20105 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20106 __pyx_wrapperbase_8PyClical_8clifford_50__or__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20107 __pyx_wrapperbase_8PyClical_8clifford_50__or__.doc = __pyx_doc_8PyClical_8clifford_50__or__;
20108 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_50__or__;
20112 #if CYTHON_COMPILING_IN_CPYTHON 20114 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__ior__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20115 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20116 __pyx_wrapperbase_8PyClical_8clifford_52__ior__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20117 __pyx_wrapperbase_8PyClical_8clifford_52__ior__.doc = __pyx_doc_8PyClical_8clifford_52__ior__;
20118 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_52__ior__;
20122 #if CYTHON_COMPILING_IN_CPYTHON 20124 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__pow__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20125 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20126 __pyx_wrapperbase_8PyClical_8clifford_54__pow__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20127 __pyx_wrapperbase_8PyClical_8clifford_54__pow__.doc = __pyx_doc_8PyClical_8clifford_54__pow__;
20128 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_54__pow__;
20132 #if CYTHON_COMPILING_IN_CPYTHON 20134 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__call__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20135 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20136 __pyx_wrapperbase_8PyClical_8clifford_60__call__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20137 __pyx_wrapperbase_8PyClical_8clifford_60__call__.doc = __pyx_doc_8PyClical_8clifford_60__call__;
20138 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_60__call__;
20142 #if CYTHON_COMPILING_IN_CPYTHON 20144 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__repr__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20145 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20146 __pyx_wrapperbase_8PyClical_8clifford_92__repr__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20147 __pyx_wrapperbase_8PyClical_8clifford_92__repr__.doc = __pyx_doc_8PyClical_8clifford_92__repr__;
20148 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_92__repr__;
20152 #if CYTHON_COMPILING_IN_CPYTHON 20154 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__str__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20155 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20156 __pyx_wrapperbase_8PyClical_8clifford_94__str__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20157 __pyx_wrapperbase_8PyClical_8clifford_94__str__.doc = __pyx_doc_8PyClical_8clifford_94__str__;
20158 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_94__str__;
20162 if (__Pyx_SetVtable(__pyx_type_8PyClical_clifford.tp_dict, __pyx_vtabptr_8PyClical_clifford) < 0) __PYX_ERR(0, 535, __pyx_L1_error)
20163 if (PyObject_SetAttrString(__pyx_m,
"clifford", (PyObject *)&__pyx_type_8PyClical_clifford) < 0) __PYX_ERR(0, 535, __pyx_L1_error)
20164 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8PyClical_clifford) < 0) __PYX_ERR(0, 535, __pyx_L1_error)
20165 __pyx_ptype_8PyClical_clifford = &__pyx_type_8PyClical_clifford;
20166 if (PyType_Ready(&__pyx_type_8PyClical___pyx_scope_struct____iter__) < 0) __PYX_ERR(0, 227, __pyx_L1_error)
20167 __pyx_type_8PyClical___pyx_scope_struct____iter__.tp_print = 0;
20168 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)) {
20169 __pyx_type_8PyClical___pyx_scope_struct____iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
20171 __pyx_ptype_8PyClical___pyx_scope_struct____iter__ = &__pyx_type_8PyClical___pyx_scope_struct____iter__;
20172 __Pyx_RefNannyFinishContext();
20175 __Pyx_RefNannyFinishContext();
20179 static int __Pyx_modinit_type_import_code(
void) {
20180 __Pyx_RefNannyDeclarations
20181 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_import_code", 0);
20183 __Pyx_RefNannyFinishContext();
20187 static int __Pyx_modinit_variable_import_code(
void) {
20188 __Pyx_RefNannyDeclarations
20189 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_import_code", 0);
20191 __Pyx_RefNannyFinishContext();
20195 static int __Pyx_modinit_function_import_code(
void) {
20196 __Pyx_RefNannyDeclarations
20197 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_import_code", 0);
20199 __Pyx_RefNannyFinishContext();
20204 #if PY_MAJOR_VERSION < 3 20205 #ifdef CYTHON_NO_PYINIT_EXPORT 20206 #define __Pyx_PyMODINIT_FUNC void 20208 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC 20211 #ifdef CYTHON_NO_PYINIT_EXPORT 20212 #define __Pyx_PyMODINIT_FUNC PyObject * 20214 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC 20217 #ifndef CYTHON_SMALL_CODE 20218 #if defined(__clang__) 20219 #define CYTHON_SMALL_CODE 20220 #elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4))) 20221 #define CYTHON_SMALL_CODE __attribute__((optimize("Os"))) 20223 #define CYTHON_SMALL_CODE 20228 #if PY_MAJOR_VERSION < 3 20229 __Pyx_PyMODINIT_FUNC initPyClical(
void) CYTHON_SMALL_CODE;
20230 __Pyx_PyMODINIT_FUNC initPyClical(
void)
20232 __Pyx_PyMODINIT_FUNC PyInit_PyClical(
void) CYTHON_SMALL_CODE;
20233 __Pyx_PyMODINIT_FUNC PyInit_PyClical(
void)
20234 #if CYTHON_PEP489_MULTI_PHASE_INIT 20236 return PyModuleDef_Init(&__pyx_moduledef);
20238 static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict,
const char* from_name,
const char* to_name) {
20239 PyObject *value = PyObject_GetAttrString(spec, from_name);
20241 if (likely(value)) {
20242 result = PyDict_SetItemString(moddict, to_name, value);
20244 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
20251 static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
20252 PyObject *module = NULL, *moddict, *modname;
20254 return __Pyx_NewRef(__pyx_m);
20255 modname = PyObject_GetAttrString(spec,
"name");
20256 if (unlikely(!modname))
goto bad;
20257 module = PyModule_NewObject(modname);
20258 Py_DECREF(modname);
20259 if (unlikely(!module))
goto bad;
20260 moddict = PyModule_GetDict(module);
20261 if (unlikely(!moddict))
goto bad;
20262 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__") < 0))
goto bad;
20263 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__") < 0))
goto bad;
20264 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__") < 0))
goto bad;
20265 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__") < 0))
goto bad;
20268 Py_XDECREF(module);
20273 static int __pyx_pymod_exec_PyClical(PyObject *__pyx_pyinit_module)
20277 PyObject *__pyx_t_1 = NULL;
20278 PyObject *__pyx_t_2 = NULL;
20279 PyObject *__pyx_t_3 = NULL;
20281 __Pyx_RefNannyDeclarations
20282 #if CYTHON_PEP489_MULTI_PHASE_INIT 20283 if (__pyx_m && __pyx_m == __pyx_pyinit_module)
return 0;
20284 #elif PY_MAJOR_VERSION >= 3 20285 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
20287 #if CYTHON_REFNANNY 20288 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
20289 if (!__Pyx_RefNanny) {
20291 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
20292 if (!__Pyx_RefNanny)
20293 Py_FatalError(
"failed to import 'refnanny' module");
20296 __Pyx_RefNannySetupContext(
"__Pyx_PyMODINIT_FUNC PyInit_PyClical(void)", 0);
20297 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20298 __pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
20299 __pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
20300 __pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
20301 #ifdef __Pyx_CyFunction_USED 20302 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20304 #ifdef __Pyx_FusedFunction_USED 20305 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20307 #ifdef __Pyx_Coroutine_USED 20308 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20310 #ifdef __Pyx_Generator_USED 20311 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20313 #ifdef __Pyx_AsyncGen_USED 20314 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20316 #ifdef __Pyx_StopAsyncIteration_USED 20317 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20321 #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS 20323 PyEval_InitThreads();
20327 #if CYTHON_PEP489_MULTI_PHASE_INIT 20328 __pyx_m = __pyx_pyinit_module;
20329 Py_INCREF(__pyx_m);
20331 #if PY_MAJOR_VERSION < 3 20332 __pyx_m = Py_InitModule4(
"PyClical", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
20334 __pyx_m = PyModule_Create(&__pyx_moduledef);
20336 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
20338 __pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
20339 Py_INCREF(__pyx_d);
20340 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
20341 __pyx_cython_runtime = PyImport_AddModule((
char *)
"cython_runtime");
if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
20342 #if CYTHON_COMPILING_IN_PYPY 20343 Py_INCREF(__pyx_b);
20345 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
20347 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20348 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) 20349 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20351 if (__pyx_module_is_main_PyClical) {
20352 if (PyObject_SetAttrString(__pyx_m,
"__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20354 #if PY_MAJOR_VERSION >= 3 20356 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
20357 if (!PyDict_GetItemString(modules,
"PyClical")) {
20358 if (unlikely(PyDict_SetItemString(modules,
"PyClical", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
20363 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20365 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20367 (void)__Pyx_modinit_global_init_code();
20368 (void)__Pyx_modinit_variable_export_code();
20369 (void)__Pyx_modinit_function_export_code();
20370 if (unlikely(__Pyx_modinit_type_init_code() != 0))
goto __pyx_L1_error;
20371 (void)__Pyx_modinit_type_import_code();
20372 (void)__Pyx_modinit_variable_import_code();
20373 (void)__Pyx_modinit_function_import_code();
20375 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) 20376 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20386 __pyx_t_1 = __Pyx_Import(__pyx_n_s_math, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
20387 __Pyx_GOTREF(__pyx_t_1);
20388 if (PyDict_SetItem(__pyx_d, __pyx_n_s_math, __pyx_t_1) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
20389 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20398 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numbers, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
20399 __Pyx_GOTREF(__pyx_t_1);
20400 if (PyDict_SetItem(__pyx_d, __pyx_n_s_numbers, __pyx_t_1) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
20401 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20410 __pyx_t_1 = __Pyx_Import(__pyx_n_s_collections, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error)
20411 __Pyx_GOTREF(__pyx_t_1);
20412 if (PyDict_SetItem(__pyx_d, __pyx_n_s_collections, __pyx_t_1) < 0) __PYX_ERR(0, 30, __pyx_L1_error)
20413 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20422 if (PyDict_SetItem(__pyx_d, __pyx_n_s_version, __pyx_kp_s_0_8_2) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
20431 __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)
20432 __Pyx_GOTREF(__pyx_t_1);
20433 if (PyDict_SetItem(__pyx_d, __pyx_n_s_index_set_hidden_doctests, __pyx_t_1) < 0) __PYX_ERR(0, 404, __pyx_L1_error)
20434 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20443 __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)
20444 __Pyx_GOTREF(__pyx_t_1);
20445 if (PyDict_SetItem(__pyx_d, __pyx_n_s_clifford_hidden_doctests, __pyx_t_1) < 0) __PYX_ERR(0, 1243, __pyx_L1_error)
20446 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20455 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_tuple__16, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1856, __pyx_L1_error)
20456 __Pyx_GOTREF(__pyx_t_1);
20457 __pyx_t_2 = __pyx_f_8PyClical_atan(__pyx_t_1, 0, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1856, __pyx_L1_error)
20458 __Pyx_GOTREF(__pyx_t_2);
20459 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20460 __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_float_8_0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1856, __pyx_L1_error)
20461 __Pyx_GOTREF(__pyx_t_1);
20462 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20463 if (PyDict_SetItem(__pyx_d, __pyx_n_s_tau, __pyx_t_1) < 0) __PYX_ERR(0, 1856, __pyx_L1_error)
20464 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20473 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_tau);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1857, __pyx_L1_error)
20474 __Pyx_GOTREF(__pyx_t_1);
20475 __pyx_t_2 = __Pyx_PyFloat_DivideObjC(__pyx_t_1, __pyx_float_2_0, 2.0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1857, __pyx_L1_error)
20476 __Pyx_GOTREF(__pyx_t_2);
20477 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20478 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pi, __pyx_t_2) < 0) __PYX_ERR(0, 1857, __pyx_L1_error)
20479 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20488 if (PyDict_SetItem(__pyx_d, __pyx_n_s_cl, ((PyObject *)__pyx_ptype_8PyClical_clifford)) < 0) __PYX_ERR(0, 1859, __pyx_L1_error)
20497 if (PyDict_SetItem(__pyx_d, __pyx_n_s_ist, ((PyObject *)__pyx_ptype_8PyClical_index_set)) < 0) __PYX_ERR(0, 1879, __pyx_L1_error)
20506 __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)
20507 __Pyx_GOTREF(__pyx_t_2);
20508 if (PyDict_SetItem(__pyx_d, __pyx_n_s_e, __pyx_t_2) < 0) __PYX_ERR(0, 1887, __pyx_L1_error)
20509 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20518 __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)
20519 __Pyx_GOTREF(__pyx_t_2);
20520 if (PyDict_SetItem(__pyx_d, __pyx_n_s_istpq, __pyx_t_2) < 0) __PYX_ERR(0, 1900, __pyx_L1_error)
20521 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20530 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_e);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1909, __pyx_L1_error)
20531 __Pyx_GOTREF(__pyx_t_2);
20532 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__21, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1909, __pyx_L1_error)
20533 __Pyx_GOTREF(__pyx_t_1);
20534 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20535 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_e);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1909, __pyx_L1_error)
20536 __Pyx_GOTREF(__pyx_t_2);
20537 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__22, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1909, __pyx_L1_error)
20538 __Pyx_GOTREF(__pyx_t_3);
20539 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20540 __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1909, __pyx_L1_error)
20541 __Pyx_GOTREF(__pyx_t_2);
20542 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20543 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20544 if (PyDict_SetItem(__pyx_d, __pyx_n_s_ninf3, __pyx_t_2) < 0) __PYX_ERR(0, 1909, __pyx_L1_error)
20545 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20554 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_e);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1910, __pyx_L1_error)
20555 __Pyx_GOTREF(__pyx_t_2);
20556 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__23, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1910, __pyx_L1_error)
20557 __Pyx_GOTREF(__pyx_t_3);
20558 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20559 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_e);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1910, __pyx_L1_error)
20560 __Pyx_GOTREF(__pyx_t_2);
20561 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__24, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1910, __pyx_L1_error)
20562 __Pyx_GOTREF(__pyx_t_1);
20563 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20564 __pyx_t_2 = PyNumber_Subtract(__pyx_t_3, __pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1910, __pyx_L1_error)
20565 __Pyx_GOTREF(__pyx_t_2);
20566 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20567 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20568 if (PyDict_SetItem(__pyx_d, __pyx_n_s_nbar3, __pyx_t_2) < 0) __PYX_ERR(0, 1910, __pyx_L1_error)
20569 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20578 __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)
20579 __Pyx_GOTREF(__pyx_t_2);
20580 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1913, __pyx_L1_error)
20581 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20589 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1917, __pyx_L1_error)
20590 __Pyx_GOTREF(__pyx_t_2);
20591 __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)
20592 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20600 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_test);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1918, __pyx_L1_error)
20601 __Pyx_GOTREF(__pyx_t_2);
20602 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1918, __pyx_L1_error)
20603 __Pyx_GOTREF(__pyx_t_1);
20604 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20605 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20620 __pyx_t_1 = __Pyx_PyDict_NewPresized(107);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
20621 __Pyx_GOTREF(__pyx_t_1);
20622 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)
20623 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)
20624 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)
20625 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)
20626 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)
20627 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)
20628 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)
20629 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)
20630 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)
20631 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)
20632 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)
20633 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)
20634 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)
20635 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)
20636 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)
20637 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)
20638 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)
20639 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)
20640 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)
20641 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)
20642 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)
20643 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)
20644 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)
20645 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)
20646 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)
20647 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)
20648 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)
20649 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)
20650 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)
20651 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)
20652 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)
20653 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)
20654 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)
20655 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)
20656 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)
20657 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)
20658 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)
20659 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)
20660 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)
20661 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)
20662 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)
20663 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)
20664 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)
20665 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)
20666 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)
20667 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)
20668 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)
20669 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)
20670 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)
20671 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)
20672 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)
20673 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)
20674 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)
20675 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)
20676 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)
20677 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)
20678 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)
20679 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)
20680 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)
20681 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)
20682 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)
20683 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)
20684 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)
20685 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)
20686 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)
20687 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)
20688 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)
20689 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)
20690 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)
20691 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)
20692 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)
20693 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)
20694 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)
20695 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)
20696 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)
20697 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)
20698 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)
20699 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)
20700 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)
20701 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)
20702 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)
20703 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)
20704 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)
20705 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)
20706 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)
20707 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)
20708 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)
20709 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)
20710 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)
20711 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)
20712 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)
20713 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)
20714 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)
20715 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)
20716 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)
20717 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)
20718 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)
20719 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)
20720 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)
20721 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)
20722 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)
20723 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)
20724 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)
20725 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)
20726 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)
20727 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)
20728 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)
20729 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_2, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20730 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20736 __Pyx_XDECREF(__pyx_t_1);
20737 __Pyx_XDECREF(__pyx_t_2);
20738 __Pyx_XDECREF(__pyx_t_3);
20741 __Pyx_AddTraceback(
"init PyClical", 0, __pyx_lineno, __pyx_filename);
20743 Py_DECREF(__pyx_m); __pyx_m = 0;
20744 }
else if (!PyErr_Occurred()) {
20745 PyErr_SetString(PyExc_ImportError,
"init PyClical");
20748 __Pyx_RefNannyFinishContext();
20749 #if CYTHON_PEP489_MULTI_PHASE_INIT 20750 return (__pyx_m != NULL) ? 0 : -1;
20751 #elif PY_MAJOR_VERSION >= 3 20760 #if CYTHON_REFNANNY 20761 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
20762 PyObject *m = NULL, *p = NULL;
20764 m = PyImport_ImportModule((
char *)modname);
20766 p = PyObject_GetAttrString(m, (
char *)
"RefNannyAPI");
20768 r = PyLong_AsVoidPtr(p);
20772 return (__Pyx_RefNannyAPIStruct *)r;
20777 #if CYTHON_USE_TYPE_SLOTS 20778 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject*
obj, PyObject* attr_name) {
20779 PyTypeObject* tp = Py_TYPE(
obj);
20780 if (likely(tp->tp_getattro))
20781 return tp->tp_getattro(
obj, attr_name);
20782 #if PY_MAJOR_VERSION < 3 20783 if (likely(tp->tp_getattr))
20784 return tp->tp_getattr(
obj, PyString_AS_STRING(attr_name));
20786 return PyObject_GetAttr(
obj, attr_name);
20791 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
20792 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
20793 if (unlikely(!result)) {
20794 PyErr_Format(PyExc_NameError,
20795 #
if PY_MAJOR_VERSION >= 3
20796 "name '%U' is not defined", name);
20798 "name '%.200s' is not defined", PyString_AS_STRING(name));
20805 #if CYTHON_FAST_PYCCALL 20806 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
20807 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
20808 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
20809 PyObject *
self = PyCFunction_GET_SELF(func);
20810 int flags = PyCFunction_GET_FLAGS(func);
20811 assert(PyCFunction_Check(func));
20812 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)));
20813 assert(nargs >= 0);
20814 assert(nargs == 0 || args != NULL);
20818 assert(!PyErr_Occurred());
20819 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
20820 return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (
self, args, nargs, NULL);
20822 return (*((__Pyx_PyCFunctionFast)meth)) (
self, args, nargs);
20828 #if CYTHON_FAST_PYCALL 20829 #include "frameobject.h" 20830 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
20831 PyObject *globals) {
20833 PyThreadState *tstate = __Pyx_PyThreadState_Current;
20834 PyObject **fastlocals;
20837 assert(globals != NULL);
20842 assert(tstate != NULL);
20843 f = PyFrame_New(tstate, co, globals, NULL);
20847 fastlocals = f->f_localsplus;
20848 for (
i = 0;
i < na;
i++) {
20850 fastlocals[
i] = *args++;
20852 result = PyEval_EvalFrameEx(f,0);
20853 ++tstate->recursion_depth;
20855 --tstate->recursion_depth;
20858 #if 1 || PY_VERSION_HEX < 0x030600B1 20859 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
int nargs, PyObject *kwargs) {
20860 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
20861 PyObject *globals = PyFunction_GET_GLOBALS(func);
20862 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
20864 #if PY_MAJOR_VERSION >= 3 20867 PyObject *kwtuple, **k;
20872 assert(kwargs == NULL || PyDict_Check(kwargs));
20873 nk = kwargs ? PyDict_Size(kwargs) : 0;
20874 if (Py_EnterRecursiveCall((
char*)
" while calling a Python object")) {
20878 #
if PY_MAJOR_VERSION >= 3
20879 co->co_kwonlyargcount == 0 &&
20881 likely(kwargs == NULL || nk == 0) &&
20882 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
20883 if (argdefs == NULL && co->co_argcount == nargs) {
20884 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
20887 else if (nargs == 0 && argdefs != NULL
20888 && co->co_argcount == Py_SIZE(argdefs)) {
20891 args = &PyTuple_GET_ITEM(argdefs, 0);
20892 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
20896 if (kwargs != NULL) {
20898 kwtuple = PyTuple_New(2 * nk);
20899 if (kwtuple == NULL) {
20903 k = &PyTuple_GET_ITEM(kwtuple, 0);
20905 while (PyDict_Next(kwargs, &pos, &k[
i], &k[
i+1])) {
20916 closure = PyFunction_GET_CLOSURE(func);
20917 #if PY_MAJOR_VERSION >= 3 20918 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
20920 if (argdefs != NULL) {
20921 d = &PyTuple_GET_ITEM(argdefs, 0);
20922 nd = Py_SIZE(argdefs);
20928 #if PY_MAJOR_VERSION >= 3 20929 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
20932 d, (
int)nd, kwdefs, closure);
20934 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
20937 d, (
int)nd, closure);
20939 Py_XDECREF(kwtuple);
20941 Py_LeaveRecursiveCall();
20948 #if CYTHON_COMPILING_IN_CPYTHON 20949 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
20951 ternaryfunc call = func->ob_type->tp_call;
20952 if (unlikely(!call))
20953 return PyObject_Call(func, arg, kw);
20954 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
20956 result = (*call)(func, arg, kw);
20957 Py_LeaveRecursiveCall();
20958 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
20961 "NULL result without error in PyObject_Call");
20968 #if CYTHON_COMPILING_IN_CPYTHON 20969 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
20970 PyObject *
self, *result;
20972 cfunc = PyCFunction_GET_FUNCTION(func);
20973 self = PyCFunction_GET_SELF(func);
20974 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
20976 result = cfunc(
self, arg);
20977 Py_LeaveRecursiveCall();
20978 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
20981 "NULL result without error in PyObject_Call");
20988 #if CYTHON_COMPILING_IN_CPYTHON 20989 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
20991 PyObject *args = PyTuple_New(1);
20992 if (unlikely(!args))
return NULL;
20994 PyTuple_SET_ITEM(args, 0, arg);
20995 result = __Pyx_PyObject_Call(func, args, NULL);
20999 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
21000 #if CYTHON_FAST_PYCALL 21001 if (PyFunction_Check(func)) {
21002 return __Pyx_PyFunction_FastCall(func, &arg, 1);
21005 if (likely(PyCFunction_Check(func))) {
21006 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
21007 return __Pyx_PyObject_CallMethO(func, arg);
21008 #if CYTHON_FAST_PYCCALL 21009 }
else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
21010 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
21014 return __Pyx__PyObject_CallOneArg(func, arg);
21017 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
21019 PyObject *args = PyTuple_Pack(1, arg);
21020 if (unlikely(!args))
return NULL;
21021 result = __Pyx_PyObject_Call(func, args, NULL);
21028 #if CYTHON_FAST_THREAD_STATE 21029 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
21030 PyObject *tmp_type, *tmp_value, *tmp_tb;
21031 tmp_type = tstate->curexc_type;
21032 tmp_value = tstate->curexc_value;
21033 tmp_tb = tstate->curexc_traceback;
21034 tstate->curexc_type = type;
21035 tstate->curexc_value = value;
21036 tstate->curexc_traceback = tb;
21037 Py_XDECREF(tmp_type);
21038 Py_XDECREF(tmp_value);
21039 Py_XDECREF(tmp_tb);
21041 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
21042 *type = tstate->curexc_type;
21043 *value = tstate->curexc_value;
21044 *tb = tstate->curexc_traceback;
21045 tstate->curexc_type = 0;
21046 tstate->curexc_value = 0;
21047 tstate->curexc_traceback = 0;
21052 static void __Pyx_WriteUnraisable(
const char *name, CYTHON_UNUSED
int clineno,
21053 CYTHON_UNUSED
int lineno, CYTHON_UNUSED
const char *filename,
21054 int full_traceback, CYTHON_UNUSED
int nogil) {
21055 PyObject *old_exc, *old_val, *old_tb;
21057 __Pyx_PyThreadState_declare
21059 PyGILState_STATE state;
21061 state = PyGILState_Ensure();
21063 else state = (PyGILState_STATE)-1;
21066 __Pyx_PyThreadState_assign
21067 __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
21068 if (full_traceback) {
21069 Py_XINCREF(old_exc);
21070 Py_XINCREF(old_val);
21071 Py_XINCREF(old_tb);
21072 __Pyx_ErrRestore(old_exc, old_val, old_tb);
21075 #if PY_MAJOR_VERSION < 3 21076 ctx = PyString_FromString(name);
21078 ctx = PyUnicode_FromString(name);
21080 __Pyx_ErrRestore(old_exc, old_val, old_tb);
21082 PyErr_WriteUnraisable(Py_None);
21084 PyErr_WriteUnraisable(ctx);
21089 PyGILState_Release(state);
21094 #if CYTHON_COMPILING_IN_CPYTHON 21095 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
21096 #if CYTHON_FAST_PYCALL 21097 if (PyFunction_Check(func)) {
21098 return __Pyx_PyFunction_FastCall(func, NULL, 0);
21101 #ifdef __Pyx_CyFunction_USED 21102 if (likely(PyCFunction_Check(func) || __Pyx_TypeCheck(func, __pyx_CyFunctionType))) {
21104 if (likely(PyCFunction_Check(func))) {
21106 if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
21107 return __Pyx_PyObject_CallMethO(func, NULL);
21110 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
21115 static void __Pyx_RaiseDoubleKeywordsError(
21116 const char* func_name,
21119 PyErr_Format(PyExc_TypeError,
21120 #
if PY_MAJOR_VERSION >= 3
21121 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
21123 "%s() got multiple values for keyword argument '%s'", func_name,
21124 PyString_AsString(kw_name));
21129 static int __Pyx_ParseOptionalKeywords(
21131 PyObject **argnames[],
21133 PyObject *values[],
21134 Py_ssize_t num_pos_args,
21135 const char* function_name)
21137 PyObject *key = 0, *value = 0;
21138 Py_ssize_t pos = 0;
21140 PyObject*** first_kw_arg = argnames + num_pos_args;
21141 while (PyDict_Next(kwds, &pos, &key, &value)) {
21142 name = first_kw_arg;
21143 while (*name && (**name != key)) name++;
21145 values[name-argnames] = value;
21148 name = first_kw_arg;
21149 #if PY_MAJOR_VERSION < 3 21150 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
21152 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
21153 && _PyString_Eq(**name, key)) {
21154 values[name-argnames] = value;
21159 if (*name)
continue;
21161 PyObject*** argname = argnames;
21162 while (argname != first_kw_arg) {
21163 if ((**argname == key) || (
21164 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
21165 && _PyString_Eq(**argname, key))) {
21166 goto arg_passed_twice;
21173 if (likely(PyUnicode_Check(key))) {
21175 int cmp = (**name == key) ? 0 :
21176 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
21177 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
21179 PyUnicode_Compare(**name, key);
21180 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
21182 values[name-argnames] = value;
21187 if (*name)
continue;
21189 PyObject*** argname = argnames;
21190 while (argname != first_kw_arg) {
21191 int cmp = (**argname == key) ? 0 :
21192 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
21193 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
21195 PyUnicode_Compare(**argname, key);
21196 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
21197 if (cmp == 0)
goto arg_passed_twice;
21202 goto invalid_keyword_type;
21204 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
21206 goto invalid_keyword;
21211 __Pyx_RaiseDoubleKeywordsError(function_name, key);
21213 invalid_keyword_type:
21214 PyErr_Format(PyExc_TypeError,
21215 "%.200s() keywords must be strings", function_name);
21218 PyErr_Format(PyExc_TypeError,
21219 #
if PY_MAJOR_VERSION < 3
21220 "%.200s() got an unexpected keyword argument '%.200s'",
21221 function_name, PyString_AsString(key));
21223 "%s() got an unexpected keyword argument '%U'",
21224 function_name, key);
21231 static void __Pyx_RaiseArgtupleInvalid(
21232 const char* func_name,
21234 Py_ssize_t num_min,
21235 Py_ssize_t num_max,
21236 Py_ssize_t num_found)
21238 Py_ssize_t num_expected;
21239 const char *more_or_less;
21240 if (num_found < num_min) {
21241 num_expected = num_min;
21242 more_or_less =
"at least";
21244 num_expected = num_max;
21245 more_or_less =
"at most";
21248 more_or_less =
"exactly";
21250 PyErr_Format(PyExc_TypeError,
21251 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
21252 func_name, more_or_less, num_expected,
21253 (num_expected == 1) ?
"" :
"s", num_found);
21257 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
21259 #if !CYTHON_AVOID_BORROWED_REFS 21260 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 21261 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
21262 if (likely(result)) {
21264 }
else if (unlikely(PyErr_Occurred())) {
21268 result = PyDict_GetItem(__pyx_d, name);
21269 if (likely(result)) {
21274 result = PyObject_GetItem(__pyx_d, name);
21278 result = __Pyx_GetBuiltinName(name);
21284 #if CYTHON_FAST_THREAD_STATE 21285 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
21286 #if PY_VERSION_HEX >= 0x030700A2 21287 *type = tstate->exc_state.exc_type;
21288 *value = tstate->exc_state.exc_value;
21289 *tb = tstate->exc_state.exc_traceback;
21291 *type = tstate->exc_type;
21292 *value = tstate->exc_value;
21293 *tb = tstate->exc_traceback;
21296 Py_XINCREF(*value);
21299 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
21300 PyObject *tmp_type, *tmp_value, *tmp_tb;
21301 #if PY_VERSION_HEX >= 0x030700A2 21302 tmp_type = tstate->exc_state.exc_type;
21303 tmp_value = tstate->exc_state.exc_value;
21304 tmp_tb = tstate->exc_state.exc_traceback;
21305 tstate->exc_state.exc_type = type;
21306 tstate->exc_state.exc_value = value;
21307 tstate->exc_state.exc_traceback = tb;
21309 tmp_type = tstate->exc_type;
21310 tmp_value = tstate->exc_value;
21311 tmp_tb = tstate->exc_traceback;
21312 tstate->exc_type = type;
21313 tstate->exc_value = value;
21314 tstate->exc_traceback = tb;
21316 Py_XDECREF(tmp_type);
21317 Py_XDECREF(tmp_value);
21318 Py_XDECREF(tmp_tb);
21323 #if CYTHON_FAST_THREAD_STATE 21324 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
21326 n = PyTuple_GET_SIZE(tuple);
21327 #if PY_MAJOR_VERSION >= 3 21328 for (
i=0;
i<n;
i++) {
21329 if (exc_type == PyTuple_GET_ITEM(tuple,
i))
return 1;
21332 for (
i=0;
i<n;
i++) {
21333 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple,
i)))
return 1;
21337 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
21338 PyObject *exc_type = tstate->curexc_type;
21339 if (exc_type == err)
return 1;
21340 if (unlikely(!exc_type))
return 0;
21341 if (unlikely(PyTuple_Check(err)))
21342 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
21343 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
21348 #if CYTHON_FAST_THREAD_STATE 21349 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
21351 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
21353 PyObject *local_type, *local_value, *local_tb;
21354 #if CYTHON_FAST_THREAD_STATE 21355 PyObject *tmp_type, *tmp_value, *tmp_tb;
21356 local_type = tstate->curexc_type;
21357 local_value = tstate->curexc_value;
21358 local_tb = tstate->curexc_traceback;
21359 tstate->curexc_type = 0;
21360 tstate->curexc_value = 0;
21361 tstate->curexc_traceback = 0;
21363 PyErr_Fetch(&local_type, &local_value, &local_tb);
21365 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
21366 #if CYTHON_FAST_THREAD_STATE 21367 if (unlikely(tstate->curexc_type))
21369 if (unlikely(PyErr_Occurred()))
21372 #if PY_MAJOR_VERSION >= 3 21374 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
21378 Py_XINCREF(local_tb);
21379 Py_XINCREF(local_type);
21380 Py_XINCREF(local_value);
21381 *type = local_type;
21382 *value = local_value;
21384 #if CYTHON_FAST_THREAD_STATE 21385 #if PY_VERSION_HEX >= 0x030700A2 21386 tmp_type = tstate->exc_state.exc_type;
21387 tmp_value = tstate->exc_state.exc_value;
21388 tmp_tb = tstate->exc_state.exc_traceback;
21389 tstate->exc_state.exc_type = local_type;
21390 tstate->exc_state.exc_value = local_value;
21391 tstate->exc_state.exc_traceback = local_tb;
21393 tmp_type = tstate->exc_type;
21394 tmp_value = tstate->exc_value;
21395 tmp_tb = tstate->exc_traceback;
21396 tstate->exc_type = local_type;
21397 tstate->exc_value = local_value;
21398 tstate->exc_traceback = local_tb;
21400 Py_XDECREF(tmp_type);
21401 Py_XDECREF(tmp_value);
21402 Py_XDECREF(tmp_tb);
21404 PyErr_SetExcInfo(local_type, local_value, local_tb);
21411 Py_XDECREF(local_type);
21412 Py_XDECREF(local_value);
21413 Py_XDECREF(local_tb);
21418 #if PY_MAJOR_VERSION < 3 21419 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
21420 CYTHON_UNUSED PyObject *cause) {
21421 __Pyx_PyThreadState_declare
21423 if (!value || value == Py_None)
21427 if (!tb || tb == Py_None)
21431 if (!PyTraceBack_Check(tb)) {
21432 PyErr_SetString(PyExc_TypeError,
21433 "raise: arg 3 must be a traceback or None");
21437 if (PyType_Check(type)) {
21438 #if CYTHON_COMPILING_IN_PYPY 21440 Py_INCREF(Py_None);
21444 PyErr_NormalizeException(&type, &value, &tb);
21447 PyErr_SetString(PyExc_TypeError,
21448 "instance exception may not have a separate value");
21452 type = (PyObject*) Py_TYPE(type);
21454 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
21455 PyErr_SetString(PyExc_TypeError,
21456 "raise: exception class must be a subclass of BaseException");
21460 __Pyx_PyThreadState_assign
21461 __Pyx_ErrRestore(type, value, tb);
21470 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
21471 PyObject* owned_instance = NULL;
21472 if (tb == Py_None) {
21474 }
else if (tb && !PyTraceBack_Check(tb)) {
21475 PyErr_SetString(PyExc_TypeError,
21476 "raise: arg 3 must be a traceback or None");
21479 if (value == Py_None)
21481 if (PyExceptionInstance_Check(type)) {
21483 PyErr_SetString(PyExc_TypeError,
21484 "instance exception may not have a separate value");
21488 type = (PyObject*) Py_TYPE(value);
21489 }
else if (PyExceptionClass_Check(type)) {
21490 PyObject *instance_class = NULL;
21491 if (value && PyExceptionInstance_Check(value)) {
21492 instance_class = (PyObject*) Py_TYPE(value);
21493 if (instance_class != type) {
21494 int is_subclass = PyObject_IsSubclass(instance_class, type);
21495 if (!is_subclass) {
21496 instance_class = NULL;
21497 }
else if (unlikely(is_subclass == -1)) {
21500 type = instance_class;
21504 if (!instance_class) {
21507 args = PyTuple_New(0);
21508 else if (PyTuple_Check(value)) {
21512 args = PyTuple_Pack(1, value);
21515 owned_instance = PyObject_Call(type, args, NULL);
21517 if (!owned_instance)
21519 value = owned_instance;
21520 if (!PyExceptionInstance_Check(value)) {
21521 PyErr_Format(PyExc_TypeError,
21522 "calling %R should have returned an instance of " 21523 "BaseException, not %R",
21524 type, Py_TYPE(value));
21529 PyErr_SetString(PyExc_TypeError,
21530 "raise: exception class must be a subclass of BaseException");
21534 PyObject *fixed_cause;
21535 if (cause == Py_None) {
21536 fixed_cause = NULL;
21537 }
else if (PyExceptionClass_Check(cause)) {
21538 fixed_cause = PyObject_CallObject(cause, NULL);
21539 if (fixed_cause == NULL)
21541 }
else if (PyExceptionInstance_Check(cause)) {
21542 fixed_cause = cause;
21543 Py_INCREF(fixed_cause);
21545 PyErr_SetString(PyExc_TypeError,
21546 "exception causes must derive from " 21550 PyException_SetCause(value, fixed_cause);
21552 PyErr_SetObject(type, value);
21554 #if CYTHON_COMPILING_IN_PYPY 21555 PyObject *tmp_type, *tmp_value, *tmp_tb;
21556 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
21558 PyErr_Restore(tmp_type, tmp_value, tb);
21559 Py_XDECREF(tmp_tb);
21561 PyThreadState *tstate = __Pyx_PyThreadState_Current;
21562 PyObject* tmp_tb = tstate->curexc_traceback;
21563 if (tb != tmp_tb) {
21565 tstate->curexc_traceback = tb;
21566 Py_XDECREF(tmp_tb);
21571 Py_XDECREF(owned_instance);
21577 #if !CYTHON_COMPILING_IN_PYPY 21578 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
long intval, CYTHON_UNUSED
int inplace) {
21579 #if PY_MAJOR_VERSION < 3 21580 if (likely(PyInt_CheckExact(op1))) {
21581 const long b = intval;
21583 long a = PyInt_AS_LONG(op1);
21584 x = (long)((
unsigned long)a + b);
21585 if (likely((x^a) >= 0 || (x^b) >= 0))
21586 return PyInt_FromLong(x);
21587 return PyLong_Type.tp_as_number->nb_add(op1, op2);
21590 #if CYTHON_USE_PYLONG_INTERNALS 21591 if (likely(PyLong_CheckExact(op1))) {
21592 const long b = intval;
21594 #ifdef HAVE_LONG_LONG 21595 const PY_LONG_LONG llb = intval;
21596 PY_LONG_LONG lla, llx;
21598 const digit* digits = ((PyLongObject*)op1)->ob_digit;
21599 const Py_ssize_t size = Py_SIZE(op1);
21600 if (likely(__Pyx_sst_abs(size) <= 1)) {
21601 a = likely(size) ? digits[0] : 0;
21602 if (size == -1) a = -a;
21606 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
21607 a = -(long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21609 #ifdef HAVE_LONG_LONG 21610 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
21611 lla = -(PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
21615 CYTHON_FALLTHROUGH;
21617 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
21618 a = (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21620 #ifdef HAVE_LONG_LONG 21621 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
21622 lla = (PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
21626 CYTHON_FALLTHROUGH;
21628 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
21629 a = -(long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21631 #ifdef HAVE_LONG_LONG 21632 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
21633 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]));
21637 CYTHON_FALLTHROUGH;
21639 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
21640 a = (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21642 #ifdef HAVE_LONG_LONG 21643 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
21644 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]));
21648 CYTHON_FALLTHROUGH;
21650 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
21651 a = -(long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21653 #ifdef HAVE_LONG_LONG 21654 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
21655 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]));
21659 CYTHON_FALLTHROUGH;
21661 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
21662 a = (long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21664 #ifdef HAVE_LONG_LONG 21665 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
21666 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]));
21670 CYTHON_FALLTHROUGH;
21671 default:
return PyLong_Type.tp_as_number->nb_add(op1, op2);
21675 return PyLong_FromLong(x);
21676 #ifdef HAVE_LONG_LONG 21679 return PyLong_FromLongLong(llx);
21685 if (PyFloat_CheckExact(op1)) {
21686 const long b = intval;
21687 double a = PyFloat_AS_DOUBLE(op1);
21689 PyFPE_START_PROTECT(
"add",
return NULL)
21690 result = ((double)a) + (double)b;
21691 PyFPE_END_PROTECT(result)
21694 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
21699 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
21702 r = PyObject_SetItem(o, j, v);
21706 static CYTHON_INLINE
int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t
i, PyObject *v,
int is_list,
21707 CYTHON_NCP_UNUSED
int wraparound, CYTHON_NCP_UNUSED
int boundscheck) {
21708 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS 21709 if (is_list || PyList_CheckExact(o)) {
21710 Py_ssize_t n = (!wraparound) ?
i : ((likely(
i >= 0)) ?
i :
i + PyList_GET_SIZE(o));
21711 if ((!boundscheck) || likely((n >= 0) & (n < PyList_GET_SIZE(o)))) {
21712 PyObject* old = PyList_GET_ITEM(o, n);
21714 PyList_SET_ITEM(o, n, v);
21719 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
21720 if (likely(m && m->sq_ass_item)) {
21721 if (wraparound && unlikely(
i < 0) && likely(m->sq_length)) {
21722 Py_ssize_t l = m->sq_length(o);
21723 if (likely(l >= 0)) {
21726 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
21731 return m->sq_ass_item(o,
i, v);
21735 #if CYTHON_COMPILING_IN_PYPY 21736 if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) {
21738 if (is_list || PySequence_Check(o)) {
21740 return PySequence_SetItem(o,
i, v);
21743 return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(
i), v);
21747 static int __Pyx__ArgTypeTest(PyObject *
obj, PyTypeObject *type,
const char *name,
int exact)
21749 if (unlikely(!type)) {
21750 PyErr_SetString(PyExc_SystemError,
"Missing type object");
21754 #if PY_MAJOR_VERSION == 2 21755 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(
obj)))
return 1;
21759 if (likely(__Pyx_TypeCheck(
obj, type)))
return 1;
21761 PyErr_Format(PyExc_TypeError,
21762 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
21763 name, type->tp_name, Py_TYPE(
obj)->tp_name);
21768 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level) {
21769 PyObject *empty_list = 0;
21770 PyObject *module = 0;
21771 PyObject *global_dict = 0;
21772 PyObject *empty_dict = 0;
21774 #if PY_MAJOR_VERSION < 3 21775 PyObject *py_import;
21776 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
21783 empty_list = PyList_New(0);
21788 global_dict = PyModule_GetDict(__pyx_m);
21791 empty_dict = PyDict_New();
21795 #if PY_MAJOR_VERSION >= 3 21797 if (strchr(__Pyx_MODULE_NAME,
'.')) {
21798 module = PyImport_ImportModuleLevelObject(
21799 name, global_dict, empty_dict, list, 1);
21801 if (!PyErr_ExceptionMatches(PyExc_ImportError))
21810 #if PY_MAJOR_VERSION < 3 21811 PyObject *py_level = PyInt_FromLong(level);
21814 module = PyObject_CallFunctionObjArgs(py_import,
21815 name, global_dict, empty_dict, list, py_level, NULL);
21816 Py_DECREF(py_level);
21818 module = PyImport_ImportModuleLevelObject(
21819 name, global_dict, empty_dict, list, level);
21824 #if PY_MAJOR_VERSION < 3 21825 Py_XDECREF(py_import);
21827 Py_XDECREF(empty_list);
21828 Py_XDECREF(empty_dict);
21833 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 21834 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
21835 PyErr_Format(PyExc_AttributeError,
21836 #
if PY_MAJOR_VERSION >= 3
21837 "'%.50s' object has no attribute '%U'",
21838 tp->tp_name, attr_name);
21840 "'%.50s' object has no attribute '%.400s'",
21841 tp->tp_name, PyString_AS_STRING(attr_name));
21845 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject*
obj, PyObject* attr_name) {
21847 PyTypeObject *tp = Py_TYPE(
obj);
21848 if (unlikely(!PyString_Check(attr_name))) {
21849 return PyObject_GenericGetAttr(
obj, attr_name);
21851 assert(!tp->tp_dictoffset);
21852 descr = _PyType_Lookup(tp, attr_name);
21853 if (unlikely(!descr)) {
21854 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
21857 #if PY_MAJOR_VERSION < 3 21858 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
21861 descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
21863 PyObject *res = f(descr,
obj, (PyObject *)tp);
21873 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 21874 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject*
obj, PyObject* attr_name) {
21875 if (unlikely(Py_TYPE(
obj)->tp_dictoffset)) {
21876 return PyObject_GenericGetAttr(
obj, attr_name);
21878 return __Pyx_PyObject_GenericGetAttrNoDict(
obj, attr_name);
21883 static int __Pyx_SetVtable(PyObject *dict,
void *vtable) {
21884 #if PY_VERSION_HEX >= 0x02070000 21885 PyObject *ob = PyCapsule_New(vtable, 0, 0);
21887 PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
21891 if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
21901 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
21903 PyObject *name_attr;
21904 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name);
21905 if (likely(name_attr)) {
21906 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
21910 if (unlikely(ret < 0)) {
21914 Py_XDECREF(name_attr);
21917 static int __Pyx_setup_reduce(PyObject* type_obj) {
21919 PyObject *object_reduce = NULL;
21920 PyObject *object_reduce_ex = NULL;
21921 PyObject *reduce = NULL;
21922 PyObject *reduce_ex = NULL;
21923 PyObject *reduce_cython = NULL;
21924 PyObject *setstate = NULL;
21925 PyObject *setstate_cython = NULL;
21926 #if CYTHON_USE_PYTYPE_LOOKUP 21927 if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate))
goto GOOD;
21929 if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate))
goto GOOD;
21931 #if CYTHON_USE_PYTYPE_LOOKUP 21932 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto BAD;
21934 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto BAD;
21936 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex);
if (unlikely(!reduce_ex))
goto BAD;
21937 if (reduce_ex == object_reduce_ex) {
21938 #if CYTHON_USE_PYTYPE_LOOKUP 21939 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto BAD;
21941 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto BAD;
21943 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce);
if (unlikely(!reduce))
goto BAD;
21944 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
21945 reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython);
if (unlikely(!reduce_cython))
goto BAD;
21946 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython);
if (unlikely(ret < 0))
goto BAD;
21947 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython);
if (unlikely(ret < 0))
goto BAD;
21948 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
21949 if (!setstate) PyErr_Clear();
21950 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
21951 setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython);
if (unlikely(!setstate_cython))
goto BAD;
21952 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython);
if (unlikely(ret < 0))
goto BAD;
21953 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython);
if (unlikely(ret < 0))
goto BAD;
21955 PyType_Modified((PyTypeObject*)type_obj);
21960 if (!PyErr_Occurred())
21961 PyErr_Format(PyExc_RuntimeError,
"Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
21964 #if !CYTHON_USE_PYTYPE_LOOKUP 21965 Py_XDECREF(object_reduce);
21966 Py_XDECREF(object_reduce_ex);
21968 Py_XDECREF(reduce);
21969 Py_XDECREF(reduce_ex);
21970 Py_XDECREF(reduce_cython);
21971 Py_XDECREF(setstate);
21972 Py_XDECREF(setstate_cython);
21977 #if !CYTHON_COMPILING_IN_PYPY 21978 static PyObject* __Pyx_PyFloat_DivideObjC(PyObject *op1, PyObject *op2,
double floatval, CYTHON_UNUSED
int inplace) {
21979 const double b = floatval;
21981 if (likely(PyFloat_CheckExact(op1))) {
21982 a = PyFloat_AS_DOUBLE(op1);
21984 #if PY_MAJOR_VERSION < 3 21985 if (likely(PyInt_CheckExact(op1))) {
21986 a = (double) PyInt_AS_LONG(op1);
21989 if (likely(PyLong_CheckExact(op1))) {
21990 #if CYTHON_USE_PYLONG_INTERNALS 21991 const digit* digits = ((PyLongObject*)op1)->ob_digit;
21992 const Py_ssize_t size = Py_SIZE(op1);
21994 case 0: a = 0.0;
break;
21995 case -1: a = -(double) digits[0];
break;
21996 case 1: a = (double) digits[0];
break;
21999 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
22000 a = (double) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
22001 if ((8 *
sizeof(
unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
22007 CYTHON_FALLTHROUGH;
22010 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
22011 a = (double) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
22012 if ((8 *
sizeof(
unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
22018 CYTHON_FALLTHROUGH;
22021 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
22022 a = (double) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
22023 if ((8 *
sizeof(
unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
22029 CYTHON_FALLTHROUGH;
22034 a = PyLong_AsDouble(op1);
22035 if (unlikely(a == -1.0 && PyErr_Occurred()))
return NULL;
22038 return (inplace ? __Pyx_PyNumber_InPlaceDivide(op1, op2) : __Pyx_PyNumber_Divide(op1, op2));
22040 PyFPE_START_PROTECT(
"divide",
return NULL)
22042 PyFPE_END_PROTECT(result)
22048 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals) {
22049 #if CYTHON_COMPILING_IN_PYPY 22050 return PyObject_RichCompareBool(s1, s2, equals);
22053 return (equals == Py_EQ);
22054 }
else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
22055 const char *ps1, *ps2;
22056 Py_ssize_t length = PyBytes_GET_SIZE(s1);
22057 if (length != PyBytes_GET_SIZE(s2))
22058 return (equals == Py_NE);
22059 ps1 = PyBytes_AS_STRING(s1);
22060 ps2 = PyBytes_AS_STRING(s2);
22061 if (ps1[0] != ps2[0]) {
22062 return (equals == Py_NE);
22063 }
else if (length == 1) {
22064 return (equals == Py_EQ);
22067 #if CYTHON_USE_UNICODE_INTERNALS 22068 Py_hash_t hash1, hash2;
22069 hash1 = ((PyBytesObject*)s1)->ob_shash;
22070 hash2 = ((PyBytesObject*)s2)->ob_shash;
22071 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
22072 return (equals == Py_NE);
22075 result = memcmp(ps1, ps2, (
size_t)length);
22076 return (equals == Py_EQ) ? (result == 0) : (result != 0);
22078 }
else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
22079 return (equals == Py_NE);
22080 }
else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
22081 return (equals == Py_NE);
22084 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
22087 result = __Pyx_PyObject_IsTrue(py_result);
22088 Py_DECREF(py_result);
22095 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals) {
22096 #if CYTHON_COMPILING_IN_PYPY 22097 return PyObject_RichCompareBool(s1, s2, equals);
22099 #if PY_MAJOR_VERSION < 3 22100 PyObject* owned_ref = NULL;
22102 int s1_is_unicode, s2_is_unicode;
22106 s1_is_unicode = PyUnicode_CheckExact(s1);
22107 s2_is_unicode = PyUnicode_CheckExact(s2);
22108 #if PY_MAJOR_VERSION < 3 22109 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
22110 owned_ref = PyUnicode_FromObject(s2);
22111 if (unlikely(!owned_ref))
22115 }
else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
22116 owned_ref = PyUnicode_FromObject(s1);
22117 if (unlikely(!owned_ref))
22121 }
else if (((!s2_is_unicode) & (!s1_is_unicode))) {
22122 return __Pyx_PyBytes_Equals(s1, s2, equals);
22125 if (s1_is_unicode & s2_is_unicode) {
22128 void *data1, *data2;
22129 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
22131 length = __Pyx_PyUnicode_GET_LENGTH(s1);
22132 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
22135 #if CYTHON_USE_UNICODE_INTERNALS 22137 Py_hash_t hash1, hash2;
22138 #if CYTHON_PEP393_ENABLED 22139 hash1 = ((PyASCIIObject*)s1)->hash;
22140 hash2 = ((PyASCIIObject*)s2)->hash;
22142 hash1 = ((PyUnicodeObject*)s1)->hash;
22143 hash2 = ((PyUnicodeObject*)s2)->hash;
22145 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
22150 kind = __Pyx_PyUnicode_KIND(s1);
22151 if (kind != __Pyx_PyUnicode_KIND(s2)) {
22154 data1 = __Pyx_PyUnicode_DATA(s1);
22155 data2 = __Pyx_PyUnicode_DATA(s2);
22156 if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
22158 }
else if (length == 1) {
22161 int result = memcmp(data1, data2, (
size_t)(length * kind));
22162 #if PY_MAJOR_VERSION < 3 22163 Py_XDECREF(owned_ref);
22165 return (equals == Py_EQ) ? (result == 0) : (result != 0);
22167 }
else if ((s1 == Py_None) & s2_is_unicode) {
22169 }
else if ((s2 == Py_None) & s1_is_unicode) {
22173 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
22176 result = __Pyx_PyObject_IsTrue(py_result);
22177 Py_DECREF(py_result);
22181 #if PY_MAJOR_VERSION < 3 22182 Py_XDECREF(owned_ref);
22184 return (equals == Py_EQ);
22186 #if PY_MAJOR_VERSION < 3 22187 Py_XDECREF(owned_ref);
22189 return (equals == Py_NE);
22194 #ifndef CYTHON_CLINE_IN_TRACEBACK 22195 static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate,
int c_line) {
22196 PyObject *use_cline;
22197 PyObject *ptype, *pvalue, *ptraceback;
22198 #if CYTHON_COMPILING_IN_CPYTHON 22199 PyObject **cython_runtime_dict;
22201 if (unlikely(!__pyx_cython_runtime)) {
22204 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
22205 #if CYTHON_COMPILING_IN_CPYTHON 22206 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
22207 if (likely(cython_runtime_dict)) {
22208 use_cline = __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback);
22212 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
22213 if (use_cline_obj) {
22214 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
22215 Py_DECREF(use_cline_obj);
22223 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
22225 else if (PyObject_Not(use_cline) != 0) {
22228 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
22234 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
22235 int start = 0, mid = 0, end = count - 1;
22236 if (end >= 0 && code_line > entries[end].code_line) {
22239 while (start < end) {
22240 mid = start + (end - start) / 2;
22241 if (code_line < entries[mid].code_line) {
22243 }
else if (code_line > entries[mid].code_line) {
22249 if (code_line <= entries[mid].code_line) {
22255 static PyCodeObject *__pyx_find_code_object(
int code_line) {
22256 PyCodeObject* code_object;
22258 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
22261 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
22262 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
22265 code_object = __pyx_code_cache.entries[pos].code_object;
22266 Py_INCREF(code_object);
22267 return code_object;
22269 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
22271 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
22272 if (unlikely(!code_line)) {
22275 if (unlikely(!entries)) {
22276 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
22277 if (likely(entries)) {
22278 __pyx_code_cache.entries = entries;
22279 __pyx_code_cache.max_count = 64;
22280 __pyx_code_cache.count = 1;
22281 entries[0].code_line = code_line;
22282 entries[0].code_object = code_object;
22283 Py_INCREF(code_object);
22287 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
22288 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
22289 PyCodeObject* tmp = entries[pos].code_object;
22290 entries[pos].code_object = code_object;
22294 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
22295 int new_max = __pyx_code_cache.max_count + 64;
22296 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
22297 __pyx_code_cache.entries, (
size_t)new_max*
sizeof(__Pyx_CodeObjectCacheEntry));
22298 if (unlikely(!entries)) {
22301 __pyx_code_cache.entries = entries;
22302 __pyx_code_cache.max_count = new_max;
22304 for (
i=__pyx_code_cache.count;
i>pos;
i--) {
22305 entries[
i] = entries[
i-1];
22307 entries[pos].code_line = code_line;
22308 entries[pos].code_object = code_object;
22309 __pyx_code_cache.count++;
22310 Py_INCREF(code_object);
22314 #include "compile.h" 22315 #include "frameobject.h" 22316 #include "traceback.h" 22317 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
22318 const char *funcname,
int c_line,
22319 int py_line,
const char *filename) {
22320 PyCodeObject *py_code = 0;
22321 PyObject *py_srcfile = 0;
22322 PyObject *py_funcname = 0;
22323 #if PY_MAJOR_VERSION < 3 22324 py_srcfile = PyString_FromString(filename);
22326 py_srcfile = PyUnicode_FromString(filename);
22328 if (!py_srcfile)
goto bad;
22330 #if PY_MAJOR_VERSION < 3 22331 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
22333 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
22337 #if PY_MAJOR_VERSION < 3 22338 py_funcname = PyString_FromString(funcname);
22340 py_funcname = PyUnicode_FromString(funcname);
22343 if (!py_funcname)
goto bad;
22344 py_code = __Pyx_PyCode_New(
22361 Py_DECREF(py_srcfile);
22362 Py_DECREF(py_funcname);
22365 Py_XDECREF(py_srcfile);
22366 Py_XDECREF(py_funcname);
22369 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
22370 int py_line,
const char *filename) {
22371 PyCodeObject *py_code = 0;
22372 PyFrameObject *py_frame = 0;
22373 PyThreadState *tstate = __Pyx_PyThreadState_Current;
22375 c_line = __Pyx_CLineForTraceback(tstate, c_line);
22377 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
22379 py_code = __Pyx_CreateCodeObjectForTraceback(
22380 funcname, c_line, py_line, filename);
22381 if (!py_code)
goto bad;
22382 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
22384 py_frame = PyFrame_New(
22390 if (!py_frame)
goto bad;
22391 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
22392 PyTraceBack_Here(py_frame);
22394 Py_XDECREF(py_code);
22395 Py_XDECREF(py_frame);
22399 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ 22400 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) 22401 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ 22402 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) 22403 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ 22405 func_type value = func_value;\ 22406 if (sizeof(target_type) < sizeof(func_type)) {\ 22407 if (unlikely(value != (func_type) (target_type) value)) {\ 22408 func_type zero = 0;\ 22409 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ 22410 return (target_type) -1;\ 22411 if (is_unsigned && unlikely(value < zero))\ 22412 goto raise_neg_overflow;\ 22414 goto raise_overflow;\ 22417 return (target_type) value;\ 22421 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value) {
22422 const int neg_one = (int) -1, const_zero = (
int) 0;
22423 const int is_unsigned = neg_one > const_zero;
22425 if (
sizeof(
int) <
sizeof(long)) {
22426 return PyInt_FromLong((
long) value);
22427 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
22428 return PyLong_FromUnsignedLong((
unsigned long) value);
22429 #ifdef HAVE_LONG_LONG 22430 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
22431 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
22435 if (
sizeof(
int) <=
sizeof(
long)) {
22436 return PyInt_FromLong((
long) value);
22437 #ifdef HAVE_LONG_LONG 22438 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
22439 return PyLong_FromLongLong((PY_LONG_LONG) value);
22444 int one = 1;
int little = (int)*(
unsigned char *)&one;
22445 unsigned char *bytes = (
unsigned char *)&value;
22446 return _PyLong_FromByteArray(bytes,
sizeof(
int),
22447 little, !is_unsigned);
22452 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *x) {
22453 const int neg_one = (int) -1, const_zero = (
int) 0;
22454 const int is_unsigned = neg_one > const_zero;
22455 #if PY_MAJOR_VERSION < 3 22456 if (likely(PyInt_Check(x))) {
22457 if (
sizeof(
int) <
sizeof(long)) {
22458 __PYX_VERIFY_RETURN_INT(
int,
long, PyInt_AS_LONG(x))
22460 long val = PyInt_AS_LONG(x);
22461 if (is_unsigned && unlikely(val < 0)) {
22462 goto raise_neg_overflow;
22468 if (likely(PyLong_Check(x))) {
22470 #if CYTHON_USE_PYLONG_INTERNALS 22471 const digit* digits = ((PyLongObject*)x)->ob_digit;
22472 switch (Py_SIZE(x)) {
22473 case 0:
return (
int) 0;
22474 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, digits[0])
22476 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
22477 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22478 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22479 }
else if (8 *
sizeof(
int) >= 2 * PyLong_SHIFT) {
22480 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
22485 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
22486 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22487 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22488 }
else if (8 *
sizeof(
int) >= 3 * PyLong_SHIFT) {
22489 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
22494 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
22495 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22496 __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])))
22497 }
else if (8 *
sizeof(
int) >= 4 * PyLong_SHIFT) {
22498 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
22504 #if CYTHON_COMPILING_IN_CPYTHON 22505 if (unlikely(Py_SIZE(x) < 0)) {
22506 goto raise_neg_overflow;
22510 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
22511 if (unlikely(result < 0))
22513 if (unlikely(result == 1))
22514 goto raise_neg_overflow;
22517 if (
sizeof(
int) <=
sizeof(
unsigned long)) {
22518 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
22519 #ifdef HAVE_LONG_LONG 22520 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
22521 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
22525 #if CYTHON_USE_PYLONG_INTERNALS 22526 const digit* digits = ((PyLongObject*)x)->ob_digit;
22527 switch (Py_SIZE(x)) {
22528 case 0:
return (
int) 0;
22529 case -1: __PYX_VERIFY_RETURN_INT(
int, sdigit, (sdigit) (-(sdigit)digits[0]))
22530 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, +digits[0])
22532 if (8 *
sizeof(
int) - 1 > 1 * PyLong_SHIFT) {
22533 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22534 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22535 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
22536 return (
int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
22541 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
22542 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22543 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22544 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
22545 return (
int) ((((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
22550 if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
22551 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22552 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22553 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
22554 return (
int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
22559 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
22560 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22561 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22562 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
22563 return (
int) ((((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
22568 if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
22569 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22570 __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])))
22571 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
22572 return (
int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
22577 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
22578 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22579 __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])))
22580 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
22581 return (
int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
22587 if (
sizeof(
int) <=
sizeof(long)) {
22588 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
22589 #ifdef HAVE_LONG_LONG 22590 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
22591 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
22596 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) 22597 PyErr_SetString(PyExc_RuntimeError,
22598 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
22601 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
22602 #if PY_MAJOR_VERSION < 3 22603 if (likely(v) && !PyLong_Check(v)) {
22605 v = PyNumber_Long(tmp);
22610 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
22611 unsigned char *bytes = (
unsigned char *)&val;
22612 int ret = _PyLong_AsByteArray((PyLongObject *)v,
22613 bytes,
sizeof(val),
22614 is_little, !is_unsigned);
22624 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
22625 if (!tmp)
return (
int) -1;
22626 val = __Pyx_PyInt_As_int(tmp);
22631 PyErr_SetString(PyExc_OverflowError,
22632 "value too large to convert to int");
22634 raise_neg_overflow:
22635 PyErr_SetString(PyExc_OverflowError,
22636 "can't convert negative value to int");
22641 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value) {
22642 const long neg_one = (long) -1, const_zero = (
long) 0;
22643 const int is_unsigned = neg_one > const_zero;
22645 if (
sizeof(
long) <
sizeof(long)) {
22646 return PyInt_FromLong((
long) value);
22647 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
22648 return PyLong_FromUnsignedLong((
unsigned long) value);
22649 #ifdef HAVE_LONG_LONG 22650 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
22651 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
22655 if (
sizeof(
long) <=
sizeof(
long)) {
22656 return PyInt_FromLong((
long) value);
22657 #ifdef HAVE_LONG_LONG 22658 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
22659 return PyLong_FromLongLong((PY_LONG_LONG) value);
22664 int one = 1;
int little = (int)*(
unsigned char *)&one;
22665 unsigned char *bytes = (
unsigned char *)&value;
22666 return _PyLong_FromByteArray(bytes,
sizeof(
long),
22667 little, !is_unsigned);
22672 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *x) {
22673 const long neg_one = (long) -1, const_zero = (
long) 0;
22674 const int is_unsigned = neg_one > const_zero;
22675 #if PY_MAJOR_VERSION < 3 22676 if (likely(PyInt_Check(x))) {
22677 if (
sizeof(
long) <
sizeof(long)) {
22678 __PYX_VERIFY_RETURN_INT(
long,
long, PyInt_AS_LONG(x))
22680 long val = PyInt_AS_LONG(x);
22681 if (is_unsigned && unlikely(val < 0)) {
22682 goto raise_neg_overflow;
22688 if (likely(PyLong_Check(x))) {
22690 #if CYTHON_USE_PYLONG_INTERNALS 22691 const digit* digits = ((PyLongObject*)x)->ob_digit;
22692 switch (Py_SIZE(x)) {
22693 case 0:
return (
long) 0;
22694 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, digits[0])
22696 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
22697 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22698 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22699 }
else if (8 *
sizeof(
long) >= 2 * PyLong_SHIFT) {
22700 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
22705 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
22706 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22707 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22708 }
else if (8 *
sizeof(
long) >= 3 * PyLong_SHIFT) {
22709 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
22714 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
22715 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22716 __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])))
22717 }
else if (8 *
sizeof(
long) >= 4 * PyLong_SHIFT) {
22718 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
22724 #if CYTHON_COMPILING_IN_CPYTHON 22725 if (unlikely(Py_SIZE(x) < 0)) {
22726 goto raise_neg_overflow;
22730 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
22731 if (unlikely(result < 0))
22733 if (unlikely(result == 1))
22734 goto raise_neg_overflow;
22737 if (
sizeof(
long) <=
sizeof(
unsigned long)) {
22738 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
22739 #ifdef HAVE_LONG_LONG 22740 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
22741 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
22745 #if CYTHON_USE_PYLONG_INTERNALS 22746 const digit* digits = ((PyLongObject*)x)->ob_digit;
22747 switch (Py_SIZE(x)) {
22748 case 0:
return (
long) 0;
22749 case -1: __PYX_VERIFY_RETURN_INT(
long, sdigit, (sdigit) (-(sdigit)digits[0]))
22750 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, +digits[0])
22752 if (8 *
sizeof(
long) - 1 > 1 * PyLong_SHIFT) {
22753 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22754 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22755 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
22756 return (
long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
22761 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
22762 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22763 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22764 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
22765 return (
long) ((((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
22770 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
22771 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22772 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22773 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
22774 return (
long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
22779 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
22780 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22781 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22782 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
22783 return (
long) ((((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
22788 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
22789 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22790 __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])))
22791 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
22792 return (
long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
22797 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
22798 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22799 __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])))
22800 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
22801 return (
long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
22807 if (
sizeof(
long) <=
sizeof(long)) {
22808 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
22809 #ifdef HAVE_LONG_LONG 22810 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
22811 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
22816 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) 22817 PyErr_SetString(PyExc_RuntimeError,
22818 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
22821 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
22822 #if PY_MAJOR_VERSION < 3 22823 if (likely(v) && !PyLong_Check(v)) {
22825 v = PyNumber_Long(tmp);
22830 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
22831 unsigned char *bytes = (
unsigned char *)&val;
22832 int ret = _PyLong_AsByteArray((PyLongObject *)v,
22833 bytes,
sizeof(val),
22834 is_little, !is_unsigned);
22844 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
22845 if (!tmp)
return (
long) -1;
22846 val = __Pyx_PyInt_As_long(tmp);
22851 PyErr_SetString(PyExc_OverflowError,
22852 "value too large to convert to long");
22854 raise_neg_overflow:
22855 PyErr_SetString(PyExc_OverflowError,
22856 "can't convert negative value to long");
22861 #if CYTHON_COMPILING_IN_CPYTHON 22862 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
22868 return b == &PyBaseObject_Type;
22870 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
22872 if (a == b)
return 1;
22876 n = PyTuple_GET_SIZE(mro);
22877 for (
i = 0;
i < n;
i++) {
22878 if (PyTuple_GET_ITEM(mro,
i) == (PyObject *)b)
22883 return __Pyx_InBases(a, b);
22885 #if PY_MAJOR_VERSION == 2 22886 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
22887 PyObject *exception, *value, *tb;
22889 __Pyx_PyThreadState_declare
22890 __Pyx_PyThreadState_assign
22891 __Pyx_ErrFetch(&exception, &value, &tb);
22892 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
22893 if (unlikely(res == -1)) {
22894 PyErr_WriteUnraisable(err);
22898 res = PyObject_IsSubclass(err, exc_type2);
22899 if (unlikely(res == -1)) {
22900 PyErr_WriteUnraisable(err);
22904 __Pyx_ErrRestore(exception, value, tb);
22908 static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
22909 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
22911 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
22916 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
22917 if (likely(err == exc_type))
return 1;
22918 if (likely(PyExceptionClass_Check(err))) {
22919 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
22921 return PyErr_GivenExceptionMatches(err, exc_type);
22923 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
22924 if (likely(err == exc_type1 || err == exc_type2))
return 1;
22925 if (likely(PyExceptionClass_Check(err))) {
22926 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
22928 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
22933 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
22934 PyObject* fake_module;
22935 PyTypeObject* cached_type = NULL;
22936 fake_module = PyImport_AddModule((
char*)
"_cython_" CYTHON_ABI);
22937 if (!fake_module)
return NULL;
22938 Py_INCREF(fake_module);
22939 cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
22941 if (!PyType_Check((PyObject*)cached_type)) {
22942 PyErr_Format(PyExc_TypeError,
22943 "Shared Cython type %.200s is not a type object",
22947 if (cached_type->tp_basicsize != type->tp_basicsize) {
22948 PyErr_Format(PyExc_TypeError,
22949 "Shared Cython type %.200s has the wrong size, try recompiling",
22954 if (!PyErr_ExceptionMatches(PyExc_AttributeError))
goto bad;
22956 if (PyType_Ready(type) < 0)
goto bad;
22957 if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
22960 cached_type = type;
22963 Py_DECREF(fake_module);
22964 return cached_type;
22966 Py_XDECREF(cached_type);
22967 cached_type = NULL;
22972 #if CYTHON_FAST_THREAD_STATE 22973 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
22974 PyObject *tmp_type, *tmp_value, *tmp_tb;
22975 #if PY_VERSION_HEX >= 0x030700A2 22976 tmp_type = tstate->exc_state.exc_type;
22977 tmp_value = tstate->exc_state.exc_value;
22978 tmp_tb = tstate->exc_state.exc_traceback;
22979 tstate->exc_state.exc_type = *type;
22980 tstate->exc_state.exc_value = *value;
22981 tstate->exc_state.exc_traceback = *tb;
22983 tmp_type = tstate->exc_type;
22984 tmp_value = tstate->exc_value;
22985 tmp_tb = tstate->exc_traceback;
22986 tstate->exc_type = *type;
22987 tstate->exc_value = *value;
22988 tstate->exc_traceback = *tb;
22991 *value = tmp_value;
22995 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
22996 PyObject *tmp_type, *tmp_value, *tmp_tb;
22997 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
22998 PyErr_SetExcInfo(*type, *value, *tb);
23000 *value = tmp_value;
23006 static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
23007 PyObject *result = NULL;
23008 #if CYTHON_UNPACK_METHODS 23009 if (likely(PyMethod_Check(method))) {
23010 PyObject *
self = PyMethod_GET_SELF(method);
23011 if (likely(
self)) {
23013 PyObject *
function = PyMethod_GET_FUNCTION(method);
23014 #if CYTHON_FAST_PYCALL 23015 if (PyFunction_Check(
function)) {
23016 PyObject *args[2] = {
self, arg};
23017 result = __Pyx_PyFunction_FastCall(
function, args, 2);
23021 #if CYTHON_FAST_PYCCALL 23022 if (__Pyx_PyFastCFunction_Check(
function)) {
23023 PyObject *args[2] = {
self, arg};
23024 result = __Pyx_PyCFunction_FastCall(
function, args, 2);
23028 args = PyTuple_New(2);
23029 if (unlikely(!args))
goto done;
23031 PyTuple_SET_ITEM(args, 0,
self);
23033 PyTuple_SET_ITEM(args, 1, arg);
23034 Py_INCREF(
function);
23035 result = __Pyx_PyObject_Call(
function, args, NULL);
23037 Py_DECREF(
function);
23042 result = __Pyx_PyObject_CallOneArg(method, arg);
23047 static PyObject* __Pyx_PyObject_CallMethod1(PyObject*
obj, PyObject* method_name, PyObject* arg) {
23048 PyObject *method, *result;
23049 method = __Pyx_PyObject_GetAttrStr(
obj, method_name);
23050 if (unlikely(!method))
return NULL;
23051 result = __Pyx__PyObject_CallMethod1(method, arg);
23057 #include <structmember.h> 23058 #include <frameobject.h> 23059 #define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom) 23060 static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) {
23061 PyObject *et, *ev, *tb;
23062 PyObject *value = NULL;
23063 __Pyx_ErrFetch(&et, &ev, &tb);
23067 Py_INCREF(Py_None);
23071 if (likely(et == PyExc_StopIteration)) {
23073 Py_INCREF(Py_None);
23076 #if PY_VERSION_HEX >= 0x030300A0 23077 else if (Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) {
23078 value = ((PyStopIterationObject *)ev)->value;
23083 else if (unlikely(PyTuple_Check(ev))) {
23084 if (PyTuple_GET_SIZE(ev) >= 1) {
23085 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 23086 value = PyTuple_GET_ITEM(ev, 0);
23089 value = PySequence_ITEM(ev, 0);
23092 Py_INCREF(Py_None);
23097 else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
23100 if (likely(value)) {
23106 }
else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
23107 __Pyx_ErrRestore(et, ev, tb);
23110 PyErr_NormalizeException(&et, &ev, &tb);
23111 if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
23112 __Pyx_ErrRestore(et, ev, tb);
23117 #if PY_VERSION_HEX >= 0x030300A0 23118 value = ((PyStopIterationObject *)ev)->value;
23123 PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args);
23125 if (likely(args)) {
23126 value = PySequence_GetItem(args, 0);
23129 if (unlikely(!value)) {
23130 __Pyx_ErrRestore(NULL, NULL, NULL);
23131 Py_INCREF(Py_None);
23139 static CYTHON_INLINE
23140 void __Pyx_Coroutine_ExceptionClear(__pyx_CoroutineObject *
self) {
23141 PyObject *exc_type =
self->exc_type;
23142 PyObject *exc_value =
self->exc_value;
23143 PyObject *exc_traceback =
self->exc_traceback;
23144 self->exc_type = NULL;
23145 self->exc_value = NULL;
23146 self->exc_traceback = NULL;
23147 Py_XDECREF(exc_type);
23148 Py_XDECREF(exc_value);
23149 Py_XDECREF(exc_traceback);
23151 #define __Pyx_Coroutine_AlreadyRunningError(gen) (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL) 23152 static void __Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject *gen) {
23155 #ifdef __Pyx_Coroutine_USED 23156 }
else if (__Pyx_Coroutine_Check((PyObject*)gen)) {
23157 msg =
"coroutine already executing";
23159 #ifdef __Pyx_AsyncGen_USED 23160 }
else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
23161 msg =
"async generator already executing";
23164 msg =
"generator already executing";
23166 PyErr_SetString(PyExc_ValueError, msg);
23168 #define __Pyx_Coroutine_NotStartedError(gen) (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL) 23169 static void __Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject *gen) {
23172 #ifdef __Pyx_Coroutine_USED 23173 }
else if (__Pyx_Coroutine_Check(gen)) {
23174 msg =
"can't send non-None value to a just-started coroutine";
23176 #ifdef __Pyx_AsyncGen_USED 23177 }
else if (__Pyx_AsyncGen_CheckExact(gen)) {
23178 msg =
"can't send non-None value to a just-started async generator";
23181 msg =
"can't send non-None value to a just-started generator";
23183 PyErr_SetString(PyExc_TypeError, msg);
23185 #define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing) (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL) 23186 static void __Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject *gen, PyObject *value, CYTHON_UNUSED
int closing) {
23187 #ifdef __Pyx_Coroutine_USED 23188 if (!closing && __Pyx_Coroutine_Check(gen)) {
23189 PyErr_SetString(PyExc_RuntimeError,
"cannot reuse already awaited coroutine");
23193 #ifdef __Pyx_AsyncGen_USED 23194 if (__Pyx_AsyncGen_CheckExact(gen))
23195 PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration);
23198 PyErr_SetNone(PyExc_StopIteration);
23202 PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *
self, PyObject *value,
int closing) {
23203 __Pyx_PyThreadState_declare
23204 PyThreadState *tstate;
23206 assert(!self->is_running);
23207 if (unlikely(self->resume_label == 0)) {
23208 if (unlikely(value && value != Py_None)) {
23209 return __Pyx_Coroutine_NotStartedError((PyObject*)
self);
23212 if (unlikely(self->resume_label == -1)) {
23213 return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)
self, value, closing);
23215 #if CYTHON_FAST_THREAD_STATE 23216 __Pyx_PyThreadState_assign
23217 tstate = __pyx_tstate;
23219 tstate = __Pyx_PyThreadState_Current;
23221 if (self->exc_type) {
23222 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON 23224 if (self->exc_traceback) {
23225 PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
23226 PyFrameObject *f = tb->tb_frame;
23227 Py_XINCREF(tstate->frame);
23228 assert(f->f_back == NULL);
23229 f->f_back = tstate->frame;
23232 __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value,
23233 &self->exc_traceback);
23235 __Pyx_Coroutine_ExceptionClear(
self);
23236 __Pyx_ExceptionSave(&self->exc_type, &self->exc_value, &self->exc_traceback);
23238 self->is_running = 1;
23239 retval =
self->body((PyObject *)
self, tstate, value);
23240 self->is_running = 0;
23243 static CYTHON_INLINE
void __Pyx_Coroutine_ResetFrameBackpointer(__pyx_CoroutineObject *
self) {
23244 if (likely(self->exc_traceback)) {
23245 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON 23247 PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
23248 PyFrameObject *f = tb->tb_frame;
23249 Py_CLEAR(f->f_back);
23253 static CYTHON_INLINE
23254 PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *retval) {
23255 if (unlikely(!retval)) {
23256 __Pyx_PyThreadState_declare
23257 __Pyx_PyThreadState_assign
23258 if (!__Pyx_PyErr_Occurred()) {
23259 PyObject *exc = PyExc_StopIteration;
23260 #ifdef __Pyx_AsyncGen_USED 23261 if (__Pyx_AsyncGen_CheckExact(gen))
23262 exc = __Pyx_PyExc_StopAsyncIteration;
23264 __Pyx_PyErr_SetNone(exc);
23269 static CYTHON_INLINE
23270 PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
23272 PyObject *val = NULL;
23273 __Pyx_Coroutine_Undelegate(gen);
23274 __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
23275 ret = __Pyx_Coroutine_SendEx(gen, val, 0);
23279 static PyObject *__Pyx_Coroutine_Send(PyObject *
self, PyObject *value) {
23281 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*)
self;
23282 PyObject *yf = gen->yieldfrom;
23283 if (unlikely(gen->is_running))
23284 return __Pyx_Coroutine_AlreadyRunningError(gen);
23287 gen->is_running = 1;
23288 #ifdef __Pyx_Generator_USED 23289 if (__Pyx_Generator_CheckExact(yf)) {
23290 ret = __Pyx_Coroutine_Send(yf, value);
23293 #ifdef __Pyx_Coroutine_USED 23294 if (__Pyx_Coroutine_Check(yf)) {
23295 ret = __Pyx_Coroutine_Send(yf, value);
23298 #ifdef __Pyx_AsyncGen_USED 23299 if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
23300 ret = __Pyx_async_gen_asend_send(yf, value);
23303 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) 23304 if (PyGen_CheckExact(yf)) {
23305 ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
23308 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) 23309 if (PyCoro_CheckExact(yf)) {
23310 ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
23314 if (value == Py_None)
23315 ret = Py_TYPE(yf)->tp_iternext(yf);
23317 ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
23319 gen->is_running = 0;
23323 retval = __Pyx_Coroutine_FinishDelegation(gen);
23325 retval = __Pyx_Coroutine_SendEx(gen, value, 0);
23327 return __Pyx_Coroutine_MethodReturn(
self, retval);
23329 static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
23330 PyObject *retval = NULL;
23332 #ifdef __Pyx_Generator_USED 23333 if (__Pyx_Generator_CheckExact(yf)) {
23334 retval = __Pyx_Coroutine_Close(yf);
23339 #ifdef __Pyx_Coroutine_USED 23340 if (__Pyx_Coroutine_Check(yf)) {
23341 retval = __Pyx_Coroutine_Close(yf);
23345 if (__Pyx_CoroutineAwait_CheckExact(yf)) {
23346 retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf);
23351 #ifdef __Pyx_AsyncGen_USED 23352 if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
23353 retval = __Pyx_async_gen_asend_close(yf, NULL);
23355 if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
23356 retval = __Pyx_async_gen_athrow_close(yf, NULL);
23361 gen->is_running = 1;
23362 meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close);
23363 if (unlikely(!meth)) {
23364 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
23365 PyErr_WriteUnraisable(yf);
23369 retval = PyObject_CallFunction(meth, NULL);
23374 gen->is_running = 0;
23376 Py_XDECREF(retval);
23379 static PyObject *__Pyx_Generator_Next(PyObject *
self) {
23380 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*)
self;
23381 PyObject *yf = gen->yieldfrom;
23382 if (unlikely(gen->is_running))
23383 return __Pyx_Coroutine_AlreadyRunningError(gen);
23386 gen->is_running = 1;
23387 #ifdef __Pyx_Generator_USED 23388 if (__Pyx_Generator_CheckExact(yf)) {
23389 ret = __Pyx_Generator_Next(yf);
23392 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) 23393 if (PyGen_CheckExact(yf)) {
23394 ret = _PyGen_Send((PyGenObject*)yf, NULL);
23397 #ifdef __Pyx_Coroutine_USED 23398 if (__Pyx_Coroutine_Check(yf)) {
23399 ret = __Pyx_Coroutine_Send(yf, Py_None);
23402 ret = Py_TYPE(yf)->tp_iternext(yf);
23403 gen->is_running = 0;
23407 return __Pyx_Coroutine_FinishDelegation(gen);
23409 return __Pyx_Coroutine_SendEx(gen, Py_None, 0);
23411 static PyObject *__Pyx_Coroutine_Close(PyObject *
self) {
23412 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
23413 PyObject *retval, *raised_exception;
23414 PyObject *yf = gen->yieldfrom;
23416 if (unlikely(gen->is_running))
23417 return __Pyx_Coroutine_AlreadyRunningError(gen);
23420 err = __Pyx_Coroutine_CloseIter(gen, yf);
23421 __Pyx_Coroutine_Undelegate(gen);
23425 PyErr_SetNone(PyExc_GeneratorExit);
23426 retval = __Pyx_Coroutine_SendEx(gen, NULL, 1);
23427 if (unlikely(retval)) {
23431 #ifdef __Pyx_Coroutine_USED 23432 }
else if (__Pyx_Coroutine_Check(
self)) {
23433 msg =
"coroutine ignored GeneratorExit";
23435 #ifdef __Pyx_AsyncGen_USED 23436 }
else if (__Pyx_AsyncGen_CheckExact(
self)) {
23437 #if PY_VERSION_HEX < 0x03060000 23438 msg =
"async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)";
23440 msg =
"async generator ignored GeneratorExit";
23444 msg =
"generator ignored GeneratorExit";
23446 PyErr_SetString(PyExc_RuntimeError, msg);
23449 raised_exception = PyErr_Occurred();
23450 if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) {
23451 if (raised_exception) PyErr_Clear();
23452 Py_INCREF(Py_None);
23457 static PyObject *__Pyx__Coroutine_Throw(PyObject *
self, PyObject *typ, PyObject *val, PyObject *tb,
23458 PyObject *args,
int close_on_genexit) {
23459 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
23460 PyObject *yf = gen->yieldfrom;
23461 if (unlikely(gen->is_running))
23462 return __Pyx_Coroutine_AlreadyRunningError(gen);
23466 if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
23467 int err = __Pyx_Coroutine_CloseIter(gen, yf);
23469 __Pyx_Coroutine_Undelegate(gen);
23471 return __Pyx_Coroutine_MethodReturn(
self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
23474 gen->is_running = 1;
23476 #ifdef __Pyx_Generator_USED
23477 || __Pyx_Generator_CheckExact(yf)
23479 #ifdef __Pyx_Coroutine_USED
23480 || __Pyx_Coroutine_Check(yf)
23483 ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
23484 #ifdef __Pyx_Coroutine_USED 23485 }
else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
23486 ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
23489 PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw);
23490 if (unlikely(!meth)) {
23492 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
23493 gen->is_running = 0;
23497 __Pyx_Coroutine_Undelegate(gen);
23498 gen->is_running = 0;
23501 if (likely(args)) {
23502 ret = PyObject_CallObject(meth, args);
23504 ret = PyObject_CallFunctionObjArgs(meth, typ, val, tb, NULL);
23508 gen->is_running = 0;
23511 ret = __Pyx_Coroutine_FinishDelegation(gen);
23513 return __Pyx_Coroutine_MethodReturn(
self, ret);
23516 __Pyx_Raise(typ, val, tb, NULL);
23517 return __Pyx_Coroutine_MethodReturn(
self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
23519 static PyObject *__Pyx_Coroutine_Throw(PyObject *
self, PyObject *args) {
23521 PyObject *val = NULL;
23522 PyObject *tb = NULL;
23523 if (!PyArg_UnpackTuple(args, (
char *)
"throw", 1, 3, &typ, &val, &tb))
23525 return __Pyx__Coroutine_Throw(
self, typ, val, tb, args, 1);
23527 static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit,
void *arg) {
23528 Py_VISIT(gen->closure);
23529 Py_VISIT(gen->classobj);
23530 Py_VISIT(gen->yieldfrom);
23531 Py_VISIT(gen->exc_type);
23532 Py_VISIT(gen->exc_value);
23533 Py_VISIT(gen->exc_traceback);
23536 static int __Pyx_Coroutine_clear(PyObject *
self) {
23537 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
23538 Py_CLEAR(gen->closure);
23539 Py_CLEAR(gen->classobj);
23540 Py_CLEAR(gen->yieldfrom);
23541 Py_CLEAR(gen->exc_type);
23542 Py_CLEAR(gen->exc_value);
23543 Py_CLEAR(gen->exc_traceback);
23544 #ifdef __Pyx_AsyncGen_USED 23545 if (__Pyx_AsyncGen_CheckExact(
self)) {
23546 Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
23549 Py_CLEAR(gen->gi_code);
23550 Py_CLEAR(gen->gi_name);
23551 Py_CLEAR(gen->gi_qualname);
23552 Py_CLEAR(gen->gi_modulename);
23555 static void __Pyx_Coroutine_dealloc(PyObject *
self) {
23556 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
23557 PyObject_GC_UnTrack(gen);
23558 if (gen->gi_weakreflist != NULL)
23559 PyObject_ClearWeakRefs(
self);
23560 if (gen->resume_label >= 0) {
23561 PyObject_GC_Track(
self);
23562 #if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE 23563 if (PyObject_CallFinalizerFromDealloc(
self))
23565 Py_TYPE(gen)->tp_del(
self);
23566 if (self->ob_refcnt > 0)
23571 PyObject_GC_UnTrack(
self);
23573 #ifdef __Pyx_AsyncGen_USED 23574 if (__Pyx_AsyncGen_CheckExact(
self)) {
23578 Py_CLEAR(((__pyx_PyAsyncGenObject*)
self)->ag_finalizer);
23581 __Pyx_Coroutine_clear(
self);
23582 PyObject_GC_Del(gen);
23584 static void __Pyx_Coroutine_del(PyObject *
self) {
23585 PyObject *error_type, *error_value, *error_traceback;
23586 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
23587 __Pyx_PyThreadState_declare
23588 if (gen->resume_label < 0) {
23591 #if !CYTHON_USE_TP_FINALIZE 23592 assert(self->ob_refcnt == 0);
23593 self->ob_refcnt = 1;
23595 __Pyx_PyThreadState_assign
23596 __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
23597 #ifdef __Pyx_AsyncGen_USED 23598 if (__Pyx_AsyncGen_CheckExact(
self)) {
23599 __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)
self;
23600 PyObject *finalizer = agen->ag_finalizer;
23601 if (finalizer && !agen->ag_closed) {
23602 PyObject *res = __Pyx_PyObject_CallOneArg(finalizer,
self);
23603 if (unlikely(!res)) {
23604 PyErr_WriteUnraisable(
self);
23608 __Pyx_ErrRestore(error_type, error_value, error_traceback);
23613 if (unlikely(gen->resume_label == 0 && !error_value)) {
23614 #ifdef __Pyx_Coroutine_USED 23615 #ifdef __Pyx_Generator_USED 23616 if (!__Pyx_Generator_CheckExact(
self))
23619 PyObject_GC_UnTrack(
self);
23620 #if PY_MAJOR_VERSION >= 3 || defined(PyErr_WarnFormat) 23621 if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1,
"coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
23622 PyErr_WriteUnraisable(
self);
23626 #if CYTHON_COMPILING_IN_PYPY 23628 cmsg = (
char*)
"coroutine was never awaited";
23631 PyObject *qualname;
23632 qualname = gen->gi_qualname;
23633 cname = PyString_AS_STRING(qualname);
23634 msg = PyString_FromFormat(
"coroutine '%.50s' was never awaited", cname);
23635 if (unlikely(!msg)) {
23637 cmsg = (
char*)
"coroutine was never awaited";
23639 cmsg = PyString_AS_STRING(msg);
23642 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0))
23643 PyErr_WriteUnraisable(
self);
23646 PyObject_GC_Track(
self);
23650 PyObject *res = __Pyx_Coroutine_Close(
self);
23651 if (unlikely(!res)) {
23652 if (PyErr_Occurred())
23653 PyErr_WriteUnraisable(
self);
23658 __Pyx_ErrRestore(error_type, error_value, error_traceback);
23659 #if !CYTHON_USE_TP_FINALIZE 23660 assert(self->ob_refcnt > 0);
23661 if (--self->ob_refcnt == 0) {
23665 Py_ssize_t refcnt =
self->ob_refcnt;
23666 _Py_NewReference(
self);
23667 self->ob_refcnt = refcnt;
23669 #if CYTHON_COMPILING_IN_CPYTHON 23670 assert(PyType_IS_GC(self->ob_type) &&
23671 _Py_AS_GC(
self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
23674 #ifdef COUNT_ALLOCS 23675 --Py_TYPE(
self)->tp_frees;
23676 --Py_TYPE(
self)->tp_allocs;
23681 __Pyx_Coroutine_get_name(__pyx_CoroutineObject *
self)
23683 PyObject *name =
self->gi_name;
23684 if (unlikely(!name)) name = Py_None;
23689 __Pyx_Coroutine_set_name(__pyx_CoroutineObject *
self, PyObject *value)
23692 #if PY_MAJOR_VERSION >= 3 23693 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
23695 if (unlikely(value == NULL || !PyString_Check(value))) {
23697 PyErr_SetString(PyExc_TypeError,
23698 "__name__ must be set to a string object");
23701 tmp =
self->gi_name;
23703 self->gi_name = value;
23708 __Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *
self)
23710 PyObject *name =
self->gi_qualname;
23711 if (unlikely(!name)) name = Py_None;
23716 __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *
self, PyObject *value)
23719 #if PY_MAJOR_VERSION >= 3 23720 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
23722 if (unlikely(value == NULL || !PyString_Check(value))) {
23724 PyErr_SetString(PyExc_TypeError,
23725 "__qualname__ must be set to a string object");
23728 tmp =
self->gi_qualname;
23730 self->gi_qualname = value;
23734 static __pyx_CoroutineObject *__Pyx__Coroutine_New(
23735 PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
23736 PyObject *name, PyObject *qualname, PyObject *module_name) {
23737 __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
23738 if (unlikely(!gen))
23740 return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name);
23742 static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
23743 __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
23744 PyObject *name, PyObject *qualname, PyObject *module_name) {
23746 gen->closure = closure;
23747 Py_XINCREF(closure);
23748 gen->is_running = 0;
23749 gen->resume_label = 0;
23750 gen->classobj = NULL;
23751 gen->yieldfrom = NULL;
23752 gen->exc_type = NULL;
23753 gen->exc_value = NULL;
23754 gen->exc_traceback = NULL;
23755 gen->gi_weakreflist = NULL;
23756 Py_XINCREF(qualname);
23757 gen->gi_qualname = qualname;
23759 gen->gi_name = name;
23760 Py_XINCREF(module_name);
23761 gen->gi_modulename = module_name;
23763 gen->gi_code = code;
23764 PyObject_GC_Track(gen);
23769 static PyObject* __Pyx_Coroutine_patch_module(PyObject* module,
const char* py_code) {
23770 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) 23772 PyObject *globals, *result_obj;
23773 globals = PyDict_New();
if (unlikely(!globals))
goto ignore;
23774 result = PyDict_SetItemString(globals,
"_cython_coroutine_type",
23775 #ifdef __Pyx_Coroutine_USED
23776 (PyObject*)__pyx_CoroutineType);
23780 if (unlikely(result < 0))
goto ignore;
23781 result = PyDict_SetItemString(globals,
"_cython_generator_type",
23782 #ifdef __Pyx_Generator_USED
23783 (PyObject*)__pyx_GeneratorType);
23787 if (unlikely(result < 0))
goto ignore;
23788 if (unlikely(PyDict_SetItemString(globals,
"_module", module) < 0))
goto ignore;
23789 if (unlikely(PyDict_SetItemString(globals,
"__builtins__", __pyx_b) < 0))
goto ignore;
23790 result_obj = PyRun_String(py_code, Py_file_input, globals, globals);
23791 if (unlikely(!result_obj))
goto ignore;
23792 Py_DECREF(result_obj);
23793 Py_DECREF(globals);
23796 Py_XDECREF(globals);
23797 PyErr_WriteUnraisable(module);
23798 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
"Cython module failed to patch module with custom type", 1) < 0)) {
23809 #ifndef CYTHON_REGISTER_ABCS 23810 #define CYTHON_REGISTER_ABCS 1 23812 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) 23813 static PyObject* __Pyx_patch_abc_module(PyObject *module);
23814 static PyObject* __Pyx_patch_abc_module(PyObject *module) {
23815 module = __Pyx_Coroutine_patch_module(
23817 "if _cython_generator_type is not None:\n" 23818 " try: Generator = _module.Generator\n" 23819 " except AttributeError: pass\n" 23820 " else: Generator.register(_cython_generator_type)\n" 23821 "if _cython_coroutine_type is not None:\n" 23822 " try: Coroutine = _module.Coroutine\n" 23823 " except AttributeError: pass\n" 23824 " else: Coroutine.register(_cython_coroutine_type)\n" 23829 static int __Pyx_patch_abc(
void) {
23830 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) 23831 static int abc_patched = 0;
23832 if (CYTHON_REGISTER_ABCS && !abc_patched) {
23834 module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ?
"collections.abc" :
"collections");
23836 PyErr_WriteUnraisable(NULL);
23837 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
23838 ((PY_MAJOR_VERSION >= 3) ?
23839 "Cython module failed to register with collections.abc module" :
23840 "Cython module failed to register with collections module"), 1) < 0)) {
23844 module = __Pyx_patch_abc_module(module);
23846 if (unlikely(!module))
23850 module = PyImport_ImportModule(
"backports_abc");
23852 module = __Pyx_patch_abc_module(module);
23853 Py_XDECREF(module);
23860 if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL);
23866 static PyMethodDef __pyx_Generator_methods[] = {
23867 {
"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
23868 (
char*) PyDoc_STR(
"send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
23869 {
"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
23870 (
char*) PyDoc_STR(
"throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
23871 {
"close", (PyCFunction) __Pyx_Coroutine_Close, METH_NOARGS,
23872 (
char*) PyDoc_STR(
"close() -> raise GeneratorExit inside generator.")},
23875 static PyMemberDef __pyx_Generator_memberlist[] = {
23876 {(
char *)
"gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL},
23877 {(
char*)
"gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
23878 (
char*) PyDoc_STR(
"object being iterated by 'yield from', or None")},
23879 {(
char*)
"gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
23882 static PyGetSetDef __pyx_Generator_getsets[] = {
23883 {(
char *)
"__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
23884 (
char*) PyDoc_STR(
"name of the generator"), 0},
23885 {(
char *)
"__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
23886 (
char*) PyDoc_STR(
"qualified name of the generator"), 0},
23889 static PyTypeObject __pyx_GeneratorType_type = {
23890 PyVarObject_HEAD_INIT(0, 0)
23892 sizeof(__pyx_CoroutineObject),
23894 (destructor) __Pyx_Coroutine_dealloc,
23909 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
23911 (traverseproc) __Pyx_Coroutine_traverse,
23914 offsetof(__pyx_CoroutineObject, gi_weakreflist),
23916 (iternextfunc) __Pyx_Generator_Next,
23917 __pyx_Generator_methods,
23918 __pyx_Generator_memberlist,
23919 __pyx_Generator_getsets,
23935 #
if CYTHON_USE_TP_FINALIZE
23938 __Pyx_Coroutine_del,
23941 #
if CYTHON_USE_TP_FINALIZE
23942 __Pyx_Coroutine_del,
23943 #elif PY_VERSION_HEX >= 0x030400a1
23947 static int __pyx_Generator_init(
void) {
23948 __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
23949 __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
23950 __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
23951 if (unlikely(!__pyx_GeneratorType)) {
23958 static int __Pyx_check_binary_version(
void) {
23959 char ctversion[4], rtversion[4];
23960 PyOS_snprintf(ctversion, 4,
"%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
23961 PyOS_snprintf(rtversion, 4,
"%s", Py_GetVersion());
23962 if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
23964 PyOS_snprintf(message,
sizeof(message),
23965 "compiletime version %s of module '%.100s' " 23966 "does not match runtime version %s",
23967 ctversion, __Pyx_MODULE_NAME, rtversion);
23968 return PyErr_WarnEx(NULL, message, 1);
23974 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
23976 #if PY_MAJOR_VERSION < 3 23977 if (t->is_unicode) {
23978 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
23979 }
else if (t->intern) {
23980 *t->p = PyString_InternFromString(t->s);
23982 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
23985 if (t->is_unicode | t->is_str) {
23987 *t->p = PyUnicode_InternFromString(t->s);
23988 }
else if (t->encoding) {
23989 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
23991 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
23994 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
23999 if (PyObject_Hash(*t->p) == -1)
24006 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
24007 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
24009 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
24011 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
24013 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 24014 #if !CYTHON_PEP393_ENABLED 24015 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
24017 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
24018 if (!defenc)
return NULL;
24019 defenc_c = PyBytes_AS_STRING(defenc);
24020 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 24022 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
24024 for (c = defenc_c; c < end; c++) {
24025 if ((
unsigned char) (*c) >= 128) {
24026 PyUnicode_AsASCIIString(o);
24032 *length = PyBytes_GET_SIZE(defenc);
24036 static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
24037 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
24038 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 24039 if (likely(PyUnicode_IS_ASCII(o))) {
24040 *length = PyUnicode_GET_LENGTH(o);
24041 return PyUnicode_AsUTF8(o);
24043 PyUnicode_AsASCIIString(o);
24047 return PyUnicode_AsUTF8AndSize(o, length);
24052 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
24053 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 24055 #
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
24056 __Pyx_sys_getdefaultencoding_not_ascii &&
24058 PyUnicode_Check(o)) {
24059 return __Pyx_PyUnicode_AsStringAndSize(o, length);
24062 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) 24063 if (PyByteArray_Check(o)) {
24064 *length = PyByteArray_GET_SIZE(o);
24065 return PyByteArray_AS_STRING(o);
24070 int r = PyBytes_AsStringAndSize(o, &result, length);
24071 if (unlikely(r < 0)) {
24078 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
24079 int is_true = x == Py_True;
24080 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
24081 else return PyObject_IsTrue(x);
24083 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result,
const char* type_name) {
24084 #if PY_MAJOR_VERSION >= 3 24085 if (PyLong_Check(result)) {
24086 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
24087 "__int__ returned non-int (type %.200s). " 24088 "The ability to return an instance of a strict subclass of int " 24089 "is deprecated, and may be removed in a future version of Python.",
24090 Py_TYPE(result)->tp_name)) {
24097 PyErr_Format(PyExc_TypeError,
24098 "__%.4s__ returned non-%.4s (type %.200s)",
24099 type_name, type_name, Py_TYPE(result)->tp_name);
24103 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
24104 #if CYTHON_USE_TYPE_SLOTS 24105 PyNumberMethods *m;
24107 const char *name = NULL;
24108 PyObject *res = NULL;
24109 #if PY_MAJOR_VERSION < 3 24110 if (likely(PyInt_Check(x) || PyLong_Check(x)))
24112 if (likely(PyLong_Check(x)))
24114 return __Pyx_NewRef(x);
24115 #if CYTHON_USE_TYPE_SLOTS 24116 m = Py_TYPE(x)->tp_as_number;
24117 #if PY_MAJOR_VERSION < 3 24118 if (m && m->nb_int) {
24120 res = m->nb_int(x);
24122 else if (m && m->nb_long) {
24124 res = m->nb_long(x);
24127 if (likely(m && m->nb_int)) {
24129 res = m->nb_int(x);
24133 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
24134 res = PyNumber_Int(x);
24138 #if PY_MAJOR_VERSION < 3 24139 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
24141 if (unlikely(!PyLong_CheckExact(res))) {
24143 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
24146 else if (!PyErr_Occurred()) {
24147 PyErr_SetString(PyExc_TypeError,
24148 "an integer is required");
24152 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
24155 #if PY_MAJOR_VERSION < 3 24156 if (likely(PyInt_CheckExact(b))) {
24157 if (
sizeof(Py_ssize_t) >=
sizeof(
long))
24158 return PyInt_AS_LONG(b);
24160 return PyInt_AsSsize_t(x);
24163 if (likely(PyLong_CheckExact(b))) {
24164 #if CYTHON_USE_PYLONG_INTERNALS 24165 const digit* digits = ((PyLongObject*)b)->ob_digit;
24166 const Py_ssize_t size = Py_SIZE(b);
24167 if (likely(__Pyx_sst_abs(size) <= 1)) {
24168 ival = likely(size) ? digits[0] : 0;
24169 if (size == -1) ival = -ival;
24174 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
24175 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
24179 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
24180 return -(Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
24184 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
24185 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
24189 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
24190 return -(Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
24194 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
24195 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]));
24199 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
24200 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]));
24206 return PyLong_AsSsize_t(b);
24208 x = PyNumber_Index(b);
24210 ival = PyInt_AsSsize_t(x);
24214 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
24215 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
24217 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
24218 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.
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.
const Multivector< Scalar_T, LO, HI > operator &(const Multivector< Scalar_T, LO, HI > &lhs, const RHS< Scalar_T, LO, HI > &rhs)
Inner product.
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.
bool operator!=(const Multivector< Scalar_T, LO, HI > &lhs, const RHS< Scalar_T, LO, HI > &rhs)
Test for inequality of multivectors.
Multivector_T cga3std(const Multivector_T &X)
Convert CGA3 null vector to standard Conformal Geometric Algebra null vector [DL (10.52)].
Multivector_T agc3(const Multivector_T &X)
Convert CGA3 null vector to Euclidean 3D vector [DL (10.50)].