55 #define PY_SSIZE_T_CLEAN 58 #error Python headers needed to compile C extensions, please install development version of Python. 59 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) 60 #error Cython requires Python 2.6+ or Python 3.3+. 62 #define CYTHON_ABI "0_28_5" 63 #define CYTHON_FUTURE_DIVISION 0 66 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) 68 #if !defined(WIN32) && !defined(MS_WINDOWS) 80 #define DL_IMPORT(t) t 83 #define DL_EXPORT(t) t 86 #ifndef HAVE_LONG_LONG 87 #if PY_VERSION_HEX >= 0x02070000 88 #define HAVE_LONG_LONG 92 #define PY_LONG_LONG LONG_LONG 95 #define Py_HUGE_VAL HUGE_VAL 98 #define CYTHON_COMPILING_IN_PYPY 1 99 #define CYTHON_COMPILING_IN_PYSTON 0 100 #define CYTHON_COMPILING_IN_CPYTHON 0 101 #undef CYTHON_USE_TYPE_SLOTS 102 #define CYTHON_USE_TYPE_SLOTS 0 103 #undef CYTHON_USE_PYTYPE_LOOKUP 104 #define CYTHON_USE_PYTYPE_LOOKUP 0 105 #if PY_VERSION_HEX < 0x03050000 106 #undef CYTHON_USE_ASYNC_SLOTS 107 #define CYTHON_USE_ASYNC_SLOTS 0 108 #elif !defined(CYTHON_USE_ASYNC_SLOTS) 109 #define CYTHON_USE_ASYNC_SLOTS 1 111 #undef CYTHON_USE_PYLIST_INTERNALS 112 #define CYTHON_USE_PYLIST_INTERNALS 0 113 #undef CYTHON_USE_UNICODE_INTERNALS 114 #define CYTHON_USE_UNICODE_INTERNALS 0 115 #undef CYTHON_USE_UNICODE_WRITER 116 #define CYTHON_USE_UNICODE_WRITER 0 117 #undef CYTHON_USE_PYLONG_INTERNALS 118 #define CYTHON_USE_PYLONG_INTERNALS 0 119 #undef CYTHON_AVOID_BORROWED_REFS 120 #define CYTHON_AVOID_BORROWED_REFS 1 121 #undef CYTHON_ASSUME_SAFE_MACROS 122 #define CYTHON_ASSUME_SAFE_MACROS 0 123 #undef CYTHON_UNPACK_METHODS 124 #define CYTHON_UNPACK_METHODS 0 125 #undef CYTHON_FAST_THREAD_STATE 126 #define CYTHON_FAST_THREAD_STATE 0 127 #undef CYTHON_FAST_PYCALL 128 #define CYTHON_FAST_PYCALL 0 129 #undef CYTHON_PEP489_MULTI_PHASE_INIT 130 #define CYTHON_PEP489_MULTI_PHASE_INIT 0 131 #undef CYTHON_USE_TP_FINALIZE 132 #define CYTHON_USE_TP_FINALIZE 0 133 #elif defined(PYSTON_VERSION) 134 #define CYTHON_COMPILING_IN_PYPY 0 135 #define CYTHON_COMPILING_IN_PYSTON 1 136 #define CYTHON_COMPILING_IN_CPYTHON 0 137 #ifndef CYTHON_USE_TYPE_SLOTS 138 #define CYTHON_USE_TYPE_SLOTS 1 140 #undef CYTHON_USE_PYTYPE_LOOKUP 141 #define CYTHON_USE_PYTYPE_LOOKUP 0 142 #undef CYTHON_USE_ASYNC_SLOTS 143 #define CYTHON_USE_ASYNC_SLOTS 0 144 #undef CYTHON_USE_PYLIST_INTERNALS 145 #define CYTHON_USE_PYLIST_INTERNALS 0 146 #ifndef CYTHON_USE_UNICODE_INTERNALS 147 #define CYTHON_USE_UNICODE_INTERNALS 1 149 #undef CYTHON_USE_UNICODE_WRITER 150 #define CYTHON_USE_UNICODE_WRITER 0 151 #undef CYTHON_USE_PYLONG_INTERNALS 152 #define CYTHON_USE_PYLONG_INTERNALS 0 153 #ifndef CYTHON_AVOID_BORROWED_REFS 154 #define CYTHON_AVOID_BORROWED_REFS 0 156 #ifndef CYTHON_ASSUME_SAFE_MACROS 157 #define CYTHON_ASSUME_SAFE_MACROS 1 159 #ifndef CYTHON_UNPACK_METHODS 160 #define CYTHON_UNPACK_METHODS 1 162 #undef CYTHON_FAST_THREAD_STATE 163 #define CYTHON_FAST_THREAD_STATE 0 164 #undef CYTHON_FAST_PYCALL 165 #define CYTHON_FAST_PYCALL 0 166 #undef CYTHON_PEP489_MULTI_PHASE_INIT 167 #define CYTHON_PEP489_MULTI_PHASE_INIT 0 168 #undef CYTHON_USE_TP_FINALIZE 169 #define CYTHON_USE_TP_FINALIZE 0 171 #define CYTHON_COMPILING_IN_PYPY 0 172 #define CYTHON_COMPILING_IN_PYSTON 0 173 #define CYTHON_COMPILING_IN_CPYTHON 1 174 #ifndef CYTHON_USE_TYPE_SLOTS 175 #define CYTHON_USE_TYPE_SLOTS 1 177 #if PY_VERSION_HEX < 0x02070000 178 #undef CYTHON_USE_PYTYPE_LOOKUP 179 #define CYTHON_USE_PYTYPE_LOOKUP 0 180 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) 181 #define CYTHON_USE_PYTYPE_LOOKUP 1 183 #if PY_MAJOR_VERSION < 3 184 #undef CYTHON_USE_ASYNC_SLOTS 185 #define CYTHON_USE_ASYNC_SLOTS 0 186 #elif !defined(CYTHON_USE_ASYNC_SLOTS) 187 #define CYTHON_USE_ASYNC_SLOTS 1 189 #if PY_VERSION_HEX < 0x02070000 190 #undef CYTHON_USE_PYLONG_INTERNALS 191 #define CYTHON_USE_PYLONG_INTERNALS 0 192 #elif !defined(CYTHON_USE_PYLONG_INTERNALS) 193 #define CYTHON_USE_PYLONG_INTERNALS 1 195 #ifndef CYTHON_USE_PYLIST_INTERNALS 196 #define CYTHON_USE_PYLIST_INTERNALS 1 198 #ifndef CYTHON_USE_UNICODE_INTERNALS 199 #define CYTHON_USE_UNICODE_INTERNALS 1 201 #if PY_VERSION_HEX < 0x030300F0 202 #undef CYTHON_USE_UNICODE_WRITER 203 #define CYTHON_USE_UNICODE_WRITER 0 204 #elif !defined(CYTHON_USE_UNICODE_WRITER) 205 #define CYTHON_USE_UNICODE_WRITER 1 207 #ifndef CYTHON_AVOID_BORROWED_REFS 208 #define CYTHON_AVOID_BORROWED_REFS 0 210 #ifndef CYTHON_ASSUME_SAFE_MACROS 211 #define CYTHON_ASSUME_SAFE_MACROS 1 213 #ifndef CYTHON_UNPACK_METHODS 214 #define CYTHON_UNPACK_METHODS 1 216 #ifndef CYTHON_FAST_THREAD_STATE 217 #define CYTHON_FAST_THREAD_STATE 1 219 #ifndef CYTHON_FAST_PYCALL 220 #define CYTHON_FAST_PYCALL 1 222 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT 223 #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000) 225 #ifndef CYTHON_USE_TP_FINALIZE 226 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) 229 #if !defined(CYTHON_FAST_PYCCALL) 230 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) 232 #if CYTHON_USE_PYLONG_INTERNALS 233 #include "longintrepr.h" 238 #ifndef __has_attribute 239 #define __has_attribute(x) 0 241 #ifndef __has_cpp_attribute 242 #define __has_cpp_attribute(x) 0 244 #ifndef CYTHON_RESTRICT 245 #if defined(__GNUC__) 246 #define CYTHON_RESTRICT __restrict__ 247 #elif defined(_MSC_VER) && _MSC_VER >= 1400 248 #define CYTHON_RESTRICT __restrict 249 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 250 #define CYTHON_RESTRICT restrict 252 #define CYTHON_RESTRICT 255 #ifndef CYTHON_UNUSED 256 # if defined(__GNUC__) 257 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) 258 # define CYTHON_UNUSED __attribute__ ((__unused__)) 260 # define CYTHON_UNUSED 262 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) 263 # define CYTHON_UNUSED __attribute__ ((__unused__)) 265 # define CYTHON_UNUSED 268 #ifndef CYTHON_MAYBE_UNUSED_VAR 269 # if defined(__cplusplus) 270 template<
class T>
void CYTHON_MAYBE_UNUSED_VAR(
const T& ) { }
272 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) 275 #ifndef CYTHON_NCP_UNUSED 276 # if CYTHON_COMPILING_IN_CPYTHON 277 # define CYTHON_NCP_UNUSED 279 # define CYTHON_NCP_UNUSED CYTHON_UNUSED 282 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) 284 #ifndef _MSC_STDINT_H_ 286 typedef unsigned char uint8_t;
287 typedef unsigned int uint32_t;
289 typedef unsigned __int8 uint8_t;
290 typedef unsigned __int32 uint32_t;
296 #ifndef CYTHON_FALLTHROUGH 297 #if defined(__cplusplus) && __cplusplus >= 201103L 298 #if __has_cpp_attribute(fallthrough) 299 #define CYTHON_FALLTHROUGH [[fallthrough]] 300 #elif __has_cpp_attribute(clang::fallthrough) 301 #define CYTHON_FALLTHROUGH [[clang::fallthrough]] 302 #elif __has_cpp_attribute(gnu::fallthrough) 303 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] 306 #ifndef CYTHON_FALLTHROUGH 307 #if __has_attribute(fallthrough) 308 #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) 310 #define CYTHON_FALLTHROUGH 313 #if defined(__clang__ ) && defined(__apple_build_version__) 314 #if __apple_build_version__ < 7000000 315 #undef CYTHON_FALLTHROUGH 316 #define CYTHON_FALLTHROUGH 322 #error "Cython files generated with the C++ option must be compiled with a C++ compiler." 324 #ifndef CYTHON_INLINE 325 #if defined(__clang__) 326 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) 328 #define CYTHON_INLINE inline 332 void __Pyx_call_destructor(T& x) {
336 class __Pyx_FakeReference {
338 __Pyx_FakeReference() : ptr(NULL) { }
339 __Pyx_FakeReference(
const T& ref) : ptr(const_cast<T*>(&ref)) { }
340 T *operator->() {
return ptr; }
342 operator T&() {
return *ptr; }
343 template<
typename U>
bool operator ==(U other) {
return *ptr == other; }
344 template<
typename U>
bool operator !=(U other) {
return *ptr != other; }
349 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) 350 #define Py_OptimizeFlag 0 352 #define __PYX_BUILD_PY_SSIZE_T "n" 353 #define CYTHON_FORMAT_SSIZE_T "z" 354 #if PY_MAJOR_VERSION < 3 355 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" 356 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ 357 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) 358 #define __Pyx_DefaultClassType PyClass_Type 360 #define __Pyx_BUILTIN_MODULE_NAME "builtins" 361 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ 362 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) 363 #define __Pyx_DefaultClassType PyType_Type 365 #ifndef Py_TPFLAGS_CHECKTYPES 366 #define Py_TPFLAGS_CHECKTYPES 0 368 #ifndef Py_TPFLAGS_HAVE_INDEX 369 #define Py_TPFLAGS_HAVE_INDEX 0 371 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER 372 #define Py_TPFLAGS_HAVE_NEWBUFFER 0 374 #ifndef Py_TPFLAGS_HAVE_FINALIZE 375 #define Py_TPFLAGS_HAVE_FINALIZE 0 377 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) 378 #ifndef METH_FASTCALL 379 #define METH_FASTCALL 0x80 381 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *
self, PyObject *
const *args, Py_ssize_t nargs);
382 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *
self, PyObject *
const *args,
383 Py_ssize_t nargs, PyObject *kwnames);
385 #define __Pyx_PyCFunctionFast _PyCFunctionFast 386 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords 388 #if CYTHON_FAST_PYCCALL 389 #define __Pyx_PyFastCFunction_Check(func)\ 390 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS))))) 392 #define __Pyx_PyFastCFunction_Check(func) 0 394 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) 395 #define PyObject_Malloc(s) PyMem_Malloc(s) 396 #define PyObject_Free(p) PyMem_Free(p) 397 #define PyObject_Realloc(p) PyMem_Realloc(p) 399 #if CYTHON_COMPILING_IN_PYSTON 400 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) 401 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) 403 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) 404 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) 406 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 407 #define __Pyx_PyThreadState_Current PyThreadState_GET() 408 #elif PY_VERSION_HEX >= 0x03060000 409 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() 410 #elif PY_VERSION_HEX >= 0x03000000 411 #define __Pyx_PyThreadState_Current PyThreadState_GET() 413 #define __Pyx_PyThreadState_Current _PyThreadState_Current 415 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) 416 #include "pythread.h" 417 #define Py_tss_NEEDS_INIT 0 418 typedef int Py_tss_t;
419 static CYTHON_INLINE
int PyThread_tss_create(Py_tss_t *key) {
420 *key = PyThread_create_key();
423 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(
void) {
424 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(
sizeof(Py_tss_t));
425 *key = Py_tss_NEEDS_INIT;
428 static CYTHON_INLINE
void PyThread_tss_free(Py_tss_t *key) {
431 static CYTHON_INLINE
int PyThread_tss_is_created(Py_tss_t *key) {
432 return *key != Py_tss_NEEDS_INIT;
434 static CYTHON_INLINE
void PyThread_tss_delete(Py_tss_t *key) {
435 PyThread_delete_key(*key);
436 *key = Py_tss_NEEDS_INIT;
438 static CYTHON_INLINE
int PyThread_tss_set(Py_tss_t *key,
void *value) {
439 return PyThread_set_key_value(*key, value);
441 static CYTHON_INLINE
void * PyThread_tss_get(Py_tss_t *key) {
442 return PyThread_get_key_value(*key);
444 #endif // TSS (Thread Specific Storage) API 445 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) 446 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) 448 #define __Pyx_PyDict_NewPresized(n) PyDict_New() 450 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION 451 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) 452 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) 454 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) 455 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) 457 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS 458 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) 460 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) 462 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) 463 #define CYTHON_PEP393_ENABLED 1 464 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 465 0 : _PyUnicode_Ready((PyObject *)(op))) 466 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) 467 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) 468 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) 469 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) 470 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) 471 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) 472 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) 473 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) 475 #define CYTHON_PEP393_ENABLED 0 476 #define PyUnicode_1BYTE_KIND 1 477 #define PyUnicode_2BYTE_KIND 2 478 #define PyUnicode_4BYTE_KIND 4 479 #define __Pyx_PyUnicode_READY(op) (0) 480 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) 481 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) 482 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) 483 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) 484 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) 485 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) 486 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) 487 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) 489 #if CYTHON_COMPILING_IN_PYPY 490 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) 491 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) 493 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) 494 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ 495 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) 497 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) 498 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) 500 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) 501 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) 503 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) 504 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) 506 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) 507 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) 508 #if PY_MAJOR_VERSION >= 3 509 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) 511 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) 513 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) 514 #define PyObject_ASCII(o) PyObject_Repr(o) 516 #if PY_MAJOR_VERSION >= 3 517 #define PyBaseString_Type PyUnicode_Type 518 #define PyStringObject PyUnicodeObject 519 #define PyString_Type PyUnicode_Type 520 #define PyString_Check PyUnicode_Check 521 #define PyString_CheckExact PyUnicode_CheckExact 522 #define PyObject_Unicode PyObject_Str 524 #if PY_MAJOR_VERSION >= 3 525 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) 526 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) 528 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) 529 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) 531 #ifndef PySet_CheckExact 532 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) 534 #if CYTHON_ASSUME_SAFE_MACROS 535 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) 537 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) 539 #if PY_MAJOR_VERSION >= 3 540 #define PyIntObject PyLongObject 541 #define PyInt_Type PyLong_Type 542 #define PyInt_Check(op) PyLong_Check(op) 543 #define PyInt_CheckExact(op) PyLong_CheckExact(op) 544 #define PyInt_FromString PyLong_FromString 545 #define PyInt_FromUnicode PyLong_FromUnicode 546 #define PyInt_FromLong PyLong_FromLong 547 #define PyInt_FromSize_t PyLong_FromSize_t 548 #define PyInt_FromSsize_t PyLong_FromSsize_t 549 #define PyInt_AsLong PyLong_AsLong 550 #define PyInt_AS_LONG PyLong_AS_LONG 551 #define PyInt_AsSsize_t PyLong_AsSsize_t 552 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask 553 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask 554 #define PyNumber_Int PyNumber_Long 556 #if PY_MAJOR_VERSION >= 3 557 #define PyBoolObject PyLongObject 559 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY 560 #ifndef PyUnicode_InternFromString 561 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) 564 #if PY_VERSION_HEX < 0x030200A4 565 typedef long Py_hash_t;
566 #define __Pyx_PyInt_FromHash_t PyInt_FromLong 567 #define __Pyx_PyInt_AsHash_t PyInt_AsLong 569 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t 570 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t 572 #if PY_MAJOR_VERSION >= 3 573 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) 575 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) 577 #if CYTHON_USE_ASYNC_SLOTS 578 #if PY_VERSION_HEX >= 0x030500B1 579 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods 580 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) 582 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) 585 #define __Pyx_PyType_AsAsync(obj) NULL 587 #ifndef __Pyx_PyAsyncMethodsStruct 592 } __Pyx_PyAsyncMethodsStruct;
595 #if defined(WIN32) || defined(MS_WINDOWS) 596 #define _USE_MATH_DEFINES 600 #define __PYX_NAN() ((float) NAN) 602 static CYTHON_INLINE
float __PYX_NAN() {
604 memset(&value, 0xFF,
sizeof(value));
608 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) 609 #define __Pyx_truncl trunc 611 #define __Pyx_truncl truncl 615 #define __PYX_ERR(f_index, lineno, Ln_error) \ 617 __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ 620 #ifndef __PYX_EXTERN_C 622 #define __PYX_EXTERN_C extern "C" 624 #define __PYX_EXTERN_C extern 628 #define __PYX_HAVE__PyClical 629 #define __PYX_HAVE_API__PyClical 641 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) 642 #define CYTHON_WITHOUT_ASSERTIONS 645 typedef struct {PyObject **p;
const char *s;
const Py_ssize_t n;
const char* encoding;
646 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
648 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 649 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 650 #define __PYX_DEFAULT_STRING_ENCODING "" 651 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString 652 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize 653 #define __Pyx_uchar_cast(c) ((unsigned char)c) 654 #define __Pyx_long_cast(x) ((long)x) 655 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ 656 (sizeof(type) < sizeof(Py_ssize_t)) ||\ 657 (sizeof(type) > sizeof(Py_ssize_t) &&\ 658 likely(v < (type)PY_SSIZE_T_MAX ||\ 659 v == (type)PY_SSIZE_T_MAX) &&\ 660 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ 661 v == (type)PY_SSIZE_T_MIN))) ||\ 662 (sizeof(type) == sizeof(Py_ssize_t) &&\ 663 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ 664 v == (type)PY_SSIZE_T_MAX))) ) 665 #if defined (__cplusplus) && __cplusplus >= 201103L 667 #define __Pyx_sst_abs(value) std::abs(value) 668 #elif SIZEOF_INT >= SIZEOF_SIZE_T 669 #define __Pyx_sst_abs(value) abs(value) 670 #elif SIZEOF_LONG >= SIZEOF_SIZE_T 671 #define __Pyx_sst_abs(value) labs(value) 672 #elif defined (_MSC_VER) 673 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) 674 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 675 #define __Pyx_sst_abs(value) llabs(value) 676 #elif defined (__GNUC__) 677 #define __Pyx_sst_abs(value) __builtin_llabs(value) 679 #define __Pyx_sst_abs(value) ((value<0) ? -value : value) 681 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
682 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
683 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) 684 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) 685 #define __Pyx_PyBytes_FromString PyBytes_FromString 686 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize 687 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
688 #if PY_MAJOR_VERSION < 3 689 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString 690 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize 692 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString 693 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize 695 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) 696 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) 697 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) 698 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) 699 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) 700 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) 701 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) 702 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) 703 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) 704 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) 705 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) 706 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) 707 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) 708 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) 709 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) 710 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) 711 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *u) {
712 const Py_UNICODE *u_end = u;
714 return (
size_t)(u_end - u - 1);
716 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) 717 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode 718 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode 719 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) 720 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) 721 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
722 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
723 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
724 #define __Pyx_PySequence_Tuple(obj)\ 725 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) 726 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
727 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
728 #if CYTHON_ASSUME_SAFE_MACROS 729 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) 731 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) 733 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) 734 #if PY_MAJOR_VERSION >= 3 735 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) 737 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) 739 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) 740 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 741 static int __Pyx_sys_getdefaultencoding_not_ascii;
742 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
744 PyObject* default_encoding = NULL;
745 PyObject* ascii_chars_u = NULL;
746 PyObject* ascii_chars_b = NULL;
747 const char* default_encoding_c;
748 sys = PyImport_ImportModule(
"sys");
750 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
752 if (!default_encoding)
goto bad;
753 default_encoding_c = PyBytes_AsString(default_encoding);
754 if (!default_encoding_c)
goto bad;
755 if (strcmp(default_encoding_c,
"ascii") == 0) {
756 __Pyx_sys_getdefaultencoding_not_ascii = 0;
758 char ascii_chars[128];
760 for (c = 0; c < 128; c++) {
763 __Pyx_sys_getdefaultencoding_not_ascii = 1;
764 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
765 if (!ascii_chars_u)
goto bad;
766 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
767 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
770 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
774 Py_DECREF(ascii_chars_u);
775 Py_DECREF(ascii_chars_b);
777 Py_DECREF(default_encoding);
780 Py_XDECREF(default_encoding);
781 Py_XDECREF(ascii_chars_u);
782 Py_XDECREF(ascii_chars_b);
786 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 787 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) 789 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) 790 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 791 static char* __PYX_DEFAULT_STRING_ENCODING;
792 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
794 PyObject* default_encoding = NULL;
795 char* default_encoding_c;
796 sys = PyImport_ImportModule(
"sys");
798 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
800 if (!default_encoding)
goto bad;
801 default_encoding_c = PyBytes_AsString(default_encoding);
802 if (!default_encoding_c)
goto bad;
803 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c));
804 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
805 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
806 Py_DECREF(default_encoding);
809 Py_XDECREF(default_encoding);
817 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) 818 #define likely(x) __builtin_expect(!!(x), 1) 819 #define unlikely(x) __builtin_expect(!!(x), 0) 821 #define likely(x) (x) 822 #define unlikely(x) (x) 824 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
826 static PyObject *__pyx_m = NULL;
827 static PyObject *__pyx_d;
828 static PyObject *__pyx_b;
829 static PyObject *__pyx_cython_runtime = NULL;
830 static PyObject *__pyx_empty_tuple;
831 static PyObject *__pyx_empty_bytes;
832 static PyObject *__pyx_empty_unicode;
833 static int __pyx_lineno;
834 static int __pyx_clineno = 0;
835 static const char * __pyx_cfilenm= __FILE__;
836 static const char *__pyx_filename;
839 static const char *__pyx_f[] = {
845 struct __pyx_obj_8PyClical_index_set;
846 struct __pyx_obj_8PyClical_clifford;
847 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__;
848 struct __pyx_opt_args_8PyClical_sqrt;
849 struct __pyx_opt_args_8PyClical_log;
850 struct __pyx_opt_args_8PyClical_cos;
851 struct __pyx_opt_args_8PyClical_acos;
852 struct __pyx_opt_args_8PyClical_acosh;
853 struct __pyx_opt_args_8PyClical_sin;
854 struct __pyx_opt_args_8PyClical_asin;
855 struct __pyx_opt_args_8PyClical_asinh;
856 struct __pyx_opt_args_8PyClical_tan;
857 struct __pyx_opt_args_8PyClical_atan;
858 struct __pyx_opt_args_8PyClical_atanh;
859 struct __pyx_opt_args_8PyClical_random_clifford;
868 struct __pyx_opt_args_8PyClical_sqrt {
880 struct __pyx_opt_args_8PyClical_log {
892 struct __pyx_opt_args_8PyClical_cos {
904 struct __pyx_opt_args_8PyClical_acos {
916 struct __pyx_opt_args_8PyClical_acosh {
928 struct __pyx_opt_args_8PyClical_sin {
940 struct __pyx_opt_args_8PyClical_asin {
952 struct __pyx_opt_args_8PyClical_asinh {
964 struct __pyx_opt_args_8PyClical_tan {
976 struct __pyx_opt_args_8PyClical_atan {
988 struct __pyx_opt_args_8PyClical_atanh {
1000 struct __pyx_opt_args_8PyClical_random_clifford {
1012 struct __pyx_obj_8PyClical_index_set {
1014 struct __pyx_vtabstruct_8PyClical_index_set *__pyx_vtab;
1026 struct __pyx_obj_8PyClical_clifford {
1028 struct __pyx_vtabstruct_8PyClical_clifford *__pyx_vtab;
1040 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ {
1042 PyObject *__pyx_v_idx;
1043 struct __pyx_obj_8PyClical_index_set *__pyx_v_self;
1044 PyObject *__pyx_t_0;
1045 Py_ssize_t __pyx_t_1;
1046 PyObject *(*__pyx_t_2)(PyObject *);
1059 struct __pyx_vtabstruct_8PyClical_index_set {
1060 PyObject *(*wrap)(
struct __pyx_obj_8PyClical_index_set *,
IndexSet);
1061 IndexSet (*unwrap)(
struct __pyx_obj_8PyClical_index_set *);
1062 PyObject *(*copy)(
struct __pyx_obj_8PyClical_index_set *,
int __pyx_skip_dispatch);
1064 static struct __pyx_vtabstruct_8PyClical_index_set *__pyx_vtabptr_8PyClical_index_set;
1065 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_9index_set_wrap(
struct __pyx_obj_8PyClical_index_set *,
IndexSet);
1066 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_9index_set_unwrap(
struct __pyx_obj_8PyClical_index_set *);
1077 struct __pyx_vtabstruct_8PyClical_clifford {
1078 PyObject *(*wrap)(
struct __pyx_obj_8PyClical_clifford *,
Clifford);
1079 Clifford (*unwrap)(
struct __pyx_obj_8PyClical_clifford *);
1080 PyObject *(*copy)(
struct __pyx_obj_8PyClical_clifford *,
int __pyx_skip_dispatch);
1082 static struct __pyx_vtabstruct_8PyClical_clifford *__pyx_vtabptr_8PyClical_clifford;
1083 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_8clifford_wrap(
struct __pyx_obj_8PyClical_clifford *,
Clifford);
1084 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_8clifford_unwrap(
struct __pyx_obj_8PyClical_clifford *);
1088 #ifndef CYTHON_REFNANNY 1089 #define CYTHON_REFNANNY 0 1093 void (*INCREF)(
void*, PyObject*, int);
1094 void (*DECREF)(
void*, PyObject*, int);
1095 void (*GOTREF)(
void*, PyObject*, int);
1096 void (*GIVEREF)(
void*, PyObject*, int);
1097 void* (*SetupContext)(
const char*, int,
const char*);
1098 void (*FinishContext)(
void**);
1099 } __Pyx_RefNannyAPIStruct;
1100 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1101 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1102 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; 1104 #define __Pyx_RefNannySetupContext(name, acquire_gil)\ 1106 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ 1107 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ 1108 PyGILState_Release(__pyx_gilstate_save);\ 1110 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ 1113 #define __Pyx_RefNannySetupContext(name, acquire_gil)\ 1114 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) 1116 #define __Pyx_RefNannyFinishContext()\ 1117 __Pyx_RefNanny->FinishContext(&__pyx_refnanny) 1118 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1119 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1120 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1121 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1122 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) 1123 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) 1124 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) 1125 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) 1127 #define __Pyx_RefNannyDeclarations 1128 #define __Pyx_RefNannySetupContext(name, acquire_gil) 1129 #define __Pyx_RefNannyFinishContext() 1130 #define __Pyx_INCREF(r) Py_INCREF(r) 1131 #define __Pyx_DECREF(r) Py_DECREF(r) 1132 #define __Pyx_GOTREF(r) 1133 #define __Pyx_GIVEREF(r) 1134 #define __Pyx_XINCREF(r) Py_XINCREF(r) 1135 #define __Pyx_XDECREF(r) Py_XDECREF(r) 1136 #define __Pyx_XGOTREF(r) 1137 #define __Pyx_XGIVEREF(r) 1139 #define __Pyx_XDECREF_SET(r, v) do {\ 1140 PyObject *tmp = (PyObject *) r;\ 1141 r = v; __Pyx_XDECREF(tmp);\ 1143 #define __Pyx_DECREF_SET(r, v) do {\ 1144 PyObject *tmp = (PyObject *) r;\ 1145 r = v; __Pyx_DECREF(tmp);\ 1147 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) 1148 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) 1151 #if CYTHON_USE_TYPE_SLOTS 1152 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject*
obj, PyObject* attr_name);
1154 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) 1158 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1161 #if CYTHON_FAST_PYCCALL 1162 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1164 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) 1168 #if CYTHON_FAST_PYCALL 1169 #define __Pyx_PyFunction_FastCall(func, args, nargs)\ 1170 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) 1171 #if 1 || PY_VERSION_HEX < 0x030600B1 1172 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
int nargs, PyObject *kwargs);
1174 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) 1179 #if CYTHON_COMPILING_IN_CPYTHON 1180 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1182 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) 1186 #if CYTHON_COMPILING_IN_CPYTHON 1187 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1191 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1194 #if CYTHON_FAST_THREAD_STATE 1195 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; 1196 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; 1197 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type 1199 #define __Pyx_PyThreadState_declare 1200 #define __Pyx_PyThreadState_assign 1201 #define __Pyx_PyErr_Occurred() PyErr_Occurred() 1205 #if CYTHON_FAST_THREAD_STATE 1206 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) 1207 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) 1208 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) 1209 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) 1210 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) 1211 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1212 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1213 #if CYTHON_COMPILING_IN_CPYTHON 1214 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) 1216 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) 1219 #define __Pyx_PyErr_Clear() PyErr_Clear() 1220 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) 1221 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) 1222 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) 1223 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) 1224 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) 1225 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) 1226 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) 1230 static void __Pyx_WriteUnraisable(
const char *name,
int clineno,
1231 int lineno,
const char *filename,
1232 int full_traceback,
int nogil);
1235 #if CYTHON_COMPILING_IN_CPYTHON 1236 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1238 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) 1242 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
1245 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1246 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1247 const char* function_name);
1250 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1251 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1254 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
1257 #if CYTHON_FAST_THREAD_STATE 1258 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) 1259 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1260 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) 1261 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1263 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) 1264 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) 1268 #if CYTHON_FAST_THREAD_STATE 1269 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) 1270 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1272 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) 1276 #if CYTHON_FAST_THREAD_STATE 1277 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) 1278 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1280 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1284 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1287 #if !CYTHON_COMPILING_IN_PYPY 1288 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2,
long intval,
int inplace);
1290 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\ 1291 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) 1295 static CYTHON_INLINE
int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq,
int eq) {
1296 int result = PySequence_Contains(seq, item);
1297 return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
1301 #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ 1302 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ 1303 __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\ 1304 (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\ 1305 __Pyx_SetItemInt_Generic(o, to_py_func(i), v))) 1306 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
1307 static CYTHON_INLINE
int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t
i, PyObject *v,
1308 int is_list,
int wraparound,
int boundscheck);
1311 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ 1312 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\ 1313 __Pyx__ArgTypeTest(obj, type, name, exact)) 1314 static int __Pyx__ArgTypeTest(PyObject *
obj, PyTypeObject *type,
const char *name,
int exact);
1317 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
1323 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 1324 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject*
obj, PyObject* attr_name);
1326 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr 1330 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 1331 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject*
obj, PyObject* attr_name);
1333 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr 1337 static int __Pyx_SetVtable(PyObject *dict,
void *vtable);
1340 static int __Pyx_setup_reduce(PyObject* type_obj);
1343 #if !CYTHON_COMPILING_IN_PYPY 1344 static PyObject* __Pyx_PyFloat_DivideObjC(PyObject *op1, PyObject *op2,
double floatval,
int inplace);
1346 #define __Pyx_PyFloat_DivideObjC(op1, op2, floatval, inplace)\ 1347 ((inplace ? __Pyx_PyNumber_InPlaceDivide(op1, op2) : __Pyx_PyNumber_Divide(op1, op2))) 1351 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals);
1354 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals);
1357 #if PY_MAJOR_VERSION >= 3 1358 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals 1360 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals 1364 #ifdef CYTHON_CLINE_IN_TRACEBACK 1365 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) 1367 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
1372 PyCodeObject* code_object;
1374 } __Pyx_CodeObjectCacheEntry;
1375 struct __Pyx_CodeObjectCache {
1378 __Pyx_CodeObjectCacheEntry* entries;
1380 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1381 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
1382 static PyCodeObject *__pyx_find_code_object(
int code_line);
1383 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
1386 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
1387 int py_line,
const char *filename);
1390 #ifndef __Pyx_CppExn2PyErr 1393 #include <stdexcept> 1395 static void __Pyx_CppExn2PyErr() {
1397 if (PyErr_Occurred())
1401 }
catch (
const std::bad_alloc& exn) {
1402 PyErr_SetString(PyExc_MemoryError, exn.what());
1403 }
catch (
const std::bad_cast& exn) {
1404 PyErr_SetString(PyExc_TypeError, exn.what());
1405 }
catch (
const std::bad_typeid& exn) {
1406 PyErr_SetString(PyExc_TypeError, exn.what());
1407 }
catch (
const std::domain_error& exn) {
1408 PyErr_SetString(PyExc_ValueError, exn.what());
1409 }
catch (
const std::invalid_argument& exn) {
1410 PyErr_SetString(PyExc_ValueError, exn.what());
1411 }
catch (
const std::ios_base::failure& exn) {
1412 PyErr_SetString(PyExc_IOError, exn.what());
1413 }
catch (
const std::out_of_range& exn) {
1414 PyErr_SetString(PyExc_IndexError, exn.what());
1415 }
catch (
const std::overflow_error& exn) {
1416 PyErr_SetString(PyExc_OverflowError, exn.what());
1417 }
catch (
const std::range_error& exn) {
1418 PyErr_SetString(PyExc_ArithmeticError, exn.what());
1419 }
catch (
const std::underflow_error& exn) {
1420 PyErr_SetString(PyExc_ArithmeticError, exn.what());
1421 }
catch (
const std::exception& exn) {
1422 PyErr_SetString(PyExc_RuntimeError, exn.what());
1426 PyErr_SetString(PyExc_RuntimeError,
"Unknown exception");
1432 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
1435 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
1438 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
1441 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
1444 #if CYTHON_COMPILING_IN_CPYTHON 1445 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) 1446 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1447 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1448 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1450 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) 1451 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) 1452 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) 1454 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) 1457 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
1460 #if CYTHON_FAST_THREAD_STATE 1461 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) 1462 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1464 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
1468 static PyObject* __Pyx_PyObject_CallMethod1(PyObject*
obj, PyObject* method_name, PyObject* arg);
1469 static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg);
1472 typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyThreadState *, PyObject *);
1475 __pyx_coroutine_body_t body;
1478 PyObject *exc_value;
1479 PyObject *exc_traceback;
1480 PyObject *gi_weakreflist;
1482 PyObject *yieldfrom;
1484 PyObject *gi_qualname;
1485 PyObject *gi_modulename;
1489 } __pyx_CoroutineObject;
1490 static __pyx_CoroutineObject *__Pyx__Coroutine_New(
1491 PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
1492 PyObject *name, PyObject *qualname, PyObject *module_name);
1493 static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
1494 __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
1495 PyObject *name, PyObject *qualname, PyObject *module_name);
1496 static int __Pyx_Coroutine_clear(PyObject *
self);
1497 static PyObject *__Pyx_Coroutine_Send(PyObject *
self, PyObject *value);
1498 static PyObject *__Pyx_Coroutine_Close(PyObject *
self);
1499 static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
1500 #define __Pyx_Coroutine_SwapException(self) {\ 1501 __Pyx_ExceptionSwap(&(self)->exc_type, &(self)->exc_value, &(self)->exc_traceback);\ 1502 __Pyx_Coroutine_ResetFrameBackpointer(self);\ 1504 #define __Pyx_Coroutine_ResetAndClearException(self) {\ 1505 __Pyx_ExceptionReset((self)->exc_type, (self)->exc_value, (self)->exc_traceback);\ 1506 (self)->exc_type = (self)->exc_value = (self)->exc_traceback = NULL;\ 1508 #if CYTHON_FAST_THREAD_STATE 1509 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ 1510 __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue) 1512 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ 1513 __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue) 1515 static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue);
1516 static CYTHON_INLINE
void __Pyx_Coroutine_ResetFrameBackpointer(__pyx_CoroutineObject *
self);
1519 static PyObject* __Pyx_Coroutine_patch_module(PyObject* module,
const char* py_code);
1522 static int __Pyx_patch_abc(
void);
1525 #define __Pyx_Generator_USED 1526 static PyTypeObject *__pyx_GeneratorType = 0;
1527 #define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType) 1528 #define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\ 1529 __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name) 1530 static PyObject *__Pyx_Generator_Next(PyObject *
self);
1531 static int __pyx_Generator_init(
void);
1534 static int __Pyx_check_binary_version(
void);
1537 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1539 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_9index_set_wrap(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self,
IndexSet __pyx_v_other);
1540 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_9index_set_unwrap(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
1541 static PyObject *__pyx_f_8PyClical_9index_set_copy(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self,
int __pyx_skip_dispatch);
1542 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_8clifford_wrap(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self,
Clifford __pyx_v_other);
1543 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_8clifford_unwrap(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
1544 static PyObject *__pyx_f_8PyClical_8clifford_copy(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self,
int __pyx_skip_dispatch);
1551 static PyTypeObject *__pyx_ptype_8PyClical_index_set = 0;
1552 static PyTypeObject *__pyx_ptype_8PyClical_clifford = 0;
1553 static PyTypeObject *__pyx_ptype_8PyClical___pyx_scope_struct____iter__ = 0;
1554 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_toIndexSet(PyObject *);
1555 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_compare(PyObject *, PyObject *,
int __pyx_skip_dispatch);
1556 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_min_neg(PyObject *,
int __pyx_skip_dispatch);
1557 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_max_pos(PyObject *,
int __pyx_skip_dispatch);
1558 static CYTHON_INLINE std::vector<scalar_t> __pyx_f_8PyClical_list_to_vector(PyObject *);
1559 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_toClifford(PyObject *);
1560 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_inv(PyObject *,
int __pyx_skip_dispatch);
1561 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_scalar(PyObject *,
int __pyx_skip_dispatch);
1562 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_real(PyObject *,
int __pyx_skip_dispatch);
1563 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_imag(PyObject *,
int __pyx_skip_dispatch);
1564 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_pure(PyObject *,
int __pyx_skip_dispatch);
1565 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_even(PyObject *,
int __pyx_skip_dispatch);
1566 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_odd(PyObject *,
int __pyx_skip_dispatch);
1567 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_involute(PyObject *,
int __pyx_skip_dispatch);
1568 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_reverse(PyObject *,
int __pyx_skip_dispatch);
1569 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_conj(PyObject *,
int __pyx_skip_dispatch);
1570 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_quad(PyObject *,
int __pyx_skip_dispatch);
1571 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_norm(PyObject *,
int __pyx_skip_dispatch);
1572 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_abs(PyObject *,
int __pyx_skip_dispatch);
1573 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_max_abs(PyObject *,
int __pyx_skip_dispatch);
1574 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_pow(PyObject *, PyObject *,
int __pyx_skip_dispatch);
1575 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_outer_pow(PyObject *, PyObject *,
int __pyx_skip_dispatch);
1576 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_complexifier(PyObject *,
int __pyx_skip_dispatch);
1577 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_sqrt(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_sqrt *__pyx_optional_args);
1578 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_exp(PyObject *,
int __pyx_skip_dispatch);
1579 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_log(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_log *__pyx_optional_args);
1580 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cos(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_cos *__pyx_optional_args);
1581 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_acos(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_acos *__pyx_optional_args);
1582 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cosh(PyObject *,
int __pyx_skip_dispatch);
1583 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_acosh(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_acosh *__pyx_optional_args);
1584 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_sin(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_sin *__pyx_optional_args);
1585 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_asin(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_asin *__pyx_optional_args);
1586 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_sinh(PyObject *,
int __pyx_skip_dispatch);
1587 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_asinh(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_asinh *__pyx_optional_args);
1588 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_tan(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_tan *__pyx_optional_args);
1589 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_atan(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_atan *__pyx_optional_args);
1590 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_tanh(PyObject *,
int __pyx_skip_dispatch);
1591 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_atanh(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_atanh *__pyx_optional_args);
1592 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);
1593 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cga3(PyObject *,
int __pyx_skip_dispatch);
1594 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cga3std(PyObject *,
int __pyx_skip_dispatch);
1595 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_agc3(PyObject *,
int __pyx_skip_dispatch);
1596 #define __Pyx_MODULE_NAME "PyClical" 1597 extern int __pyx_module_is_main_PyClical;
1598 int __pyx_module_is_main_PyClical = 0;
1601 static PyObject *__pyx_builtin_IndexError;
1602 static PyObject *__pyx_builtin_RuntimeError;
1603 static PyObject *__pyx_builtin_TypeError;
1604 static PyObject *__pyx_builtin_ValueError;
1605 static PyObject *__pyx_builtin_NotImplemented;
1606 static PyObject *__pyx_builtin_range;
1607 static PyObject *__pyx_builtin_xrange;
1608 static const char __pyx_k_[] =
".";
1609 static const char __pyx_k_e[] =
"e";
1610 static const char __pyx_k_i[] =
"i";
1611 static const char __pyx_k_m[] =
"m";
1612 static const char __pyx_k_p[] =
"p";
1613 static const char __pyx_k_q[] =
"q";
1614 static const char __pyx_k__2[] =
" ";
1615 static const char __pyx_k__5[] =
":";
1616 static const char __pyx_k__6[] =
"\n\t";
1617 static const char __pyx_k__7[] =
" (";
1618 static const char __pyx_k__8[] =
", ";
1619 static const char __pyx_k__9[] =
").";
1620 static const char __pyx_k_cl[] =
"cl";
1621 static const char __pyx_k_pi[] =
"pi";
1622 static const char __pyx_k_cos[] =
"cos";
1623 static const char __pyx_k_exp[] =
"exp";
1624 static const char __pyx_k_frm[] =
"frm";
1625 static const char __pyx_k_inv[] =
"inv";
1626 static const char __pyx_k_ist[] =
"ist";
1627 static const char __pyx_k_ixt[] =
"ixt";
1628 static const char __pyx_k_lhs[] =
"lhs";
1629 static const char __pyx_k_log[] =
"log";
1630 static const char __pyx_k_max[] =
"max";
1631 static const char __pyx_k_min[] =
"min";
1632 static const char __pyx_k_obj[] =
"obj";
1633 static const char __pyx_k_odd[] =
"odd";
1634 static const char __pyx_k_pow[] =
"pow";
1635 static const char __pyx_k_rhs[] =
"rhs";
1636 static const char __pyx_k_sin[] =
"sin";
1637 static const char __pyx_k_tan[] =
"tan";
1638 static const char __pyx_k_tau[] =
"tau";
1639 static const char __pyx_k_Real[] =
"Real";
1640 static const char __pyx_k_acos[] =
"acos";
1641 static const char __pyx_k_args[] =
"args";
1642 static const char __pyx_k_asin[] =
"asin";
1643 static const char __pyx_k_atan[] =
"atan";
1644 static const char __pyx_k_conj[] =
"conj";
1645 static const char __pyx_k_copy[] =
"copy";
1646 static const char __pyx_k_cosh[] =
"cosh";
1647 static const char __pyx_k_even[] =
"even";
1648 static const char __pyx_k_fill[] =
"fill";
1649 static const char __pyx_k_from[] =
" from ";
1650 static const char __pyx_k_iter[] =
"__iter__";
1651 static const char __pyx_k_main[] =
"__main__";
1652 static const char __pyx_k_math[] =
"math";
1653 static const char __pyx_k_name[] =
"__name__";
1654 static const char __pyx_k_norm[] =
"norm";
1655 static const char __pyx_k_pure[] =
"pure";
1656 static const char __pyx_k_quad[] =
"quad";
1657 static const char __pyx_k_send[] =
"send";
1658 static const char __pyx_k_sinh[] =
"sinh";
1659 static const char __pyx_k_sqrt[] =
"sqrt";
1660 static const char __pyx_k_tanh[] =
"tanh";
1661 static const char __pyx_k_test[] =
"_test";
1662 static const char __pyx_k_0_8_2[] =
"0.8.2";
1663 static const char __pyx_k_acosh[] =
"acosh";
1664 static const char __pyx_k_asinh[] =
"asinh";
1665 static const char __pyx_k_atanh[] =
"atanh";
1666 static const char __pyx_k_close[] =
"close";
1667 static const char __pyx_k_grade[] =
"grade";
1668 static const char __pyx_k_istpq[] =
"istpq";
1669 static const char __pyx_k_nbar3[] =
"nbar3";
1670 static const char __pyx_k_ninf3[] =
"ninf3";
1671 static const char __pyx_k_other[] =
"other";
1672 static const char __pyx_k_range[] =
"range";
1673 static const char __pyx_k_throw[] =
"throw";
1674 static const char __pyx_k_using[] =
" using (";
1675 static const char __pyx_k_value[] =
" value ";
1676 static const char __pyx_k_import[] =
"__import__";
1677 static const char __pyx_k_reduce[] =
"__reduce__";
1678 static const char __pyx_k_scalar[] =
"scalar";
1679 static const char __pyx_k_test_2[] =
"__test__";
1680 static const char __pyx_k_xrange[] =
"xrange";
1681 static const char __pyx_k_doctest[] =
"doctest";
1682 static const char __pyx_k_invalid[] =
" invalid ";
1683 static const char __pyx_k_numbers[] =
"numbers";
1684 static const char __pyx_k_reverse[] =
"reverse";
1685 static const char __pyx_k_testmod[] =
"testmod";
1686 static const char __pyx_k_version[] =
"__version__";
1687 static const char __pyx_k_Integral[] =
"Integral";
1688 static const char __pyx_k_PyClical[] =
"PyClical";
1689 static const char __pyx_k_Sequence[] =
"Sequence";
1690 static const char __pyx_k_as_frame[] =
" as frame:\n\t";
1691 static const char __pyx_k_getstate[] =
"__getstate__";
1692 static const char __pyx_k_involute[] =
"involute";
1693 static const char __pyx_k_setstate[] =
"__setstate__";
1694 static const char __pyx_k_to_frame[] =
" to frame ";
1695 static const char __pyx_k_TypeError[] =
"TypeError";
1696 static const char __pyx_k_outer_pow[] =
"outer_pow";
1697 static const char __pyx_k_reduce_ex[] =
"__reduce_ex__";
1698 static const char __pyx_k_IndexError[] =
"IndexError";
1699 static const char __pyx_k_ValueError[] =
"ValueError";
1700 static const char __pyx_k_pyx_vtable[] =
"__pyx_vtable__";
1701 static const char __pyx_k_collections[] =
"collections";
1702 static const char __pyx_k_e_line_1887[] =
"e (line 1887)";
1703 static const char __pyx_k_PyClical_pyx[] =
"PyClical.pyx";
1704 static const char __pyx_k_RuntimeError[] =
"RuntimeError";
1705 static const char __pyx_k_abs_line_1473[] =
"abs (line 1473)";
1706 static const char __pyx_k_cos_line_1602[] =
"cos (line 1602)";
1707 static const char __pyx_k_exp_line_1565[] =
"exp (line 1565)";
1708 static const char __pyx_k_inv_line_1329[] =
"inv (line 1329)";
1709 static const char __pyx_k_log_line_1579[] =
"log (line 1579)";
1710 static const char __pyx_k_odd_line_1397[] =
"odd (line 1397)";
1711 static const char __pyx_k_pow_line_1494[] =
"pow (line 1494)";
1712 static const char __pyx_k_reduce_cython[] =
"__reduce_cython__";
1713 static const char __pyx_k_sin_line_1679[] =
"sin (line 1679)";
1714 static const char __pyx_k_tan_line_1752[] =
"tan (line 1752)";
1715 static const char __pyx_k_using_invalid[] =
" using invalid ";
1716 static const char __pyx_k_Cannot_reframe[] =
"Cannot reframe";
1717 static const char __pyx_k_NotImplemented[] =
"NotImplemented";
1718 static const char __pyx_k_Not_applicable[] =
"Not applicable.";
1719 static const char __pyx_k_acos_line_1619[] =
"acos (line 1619)";
1720 static const char __pyx_k_agc3_line_1844[] =
"agc3 (line 1844)";
1721 static const char __pyx_k_asin_line_1698[] =
"asin (line 1698)";
1722 static const char __pyx_k_atan_line_1769[] =
"atan (line 1769)";
1723 static const char __pyx_k_cga3_line_1824[] =
"cga3 (line 1824)";
1724 static const char __pyx_k_conj_line_1436[] =
"conj (line 1436)";
1725 static const char __pyx_k_cosh_line_1640[] =
"cosh (line 1640)";
1726 static const char __pyx_k_even_line_1388[] =
"even (line 1388)";
1727 static const char __pyx_k_imag_line_1366[] =
"imag (line 1366)";
1728 static const char __pyx_k_invalid_string[] =
" invalid string ";
1729 static const char __pyx_k_norm_line_1462[] =
"norm (line 1462)";
1730 static const char __pyx_k_pure_line_1377[] =
"pure (line 1377)";
1731 static const char __pyx_k_quad_line_1451[] =
"quad (line 1451)";
1732 static const char __pyx_k_real_line_1355[] =
"real (line 1355)";
1733 static const char __pyx_k_sinh_line_1719[] =
"sinh (line 1719)";
1734 static const char __pyx_k_sqrt_line_1542[] =
"sqrt (line 1542)";
1735 static const char __pyx_k_tanh_line_1786[] =
"tanh (line 1786)";
1736 static const char __pyx_k_acosh_line_1656[] =
"acosh (line 1656)";
1737 static const char __pyx_k_asinh_line_1733[] =
"asinh (line 1733)";
1738 static const char __pyx_k_atanh_line_1798[] =
"atanh (line 1798)";
1739 static const char __pyx_k_istpq_line_1900[] =
"istpq (line 1900)";
1740 static const char __pyx_k_setstate_cython[] =
"__setstate_cython__";
1741 static const char __pyx_k_compare_line_490[] =
"compare (line 490)";
1742 static const char __pyx_k_index_set___iter[] =
"index_set.__iter__";
1743 static const char __pyx_k_max_pos_line_511[] =
"max_pos (line 511)";
1744 static const char __pyx_k_min_neg_line_502[] =
"min_neg (line 502)";
1745 static const char __pyx_k_scalar_line_1344[] =
"scalar (line 1344)";
1746 static const char __pyx_k_cga3std_line_1833[] =
"cga3std (line 1833)";
1747 static const char __pyx_k_max_abs_line_1482[] =
"max_abs (line 1482)";
1748 static const char __pyx_k_reverse_line_1421[] =
"reverse (line 1421)";
1749 static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
1750 static const char __pyx_k_involute_line_1406[] =
"involute (line 1406)";
1751 static const char __pyx_k_outer_pow_line_1518[] =
"outer_pow (line 1518)";
1752 static const char __pyx_k_clifford_inv_line_925[] =
"clifford.inv (line 925)";
1753 static const char __pyx_k_clifford_pow_line_979[] =
"clifford.pow (line 979)";
1754 static const char __pyx_k_clifford_abs_line_1174[] =
"clifford.abs (line 1174)";
1755 static const char __pyx_k_clifford_copy_line_554[] =
"clifford.copy (line 554)";
1756 static const char __pyx_k_clifford_odd_line_1069[] =
"clifford.odd (line 1069)";
1757 static const char __pyx_k_complexifier_line_1527[] =
"complexifier (line 1527)";
1758 static const char __pyx_k_index_set_copy_line_64[] =
"index_set.copy (line 64)";
1759 static const char __pyx_k_index_set_max_line_349[] =
"index_set.max (line 349)";
1760 static const char __pyx_k_index_set_min_line_340[] =
"index_set.min (line 340)";
1761 static const char __pyx_k_clifford_conj_line_1137[] =
"clifford.conj (line 1137)";
1762 static const char __pyx_k_clifford_even_line_1060[] =
"clifford.even (line 1060)";
1763 static const char __pyx_k_clifford_norm_line_1163[] =
"clifford.norm (line 1163)";
1764 static const char __pyx_k_clifford_pure_line_1049[] =
"clifford.pure (line 1049)";
1765 static const char __pyx_k_clifford_quad_line_1152[] =
"clifford.quad (line 1152)";
1766 static const char __pyx_k_Unary_print_clifford_1_1[] =
"\n Unary -.\n\n >>> print -clifford(\"{1}\")\n -{1}\n ";
1767 static const char __pyx_k_clifford___or___line_938[] =
"clifford.__or__ (line 938)";
1768 static const char __pyx_k_clifford_frame_line_1214[] =
"clifford.frame (line 1214)";
1769 static const char __pyx_k_clifford_hidden_doctests[] =
"clifford_hidden_doctests";
1770 static const char __pyx_k_clifford_isnan_line_1205[] =
"clifford.isnan (line 1205)";
1771 static const char __pyx_k_index_set_count_line_313[] =
"index_set.count (line 313)";
1772 static const char __pyx_k_clifford___add___line_739[] =
"clifford.__add__ (line 739)";
1773 static const char __pyx_k_clifford___and___line_835[] =
"clifford.__and__ (line 835)";
1774 static const char __pyx_k_clifford___div___line_895[] =
"clifford.__div__ (line 895)";
1775 static const char __pyx_k_clifford___ior___line_949[] =
"clifford.__ior__ (line 949)";
1776 static const char __pyx_k_clifford___mod___line_805[] =
"clifford.__mod__ (line 805)";
1777 static const char __pyx_k_clifford___mul___line_779[] =
"clifford.__mul__ (line 779)";
1778 static const char __pyx_k_clifford___neg___line_721[] =
"clifford.__neg__ (line 721)";
1779 static const char __pyx_k_clifford___pos___line_730[] =
"clifford.__pos__ (line 730)";
1780 static const char __pyx_k_clifford___pow___line_960[] =
"clifford.__pow__ (line 960)";
1781 static const char __pyx_k_clifford___sub___line_759[] =
"clifford.__sub__ (line 759)";
1782 static const char __pyx_k_clifford___xor___line_865[] =
"clifford.__xor__ (line 865)";
1783 static const char __pyx_k_clifford_reframe_line_648[] =
"clifford.reframe (line 648)";
1784 static const char __pyx_k_clifford_scalar_line_1038[] =
"clifford.scalar (line 1038)";
1785 static const char __pyx_k_index_set___or___line_291[] =
"index_set.__or__ (line 291)";
1786 static const char __pyx_k_index_set_hidden_doctests[] =
"index_set_hidden_doctests";
1787 static const char __pyx_k_random_clifford_line_1815[] =
"random_clifford (line 1815)";
1788 static const char __pyx_k_Cannot_take_vector_part_of[] =
"Cannot take vector part of ";
1789 static const char __pyx_k_Unary_print_clifford_1_1_2[] =
"\n Unary +.\n\n >>> print +clifford(\"{1}\")\n {1}\n ";
1790 static const char __pyx_k_clifford___iadd___line_750[] =
"clifford.__iadd__ (line 750)";
1791 static const char __pyx_k_clifford___iand___line_850[] =
"clifford.__iand__ (line 850)";
1792 static const char __pyx_k_clifford___idiv___line_910[] =
"clifford.__idiv__ (line 910)";
1793 static const char __pyx_k_clifford___imod___line_820[] =
"clifford.__imod__ (line 820)";
1794 static const char __pyx_k_clifford___imul___line_792[] =
"clifford.__imul__ (line 792)";
1795 static const char __pyx_k_clifford___isub___line_770[] =
"clifford.__isub__ (line 770)";
1796 static const char __pyx_k_clifford___iter___line_637[] =
"clifford.__iter__ (line 637)";
1797 static const char __pyx_k_clifford___ixor___line_880[] =
"clifford.__ixor__ (line 880)";
1798 static const char __pyx_k_clifford___str___line_1234[] =
"clifford.__str__ (line 1234)";
1799 static const char __pyx_k_clifford_max_abs_line_1183[] =
"clifford.max_abs (line 1183)";
1800 static const char __pyx_k_clifford_reverse_line_1122[] =
"clifford.reverse (line 1122)";
1801 static const char __pyx_k_index_set___and___line_269[] =
"index_set.__and__ (line 269)";
1802 static const char __pyx_k_index_set___ior___line_302[] =
"index_set.__ior__ (line 302)";
1803 static const char __pyx_k_index_set___str___line_393[] =
"index_set.__str__ (line 393)";
1804 static const char __pyx_k_index_set___xor___line_247[] =
"index_set.__xor__ (line 247)";
1805 static const char __pyx_k_clifford___call___line_1019[] =
"clifford.__call__ (line 1019)";
1806 static const char __pyx_k_clifford___repr___line_1225[] =
"clifford.__repr__ (line 1225)";
1807 static const char __pyx_k_clifford_involute_line_1106[] =
"clifford.involute (line 1106)";
1808 static const char __pyx_k_index_set___iand___line_280[] =
"index_set.__iand__ (line 280)";
1809 static const char __pyx_k_index_set___iter___line_227[] =
"index_set.__iter__ (line 227)";
1810 static const char __pyx_k_index_set___ixor___line_258[] =
"index_set.__ixor__ (line 258)";
1811 static const char __pyx_k_index_set___repr___line_382[] =
"index_set.__repr__ (line 382)";
1812 static const char __pyx_k_clifford_outer_pow_line_1003[] =
"clifford.outer_pow (line 1003)";
1813 static const char __pyx_k_clifford_truncated_line_1194[] =
"clifford.truncated (line 1194)";
1814 static const char __pyx_k_index_set_count_neg_line_322[] =
"index_set.count_neg (line 322)";
1815 static const char __pyx_k_index_set_count_pos_line_331[] =
"index_set.count_pos (line 331)";
1816 static const char __pyx_k_clifford___getitem___line_706[] =
"clifford.__getitem__ (line 706)";
1817 static const char __pyx_k_index_set___invert___line_238[] =
"index_set.__invert__ (line 238)";
1818 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 ";
1819 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 ";
1820 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 ";
1821 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 ";
1822 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 ";
1823 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 ";
1824 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 ";
1825 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 ";
1826 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 ";
1827 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 ";
1828 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 ";
1829 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 ";
1830 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 ";
1831 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 ";
1832 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 ";
1833 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 ";
1834 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 ";
1835 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 ";
1836 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 ";
1837 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 ";
1838 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 ";
1839 static const char __pyx_k_clifford_vector_part_line_1078[] =
"clifford.vector_part (line 1078)";
1840 static const char __pyx_k_index_set___getitem___line_189[] =
"index_set.__getitem__ (line 189)";
1841 static const char __pyx_k_index_set___setitem___line_177[] =
"index_set.__setitem__ (line 177)";
1842 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 ";
1843 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 ";
1844 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 ";
1845 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 ";
1846 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 ";
1847 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 ";
1848 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 ";
1849 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 ";
1850 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 ";
1851 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 ";
1852 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 ";
1853 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 ";
1854 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 ";
1855 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 ";
1856 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 ";
1857 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 ";
1858 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 ";
1859 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 ";
1860 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 ";
1861 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 ";
1862 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 ";
1863 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 ";
1864 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 ";
1865 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 ";
1866 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 ";
1867 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 ";
1868 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 ";
1869 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 ";
1870 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 ";
1871 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 ";
1872 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 ";
1873 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 ";
1874 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 ";
1875 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 ";
1876 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 ";
1877 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 ";
1878 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 ";
1879 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 ";
1880 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 ";
1881 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 ";
1882 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 ";
1883 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 ";
1884 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 ";
1885 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 ";
1886 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 ";
1887 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 ";
1888 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 ";
1889 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 ";
1890 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 ";
1891 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 ";
1892 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 ";
1893 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 ";
1894 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 ";
1895 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 ";
1896 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 ";
1897 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 ";
1898 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 ";
1899 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 ";
1900 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 ";
1901 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 ";
1902 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 ";
1903 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 ";
1904 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 ";
1905 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 ";
1906 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 ";
1907 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 ";
1908 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 ";
1909 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 ";
1910 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 ";
1911 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 ";
1912 static const char __pyx_k_This_comparison_operator_is_not[] =
"This comparison operator is not implemented for ";
1913 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 ";
1914 static const char __pyx_k_index_set_sign_of_mult_line_364[] =
"index_set.sign_of_mult (line 364)";
1915 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 ";
1916 static const char __pyx_k_Cannot_initialize_clifford_objec[] =
"Cannot initialize clifford object from";
1917 static const char __pyx_k_Cannot_initialize_index_set_obje[] =
"Cannot initialize index_set object from";
1918 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 ";
1919 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 ";
1920 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 ";
1921 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 ";
1922 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 ";
1923 static const char __pyx_k_clifford_hidden_doctests_line_12[] =
"clifford_hidden_doctests (line 1243)";
1924 static const char __pyx_k_index_set_hidden_doctests_line_4[] =
"index_set_hidden_doctests (line 404)";
1925 static const char __pyx_k_index_set_sign_of_square_line_37[] =
"index_set.sign_of_square (line 373)";
1926 static const char __pyx_k_no_default___reduce___due_to_non[] =
"no default __reduce__ due to non-trivial __cinit__";
1927 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 ";
1928 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 ";
1929 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 ";
1930 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 ";
1931 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 ";
1932 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 ";
1933 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 ";
1934 static PyObject *__pyx_kp_s_;
1935 static PyObject *__pyx_kp_s_0_8_2;
1936 static PyObject *__pyx_kp_u_Abbreviation_for_clifford_index;
1937 static PyObject *__pyx_kp_u_Abbreviation_for_index_set_q_p;
1938 static PyObject *__pyx_kp_u_Absolute_value_of_multivector_m;
1939 static PyObject *__pyx_kp_u_Absolute_value_square_root_of_n;
1940 static PyObject *__pyx_kp_s_Cannot_initialize_clifford_objec;
1941 static PyObject *__pyx_kp_s_Cannot_initialize_index_set_obje;
1942 static PyObject *__pyx_kp_s_Cannot_reframe;
1943 static PyObject *__pyx_kp_s_Cannot_take_vector_part_of;
1944 static PyObject *__pyx_kp_u_Cardinality_Number_of_indices_i;
1945 static PyObject *__pyx_kp_u_Check_if_a_multivector_contains;
1946 static PyObject *__pyx_kp_u_Conjugation_reverse_o_involute;
1947 static PyObject *__pyx_kp_u_Conjugation_reverse_o_involute_2;
1948 static PyObject *__pyx_kp_u_Contraction_print_clifford_1_cl;
1949 static PyObject *__pyx_kp_u_Contraction_x_clifford_1_x_clif;
1950 static PyObject *__pyx_kp_u_Convert_CGA3_null_vector_to_Euc;
1951 static PyObject *__pyx_kp_u_Convert_CGA3_null_vector_to_sta;
1952 static PyObject *__pyx_kp_u_Convert_Euclidean_3D_multivecto;
1953 static PyObject *__pyx_kp_u_Copy_this_clifford_object_x_cli;
1954 static PyObject *__pyx_kp_u_Copy_this_index_set_object_s_in;
1955 static PyObject *__pyx_kp_u_Cosine_of_multivector_with_opti;
1956 static PyObject *__pyx_kp_u_Even_part_of_multivector_sum_of;
1957 static PyObject *__pyx_kp_u_Even_part_of_multivector_sum_of_2;
1958 static PyObject *__pyx_kp_u_Exponential_of_multivector_x_cl;
1959 static PyObject *__pyx_kp_u_Geometric_difference_print_clif;
1960 static PyObject *__pyx_kp_u_Geometric_difference_x_clifford;
1961 static PyObject *__pyx_kp_u_Geometric_multiplicative_invers;
1962 static PyObject *__pyx_kp_u_Geometric_multiplicative_invers_2;
1963 static PyObject *__pyx_kp_u_Geometric_product_print_cliffor;
1964 static PyObject *__pyx_kp_u_Geometric_product_x_clifford_2;
1965 static PyObject *__pyx_kp_u_Geometric_quotient_print_cliffo;
1966 static PyObject *__pyx_kp_u_Geometric_quotient_x_clifford_1;
1967 static PyObject *__pyx_kp_u_Geometric_sum_print_clifford_1;
1968 static PyObject *__pyx_kp_u_Geometric_sum_x_clifford_1_x_cl;
1969 static PyObject *__pyx_kp_u_Get_the_value_of_an_index_set_o;
1970 static PyObject *__pyx_kp_u_Hyperbolic_cosine_of_multivecto;
1971 static PyObject *__pyx_kp_u_Hyperbolic_sine_of_multivector;
1972 static PyObject *__pyx_kp_u_Hyperbolic_tangent_of_multivect;
1973 static PyObject *__pyx_kp_u_Imaginary_part_deprecated_alway;
1974 static PyObject *__pyx_n_s_IndexError;
1975 static PyObject *__pyx_kp_u_Inner_product_print_clifford_1;
1976 static PyObject *__pyx_kp_u_Inner_product_x_clifford_1_x_cl;
1977 static PyObject *__pyx_kp_u_Integer_power_of_multivector_ob;
1978 static PyObject *__pyx_n_s_Integral;
1979 static PyObject *__pyx_kp_u_Inverse_cosine_of_multivector_w;
1980 static PyObject *__pyx_kp_u_Inverse_hyperbolic_cosine_of_mu;
1981 static PyObject *__pyx_kp_u_Inverse_hyperbolic_sine_of_mult;
1982 static PyObject *__pyx_kp_u_Inverse_hyperbolic_tangent_of_m;
1983 static PyObject *__pyx_kp_u_Inverse_sine_of_multivector_wit;
1984 static PyObject *__pyx_kp_u_Inverse_tangent_of_multivector;
1985 static PyObject *__pyx_kp_u_Iterate_over_the_indices_of_an;
1986 static PyObject *__pyx_kp_u_Main_involution_each_i_is_repla;
1987 static PyObject *__pyx_kp_u_Main_involution_each_i_is_repla_2;
1988 static PyObject *__pyx_kp_u_Maximum_absolute_value_of_coord;
1989 static PyObject *__pyx_kp_u_Maximum_member_index_set_1_1_2;
1990 static PyObject *__pyx_kp_u_Maximum_of_absolute_values_of_c;
1991 static PyObject *__pyx_kp_u_Maximum_positive_index_or_0_if;
1992 static PyObject *__pyx_kp_u_Minimum_member_index_set_1_1_2;
1993 static PyObject *__pyx_kp_u_Minimum_negative_index_or_0_if;
1994 static PyObject *__pyx_kp_u_Natural_logarithm_of_multivecto;
1995 static PyObject *__pyx_kp_u_Norm_sum_of_squares_of_coordina;
1996 static PyObject *__pyx_n_s_NotImplemented;
1997 static PyObject *__pyx_kp_s_Not_applicable;
1998 static PyObject *__pyx_kp_u_Not_applicable_for_a_in_cliffor;
1999 static PyObject *__pyx_kp_u_Number_of_negative_indices_incl;
2000 static PyObject *__pyx_kp_u_Number_of_positive_indices_incl;
2001 static PyObject *__pyx_kp_u_Odd_part_of_multivector_sum_of;
2002 static PyObject *__pyx_kp_u_Odd_part_of_multivector_sum_of_2;
2003 static PyObject *__pyx_kp_u_Outer_product_power_of_multivec;
2004 static PyObject *__pyx_kp_u_Outer_product_power_x_clifford;
2005 static PyObject *__pyx_kp_u_Outer_product_print_clifford_1;
2006 static PyObject *__pyx_kp_u_Outer_product_x_clifford_1_x_cl;
2007 static PyObject *__pyx_kp_u_Power_self_to_the_m_x_clifford;
2008 static PyObject *__pyx_kp_u_Power_self_to_the_m_x_clifford_2;
2009 static PyObject *__pyx_kp_u_Pure_grade_vector_part_print_cl;
2010 static PyObject *__pyx_kp_u_Pure_part_print_clifford_1_1_1;
2011 static PyObject *__pyx_kp_u_Pure_part_print_pure_clifford_1;
2012 static PyObject *__pyx_kp_u_Put_self_into_a_larger_frame_co;
2013 static PyObject *__pyx_n_s_PyClical;
2014 static PyObject *__pyx_kp_s_PyClical_pyx;
2015 static PyObject *__pyx_kp_u_Quadratic_form_rev_x_x_0_print;
2016 static PyObject *__pyx_kp_u_Quadratic_form_rev_x_x_0_print_2;
2017 static PyObject *__pyx_kp_u_Random_multivector_within_a_fra;
2018 static PyObject *__pyx_n_s_Real;
2019 static PyObject *__pyx_kp_u_Real_part_synonym_for_scalar_pa;
2020 static PyObject *__pyx_kp_u_Remove_all_terms_of_self_with_r;
2021 static PyObject *__pyx_kp_u_Reversion_eg_1_2_2_1_print_reve;
2022 static PyObject *__pyx_kp_u_Reversion_eg_clifford_1_cliffor;
2023 static PyObject *__pyx_n_s_RuntimeError;
2024 static PyObject *__pyx_kp_u_Scalar_part_clifford_1_1_1_2_sc;
2025 static PyObject *__pyx_kp_u_Scalar_part_scalar_clifford_1_1;
2026 static PyObject *__pyx_n_s_Sequence;
2027 static PyObject *__pyx_kp_u_Set_complement_not_print_index;
2028 static PyObject *__pyx_kp_u_Set_intersection_and_print_inde;
2029 static PyObject *__pyx_kp_u_Set_intersection_and_x_index_se;
2030 static PyObject *__pyx_kp_u_Set_the_value_of_an_index_set_o;
2031 static PyObject *__pyx_kp_u_Set_union_or_print_index_set_1;
2032 static PyObject *__pyx_kp_u_Set_union_or_x_index_set_1_x_in;
2033 static PyObject *__pyx_kp_u_Sign_of_geometric_product_of_tw;
2034 static PyObject *__pyx_kp_u_Sign_of_geometric_square_of_a_C;
2035 static PyObject *__pyx_kp_u_Sine_of_multivector_with_option;
2036 static PyObject *__pyx_kp_u_Square_root_of_1_which_commutes;
2037 static PyObject *__pyx_kp_u_Square_root_of_multivector_with;
2038 static PyObject *__pyx_kp_u_Subalgebra_generated_by_all_gen;
2039 static PyObject *__pyx_kp_u_Subscripting_map_from_index_set;
2040 static PyObject *__pyx_kp_u_Symmetric_set_difference_exclus;
2041 static PyObject *__pyx_kp_u_Symmetric_set_difference_exclus_2;
2042 static PyObject *__pyx_kp_u_Tangent_of_multivector_with_opt;
2043 static PyObject *__pyx_kp_u_Tests_for_functions_that_Doctes;
2044 static PyObject *__pyx_kp_u_Tests_for_functions_that_Doctes_2;
2045 static PyObject *__pyx_kp_u_The_informal_string_representat;
2046 static PyObject *__pyx_kp_u_The_informal_string_representat_2;
2047 static PyObject *__pyx_kp_u_The_official_string_representat;
2048 static PyObject *__pyx_kp_u_The_official_string_representat_2;
2049 static PyObject *__pyx_kp_s_This_comparison_operator_is_not;
2050 static PyObject *__pyx_kp_u_Transform_left_hand_side_using;
2051 static PyObject *__pyx_kp_u_Transform_left_hand_side_using_2;
2052 static PyObject *__pyx_n_s_TypeError;
2053 static PyObject *__pyx_kp_u_Unary_print_clifford_1_1;
2054 static PyObject *__pyx_kp_u_Unary_print_clifford_1_1_2;
2055 static PyObject *__pyx_n_s_ValueError;
2056 static PyObject *__pyx_kp_u_Vector_part_of_multivector_as_a;
2057 static PyObject *__pyx_kp_s__2;
2058 static PyObject *__pyx_kp_s__5;
2059 static PyObject *__pyx_kp_s__6;
2060 static PyObject *__pyx_kp_s__7;
2061 static PyObject *__pyx_kp_s__8;
2062 static PyObject *__pyx_kp_s__9;
2063 static PyObject *__pyx_kp_u_abs_line_1473;
2064 static PyObject *__pyx_n_s_acos;
2065 static PyObject *__pyx_kp_u_acos_line_1619;
2066 static PyObject *__pyx_n_s_acosh;
2067 static PyObject *__pyx_kp_u_acosh_line_1656;
2068 static PyObject *__pyx_kp_u_agc3_line_1844;
2069 static PyObject *__pyx_n_s_args;
2070 static PyObject *__pyx_kp_s_as_frame;
2071 static PyObject *__pyx_n_s_asin;
2072 static PyObject *__pyx_kp_u_asin_line_1698;
2073 static PyObject *__pyx_n_s_asinh;
2074 static PyObject *__pyx_kp_u_asinh_line_1733;
2075 static PyObject *__pyx_n_s_atan;
2076 static PyObject *__pyx_kp_u_atan_line_1769;
2077 static PyObject *__pyx_n_s_atanh;
2078 static PyObject *__pyx_kp_u_atanh_line_1798;
2079 static PyObject *__pyx_kp_u_cga3_line_1824;
2080 static PyObject *__pyx_kp_u_cga3std_line_1833;
2081 static PyObject *__pyx_n_s_cl;
2082 static PyObject *__pyx_kp_u_clifford___add___line_739;
2083 static PyObject *__pyx_kp_u_clifford___and___line_835;
2084 static PyObject *__pyx_kp_u_clifford___call___line_1019;
2085 static PyObject *__pyx_kp_u_clifford___div___line_895;
2086 static PyObject *__pyx_kp_u_clifford___getitem___line_706;
2087 static PyObject *__pyx_kp_u_clifford___iadd___line_750;
2088 static PyObject *__pyx_kp_u_clifford___iand___line_850;
2089 static PyObject *__pyx_kp_u_clifford___idiv___line_910;
2090 static PyObject *__pyx_kp_u_clifford___imod___line_820;
2091 static PyObject *__pyx_kp_u_clifford___imul___line_792;
2092 static PyObject *__pyx_kp_u_clifford___ior___line_949;
2093 static PyObject *__pyx_kp_u_clifford___isub___line_770;
2094 static PyObject *__pyx_kp_u_clifford___iter___line_637;
2095 static PyObject *__pyx_kp_u_clifford___ixor___line_880;
2096 static PyObject *__pyx_kp_u_clifford___mod___line_805;
2097 static PyObject *__pyx_kp_u_clifford___mul___line_779;
2098 static PyObject *__pyx_kp_u_clifford___neg___line_721;
2099 static PyObject *__pyx_kp_u_clifford___or___line_938;
2100 static PyObject *__pyx_kp_u_clifford___pos___line_730;
2101 static PyObject *__pyx_kp_u_clifford___pow___line_960;
2102 static PyObject *__pyx_kp_u_clifford___repr___line_1225;
2103 static PyObject *__pyx_kp_u_clifford___str___line_1234;
2104 static PyObject *__pyx_kp_u_clifford___sub___line_759;
2105 static PyObject *__pyx_kp_u_clifford___xor___line_865;
2106 static PyObject *__pyx_kp_u_clifford_abs_line_1174;
2107 static PyObject *__pyx_kp_u_clifford_conj_line_1137;
2108 static PyObject *__pyx_kp_u_clifford_copy_line_554;
2109 static PyObject *__pyx_kp_u_clifford_even_line_1060;
2110 static PyObject *__pyx_kp_u_clifford_frame_line_1214;
2111 static PyObject *__pyx_n_s_clifford_hidden_doctests;
2112 static PyObject *__pyx_kp_u_clifford_hidden_doctests_line_12;
2113 static PyObject *__pyx_kp_u_clifford_inv_line_925;
2114 static PyObject *__pyx_kp_u_clifford_involute_line_1106;
2115 static PyObject *__pyx_kp_u_clifford_isnan_line_1205;
2116 static PyObject *__pyx_kp_u_clifford_max_abs_line_1183;
2117 static PyObject *__pyx_kp_u_clifford_norm_line_1163;
2118 static PyObject *__pyx_kp_u_clifford_odd_line_1069;
2119 static PyObject *__pyx_kp_u_clifford_outer_pow_line_1003;
2120 static PyObject *__pyx_kp_u_clifford_pow_line_979;
2121 static PyObject *__pyx_kp_u_clifford_pure_line_1049;
2122 static PyObject *__pyx_kp_u_clifford_quad_line_1152;
2123 static PyObject *__pyx_kp_u_clifford_reframe_line_648;
2124 static PyObject *__pyx_kp_u_clifford_reverse_line_1122;
2125 static PyObject *__pyx_kp_u_clifford_scalar_line_1038;
2126 static PyObject *__pyx_kp_u_clifford_truncated_line_1194;
2127 static PyObject *__pyx_kp_u_clifford_vector_part_line_1078;
2128 static PyObject *__pyx_n_s_cline_in_traceback;
2129 static PyObject *__pyx_n_s_close;
2130 static PyObject *__pyx_n_s_collections;
2131 static PyObject *__pyx_kp_u_compare_line_490;
2132 static PyObject *__pyx_kp_u_complexifier_line_1527;
2133 static PyObject *__pyx_n_s_conj;
2134 static PyObject *__pyx_kp_u_conj_line_1436;
2135 static PyObject *__pyx_n_s_copy;
2136 static PyObject *__pyx_n_s_cos;
2137 static PyObject *__pyx_kp_u_cos_line_1602;
2138 static PyObject *__pyx_n_s_cosh;
2139 static PyObject *__pyx_kp_u_cosh_line_1640;
2140 static PyObject *__pyx_n_s_doctest;
2141 static PyObject *__pyx_n_s_e;
2142 static PyObject *__pyx_kp_u_e_line_1887;
2143 static PyObject *__pyx_n_s_even;
2144 static PyObject *__pyx_kp_u_even_line_1388;
2145 static PyObject *__pyx_n_s_exp;
2146 static PyObject *__pyx_kp_u_exp_line_1565;
2147 static PyObject *__pyx_n_s_fill;
2148 static PyObject *__pyx_n_s_frm;
2149 static PyObject *__pyx_kp_s_from;
2150 static PyObject *__pyx_n_s_getstate;
2151 static PyObject *__pyx_n_s_grade;
2152 static PyObject *__pyx_n_s_i;
2153 static PyObject *__pyx_kp_u_imag_line_1366;
2154 static PyObject *__pyx_n_s_import;
2155 static PyObject *__pyx_kp_u_index_set___and___line_269;
2156 static PyObject *__pyx_kp_u_index_set___getitem___line_189;
2157 static PyObject *__pyx_kp_u_index_set___iand___line_280;
2158 static PyObject *__pyx_kp_u_index_set___invert___line_238;
2159 static PyObject *__pyx_kp_u_index_set___ior___line_302;
2160 static PyObject *__pyx_n_s_index_set___iter;
2161 static PyObject *__pyx_kp_u_index_set___iter___line_227;
2162 static PyObject *__pyx_kp_u_index_set___ixor___line_258;
2163 static PyObject *__pyx_kp_u_index_set___or___line_291;
2164 static PyObject *__pyx_kp_u_index_set___repr___line_382;
2165 static PyObject *__pyx_kp_u_index_set___setitem___line_177;
2166 static PyObject *__pyx_kp_u_index_set___str___line_393;
2167 static PyObject *__pyx_kp_u_index_set___xor___line_247;
2168 static PyObject *__pyx_kp_u_index_set_copy_line_64;
2169 static PyObject *__pyx_kp_u_index_set_count_line_313;
2170 static PyObject *__pyx_kp_u_index_set_count_neg_line_322;
2171 static PyObject *__pyx_kp_u_index_set_count_pos_line_331;
2172 static PyObject *__pyx_n_s_index_set_hidden_doctests;
2173 static PyObject *__pyx_kp_u_index_set_hidden_doctests_line_4;
2174 static PyObject *__pyx_kp_u_index_set_max_line_349;
2175 static PyObject *__pyx_kp_u_index_set_min_line_340;
2176 static PyObject *__pyx_kp_u_index_set_sign_of_mult_line_364;
2177 static PyObject *__pyx_kp_u_index_set_sign_of_square_line_37;
2178 static PyObject *__pyx_n_s_inv;
2179 static PyObject *__pyx_kp_u_inv_line_1329;
2180 static PyObject *__pyx_kp_s_invalid;
2181 static PyObject *__pyx_kp_s_invalid_string;
2182 static PyObject *__pyx_n_s_involute;
2183 static PyObject *__pyx_kp_u_involute_line_1406;
2184 static PyObject *__pyx_n_s_ist;
2185 static PyObject *__pyx_n_s_istpq;
2186 static PyObject *__pyx_kp_u_istpq_line_1900;
2187 static PyObject *__pyx_n_s_iter;
2188 static PyObject *__pyx_n_s_ixt;
2189 static PyObject *__pyx_kp_u_lexicographic_compare_eg_3_4_5;
2190 static PyObject *__pyx_n_s_lhs;
2191 static PyObject *__pyx_n_s_log;
2192 static PyObject *__pyx_kp_u_log_line_1579;
2193 static PyObject *__pyx_n_s_m;
2194 static PyObject *__pyx_n_s_main;
2195 static PyObject *__pyx_n_s_math;
2196 static PyObject *__pyx_n_s_max;
2197 static PyObject *__pyx_kp_u_max_abs_line_1482;
2198 static PyObject *__pyx_kp_u_max_pos_line_511;
2199 static PyObject *__pyx_n_s_min;
2200 static PyObject *__pyx_kp_u_min_neg_line_502;
2201 static PyObject *__pyx_n_s_name;
2202 static PyObject *__pyx_n_s_nbar3;
2203 static PyObject *__pyx_n_s_ninf3;
2204 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2205 static PyObject *__pyx_n_s_norm;
2206 static PyObject *__pyx_kp_u_norm_line_1462;
2207 static PyObject *__pyx_kp_u_norm_sum_of_squares_of_coordina;
2208 static PyObject *__pyx_n_s_numbers;
2209 static PyObject *__pyx_n_s_obj;
2210 static PyObject *__pyx_n_s_odd;
2211 static PyObject *__pyx_kp_u_odd_line_1397;
2212 static PyObject *__pyx_n_s_other;
2213 static PyObject *__pyx_n_s_outer_pow;
2214 static PyObject *__pyx_kp_u_outer_pow_line_1518;
2215 static PyObject *__pyx_n_s_p;
2216 static PyObject *__pyx_n_s_pi;
2217 static PyObject *__pyx_n_s_pow;
2218 static PyObject *__pyx_kp_u_pow_line_1494;
2219 static PyObject *__pyx_n_s_pure;
2220 static PyObject *__pyx_kp_u_pure_line_1377;
2221 static PyObject *__pyx_n_s_pyx_vtable;
2222 static PyObject *__pyx_n_s_q;
2223 static PyObject *__pyx_n_s_quad;
2224 static PyObject *__pyx_kp_u_quad_line_1451;
2225 static PyObject *__pyx_kp_u_random_clifford_line_1815;
2226 static PyObject *__pyx_n_s_range;
2227 static PyObject *__pyx_kp_u_real_line_1355;
2228 static PyObject *__pyx_n_s_reduce;
2229 static PyObject *__pyx_n_s_reduce_cython;
2230 static PyObject *__pyx_n_s_reduce_ex;
2231 static PyObject *__pyx_n_s_reverse;
2232 static PyObject *__pyx_kp_u_reverse_line_1421;
2233 static PyObject *__pyx_n_s_rhs;
2234 static PyObject *__pyx_n_s_scalar;
2235 static PyObject *__pyx_kp_u_scalar_line_1344;
2236 static PyObject *__pyx_n_s_send;
2237 static PyObject *__pyx_n_s_setstate;
2238 static PyObject *__pyx_n_s_setstate_cython;
2239 static PyObject *__pyx_n_s_sin;
2240 static PyObject *__pyx_kp_u_sin_line_1679;
2241 static PyObject *__pyx_n_s_sinh;
2242 static PyObject *__pyx_kp_u_sinh_line_1719;
2243 static PyObject *__pyx_n_s_sqrt;
2244 static PyObject *__pyx_kp_u_sqrt_line_1542;
2245 static PyObject *__pyx_n_s_tan;
2246 static PyObject *__pyx_kp_u_tan_line_1752;
2247 static PyObject *__pyx_n_s_tanh;
2248 static PyObject *__pyx_kp_u_tanh_line_1786;
2249 static PyObject *__pyx_n_s_tau;
2250 static PyObject *__pyx_n_s_test;
2251 static PyObject *__pyx_n_s_test_2;
2252 static PyObject *__pyx_n_s_testmod;
2253 static PyObject *__pyx_n_s_throw;
2254 static PyObject *__pyx_kp_s_to_frame;
2255 static PyObject *__pyx_kp_s_using;
2256 static PyObject *__pyx_kp_s_using_invalid;
2257 static PyObject *__pyx_kp_s_value;
2258 static PyObject *__pyx_n_s_version;
2259 static PyObject *__pyx_n_s_xrange;
2260 static PyObject *__pyx_pf_8PyClical_9index_set_copy(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2261 static int __pyx_pf_8PyClical_9index_set_2__cinit__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_other);
2262 static void __pyx_pf_8PyClical_9index_set_4__dealloc__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2263 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);
2264 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);
2265 static PyObject *__pyx_pf_8PyClical_9index_set_10__getitem__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_idx);
2266 static int __pyx_pf_8PyClical_9index_set_12__contains__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_idx);
2267 static PyObject *__pyx_pf_8PyClical_9index_set_14__iter__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2268 static PyObject *__pyx_pf_8PyClical_9index_set_17__invert__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2269 static PyObject *__pyx_pf_8PyClical_9index_set_19__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2270 static PyObject *__pyx_pf_8PyClical_9index_set_21__ixor__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs);
2271 static PyObject *__pyx_pf_8PyClical_9index_set_23__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2272 static PyObject *__pyx_pf_8PyClical_9index_set_25__iand__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs);
2273 static PyObject *__pyx_pf_8PyClical_9index_set_27__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2274 static PyObject *__pyx_pf_8PyClical_9index_set_29__ior__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs);
2275 static PyObject *__pyx_pf_8PyClical_9index_set_31count(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2276 static PyObject *__pyx_pf_8PyClical_9index_set_33count_neg(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2277 static PyObject *__pyx_pf_8PyClical_9index_set_35count_pos(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2278 static PyObject *__pyx_pf_8PyClical_9index_set_37min(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2279 static PyObject *__pyx_pf_8PyClical_9index_set_39max(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2280 static PyObject *__pyx_pf_8PyClical_9index_set_41hash_fn(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2281 static PyObject *__pyx_pf_8PyClical_9index_set_43sign_of_mult(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs);
2282 static PyObject *__pyx_pf_8PyClical_9index_set_45sign_of_square(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2283 static PyObject *__pyx_pf_8PyClical_9index_set_47__repr__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2284 static PyObject *__pyx_pf_8PyClical_9index_set_49__str__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2285 static PyObject *__pyx_pf_8PyClical_9index_set_51__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2286 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);
2287 static PyObject *__pyx_pf_8PyClical_index_set_hidden_doctests(CYTHON_UNUSED PyObject *__pyx_self);
2288 static PyObject *__pyx_pf_8PyClical_2compare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2289 static PyObject *__pyx_pf_8PyClical_4min_neg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2290 static PyObject *__pyx_pf_8PyClical_6max_pos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2291 static PyObject *__pyx_pf_8PyClical_8clifford_copy(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2292 static int __pyx_pf_8PyClical_8clifford_2__cinit__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_ixt);
2293 static void __pyx_pf_8PyClical_8clifford_4__dealloc__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2294 static int __pyx_pf_8PyClical_8clifford_6__contains__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_x);
2295 static PyObject *__pyx_pf_8PyClical_8clifford_8__iter__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2296 static PyObject *__pyx_pf_8PyClical_8clifford_10reframe(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_ixt);
2297 static PyObject *__pyx_pf_8PyClical_8clifford_12__richcmp__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op);
2298 static PyObject *__pyx_pf_8PyClical_8clifford_14__getitem__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_ixt);
2299 static PyObject *__pyx_pf_8PyClical_8clifford_16__neg__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2300 static PyObject *__pyx_pf_8PyClical_8clifford_18__pos__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2301 static PyObject *__pyx_pf_8PyClical_8clifford_20__add__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2302 static PyObject *__pyx_pf_8PyClical_8clifford_22__iadd__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2303 static PyObject *__pyx_pf_8PyClical_8clifford_24__sub__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2304 static PyObject *__pyx_pf_8PyClical_8clifford_26__isub__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2305 static PyObject *__pyx_pf_8PyClical_8clifford_28__mul__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2306 static PyObject *__pyx_pf_8PyClical_8clifford_30__imul__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2307 static PyObject *__pyx_pf_8PyClical_8clifford_32__mod__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2308 static PyObject *__pyx_pf_8PyClical_8clifford_34__imod__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2309 static PyObject *__pyx_pf_8PyClical_8clifford_36__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2310 static PyObject *__pyx_pf_8PyClical_8clifford_38__iand__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2311 static PyObject *__pyx_pf_8PyClical_8clifford_40__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2312 static PyObject *__pyx_pf_8PyClical_8clifford_42__ixor__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2313 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 2314 static PyObject *__pyx_pf_8PyClical_8clifford_44__div__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2316 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 2317 static PyObject *__pyx_pf_8PyClical_8clifford_46__idiv__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2319 static PyObject *__pyx_pf_8PyClical_8clifford_48inv(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2320 static PyObject *__pyx_pf_8PyClical_8clifford_50__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2321 static PyObject *__pyx_pf_8PyClical_8clifford_52__ior__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2322 static PyObject *__pyx_pf_8PyClical_8clifford_54__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_m, CYTHON_UNUSED PyObject *__pyx_v_dummy);
2323 static PyObject *__pyx_pf_8PyClical_8clifford_56pow(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_m);
2324 static PyObject *__pyx_pf_8PyClical_8clifford_58outer_pow(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_m);
2325 static PyObject *__pyx_pf_8PyClical_8clifford_60__call__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_grade);
2326 static PyObject *__pyx_pf_8PyClical_8clifford_62scalar(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2327 static PyObject *__pyx_pf_8PyClical_8clifford_64pure(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2328 static PyObject *__pyx_pf_8PyClical_8clifford_66even(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2329 static PyObject *__pyx_pf_8PyClical_8clifford_68odd(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2330 static PyObject *__pyx_pf_8PyClical_8clifford_70vector_part(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_frm);
2331 static PyObject *__pyx_pf_8PyClical_8clifford_72involute(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2332 static PyObject *__pyx_pf_8PyClical_8clifford_74reverse(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2333 static PyObject *__pyx_pf_8PyClical_8clifford_76conj(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2334 static PyObject *__pyx_pf_8PyClical_8clifford_78quad(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2335 static PyObject *__pyx_pf_8PyClical_8clifford_80norm(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2336 static PyObject *__pyx_pf_8PyClical_8clifford_82abs(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2337 static PyObject *__pyx_pf_8PyClical_8clifford_84max_abs(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2338 static PyObject *__pyx_pf_8PyClical_8clifford_86truncated(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_limit);
2339 static PyObject *__pyx_pf_8PyClical_8clifford_88isnan(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2340 static PyObject *__pyx_pf_8PyClical_8clifford_90frame(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2341 static PyObject *__pyx_pf_8PyClical_8clifford_92__repr__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2342 static PyObject *__pyx_pf_8PyClical_8clifford_94__str__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2343 static PyObject *__pyx_pf_8PyClical_8clifford_96__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2344 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);
2345 static PyObject *__pyx_pf_8PyClical_8clifford_hidden_doctests(CYTHON_UNUSED PyObject *__pyx_self);
2346 static PyObject *__pyx_pf_8PyClical_10inv(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2347 static PyObject *__pyx_pf_8PyClical_12scalar(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2348 static PyObject *__pyx_pf_8PyClical_14real(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2349 static PyObject *__pyx_pf_8PyClical_16imag(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2350 static PyObject *__pyx_pf_8PyClical_18pure(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2351 static PyObject *__pyx_pf_8PyClical_20even(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2352 static PyObject *__pyx_pf_8PyClical_22odd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2353 static PyObject *__pyx_pf_8PyClical_24involute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2354 static PyObject *__pyx_pf_8PyClical_26reverse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2355 static PyObject *__pyx_pf_8PyClical_28conj(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2356 static PyObject *__pyx_pf_8PyClical_30quad(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2357 static PyObject *__pyx_pf_8PyClical_32norm(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2358 static PyObject *__pyx_pf_8PyClical_34abs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2359 static PyObject *__pyx_pf_8PyClical_36max_abs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2360 static PyObject *__pyx_pf_8PyClical_38pow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_m);
2361 static PyObject *__pyx_pf_8PyClical_40outer_pow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_m);
2362 static PyObject *__pyx_pf_8PyClical_42complexifier(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2363 static PyObject *__pyx_pf_8PyClical_44sqrt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2364 static PyObject *__pyx_pf_8PyClical_46exp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2365 static PyObject *__pyx_pf_8PyClical_48log(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2366 static PyObject *__pyx_pf_8PyClical_50cos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2367 static PyObject *__pyx_pf_8PyClical_52acos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2368 static PyObject *__pyx_pf_8PyClical_54cosh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2369 static PyObject *__pyx_pf_8PyClical_56acosh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2370 static PyObject *__pyx_pf_8PyClical_58sin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2371 static PyObject *__pyx_pf_8PyClical_60asin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2372 static PyObject *__pyx_pf_8PyClical_62sinh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2373 static PyObject *__pyx_pf_8PyClical_64asinh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2374 static PyObject *__pyx_pf_8PyClical_66tan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2375 static PyObject *__pyx_pf_8PyClical_68atan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2376 static PyObject *__pyx_pf_8PyClical_70tanh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2377 static PyObject *__pyx_pf_8PyClical_72atanh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2378 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);
2379 static PyObject *__pyx_pf_8PyClical_76cga3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2380 static PyObject *__pyx_pf_8PyClical_78cga3std(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2381 static PyObject *__pyx_pf_8PyClical_80agc3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2382 static PyObject *__pyx_pf_8PyClical_82e(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2383 static PyObject *__pyx_pf_8PyClical_84istpq(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_p, PyObject *__pyx_v_q);
2384 static PyObject *__pyx_pf_8PyClical_86_test(CYTHON_UNUSED PyObject *__pyx_self);
2385 static PyObject *__pyx_tp_new_8PyClical_index_set(PyTypeObject *t, PyObject *a, PyObject *k);
2386 static PyObject *__pyx_tp_new_8PyClical_clifford(PyTypeObject *t, PyObject *a, PyObject *k);
2387 static PyObject *__pyx_tp_new_8PyClical___pyx_scope_struct____iter__(PyTypeObject *t, PyObject *a, PyObject *k);
2388 static PyObject *__pyx_float_0_0;
2389 static PyObject *__pyx_float_1_0;
2390 static PyObject *__pyx_float_2_0;
2391 static PyObject *__pyx_float_8_0;
2392 static PyObject *__pyx_int_0;
2393 static PyObject *__pyx_int_1;
2394 static PyObject *__pyx_int_4;
2395 static PyObject *__pyx_int_neg_1;
2396 static PyObject *__pyx_tuple__3;
2397 static PyObject *__pyx_tuple__4;
2398 static PyObject *__pyx_tuple__10;
2399 static PyObject *__pyx_tuple__11;
2400 static PyObject *__pyx_tuple__12;
2401 static PyObject *__pyx_tuple__13;
2402 static PyObject *__pyx_tuple__16;
2403 static PyObject *__pyx_tuple__17;
2404 static PyObject *__pyx_tuple__19;
2405 static PyObject *__pyx_tuple__21;
2406 static PyObject *__pyx_tuple__22;
2407 static PyObject *__pyx_tuple__23;
2408 static PyObject *__pyx_tuple__24;
2409 static PyObject *__pyx_tuple__25;
2410 static PyObject *__pyx_codeobj__14;
2411 static PyObject *__pyx_codeobj__15;
2412 static PyObject *__pyx_codeobj__18;
2413 static PyObject *__pyx_codeobj__20;
2414 static PyObject *__pyx_codeobj__26;
2425 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_toIndexSet(PyObject *__pyx_v_obj) {
2427 __Pyx_RefNannyDeclarations
2428 PyObject *__pyx_t_1 = NULL;
2429 __Pyx_RefNannySetupContext(
"toIndexSet", 0);
2438 __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)
2439 __Pyx_GOTREF(__pyx_t_1);
2440 __pyx_r = (((
struct __pyx_obj_8PyClical_index_set *)__pyx_t_1)->instance[0]);
2441 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2454 __Pyx_XDECREF(__pyx_t_1);
2455 __Pyx_WriteUnraisable(
"PyClical.toIndexSet", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
2456 __Pyx_pretend_to_initialize(&__pyx_r);
2458 __Pyx_RefNannyFinishContext();
2470 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_9index_set_wrap(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self,
IndexSet __pyx_v_other) {
2471 PyObject *__pyx_r = NULL;
2472 __Pyx_RefNannyDeclarations
2473 __Pyx_RefNannySetupContext(
"wrap", 0);
2482 (__pyx_v_self->instance[0]) = __pyx_v_other;
2491 __Pyx_XDECREF(__pyx_r);
2492 __Pyx_INCREF(((PyObject *)__pyx_v_self));
2493 __pyx_r = ((PyObject *)__pyx_v_self);
2506 __Pyx_XGIVEREF(__pyx_r);
2507 __Pyx_RefNannyFinishContext();
2519 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_9index_set_unwrap(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
2521 __Pyx_RefNannyDeclarations
2522 __Pyx_RefNannySetupContext(
"unwrap", 0);
2531 __pyx_r = (__pyx_v_self->instance[0]);
2544 __Pyx_RefNannyFinishContext();
2556 static PyObject *__pyx_pw_8PyClical_9index_set_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
2557 static PyObject *__pyx_f_8PyClical_9index_set_copy(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self,
int __pyx_skip_dispatch) {
2558 PyObject *__pyx_r = NULL;
2559 __Pyx_RefNannyDeclarations
2560 PyObject *__pyx_t_1 = NULL;
2561 PyObject *__pyx_t_2 = NULL;
2562 PyObject *__pyx_t_3 = NULL;
2563 PyObject *__pyx_t_4 = NULL;
2564 __Pyx_RefNannySetupContext(
"copy", 0);
2566 if (unlikely(__pyx_skip_dispatch)) ;
2568 else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
2569 __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)
2570 __Pyx_GOTREF(__pyx_t_1);
2571 if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_8PyClical_9index_set_1copy)) {
2572 __Pyx_XDECREF(__pyx_r);
2573 __Pyx_INCREF(__pyx_t_1);
2574 __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
2575 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
2576 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
2577 if (likely(__pyx_t_4)) {
2578 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
2579 __Pyx_INCREF(__pyx_t_4);
2580 __Pyx_INCREF(
function);
2581 __Pyx_DECREF_SET(__pyx_t_3,
function);
2585 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error)
2586 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2588 __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error)
2590 __Pyx_GOTREF(__pyx_t_2);
2591 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2592 __pyx_r = __pyx_t_2;
2594 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2597 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2607 __Pyx_XDECREF(__pyx_r);
2608 __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)
2609 __Pyx_GOTREF(__pyx_t_1);
2610 __pyx_r = __pyx_t_1;
2624 __Pyx_XDECREF(__pyx_t_1);
2625 __Pyx_XDECREF(__pyx_t_2);
2626 __Pyx_XDECREF(__pyx_t_3);
2627 __Pyx_XDECREF(__pyx_t_4);
2628 __Pyx_AddTraceback(
"PyClical.index_set.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
2631 __Pyx_XGIVEREF(__pyx_r);
2632 __Pyx_RefNannyFinishContext();
2637 static PyObject *__pyx_pw_8PyClical_9index_set_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
2638 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 ";
2639 static PyObject *__pyx_pw_8PyClical_9index_set_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
2640 PyObject *__pyx_r = 0;
2641 __Pyx_RefNannyDeclarations
2642 __Pyx_RefNannySetupContext(
"copy (wrapper)", 0);
2643 __pyx_r = __pyx_pf_8PyClical_9index_set_copy(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
2646 __Pyx_RefNannyFinishContext();
2650 static PyObject *__pyx_pf_8PyClical_9index_set_copy(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
2651 PyObject *__pyx_r = NULL;
2652 __Pyx_RefNannyDeclarations
2653 PyObject *__pyx_t_1 = NULL;
2654 __Pyx_RefNannySetupContext(
"copy", 0);
2655 __Pyx_XDECREF(__pyx_r);
2656 __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)
2657 __Pyx_GOTREF(__pyx_t_1);
2658 __pyx_r = __pyx_t_1;
2664 __Pyx_XDECREF(__pyx_t_1);
2665 __Pyx_AddTraceback(
"PyClical.index_set.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
2668 __Pyx_XGIVEREF(__pyx_r);
2669 __Pyx_RefNannyFinishContext();
2682 static int __pyx_pw_8PyClical_9index_set_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2683 static int __pyx_pw_8PyClical_9index_set_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2684 PyObject *__pyx_v_other = 0;
2686 __Pyx_RefNannyDeclarations
2687 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
2689 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,0};
2690 PyObject* values[1] = {0};
2691 values[0] = ((PyObject *)__pyx_int_0);
2692 if (unlikely(__pyx_kwds)) {
2694 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2696 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2699 default:
goto __pyx_L5_argtuple_error;
2701 kw_args = PyDict_Size(__pyx_kwds);
2705 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other);
2706 if (value) { values[0] = value; kw_args--; }
2709 if (unlikely(kw_args > 0)) {
2710 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(0, 73, __pyx_L3_error)
2713 switch (PyTuple_GET_SIZE(__pyx_args)) {
2714 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2717 default:
goto __pyx_L5_argtuple_error;
2720 __pyx_v_other = values[0];
2722 goto __pyx_L4_argument_unpacking_done;
2723 __pyx_L5_argtuple_error:;
2724 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 73, __pyx_L3_error)
2726 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2727 __Pyx_RefNannyFinishContext();
2729 __pyx_L4_argument_unpacking_done:;
2730 __pyx_r = __pyx_pf_8PyClical_9index_set_2__cinit__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), __pyx_v_other);
2733 __Pyx_RefNannyFinishContext();
2737 static int __pyx_pf_8PyClical_9index_set_2__cinit__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_other) {
2738 PyObject *__pyx_v_error_msg_prefix = NULL;
2739 PyObject *__pyx_v_idx = NULL;
2741 __Pyx_RefNannyDeclarations
2745 PyObject *__pyx_t_4 = NULL;
2746 PyObject *__pyx_t_5 = NULL;
2749 PyObject *__pyx_t_8 = NULL;
2750 PyObject *__pyx_t_9 = NULL;
2751 PyObject *__pyx_t_10 = NULL;
2752 Py_ssize_t __pyx_t_11;
2753 PyObject *(*__pyx_t_12)(PyObject *);
2754 PyObject *__pyx_t_13 = NULL;
2755 PyObject *__pyx_t_14 = NULL;
2756 PyObject *__pyx_t_15 = NULL;
2757 PyObject *__pyx_t_16 = NULL;
2759 __Pyx_RefNannySetupContext(
"__cinit__", 0);
2768 __Pyx_INCREF(__pyx_kp_s_Cannot_initialize_index_set_obje);
2769 __pyx_v_error_msg_prefix = __pyx_kp_s_Cannot_initialize_index_set_obje;
2778 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8PyClical_index_set);
2779 __pyx_t_2 = (__pyx_t_1 != 0);
2790 __pyx_t_3 =
new IndexSet(__pyx_f_8PyClical_9index_set_unwrap(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_other)));
2792 __Pyx_CppExn2PyErr();
2793 __PYX_ERR(0, 94, __pyx_L1_error)
2795 __pyx_v_self->instance = __pyx_t_3;
2814 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numbers);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 95, __pyx_L1_error)
2815 __Pyx_GOTREF(__pyx_t_4);
2816 __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)
2817 __Pyx_GOTREF(__pyx_t_5);
2818 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2819 __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)
2820 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2821 __pyx_t_1 = (__pyx_t_2 != 0);
2831 __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)
2833 __pyx_t_3 =
new IndexSet(((
int)__pyx_t_6));
2835 __Pyx_CppExn2PyErr();
2836 __PYX_ERR(0, 96, __pyx_L1_error)
2838 __pyx_v_self->instance = __pyx_t_3;
2857 __pyx_t_2 = PySet_Check(__pyx_v_other);
2858 __pyx_t_7 = (__pyx_t_2 != 0);
2861 __pyx_t_1 = __pyx_t_7;
2862 goto __pyx_L4_bool_binop_done;
2864 __pyx_t_7 = PyFrozenSet_Check(__pyx_v_other);
2865 __pyx_t_2 = (__pyx_t_7 != 0);
2866 __pyx_t_1 = __pyx_t_2;
2867 __pyx_L4_bool_binop_done:;
2868 __pyx_t_2 = (__pyx_t_1 != 0);
2879 __Pyx_PyThreadState_declare
2880 __Pyx_PyThreadState_assign
2881 __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
2882 __Pyx_XGOTREF(__pyx_t_8);
2883 __Pyx_XGOTREF(__pyx_t_9);
2884 __Pyx_XGOTREF(__pyx_t_10);
2895 __pyx_v_self->instance = __pyx_t_3;
2904 if (likely(PyList_CheckExact(__pyx_v_other)) || PyTuple_CheckExact(__pyx_v_other)) {
2905 __pyx_t_5 = __pyx_v_other; __Pyx_INCREF(__pyx_t_5); __pyx_t_11 = 0;
2908 __pyx_t_11 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_other);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 100, __pyx_L6_error)
2909 __Pyx_GOTREF(__pyx_t_5);
2910 __pyx_t_12 = Py_TYPE(__pyx_t_5)->tp_iternext;
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 100, __pyx_L6_error)
2913 if (likely(!__pyx_t_12)) {
2914 if (likely(PyList_CheckExact(__pyx_t_5))) {
2915 if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_5))
break;
2916 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 2917 __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)
2919 __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)
2920 __Pyx_GOTREF(__pyx_t_4);
2923 if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_5))
break;
2924 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 2925 __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)
2927 __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)
2928 __Pyx_GOTREF(__pyx_t_4);
2932 __pyx_t_4 = __pyx_t_12(__pyx_t_5);
2933 if (unlikely(!__pyx_t_4)) {
2934 PyObject* exc_type = PyErr_Occurred();
2936 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
2937 else __PYX_ERR(0, 100, __pyx_L6_error)
2941 __Pyx_GOTREF(__pyx_t_4);
2943 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_4);
2953 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self), __pyx_v_idx, Py_True) < 0)) __PYX_ERR(0, 101, __pyx_L6_error)
2963 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2973 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
2974 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
2975 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
2976 goto __pyx_L11_try_end;
2978 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
2979 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
2988 __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_IndexError);
2990 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2991 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_13) < 0) __PYX_ERR(0, 102, __pyx_L8_except_error)
2992 __Pyx_GOTREF(__pyx_t_5);
2993 __Pyx_GOTREF(__pyx_t_4);
2994 __Pyx_GOTREF(__pyx_t_13);
3003 __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)
3004 __Pyx_GOTREF(__pyx_t_14);
3005 __pyx_t_15 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 103, __pyx_L8_except_error)
3006 __Pyx_GOTREF(__pyx_t_15);
3007 __pyx_t_16 = PyNumber_Add(__pyx_t_14, __pyx_t_15);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 103, __pyx_L8_except_error)
3008 __Pyx_GOTREF(__pyx_t_16);
3009 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3010 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3011 __pyx_t_15 = PyNumber_Add(__pyx_t_16, __pyx_kp_s_);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 103, __pyx_L8_except_error)
3012 __Pyx_GOTREF(__pyx_t_15);
3013 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3014 __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)
3015 __Pyx_GOTREF(__pyx_t_16);
3016 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3017 __Pyx_Raise(__pyx_t_16, 0, 0, 0);
3018 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3019 __PYX_ERR(0, 103, __pyx_L8_except_error)
3029 __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
3031 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3032 if (__Pyx_GetException(&__pyx_t_13, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(0, 104, __pyx_L8_except_error)
3033 __Pyx_GOTREF(__pyx_t_13);
3034 __Pyx_GOTREF(__pyx_t_4);
3035 __Pyx_GOTREF(__pyx_t_5);
3044 __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)
3045 __Pyx_GOTREF(__pyx_t_16);
3046 __pyx_t_15 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 105, __pyx_L8_except_error)
3047 __Pyx_GOTREF(__pyx_t_15);
3048 __pyx_t_14 = PyNumber_Add(__pyx_t_16, __pyx_t_15);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 105, __pyx_L8_except_error)
3049 __Pyx_GOTREF(__pyx_t_14);
3050 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3051 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3052 __pyx_t_15 = PyNumber_Add(__pyx_t_14, __pyx_kp_s_);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 105, __pyx_L8_except_error)
3053 __Pyx_GOTREF(__pyx_t_15);
3054 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3055 __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)
3056 __Pyx_GOTREF(__pyx_t_14);
3057 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3058 __Pyx_Raise(__pyx_t_14, 0, 0, 0);
3059 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3060 __PYX_ERR(0, 105, __pyx_L8_except_error)
3062 goto __pyx_L8_except_error;
3063 __pyx_L8_except_error:;
3072 __Pyx_XGIVEREF(__pyx_t_8);
3073 __Pyx_XGIVEREF(__pyx_t_9);
3074 __Pyx_XGIVEREF(__pyx_t_10);
3075 __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
3076 goto __pyx_L1_error;
3097 __pyx_t_2 = PyString_Check(__pyx_v_other);
3098 __pyx_t_1 = (__pyx_t_2 != 0);
3099 if (likely(__pyx_t_1)) {
3109 __Pyx_PyThreadState_declare
3110 __Pyx_PyThreadState_assign
3111 __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
3112 __Pyx_XGOTREF(__pyx_t_10);
3113 __Pyx_XGOTREF(__pyx_t_9);
3114 __Pyx_XGOTREF(__pyx_t_8);
3124 __pyx_t_17 = __Pyx_PyObject_AsWritableString(__pyx_v_other);
if (unlikely((!__pyx_t_17) && PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L18_error)
3126 __pyx_t_3 =
new IndexSet(((
char *)__pyx_t_17));
3128 __Pyx_CppExn2PyErr();
3129 __PYX_ERR(0, 108, __pyx_L18_error)
3131 __pyx_v_self->instance = __pyx_t_3;
3141 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3142 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
3143 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3144 goto __pyx_L23_try_end;
3146 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
3147 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
3148 __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
3149 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
3150 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3151 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3160 __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
3162 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3163 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_13) < 0) __PYX_ERR(0, 109, __pyx_L20_except_error)
3164 __Pyx_GOTREF(__pyx_t_5);
3165 __Pyx_GOTREF(__pyx_t_4);
3166 __Pyx_GOTREF(__pyx_t_13);
3175 __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)
3176 __Pyx_GOTREF(__pyx_t_14);
3177 __pyx_t_15 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 110, __pyx_L20_except_error)
3178 __Pyx_GOTREF(__pyx_t_15);
3179 __pyx_t_16 = PyNumber_Add(__pyx_t_14, __pyx_t_15);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 110, __pyx_L20_except_error)
3180 __Pyx_GOTREF(__pyx_t_16);
3181 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3182 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3183 __pyx_t_15 = PyNumber_Add(__pyx_t_16, __pyx_kp_s_);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 110, __pyx_L20_except_error)
3184 __Pyx_GOTREF(__pyx_t_15);
3185 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3186 __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)
3187 __Pyx_GOTREF(__pyx_t_16);
3188 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3189 __Pyx_Raise(__pyx_t_16, 0, 0, 0);
3190 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3191 __PYX_ERR(0, 110, __pyx_L20_except_error)
3193 goto __pyx_L20_except_error;
3194 __pyx_L20_except_error:;
3203 __Pyx_XGIVEREF(__pyx_t_10);
3204 __Pyx_XGIVEREF(__pyx_t_9);
3205 __Pyx_XGIVEREF(__pyx_t_8);
3206 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8);
3207 goto __pyx_L1_error;
3229 __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)
3230 __Pyx_GOTREF(__pyx_t_13);
3231 __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)
3232 __Pyx_GOTREF(__pyx_t_4);
3233 __pyx_t_5 = PyNumber_Add(__pyx_t_13, __pyx_t_4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 112, __pyx_L1_error)
3234 __Pyx_GOTREF(__pyx_t_5);
3235 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
3236 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3237 __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_kp_s_);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 112, __pyx_L1_error)
3238 __Pyx_GOTREF(__pyx_t_4);
3239 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3240 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 112, __pyx_L1_error)
3241 __Pyx_GOTREF(__pyx_t_5);
3242 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3243 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
3244 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3245 __PYX_ERR(0, 112, __pyx_L1_error)
3261 __Pyx_XDECREF(__pyx_t_4);
3262 __Pyx_XDECREF(__pyx_t_5);
3263 __Pyx_XDECREF(__pyx_t_13);
3264 __Pyx_XDECREF(__pyx_t_14);
3265 __Pyx_XDECREF(__pyx_t_15);
3266 __Pyx_XDECREF(__pyx_t_16);
3267 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3270 __Pyx_XDECREF(__pyx_v_error_msg_prefix);
3271 __Pyx_XDECREF(__pyx_v_idx);
3272 __Pyx_RefNannyFinishContext();
3285 static void __pyx_pw_8PyClical_9index_set_5__dealloc__(PyObject *__pyx_v_self);
3286 static void __pyx_pw_8PyClical_9index_set_5__dealloc__(PyObject *__pyx_v_self) {
3287 __Pyx_RefNannyDeclarations
3288 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
3289 __pyx_pf_8PyClical_9index_set_4__dealloc__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
3292 __Pyx_RefNannyFinishContext();
3295 static void __pyx_pf_8PyClical_9index_set_4__dealloc__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
3296 __Pyx_RefNannyDeclarations
3297 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
3306 delete __pyx_v_self->instance;
3317 __Pyx_RefNannyFinishContext();
3329 static PyObject *__pyx_pw_8PyClical_9index_set_7__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op);
3330 static PyObject *__pyx_pw_8PyClical_9index_set_7__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op) {
3331 PyObject *__pyx_r = 0;
3332 __Pyx_RefNannyDeclarations
3333 __Pyx_RefNannySetupContext(
"__richcmp__ (wrapper)", 0);
3334 __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));
3337 __Pyx_RefNannyFinishContext();
3341 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) {
3342 PyObject *__pyx_v_eq = NULL;
3343 PyObject *__pyx_v_lt = NULL;
3344 PyObject *__pyx_r = NULL;
3345 __Pyx_RefNannyDeclarations
3349 PyObject *__pyx_t_4 = NULL;
3350 __Pyx_RefNannySetupContext(
"__richcmp__", 0);
3359 __pyx_t_2 = (((PyObject *)__pyx_v_lhs) == Py_None);
3360 __pyx_t_3 = (__pyx_t_2 != 0);
3363 __pyx_t_1 = __pyx_t_3;
3364 goto __pyx_L4_bool_binop_done;
3366 __pyx_t_3 = (__pyx_v_rhs == Py_None);
3367 __pyx_t_2 = (__pyx_t_3 != 0);
3368 __pyx_t_1 = __pyx_t_2;
3369 __pyx_L4_bool_binop_done:;
3379 __pyx_t_1 = (((PyObject *)__pyx_v_lhs) == __pyx_v_rhs);
3380 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 142, __pyx_L1_error)
3381 __Pyx_GOTREF(__pyx_t_4);
3382 __pyx_v_eq = __pyx_t_4;
3392 switch (__pyx_v_op) {
3402 __Pyx_XDECREF(__pyx_r);
3403 __Pyx_INCREF(__pyx_v_eq);
3404 __pyx_r = __pyx_v_eq;
3432 __Pyx_XDECREF(__pyx_r);
3433 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_eq);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 146, __pyx_L1_error)
3434 __pyx_t_4 = __Pyx_PyBool_FromLong((!__pyx_t_1));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error)
3435 __Pyx_GOTREF(__pyx_t_4);
3436 __pyx_r = __pyx_t_4;
3457 switch (__pyx_v_op) {
3467 __Pyx_XDECREF(__pyx_r);
3468 __Pyx_INCREF(Py_False);
3497 __Pyx_XDECREF(__pyx_r);
3498 __Pyx_INCREF(__pyx_v_eq);
3499 __pyx_r = __pyx_v_eq;
3527 __Pyx_XDECREF(__pyx_r);
3528 __Pyx_INCREF(Py_False);
3557 __Pyx_XDECREF(__pyx_r);
3558 __Pyx_INCREF(__pyx_v_eq);
3559 __pyx_r = __pyx_v_eq;
3579 __Pyx_XDECREF(__pyx_r);
3580 __Pyx_INCREF(__pyx_builtin_NotImplemented);
3581 __pyx_r = __pyx_builtin_NotImplemented;
3605 __pyx_t_1 = (__pyx_f_8PyClical_toIndexSet(((PyObject *)__pyx_v_lhs)) == __pyx_f_8PyClical_toIndexSet(__pyx_v_rhs));
3606 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error)
3607 __Pyx_GOTREF(__pyx_t_4);
3608 __pyx_v_eq = __pyx_t_4;
3618 switch (__pyx_v_op) {
3628 __Pyx_XDECREF(__pyx_r);
3629 __Pyx_INCREF(__pyx_v_eq);
3630 __pyx_r = __pyx_v_eq;
3658 __Pyx_XDECREF(__pyx_r);
3659 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_eq);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 163, __pyx_L1_error)
3660 __pyx_t_4 = __Pyx_PyBool_FromLong((!__pyx_t_1));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error)
3661 __Pyx_GOTREF(__pyx_t_4);
3662 __pyx_r = __pyx_t_4;
3683 __pyx_t_1 = (__pyx_f_8PyClical_toIndexSet(((PyObject *)__pyx_v_lhs)) < __pyx_f_8PyClical_toIndexSet(__pyx_v_rhs));
3684 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error)
3685 __Pyx_GOTREF(__pyx_t_4);
3686 __pyx_v_lt = __pyx_t_4;
3696 switch (__pyx_v_op) {
3706 __Pyx_XDECREF(__pyx_r);
3707 __Pyx_INCREF(__pyx_v_lt);
3708 __pyx_r = __pyx_v_lt;
3736 __Pyx_XDECREF(__pyx_r);
3737 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_lt);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 169, __pyx_L1_error)
3740 __Pyx_INCREF(__pyx_v_lt);
3741 __pyx_t_4 = __pyx_v_lt;
3742 goto __pyx_L6_bool_binop_done;
3744 __Pyx_INCREF(__pyx_v_eq);
3745 __pyx_t_4 = __pyx_v_eq;
3746 __pyx_L6_bool_binop_done:;
3747 __pyx_r = __pyx_t_4;
3776 __Pyx_XDECREF(__pyx_r);
3777 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_lt);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 171, __pyx_L1_error)
3780 __pyx_t_1 = __pyx_t_2;
3781 goto __pyx_L8_bool_binop_done;
3783 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_eq);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 171, __pyx_L1_error)
3784 __pyx_t_1 = __pyx_t_2;
3785 __pyx_L8_bool_binop_done:;
3786 __pyx_t_4 = __Pyx_PyBool_FromLong((!__pyx_t_1));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error)
3787 __Pyx_GOTREF(__pyx_t_4);
3788 __pyx_r = __pyx_t_4;
3817 __Pyx_XDECREF(__pyx_r);
3818 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_lt);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 173, __pyx_L1_error)
3819 __pyx_t_4 = __Pyx_PyBool_FromLong((!__pyx_t_1));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 173, __pyx_L1_error)
3820 __Pyx_GOTREF(__pyx_t_4);
3821 __pyx_r = __pyx_t_4;
3842 __Pyx_XDECREF(__pyx_r);
3843 __Pyx_INCREF(__pyx_builtin_NotImplemented);
3844 __pyx_r = __pyx_builtin_NotImplemented;
3862 __Pyx_XDECREF(__pyx_t_4);
3863 __Pyx_AddTraceback(
"PyClical.index_set.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3866 __Pyx_XDECREF(__pyx_v_eq);
3867 __Pyx_XDECREF(__pyx_v_lt);
3868 __Pyx_XGIVEREF(__pyx_r);
3869 __Pyx_RefNannyFinishContext();
3882 static int __pyx_pw_8PyClical_9index_set_9__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx, PyObject *__pyx_v_val);
3883 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 ";
3884 #if CYTHON_COMPILING_IN_CPYTHON 3885 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_8__setitem__;
3887 static int __pyx_pw_8PyClical_9index_set_9__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx, PyObject *__pyx_v_val) {
3889 __Pyx_RefNannyDeclarations
3890 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
3891 __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));
3894 __Pyx_RefNannyFinishContext();
3898 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) {
3900 __Pyx_RefNannyDeclarations
3903 __Pyx_RefNannySetupContext(
"__setitem__", 0);
3912 __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)
3913 __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)
3915 __pyx_v_self->instance->set(__pyx_t_1, __pyx_t_2);
3917 __Pyx_CppExn2PyErr();
3918 __PYX_ERR(0, 186, __pyx_L1_error)
3941 __Pyx_AddTraceback(
"PyClical.index_set.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3944 __Pyx_RefNannyFinishContext();
3957 static PyObject *__pyx_pw_8PyClical_9index_set_11__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx);
3958 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 ";
3959 #if CYTHON_COMPILING_IN_CPYTHON 3960 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_10__getitem__;
3962 static PyObject *__pyx_pw_8PyClical_9index_set_11__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx) {
3963 PyObject *__pyx_r = 0;
3964 __Pyx_RefNannyDeclarations
3965 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
3966 __pyx_r = __pyx_pf_8PyClical_9index_set_10__getitem__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_idx));
3969 __Pyx_RefNannyFinishContext();
3973 static PyObject *__pyx_pf_8PyClical_9index_set_10__getitem__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_idx) {
3974 PyObject *__pyx_r = NULL;
3975 __Pyx_RefNannyDeclarations
3977 PyObject *__pyx_t_2 = NULL;
3978 __Pyx_RefNannySetupContext(
"__getitem__", 0);
3987 __Pyx_XDECREF(__pyx_r);
3988 __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)
3989 __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)
3990 __Pyx_GOTREF(__pyx_t_2);
3991 __pyx_r = __pyx_t_2;
4005 __Pyx_XDECREF(__pyx_t_2);
4006 __Pyx_AddTraceback(
"PyClical.index_set.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4009 __Pyx_XGIVEREF(__pyx_r);
4010 __Pyx_RefNannyFinishContext();
4023 static int __pyx_pw_8PyClical_9index_set_13__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx);
4024 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 ";
4025 #if CYTHON_COMPILING_IN_CPYTHON 4026 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_12__contains__;
4028 static int __pyx_pw_8PyClical_9index_set_13__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx) {
4030 __Pyx_RefNannyDeclarations
4031 __Pyx_RefNannySetupContext(
"__contains__ (wrapper)", 0);
4032 __pyx_r = __pyx_pf_8PyClical_9index_set_12__contains__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_idx));
4035 __Pyx_RefNannyFinishContext();
4039 static int __pyx_pf_8PyClical_9index_set_12__contains__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_idx) {
4041 __Pyx_RefNannyDeclarations
4043 __Pyx_RefNannySetupContext(
"__contains__", 0);
4052 __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)
4053 __pyx_r = __pyx_v_self->instance->operator[](__pyx_t_1);
4066 __Pyx_AddTraceback(
"PyClical.index_set.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4069 __Pyx_RefNannyFinishContext();
4072 static PyObject *__pyx_gb_8PyClical_9index_set_16generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value);
4083 static PyObject *__pyx_pw_8PyClical_9index_set_15__iter__(PyObject *__pyx_v_self);
4084 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 ";
4085 #if CYTHON_COMPILING_IN_CPYTHON 4086 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_14__iter__;
4088 static PyObject *__pyx_pw_8PyClical_9index_set_15__iter__(PyObject *__pyx_v_self) {
4089 PyObject *__pyx_r = 0;
4090 __Pyx_RefNannyDeclarations
4091 __Pyx_RefNannySetupContext(
"__iter__ (wrapper)", 0);
4092 __pyx_r = __pyx_pf_8PyClical_9index_set_14__iter__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
4095 __Pyx_RefNannyFinishContext();
4099 static PyObject *__pyx_pf_8PyClical_9index_set_14__iter__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
4100 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *__pyx_cur_scope;
4101 PyObject *__pyx_r = NULL;
4102 __Pyx_RefNannyDeclarations
4103 __Pyx_RefNannySetupContext(
"__iter__", 0);
4104 __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);
4105 if (unlikely(!__pyx_cur_scope)) {
4106 __pyx_cur_scope = ((
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)Py_None);
4107 __Pyx_INCREF(Py_None);
4108 __PYX_ERR(0, 227, __pyx_L1_error)
4110 __Pyx_GOTREF(__pyx_cur_scope);
4112 __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
4113 __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
4114 __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
4116 __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)
4117 __Pyx_DECREF(__pyx_cur_scope);
4118 __Pyx_RefNannyFinishContext();
4119 return (PyObject *) gen;
4124 __Pyx_AddTraceback(
"PyClical.index_set.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4126 __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
4127 __Pyx_XGIVEREF(__pyx_r);
4128 __Pyx_RefNannyFinishContext();
4132 static PyObject *__pyx_gb_8PyClical_9index_set_16generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value)
4134 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *__pyx_cur_scope = ((
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)__pyx_generator->closure);
4135 PyObject *__pyx_r = NULL;
4136 PyObject *__pyx_t_1 = NULL;
4137 PyObject *__pyx_t_2 = NULL;
4138 PyObject *__pyx_t_3 = NULL;
4139 PyObject *__pyx_t_4 = NULL;
4140 Py_ssize_t __pyx_t_5;
4141 PyObject *(*__pyx_t_6)(PyObject *);
4144 __Pyx_RefNannyDeclarations
4145 __Pyx_RefNannySetupContext(
"__iter__", 0);
4146 switch (__pyx_generator->resume_label) {
4147 case 0:
goto __pyx_L3_first_run;
4148 case 1:
goto __pyx_L7_resume_from_yield;
4150 __Pyx_RefNannyFinishContext();
4153 __pyx_L3_first_run:;
4154 if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 227, __pyx_L1_error)
4163 __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)
4164 __Pyx_GOTREF(__pyx_t_2);
4166 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
4167 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
4168 if (likely(__pyx_t_3)) {
4169 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
4170 __Pyx_INCREF(__pyx_t_3);
4171 __Pyx_INCREF(
function);
4172 __Pyx_DECREF_SET(__pyx_t_2,
function);
4176 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error)
4177 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4179 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error)
4181 __Pyx_GOTREF(__pyx_t_1);
4182 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4183 __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)
4184 __Pyx_GOTREF(__pyx_t_3);
4186 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4187 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
4188 if (likely(__pyx_t_4)) {
4189 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4190 __Pyx_INCREF(__pyx_t_4);
4191 __Pyx_INCREF(
function);
4192 __Pyx_DECREF_SET(__pyx_t_3,
function);
4196 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error)
4197 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4199 __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error)
4201 __Pyx_GOTREF(__pyx_t_2);
4202 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4203 __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)
4204 __Pyx_GOTREF(__pyx_t_3);
4205 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4206 __pyx_t_2 = PyTuple_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error)
4207 __Pyx_GOTREF(__pyx_t_2);
4208 __Pyx_GIVEREF(__pyx_t_1);
4209 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
4210 __Pyx_GIVEREF(__pyx_t_3);
4211 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
4214 __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)
4215 __Pyx_GOTREF(__pyx_t_3);
4216 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4217 if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
4218 __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
4221 __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error)
4222 __Pyx_GOTREF(__pyx_t_2);
4223 __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext;
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error)
4225 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4227 if (likely(!__pyx_t_6)) {
4228 if (likely(PyList_CheckExact(__pyx_t_2))) {
4229 if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2))
break;
4230 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 4231 __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)
4233 __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)
4234 __Pyx_GOTREF(__pyx_t_3);
4237 if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2))
break;
4238 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 4239 __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)
4241 __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)
4242 __Pyx_GOTREF(__pyx_t_3);
4246 __pyx_t_3 = __pyx_t_6(__pyx_t_2);
4247 if (unlikely(!__pyx_t_3)) {
4248 PyObject* exc_type = PyErr_Occurred();
4250 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
4251 else __PYX_ERR(0, 234, __pyx_L1_error)
4255 __Pyx_GOTREF(__pyx_t_3);
4257 __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_idx);
4258 __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_idx, __pyx_t_3);
4259 __Pyx_GIVEREF(__pyx_t_3);
4269 __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)
4270 __pyx_t_8 = (__pyx_t_7 != 0);
4280 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_idx);
4281 __pyx_r = __pyx_cur_scope->__pyx_v_idx;
4282 __Pyx_XGIVEREF(__pyx_t_2);
4283 __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
4284 __pyx_cur_scope->__pyx_t_1 = __pyx_t_5;
4285 __pyx_cur_scope->__pyx_t_2 = __pyx_t_6;
4286 __Pyx_XGIVEREF(__pyx_r);
4287 __Pyx_RefNannyFinishContext();
4288 __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
4290 __pyx_generator->resume_label = 1;
4292 __pyx_L7_resume_from_yield:;
4293 __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
4294 __pyx_cur_scope->__pyx_t_0 = 0;
4295 __Pyx_XGOTREF(__pyx_t_2);
4296 __pyx_t_5 = __pyx_cur_scope->__pyx_t_1;
4297 __pyx_t_6 = __pyx_cur_scope->__pyx_t_2;
4298 if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 236, __pyx_L1_error)
4317 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4318 CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
4329 PyErr_SetNone(PyExc_StopIteration);
4332 __Pyx_XDECREF(__pyx_t_1);
4333 __Pyx_XDECREF(__pyx_t_2);
4334 __Pyx_XDECREF(__pyx_t_3);
4335 __Pyx_XDECREF(__pyx_t_4);
4336 __Pyx_AddTraceback(
"__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4338 __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
4339 __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
4340 __pyx_generator->resume_label = -1;
4341 __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
4342 __Pyx_RefNannyFinishContext();
4355 static PyObject *__pyx_pw_8PyClical_9index_set_18__invert__(PyObject *__pyx_v_self);
4356 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 ";
4357 #if CYTHON_COMPILING_IN_CPYTHON 4358 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_17__invert__;
4360 static PyObject *__pyx_pw_8PyClical_9index_set_18__invert__(PyObject *__pyx_v_self) {
4361 PyObject *__pyx_r = 0;
4362 __Pyx_RefNannyDeclarations
4363 __Pyx_RefNannySetupContext(
"__invert__ (wrapper)", 0);
4364 __pyx_r = __pyx_pf_8PyClical_9index_set_17__invert__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
4367 __Pyx_RefNannyFinishContext();
4371 static PyObject *__pyx_pf_8PyClical_9index_set_17__invert__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
4372 PyObject *__pyx_r = NULL;
4373 __Pyx_RefNannyDeclarations
4374 PyObject *__pyx_t_1 = NULL;
4375 PyObject *__pyx_t_2 = NULL;
4376 __Pyx_RefNannySetupContext(
"__invert__", 0);
4385 __Pyx_XDECREF(__pyx_r);
4386 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_index_set));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 245, __pyx_L1_error)
4387 __Pyx_GOTREF(__pyx_t_1);
4388 __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)
4389 __Pyx_GOTREF(__pyx_t_2);
4390 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4391 __pyx_r = __pyx_t_2;
4405 __Pyx_XDECREF(__pyx_t_1);
4406 __Pyx_XDECREF(__pyx_t_2);
4407 __Pyx_AddTraceback(
"PyClical.index_set.__invert__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4410 __Pyx_XGIVEREF(__pyx_r);
4411 __Pyx_RefNannyFinishContext();
4424 static PyObject *__pyx_pw_8PyClical_9index_set_20__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
4425 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 ";
4426 #if CYTHON_COMPILING_IN_CPYTHON 4427 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_19__xor__;
4429 static PyObject *__pyx_pw_8PyClical_9index_set_20__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4430 PyObject *__pyx_r = 0;
4431 __Pyx_RefNannyDeclarations
4432 __Pyx_RefNannySetupContext(
"__xor__ (wrapper)", 0);
4433 __pyx_r = __pyx_pf_8PyClical_9index_set_19__xor__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
4436 __Pyx_RefNannyFinishContext();
4440 static PyObject *__pyx_pf_8PyClical_9index_set_19__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4441 PyObject *__pyx_r = NULL;
4442 __Pyx_RefNannyDeclarations
4443 PyObject *__pyx_t_1 = NULL;
4444 PyObject *__pyx_t_2 = NULL;
4445 __Pyx_RefNannySetupContext(
"__xor__", 0);
4454 __Pyx_XDECREF(__pyx_r);
4455 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_index_set));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error)
4456 __Pyx_GOTREF(__pyx_t_1);
4457 __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)
4458 __Pyx_GOTREF(__pyx_t_2);
4459 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4460 __pyx_r = __pyx_t_2;
4474 __Pyx_XDECREF(__pyx_t_1);
4475 __Pyx_XDECREF(__pyx_t_2);
4476 __Pyx_AddTraceback(
"PyClical.index_set.__xor__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4479 __Pyx_XGIVEREF(__pyx_r);
4480 __Pyx_RefNannyFinishContext();
4493 static PyObject *__pyx_pw_8PyClical_9index_set_22__ixor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
4494 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 ";
4495 #if CYTHON_COMPILING_IN_CPYTHON 4496 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_21__ixor__;
4498 static PyObject *__pyx_pw_8PyClical_9index_set_22__ixor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
4499 PyObject *__pyx_r = 0;
4500 __Pyx_RefNannyDeclarations
4501 __Pyx_RefNannySetupContext(
"__ixor__ (wrapper)", 0);
4502 __pyx_r = __pyx_pf_8PyClical_9index_set_21__ixor__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
4505 __Pyx_RefNannyFinishContext();
4509 static PyObject *__pyx_pf_8PyClical_9index_set_21__ixor__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs) {
4510 PyObject *__pyx_r = NULL;
4511 __Pyx_RefNannyDeclarations
4512 PyObject *__pyx_t_1 = NULL;
4513 __Pyx_RefNannySetupContext(
"__ixor__", 0);
4522 __Pyx_XDECREF(__pyx_r);
4523 __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)
4524 __Pyx_GOTREF(__pyx_t_1);
4525 __pyx_r = __pyx_t_1;
4539 __Pyx_XDECREF(__pyx_t_1);
4540 __Pyx_AddTraceback(
"PyClical.index_set.__ixor__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4543 __Pyx_XGIVEREF(__pyx_r);
4544 __Pyx_RefNannyFinishContext();
4557 static PyObject *__pyx_pw_8PyClical_9index_set_24__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
4558 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 ";
4559 #if CYTHON_COMPILING_IN_CPYTHON 4560 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_23__and__;
4562 static PyObject *__pyx_pw_8PyClical_9index_set_24__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4563 PyObject *__pyx_r = 0;
4564 __Pyx_RefNannyDeclarations
4565 __Pyx_RefNannySetupContext(
"__and__ (wrapper)", 0);
4566 __pyx_r = __pyx_pf_8PyClical_9index_set_23__and__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
4569 __Pyx_RefNannyFinishContext();
4573 static PyObject *__pyx_pf_8PyClical_9index_set_23__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4574 PyObject *__pyx_r = NULL;
4575 __Pyx_RefNannyDeclarations
4576 PyObject *__pyx_t_1 = NULL;
4577 PyObject *__pyx_t_2 = NULL;
4578 __Pyx_RefNannySetupContext(
"__and__", 0);
4587 __Pyx_XDECREF(__pyx_r);
4588 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_index_set));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __pyx_L1_error)
4589 __Pyx_GOTREF(__pyx_t_1);
4590 __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)
4591 __Pyx_GOTREF(__pyx_t_2);
4592 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4593 __pyx_r = __pyx_t_2;
4607 __Pyx_XDECREF(__pyx_t_1);
4608 __Pyx_XDECREF(__pyx_t_2);
4609 __Pyx_AddTraceback(
"PyClical.index_set.__and__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4612 __Pyx_XGIVEREF(__pyx_r);
4613 __Pyx_RefNannyFinishContext();
4626 static PyObject *__pyx_pw_8PyClical_9index_set_26__iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
4627 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 ";
4628 #if CYTHON_COMPILING_IN_CPYTHON 4629 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_25__iand__;
4631 static PyObject *__pyx_pw_8PyClical_9index_set_26__iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
4632 PyObject *__pyx_r = 0;
4633 __Pyx_RefNannyDeclarations
4634 __Pyx_RefNannySetupContext(
"__iand__ (wrapper)", 0);
4635 __pyx_r = __pyx_pf_8PyClical_9index_set_25__iand__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
4638 __Pyx_RefNannyFinishContext();
4642 static PyObject *__pyx_pf_8PyClical_9index_set_25__iand__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs) {
4643 PyObject *__pyx_r = NULL;
4644 __Pyx_RefNannyDeclarations
4645 PyObject *__pyx_t_1 = NULL;
4646 __Pyx_RefNannySetupContext(
"__iand__", 0);
4655 __Pyx_XDECREF(__pyx_r);
4656 __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)
4657 __Pyx_GOTREF(__pyx_t_1);
4658 __pyx_r = __pyx_t_1;
4672 __Pyx_XDECREF(__pyx_t_1);
4673 __Pyx_AddTraceback(
"PyClical.index_set.__iand__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4676 __Pyx_XGIVEREF(__pyx_r);
4677 __Pyx_RefNannyFinishContext();
4690 static PyObject *__pyx_pw_8PyClical_9index_set_28__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
4691 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 ";
4692 #if CYTHON_COMPILING_IN_CPYTHON 4693 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_27__or__;
4695 static PyObject *__pyx_pw_8PyClical_9index_set_28__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4696 PyObject *__pyx_r = 0;
4697 __Pyx_RefNannyDeclarations
4698 __Pyx_RefNannySetupContext(
"__or__ (wrapper)", 0);
4699 __pyx_r = __pyx_pf_8PyClical_9index_set_27__or__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
4702 __Pyx_RefNannyFinishContext();
4706 static PyObject *__pyx_pf_8PyClical_9index_set_27__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4707 PyObject *__pyx_r = NULL;
4708 __Pyx_RefNannyDeclarations
4709 PyObject *__pyx_t_1 = NULL;
4710 PyObject *__pyx_t_2 = NULL;
4711 __Pyx_RefNannySetupContext(
"__or__", 0);
4720 __Pyx_XDECREF(__pyx_r);
4721 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_index_set));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error)
4722 __Pyx_GOTREF(__pyx_t_1);
4723 __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)
4724 __Pyx_GOTREF(__pyx_t_2);
4725 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4726 __pyx_r = __pyx_t_2;
4740 __Pyx_XDECREF(__pyx_t_1);
4741 __Pyx_XDECREF(__pyx_t_2);
4742 __Pyx_AddTraceback(
"PyClical.index_set.__or__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4745 __Pyx_XGIVEREF(__pyx_r);
4746 __Pyx_RefNannyFinishContext();
4759 static PyObject *__pyx_pw_8PyClical_9index_set_30__ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
4760 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 ";
4761 #if CYTHON_COMPILING_IN_CPYTHON 4762 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_29__ior__;
4764 static PyObject *__pyx_pw_8PyClical_9index_set_30__ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
4765 PyObject *__pyx_r = 0;
4766 __Pyx_RefNannyDeclarations
4767 __Pyx_RefNannySetupContext(
"__ior__ (wrapper)", 0);
4768 __pyx_r = __pyx_pf_8PyClical_9index_set_29__ior__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
4771 __Pyx_RefNannyFinishContext();
4775 static PyObject *__pyx_pf_8PyClical_9index_set_29__ior__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs) {
4776 PyObject *__pyx_r = NULL;
4777 __Pyx_RefNannyDeclarations
4778 PyObject *__pyx_t_1 = NULL;
4779 __Pyx_RefNannySetupContext(
"__ior__", 0);
4788 __Pyx_XDECREF(__pyx_r);
4789 __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)
4790 __Pyx_GOTREF(__pyx_t_1);
4791 __pyx_r = __pyx_t_1;
4805 __Pyx_XDECREF(__pyx_t_1);
4806 __Pyx_AddTraceback(
"PyClical.index_set.__ior__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4809 __Pyx_XGIVEREF(__pyx_r);
4810 __Pyx_RefNannyFinishContext();
4823 static PyObject *__pyx_pw_8PyClical_9index_set_32count(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4824 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 ";
4825 static PyObject *__pyx_pw_8PyClical_9index_set_32count(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4826 PyObject *__pyx_r = 0;
4827 __Pyx_RefNannyDeclarations
4828 __Pyx_RefNannySetupContext(
"count (wrapper)", 0);
4829 __pyx_r = __pyx_pf_8PyClical_9index_set_31count(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
4832 __Pyx_RefNannyFinishContext();
4836 static PyObject *__pyx_pf_8PyClical_9index_set_31count(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
4837 PyObject *__pyx_r = NULL;
4838 __Pyx_RefNannyDeclarations
4839 PyObject *__pyx_t_1 = NULL;
4840 __Pyx_RefNannySetupContext(
"count", 0);
4849 __Pyx_XDECREF(__pyx_r);
4850 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->instance->count());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error)
4851 __Pyx_GOTREF(__pyx_t_1);
4852 __pyx_r = __pyx_t_1;
4866 __Pyx_XDECREF(__pyx_t_1);
4867 __Pyx_AddTraceback(
"PyClical.index_set.count", __pyx_clineno, __pyx_lineno, __pyx_filename);
4870 __Pyx_XGIVEREF(__pyx_r);
4871 __Pyx_RefNannyFinishContext();
4884 static PyObject *__pyx_pw_8PyClical_9index_set_34count_neg(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4885 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 ";
4886 static PyObject *__pyx_pw_8PyClical_9index_set_34count_neg(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4887 PyObject *__pyx_r = 0;
4888 __Pyx_RefNannyDeclarations
4889 __Pyx_RefNannySetupContext(
"count_neg (wrapper)", 0);
4890 __pyx_r = __pyx_pf_8PyClical_9index_set_33count_neg(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
4893 __Pyx_RefNannyFinishContext();
4897 static PyObject *__pyx_pf_8PyClical_9index_set_33count_neg(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
4898 PyObject *__pyx_r = NULL;
4899 __Pyx_RefNannyDeclarations
4900 PyObject *__pyx_t_1 = NULL;
4901 __Pyx_RefNannySetupContext(
"count_neg", 0);
4910 __Pyx_XDECREF(__pyx_r);
4911 __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)
4912 __Pyx_GOTREF(__pyx_t_1);
4913 __pyx_r = __pyx_t_1;
4927 __Pyx_XDECREF(__pyx_t_1);
4928 __Pyx_AddTraceback(
"PyClical.index_set.count_neg", __pyx_clineno, __pyx_lineno, __pyx_filename);
4931 __Pyx_XGIVEREF(__pyx_r);
4932 __Pyx_RefNannyFinishContext();
4945 static PyObject *__pyx_pw_8PyClical_9index_set_36count_pos(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4946 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 ";
4947 static PyObject *__pyx_pw_8PyClical_9index_set_36count_pos(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4948 PyObject *__pyx_r = 0;
4949 __Pyx_RefNannyDeclarations
4950 __Pyx_RefNannySetupContext(
"count_pos (wrapper)", 0);
4951 __pyx_r = __pyx_pf_8PyClical_9index_set_35count_pos(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
4954 __Pyx_RefNannyFinishContext();
4958 static PyObject *__pyx_pf_8PyClical_9index_set_35count_pos(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
4959 PyObject *__pyx_r = NULL;
4960 __Pyx_RefNannyDeclarations
4961 PyObject *__pyx_t_1 = NULL;
4962 __Pyx_RefNannySetupContext(
"count_pos", 0);
4971 __Pyx_XDECREF(__pyx_r);
4972 __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)
4973 __Pyx_GOTREF(__pyx_t_1);
4974 __pyx_r = __pyx_t_1;
4988 __Pyx_XDECREF(__pyx_t_1);
4989 __Pyx_AddTraceback(
"PyClical.index_set.count_pos", __pyx_clineno, __pyx_lineno, __pyx_filename);
4992 __Pyx_XGIVEREF(__pyx_r);
4993 __Pyx_RefNannyFinishContext();
5006 static PyObject *__pyx_pw_8PyClical_9index_set_38min(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5007 static char __pyx_doc_8PyClical_9index_set_37min[] =
"\n Minimum member.\n\n >>> index_set({-1,1,2}).min()\n -1\n ";
5008 static PyObject *__pyx_pw_8PyClical_9index_set_38min(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5009 PyObject *__pyx_r = 0;
5010 __Pyx_RefNannyDeclarations
5011 __Pyx_RefNannySetupContext(
"min (wrapper)", 0);
5012 __pyx_r = __pyx_pf_8PyClical_9index_set_37min(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5015 __Pyx_RefNannyFinishContext();
5019 static PyObject *__pyx_pf_8PyClical_9index_set_37min(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5020 PyObject *__pyx_r = NULL;
5021 __Pyx_RefNannyDeclarations
5022 PyObject *__pyx_t_1 = NULL;
5023 __Pyx_RefNannySetupContext(
"min", 0);
5032 __Pyx_XDECREF(__pyx_r);
5033 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->instance->min());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 347, __pyx_L1_error)
5034 __Pyx_GOTREF(__pyx_t_1);
5035 __pyx_r = __pyx_t_1;
5049 __Pyx_XDECREF(__pyx_t_1);
5050 __Pyx_AddTraceback(
"PyClical.index_set.min", __pyx_clineno, __pyx_lineno, __pyx_filename);
5053 __Pyx_XGIVEREF(__pyx_r);
5054 __Pyx_RefNannyFinishContext();
5067 static PyObject *__pyx_pw_8PyClical_9index_set_40max(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5068 static char __pyx_doc_8PyClical_9index_set_39max[] =
"\n Maximum member.\n\n >>> index_set({-1,1,2}).max()\n 2\n ";
5069 static PyObject *__pyx_pw_8PyClical_9index_set_40max(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5070 PyObject *__pyx_r = 0;
5071 __Pyx_RefNannyDeclarations
5072 __Pyx_RefNannySetupContext(
"max (wrapper)", 0);
5073 __pyx_r = __pyx_pf_8PyClical_9index_set_39max(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5076 __Pyx_RefNannyFinishContext();
5080 static PyObject *__pyx_pf_8PyClical_9index_set_39max(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5081 PyObject *__pyx_r = NULL;
5082 __Pyx_RefNannyDeclarations
5083 PyObject *__pyx_t_1 = NULL;
5084 __Pyx_RefNannySetupContext(
"max", 0);
5093 __Pyx_XDECREF(__pyx_r);
5094 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->instance->max());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error)
5095 __Pyx_GOTREF(__pyx_t_1);
5096 __pyx_r = __pyx_t_1;
5110 __Pyx_XDECREF(__pyx_t_1);
5111 __Pyx_AddTraceback(
"PyClical.index_set.max", __pyx_clineno, __pyx_lineno, __pyx_filename);
5114 __Pyx_XGIVEREF(__pyx_r);
5115 __Pyx_RefNannyFinishContext();
5128 static PyObject *__pyx_pw_8PyClical_9index_set_42hash_fn(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5129 static char __pyx_doc_8PyClical_9index_set_41hash_fn[] =
"\n Hash function.\n ";
5130 static PyObject *__pyx_pw_8PyClical_9index_set_42hash_fn(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5131 PyObject *__pyx_r = 0;
5132 __Pyx_RefNannyDeclarations
5133 __Pyx_RefNannySetupContext(
"hash_fn (wrapper)", 0);
5134 __pyx_r = __pyx_pf_8PyClical_9index_set_41hash_fn(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5137 __Pyx_RefNannyFinishContext();
5141 static PyObject *__pyx_pf_8PyClical_9index_set_41hash_fn(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5142 PyObject *__pyx_r = NULL;
5143 __Pyx_RefNannyDeclarations
5144 PyObject *__pyx_t_1 = NULL;
5145 __Pyx_RefNannySetupContext(
"hash_fn", 0);
5154 __Pyx_XDECREF(__pyx_r);
5155 __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)
5156 __Pyx_GOTREF(__pyx_t_1);
5157 __pyx_r = __pyx_t_1;
5171 __Pyx_XDECREF(__pyx_t_1);
5172 __Pyx_AddTraceback(
"PyClical.index_set.hash_fn", __pyx_clineno, __pyx_lineno, __pyx_filename);
5175 __Pyx_XGIVEREF(__pyx_r);
5176 __Pyx_RefNannyFinishContext();
5189 static PyObject *__pyx_pw_8PyClical_9index_set_44sign_of_mult(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
5190 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 ";
5191 static PyObject *__pyx_pw_8PyClical_9index_set_44sign_of_mult(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
5192 PyObject *__pyx_r = 0;
5193 __Pyx_RefNannyDeclarations
5194 __Pyx_RefNannySetupContext(
"sign_of_mult (wrapper)", 0);
5195 __pyx_r = __pyx_pf_8PyClical_9index_set_43sign_of_mult(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
5198 __Pyx_RefNannyFinishContext();
5202 static PyObject *__pyx_pf_8PyClical_9index_set_43sign_of_mult(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs) {
5203 PyObject *__pyx_r = NULL;
5204 __Pyx_RefNannyDeclarations
5205 PyObject *__pyx_t_1 = NULL;
5206 __Pyx_RefNannySetupContext(
"sign_of_mult", 0);
5215 __Pyx_XDECREF(__pyx_r);
5216 __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)
5217 __Pyx_GOTREF(__pyx_t_1);
5218 __pyx_r = __pyx_t_1;
5232 __Pyx_XDECREF(__pyx_t_1);
5233 __Pyx_AddTraceback(
"PyClical.index_set.sign_of_mult", __pyx_clineno, __pyx_lineno, __pyx_filename);
5236 __Pyx_XGIVEREF(__pyx_r);
5237 __Pyx_RefNannyFinishContext();
5250 static PyObject *__pyx_pw_8PyClical_9index_set_46sign_of_square(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5251 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 ";
5252 static PyObject *__pyx_pw_8PyClical_9index_set_46sign_of_square(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5253 PyObject *__pyx_r = 0;
5254 __Pyx_RefNannyDeclarations
5255 __Pyx_RefNannySetupContext(
"sign_of_square (wrapper)", 0);
5256 __pyx_r = __pyx_pf_8PyClical_9index_set_45sign_of_square(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5259 __Pyx_RefNannyFinishContext();
5263 static PyObject *__pyx_pf_8PyClical_9index_set_45sign_of_square(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5264 PyObject *__pyx_r = NULL;
5265 __Pyx_RefNannyDeclarations
5266 PyObject *__pyx_t_1 = NULL;
5267 __Pyx_RefNannySetupContext(
"sign_of_square", 0);
5276 __Pyx_XDECREF(__pyx_r);
5277 __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)
5278 __Pyx_GOTREF(__pyx_t_1);
5279 __pyx_r = __pyx_t_1;
5293 __Pyx_XDECREF(__pyx_t_1);
5294 __Pyx_AddTraceback(
"PyClical.index_set.sign_of_square", __pyx_clineno, __pyx_lineno, __pyx_filename);
5297 __Pyx_XGIVEREF(__pyx_r);
5298 __Pyx_RefNannyFinishContext();
5311 static PyObject *__pyx_pw_8PyClical_9index_set_48__repr__(PyObject *__pyx_v_self);
5312 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 ";
5313 #if CYTHON_COMPILING_IN_CPYTHON 5314 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_47__repr__;
5316 static PyObject *__pyx_pw_8PyClical_9index_set_48__repr__(PyObject *__pyx_v_self) {
5317 PyObject *__pyx_r = 0;
5318 __Pyx_RefNannyDeclarations
5319 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
5320 __pyx_r = __pyx_pf_8PyClical_9index_set_47__repr__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5323 __Pyx_RefNannyFinishContext();
5327 static PyObject *__pyx_pf_8PyClical_9index_set_47__repr__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5328 PyObject *__pyx_r = NULL;
5329 __Pyx_RefNannyDeclarations
5330 PyObject *__pyx_t_1 = NULL;
5331 __Pyx_RefNannySetupContext(
"__repr__", 0);
5340 __Pyx_XDECREF(__pyx_r);
5341 __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)
5342 __Pyx_GOTREF(__pyx_t_1);
5343 __pyx_r = __pyx_t_1;
5357 __Pyx_XDECREF(__pyx_t_1);
5358 __Pyx_AddTraceback(
"PyClical.index_set.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5361 __Pyx_XGIVEREF(__pyx_r);
5362 __Pyx_RefNannyFinishContext();
5375 static PyObject *__pyx_pw_8PyClical_9index_set_50__str__(PyObject *__pyx_v_self);
5376 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 ";
5377 #if CYTHON_COMPILING_IN_CPYTHON 5378 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_49__str__;
5380 static PyObject *__pyx_pw_8PyClical_9index_set_50__str__(PyObject *__pyx_v_self) {
5381 PyObject *__pyx_r = 0;
5382 __Pyx_RefNannyDeclarations
5383 __Pyx_RefNannySetupContext(
"__str__ (wrapper)", 0);
5384 __pyx_r = __pyx_pf_8PyClical_9index_set_49__str__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5387 __Pyx_RefNannyFinishContext();
5391 static PyObject *__pyx_pf_8PyClical_9index_set_49__str__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5392 PyObject *__pyx_r = NULL;
5393 __Pyx_RefNannyDeclarations
5394 PyObject *__pyx_t_1 = NULL;
5395 __Pyx_RefNannySetupContext(
"__str__", 0);
5404 __Pyx_XDECREF(__pyx_r);
5405 __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)
5406 __Pyx_GOTREF(__pyx_t_1);
5407 __pyx_r = __pyx_t_1;
5421 __Pyx_XDECREF(__pyx_t_1);
5422 __Pyx_AddTraceback(
"PyClical.index_set.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5425 __Pyx_XGIVEREF(__pyx_r);
5426 __Pyx_RefNannyFinishContext();
5437 static PyObject *__pyx_pw_8PyClical_9index_set_52__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5438 static PyObject *__pyx_pw_8PyClical_9index_set_52__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5439 PyObject *__pyx_r = 0;
5440 __Pyx_RefNannyDeclarations
5441 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
5442 __pyx_r = __pyx_pf_8PyClical_9index_set_51__reduce_cython__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5445 __Pyx_RefNannyFinishContext();
5449 static PyObject *__pyx_pf_8PyClical_9index_set_51__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5450 PyObject *__pyx_r = NULL;
5451 __Pyx_RefNannyDeclarations
5452 PyObject *__pyx_t_1 = NULL;
5453 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
5461 __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)
5462 __Pyx_GOTREF(__pyx_t_1);
5463 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5464 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5465 __PYX_ERR(1, 2, __pyx_L1_error)
5475 __Pyx_XDECREF(__pyx_t_1);
5476 __Pyx_AddTraceback(
"PyClical.index_set.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5478 __Pyx_XGIVEREF(__pyx_r);
5479 __Pyx_RefNannyFinishContext();
5491 static PyObject *__pyx_pw_8PyClical_9index_set_54__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
5492 static PyObject *__pyx_pw_8PyClical_9index_set_54__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
5493 PyObject *__pyx_r = 0;
5494 __Pyx_RefNannyDeclarations
5495 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
5496 __pyx_r = __pyx_pf_8PyClical_9index_set_53__setstate_cython__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
5499 __Pyx_RefNannyFinishContext();
5503 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) {
5504 PyObject *__pyx_r = NULL;
5505 __Pyx_RefNannyDeclarations
5506 PyObject *__pyx_t_1 = NULL;
5507 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
5514 __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)
5515 __Pyx_GOTREF(__pyx_t_1);
5516 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5517 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5518 __PYX_ERR(1, 4, __pyx_L1_error)
5529 __Pyx_XDECREF(__pyx_t_1);
5530 __Pyx_AddTraceback(
"PyClical.index_set.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5532 __Pyx_XGIVEREF(__pyx_r);
5533 __Pyx_RefNannyFinishContext();
5546 static PyObject *__pyx_pw_8PyClical_1index_set_hidden_doctests(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused);
5547 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 ";
5548 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};
5549 static PyObject *__pyx_pw_8PyClical_1index_set_hidden_doctests(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
5550 PyObject *__pyx_r = 0;
5551 __Pyx_RefNannyDeclarations
5552 __Pyx_RefNannySetupContext(
"index_set_hidden_doctests (wrapper)", 0);
5553 __pyx_r = __pyx_pf_8PyClical_index_set_hidden_doctests(__pyx_self);
5556 __Pyx_RefNannyFinishContext();
5560 static PyObject *__pyx_pf_8PyClical_index_set_hidden_doctests(CYTHON_UNUSED PyObject *__pyx_self) {
5561 PyObject *__pyx_r = NULL;
5562 __Pyx_RefNannyDeclarations
5563 __Pyx_RefNannySetupContext(
"index_set_hidden_doctests", 0);
5572 __Pyx_XDECREF(__pyx_r);
5573 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5586 __Pyx_XGIVEREF(__pyx_r);
5587 __Pyx_RefNannyFinishContext();
5599 static PyObject *__pyx_pw_8PyClical_3compare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5600 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_compare(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs, CYTHON_UNUSED
int __pyx_skip_dispatch) {
5601 PyObject *__pyx_r = NULL;
5602 __Pyx_RefNannyDeclarations
5603 PyObject *__pyx_t_1 = NULL;
5604 __Pyx_RefNannySetupContext(
"compare", 0);
5613 __Pyx_XDECREF(__pyx_r);
5614 __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)
5615 __Pyx_GOTREF(__pyx_t_1);
5616 __pyx_r = __pyx_t_1;
5630 __Pyx_XDECREF(__pyx_t_1);
5631 __Pyx_AddTraceback(
"PyClical.compare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5634 __Pyx_XGIVEREF(__pyx_r);
5635 __Pyx_RefNannyFinishContext();
5640 static PyObject *__pyx_pw_8PyClical_3compare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5641 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 ";
5642 static PyObject *__pyx_pw_8PyClical_3compare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5643 PyObject *__pyx_v_lhs = 0;
5644 PyObject *__pyx_v_rhs = 0;
5645 PyObject *__pyx_r = 0;
5646 __Pyx_RefNannyDeclarations
5647 __Pyx_RefNannySetupContext(
"compare (wrapper)", 0);
5649 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lhs,&__pyx_n_s_rhs,0};
5650 PyObject* values[2] = {0,0};
5651 if (unlikely(__pyx_kwds)) {
5653 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5655 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5657 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5660 default:
goto __pyx_L5_argtuple_error;
5662 kw_args = PyDict_Size(__pyx_kwds);
5665 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lhs)) != 0)) kw_args--;
5666 else goto __pyx_L5_argtuple_error;
5669 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rhs)) != 0)) kw_args--;
5671 __Pyx_RaiseArgtupleInvalid(
"compare", 1, 2, 2, 1); __PYX_ERR(0, 490, __pyx_L3_error)
5674 if (unlikely(kw_args > 0)) {
5675 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"compare") < 0)) __PYX_ERR(0, 490, __pyx_L3_error)
5677 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5678 goto __pyx_L5_argtuple_error;
5680 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5681 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5683 __pyx_v_lhs = values[0];
5684 __pyx_v_rhs = values[1];
5686 goto __pyx_L4_argument_unpacking_done;
5687 __pyx_L5_argtuple_error:;
5688 __Pyx_RaiseArgtupleInvalid(
"compare", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 490, __pyx_L3_error)
5690 __Pyx_AddTraceback(
"PyClical.compare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5691 __Pyx_RefNannyFinishContext();
5693 __pyx_L4_argument_unpacking_done:;
5694 __pyx_r = __pyx_pf_8PyClical_2compare(__pyx_self, __pyx_v_lhs, __pyx_v_rhs);
5697 __Pyx_RefNannyFinishContext();
5701 static PyObject *__pyx_pf_8PyClical_2compare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
5702 PyObject *__pyx_r = NULL;
5703 __Pyx_RefNannyDeclarations
5704 PyObject *__pyx_t_1 = NULL;
5705 __Pyx_RefNannySetupContext(
"compare", 0);
5706 __Pyx_XDECREF(__pyx_r);
5707 __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)
5708 __Pyx_GOTREF(__pyx_t_1);
5709 __pyx_r = __pyx_t_1;
5715 __Pyx_XDECREF(__pyx_t_1);
5716 __Pyx_AddTraceback(
"PyClical.compare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5719 __Pyx_XGIVEREF(__pyx_r);
5720 __Pyx_RefNannyFinishContext();
5732 static PyObject *__pyx_pw_8PyClical_5min_neg(PyObject *__pyx_self, PyObject *__pyx_v_obj);
5733 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_min_neg(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
5734 PyObject *__pyx_r = NULL;
5735 __Pyx_RefNannyDeclarations
5736 PyObject *__pyx_t_1 = NULL;
5737 __Pyx_RefNannySetupContext(
"min_neg", 0);
5746 __Pyx_XDECREF(__pyx_r);
5747 __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)
5748 __Pyx_GOTREF(__pyx_t_1);
5749 __pyx_r = __pyx_t_1;
5763 __Pyx_XDECREF(__pyx_t_1);
5764 __Pyx_AddTraceback(
"PyClical.min_neg", __pyx_clineno, __pyx_lineno, __pyx_filename);
5767 __Pyx_XGIVEREF(__pyx_r);
5768 __Pyx_RefNannyFinishContext();
5773 static PyObject *__pyx_pw_8PyClical_5min_neg(PyObject *__pyx_self, PyObject *__pyx_v_obj);
5774 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 ";
5775 static PyObject *__pyx_pw_8PyClical_5min_neg(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
5776 PyObject *__pyx_r = 0;
5777 __Pyx_RefNannyDeclarations
5778 __Pyx_RefNannySetupContext(
"min_neg (wrapper)", 0);
5779 __pyx_r = __pyx_pf_8PyClical_4min_neg(__pyx_self, ((PyObject *)__pyx_v_obj));
5782 __Pyx_RefNannyFinishContext();
5786 static PyObject *__pyx_pf_8PyClical_4min_neg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
5787 PyObject *__pyx_r = NULL;
5788 __Pyx_RefNannyDeclarations
5789 PyObject *__pyx_t_1 = NULL;
5790 __Pyx_RefNannySetupContext(
"min_neg", 0);
5791 __Pyx_XDECREF(__pyx_r);
5792 __pyx_t_1 = __pyx_f_8PyClical_min_neg(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 502, __pyx_L1_error)
5793 __Pyx_GOTREF(__pyx_t_1);
5794 __pyx_r = __pyx_t_1;
5800 __Pyx_XDECREF(__pyx_t_1);
5801 __Pyx_AddTraceback(
"PyClical.min_neg", __pyx_clineno, __pyx_lineno, __pyx_filename);
5804 __Pyx_XGIVEREF(__pyx_r);
5805 __Pyx_RefNannyFinishContext();
5817 static PyObject *__pyx_pw_8PyClical_7max_pos(PyObject *__pyx_self, PyObject *__pyx_v_obj);
5818 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_max_pos(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
5819 PyObject *__pyx_r = NULL;
5820 __Pyx_RefNannyDeclarations
5821 PyObject *__pyx_t_1 = NULL;
5822 __Pyx_RefNannySetupContext(
"max_pos", 0);
5831 __Pyx_XDECREF(__pyx_r);
5832 __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)
5833 __Pyx_GOTREF(__pyx_t_1);
5834 __pyx_r = __pyx_t_1;
5848 __Pyx_XDECREF(__pyx_t_1);
5849 __Pyx_AddTraceback(
"PyClical.max_pos", __pyx_clineno, __pyx_lineno, __pyx_filename);
5852 __Pyx_XGIVEREF(__pyx_r);
5853 __Pyx_RefNannyFinishContext();
5858 static PyObject *__pyx_pw_8PyClical_7max_pos(PyObject *__pyx_self, PyObject *__pyx_v_obj);
5859 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 ";
5860 static PyObject *__pyx_pw_8PyClical_7max_pos(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
5861 PyObject *__pyx_r = 0;
5862 __Pyx_RefNannyDeclarations
5863 __Pyx_RefNannySetupContext(
"max_pos (wrapper)", 0);
5864 __pyx_r = __pyx_pf_8PyClical_6max_pos(__pyx_self, ((PyObject *)__pyx_v_obj));
5867 __Pyx_RefNannyFinishContext();
5871 static PyObject *__pyx_pf_8PyClical_6max_pos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
5872 PyObject *__pyx_r = NULL;
5873 __Pyx_RefNannyDeclarations
5874 PyObject *__pyx_t_1 = NULL;
5875 __Pyx_RefNannySetupContext(
"max_pos", 0);
5876 __Pyx_XDECREF(__pyx_r);
5877 __pyx_t_1 = __pyx_f_8PyClical_max_pos(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 511, __pyx_L1_error)
5878 __Pyx_GOTREF(__pyx_t_1);
5879 __pyx_r = __pyx_t_1;
5885 __Pyx_XDECREF(__pyx_t_1);
5886 __Pyx_AddTraceback(
"PyClical.max_pos", __pyx_clineno, __pyx_lineno, __pyx_filename);
5889 __Pyx_XGIVEREF(__pyx_r);
5890 __Pyx_RefNannyFinishContext();
5902 static CYTHON_INLINE std::vector<scalar_t> __pyx_f_8PyClical_list_to_vector(PyObject *__pyx_v_lst) {
5903 std::vector<scalar_t> __pyx_v_v;
5904 PyObject *__pyx_v_s = NULL;
5905 std::vector<scalar_t> __pyx_r;
5906 __Pyx_RefNannyDeclarations
5907 PyObject *__pyx_t_1 = NULL;
5908 Py_ssize_t __pyx_t_2;
5909 PyObject *(*__pyx_t_3)(PyObject *);
5910 PyObject *__pyx_t_4 = NULL;
5912 __Pyx_RefNannySetupContext(
"list_to_vector", 0);
5921 if (likely(PyList_CheckExact(__pyx_v_lst)) || PyTuple_CheckExact(__pyx_v_lst)) {
5922 __pyx_t_1 = __pyx_v_lst; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
5925 __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_lst);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error)
5926 __Pyx_GOTREF(__pyx_t_1);
5927 __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 525, __pyx_L1_error)
5930 if (likely(!__pyx_t_3)) {
5931 if (likely(PyList_CheckExact(__pyx_t_1))) {
5932 if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1))
break;
5933 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 5934 __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)
5936 __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)
5937 __Pyx_GOTREF(__pyx_t_4);
5940 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1))
break;
5941 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 5942 __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)
5944 __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)
5945 __Pyx_GOTREF(__pyx_t_4);
5949 __pyx_t_4 = __pyx_t_3(__pyx_t_1);
5950 if (unlikely(!__pyx_t_4)) {
5951 PyObject* exc_type = PyErr_Occurred();
5953 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
5954 else __PYX_ERR(0, 525, __pyx_L1_error)
5958 __Pyx_GOTREF(__pyx_t_4);
5960 __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_4);
5970 __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)
5972 __pyx_v_v.push_back(((
scalar_t)__pyx_t_5));
5974 __Pyx_CppExn2PyErr();
5975 __PYX_ERR(0, 526, __pyx_L1_error)
5986 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5995 __pyx_r = __pyx_v_v;
6008 __Pyx_XDECREF(__pyx_t_1);
6009 __Pyx_XDECREF(__pyx_t_4);
6010 __Pyx_WriteUnraisable(
"PyClical.list_to_vector", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6011 __Pyx_pretend_to_initialize(&__pyx_r);
6013 __Pyx_XDECREF(__pyx_v_s);
6014 __Pyx_RefNannyFinishContext();
6026 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_toClifford(PyObject *__pyx_v_obj) {
6028 __Pyx_RefNannyDeclarations
6029 PyObject *__pyx_t_1 = NULL;
6030 __Pyx_RefNannySetupContext(
"toClifford", 0);
6039 __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)
6040 __Pyx_GOTREF(__pyx_t_1);
6041 __pyx_r = (((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_1)->instance[0]);
6042 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6055 __Pyx_XDECREF(__pyx_t_1);
6056 __Pyx_WriteUnraisable(
"PyClical.toClifford", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6057 __Pyx_pretend_to_initialize(&__pyx_r);
6059 __Pyx_RefNannyFinishContext();
6071 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_8clifford_wrap(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self,
Clifford __pyx_v_other) {
6072 PyObject *__pyx_r = NULL;
6073 __Pyx_RefNannyDeclarations
6074 __Pyx_RefNannySetupContext(
"wrap", 0);
6083 (__pyx_v_self->instance[0]) = __pyx_v_other;
6092 __Pyx_XDECREF(__pyx_r);
6093 __Pyx_INCREF(((PyObject *)__pyx_v_self));
6094 __pyx_r = ((PyObject *)__pyx_v_self);
6107 __Pyx_XGIVEREF(__pyx_r);
6108 __Pyx_RefNannyFinishContext();
6120 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_8clifford_unwrap(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
6122 __Pyx_RefNannyDeclarations
6123 __Pyx_RefNannySetupContext(
"unwrap", 0);
6132 __pyx_r = (__pyx_v_self->instance[0]);
6145 __Pyx_RefNannyFinishContext();
6157 static PyObject *__pyx_pw_8PyClical_8clifford_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
6158 static PyObject *__pyx_f_8PyClical_8clifford_copy(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self,
int __pyx_skip_dispatch) {
6159 PyObject *__pyx_r = NULL;
6160 __Pyx_RefNannyDeclarations
6161 PyObject *__pyx_t_1 = NULL;
6162 PyObject *__pyx_t_2 = NULL;
6163 PyObject *__pyx_t_3 = NULL;
6164 PyObject *__pyx_t_4 = NULL;
6165 __Pyx_RefNannySetupContext(
"copy", 0);
6167 if (unlikely(__pyx_skip_dispatch)) ;
6169 else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
6170 __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)
6171 __Pyx_GOTREF(__pyx_t_1);
6172 if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_8PyClical_8clifford_1copy)) {
6173 __Pyx_XDECREF(__pyx_r);
6174 __Pyx_INCREF(__pyx_t_1);
6175 __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
6176 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
6177 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
6178 if (likely(__pyx_t_4)) {
6179 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
6180 __Pyx_INCREF(__pyx_t_4);
6181 __Pyx_INCREF(
function);
6182 __Pyx_DECREF_SET(__pyx_t_3,
function);
6186 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 554, __pyx_L1_error)
6187 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6189 __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 554, __pyx_L1_error)
6191 __Pyx_GOTREF(__pyx_t_2);
6192 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6193 __pyx_r = __pyx_t_2;
6195 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6198 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6208 __Pyx_XDECREF(__pyx_r);
6209 __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)
6210 __Pyx_GOTREF(__pyx_t_1);
6211 __pyx_r = __pyx_t_1;
6225 __Pyx_XDECREF(__pyx_t_1);
6226 __Pyx_XDECREF(__pyx_t_2);
6227 __Pyx_XDECREF(__pyx_t_3);
6228 __Pyx_XDECREF(__pyx_t_4);
6229 __Pyx_AddTraceback(
"PyClical.clifford.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
6232 __Pyx_XGIVEREF(__pyx_r);
6233 __Pyx_RefNannyFinishContext();
6238 static PyObject *__pyx_pw_8PyClical_8clifford_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
6239 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 ";
6240 static PyObject *__pyx_pw_8PyClical_8clifford_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
6241 PyObject *__pyx_r = 0;
6242 __Pyx_RefNannyDeclarations
6243 __Pyx_RefNannySetupContext(
"copy (wrapper)", 0);
6244 __pyx_r = __pyx_pf_8PyClical_8clifford_copy(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
6247 __Pyx_RefNannyFinishContext();
6251 static PyObject *__pyx_pf_8PyClical_8clifford_copy(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
6252 PyObject *__pyx_r = NULL;
6253 __Pyx_RefNannyDeclarations
6254 PyObject *__pyx_t_1 = NULL;
6255 __Pyx_RefNannySetupContext(
"copy", 0);
6256 __Pyx_XDECREF(__pyx_r);
6257 __pyx_t_1 = __pyx_f_8PyClical_8clifford_copy(__pyx_v_self, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 554, __pyx_L1_error)
6258 __Pyx_GOTREF(__pyx_t_1);
6259 __pyx_r = __pyx_t_1;
6265 __Pyx_XDECREF(__pyx_t_1);
6266 __Pyx_AddTraceback(
"PyClical.clifford.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
6269 __Pyx_XGIVEREF(__pyx_r);
6270 __Pyx_RefNannyFinishContext();
6283 static int __pyx_pw_8PyClical_8clifford_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6284 static int __pyx_pw_8PyClical_8clifford_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6285 PyObject *__pyx_v_other = 0;
6286 PyObject *__pyx_v_ixt = 0;
6288 __Pyx_RefNannyDeclarations
6289 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
6291 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_ixt,0};
6292 PyObject* values[2] = {0,0};
6293 values[0] = ((PyObject *)__pyx_int_0);
6294 values[1] = ((PyObject *)Py_None);
6295 if (unlikely(__pyx_kwds)) {
6297 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6299 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6301 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6304 default:
goto __pyx_L5_argtuple_error;
6306 kw_args = PyDict_Size(__pyx_kwds);
6310 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other);
6311 if (value) { values[0] = value; kw_args--; }
6316 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ixt);
6317 if (value) { values[1] = value; kw_args--; }
6320 if (unlikely(kw_args > 0)) {
6321 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(0, 563, __pyx_L3_error)
6324 switch (PyTuple_GET_SIZE(__pyx_args)) {
6325 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6327 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6330 default:
goto __pyx_L5_argtuple_error;
6333 __pyx_v_other = values[0];
6334 __pyx_v_ixt = values[1];
6336 goto __pyx_L4_argument_unpacking_done;
6337 __pyx_L5_argtuple_error:;
6338 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 563, __pyx_L3_error)
6340 __Pyx_AddTraceback(
"PyClical.clifford.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6341 __Pyx_RefNannyFinishContext();
6343 __pyx_L4_argument_unpacking_done:;
6344 __pyx_r = __pyx_pf_8PyClical_8clifford_2__cinit__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), __pyx_v_other, __pyx_v_ixt);
6347 __Pyx_RefNannyFinishContext();
6351 static int __pyx_pf_8PyClical_8clifford_2__cinit__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_ixt) {
6352 PyObject *__pyx_v_error_msg_prefix = NULL;
6353 PyObject *__pyx_v_err = NULL;
6355 __Pyx_RefNannyDeclarations
6358 PyObject *__pyx_t_3 = NULL;
6359 PyObject *__pyx_t_4 = NULL;
6360 PyObject *__pyx_t_5 = NULL;
6362 PyObject *__pyx_t_7 = NULL;
6363 PyObject *__pyx_t_8 = NULL;
6365 PyObject *__pyx_t_10 = NULL;
6366 PyObject *__pyx_t_11 = NULL;
6367 PyObject *__pyx_t_12 = NULL;
6370 PyObject *__pyx_t_15 = NULL;
6371 PyObject *__pyx_t_16 = NULL;
6372 PyObject *__pyx_t_17 = NULL;
6373 PyObject *__pyx_t_18 = NULL;
6374 __Pyx_RefNannySetupContext(
"__cinit__", 0);
6383 __Pyx_INCREF(__pyx_kp_s_Cannot_initialize_clifford_objec);
6384 __pyx_v_error_msg_prefix = __pyx_kp_s_Cannot_initialize_clifford_objec;
6393 __pyx_t_1 = (__pyx_v_ixt == Py_None);
6394 __pyx_t_2 = (__pyx_t_1 != 0);
6405 __Pyx_PyThreadState_declare
6406 __Pyx_PyThreadState_assign
6407 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
6408 __Pyx_XGOTREF(__pyx_t_3);
6409 __Pyx_XGOTREF(__pyx_t_4);
6410 __Pyx_XGOTREF(__pyx_t_5);
6420 __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8PyClical_clifford);
6421 __pyx_t_1 = (__pyx_t_2 != 0);
6432 __pyx_t_6 =
new Clifford(__pyx_f_8PyClical_8clifford_unwrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_other)));
6434 __Pyx_CppExn2PyErr();
6435 __PYX_ERR(0, 592, __pyx_L4_error)
6437 __pyx_v_self->instance = __pyx_t_6;
6456 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8PyClical_index_set);
6457 __pyx_t_2 = (__pyx_t_1 != 0);
6468 __pyx_t_6 =
new Clifford(__pyx_f_8PyClical_9index_set_unwrap(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_other)), ((
scalar_t)1.0));
6470 __Pyx_CppExn2PyErr();
6471 __PYX_ERR(0, 594, __pyx_L4_error)
6473 __pyx_v_self->instance = __pyx_t_6;
6492 __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numbers);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 595, __pyx_L4_error)
6493 __Pyx_GOTREF(__pyx_t_7);
6494 __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)
6495 __Pyx_GOTREF(__pyx_t_8);
6496 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6497 __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)
6498 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6499 __pyx_t_1 = (__pyx_t_2 != 0);
6509 __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)
6513 __Pyx_CppExn2PyErr();
6514 __PYX_ERR(0, 596, __pyx_L4_error)
6516 __pyx_v_self->instance = __pyx_t_6;
6535 __pyx_t_1 = PyString_Check(__pyx_v_other);
6536 __pyx_t_2 = (__pyx_t_1 != 0);
6537 if (likely(__pyx_t_2)) {
6547 __Pyx_PyThreadState_declare
6548 __Pyx_PyThreadState_assign
6549 __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
6550 __Pyx_XGOTREF(__pyx_t_10);
6551 __Pyx_XGOTREF(__pyx_t_11);
6552 __Pyx_XGOTREF(__pyx_t_12);
6562 __pyx_t_13 = __Pyx_PyObject_AsWritableString(__pyx_v_other);
if (unlikely((!__pyx_t_13) && PyErr_Occurred())) __PYX_ERR(0, 599, __pyx_L11_error)
6564 __pyx_t_6 =
new Clifford(((
char *)__pyx_t_13));
6566 __Pyx_CppExn2PyErr();
6567 __PYX_ERR(0, 599, __pyx_L11_error)
6569 __pyx_v_self->instance = __pyx_t_6;
6579 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
6580 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
6581 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
6582 goto __pyx_L16_try_end;
6584 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6585 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
6594 __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
6596 __Pyx_AddTraceback(
"PyClical.clifford.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6597 if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_15) < 0) __PYX_ERR(0, 600, __pyx_L13_except_error)
6598 __Pyx_GOTREF(__pyx_t_8);
6599 __Pyx_GOTREF(__pyx_t_7);
6600 __Pyx_GOTREF(__pyx_t_15);
6609 __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)
6610 __Pyx_GOTREF(__pyx_t_16);
6611 __pyx_t_17 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 601, __pyx_L13_except_error)
6612 __Pyx_GOTREF(__pyx_t_17);
6613 __pyx_t_18 = PyNumber_Add(__pyx_t_16, __pyx_t_17);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 601, __pyx_L13_except_error)
6614 __Pyx_GOTREF(__pyx_t_18);
6615 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6616 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6617 __pyx_t_17 = PyNumber_Add(__pyx_t_18, __pyx_kp_s_);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 601, __pyx_L13_except_error)
6618 __Pyx_GOTREF(__pyx_t_17);
6619 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6620 __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)
6621 __Pyx_GOTREF(__pyx_t_18);
6622 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6623 __Pyx_Raise(__pyx_t_18, 0, 0, 0);
6624 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6625 __PYX_ERR(0, 601, __pyx_L13_except_error)
6627 goto __pyx_L13_except_error;
6628 __pyx_L13_except_error:;
6637 __Pyx_XGIVEREF(__pyx_t_10);
6638 __Pyx_XGIVEREF(__pyx_t_11);
6639 __Pyx_XGIVEREF(__pyx_t_12);
6640 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
6641 goto __pyx_L4_error;
6663 __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)
6664 __Pyx_GOTREF(__pyx_t_15);
6665 __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)
6666 __Pyx_GOTREF(__pyx_t_7);
6667 __pyx_t_8 = PyNumber_Add(__pyx_t_15, __pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 603, __pyx_L4_error)
6668 __Pyx_GOTREF(__pyx_t_8);
6669 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6670 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6671 __pyx_t_7 = PyNumber_Add(__pyx_t_8, __pyx_kp_s_);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 603, __pyx_L4_error)
6672 __Pyx_GOTREF(__pyx_t_7);
6673 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6674 __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 603, __pyx_L4_error)
6675 __Pyx_GOTREF(__pyx_t_8);
6676 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6677 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
6678 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6679 __PYX_ERR(0, 603, __pyx_L4_error)
6691 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6692 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6693 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
6694 goto __pyx_L9_try_end;
6696 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
6697 __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
6698 __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
6699 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
6700 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6701 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
6710 __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
6712 __Pyx_AddTraceback(
"PyClical.clifford.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6713 if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_15) < 0) __PYX_ERR(0, 604, __pyx_L6_except_error)
6714 __Pyx_GOTREF(__pyx_t_8);
6715 __Pyx_GOTREF(__pyx_t_7);
6716 __Pyx_GOTREF(__pyx_t_15);
6717 __Pyx_INCREF(__pyx_t_7);
6718 __pyx_v_err = __pyx_t_7;
6727 __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)
6728 __Pyx_GOTREF(__pyx_t_18);
6729 __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)
6730 __Pyx_GOTREF(__pyx_t_17);
6731 __pyx_t_16 = PyNumber_Add(__pyx_t_18, __pyx_t_17);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 605, __pyx_L6_except_error)
6732 __Pyx_GOTREF(__pyx_t_16);
6733 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6734 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6743 __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)
6744 __Pyx_GOTREF(__pyx_t_17);
6745 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6746 __pyx_t_16 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 606, __pyx_L6_except_error)
6747 __Pyx_GOTREF(__pyx_t_16);
6748 __pyx_t_18 = PyNumber_Add(__pyx_t_17, __pyx_t_16);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 606, __pyx_L6_except_error)
6749 __Pyx_GOTREF(__pyx_t_18);
6750 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6751 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6752 __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)
6753 __Pyx_GOTREF(__pyx_t_16);
6754 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6763 __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)
6764 __Pyx_GOTREF(__pyx_t_18);
6765 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6766 __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)
6767 __Pyx_GOTREF(__pyx_t_16);
6768 __pyx_t_17 = PyNumber_Add(__pyx_t_18, __pyx_t_16);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 607, __pyx_L6_except_error)
6769 __Pyx_GOTREF(__pyx_t_17);
6770 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6771 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6780 __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)
6781 __Pyx_GOTREF(__pyx_t_16);
6782 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6783 __Pyx_Raise(__pyx_t_16, 0, 0, 0);
6784 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6785 __PYX_ERR(0, 605, __pyx_L6_except_error)
6787 goto __pyx_L6_except_error;
6788 __pyx_L6_except_error:;
6797 __Pyx_XGIVEREF(__pyx_t_3);
6798 __Pyx_XGIVEREF(__pyx_t_4);
6799 __Pyx_XGIVEREF(__pyx_t_5);
6800 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
6801 goto __pyx_L1_error;
6822 __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_ixt, __pyx_ptype_8PyClical_index_set);
6823 __pyx_t_1 = (__pyx_t_2 != 0);
6824 if (likely(__pyx_t_1)) {
6833 __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_numbers);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 609, __pyx_L1_error)
6834 __Pyx_GOTREF(__pyx_t_15);
6835 __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)
6836 __Pyx_GOTREF(__pyx_t_7);
6837 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6838 __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)
6839 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6840 __pyx_t_2 = (__pyx_t_1 != 0);
6850 __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)
6852 __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));
6854 __Pyx_CppExn2PyErr();
6855 __PYX_ERR(0, 610, __pyx_L1_error)
6857 __pyx_v_self->instance = __pyx_t_6;
6876 __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_collections);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 611, __pyx_L1_error)
6877 __Pyx_GOTREF(__pyx_t_7);
6878 __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)
6879 __Pyx_GOTREF(__pyx_t_15);
6880 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6881 __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)
6882 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6883 __pyx_t_1 = (__pyx_t_2 != 0);
6884 if (likely(__pyx_t_1)) {
6894 __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)));
6896 __Pyx_CppExn2PyErr();
6897 __PYX_ERR(0, 612, __pyx_L1_error)
6899 __pyx_v_self->instance = __pyx_t_6;
6919 __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)
6920 __Pyx_GOTREF(__pyx_t_15);
6921 __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)
6922 __Pyx_GOTREF(__pyx_t_7);
6923 __pyx_t_8 = PyNumber_Add(__pyx_t_15, __pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 614, __pyx_L1_error)
6924 __Pyx_GOTREF(__pyx_t_8);
6925 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6926 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6935 __pyx_t_7 = PyNumber_Add(__pyx_t_8, __pyx_kp_s__8);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 615, __pyx_L1_error)
6936 __Pyx_GOTREF(__pyx_t_7);
6937 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6938 __pyx_t_8 = PyObject_Repr(__pyx_v_ixt);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 615, __pyx_L1_error)
6939 __Pyx_GOTREF(__pyx_t_8);
6940 __pyx_t_15 = PyNumber_Add(__pyx_t_7, __pyx_t_8);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 615, __pyx_L1_error)
6941 __Pyx_GOTREF(__pyx_t_15);
6942 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6943 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6944 __pyx_t_8 = PyNumber_Add(__pyx_t_15, __pyx_kp_s__9);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 615, __pyx_L1_error)
6945 __Pyx_GOTREF(__pyx_t_8);
6946 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6955 __pyx_t_15 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_8);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 614, __pyx_L1_error)
6956 __Pyx_GOTREF(__pyx_t_15);
6957 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6958 __Pyx_Raise(__pyx_t_15, 0, 0, 0);
6959 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6960 __PYX_ERR(0, 614, __pyx_L1_error)
6982 __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)
6983 __Pyx_GOTREF(__pyx_t_15);
6984 __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)
6985 __Pyx_GOTREF(__pyx_t_8);
6986 __pyx_t_7 = PyNumber_Add(__pyx_t_15, __pyx_t_8);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 617, __pyx_L1_error)
6987 __Pyx_GOTREF(__pyx_t_7);
6988 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6989 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6998 __pyx_t_8 = PyNumber_Add(__pyx_t_7, __pyx_kp_s__8);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 618, __pyx_L1_error)
6999 __Pyx_GOTREF(__pyx_t_8);
7000 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7001 __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)
7002 __Pyx_GOTREF(__pyx_t_7);
7003 __pyx_t_15 = PyNumber_Add(__pyx_t_8, __pyx_t_7);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 618, __pyx_L1_error)
7004 __Pyx_GOTREF(__pyx_t_15);
7005 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7006 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7007 __pyx_t_7 = PyNumber_Add(__pyx_t_15, __pyx_kp_s__9);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 618, __pyx_L1_error)
7008 __Pyx_GOTREF(__pyx_t_7);
7009 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7018 __pyx_t_15 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 617, __pyx_L1_error)
7019 __Pyx_GOTREF(__pyx_t_15);
7020 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7021 __Pyx_Raise(__pyx_t_15, 0, 0, 0);
7022 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7023 __PYX_ERR(0, 617, __pyx_L1_error)
7039 __Pyx_XDECREF(__pyx_t_7);
7040 __Pyx_XDECREF(__pyx_t_8);
7041 __Pyx_XDECREF(__pyx_t_15);
7042 __Pyx_XDECREF(__pyx_t_16);
7043 __Pyx_XDECREF(__pyx_t_17);
7044 __Pyx_XDECREF(__pyx_t_18);
7045 __Pyx_AddTraceback(
"PyClical.clifford.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7048 __Pyx_XDECREF(__pyx_v_error_msg_prefix);
7049 __Pyx_XDECREF(__pyx_v_err);
7050 __Pyx_RefNannyFinishContext();
7063 static void __pyx_pw_8PyClical_8clifford_5__dealloc__(PyObject *__pyx_v_self);
7064 static void __pyx_pw_8PyClical_8clifford_5__dealloc__(PyObject *__pyx_v_self) {
7065 __Pyx_RefNannyDeclarations
7066 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
7067 __pyx_pf_8PyClical_8clifford_4__dealloc__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
7070 __Pyx_RefNannyFinishContext();
7073 static void __pyx_pf_8PyClical_8clifford_4__dealloc__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
7074 __Pyx_RefNannyDeclarations
7075 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
7084 delete __pyx_v_self->instance;
7095 __Pyx_RefNannyFinishContext();
7107 static int __pyx_pw_8PyClical_8clifford_7__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_x);
7108 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 ";
7109 #if CYTHON_COMPILING_IN_CPYTHON 7110 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_6__contains__;
7112 static int __pyx_pw_8PyClical_8clifford_7__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_x) {
7114 __Pyx_RefNannyDeclarations
7115 __Pyx_RefNannySetupContext(
"__contains__ (wrapper)", 0);
7116 __pyx_r = __pyx_pf_8PyClical_8clifford_6__contains__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_x));
7119 __Pyx_RefNannyFinishContext();
7123 static int __pyx_pf_8PyClical_8clifford_6__contains__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_x) {
7125 __Pyx_RefNannyDeclarations
7126 PyObject *__pyx_t_1 = NULL;
7127 __Pyx_RefNannySetupContext(
"__contains__", 0);
7136 __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)
7137 __Pyx_GOTREF(__pyx_t_1);
7138 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
7139 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7140 __PYX_ERR(0, 635, __pyx_L1_error)
7152 __Pyx_XDECREF(__pyx_t_1);
7153 __Pyx_AddTraceback(
"PyClical.clifford.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7155 __Pyx_RefNannyFinishContext();
7168 static PyObject *__pyx_pw_8PyClical_8clifford_9__iter__(PyObject *__pyx_v_self);
7169 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 ";
7170 #if CYTHON_COMPILING_IN_CPYTHON 7171 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_8__iter__;
7173 static PyObject *__pyx_pw_8PyClical_8clifford_9__iter__(PyObject *__pyx_v_self) {
7174 PyObject *__pyx_r = 0;
7175 __Pyx_RefNannyDeclarations
7176 __Pyx_RefNannySetupContext(
"__iter__ (wrapper)", 0);
7177 __pyx_r = __pyx_pf_8PyClical_8clifford_8__iter__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
7180 __Pyx_RefNannyFinishContext();
7184 static PyObject *__pyx_pf_8PyClical_8clifford_8__iter__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
7185 PyObject *__pyx_r = NULL;
7186 __Pyx_RefNannyDeclarations
7187 PyObject *__pyx_t_1 = NULL;
7188 __Pyx_RefNannySetupContext(
"__iter__", 0);
7197 __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)
7198 __Pyx_GOTREF(__pyx_t_1);
7199 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
7200 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7201 __PYX_ERR(0, 646, __pyx_L1_error)
7213 __Pyx_XDECREF(__pyx_t_1);
7214 __Pyx_AddTraceback(
"PyClical.clifford.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7216 __Pyx_XGIVEREF(__pyx_r);
7217 __Pyx_RefNannyFinishContext();
7230 static PyObject *__pyx_pw_8PyClical_8clifford_11reframe(PyObject *__pyx_v_self, PyObject *__pyx_v_ixt);
7231 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 ";
7232 static PyObject *__pyx_pw_8PyClical_8clifford_11reframe(PyObject *__pyx_v_self, PyObject *__pyx_v_ixt) {
7233 PyObject *__pyx_r = 0;
7234 __Pyx_RefNannyDeclarations
7235 __Pyx_RefNannySetupContext(
"reframe (wrapper)", 0);
7236 __pyx_r = __pyx_pf_8PyClical_8clifford_10reframe(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_ixt));
7239 __Pyx_RefNannyFinishContext();
7243 static PyObject *__pyx_pf_8PyClical_8clifford_10reframe(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_ixt) {
7244 PyObject *__pyx_v_error_msg_prefix = NULL;
7245 struct __pyx_obj_8PyClical_clifford *__pyx_v_result = NULL;
7246 PyObject *__pyx_v_err = NULL;
7247 PyObject *__pyx_r = NULL;
7248 __Pyx_RefNannyDeclarations
7251 PyObject *__pyx_t_3 = NULL;
7252 PyObject *__pyx_t_4 = NULL;
7253 PyObject *__pyx_t_5 = NULL;
7254 PyObject *__pyx_t_6 = NULL;
7257 PyObject *__pyx_t_9 = NULL;
7258 PyObject *__pyx_t_10 = NULL;
7259 PyObject *__pyx_t_11 = NULL;
7260 PyObject *__pyx_t_12 = NULL;
7261 PyObject *__pyx_t_13 = NULL;
7262 __Pyx_RefNannySetupContext(
"reframe", 0);
7271 __Pyx_INCREF(__pyx_kp_s_Cannot_reframe);
7272 __pyx_v_error_msg_prefix = __pyx_kp_s_Cannot_reframe;
7281 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_ixt, __pyx_ptype_8PyClical_index_set);
7282 __pyx_t_2 = (__pyx_t_1 != 0);
7283 if (likely(__pyx_t_2)) {
7293 __Pyx_PyThreadState_declare
7294 __Pyx_PyThreadState_assign
7295 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
7296 __Pyx_XGOTREF(__pyx_t_3);
7297 __Pyx_XGOTREF(__pyx_t_4);
7298 __Pyx_XGOTREF(__pyx_t_5);
7308 __pyx_t_6 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 661, __pyx_L4_error)
7309 __Pyx_GOTREF(__pyx_t_6);
7310 __pyx_v_result = ((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_6);
7321 __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)));
7323 __Pyx_CppExn2PyErr();
7324 __PYX_ERR(0, 662, __pyx_L4_error)
7326 __pyx_v_result->instance = __pyx_t_7;
7336 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7337 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7338 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
7339 goto __pyx_L9_try_end;
7341 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
7350 __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
7352 __Pyx_AddTraceback(
"PyClical.clifford.reframe", __pyx_clineno, __pyx_lineno, __pyx_filename);
7353 if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 663, __pyx_L6_except_error)
7354 __Pyx_GOTREF(__pyx_t_6);
7355 __Pyx_GOTREF(__pyx_t_9);
7356 __Pyx_GOTREF(__pyx_t_10);
7357 __Pyx_INCREF(__pyx_t_9);
7358 __pyx_v_err = __pyx_t_9;
7367 __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)
7368 __Pyx_GOTREF(__pyx_t_11);
7369 __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)
7370 __Pyx_GOTREF(__pyx_t_12);
7371 __pyx_t_13 = PyNumber_Add(__pyx_t_11, __pyx_t_12);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 664, __pyx_L6_except_error)
7372 __Pyx_GOTREF(__pyx_t_13);
7373 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7374 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7375 __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)
7376 __Pyx_GOTREF(__pyx_t_12);
7377 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7386 __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)
7387 __Pyx_GOTREF(__pyx_t_13);
7388 __pyx_t_11 = PyNumber_Add(__pyx_t_12, __pyx_t_13);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 665, __pyx_L6_except_error)
7389 __Pyx_GOTREF(__pyx_t_11);
7390 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7391 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7392 __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)
7393 __Pyx_GOTREF(__pyx_t_13);
7394 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7403 __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)
7404 __Pyx_GOTREF(__pyx_t_11);
7405 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7406 __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)
7407 __Pyx_GOTREF(__pyx_t_13);
7408 __pyx_t_12 = PyNumber_Add(__pyx_t_11, __pyx_t_13);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 666, __pyx_L6_except_error)
7409 __Pyx_GOTREF(__pyx_t_12);
7410 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7411 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7420 __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)
7421 __Pyx_GOTREF(__pyx_t_13);
7422 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7423 __Pyx_Raise(__pyx_t_13, 0, 0, 0);
7424 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7425 __PYX_ERR(0, 664, __pyx_L6_except_error)
7427 goto __pyx_L6_except_error;
7428 __pyx_L6_except_error:;
7437 __Pyx_XGIVEREF(__pyx_t_3);
7438 __Pyx_XGIVEREF(__pyx_t_4);
7439 __Pyx_XGIVEREF(__pyx_t_5);
7440 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
7441 goto __pyx_L1_error;
7463 __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)
7464 __Pyx_GOTREF(__pyx_t_10);
7465 __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)
7466 __Pyx_GOTREF(__pyx_t_9);
7467 __pyx_t_6 = PyNumber_Add(__pyx_t_10, __pyx_t_9);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 668, __pyx_L1_error)
7468 __Pyx_GOTREF(__pyx_t_6);
7469 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7470 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7471 __pyx_t_9 = PyNumber_Add(__pyx_t_6, __pyx_kp_s__9);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 668, __pyx_L1_error)
7472 __Pyx_GOTREF(__pyx_t_9);
7473 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7474 __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_9);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 668, __pyx_L1_error)
7475 __Pyx_GOTREF(__pyx_t_6);
7476 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7477 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
7478 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7479 __PYX_ERR(0, 668, __pyx_L1_error)
7490 __Pyx_XDECREF(__pyx_r);
7491 __Pyx_INCREF(((PyObject *)__pyx_v_result));
7492 __pyx_r = ((PyObject *)__pyx_v_result);
7505 __Pyx_XDECREF(__pyx_t_6);
7506 __Pyx_XDECREF(__pyx_t_9);
7507 __Pyx_XDECREF(__pyx_t_10);
7508 __Pyx_XDECREF(__pyx_t_11);
7509 __Pyx_XDECREF(__pyx_t_12);
7510 __Pyx_XDECREF(__pyx_t_13);
7511 __Pyx_AddTraceback(
"PyClical.clifford.reframe", __pyx_clineno, __pyx_lineno, __pyx_filename);
7514 __Pyx_XDECREF(__pyx_v_error_msg_prefix);
7515 __Pyx_XDECREF((PyObject *)__pyx_v_result);
7516 __Pyx_XDECREF(__pyx_v_err);
7517 __Pyx_XGIVEREF(__pyx_r);
7518 __Pyx_RefNannyFinishContext();
7531 static PyObject *__pyx_pw_8PyClical_8clifford_13__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op);
7532 static PyObject *__pyx_pw_8PyClical_8clifford_13__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op) {
7533 PyObject *__pyx_r = 0;
7534 __Pyx_RefNannyDeclarations
7535 __Pyx_RefNannySetupContext(
"__richcmp__ (wrapper)", 0);
7536 __pyx_r = __pyx_pf_8PyClical_8clifford_12__richcmp__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs), ((
int)__pyx_v_op));
7539 __Pyx_RefNannyFinishContext();
7543 static PyObject *__pyx_pf_8PyClical_8clifford_12__richcmp__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op) {
7544 PyObject *__pyx_r = NULL;
7545 __Pyx_RefNannyDeclarations
7549 PyObject *__pyx_t_4 = NULL;
7550 PyObject *__pyx_t_5 = NULL;
7551 PyObject *__pyx_t_6 = NULL;
7552 __Pyx_RefNannySetupContext(
"__richcmp__", 0);
7561 __pyx_t_1 = ((__pyx_v_op == 2) != 0);
7571 __pyx_t_2 = (((PyObject *)__pyx_v_lhs) == Py_None);
7572 __pyx_t_3 = (__pyx_t_2 != 0);
7575 __pyx_t_1 = __pyx_t_3;
7576 goto __pyx_L5_bool_binop_done;
7578 __pyx_t_3 = (__pyx_v_rhs == Py_None);
7579 __pyx_t_2 = (__pyx_t_3 != 0);
7580 __pyx_t_1 = __pyx_t_2;
7581 __pyx_L5_bool_binop_done:;
7591 __Pyx_XDECREF(__pyx_r);
7592 __pyx_t_1 = (((PyObject *)__pyx_v_lhs) == __pyx_v_rhs);
7593 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error)
7594 __Pyx_GOTREF(__pyx_t_4);
7595 __pyx_r = __pyx_t_4;
7616 __Pyx_XDECREF(__pyx_r);
7617 __pyx_t_1 = (__pyx_f_8PyClical_toClifford(((PyObject *)__pyx_v_lhs)) == __pyx_f_8PyClical_toClifford(__pyx_v_rhs));
7618 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 694, __pyx_L1_error)
7619 __Pyx_GOTREF(__pyx_t_4);
7620 __pyx_r = __pyx_t_4;
7641 __pyx_t_1 = ((__pyx_v_op == 3) != 0);
7651 __pyx_t_2 = (((PyObject *)__pyx_v_lhs) == Py_None);
7652 __pyx_t_3 = (__pyx_t_2 != 0);
7655 __pyx_t_1 = __pyx_t_3;
7656 goto __pyx_L8_bool_binop_done;
7658 __pyx_t_3 = (__pyx_v_rhs == Py_None);
7659 __pyx_t_2 = (__pyx_t_3 != 0);
7660 __pyx_t_1 = __pyx_t_2;
7661 __pyx_L8_bool_binop_done:;
7671 __Pyx_XDECREF(__pyx_r);
7672 __pyx_t_1 = (((PyObject *)__pyx_v_lhs) == __pyx_v_rhs);
7673 __pyx_t_4 = __Pyx_PyBool_FromLong((!((!(!__pyx_t_1)) != 0)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 697, __pyx_L1_error)
7674 __Pyx_GOTREF(__pyx_t_4);
7675 __pyx_r = __pyx_t_4;
7696 __Pyx_XDECREF(__pyx_r);
7697 __pyx_t_1 = (__pyx_f_8PyClical_toClifford(((PyObject *)__pyx_v_lhs)) != __pyx_f_8PyClical_toClifford(__pyx_v_rhs));
7698 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 699, __pyx_L1_error)
7699 __Pyx_GOTREF(__pyx_t_4);
7700 __pyx_r = __pyx_t_4;
7721 __pyx_t_2 = __Pyx_TypeCheck(((PyObject *)__pyx_v_lhs), __pyx_ptype_8PyClical_clifford);
7722 __pyx_t_3 = (__pyx_t_2 != 0);
7725 __pyx_t_1 = __pyx_t_3;
7726 goto __pyx_L10_bool_binop_done;
7728 __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_rhs, __pyx_ptype_8PyClical_clifford);
7729 __pyx_t_2 = (__pyx_t_3 != 0);
7730 __pyx_t_1 = __pyx_t_2;
7731 __pyx_L10_bool_binop_done:;
7732 if (unlikely(__pyx_t_1)) {
7741 __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)
7742 __Pyx_GOTREF(__pyx_t_4);
7743 __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)
7744 __Pyx_GOTREF(__pyx_t_5);
7745 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7746 __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_kp_s__8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 702, __pyx_L1_error)
7747 __Pyx_GOTREF(__pyx_t_4);
7748 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7749 __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)
7750 __Pyx_GOTREF(__pyx_t_5);
7751 __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_t_5);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 702, __pyx_L1_error)
7752 __Pyx_GOTREF(__pyx_t_6);
7753 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7754 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7755 __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_kp_s_);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 702, __pyx_L1_error)
7756 __Pyx_GOTREF(__pyx_t_5);
7757 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7766 __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_5);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 701, __pyx_L1_error)
7767 __Pyx_GOTREF(__pyx_t_6);
7768 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7769 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
7770 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7771 __PYX_ERR(0, 701, __pyx_L1_error)
7790 __Pyx_XDECREF(__pyx_r);
7791 __Pyx_INCREF(__pyx_builtin_NotImplemented);
7792 __pyx_r = __pyx_builtin_NotImplemented;
7806 __Pyx_XDECREF(__pyx_t_4);
7807 __Pyx_XDECREF(__pyx_t_5);
7808 __Pyx_XDECREF(__pyx_t_6);
7809 __Pyx_AddTraceback(
"PyClical.clifford.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7812 __Pyx_XGIVEREF(__pyx_r);
7813 __Pyx_RefNannyFinishContext();
7826 static PyObject *__pyx_pw_8PyClical_8clifford_15__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ixt);
7827 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 ";
7828 #if CYTHON_COMPILING_IN_CPYTHON 7829 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_14__getitem__;
7831 static PyObject *__pyx_pw_8PyClical_8clifford_15__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ixt) {
7832 PyObject *__pyx_r = 0;
7833 __Pyx_RefNannyDeclarations
7834 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
7835 __pyx_r = __pyx_pf_8PyClical_8clifford_14__getitem__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_ixt));
7838 __Pyx_RefNannyFinishContext();
7842 static PyObject *__pyx_pf_8PyClical_8clifford_14__getitem__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_ixt) {
7843 PyObject *__pyx_r = NULL;
7844 __Pyx_RefNannyDeclarations
7845 PyObject *__pyx_t_1 = NULL;
7846 __Pyx_RefNannySetupContext(
"__getitem__", 0);
7855 __Pyx_XDECREF(__pyx_r);
7856 __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)
7857 __Pyx_GOTREF(__pyx_t_1);
7858 __pyx_r = __pyx_t_1;
7872 __Pyx_XDECREF(__pyx_t_1);
7873 __Pyx_AddTraceback(
"PyClical.clifford.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7876 __Pyx_XGIVEREF(__pyx_r);
7877 __Pyx_RefNannyFinishContext();
7890 static PyObject *__pyx_pw_8PyClical_8clifford_17__neg__(PyObject *__pyx_v_self);
7891 static char __pyx_doc_8PyClical_8clifford_16__neg__[] =
"\n Unary -.\n\n >>> print -clifford(\"{1}\")\n -{1}\n ";
7892 #if CYTHON_COMPILING_IN_CPYTHON 7893 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_16__neg__;
7895 static PyObject *__pyx_pw_8PyClical_8clifford_17__neg__(PyObject *__pyx_v_self) {
7896 PyObject *__pyx_r = 0;
7897 __Pyx_RefNannyDeclarations
7898 __Pyx_RefNannySetupContext(
"__neg__ (wrapper)", 0);
7899 __pyx_r = __pyx_pf_8PyClical_8clifford_16__neg__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
7902 __Pyx_RefNannyFinishContext();
7906 static PyObject *__pyx_pf_8PyClical_8clifford_16__neg__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
7907 PyObject *__pyx_r = NULL;
7908 __Pyx_RefNannyDeclarations
7909 PyObject *__pyx_t_1 = NULL;
7910 PyObject *__pyx_t_2 = NULL;
7911 __Pyx_RefNannySetupContext(
"__neg__", 0);
7920 __Pyx_XDECREF(__pyx_r);
7921 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 728, __pyx_L1_error)
7922 __Pyx_GOTREF(__pyx_t_1);
7923 __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)
7924 __Pyx_GOTREF(__pyx_t_2);
7925 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7926 __pyx_r = __pyx_t_2;
7940 __Pyx_XDECREF(__pyx_t_1);
7941 __Pyx_XDECREF(__pyx_t_2);
7942 __Pyx_AddTraceback(
"PyClical.clifford.__neg__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7945 __Pyx_XGIVEREF(__pyx_r);
7946 __Pyx_RefNannyFinishContext();
7959 static PyObject *__pyx_pw_8PyClical_8clifford_19__pos__(PyObject *__pyx_v_self);
7960 static char __pyx_doc_8PyClical_8clifford_18__pos__[] =
"\n Unary +.\n\n >>> print +clifford(\"{1}\")\n {1}\n ";
7961 #if CYTHON_COMPILING_IN_CPYTHON 7962 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_18__pos__;
7964 static PyObject *__pyx_pw_8PyClical_8clifford_19__pos__(PyObject *__pyx_v_self) {
7965 PyObject *__pyx_r = 0;
7966 __Pyx_RefNannyDeclarations
7967 __Pyx_RefNannySetupContext(
"__pos__ (wrapper)", 0);
7968 __pyx_r = __pyx_pf_8PyClical_8clifford_18__pos__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
7971 __Pyx_RefNannyFinishContext();
7975 static PyObject *__pyx_pf_8PyClical_8clifford_18__pos__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
7976 PyObject *__pyx_r = NULL;
7977 __Pyx_RefNannyDeclarations
7978 PyObject *__pyx_t_1 = NULL;
7979 __Pyx_RefNannySetupContext(
"__pos__", 0);
7988 __Pyx_XDECREF(__pyx_r);
7989 __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)
7990 __Pyx_GOTREF(__pyx_t_1);
7991 __pyx_r = __pyx_t_1;
8005 __Pyx_XDECREF(__pyx_t_1);
8006 __Pyx_AddTraceback(
"PyClical.clifford.__pos__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8009 __Pyx_XGIVEREF(__pyx_r);
8010 __Pyx_RefNannyFinishContext();
8023 static PyObject *__pyx_pw_8PyClical_8clifford_21__add__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8024 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 ";
8025 #if CYTHON_COMPILING_IN_CPYTHON 8026 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_20__add__;
8028 static PyObject *__pyx_pw_8PyClical_8clifford_21__add__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8029 PyObject *__pyx_r = 0;
8030 __Pyx_RefNannyDeclarations
8031 __Pyx_RefNannySetupContext(
"__add__ (wrapper)", 0);
8032 __pyx_r = __pyx_pf_8PyClical_8clifford_20__add__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8035 __Pyx_RefNannyFinishContext();
8039 static PyObject *__pyx_pf_8PyClical_8clifford_20__add__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8040 PyObject *__pyx_r = NULL;
8041 __Pyx_RefNannyDeclarations
8042 PyObject *__pyx_t_1 = NULL;
8043 PyObject *__pyx_t_2 = NULL;
8044 __Pyx_RefNannySetupContext(
"__add__", 0);
8053 __Pyx_XDECREF(__pyx_r);
8054 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 748, __pyx_L1_error)
8055 __Pyx_GOTREF(__pyx_t_1);
8056 __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)
8057 __Pyx_GOTREF(__pyx_t_2);
8058 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8059 __pyx_r = __pyx_t_2;
8073 __Pyx_XDECREF(__pyx_t_1);
8074 __Pyx_XDECREF(__pyx_t_2);
8075 __Pyx_AddTraceback(
"PyClical.clifford.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8078 __Pyx_XGIVEREF(__pyx_r);
8079 __Pyx_RefNannyFinishContext();
8092 static PyObject *__pyx_pw_8PyClical_8clifford_23__iadd__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8093 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 ";
8094 #if CYTHON_COMPILING_IN_CPYTHON 8095 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_22__iadd__;
8097 static PyObject *__pyx_pw_8PyClical_8clifford_23__iadd__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8098 PyObject *__pyx_r = 0;
8099 __Pyx_RefNannyDeclarations
8100 __Pyx_RefNannySetupContext(
"__iadd__ (wrapper)", 0);
8101 __pyx_r = __pyx_pf_8PyClical_8clifford_22__iadd__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8104 __Pyx_RefNannyFinishContext();
8108 static PyObject *__pyx_pf_8PyClical_8clifford_22__iadd__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8109 PyObject *__pyx_r = NULL;
8110 __Pyx_RefNannyDeclarations
8111 PyObject *__pyx_t_1 = NULL;
8112 __Pyx_RefNannySetupContext(
"__iadd__", 0);
8121 __Pyx_XDECREF(__pyx_r);
8122 __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)
8123 __Pyx_GOTREF(__pyx_t_1);
8124 __pyx_r = __pyx_t_1;
8138 __Pyx_XDECREF(__pyx_t_1);
8139 __Pyx_AddTraceback(
"PyClical.clifford.__iadd__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8142 __Pyx_XGIVEREF(__pyx_r);
8143 __Pyx_RefNannyFinishContext();
8156 static PyObject *__pyx_pw_8PyClical_8clifford_25__sub__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8157 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 ";
8158 #if CYTHON_COMPILING_IN_CPYTHON 8159 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_24__sub__;
8161 static PyObject *__pyx_pw_8PyClical_8clifford_25__sub__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8162 PyObject *__pyx_r = 0;
8163 __Pyx_RefNannyDeclarations
8164 __Pyx_RefNannySetupContext(
"__sub__ (wrapper)", 0);
8165 __pyx_r = __pyx_pf_8PyClical_8clifford_24__sub__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8168 __Pyx_RefNannyFinishContext();
8172 static PyObject *__pyx_pf_8PyClical_8clifford_24__sub__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8173 PyObject *__pyx_r = NULL;
8174 __Pyx_RefNannyDeclarations
8175 PyObject *__pyx_t_1 = NULL;
8176 PyObject *__pyx_t_2 = NULL;
8177 __Pyx_RefNannySetupContext(
"__sub__", 0);
8186 __Pyx_XDECREF(__pyx_r);
8187 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 768, __pyx_L1_error)
8188 __Pyx_GOTREF(__pyx_t_1);
8189 __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)
8190 __Pyx_GOTREF(__pyx_t_2);
8191 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8192 __pyx_r = __pyx_t_2;
8206 __Pyx_XDECREF(__pyx_t_1);
8207 __Pyx_XDECREF(__pyx_t_2);
8208 __Pyx_AddTraceback(
"PyClical.clifford.__sub__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8211 __Pyx_XGIVEREF(__pyx_r);
8212 __Pyx_RefNannyFinishContext();
8225 static PyObject *__pyx_pw_8PyClical_8clifford_27__isub__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8226 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 ";
8227 #if CYTHON_COMPILING_IN_CPYTHON 8228 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_26__isub__;
8230 static PyObject *__pyx_pw_8PyClical_8clifford_27__isub__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8231 PyObject *__pyx_r = 0;
8232 __Pyx_RefNannyDeclarations
8233 __Pyx_RefNannySetupContext(
"__isub__ (wrapper)", 0);
8234 __pyx_r = __pyx_pf_8PyClical_8clifford_26__isub__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8237 __Pyx_RefNannyFinishContext();
8241 static PyObject *__pyx_pf_8PyClical_8clifford_26__isub__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8242 PyObject *__pyx_r = NULL;
8243 __Pyx_RefNannyDeclarations
8244 PyObject *__pyx_t_1 = NULL;
8245 __Pyx_RefNannySetupContext(
"__isub__", 0);
8254 __Pyx_XDECREF(__pyx_r);
8255 __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)
8256 __Pyx_GOTREF(__pyx_t_1);
8257 __pyx_r = __pyx_t_1;
8271 __Pyx_XDECREF(__pyx_t_1);
8272 __Pyx_AddTraceback(
"PyClical.clifford.__isub__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8275 __Pyx_XGIVEREF(__pyx_r);
8276 __Pyx_RefNannyFinishContext();
8289 static PyObject *__pyx_pw_8PyClical_8clifford_29__mul__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8290 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 ";
8291 #if CYTHON_COMPILING_IN_CPYTHON 8292 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_28__mul__;
8294 static PyObject *__pyx_pw_8PyClical_8clifford_29__mul__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8295 PyObject *__pyx_r = 0;
8296 __Pyx_RefNannyDeclarations
8297 __Pyx_RefNannySetupContext(
"__mul__ (wrapper)", 0);
8298 __pyx_r = __pyx_pf_8PyClical_8clifford_28__mul__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8301 __Pyx_RefNannyFinishContext();
8305 static PyObject *__pyx_pf_8PyClical_8clifford_28__mul__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8306 PyObject *__pyx_r = NULL;
8307 __Pyx_RefNannyDeclarations
8308 PyObject *__pyx_t_1 = NULL;
8309 PyObject *__pyx_t_2 = NULL;
8310 __Pyx_RefNannySetupContext(
"__mul__", 0);
8319 __Pyx_XDECREF(__pyx_r);
8320 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 790, __pyx_L1_error)
8321 __Pyx_GOTREF(__pyx_t_1);
8322 __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)
8323 __Pyx_GOTREF(__pyx_t_2);
8324 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8325 __pyx_r = __pyx_t_2;
8339 __Pyx_XDECREF(__pyx_t_1);
8340 __Pyx_XDECREF(__pyx_t_2);
8341 __Pyx_AddTraceback(
"PyClical.clifford.__mul__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8344 __Pyx_XGIVEREF(__pyx_r);
8345 __Pyx_RefNannyFinishContext();
8358 static PyObject *__pyx_pw_8PyClical_8clifford_31__imul__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8359 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 ";
8360 #if CYTHON_COMPILING_IN_CPYTHON 8361 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_30__imul__;
8363 static PyObject *__pyx_pw_8PyClical_8clifford_31__imul__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8364 PyObject *__pyx_r = 0;
8365 __Pyx_RefNannyDeclarations
8366 __Pyx_RefNannySetupContext(
"__imul__ (wrapper)", 0);
8367 __pyx_r = __pyx_pf_8PyClical_8clifford_30__imul__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8370 __Pyx_RefNannyFinishContext();
8374 static PyObject *__pyx_pf_8PyClical_8clifford_30__imul__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8375 PyObject *__pyx_r = NULL;
8376 __Pyx_RefNannyDeclarations
8377 PyObject *__pyx_t_1 = NULL;
8378 __Pyx_RefNannySetupContext(
"__imul__", 0);
8387 __Pyx_XDECREF(__pyx_r);
8388 __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)
8389 __Pyx_GOTREF(__pyx_t_1);
8390 __pyx_r = __pyx_t_1;
8404 __Pyx_XDECREF(__pyx_t_1);
8405 __Pyx_AddTraceback(
"PyClical.clifford.__imul__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8408 __Pyx_XGIVEREF(__pyx_r);
8409 __Pyx_RefNannyFinishContext();
8422 static PyObject *__pyx_pw_8PyClical_8clifford_33__mod__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8423 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 ";
8424 #if CYTHON_COMPILING_IN_CPYTHON 8425 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_32__mod__;
8427 static PyObject *__pyx_pw_8PyClical_8clifford_33__mod__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8428 PyObject *__pyx_r = 0;
8429 __Pyx_RefNannyDeclarations
8430 __Pyx_RefNannySetupContext(
"__mod__ (wrapper)", 0);
8431 __pyx_r = __pyx_pf_8PyClical_8clifford_32__mod__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8434 __Pyx_RefNannyFinishContext();
8438 static PyObject *__pyx_pf_8PyClical_8clifford_32__mod__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8439 PyObject *__pyx_r = NULL;
8440 __Pyx_RefNannyDeclarations
8441 PyObject *__pyx_t_1 = NULL;
8442 PyObject *__pyx_t_2 = NULL;
8443 __Pyx_RefNannySetupContext(
"__mod__", 0);
8452 __Pyx_XDECREF(__pyx_r);
8453 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 818, __pyx_L1_error)
8454 __Pyx_GOTREF(__pyx_t_1);
8455 __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)
8456 __Pyx_GOTREF(__pyx_t_2);
8457 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8458 __pyx_r = __pyx_t_2;
8472 __Pyx_XDECREF(__pyx_t_1);
8473 __Pyx_XDECREF(__pyx_t_2);
8474 __Pyx_AddTraceback(
"PyClical.clifford.__mod__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8477 __Pyx_XGIVEREF(__pyx_r);
8478 __Pyx_RefNannyFinishContext();
8491 static PyObject *__pyx_pw_8PyClical_8clifford_35__imod__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8492 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 ";
8493 #if CYTHON_COMPILING_IN_CPYTHON 8494 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_34__imod__;
8496 static PyObject *__pyx_pw_8PyClical_8clifford_35__imod__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8497 PyObject *__pyx_r = 0;
8498 __Pyx_RefNannyDeclarations
8499 __Pyx_RefNannySetupContext(
"__imod__ (wrapper)", 0);
8500 __pyx_r = __pyx_pf_8PyClical_8clifford_34__imod__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8503 __Pyx_RefNannyFinishContext();
8507 static PyObject *__pyx_pf_8PyClical_8clifford_34__imod__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8508 PyObject *__pyx_r = NULL;
8509 __Pyx_RefNannyDeclarations
8510 PyObject *__pyx_t_1 = NULL;
8511 __Pyx_RefNannySetupContext(
"__imod__", 0);
8520 __Pyx_XDECREF(__pyx_r);
8521 __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)
8522 __Pyx_GOTREF(__pyx_t_1);
8523 __pyx_r = __pyx_t_1;
8537 __Pyx_XDECREF(__pyx_t_1);
8538 __Pyx_AddTraceback(
"PyClical.clifford.__imod__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8541 __Pyx_XGIVEREF(__pyx_r);
8542 __Pyx_RefNannyFinishContext();
8555 static PyObject *__pyx_pw_8PyClical_8clifford_37__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8556 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 ";
8557 #if CYTHON_COMPILING_IN_CPYTHON 8558 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_36__and__;
8560 static PyObject *__pyx_pw_8PyClical_8clifford_37__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8561 PyObject *__pyx_r = 0;
8562 __Pyx_RefNannyDeclarations
8563 __Pyx_RefNannySetupContext(
"__and__ (wrapper)", 0);
8564 __pyx_r = __pyx_pf_8PyClical_8clifford_36__and__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8567 __Pyx_RefNannyFinishContext();
8571 static PyObject *__pyx_pf_8PyClical_8clifford_36__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8572 PyObject *__pyx_r = NULL;
8573 __Pyx_RefNannyDeclarations
8574 PyObject *__pyx_t_1 = NULL;
8575 PyObject *__pyx_t_2 = NULL;
8576 __Pyx_RefNannySetupContext(
"__and__", 0);
8585 __Pyx_XDECREF(__pyx_r);
8586 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 848, __pyx_L1_error)
8587 __Pyx_GOTREF(__pyx_t_1);
8588 __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)
8589 __Pyx_GOTREF(__pyx_t_2);
8590 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8591 __pyx_r = __pyx_t_2;
8605 __Pyx_XDECREF(__pyx_t_1);
8606 __Pyx_XDECREF(__pyx_t_2);
8607 __Pyx_AddTraceback(
"PyClical.clifford.__and__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8610 __Pyx_XGIVEREF(__pyx_r);
8611 __Pyx_RefNannyFinishContext();
8624 static PyObject *__pyx_pw_8PyClical_8clifford_39__iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8625 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 ";
8626 #if CYTHON_COMPILING_IN_CPYTHON 8627 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_38__iand__;
8629 static PyObject *__pyx_pw_8PyClical_8clifford_39__iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8630 PyObject *__pyx_r = 0;
8631 __Pyx_RefNannyDeclarations
8632 __Pyx_RefNannySetupContext(
"__iand__ (wrapper)", 0);
8633 __pyx_r = __pyx_pf_8PyClical_8clifford_38__iand__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8636 __Pyx_RefNannyFinishContext();
8640 static PyObject *__pyx_pf_8PyClical_8clifford_38__iand__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8641 PyObject *__pyx_r = NULL;
8642 __Pyx_RefNannyDeclarations
8643 PyObject *__pyx_t_1 = NULL;
8644 __Pyx_RefNannySetupContext(
"__iand__", 0);
8653 __Pyx_XDECREF(__pyx_r);
8654 __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)
8655 __Pyx_GOTREF(__pyx_t_1);
8656 __pyx_r = __pyx_t_1;
8670 __Pyx_XDECREF(__pyx_t_1);
8671 __Pyx_AddTraceback(
"PyClical.clifford.__iand__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8674 __Pyx_XGIVEREF(__pyx_r);
8675 __Pyx_RefNannyFinishContext();
8688 static PyObject *__pyx_pw_8PyClical_8clifford_41__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8689 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 ";
8690 #if CYTHON_COMPILING_IN_CPYTHON 8691 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_40__xor__;
8693 static PyObject *__pyx_pw_8PyClical_8clifford_41__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8694 PyObject *__pyx_r = 0;
8695 __Pyx_RefNannyDeclarations
8696 __Pyx_RefNannySetupContext(
"__xor__ (wrapper)", 0);
8697 __pyx_r = __pyx_pf_8PyClical_8clifford_40__xor__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8700 __Pyx_RefNannyFinishContext();
8704 static PyObject *__pyx_pf_8PyClical_8clifford_40__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8705 PyObject *__pyx_r = NULL;
8706 __Pyx_RefNannyDeclarations
8707 PyObject *__pyx_t_1 = NULL;
8708 PyObject *__pyx_t_2 = NULL;
8709 __Pyx_RefNannySetupContext(
"__xor__", 0);
8718 __Pyx_XDECREF(__pyx_r);
8719 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 878, __pyx_L1_error)
8720 __Pyx_GOTREF(__pyx_t_1);
8721 __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)
8722 __Pyx_GOTREF(__pyx_t_2);
8723 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8724 __pyx_r = __pyx_t_2;
8738 __Pyx_XDECREF(__pyx_t_1);
8739 __Pyx_XDECREF(__pyx_t_2);
8740 __Pyx_AddTraceback(
"PyClical.clifford.__xor__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8743 __Pyx_XGIVEREF(__pyx_r);
8744 __Pyx_RefNannyFinishContext();
8757 static PyObject *__pyx_pw_8PyClical_8clifford_43__ixor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8758 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 ";
8759 #if CYTHON_COMPILING_IN_CPYTHON 8760 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_42__ixor__;
8762 static PyObject *__pyx_pw_8PyClical_8clifford_43__ixor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8763 PyObject *__pyx_r = 0;
8764 __Pyx_RefNannyDeclarations
8765 __Pyx_RefNannySetupContext(
"__ixor__ (wrapper)", 0);
8766 __pyx_r = __pyx_pf_8PyClical_8clifford_42__ixor__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8769 __Pyx_RefNannyFinishContext();
8773 static PyObject *__pyx_pf_8PyClical_8clifford_42__ixor__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8774 PyObject *__pyx_r = NULL;
8775 __Pyx_RefNannyDeclarations
8776 PyObject *__pyx_t_1 = NULL;
8777 __Pyx_RefNannySetupContext(
"__ixor__", 0);
8786 __Pyx_XDECREF(__pyx_r);
8787 __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)
8788 __Pyx_GOTREF(__pyx_t_1);
8789 __pyx_r = __pyx_t_1;
8803 __Pyx_XDECREF(__pyx_t_1);
8804 __Pyx_AddTraceback(
"PyClical.clifford.__ixor__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8807 __Pyx_XGIVEREF(__pyx_r);
8808 __Pyx_RefNannyFinishContext();
8821 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 8822 static PyObject *__pyx_pw_8PyClical_8clifford_45__div__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8823 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 ";
8824 #if CYTHON_COMPILING_IN_CPYTHON 8825 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_44__div__;
8827 static PyObject *__pyx_pw_8PyClical_8clifford_45__div__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8828 PyObject *__pyx_r = 0;
8829 __Pyx_RefNannyDeclarations
8830 __Pyx_RefNannySetupContext(
"__div__ (wrapper)", 0);
8831 __pyx_r = __pyx_pf_8PyClical_8clifford_44__div__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8834 __Pyx_RefNannyFinishContext();
8839 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 8840 static PyObject *__pyx_pf_8PyClical_8clifford_44__div__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8841 PyObject *__pyx_r = NULL;
8842 __Pyx_RefNannyDeclarations
8843 PyObject *__pyx_t_1 = NULL;
8844 PyObject *__pyx_t_2 = NULL;
8845 __Pyx_RefNannySetupContext(
"__div__", 0);
8854 __Pyx_XDECREF(__pyx_r);
8855 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 908, __pyx_L1_error)
8856 __Pyx_GOTREF(__pyx_t_1);
8857 __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)
8858 __Pyx_GOTREF(__pyx_t_2);
8859 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8860 __pyx_r = __pyx_t_2;
8874 __Pyx_XDECREF(__pyx_t_1);
8875 __Pyx_XDECREF(__pyx_t_2);
8876 __Pyx_AddTraceback(
"PyClical.clifford.__div__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8879 __Pyx_XGIVEREF(__pyx_r);
8880 __Pyx_RefNannyFinishContext();
8894 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 8895 static PyObject *__pyx_pw_8PyClical_8clifford_47__idiv__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8896 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 ";
8897 #if CYTHON_COMPILING_IN_CPYTHON 8898 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_46__idiv__;
8900 static PyObject *__pyx_pw_8PyClical_8clifford_47__idiv__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8901 PyObject *__pyx_r = 0;
8902 __Pyx_RefNannyDeclarations
8903 __Pyx_RefNannySetupContext(
"__idiv__ (wrapper)", 0);
8904 __pyx_r = __pyx_pf_8PyClical_8clifford_46__idiv__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8907 __Pyx_RefNannyFinishContext();
8912 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 8913 static PyObject *__pyx_pf_8PyClical_8clifford_46__idiv__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8914 PyObject *__pyx_r = NULL;
8915 __Pyx_RefNannyDeclarations
8916 PyObject *__pyx_t_1 = NULL;
8917 __Pyx_RefNannySetupContext(
"__idiv__", 0);
8926 __Pyx_XDECREF(__pyx_r);
8927 __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)
8928 __Pyx_GOTREF(__pyx_t_1);
8929 __pyx_r = __pyx_t_1;
8943 __Pyx_XDECREF(__pyx_t_1);
8944 __Pyx_AddTraceback(
"PyClical.clifford.__idiv__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8947 __Pyx_XGIVEREF(__pyx_r);
8948 __Pyx_RefNannyFinishContext();
8962 static PyObject *__pyx_pw_8PyClical_8clifford_49inv(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
8963 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 ";
8964 static PyObject *__pyx_pw_8PyClical_8clifford_49inv(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
8965 PyObject *__pyx_r = 0;
8966 __Pyx_RefNannyDeclarations
8967 __Pyx_RefNannySetupContext(
"inv (wrapper)", 0);
8968 __pyx_r = __pyx_pf_8PyClical_8clifford_48inv(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
8971 __Pyx_RefNannyFinishContext();
8975 static PyObject *__pyx_pf_8PyClical_8clifford_48inv(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
8976 PyObject *__pyx_r = NULL;
8977 __Pyx_RefNannyDeclarations
8978 PyObject *__pyx_t_1 = NULL;
8979 PyObject *__pyx_t_2 = NULL;
8980 __Pyx_RefNannySetupContext(
"inv", 0);
8989 __Pyx_XDECREF(__pyx_r);
8990 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 936, __pyx_L1_error)
8991 __Pyx_GOTREF(__pyx_t_1);
8992 __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)
8993 __Pyx_GOTREF(__pyx_t_2);
8994 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8995 __pyx_r = __pyx_t_2;
9009 __Pyx_XDECREF(__pyx_t_1);
9010 __Pyx_XDECREF(__pyx_t_2);
9011 __Pyx_AddTraceback(
"PyClical.clifford.inv", __pyx_clineno, __pyx_lineno, __pyx_filename);
9014 __Pyx_XGIVEREF(__pyx_r);
9015 __Pyx_RefNannyFinishContext();
9028 static PyObject *__pyx_pw_8PyClical_8clifford_51__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
9029 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 ";
9030 #if CYTHON_COMPILING_IN_CPYTHON 9031 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_50__or__;
9033 static PyObject *__pyx_pw_8PyClical_8clifford_51__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
9034 PyObject *__pyx_r = 0;
9035 __Pyx_RefNannyDeclarations
9036 __Pyx_RefNannySetupContext(
"__or__ (wrapper)", 0);
9037 __pyx_r = __pyx_pf_8PyClical_8clifford_50__or__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
9040 __Pyx_RefNannyFinishContext();
9044 static PyObject *__pyx_pf_8PyClical_8clifford_50__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
9045 PyObject *__pyx_r = NULL;
9046 __Pyx_RefNannyDeclarations
9047 PyObject *__pyx_t_1 = NULL;
9048 PyObject *__pyx_t_2 = NULL;
9049 __Pyx_RefNannySetupContext(
"__or__", 0);
9058 __Pyx_XDECREF(__pyx_r);
9059 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 947, __pyx_L1_error)
9060 __Pyx_GOTREF(__pyx_t_1);
9061 __pyx_t_2 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_1), (__pyx_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)
9062 __Pyx_GOTREF(__pyx_t_2);
9063 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9064 __pyx_r = __pyx_t_2;
9078 __Pyx_XDECREF(__pyx_t_1);
9079 __Pyx_XDECREF(__pyx_t_2);
9080 __Pyx_AddTraceback(
"PyClical.clifford.__or__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9083 __Pyx_XGIVEREF(__pyx_r);
9084 __Pyx_RefNannyFinishContext();
9097 static PyObject *__pyx_pw_8PyClical_8clifford_53__ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
9098 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 ";
9099 #if CYTHON_COMPILING_IN_CPYTHON 9100 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_52__ior__;
9102 static PyObject *__pyx_pw_8PyClical_8clifford_53__ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
9103 PyObject *__pyx_r = 0;
9104 __Pyx_RefNannyDeclarations
9105 __Pyx_RefNannySetupContext(
"__ior__ (wrapper)", 0);
9106 __pyx_r = __pyx_pf_8PyClical_8clifford_52__ior__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
9109 __Pyx_RefNannyFinishContext();
9113 static PyObject *__pyx_pf_8PyClical_8clifford_52__ior__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
9114 PyObject *__pyx_r = NULL;
9115 __Pyx_RefNannyDeclarations
9116 PyObject *__pyx_t_1 = NULL;
9117 __Pyx_RefNannySetupContext(
"__ior__", 0);
9126 __Pyx_XDECREF(__pyx_r);
9127 __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)
9128 __Pyx_GOTREF(__pyx_t_1);
9129 __pyx_r = __pyx_t_1;
9143 __Pyx_XDECREF(__pyx_t_1);
9144 __Pyx_AddTraceback(
"PyClical.clifford.__ior__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9147 __Pyx_XGIVEREF(__pyx_r);
9148 __Pyx_RefNannyFinishContext();
9161 static PyObject *__pyx_pw_8PyClical_8clifford_55__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_m, PyObject *__pyx_v_dummy);
9162 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 ";
9163 #if CYTHON_COMPILING_IN_CPYTHON 9164 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_54__pow__;
9166 static PyObject *__pyx_pw_8PyClical_8clifford_55__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_m, PyObject *__pyx_v_dummy) {
9167 PyObject *__pyx_r = 0;
9168 __Pyx_RefNannyDeclarations
9169 __Pyx_RefNannySetupContext(
"__pow__ (wrapper)", 0);
9170 __pyx_r = __pyx_pf_8PyClical_8clifford_54__pow__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_m), ((PyObject *)__pyx_v_dummy));
9173 __Pyx_RefNannyFinishContext();
9177 static PyObject *__pyx_pf_8PyClical_8clifford_54__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_m, CYTHON_UNUSED PyObject *__pyx_v_dummy) {
9178 PyObject *__pyx_r = NULL;
9179 __Pyx_RefNannyDeclarations
9180 PyObject *__pyx_t_1 = NULL;
9181 __Pyx_RefNannySetupContext(
"__pow__", 0);
9190 __Pyx_XDECREF(__pyx_r);
9191 __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)
9192 __Pyx_GOTREF(__pyx_t_1);
9193 __pyx_r = __pyx_t_1;
9207 __Pyx_XDECREF(__pyx_t_1);
9208 __Pyx_AddTraceback(
"PyClical.clifford.__pow__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9211 __Pyx_XGIVEREF(__pyx_r);
9212 __Pyx_RefNannyFinishContext();
9225 static PyObject *__pyx_pw_8PyClical_8clifford_57pow(PyObject *__pyx_v_self, PyObject *__pyx_v_m);
9226 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 ";
9227 static PyObject *__pyx_pw_8PyClical_8clifford_57pow(PyObject *__pyx_v_self, PyObject *__pyx_v_m) {
9228 PyObject *__pyx_r = 0;
9229 __Pyx_RefNannyDeclarations
9230 __Pyx_RefNannySetupContext(
"pow (wrapper)", 0);
9231 __pyx_r = __pyx_pf_8PyClical_8clifford_56pow(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_m));
9234 __Pyx_RefNannyFinishContext();
9238 static PyObject *__pyx_pf_8PyClical_8clifford_56pow(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_m) {
9239 PyObject *__pyx_r = NULL;
9240 __Pyx_RefNannyDeclarations
9241 PyObject *__pyx_t_1 = NULL;
9242 PyObject *__pyx_t_2 = NULL;
9246 __Pyx_RefNannySetupContext(
"pow", 0);
9255 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numbers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __pyx_L1_error)
9256 __Pyx_GOTREF(__pyx_t_1);
9257 __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)
9258 __Pyx_GOTREF(__pyx_t_2);
9259 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9260 __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)
9261 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9262 __pyx_t_4 = (__pyx_t_3 != 0);
9272 __Pyx_XDECREF(__pyx_r);
9273 __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 999, __pyx_L1_error)
9274 __Pyx_GOTREF(__pyx_t_2);
9275 __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)
9276 __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)
9277 __Pyx_GOTREF(__pyx_t_1);
9278 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9279 __pyx_r = __pyx_t_1;
9300 __Pyx_XDECREF(__pyx_r);
9301 __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)
9302 __Pyx_GOTREF(__pyx_t_1);
9303 __pyx_t_2 = PyNumber_Multiply(__pyx_v_m, __pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1001, __pyx_L1_error)
9304 __Pyx_GOTREF(__pyx_t_2);
9305 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9306 __pyx_t_1 = __pyx_f_8PyClical_exp(__pyx_t_2, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1001, __pyx_L1_error)
9307 __Pyx_GOTREF(__pyx_t_1);
9308 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9309 __pyx_r = __pyx_t_1;
9324 __Pyx_XDECREF(__pyx_t_1);
9325 __Pyx_XDECREF(__pyx_t_2);
9326 __Pyx_AddTraceback(
"PyClical.clifford.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
9329 __Pyx_XGIVEREF(__pyx_r);
9330 __Pyx_RefNannyFinishContext();
9343 static PyObject *__pyx_pw_8PyClical_8clifford_59outer_pow(PyObject *__pyx_v_self, PyObject *__pyx_v_m);
9344 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 ";
9345 static PyObject *__pyx_pw_8PyClical_8clifford_59outer_pow(PyObject *__pyx_v_self, PyObject *__pyx_v_m) {
9346 PyObject *__pyx_r = 0;
9347 __Pyx_RefNannyDeclarations
9348 __Pyx_RefNannySetupContext(
"outer_pow (wrapper)", 0);
9349 __pyx_r = __pyx_pf_8PyClical_8clifford_58outer_pow(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_m));
9352 __Pyx_RefNannyFinishContext();
9356 static PyObject *__pyx_pf_8PyClical_8clifford_58outer_pow(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_m) {
9357 PyObject *__pyx_r = NULL;
9358 __Pyx_RefNannyDeclarations
9359 PyObject *__pyx_t_1 = NULL;
9361 PyObject *__pyx_t_3 = NULL;
9362 __Pyx_RefNannySetupContext(
"outer_pow", 0);
9371 __Pyx_XDECREF(__pyx_r);
9372 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1017, __pyx_L1_error)
9373 __Pyx_GOTREF(__pyx_t_1);
9374 __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)
9375 __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)
9376 __Pyx_GOTREF(__pyx_t_3);
9377 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9378 __pyx_r = __pyx_t_3;
9392 __Pyx_XDECREF(__pyx_t_1);
9393 __Pyx_XDECREF(__pyx_t_3);
9394 __Pyx_AddTraceback(
"PyClical.clifford.outer_pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
9397 __Pyx_XGIVEREF(__pyx_r);
9398 __Pyx_RefNannyFinishContext();
9411 static PyObject *__pyx_pw_8PyClical_8clifford_61__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
9412 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 ";
9413 #if CYTHON_COMPILING_IN_CPYTHON 9414 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_60__call__;
9416 static PyObject *__pyx_pw_8PyClical_8clifford_61__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9417 PyObject *__pyx_v_grade = 0;
9418 PyObject *__pyx_r = 0;
9419 __Pyx_RefNannyDeclarations
9420 __Pyx_RefNannySetupContext(
"__call__ (wrapper)", 0);
9422 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_grade,0};
9423 PyObject* values[1] = {0};
9424 if (unlikely(__pyx_kwds)) {
9426 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9428 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9431 default:
goto __pyx_L5_argtuple_error;
9433 kw_args = PyDict_Size(__pyx_kwds);
9436 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_grade)) != 0)) kw_args--;
9437 else goto __pyx_L5_argtuple_error;
9439 if (unlikely(kw_args > 0)) {
9440 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__call__") < 0)) __PYX_ERR(0, 1019, __pyx_L3_error)
9442 }
else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
9443 goto __pyx_L5_argtuple_error;
9445 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9447 __pyx_v_grade = values[0];
9449 goto __pyx_L4_argument_unpacking_done;
9450 __pyx_L5_argtuple_error:;
9451 __Pyx_RaiseArgtupleInvalid(
"__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1019, __pyx_L3_error)
9453 __Pyx_AddTraceback(
"PyClical.clifford.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9454 __Pyx_RefNannyFinishContext();
9456 __pyx_L4_argument_unpacking_done:;
9457 __pyx_r = __pyx_pf_8PyClical_8clifford_60__call__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), __pyx_v_grade);
9460 __Pyx_RefNannyFinishContext();
9464 static PyObject *__pyx_pf_8PyClical_8clifford_60__call__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_grade) {
9465 PyObject *__pyx_r = NULL;
9466 __Pyx_RefNannyDeclarations
9467 PyObject *__pyx_t_1 = NULL;
9469 PyObject *__pyx_t_3 = NULL;
9470 __Pyx_RefNannySetupContext(
"__call__", 0);
9479 __Pyx_XDECREF(__pyx_r);
9480 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1036, __pyx_L1_error)
9481 __Pyx_GOTREF(__pyx_t_1);
9482 __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)
9483 __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)
9484 __Pyx_GOTREF(__pyx_t_3);
9485 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9486 __pyx_r = __pyx_t_3;
9500 __Pyx_XDECREF(__pyx_t_1);
9501 __Pyx_XDECREF(__pyx_t_3);
9502 __Pyx_AddTraceback(
"PyClical.clifford.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9505 __Pyx_XGIVEREF(__pyx_r);
9506 __Pyx_RefNannyFinishContext();
9519 static PyObject *__pyx_pw_8PyClical_8clifford_63scalar(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9520 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 ";
9521 static PyObject *__pyx_pw_8PyClical_8clifford_63scalar(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9522 PyObject *__pyx_r = 0;
9523 __Pyx_RefNannyDeclarations
9524 __Pyx_RefNannySetupContext(
"scalar (wrapper)", 0);
9525 __pyx_r = __pyx_pf_8PyClical_8clifford_62scalar(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
9528 __Pyx_RefNannyFinishContext();
9532 static PyObject *__pyx_pf_8PyClical_8clifford_62scalar(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
9533 PyObject *__pyx_r = NULL;
9534 __Pyx_RefNannyDeclarations
9535 PyObject *__pyx_t_1 = NULL;
9536 __Pyx_RefNannySetupContext(
"scalar", 0);
9545 __Pyx_XDECREF(__pyx_r);
9546 __pyx_t_1 =
PyFloat_FromDouble(__pyx_v_self->instance->scalar());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1047, __pyx_L1_error)
9547 __Pyx_GOTREF(__pyx_t_1);
9548 __pyx_r = __pyx_t_1;
9562 __Pyx_XDECREF(__pyx_t_1);
9563 __Pyx_AddTraceback(
"PyClical.clifford.scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
9566 __Pyx_XGIVEREF(__pyx_r);
9567 __Pyx_RefNannyFinishContext();
9580 static PyObject *__pyx_pw_8PyClical_8clifford_65pure(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9581 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 ";
9582 static PyObject *__pyx_pw_8PyClical_8clifford_65pure(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9583 PyObject *__pyx_r = 0;
9584 __Pyx_RefNannyDeclarations
9585 __Pyx_RefNannySetupContext(
"pure (wrapper)", 0);
9586 __pyx_r = __pyx_pf_8PyClical_8clifford_64pure(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
9589 __Pyx_RefNannyFinishContext();
9593 static PyObject *__pyx_pf_8PyClical_8clifford_64pure(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
9594 PyObject *__pyx_r = NULL;
9595 __Pyx_RefNannyDeclarations
9596 PyObject *__pyx_t_1 = NULL;
9597 PyObject *__pyx_t_2 = NULL;
9598 __Pyx_RefNannySetupContext(
"pure", 0);
9607 __Pyx_XDECREF(__pyx_r);
9608 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1058, __pyx_L1_error)
9609 __Pyx_GOTREF(__pyx_t_1);
9610 __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)
9611 __Pyx_GOTREF(__pyx_t_2);
9612 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9613 __pyx_r = __pyx_t_2;
9627 __Pyx_XDECREF(__pyx_t_1);
9628 __Pyx_XDECREF(__pyx_t_2);
9629 __Pyx_AddTraceback(
"PyClical.clifford.pure", __pyx_clineno, __pyx_lineno, __pyx_filename);
9632 __Pyx_XGIVEREF(__pyx_r);
9633 __Pyx_RefNannyFinishContext();
9646 static PyObject *__pyx_pw_8PyClical_8clifford_67even(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9647 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 ";
9648 static PyObject *__pyx_pw_8PyClical_8clifford_67even(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9649 PyObject *__pyx_r = 0;
9650 __Pyx_RefNannyDeclarations
9651 __Pyx_RefNannySetupContext(
"even (wrapper)", 0);
9652 __pyx_r = __pyx_pf_8PyClical_8clifford_66even(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
9655 __Pyx_RefNannyFinishContext();
9659 static PyObject *__pyx_pf_8PyClical_8clifford_66even(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
9660 PyObject *__pyx_r = NULL;
9661 __Pyx_RefNannyDeclarations
9662 PyObject *__pyx_t_1 = NULL;
9663 PyObject *__pyx_t_2 = NULL;
9664 __Pyx_RefNannySetupContext(
"even", 0);
9673 __Pyx_XDECREF(__pyx_r);
9674 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1067, __pyx_L1_error)
9675 __Pyx_GOTREF(__pyx_t_1);
9676 __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)
9677 __Pyx_GOTREF(__pyx_t_2);
9678 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9679 __pyx_r = __pyx_t_2;
9693 __Pyx_XDECREF(__pyx_t_1);
9694 __Pyx_XDECREF(__pyx_t_2);
9695 __Pyx_AddTraceback(
"PyClical.clifford.even", __pyx_clineno, __pyx_lineno, __pyx_filename);
9698 __Pyx_XGIVEREF(__pyx_r);
9699 __Pyx_RefNannyFinishContext();
9712 static PyObject *__pyx_pw_8PyClical_8clifford_69odd(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9713 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 ";
9714 static PyObject *__pyx_pw_8PyClical_8clifford_69odd(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9715 PyObject *__pyx_r = 0;
9716 __Pyx_RefNannyDeclarations
9717 __Pyx_RefNannySetupContext(
"odd (wrapper)", 0);
9718 __pyx_r = __pyx_pf_8PyClical_8clifford_68odd(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
9721 __Pyx_RefNannyFinishContext();
9725 static PyObject *__pyx_pf_8PyClical_8clifford_68odd(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
9726 PyObject *__pyx_r = NULL;
9727 __Pyx_RefNannyDeclarations
9728 PyObject *__pyx_t_1 = NULL;
9729 PyObject *__pyx_t_2 = NULL;
9730 __Pyx_RefNannySetupContext(
"odd", 0);
9739 __Pyx_XDECREF(__pyx_r);
9740 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1076, __pyx_L1_error)
9741 __Pyx_GOTREF(__pyx_t_1);
9742 __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)
9743 __Pyx_GOTREF(__pyx_t_2);
9744 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9745 __pyx_r = __pyx_t_2;
9759 __Pyx_XDECREF(__pyx_t_1);
9760 __Pyx_XDECREF(__pyx_t_2);
9761 __Pyx_AddTraceback(
"PyClical.clifford.odd", __pyx_clineno, __pyx_lineno, __pyx_filename);
9764 __Pyx_XGIVEREF(__pyx_r);
9765 __Pyx_RefNannyFinishContext();
9778 static PyObject *__pyx_pw_8PyClical_8clifford_71vector_part(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
9779 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 ";
9780 static PyObject *__pyx_pw_8PyClical_8clifford_71vector_part(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9781 PyObject *__pyx_v_frm = 0;
9782 PyObject *__pyx_r = 0;
9783 __Pyx_RefNannyDeclarations
9784 __Pyx_RefNannySetupContext(
"vector_part (wrapper)", 0);
9786 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frm,0};
9787 PyObject* values[1] = {0};
9788 values[0] = ((PyObject *)Py_None);
9789 if (unlikely(__pyx_kwds)) {
9791 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9793 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9796 default:
goto __pyx_L5_argtuple_error;
9798 kw_args = PyDict_Size(__pyx_kwds);
9802 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_frm);
9803 if (value) { values[0] = value; kw_args--; }
9806 if (unlikely(kw_args > 0)) {
9807 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"vector_part") < 0)) __PYX_ERR(0, 1078, __pyx_L3_error)
9810 switch (PyTuple_GET_SIZE(__pyx_args)) {
9811 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9814 default:
goto __pyx_L5_argtuple_error;
9817 __pyx_v_frm = values[0];
9819 goto __pyx_L4_argument_unpacking_done;
9820 __pyx_L5_argtuple_error:;
9821 __Pyx_RaiseArgtupleInvalid(
"vector_part", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1078, __pyx_L3_error)
9823 __Pyx_AddTraceback(
"PyClical.clifford.vector_part", __pyx_clineno, __pyx_lineno, __pyx_filename);
9824 __Pyx_RefNannyFinishContext();
9826 __pyx_L4_argument_unpacking_done:;
9827 __pyx_r = __pyx_pf_8PyClical_8clifford_70vector_part(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), __pyx_v_frm);
9830 __Pyx_RefNannyFinishContext();
9834 static PyObject *__pyx_pf_8PyClical_8clifford_70vector_part(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_frm) {
9835 PyObject *__pyx_v_error_msg_prefix = NULL;
9836 std::vector<scalar_t> __pyx_v_vec;
9839 PyObject *__pyx_v_lst = NULL;
9840 PyObject *__pyx_v_err = NULL;
9841 PyObject *__pyx_r = NULL;
9842 __Pyx_RefNannyDeclarations
9843 PyObject *__pyx_t_1 = NULL;
9844 PyObject *__pyx_t_2 = NULL;
9845 PyObject *__pyx_t_3 = NULL;
9848 std::vector<scalar_t> __pyx_t_6;
9849 PyObject *__pyx_t_7 = NULL;
9853 PyObject *__pyx_t_11 = NULL;
9854 PyObject *__pyx_t_12 = NULL;
9855 PyObject *__pyx_t_13 = NULL;
9856 PyObject *__pyx_t_14 = NULL;
9857 PyObject *__pyx_t_15 = NULL;
9858 __Pyx_RefNannySetupContext(
"vector_part", 0);
9867 __Pyx_INCREF(__pyx_kp_s_Cannot_take_vector_part_of);
9868 __pyx_v_error_msg_prefix = __pyx_kp_s_Cannot_take_vector_part_of;
9878 __Pyx_PyThreadState_declare
9879 __Pyx_PyThreadState_assign
9880 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
9881 __Pyx_XGOTREF(__pyx_t_1);
9882 __Pyx_XGOTREF(__pyx_t_2);
9883 __Pyx_XGOTREF(__pyx_t_3);
9893 __pyx_t_4 = (__pyx_v_frm == Py_None);
9894 __pyx_t_5 = (__pyx_t_4 != 0);
9904 __pyx_t_6 = __pyx_v_self->instance->vector_part();
9905 __pyx_v_vec = __pyx_t_6;
9926 __pyx_t_6 = __pyx_v_self->instance->vector_part(__pyx_f_8PyClical_9index_set_unwrap(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_frm)));
9928 __Pyx_CppExn2PyErr();
9929 __PYX_ERR(0, 1095, __pyx_L3_error)
9931 __pyx_v_vec = __pyx_t_6;
9942 __pyx_v_n = __pyx_v_vec.size();
9951 __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)
9952 __Pyx_GOTREF(__pyx_t_7);
9953 { Py_ssize_t __pyx_temp;
9954 for (__pyx_temp=0; __pyx_temp < __pyx_v_n; __pyx_temp++) {
9955 __Pyx_INCREF(__pyx_float_0_0);
9956 __Pyx_GIVEREF(__pyx_float_0_0);
9957 PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_float_0_0);
9960 __pyx_v_lst = ((PyObject*)__pyx_t_7);
9970 __pyx_t_8 = __pyx_v_n;
9971 __pyx_t_9 = __pyx_t_8;
9972 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
9973 __pyx_v_i = __pyx_t_10;
9982 __pyx_t_7 =
PyFloat_FromDouble((__pyx_v_vec[__pyx_v_i]));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1099, __pyx_L3_error)
9983 __Pyx_GOTREF(__pyx_t_7);
9984 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)
9985 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9995 __Pyx_XDECREF(__pyx_r);
9996 __Pyx_INCREF(__pyx_v_lst);
9997 __pyx_r = __pyx_v_lst;
9998 goto __pyx_L7_try_return;
10009 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10018 __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
10020 __Pyx_AddTraceback(
"PyClical.clifford.vector_part", __pyx_clineno, __pyx_lineno, __pyx_filename);
10021 if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_11, &__pyx_t_12) < 0) __PYX_ERR(0, 1101, __pyx_L5_except_error)
10022 __Pyx_GOTREF(__pyx_t_7);
10023 __Pyx_GOTREF(__pyx_t_11);
10024 __Pyx_GOTREF(__pyx_t_12);
10025 __Pyx_INCREF(__pyx_t_11);
10026 __pyx_v_err = __pyx_t_11;
10035 __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)
10036 __Pyx_GOTREF(__pyx_t_13);
10037 __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)
10038 __Pyx_GOTREF(__pyx_t_14);
10039 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
10040 __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)
10041 __Pyx_GOTREF(__pyx_t_13);
10042 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
10051 __pyx_t_14 = PyObject_Repr(__pyx_v_frm);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1103, __pyx_L5_except_error)
10052 __Pyx_GOTREF(__pyx_t_14);
10053 __pyx_t_15 = PyNumber_Add(__pyx_t_13, __pyx_t_14);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1103, __pyx_L5_except_error)
10054 __Pyx_GOTREF(__pyx_t_15);
10055 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
10056 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
10057 __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)
10058 __Pyx_GOTREF(__pyx_t_14);
10059 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
10068 __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)
10069 __Pyx_GOTREF(__pyx_t_15);
10070 __pyx_t_13 = PyNumber_Add(__pyx_t_14, __pyx_t_15);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1104, __pyx_L5_except_error)
10071 __Pyx_GOTREF(__pyx_t_13);
10072 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
10073 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
10082 __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)
10083 __Pyx_GOTREF(__pyx_t_15);
10084 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
10085 __Pyx_Raise(__pyx_t_15, 0, 0, 0);
10086 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
10087 __PYX_ERR(0, 1102, __pyx_L5_except_error)
10089 goto __pyx_L5_except_error;
10090 __pyx_L5_except_error:;
10099 __Pyx_XGIVEREF(__pyx_t_1);
10100 __Pyx_XGIVEREF(__pyx_t_2);
10101 __Pyx_XGIVEREF(__pyx_t_3);
10102 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
10103 goto __pyx_L1_error;
10104 __pyx_L7_try_return:;
10105 __Pyx_XGIVEREF(__pyx_t_1);
10106 __Pyx_XGIVEREF(__pyx_t_2);
10107 __Pyx_XGIVEREF(__pyx_t_3);
10108 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
10122 __Pyx_XDECREF(__pyx_t_7);
10123 __Pyx_XDECREF(__pyx_t_11);
10124 __Pyx_XDECREF(__pyx_t_12);
10125 __Pyx_XDECREF(__pyx_t_13);
10126 __Pyx_XDECREF(__pyx_t_14);
10127 __Pyx_XDECREF(__pyx_t_15);
10128 __Pyx_AddTraceback(
"PyClical.clifford.vector_part", __pyx_clineno, __pyx_lineno, __pyx_filename);
10131 __Pyx_XDECREF(__pyx_v_error_msg_prefix);
10132 __Pyx_XDECREF(__pyx_v_lst);
10133 __Pyx_XDECREF(__pyx_v_err);
10134 __Pyx_XGIVEREF(__pyx_r);
10135 __Pyx_RefNannyFinishContext();
10148 static PyObject *__pyx_pw_8PyClical_8clifford_73involute(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10149 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 ";
10150 static PyObject *__pyx_pw_8PyClical_8clifford_73involute(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10151 PyObject *__pyx_r = 0;
10152 __Pyx_RefNannyDeclarations
10153 __Pyx_RefNannySetupContext(
"involute (wrapper)", 0);
10154 __pyx_r = __pyx_pf_8PyClical_8clifford_72involute(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10157 __Pyx_RefNannyFinishContext();
10161 static PyObject *__pyx_pf_8PyClical_8clifford_72involute(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10162 PyObject *__pyx_r = NULL;
10163 __Pyx_RefNannyDeclarations
10164 PyObject *__pyx_t_1 = NULL;
10165 PyObject *__pyx_t_2 = NULL;
10166 __Pyx_RefNannySetupContext(
"involute", 0);
10175 __Pyx_XDECREF(__pyx_r);
10176 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1120, __pyx_L1_error)
10177 __Pyx_GOTREF(__pyx_t_1);
10178 __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)
10179 __Pyx_GOTREF(__pyx_t_2);
10180 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10181 __pyx_r = __pyx_t_2;
10195 __Pyx_XDECREF(__pyx_t_1);
10196 __Pyx_XDECREF(__pyx_t_2);
10197 __Pyx_AddTraceback(
"PyClical.clifford.involute", __pyx_clineno, __pyx_lineno, __pyx_filename);
10200 __Pyx_XGIVEREF(__pyx_r);
10201 __Pyx_RefNannyFinishContext();
10214 static PyObject *__pyx_pw_8PyClical_8clifford_75reverse(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10215 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 ";
10216 static PyObject *__pyx_pw_8PyClical_8clifford_75reverse(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10217 PyObject *__pyx_r = 0;
10218 __Pyx_RefNannyDeclarations
10219 __Pyx_RefNannySetupContext(
"reverse (wrapper)", 0);
10220 __pyx_r = __pyx_pf_8PyClical_8clifford_74reverse(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10223 __Pyx_RefNannyFinishContext();
10227 static PyObject *__pyx_pf_8PyClical_8clifford_74reverse(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10228 PyObject *__pyx_r = NULL;
10229 __Pyx_RefNannyDeclarations
10230 PyObject *__pyx_t_1 = NULL;
10231 PyObject *__pyx_t_2 = NULL;
10232 __Pyx_RefNannySetupContext(
"reverse", 0);
10241 __Pyx_XDECREF(__pyx_r);
10242 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1135, __pyx_L1_error)
10243 __Pyx_GOTREF(__pyx_t_1);
10244 __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)
10245 __Pyx_GOTREF(__pyx_t_2);
10246 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10247 __pyx_r = __pyx_t_2;
10261 __Pyx_XDECREF(__pyx_t_1);
10262 __Pyx_XDECREF(__pyx_t_2);
10263 __Pyx_AddTraceback(
"PyClical.clifford.reverse", __pyx_clineno, __pyx_lineno, __pyx_filename);
10266 __Pyx_XGIVEREF(__pyx_r);
10267 __Pyx_RefNannyFinishContext();
10280 static PyObject *__pyx_pw_8PyClical_8clifford_77conj(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10281 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 ";
10282 static PyObject *__pyx_pw_8PyClical_8clifford_77conj(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10283 PyObject *__pyx_r = 0;
10284 __Pyx_RefNannyDeclarations
10285 __Pyx_RefNannySetupContext(
"conj (wrapper)", 0);
10286 __pyx_r = __pyx_pf_8PyClical_8clifford_76conj(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10289 __Pyx_RefNannyFinishContext();
10293 static PyObject *__pyx_pf_8PyClical_8clifford_76conj(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10294 PyObject *__pyx_r = NULL;
10295 __Pyx_RefNannyDeclarations
10296 PyObject *__pyx_t_1 = NULL;
10297 PyObject *__pyx_t_2 = NULL;
10298 __Pyx_RefNannySetupContext(
"conj", 0);
10307 __Pyx_XDECREF(__pyx_r);
10308 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1150, __pyx_L1_error)
10309 __Pyx_GOTREF(__pyx_t_1);
10310 __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)
10311 __Pyx_GOTREF(__pyx_t_2);
10312 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10313 __pyx_r = __pyx_t_2;
10327 __Pyx_XDECREF(__pyx_t_1);
10328 __Pyx_XDECREF(__pyx_t_2);
10329 __Pyx_AddTraceback(
"PyClical.clifford.conj", __pyx_clineno, __pyx_lineno, __pyx_filename);
10332 __Pyx_XGIVEREF(__pyx_r);
10333 __Pyx_RefNannyFinishContext();
10346 static PyObject *__pyx_pw_8PyClical_8clifford_79quad(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10347 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 ";
10348 static PyObject *__pyx_pw_8PyClical_8clifford_79quad(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10349 PyObject *__pyx_r = 0;
10350 __Pyx_RefNannyDeclarations
10351 __Pyx_RefNannySetupContext(
"quad (wrapper)", 0);
10352 __pyx_r = __pyx_pf_8PyClical_8clifford_78quad(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10355 __Pyx_RefNannyFinishContext();
10359 static PyObject *__pyx_pf_8PyClical_8clifford_78quad(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10360 PyObject *__pyx_r = NULL;
10361 __Pyx_RefNannyDeclarations
10362 PyObject *__pyx_t_1 = NULL;
10363 __Pyx_RefNannySetupContext(
"quad", 0);
10372 __Pyx_XDECREF(__pyx_r);
10373 __pyx_t_1 =
PyFloat_FromDouble(__pyx_v_self->instance->quad());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1161, __pyx_L1_error)
10374 __Pyx_GOTREF(__pyx_t_1);
10375 __pyx_r = __pyx_t_1;
10389 __Pyx_XDECREF(__pyx_t_1);
10390 __Pyx_AddTraceback(
"PyClical.clifford.quad", __pyx_clineno, __pyx_lineno, __pyx_filename);
10393 __Pyx_XGIVEREF(__pyx_r);
10394 __Pyx_RefNannyFinishContext();
10407 static PyObject *__pyx_pw_8PyClical_8clifford_81norm(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10408 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 ";
10409 static PyObject *__pyx_pw_8PyClical_8clifford_81norm(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10410 PyObject *__pyx_r = 0;
10411 __Pyx_RefNannyDeclarations
10412 __Pyx_RefNannySetupContext(
"norm (wrapper)", 0);
10413 __pyx_r = __pyx_pf_8PyClical_8clifford_80norm(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10416 __Pyx_RefNannyFinishContext();
10420 static PyObject *__pyx_pf_8PyClical_8clifford_80norm(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10421 PyObject *__pyx_r = NULL;
10422 __Pyx_RefNannyDeclarations
10423 PyObject *__pyx_t_1 = NULL;
10424 __Pyx_RefNannySetupContext(
"norm", 0);
10433 __Pyx_XDECREF(__pyx_r);
10434 __pyx_t_1 =
PyFloat_FromDouble(__pyx_v_self->instance->norm());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1172, __pyx_L1_error)
10435 __Pyx_GOTREF(__pyx_t_1);
10436 __pyx_r = __pyx_t_1;
10450 __Pyx_XDECREF(__pyx_t_1);
10451 __Pyx_AddTraceback(
"PyClical.clifford.norm", __pyx_clineno, __pyx_lineno, __pyx_filename);
10454 __Pyx_XGIVEREF(__pyx_r);
10455 __Pyx_RefNannyFinishContext();
10468 static PyObject *__pyx_pw_8PyClical_8clifford_83abs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10469 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 ";
10470 static PyObject *__pyx_pw_8PyClical_8clifford_83abs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10471 PyObject *__pyx_r = 0;
10472 __Pyx_RefNannyDeclarations
10473 __Pyx_RefNannySetupContext(
"abs (wrapper)", 0);
10474 __pyx_r = __pyx_pf_8PyClical_8clifford_82abs(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10477 __Pyx_RefNannyFinishContext();
10481 static PyObject *__pyx_pf_8PyClical_8clifford_82abs(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10482 PyObject *__pyx_r = NULL;
10483 __Pyx_RefNannyDeclarations
10484 PyObject *__pyx_t_1 = NULL;
10485 __Pyx_RefNannySetupContext(
"abs", 0);
10494 __Pyx_XDECREF(__pyx_r);
10495 __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)
10496 __Pyx_GOTREF(__pyx_t_1);
10497 __pyx_r = __pyx_t_1;
10511 __Pyx_XDECREF(__pyx_t_1);
10512 __Pyx_AddTraceback(
"PyClical.clifford.abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
10515 __Pyx_XGIVEREF(__pyx_r);
10516 __Pyx_RefNannyFinishContext();
10529 static PyObject *__pyx_pw_8PyClical_8clifford_85max_abs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10530 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 ";
10531 static PyObject *__pyx_pw_8PyClical_8clifford_85max_abs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10532 PyObject *__pyx_r = 0;
10533 __Pyx_RefNannyDeclarations
10534 __Pyx_RefNannySetupContext(
"max_abs (wrapper)", 0);
10535 __pyx_r = __pyx_pf_8PyClical_8clifford_84max_abs(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10538 __Pyx_RefNannyFinishContext();
10542 static PyObject *__pyx_pf_8PyClical_8clifford_84max_abs(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10543 PyObject *__pyx_r = NULL;
10544 __Pyx_RefNannyDeclarations
10545 PyObject *__pyx_t_1 = NULL;
10546 __Pyx_RefNannySetupContext(
"max_abs", 0);
10555 __Pyx_XDECREF(__pyx_r);
10556 __pyx_t_1 =
PyFloat_FromDouble(__pyx_v_self->instance->max_abs());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1192, __pyx_L1_error)
10557 __Pyx_GOTREF(__pyx_t_1);
10558 __pyx_r = __pyx_t_1;
10572 __Pyx_XDECREF(__pyx_t_1);
10573 __Pyx_AddTraceback(
"PyClical.clifford.max_abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
10576 __Pyx_XGIVEREF(__pyx_r);
10577 __Pyx_RefNannyFinishContext();
10590 static PyObject *__pyx_pw_8PyClical_8clifford_87truncated(PyObject *__pyx_v_self, PyObject *__pyx_v_limit);
10591 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 ";
10592 static PyObject *__pyx_pw_8PyClical_8clifford_87truncated(PyObject *__pyx_v_self, PyObject *__pyx_v_limit) {
10593 PyObject *__pyx_r = 0;
10594 __Pyx_RefNannyDeclarations
10595 __Pyx_RefNannySetupContext(
"truncated (wrapper)", 0);
10596 __pyx_r = __pyx_pf_8PyClical_8clifford_86truncated(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_limit));
10599 __Pyx_RefNannyFinishContext();
10603 static PyObject *__pyx_pf_8PyClical_8clifford_86truncated(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_limit) {
10604 PyObject *__pyx_r = NULL;
10605 __Pyx_RefNannyDeclarations
10606 PyObject *__pyx_t_1 = NULL;
10608 PyObject *__pyx_t_3 = NULL;
10609 __Pyx_RefNannySetupContext(
"truncated", 0);
10618 __Pyx_XDECREF(__pyx_r);
10619 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1203, __pyx_L1_error)
10620 __Pyx_GOTREF(__pyx_t_1);
10621 __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)
10622 __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)
10623 __Pyx_GOTREF(__pyx_t_3);
10624 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10625 __pyx_r = __pyx_t_3;
10639 __Pyx_XDECREF(__pyx_t_1);
10640 __Pyx_XDECREF(__pyx_t_3);
10641 __Pyx_AddTraceback(
"PyClical.clifford.truncated", __pyx_clineno, __pyx_lineno, __pyx_filename);
10644 __Pyx_XGIVEREF(__pyx_r);
10645 __Pyx_RefNannyFinishContext();
10658 static PyObject *__pyx_pw_8PyClical_8clifford_89isnan(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10659 static char __pyx_doc_8PyClical_8clifford_88isnan[] =
"\n Check if a multivector contains any IEEE NaN values.\n\n >>> clifford().isnan()\n False\n ";
10660 static PyObject *__pyx_pw_8PyClical_8clifford_89isnan(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10661 PyObject *__pyx_r = 0;
10662 __Pyx_RefNannyDeclarations
10663 __Pyx_RefNannySetupContext(
"isnan (wrapper)", 0);
10664 __pyx_r = __pyx_pf_8PyClical_8clifford_88isnan(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10667 __Pyx_RefNannyFinishContext();
10671 static PyObject *__pyx_pf_8PyClical_8clifford_88isnan(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10672 PyObject *__pyx_r = NULL;
10673 __Pyx_RefNannyDeclarations
10674 PyObject *__pyx_t_1 = NULL;
10675 __Pyx_RefNannySetupContext(
"isnan", 0);
10684 __Pyx_XDECREF(__pyx_r);
10685 __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->instance->isnan());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1212, __pyx_L1_error)
10686 __Pyx_GOTREF(__pyx_t_1);
10687 __pyx_r = __pyx_t_1;
10701 __Pyx_XDECREF(__pyx_t_1);
10702 __Pyx_AddTraceback(
"PyClical.clifford.isnan", __pyx_clineno, __pyx_lineno, __pyx_filename);
10705 __Pyx_XGIVEREF(__pyx_r);
10706 __Pyx_RefNannyFinishContext();
10719 static PyObject *__pyx_pw_8PyClical_8clifford_91frame(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10720 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 ";
10721 static PyObject *__pyx_pw_8PyClical_8clifford_91frame(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10722 PyObject *__pyx_r = 0;
10723 __Pyx_RefNannyDeclarations
10724 __Pyx_RefNannySetupContext(
"frame (wrapper)", 0);
10725 __pyx_r = __pyx_pf_8PyClical_8clifford_90frame(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10728 __Pyx_RefNannyFinishContext();
10732 static PyObject *__pyx_pf_8PyClical_8clifford_90frame(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10733 PyObject *__pyx_r = NULL;
10734 __Pyx_RefNannyDeclarations
10735 PyObject *__pyx_t_1 = NULL;
10736 PyObject *__pyx_t_2 = NULL;
10737 __Pyx_RefNannySetupContext(
"frame", 0);
10746 __Pyx_XDECREF(__pyx_r);
10747 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_index_set));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1223, __pyx_L1_error)
10748 __Pyx_GOTREF(__pyx_t_1);
10749 __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)
10750 __Pyx_GOTREF(__pyx_t_2);
10751 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10752 __pyx_r = __pyx_t_2;
10766 __Pyx_XDECREF(__pyx_t_1);
10767 __Pyx_XDECREF(__pyx_t_2);
10768 __Pyx_AddTraceback(
"PyClical.clifford.frame", __pyx_clineno, __pyx_lineno, __pyx_filename);
10771 __Pyx_XGIVEREF(__pyx_r);
10772 __Pyx_RefNannyFinishContext();
10785 static PyObject *__pyx_pw_8PyClical_8clifford_93__repr__(PyObject *__pyx_v_self);
10786 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 ";
10787 #if CYTHON_COMPILING_IN_CPYTHON 10788 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_92__repr__;
10790 static PyObject *__pyx_pw_8PyClical_8clifford_93__repr__(PyObject *__pyx_v_self) {
10791 PyObject *__pyx_r = 0;
10792 __Pyx_RefNannyDeclarations
10793 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
10794 __pyx_r = __pyx_pf_8PyClical_8clifford_92__repr__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10797 __Pyx_RefNannyFinishContext();
10801 static PyObject *__pyx_pf_8PyClical_8clifford_92__repr__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10802 PyObject *__pyx_r = NULL;
10803 __Pyx_RefNannyDeclarations
10804 PyObject *__pyx_t_1 = NULL;
10805 __Pyx_RefNannySetupContext(
"__repr__", 0);
10814 __Pyx_XDECREF(__pyx_r);
10815 __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)
10816 __Pyx_GOTREF(__pyx_t_1);
10817 __pyx_r = __pyx_t_1;
10831 __Pyx_XDECREF(__pyx_t_1);
10832 __Pyx_AddTraceback(
"PyClical.clifford.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10835 __Pyx_XGIVEREF(__pyx_r);
10836 __Pyx_RefNannyFinishContext();
10849 static PyObject *__pyx_pw_8PyClical_8clifford_95__str__(PyObject *__pyx_v_self);
10850 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 ";
10851 #if CYTHON_COMPILING_IN_CPYTHON 10852 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_94__str__;
10854 static PyObject *__pyx_pw_8PyClical_8clifford_95__str__(PyObject *__pyx_v_self) {
10855 PyObject *__pyx_r = 0;
10856 __Pyx_RefNannyDeclarations
10857 __Pyx_RefNannySetupContext(
"__str__ (wrapper)", 0);
10858 __pyx_r = __pyx_pf_8PyClical_8clifford_94__str__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10861 __Pyx_RefNannyFinishContext();
10865 static PyObject *__pyx_pf_8PyClical_8clifford_94__str__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10866 PyObject *__pyx_r = NULL;
10867 __Pyx_RefNannyDeclarations
10868 PyObject *__pyx_t_1 = NULL;
10869 __Pyx_RefNannySetupContext(
"__str__", 0);
10878 __Pyx_XDECREF(__pyx_r);
10879 __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)
10880 __Pyx_GOTREF(__pyx_t_1);
10881 __pyx_r = __pyx_t_1;
10895 __Pyx_XDECREF(__pyx_t_1);
10896 __Pyx_AddTraceback(
"PyClical.clifford.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10899 __Pyx_XGIVEREF(__pyx_r);
10900 __Pyx_RefNannyFinishContext();
10911 static PyObject *__pyx_pw_8PyClical_8clifford_97__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10912 static PyObject *__pyx_pw_8PyClical_8clifford_97__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10913 PyObject *__pyx_r = 0;
10914 __Pyx_RefNannyDeclarations
10915 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
10916 __pyx_r = __pyx_pf_8PyClical_8clifford_96__reduce_cython__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10919 __Pyx_RefNannyFinishContext();
10923 static PyObject *__pyx_pf_8PyClical_8clifford_96__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10924 PyObject *__pyx_r = NULL;
10925 __Pyx_RefNannyDeclarations
10926 PyObject *__pyx_t_1 = NULL;
10927 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
10935 __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)
10936 __Pyx_GOTREF(__pyx_t_1);
10937 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
10938 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10939 __PYX_ERR(1, 2, __pyx_L1_error)
10949 __Pyx_XDECREF(__pyx_t_1);
10950 __Pyx_AddTraceback(
"PyClical.clifford.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10952 __Pyx_XGIVEREF(__pyx_r);
10953 __Pyx_RefNannyFinishContext();
10965 static PyObject *__pyx_pw_8PyClical_8clifford_99__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
10966 static PyObject *__pyx_pw_8PyClical_8clifford_99__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10967 PyObject *__pyx_r = 0;
10968 __Pyx_RefNannyDeclarations
10969 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
10970 __pyx_r = __pyx_pf_8PyClical_8clifford_98__setstate_cython__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
10973 __Pyx_RefNannyFinishContext();
10977 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) {
10978 PyObject *__pyx_r = NULL;
10979 __Pyx_RefNannyDeclarations
10980 PyObject *__pyx_t_1 = NULL;
10981 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
10988 __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)
10989 __Pyx_GOTREF(__pyx_t_1);
10990 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
10991 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10992 __PYX_ERR(1, 4, __pyx_L1_error)
11003 __Pyx_XDECREF(__pyx_t_1);
11004 __Pyx_AddTraceback(
"PyClical.clifford.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11006 __Pyx_XGIVEREF(__pyx_r);
11007 __Pyx_RefNannyFinishContext();
11020 static PyObject *__pyx_pw_8PyClical_9clifford_hidden_doctests(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused);
11021 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 ";
11022 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};
11023 static PyObject *__pyx_pw_8PyClical_9clifford_hidden_doctests(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
11024 PyObject *__pyx_r = 0;
11025 __Pyx_RefNannyDeclarations
11026 __Pyx_RefNannySetupContext(
"clifford_hidden_doctests (wrapper)", 0);
11027 __pyx_r = __pyx_pf_8PyClical_8clifford_hidden_doctests(__pyx_self);
11030 __Pyx_RefNannyFinishContext();
11034 static PyObject *__pyx_pf_8PyClical_8clifford_hidden_doctests(CYTHON_UNUSED PyObject *__pyx_self) {
11035 PyObject *__pyx_r = NULL;
11036 __Pyx_RefNannyDeclarations
11037 __Pyx_RefNannySetupContext(
"clifford_hidden_doctests", 0);
11046 __Pyx_XDECREF(__pyx_r);
11047 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11060 __Pyx_XGIVEREF(__pyx_r);
11061 __Pyx_RefNannyFinishContext();
11073 static PyObject *__pyx_pw_8PyClical_11inv(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11074 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_inv(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11075 PyObject *__pyx_r = NULL;
11076 __Pyx_RefNannyDeclarations
11077 PyObject *__pyx_t_1 = NULL;
11078 PyObject *__pyx_t_2 = NULL;
11079 PyObject *__pyx_t_3 = NULL;
11080 __Pyx_RefNannySetupContext(
"inv", 0);
11089 __Pyx_XDECREF(__pyx_r);
11090 __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)
11091 __Pyx_GOTREF(__pyx_t_2);
11092 __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)
11093 __Pyx_GOTREF(__pyx_t_3);
11094 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11096 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11097 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11098 if (likely(__pyx_t_2)) {
11099 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
11100 __Pyx_INCREF(__pyx_t_2);
11101 __Pyx_INCREF(
function);
11102 __Pyx_DECREF_SET(__pyx_t_3,
function);
11106 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1342, __pyx_L1_error)
11107 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11109 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1342, __pyx_L1_error)
11111 __Pyx_GOTREF(__pyx_t_1);
11112 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11113 __pyx_r = __pyx_t_1;
11127 __Pyx_XDECREF(__pyx_t_1);
11128 __Pyx_XDECREF(__pyx_t_2);
11129 __Pyx_XDECREF(__pyx_t_3);
11130 __Pyx_AddTraceback(
"PyClical.inv", __pyx_clineno, __pyx_lineno, __pyx_filename);
11133 __Pyx_XGIVEREF(__pyx_r);
11134 __Pyx_RefNannyFinishContext();
11139 static PyObject *__pyx_pw_8PyClical_11inv(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11140 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 ";
11141 static PyObject *__pyx_pw_8PyClical_11inv(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11142 PyObject *__pyx_r = 0;
11143 __Pyx_RefNannyDeclarations
11144 __Pyx_RefNannySetupContext(
"inv (wrapper)", 0);
11145 __pyx_r = __pyx_pf_8PyClical_10inv(__pyx_self, ((PyObject *)__pyx_v_obj));
11148 __Pyx_RefNannyFinishContext();
11152 static PyObject *__pyx_pf_8PyClical_10inv(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11153 PyObject *__pyx_r = NULL;
11154 __Pyx_RefNannyDeclarations
11155 PyObject *__pyx_t_1 = NULL;
11156 __Pyx_RefNannySetupContext(
"inv", 0);
11157 __Pyx_XDECREF(__pyx_r);
11158 __pyx_t_1 = __pyx_f_8PyClical_inv(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1329, __pyx_L1_error)
11159 __Pyx_GOTREF(__pyx_t_1);
11160 __pyx_r = __pyx_t_1;
11166 __Pyx_XDECREF(__pyx_t_1);
11167 __Pyx_AddTraceback(
"PyClical.inv", __pyx_clineno, __pyx_lineno, __pyx_filename);
11170 __Pyx_XGIVEREF(__pyx_r);
11171 __Pyx_RefNannyFinishContext();
11183 static PyObject *__pyx_pw_8PyClical_13scalar(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11184 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_scalar(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11185 PyObject *__pyx_r = NULL;
11186 __Pyx_RefNannyDeclarations
11187 PyObject *__pyx_t_1 = NULL;
11188 PyObject *__pyx_t_2 = NULL;
11189 PyObject *__pyx_t_3 = NULL;
11190 __Pyx_RefNannySetupContext(
"scalar", 0);
11199 __Pyx_XDECREF(__pyx_r);
11200 __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)
11201 __Pyx_GOTREF(__pyx_t_2);
11202 __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)
11203 __Pyx_GOTREF(__pyx_t_3);
11204 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11206 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11207 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11208 if (likely(__pyx_t_2)) {
11209 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
11210 __Pyx_INCREF(__pyx_t_2);
11211 __Pyx_INCREF(
function);
11212 __Pyx_DECREF_SET(__pyx_t_3,
function);
11216 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1353, __pyx_L1_error)
11217 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11219 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1353, __pyx_L1_error)
11221 __Pyx_GOTREF(__pyx_t_1);
11222 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11223 __pyx_r = __pyx_t_1;
11237 __Pyx_XDECREF(__pyx_t_1);
11238 __Pyx_XDECREF(__pyx_t_2);
11239 __Pyx_XDECREF(__pyx_t_3);
11240 __Pyx_AddTraceback(
"PyClical.scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
11243 __Pyx_XGIVEREF(__pyx_r);
11244 __Pyx_RefNannyFinishContext();
11249 static PyObject *__pyx_pw_8PyClical_13scalar(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11250 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 ";
11251 static PyObject *__pyx_pw_8PyClical_13scalar(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11252 PyObject *__pyx_r = 0;
11253 __Pyx_RefNannyDeclarations
11254 __Pyx_RefNannySetupContext(
"scalar (wrapper)", 0);
11255 __pyx_r = __pyx_pf_8PyClical_12scalar(__pyx_self, ((PyObject *)__pyx_v_obj));
11258 __Pyx_RefNannyFinishContext();
11262 static PyObject *__pyx_pf_8PyClical_12scalar(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11263 PyObject *__pyx_r = NULL;
11264 __Pyx_RefNannyDeclarations
11265 PyObject *__pyx_t_1 = NULL;
11266 __Pyx_RefNannySetupContext(
"scalar", 0);
11267 __Pyx_XDECREF(__pyx_r);
11268 __pyx_t_1 = __pyx_f_8PyClical_scalar(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1344, __pyx_L1_error)
11269 __Pyx_GOTREF(__pyx_t_1);
11270 __pyx_r = __pyx_t_1;
11276 __Pyx_XDECREF(__pyx_t_1);
11277 __Pyx_AddTraceback(
"PyClical.scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
11280 __Pyx_XGIVEREF(__pyx_r);
11281 __Pyx_RefNannyFinishContext();
11293 static PyObject *__pyx_pw_8PyClical_15real(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11294 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_real(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11295 PyObject *__pyx_r = NULL;
11296 __Pyx_RefNannyDeclarations
11297 PyObject *__pyx_t_1 = NULL;
11298 PyObject *__pyx_t_2 = NULL;
11299 PyObject *__pyx_t_3 = NULL;
11300 __Pyx_RefNannySetupContext(
"real", 0);
11309 __Pyx_XDECREF(__pyx_r);
11310 __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)
11311 __Pyx_GOTREF(__pyx_t_2);
11312 __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)
11313 __Pyx_GOTREF(__pyx_t_3);
11314 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11316 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11317 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11318 if (likely(__pyx_t_2)) {
11319 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
11320 __Pyx_INCREF(__pyx_t_2);
11321 __Pyx_INCREF(
function);
11322 __Pyx_DECREF_SET(__pyx_t_3,
function);
11326 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1364, __pyx_L1_error)
11327 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11329 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1364, __pyx_L1_error)
11331 __Pyx_GOTREF(__pyx_t_1);
11332 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11333 __pyx_r = __pyx_t_1;
11347 __Pyx_XDECREF(__pyx_t_1);
11348 __Pyx_XDECREF(__pyx_t_2);
11349 __Pyx_XDECREF(__pyx_t_3);
11350 __Pyx_AddTraceback(
"PyClical.real", __pyx_clineno, __pyx_lineno, __pyx_filename);
11353 __Pyx_XGIVEREF(__pyx_r);
11354 __Pyx_RefNannyFinishContext();
11359 static PyObject *__pyx_pw_8PyClical_15real(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11360 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 ";
11361 static PyObject *__pyx_pw_8PyClical_15real(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11362 PyObject *__pyx_r = 0;
11363 __Pyx_RefNannyDeclarations
11364 __Pyx_RefNannySetupContext(
"real (wrapper)", 0);
11365 __pyx_r = __pyx_pf_8PyClical_14real(__pyx_self, ((PyObject *)__pyx_v_obj));
11368 __Pyx_RefNannyFinishContext();
11372 static PyObject *__pyx_pf_8PyClical_14real(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11373 PyObject *__pyx_r = NULL;
11374 __Pyx_RefNannyDeclarations
11375 PyObject *__pyx_t_1 = NULL;
11376 __Pyx_RefNannySetupContext(
"real", 0);
11377 __Pyx_XDECREF(__pyx_r);
11378 __pyx_t_1 = __pyx_f_8PyClical_real(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1355, __pyx_L1_error)
11379 __Pyx_GOTREF(__pyx_t_1);
11380 __pyx_r = __pyx_t_1;
11386 __Pyx_XDECREF(__pyx_t_1);
11387 __Pyx_AddTraceback(
"PyClical.real", __pyx_clineno, __pyx_lineno, __pyx_filename);
11390 __Pyx_XGIVEREF(__pyx_r);
11391 __Pyx_RefNannyFinishContext();
11403 static PyObject *__pyx_pw_8PyClical_17imag(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11404 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_imag(CYTHON_UNUSED PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11405 PyObject *__pyx_r = NULL;
11406 __Pyx_RefNannyDeclarations
11407 __Pyx_RefNannySetupContext(
"imag", 0);
11416 __Pyx_XDECREF(__pyx_r);
11417 __Pyx_INCREF(__pyx_float_0_0);
11418 __pyx_r = __pyx_float_0_0;
11431 __Pyx_XGIVEREF(__pyx_r);
11432 __Pyx_RefNannyFinishContext();
11437 static PyObject *__pyx_pw_8PyClical_17imag(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11438 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 ";
11439 static PyObject *__pyx_pw_8PyClical_17imag(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11440 PyObject *__pyx_r = 0;
11441 __Pyx_RefNannyDeclarations
11442 __Pyx_RefNannySetupContext(
"imag (wrapper)", 0);
11443 __pyx_r = __pyx_pf_8PyClical_16imag(__pyx_self, ((PyObject *)__pyx_v_obj));
11446 __Pyx_RefNannyFinishContext();
11450 static PyObject *__pyx_pf_8PyClical_16imag(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11451 PyObject *__pyx_r = NULL;
11452 __Pyx_RefNannyDeclarations
11453 PyObject *__pyx_t_1 = NULL;
11454 __Pyx_RefNannySetupContext(
"imag", 0);
11455 __Pyx_XDECREF(__pyx_r);
11456 __pyx_t_1 = __pyx_f_8PyClical_imag(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1366, __pyx_L1_error)
11457 __Pyx_GOTREF(__pyx_t_1);
11458 __pyx_r = __pyx_t_1;
11464 __Pyx_XDECREF(__pyx_t_1);
11465 __Pyx_AddTraceback(
"PyClical.imag", __pyx_clineno, __pyx_lineno, __pyx_filename);
11468 __Pyx_XGIVEREF(__pyx_r);
11469 __Pyx_RefNannyFinishContext();
11481 static PyObject *__pyx_pw_8PyClical_19pure(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11482 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_pure(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11483 PyObject *__pyx_r = NULL;
11484 __Pyx_RefNannyDeclarations
11485 PyObject *__pyx_t_1 = NULL;
11486 PyObject *__pyx_t_2 = NULL;
11487 PyObject *__pyx_t_3 = NULL;
11488 __Pyx_RefNannySetupContext(
"pure", 0);
11497 __Pyx_XDECREF(__pyx_r);
11498 __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)
11499 __Pyx_GOTREF(__pyx_t_2);
11500 __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)
11501 __Pyx_GOTREF(__pyx_t_3);
11502 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11504 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11505 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11506 if (likely(__pyx_t_2)) {
11507 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
11508 __Pyx_INCREF(__pyx_t_2);
11509 __Pyx_INCREF(
function);
11510 __Pyx_DECREF_SET(__pyx_t_3,
function);
11514 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1386, __pyx_L1_error)
11515 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11517 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1386, __pyx_L1_error)
11519 __Pyx_GOTREF(__pyx_t_1);
11520 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11521 __pyx_r = __pyx_t_1;
11535 __Pyx_XDECREF(__pyx_t_1);
11536 __Pyx_XDECREF(__pyx_t_2);
11537 __Pyx_XDECREF(__pyx_t_3);
11538 __Pyx_AddTraceback(
"PyClical.pure", __pyx_clineno, __pyx_lineno, __pyx_filename);
11541 __Pyx_XGIVEREF(__pyx_r);
11542 __Pyx_RefNannyFinishContext();
11547 static PyObject *__pyx_pw_8PyClical_19pure(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11548 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 ";
11549 static PyObject *__pyx_pw_8PyClical_19pure(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11550 PyObject *__pyx_r = 0;
11551 __Pyx_RefNannyDeclarations
11552 __Pyx_RefNannySetupContext(
"pure (wrapper)", 0);
11553 __pyx_r = __pyx_pf_8PyClical_18pure(__pyx_self, ((PyObject *)__pyx_v_obj));
11556 __Pyx_RefNannyFinishContext();
11560 static PyObject *__pyx_pf_8PyClical_18pure(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11561 PyObject *__pyx_r = NULL;
11562 __Pyx_RefNannyDeclarations
11563 PyObject *__pyx_t_1 = NULL;
11564 __Pyx_RefNannySetupContext(
"pure", 0);
11565 __Pyx_XDECREF(__pyx_r);
11566 __pyx_t_1 = __pyx_f_8PyClical_pure(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1377, __pyx_L1_error)
11567 __Pyx_GOTREF(__pyx_t_1);
11568 __pyx_r = __pyx_t_1;
11574 __Pyx_XDECREF(__pyx_t_1);
11575 __Pyx_AddTraceback(
"PyClical.pure", __pyx_clineno, __pyx_lineno, __pyx_filename);
11578 __Pyx_XGIVEREF(__pyx_r);
11579 __Pyx_RefNannyFinishContext();
11591 static PyObject *__pyx_pw_8PyClical_21even(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11592 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_even(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11593 PyObject *__pyx_r = NULL;
11594 __Pyx_RefNannyDeclarations
11595 PyObject *__pyx_t_1 = NULL;
11596 PyObject *__pyx_t_2 = NULL;
11597 PyObject *__pyx_t_3 = NULL;
11598 __Pyx_RefNannySetupContext(
"even", 0);
11607 __Pyx_XDECREF(__pyx_r);
11608 __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)
11609 __Pyx_GOTREF(__pyx_t_2);
11610 __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)
11611 __Pyx_GOTREF(__pyx_t_3);
11612 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11614 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11615 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11616 if (likely(__pyx_t_2)) {
11617 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
11618 __Pyx_INCREF(__pyx_t_2);
11619 __Pyx_INCREF(
function);
11620 __Pyx_DECREF_SET(__pyx_t_3,
function);
11624 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1395, __pyx_L1_error)
11625 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11627 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1395, __pyx_L1_error)
11629 __Pyx_GOTREF(__pyx_t_1);
11630 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11631 __pyx_r = __pyx_t_1;
11645 __Pyx_XDECREF(__pyx_t_1);
11646 __Pyx_XDECREF(__pyx_t_2);
11647 __Pyx_XDECREF(__pyx_t_3);
11648 __Pyx_AddTraceback(
"PyClical.even", __pyx_clineno, __pyx_lineno, __pyx_filename);
11651 __Pyx_XGIVEREF(__pyx_r);
11652 __Pyx_RefNannyFinishContext();
11657 static PyObject *__pyx_pw_8PyClical_21even(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11658 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 ";
11659 static PyObject *__pyx_pw_8PyClical_21even(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11660 PyObject *__pyx_r = 0;
11661 __Pyx_RefNannyDeclarations
11662 __Pyx_RefNannySetupContext(
"even (wrapper)", 0);
11663 __pyx_r = __pyx_pf_8PyClical_20even(__pyx_self, ((PyObject *)__pyx_v_obj));
11666 __Pyx_RefNannyFinishContext();
11670 static PyObject *__pyx_pf_8PyClical_20even(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11671 PyObject *__pyx_r = NULL;
11672 __Pyx_RefNannyDeclarations
11673 PyObject *__pyx_t_1 = NULL;
11674 __Pyx_RefNannySetupContext(
"even", 0);
11675 __Pyx_XDECREF(__pyx_r);
11676 __pyx_t_1 = __pyx_f_8PyClical_even(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1388, __pyx_L1_error)
11677 __Pyx_GOTREF(__pyx_t_1);
11678 __pyx_r = __pyx_t_1;
11684 __Pyx_XDECREF(__pyx_t_1);
11685 __Pyx_AddTraceback(
"PyClical.even", __pyx_clineno, __pyx_lineno, __pyx_filename);
11688 __Pyx_XGIVEREF(__pyx_r);
11689 __Pyx_RefNannyFinishContext();
11701 static PyObject *__pyx_pw_8PyClical_23odd(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11702 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_odd(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11703 PyObject *__pyx_r = NULL;
11704 __Pyx_RefNannyDeclarations
11705 PyObject *__pyx_t_1 = NULL;
11706 PyObject *__pyx_t_2 = NULL;
11707 PyObject *__pyx_t_3 = NULL;
11708 __Pyx_RefNannySetupContext(
"odd", 0);
11717 __Pyx_XDECREF(__pyx_r);
11718 __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)
11719 __Pyx_GOTREF(__pyx_t_2);
11720 __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)
11721 __Pyx_GOTREF(__pyx_t_3);
11722 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11724 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11725 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11726 if (likely(__pyx_t_2)) {
11727 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
11728 __Pyx_INCREF(__pyx_t_2);
11729 __Pyx_INCREF(
function);
11730 __Pyx_DECREF_SET(__pyx_t_3,
function);
11734 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1404, __pyx_L1_error)
11735 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11737 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1404, __pyx_L1_error)
11739 __Pyx_GOTREF(__pyx_t_1);
11740 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11741 __pyx_r = __pyx_t_1;
11755 __Pyx_XDECREF(__pyx_t_1);
11756 __Pyx_XDECREF(__pyx_t_2);
11757 __Pyx_XDECREF(__pyx_t_3);
11758 __Pyx_AddTraceback(
"PyClical.odd", __pyx_clineno, __pyx_lineno, __pyx_filename);
11761 __Pyx_XGIVEREF(__pyx_r);
11762 __Pyx_RefNannyFinishContext();
11767 static PyObject *__pyx_pw_8PyClical_23odd(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11768 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 ";
11769 static PyObject *__pyx_pw_8PyClical_23odd(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11770 PyObject *__pyx_r = 0;
11771 __Pyx_RefNannyDeclarations
11772 __Pyx_RefNannySetupContext(
"odd (wrapper)", 0);
11773 __pyx_r = __pyx_pf_8PyClical_22odd(__pyx_self, ((PyObject *)__pyx_v_obj));
11776 __Pyx_RefNannyFinishContext();
11780 static PyObject *__pyx_pf_8PyClical_22odd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11781 PyObject *__pyx_r = NULL;
11782 __Pyx_RefNannyDeclarations
11783 PyObject *__pyx_t_1 = NULL;
11784 __Pyx_RefNannySetupContext(
"odd", 0);
11785 __Pyx_XDECREF(__pyx_r);
11786 __pyx_t_1 = __pyx_f_8PyClical_odd(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1397, __pyx_L1_error)
11787 __Pyx_GOTREF(__pyx_t_1);
11788 __pyx_r = __pyx_t_1;
11794 __Pyx_XDECREF(__pyx_t_1);
11795 __Pyx_AddTraceback(
"PyClical.odd", __pyx_clineno, __pyx_lineno, __pyx_filename);
11798 __Pyx_XGIVEREF(__pyx_r);
11799 __Pyx_RefNannyFinishContext();
11811 static PyObject *__pyx_pw_8PyClical_25involute(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11812 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_involute(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11813 PyObject *__pyx_r = NULL;
11814 __Pyx_RefNannyDeclarations
11815 PyObject *__pyx_t_1 = NULL;
11816 PyObject *__pyx_t_2 = NULL;
11817 PyObject *__pyx_t_3 = NULL;
11818 __Pyx_RefNannySetupContext(
"involute", 0);
11827 __Pyx_XDECREF(__pyx_r);
11828 __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)
11829 __Pyx_GOTREF(__pyx_t_2);
11830 __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)
11831 __Pyx_GOTREF(__pyx_t_3);
11832 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11834 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11835 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11836 if (likely(__pyx_t_2)) {
11837 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
11838 __Pyx_INCREF(__pyx_t_2);
11839 __Pyx_INCREF(
function);
11840 __Pyx_DECREF_SET(__pyx_t_3,
function);
11844 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1419, __pyx_L1_error)
11845 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11847 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1419, __pyx_L1_error)
11849 __Pyx_GOTREF(__pyx_t_1);
11850 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11851 __pyx_r = __pyx_t_1;
11865 __Pyx_XDECREF(__pyx_t_1);
11866 __Pyx_XDECREF(__pyx_t_2);
11867 __Pyx_XDECREF(__pyx_t_3);
11868 __Pyx_AddTraceback(
"PyClical.involute", __pyx_clineno, __pyx_lineno, __pyx_filename);
11871 __Pyx_XGIVEREF(__pyx_r);
11872 __Pyx_RefNannyFinishContext();
11877 static PyObject *__pyx_pw_8PyClical_25involute(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11878 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 ";
11879 static PyObject *__pyx_pw_8PyClical_25involute(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11880 PyObject *__pyx_r = 0;
11881 __Pyx_RefNannyDeclarations
11882 __Pyx_RefNannySetupContext(
"involute (wrapper)", 0);
11883 __pyx_r = __pyx_pf_8PyClical_24involute(__pyx_self, ((PyObject *)__pyx_v_obj));
11886 __Pyx_RefNannyFinishContext();
11890 static PyObject *__pyx_pf_8PyClical_24involute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11891 PyObject *__pyx_r = NULL;
11892 __Pyx_RefNannyDeclarations
11893 PyObject *__pyx_t_1 = NULL;
11894 __Pyx_RefNannySetupContext(
"involute", 0);
11895 __Pyx_XDECREF(__pyx_r);
11896 __pyx_t_1 = __pyx_f_8PyClical_involute(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1406, __pyx_L1_error)
11897 __Pyx_GOTREF(__pyx_t_1);
11898 __pyx_r = __pyx_t_1;
11904 __Pyx_XDECREF(__pyx_t_1);
11905 __Pyx_AddTraceback(
"PyClical.involute", __pyx_clineno, __pyx_lineno, __pyx_filename);
11908 __Pyx_XGIVEREF(__pyx_r);
11909 __Pyx_RefNannyFinishContext();
11921 static PyObject *__pyx_pw_8PyClical_27reverse(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11922 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_reverse(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11923 PyObject *__pyx_r = NULL;
11924 __Pyx_RefNannyDeclarations
11925 PyObject *__pyx_t_1 = NULL;
11926 PyObject *__pyx_t_2 = NULL;
11927 PyObject *__pyx_t_3 = NULL;
11928 __Pyx_RefNannySetupContext(
"reverse", 0);
11937 __Pyx_XDECREF(__pyx_r);
11938 __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)
11939 __Pyx_GOTREF(__pyx_t_2);
11940 __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)
11941 __Pyx_GOTREF(__pyx_t_3);
11942 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11944 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11945 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11946 if (likely(__pyx_t_2)) {
11947 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
11948 __Pyx_INCREF(__pyx_t_2);
11949 __Pyx_INCREF(
function);
11950 __Pyx_DECREF_SET(__pyx_t_3,
function);
11954 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1434, __pyx_L1_error)
11955 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11957 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1434, __pyx_L1_error)
11959 __Pyx_GOTREF(__pyx_t_1);
11960 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11961 __pyx_r = __pyx_t_1;
11975 __Pyx_XDECREF(__pyx_t_1);
11976 __Pyx_XDECREF(__pyx_t_2);
11977 __Pyx_XDECREF(__pyx_t_3);
11978 __Pyx_AddTraceback(
"PyClical.reverse", __pyx_clineno, __pyx_lineno, __pyx_filename);
11981 __Pyx_XGIVEREF(__pyx_r);
11982 __Pyx_RefNannyFinishContext();
11987 static PyObject *__pyx_pw_8PyClical_27reverse(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11988 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 ";
11989 static PyObject *__pyx_pw_8PyClical_27reverse(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11990 PyObject *__pyx_r = 0;
11991 __Pyx_RefNannyDeclarations
11992 __Pyx_RefNannySetupContext(
"reverse (wrapper)", 0);
11993 __pyx_r = __pyx_pf_8PyClical_26reverse(__pyx_self, ((PyObject *)__pyx_v_obj));
11996 __Pyx_RefNannyFinishContext();
12000 static PyObject *__pyx_pf_8PyClical_26reverse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12001 PyObject *__pyx_r = NULL;
12002 __Pyx_RefNannyDeclarations
12003 PyObject *__pyx_t_1 = NULL;
12004 __Pyx_RefNannySetupContext(
"reverse", 0);
12005 __Pyx_XDECREF(__pyx_r);
12006 __pyx_t_1 = __pyx_f_8PyClical_reverse(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1421, __pyx_L1_error)
12007 __Pyx_GOTREF(__pyx_t_1);
12008 __pyx_r = __pyx_t_1;
12014 __Pyx_XDECREF(__pyx_t_1);
12015 __Pyx_AddTraceback(
"PyClical.reverse", __pyx_clineno, __pyx_lineno, __pyx_filename);
12018 __Pyx_XGIVEREF(__pyx_r);
12019 __Pyx_RefNannyFinishContext();
12031 static PyObject *__pyx_pw_8PyClical_29conj(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12032 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_conj(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12033 PyObject *__pyx_r = NULL;
12034 __Pyx_RefNannyDeclarations
12035 PyObject *__pyx_t_1 = NULL;
12036 PyObject *__pyx_t_2 = NULL;
12037 PyObject *__pyx_t_3 = NULL;
12038 __Pyx_RefNannySetupContext(
"conj", 0);
12047 __Pyx_XDECREF(__pyx_r);
12048 __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)
12049 __Pyx_GOTREF(__pyx_t_2);
12050 __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)
12051 __Pyx_GOTREF(__pyx_t_3);
12052 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12054 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
12055 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
12056 if (likely(__pyx_t_2)) {
12057 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
12058 __Pyx_INCREF(__pyx_t_2);
12059 __Pyx_INCREF(
function);
12060 __Pyx_DECREF_SET(__pyx_t_3,
function);
12064 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1449, __pyx_L1_error)
12065 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12067 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1449, __pyx_L1_error)
12069 __Pyx_GOTREF(__pyx_t_1);
12070 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12071 __pyx_r = __pyx_t_1;
12085 __Pyx_XDECREF(__pyx_t_1);
12086 __Pyx_XDECREF(__pyx_t_2);
12087 __Pyx_XDECREF(__pyx_t_3);
12088 __Pyx_AddTraceback(
"PyClical.conj", __pyx_clineno, __pyx_lineno, __pyx_filename);
12091 __Pyx_XGIVEREF(__pyx_r);
12092 __Pyx_RefNannyFinishContext();
12097 static PyObject *__pyx_pw_8PyClical_29conj(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12098 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 ";
12099 static PyObject *__pyx_pw_8PyClical_29conj(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12100 PyObject *__pyx_r = 0;
12101 __Pyx_RefNannyDeclarations
12102 __Pyx_RefNannySetupContext(
"conj (wrapper)", 0);
12103 __pyx_r = __pyx_pf_8PyClical_28conj(__pyx_self, ((PyObject *)__pyx_v_obj));
12106 __Pyx_RefNannyFinishContext();
12110 static PyObject *__pyx_pf_8PyClical_28conj(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12111 PyObject *__pyx_r = NULL;
12112 __Pyx_RefNannyDeclarations
12113 PyObject *__pyx_t_1 = NULL;
12114 __Pyx_RefNannySetupContext(
"conj", 0);
12115 __Pyx_XDECREF(__pyx_r);
12116 __pyx_t_1 = __pyx_f_8PyClical_conj(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1436, __pyx_L1_error)
12117 __Pyx_GOTREF(__pyx_t_1);
12118 __pyx_r = __pyx_t_1;
12124 __Pyx_XDECREF(__pyx_t_1);
12125 __Pyx_AddTraceback(
"PyClical.conj", __pyx_clineno, __pyx_lineno, __pyx_filename);
12128 __Pyx_XGIVEREF(__pyx_r);
12129 __Pyx_RefNannyFinishContext();
12141 static PyObject *__pyx_pw_8PyClical_31quad(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12142 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_quad(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12143 PyObject *__pyx_r = NULL;
12144 __Pyx_RefNannyDeclarations
12145 PyObject *__pyx_t_1 = NULL;
12146 PyObject *__pyx_t_2 = NULL;
12147 PyObject *__pyx_t_3 = NULL;
12148 __Pyx_RefNannySetupContext(
"quad", 0);
12157 __Pyx_XDECREF(__pyx_r);
12158 __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)
12159 __Pyx_GOTREF(__pyx_t_2);
12160 __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)
12161 __Pyx_GOTREF(__pyx_t_3);
12162 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12164 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
12165 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
12166 if (likely(__pyx_t_2)) {
12167 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
12168 __Pyx_INCREF(__pyx_t_2);
12169 __Pyx_INCREF(
function);
12170 __Pyx_DECREF_SET(__pyx_t_3,
function);
12174 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1460, __pyx_L1_error)
12175 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12177 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1460, __pyx_L1_error)
12179 __Pyx_GOTREF(__pyx_t_1);
12180 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12181 __pyx_r = __pyx_t_1;
12195 __Pyx_XDECREF(__pyx_t_1);
12196 __Pyx_XDECREF(__pyx_t_2);
12197 __Pyx_XDECREF(__pyx_t_3);
12198 __Pyx_AddTraceback(
"PyClical.quad", __pyx_clineno, __pyx_lineno, __pyx_filename);
12201 __Pyx_XGIVEREF(__pyx_r);
12202 __Pyx_RefNannyFinishContext();
12207 static PyObject *__pyx_pw_8PyClical_31quad(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12208 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 ";
12209 static PyObject *__pyx_pw_8PyClical_31quad(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12210 PyObject *__pyx_r = 0;
12211 __Pyx_RefNannyDeclarations
12212 __Pyx_RefNannySetupContext(
"quad (wrapper)", 0);
12213 __pyx_r = __pyx_pf_8PyClical_30quad(__pyx_self, ((PyObject *)__pyx_v_obj));
12216 __Pyx_RefNannyFinishContext();
12220 static PyObject *__pyx_pf_8PyClical_30quad(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12221 PyObject *__pyx_r = NULL;
12222 __Pyx_RefNannyDeclarations
12223 PyObject *__pyx_t_1 = NULL;
12224 __Pyx_RefNannySetupContext(
"quad", 0);
12225 __Pyx_XDECREF(__pyx_r);
12226 __pyx_t_1 = __pyx_f_8PyClical_quad(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1451, __pyx_L1_error)
12227 __Pyx_GOTREF(__pyx_t_1);
12228 __pyx_r = __pyx_t_1;
12234 __Pyx_XDECREF(__pyx_t_1);
12235 __Pyx_AddTraceback(
"PyClical.quad", __pyx_clineno, __pyx_lineno, __pyx_filename);
12238 __Pyx_XGIVEREF(__pyx_r);
12239 __Pyx_RefNannyFinishContext();
12251 static PyObject *__pyx_pw_8PyClical_33norm(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12252 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_norm(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12253 PyObject *__pyx_r = NULL;
12254 __Pyx_RefNannyDeclarations
12255 PyObject *__pyx_t_1 = NULL;
12256 PyObject *__pyx_t_2 = NULL;
12257 PyObject *__pyx_t_3 = NULL;
12258 __Pyx_RefNannySetupContext(
"norm", 0);
12267 __Pyx_XDECREF(__pyx_r);
12268 __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)
12269 __Pyx_GOTREF(__pyx_t_2);
12270 __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)
12271 __Pyx_GOTREF(__pyx_t_3);
12272 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12274 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
12275 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
12276 if (likely(__pyx_t_2)) {
12277 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
12278 __Pyx_INCREF(__pyx_t_2);
12279 __Pyx_INCREF(
function);
12280 __Pyx_DECREF_SET(__pyx_t_3,
function);
12284 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1471, __pyx_L1_error)
12285 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12287 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1471, __pyx_L1_error)
12289 __Pyx_GOTREF(__pyx_t_1);
12290 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12291 __pyx_r = __pyx_t_1;
12305 __Pyx_XDECREF(__pyx_t_1);
12306 __Pyx_XDECREF(__pyx_t_2);
12307 __Pyx_XDECREF(__pyx_t_3);
12308 __Pyx_AddTraceback(
"PyClical.norm", __pyx_clineno, __pyx_lineno, __pyx_filename);
12311 __Pyx_XGIVEREF(__pyx_r);
12312 __Pyx_RefNannyFinishContext();
12317 static PyObject *__pyx_pw_8PyClical_33norm(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12318 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 ";
12319 static PyObject *__pyx_pw_8PyClical_33norm(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12320 PyObject *__pyx_r = 0;
12321 __Pyx_RefNannyDeclarations
12322 __Pyx_RefNannySetupContext(
"norm (wrapper)", 0);
12323 __pyx_r = __pyx_pf_8PyClical_32norm(__pyx_self, ((PyObject *)__pyx_v_obj));
12326 __Pyx_RefNannyFinishContext();
12330 static PyObject *__pyx_pf_8PyClical_32norm(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12331 PyObject *__pyx_r = NULL;
12332 __Pyx_RefNannyDeclarations
12333 PyObject *__pyx_t_1 = NULL;
12334 __Pyx_RefNannySetupContext(
"norm", 0);
12335 __Pyx_XDECREF(__pyx_r);
12336 __pyx_t_1 = __pyx_f_8PyClical_norm(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1462, __pyx_L1_error)
12337 __Pyx_GOTREF(__pyx_t_1);
12338 __pyx_r = __pyx_t_1;
12344 __Pyx_XDECREF(__pyx_t_1);
12345 __Pyx_AddTraceback(
"PyClical.norm", __pyx_clineno, __pyx_lineno, __pyx_filename);
12348 __Pyx_XGIVEREF(__pyx_r);
12349 __Pyx_RefNannyFinishContext();
12361 static PyObject *__pyx_pw_8PyClical_35abs(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12362 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_abs(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12363 PyObject *__pyx_r = NULL;
12364 __Pyx_RefNannyDeclarations
12365 PyObject *__pyx_t_1 = NULL;
12366 __Pyx_RefNannySetupContext(
"abs", 0);
12375 __Pyx_XDECREF(__pyx_r);
12376 __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)
12377 __Pyx_GOTREF(__pyx_t_1);
12378 __pyx_r = __pyx_t_1;
12392 __Pyx_XDECREF(__pyx_t_1);
12393 __Pyx_AddTraceback(
"PyClical.abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
12396 __Pyx_XGIVEREF(__pyx_r);
12397 __Pyx_RefNannyFinishContext();
12402 static PyObject *__pyx_pw_8PyClical_35abs(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12403 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 ";
12404 static PyObject *__pyx_pw_8PyClical_35abs(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12405 PyObject *__pyx_r = 0;
12406 __Pyx_RefNannyDeclarations
12407 __Pyx_RefNannySetupContext(
"abs (wrapper)", 0);
12408 __pyx_r = __pyx_pf_8PyClical_34abs(__pyx_self, ((PyObject *)__pyx_v_obj));
12411 __Pyx_RefNannyFinishContext();
12415 static PyObject *__pyx_pf_8PyClical_34abs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12416 PyObject *__pyx_r = NULL;
12417 __Pyx_RefNannyDeclarations
12418 PyObject *__pyx_t_1 = NULL;
12419 __Pyx_RefNannySetupContext(
"abs", 0);
12420 __Pyx_XDECREF(__pyx_r);
12421 __pyx_t_1 = __pyx_f_8PyClical_abs(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1473, __pyx_L1_error)
12422 __Pyx_GOTREF(__pyx_t_1);
12423 __pyx_r = __pyx_t_1;
12429 __Pyx_XDECREF(__pyx_t_1);
12430 __Pyx_AddTraceback(
"PyClical.abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
12433 __Pyx_XGIVEREF(__pyx_r);
12434 __Pyx_RefNannyFinishContext();
12446 static PyObject *__pyx_pw_8PyClical_37max_abs(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12447 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_max_abs(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12448 PyObject *__pyx_r = NULL;
12449 __Pyx_RefNannyDeclarations
12450 PyObject *__pyx_t_1 = NULL;
12451 __Pyx_RefNannySetupContext(
"max_abs", 0);
12460 __Pyx_XDECREF(__pyx_r);
12461 __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)
12462 __Pyx_GOTREF(__pyx_t_1);
12463 __pyx_r = __pyx_t_1;
12477 __Pyx_XDECREF(__pyx_t_1);
12478 __Pyx_AddTraceback(
"PyClical.max_abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
12481 __Pyx_XGIVEREF(__pyx_r);
12482 __Pyx_RefNannyFinishContext();
12487 static PyObject *__pyx_pw_8PyClical_37max_abs(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12488 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 ";
12489 static PyObject *__pyx_pw_8PyClical_37max_abs(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12490 PyObject *__pyx_r = 0;
12491 __Pyx_RefNannyDeclarations
12492 __Pyx_RefNannySetupContext(
"max_abs (wrapper)", 0);
12493 __pyx_r = __pyx_pf_8PyClical_36max_abs(__pyx_self, ((PyObject *)__pyx_v_obj));
12496 __Pyx_RefNannyFinishContext();
12500 static PyObject *__pyx_pf_8PyClical_36max_abs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12501 PyObject *__pyx_r = NULL;
12502 __Pyx_RefNannyDeclarations
12503 PyObject *__pyx_t_1 = NULL;
12504 __Pyx_RefNannySetupContext(
"max_abs", 0);
12505 __Pyx_XDECREF(__pyx_r);
12506 __pyx_t_1 = __pyx_f_8PyClical_max_abs(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1482, __pyx_L1_error)
12507 __Pyx_GOTREF(__pyx_t_1);
12508 __pyx_r = __pyx_t_1;
12514 __Pyx_XDECREF(__pyx_t_1);
12515 __Pyx_AddTraceback(
"PyClical.max_abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
12518 __Pyx_XGIVEREF(__pyx_r);
12519 __Pyx_RefNannyFinishContext();
12531 static PyObject *__pyx_pw_8PyClical_39pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
12532 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_pow(PyObject *__pyx_v_obj, PyObject *__pyx_v_m, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12533 PyObject *__pyx_r = NULL;
12534 __Pyx_RefNannyDeclarations
12535 PyObject *__pyx_t_1 = NULL;
12536 PyObject *__pyx_t_2 = NULL;
12537 PyObject *__pyx_t_3 = NULL;
12538 PyObject *__pyx_t_4 = NULL;
12539 PyObject *__pyx_t_5 = NULL;
12540 PyObject *__pyx_t_6 = NULL;
12542 PyObject *__pyx_t_8 = NULL;
12543 PyObject *__pyx_t_9 = NULL;
12544 PyObject *__pyx_t_10 = NULL;
12545 PyObject *__pyx_t_11 = NULL;
12546 __Pyx_RefNannySetupContext(
"pow", 0);
12556 __Pyx_PyThreadState_declare
12557 __Pyx_PyThreadState_assign
12558 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
12559 __Pyx_XGOTREF(__pyx_t_1);
12560 __Pyx_XGOTREF(__pyx_t_2);
12561 __Pyx_XGOTREF(__pyx_t_3);
12571 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1514, __pyx_L3_error)
12572 __Pyx_GOTREF(__pyx_t_5);
12573 __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)
12574 __Pyx_GOTREF(__pyx_t_6);
12575 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12578 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
12579 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
12580 if (likely(__pyx_t_5)) {
12581 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
12582 __Pyx_INCREF(__pyx_t_5);
12583 __Pyx_INCREF(
function);
12584 __Pyx_DECREF_SET(__pyx_t_6,
function);
12588 #if CYTHON_FAST_PYCALL 12589 if (PyFunction_Check(__pyx_t_6)) {
12590 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_obj, __pyx_v_m};
12591 __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)
12592 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12593 __Pyx_GOTREF(__pyx_t_4);
12596 #if CYTHON_FAST_PYCCALL 12597 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
12598 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_obj, __pyx_v_m};
12599 __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)
12600 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12601 __Pyx_GOTREF(__pyx_t_4);
12605 __pyx_t_8 = PyTuple_New(2+__pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1514, __pyx_L3_error)
12606 __Pyx_GOTREF(__pyx_t_8);
12608 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
12610 __Pyx_INCREF(__pyx_v_obj);
12611 __Pyx_GIVEREF(__pyx_v_obj);
12612 PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_obj);
12613 __Pyx_INCREF(__pyx_v_m);
12614 __Pyx_GIVEREF(__pyx_v_m);
12615 PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_m);
12616 __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)
12617 __Pyx_GOTREF(__pyx_t_4);
12618 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12620 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12621 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12631 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12632 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12633 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12634 goto __pyx_L8_try_end;
12636 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12637 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
12638 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12639 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12649 __Pyx_AddTraceback(
"PyClical.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
12650 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_8) < 0) __PYX_ERR(0, 1515, __pyx_L5_except_error)
12651 __Pyx_GOTREF(__pyx_t_4);
12652 __Pyx_GOTREF(__pyx_t_6);
12653 __Pyx_GOTREF(__pyx_t_8);
12662 __Pyx_XDECREF(__pyx_r);
12663 __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)
12664 __Pyx_GOTREF(__pyx_t_9);
12665 __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)
12666 __Pyx_GOTREF(__pyx_t_10);
12667 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12669 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
12670 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
12671 if (likely(__pyx_t_9)) {
12672 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_10);
12673 __Pyx_INCREF(__pyx_t_9);
12674 __Pyx_INCREF(
function);
12675 __Pyx_DECREF_SET(__pyx_t_10,
function);
12679 __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)
12680 __Pyx_GOTREF(__pyx_t_5);
12682 #if CYTHON_FAST_PYCALL 12683 if (PyFunction_Check(__pyx_t_10)) {
12684 PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_v_m};
12685 __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)
12686 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
12687 __Pyx_GOTREF(__pyx_t_5);
12690 #if CYTHON_FAST_PYCCALL 12691 if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
12692 PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_v_m};
12693 __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)
12694 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
12695 __Pyx_GOTREF(__pyx_t_5);
12699 __pyx_t_11 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1516, __pyx_L5_except_error)
12700 __Pyx_GOTREF(__pyx_t_11);
12701 __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
12702 __Pyx_INCREF(__pyx_v_m);
12703 __Pyx_GIVEREF(__pyx_v_m);
12704 PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_v_m);
12705 __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)
12706 __Pyx_GOTREF(__pyx_t_5);
12707 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
12710 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12711 __pyx_r = __pyx_t_5;
12713 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12714 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12715 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12716 goto __pyx_L6_except_return;
12718 __pyx_L5_except_error:;
12727 __Pyx_XGIVEREF(__pyx_t_1);
12728 __Pyx_XGIVEREF(__pyx_t_2);
12729 __Pyx_XGIVEREF(__pyx_t_3);
12730 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
12731 goto __pyx_L1_error;
12732 __pyx_L6_except_return:;
12733 __Pyx_XGIVEREF(__pyx_t_1);
12734 __Pyx_XGIVEREF(__pyx_t_2);
12735 __Pyx_XGIVEREF(__pyx_t_3);
12736 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
12750 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12753 __Pyx_XDECREF(__pyx_t_4);
12754 __Pyx_XDECREF(__pyx_t_5);
12755 __Pyx_XDECREF(__pyx_t_6);
12756 __Pyx_XDECREF(__pyx_t_8);
12757 __Pyx_XDECREF(__pyx_t_9);
12758 __Pyx_XDECREF(__pyx_t_10);
12759 __Pyx_XDECREF(__pyx_t_11);
12760 __Pyx_AddTraceback(
"PyClical.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
12763 __Pyx_XGIVEREF(__pyx_r);
12764 __Pyx_RefNannyFinishContext();
12769 static PyObject *__pyx_pw_8PyClical_39pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
12770 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 ";
12771 static PyObject *__pyx_pw_8PyClical_39pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
12772 PyObject *__pyx_v_obj = 0;
12773 PyObject *__pyx_v_m = 0;
12774 PyObject *__pyx_r = 0;
12775 __Pyx_RefNannyDeclarations
12776 __Pyx_RefNannySetupContext(
"pow (wrapper)", 0);
12778 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_m,0};
12779 PyObject* values[2] = {0,0};
12780 if (unlikely(__pyx_kwds)) {
12781 Py_ssize_t kw_args;
12782 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
12783 switch (pos_args) {
12784 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12785 CYTHON_FALLTHROUGH;
12786 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12787 CYTHON_FALLTHROUGH;
12789 default:
goto __pyx_L5_argtuple_error;
12791 kw_args = PyDict_Size(__pyx_kwds);
12792 switch (pos_args) {
12794 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
12795 else goto __pyx_L5_argtuple_error;
12796 CYTHON_FALLTHROUGH;
12798 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
12800 __Pyx_RaiseArgtupleInvalid(
"pow", 1, 2, 2, 1); __PYX_ERR(0, 1494, __pyx_L3_error)
12803 if (unlikely(kw_args > 0)) {
12804 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"pow") < 0)) __PYX_ERR(0, 1494, __pyx_L3_error)
12806 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
12807 goto __pyx_L5_argtuple_error;
12809 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12810 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12812 __pyx_v_obj = values[0];
12813 __pyx_v_m = values[1];
12815 goto __pyx_L4_argument_unpacking_done;
12816 __pyx_L5_argtuple_error:;
12817 __Pyx_RaiseArgtupleInvalid(
"pow", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1494, __pyx_L3_error)
12819 __Pyx_AddTraceback(
"PyClical.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
12820 __Pyx_RefNannyFinishContext();
12822 __pyx_L4_argument_unpacking_done:;
12823 __pyx_r = __pyx_pf_8PyClical_38pow(__pyx_self, __pyx_v_obj, __pyx_v_m);
12826 __Pyx_RefNannyFinishContext();
12830 static PyObject *__pyx_pf_8PyClical_38pow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_m) {
12831 PyObject *__pyx_r = NULL;
12832 __Pyx_RefNannyDeclarations
12833 PyObject *__pyx_t_1 = NULL;
12834 __Pyx_RefNannySetupContext(
"pow", 0);
12835 __Pyx_XDECREF(__pyx_r);
12836 __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)
12837 __Pyx_GOTREF(__pyx_t_1);
12838 __pyx_r = __pyx_t_1;
12844 __Pyx_XDECREF(__pyx_t_1);
12845 __Pyx_AddTraceback(
"PyClical.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
12848 __Pyx_XGIVEREF(__pyx_r);
12849 __Pyx_RefNannyFinishContext();
12861 static PyObject *__pyx_pw_8PyClical_41outer_pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
12862 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_outer_pow(PyObject *__pyx_v_obj, PyObject *__pyx_v_m, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12863 PyObject *__pyx_r = NULL;
12864 __Pyx_RefNannyDeclarations
12865 PyObject *__pyx_t_1 = NULL;
12866 PyObject *__pyx_t_2 = NULL;
12867 PyObject *__pyx_t_3 = NULL;
12868 PyObject *__pyx_t_4 = NULL;
12869 __Pyx_RefNannySetupContext(
"outer_pow", 0);
12878 __Pyx_XDECREF(__pyx_r);
12879 __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)
12880 __Pyx_GOTREF(__pyx_t_2);
12881 __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)
12882 __Pyx_GOTREF(__pyx_t_3);
12883 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12885 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
12886 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
12887 if (likely(__pyx_t_2)) {
12888 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
12889 __Pyx_INCREF(__pyx_t_2);
12890 __Pyx_INCREF(
function);
12891 __Pyx_DECREF_SET(__pyx_t_3,
function);
12895 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_m);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1525, __pyx_L1_error)
12896 __Pyx_GOTREF(__pyx_t_1);
12898 #if CYTHON_FAST_PYCALL 12899 if (PyFunction_Check(__pyx_t_3)) {
12900 PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_v_m};
12901 __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)
12902 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12903 __Pyx_GOTREF(__pyx_t_1);
12906 #if CYTHON_FAST_PYCCALL 12907 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
12908 PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_v_m};
12909 __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)
12910 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12911 __Pyx_GOTREF(__pyx_t_1);
12915 __pyx_t_4 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1525, __pyx_L1_error)
12916 __Pyx_GOTREF(__pyx_t_4);
12917 __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL;
12918 __Pyx_INCREF(__pyx_v_m);
12919 __Pyx_GIVEREF(__pyx_v_m);
12920 PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_m);
12921 __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)
12922 __Pyx_GOTREF(__pyx_t_1);
12923 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12926 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12927 __pyx_r = __pyx_t_1;
12941 __Pyx_XDECREF(__pyx_t_1);
12942 __Pyx_XDECREF(__pyx_t_2);
12943 __Pyx_XDECREF(__pyx_t_3);
12944 __Pyx_XDECREF(__pyx_t_4);
12945 __Pyx_AddTraceback(
"PyClical.outer_pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
12948 __Pyx_XGIVEREF(__pyx_r);
12949 __Pyx_RefNannyFinishContext();
12954 static PyObject *__pyx_pw_8PyClical_41outer_pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
12955 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 ";
12956 static PyObject *__pyx_pw_8PyClical_41outer_pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
12957 PyObject *__pyx_v_obj = 0;
12958 PyObject *__pyx_v_m = 0;
12959 PyObject *__pyx_r = 0;
12960 __Pyx_RefNannyDeclarations
12961 __Pyx_RefNannySetupContext(
"outer_pow (wrapper)", 0);
12963 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_m,0};
12964 PyObject* values[2] = {0,0};
12965 if (unlikely(__pyx_kwds)) {
12966 Py_ssize_t kw_args;
12967 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
12968 switch (pos_args) {
12969 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12970 CYTHON_FALLTHROUGH;
12971 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12972 CYTHON_FALLTHROUGH;
12974 default:
goto __pyx_L5_argtuple_error;
12976 kw_args = PyDict_Size(__pyx_kwds);
12977 switch (pos_args) {
12979 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
12980 else goto __pyx_L5_argtuple_error;
12981 CYTHON_FALLTHROUGH;
12983 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
12985 __Pyx_RaiseArgtupleInvalid(
"outer_pow", 1, 2, 2, 1); __PYX_ERR(0, 1518, __pyx_L3_error)
12988 if (unlikely(kw_args > 0)) {
12989 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"outer_pow") < 0)) __PYX_ERR(0, 1518, __pyx_L3_error)
12991 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
12992 goto __pyx_L5_argtuple_error;
12994 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12995 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12997 __pyx_v_obj = values[0];
12998 __pyx_v_m = values[1];
13000 goto __pyx_L4_argument_unpacking_done;
13001 __pyx_L5_argtuple_error:;
13002 __Pyx_RaiseArgtupleInvalid(
"outer_pow", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1518, __pyx_L3_error)
13004 __Pyx_AddTraceback(
"PyClical.outer_pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
13005 __Pyx_RefNannyFinishContext();
13007 __pyx_L4_argument_unpacking_done:;
13008 __pyx_r = __pyx_pf_8PyClical_40outer_pow(__pyx_self, __pyx_v_obj, __pyx_v_m);
13011 __Pyx_RefNannyFinishContext();
13015 static PyObject *__pyx_pf_8PyClical_40outer_pow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_m) {
13016 PyObject *__pyx_r = NULL;
13017 __Pyx_RefNannyDeclarations
13018 PyObject *__pyx_t_1 = NULL;
13019 __Pyx_RefNannySetupContext(
"outer_pow", 0);
13020 __Pyx_XDECREF(__pyx_r);
13021 __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)
13022 __Pyx_GOTREF(__pyx_t_1);
13023 __pyx_r = __pyx_t_1;
13029 __Pyx_XDECREF(__pyx_t_1);
13030 __Pyx_AddTraceback(
"PyClical.outer_pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
13033 __Pyx_XGIVEREF(__pyx_r);
13034 __Pyx_RefNannyFinishContext();
13046 static PyObject *__pyx_pw_8PyClical_43complexifier(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13047 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_complexifier(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
13048 PyObject *__pyx_r = NULL;
13049 __Pyx_RefNannyDeclarations
13050 PyObject *__pyx_t_1 = NULL;
13051 PyObject *__pyx_t_2 = NULL;
13052 __Pyx_RefNannySetupContext(
"complexifier", 0);
13061 __Pyx_XDECREF(__pyx_r);
13062 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1540, __pyx_L1_error)
13063 __Pyx_GOTREF(__pyx_t_1);
13064 __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)
13065 __Pyx_GOTREF(__pyx_t_2);
13066 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13067 __pyx_r = __pyx_t_2;
13081 __Pyx_XDECREF(__pyx_t_1);
13082 __Pyx_XDECREF(__pyx_t_2);
13083 __Pyx_AddTraceback(
"PyClical.complexifier", __pyx_clineno, __pyx_lineno, __pyx_filename);
13086 __Pyx_XGIVEREF(__pyx_r);
13087 __Pyx_RefNannyFinishContext();
13092 static PyObject *__pyx_pw_8PyClical_43complexifier(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13093 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 ";
13094 static PyObject *__pyx_pw_8PyClical_43complexifier(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13095 PyObject *__pyx_r = 0;
13096 __Pyx_RefNannyDeclarations
13097 __Pyx_RefNannySetupContext(
"complexifier (wrapper)", 0);
13098 __pyx_r = __pyx_pf_8PyClical_42complexifier(__pyx_self, ((PyObject *)__pyx_v_obj));
13101 __Pyx_RefNannyFinishContext();
13105 static PyObject *__pyx_pf_8PyClical_42complexifier(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13106 PyObject *__pyx_r = NULL;
13107 __Pyx_RefNannyDeclarations
13108 PyObject *__pyx_t_1 = NULL;
13109 __Pyx_RefNannySetupContext(
"complexifier", 0);
13110 __Pyx_XDECREF(__pyx_r);
13111 __pyx_t_1 = __pyx_f_8PyClical_complexifier(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1527, __pyx_L1_error)
13112 __Pyx_GOTREF(__pyx_t_1);
13113 __pyx_r = __pyx_t_1;
13119 __Pyx_XDECREF(__pyx_t_1);
13120 __Pyx_AddTraceback(
"PyClical.complexifier", __pyx_clineno, __pyx_lineno, __pyx_filename);
13123 __Pyx_XGIVEREF(__pyx_r);
13124 __Pyx_RefNannyFinishContext();
13136 static PyObject *__pyx_pw_8PyClical_45sqrt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13137 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) {
13138 PyObject *__pyx_v_i = ((PyObject *)Py_None);
13139 PyObject *__pyx_r = NULL;
13140 __Pyx_RefNannyDeclarations
13143 PyObject *__pyx_t_3 = NULL;
13145 PyObject *__pyx_t_5 = NULL;
13146 PyObject *__pyx_t_6 = NULL;
13147 PyObject *__pyx_t_7 = NULL;
13148 PyObject *__pyx_t_8 = NULL;
13149 PyObject *__pyx_t_9 = NULL;
13150 PyObject *__pyx_t_10 = NULL;
13151 PyObject *__pyx_t_11 = NULL;
13152 __Pyx_RefNannySetupContext(
"sqrt", 0);
13153 if (__pyx_optional_args) {
13154 if (__pyx_optional_args->__pyx_n > 0) {
13155 __pyx_v_i = __pyx_optional_args->i;
13166 __pyx_t_1 = (__pyx_v_i != Py_None);
13167 __pyx_t_2 = (__pyx_t_1 != 0);
13177 __Pyx_XDECREF(__pyx_r);
13178 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1558, __pyx_L1_error)
13179 __Pyx_GOTREF(__pyx_t_3);
13181 __pyx_t_4 =
sqrt(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
13183 __Pyx_CppExn2PyErr();
13184 __PYX_ERR(0, 1558, __pyx_L1_error)
13186 __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)
13187 __Pyx_GOTREF(__pyx_t_5);
13188 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13189 __pyx_r = __pyx_t_5;
13211 __Pyx_PyThreadState_declare
13212 __Pyx_PyThreadState_assign
13213 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
13214 __Pyx_XGOTREF(__pyx_t_6);
13215 __Pyx_XGOTREF(__pyx_t_7);
13216 __Pyx_XGOTREF(__pyx_t_8);
13226 __Pyx_XDECREF(__pyx_r);
13227 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1561, __pyx_L4_error)
13228 __Pyx_GOTREF(__pyx_t_3);
13229 __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)
13230 __Pyx_GOTREF(__pyx_t_9);
13231 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13233 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
13234 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
13235 if (likely(__pyx_t_3)) {
13236 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
13237 __Pyx_INCREF(__pyx_t_3);
13238 __Pyx_INCREF(
function);
13239 __Pyx_DECREF_SET(__pyx_t_9,
function);
13243 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1561, __pyx_L4_error)
13244 __Pyx_GOTREF(__pyx_t_5);
13246 #if CYTHON_FAST_PYCALL 13247 if (PyFunction_Check(__pyx_t_9)) {
13248 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
13249 __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)
13250 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13251 __Pyx_GOTREF(__pyx_t_5);
13254 #if CYTHON_FAST_PYCCALL 13255 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
13256 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
13257 __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)
13258 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13259 __Pyx_GOTREF(__pyx_t_5);
13263 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1561, __pyx_L4_error)
13264 __Pyx_GOTREF(__pyx_t_10);
13265 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
13266 __Pyx_INCREF(__pyx_v_obj);
13267 __Pyx_GIVEREF(__pyx_v_obj);
13268 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
13269 __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)
13270 __Pyx_GOTREF(__pyx_t_5);
13271 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13274 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13275 __pyx_r = __pyx_t_5;
13277 goto __pyx_L8_try_return;
13288 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13289 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
13290 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
13291 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13301 __Pyx_AddTraceback(
"PyClical.sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename);
13302 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1562, __pyx_L6_except_error)
13303 __Pyx_GOTREF(__pyx_t_5);
13304 __Pyx_GOTREF(__pyx_t_9);
13305 __Pyx_GOTREF(__pyx_t_10);
13314 __Pyx_XDECREF(__pyx_r);
13315 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1563, __pyx_L6_except_error)
13316 __Pyx_GOTREF(__pyx_t_3);
13317 __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)
13318 __Pyx_GOTREF(__pyx_t_11);
13319 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13320 __pyx_r = __pyx_t_11;
13322 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13323 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13324 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13325 goto __pyx_L7_except_return;
13327 __pyx_L6_except_error:;
13336 __Pyx_XGIVEREF(__pyx_t_6);
13337 __Pyx_XGIVEREF(__pyx_t_7);
13338 __Pyx_XGIVEREF(__pyx_t_8);
13339 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
13340 goto __pyx_L1_error;
13341 __pyx_L8_try_return:;
13342 __Pyx_XGIVEREF(__pyx_t_6);
13343 __Pyx_XGIVEREF(__pyx_t_7);
13344 __Pyx_XGIVEREF(__pyx_t_8);
13345 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
13347 __pyx_L7_except_return:;
13348 __Pyx_XGIVEREF(__pyx_t_6);
13349 __Pyx_XGIVEREF(__pyx_t_7);
13350 __Pyx_XGIVEREF(__pyx_t_8);
13351 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
13366 __Pyx_XDECREF(__pyx_t_3);
13367 __Pyx_XDECREF(__pyx_t_5);
13368 __Pyx_XDECREF(__pyx_t_9);
13369 __Pyx_XDECREF(__pyx_t_10);
13370 __Pyx_XDECREF(__pyx_t_11);
13371 __Pyx_AddTraceback(
"PyClical.sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename);
13374 __Pyx_XGIVEREF(__pyx_r);
13375 __Pyx_RefNannyFinishContext();
13380 static PyObject *__pyx_pw_8PyClical_45sqrt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13381 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 ";
13382 static PyObject *__pyx_pw_8PyClical_45sqrt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13383 PyObject *__pyx_v_obj = 0;
13384 PyObject *__pyx_v_i = 0;
13385 PyObject *__pyx_r = 0;
13386 __Pyx_RefNannyDeclarations
13387 __Pyx_RefNannySetupContext(
"sqrt (wrapper)", 0);
13389 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
13390 PyObject* values[2] = {0,0};
13391 values[1] = ((PyObject *)Py_None);
13392 if (unlikely(__pyx_kwds)) {
13393 Py_ssize_t kw_args;
13394 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13395 switch (pos_args) {
13396 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13397 CYTHON_FALLTHROUGH;
13398 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13399 CYTHON_FALLTHROUGH;
13401 default:
goto __pyx_L5_argtuple_error;
13403 kw_args = PyDict_Size(__pyx_kwds);
13404 switch (pos_args) {
13406 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
13407 else goto __pyx_L5_argtuple_error;
13408 CYTHON_FALLTHROUGH;
13411 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
13412 if (value) { values[1] = value; kw_args--; }
13415 if (unlikely(kw_args > 0)) {
13416 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"sqrt") < 0)) __PYX_ERR(0, 1542, __pyx_L3_error)
13419 switch (PyTuple_GET_SIZE(__pyx_args)) {
13420 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13421 CYTHON_FALLTHROUGH;
13422 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13424 default:
goto __pyx_L5_argtuple_error;
13427 __pyx_v_obj = values[0];
13428 __pyx_v_i = values[1];
13430 goto __pyx_L4_argument_unpacking_done;
13431 __pyx_L5_argtuple_error:;
13432 __Pyx_RaiseArgtupleInvalid(
"sqrt", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1542, __pyx_L3_error)
13434 __Pyx_AddTraceback(
"PyClical.sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename);
13435 __Pyx_RefNannyFinishContext();
13437 __pyx_L4_argument_unpacking_done:;
13438 __pyx_r = __pyx_pf_8PyClical_44sqrt(__pyx_self, __pyx_v_obj, __pyx_v_i);
13441 __Pyx_RefNannyFinishContext();
13445 static PyObject *__pyx_pf_8PyClical_44sqrt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
13446 PyObject *__pyx_r = NULL;
13447 __Pyx_RefNannyDeclarations
13448 PyObject *__pyx_t_1 = NULL;
13449 struct __pyx_opt_args_8PyClical_sqrt __pyx_t_2;
13450 __Pyx_RefNannySetupContext(
"sqrt", 0);
13451 __Pyx_XDECREF(__pyx_r);
13452 __pyx_t_2.__pyx_n = 1;
13453 __pyx_t_2.i = __pyx_v_i;
13454 __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)
13455 __Pyx_GOTREF(__pyx_t_1);
13456 __pyx_r = __pyx_t_1;
13462 __Pyx_XDECREF(__pyx_t_1);
13463 __Pyx_AddTraceback(
"PyClical.sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename);
13466 __Pyx_XGIVEREF(__pyx_r);
13467 __Pyx_RefNannyFinishContext();
13479 static PyObject *__pyx_pw_8PyClical_47exp(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13480 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_exp(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
13481 PyObject *__pyx_r = NULL;
13482 __Pyx_RefNannyDeclarations
13483 PyObject *__pyx_t_1 = NULL;
13484 PyObject *__pyx_t_2 = NULL;
13485 PyObject *__pyx_t_3 = NULL;
13486 PyObject *__pyx_t_4 = NULL;
13487 PyObject *__pyx_t_5 = NULL;
13488 PyObject *__pyx_t_6 = NULL;
13489 PyObject *__pyx_t_7 = NULL;
13490 PyObject *__pyx_t_8 = NULL;
13491 __Pyx_RefNannySetupContext(
"exp", 0);
13501 __Pyx_PyThreadState_declare
13502 __Pyx_PyThreadState_assign
13503 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
13504 __Pyx_XGOTREF(__pyx_t_1);
13505 __Pyx_XGOTREF(__pyx_t_2);
13506 __Pyx_XGOTREF(__pyx_t_3);
13516 __Pyx_XDECREF(__pyx_r);
13517 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1575, __pyx_L3_error)
13518 __Pyx_GOTREF(__pyx_t_5);
13519 __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)
13520 __Pyx_GOTREF(__pyx_t_6);
13521 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13523 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
13524 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
13525 if (likely(__pyx_t_5)) {
13526 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
13527 __Pyx_INCREF(__pyx_t_5);
13528 __Pyx_INCREF(
function);
13529 __Pyx_DECREF_SET(__pyx_t_6,
function);
13533 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_obj);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1575, __pyx_L3_error)
13534 __Pyx_GOTREF(__pyx_t_4);
13536 #if CYTHON_FAST_PYCALL 13537 if (PyFunction_Check(__pyx_t_6)) {
13538 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_obj};
13539 __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)
13540 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13541 __Pyx_GOTREF(__pyx_t_4);
13544 #if CYTHON_FAST_PYCCALL 13545 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
13546 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_obj};
13547 __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)
13548 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13549 __Pyx_GOTREF(__pyx_t_4);
13553 __pyx_t_7 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1575, __pyx_L3_error)
13554 __Pyx_GOTREF(__pyx_t_7);
13555 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
13556 __Pyx_INCREF(__pyx_v_obj);
13557 __Pyx_GIVEREF(__pyx_v_obj);
13558 PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_obj);
13559 __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)
13560 __Pyx_GOTREF(__pyx_t_4);
13561 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13564 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13565 __pyx_r = __pyx_t_4;
13567 goto __pyx_L7_try_return;
13578 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13579 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
13580 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
13581 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
13591 __Pyx_AddTraceback(
"PyClical.exp", __pyx_clineno, __pyx_lineno, __pyx_filename);
13592 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1576, __pyx_L5_except_error)
13593 __Pyx_GOTREF(__pyx_t_4);
13594 __Pyx_GOTREF(__pyx_t_6);
13595 __Pyx_GOTREF(__pyx_t_7);
13604 __Pyx_XDECREF(__pyx_r);
13605 __pyx_t_5 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1577, __pyx_L5_except_error)
13606 __Pyx_GOTREF(__pyx_t_5);
13607 __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)
13608 __Pyx_GOTREF(__pyx_t_8);
13609 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13610 __pyx_r = __pyx_t_8;
13612 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13613 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13614 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13615 goto __pyx_L6_except_return;
13617 __pyx_L5_except_error:;
13626 __Pyx_XGIVEREF(__pyx_t_1);
13627 __Pyx_XGIVEREF(__pyx_t_2);
13628 __Pyx_XGIVEREF(__pyx_t_3);
13629 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
13630 goto __pyx_L1_error;
13631 __pyx_L7_try_return:;
13632 __Pyx_XGIVEREF(__pyx_t_1);
13633 __Pyx_XGIVEREF(__pyx_t_2);
13634 __Pyx_XGIVEREF(__pyx_t_3);
13635 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
13637 __pyx_L6_except_return:;
13638 __Pyx_XGIVEREF(__pyx_t_1);
13639 __Pyx_XGIVEREF(__pyx_t_2);
13640 __Pyx_XGIVEREF(__pyx_t_3);
13641 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
13655 __Pyx_XDECREF(__pyx_t_4);
13656 __Pyx_XDECREF(__pyx_t_5);
13657 __Pyx_XDECREF(__pyx_t_6);
13658 __Pyx_XDECREF(__pyx_t_7);
13659 __Pyx_XDECREF(__pyx_t_8);
13660 __Pyx_AddTraceback(
"PyClical.exp", __pyx_clineno, __pyx_lineno, __pyx_filename);
13663 __Pyx_XGIVEREF(__pyx_r);
13664 __Pyx_RefNannyFinishContext();
13669 static PyObject *__pyx_pw_8PyClical_47exp(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13670 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 ";
13671 static PyObject *__pyx_pw_8PyClical_47exp(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13672 PyObject *__pyx_r = 0;
13673 __Pyx_RefNannyDeclarations
13674 __Pyx_RefNannySetupContext(
"exp (wrapper)", 0);
13675 __pyx_r = __pyx_pf_8PyClical_46exp(__pyx_self, ((PyObject *)__pyx_v_obj));
13678 __Pyx_RefNannyFinishContext();
13682 static PyObject *__pyx_pf_8PyClical_46exp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13683 PyObject *__pyx_r = NULL;
13684 __Pyx_RefNannyDeclarations
13685 PyObject *__pyx_t_1 = NULL;
13686 __Pyx_RefNannySetupContext(
"exp", 0);
13687 __Pyx_XDECREF(__pyx_r);
13688 __pyx_t_1 = __pyx_f_8PyClical_exp(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1565, __pyx_L1_error)
13689 __Pyx_GOTREF(__pyx_t_1);
13690 __pyx_r = __pyx_t_1;
13696 __Pyx_XDECREF(__pyx_t_1);
13697 __Pyx_AddTraceback(
"PyClical.exp", __pyx_clineno, __pyx_lineno, __pyx_filename);
13700 __Pyx_XGIVEREF(__pyx_r);
13701 __Pyx_RefNannyFinishContext();
13713 static PyObject *__pyx_pw_8PyClical_49log(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13714 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) {
13715 PyObject *__pyx_v_i = ((PyObject *)Py_None);
13716 PyObject *__pyx_r = NULL;
13717 __Pyx_RefNannyDeclarations
13720 PyObject *__pyx_t_3 = NULL;
13722 PyObject *__pyx_t_5 = NULL;
13723 PyObject *__pyx_t_6 = NULL;
13724 PyObject *__pyx_t_7 = NULL;
13725 PyObject *__pyx_t_8 = NULL;
13726 PyObject *__pyx_t_9 = NULL;
13727 PyObject *__pyx_t_10 = NULL;
13728 PyObject *__pyx_t_11 = NULL;
13729 __Pyx_RefNannySetupContext(
"log", 0);
13730 if (__pyx_optional_args) {
13731 if (__pyx_optional_args->__pyx_n > 0) {
13732 __pyx_v_i = __pyx_optional_args->i;
13743 __pyx_t_1 = (__pyx_v_i != Py_None);
13744 __pyx_t_2 = (__pyx_t_1 != 0);
13754 __Pyx_XDECREF(__pyx_r);
13755 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1595, __pyx_L1_error)
13756 __Pyx_GOTREF(__pyx_t_3);
13758 __pyx_t_4 =
log(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
13760 __Pyx_CppExn2PyErr();
13761 __PYX_ERR(0, 1595, __pyx_L1_error)
13763 __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)
13764 __Pyx_GOTREF(__pyx_t_5);
13765 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13766 __pyx_r = __pyx_t_5;
13788 __Pyx_PyThreadState_declare
13789 __Pyx_PyThreadState_assign
13790 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
13791 __Pyx_XGOTREF(__pyx_t_6);
13792 __Pyx_XGOTREF(__pyx_t_7);
13793 __Pyx_XGOTREF(__pyx_t_8);
13803 __Pyx_XDECREF(__pyx_r);
13804 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1598, __pyx_L4_error)
13805 __Pyx_GOTREF(__pyx_t_3);
13806 __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)
13807 __Pyx_GOTREF(__pyx_t_9);
13808 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13810 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
13811 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
13812 if (likely(__pyx_t_3)) {
13813 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
13814 __Pyx_INCREF(__pyx_t_3);
13815 __Pyx_INCREF(
function);
13816 __Pyx_DECREF_SET(__pyx_t_9,
function);
13820 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1598, __pyx_L4_error)
13821 __Pyx_GOTREF(__pyx_t_5);
13823 #if CYTHON_FAST_PYCALL 13824 if (PyFunction_Check(__pyx_t_9)) {
13825 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
13826 __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)
13827 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13828 __Pyx_GOTREF(__pyx_t_5);
13831 #if CYTHON_FAST_PYCCALL 13832 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
13833 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
13834 __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)
13835 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13836 __Pyx_GOTREF(__pyx_t_5);
13840 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1598, __pyx_L4_error)
13841 __Pyx_GOTREF(__pyx_t_10);
13842 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
13843 __Pyx_INCREF(__pyx_v_obj);
13844 __Pyx_GIVEREF(__pyx_v_obj);
13845 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
13846 __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)
13847 __Pyx_GOTREF(__pyx_t_5);
13848 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13851 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13852 __pyx_r = __pyx_t_5;
13854 goto __pyx_L8_try_return;
13865 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13866 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
13867 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
13868 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13878 __Pyx_AddTraceback(
"PyClical.log", __pyx_clineno, __pyx_lineno, __pyx_filename);
13879 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1599, __pyx_L6_except_error)
13880 __Pyx_GOTREF(__pyx_t_5);
13881 __Pyx_GOTREF(__pyx_t_9);
13882 __Pyx_GOTREF(__pyx_t_10);
13891 __Pyx_XDECREF(__pyx_r);
13892 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1600, __pyx_L6_except_error)
13893 __Pyx_GOTREF(__pyx_t_3);
13894 __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)
13895 __Pyx_GOTREF(__pyx_t_11);
13896 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13897 __pyx_r = __pyx_t_11;
13899 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13900 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13901 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13902 goto __pyx_L7_except_return;
13904 __pyx_L6_except_error:;
13913 __Pyx_XGIVEREF(__pyx_t_6);
13914 __Pyx_XGIVEREF(__pyx_t_7);
13915 __Pyx_XGIVEREF(__pyx_t_8);
13916 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
13917 goto __pyx_L1_error;
13918 __pyx_L8_try_return:;
13919 __Pyx_XGIVEREF(__pyx_t_6);
13920 __Pyx_XGIVEREF(__pyx_t_7);
13921 __Pyx_XGIVEREF(__pyx_t_8);
13922 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
13924 __pyx_L7_except_return:;
13925 __Pyx_XGIVEREF(__pyx_t_6);
13926 __Pyx_XGIVEREF(__pyx_t_7);
13927 __Pyx_XGIVEREF(__pyx_t_8);
13928 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
13943 __Pyx_XDECREF(__pyx_t_3);
13944 __Pyx_XDECREF(__pyx_t_5);
13945 __Pyx_XDECREF(__pyx_t_9);
13946 __Pyx_XDECREF(__pyx_t_10);
13947 __Pyx_XDECREF(__pyx_t_11);
13948 __Pyx_AddTraceback(
"PyClical.log", __pyx_clineno, __pyx_lineno, __pyx_filename);
13951 __Pyx_XGIVEREF(__pyx_r);
13952 __Pyx_RefNannyFinishContext();
13957 static PyObject *__pyx_pw_8PyClical_49log(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13958 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 ";
13959 static PyObject *__pyx_pw_8PyClical_49log(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13960 PyObject *__pyx_v_obj = 0;
13961 PyObject *__pyx_v_i = 0;
13962 PyObject *__pyx_r = 0;
13963 __Pyx_RefNannyDeclarations
13964 __Pyx_RefNannySetupContext(
"log (wrapper)", 0);
13966 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
13967 PyObject* values[2] = {0,0};
13968 values[1] = ((PyObject *)Py_None);
13969 if (unlikely(__pyx_kwds)) {
13970 Py_ssize_t kw_args;
13971 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13972 switch (pos_args) {
13973 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13974 CYTHON_FALLTHROUGH;
13975 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13976 CYTHON_FALLTHROUGH;
13978 default:
goto __pyx_L5_argtuple_error;
13980 kw_args = PyDict_Size(__pyx_kwds);
13981 switch (pos_args) {
13983 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
13984 else goto __pyx_L5_argtuple_error;
13985 CYTHON_FALLTHROUGH;
13988 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
13989 if (value) { values[1] = value; kw_args--; }
13992 if (unlikely(kw_args > 0)) {
13993 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"log") < 0)) __PYX_ERR(0, 1579, __pyx_L3_error)
13996 switch (PyTuple_GET_SIZE(__pyx_args)) {
13997 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13998 CYTHON_FALLTHROUGH;
13999 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14001 default:
goto __pyx_L5_argtuple_error;
14004 __pyx_v_obj = values[0];
14005 __pyx_v_i = values[1];
14007 goto __pyx_L4_argument_unpacking_done;
14008 __pyx_L5_argtuple_error:;
14009 __Pyx_RaiseArgtupleInvalid(
"log", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1579, __pyx_L3_error)
14011 __Pyx_AddTraceback(
"PyClical.log", __pyx_clineno, __pyx_lineno, __pyx_filename);
14012 __Pyx_RefNannyFinishContext();
14014 __pyx_L4_argument_unpacking_done:;
14015 __pyx_r = __pyx_pf_8PyClical_48log(__pyx_self, __pyx_v_obj, __pyx_v_i);
14018 __Pyx_RefNannyFinishContext();
14022 static PyObject *__pyx_pf_8PyClical_48log(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
14023 PyObject *__pyx_r = NULL;
14024 __Pyx_RefNannyDeclarations
14025 PyObject *__pyx_t_1 = NULL;
14026 struct __pyx_opt_args_8PyClical_log __pyx_t_2;
14027 __Pyx_RefNannySetupContext(
"log", 0);
14028 __Pyx_XDECREF(__pyx_r);
14029 __pyx_t_2.__pyx_n = 1;
14030 __pyx_t_2.i = __pyx_v_i;
14031 __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)
14032 __Pyx_GOTREF(__pyx_t_1);
14033 __pyx_r = __pyx_t_1;
14039 __Pyx_XDECREF(__pyx_t_1);
14040 __Pyx_AddTraceback(
"PyClical.log", __pyx_clineno, __pyx_lineno, __pyx_filename);
14043 __Pyx_XGIVEREF(__pyx_r);
14044 __Pyx_RefNannyFinishContext();
14056 static PyObject *__pyx_pw_8PyClical_51cos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14057 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) {
14058 PyObject *__pyx_v_i = ((PyObject *)Py_None);
14059 PyObject *__pyx_r = NULL;
14060 __Pyx_RefNannyDeclarations
14063 PyObject *__pyx_t_3 = NULL;
14065 PyObject *__pyx_t_5 = NULL;
14066 PyObject *__pyx_t_6 = NULL;
14067 PyObject *__pyx_t_7 = NULL;
14068 PyObject *__pyx_t_8 = NULL;
14069 PyObject *__pyx_t_9 = NULL;
14070 PyObject *__pyx_t_10 = NULL;
14071 PyObject *__pyx_t_11 = NULL;
14072 __Pyx_RefNannySetupContext(
"cos", 0);
14073 if (__pyx_optional_args) {
14074 if (__pyx_optional_args->__pyx_n > 0) {
14075 __pyx_v_i = __pyx_optional_args->i;
14086 __pyx_t_1 = (__pyx_v_i != Py_None);
14087 __pyx_t_2 = (__pyx_t_1 != 0);
14097 __Pyx_XDECREF(__pyx_r);
14098 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1612, __pyx_L1_error)
14099 __Pyx_GOTREF(__pyx_t_3);
14101 __pyx_t_4 =
cos(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
14103 __Pyx_CppExn2PyErr();
14104 __PYX_ERR(0, 1612, __pyx_L1_error)
14106 __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)
14107 __Pyx_GOTREF(__pyx_t_5);
14108 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14109 __pyx_r = __pyx_t_5;
14131 __Pyx_PyThreadState_declare
14132 __Pyx_PyThreadState_assign
14133 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
14134 __Pyx_XGOTREF(__pyx_t_6);
14135 __Pyx_XGOTREF(__pyx_t_7);
14136 __Pyx_XGOTREF(__pyx_t_8);
14146 __Pyx_XDECREF(__pyx_r);
14147 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1615, __pyx_L4_error)
14148 __Pyx_GOTREF(__pyx_t_3);
14149 __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)
14150 __Pyx_GOTREF(__pyx_t_9);
14151 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14153 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
14154 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
14155 if (likely(__pyx_t_3)) {
14156 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
14157 __Pyx_INCREF(__pyx_t_3);
14158 __Pyx_INCREF(
function);
14159 __Pyx_DECREF_SET(__pyx_t_9,
function);
14163 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1615, __pyx_L4_error)
14164 __Pyx_GOTREF(__pyx_t_5);
14166 #if CYTHON_FAST_PYCALL 14167 if (PyFunction_Check(__pyx_t_9)) {
14168 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
14169 __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)
14170 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14171 __Pyx_GOTREF(__pyx_t_5);
14174 #if CYTHON_FAST_PYCCALL 14175 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
14176 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
14177 __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)
14178 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14179 __Pyx_GOTREF(__pyx_t_5);
14183 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1615, __pyx_L4_error)
14184 __Pyx_GOTREF(__pyx_t_10);
14185 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
14186 __Pyx_INCREF(__pyx_v_obj);
14187 __Pyx_GIVEREF(__pyx_v_obj);
14188 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
14189 __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)
14190 __Pyx_GOTREF(__pyx_t_5);
14191 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14194 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14195 __pyx_r = __pyx_t_5;
14197 goto __pyx_L8_try_return;
14208 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14209 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
14210 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
14211 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14221 __Pyx_AddTraceback(
"PyClical.cos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14222 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1616, __pyx_L6_except_error)
14223 __Pyx_GOTREF(__pyx_t_5);
14224 __Pyx_GOTREF(__pyx_t_9);
14225 __Pyx_GOTREF(__pyx_t_10);
14234 __Pyx_XDECREF(__pyx_r);
14235 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1617, __pyx_L6_except_error)
14236 __Pyx_GOTREF(__pyx_t_3);
14237 __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)
14238 __Pyx_GOTREF(__pyx_t_11);
14239 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14240 __pyx_r = __pyx_t_11;
14242 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14243 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14244 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14245 goto __pyx_L7_except_return;
14247 __pyx_L6_except_error:;
14256 __Pyx_XGIVEREF(__pyx_t_6);
14257 __Pyx_XGIVEREF(__pyx_t_7);
14258 __Pyx_XGIVEREF(__pyx_t_8);
14259 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14260 goto __pyx_L1_error;
14261 __pyx_L8_try_return:;
14262 __Pyx_XGIVEREF(__pyx_t_6);
14263 __Pyx_XGIVEREF(__pyx_t_7);
14264 __Pyx_XGIVEREF(__pyx_t_8);
14265 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14267 __pyx_L7_except_return:;
14268 __Pyx_XGIVEREF(__pyx_t_6);
14269 __Pyx_XGIVEREF(__pyx_t_7);
14270 __Pyx_XGIVEREF(__pyx_t_8);
14271 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14286 __Pyx_XDECREF(__pyx_t_3);
14287 __Pyx_XDECREF(__pyx_t_5);
14288 __Pyx_XDECREF(__pyx_t_9);
14289 __Pyx_XDECREF(__pyx_t_10);
14290 __Pyx_XDECREF(__pyx_t_11);
14291 __Pyx_AddTraceback(
"PyClical.cos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14294 __Pyx_XGIVEREF(__pyx_r);
14295 __Pyx_RefNannyFinishContext();
14300 static PyObject *__pyx_pw_8PyClical_51cos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14301 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 ";
14302 static PyObject *__pyx_pw_8PyClical_51cos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14303 PyObject *__pyx_v_obj = 0;
14304 PyObject *__pyx_v_i = 0;
14305 PyObject *__pyx_r = 0;
14306 __Pyx_RefNannyDeclarations
14307 __Pyx_RefNannySetupContext(
"cos (wrapper)", 0);
14309 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
14310 PyObject* values[2] = {0,0};
14311 values[1] = ((PyObject *)Py_None);
14312 if (unlikely(__pyx_kwds)) {
14313 Py_ssize_t kw_args;
14314 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14315 switch (pos_args) {
14316 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14317 CYTHON_FALLTHROUGH;
14318 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14319 CYTHON_FALLTHROUGH;
14321 default:
goto __pyx_L5_argtuple_error;
14323 kw_args = PyDict_Size(__pyx_kwds);
14324 switch (pos_args) {
14326 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
14327 else goto __pyx_L5_argtuple_error;
14328 CYTHON_FALLTHROUGH;
14331 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
14332 if (value) { values[1] = value; kw_args--; }
14335 if (unlikely(kw_args > 0)) {
14336 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"cos") < 0)) __PYX_ERR(0, 1602, __pyx_L3_error)
14339 switch (PyTuple_GET_SIZE(__pyx_args)) {
14340 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14341 CYTHON_FALLTHROUGH;
14342 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14344 default:
goto __pyx_L5_argtuple_error;
14347 __pyx_v_obj = values[0];
14348 __pyx_v_i = values[1];
14350 goto __pyx_L4_argument_unpacking_done;
14351 __pyx_L5_argtuple_error:;
14352 __Pyx_RaiseArgtupleInvalid(
"cos", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1602, __pyx_L3_error)
14354 __Pyx_AddTraceback(
"PyClical.cos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14355 __Pyx_RefNannyFinishContext();
14357 __pyx_L4_argument_unpacking_done:;
14358 __pyx_r = __pyx_pf_8PyClical_50cos(__pyx_self, __pyx_v_obj, __pyx_v_i);
14361 __Pyx_RefNannyFinishContext();
14365 static PyObject *__pyx_pf_8PyClical_50cos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
14366 PyObject *__pyx_r = NULL;
14367 __Pyx_RefNannyDeclarations
14368 PyObject *__pyx_t_1 = NULL;
14369 struct __pyx_opt_args_8PyClical_cos __pyx_t_2;
14370 __Pyx_RefNannySetupContext(
"cos", 0);
14371 __Pyx_XDECREF(__pyx_r);
14372 __pyx_t_2.__pyx_n = 1;
14373 __pyx_t_2.i = __pyx_v_i;
14374 __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)
14375 __Pyx_GOTREF(__pyx_t_1);
14376 __pyx_r = __pyx_t_1;
14382 __Pyx_XDECREF(__pyx_t_1);
14383 __Pyx_AddTraceback(
"PyClical.cos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14386 __Pyx_XGIVEREF(__pyx_r);
14387 __Pyx_RefNannyFinishContext();
14399 static PyObject *__pyx_pw_8PyClical_53acos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14400 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) {
14401 PyObject *__pyx_v_i = ((PyObject *)Py_None);
14402 PyObject *__pyx_r = NULL;
14403 __Pyx_RefNannyDeclarations
14406 PyObject *__pyx_t_3 = NULL;
14408 PyObject *__pyx_t_5 = NULL;
14409 PyObject *__pyx_t_6 = NULL;
14410 PyObject *__pyx_t_7 = NULL;
14411 PyObject *__pyx_t_8 = NULL;
14412 PyObject *__pyx_t_9 = NULL;
14413 PyObject *__pyx_t_10 = NULL;
14414 PyObject *__pyx_t_11 = NULL;
14415 __Pyx_RefNannySetupContext(
"acos", 0);
14416 if (__pyx_optional_args) {
14417 if (__pyx_optional_args->__pyx_n > 0) {
14418 __pyx_v_i = __pyx_optional_args->i;
14429 __pyx_t_1 = (__pyx_v_i != Py_None);
14430 __pyx_t_2 = (__pyx_t_1 != 0);
14440 __Pyx_XDECREF(__pyx_r);
14441 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1633, __pyx_L1_error)
14442 __Pyx_GOTREF(__pyx_t_3);
14444 __pyx_t_4 =
acos(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
14446 __Pyx_CppExn2PyErr();
14447 __PYX_ERR(0, 1633, __pyx_L1_error)
14449 __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)
14450 __Pyx_GOTREF(__pyx_t_5);
14451 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14452 __pyx_r = __pyx_t_5;
14474 __Pyx_PyThreadState_declare
14475 __Pyx_PyThreadState_assign
14476 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
14477 __Pyx_XGOTREF(__pyx_t_6);
14478 __Pyx_XGOTREF(__pyx_t_7);
14479 __Pyx_XGOTREF(__pyx_t_8);
14489 __Pyx_XDECREF(__pyx_r);
14490 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1636, __pyx_L4_error)
14491 __Pyx_GOTREF(__pyx_t_3);
14492 __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)
14493 __Pyx_GOTREF(__pyx_t_9);
14494 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14496 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
14497 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
14498 if (likely(__pyx_t_3)) {
14499 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
14500 __Pyx_INCREF(__pyx_t_3);
14501 __Pyx_INCREF(
function);
14502 __Pyx_DECREF_SET(__pyx_t_9,
function);
14506 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1636, __pyx_L4_error)
14507 __Pyx_GOTREF(__pyx_t_5);
14509 #if CYTHON_FAST_PYCALL 14510 if (PyFunction_Check(__pyx_t_9)) {
14511 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
14512 __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)
14513 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14514 __Pyx_GOTREF(__pyx_t_5);
14517 #if CYTHON_FAST_PYCCALL 14518 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
14519 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
14520 __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)
14521 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14522 __Pyx_GOTREF(__pyx_t_5);
14526 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1636, __pyx_L4_error)
14527 __Pyx_GOTREF(__pyx_t_10);
14528 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
14529 __Pyx_INCREF(__pyx_v_obj);
14530 __Pyx_GIVEREF(__pyx_v_obj);
14531 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
14532 __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)
14533 __Pyx_GOTREF(__pyx_t_5);
14534 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14537 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14538 __pyx_r = __pyx_t_5;
14540 goto __pyx_L8_try_return;
14551 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14552 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
14553 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
14554 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14564 __Pyx_AddTraceback(
"PyClical.acos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14565 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1637, __pyx_L6_except_error)
14566 __Pyx_GOTREF(__pyx_t_5);
14567 __Pyx_GOTREF(__pyx_t_9);
14568 __Pyx_GOTREF(__pyx_t_10);
14577 __Pyx_XDECREF(__pyx_r);
14578 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1638, __pyx_L6_except_error)
14579 __Pyx_GOTREF(__pyx_t_3);
14580 __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)
14581 __Pyx_GOTREF(__pyx_t_11);
14582 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14583 __pyx_r = __pyx_t_11;
14585 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14586 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14587 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14588 goto __pyx_L7_except_return;
14590 __pyx_L6_except_error:;
14599 __Pyx_XGIVEREF(__pyx_t_6);
14600 __Pyx_XGIVEREF(__pyx_t_7);
14601 __Pyx_XGIVEREF(__pyx_t_8);
14602 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14603 goto __pyx_L1_error;
14604 __pyx_L8_try_return:;
14605 __Pyx_XGIVEREF(__pyx_t_6);
14606 __Pyx_XGIVEREF(__pyx_t_7);
14607 __Pyx_XGIVEREF(__pyx_t_8);
14608 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14610 __pyx_L7_except_return:;
14611 __Pyx_XGIVEREF(__pyx_t_6);
14612 __Pyx_XGIVEREF(__pyx_t_7);
14613 __Pyx_XGIVEREF(__pyx_t_8);
14614 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14629 __Pyx_XDECREF(__pyx_t_3);
14630 __Pyx_XDECREF(__pyx_t_5);
14631 __Pyx_XDECREF(__pyx_t_9);
14632 __Pyx_XDECREF(__pyx_t_10);
14633 __Pyx_XDECREF(__pyx_t_11);
14634 __Pyx_AddTraceback(
"PyClical.acos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14637 __Pyx_XGIVEREF(__pyx_r);
14638 __Pyx_RefNannyFinishContext();
14643 static PyObject *__pyx_pw_8PyClical_53acos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14644 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 ";
14645 static PyObject *__pyx_pw_8PyClical_53acos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14646 PyObject *__pyx_v_obj = 0;
14647 PyObject *__pyx_v_i = 0;
14648 PyObject *__pyx_r = 0;
14649 __Pyx_RefNannyDeclarations
14650 __Pyx_RefNannySetupContext(
"acos (wrapper)", 0);
14652 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
14653 PyObject* values[2] = {0,0};
14654 values[1] = ((PyObject *)Py_None);
14655 if (unlikely(__pyx_kwds)) {
14656 Py_ssize_t kw_args;
14657 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14658 switch (pos_args) {
14659 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14660 CYTHON_FALLTHROUGH;
14661 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14662 CYTHON_FALLTHROUGH;
14664 default:
goto __pyx_L5_argtuple_error;
14666 kw_args = PyDict_Size(__pyx_kwds);
14667 switch (pos_args) {
14669 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
14670 else goto __pyx_L5_argtuple_error;
14671 CYTHON_FALLTHROUGH;
14674 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
14675 if (value) { values[1] = value; kw_args--; }
14678 if (unlikely(kw_args > 0)) {
14679 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"acos") < 0)) __PYX_ERR(0, 1619, __pyx_L3_error)
14682 switch (PyTuple_GET_SIZE(__pyx_args)) {
14683 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14684 CYTHON_FALLTHROUGH;
14685 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14687 default:
goto __pyx_L5_argtuple_error;
14690 __pyx_v_obj = values[0];
14691 __pyx_v_i = values[1];
14693 goto __pyx_L4_argument_unpacking_done;
14694 __pyx_L5_argtuple_error:;
14695 __Pyx_RaiseArgtupleInvalid(
"acos", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1619, __pyx_L3_error)
14697 __Pyx_AddTraceback(
"PyClical.acos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14698 __Pyx_RefNannyFinishContext();
14700 __pyx_L4_argument_unpacking_done:;
14701 __pyx_r = __pyx_pf_8PyClical_52acos(__pyx_self, __pyx_v_obj, __pyx_v_i);
14704 __Pyx_RefNannyFinishContext();
14708 static PyObject *__pyx_pf_8PyClical_52acos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
14709 PyObject *__pyx_r = NULL;
14710 __Pyx_RefNannyDeclarations
14711 PyObject *__pyx_t_1 = NULL;
14712 struct __pyx_opt_args_8PyClical_acos __pyx_t_2;
14713 __Pyx_RefNannySetupContext(
"acos", 0);
14714 __Pyx_XDECREF(__pyx_r);
14715 __pyx_t_2.__pyx_n = 1;
14716 __pyx_t_2.i = __pyx_v_i;
14717 __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)
14718 __Pyx_GOTREF(__pyx_t_1);
14719 __pyx_r = __pyx_t_1;
14725 __Pyx_XDECREF(__pyx_t_1);
14726 __Pyx_AddTraceback(
"PyClical.acos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14729 __Pyx_XGIVEREF(__pyx_r);
14730 __Pyx_RefNannyFinishContext();
14742 static PyObject *__pyx_pw_8PyClical_55cosh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
14743 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cosh(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
14744 PyObject *__pyx_r = NULL;
14745 __Pyx_RefNannyDeclarations
14746 PyObject *__pyx_t_1 = NULL;
14747 PyObject *__pyx_t_2 = NULL;
14748 PyObject *__pyx_t_3 = NULL;
14749 PyObject *__pyx_t_4 = NULL;
14750 PyObject *__pyx_t_5 = NULL;
14751 PyObject *__pyx_t_6 = NULL;
14752 PyObject *__pyx_t_7 = NULL;
14753 PyObject *__pyx_t_8 = NULL;
14754 __Pyx_RefNannySetupContext(
"cosh", 0);
14764 __Pyx_PyThreadState_declare
14765 __Pyx_PyThreadState_assign
14766 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
14767 __Pyx_XGOTREF(__pyx_t_1);
14768 __Pyx_XGOTREF(__pyx_t_2);
14769 __Pyx_XGOTREF(__pyx_t_3);
14779 __Pyx_XDECREF(__pyx_r);
14780 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1652, __pyx_L3_error)
14781 __Pyx_GOTREF(__pyx_t_5);
14782 __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)
14783 __Pyx_GOTREF(__pyx_t_6);
14784 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14786 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
14787 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
14788 if (likely(__pyx_t_5)) {
14789 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
14790 __Pyx_INCREF(__pyx_t_5);
14791 __Pyx_INCREF(
function);
14792 __Pyx_DECREF_SET(__pyx_t_6,
function);
14796 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_obj);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1652, __pyx_L3_error)
14797 __Pyx_GOTREF(__pyx_t_4);
14799 #if CYTHON_FAST_PYCALL 14800 if (PyFunction_Check(__pyx_t_6)) {
14801 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_obj};
14802 __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)
14803 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14804 __Pyx_GOTREF(__pyx_t_4);
14807 #if CYTHON_FAST_PYCCALL 14808 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
14809 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_obj};
14810 __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)
14811 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14812 __Pyx_GOTREF(__pyx_t_4);
14816 __pyx_t_7 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1652, __pyx_L3_error)
14817 __Pyx_GOTREF(__pyx_t_7);
14818 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
14819 __Pyx_INCREF(__pyx_v_obj);
14820 __Pyx_GIVEREF(__pyx_v_obj);
14821 PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_obj);
14822 __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)
14823 __Pyx_GOTREF(__pyx_t_4);
14824 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14827 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14828 __pyx_r = __pyx_t_4;
14830 goto __pyx_L7_try_return;
14841 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14842 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
14843 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
14844 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
14854 __Pyx_AddTraceback(
"PyClical.cosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
14855 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1653, __pyx_L5_except_error)
14856 __Pyx_GOTREF(__pyx_t_4);
14857 __Pyx_GOTREF(__pyx_t_6);
14858 __Pyx_GOTREF(__pyx_t_7);
14867 __Pyx_XDECREF(__pyx_r);
14868 __pyx_t_5 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1654, __pyx_L5_except_error)
14869 __Pyx_GOTREF(__pyx_t_5);
14870 __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)
14871 __Pyx_GOTREF(__pyx_t_8);
14872 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14873 __pyx_r = __pyx_t_8;
14875 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14876 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14877 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14878 goto __pyx_L6_except_return;
14880 __pyx_L5_except_error:;
14889 __Pyx_XGIVEREF(__pyx_t_1);
14890 __Pyx_XGIVEREF(__pyx_t_2);
14891 __Pyx_XGIVEREF(__pyx_t_3);
14892 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
14893 goto __pyx_L1_error;
14894 __pyx_L7_try_return:;
14895 __Pyx_XGIVEREF(__pyx_t_1);
14896 __Pyx_XGIVEREF(__pyx_t_2);
14897 __Pyx_XGIVEREF(__pyx_t_3);
14898 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
14900 __pyx_L6_except_return:;
14901 __Pyx_XGIVEREF(__pyx_t_1);
14902 __Pyx_XGIVEREF(__pyx_t_2);
14903 __Pyx_XGIVEREF(__pyx_t_3);
14904 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
14918 __Pyx_XDECREF(__pyx_t_4);
14919 __Pyx_XDECREF(__pyx_t_5);
14920 __Pyx_XDECREF(__pyx_t_6);
14921 __Pyx_XDECREF(__pyx_t_7);
14922 __Pyx_XDECREF(__pyx_t_8);
14923 __Pyx_AddTraceback(
"PyClical.cosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
14926 __Pyx_XGIVEREF(__pyx_r);
14927 __Pyx_RefNannyFinishContext();
14932 static PyObject *__pyx_pw_8PyClical_55cosh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
14933 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 ";
14934 static PyObject *__pyx_pw_8PyClical_55cosh(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
14935 PyObject *__pyx_r = 0;
14936 __Pyx_RefNannyDeclarations
14937 __Pyx_RefNannySetupContext(
"cosh (wrapper)", 0);
14938 __pyx_r = __pyx_pf_8PyClical_54cosh(__pyx_self, ((PyObject *)__pyx_v_obj));
14941 __Pyx_RefNannyFinishContext();
14945 static PyObject *__pyx_pf_8PyClical_54cosh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
14946 PyObject *__pyx_r = NULL;
14947 __Pyx_RefNannyDeclarations
14948 PyObject *__pyx_t_1 = NULL;
14949 __Pyx_RefNannySetupContext(
"cosh", 0);
14950 __Pyx_XDECREF(__pyx_r);
14951 __pyx_t_1 = __pyx_f_8PyClical_cosh(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1640, __pyx_L1_error)
14952 __Pyx_GOTREF(__pyx_t_1);
14953 __pyx_r = __pyx_t_1;
14959 __Pyx_XDECREF(__pyx_t_1);
14960 __Pyx_AddTraceback(
"PyClical.cosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
14963 __Pyx_XGIVEREF(__pyx_r);
14964 __Pyx_RefNannyFinishContext();
14976 static PyObject *__pyx_pw_8PyClical_57acosh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14977 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) {
14978 PyObject *__pyx_v_i = ((PyObject *)Py_None);
14979 PyObject *__pyx_r = NULL;
14980 __Pyx_RefNannyDeclarations
14983 PyObject *__pyx_t_3 = NULL;
14985 PyObject *__pyx_t_5 = NULL;
14986 PyObject *__pyx_t_6 = NULL;
14987 PyObject *__pyx_t_7 = NULL;
14988 PyObject *__pyx_t_8 = NULL;
14989 PyObject *__pyx_t_9 = NULL;
14990 PyObject *__pyx_t_10 = NULL;
14991 PyObject *__pyx_t_11 = NULL;
14992 __Pyx_RefNannySetupContext(
"acosh", 0);
14993 if (__pyx_optional_args) {
14994 if (__pyx_optional_args->__pyx_n > 0) {
14995 __pyx_v_i = __pyx_optional_args->i;
15006 __pyx_t_1 = (__pyx_v_i != Py_None);
15007 __pyx_t_2 = (__pyx_t_1 != 0);
15017 __Pyx_XDECREF(__pyx_r);
15018 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1672, __pyx_L1_error)
15019 __Pyx_GOTREF(__pyx_t_3);
15021 __pyx_t_4 =
acosh(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
15023 __Pyx_CppExn2PyErr();
15024 __PYX_ERR(0, 1672, __pyx_L1_error)
15026 __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)
15027 __Pyx_GOTREF(__pyx_t_5);
15028 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15029 __pyx_r = __pyx_t_5;
15051 __Pyx_PyThreadState_declare
15052 __Pyx_PyThreadState_assign
15053 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
15054 __Pyx_XGOTREF(__pyx_t_6);
15055 __Pyx_XGOTREF(__pyx_t_7);
15056 __Pyx_XGOTREF(__pyx_t_8);
15066 __Pyx_XDECREF(__pyx_r);
15067 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1675, __pyx_L4_error)
15068 __Pyx_GOTREF(__pyx_t_3);
15069 __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)
15070 __Pyx_GOTREF(__pyx_t_9);
15071 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15073 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
15074 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
15075 if (likely(__pyx_t_3)) {
15076 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
15077 __Pyx_INCREF(__pyx_t_3);
15078 __Pyx_INCREF(
function);
15079 __Pyx_DECREF_SET(__pyx_t_9,
function);
15083 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1675, __pyx_L4_error)
15084 __Pyx_GOTREF(__pyx_t_5);
15086 #if CYTHON_FAST_PYCALL 15087 if (PyFunction_Check(__pyx_t_9)) {
15088 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
15089 __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)
15090 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15091 __Pyx_GOTREF(__pyx_t_5);
15094 #if CYTHON_FAST_PYCCALL 15095 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
15096 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
15097 __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)
15098 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15099 __Pyx_GOTREF(__pyx_t_5);
15103 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1675, __pyx_L4_error)
15104 __Pyx_GOTREF(__pyx_t_10);
15105 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
15106 __Pyx_INCREF(__pyx_v_obj);
15107 __Pyx_GIVEREF(__pyx_v_obj);
15108 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
15109 __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)
15110 __Pyx_GOTREF(__pyx_t_5);
15111 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15114 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15115 __pyx_r = __pyx_t_5;
15117 goto __pyx_L8_try_return;
15128 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15129 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
15130 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
15131 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15141 __Pyx_AddTraceback(
"PyClical.acosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15142 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1676, __pyx_L6_except_error)
15143 __Pyx_GOTREF(__pyx_t_5);
15144 __Pyx_GOTREF(__pyx_t_9);
15145 __Pyx_GOTREF(__pyx_t_10);
15154 __Pyx_XDECREF(__pyx_r);
15155 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1677, __pyx_L6_except_error)
15156 __Pyx_GOTREF(__pyx_t_3);
15157 __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)
15158 __Pyx_GOTREF(__pyx_t_11);
15159 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15160 __pyx_r = __pyx_t_11;
15162 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15163 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15164 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15165 goto __pyx_L7_except_return;
15167 __pyx_L6_except_error:;
15176 __Pyx_XGIVEREF(__pyx_t_6);
15177 __Pyx_XGIVEREF(__pyx_t_7);
15178 __Pyx_XGIVEREF(__pyx_t_8);
15179 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15180 goto __pyx_L1_error;
15181 __pyx_L8_try_return:;
15182 __Pyx_XGIVEREF(__pyx_t_6);
15183 __Pyx_XGIVEREF(__pyx_t_7);
15184 __Pyx_XGIVEREF(__pyx_t_8);
15185 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15187 __pyx_L7_except_return:;
15188 __Pyx_XGIVEREF(__pyx_t_6);
15189 __Pyx_XGIVEREF(__pyx_t_7);
15190 __Pyx_XGIVEREF(__pyx_t_8);
15191 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15206 __Pyx_XDECREF(__pyx_t_3);
15207 __Pyx_XDECREF(__pyx_t_5);
15208 __Pyx_XDECREF(__pyx_t_9);
15209 __Pyx_XDECREF(__pyx_t_10);
15210 __Pyx_XDECREF(__pyx_t_11);
15211 __Pyx_AddTraceback(
"PyClical.acosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15214 __Pyx_XGIVEREF(__pyx_r);
15215 __Pyx_RefNannyFinishContext();
15220 static PyObject *__pyx_pw_8PyClical_57acosh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15221 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 ";
15222 static PyObject *__pyx_pw_8PyClical_57acosh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15223 PyObject *__pyx_v_obj = 0;
15224 PyObject *__pyx_v_i = 0;
15225 PyObject *__pyx_r = 0;
15226 __Pyx_RefNannyDeclarations
15227 __Pyx_RefNannySetupContext(
"acosh (wrapper)", 0);
15229 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
15230 PyObject* values[2] = {0,0};
15231 values[1] = ((PyObject *)Py_None);
15232 if (unlikely(__pyx_kwds)) {
15233 Py_ssize_t kw_args;
15234 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15235 switch (pos_args) {
15236 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15237 CYTHON_FALLTHROUGH;
15238 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15239 CYTHON_FALLTHROUGH;
15241 default:
goto __pyx_L5_argtuple_error;
15243 kw_args = PyDict_Size(__pyx_kwds);
15244 switch (pos_args) {
15246 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
15247 else goto __pyx_L5_argtuple_error;
15248 CYTHON_FALLTHROUGH;
15251 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
15252 if (value) { values[1] = value; kw_args--; }
15255 if (unlikely(kw_args > 0)) {
15256 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"acosh") < 0)) __PYX_ERR(0, 1656, __pyx_L3_error)
15259 switch (PyTuple_GET_SIZE(__pyx_args)) {
15260 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15261 CYTHON_FALLTHROUGH;
15262 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15264 default:
goto __pyx_L5_argtuple_error;
15267 __pyx_v_obj = values[0];
15268 __pyx_v_i = values[1];
15270 goto __pyx_L4_argument_unpacking_done;
15271 __pyx_L5_argtuple_error:;
15272 __Pyx_RaiseArgtupleInvalid(
"acosh", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1656, __pyx_L3_error)
15274 __Pyx_AddTraceback(
"PyClical.acosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15275 __Pyx_RefNannyFinishContext();
15277 __pyx_L4_argument_unpacking_done:;
15278 __pyx_r = __pyx_pf_8PyClical_56acosh(__pyx_self, __pyx_v_obj, __pyx_v_i);
15281 __Pyx_RefNannyFinishContext();
15285 static PyObject *__pyx_pf_8PyClical_56acosh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
15286 PyObject *__pyx_r = NULL;
15287 __Pyx_RefNannyDeclarations
15288 PyObject *__pyx_t_1 = NULL;
15289 struct __pyx_opt_args_8PyClical_acosh __pyx_t_2;
15290 __Pyx_RefNannySetupContext(
"acosh", 0);
15291 __Pyx_XDECREF(__pyx_r);
15292 __pyx_t_2.__pyx_n = 1;
15293 __pyx_t_2.i = __pyx_v_i;
15294 __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)
15295 __Pyx_GOTREF(__pyx_t_1);
15296 __pyx_r = __pyx_t_1;
15302 __Pyx_XDECREF(__pyx_t_1);
15303 __Pyx_AddTraceback(
"PyClical.acosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15306 __Pyx_XGIVEREF(__pyx_r);
15307 __Pyx_RefNannyFinishContext();
15319 static PyObject *__pyx_pw_8PyClical_59sin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15320 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) {
15321 PyObject *__pyx_v_i = ((PyObject *)Py_None);
15322 PyObject *__pyx_r = NULL;
15323 __Pyx_RefNannyDeclarations
15326 PyObject *__pyx_t_3 = NULL;
15328 PyObject *__pyx_t_5 = NULL;
15329 PyObject *__pyx_t_6 = NULL;
15330 PyObject *__pyx_t_7 = NULL;
15331 PyObject *__pyx_t_8 = NULL;
15332 PyObject *__pyx_t_9 = NULL;
15333 PyObject *__pyx_t_10 = NULL;
15334 PyObject *__pyx_t_11 = NULL;
15335 __Pyx_RefNannySetupContext(
"sin", 0);
15336 if (__pyx_optional_args) {
15337 if (__pyx_optional_args->__pyx_n > 0) {
15338 __pyx_v_i = __pyx_optional_args->i;
15349 __pyx_t_1 = (__pyx_v_i != Py_None);
15350 __pyx_t_2 = (__pyx_t_1 != 0);
15360 __Pyx_XDECREF(__pyx_r);
15361 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1691, __pyx_L1_error)
15362 __Pyx_GOTREF(__pyx_t_3);
15364 __pyx_t_4 =
sin(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
15366 __Pyx_CppExn2PyErr();
15367 __PYX_ERR(0, 1691, __pyx_L1_error)
15369 __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)
15370 __Pyx_GOTREF(__pyx_t_5);
15371 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15372 __pyx_r = __pyx_t_5;
15394 __Pyx_PyThreadState_declare
15395 __Pyx_PyThreadState_assign
15396 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
15397 __Pyx_XGOTREF(__pyx_t_6);
15398 __Pyx_XGOTREF(__pyx_t_7);
15399 __Pyx_XGOTREF(__pyx_t_8);
15409 __Pyx_XDECREF(__pyx_r);
15410 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1694, __pyx_L4_error)
15411 __Pyx_GOTREF(__pyx_t_3);
15412 __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)
15413 __Pyx_GOTREF(__pyx_t_9);
15414 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15416 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
15417 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
15418 if (likely(__pyx_t_3)) {
15419 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
15420 __Pyx_INCREF(__pyx_t_3);
15421 __Pyx_INCREF(
function);
15422 __Pyx_DECREF_SET(__pyx_t_9,
function);
15426 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1694, __pyx_L4_error)
15427 __Pyx_GOTREF(__pyx_t_5);
15429 #if CYTHON_FAST_PYCALL 15430 if (PyFunction_Check(__pyx_t_9)) {
15431 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
15432 __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)
15433 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15434 __Pyx_GOTREF(__pyx_t_5);
15437 #if CYTHON_FAST_PYCCALL 15438 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
15439 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
15440 __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)
15441 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15442 __Pyx_GOTREF(__pyx_t_5);
15446 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1694, __pyx_L4_error)
15447 __Pyx_GOTREF(__pyx_t_10);
15448 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
15449 __Pyx_INCREF(__pyx_v_obj);
15450 __Pyx_GIVEREF(__pyx_v_obj);
15451 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
15452 __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)
15453 __Pyx_GOTREF(__pyx_t_5);
15454 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15457 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15458 __pyx_r = __pyx_t_5;
15460 goto __pyx_L8_try_return;
15471 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15472 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
15473 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
15474 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15484 __Pyx_AddTraceback(
"PyClical.sin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15485 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1695, __pyx_L6_except_error)
15486 __Pyx_GOTREF(__pyx_t_5);
15487 __Pyx_GOTREF(__pyx_t_9);
15488 __Pyx_GOTREF(__pyx_t_10);
15497 __Pyx_XDECREF(__pyx_r);
15498 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1696, __pyx_L6_except_error)
15499 __Pyx_GOTREF(__pyx_t_3);
15500 __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)
15501 __Pyx_GOTREF(__pyx_t_11);
15502 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15503 __pyx_r = __pyx_t_11;
15505 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15506 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15507 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15508 goto __pyx_L7_except_return;
15510 __pyx_L6_except_error:;
15519 __Pyx_XGIVEREF(__pyx_t_6);
15520 __Pyx_XGIVEREF(__pyx_t_7);
15521 __Pyx_XGIVEREF(__pyx_t_8);
15522 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15523 goto __pyx_L1_error;
15524 __pyx_L8_try_return:;
15525 __Pyx_XGIVEREF(__pyx_t_6);
15526 __Pyx_XGIVEREF(__pyx_t_7);
15527 __Pyx_XGIVEREF(__pyx_t_8);
15528 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15530 __pyx_L7_except_return:;
15531 __Pyx_XGIVEREF(__pyx_t_6);
15532 __Pyx_XGIVEREF(__pyx_t_7);
15533 __Pyx_XGIVEREF(__pyx_t_8);
15534 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15549 __Pyx_XDECREF(__pyx_t_3);
15550 __Pyx_XDECREF(__pyx_t_5);
15551 __Pyx_XDECREF(__pyx_t_9);
15552 __Pyx_XDECREF(__pyx_t_10);
15553 __Pyx_XDECREF(__pyx_t_11);
15554 __Pyx_AddTraceback(
"PyClical.sin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15557 __Pyx_XGIVEREF(__pyx_r);
15558 __Pyx_RefNannyFinishContext();
15563 static PyObject *__pyx_pw_8PyClical_59sin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15564 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 ";
15565 static PyObject *__pyx_pw_8PyClical_59sin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15566 PyObject *__pyx_v_obj = 0;
15567 PyObject *__pyx_v_i = 0;
15568 PyObject *__pyx_r = 0;
15569 __Pyx_RefNannyDeclarations
15570 __Pyx_RefNannySetupContext(
"sin (wrapper)", 0);
15572 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
15573 PyObject* values[2] = {0,0};
15574 values[1] = ((PyObject *)Py_None);
15575 if (unlikely(__pyx_kwds)) {
15576 Py_ssize_t kw_args;
15577 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15578 switch (pos_args) {
15579 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15580 CYTHON_FALLTHROUGH;
15581 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15582 CYTHON_FALLTHROUGH;
15584 default:
goto __pyx_L5_argtuple_error;
15586 kw_args = PyDict_Size(__pyx_kwds);
15587 switch (pos_args) {
15589 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
15590 else goto __pyx_L5_argtuple_error;
15591 CYTHON_FALLTHROUGH;
15594 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
15595 if (value) { values[1] = value; kw_args--; }
15598 if (unlikely(kw_args > 0)) {
15599 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"sin") < 0)) __PYX_ERR(0, 1679, __pyx_L3_error)
15602 switch (PyTuple_GET_SIZE(__pyx_args)) {
15603 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15604 CYTHON_FALLTHROUGH;
15605 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15607 default:
goto __pyx_L5_argtuple_error;
15610 __pyx_v_obj = values[0];
15611 __pyx_v_i = values[1];
15613 goto __pyx_L4_argument_unpacking_done;
15614 __pyx_L5_argtuple_error:;
15615 __Pyx_RaiseArgtupleInvalid(
"sin", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1679, __pyx_L3_error)
15617 __Pyx_AddTraceback(
"PyClical.sin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15618 __Pyx_RefNannyFinishContext();
15620 __pyx_L4_argument_unpacking_done:;
15621 __pyx_r = __pyx_pf_8PyClical_58sin(__pyx_self, __pyx_v_obj, __pyx_v_i);
15624 __Pyx_RefNannyFinishContext();
15628 static PyObject *__pyx_pf_8PyClical_58sin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
15629 PyObject *__pyx_r = NULL;
15630 __Pyx_RefNannyDeclarations
15631 PyObject *__pyx_t_1 = NULL;
15632 struct __pyx_opt_args_8PyClical_sin __pyx_t_2;
15633 __Pyx_RefNannySetupContext(
"sin", 0);
15634 __Pyx_XDECREF(__pyx_r);
15635 __pyx_t_2.__pyx_n = 1;
15636 __pyx_t_2.i = __pyx_v_i;
15637 __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)
15638 __Pyx_GOTREF(__pyx_t_1);
15639 __pyx_r = __pyx_t_1;
15645 __Pyx_XDECREF(__pyx_t_1);
15646 __Pyx_AddTraceback(
"PyClical.sin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15649 __Pyx_XGIVEREF(__pyx_r);
15650 __Pyx_RefNannyFinishContext();
15662 static PyObject *__pyx_pw_8PyClical_61asin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15663 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) {
15664 PyObject *__pyx_v_i = ((PyObject *)Py_None);
15665 PyObject *__pyx_r = NULL;
15666 __Pyx_RefNannyDeclarations
15669 PyObject *__pyx_t_3 = NULL;
15671 PyObject *__pyx_t_5 = NULL;
15672 PyObject *__pyx_t_6 = NULL;
15673 PyObject *__pyx_t_7 = NULL;
15674 PyObject *__pyx_t_8 = NULL;
15675 PyObject *__pyx_t_9 = NULL;
15676 PyObject *__pyx_t_10 = NULL;
15677 PyObject *__pyx_t_11 = NULL;
15678 __Pyx_RefNannySetupContext(
"asin", 0);
15679 if (__pyx_optional_args) {
15680 if (__pyx_optional_args->__pyx_n > 0) {
15681 __pyx_v_i = __pyx_optional_args->i;
15692 __pyx_t_1 = (__pyx_v_i != Py_None);
15693 __pyx_t_2 = (__pyx_t_1 != 0);
15703 __Pyx_XDECREF(__pyx_r);
15704 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1712, __pyx_L1_error)
15705 __Pyx_GOTREF(__pyx_t_3);
15707 __pyx_t_4 =
asin(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
15709 __Pyx_CppExn2PyErr();
15710 __PYX_ERR(0, 1712, __pyx_L1_error)
15712 __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)
15713 __Pyx_GOTREF(__pyx_t_5);
15714 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15715 __pyx_r = __pyx_t_5;
15737 __Pyx_PyThreadState_declare
15738 __Pyx_PyThreadState_assign
15739 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
15740 __Pyx_XGOTREF(__pyx_t_6);
15741 __Pyx_XGOTREF(__pyx_t_7);
15742 __Pyx_XGOTREF(__pyx_t_8);
15752 __Pyx_XDECREF(__pyx_r);
15753 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1715, __pyx_L4_error)
15754 __Pyx_GOTREF(__pyx_t_3);
15755 __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)
15756 __Pyx_GOTREF(__pyx_t_9);
15757 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15759 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
15760 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
15761 if (likely(__pyx_t_3)) {
15762 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
15763 __Pyx_INCREF(__pyx_t_3);
15764 __Pyx_INCREF(
function);
15765 __Pyx_DECREF_SET(__pyx_t_9,
function);
15769 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1715, __pyx_L4_error)
15770 __Pyx_GOTREF(__pyx_t_5);
15772 #if CYTHON_FAST_PYCALL 15773 if (PyFunction_Check(__pyx_t_9)) {
15774 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
15775 __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)
15776 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15777 __Pyx_GOTREF(__pyx_t_5);
15780 #if CYTHON_FAST_PYCCALL 15781 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
15782 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
15783 __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)
15784 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15785 __Pyx_GOTREF(__pyx_t_5);
15789 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1715, __pyx_L4_error)
15790 __Pyx_GOTREF(__pyx_t_10);
15791 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
15792 __Pyx_INCREF(__pyx_v_obj);
15793 __Pyx_GIVEREF(__pyx_v_obj);
15794 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
15795 __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)
15796 __Pyx_GOTREF(__pyx_t_5);
15797 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15800 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15801 __pyx_r = __pyx_t_5;
15803 goto __pyx_L8_try_return;
15814 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15815 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
15816 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
15817 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15827 __Pyx_AddTraceback(
"PyClical.asin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15828 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1716, __pyx_L6_except_error)
15829 __Pyx_GOTREF(__pyx_t_5);
15830 __Pyx_GOTREF(__pyx_t_9);
15831 __Pyx_GOTREF(__pyx_t_10);
15840 __Pyx_XDECREF(__pyx_r);
15841 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1717, __pyx_L6_except_error)
15842 __Pyx_GOTREF(__pyx_t_3);
15843 __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)
15844 __Pyx_GOTREF(__pyx_t_11);
15845 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15846 __pyx_r = __pyx_t_11;
15848 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15849 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15850 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15851 goto __pyx_L7_except_return;
15853 __pyx_L6_except_error:;
15862 __Pyx_XGIVEREF(__pyx_t_6);
15863 __Pyx_XGIVEREF(__pyx_t_7);
15864 __Pyx_XGIVEREF(__pyx_t_8);
15865 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15866 goto __pyx_L1_error;
15867 __pyx_L8_try_return:;
15868 __Pyx_XGIVEREF(__pyx_t_6);
15869 __Pyx_XGIVEREF(__pyx_t_7);
15870 __Pyx_XGIVEREF(__pyx_t_8);
15871 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15873 __pyx_L7_except_return:;
15874 __Pyx_XGIVEREF(__pyx_t_6);
15875 __Pyx_XGIVEREF(__pyx_t_7);
15876 __Pyx_XGIVEREF(__pyx_t_8);
15877 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15892 __Pyx_XDECREF(__pyx_t_3);
15893 __Pyx_XDECREF(__pyx_t_5);
15894 __Pyx_XDECREF(__pyx_t_9);
15895 __Pyx_XDECREF(__pyx_t_10);
15896 __Pyx_XDECREF(__pyx_t_11);
15897 __Pyx_AddTraceback(
"PyClical.asin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15900 __Pyx_XGIVEREF(__pyx_r);
15901 __Pyx_RefNannyFinishContext();
15906 static PyObject *__pyx_pw_8PyClical_61asin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15907 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 ";
15908 static PyObject *__pyx_pw_8PyClical_61asin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15909 PyObject *__pyx_v_obj = 0;
15910 PyObject *__pyx_v_i = 0;
15911 PyObject *__pyx_r = 0;
15912 __Pyx_RefNannyDeclarations
15913 __Pyx_RefNannySetupContext(
"asin (wrapper)", 0);
15915 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
15916 PyObject* values[2] = {0,0};
15917 values[1] = ((PyObject *)Py_None);
15918 if (unlikely(__pyx_kwds)) {
15919 Py_ssize_t kw_args;
15920 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15921 switch (pos_args) {
15922 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15923 CYTHON_FALLTHROUGH;
15924 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15925 CYTHON_FALLTHROUGH;
15927 default:
goto __pyx_L5_argtuple_error;
15929 kw_args = PyDict_Size(__pyx_kwds);
15930 switch (pos_args) {
15932 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
15933 else goto __pyx_L5_argtuple_error;
15934 CYTHON_FALLTHROUGH;
15937 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
15938 if (value) { values[1] = value; kw_args--; }
15941 if (unlikely(kw_args > 0)) {
15942 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"asin") < 0)) __PYX_ERR(0, 1698, __pyx_L3_error)
15945 switch (PyTuple_GET_SIZE(__pyx_args)) {
15946 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15947 CYTHON_FALLTHROUGH;
15948 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15950 default:
goto __pyx_L5_argtuple_error;
15953 __pyx_v_obj = values[0];
15954 __pyx_v_i = values[1];
15956 goto __pyx_L4_argument_unpacking_done;
15957 __pyx_L5_argtuple_error:;
15958 __Pyx_RaiseArgtupleInvalid(
"asin", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1698, __pyx_L3_error)
15960 __Pyx_AddTraceback(
"PyClical.asin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15961 __Pyx_RefNannyFinishContext();
15963 __pyx_L4_argument_unpacking_done:;
15964 __pyx_r = __pyx_pf_8PyClical_60asin(__pyx_self, __pyx_v_obj, __pyx_v_i);
15967 __Pyx_RefNannyFinishContext();
15971 static PyObject *__pyx_pf_8PyClical_60asin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
15972 PyObject *__pyx_r = NULL;
15973 __Pyx_RefNannyDeclarations
15974 PyObject *__pyx_t_1 = NULL;
15975 struct __pyx_opt_args_8PyClical_asin __pyx_t_2;
15976 __Pyx_RefNannySetupContext(
"asin", 0);
15977 __Pyx_XDECREF(__pyx_r);
15978 __pyx_t_2.__pyx_n = 1;
15979 __pyx_t_2.i = __pyx_v_i;
15980 __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)
15981 __Pyx_GOTREF(__pyx_t_1);
15982 __pyx_r = __pyx_t_1;
15988 __Pyx_XDECREF(__pyx_t_1);
15989 __Pyx_AddTraceback(
"PyClical.asin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15992 __Pyx_XGIVEREF(__pyx_r);
15993 __Pyx_RefNannyFinishContext();
16005 static PyObject *__pyx_pw_8PyClical_63sinh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
16006 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_sinh(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
16007 PyObject *__pyx_r = NULL;
16008 __Pyx_RefNannyDeclarations
16009 PyObject *__pyx_t_1 = NULL;
16010 PyObject *__pyx_t_2 = NULL;
16011 PyObject *__pyx_t_3 = NULL;
16012 PyObject *__pyx_t_4 = NULL;
16013 PyObject *__pyx_t_5 = NULL;
16014 PyObject *__pyx_t_6 = NULL;
16015 PyObject *__pyx_t_7 = NULL;
16016 PyObject *__pyx_t_8 = NULL;
16017 __Pyx_RefNannySetupContext(
"sinh", 0);
16027 __Pyx_PyThreadState_declare
16028 __Pyx_PyThreadState_assign
16029 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
16030 __Pyx_XGOTREF(__pyx_t_1);
16031 __Pyx_XGOTREF(__pyx_t_2);
16032 __Pyx_XGOTREF(__pyx_t_3);
16042 __Pyx_XDECREF(__pyx_r);
16043 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1729, __pyx_L3_error)
16044 __Pyx_GOTREF(__pyx_t_5);
16045 __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)
16046 __Pyx_GOTREF(__pyx_t_6);
16047 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16049 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
16050 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
16051 if (likely(__pyx_t_5)) {
16052 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
16053 __Pyx_INCREF(__pyx_t_5);
16054 __Pyx_INCREF(
function);
16055 __Pyx_DECREF_SET(__pyx_t_6,
function);
16059 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_obj);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1729, __pyx_L3_error)
16060 __Pyx_GOTREF(__pyx_t_4);
16062 #if CYTHON_FAST_PYCALL 16063 if (PyFunction_Check(__pyx_t_6)) {
16064 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_obj};
16065 __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)
16066 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16067 __Pyx_GOTREF(__pyx_t_4);
16070 #if CYTHON_FAST_PYCCALL 16071 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
16072 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_obj};
16073 __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)
16074 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16075 __Pyx_GOTREF(__pyx_t_4);
16079 __pyx_t_7 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1729, __pyx_L3_error)
16080 __Pyx_GOTREF(__pyx_t_7);
16081 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
16082 __Pyx_INCREF(__pyx_v_obj);
16083 __Pyx_GIVEREF(__pyx_v_obj);
16084 PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_obj);
16085 __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)
16086 __Pyx_GOTREF(__pyx_t_4);
16087 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16090 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16091 __pyx_r = __pyx_t_4;
16093 goto __pyx_L7_try_return;
16104 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16105 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
16106 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
16107 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
16117 __Pyx_AddTraceback(
"PyClical.sinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16118 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1730, __pyx_L5_except_error)
16119 __Pyx_GOTREF(__pyx_t_4);
16120 __Pyx_GOTREF(__pyx_t_6);
16121 __Pyx_GOTREF(__pyx_t_7);
16130 __Pyx_XDECREF(__pyx_r);
16131 __pyx_t_5 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1731, __pyx_L5_except_error)
16132 __Pyx_GOTREF(__pyx_t_5);
16133 __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)
16134 __Pyx_GOTREF(__pyx_t_8);
16135 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16136 __pyx_r = __pyx_t_8;
16138 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16139 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16140 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16141 goto __pyx_L6_except_return;
16143 __pyx_L5_except_error:;
16152 __Pyx_XGIVEREF(__pyx_t_1);
16153 __Pyx_XGIVEREF(__pyx_t_2);
16154 __Pyx_XGIVEREF(__pyx_t_3);
16155 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
16156 goto __pyx_L1_error;
16157 __pyx_L7_try_return:;
16158 __Pyx_XGIVEREF(__pyx_t_1);
16159 __Pyx_XGIVEREF(__pyx_t_2);
16160 __Pyx_XGIVEREF(__pyx_t_3);
16161 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
16163 __pyx_L6_except_return:;
16164 __Pyx_XGIVEREF(__pyx_t_1);
16165 __Pyx_XGIVEREF(__pyx_t_2);
16166 __Pyx_XGIVEREF(__pyx_t_3);
16167 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
16181 __Pyx_XDECREF(__pyx_t_4);
16182 __Pyx_XDECREF(__pyx_t_5);
16183 __Pyx_XDECREF(__pyx_t_6);
16184 __Pyx_XDECREF(__pyx_t_7);
16185 __Pyx_XDECREF(__pyx_t_8);
16186 __Pyx_AddTraceback(
"PyClical.sinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16189 __Pyx_XGIVEREF(__pyx_r);
16190 __Pyx_RefNannyFinishContext();
16195 static PyObject *__pyx_pw_8PyClical_63sinh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
16196 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 ";
16197 static PyObject *__pyx_pw_8PyClical_63sinh(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
16198 PyObject *__pyx_r = 0;
16199 __Pyx_RefNannyDeclarations
16200 __Pyx_RefNannySetupContext(
"sinh (wrapper)", 0);
16201 __pyx_r = __pyx_pf_8PyClical_62sinh(__pyx_self, ((PyObject *)__pyx_v_obj));
16204 __Pyx_RefNannyFinishContext();
16208 static PyObject *__pyx_pf_8PyClical_62sinh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
16209 PyObject *__pyx_r = NULL;
16210 __Pyx_RefNannyDeclarations
16211 PyObject *__pyx_t_1 = NULL;
16212 __Pyx_RefNannySetupContext(
"sinh", 0);
16213 __Pyx_XDECREF(__pyx_r);
16214 __pyx_t_1 = __pyx_f_8PyClical_sinh(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1719, __pyx_L1_error)
16215 __Pyx_GOTREF(__pyx_t_1);
16216 __pyx_r = __pyx_t_1;
16222 __Pyx_XDECREF(__pyx_t_1);
16223 __Pyx_AddTraceback(
"PyClical.sinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16226 __Pyx_XGIVEREF(__pyx_r);
16227 __Pyx_RefNannyFinishContext();
16239 static PyObject *__pyx_pw_8PyClical_65asinh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16240 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) {
16241 PyObject *__pyx_v_i = ((PyObject *)Py_None);
16242 PyObject *__pyx_r = NULL;
16243 __Pyx_RefNannyDeclarations
16246 PyObject *__pyx_t_3 = NULL;
16248 PyObject *__pyx_t_5 = NULL;
16249 PyObject *__pyx_t_6 = NULL;
16250 PyObject *__pyx_t_7 = NULL;
16251 PyObject *__pyx_t_8 = NULL;
16252 PyObject *__pyx_t_9 = NULL;
16253 PyObject *__pyx_t_10 = NULL;
16254 PyObject *__pyx_t_11 = NULL;
16255 __Pyx_RefNannySetupContext(
"asinh", 0);
16256 if (__pyx_optional_args) {
16257 if (__pyx_optional_args->__pyx_n > 0) {
16258 __pyx_v_i = __pyx_optional_args->i;
16269 __pyx_t_1 = (__pyx_v_i != Py_None);
16270 __pyx_t_2 = (__pyx_t_1 != 0);
16280 __Pyx_XDECREF(__pyx_r);
16281 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1745, __pyx_L1_error)
16282 __Pyx_GOTREF(__pyx_t_3);
16284 __pyx_t_4 =
asinh(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
16286 __Pyx_CppExn2PyErr();
16287 __PYX_ERR(0, 1745, __pyx_L1_error)
16289 __pyx_t_5 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_3), __pyx_t_4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1745, __pyx_L1_error)
16290 __Pyx_GOTREF(__pyx_t_5);
16291 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16292 __pyx_r = __pyx_t_5;
16314 __Pyx_PyThreadState_declare
16315 __Pyx_PyThreadState_assign
16316 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
16317 __Pyx_XGOTREF(__pyx_t_6);
16318 __Pyx_XGOTREF(__pyx_t_7);
16319 __Pyx_XGOTREF(__pyx_t_8);
16329 __Pyx_XDECREF(__pyx_r);
16330 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1748, __pyx_L4_error)
16331 __Pyx_GOTREF(__pyx_t_3);
16332 __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)
16333 __Pyx_GOTREF(__pyx_t_9);
16334 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16336 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
16337 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
16338 if (likely(__pyx_t_3)) {
16339 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
16340 __Pyx_INCREF(__pyx_t_3);
16341 __Pyx_INCREF(
function);
16342 __Pyx_DECREF_SET(__pyx_t_9,
function);
16346 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1748, __pyx_L4_error)
16347 __Pyx_GOTREF(__pyx_t_5);
16349 #if CYTHON_FAST_PYCALL 16350 if (PyFunction_Check(__pyx_t_9)) {
16351 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
16352 __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)
16353 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16354 __Pyx_GOTREF(__pyx_t_5);
16357 #if CYTHON_FAST_PYCCALL 16358 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
16359 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
16360 __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)
16361 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16362 __Pyx_GOTREF(__pyx_t_5);
16366 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1748, __pyx_L4_error)
16367 __Pyx_GOTREF(__pyx_t_10);
16368 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
16369 __Pyx_INCREF(__pyx_v_obj);
16370 __Pyx_GIVEREF(__pyx_v_obj);
16371 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
16372 __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)
16373 __Pyx_GOTREF(__pyx_t_5);
16374 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16377 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16378 __pyx_r = __pyx_t_5;
16380 goto __pyx_L8_try_return;
16391 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16392 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
16393 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
16394 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16404 __Pyx_AddTraceback(
"PyClical.asinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16405 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1749, __pyx_L6_except_error)
16406 __Pyx_GOTREF(__pyx_t_5);
16407 __Pyx_GOTREF(__pyx_t_9);
16408 __Pyx_GOTREF(__pyx_t_10);
16417 __Pyx_XDECREF(__pyx_r);
16418 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1750, __pyx_L6_except_error)
16419 __Pyx_GOTREF(__pyx_t_3);
16420 __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)
16421 __Pyx_GOTREF(__pyx_t_11);
16422 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16423 __pyx_r = __pyx_t_11;
16425 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16426 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16427 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16428 goto __pyx_L7_except_return;
16430 __pyx_L6_except_error:;
16439 __Pyx_XGIVEREF(__pyx_t_6);
16440 __Pyx_XGIVEREF(__pyx_t_7);
16441 __Pyx_XGIVEREF(__pyx_t_8);
16442 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16443 goto __pyx_L1_error;
16444 __pyx_L8_try_return:;
16445 __Pyx_XGIVEREF(__pyx_t_6);
16446 __Pyx_XGIVEREF(__pyx_t_7);
16447 __Pyx_XGIVEREF(__pyx_t_8);
16448 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16450 __pyx_L7_except_return:;
16451 __Pyx_XGIVEREF(__pyx_t_6);
16452 __Pyx_XGIVEREF(__pyx_t_7);
16453 __Pyx_XGIVEREF(__pyx_t_8);
16454 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16469 __Pyx_XDECREF(__pyx_t_3);
16470 __Pyx_XDECREF(__pyx_t_5);
16471 __Pyx_XDECREF(__pyx_t_9);
16472 __Pyx_XDECREF(__pyx_t_10);
16473 __Pyx_XDECREF(__pyx_t_11);
16474 __Pyx_AddTraceback(
"PyClical.asinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16477 __Pyx_XGIVEREF(__pyx_r);
16478 __Pyx_RefNannyFinishContext();
16483 static PyObject *__pyx_pw_8PyClical_65asinh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16484 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 ";
16485 static PyObject *__pyx_pw_8PyClical_65asinh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16486 PyObject *__pyx_v_obj = 0;
16487 PyObject *__pyx_v_i = 0;
16488 PyObject *__pyx_r = 0;
16489 __Pyx_RefNannyDeclarations
16490 __Pyx_RefNannySetupContext(
"asinh (wrapper)", 0);
16492 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
16493 PyObject* values[2] = {0,0};
16494 values[1] = ((PyObject *)Py_None);
16495 if (unlikely(__pyx_kwds)) {
16496 Py_ssize_t kw_args;
16497 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16498 switch (pos_args) {
16499 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16500 CYTHON_FALLTHROUGH;
16501 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16502 CYTHON_FALLTHROUGH;
16504 default:
goto __pyx_L5_argtuple_error;
16506 kw_args = PyDict_Size(__pyx_kwds);
16507 switch (pos_args) {
16509 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
16510 else goto __pyx_L5_argtuple_error;
16511 CYTHON_FALLTHROUGH;
16514 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
16515 if (value) { values[1] = value; kw_args--; }
16518 if (unlikely(kw_args > 0)) {
16519 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"asinh") < 0)) __PYX_ERR(0, 1733, __pyx_L3_error)
16522 switch (PyTuple_GET_SIZE(__pyx_args)) {
16523 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16524 CYTHON_FALLTHROUGH;
16525 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16527 default:
goto __pyx_L5_argtuple_error;
16530 __pyx_v_obj = values[0];
16531 __pyx_v_i = values[1];
16533 goto __pyx_L4_argument_unpacking_done;
16534 __pyx_L5_argtuple_error:;
16535 __Pyx_RaiseArgtupleInvalid(
"asinh", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1733, __pyx_L3_error)
16537 __Pyx_AddTraceback(
"PyClical.asinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16538 __Pyx_RefNannyFinishContext();
16540 __pyx_L4_argument_unpacking_done:;
16541 __pyx_r = __pyx_pf_8PyClical_64asinh(__pyx_self, __pyx_v_obj, __pyx_v_i);
16544 __Pyx_RefNannyFinishContext();
16548 static PyObject *__pyx_pf_8PyClical_64asinh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
16549 PyObject *__pyx_r = NULL;
16550 __Pyx_RefNannyDeclarations
16551 PyObject *__pyx_t_1 = NULL;
16552 struct __pyx_opt_args_8PyClical_asinh __pyx_t_2;
16553 __Pyx_RefNannySetupContext(
"asinh", 0);
16554 __Pyx_XDECREF(__pyx_r);
16555 __pyx_t_2.__pyx_n = 1;
16556 __pyx_t_2.i = __pyx_v_i;
16557 __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)
16558 __Pyx_GOTREF(__pyx_t_1);
16559 __pyx_r = __pyx_t_1;
16565 __Pyx_XDECREF(__pyx_t_1);
16566 __Pyx_AddTraceback(
"PyClical.asinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16569 __Pyx_XGIVEREF(__pyx_r);
16570 __Pyx_RefNannyFinishContext();
16582 static PyObject *__pyx_pw_8PyClical_67tan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16583 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) {
16584 PyObject *__pyx_v_i = ((PyObject *)Py_None);
16585 PyObject *__pyx_r = NULL;
16586 __Pyx_RefNannyDeclarations
16589 PyObject *__pyx_t_3 = NULL;
16591 PyObject *__pyx_t_5 = NULL;
16592 PyObject *__pyx_t_6 = NULL;
16593 PyObject *__pyx_t_7 = NULL;
16594 PyObject *__pyx_t_8 = NULL;
16595 PyObject *__pyx_t_9 = NULL;
16596 PyObject *__pyx_t_10 = NULL;
16597 PyObject *__pyx_t_11 = NULL;
16598 __Pyx_RefNannySetupContext(
"tan", 0);
16599 if (__pyx_optional_args) {
16600 if (__pyx_optional_args->__pyx_n > 0) {
16601 __pyx_v_i = __pyx_optional_args->i;
16612 __pyx_t_1 = (__pyx_v_i != Py_None);
16613 __pyx_t_2 = (__pyx_t_1 != 0);
16623 __Pyx_XDECREF(__pyx_r);
16624 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1762, __pyx_L1_error)
16625 __Pyx_GOTREF(__pyx_t_3);
16627 __pyx_t_4 =
tan(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
16629 __Pyx_CppExn2PyErr();
16630 __PYX_ERR(0, 1762, __pyx_L1_error)
16632 __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)
16633 __Pyx_GOTREF(__pyx_t_5);
16634 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16635 __pyx_r = __pyx_t_5;
16657 __Pyx_PyThreadState_declare
16658 __Pyx_PyThreadState_assign
16659 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
16660 __Pyx_XGOTREF(__pyx_t_6);
16661 __Pyx_XGOTREF(__pyx_t_7);
16662 __Pyx_XGOTREF(__pyx_t_8);
16672 __Pyx_XDECREF(__pyx_r);
16673 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1765, __pyx_L4_error)
16674 __Pyx_GOTREF(__pyx_t_3);
16675 __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)
16676 __Pyx_GOTREF(__pyx_t_9);
16677 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16679 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
16680 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
16681 if (likely(__pyx_t_3)) {
16682 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
16683 __Pyx_INCREF(__pyx_t_3);
16684 __Pyx_INCREF(
function);
16685 __Pyx_DECREF_SET(__pyx_t_9,
function);
16689 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1765, __pyx_L4_error)
16690 __Pyx_GOTREF(__pyx_t_5);
16692 #if CYTHON_FAST_PYCALL 16693 if (PyFunction_Check(__pyx_t_9)) {
16694 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
16695 __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)
16696 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16697 __Pyx_GOTREF(__pyx_t_5);
16700 #if CYTHON_FAST_PYCCALL 16701 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
16702 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
16703 __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)
16704 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16705 __Pyx_GOTREF(__pyx_t_5);
16709 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1765, __pyx_L4_error)
16710 __Pyx_GOTREF(__pyx_t_10);
16711 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
16712 __Pyx_INCREF(__pyx_v_obj);
16713 __Pyx_GIVEREF(__pyx_v_obj);
16714 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
16715 __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)
16716 __Pyx_GOTREF(__pyx_t_5);
16717 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16720 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16721 __pyx_r = __pyx_t_5;
16723 goto __pyx_L8_try_return;
16734 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16735 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
16736 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
16737 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16747 __Pyx_AddTraceback(
"PyClical.tan", __pyx_clineno, __pyx_lineno, __pyx_filename);
16748 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1766, __pyx_L6_except_error)
16749 __Pyx_GOTREF(__pyx_t_5);
16750 __Pyx_GOTREF(__pyx_t_9);
16751 __Pyx_GOTREF(__pyx_t_10);
16760 __Pyx_XDECREF(__pyx_r);
16761 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1767, __pyx_L6_except_error)
16762 __Pyx_GOTREF(__pyx_t_3);
16763 __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)
16764 __Pyx_GOTREF(__pyx_t_11);
16765 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16766 __pyx_r = __pyx_t_11;
16768 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16769 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16770 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16771 goto __pyx_L7_except_return;
16773 __pyx_L6_except_error:;
16782 __Pyx_XGIVEREF(__pyx_t_6);
16783 __Pyx_XGIVEREF(__pyx_t_7);
16784 __Pyx_XGIVEREF(__pyx_t_8);
16785 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16786 goto __pyx_L1_error;
16787 __pyx_L8_try_return:;
16788 __Pyx_XGIVEREF(__pyx_t_6);
16789 __Pyx_XGIVEREF(__pyx_t_7);
16790 __Pyx_XGIVEREF(__pyx_t_8);
16791 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16793 __pyx_L7_except_return:;
16794 __Pyx_XGIVEREF(__pyx_t_6);
16795 __Pyx_XGIVEREF(__pyx_t_7);
16796 __Pyx_XGIVEREF(__pyx_t_8);
16797 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16812 __Pyx_XDECREF(__pyx_t_3);
16813 __Pyx_XDECREF(__pyx_t_5);
16814 __Pyx_XDECREF(__pyx_t_9);
16815 __Pyx_XDECREF(__pyx_t_10);
16816 __Pyx_XDECREF(__pyx_t_11);
16817 __Pyx_AddTraceback(
"PyClical.tan", __pyx_clineno, __pyx_lineno, __pyx_filename);
16820 __Pyx_XGIVEREF(__pyx_r);
16821 __Pyx_RefNannyFinishContext();
16826 static PyObject *__pyx_pw_8PyClical_67tan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16827 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 ";
16828 static PyObject *__pyx_pw_8PyClical_67tan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16829 PyObject *__pyx_v_obj = 0;
16830 PyObject *__pyx_v_i = 0;
16831 PyObject *__pyx_r = 0;
16832 __Pyx_RefNannyDeclarations
16833 __Pyx_RefNannySetupContext(
"tan (wrapper)", 0);
16835 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
16836 PyObject* values[2] = {0,0};
16837 values[1] = ((PyObject *)Py_None);
16838 if (unlikely(__pyx_kwds)) {
16839 Py_ssize_t kw_args;
16840 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16841 switch (pos_args) {
16842 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16843 CYTHON_FALLTHROUGH;
16844 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16845 CYTHON_FALLTHROUGH;
16847 default:
goto __pyx_L5_argtuple_error;
16849 kw_args = PyDict_Size(__pyx_kwds);
16850 switch (pos_args) {
16852 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
16853 else goto __pyx_L5_argtuple_error;
16854 CYTHON_FALLTHROUGH;
16857 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
16858 if (value) { values[1] = value; kw_args--; }
16861 if (unlikely(kw_args > 0)) {
16862 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"tan") < 0)) __PYX_ERR(0, 1752, __pyx_L3_error)
16865 switch (PyTuple_GET_SIZE(__pyx_args)) {
16866 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16867 CYTHON_FALLTHROUGH;
16868 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16870 default:
goto __pyx_L5_argtuple_error;
16873 __pyx_v_obj = values[0];
16874 __pyx_v_i = values[1];
16876 goto __pyx_L4_argument_unpacking_done;
16877 __pyx_L5_argtuple_error:;
16878 __Pyx_RaiseArgtupleInvalid(
"tan", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1752, __pyx_L3_error)
16880 __Pyx_AddTraceback(
"PyClical.tan", __pyx_clineno, __pyx_lineno, __pyx_filename);
16881 __Pyx_RefNannyFinishContext();
16883 __pyx_L4_argument_unpacking_done:;
16884 __pyx_r = __pyx_pf_8PyClical_66tan(__pyx_self, __pyx_v_obj, __pyx_v_i);
16887 __Pyx_RefNannyFinishContext();
16891 static PyObject *__pyx_pf_8PyClical_66tan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
16892 PyObject *__pyx_r = NULL;
16893 __Pyx_RefNannyDeclarations
16894 PyObject *__pyx_t_1 = NULL;
16895 struct __pyx_opt_args_8PyClical_tan __pyx_t_2;
16896 __Pyx_RefNannySetupContext(
"tan", 0);
16897 __Pyx_XDECREF(__pyx_r);
16898 __pyx_t_2.__pyx_n = 1;
16899 __pyx_t_2.i = __pyx_v_i;
16900 __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)
16901 __Pyx_GOTREF(__pyx_t_1);
16902 __pyx_r = __pyx_t_1;
16908 __Pyx_XDECREF(__pyx_t_1);
16909 __Pyx_AddTraceback(
"PyClical.tan", __pyx_clineno, __pyx_lineno, __pyx_filename);
16912 __Pyx_XGIVEREF(__pyx_r);
16913 __Pyx_RefNannyFinishContext();
16925 static PyObject *__pyx_pw_8PyClical_69atan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16926 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) {
16927 PyObject *__pyx_v_i = ((PyObject *)Py_None);
16928 PyObject *__pyx_r = NULL;
16929 __Pyx_RefNannyDeclarations
16932 PyObject *__pyx_t_3 = NULL;
16934 PyObject *__pyx_t_5 = NULL;
16935 PyObject *__pyx_t_6 = NULL;
16936 PyObject *__pyx_t_7 = NULL;
16937 PyObject *__pyx_t_8 = NULL;
16938 PyObject *__pyx_t_9 = NULL;
16939 PyObject *__pyx_t_10 = NULL;
16940 PyObject *__pyx_t_11 = NULL;
16941 __Pyx_RefNannySetupContext(
"atan", 0);
16942 if (__pyx_optional_args) {
16943 if (__pyx_optional_args->__pyx_n > 0) {
16944 __pyx_v_i = __pyx_optional_args->i;
16955 __pyx_t_1 = (__pyx_v_i != Py_None);
16956 __pyx_t_2 = (__pyx_t_1 != 0);
16966 __Pyx_XDECREF(__pyx_r);
16967 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1779, __pyx_L1_error)
16968 __Pyx_GOTREF(__pyx_t_3);
16970 __pyx_t_4 =
atan(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
16972 __Pyx_CppExn2PyErr();
16973 __PYX_ERR(0, 1779, __pyx_L1_error)
16975 __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)
16976 __Pyx_GOTREF(__pyx_t_5);
16977 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16978 __pyx_r = __pyx_t_5;
17000 __Pyx_PyThreadState_declare
17001 __Pyx_PyThreadState_assign
17002 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
17003 __Pyx_XGOTREF(__pyx_t_6);
17004 __Pyx_XGOTREF(__pyx_t_7);
17005 __Pyx_XGOTREF(__pyx_t_8);
17015 __Pyx_XDECREF(__pyx_r);
17016 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1782, __pyx_L4_error)
17017 __Pyx_GOTREF(__pyx_t_3);
17018 __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)
17019 __Pyx_GOTREF(__pyx_t_9);
17020 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17022 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
17023 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
17024 if (likely(__pyx_t_3)) {
17025 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
17026 __Pyx_INCREF(__pyx_t_3);
17027 __Pyx_INCREF(
function);
17028 __Pyx_DECREF_SET(__pyx_t_9,
function);
17032 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1782, __pyx_L4_error)
17033 __Pyx_GOTREF(__pyx_t_5);
17035 #if CYTHON_FAST_PYCALL 17036 if (PyFunction_Check(__pyx_t_9)) {
17037 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
17038 __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)
17039 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17040 __Pyx_GOTREF(__pyx_t_5);
17043 #if CYTHON_FAST_PYCCALL 17044 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
17045 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
17046 __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)
17047 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17048 __Pyx_GOTREF(__pyx_t_5);
17052 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1782, __pyx_L4_error)
17053 __Pyx_GOTREF(__pyx_t_10);
17054 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
17055 __Pyx_INCREF(__pyx_v_obj);
17056 __Pyx_GIVEREF(__pyx_v_obj);
17057 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
17058 __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)
17059 __Pyx_GOTREF(__pyx_t_5);
17060 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
17063 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17064 __pyx_r = __pyx_t_5;
17066 goto __pyx_L8_try_return;
17077 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17078 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
17079 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
17080 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17090 __Pyx_AddTraceback(
"PyClical.atan", __pyx_clineno, __pyx_lineno, __pyx_filename);
17091 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1783, __pyx_L6_except_error)
17092 __Pyx_GOTREF(__pyx_t_5);
17093 __Pyx_GOTREF(__pyx_t_9);
17094 __Pyx_GOTREF(__pyx_t_10);
17103 __Pyx_XDECREF(__pyx_r);
17104 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1784, __pyx_L6_except_error)
17105 __Pyx_GOTREF(__pyx_t_3);
17106 __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)
17107 __Pyx_GOTREF(__pyx_t_11);
17108 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17109 __pyx_r = __pyx_t_11;
17111 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17112 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17113 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
17114 goto __pyx_L7_except_return;
17116 __pyx_L6_except_error:;
17125 __Pyx_XGIVEREF(__pyx_t_6);
17126 __Pyx_XGIVEREF(__pyx_t_7);
17127 __Pyx_XGIVEREF(__pyx_t_8);
17128 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17129 goto __pyx_L1_error;
17130 __pyx_L8_try_return:;
17131 __Pyx_XGIVEREF(__pyx_t_6);
17132 __Pyx_XGIVEREF(__pyx_t_7);
17133 __Pyx_XGIVEREF(__pyx_t_8);
17134 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17136 __pyx_L7_except_return:;
17137 __Pyx_XGIVEREF(__pyx_t_6);
17138 __Pyx_XGIVEREF(__pyx_t_7);
17139 __Pyx_XGIVEREF(__pyx_t_8);
17140 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17155 __Pyx_XDECREF(__pyx_t_3);
17156 __Pyx_XDECREF(__pyx_t_5);
17157 __Pyx_XDECREF(__pyx_t_9);
17158 __Pyx_XDECREF(__pyx_t_10);
17159 __Pyx_XDECREF(__pyx_t_11);
17160 __Pyx_AddTraceback(
"PyClical.atan", __pyx_clineno, __pyx_lineno, __pyx_filename);
17163 __Pyx_XGIVEREF(__pyx_r);
17164 __Pyx_RefNannyFinishContext();
17169 static PyObject *__pyx_pw_8PyClical_69atan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17170 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 ";
17171 static PyObject *__pyx_pw_8PyClical_69atan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17172 PyObject *__pyx_v_obj = 0;
17173 PyObject *__pyx_v_i = 0;
17174 PyObject *__pyx_r = 0;
17175 __Pyx_RefNannyDeclarations
17176 __Pyx_RefNannySetupContext(
"atan (wrapper)", 0);
17178 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
17179 PyObject* values[2] = {0,0};
17180 values[1] = ((PyObject *)Py_None);
17181 if (unlikely(__pyx_kwds)) {
17182 Py_ssize_t kw_args;
17183 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17184 switch (pos_args) {
17185 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17186 CYTHON_FALLTHROUGH;
17187 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17188 CYTHON_FALLTHROUGH;
17190 default:
goto __pyx_L5_argtuple_error;
17192 kw_args = PyDict_Size(__pyx_kwds);
17193 switch (pos_args) {
17195 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
17196 else goto __pyx_L5_argtuple_error;
17197 CYTHON_FALLTHROUGH;
17200 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
17201 if (value) { values[1] = value; kw_args--; }
17204 if (unlikely(kw_args > 0)) {
17205 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"atan") < 0)) __PYX_ERR(0, 1769, __pyx_L3_error)
17208 switch (PyTuple_GET_SIZE(__pyx_args)) {
17209 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17210 CYTHON_FALLTHROUGH;
17211 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17213 default:
goto __pyx_L5_argtuple_error;
17216 __pyx_v_obj = values[0];
17217 __pyx_v_i = values[1];
17219 goto __pyx_L4_argument_unpacking_done;
17220 __pyx_L5_argtuple_error:;
17221 __Pyx_RaiseArgtupleInvalid(
"atan", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1769, __pyx_L3_error)
17223 __Pyx_AddTraceback(
"PyClical.atan", __pyx_clineno, __pyx_lineno, __pyx_filename);
17224 __Pyx_RefNannyFinishContext();
17226 __pyx_L4_argument_unpacking_done:;
17227 __pyx_r = __pyx_pf_8PyClical_68atan(__pyx_self, __pyx_v_obj, __pyx_v_i);
17230 __Pyx_RefNannyFinishContext();
17234 static PyObject *__pyx_pf_8PyClical_68atan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
17235 PyObject *__pyx_r = NULL;
17236 __Pyx_RefNannyDeclarations
17237 PyObject *__pyx_t_1 = NULL;
17238 struct __pyx_opt_args_8PyClical_atan __pyx_t_2;
17239 __Pyx_RefNannySetupContext(
"atan", 0);
17240 __Pyx_XDECREF(__pyx_r);
17241 __pyx_t_2.__pyx_n = 1;
17242 __pyx_t_2.i = __pyx_v_i;
17243 __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)
17244 __Pyx_GOTREF(__pyx_t_1);
17245 __pyx_r = __pyx_t_1;
17251 __Pyx_XDECREF(__pyx_t_1);
17252 __Pyx_AddTraceback(
"PyClical.atan", __pyx_clineno, __pyx_lineno, __pyx_filename);
17255 __Pyx_XGIVEREF(__pyx_r);
17256 __Pyx_RefNannyFinishContext();
17268 static PyObject *__pyx_pw_8PyClical_71tanh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
17269 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_tanh(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
17270 PyObject *__pyx_r = NULL;
17271 __Pyx_RefNannyDeclarations
17272 PyObject *__pyx_t_1 = NULL;
17273 PyObject *__pyx_t_2 = NULL;
17274 PyObject *__pyx_t_3 = NULL;
17275 PyObject *__pyx_t_4 = NULL;
17276 PyObject *__pyx_t_5 = NULL;
17277 PyObject *__pyx_t_6 = NULL;
17278 PyObject *__pyx_t_7 = NULL;
17279 PyObject *__pyx_t_8 = NULL;
17280 __Pyx_RefNannySetupContext(
"tanh", 0);
17290 __Pyx_PyThreadState_declare
17291 __Pyx_PyThreadState_assign
17292 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
17293 __Pyx_XGOTREF(__pyx_t_1);
17294 __Pyx_XGOTREF(__pyx_t_2);
17295 __Pyx_XGOTREF(__pyx_t_3);
17305 __Pyx_XDECREF(__pyx_r);
17306 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1794, __pyx_L3_error)
17307 __Pyx_GOTREF(__pyx_t_5);
17308 __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)
17309 __Pyx_GOTREF(__pyx_t_6);
17310 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17312 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
17313 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
17314 if (likely(__pyx_t_5)) {
17315 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
17316 __Pyx_INCREF(__pyx_t_5);
17317 __Pyx_INCREF(
function);
17318 __Pyx_DECREF_SET(__pyx_t_6,
function);
17322 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_obj);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1794, __pyx_L3_error)
17323 __Pyx_GOTREF(__pyx_t_4);
17325 #if CYTHON_FAST_PYCALL 17326 if (PyFunction_Check(__pyx_t_6)) {
17327 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_obj};
17328 __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)
17329 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17330 __Pyx_GOTREF(__pyx_t_4);
17333 #if CYTHON_FAST_PYCCALL 17334 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
17335 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_obj};
17336 __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)
17337 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17338 __Pyx_GOTREF(__pyx_t_4);
17342 __pyx_t_7 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1794, __pyx_L3_error)
17343 __Pyx_GOTREF(__pyx_t_7);
17344 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
17345 __Pyx_INCREF(__pyx_v_obj);
17346 __Pyx_GIVEREF(__pyx_v_obj);
17347 PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_obj);
17348 __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)
17349 __Pyx_GOTREF(__pyx_t_4);
17350 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
17353 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17354 __pyx_r = __pyx_t_4;
17356 goto __pyx_L7_try_return;
17367 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17368 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
17369 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
17370 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
17380 __Pyx_AddTraceback(
"PyClical.tanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17381 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1795, __pyx_L5_except_error)
17382 __Pyx_GOTREF(__pyx_t_4);
17383 __Pyx_GOTREF(__pyx_t_6);
17384 __Pyx_GOTREF(__pyx_t_7);
17393 __Pyx_XDECREF(__pyx_r);
17394 __pyx_t_5 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1796, __pyx_L5_except_error)
17395 __Pyx_GOTREF(__pyx_t_5);
17396 __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)
17397 __Pyx_GOTREF(__pyx_t_8);
17398 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17399 __pyx_r = __pyx_t_8;
17401 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17402 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17403 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
17404 goto __pyx_L6_except_return;
17406 __pyx_L5_except_error:;
17415 __Pyx_XGIVEREF(__pyx_t_1);
17416 __Pyx_XGIVEREF(__pyx_t_2);
17417 __Pyx_XGIVEREF(__pyx_t_3);
17418 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
17419 goto __pyx_L1_error;
17420 __pyx_L7_try_return:;
17421 __Pyx_XGIVEREF(__pyx_t_1);
17422 __Pyx_XGIVEREF(__pyx_t_2);
17423 __Pyx_XGIVEREF(__pyx_t_3);
17424 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
17426 __pyx_L6_except_return:;
17427 __Pyx_XGIVEREF(__pyx_t_1);
17428 __Pyx_XGIVEREF(__pyx_t_2);
17429 __Pyx_XGIVEREF(__pyx_t_3);
17430 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
17444 __Pyx_XDECREF(__pyx_t_4);
17445 __Pyx_XDECREF(__pyx_t_5);
17446 __Pyx_XDECREF(__pyx_t_6);
17447 __Pyx_XDECREF(__pyx_t_7);
17448 __Pyx_XDECREF(__pyx_t_8);
17449 __Pyx_AddTraceback(
"PyClical.tanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17452 __Pyx_XGIVEREF(__pyx_r);
17453 __Pyx_RefNannyFinishContext();
17458 static PyObject *__pyx_pw_8PyClical_71tanh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
17459 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 ";
17460 static PyObject *__pyx_pw_8PyClical_71tanh(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
17461 PyObject *__pyx_r = 0;
17462 __Pyx_RefNannyDeclarations
17463 __Pyx_RefNannySetupContext(
"tanh (wrapper)", 0);
17464 __pyx_r = __pyx_pf_8PyClical_70tanh(__pyx_self, ((PyObject *)__pyx_v_obj));
17467 __Pyx_RefNannyFinishContext();
17471 static PyObject *__pyx_pf_8PyClical_70tanh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
17472 PyObject *__pyx_r = NULL;
17473 __Pyx_RefNannyDeclarations
17474 PyObject *__pyx_t_1 = NULL;
17475 __Pyx_RefNannySetupContext(
"tanh", 0);
17476 __Pyx_XDECREF(__pyx_r);
17477 __pyx_t_1 = __pyx_f_8PyClical_tanh(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1786, __pyx_L1_error)
17478 __Pyx_GOTREF(__pyx_t_1);
17479 __pyx_r = __pyx_t_1;
17485 __Pyx_XDECREF(__pyx_t_1);
17486 __Pyx_AddTraceback(
"PyClical.tanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17489 __Pyx_XGIVEREF(__pyx_r);
17490 __Pyx_RefNannyFinishContext();
17502 static PyObject *__pyx_pw_8PyClical_73atanh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17503 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) {
17504 PyObject *__pyx_v_i = ((PyObject *)Py_None);
17505 PyObject *__pyx_r = NULL;
17506 __Pyx_RefNannyDeclarations
17509 PyObject *__pyx_t_3 = NULL;
17511 PyObject *__pyx_t_5 = NULL;
17512 PyObject *__pyx_t_6 = NULL;
17513 PyObject *__pyx_t_7 = NULL;
17514 PyObject *__pyx_t_8 = NULL;
17515 PyObject *__pyx_t_9 = NULL;
17516 PyObject *__pyx_t_10 = NULL;
17517 PyObject *__pyx_t_11 = NULL;
17518 __Pyx_RefNannySetupContext(
"atanh", 0);
17519 if (__pyx_optional_args) {
17520 if (__pyx_optional_args->__pyx_n > 0) {
17521 __pyx_v_i = __pyx_optional_args->i;
17532 __pyx_t_1 = (__pyx_v_i != Py_None);
17533 __pyx_t_2 = (__pyx_t_1 != 0);
17543 __Pyx_XDECREF(__pyx_r);
17544 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1808, __pyx_L1_error)
17545 __Pyx_GOTREF(__pyx_t_3);
17547 __pyx_t_4 =
atanh(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
17549 __Pyx_CppExn2PyErr();
17550 __PYX_ERR(0, 1808, __pyx_L1_error)
17552 __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)
17553 __Pyx_GOTREF(__pyx_t_5);
17554 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17555 __pyx_r = __pyx_t_5;
17577 __Pyx_PyThreadState_declare
17578 __Pyx_PyThreadState_assign
17579 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
17580 __Pyx_XGOTREF(__pyx_t_6);
17581 __Pyx_XGOTREF(__pyx_t_7);
17582 __Pyx_XGOTREF(__pyx_t_8);
17592 __Pyx_XDECREF(__pyx_r);
17593 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1811, __pyx_L4_error)
17594 __Pyx_GOTREF(__pyx_t_3);
17595 __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)
17596 __Pyx_GOTREF(__pyx_t_9);
17597 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17599 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
17600 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
17601 if (likely(__pyx_t_3)) {
17602 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
17603 __Pyx_INCREF(__pyx_t_3);
17604 __Pyx_INCREF(
function);
17605 __Pyx_DECREF_SET(__pyx_t_9,
function);
17609 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1811, __pyx_L4_error)
17610 __Pyx_GOTREF(__pyx_t_5);
17612 #if CYTHON_FAST_PYCALL 17613 if (PyFunction_Check(__pyx_t_9)) {
17614 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
17615 __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)
17616 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17617 __Pyx_GOTREF(__pyx_t_5);
17620 #if CYTHON_FAST_PYCCALL 17621 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
17622 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
17623 __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)
17624 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17625 __Pyx_GOTREF(__pyx_t_5);
17629 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1811, __pyx_L4_error)
17630 __Pyx_GOTREF(__pyx_t_10);
17631 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
17632 __Pyx_INCREF(__pyx_v_obj);
17633 __Pyx_GIVEREF(__pyx_v_obj);
17634 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
17635 __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)
17636 __Pyx_GOTREF(__pyx_t_5);
17637 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
17640 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17641 __pyx_r = __pyx_t_5;
17643 goto __pyx_L8_try_return;
17654 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17655 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
17656 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
17657 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17667 __Pyx_AddTraceback(
"PyClical.atanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17668 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1812, __pyx_L6_except_error)
17669 __Pyx_GOTREF(__pyx_t_5);
17670 __Pyx_GOTREF(__pyx_t_9);
17671 __Pyx_GOTREF(__pyx_t_10);
17680 __Pyx_XDECREF(__pyx_r);
17681 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1813, __pyx_L6_except_error)
17682 __Pyx_GOTREF(__pyx_t_3);
17683 __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)
17684 __Pyx_GOTREF(__pyx_t_11);
17685 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17686 __pyx_r = __pyx_t_11;
17688 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17689 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17690 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
17691 goto __pyx_L7_except_return;
17693 __pyx_L6_except_error:;
17702 __Pyx_XGIVEREF(__pyx_t_6);
17703 __Pyx_XGIVEREF(__pyx_t_7);
17704 __Pyx_XGIVEREF(__pyx_t_8);
17705 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17706 goto __pyx_L1_error;
17707 __pyx_L8_try_return:;
17708 __Pyx_XGIVEREF(__pyx_t_6);
17709 __Pyx_XGIVEREF(__pyx_t_7);
17710 __Pyx_XGIVEREF(__pyx_t_8);
17711 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17713 __pyx_L7_except_return:;
17714 __Pyx_XGIVEREF(__pyx_t_6);
17715 __Pyx_XGIVEREF(__pyx_t_7);
17716 __Pyx_XGIVEREF(__pyx_t_8);
17717 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17732 __Pyx_XDECREF(__pyx_t_3);
17733 __Pyx_XDECREF(__pyx_t_5);
17734 __Pyx_XDECREF(__pyx_t_9);
17735 __Pyx_XDECREF(__pyx_t_10);
17736 __Pyx_XDECREF(__pyx_t_11);
17737 __Pyx_AddTraceback(
"PyClical.atanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17740 __Pyx_XGIVEREF(__pyx_r);
17741 __Pyx_RefNannyFinishContext();
17746 static PyObject *__pyx_pw_8PyClical_73atanh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17747 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 ";
17748 static PyObject *__pyx_pw_8PyClical_73atanh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17749 PyObject *__pyx_v_obj = 0;
17750 PyObject *__pyx_v_i = 0;
17751 PyObject *__pyx_r = 0;
17752 __Pyx_RefNannyDeclarations
17753 __Pyx_RefNannySetupContext(
"atanh (wrapper)", 0);
17755 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
17756 PyObject* values[2] = {0,0};
17757 values[1] = ((PyObject *)Py_None);
17758 if (unlikely(__pyx_kwds)) {
17759 Py_ssize_t kw_args;
17760 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17761 switch (pos_args) {
17762 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17763 CYTHON_FALLTHROUGH;
17764 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17765 CYTHON_FALLTHROUGH;
17767 default:
goto __pyx_L5_argtuple_error;
17769 kw_args = PyDict_Size(__pyx_kwds);
17770 switch (pos_args) {
17772 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
17773 else goto __pyx_L5_argtuple_error;
17774 CYTHON_FALLTHROUGH;
17777 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
17778 if (value) { values[1] = value; kw_args--; }
17781 if (unlikely(kw_args > 0)) {
17782 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"atanh") < 0)) __PYX_ERR(0, 1798, __pyx_L3_error)
17785 switch (PyTuple_GET_SIZE(__pyx_args)) {
17786 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17787 CYTHON_FALLTHROUGH;
17788 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17790 default:
goto __pyx_L5_argtuple_error;
17793 __pyx_v_obj = values[0];
17794 __pyx_v_i = values[1];
17796 goto __pyx_L4_argument_unpacking_done;
17797 __pyx_L5_argtuple_error:;
17798 __Pyx_RaiseArgtupleInvalid(
"atanh", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1798, __pyx_L3_error)
17800 __Pyx_AddTraceback(
"PyClical.atanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17801 __Pyx_RefNannyFinishContext();
17803 __pyx_L4_argument_unpacking_done:;
17804 __pyx_r = __pyx_pf_8PyClical_72atanh(__pyx_self, __pyx_v_obj, __pyx_v_i);
17807 __Pyx_RefNannyFinishContext();
17811 static PyObject *__pyx_pf_8PyClical_72atanh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
17812 PyObject *__pyx_r = NULL;
17813 __Pyx_RefNannyDeclarations
17814 PyObject *__pyx_t_1 = NULL;
17815 struct __pyx_opt_args_8PyClical_atanh __pyx_t_2;
17816 __Pyx_RefNannySetupContext(
"atanh", 0);
17817 __Pyx_XDECREF(__pyx_r);
17818 __pyx_t_2.__pyx_n = 1;
17819 __pyx_t_2.i = __pyx_v_i;
17820 __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)
17821 __Pyx_GOTREF(__pyx_t_1);
17822 __pyx_r = __pyx_t_1;
17828 __Pyx_XDECREF(__pyx_t_1);
17829 __Pyx_AddTraceback(
"PyClical.atanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17832 __Pyx_XGIVEREF(__pyx_r);
17833 __Pyx_RefNannyFinishContext();
17845 static PyObject *__pyx_pw_8PyClical_75random_clifford(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17846 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) {
17847 PyObject *__pyx_v_fill = ((PyObject *)__pyx_float_1_0);
17848 PyObject *__pyx_r = NULL;
17849 __Pyx_RefNannyDeclarations
17850 PyObject *__pyx_t_1 = NULL;
17851 PyObject *__pyx_t_2 = NULL;
17853 PyObject *__pyx_t_4 = NULL;
17854 __Pyx_RefNannySetupContext(
"random_clifford", 0);
17855 if (__pyx_optional_args) {
17856 if (__pyx_optional_args->__pyx_n > 0) {
17857 __pyx_v_fill = __pyx_optional_args->fill;
17868 __Pyx_XDECREF(__pyx_r);
17869 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1822, __pyx_L1_error)
17870 __Pyx_GOTREF(__pyx_t_1);
17871 __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1822, __pyx_L1_error)
17872 __Pyx_GOTREF(__pyx_t_2);
17873 __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)
17874 __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)
17875 __Pyx_GOTREF(__pyx_t_4);
17876 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17877 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17878 __pyx_r = __pyx_t_4;
17892 __Pyx_XDECREF(__pyx_t_1);
17893 __Pyx_XDECREF(__pyx_t_2);
17894 __Pyx_XDECREF(__pyx_t_4);
17895 __Pyx_AddTraceback(
"PyClical.random_clifford", __pyx_clineno, __pyx_lineno, __pyx_filename);
17898 __Pyx_XGIVEREF(__pyx_r);
17899 __Pyx_RefNannyFinishContext();
17904 static PyObject *__pyx_pw_8PyClical_75random_clifford(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17905 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 ";
17906 static PyObject *__pyx_pw_8PyClical_75random_clifford(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17907 struct __pyx_obj_8PyClical_index_set *__pyx_v_ixt = 0;
17908 PyObject *__pyx_v_fill = 0;
17909 PyObject *__pyx_r = 0;
17910 __Pyx_RefNannyDeclarations
17911 __Pyx_RefNannySetupContext(
"random_clifford (wrapper)", 0);
17913 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ixt,&__pyx_n_s_fill,0};
17914 PyObject* values[2] = {0,0};
17915 values[1] = ((PyObject *)__pyx_float_1_0);
17916 if (unlikely(__pyx_kwds)) {
17917 Py_ssize_t kw_args;
17918 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17919 switch (pos_args) {
17920 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17921 CYTHON_FALLTHROUGH;
17922 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17923 CYTHON_FALLTHROUGH;
17925 default:
goto __pyx_L5_argtuple_error;
17927 kw_args = PyDict_Size(__pyx_kwds);
17928 switch (pos_args) {
17930 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ixt)) != 0)) kw_args--;
17931 else goto __pyx_L5_argtuple_error;
17932 CYTHON_FALLTHROUGH;
17935 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fill);
17936 if (value) { values[1] = value; kw_args--; }
17939 if (unlikely(kw_args > 0)) {
17940 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"random_clifford") < 0)) __PYX_ERR(0, 1815, __pyx_L3_error)
17943 switch (PyTuple_GET_SIZE(__pyx_args)) {
17944 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17945 CYTHON_FALLTHROUGH;
17946 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17948 default:
goto __pyx_L5_argtuple_error;
17951 __pyx_v_ixt = ((
struct __pyx_obj_8PyClical_index_set *)values[0]);
17952 __pyx_v_fill = values[1];
17954 goto __pyx_L4_argument_unpacking_done;
17955 __pyx_L5_argtuple_error:;
17956 __Pyx_RaiseArgtupleInvalid(
"random_clifford", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1815, __pyx_L3_error)
17958 __Pyx_AddTraceback(
"PyClical.random_clifford", __pyx_clineno, __pyx_lineno, __pyx_filename);
17959 __Pyx_RefNannyFinishContext();
17961 __pyx_L4_argument_unpacking_done:;
17962 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ixt), __pyx_ptype_8PyClical_index_set, 1,
"ixt", 0))) __PYX_ERR(0, 1815, __pyx_L1_error)
17963 __pyx_r = __pyx_pf_8PyClical_74random_clifford(__pyx_self, __pyx_v_ixt, __pyx_v_fill);
17970 __Pyx_RefNannyFinishContext();
17974 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) {
17975 PyObject *__pyx_r = NULL;
17976 __Pyx_RefNannyDeclarations
17977 PyObject *__pyx_t_1 = NULL;
17978 struct __pyx_opt_args_8PyClical_random_clifford __pyx_t_2;
17979 __Pyx_RefNannySetupContext(
"random_clifford", 0);
17980 __Pyx_XDECREF(__pyx_r);
17981 __pyx_t_2.__pyx_n = 1;
17982 __pyx_t_2.fill = __pyx_v_fill;
17983 __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)
17984 __Pyx_GOTREF(__pyx_t_1);
17985 __pyx_r = __pyx_t_1;
17991 __Pyx_XDECREF(__pyx_t_1);
17992 __Pyx_AddTraceback(
"PyClical.random_clifford", __pyx_clineno, __pyx_lineno, __pyx_filename);
17995 __Pyx_XGIVEREF(__pyx_r);
17996 __Pyx_RefNannyFinishContext();
18008 static PyObject *__pyx_pw_8PyClical_77cga3(PyObject *__pyx_self, PyObject *__pyx_v_obj);
18009 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cga3(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
18010 PyObject *__pyx_r = NULL;
18011 __Pyx_RefNannyDeclarations
18012 PyObject *__pyx_t_1 = NULL;
18013 PyObject *__pyx_t_2 = NULL;
18014 __Pyx_RefNannySetupContext(
"cga3", 0);
18023 __Pyx_XDECREF(__pyx_r);
18024 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1831, __pyx_L1_error)
18025 __Pyx_GOTREF(__pyx_t_1);
18026 __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)
18027 __Pyx_GOTREF(__pyx_t_2);
18028 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18029 __pyx_r = __pyx_t_2;
18043 __Pyx_XDECREF(__pyx_t_1);
18044 __Pyx_XDECREF(__pyx_t_2);
18045 __Pyx_AddTraceback(
"PyClical.cga3", __pyx_clineno, __pyx_lineno, __pyx_filename);
18048 __Pyx_XGIVEREF(__pyx_r);
18049 __Pyx_RefNannyFinishContext();
18054 static PyObject *__pyx_pw_8PyClical_77cga3(PyObject *__pyx_self, PyObject *__pyx_v_obj);
18055 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 ";
18056 static PyObject *__pyx_pw_8PyClical_77cga3(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18057 PyObject *__pyx_r = 0;
18058 __Pyx_RefNannyDeclarations
18059 __Pyx_RefNannySetupContext(
"cga3 (wrapper)", 0);
18060 __pyx_r = __pyx_pf_8PyClical_76cga3(__pyx_self, ((PyObject *)__pyx_v_obj));
18063 __Pyx_RefNannyFinishContext();
18067 static PyObject *__pyx_pf_8PyClical_76cga3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18068 PyObject *__pyx_r = NULL;
18069 __Pyx_RefNannyDeclarations
18070 PyObject *__pyx_t_1 = NULL;
18071 __Pyx_RefNannySetupContext(
"cga3", 0);
18072 __Pyx_XDECREF(__pyx_r);
18073 __pyx_t_1 = __pyx_f_8PyClical_cga3(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1824, __pyx_L1_error)
18074 __Pyx_GOTREF(__pyx_t_1);
18075 __pyx_r = __pyx_t_1;
18081 __Pyx_XDECREF(__pyx_t_1);
18082 __Pyx_AddTraceback(
"PyClical.cga3", __pyx_clineno, __pyx_lineno, __pyx_filename);
18085 __Pyx_XGIVEREF(__pyx_r);
18086 __Pyx_RefNannyFinishContext();
18098 static PyObject *__pyx_pw_8PyClical_79cga3std(PyObject *__pyx_self, PyObject *__pyx_v_obj);
18099 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cga3std(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
18100 PyObject *__pyx_r = NULL;
18101 __Pyx_RefNannyDeclarations
18102 PyObject *__pyx_t_1 = NULL;
18103 PyObject *__pyx_t_2 = NULL;
18104 __Pyx_RefNannySetupContext(
"cga3std", 0);
18113 __Pyx_XDECREF(__pyx_r);
18114 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1842, __pyx_L1_error)
18115 __Pyx_GOTREF(__pyx_t_1);
18116 __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)
18117 __Pyx_GOTREF(__pyx_t_2);
18118 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18119 __pyx_r = __pyx_t_2;
18133 __Pyx_XDECREF(__pyx_t_1);
18134 __Pyx_XDECREF(__pyx_t_2);
18135 __Pyx_AddTraceback(
"PyClical.cga3std", __pyx_clineno, __pyx_lineno, __pyx_filename);
18138 __Pyx_XGIVEREF(__pyx_r);
18139 __Pyx_RefNannyFinishContext();
18144 static PyObject *__pyx_pw_8PyClical_79cga3std(PyObject *__pyx_self, PyObject *__pyx_v_obj);
18145 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 ";
18146 static PyObject *__pyx_pw_8PyClical_79cga3std(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18147 PyObject *__pyx_r = 0;
18148 __Pyx_RefNannyDeclarations
18149 __Pyx_RefNannySetupContext(
"cga3std (wrapper)", 0);
18150 __pyx_r = __pyx_pf_8PyClical_78cga3std(__pyx_self, ((PyObject *)__pyx_v_obj));
18153 __Pyx_RefNannyFinishContext();
18157 static PyObject *__pyx_pf_8PyClical_78cga3std(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18158 PyObject *__pyx_r = NULL;
18159 __Pyx_RefNannyDeclarations
18160 PyObject *__pyx_t_1 = NULL;
18161 __Pyx_RefNannySetupContext(
"cga3std", 0);
18162 __Pyx_XDECREF(__pyx_r);
18163 __pyx_t_1 = __pyx_f_8PyClical_cga3std(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1833, __pyx_L1_error)
18164 __Pyx_GOTREF(__pyx_t_1);
18165 __pyx_r = __pyx_t_1;
18171 __Pyx_XDECREF(__pyx_t_1);
18172 __Pyx_AddTraceback(
"PyClical.cga3std", __pyx_clineno, __pyx_lineno, __pyx_filename);
18175 __Pyx_XGIVEREF(__pyx_r);
18176 __Pyx_RefNannyFinishContext();
18188 static PyObject *__pyx_pw_8PyClical_81agc3(PyObject *__pyx_self, PyObject *__pyx_v_obj);
18189 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_agc3(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
18190 PyObject *__pyx_r = NULL;
18191 __Pyx_RefNannyDeclarations
18192 PyObject *__pyx_t_1 = NULL;
18193 PyObject *__pyx_t_2 = NULL;
18194 __Pyx_RefNannySetupContext(
"agc3", 0);
18203 __Pyx_XDECREF(__pyx_r);
18204 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1853, __pyx_L1_error)
18205 __Pyx_GOTREF(__pyx_t_1);
18206 __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)
18207 __Pyx_GOTREF(__pyx_t_2);
18208 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18209 __pyx_r = __pyx_t_2;
18223 __Pyx_XDECREF(__pyx_t_1);
18224 __Pyx_XDECREF(__pyx_t_2);
18225 __Pyx_AddTraceback(
"PyClical.agc3", __pyx_clineno, __pyx_lineno, __pyx_filename);
18228 __Pyx_XGIVEREF(__pyx_r);
18229 __Pyx_RefNannyFinishContext();
18234 static PyObject *__pyx_pw_8PyClical_81agc3(PyObject *__pyx_self, PyObject *__pyx_v_obj);
18235 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 ";
18236 static PyObject *__pyx_pw_8PyClical_81agc3(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18237 PyObject *__pyx_r = 0;
18238 __Pyx_RefNannyDeclarations
18239 __Pyx_RefNannySetupContext(
"agc3 (wrapper)", 0);
18240 __pyx_r = __pyx_pf_8PyClical_80agc3(__pyx_self, ((PyObject *)__pyx_v_obj));
18243 __Pyx_RefNannyFinishContext();
18247 static PyObject *__pyx_pf_8PyClical_80agc3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18248 PyObject *__pyx_r = NULL;
18249 __Pyx_RefNannyDeclarations
18250 PyObject *__pyx_t_1 = NULL;
18251 __Pyx_RefNannySetupContext(
"agc3", 0);
18252 __Pyx_XDECREF(__pyx_r);
18253 __pyx_t_1 = __pyx_f_8PyClical_agc3(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1844, __pyx_L1_error)
18254 __Pyx_GOTREF(__pyx_t_1);
18255 __pyx_r = __pyx_t_1;
18261 __Pyx_XDECREF(__pyx_t_1);
18262 __Pyx_AddTraceback(
"PyClical.agc3", __pyx_clineno, __pyx_lineno, __pyx_filename);
18265 __Pyx_XGIVEREF(__pyx_r);
18266 __Pyx_RefNannyFinishContext();
18279 static PyObject *__pyx_pw_8PyClical_83e(PyObject *__pyx_self, PyObject *__pyx_v_obj);
18280 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 ";
18281 static PyMethodDef __pyx_mdef_8PyClical_83e = {
"e", (PyCFunction)__pyx_pw_8PyClical_83e, METH_O, __pyx_doc_8PyClical_82e};
18282 static PyObject *__pyx_pw_8PyClical_83e(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18283 PyObject *__pyx_r = 0;
18284 __Pyx_RefNannyDeclarations
18285 __Pyx_RefNannySetupContext(
"e (wrapper)", 0);
18286 __pyx_r = __pyx_pf_8PyClical_82e(__pyx_self, ((PyObject *)__pyx_v_obj));
18289 __Pyx_RefNannyFinishContext();
18293 static PyObject *__pyx_pf_8PyClical_82e(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18294 PyObject *__pyx_r = NULL;
18295 __Pyx_RefNannyDeclarations
18296 PyObject *__pyx_t_1 = NULL;
18297 PyObject *__pyx_t_2 = NULL;
18298 __Pyx_RefNannySetupContext(
"e", 0);
18307 __Pyx_XDECREF(__pyx_r);
18308 __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)
18309 __Pyx_GOTREF(__pyx_t_1);
18310 __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)
18311 __Pyx_GOTREF(__pyx_t_2);
18312 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18313 __pyx_r = __pyx_t_2;
18327 __Pyx_XDECREF(__pyx_t_1);
18328 __Pyx_XDECREF(__pyx_t_2);
18329 __Pyx_AddTraceback(
"PyClical.e", __pyx_clineno, __pyx_lineno, __pyx_filename);
18332 __Pyx_XGIVEREF(__pyx_r);
18333 __Pyx_RefNannyFinishContext();
18346 static PyObject *__pyx_pw_8PyClical_85istpq(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
18347 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 ";
18348 static PyMethodDef __pyx_mdef_8PyClical_85istpq = {
"istpq", (PyCFunction)__pyx_pw_8PyClical_85istpq, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_84istpq};
18349 static PyObject *__pyx_pw_8PyClical_85istpq(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18350 PyObject *__pyx_v_p = 0;
18351 PyObject *__pyx_v_q = 0;
18352 PyObject *__pyx_r = 0;
18353 __Pyx_RefNannyDeclarations
18354 __Pyx_RefNannySetupContext(
"istpq (wrapper)", 0);
18356 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,&__pyx_n_s_q,0};
18357 PyObject* values[2] = {0,0};
18358 if (unlikely(__pyx_kwds)) {
18359 Py_ssize_t kw_args;
18360 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
18361 switch (pos_args) {
18362 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18363 CYTHON_FALLTHROUGH;
18364 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18365 CYTHON_FALLTHROUGH;
18367 default:
goto __pyx_L5_argtuple_error;
18369 kw_args = PyDict_Size(__pyx_kwds);
18370 switch (pos_args) {
18372 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p)) != 0)) kw_args--;
18373 else goto __pyx_L5_argtuple_error;
18374 CYTHON_FALLTHROUGH;
18376 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q)) != 0)) kw_args--;
18378 __Pyx_RaiseArgtupleInvalid(
"istpq", 1, 2, 2, 1); __PYX_ERR(0, 1900, __pyx_L3_error)
18381 if (unlikely(kw_args > 0)) {
18382 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"istpq") < 0)) __PYX_ERR(0, 1900, __pyx_L3_error)
18384 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
18385 goto __pyx_L5_argtuple_error;
18387 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18388 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18390 __pyx_v_p = values[0];
18391 __pyx_v_q = values[1];
18393 goto __pyx_L4_argument_unpacking_done;
18394 __pyx_L5_argtuple_error:;
18395 __Pyx_RaiseArgtupleInvalid(
"istpq", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1900, __pyx_L3_error)
18397 __Pyx_AddTraceback(
"PyClical.istpq", __pyx_clineno, __pyx_lineno, __pyx_filename);
18398 __Pyx_RefNannyFinishContext();
18400 __pyx_L4_argument_unpacking_done:;
18401 __pyx_r = __pyx_pf_8PyClical_84istpq(__pyx_self, __pyx_v_p, __pyx_v_q);
18404 __Pyx_RefNannyFinishContext();
18408 static PyObject *__pyx_pf_8PyClical_84istpq(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_p, PyObject *__pyx_v_q) {
18409 PyObject *__pyx_r = NULL;
18410 __Pyx_RefNannyDeclarations
18411 PyObject *__pyx_t_1 = NULL;
18412 PyObject *__pyx_t_2 = NULL;
18413 PyObject *__pyx_t_3 = NULL;
18414 __Pyx_RefNannySetupContext(
"istpq", 0);
18423 __Pyx_XDECREF(__pyx_r);
18424 __pyx_t_1 = PyNumber_Negative(__pyx_v_q);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1907, __pyx_L1_error)
18425 __Pyx_GOTREF(__pyx_t_1);
18426 __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)
18427 __Pyx_GOTREF(__pyx_t_2);
18428 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1907, __pyx_L1_error)
18429 __Pyx_GOTREF(__pyx_t_3);
18430 __Pyx_GIVEREF(__pyx_t_1);
18431 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
18432 __Pyx_GIVEREF(__pyx_t_2);
18433 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
18436 __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)
18437 __Pyx_GOTREF(__pyx_t_2);
18438 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18439 __pyx_t_3 = PySet_New(__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1907, __pyx_L1_error)
18440 __Pyx_GOTREF(__pyx_t_3);
18441 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18442 __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)
18443 __Pyx_GOTREF(__pyx_t_2);
18444 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18445 __pyx_r = __pyx_t_2;
18459 __Pyx_XDECREF(__pyx_t_1);
18460 __Pyx_XDECREF(__pyx_t_2);
18461 __Pyx_XDECREF(__pyx_t_3);
18462 __Pyx_AddTraceback(
"PyClical.istpq", __pyx_clineno, __pyx_lineno, __pyx_filename);
18465 __Pyx_XGIVEREF(__pyx_r);
18466 __Pyx_RefNannyFinishContext();
18479 static PyObject *__pyx_pw_8PyClical_87_test(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused);
18480 static PyMethodDef __pyx_mdef_8PyClical_87_test = {
"_test", (PyCFunction)__pyx_pw_8PyClical_87_test, METH_NOARGS, 0};
18481 static PyObject *__pyx_pw_8PyClical_87_test(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
18482 PyObject *__pyx_r = 0;
18483 __Pyx_RefNannyDeclarations
18484 __Pyx_RefNannySetupContext(
"_test (wrapper)", 0);
18485 __pyx_r = __pyx_pf_8PyClical_86_test(__pyx_self);
18488 __Pyx_RefNannyFinishContext();
18492 static PyObject *__pyx_pf_8PyClical_86_test(CYTHON_UNUSED PyObject *__pyx_self) {
18493 PyObject *__pyx_v_PyClical = NULL;
18494 PyObject *__pyx_v_doctest = NULL;
18495 PyObject *__pyx_r = NULL;
18496 __Pyx_RefNannyDeclarations
18497 PyObject *__pyx_t_1 = NULL;
18498 PyObject *__pyx_t_2 = NULL;
18499 PyObject *__pyx_t_3 = NULL;
18500 PyObject *__pyx_t_4 = NULL;
18501 __Pyx_RefNannySetupContext(
"_test", 0);
18510 __pyx_t_1 = __Pyx_Import(__pyx_n_s_PyClical, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1914, __pyx_L1_error)
18511 __Pyx_GOTREF(__pyx_t_1);
18512 __pyx_v_PyClical = __pyx_t_1;
18514 __pyx_t_1 = __Pyx_Import(__pyx_n_s_doctest, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1914, __pyx_L1_error)
18515 __Pyx_GOTREF(__pyx_t_1);
18516 __pyx_v_doctest = __pyx_t_1;
18526 __Pyx_XDECREF(__pyx_r);
18527 __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)
18528 __Pyx_GOTREF(__pyx_t_2);
18530 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
18531 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
18532 if (likely(__pyx_t_3)) {
18533 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
18534 __Pyx_INCREF(__pyx_t_3);
18535 __Pyx_INCREF(
function);
18536 __Pyx_DECREF_SET(__pyx_t_2,
function);
18540 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_PyClical);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1915, __pyx_L1_error)
18541 __Pyx_GOTREF(__pyx_t_1);
18543 #if CYTHON_FAST_PYCALL 18544 if (PyFunction_Check(__pyx_t_2)) {
18545 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_PyClical};
18546 __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)
18547 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18548 __Pyx_GOTREF(__pyx_t_1);
18551 #if CYTHON_FAST_PYCCALL 18552 if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
18553 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_PyClical};
18554 __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)
18555 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18556 __Pyx_GOTREF(__pyx_t_1);
18560 __pyx_t_4 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1915, __pyx_L1_error)
18561 __Pyx_GOTREF(__pyx_t_4);
18562 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
18563 __Pyx_INCREF(__pyx_v_PyClical);
18564 __Pyx_GIVEREF(__pyx_v_PyClical);
18565 PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_PyClical);
18566 __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)
18567 __Pyx_GOTREF(__pyx_t_1);
18568 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18571 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18572 __pyx_r = __pyx_t_1;
18586 __Pyx_XDECREF(__pyx_t_1);
18587 __Pyx_XDECREF(__pyx_t_2);
18588 __Pyx_XDECREF(__pyx_t_3);
18589 __Pyx_XDECREF(__pyx_t_4);
18590 __Pyx_AddTraceback(
"PyClical._test", __pyx_clineno, __pyx_lineno, __pyx_filename);
18593 __Pyx_XDECREF(__pyx_v_PyClical);
18594 __Pyx_XDECREF(__pyx_v_doctest);
18595 __Pyx_XGIVEREF(__pyx_r);
18596 __Pyx_RefNannyFinishContext();
18599 static struct __pyx_vtabstruct_8PyClical_index_set __pyx_vtable_8PyClical_index_set;
18601 static PyObject *__pyx_tp_new_8PyClical_index_set(PyTypeObject *t, PyObject *a, PyObject *k) {
18602 struct __pyx_obj_8PyClical_index_set *p;
18604 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
18605 o = (*t->tp_alloc)(t, 0);
18607 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
18609 if (unlikely(!o))
return 0;
18610 p = ((
struct __pyx_obj_8PyClical_index_set *)o);
18611 p->__pyx_vtab = __pyx_vtabptr_8PyClical_index_set;
18612 if (unlikely(__pyx_pw_8PyClical_9index_set_3__cinit__(o, a, k) < 0))
goto bad;
18615 Py_DECREF(o); o = 0;
18619 static void __pyx_tp_dealloc_8PyClical_index_set(PyObject *o) {
18620 #if CYTHON_USE_TP_FINALIZE 18621 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))) {
18622 if (PyObject_CallFinalizerFromDealloc(o))
return;
18626 PyObject *etype, *eval, *etb;
18627 PyErr_Fetch(&etype, &eval, &etb);
18629 __pyx_pw_8PyClical_9index_set_5__dealloc__(o);
18631 PyErr_Restore(etype, eval, etb);
18633 (*Py_TYPE(o)->tp_free)(o);
18635 static PyObject *__pyx_sq_item_8PyClical_index_set(PyObject *o, Py_ssize_t
i) {
18637 PyObject *x = PyInt_FromSsize_t(
i);
if(!x)
return 0;
18638 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
18643 static int __pyx_mp_ass_subscript_8PyClical_index_set(PyObject *o, PyObject *
i, PyObject *v) {
18645 return __pyx_pw_8PyClical_9index_set_9__setitem__(o,
i, v);
18648 PyErr_Format(PyExc_NotImplementedError,
18649 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
18654 static PyMethodDef __pyx_methods_8PyClical_index_set[] = {
18655 {
"copy", (PyCFunction)__pyx_pw_8PyClical_9index_set_1copy, METH_NOARGS, __pyx_doc_8PyClical_9index_set_copy},
18656 {
"count", (PyCFunction)__pyx_pw_8PyClical_9index_set_32count, METH_NOARGS, __pyx_doc_8PyClical_9index_set_31count},
18657 {
"count_neg", (PyCFunction)__pyx_pw_8PyClical_9index_set_34count_neg, METH_NOARGS, __pyx_doc_8PyClical_9index_set_33count_neg},
18658 {
"count_pos", (PyCFunction)__pyx_pw_8PyClical_9index_set_36count_pos, METH_NOARGS, __pyx_doc_8PyClical_9index_set_35count_pos},
18659 {
"min", (PyCFunction)__pyx_pw_8PyClical_9index_set_38min, METH_NOARGS, __pyx_doc_8PyClical_9index_set_37min},
18660 {
"max", (PyCFunction)__pyx_pw_8PyClical_9index_set_40max, METH_NOARGS, __pyx_doc_8PyClical_9index_set_39max},
18661 {
"hash_fn", (PyCFunction)__pyx_pw_8PyClical_9index_set_42hash_fn, METH_NOARGS, __pyx_doc_8PyClical_9index_set_41hash_fn},
18662 {
"sign_of_mult", (PyCFunction)__pyx_pw_8PyClical_9index_set_44sign_of_mult, METH_O, __pyx_doc_8PyClical_9index_set_43sign_of_mult},
18663 {
"sign_of_square", (PyCFunction)__pyx_pw_8PyClical_9index_set_46sign_of_square, METH_NOARGS, __pyx_doc_8PyClical_9index_set_45sign_of_square},
18664 {
"__reduce_cython__", (PyCFunction)__pyx_pw_8PyClical_9index_set_52__reduce_cython__, METH_NOARGS, 0},
18665 {
"__setstate_cython__", (PyCFunction)__pyx_pw_8PyClical_9index_set_54__setstate_cython__, METH_O, 0},
18669 static PyNumberMethods __pyx_tp_as_number_index_set = {
18673 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18683 __pyx_pw_8PyClical_9index_set_18__invert__,
18686 __pyx_pw_8PyClical_9index_set_24__and__,
18687 __pyx_pw_8PyClical_9index_set_20__xor__,
18688 __pyx_pw_8PyClical_9index_set_28__or__,
18689 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18693 #if PY_MAJOR_VERSION < 3 18699 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18702 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18708 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18715 __pyx_pw_8PyClical_9index_set_26__iand__,
18716 __pyx_pw_8PyClical_9index_set_22__ixor__,
18717 __pyx_pw_8PyClical_9index_set_30__ior__,
18723 #if PY_VERSION_HEX >= 0x03050000 18726 #if PY_VERSION_HEX >= 0x03050000 18731 static PySequenceMethods __pyx_tp_as_sequence_index_set = {
18735 __pyx_sq_item_8PyClical_index_set,
18739 __pyx_pw_8PyClical_9index_set_13__contains__,
18744 static PyMappingMethods __pyx_tp_as_mapping_index_set = {
18746 __pyx_pw_8PyClical_9index_set_11__getitem__,
18747 __pyx_mp_ass_subscript_8PyClical_index_set,
18750 static PyTypeObject __pyx_type_8PyClical_index_set = {
18751 PyVarObject_HEAD_INIT(0, 0)
18752 "PyClical.index_set",
18753 sizeof(
struct __pyx_obj_8PyClical_index_set),
18755 __pyx_tp_dealloc_8PyClical_index_set,
18759 #if PY_MAJOR_VERSION < 3
18762 #if PY_MAJOR_VERSION >= 3
18765 __pyx_pw_8PyClical_9index_set_48__repr__,
18766 &__pyx_tp_as_number_index_set,
18767 &__pyx_tp_as_sequence_index_set,
18768 &__pyx_tp_as_mapping_index_set,
18771 __pyx_pw_8PyClical_9index_set_50__str__,
18775 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
18776 "\n Python class index_set wraps C++ class IndexSet.\n ",
18779 __pyx_pw_8PyClical_9index_set_7__richcmp__,
18781 __pyx_pw_8PyClical_9index_set_15__iter__,
18783 __pyx_methods_8PyClical_index_set,
18793 __pyx_tp_new_8PyClical_index_set,
18803 #if PY_VERSION_HEX >= 0x030400a1 18807 static struct __pyx_vtabstruct_8PyClical_clifford __pyx_vtable_8PyClical_clifford;
18809 static PyObject *__pyx_tp_new_8PyClical_clifford(PyTypeObject *t, PyObject *a, PyObject *k) {
18810 struct __pyx_obj_8PyClical_clifford *p;
18812 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
18813 o = (*t->tp_alloc)(t, 0);
18815 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
18817 if (unlikely(!o))
return 0;
18818 p = ((
struct __pyx_obj_8PyClical_clifford *)o);
18819 p->__pyx_vtab = __pyx_vtabptr_8PyClical_clifford;
18820 if (unlikely(__pyx_pw_8PyClical_8clifford_3__cinit__(o, a, k) < 0))
goto bad;
18823 Py_DECREF(o); o = 0;
18827 static void __pyx_tp_dealloc_8PyClical_clifford(PyObject *o) {
18828 #if CYTHON_USE_TP_FINALIZE 18829 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))) {
18830 if (PyObject_CallFinalizerFromDealloc(o))
return;
18834 PyObject *etype, *eval, *etb;
18835 PyErr_Fetch(&etype, &eval, &etb);
18837 __pyx_pw_8PyClical_8clifford_5__dealloc__(o);
18839 PyErr_Restore(etype, eval, etb);
18841 (*Py_TYPE(o)->tp_free)(o);
18843 static PyObject *__pyx_sq_item_8PyClical_clifford(PyObject *o, Py_ssize_t
i) {
18845 PyObject *x = PyInt_FromSsize_t(
i);
if(!x)
return 0;
18846 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
18851 static PyMethodDef __pyx_methods_8PyClical_clifford[] = {
18852 {
"copy", (PyCFunction)__pyx_pw_8PyClical_8clifford_1copy, METH_NOARGS, __pyx_doc_8PyClical_8clifford_copy},
18853 {
"reframe", (PyCFunction)__pyx_pw_8PyClical_8clifford_11reframe, METH_O, __pyx_doc_8PyClical_8clifford_10reframe},
18854 {
"inv", (PyCFunction)__pyx_pw_8PyClical_8clifford_49inv, METH_NOARGS, __pyx_doc_8PyClical_8clifford_48inv},
18855 {
"pow", (PyCFunction)__pyx_pw_8PyClical_8clifford_57pow, METH_O, __pyx_doc_8PyClical_8clifford_56pow},
18856 {
"outer_pow", (PyCFunction)__pyx_pw_8PyClical_8clifford_59outer_pow, METH_O, __pyx_doc_8PyClical_8clifford_58outer_pow},
18857 {
"scalar", (PyCFunction)__pyx_pw_8PyClical_8clifford_63scalar, METH_NOARGS, __pyx_doc_8PyClical_8clifford_62scalar},
18858 {
"pure", (PyCFunction)__pyx_pw_8PyClical_8clifford_65pure, METH_NOARGS, __pyx_doc_8PyClical_8clifford_64pure},
18859 {
"even", (PyCFunction)__pyx_pw_8PyClical_8clifford_67even, METH_NOARGS, __pyx_doc_8PyClical_8clifford_66even},
18860 {
"odd", (PyCFunction)__pyx_pw_8PyClical_8clifford_69odd, METH_NOARGS, __pyx_doc_8PyClical_8clifford_68odd},
18861 {
"vector_part", (PyCFunction)__pyx_pw_8PyClical_8clifford_71vector_part, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_8clifford_70vector_part},
18862 {
"involute", (PyCFunction)__pyx_pw_8PyClical_8clifford_73involute, METH_NOARGS, __pyx_doc_8PyClical_8clifford_72involute},
18863 {
"reverse", (PyCFunction)__pyx_pw_8PyClical_8clifford_75reverse, METH_NOARGS, __pyx_doc_8PyClical_8clifford_74reverse},
18864 {
"conj", (PyCFunction)__pyx_pw_8PyClical_8clifford_77conj, METH_NOARGS, __pyx_doc_8PyClical_8clifford_76conj},
18865 {
"quad", (PyCFunction)__pyx_pw_8PyClical_8clifford_79quad, METH_NOARGS, __pyx_doc_8PyClical_8clifford_78quad},
18866 {
"norm", (PyCFunction)__pyx_pw_8PyClical_8clifford_81norm, METH_NOARGS, __pyx_doc_8PyClical_8clifford_80norm},
18867 {
"abs", (PyCFunction)__pyx_pw_8PyClical_8clifford_83abs, METH_NOARGS, __pyx_doc_8PyClical_8clifford_82abs},
18868 {
"max_abs", (PyCFunction)__pyx_pw_8PyClical_8clifford_85max_abs, METH_NOARGS, __pyx_doc_8PyClical_8clifford_84max_abs},
18869 {
"truncated", (PyCFunction)__pyx_pw_8PyClical_8clifford_87truncated, METH_O, __pyx_doc_8PyClical_8clifford_86truncated},
18870 {
"isnan", (PyCFunction)__pyx_pw_8PyClical_8clifford_89isnan, METH_NOARGS, __pyx_doc_8PyClical_8clifford_88isnan},
18871 {
"frame", (PyCFunction)__pyx_pw_8PyClical_8clifford_91frame, METH_NOARGS, __pyx_doc_8PyClical_8clifford_90frame},
18872 {
"__reduce_cython__", (PyCFunction)__pyx_pw_8PyClical_8clifford_97__reduce_cython__, METH_NOARGS, 0},
18873 {
"__setstate_cython__", (PyCFunction)__pyx_pw_8PyClical_8clifford_99__setstate_cython__, METH_O, 0},
18877 static PyNumberMethods __pyx_tp_as_number_clifford = {
18878 __pyx_pw_8PyClical_8clifford_21__add__,
18879 __pyx_pw_8PyClical_8clifford_25__sub__,
18880 __pyx_pw_8PyClical_8clifford_29__mul__,
18881 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18882 __pyx_pw_8PyClical_8clifford_45__div__,
18884 __pyx_pw_8PyClical_8clifford_33__mod__,
18886 __pyx_pw_8PyClical_8clifford_55__pow__,
18887 __pyx_pw_8PyClical_8clifford_17__neg__,
18888 __pyx_pw_8PyClical_8clifford_19__pos__,
18894 __pyx_pw_8PyClical_8clifford_37__and__,
18895 __pyx_pw_8PyClical_8clifford_41__xor__,
18896 __pyx_pw_8PyClical_8clifford_51__or__,
18897 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18901 #if PY_MAJOR_VERSION < 3 18907 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18910 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18913 __pyx_pw_8PyClical_8clifford_23__iadd__,
18914 __pyx_pw_8PyClical_8clifford_27__isub__,
18915 __pyx_pw_8PyClical_8clifford_31__imul__,
18916 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18917 __pyx_pw_8PyClical_8clifford_47__idiv__,
18919 __pyx_pw_8PyClical_8clifford_35__imod__,
18923 __pyx_pw_8PyClical_8clifford_39__iand__,
18924 __pyx_pw_8PyClical_8clifford_43__ixor__,
18925 __pyx_pw_8PyClical_8clifford_53__ior__,
18931 #if PY_VERSION_HEX >= 0x03050000 18934 #if PY_VERSION_HEX >= 0x03050000 18939 static PySequenceMethods __pyx_tp_as_sequence_clifford = {
18943 __pyx_sq_item_8PyClical_clifford,
18947 __pyx_pw_8PyClical_8clifford_7__contains__,
18952 static PyMappingMethods __pyx_tp_as_mapping_clifford = {
18954 __pyx_pw_8PyClical_8clifford_15__getitem__,
18958 static PyTypeObject __pyx_type_8PyClical_clifford = {
18959 PyVarObject_HEAD_INIT(0, 0)
18960 "PyClical.clifford",
18961 sizeof(
struct __pyx_obj_8PyClical_clifford),
18963 __pyx_tp_dealloc_8PyClical_clifford,
18967 #if PY_MAJOR_VERSION < 3
18970 #if PY_MAJOR_VERSION >= 3
18973 __pyx_pw_8PyClical_8clifford_93__repr__,
18974 &__pyx_tp_as_number_clifford,
18975 &__pyx_tp_as_sequence_clifford,
18976 &__pyx_tp_as_mapping_clifford,
18978 __pyx_pw_8PyClical_8clifford_61__call__,
18979 __pyx_pw_8PyClical_8clifford_95__str__,
18983 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
18984 "\n Python class clifford wraps C++ class Clifford.\n ",
18987 __pyx_pw_8PyClical_8clifford_13__richcmp__,
18989 __pyx_pw_8PyClical_8clifford_9__iter__,
18991 __pyx_methods_8PyClical_clifford,
19001 __pyx_tp_new_8PyClical_clifford,
19011 #if PY_VERSION_HEX >= 0x030400a1 19016 static struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *__pyx_freelist_8PyClical___pyx_scope_struct____iter__[8];
19017 static int __pyx_freecount_8PyClical___pyx_scope_struct____iter__ = 0;
19019 static PyObject *__pyx_tp_new_8PyClical___pyx_scope_struct____iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
19021 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__)))) {
19022 o = (PyObject*)__pyx_freelist_8PyClical___pyx_scope_struct____iter__[--__pyx_freecount_8PyClical___pyx_scope_struct____iter__];
19023 memset(o, 0,
sizeof(
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__));
19024 (void) PyObject_INIT(o, t);
19025 PyObject_GC_Track(o);
19027 o = (*t->tp_alloc)(t, 0);
19028 if (unlikely(!o))
return 0;
19033 static void __pyx_tp_dealloc_8PyClical___pyx_scope_struct____iter__(PyObject *o) {
19034 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *p = (
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)o;
19035 PyObject_GC_UnTrack(o);
19036 Py_CLEAR(p->__pyx_v_idx);
19037 Py_CLEAR(p->__pyx_v_self);
19038 Py_CLEAR(p->__pyx_t_0);
19039 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__)))) {
19040 __pyx_freelist_8PyClical___pyx_scope_struct____iter__[__pyx_freecount_8PyClical___pyx_scope_struct____iter__++] = ((
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)o);
19042 (*Py_TYPE(o)->tp_free)(o);
19046 static int __pyx_tp_traverse_8PyClical___pyx_scope_struct____iter__(PyObject *o, visitproc v,
void *a) {
19048 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *p = (
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)o;
19049 if (p->__pyx_v_idx) {
19050 e = (*v)(p->__pyx_v_idx, a);
if (
e)
return e;
19052 if (p->__pyx_v_self) {
19053 e = (*v)(((PyObject *)p->__pyx_v_self), a);
if (
e)
return e;
19055 if (p->__pyx_t_0) {
19056 e = (*v)(p->__pyx_t_0, a);
if (
e)
return e;
19061 static PyTypeObject __pyx_type_8PyClical___pyx_scope_struct____iter__ = {
19062 PyVarObject_HEAD_INIT(0, 0)
19063 "PyClical.__pyx_scope_struct____iter__",
19064 sizeof(
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__),
19066 __pyx_tp_dealloc_8PyClical___pyx_scope_struct____iter__,
19070 #if PY_MAJOR_VERSION < 3
19073 #if PY_MAJOR_VERSION >= 3
19086 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
19088 __pyx_tp_traverse_8PyClical___pyx_scope_struct____iter__,
19104 __pyx_tp_new_8PyClical___pyx_scope_struct____iter__,
19114 #if PY_VERSION_HEX >= 0x030400a1 19119 static PyMethodDef __pyx_methods[] = {
19120 {
"compare", (PyCFunction)__pyx_pw_8PyClical_3compare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_2compare},
19121 {
"min_neg", (PyCFunction)__pyx_pw_8PyClical_5min_neg, METH_O, __pyx_doc_8PyClical_4min_neg},
19122 {
"max_pos", (PyCFunction)__pyx_pw_8PyClical_7max_pos, METH_O, __pyx_doc_8PyClical_6max_pos},
19123 {
"inv", (PyCFunction)__pyx_pw_8PyClical_11inv, METH_O, __pyx_doc_8PyClical_10inv},
19124 {
"scalar", (PyCFunction)__pyx_pw_8PyClical_13scalar, METH_O, __pyx_doc_8PyClical_12scalar},
19125 {
"real", (PyCFunction)__pyx_pw_8PyClical_15real, METH_O, __pyx_doc_8PyClical_14real},
19126 {
"imag", (PyCFunction)__pyx_pw_8PyClical_17imag, METH_O, __pyx_doc_8PyClical_16imag},
19127 {
"pure", (PyCFunction)__pyx_pw_8PyClical_19pure, METH_O, __pyx_doc_8PyClical_18pure},
19128 {
"even", (PyCFunction)__pyx_pw_8PyClical_21even, METH_O, __pyx_doc_8PyClical_20even},
19129 {
"odd", (PyCFunction)__pyx_pw_8PyClical_23odd, METH_O, __pyx_doc_8PyClical_22odd},
19130 {
"involute", (PyCFunction)__pyx_pw_8PyClical_25involute, METH_O, __pyx_doc_8PyClical_24involute},
19131 {
"reverse", (PyCFunction)__pyx_pw_8PyClical_27reverse, METH_O, __pyx_doc_8PyClical_26reverse},
19132 {
"conj", (PyCFunction)__pyx_pw_8PyClical_29conj, METH_O, __pyx_doc_8PyClical_28conj},
19133 {
"quad", (PyCFunction)__pyx_pw_8PyClical_31quad, METH_O, __pyx_doc_8PyClical_30quad},
19134 {
"norm", (PyCFunction)__pyx_pw_8PyClical_33norm, METH_O, __pyx_doc_8PyClical_32norm},
19135 {
"abs", (PyCFunction)__pyx_pw_8PyClical_35abs, METH_O, __pyx_doc_8PyClical_34abs},
19136 {
"max_abs", (PyCFunction)__pyx_pw_8PyClical_37max_abs, METH_O, __pyx_doc_8PyClical_36max_abs},
19137 {
"pow", (PyCFunction)__pyx_pw_8PyClical_39pow, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_38pow},
19138 {
"outer_pow", (PyCFunction)__pyx_pw_8PyClical_41outer_pow, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_40outer_pow},
19139 {
"complexifier", (PyCFunction)__pyx_pw_8PyClical_43complexifier, METH_O, __pyx_doc_8PyClical_42complexifier},
19140 {
"sqrt", (PyCFunction)__pyx_pw_8PyClical_45sqrt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_44sqrt},
19141 {
"exp", (PyCFunction)__pyx_pw_8PyClical_47exp, METH_O, __pyx_doc_8PyClical_46exp},
19142 {
"log", (PyCFunction)__pyx_pw_8PyClical_49log, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_48log},
19143 {
"cos", (PyCFunction)__pyx_pw_8PyClical_51cos, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_50cos},
19144 {
"acos", (PyCFunction)__pyx_pw_8PyClical_53acos, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_52acos},
19145 {
"cosh", (PyCFunction)__pyx_pw_8PyClical_55cosh, METH_O, __pyx_doc_8PyClical_54cosh},
19146 {
"acosh", (PyCFunction)__pyx_pw_8PyClical_57acosh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_56acosh},
19147 {
"sin", (PyCFunction)__pyx_pw_8PyClical_59sin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_58sin},
19148 {
"asin", (PyCFunction)__pyx_pw_8PyClical_61asin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_60asin},
19149 {
"sinh", (PyCFunction)__pyx_pw_8PyClical_63sinh, METH_O, __pyx_doc_8PyClical_62sinh},
19150 {
"asinh", (PyCFunction)__pyx_pw_8PyClical_65asinh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_64asinh},
19151 {
"tan", (PyCFunction)__pyx_pw_8PyClical_67tan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_66tan},
19152 {
"atan", (PyCFunction)__pyx_pw_8PyClical_69atan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_68atan},
19153 {
"tanh", (PyCFunction)__pyx_pw_8PyClical_71tanh, METH_O, __pyx_doc_8PyClical_70tanh},
19154 {
"atanh", (PyCFunction)__pyx_pw_8PyClical_73atanh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_72atanh},
19155 {
"random_clifford", (PyCFunction)__pyx_pw_8PyClical_75random_clifford, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_74random_clifford},
19156 {
"cga3", (PyCFunction)__pyx_pw_8PyClical_77cga3, METH_O, __pyx_doc_8PyClical_76cga3},
19157 {
"cga3std", (PyCFunction)__pyx_pw_8PyClical_79cga3std, METH_O, __pyx_doc_8PyClical_78cga3std},
19158 {
"agc3", (PyCFunction)__pyx_pw_8PyClical_81agc3, METH_O, __pyx_doc_8PyClical_80agc3},
19162 #if PY_MAJOR_VERSION >= 3 19163 #if CYTHON_PEP489_MULTI_PHASE_INIT 19164 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
19165 static int __pyx_pymod_exec_PyClical(PyObject* module);
19166 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
19167 {Py_mod_create, (
void*)__pyx_pymod_create},
19168 {Py_mod_exec, (
void*)__pyx_pymod_exec_PyClical},
19173 static struct PyModuleDef __pyx_moduledef = {
19174 PyModuleDef_HEAD_INIT,
19177 #if CYTHON_PEP489_MULTI_PHASE_INIT 19183 #if CYTHON_PEP489_MULTI_PHASE_INIT 19184 __pyx_moduledef_slots,
19194 static __Pyx_StringTabEntry __pyx_string_tab[] = {
19195 {&__pyx_kp_s_, __pyx_k_,
sizeof(__pyx_k_), 0, 0, 1, 0},
19196 {&__pyx_kp_s_0_8_2, __pyx_k_0_8_2,
sizeof(__pyx_k_0_8_2), 0, 0, 1, 0},
19197 {&__pyx_kp_u_Abbreviation_for_clifford_index, __pyx_k_Abbreviation_for_clifford_index,
sizeof(__pyx_k_Abbreviation_for_clifford_index), 0, 1, 0, 0},
19198 {&__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},
19199 {&__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},
19200 {&__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},
19201 {&__pyx_kp_s_Cannot_initialize_clifford_objec, __pyx_k_Cannot_initialize_clifford_objec,
sizeof(__pyx_k_Cannot_initialize_clifford_objec), 0, 0, 1, 0},
19202 {&__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},
19203 {&__pyx_kp_s_Cannot_reframe, __pyx_k_Cannot_reframe,
sizeof(__pyx_k_Cannot_reframe), 0, 0, 1, 0},
19204 {&__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},
19205 {&__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},
19206 {&__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},
19207 {&__pyx_kp_u_Conjugation_reverse_o_involute, __pyx_k_Conjugation_reverse_o_involute,
sizeof(__pyx_k_Conjugation_reverse_o_involute), 0, 1, 0, 0},
19208 {&__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},
19209 {&__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},
19210 {&__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},
19211 {&__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},
19212 {&__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},
19213 {&__pyx_kp_u_Convert_Euclidean_3D_multivecto, __pyx_k_Convert_Euclidean_3D_multivecto,
sizeof(__pyx_k_Convert_Euclidean_3D_multivecto), 0, 1, 0, 0},
19214 {&__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},
19215 {&__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},
19216 {&__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},
19217 {&__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},
19218 {&__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},
19219 {&__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},
19220 {&__pyx_kp_u_Geometric_difference_print_clif, __pyx_k_Geometric_difference_print_clif,
sizeof(__pyx_k_Geometric_difference_print_clif), 0, 1, 0, 0},
19221 {&__pyx_kp_u_Geometric_difference_x_clifford, __pyx_k_Geometric_difference_x_clifford,
sizeof(__pyx_k_Geometric_difference_x_clifford), 0, 1, 0, 0},
19222 {&__pyx_kp_u_Geometric_multiplicative_invers, __pyx_k_Geometric_multiplicative_invers,
sizeof(__pyx_k_Geometric_multiplicative_invers), 0, 1, 0, 0},
19223 {&__pyx_kp_u_Geometric_multiplicative_invers_2, __pyx_k_Geometric_multiplicative_invers_2,
sizeof(__pyx_k_Geometric_multiplicative_invers_2), 0, 1, 0, 0},
19224 {&__pyx_kp_u_Geometric_product_print_cliffor, __pyx_k_Geometric_product_print_cliffor,
sizeof(__pyx_k_Geometric_product_print_cliffor), 0, 1, 0, 0},
19225 {&__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},
19226 {&__pyx_kp_u_Geometric_quotient_print_cliffo, __pyx_k_Geometric_quotient_print_cliffo,
sizeof(__pyx_k_Geometric_quotient_print_cliffo), 0, 1, 0, 0},
19227 {&__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},
19228 {&__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},
19229 {&__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},
19230 {&__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},
19231 {&__pyx_kp_u_Hyperbolic_cosine_of_multivecto, __pyx_k_Hyperbolic_cosine_of_multivecto,
sizeof(__pyx_k_Hyperbolic_cosine_of_multivecto), 0, 1, 0, 0},
19232 {&__pyx_kp_u_Hyperbolic_sine_of_multivector, __pyx_k_Hyperbolic_sine_of_multivector,
sizeof(__pyx_k_Hyperbolic_sine_of_multivector), 0, 1, 0, 0},
19233 {&__pyx_kp_u_Hyperbolic_tangent_of_multivect, __pyx_k_Hyperbolic_tangent_of_multivect,
sizeof(__pyx_k_Hyperbolic_tangent_of_multivect), 0, 1, 0, 0},
19234 {&__pyx_kp_u_Imaginary_part_deprecated_alway, __pyx_k_Imaginary_part_deprecated_alway,
sizeof(__pyx_k_Imaginary_part_deprecated_alway), 0, 1, 0, 0},
19235 {&__pyx_n_s_IndexError, __pyx_k_IndexError,
sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
19236 {&__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},
19237 {&__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},
19238 {&__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},
19239 {&__pyx_n_s_Integral, __pyx_k_Integral,
sizeof(__pyx_k_Integral), 0, 0, 1, 1},
19240 {&__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},
19241 {&__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},
19242 {&__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},
19243 {&__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},
19244 {&__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},
19245 {&__pyx_kp_u_Inverse_tangent_of_multivector, __pyx_k_Inverse_tangent_of_multivector,
sizeof(__pyx_k_Inverse_tangent_of_multivector), 0, 1, 0, 0},
19246 {&__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},
19247 {&__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},
19248 {&__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},
19249 {&__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},
19250 {&__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},
19251 {&__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},
19252 {&__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},
19253 {&__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},
19254 {&__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},
19255 {&__pyx_kp_u_Natural_logarithm_of_multivecto, __pyx_k_Natural_logarithm_of_multivecto,
sizeof(__pyx_k_Natural_logarithm_of_multivecto), 0, 1, 0, 0},
19256 {&__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},
19257 {&__pyx_n_s_NotImplemented, __pyx_k_NotImplemented,
sizeof(__pyx_k_NotImplemented), 0, 0, 1, 1},
19258 {&__pyx_kp_s_Not_applicable, __pyx_k_Not_applicable,
sizeof(__pyx_k_Not_applicable), 0, 0, 1, 0},
19259 {&__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},
19260 {&__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},
19261 {&__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},
19262 {&__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},
19263 {&__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},
19264 {&__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},
19265 {&__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},
19266 {&__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},
19267 {&__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},
19268 {&__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},
19269 {&__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},
19270 {&__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},
19271 {&__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},
19272 {&__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},
19273 {&__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},
19274 {&__pyx_n_s_PyClical, __pyx_k_PyClical,
sizeof(__pyx_k_PyClical), 0, 0, 1, 1},
19275 {&__pyx_kp_s_PyClical_pyx, __pyx_k_PyClical_pyx,
sizeof(__pyx_k_PyClical_pyx), 0, 0, 1, 0},
19276 {&__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},
19277 {&__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},
19278 {&__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},
19279 {&__pyx_n_s_Real, __pyx_k_Real,
sizeof(__pyx_k_Real), 0, 0, 1, 1},
19280 {&__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},
19281 {&__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},
19282 {&__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},
19283 {&__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},
19284 {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError,
sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
19285 {&__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},
19286 {&__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},
19287 {&__pyx_n_s_Sequence, __pyx_k_Sequence,
sizeof(__pyx_k_Sequence), 0, 0, 1, 1},
19288 {&__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},
19289 {&__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},
19290 {&__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},
19291 {&__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},
19292 {&__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},
19293 {&__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},
19294 {&__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},
19295 {&__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},
19296 {&__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},
19297 {&__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},
19298 {&__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},
19299 {&__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},
19300 {&__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},
19301 {&__pyx_kp_u_Symmetric_set_difference_exclus, __pyx_k_Symmetric_set_difference_exclus,
sizeof(__pyx_k_Symmetric_set_difference_exclus), 0, 1, 0, 0},
19302 {&__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},
19303 {&__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},
19304 {&__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},
19305 {&__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},
19306 {&__pyx_kp_u_The_informal_string_representat, __pyx_k_The_informal_string_representat,
sizeof(__pyx_k_The_informal_string_representat), 0, 1, 0, 0},
19307 {&__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},
19308 {&__pyx_kp_u_The_official_string_representat, __pyx_k_The_official_string_representat,
sizeof(__pyx_k_The_official_string_representat), 0, 1, 0, 0},
19309 {&__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},
19310 {&__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},
19311 {&__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},
19312 {&__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},
19313 {&__pyx_n_s_TypeError, __pyx_k_TypeError,
sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
19314 {&__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},
19315 {&__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},
19316 {&__pyx_n_s_ValueError, __pyx_k_ValueError,
sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
19317 {&__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},
19318 {&__pyx_kp_s__2, __pyx_k__2,
sizeof(__pyx_k__2), 0, 0, 1, 0},
19319 {&__pyx_kp_s__5, __pyx_k__5,
sizeof(__pyx_k__5), 0, 0, 1, 0},
19320 {&__pyx_kp_s__6, __pyx_k__6,
sizeof(__pyx_k__6), 0, 0, 1, 0},
19321 {&__pyx_kp_s__7, __pyx_k__7,
sizeof(__pyx_k__7), 0, 0, 1, 0},
19322 {&__pyx_kp_s__8, __pyx_k__8,
sizeof(__pyx_k__8), 0, 0, 1, 0},
19323 {&__pyx_kp_s__9, __pyx_k__9,
sizeof(__pyx_k__9), 0, 0, 1, 0},
19324 {&__pyx_kp_u_abs_line_1473, __pyx_k_abs_line_1473,
sizeof(__pyx_k_abs_line_1473), 0, 1, 0, 0},
19325 {&__pyx_n_s_acos, __pyx_k_acos,
sizeof(__pyx_k_acos), 0, 0, 1, 1},
19326 {&__pyx_kp_u_acos_line_1619, __pyx_k_acos_line_1619,
sizeof(__pyx_k_acos_line_1619), 0, 1, 0, 0},
19327 {&__pyx_n_s_acosh, __pyx_k_acosh,
sizeof(__pyx_k_acosh), 0, 0, 1, 1},
19328 {&__pyx_kp_u_acosh_line_1656, __pyx_k_acosh_line_1656,
sizeof(__pyx_k_acosh_line_1656), 0, 1, 0, 0},
19329 {&__pyx_kp_u_agc3_line_1844, __pyx_k_agc3_line_1844,
sizeof(__pyx_k_agc3_line_1844), 0, 1, 0, 0},
19330 {&__pyx_n_s_args, __pyx_k_args,
sizeof(__pyx_k_args), 0, 0, 1, 1},
19331 {&__pyx_kp_s_as_frame, __pyx_k_as_frame,
sizeof(__pyx_k_as_frame), 0, 0, 1, 0},
19332 {&__pyx_n_s_asin, __pyx_k_asin,
sizeof(__pyx_k_asin), 0, 0, 1, 1},
19333 {&__pyx_kp_u_asin_line_1698, __pyx_k_asin_line_1698,
sizeof(__pyx_k_asin_line_1698), 0, 1, 0, 0},
19334 {&__pyx_n_s_asinh, __pyx_k_asinh,
sizeof(__pyx_k_asinh), 0, 0, 1, 1},
19335 {&__pyx_kp_u_asinh_line_1733, __pyx_k_asinh_line_1733,
sizeof(__pyx_k_asinh_line_1733), 0, 1, 0, 0},
19336 {&__pyx_n_s_atan, __pyx_k_atan,
sizeof(__pyx_k_atan), 0, 0, 1, 1},
19337 {&__pyx_kp_u_atan_line_1769, __pyx_k_atan_line_1769,
sizeof(__pyx_k_atan_line_1769), 0, 1, 0, 0},
19338 {&__pyx_n_s_atanh, __pyx_k_atanh,
sizeof(__pyx_k_atanh), 0, 0, 1, 1},
19339 {&__pyx_kp_u_atanh_line_1798, __pyx_k_atanh_line_1798,
sizeof(__pyx_k_atanh_line_1798), 0, 1, 0, 0},
19340 {&__pyx_kp_u_cga3_line_1824, __pyx_k_cga3_line_1824,
sizeof(__pyx_k_cga3_line_1824), 0, 1, 0, 0},
19341 {&__pyx_kp_u_cga3std_line_1833, __pyx_k_cga3std_line_1833,
sizeof(__pyx_k_cga3std_line_1833), 0, 1, 0, 0},
19342 {&__pyx_n_s_cl, __pyx_k_cl,
sizeof(__pyx_k_cl), 0, 0, 1, 1},
19343 {&__pyx_kp_u_clifford___add___line_739, __pyx_k_clifford___add___line_739,
sizeof(__pyx_k_clifford___add___line_739), 0, 1, 0, 0},
19344 {&__pyx_kp_u_clifford___and___line_835, __pyx_k_clifford___and___line_835,
sizeof(__pyx_k_clifford___and___line_835), 0, 1, 0, 0},
19345 {&__pyx_kp_u_clifford___call___line_1019, __pyx_k_clifford___call___line_1019,
sizeof(__pyx_k_clifford___call___line_1019), 0, 1, 0, 0},
19346 {&__pyx_kp_u_clifford___div___line_895, __pyx_k_clifford___div___line_895,
sizeof(__pyx_k_clifford___div___line_895), 0, 1, 0, 0},
19347 {&__pyx_kp_u_clifford___getitem___line_706, __pyx_k_clifford___getitem___line_706,
sizeof(__pyx_k_clifford___getitem___line_706), 0, 1, 0, 0},
19348 {&__pyx_kp_u_clifford___iadd___line_750, __pyx_k_clifford___iadd___line_750,
sizeof(__pyx_k_clifford___iadd___line_750), 0, 1, 0, 0},
19349 {&__pyx_kp_u_clifford___iand___line_850, __pyx_k_clifford___iand___line_850,
sizeof(__pyx_k_clifford___iand___line_850), 0, 1, 0, 0},
19350 {&__pyx_kp_u_clifford___idiv___line_910, __pyx_k_clifford___idiv___line_910,
sizeof(__pyx_k_clifford___idiv___line_910), 0, 1, 0, 0},
19351 {&__pyx_kp_u_clifford___imod___line_820, __pyx_k_clifford___imod___line_820,
sizeof(__pyx_k_clifford___imod___line_820), 0, 1, 0, 0},
19352 {&__pyx_kp_u_clifford___imul___line_792, __pyx_k_clifford___imul___line_792,
sizeof(__pyx_k_clifford___imul___line_792), 0, 1, 0, 0},
19353 {&__pyx_kp_u_clifford___ior___line_949, __pyx_k_clifford___ior___line_949,
sizeof(__pyx_k_clifford___ior___line_949), 0, 1, 0, 0},
19354 {&__pyx_kp_u_clifford___isub___line_770, __pyx_k_clifford___isub___line_770,
sizeof(__pyx_k_clifford___isub___line_770), 0, 1, 0, 0},
19355 {&__pyx_kp_u_clifford___iter___line_637, __pyx_k_clifford___iter___line_637,
sizeof(__pyx_k_clifford___iter___line_637), 0, 1, 0, 0},
19356 {&__pyx_kp_u_clifford___ixor___line_880, __pyx_k_clifford___ixor___line_880,
sizeof(__pyx_k_clifford___ixor___line_880), 0, 1, 0, 0},
19357 {&__pyx_kp_u_clifford___mod___line_805, __pyx_k_clifford___mod___line_805,
sizeof(__pyx_k_clifford___mod___line_805), 0, 1, 0, 0},
19358 {&__pyx_kp_u_clifford___mul___line_779, __pyx_k_clifford___mul___line_779,
sizeof(__pyx_k_clifford___mul___line_779), 0, 1, 0, 0},
19359 {&__pyx_kp_u_clifford___neg___line_721, __pyx_k_clifford___neg___line_721,
sizeof(__pyx_k_clifford___neg___line_721), 0, 1, 0, 0},
19360 {&__pyx_kp_u_clifford___or___line_938, __pyx_k_clifford___or___line_938,
sizeof(__pyx_k_clifford___or___line_938), 0, 1, 0, 0},
19361 {&__pyx_kp_u_clifford___pos___line_730, __pyx_k_clifford___pos___line_730,
sizeof(__pyx_k_clifford___pos___line_730), 0, 1, 0, 0},
19362 {&__pyx_kp_u_clifford___pow___line_960, __pyx_k_clifford___pow___line_960,
sizeof(__pyx_k_clifford___pow___line_960), 0, 1, 0, 0},
19363 {&__pyx_kp_u_clifford___repr___line_1225, __pyx_k_clifford___repr___line_1225,
sizeof(__pyx_k_clifford___repr___line_1225), 0, 1, 0, 0},
19364 {&__pyx_kp_u_clifford___str___line_1234, __pyx_k_clifford___str___line_1234,
sizeof(__pyx_k_clifford___str___line_1234), 0, 1, 0, 0},
19365 {&__pyx_kp_u_clifford___sub___line_759, __pyx_k_clifford___sub___line_759,
sizeof(__pyx_k_clifford___sub___line_759), 0, 1, 0, 0},
19366 {&__pyx_kp_u_clifford___xor___line_865, __pyx_k_clifford___xor___line_865,
sizeof(__pyx_k_clifford___xor___line_865), 0, 1, 0, 0},
19367 {&__pyx_kp_u_clifford_abs_line_1174, __pyx_k_clifford_abs_line_1174,
sizeof(__pyx_k_clifford_abs_line_1174), 0, 1, 0, 0},
19368 {&__pyx_kp_u_clifford_conj_line_1137, __pyx_k_clifford_conj_line_1137,
sizeof(__pyx_k_clifford_conj_line_1137), 0, 1, 0, 0},
19369 {&__pyx_kp_u_clifford_copy_line_554, __pyx_k_clifford_copy_line_554,
sizeof(__pyx_k_clifford_copy_line_554), 0, 1, 0, 0},
19370 {&__pyx_kp_u_clifford_even_line_1060, __pyx_k_clifford_even_line_1060,
sizeof(__pyx_k_clifford_even_line_1060), 0, 1, 0, 0},
19371 {&__pyx_kp_u_clifford_frame_line_1214, __pyx_k_clifford_frame_line_1214,
sizeof(__pyx_k_clifford_frame_line_1214), 0, 1, 0, 0},
19372 {&__pyx_n_s_clifford_hidden_doctests, __pyx_k_clifford_hidden_doctests,
sizeof(__pyx_k_clifford_hidden_doctests), 0, 0, 1, 1},
19373 {&__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},
19374 {&__pyx_kp_u_clifford_inv_line_925, __pyx_k_clifford_inv_line_925,
sizeof(__pyx_k_clifford_inv_line_925), 0, 1, 0, 0},
19375 {&__pyx_kp_u_clifford_involute_line_1106, __pyx_k_clifford_involute_line_1106,
sizeof(__pyx_k_clifford_involute_line_1106), 0, 1, 0, 0},
19376 {&__pyx_kp_u_clifford_isnan_line_1205, __pyx_k_clifford_isnan_line_1205,
sizeof(__pyx_k_clifford_isnan_line_1205), 0, 1, 0, 0},
19377 {&__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},
19378 {&__pyx_kp_u_clifford_norm_line_1163, __pyx_k_clifford_norm_line_1163,
sizeof(__pyx_k_clifford_norm_line_1163), 0, 1, 0, 0},
19379 {&__pyx_kp_u_clifford_odd_line_1069, __pyx_k_clifford_odd_line_1069,
sizeof(__pyx_k_clifford_odd_line_1069), 0, 1, 0, 0},
19380 {&__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},
19381 {&__pyx_kp_u_clifford_pow_line_979, __pyx_k_clifford_pow_line_979,
sizeof(__pyx_k_clifford_pow_line_979), 0, 1, 0, 0},
19382 {&__pyx_kp_u_clifford_pure_line_1049, __pyx_k_clifford_pure_line_1049,
sizeof(__pyx_k_clifford_pure_line_1049), 0, 1, 0, 0},
19383 {&__pyx_kp_u_clifford_quad_line_1152, __pyx_k_clifford_quad_line_1152,
sizeof(__pyx_k_clifford_quad_line_1152), 0, 1, 0, 0},
19384 {&__pyx_kp_u_clifford_reframe_line_648, __pyx_k_clifford_reframe_line_648,
sizeof(__pyx_k_clifford_reframe_line_648), 0, 1, 0, 0},
19385 {&__pyx_kp_u_clifford_reverse_line_1122, __pyx_k_clifford_reverse_line_1122,
sizeof(__pyx_k_clifford_reverse_line_1122), 0, 1, 0, 0},
19386 {&__pyx_kp_u_clifford_scalar_line_1038, __pyx_k_clifford_scalar_line_1038,
sizeof(__pyx_k_clifford_scalar_line_1038), 0, 1, 0, 0},
19387 {&__pyx_kp_u_clifford_truncated_line_1194, __pyx_k_clifford_truncated_line_1194,
sizeof(__pyx_k_clifford_truncated_line_1194), 0, 1, 0, 0},
19388 {&__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},
19389 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback,
sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
19390 {&__pyx_n_s_close, __pyx_k_close,
sizeof(__pyx_k_close), 0, 0, 1, 1},
19391 {&__pyx_n_s_collections, __pyx_k_collections,
sizeof(__pyx_k_collections), 0, 0, 1, 1},
19392 {&__pyx_kp_u_compare_line_490, __pyx_k_compare_line_490,
sizeof(__pyx_k_compare_line_490), 0, 1, 0, 0},
19393 {&__pyx_kp_u_complexifier_line_1527, __pyx_k_complexifier_line_1527,
sizeof(__pyx_k_complexifier_line_1527), 0, 1, 0, 0},
19394 {&__pyx_n_s_conj, __pyx_k_conj,
sizeof(__pyx_k_conj), 0, 0, 1, 1},
19395 {&__pyx_kp_u_conj_line_1436, __pyx_k_conj_line_1436,
sizeof(__pyx_k_conj_line_1436), 0, 1, 0, 0},
19396 {&__pyx_n_s_copy, __pyx_k_copy,
sizeof(__pyx_k_copy), 0, 0, 1, 1},
19397 {&__pyx_n_s_cos, __pyx_k_cos,
sizeof(__pyx_k_cos), 0, 0, 1, 1},
19398 {&__pyx_kp_u_cos_line_1602, __pyx_k_cos_line_1602,
sizeof(__pyx_k_cos_line_1602), 0, 1, 0, 0},
19399 {&__pyx_n_s_cosh, __pyx_k_cosh,
sizeof(__pyx_k_cosh), 0, 0, 1, 1},
19400 {&__pyx_kp_u_cosh_line_1640, __pyx_k_cosh_line_1640,
sizeof(__pyx_k_cosh_line_1640), 0, 1, 0, 0},
19401 {&__pyx_n_s_doctest, __pyx_k_doctest,
sizeof(__pyx_k_doctest), 0, 0, 1, 1},
19402 {&__pyx_n_s_e, __pyx_k_e,
sizeof(__pyx_k_e), 0, 0, 1, 1},
19403 {&__pyx_kp_u_e_line_1887, __pyx_k_e_line_1887,
sizeof(__pyx_k_e_line_1887), 0, 1, 0, 0},
19404 {&__pyx_n_s_even, __pyx_k_even,
sizeof(__pyx_k_even), 0, 0, 1, 1},
19405 {&__pyx_kp_u_even_line_1388, __pyx_k_even_line_1388,
sizeof(__pyx_k_even_line_1388), 0, 1, 0, 0},
19406 {&__pyx_n_s_exp, __pyx_k_exp,
sizeof(__pyx_k_exp), 0, 0, 1, 1},
19407 {&__pyx_kp_u_exp_line_1565, __pyx_k_exp_line_1565,
sizeof(__pyx_k_exp_line_1565), 0, 1, 0, 0},
19408 {&__pyx_n_s_fill, __pyx_k_fill,
sizeof(__pyx_k_fill), 0, 0, 1, 1},
19409 {&__pyx_n_s_frm, __pyx_k_frm,
sizeof(__pyx_k_frm), 0, 0, 1, 1},
19410 {&__pyx_kp_s_from, __pyx_k_from,
sizeof(__pyx_k_from), 0, 0, 1, 0},
19411 {&__pyx_n_s_getstate, __pyx_k_getstate,
sizeof(__pyx_k_getstate), 0, 0, 1, 1},
19412 {&__pyx_n_s_grade, __pyx_k_grade,
sizeof(__pyx_k_grade), 0, 0, 1, 1},
19413 {&__pyx_n_s_i, __pyx_k_i,
sizeof(__pyx_k_i), 0, 0, 1, 1},
19414 {&__pyx_kp_u_imag_line_1366, __pyx_k_imag_line_1366,
sizeof(__pyx_k_imag_line_1366), 0, 1, 0, 0},
19415 {&__pyx_n_s_import, __pyx_k_import,
sizeof(__pyx_k_import), 0, 0, 1, 1},
19416 {&__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},
19417 {&__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},
19418 {&__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},
19419 {&__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},
19420 {&__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},
19421 {&__pyx_n_s_index_set___iter, __pyx_k_index_set___iter,
sizeof(__pyx_k_index_set___iter), 0, 0, 1, 1},
19422 {&__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},
19423 {&__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},
19424 {&__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},
19425 {&__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},
19426 {&__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},
19427 {&__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},
19428 {&__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},
19429 {&__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},
19430 {&__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},
19431 {&__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},
19432 {&__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},
19433 {&__pyx_n_s_index_set_hidden_doctests, __pyx_k_index_set_hidden_doctests,
sizeof(__pyx_k_index_set_hidden_doctests), 0, 0, 1, 1},
19434 {&__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},
19435 {&__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},
19436 {&__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},
19437 {&__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},
19438 {&__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},
19439 {&__pyx_n_s_inv, __pyx_k_inv,
sizeof(__pyx_k_inv), 0, 0, 1, 1},
19440 {&__pyx_kp_u_inv_line_1329, __pyx_k_inv_line_1329,
sizeof(__pyx_k_inv_line_1329), 0, 1, 0, 0},
19441 {&__pyx_kp_s_invalid, __pyx_k_invalid,
sizeof(__pyx_k_invalid), 0, 0, 1, 0},
19442 {&__pyx_kp_s_invalid_string, __pyx_k_invalid_string,
sizeof(__pyx_k_invalid_string), 0, 0, 1, 0},
19443 {&__pyx_n_s_involute, __pyx_k_involute,
sizeof(__pyx_k_involute), 0, 0, 1, 1},
19444 {&__pyx_kp_u_involute_line_1406, __pyx_k_involute_line_1406,
sizeof(__pyx_k_involute_line_1406), 0, 1, 0, 0},
19445 {&__pyx_n_s_ist, __pyx_k_ist,
sizeof(__pyx_k_ist), 0, 0, 1, 1},
19446 {&__pyx_n_s_istpq, __pyx_k_istpq,
sizeof(__pyx_k_istpq), 0, 0, 1, 1},
19447 {&__pyx_kp_u_istpq_line_1900, __pyx_k_istpq_line_1900,
sizeof(__pyx_k_istpq_line_1900), 0, 1, 0, 0},
19448 {&__pyx_n_s_iter, __pyx_k_iter,
sizeof(__pyx_k_iter), 0, 0, 1, 1},
19449 {&__pyx_n_s_ixt, __pyx_k_ixt,
sizeof(__pyx_k_ixt), 0, 0, 1, 1},
19450 {&__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},
19451 {&__pyx_n_s_lhs, __pyx_k_lhs,
sizeof(__pyx_k_lhs), 0, 0, 1, 1},
19452 {&__pyx_n_s_log, __pyx_k_log,
sizeof(__pyx_k_log), 0, 0, 1, 1},
19453 {&__pyx_kp_u_log_line_1579, __pyx_k_log_line_1579,
sizeof(__pyx_k_log_line_1579), 0, 1, 0, 0},
19454 {&__pyx_n_s_m, __pyx_k_m,
sizeof(__pyx_k_m), 0, 0, 1, 1},
19455 {&__pyx_n_s_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 0, 1, 1},
19456 {&__pyx_n_s_math, __pyx_k_math,
sizeof(__pyx_k_math), 0, 0, 1, 1},
19457 {&__pyx_n_s_max, __pyx_k_max,
sizeof(__pyx_k_max), 0, 0, 1, 1},
19458 {&__pyx_kp_u_max_abs_line_1482, __pyx_k_max_abs_line_1482,
sizeof(__pyx_k_max_abs_line_1482), 0, 1, 0, 0},
19459 {&__pyx_kp_u_max_pos_line_511, __pyx_k_max_pos_line_511,
sizeof(__pyx_k_max_pos_line_511), 0, 1, 0, 0},
19460 {&__pyx_n_s_min, __pyx_k_min,
sizeof(__pyx_k_min), 0, 0, 1, 1},
19461 {&__pyx_kp_u_min_neg_line_502, __pyx_k_min_neg_line_502,
sizeof(__pyx_k_min_neg_line_502), 0, 1, 0, 0},
19462 {&__pyx_n_s_name, __pyx_k_name,
sizeof(__pyx_k_name), 0, 0, 1, 1},
19463 {&__pyx_n_s_nbar3, __pyx_k_nbar3,
sizeof(__pyx_k_nbar3), 0, 0, 1, 1},
19464 {&__pyx_n_s_ninf3, __pyx_k_ninf3,
sizeof(__pyx_k_ninf3), 0, 0, 1, 1},
19465 {&__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},
19466 {&__pyx_n_s_norm, __pyx_k_norm,
sizeof(__pyx_k_norm), 0, 0, 1, 1},
19467 {&__pyx_kp_u_norm_line_1462, __pyx_k_norm_line_1462,
sizeof(__pyx_k_norm_line_1462), 0, 1, 0, 0},
19468 {&__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},
19469 {&__pyx_n_s_numbers, __pyx_k_numbers,
sizeof(__pyx_k_numbers), 0, 0, 1, 1},
19470 {&__pyx_n_s_obj, __pyx_k_obj,
sizeof(__pyx_k_obj), 0, 0, 1, 1},
19471 {&__pyx_n_s_odd, __pyx_k_odd,
sizeof(__pyx_k_odd), 0, 0, 1, 1},
19472 {&__pyx_kp_u_odd_line_1397, __pyx_k_odd_line_1397,
sizeof(__pyx_k_odd_line_1397), 0, 1, 0, 0},
19473 {&__pyx_n_s_other, __pyx_k_other,
sizeof(__pyx_k_other), 0, 0, 1, 1},
19474 {&__pyx_n_s_outer_pow, __pyx_k_outer_pow,
sizeof(__pyx_k_outer_pow), 0, 0, 1, 1},
19475 {&__pyx_kp_u_outer_pow_line_1518, __pyx_k_outer_pow_line_1518,
sizeof(__pyx_k_outer_pow_line_1518), 0, 1, 0, 0},
19476 {&__pyx_n_s_p, __pyx_k_p,
sizeof(__pyx_k_p), 0, 0, 1, 1},
19477 {&__pyx_n_s_pi, __pyx_k_pi,
sizeof(__pyx_k_pi), 0, 0, 1, 1},
19478 {&__pyx_n_s_pow, __pyx_k_pow,
sizeof(__pyx_k_pow), 0, 0, 1, 1},
19479 {&__pyx_kp_u_pow_line_1494, __pyx_k_pow_line_1494,
sizeof(__pyx_k_pow_line_1494), 0, 1, 0, 0},
19480 {&__pyx_n_s_pure, __pyx_k_pure,
sizeof(__pyx_k_pure), 0, 0, 1, 1},
19481 {&__pyx_kp_u_pure_line_1377, __pyx_k_pure_line_1377,
sizeof(__pyx_k_pure_line_1377), 0, 1, 0, 0},
19482 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable,
sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
19483 {&__pyx_n_s_q, __pyx_k_q,
sizeof(__pyx_k_q), 0, 0, 1, 1},
19484 {&__pyx_n_s_quad, __pyx_k_quad,
sizeof(__pyx_k_quad), 0, 0, 1, 1},
19485 {&__pyx_kp_u_quad_line_1451, __pyx_k_quad_line_1451,
sizeof(__pyx_k_quad_line_1451), 0, 1, 0, 0},
19486 {&__pyx_kp_u_random_clifford_line_1815, __pyx_k_random_clifford_line_1815,
sizeof(__pyx_k_random_clifford_line_1815), 0, 1, 0, 0},
19487 {&__pyx_n_s_range, __pyx_k_range,
sizeof(__pyx_k_range), 0, 0, 1, 1},
19488 {&__pyx_kp_u_real_line_1355, __pyx_k_real_line_1355,
sizeof(__pyx_k_real_line_1355), 0, 1, 0, 0},
19489 {&__pyx_n_s_reduce, __pyx_k_reduce,
sizeof(__pyx_k_reduce), 0, 0, 1, 1},
19490 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython,
sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
19491 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex,
sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
19492 {&__pyx_n_s_reverse, __pyx_k_reverse,
sizeof(__pyx_k_reverse), 0, 0, 1, 1},
19493 {&__pyx_kp_u_reverse_line_1421, __pyx_k_reverse_line_1421,
sizeof(__pyx_k_reverse_line_1421), 0, 1, 0, 0},
19494 {&__pyx_n_s_rhs, __pyx_k_rhs,
sizeof(__pyx_k_rhs), 0, 0, 1, 1},
19495 {&__pyx_n_s_scalar, __pyx_k_scalar,
sizeof(__pyx_k_scalar), 0, 0, 1, 1},
19496 {&__pyx_kp_u_scalar_line_1344, __pyx_k_scalar_line_1344,
sizeof(__pyx_k_scalar_line_1344), 0, 1, 0, 0},
19497 {&__pyx_n_s_send, __pyx_k_send,
sizeof(__pyx_k_send), 0, 0, 1, 1},
19498 {&__pyx_n_s_setstate, __pyx_k_setstate,
sizeof(__pyx_k_setstate), 0, 0, 1, 1},
19499 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython,
sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
19500 {&__pyx_n_s_sin, __pyx_k_sin,
sizeof(__pyx_k_sin), 0, 0, 1, 1},
19501 {&__pyx_kp_u_sin_line_1679, __pyx_k_sin_line_1679,
sizeof(__pyx_k_sin_line_1679), 0, 1, 0, 0},
19502 {&__pyx_n_s_sinh, __pyx_k_sinh,
sizeof(__pyx_k_sinh), 0, 0, 1, 1},
19503 {&__pyx_kp_u_sinh_line_1719, __pyx_k_sinh_line_1719,
sizeof(__pyx_k_sinh_line_1719), 0, 1, 0, 0},
19504 {&__pyx_n_s_sqrt, __pyx_k_sqrt,
sizeof(__pyx_k_sqrt), 0, 0, 1, 1},
19505 {&__pyx_kp_u_sqrt_line_1542, __pyx_k_sqrt_line_1542,
sizeof(__pyx_k_sqrt_line_1542), 0, 1, 0, 0},
19506 {&__pyx_n_s_tan, __pyx_k_tan,
sizeof(__pyx_k_tan), 0, 0, 1, 1},
19507 {&__pyx_kp_u_tan_line_1752, __pyx_k_tan_line_1752,
sizeof(__pyx_k_tan_line_1752), 0, 1, 0, 0},
19508 {&__pyx_n_s_tanh, __pyx_k_tanh,
sizeof(__pyx_k_tanh), 0, 0, 1, 1},
19509 {&__pyx_kp_u_tanh_line_1786, __pyx_k_tanh_line_1786,
sizeof(__pyx_k_tanh_line_1786), 0, 1, 0, 0},
19510 {&__pyx_n_s_tau, __pyx_k_tau,
sizeof(__pyx_k_tau), 0, 0, 1, 1},
19511 {&__pyx_n_s_test, __pyx_k_test,
sizeof(__pyx_k_test), 0, 0, 1, 1},
19512 {&__pyx_n_s_test_2, __pyx_k_test_2,
sizeof(__pyx_k_test_2), 0, 0, 1, 1},
19513 {&__pyx_n_s_testmod, __pyx_k_testmod,
sizeof(__pyx_k_testmod), 0, 0, 1, 1},
19514 {&__pyx_n_s_throw, __pyx_k_throw,
sizeof(__pyx_k_throw), 0, 0, 1, 1},
19515 {&__pyx_kp_s_to_frame, __pyx_k_to_frame,
sizeof(__pyx_k_to_frame), 0, 0, 1, 0},
19516 {&__pyx_kp_s_using, __pyx_k_using,
sizeof(__pyx_k_using), 0, 0, 1, 0},
19517 {&__pyx_kp_s_using_invalid, __pyx_k_using_invalid,
sizeof(__pyx_k_using_invalid), 0, 0, 1, 0},
19518 {&__pyx_kp_s_value, __pyx_k_value,
sizeof(__pyx_k_value), 0, 0, 1, 0},
19519 {&__pyx_n_s_version, __pyx_k_version,
sizeof(__pyx_k_version), 0, 0, 1, 1},
19520 {&__pyx_n_s_xrange, __pyx_k_xrange,
sizeof(__pyx_k_xrange), 0, 0, 1, 1},
19521 {0, 0, 0, 0, 0, 0, 0}
19523 static int __Pyx_InitCachedBuiltins(
void) {
19524 __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError);
if (!__pyx_builtin_IndexError) __PYX_ERR(0, 102, __pyx_L1_error)
19525 __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError);
if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 104, __pyx_L1_error)
19526 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError);
if (!__pyx_builtin_TypeError) __PYX_ERR(0, 104, __pyx_L1_error)
19527 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError);
if (!__pyx_builtin_ValueError) __PYX_ERR(0, 105, __pyx_L1_error)
19528 __pyx_builtin_NotImplemented = __Pyx_GetBuiltinName(__pyx_n_s_NotImplemented);
if (!__pyx_builtin_NotImplemented) __PYX_ERR(0, 157, __pyx_L1_error)
19529 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_range) __PYX_ERR(0, 234, __pyx_L1_error)
19530 #if PY_MAJOR_VERSION >= 3 19531 __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_xrange) __PYX_ERR(0, 1098, __pyx_L1_error)
19533 __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange);
if (!__pyx_builtin_xrange) __PYX_ERR(0, 1098, __pyx_L1_error)
19540 static int __Pyx_InitCachedConstants(
void) {
19541 __Pyx_RefNannyDeclarations
19542 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
19550 __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)
19551 __Pyx_GOTREF(__pyx_tuple__3);
19552 __Pyx_GIVEREF(__pyx_tuple__3);
19559 __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)
19560 __Pyx_GOTREF(__pyx_tuple__4);
19561 __Pyx_GIVEREF(__pyx_tuple__4);
19570 __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Not_applicable);
if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 635, __pyx_L1_error)
19571 __Pyx_GOTREF(__pyx_tuple__10);
19572 __Pyx_GIVEREF(__pyx_tuple__10);
19581 __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Not_applicable);
if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 646, __pyx_L1_error)
19582 __Pyx_GOTREF(__pyx_tuple__11);
19583 __Pyx_GIVEREF(__pyx_tuple__11);
19591 __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)
19592 __Pyx_GOTREF(__pyx_tuple__12);
19593 __Pyx_GIVEREF(__pyx_tuple__12);
19600 __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)
19601 __Pyx_GOTREF(__pyx_tuple__13);
19602 __Pyx_GIVEREF(__pyx_tuple__13);
19611 __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)
19620 __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)
19629 __pyx_tuple__16 = PyTuple_Pack(1, __pyx_float_1_0);
if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 1856, __pyx_L1_error)
19630 __Pyx_GOTREF(__pyx_tuple__16);
19631 __Pyx_GIVEREF(__pyx_tuple__16);
19640 __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_obj);
if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 1887, __pyx_L1_error)
19641 __Pyx_GOTREF(__pyx_tuple__17);
19642 __Pyx_GIVEREF(__pyx_tuple__17);
19643 __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)
19652 __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)
19653 __Pyx_GOTREF(__pyx_tuple__19);
19654 __Pyx_GIVEREF(__pyx_tuple__19);
19655 __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)
19664 __pyx_tuple__21 = PyTuple_Pack(1, __pyx_int_4);
if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 1909, __pyx_L1_error)
19665 __Pyx_GOTREF(__pyx_tuple__21);
19666 __Pyx_GIVEREF(__pyx_tuple__21);
19667 __pyx_tuple__22 = PyTuple_Pack(1, __pyx_int_neg_1);
if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 1909, __pyx_L1_error)
19668 __Pyx_GOTREF(__pyx_tuple__22);
19669 __Pyx_GIVEREF(__pyx_tuple__22);
19678 __pyx_tuple__23 = PyTuple_Pack(1, __pyx_int_4);
if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 1910, __pyx_L1_error)
19679 __Pyx_GOTREF(__pyx_tuple__23);
19680 __Pyx_GIVEREF(__pyx_tuple__23);
19681 __pyx_tuple__24 = PyTuple_Pack(1, __pyx_int_neg_1);
if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 1910, __pyx_L1_error)
19682 __Pyx_GOTREF(__pyx_tuple__24);
19683 __Pyx_GIVEREF(__pyx_tuple__24);
19692 __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)
19693 __Pyx_GOTREF(__pyx_tuple__25);
19694 __Pyx_GIVEREF(__pyx_tuple__25);
19695 __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)
19696 __Pyx_RefNannyFinishContext();
19699 __Pyx_RefNannyFinishContext();
19703 static int __Pyx_InitGlobals(
void) {
19704 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
19705 __pyx_float_0_0 =
PyFloat_FromDouble(0.0);
if (unlikely(!__pyx_float_0_0)) __PYX_ERR(0, 1, __pyx_L1_error)
19706 __pyx_float_1_0 =
PyFloat_FromDouble(1.0);
if (unlikely(!__pyx_float_1_0)) __PYX_ERR(0, 1, __pyx_L1_error)
19707 __pyx_float_2_0 =
PyFloat_FromDouble(2.0);
if (unlikely(!__pyx_float_2_0)) __PYX_ERR(0, 1, __pyx_L1_error)
19708 __pyx_float_8_0 =
PyFloat_FromDouble(8.0);
if (unlikely(!__pyx_float_8_0)) __PYX_ERR(0, 1, __pyx_L1_error)
19709 __pyx_int_0 = PyInt_FromLong(0);
if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
19710 __pyx_int_1 = PyInt_FromLong(1);
if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
19711 __pyx_int_4 = PyInt_FromLong(4);
if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error)
19712 __pyx_int_neg_1 = PyInt_FromLong(-1);
if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
19718 static int __Pyx_modinit_global_init_code(
void);
19719 static int __Pyx_modinit_variable_export_code(
void);
19720 static int __Pyx_modinit_function_export_code(
void);
19721 static int __Pyx_modinit_type_init_code(
void);
19722 static int __Pyx_modinit_type_import_code(
void);
19723 static int __Pyx_modinit_variable_import_code(
void);
19724 static int __Pyx_modinit_function_import_code(
void);
19726 static int __Pyx_modinit_global_init_code(
void) {
19727 __Pyx_RefNannyDeclarations
19728 __Pyx_RefNannySetupContext(
"__Pyx_modinit_global_init_code", 0);
19730 __Pyx_RefNannyFinishContext();
19734 static int __Pyx_modinit_variable_export_code(
void) {
19735 __Pyx_RefNannyDeclarations
19736 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_export_code", 0);
19738 __Pyx_RefNannyFinishContext();
19742 static int __Pyx_modinit_function_export_code(
void) {
19743 __Pyx_RefNannyDeclarations
19744 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_export_code", 0);
19746 __Pyx_RefNannyFinishContext();
19750 static int __Pyx_modinit_type_init_code(
void) {
19751 __Pyx_RefNannyDeclarations
19752 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_init_code", 0);
19754 __pyx_vtabptr_8PyClical_index_set = &__pyx_vtable_8PyClical_index_set;
19755 __pyx_vtable_8PyClical_index_set.wrap = (PyObject *(*)(
struct __pyx_obj_8PyClical_index_set *,
IndexSet))__pyx_f_8PyClical_9index_set_wrap;
19756 __pyx_vtable_8PyClical_index_set.unwrap = (
IndexSet (*)(
struct __pyx_obj_8PyClical_index_set *))__pyx_f_8PyClical_9index_set_unwrap;
19757 __pyx_vtable_8PyClical_index_set.copy = (PyObject *(*)(
struct __pyx_obj_8PyClical_index_set *,
int __pyx_skip_dispatch))__pyx_f_8PyClical_9index_set_copy;
19758 if (PyType_Ready(&__pyx_type_8PyClical_index_set) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
19759 __pyx_type_8PyClical_index_set.tp_print = 0;
19760 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)) {
19761 __pyx_type_8PyClical_index_set.tp_getattro = __Pyx_PyObject_GenericGetAttr;
19763 #if CYTHON_COMPILING_IN_CPYTHON 19765 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__setitem__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19766 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19767 __pyx_wrapperbase_8PyClical_9index_set_8__setitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19768 __pyx_wrapperbase_8PyClical_9index_set_8__setitem__.doc = __pyx_doc_8PyClical_9index_set_8__setitem__;
19769 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_8__setitem__;
19773 #if CYTHON_COMPILING_IN_CPYTHON 19775 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__getitem__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19776 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19777 __pyx_wrapperbase_8PyClical_9index_set_10__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19778 __pyx_wrapperbase_8PyClical_9index_set_10__getitem__.doc = __pyx_doc_8PyClical_9index_set_10__getitem__;
19779 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_10__getitem__;
19783 #if CYTHON_COMPILING_IN_CPYTHON 19785 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__contains__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19786 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19787 __pyx_wrapperbase_8PyClical_9index_set_12__contains__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19788 __pyx_wrapperbase_8PyClical_9index_set_12__contains__.doc = __pyx_doc_8PyClical_9index_set_12__contains__;
19789 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_12__contains__;
19793 #if CYTHON_COMPILING_IN_CPYTHON 19795 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__iter__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19796 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19797 __pyx_wrapperbase_8PyClical_9index_set_14__iter__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19798 __pyx_wrapperbase_8PyClical_9index_set_14__iter__.doc = __pyx_doc_8PyClical_9index_set_14__iter__;
19799 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_14__iter__;
19803 #if CYTHON_COMPILING_IN_CPYTHON 19805 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__invert__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19806 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19807 __pyx_wrapperbase_8PyClical_9index_set_17__invert__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19808 __pyx_wrapperbase_8PyClical_9index_set_17__invert__.doc = __pyx_doc_8PyClical_9index_set_17__invert__;
19809 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_17__invert__;
19813 #if CYTHON_COMPILING_IN_CPYTHON 19815 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__xor__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19816 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19817 __pyx_wrapperbase_8PyClical_9index_set_19__xor__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19818 __pyx_wrapperbase_8PyClical_9index_set_19__xor__.doc = __pyx_doc_8PyClical_9index_set_19__xor__;
19819 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_19__xor__;
19823 #if CYTHON_COMPILING_IN_CPYTHON 19825 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__ixor__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19826 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19827 __pyx_wrapperbase_8PyClical_9index_set_21__ixor__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19828 __pyx_wrapperbase_8PyClical_9index_set_21__ixor__.doc = __pyx_doc_8PyClical_9index_set_21__ixor__;
19829 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_21__ixor__;
19833 #if CYTHON_COMPILING_IN_CPYTHON 19835 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__and__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19836 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19837 __pyx_wrapperbase_8PyClical_9index_set_23__and__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19838 __pyx_wrapperbase_8PyClical_9index_set_23__and__.doc = __pyx_doc_8PyClical_9index_set_23__and__;
19839 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_23__and__;
19843 #if CYTHON_COMPILING_IN_CPYTHON 19845 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__iand__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19846 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19847 __pyx_wrapperbase_8PyClical_9index_set_25__iand__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19848 __pyx_wrapperbase_8PyClical_9index_set_25__iand__.doc = __pyx_doc_8PyClical_9index_set_25__iand__;
19849 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_25__iand__;
19853 #if CYTHON_COMPILING_IN_CPYTHON 19855 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__or__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19856 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19857 __pyx_wrapperbase_8PyClical_9index_set_27__or__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19858 __pyx_wrapperbase_8PyClical_9index_set_27__or__.doc = __pyx_doc_8PyClical_9index_set_27__or__;
19859 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_27__or__;
19863 #if CYTHON_COMPILING_IN_CPYTHON 19865 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__ior__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19866 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19867 __pyx_wrapperbase_8PyClical_9index_set_29__ior__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19868 __pyx_wrapperbase_8PyClical_9index_set_29__ior__.doc = __pyx_doc_8PyClical_9index_set_29__ior__;
19869 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_29__ior__;
19873 #if CYTHON_COMPILING_IN_CPYTHON 19875 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__repr__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19876 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19877 __pyx_wrapperbase_8PyClical_9index_set_47__repr__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19878 __pyx_wrapperbase_8PyClical_9index_set_47__repr__.doc = __pyx_doc_8PyClical_9index_set_47__repr__;
19879 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_47__repr__;
19883 #if CYTHON_COMPILING_IN_CPYTHON 19885 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__str__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19886 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19887 __pyx_wrapperbase_8PyClical_9index_set_49__str__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19888 __pyx_wrapperbase_8PyClical_9index_set_49__str__.doc = __pyx_doc_8PyClical_9index_set_49__str__;
19889 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_49__str__;
19893 if (__Pyx_SetVtable(__pyx_type_8PyClical_index_set.tp_dict, __pyx_vtabptr_8PyClical_index_set) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
19894 if (PyObject_SetAttrString(__pyx_m,
"index_set", (PyObject *)&__pyx_type_8PyClical_index_set) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
19895 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8PyClical_index_set) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
19896 __pyx_ptype_8PyClical_index_set = &__pyx_type_8PyClical_index_set;
19897 __pyx_vtabptr_8PyClical_clifford = &__pyx_vtable_8PyClical_clifford;
19898 __pyx_vtable_8PyClical_clifford.wrap = (PyObject *(*)(
struct __pyx_obj_8PyClical_clifford *,
Clifford))__pyx_f_8PyClical_8clifford_wrap;
19899 __pyx_vtable_8PyClical_clifford.unwrap = (
Clifford (*)(
struct __pyx_obj_8PyClical_clifford *))__pyx_f_8PyClical_8clifford_unwrap;
19900 __pyx_vtable_8PyClical_clifford.copy = (PyObject *(*)(
struct __pyx_obj_8PyClical_clifford *,
int __pyx_skip_dispatch))__pyx_f_8PyClical_8clifford_copy;
19901 if (PyType_Ready(&__pyx_type_8PyClical_clifford) < 0) __PYX_ERR(0, 535, __pyx_L1_error)
19902 __pyx_type_8PyClical_clifford.tp_print = 0;
19903 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8PyClical_clifford.tp_dictoffset && __pyx_type_8PyClical_clifford.tp_getattro == PyObject_GenericGetAttr)) {
19904 __pyx_type_8PyClical_clifford.tp_getattro = __Pyx_PyObject_GenericGetAttr;
19906 #if CYTHON_COMPILING_IN_CPYTHON 19908 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__contains__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19909 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19910 __pyx_wrapperbase_8PyClical_8clifford_6__contains__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19911 __pyx_wrapperbase_8PyClical_8clifford_6__contains__.doc = __pyx_doc_8PyClical_8clifford_6__contains__;
19912 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_6__contains__;
19916 #if CYTHON_COMPILING_IN_CPYTHON 19918 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__iter__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19919 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19920 __pyx_wrapperbase_8PyClical_8clifford_8__iter__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19921 __pyx_wrapperbase_8PyClical_8clifford_8__iter__.doc = __pyx_doc_8PyClical_8clifford_8__iter__;
19922 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_8__iter__;
19926 #if CYTHON_COMPILING_IN_CPYTHON 19928 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__getitem__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19929 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19930 __pyx_wrapperbase_8PyClical_8clifford_14__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19931 __pyx_wrapperbase_8PyClical_8clifford_14__getitem__.doc = __pyx_doc_8PyClical_8clifford_14__getitem__;
19932 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_14__getitem__;
19936 #if CYTHON_COMPILING_IN_CPYTHON 19938 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__neg__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19939 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19940 __pyx_wrapperbase_8PyClical_8clifford_16__neg__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19941 __pyx_wrapperbase_8PyClical_8clifford_16__neg__.doc = __pyx_doc_8PyClical_8clifford_16__neg__;
19942 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_16__neg__;
19946 #if CYTHON_COMPILING_IN_CPYTHON 19948 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__pos__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19949 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19950 __pyx_wrapperbase_8PyClical_8clifford_18__pos__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19951 __pyx_wrapperbase_8PyClical_8clifford_18__pos__.doc = __pyx_doc_8PyClical_8clifford_18__pos__;
19952 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_18__pos__;
19956 #if CYTHON_COMPILING_IN_CPYTHON 19958 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__add__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19959 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19960 __pyx_wrapperbase_8PyClical_8clifford_20__add__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19961 __pyx_wrapperbase_8PyClical_8clifford_20__add__.doc = __pyx_doc_8PyClical_8clifford_20__add__;
19962 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_20__add__;
19966 #if CYTHON_COMPILING_IN_CPYTHON 19968 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__iadd__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19969 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19970 __pyx_wrapperbase_8PyClical_8clifford_22__iadd__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19971 __pyx_wrapperbase_8PyClical_8clifford_22__iadd__.doc = __pyx_doc_8PyClical_8clifford_22__iadd__;
19972 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_22__iadd__;
19976 #if CYTHON_COMPILING_IN_CPYTHON 19978 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__sub__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19979 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19980 __pyx_wrapperbase_8PyClical_8clifford_24__sub__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19981 __pyx_wrapperbase_8PyClical_8clifford_24__sub__.doc = __pyx_doc_8PyClical_8clifford_24__sub__;
19982 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_24__sub__;
19986 #if CYTHON_COMPILING_IN_CPYTHON 19988 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__isub__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19989 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19990 __pyx_wrapperbase_8PyClical_8clifford_26__isub__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19991 __pyx_wrapperbase_8PyClical_8clifford_26__isub__.doc = __pyx_doc_8PyClical_8clifford_26__isub__;
19992 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_26__isub__;
19996 #if CYTHON_COMPILING_IN_CPYTHON 19998 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__mul__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19999 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20000 __pyx_wrapperbase_8PyClical_8clifford_28__mul__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20001 __pyx_wrapperbase_8PyClical_8clifford_28__mul__.doc = __pyx_doc_8PyClical_8clifford_28__mul__;
20002 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_28__mul__;
20006 #if CYTHON_COMPILING_IN_CPYTHON 20008 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__imul__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20009 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20010 __pyx_wrapperbase_8PyClical_8clifford_30__imul__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20011 __pyx_wrapperbase_8PyClical_8clifford_30__imul__.doc = __pyx_doc_8PyClical_8clifford_30__imul__;
20012 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_30__imul__;
20016 #if CYTHON_COMPILING_IN_CPYTHON 20018 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__mod__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20019 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20020 __pyx_wrapperbase_8PyClical_8clifford_32__mod__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20021 __pyx_wrapperbase_8PyClical_8clifford_32__mod__.doc = __pyx_doc_8PyClical_8clifford_32__mod__;
20022 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_32__mod__;
20026 #if CYTHON_COMPILING_IN_CPYTHON 20028 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__imod__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20029 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20030 __pyx_wrapperbase_8PyClical_8clifford_34__imod__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20031 __pyx_wrapperbase_8PyClical_8clifford_34__imod__.doc = __pyx_doc_8PyClical_8clifford_34__imod__;
20032 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_34__imod__;
20036 #if CYTHON_COMPILING_IN_CPYTHON 20038 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__and__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20039 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20040 __pyx_wrapperbase_8PyClical_8clifford_36__and__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20041 __pyx_wrapperbase_8PyClical_8clifford_36__and__.doc = __pyx_doc_8PyClical_8clifford_36__and__;
20042 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_36__and__;
20046 #if CYTHON_COMPILING_IN_CPYTHON 20048 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__iand__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20049 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20050 __pyx_wrapperbase_8PyClical_8clifford_38__iand__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20051 __pyx_wrapperbase_8PyClical_8clifford_38__iand__.doc = __pyx_doc_8PyClical_8clifford_38__iand__;
20052 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_38__iand__;
20056 #if CYTHON_COMPILING_IN_CPYTHON 20058 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__xor__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20059 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20060 __pyx_wrapperbase_8PyClical_8clifford_40__xor__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20061 __pyx_wrapperbase_8PyClical_8clifford_40__xor__.doc = __pyx_doc_8PyClical_8clifford_40__xor__;
20062 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_40__xor__;
20066 #if CYTHON_COMPILING_IN_CPYTHON 20068 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__ixor__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20069 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20070 __pyx_wrapperbase_8PyClical_8clifford_42__ixor__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20071 __pyx_wrapperbase_8PyClical_8clifford_42__ixor__.doc = __pyx_doc_8PyClical_8clifford_42__ixor__;
20072 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_42__ixor__;
20076 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 20077 #if CYTHON_COMPILING_IN_CPYTHON 20079 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__div__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20080 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20081 __pyx_wrapperbase_8PyClical_8clifford_44__div__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20082 __pyx_wrapperbase_8PyClical_8clifford_44__div__.doc = __pyx_doc_8PyClical_8clifford_44__div__;
20083 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_44__div__;
20088 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 20089 #if CYTHON_COMPILING_IN_CPYTHON 20091 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__idiv__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20092 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20093 __pyx_wrapperbase_8PyClical_8clifford_46__idiv__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20094 __pyx_wrapperbase_8PyClical_8clifford_46__idiv__.doc = __pyx_doc_8PyClical_8clifford_46__idiv__;
20095 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_46__idiv__;
20100 #if CYTHON_COMPILING_IN_CPYTHON 20102 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__or__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20103 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20104 __pyx_wrapperbase_8PyClical_8clifford_50__or__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20105 __pyx_wrapperbase_8PyClical_8clifford_50__or__.doc = __pyx_doc_8PyClical_8clifford_50__or__;
20106 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_50__or__;
20110 #if CYTHON_COMPILING_IN_CPYTHON 20112 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__ior__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20113 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20114 __pyx_wrapperbase_8PyClical_8clifford_52__ior__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20115 __pyx_wrapperbase_8PyClical_8clifford_52__ior__.doc = __pyx_doc_8PyClical_8clifford_52__ior__;
20116 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_52__ior__;
20120 #if CYTHON_COMPILING_IN_CPYTHON 20122 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__pow__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20123 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20124 __pyx_wrapperbase_8PyClical_8clifford_54__pow__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20125 __pyx_wrapperbase_8PyClical_8clifford_54__pow__.doc = __pyx_doc_8PyClical_8clifford_54__pow__;
20126 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_54__pow__;
20130 #if CYTHON_COMPILING_IN_CPYTHON 20132 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__call__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20133 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20134 __pyx_wrapperbase_8PyClical_8clifford_60__call__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20135 __pyx_wrapperbase_8PyClical_8clifford_60__call__.doc = __pyx_doc_8PyClical_8clifford_60__call__;
20136 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_60__call__;
20140 #if CYTHON_COMPILING_IN_CPYTHON 20142 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__repr__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20143 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20144 __pyx_wrapperbase_8PyClical_8clifford_92__repr__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20145 __pyx_wrapperbase_8PyClical_8clifford_92__repr__.doc = __pyx_doc_8PyClical_8clifford_92__repr__;
20146 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_92__repr__;
20150 #if CYTHON_COMPILING_IN_CPYTHON 20152 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__str__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20153 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20154 __pyx_wrapperbase_8PyClical_8clifford_94__str__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20155 __pyx_wrapperbase_8PyClical_8clifford_94__str__.doc = __pyx_doc_8PyClical_8clifford_94__str__;
20156 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_94__str__;
20160 if (__Pyx_SetVtable(__pyx_type_8PyClical_clifford.tp_dict, __pyx_vtabptr_8PyClical_clifford) < 0) __PYX_ERR(0, 535, __pyx_L1_error)
20161 if (PyObject_SetAttrString(__pyx_m,
"clifford", (PyObject *)&__pyx_type_8PyClical_clifford) < 0) __PYX_ERR(0, 535, __pyx_L1_error)
20162 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8PyClical_clifford) < 0) __PYX_ERR(0, 535, __pyx_L1_error)
20163 __pyx_ptype_8PyClical_clifford = &__pyx_type_8PyClical_clifford;
20164 if (PyType_Ready(&__pyx_type_8PyClical___pyx_scope_struct____iter__) < 0) __PYX_ERR(0, 227, __pyx_L1_error)
20165 __pyx_type_8PyClical___pyx_scope_struct____iter__.tp_print = 0;
20166 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)) {
20167 __pyx_type_8PyClical___pyx_scope_struct____iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
20169 __pyx_ptype_8PyClical___pyx_scope_struct____iter__ = &__pyx_type_8PyClical___pyx_scope_struct____iter__;
20170 __Pyx_RefNannyFinishContext();
20173 __Pyx_RefNannyFinishContext();
20177 static int __Pyx_modinit_type_import_code(
void) {
20178 __Pyx_RefNannyDeclarations
20179 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_import_code", 0);
20181 __Pyx_RefNannyFinishContext();
20185 static int __Pyx_modinit_variable_import_code(
void) {
20186 __Pyx_RefNannyDeclarations
20187 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_import_code", 0);
20189 __Pyx_RefNannyFinishContext();
20193 static int __Pyx_modinit_function_import_code(
void) {
20194 __Pyx_RefNannyDeclarations
20195 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_import_code", 0);
20197 __Pyx_RefNannyFinishContext();
20202 #if PY_MAJOR_VERSION < 3 20203 #ifdef CYTHON_NO_PYINIT_EXPORT 20204 #define __Pyx_PyMODINIT_FUNC void 20206 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC 20209 #ifdef CYTHON_NO_PYINIT_EXPORT 20210 #define __Pyx_PyMODINIT_FUNC PyObject * 20212 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC 20215 #ifndef CYTHON_SMALL_CODE 20216 #if defined(__clang__) 20217 #define CYTHON_SMALL_CODE 20218 #elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4))) 20219 #define CYTHON_SMALL_CODE __attribute__((cold)) 20221 #define CYTHON_SMALL_CODE 20226 #if PY_MAJOR_VERSION < 3 20227 __Pyx_PyMODINIT_FUNC initPyClical(
void) CYTHON_SMALL_CODE;
20228 __Pyx_PyMODINIT_FUNC initPyClical(
void)
20230 __Pyx_PyMODINIT_FUNC PyInit_PyClical(
void) CYTHON_SMALL_CODE;
20231 __Pyx_PyMODINIT_FUNC PyInit_PyClical(
void)
20232 #if CYTHON_PEP489_MULTI_PHASE_INIT 20234 return PyModuleDef_Init(&__pyx_moduledef);
20236 static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict,
const char* from_name,
const char* to_name) {
20237 PyObject *value = PyObject_GetAttrString(spec, from_name);
20239 if (likely(value)) {
20240 result = PyDict_SetItemString(moddict, to_name, value);
20242 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
20249 static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
20250 PyObject *module = NULL, *moddict, *modname;
20252 return __Pyx_NewRef(__pyx_m);
20253 modname = PyObject_GetAttrString(spec,
"name");
20254 if (unlikely(!modname))
goto bad;
20255 module = PyModule_NewObject(modname);
20256 Py_DECREF(modname);
20257 if (unlikely(!module))
goto bad;
20258 moddict = PyModule_GetDict(module);
20259 if (unlikely(!moddict))
goto bad;
20260 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__") < 0))
goto bad;
20261 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__") < 0))
goto bad;
20262 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__") < 0))
goto bad;
20263 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__") < 0))
goto bad;
20266 Py_XDECREF(module);
20271 static int __pyx_pymod_exec_PyClical(PyObject *__pyx_pyinit_module)
20275 PyObject *__pyx_t_1 = NULL;
20276 PyObject *__pyx_t_2 = NULL;
20277 PyObject *__pyx_t_3 = NULL;
20279 __Pyx_RefNannyDeclarations
20280 #if CYTHON_PEP489_MULTI_PHASE_INIT 20281 if (__pyx_m && __pyx_m == __pyx_pyinit_module)
return 0;
20282 #elif PY_MAJOR_VERSION >= 3 20283 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
20285 #if CYTHON_REFNANNY 20286 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
20287 if (!__Pyx_RefNanny) {
20289 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
20290 if (!__Pyx_RefNanny)
20291 Py_FatalError(
"failed to import 'refnanny' module");
20294 __Pyx_RefNannySetupContext(
"__Pyx_PyMODINIT_FUNC PyInit_PyClical(void)", 0);
20295 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20296 __pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
20297 __pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
20298 __pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
20299 #ifdef __Pyx_CyFunction_USED 20300 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20302 #ifdef __Pyx_FusedFunction_USED 20303 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20305 #ifdef __Pyx_Coroutine_USED 20306 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20308 #ifdef __Pyx_Generator_USED 20309 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20311 #ifdef __Pyx_AsyncGen_USED 20312 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20314 #ifdef __Pyx_StopAsyncIteration_USED 20315 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20319 #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS 20321 PyEval_InitThreads();
20325 #if CYTHON_PEP489_MULTI_PHASE_INIT 20326 __pyx_m = __pyx_pyinit_module;
20327 Py_INCREF(__pyx_m);
20329 #if PY_MAJOR_VERSION < 3 20330 __pyx_m = Py_InitModule4(
"PyClical", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
20332 __pyx_m = PyModule_Create(&__pyx_moduledef);
20334 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
20336 __pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
20337 Py_INCREF(__pyx_d);
20338 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
20339 __pyx_cython_runtime = PyImport_AddModule((
char *)
"cython_runtime");
if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
20340 #if CYTHON_COMPILING_IN_PYPY 20341 Py_INCREF(__pyx_b);
20343 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
20345 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20346 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) 20347 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20349 if (__pyx_module_is_main_PyClical) {
20350 if (PyObject_SetAttrString(__pyx_m,
"__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20352 #if PY_MAJOR_VERSION >= 3 20354 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
20355 if (!PyDict_GetItemString(modules,
"PyClical")) {
20356 if (unlikely(PyDict_SetItemString(modules,
"PyClical", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
20361 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20363 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20365 (void)__Pyx_modinit_global_init_code();
20366 (void)__Pyx_modinit_variable_export_code();
20367 (void)__Pyx_modinit_function_export_code();
20368 if (unlikely(__Pyx_modinit_type_init_code() != 0))
goto __pyx_L1_error;
20369 (void)__Pyx_modinit_type_import_code();
20370 (void)__Pyx_modinit_variable_import_code();
20371 (void)__Pyx_modinit_function_import_code();
20373 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) 20374 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20384 __pyx_t_1 = __Pyx_Import(__pyx_n_s_math, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
20385 __Pyx_GOTREF(__pyx_t_1);
20386 if (PyDict_SetItem(__pyx_d, __pyx_n_s_math, __pyx_t_1) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
20387 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20396 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numbers, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
20397 __Pyx_GOTREF(__pyx_t_1);
20398 if (PyDict_SetItem(__pyx_d, __pyx_n_s_numbers, __pyx_t_1) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
20399 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20408 __pyx_t_1 = __Pyx_Import(__pyx_n_s_collections, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error)
20409 __Pyx_GOTREF(__pyx_t_1);
20410 if (PyDict_SetItem(__pyx_d, __pyx_n_s_collections, __pyx_t_1) < 0) __PYX_ERR(0, 30, __pyx_L1_error)
20411 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20420 if (PyDict_SetItem(__pyx_d, __pyx_n_s_version, __pyx_kp_s_0_8_2) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
20429 __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)
20430 __Pyx_GOTREF(__pyx_t_1);
20431 if (PyDict_SetItem(__pyx_d, __pyx_n_s_index_set_hidden_doctests, __pyx_t_1) < 0) __PYX_ERR(0, 404, __pyx_L1_error)
20432 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20441 __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)
20442 __Pyx_GOTREF(__pyx_t_1);
20443 if (PyDict_SetItem(__pyx_d, __pyx_n_s_clifford_hidden_doctests, __pyx_t_1) < 0) __PYX_ERR(0, 1243, __pyx_L1_error)
20444 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20453 __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)
20454 __Pyx_GOTREF(__pyx_t_1);
20455 __pyx_t_2 = __pyx_f_8PyClical_atan(__pyx_t_1, 0, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1856, __pyx_L1_error)
20456 __Pyx_GOTREF(__pyx_t_2);
20457 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20458 __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_float_8_0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1856, __pyx_L1_error)
20459 __Pyx_GOTREF(__pyx_t_1);
20460 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20461 if (PyDict_SetItem(__pyx_d, __pyx_n_s_tau, __pyx_t_1) < 0) __PYX_ERR(0, 1856, __pyx_L1_error)
20462 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20471 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_tau);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1857, __pyx_L1_error)
20472 __Pyx_GOTREF(__pyx_t_1);
20473 __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)
20474 __Pyx_GOTREF(__pyx_t_2);
20475 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20476 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pi, __pyx_t_2) < 0) __PYX_ERR(0, 1857, __pyx_L1_error)
20477 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20486 if (PyDict_SetItem(__pyx_d, __pyx_n_s_cl, ((PyObject *)__pyx_ptype_8PyClical_clifford)) < 0) __PYX_ERR(0, 1859, __pyx_L1_error)
20495 if (PyDict_SetItem(__pyx_d, __pyx_n_s_ist, ((PyObject *)__pyx_ptype_8PyClical_index_set)) < 0) __PYX_ERR(0, 1879, __pyx_L1_error)
20504 __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)
20505 __Pyx_GOTREF(__pyx_t_2);
20506 if (PyDict_SetItem(__pyx_d, __pyx_n_s_e, __pyx_t_2) < 0) __PYX_ERR(0, 1887, __pyx_L1_error)
20507 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20516 __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)
20517 __Pyx_GOTREF(__pyx_t_2);
20518 if (PyDict_SetItem(__pyx_d, __pyx_n_s_istpq, __pyx_t_2) < 0) __PYX_ERR(0, 1900, __pyx_L1_error)
20519 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20528 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_e);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1909, __pyx_L1_error)
20529 __Pyx_GOTREF(__pyx_t_2);
20530 __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)
20531 __Pyx_GOTREF(__pyx_t_1);
20532 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20533 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_e);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1909, __pyx_L1_error)
20534 __Pyx_GOTREF(__pyx_t_2);
20535 __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)
20536 __Pyx_GOTREF(__pyx_t_3);
20537 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20538 __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1909, __pyx_L1_error)
20539 __Pyx_GOTREF(__pyx_t_2);
20540 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20541 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20542 if (PyDict_SetItem(__pyx_d, __pyx_n_s_ninf3, __pyx_t_2) < 0) __PYX_ERR(0, 1909, __pyx_L1_error)
20543 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20552 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_e);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1910, __pyx_L1_error)
20553 __Pyx_GOTREF(__pyx_t_2);
20554 __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)
20555 __Pyx_GOTREF(__pyx_t_3);
20556 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20557 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_e);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1910, __pyx_L1_error)
20558 __Pyx_GOTREF(__pyx_t_2);
20559 __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)
20560 __Pyx_GOTREF(__pyx_t_1);
20561 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20562 __pyx_t_2 = PyNumber_Subtract(__pyx_t_3, __pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1910, __pyx_L1_error)
20563 __Pyx_GOTREF(__pyx_t_2);
20564 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20565 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20566 if (PyDict_SetItem(__pyx_d, __pyx_n_s_nbar3, __pyx_t_2) < 0) __PYX_ERR(0, 1910, __pyx_L1_error)
20567 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20576 __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)
20577 __Pyx_GOTREF(__pyx_t_2);
20578 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1913, __pyx_L1_error)
20579 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20587 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1917, __pyx_L1_error)
20588 __Pyx_GOTREF(__pyx_t_2);
20589 __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)
20590 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20598 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_test);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1918, __pyx_L1_error)
20599 __Pyx_GOTREF(__pyx_t_2);
20600 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1918, __pyx_L1_error)
20601 __Pyx_GOTREF(__pyx_t_1);
20602 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20603 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20618 __pyx_t_1 = __Pyx_PyDict_NewPresized(107);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
20619 __Pyx_GOTREF(__pyx_t_1);
20620 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)
20621 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)
20622 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)
20623 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)
20624 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)
20625 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)
20626 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)
20627 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)
20628 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)
20629 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)
20630 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)
20631 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)
20632 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)
20633 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)
20634 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)
20635 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)
20636 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)
20637 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)
20638 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)
20639 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)
20640 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)
20641 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)
20642 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)
20643 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)
20644 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)
20645 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)
20646 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)
20647 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)
20648 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)
20649 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)
20650 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)
20651 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)
20652 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)
20653 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)
20654 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)
20655 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)
20656 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)
20657 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)
20658 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)
20659 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)
20660 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)
20661 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)
20662 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)
20663 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)
20664 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)
20665 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)
20666 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)
20667 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)
20668 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)
20669 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)
20670 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)
20671 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)
20672 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)
20673 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)
20674 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)
20675 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)
20676 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)
20677 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)
20678 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)
20679 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)
20680 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)
20681 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)
20682 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)
20683 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)
20684 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)
20685 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)
20686 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)
20687 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)
20688 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)
20689 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)
20690 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)
20691 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)
20692 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)
20693 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)
20694 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)
20695 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)
20696 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)
20697 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)
20698 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)
20699 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)
20700 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)
20701 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)
20702 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)
20703 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)
20704 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)
20705 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)
20706 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)
20707 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)
20708 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)
20709 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)
20710 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)
20711 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)
20712 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)
20713 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)
20714 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)
20715 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)
20716 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)
20717 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)
20718 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)
20719 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)
20720 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)
20721 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)
20722 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)
20723 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)
20724 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)
20725 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)
20726 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)
20727 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_2, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20728 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20734 __Pyx_XDECREF(__pyx_t_1);
20735 __Pyx_XDECREF(__pyx_t_2);
20736 __Pyx_XDECREF(__pyx_t_3);
20739 __Pyx_AddTraceback(
"init PyClical", 0, __pyx_lineno, __pyx_filename);
20741 Py_DECREF(__pyx_m); __pyx_m = 0;
20742 }
else if (!PyErr_Occurred()) {
20743 PyErr_SetString(PyExc_ImportError,
"init PyClical");
20746 __Pyx_RefNannyFinishContext();
20747 #if CYTHON_PEP489_MULTI_PHASE_INIT 20748 return (__pyx_m != NULL) ? 0 : -1;
20749 #elif PY_MAJOR_VERSION >= 3 20758 #if CYTHON_REFNANNY 20759 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
20760 PyObject *m = NULL, *p = NULL;
20762 m = PyImport_ImportModule((
char *)modname);
20764 p = PyObject_GetAttrString(m, (
char *)
"RefNannyAPI");
20766 r = PyLong_AsVoidPtr(p);
20770 return (__Pyx_RefNannyAPIStruct *)r;
20775 #if CYTHON_USE_TYPE_SLOTS 20776 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject*
obj, PyObject* attr_name) {
20777 PyTypeObject* tp = Py_TYPE(
obj);
20778 if (likely(tp->tp_getattro))
20779 return tp->tp_getattro(
obj, attr_name);
20780 #if PY_MAJOR_VERSION < 3 20781 if (likely(tp->tp_getattr))
20782 return tp->tp_getattr(
obj, PyString_AS_STRING(attr_name));
20784 return PyObject_GetAttr(
obj, attr_name);
20789 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
20790 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
20791 if (unlikely(!result)) {
20792 PyErr_Format(PyExc_NameError,
20793 #
if PY_MAJOR_VERSION >= 3
20794 "name '%U' is not defined", name);
20796 "name '%.200s' is not defined", PyString_AS_STRING(name));
20803 #if CYTHON_FAST_PYCCALL 20804 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
20805 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
20806 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
20807 PyObject *
self = PyCFunction_GET_SELF(func);
20808 int flags = PyCFunction_GET_FLAGS(func);
20809 assert(PyCFunction_Check(func));
20810 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)));
20811 assert(nargs >= 0);
20812 assert(nargs == 0 || args != NULL);
20816 assert(!PyErr_Occurred());
20817 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
20818 return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (
self, args, nargs, NULL);
20820 return (*((__Pyx_PyCFunctionFast)meth)) (
self, args, nargs);
20826 #if CYTHON_FAST_PYCALL 20827 #include "frameobject.h" 20828 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
20829 PyObject *globals) {
20831 PyThreadState *tstate = __Pyx_PyThreadState_Current;
20832 PyObject **fastlocals;
20835 assert(globals != NULL);
20840 assert(tstate != NULL);
20841 f = PyFrame_New(tstate, co, globals, NULL);
20845 fastlocals = f->f_localsplus;
20846 for (
i = 0;
i < na;
i++) {
20848 fastlocals[
i] = *args++;
20850 result = PyEval_EvalFrameEx(f,0);
20851 ++tstate->recursion_depth;
20853 --tstate->recursion_depth;
20856 #if 1 || PY_VERSION_HEX < 0x030600B1 20857 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
int nargs, PyObject *kwargs) {
20858 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
20859 PyObject *globals = PyFunction_GET_GLOBALS(func);
20860 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
20862 #if PY_MAJOR_VERSION >= 3 20865 PyObject *kwtuple, **k;
20870 assert(kwargs == NULL || PyDict_Check(kwargs));
20871 nk = kwargs ? PyDict_Size(kwargs) : 0;
20872 if (Py_EnterRecursiveCall((
char*)
" while calling a Python object")) {
20876 #
if PY_MAJOR_VERSION >= 3
20877 co->co_kwonlyargcount == 0 &&
20879 likely(kwargs == NULL || nk == 0) &&
20880 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
20881 if (argdefs == NULL && co->co_argcount == nargs) {
20882 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
20885 else if (nargs == 0 && argdefs != NULL
20886 && co->co_argcount == Py_SIZE(argdefs)) {
20889 args = &PyTuple_GET_ITEM(argdefs, 0);
20890 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
20894 if (kwargs != NULL) {
20896 kwtuple = PyTuple_New(2 * nk);
20897 if (kwtuple == NULL) {
20901 k = &PyTuple_GET_ITEM(kwtuple, 0);
20903 while (PyDict_Next(kwargs, &pos, &k[
i], &k[
i+1])) {
20914 closure = PyFunction_GET_CLOSURE(func);
20915 #if PY_MAJOR_VERSION >= 3 20916 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
20918 if (argdefs != NULL) {
20919 d = &PyTuple_GET_ITEM(argdefs, 0);
20920 nd = Py_SIZE(argdefs);
20926 #if PY_MAJOR_VERSION >= 3 20927 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
20930 d, (
int)nd, kwdefs, closure);
20932 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
20935 d, (
int)nd, closure);
20937 Py_XDECREF(kwtuple);
20939 Py_LeaveRecursiveCall();
20946 #if CYTHON_COMPILING_IN_CPYTHON 20947 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
20949 ternaryfunc call = func->ob_type->tp_call;
20950 if (unlikely(!call))
20951 return PyObject_Call(func, arg, kw);
20952 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
20954 result = (*call)(func, arg, kw);
20955 Py_LeaveRecursiveCall();
20956 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
20959 "NULL result without error in PyObject_Call");
20966 #if CYTHON_COMPILING_IN_CPYTHON 20967 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
20968 PyObject *
self, *result;
20970 cfunc = PyCFunction_GET_FUNCTION(func);
20971 self = PyCFunction_GET_SELF(func);
20972 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
20974 result = cfunc(
self, arg);
20975 Py_LeaveRecursiveCall();
20976 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
20979 "NULL result without error in PyObject_Call");
20986 #if CYTHON_COMPILING_IN_CPYTHON 20987 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
20989 PyObject *args = PyTuple_New(1);
20990 if (unlikely(!args))
return NULL;
20992 PyTuple_SET_ITEM(args, 0, arg);
20993 result = __Pyx_PyObject_Call(func, args, NULL);
20997 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
20998 #if CYTHON_FAST_PYCALL 20999 if (PyFunction_Check(func)) {
21000 return __Pyx_PyFunction_FastCall(func, &arg, 1);
21003 if (likely(PyCFunction_Check(func))) {
21004 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
21005 return __Pyx_PyObject_CallMethO(func, arg);
21006 #if CYTHON_FAST_PYCCALL 21007 }
else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
21008 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
21012 return __Pyx__PyObject_CallOneArg(func, arg);
21015 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
21017 PyObject *args = PyTuple_Pack(1, arg);
21018 if (unlikely(!args))
return NULL;
21019 result = __Pyx_PyObject_Call(func, args, NULL);
21026 #if CYTHON_FAST_THREAD_STATE 21027 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
21028 PyObject *tmp_type, *tmp_value, *tmp_tb;
21029 tmp_type = tstate->curexc_type;
21030 tmp_value = tstate->curexc_value;
21031 tmp_tb = tstate->curexc_traceback;
21032 tstate->curexc_type = type;
21033 tstate->curexc_value = value;
21034 tstate->curexc_traceback = tb;
21035 Py_XDECREF(tmp_type);
21036 Py_XDECREF(tmp_value);
21037 Py_XDECREF(tmp_tb);
21039 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
21040 *type = tstate->curexc_type;
21041 *value = tstate->curexc_value;
21042 *tb = tstate->curexc_traceback;
21043 tstate->curexc_type = 0;
21044 tstate->curexc_value = 0;
21045 tstate->curexc_traceback = 0;
21050 static void __Pyx_WriteUnraisable(
const char *name, CYTHON_UNUSED
int clineno,
21051 CYTHON_UNUSED
int lineno, CYTHON_UNUSED
const char *filename,
21052 int full_traceback, CYTHON_UNUSED
int nogil) {
21053 PyObject *old_exc, *old_val, *old_tb;
21055 __Pyx_PyThreadState_declare
21057 PyGILState_STATE state;
21059 state = PyGILState_Ensure();
21061 else state = (PyGILState_STATE)-1;
21064 __Pyx_PyThreadState_assign
21065 __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
21066 if (full_traceback) {
21067 Py_XINCREF(old_exc);
21068 Py_XINCREF(old_val);
21069 Py_XINCREF(old_tb);
21070 __Pyx_ErrRestore(old_exc, old_val, old_tb);
21073 #if PY_MAJOR_VERSION < 3 21074 ctx = PyString_FromString(name);
21076 ctx = PyUnicode_FromString(name);
21078 __Pyx_ErrRestore(old_exc, old_val, old_tb);
21080 PyErr_WriteUnraisable(Py_None);
21082 PyErr_WriteUnraisable(ctx);
21087 PyGILState_Release(state);
21092 #if CYTHON_COMPILING_IN_CPYTHON 21093 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
21094 #if CYTHON_FAST_PYCALL 21095 if (PyFunction_Check(func)) {
21096 return __Pyx_PyFunction_FastCall(func, NULL, 0);
21099 #ifdef __Pyx_CyFunction_USED 21100 if (likely(PyCFunction_Check(func) || __Pyx_TypeCheck(func, __pyx_CyFunctionType))) {
21102 if (likely(PyCFunction_Check(func))) {
21104 if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
21105 return __Pyx_PyObject_CallMethO(func, NULL);
21108 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
21113 static void __Pyx_RaiseDoubleKeywordsError(
21114 const char* func_name,
21117 PyErr_Format(PyExc_TypeError,
21118 #
if PY_MAJOR_VERSION >= 3
21119 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
21121 "%s() got multiple values for keyword argument '%s'", func_name,
21122 PyString_AsString(kw_name));
21127 static int __Pyx_ParseOptionalKeywords(
21129 PyObject **argnames[],
21131 PyObject *values[],
21132 Py_ssize_t num_pos_args,
21133 const char* function_name)
21135 PyObject *key = 0, *value = 0;
21136 Py_ssize_t pos = 0;
21138 PyObject*** first_kw_arg = argnames + num_pos_args;
21139 while (PyDict_Next(kwds, &pos, &key, &value)) {
21140 name = first_kw_arg;
21141 while (*name && (**name != key)) name++;
21143 values[name-argnames] = value;
21146 name = first_kw_arg;
21147 #if PY_MAJOR_VERSION < 3 21148 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
21150 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
21151 && _PyString_Eq(**name, key)) {
21152 values[name-argnames] = value;
21157 if (*name)
continue;
21159 PyObject*** argname = argnames;
21160 while (argname != first_kw_arg) {
21161 if ((**argname == key) || (
21162 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
21163 && _PyString_Eq(**argname, key))) {
21164 goto arg_passed_twice;
21171 if (likely(PyUnicode_Check(key))) {
21173 int cmp = (**name == key) ? 0 :
21174 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
21175 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
21177 PyUnicode_Compare(**name, key);
21178 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
21180 values[name-argnames] = value;
21185 if (*name)
continue;
21187 PyObject*** argname = argnames;
21188 while (argname != first_kw_arg) {
21189 int cmp = (**argname == key) ? 0 :
21190 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
21191 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
21193 PyUnicode_Compare(**argname, key);
21194 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
21195 if (cmp == 0)
goto arg_passed_twice;
21200 goto invalid_keyword_type;
21202 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
21204 goto invalid_keyword;
21209 __Pyx_RaiseDoubleKeywordsError(function_name, key);
21211 invalid_keyword_type:
21212 PyErr_Format(PyExc_TypeError,
21213 "%.200s() keywords must be strings", function_name);
21216 PyErr_Format(PyExc_TypeError,
21217 #
if PY_MAJOR_VERSION < 3
21218 "%.200s() got an unexpected keyword argument '%.200s'",
21219 function_name, PyString_AsString(key));
21221 "%s() got an unexpected keyword argument '%U'",
21222 function_name, key);
21229 static void __Pyx_RaiseArgtupleInvalid(
21230 const char* func_name,
21232 Py_ssize_t num_min,
21233 Py_ssize_t num_max,
21234 Py_ssize_t num_found)
21236 Py_ssize_t num_expected;
21237 const char *more_or_less;
21238 if (num_found < num_min) {
21239 num_expected = num_min;
21240 more_or_less =
"at least";
21242 num_expected = num_max;
21243 more_or_less =
"at most";
21246 more_or_less =
"exactly";
21248 PyErr_Format(PyExc_TypeError,
21249 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
21250 func_name, more_or_less, num_expected,
21251 (num_expected == 1) ?
"" :
"s", num_found);
21255 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
21257 #if !CYTHON_AVOID_BORROWED_REFS 21258 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 21259 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
21260 if (likely(result)) {
21262 }
else if (unlikely(PyErr_Occurred())) {
21266 result = PyDict_GetItem(__pyx_d, name);
21267 if (likely(result)) {
21272 result = PyObject_GetItem(__pyx_d, name);
21276 result = __Pyx_GetBuiltinName(name);
21282 #if CYTHON_FAST_THREAD_STATE 21283 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
21284 #if PY_VERSION_HEX >= 0x030700A3 21285 *type = tstate->exc_state.exc_type;
21286 *value = tstate->exc_state.exc_value;
21287 *tb = tstate->exc_state.exc_traceback;
21289 *type = tstate->exc_type;
21290 *value = tstate->exc_value;
21291 *tb = tstate->exc_traceback;
21294 Py_XINCREF(*value);
21297 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
21298 PyObject *tmp_type, *tmp_value, *tmp_tb;
21299 #if PY_VERSION_HEX >= 0x030700A3 21300 tmp_type = tstate->exc_state.exc_type;
21301 tmp_value = tstate->exc_state.exc_value;
21302 tmp_tb = tstate->exc_state.exc_traceback;
21303 tstate->exc_state.exc_type = type;
21304 tstate->exc_state.exc_value = value;
21305 tstate->exc_state.exc_traceback = tb;
21307 tmp_type = tstate->exc_type;
21308 tmp_value = tstate->exc_value;
21309 tmp_tb = tstate->exc_traceback;
21310 tstate->exc_type = type;
21311 tstate->exc_value = value;
21312 tstate->exc_traceback = tb;
21314 Py_XDECREF(tmp_type);
21315 Py_XDECREF(tmp_value);
21316 Py_XDECREF(tmp_tb);
21321 #if CYTHON_FAST_THREAD_STATE 21322 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
21324 n = PyTuple_GET_SIZE(tuple);
21325 #if PY_MAJOR_VERSION >= 3 21326 for (
i=0;
i<n;
i++) {
21327 if (exc_type == PyTuple_GET_ITEM(tuple,
i))
return 1;
21330 for (
i=0;
i<n;
i++) {
21331 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple,
i)))
return 1;
21335 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
21336 PyObject *exc_type = tstate->curexc_type;
21337 if (exc_type == err)
return 1;
21338 if (unlikely(!exc_type))
return 0;
21339 if (unlikely(PyTuple_Check(err)))
21340 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
21341 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
21346 #if CYTHON_FAST_THREAD_STATE 21347 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
21349 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
21351 PyObject *local_type, *local_value, *local_tb;
21352 #if CYTHON_FAST_THREAD_STATE 21353 PyObject *tmp_type, *tmp_value, *tmp_tb;
21354 local_type = tstate->curexc_type;
21355 local_value = tstate->curexc_value;
21356 local_tb = tstate->curexc_traceback;
21357 tstate->curexc_type = 0;
21358 tstate->curexc_value = 0;
21359 tstate->curexc_traceback = 0;
21361 PyErr_Fetch(&local_type, &local_value, &local_tb);
21363 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
21364 #if CYTHON_FAST_THREAD_STATE 21365 if (unlikely(tstate->curexc_type))
21367 if (unlikely(PyErr_Occurred()))
21370 #if PY_MAJOR_VERSION >= 3 21372 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
21376 Py_XINCREF(local_tb);
21377 Py_XINCREF(local_type);
21378 Py_XINCREF(local_value);
21379 *type = local_type;
21380 *value = local_value;
21382 #if CYTHON_FAST_THREAD_STATE 21383 #if PY_VERSION_HEX >= 0x030700A3 21384 tmp_type = tstate->exc_state.exc_type;
21385 tmp_value = tstate->exc_state.exc_value;
21386 tmp_tb = tstate->exc_state.exc_traceback;
21387 tstate->exc_state.exc_type = local_type;
21388 tstate->exc_state.exc_value = local_value;
21389 tstate->exc_state.exc_traceback = local_tb;
21391 tmp_type = tstate->exc_type;
21392 tmp_value = tstate->exc_value;
21393 tmp_tb = tstate->exc_traceback;
21394 tstate->exc_type = local_type;
21395 tstate->exc_value = local_value;
21396 tstate->exc_traceback = local_tb;
21398 Py_XDECREF(tmp_type);
21399 Py_XDECREF(tmp_value);
21400 Py_XDECREF(tmp_tb);
21402 PyErr_SetExcInfo(local_type, local_value, local_tb);
21409 Py_XDECREF(local_type);
21410 Py_XDECREF(local_value);
21411 Py_XDECREF(local_tb);
21416 #if PY_MAJOR_VERSION < 3 21417 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
21418 CYTHON_UNUSED PyObject *cause) {
21419 __Pyx_PyThreadState_declare
21421 if (!value || value == Py_None)
21425 if (!tb || tb == Py_None)
21429 if (!PyTraceBack_Check(tb)) {
21430 PyErr_SetString(PyExc_TypeError,
21431 "raise: arg 3 must be a traceback or None");
21435 if (PyType_Check(type)) {
21436 #if CYTHON_COMPILING_IN_PYPY 21438 Py_INCREF(Py_None);
21442 PyErr_NormalizeException(&type, &value, &tb);
21445 PyErr_SetString(PyExc_TypeError,
21446 "instance exception may not have a separate value");
21450 type = (PyObject*) Py_TYPE(type);
21452 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
21453 PyErr_SetString(PyExc_TypeError,
21454 "raise: exception class must be a subclass of BaseException");
21458 __Pyx_PyThreadState_assign
21459 __Pyx_ErrRestore(type, value, tb);
21468 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
21469 PyObject* owned_instance = NULL;
21470 if (tb == Py_None) {
21472 }
else if (tb && !PyTraceBack_Check(tb)) {
21473 PyErr_SetString(PyExc_TypeError,
21474 "raise: arg 3 must be a traceback or None");
21477 if (value == Py_None)
21479 if (PyExceptionInstance_Check(type)) {
21481 PyErr_SetString(PyExc_TypeError,
21482 "instance exception may not have a separate value");
21486 type = (PyObject*) Py_TYPE(value);
21487 }
else if (PyExceptionClass_Check(type)) {
21488 PyObject *instance_class = NULL;
21489 if (value && PyExceptionInstance_Check(value)) {
21490 instance_class = (PyObject*) Py_TYPE(value);
21491 if (instance_class != type) {
21492 int is_subclass = PyObject_IsSubclass(instance_class, type);
21493 if (!is_subclass) {
21494 instance_class = NULL;
21495 }
else if (unlikely(is_subclass == -1)) {
21498 type = instance_class;
21502 if (!instance_class) {
21505 args = PyTuple_New(0);
21506 else if (PyTuple_Check(value)) {
21510 args = PyTuple_Pack(1, value);
21513 owned_instance = PyObject_Call(type, args, NULL);
21515 if (!owned_instance)
21517 value = owned_instance;
21518 if (!PyExceptionInstance_Check(value)) {
21519 PyErr_Format(PyExc_TypeError,
21520 "calling %R should have returned an instance of " 21521 "BaseException, not %R",
21522 type, Py_TYPE(value));
21527 PyErr_SetString(PyExc_TypeError,
21528 "raise: exception class must be a subclass of BaseException");
21532 PyObject *fixed_cause;
21533 if (cause == Py_None) {
21534 fixed_cause = NULL;
21535 }
else if (PyExceptionClass_Check(cause)) {
21536 fixed_cause = PyObject_CallObject(cause, NULL);
21537 if (fixed_cause == NULL)
21539 }
else if (PyExceptionInstance_Check(cause)) {
21540 fixed_cause = cause;
21541 Py_INCREF(fixed_cause);
21543 PyErr_SetString(PyExc_TypeError,
21544 "exception causes must derive from " 21548 PyException_SetCause(value, fixed_cause);
21550 PyErr_SetObject(type, value);
21552 #if CYTHON_COMPILING_IN_PYPY 21553 PyObject *tmp_type, *tmp_value, *tmp_tb;
21554 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
21556 PyErr_Restore(tmp_type, tmp_value, tb);
21557 Py_XDECREF(tmp_tb);
21559 PyThreadState *tstate = __Pyx_PyThreadState_Current;
21560 PyObject* tmp_tb = tstate->curexc_traceback;
21561 if (tb != tmp_tb) {
21563 tstate->curexc_traceback = tb;
21564 Py_XDECREF(tmp_tb);
21569 Py_XDECREF(owned_instance);
21575 #if !CYTHON_COMPILING_IN_PYPY 21576 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
long intval, CYTHON_UNUSED
int inplace) {
21577 #if PY_MAJOR_VERSION < 3 21578 if (likely(PyInt_CheckExact(op1))) {
21579 const long b = intval;
21581 long a = PyInt_AS_LONG(op1);
21582 x = (long)((
unsigned long)a + b);
21583 if (likely((x^a) >= 0 || (x^b) >= 0))
21584 return PyInt_FromLong(x);
21585 return PyLong_Type.tp_as_number->nb_add(op1, op2);
21588 #if CYTHON_USE_PYLONG_INTERNALS 21589 if (likely(PyLong_CheckExact(op1))) {
21590 const long b = intval;
21592 #ifdef HAVE_LONG_LONG 21593 const PY_LONG_LONG llb = intval;
21594 PY_LONG_LONG lla, llx;
21596 const digit* digits = ((PyLongObject*)op1)->ob_digit;
21597 const Py_ssize_t size = Py_SIZE(op1);
21598 if (likely(__Pyx_sst_abs(size) <= 1)) {
21599 a = likely(size) ? digits[0] : 0;
21600 if (size == -1) a = -a;
21604 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
21605 a = -(long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21607 #ifdef HAVE_LONG_LONG 21608 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
21609 lla = -(PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
21613 CYTHON_FALLTHROUGH;
21615 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
21616 a = (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21618 #ifdef HAVE_LONG_LONG 21619 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
21620 lla = (PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
21624 CYTHON_FALLTHROUGH;
21626 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
21627 a = -(long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21629 #ifdef HAVE_LONG_LONG 21630 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
21631 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]));
21635 CYTHON_FALLTHROUGH;
21637 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
21638 a = (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21640 #ifdef HAVE_LONG_LONG 21641 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
21642 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]));
21646 CYTHON_FALLTHROUGH;
21648 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
21649 a = -(long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21651 #ifdef HAVE_LONG_LONG 21652 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
21653 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]));
21657 CYTHON_FALLTHROUGH;
21659 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
21660 a = (long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21662 #ifdef HAVE_LONG_LONG 21663 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
21664 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]));
21668 CYTHON_FALLTHROUGH;
21669 default:
return PyLong_Type.tp_as_number->nb_add(op1, op2);
21673 return PyLong_FromLong(x);
21674 #ifdef HAVE_LONG_LONG 21677 return PyLong_FromLongLong(llx);
21683 if (PyFloat_CheckExact(op1)) {
21684 const long b = intval;
21685 double a = PyFloat_AS_DOUBLE(op1);
21687 PyFPE_START_PROTECT(
"add",
return NULL)
21688 result = ((double)a) + (double)b;
21689 PyFPE_END_PROTECT(result)
21692 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
21697 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
21700 r = PyObject_SetItem(o, j, v);
21704 static CYTHON_INLINE
int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t
i, PyObject *v,
int is_list,
21705 CYTHON_NCP_UNUSED
int wraparound, CYTHON_NCP_UNUSED
int boundscheck) {
21706 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS 21707 if (is_list || PyList_CheckExact(o)) {
21708 Py_ssize_t n = (!wraparound) ?
i : ((likely(
i >= 0)) ?
i :
i + PyList_GET_SIZE(o));
21709 if ((!boundscheck) || likely((n >= 0) & (n < PyList_GET_SIZE(o)))) {
21710 PyObject* old = PyList_GET_ITEM(o, n);
21712 PyList_SET_ITEM(o, n, v);
21717 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
21718 if (likely(m && m->sq_ass_item)) {
21719 if (wraparound && unlikely(
i < 0) && likely(m->sq_length)) {
21720 Py_ssize_t l = m->sq_length(o);
21721 if (likely(l >= 0)) {
21724 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
21729 return m->sq_ass_item(o,
i, v);
21733 #if CYTHON_COMPILING_IN_PYPY 21734 if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) {
21736 if (is_list || PySequence_Check(o)) {
21738 return PySequence_SetItem(o,
i, v);
21741 return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(
i), v);
21745 static int __Pyx__ArgTypeTest(PyObject *
obj, PyTypeObject *type,
const char *name,
int exact)
21747 if (unlikely(!type)) {
21748 PyErr_SetString(PyExc_SystemError,
"Missing type object");
21752 #if PY_MAJOR_VERSION == 2 21753 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(
obj)))
return 1;
21757 if (likely(__Pyx_TypeCheck(
obj, type)))
return 1;
21759 PyErr_Format(PyExc_TypeError,
21760 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
21761 name, type->tp_name, Py_TYPE(
obj)->tp_name);
21766 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level) {
21767 PyObject *empty_list = 0;
21768 PyObject *module = 0;
21769 PyObject *global_dict = 0;
21770 PyObject *empty_dict = 0;
21772 #if PY_MAJOR_VERSION < 3 21773 PyObject *py_import;
21774 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
21781 empty_list = PyList_New(0);
21786 global_dict = PyModule_GetDict(__pyx_m);
21789 empty_dict = PyDict_New();
21793 #if PY_MAJOR_VERSION >= 3 21795 if (strchr(__Pyx_MODULE_NAME,
'.')) {
21796 module = PyImport_ImportModuleLevelObject(
21797 name, global_dict, empty_dict, list, 1);
21799 if (!PyErr_ExceptionMatches(PyExc_ImportError))
21808 #if PY_MAJOR_VERSION < 3 21809 PyObject *py_level = PyInt_FromLong(level);
21812 module = PyObject_CallFunctionObjArgs(py_import,
21813 name, global_dict, empty_dict, list, py_level, NULL);
21814 Py_DECREF(py_level);
21816 module = PyImport_ImportModuleLevelObject(
21817 name, global_dict, empty_dict, list, level);
21822 #if PY_MAJOR_VERSION < 3 21823 Py_XDECREF(py_import);
21825 Py_XDECREF(empty_list);
21826 Py_XDECREF(empty_dict);
21831 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 21832 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
21833 PyErr_Format(PyExc_AttributeError,
21834 #
if PY_MAJOR_VERSION >= 3
21835 "'%.50s' object has no attribute '%U'",
21836 tp->tp_name, attr_name);
21838 "'%.50s' object has no attribute '%.400s'",
21839 tp->tp_name, PyString_AS_STRING(attr_name));
21843 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject*
obj, PyObject* attr_name) {
21845 PyTypeObject *tp = Py_TYPE(
obj);
21846 if (unlikely(!PyString_Check(attr_name))) {
21847 return PyObject_GenericGetAttr(
obj, attr_name);
21849 assert(!tp->tp_dictoffset);
21850 descr = _PyType_Lookup(tp, attr_name);
21851 if (unlikely(!descr)) {
21852 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
21855 #if PY_MAJOR_VERSION < 3 21856 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
21859 descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
21861 PyObject *res = f(descr,
obj, (PyObject *)tp);
21871 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 21872 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject*
obj, PyObject* attr_name) {
21873 if (unlikely(Py_TYPE(
obj)->tp_dictoffset)) {
21874 return PyObject_GenericGetAttr(
obj, attr_name);
21876 return __Pyx_PyObject_GenericGetAttrNoDict(
obj, attr_name);
21881 static int __Pyx_SetVtable(PyObject *dict,
void *vtable) {
21882 #if PY_VERSION_HEX >= 0x02070000 21883 PyObject *ob = PyCapsule_New(vtable, 0, 0);
21885 PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
21889 if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
21899 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
21901 PyObject *name_attr;
21902 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name);
21903 if (likely(name_attr)) {
21904 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
21908 if (unlikely(ret < 0)) {
21912 Py_XDECREF(name_attr);
21915 static int __Pyx_setup_reduce(PyObject* type_obj) {
21917 PyObject *object_reduce = NULL;
21918 PyObject *object_reduce_ex = NULL;
21919 PyObject *reduce = NULL;
21920 PyObject *reduce_ex = NULL;
21921 PyObject *reduce_cython = NULL;
21922 PyObject *setstate = NULL;
21923 PyObject *setstate_cython = NULL;
21924 #if CYTHON_USE_PYTYPE_LOOKUP 21925 if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate))
goto GOOD;
21927 if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate))
goto GOOD;
21929 #if CYTHON_USE_PYTYPE_LOOKUP 21930 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto BAD;
21932 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto BAD;
21934 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex);
if (unlikely(!reduce_ex))
goto BAD;
21935 if (reduce_ex == object_reduce_ex) {
21936 #if CYTHON_USE_PYTYPE_LOOKUP 21937 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto BAD;
21939 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto BAD;
21941 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce);
if (unlikely(!reduce))
goto BAD;
21942 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
21943 reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython);
if (unlikely(!reduce_cython))
goto BAD;
21944 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython);
if (unlikely(ret < 0))
goto BAD;
21945 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython);
if (unlikely(ret < 0))
goto BAD;
21946 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
21947 if (!setstate) PyErr_Clear();
21948 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
21949 setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython);
if (unlikely(!setstate_cython))
goto BAD;
21950 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython);
if (unlikely(ret < 0))
goto BAD;
21951 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython);
if (unlikely(ret < 0))
goto BAD;
21953 PyType_Modified((PyTypeObject*)type_obj);
21958 if (!PyErr_Occurred())
21959 PyErr_Format(PyExc_RuntimeError,
"Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
21962 #if !CYTHON_USE_PYTYPE_LOOKUP 21963 Py_XDECREF(object_reduce);
21964 Py_XDECREF(object_reduce_ex);
21966 Py_XDECREF(reduce);
21967 Py_XDECREF(reduce_ex);
21968 Py_XDECREF(reduce_cython);
21969 Py_XDECREF(setstate);
21970 Py_XDECREF(setstate_cython);
21975 #if !CYTHON_COMPILING_IN_PYPY 21976 static PyObject* __Pyx_PyFloat_DivideObjC(PyObject *op1, PyObject *op2,
double floatval, CYTHON_UNUSED
int inplace) {
21977 const double b = floatval;
21979 if (likely(PyFloat_CheckExact(op1))) {
21980 a = PyFloat_AS_DOUBLE(op1);
21982 #if PY_MAJOR_VERSION < 3 21983 if (likely(PyInt_CheckExact(op1))) {
21984 a = (double) PyInt_AS_LONG(op1);
21987 if (likely(PyLong_CheckExact(op1))) {
21988 #if CYTHON_USE_PYLONG_INTERNALS 21989 const digit* digits = ((PyLongObject*)op1)->ob_digit;
21990 const Py_ssize_t size = Py_SIZE(op1);
21992 case 0: a = 0.0;
break;
21993 case -1: a = -(double) digits[0];
break;
21994 case 1: a = (double) digits[0];
break;
21997 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
21998 a = (double) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21999 if ((8 *
sizeof(
unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
22005 CYTHON_FALLTHROUGH;
22008 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
22009 a = (double) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
22010 if ((8 *
sizeof(
unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
22016 CYTHON_FALLTHROUGH;
22019 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
22020 a = (double) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
22021 if ((8 *
sizeof(
unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
22027 CYTHON_FALLTHROUGH;
22032 a = PyLong_AsDouble(op1);
22033 if (unlikely(a == -1.0 && PyErr_Occurred()))
return NULL;
22036 return (inplace ? __Pyx_PyNumber_InPlaceDivide(op1, op2) : __Pyx_PyNumber_Divide(op1, op2));
22038 PyFPE_START_PROTECT(
"divide",
return NULL)
22040 PyFPE_END_PROTECT(result)
22046 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals) {
22047 #if CYTHON_COMPILING_IN_PYPY 22048 return PyObject_RichCompareBool(s1, s2, equals);
22051 return (equals == Py_EQ);
22052 }
else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
22053 const char *ps1, *ps2;
22054 Py_ssize_t length = PyBytes_GET_SIZE(s1);
22055 if (length != PyBytes_GET_SIZE(s2))
22056 return (equals == Py_NE);
22057 ps1 = PyBytes_AS_STRING(s1);
22058 ps2 = PyBytes_AS_STRING(s2);
22059 if (ps1[0] != ps2[0]) {
22060 return (equals == Py_NE);
22061 }
else if (length == 1) {
22062 return (equals == Py_EQ);
22065 #if CYTHON_USE_UNICODE_INTERNALS 22066 Py_hash_t hash1, hash2;
22067 hash1 = ((PyBytesObject*)s1)->ob_shash;
22068 hash2 = ((PyBytesObject*)s2)->ob_shash;
22069 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
22070 return (equals == Py_NE);
22073 result = memcmp(ps1, ps2, (
size_t)length);
22074 return (equals == Py_EQ) ? (result == 0) : (result != 0);
22076 }
else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
22077 return (equals == Py_NE);
22078 }
else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
22079 return (equals == Py_NE);
22082 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
22085 result = __Pyx_PyObject_IsTrue(py_result);
22086 Py_DECREF(py_result);
22093 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals) {
22094 #if CYTHON_COMPILING_IN_PYPY 22095 return PyObject_RichCompareBool(s1, s2, equals);
22097 #if PY_MAJOR_VERSION < 3 22098 PyObject* owned_ref = NULL;
22100 int s1_is_unicode, s2_is_unicode;
22104 s1_is_unicode = PyUnicode_CheckExact(s1);
22105 s2_is_unicode = PyUnicode_CheckExact(s2);
22106 #if PY_MAJOR_VERSION < 3 22107 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
22108 owned_ref = PyUnicode_FromObject(s2);
22109 if (unlikely(!owned_ref))
22113 }
else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
22114 owned_ref = PyUnicode_FromObject(s1);
22115 if (unlikely(!owned_ref))
22119 }
else if (((!s2_is_unicode) & (!s1_is_unicode))) {
22120 return __Pyx_PyBytes_Equals(s1, s2, equals);
22123 if (s1_is_unicode & s2_is_unicode) {
22126 void *data1, *data2;
22127 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
22129 length = __Pyx_PyUnicode_GET_LENGTH(s1);
22130 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
22133 #if CYTHON_USE_UNICODE_INTERNALS 22135 Py_hash_t hash1, hash2;
22136 #if CYTHON_PEP393_ENABLED 22137 hash1 = ((PyASCIIObject*)s1)->hash;
22138 hash2 = ((PyASCIIObject*)s2)->hash;
22140 hash1 = ((PyUnicodeObject*)s1)->hash;
22141 hash2 = ((PyUnicodeObject*)s2)->hash;
22143 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
22148 kind = __Pyx_PyUnicode_KIND(s1);
22149 if (kind != __Pyx_PyUnicode_KIND(s2)) {
22152 data1 = __Pyx_PyUnicode_DATA(s1);
22153 data2 = __Pyx_PyUnicode_DATA(s2);
22154 if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
22156 }
else if (length == 1) {
22159 int result = memcmp(data1, data2, (
size_t)(length * kind));
22160 #if PY_MAJOR_VERSION < 3 22161 Py_XDECREF(owned_ref);
22163 return (equals == Py_EQ) ? (result == 0) : (result != 0);
22165 }
else if ((s1 == Py_None) & s2_is_unicode) {
22167 }
else if ((s2 == Py_None) & s1_is_unicode) {
22171 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
22172 #if PY_MAJOR_VERSION < 3 22173 Py_XDECREF(owned_ref);
22177 result = __Pyx_PyObject_IsTrue(py_result);
22178 Py_DECREF(py_result);
22182 #if PY_MAJOR_VERSION < 3 22183 Py_XDECREF(owned_ref);
22185 return (equals == Py_EQ);
22187 #if PY_MAJOR_VERSION < 3 22188 Py_XDECREF(owned_ref);
22190 return (equals == Py_NE);
22195 #ifndef CYTHON_CLINE_IN_TRACEBACK 22196 static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate,
int c_line) {
22197 PyObject *use_cline;
22198 PyObject *ptype, *pvalue, *ptraceback;
22199 #if CYTHON_COMPILING_IN_CPYTHON 22200 PyObject **cython_runtime_dict;
22202 if (unlikely(!__pyx_cython_runtime)) {
22205 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
22206 #if CYTHON_COMPILING_IN_CPYTHON 22207 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
22208 if (likely(cython_runtime_dict)) {
22209 use_cline = __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback);
22213 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
22214 if (use_cline_obj) {
22215 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
22216 Py_DECREF(use_cline_obj);
22224 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
22226 else if (PyObject_Not(use_cline) != 0) {
22229 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
22235 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
22236 int start = 0, mid = 0, end = count - 1;
22237 if (end >= 0 && code_line > entries[end].code_line) {
22240 while (start < end) {
22241 mid = start + (end - start) / 2;
22242 if (code_line < entries[mid].code_line) {
22244 }
else if (code_line > entries[mid].code_line) {
22250 if (code_line <= entries[mid].code_line) {
22256 static PyCodeObject *__pyx_find_code_object(
int code_line) {
22257 PyCodeObject* code_object;
22259 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
22262 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
22263 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
22266 code_object = __pyx_code_cache.entries[pos].code_object;
22267 Py_INCREF(code_object);
22268 return code_object;
22270 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
22272 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
22273 if (unlikely(!code_line)) {
22276 if (unlikely(!entries)) {
22277 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
22278 if (likely(entries)) {
22279 __pyx_code_cache.entries = entries;
22280 __pyx_code_cache.max_count = 64;
22281 __pyx_code_cache.count = 1;
22282 entries[0].code_line = code_line;
22283 entries[0].code_object = code_object;
22284 Py_INCREF(code_object);
22288 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
22289 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
22290 PyCodeObject* tmp = entries[pos].code_object;
22291 entries[pos].code_object = code_object;
22295 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
22296 int new_max = __pyx_code_cache.max_count + 64;
22297 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
22298 __pyx_code_cache.entries, (
size_t)new_max*
sizeof(__Pyx_CodeObjectCacheEntry));
22299 if (unlikely(!entries)) {
22302 __pyx_code_cache.entries = entries;
22303 __pyx_code_cache.max_count = new_max;
22305 for (
i=__pyx_code_cache.count;
i>pos;
i--) {
22306 entries[
i] = entries[
i-1];
22308 entries[pos].code_line = code_line;
22309 entries[pos].code_object = code_object;
22310 __pyx_code_cache.count++;
22311 Py_INCREF(code_object);
22315 #include "compile.h" 22316 #include "frameobject.h" 22317 #include "traceback.h" 22318 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
22319 const char *funcname,
int c_line,
22320 int py_line,
const char *filename) {
22321 PyCodeObject *py_code = 0;
22322 PyObject *py_srcfile = 0;
22323 PyObject *py_funcname = 0;
22324 #if PY_MAJOR_VERSION < 3 22325 py_srcfile = PyString_FromString(filename);
22327 py_srcfile = PyUnicode_FromString(filename);
22329 if (!py_srcfile)
goto bad;
22331 #if PY_MAJOR_VERSION < 3 22332 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
22334 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
22338 #if PY_MAJOR_VERSION < 3 22339 py_funcname = PyString_FromString(funcname);
22341 py_funcname = PyUnicode_FromString(funcname);
22344 if (!py_funcname)
goto bad;
22345 py_code = __Pyx_PyCode_New(
22362 Py_DECREF(py_srcfile);
22363 Py_DECREF(py_funcname);
22366 Py_XDECREF(py_srcfile);
22367 Py_XDECREF(py_funcname);
22370 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
22371 int py_line,
const char *filename) {
22372 PyCodeObject *py_code = 0;
22373 PyFrameObject *py_frame = 0;
22374 PyThreadState *tstate = __Pyx_PyThreadState_Current;
22376 c_line = __Pyx_CLineForTraceback(tstate, c_line);
22378 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
22380 py_code = __Pyx_CreateCodeObjectForTraceback(
22381 funcname, c_line, py_line, filename);
22382 if (!py_code)
goto bad;
22383 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
22385 py_frame = PyFrame_New(
22391 if (!py_frame)
goto bad;
22392 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
22393 PyTraceBack_Here(py_frame);
22395 Py_XDECREF(py_code);
22396 Py_XDECREF(py_frame);
22400 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ 22401 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) 22402 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ 22403 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) 22404 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ 22406 func_type value = func_value;\ 22407 if (sizeof(target_type) < sizeof(func_type)) {\ 22408 if (unlikely(value != (func_type) (target_type) value)) {\ 22409 func_type zero = 0;\ 22410 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ 22411 return (target_type) -1;\ 22412 if (is_unsigned && unlikely(value < zero))\ 22413 goto raise_neg_overflow;\ 22415 goto raise_overflow;\ 22418 return (target_type) value;\ 22422 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value) {
22423 const int neg_one = (int) -1, const_zero = (
int) 0;
22424 const int is_unsigned = neg_one > const_zero;
22426 if (
sizeof(
int) <
sizeof(long)) {
22427 return PyInt_FromLong((
long) value);
22428 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
22429 return PyLong_FromUnsignedLong((
unsigned long) value);
22430 #ifdef HAVE_LONG_LONG 22431 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
22432 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
22436 if (
sizeof(
int) <=
sizeof(
long)) {
22437 return PyInt_FromLong((
long) value);
22438 #ifdef HAVE_LONG_LONG 22439 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
22440 return PyLong_FromLongLong((PY_LONG_LONG) value);
22445 int one = 1;
int little = (int)*(
unsigned char *)&one;
22446 unsigned char *bytes = (
unsigned char *)&value;
22447 return _PyLong_FromByteArray(bytes,
sizeof(
int),
22448 little, !is_unsigned);
22453 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *x) {
22454 const int neg_one = (int) -1, const_zero = (
int) 0;
22455 const int is_unsigned = neg_one > const_zero;
22456 #if PY_MAJOR_VERSION < 3 22457 if (likely(PyInt_Check(x))) {
22458 if (
sizeof(
int) <
sizeof(long)) {
22459 __PYX_VERIFY_RETURN_INT(
int,
long, PyInt_AS_LONG(x))
22461 long val = PyInt_AS_LONG(x);
22462 if (is_unsigned && unlikely(val < 0)) {
22463 goto raise_neg_overflow;
22469 if (likely(PyLong_Check(x))) {
22471 #if CYTHON_USE_PYLONG_INTERNALS 22472 const digit* digits = ((PyLongObject*)x)->ob_digit;
22473 switch (Py_SIZE(x)) {
22474 case 0:
return (
int) 0;
22475 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, digits[0])
22477 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
22478 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22479 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22480 }
else if (8 *
sizeof(
int) >= 2 * PyLong_SHIFT) {
22481 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
22486 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
22487 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22488 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22489 }
else if (8 *
sizeof(
int) >= 3 * PyLong_SHIFT) {
22490 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
22495 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
22496 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22497 __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])))
22498 }
else if (8 *
sizeof(
int) >= 4 * PyLong_SHIFT) {
22499 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
22505 #if CYTHON_COMPILING_IN_CPYTHON 22506 if (unlikely(Py_SIZE(x) < 0)) {
22507 goto raise_neg_overflow;
22511 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
22512 if (unlikely(result < 0))
22514 if (unlikely(result == 1))
22515 goto raise_neg_overflow;
22518 if (
sizeof(
int) <=
sizeof(
unsigned long)) {
22519 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
22520 #ifdef HAVE_LONG_LONG 22521 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
22522 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
22526 #if CYTHON_USE_PYLONG_INTERNALS 22527 const digit* digits = ((PyLongObject*)x)->ob_digit;
22528 switch (Py_SIZE(x)) {
22529 case 0:
return (
int) 0;
22530 case -1: __PYX_VERIFY_RETURN_INT(
int, sdigit, (sdigit) (-(sdigit)digits[0]))
22531 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, +digits[0])
22533 if (8 *
sizeof(
int) - 1 > 1 * PyLong_SHIFT) {
22534 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22535 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22536 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
22537 return (
int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
22542 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
22543 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22544 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22545 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
22546 return (
int) ((((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
22551 if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
22552 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22553 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22554 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
22555 return (
int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
22560 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
22561 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22562 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22563 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
22564 return (
int) ((((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
22569 if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
22570 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22571 __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])))
22572 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
22573 return (
int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
22578 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
22579 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22580 __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])))
22581 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
22582 return (
int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
22588 if (
sizeof(
int) <=
sizeof(long)) {
22589 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
22590 #ifdef HAVE_LONG_LONG 22591 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
22592 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
22597 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) 22598 PyErr_SetString(PyExc_RuntimeError,
22599 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
22602 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
22603 #if PY_MAJOR_VERSION < 3 22604 if (likely(v) && !PyLong_Check(v)) {
22606 v = PyNumber_Long(tmp);
22611 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
22612 unsigned char *bytes = (
unsigned char *)&val;
22613 int ret = _PyLong_AsByteArray((PyLongObject *)v,
22614 bytes,
sizeof(val),
22615 is_little, !is_unsigned);
22625 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
22626 if (!tmp)
return (
int) -1;
22627 val = __Pyx_PyInt_As_int(tmp);
22632 PyErr_SetString(PyExc_OverflowError,
22633 "value too large to convert to int");
22635 raise_neg_overflow:
22636 PyErr_SetString(PyExc_OverflowError,
22637 "can't convert negative value to int");
22642 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value) {
22643 const long neg_one = (long) -1, const_zero = (
long) 0;
22644 const int is_unsigned = neg_one > const_zero;
22646 if (
sizeof(
long) <
sizeof(long)) {
22647 return PyInt_FromLong((
long) value);
22648 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
22649 return PyLong_FromUnsignedLong((
unsigned long) value);
22650 #ifdef HAVE_LONG_LONG 22651 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
22652 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
22656 if (
sizeof(
long) <=
sizeof(
long)) {
22657 return PyInt_FromLong((
long) value);
22658 #ifdef HAVE_LONG_LONG 22659 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
22660 return PyLong_FromLongLong((PY_LONG_LONG) value);
22665 int one = 1;
int little = (int)*(
unsigned char *)&one;
22666 unsigned char *bytes = (
unsigned char *)&value;
22667 return _PyLong_FromByteArray(bytes,
sizeof(
long),
22668 little, !is_unsigned);
22673 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *x) {
22674 const long neg_one = (long) -1, const_zero = (
long) 0;
22675 const int is_unsigned = neg_one > const_zero;
22676 #if PY_MAJOR_VERSION < 3 22677 if (likely(PyInt_Check(x))) {
22678 if (
sizeof(
long) <
sizeof(long)) {
22679 __PYX_VERIFY_RETURN_INT(
long,
long, PyInt_AS_LONG(x))
22681 long val = PyInt_AS_LONG(x);
22682 if (is_unsigned && unlikely(val < 0)) {
22683 goto raise_neg_overflow;
22689 if (likely(PyLong_Check(x))) {
22691 #if CYTHON_USE_PYLONG_INTERNALS 22692 const digit* digits = ((PyLongObject*)x)->ob_digit;
22693 switch (Py_SIZE(x)) {
22694 case 0:
return (
long) 0;
22695 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, digits[0])
22697 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
22698 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22699 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22700 }
else if (8 *
sizeof(
long) >= 2 * PyLong_SHIFT) {
22701 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
22706 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
22707 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22708 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22709 }
else if (8 *
sizeof(
long) >= 3 * PyLong_SHIFT) {
22710 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
22715 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
22716 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22717 __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])))
22718 }
else if (8 *
sizeof(
long) >= 4 * PyLong_SHIFT) {
22719 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
22725 #if CYTHON_COMPILING_IN_CPYTHON 22726 if (unlikely(Py_SIZE(x) < 0)) {
22727 goto raise_neg_overflow;
22731 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
22732 if (unlikely(result < 0))
22734 if (unlikely(result == 1))
22735 goto raise_neg_overflow;
22738 if (
sizeof(
long) <=
sizeof(
unsigned long)) {
22739 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
22740 #ifdef HAVE_LONG_LONG 22741 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
22742 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
22746 #if CYTHON_USE_PYLONG_INTERNALS 22747 const digit* digits = ((PyLongObject*)x)->ob_digit;
22748 switch (Py_SIZE(x)) {
22749 case 0:
return (
long) 0;
22750 case -1: __PYX_VERIFY_RETURN_INT(
long, sdigit, (sdigit) (-(sdigit)digits[0]))
22751 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, +digits[0])
22753 if (8 *
sizeof(
long) - 1 > 1 * PyLong_SHIFT) {
22754 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22755 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22756 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
22757 return (
long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
22762 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
22763 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22764 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22765 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
22766 return (
long) ((((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
22771 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
22772 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22773 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22774 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
22775 return (
long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
22780 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
22781 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22782 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22783 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
22784 return (
long) ((((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
22789 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
22790 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22791 __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])))
22792 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
22793 return (
long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
22798 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
22799 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22800 __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])))
22801 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
22802 return (
long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
22808 if (
sizeof(
long) <=
sizeof(long)) {
22809 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
22810 #ifdef HAVE_LONG_LONG 22811 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
22812 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
22817 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) 22818 PyErr_SetString(PyExc_RuntimeError,
22819 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
22822 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
22823 #if PY_MAJOR_VERSION < 3 22824 if (likely(v) && !PyLong_Check(v)) {
22826 v = PyNumber_Long(tmp);
22831 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
22832 unsigned char *bytes = (
unsigned char *)&val;
22833 int ret = _PyLong_AsByteArray((PyLongObject *)v,
22834 bytes,
sizeof(val),
22835 is_little, !is_unsigned);
22845 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
22846 if (!tmp)
return (
long) -1;
22847 val = __Pyx_PyInt_As_long(tmp);
22852 PyErr_SetString(PyExc_OverflowError,
22853 "value too large to convert to long");
22855 raise_neg_overflow:
22856 PyErr_SetString(PyExc_OverflowError,
22857 "can't convert negative value to long");
22862 #if CYTHON_COMPILING_IN_CPYTHON 22863 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
22869 return b == &PyBaseObject_Type;
22871 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
22873 if (a == b)
return 1;
22877 n = PyTuple_GET_SIZE(mro);
22878 for (
i = 0;
i < n;
i++) {
22879 if (PyTuple_GET_ITEM(mro,
i) == (PyObject *)b)
22884 return __Pyx_InBases(a, b);
22886 #if PY_MAJOR_VERSION == 2 22887 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
22888 PyObject *exception, *value, *tb;
22890 __Pyx_PyThreadState_declare
22891 __Pyx_PyThreadState_assign
22892 __Pyx_ErrFetch(&exception, &value, &tb);
22893 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
22894 if (unlikely(res == -1)) {
22895 PyErr_WriteUnraisable(err);
22899 res = PyObject_IsSubclass(err, exc_type2);
22900 if (unlikely(res == -1)) {
22901 PyErr_WriteUnraisable(err);
22905 __Pyx_ErrRestore(exception, value, tb);
22909 static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
22910 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
22912 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
22917 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
22919 assert(PyExceptionClass_Check(exc_type));
22920 n = PyTuple_GET_SIZE(tuple);
22921 #if PY_MAJOR_VERSION >= 3 22922 for (
i=0;
i<n;
i++) {
22923 if (exc_type == PyTuple_GET_ITEM(tuple,
i))
return 1;
22926 for (
i=0;
i<n;
i++) {
22927 PyObject *t = PyTuple_GET_ITEM(tuple,
i);
22928 #if PY_MAJOR_VERSION < 3 22929 if (likely(exc_type == t))
return 1;
22931 if (likely(PyExceptionClass_Check(t))) {
22932 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
22938 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
22939 if (likely(err == exc_type))
return 1;
22940 if (likely(PyExceptionClass_Check(err))) {
22941 if (likely(PyExceptionClass_Check(exc_type))) {
22942 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
22943 }
else if (likely(PyTuple_Check(exc_type))) {
22944 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
22948 return PyErr_GivenExceptionMatches(err, exc_type);
22950 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
22951 assert(PyExceptionClass_Check(exc_type1));
22952 assert(PyExceptionClass_Check(exc_type2));
22953 if (likely(err == exc_type1 || err == exc_type2))
return 1;
22954 if (likely(PyExceptionClass_Check(err))) {
22955 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
22957 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
22962 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
22963 PyObject* fake_module;
22964 PyTypeObject* cached_type = NULL;
22965 fake_module = PyImport_AddModule((
char*)
"_cython_" CYTHON_ABI);
22966 if (!fake_module)
return NULL;
22967 Py_INCREF(fake_module);
22968 cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
22970 if (!PyType_Check((PyObject*)cached_type)) {
22971 PyErr_Format(PyExc_TypeError,
22972 "Shared Cython type %.200s is not a type object",
22976 if (cached_type->tp_basicsize != type->tp_basicsize) {
22977 PyErr_Format(PyExc_TypeError,
22978 "Shared Cython type %.200s has the wrong size, try recompiling",
22983 if (!PyErr_ExceptionMatches(PyExc_AttributeError))
goto bad;
22985 if (PyType_Ready(type) < 0)
goto bad;
22986 if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
22989 cached_type = type;
22992 Py_DECREF(fake_module);
22993 return cached_type;
22995 Py_XDECREF(cached_type);
22996 cached_type = NULL;
23001 #if CYTHON_FAST_THREAD_STATE 23002 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
23003 PyObject *tmp_type, *tmp_value, *tmp_tb;
23004 #if PY_VERSION_HEX >= 0x030700A3 23005 tmp_type = tstate->exc_state.exc_type;
23006 tmp_value = tstate->exc_state.exc_value;
23007 tmp_tb = tstate->exc_state.exc_traceback;
23008 tstate->exc_state.exc_type = *type;
23009 tstate->exc_state.exc_value = *value;
23010 tstate->exc_state.exc_traceback = *tb;
23012 tmp_type = tstate->exc_type;
23013 tmp_value = tstate->exc_value;
23014 tmp_tb = tstate->exc_traceback;
23015 tstate->exc_type = *type;
23016 tstate->exc_value = *value;
23017 tstate->exc_traceback = *tb;
23020 *value = tmp_value;
23024 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
23025 PyObject *tmp_type, *tmp_value, *tmp_tb;
23026 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
23027 PyErr_SetExcInfo(*type, *value, *tb);
23029 *value = tmp_value;
23035 static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
23036 PyObject *result = NULL;
23037 #if CYTHON_UNPACK_METHODS 23038 if (likely(PyMethod_Check(method))) {
23039 PyObject *
self = PyMethod_GET_SELF(method);
23040 if (likely(
self)) {
23042 PyObject *
function = PyMethod_GET_FUNCTION(method);
23043 #if CYTHON_FAST_PYCALL 23044 if (PyFunction_Check(
function)) {
23045 PyObject *args[2] = {
self, arg};
23046 result = __Pyx_PyFunction_FastCall(
function, args, 2);
23050 #if CYTHON_FAST_PYCCALL 23051 if (__Pyx_PyFastCFunction_Check(
function)) {
23052 PyObject *args[2] = {
self, arg};
23053 result = __Pyx_PyCFunction_FastCall(
function, args, 2);
23057 args = PyTuple_New(2);
23058 if (unlikely(!args))
goto done;
23060 PyTuple_SET_ITEM(args, 0,
self);
23062 PyTuple_SET_ITEM(args, 1, arg);
23063 Py_INCREF(
function);
23064 result = __Pyx_PyObject_Call(
function, args, NULL);
23066 Py_DECREF(
function);
23071 result = __Pyx_PyObject_CallOneArg(method, arg);
23076 static PyObject* __Pyx_PyObject_CallMethod1(PyObject*
obj, PyObject* method_name, PyObject* arg) {
23077 PyObject *method, *result;
23078 method = __Pyx_PyObject_GetAttrStr(
obj, method_name);
23079 if (unlikely(!method))
return NULL;
23080 result = __Pyx__PyObject_CallMethod1(method, arg);
23086 #include <structmember.h> 23087 #include <frameobject.h> 23088 #define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom) 23089 static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) {
23090 PyObject *et, *ev, *tb;
23091 PyObject *value = NULL;
23092 __Pyx_ErrFetch(&et, &ev, &tb);
23096 Py_INCREF(Py_None);
23100 if (likely(et == PyExc_StopIteration)) {
23102 Py_INCREF(Py_None);
23105 #if PY_VERSION_HEX >= 0x030300A0 23106 else if (Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) {
23107 value = ((PyStopIterationObject *)ev)->value;
23112 else if (unlikely(PyTuple_Check(ev))) {
23113 if (PyTuple_GET_SIZE(ev) >= 1) {
23114 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 23115 value = PyTuple_GET_ITEM(ev, 0);
23118 value = PySequence_ITEM(ev, 0);
23121 Py_INCREF(Py_None);
23126 else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
23129 if (likely(value)) {
23135 }
else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
23136 __Pyx_ErrRestore(et, ev, tb);
23139 PyErr_NormalizeException(&et, &ev, &tb);
23140 if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
23141 __Pyx_ErrRestore(et, ev, tb);
23146 #if PY_VERSION_HEX >= 0x030300A0 23147 value = ((PyStopIterationObject *)ev)->value;
23152 PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args);
23154 if (likely(args)) {
23155 value = PySequence_GetItem(args, 0);
23158 if (unlikely(!value)) {
23159 __Pyx_ErrRestore(NULL, NULL, NULL);
23160 Py_INCREF(Py_None);
23168 static CYTHON_INLINE
23169 void __Pyx_Coroutine_ExceptionClear(__pyx_CoroutineObject *
self) {
23170 PyObject *exc_type =
self->exc_type;
23171 PyObject *exc_value =
self->exc_value;
23172 PyObject *exc_traceback =
self->exc_traceback;
23173 self->exc_type = NULL;
23174 self->exc_value = NULL;
23175 self->exc_traceback = NULL;
23176 Py_XDECREF(exc_type);
23177 Py_XDECREF(exc_value);
23178 Py_XDECREF(exc_traceback);
23180 #define __Pyx_Coroutine_AlreadyRunningError(gen) (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL) 23181 static void __Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject *gen) {
23184 #ifdef __Pyx_Coroutine_USED 23185 }
else if (__Pyx_Coroutine_Check((PyObject*)gen)) {
23186 msg =
"coroutine already executing";
23188 #ifdef __Pyx_AsyncGen_USED 23189 }
else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
23190 msg =
"async generator already executing";
23193 msg =
"generator already executing";
23195 PyErr_SetString(PyExc_ValueError, msg);
23197 #define __Pyx_Coroutine_NotStartedError(gen) (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL) 23198 static void __Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject *gen) {
23201 #ifdef __Pyx_Coroutine_USED 23202 }
else if (__Pyx_Coroutine_Check(gen)) {
23203 msg =
"can't send non-None value to a just-started coroutine";
23205 #ifdef __Pyx_AsyncGen_USED 23206 }
else if (__Pyx_AsyncGen_CheckExact(gen)) {
23207 msg =
"can't send non-None value to a just-started async generator";
23210 msg =
"can't send non-None value to a just-started generator";
23212 PyErr_SetString(PyExc_TypeError, msg);
23214 #define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing) (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL) 23215 static void __Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject *gen, PyObject *value, CYTHON_UNUSED
int closing) {
23216 #ifdef __Pyx_Coroutine_USED 23217 if (!closing && __Pyx_Coroutine_Check(gen)) {
23218 PyErr_SetString(PyExc_RuntimeError,
"cannot reuse already awaited coroutine");
23222 #ifdef __Pyx_AsyncGen_USED 23223 if (__Pyx_AsyncGen_CheckExact(gen))
23224 PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration);
23227 PyErr_SetNone(PyExc_StopIteration);
23231 PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *
self, PyObject *value,
int closing) {
23232 __Pyx_PyThreadState_declare
23233 PyThreadState *tstate;
23235 assert(!self->is_running);
23236 if (unlikely(self->resume_label == 0)) {
23237 if (unlikely(value && value != Py_None)) {
23238 return __Pyx_Coroutine_NotStartedError((PyObject*)
self);
23241 if (unlikely(self->resume_label == -1)) {
23242 return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)
self, value, closing);
23244 #if CYTHON_FAST_THREAD_STATE 23245 __Pyx_PyThreadState_assign
23246 tstate = __pyx_tstate;
23248 tstate = __Pyx_PyThreadState_Current;
23250 if (self->exc_type) {
23251 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON 23253 if (self->exc_traceback) {
23254 PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
23255 PyFrameObject *f = tb->tb_frame;
23256 Py_XINCREF(tstate->frame);
23257 assert(f->f_back == NULL);
23258 f->f_back = tstate->frame;
23261 __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value,
23262 &self->exc_traceback);
23264 __Pyx_Coroutine_ExceptionClear(
self);
23265 __Pyx_ExceptionSave(&self->exc_type, &self->exc_value, &self->exc_traceback);
23267 self->is_running = 1;
23268 retval =
self->body((PyObject *)
self, tstate, value);
23269 self->is_running = 0;
23272 static CYTHON_INLINE
void __Pyx_Coroutine_ResetFrameBackpointer(__pyx_CoroutineObject *
self) {
23273 if (likely(self->exc_traceback)) {
23274 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON 23276 PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
23277 PyFrameObject *f = tb->tb_frame;
23278 Py_CLEAR(f->f_back);
23282 static CYTHON_INLINE
23283 PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *retval) {
23284 if (unlikely(!retval)) {
23285 __Pyx_PyThreadState_declare
23286 __Pyx_PyThreadState_assign
23287 if (!__Pyx_PyErr_Occurred()) {
23288 PyObject *exc = PyExc_StopIteration;
23289 #ifdef __Pyx_AsyncGen_USED 23290 if (__Pyx_AsyncGen_CheckExact(gen))
23291 exc = __Pyx_PyExc_StopAsyncIteration;
23293 __Pyx_PyErr_SetNone(exc);
23298 static CYTHON_INLINE
23299 PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
23301 PyObject *val = NULL;
23302 __Pyx_Coroutine_Undelegate(gen);
23303 __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
23304 ret = __Pyx_Coroutine_SendEx(gen, val, 0);
23308 static PyObject *__Pyx_Coroutine_Send(PyObject *
self, PyObject *value) {
23310 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*)
self;
23311 PyObject *yf = gen->yieldfrom;
23312 if (unlikely(gen->is_running))
23313 return __Pyx_Coroutine_AlreadyRunningError(gen);
23316 gen->is_running = 1;
23317 #ifdef __Pyx_Generator_USED 23318 if (__Pyx_Generator_CheckExact(yf)) {
23319 ret = __Pyx_Coroutine_Send(yf, value);
23322 #ifdef __Pyx_Coroutine_USED 23323 if (__Pyx_Coroutine_Check(yf)) {
23324 ret = __Pyx_Coroutine_Send(yf, value);
23327 #ifdef __Pyx_AsyncGen_USED 23328 if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
23329 ret = __Pyx_async_gen_asend_send(yf, value);
23332 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) 23333 if (PyGen_CheckExact(yf)) {
23334 ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
23337 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) 23338 if (PyCoro_CheckExact(yf)) {
23339 ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
23343 if (value == Py_None)
23344 ret = Py_TYPE(yf)->tp_iternext(yf);
23346 ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
23348 gen->is_running = 0;
23352 retval = __Pyx_Coroutine_FinishDelegation(gen);
23354 retval = __Pyx_Coroutine_SendEx(gen, value, 0);
23356 return __Pyx_Coroutine_MethodReturn(
self, retval);
23358 static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
23359 PyObject *retval = NULL;
23361 #ifdef __Pyx_Generator_USED 23362 if (__Pyx_Generator_CheckExact(yf)) {
23363 retval = __Pyx_Coroutine_Close(yf);
23368 #ifdef __Pyx_Coroutine_USED 23369 if (__Pyx_Coroutine_Check(yf)) {
23370 retval = __Pyx_Coroutine_Close(yf);
23374 if (__Pyx_CoroutineAwait_CheckExact(yf)) {
23375 retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf);
23380 #ifdef __Pyx_AsyncGen_USED 23381 if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
23382 retval = __Pyx_async_gen_asend_close(yf, NULL);
23384 if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
23385 retval = __Pyx_async_gen_athrow_close(yf, NULL);
23390 gen->is_running = 1;
23391 meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close);
23392 if (unlikely(!meth)) {
23393 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
23394 PyErr_WriteUnraisable(yf);
23398 retval = PyObject_CallFunction(meth, NULL);
23403 gen->is_running = 0;
23405 Py_XDECREF(retval);
23408 static PyObject *__Pyx_Generator_Next(PyObject *
self) {
23409 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*)
self;
23410 PyObject *yf = gen->yieldfrom;
23411 if (unlikely(gen->is_running))
23412 return __Pyx_Coroutine_AlreadyRunningError(gen);
23415 gen->is_running = 1;
23416 #ifdef __Pyx_Generator_USED 23417 if (__Pyx_Generator_CheckExact(yf)) {
23418 ret = __Pyx_Generator_Next(yf);
23421 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) 23422 if (PyGen_CheckExact(yf)) {
23423 ret = _PyGen_Send((PyGenObject*)yf, NULL);
23426 #ifdef __Pyx_Coroutine_USED 23427 if (__Pyx_Coroutine_Check(yf)) {
23428 ret = __Pyx_Coroutine_Send(yf, Py_None);
23431 ret = Py_TYPE(yf)->tp_iternext(yf);
23432 gen->is_running = 0;
23436 return __Pyx_Coroutine_FinishDelegation(gen);
23438 return __Pyx_Coroutine_SendEx(gen, Py_None, 0);
23440 static PyObject *__Pyx_Coroutine_Close(PyObject *
self) {
23441 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
23442 PyObject *retval, *raised_exception;
23443 PyObject *yf = gen->yieldfrom;
23445 if (unlikely(gen->is_running))
23446 return __Pyx_Coroutine_AlreadyRunningError(gen);
23449 err = __Pyx_Coroutine_CloseIter(gen, yf);
23450 __Pyx_Coroutine_Undelegate(gen);
23454 PyErr_SetNone(PyExc_GeneratorExit);
23455 retval = __Pyx_Coroutine_SendEx(gen, NULL, 1);
23456 if (unlikely(retval)) {
23460 #ifdef __Pyx_Coroutine_USED 23461 }
else if (__Pyx_Coroutine_Check(
self)) {
23462 msg =
"coroutine ignored GeneratorExit";
23464 #ifdef __Pyx_AsyncGen_USED 23465 }
else if (__Pyx_AsyncGen_CheckExact(
self)) {
23466 #if PY_VERSION_HEX < 0x03060000 23467 msg =
"async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)";
23469 msg =
"async generator ignored GeneratorExit";
23473 msg =
"generator ignored GeneratorExit";
23475 PyErr_SetString(PyExc_RuntimeError, msg);
23478 raised_exception = PyErr_Occurred();
23479 if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) {
23480 if (raised_exception) PyErr_Clear();
23481 Py_INCREF(Py_None);
23486 static PyObject *__Pyx__Coroutine_Throw(PyObject *
self, PyObject *typ, PyObject *val, PyObject *tb,
23487 PyObject *args,
int close_on_genexit) {
23488 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
23489 PyObject *yf = gen->yieldfrom;
23490 if (unlikely(gen->is_running))
23491 return __Pyx_Coroutine_AlreadyRunningError(gen);
23495 if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
23496 int err = __Pyx_Coroutine_CloseIter(gen, yf);
23498 __Pyx_Coroutine_Undelegate(gen);
23500 return __Pyx_Coroutine_MethodReturn(
self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
23503 gen->is_running = 1;
23505 #ifdef __Pyx_Generator_USED
23506 || __Pyx_Generator_CheckExact(yf)
23508 #ifdef __Pyx_Coroutine_USED
23509 || __Pyx_Coroutine_Check(yf)
23512 ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
23513 #ifdef __Pyx_Coroutine_USED 23514 }
else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
23515 ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
23518 PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw);
23519 if (unlikely(!meth)) {
23521 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
23522 gen->is_running = 0;
23526 __Pyx_Coroutine_Undelegate(gen);
23527 gen->is_running = 0;
23530 if (likely(args)) {
23531 ret = PyObject_CallObject(meth, args);
23533 ret = PyObject_CallFunctionObjArgs(meth, typ, val, tb, NULL);
23537 gen->is_running = 0;
23540 ret = __Pyx_Coroutine_FinishDelegation(gen);
23542 return __Pyx_Coroutine_MethodReturn(
self, ret);
23545 __Pyx_Raise(typ, val, tb, NULL);
23546 return __Pyx_Coroutine_MethodReturn(
self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
23548 static PyObject *__Pyx_Coroutine_Throw(PyObject *
self, PyObject *args) {
23550 PyObject *val = NULL;
23551 PyObject *tb = NULL;
23552 if (!PyArg_UnpackTuple(args, (
char *)
"throw", 1, 3, &typ, &val, &tb))
23554 return __Pyx__Coroutine_Throw(
self, typ, val, tb, args, 1);
23556 static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit,
void *arg) {
23557 Py_VISIT(gen->closure);
23558 Py_VISIT(gen->classobj);
23559 Py_VISIT(gen->yieldfrom);
23560 Py_VISIT(gen->exc_type);
23561 Py_VISIT(gen->exc_value);
23562 Py_VISIT(gen->exc_traceback);
23565 static int __Pyx_Coroutine_clear(PyObject *
self) {
23566 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
23567 Py_CLEAR(gen->closure);
23568 Py_CLEAR(gen->classobj);
23569 Py_CLEAR(gen->yieldfrom);
23570 Py_CLEAR(gen->exc_type);
23571 Py_CLEAR(gen->exc_value);
23572 Py_CLEAR(gen->exc_traceback);
23573 #ifdef __Pyx_AsyncGen_USED 23574 if (__Pyx_AsyncGen_CheckExact(
self)) {
23575 Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
23578 Py_CLEAR(gen->gi_code);
23579 Py_CLEAR(gen->gi_name);
23580 Py_CLEAR(gen->gi_qualname);
23581 Py_CLEAR(gen->gi_modulename);
23584 static void __Pyx_Coroutine_dealloc(PyObject *
self) {
23585 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
23586 PyObject_GC_UnTrack(gen);
23587 if (gen->gi_weakreflist != NULL)
23588 PyObject_ClearWeakRefs(
self);
23589 if (gen->resume_label >= 0) {
23590 PyObject_GC_Track(
self);
23591 #if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE 23592 if (PyObject_CallFinalizerFromDealloc(
self))
23594 Py_TYPE(gen)->tp_del(
self);
23595 if (self->ob_refcnt > 0)
23600 PyObject_GC_UnTrack(
self);
23602 #ifdef __Pyx_AsyncGen_USED 23603 if (__Pyx_AsyncGen_CheckExact(
self)) {
23607 Py_CLEAR(((__pyx_PyAsyncGenObject*)
self)->ag_finalizer);
23610 __Pyx_Coroutine_clear(
self);
23611 PyObject_GC_Del(gen);
23613 static void __Pyx_Coroutine_del(PyObject *
self) {
23614 PyObject *error_type, *error_value, *error_traceback;
23615 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
23616 __Pyx_PyThreadState_declare
23617 if (gen->resume_label < 0) {
23620 #if !CYTHON_USE_TP_FINALIZE 23621 assert(self->ob_refcnt == 0);
23622 self->ob_refcnt = 1;
23624 __Pyx_PyThreadState_assign
23625 __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
23626 #ifdef __Pyx_AsyncGen_USED 23627 if (__Pyx_AsyncGen_CheckExact(
self)) {
23628 __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)
self;
23629 PyObject *finalizer = agen->ag_finalizer;
23630 if (finalizer && !agen->ag_closed) {
23631 PyObject *res = __Pyx_PyObject_CallOneArg(finalizer,
self);
23632 if (unlikely(!res)) {
23633 PyErr_WriteUnraisable(
self);
23637 __Pyx_ErrRestore(error_type, error_value, error_traceback);
23642 if (unlikely(gen->resume_label == 0 && !error_value)) {
23643 #ifdef __Pyx_Coroutine_USED 23644 #ifdef __Pyx_Generator_USED 23645 if (!__Pyx_Generator_CheckExact(
self))
23648 PyObject_GC_UnTrack(
self);
23649 #if PY_MAJOR_VERSION >= 3 || defined(PyErr_WarnFormat) 23650 if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1,
"coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
23651 PyErr_WriteUnraisable(
self);
23655 #if CYTHON_COMPILING_IN_PYPY 23657 cmsg = (
char*)
"coroutine was never awaited";
23660 PyObject *qualname;
23661 qualname = gen->gi_qualname;
23662 cname = PyString_AS_STRING(qualname);
23663 msg = PyString_FromFormat(
"coroutine '%.50s' was never awaited", cname);
23664 if (unlikely(!msg)) {
23666 cmsg = (
char*)
"coroutine was never awaited";
23668 cmsg = PyString_AS_STRING(msg);
23671 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0))
23672 PyErr_WriteUnraisable(
self);
23675 PyObject_GC_Track(
self);
23679 PyObject *res = __Pyx_Coroutine_Close(
self);
23680 if (unlikely(!res)) {
23681 if (PyErr_Occurred())
23682 PyErr_WriteUnraisable(
self);
23687 __Pyx_ErrRestore(error_type, error_value, error_traceback);
23688 #if !CYTHON_USE_TP_FINALIZE 23689 assert(self->ob_refcnt > 0);
23690 if (--self->ob_refcnt == 0) {
23694 Py_ssize_t refcnt =
self->ob_refcnt;
23695 _Py_NewReference(
self);
23696 self->ob_refcnt = refcnt;
23698 #if CYTHON_COMPILING_IN_CPYTHON 23699 assert(PyType_IS_GC(self->ob_type) &&
23700 _Py_AS_GC(
self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
23703 #ifdef COUNT_ALLOCS 23704 --Py_TYPE(
self)->tp_frees;
23705 --Py_TYPE(
self)->tp_allocs;
23710 __Pyx_Coroutine_get_name(__pyx_CoroutineObject *
self)
23712 PyObject *name =
self->gi_name;
23713 if (unlikely(!name)) name = Py_None;
23718 __Pyx_Coroutine_set_name(__pyx_CoroutineObject *
self, PyObject *value)
23721 #if PY_MAJOR_VERSION >= 3 23722 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
23724 if (unlikely(value == NULL || !PyString_Check(value))) {
23726 PyErr_SetString(PyExc_TypeError,
23727 "__name__ must be set to a string object");
23730 tmp =
self->gi_name;
23732 self->gi_name = value;
23737 __Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *
self)
23739 PyObject *name =
self->gi_qualname;
23740 if (unlikely(!name)) name = Py_None;
23745 __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *
self, PyObject *value)
23748 #if PY_MAJOR_VERSION >= 3 23749 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
23751 if (unlikely(value == NULL || !PyString_Check(value))) {
23753 PyErr_SetString(PyExc_TypeError,
23754 "__qualname__ must be set to a string object");
23757 tmp =
self->gi_qualname;
23759 self->gi_qualname = value;
23763 static __pyx_CoroutineObject *__Pyx__Coroutine_New(
23764 PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
23765 PyObject *name, PyObject *qualname, PyObject *module_name) {
23766 __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
23767 if (unlikely(!gen))
23769 return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name);
23771 static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
23772 __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
23773 PyObject *name, PyObject *qualname, PyObject *module_name) {
23775 gen->closure = closure;
23776 Py_XINCREF(closure);
23777 gen->is_running = 0;
23778 gen->resume_label = 0;
23779 gen->classobj = NULL;
23780 gen->yieldfrom = NULL;
23781 gen->exc_type = NULL;
23782 gen->exc_value = NULL;
23783 gen->exc_traceback = NULL;
23784 gen->gi_weakreflist = NULL;
23785 Py_XINCREF(qualname);
23786 gen->gi_qualname = qualname;
23788 gen->gi_name = name;
23789 Py_XINCREF(module_name);
23790 gen->gi_modulename = module_name;
23792 gen->gi_code = code;
23793 PyObject_GC_Track(gen);
23798 static PyObject* __Pyx_Coroutine_patch_module(PyObject* module,
const char* py_code) {
23799 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) 23801 PyObject *globals, *result_obj;
23802 globals = PyDict_New();
if (unlikely(!globals))
goto ignore;
23803 result = PyDict_SetItemString(globals,
"_cython_coroutine_type",
23804 #ifdef __Pyx_Coroutine_USED
23805 (PyObject*)__pyx_CoroutineType);
23809 if (unlikely(result < 0))
goto ignore;
23810 result = PyDict_SetItemString(globals,
"_cython_generator_type",
23811 #ifdef __Pyx_Generator_USED
23812 (PyObject*)__pyx_GeneratorType);
23816 if (unlikely(result < 0))
goto ignore;
23817 if (unlikely(PyDict_SetItemString(globals,
"_module", module) < 0))
goto ignore;
23818 if (unlikely(PyDict_SetItemString(globals,
"__builtins__", __pyx_b) < 0))
goto ignore;
23819 result_obj = PyRun_String(py_code, Py_file_input, globals, globals);
23820 if (unlikely(!result_obj))
goto ignore;
23821 Py_DECREF(result_obj);
23822 Py_DECREF(globals);
23825 Py_XDECREF(globals);
23826 PyErr_WriteUnraisable(module);
23827 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
"Cython module failed to patch module with custom type", 1) < 0)) {
23838 #ifndef CYTHON_REGISTER_ABCS 23839 #define CYTHON_REGISTER_ABCS 1 23841 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) 23842 static PyObject* __Pyx_patch_abc_module(PyObject *module);
23843 static PyObject* __Pyx_patch_abc_module(PyObject *module) {
23844 module = __Pyx_Coroutine_patch_module(
23846 "if _cython_generator_type is not None:\n" 23847 " try: Generator = _module.Generator\n" 23848 " except AttributeError: pass\n" 23849 " else: Generator.register(_cython_generator_type)\n" 23850 "if _cython_coroutine_type is not None:\n" 23851 " try: Coroutine = _module.Coroutine\n" 23852 " except AttributeError: pass\n" 23853 " else: Coroutine.register(_cython_coroutine_type)\n" 23858 static int __Pyx_patch_abc(
void) {
23859 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) 23860 static int abc_patched = 0;
23861 if (CYTHON_REGISTER_ABCS && !abc_patched) {
23863 module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ?
"collections.abc" :
"collections");
23865 PyErr_WriteUnraisable(NULL);
23866 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
23867 ((PY_MAJOR_VERSION >= 3) ?
23868 "Cython module failed to register with collections.abc module" :
23869 "Cython module failed to register with collections module"), 1) < 0)) {
23873 module = __Pyx_patch_abc_module(module);
23875 if (unlikely(!module))
23879 module = PyImport_ImportModule(
"backports_abc");
23881 module = __Pyx_patch_abc_module(module);
23882 Py_XDECREF(module);
23889 if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL);
23895 static PyMethodDef __pyx_Generator_methods[] = {
23896 {
"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
23897 (
char*) PyDoc_STR(
"send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
23898 {
"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
23899 (
char*) PyDoc_STR(
"throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
23900 {
"close", (PyCFunction) __Pyx_Coroutine_Close, METH_NOARGS,
23901 (
char*) PyDoc_STR(
"close() -> raise GeneratorExit inside generator.")},
23904 static PyMemberDef __pyx_Generator_memberlist[] = {
23905 {(
char *)
"gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL},
23906 {(
char*)
"gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
23907 (
char*) PyDoc_STR(
"object being iterated by 'yield from', or None")},
23908 {(
char*)
"gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
23911 static PyGetSetDef __pyx_Generator_getsets[] = {
23912 {(
char *)
"__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
23913 (
char*) PyDoc_STR(
"name of the generator"), 0},
23914 {(
char *)
"__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
23915 (
char*) PyDoc_STR(
"qualified name of the generator"), 0},
23918 static PyTypeObject __pyx_GeneratorType_type = {
23919 PyVarObject_HEAD_INIT(0, 0)
23921 sizeof(__pyx_CoroutineObject),
23923 (destructor) __Pyx_Coroutine_dealloc,
23938 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
23940 (traverseproc) __Pyx_Coroutine_traverse,
23943 offsetof(__pyx_CoroutineObject, gi_weakreflist),
23945 (iternextfunc) __Pyx_Generator_Next,
23946 __pyx_Generator_methods,
23947 __pyx_Generator_memberlist,
23948 __pyx_Generator_getsets,
23964 #
if CYTHON_USE_TP_FINALIZE
23967 __Pyx_Coroutine_del,
23970 #
if CYTHON_USE_TP_FINALIZE
23971 __Pyx_Coroutine_del,
23972 #elif PY_VERSION_HEX >= 0x030400a1
23976 static int __pyx_Generator_init(
void) {
23977 __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
23978 __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
23979 __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
23980 if (unlikely(!__pyx_GeneratorType)) {
23987 static int __Pyx_check_binary_version(
void) {
23988 char ctversion[4], rtversion[4];
23989 PyOS_snprintf(ctversion, 4,
"%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
23990 PyOS_snprintf(rtversion, 4,
"%s", Py_GetVersion());
23991 if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
23993 PyOS_snprintf(message,
sizeof(message),
23994 "compiletime version %s of module '%.100s' " 23995 "does not match runtime version %s",
23996 ctversion, __Pyx_MODULE_NAME, rtversion);
23997 return PyErr_WarnEx(NULL, message, 1);
24003 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
24005 #if PY_MAJOR_VERSION < 3 24006 if (t->is_unicode) {
24007 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
24008 }
else if (t->intern) {
24009 *t->p = PyString_InternFromString(t->s);
24011 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
24014 if (t->is_unicode | t->is_str) {
24016 *t->p = PyUnicode_InternFromString(t->s);
24017 }
else if (t->encoding) {
24018 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
24020 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
24023 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
24028 if (PyObject_Hash(*t->p) == -1)
24035 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
24036 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
24038 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
24040 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
24042 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 24043 #if !CYTHON_PEP393_ENABLED 24044 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
24046 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
24047 if (!defenc)
return NULL;
24048 defenc_c = PyBytes_AS_STRING(defenc);
24049 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 24051 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
24053 for (c = defenc_c; c < end; c++) {
24054 if ((
unsigned char) (*c) >= 128) {
24055 PyUnicode_AsASCIIString(o);
24061 *length = PyBytes_GET_SIZE(defenc);
24065 static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
24066 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
24067 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 24068 if (likely(PyUnicode_IS_ASCII(o))) {
24069 *length = PyUnicode_GET_LENGTH(o);
24070 return PyUnicode_AsUTF8(o);
24072 PyUnicode_AsASCIIString(o);
24076 return PyUnicode_AsUTF8AndSize(o, length);
24081 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
24082 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 24084 #
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
24085 __Pyx_sys_getdefaultencoding_not_ascii &&
24087 PyUnicode_Check(o)) {
24088 return __Pyx_PyUnicode_AsStringAndSize(o, length);
24091 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) 24092 if (PyByteArray_Check(o)) {
24093 *length = PyByteArray_GET_SIZE(o);
24094 return PyByteArray_AS_STRING(o);
24099 int r = PyBytes_AsStringAndSize(o, &result, length);
24100 if (unlikely(r < 0)) {
24107 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
24108 int is_true = x == Py_True;
24109 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
24110 else return PyObject_IsTrue(x);
24112 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result,
const char* type_name) {
24113 #if PY_MAJOR_VERSION >= 3 24114 if (PyLong_Check(result)) {
24115 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
24116 "__int__ returned non-int (type %.200s). " 24117 "The ability to return an instance of a strict subclass of int " 24118 "is deprecated, and may be removed in a future version of Python.",
24119 Py_TYPE(result)->tp_name)) {
24126 PyErr_Format(PyExc_TypeError,
24127 "__%.4s__ returned non-%.4s (type %.200s)",
24128 type_name, type_name, Py_TYPE(result)->tp_name);
24132 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
24133 #if CYTHON_USE_TYPE_SLOTS 24134 PyNumberMethods *m;
24136 const char *name = NULL;
24137 PyObject *res = NULL;
24138 #if PY_MAJOR_VERSION < 3 24139 if (likely(PyInt_Check(x) || PyLong_Check(x)))
24141 if (likely(PyLong_Check(x)))
24143 return __Pyx_NewRef(x);
24144 #if CYTHON_USE_TYPE_SLOTS 24145 m = Py_TYPE(x)->tp_as_number;
24146 #if PY_MAJOR_VERSION < 3 24147 if (m && m->nb_int) {
24149 res = m->nb_int(x);
24151 else if (m && m->nb_long) {
24153 res = m->nb_long(x);
24156 if (likely(m && m->nb_int)) {
24158 res = m->nb_int(x);
24162 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
24163 res = PyNumber_Int(x);
24167 #if PY_MAJOR_VERSION < 3 24168 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
24170 if (unlikely(!PyLong_CheckExact(res))) {
24172 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
24175 else if (!PyErr_Occurred()) {
24176 PyErr_SetString(PyExc_TypeError,
24177 "an integer is required");
24181 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
24184 #if PY_MAJOR_VERSION < 3 24185 if (likely(PyInt_CheckExact(b))) {
24186 if (
sizeof(Py_ssize_t) >=
sizeof(
long))
24187 return PyInt_AS_LONG(b);
24189 return PyInt_AsSsize_t(x);
24192 if (likely(PyLong_CheckExact(b))) {
24193 #if CYTHON_USE_PYLONG_INTERNALS 24194 const digit* digits = ((PyLongObject*)b)->ob_digit;
24195 const Py_ssize_t size = Py_SIZE(b);
24196 if (likely(__Pyx_sst_abs(size) <= 1)) {
24197 ival = likely(size) ? digits[0] : 0;
24198 if (size == -1) ival = -ival;
24203 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
24204 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
24208 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
24209 return -(Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
24213 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
24214 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
24218 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
24219 return -(Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
24223 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
24224 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]));
24228 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
24229 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]));
24235 return PyLong_AsSsize_t(b);
24237 x = PyNumber_Index(b);
24239 ival = PyInt_AsSsize_t(x);
24243 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
24244 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
24246 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
24247 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)].