56 #define PY_SSIZE_T_CLEAN 59 #error Python headers needed to compile C extensions, please install development version of Python. 60 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) 61 #error Cython requires Python 2.6+ or Python 3.3+. 63 #define CYTHON_ABI "0_29_6" 64 #define CYTHON_HEX_VERSION 0x001D06F0 65 #define CYTHON_FUTURE_DIVISION 0 68 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) 70 #if !defined(WIN32) && !defined(MS_WINDOWS) 82 #define DL_IMPORT(t) t 85 #define DL_EXPORT(t) t 88 #ifndef HAVE_LONG_LONG 89 #if PY_VERSION_HEX >= 0x02070000 90 #define HAVE_LONG_LONG 94 #define PY_LONG_LONG LONG_LONG 97 #define Py_HUGE_VAL HUGE_VAL 100 #define CYTHON_COMPILING_IN_PYPY 1 101 #define CYTHON_COMPILING_IN_PYSTON 0 102 #define CYTHON_COMPILING_IN_CPYTHON 0 103 #undef CYTHON_USE_TYPE_SLOTS 104 #define CYTHON_USE_TYPE_SLOTS 0 105 #undef CYTHON_USE_PYTYPE_LOOKUP 106 #define CYTHON_USE_PYTYPE_LOOKUP 0 107 #if PY_VERSION_HEX < 0x03050000 108 #undef CYTHON_USE_ASYNC_SLOTS 109 #define CYTHON_USE_ASYNC_SLOTS 0 110 #elif !defined(CYTHON_USE_ASYNC_SLOTS) 111 #define CYTHON_USE_ASYNC_SLOTS 1 113 #undef CYTHON_USE_PYLIST_INTERNALS 114 #define CYTHON_USE_PYLIST_INTERNALS 0 115 #undef CYTHON_USE_UNICODE_INTERNALS 116 #define CYTHON_USE_UNICODE_INTERNALS 0 117 #undef CYTHON_USE_UNICODE_WRITER 118 #define CYTHON_USE_UNICODE_WRITER 0 119 #undef CYTHON_USE_PYLONG_INTERNALS 120 #define CYTHON_USE_PYLONG_INTERNALS 0 121 #undef CYTHON_AVOID_BORROWED_REFS 122 #define CYTHON_AVOID_BORROWED_REFS 1 123 #undef CYTHON_ASSUME_SAFE_MACROS 124 #define CYTHON_ASSUME_SAFE_MACROS 0 125 #undef CYTHON_UNPACK_METHODS 126 #define CYTHON_UNPACK_METHODS 0 127 #undef CYTHON_FAST_THREAD_STATE 128 #define CYTHON_FAST_THREAD_STATE 0 129 #undef CYTHON_FAST_PYCALL 130 #define CYTHON_FAST_PYCALL 0 131 #undef CYTHON_PEP489_MULTI_PHASE_INIT 132 #define CYTHON_PEP489_MULTI_PHASE_INIT 0 133 #undef CYTHON_USE_TP_FINALIZE 134 #define CYTHON_USE_TP_FINALIZE 0 135 #undef CYTHON_USE_DICT_VERSIONS 136 #define CYTHON_USE_DICT_VERSIONS 0 137 #undef CYTHON_USE_EXC_INFO_STACK 138 #define CYTHON_USE_EXC_INFO_STACK 0 139 #elif defined(PYSTON_VERSION) 140 #define CYTHON_COMPILING_IN_PYPY 0 141 #define CYTHON_COMPILING_IN_PYSTON 1 142 #define CYTHON_COMPILING_IN_CPYTHON 0 143 #ifndef CYTHON_USE_TYPE_SLOTS 144 #define CYTHON_USE_TYPE_SLOTS 1 146 #undef CYTHON_USE_PYTYPE_LOOKUP 147 #define CYTHON_USE_PYTYPE_LOOKUP 0 148 #undef CYTHON_USE_ASYNC_SLOTS 149 #define CYTHON_USE_ASYNC_SLOTS 0 150 #undef CYTHON_USE_PYLIST_INTERNALS 151 #define CYTHON_USE_PYLIST_INTERNALS 0 152 #ifndef CYTHON_USE_UNICODE_INTERNALS 153 #define CYTHON_USE_UNICODE_INTERNALS 1 155 #undef CYTHON_USE_UNICODE_WRITER 156 #define CYTHON_USE_UNICODE_WRITER 0 157 #undef CYTHON_USE_PYLONG_INTERNALS 158 #define CYTHON_USE_PYLONG_INTERNALS 0 159 #ifndef CYTHON_AVOID_BORROWED_REFS 160 #define CYTHON_AVOID_BORROWED_REFS 0 162 #ifndef CYTHON_ASSUME_SAFE_MACROS 163 #define CYTHON_ASSUME_SAFE_MACROS 1 165 #ifndef CYTHON_UNPACK_METHODS 166 #define CYTHON_UNPACK_METHODS 1 168 #undef CYTHON_FAST_THREAD_STATE 169 #define CYTHON_FAST_THREAD_STATE 0 170 #undef CYTHON_FAST_PYCALL 171 #define CYTHON_FAST_PYCALL 0 172 #undef CYTHON_PEP489_MULTI_PHASE_INIT 173 #define CYTHON_PEP489_MULTI_PHASE_INIT 0 174 #undef CYTHON_USE_TP_FINALIZE 175 #define CYTHON_USE_TP_FINALIZE 0 176 #undef CYTHON_USE_DICT_VERSIONS 177 #define CYTHON_USE_DICT_VERSIONS 0 178 #undef CYTHON_USE_EXC_INFO_STACK 179 #define CYTHON_USE_EXC_INFO_STACK 0 181 #define CYTHON_COMPILING_IN_PYPY 0 182 #define CYTHON_COMPILING_IN_PYSTON 0 183 #define CYTHON_COMPILING_IN_CPYTHON 1 184 #ifndef CYTHON_USE_TYPE_SLOTS 185 #define CYTHON_USE_TYPE_SLOTS 1 187 #if PY_VERSION_HEX < 0x02070000 188 #undef CYTHON_USE_PYTYPE_LOOKUP 189 #define CYTHON_USE_PYTYPE_LOOKUP 0 190 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) 191 #define CYTHON_USE_PYTYPE_LOOKUP 1 193 #if PY_MAJOR_VERSION < 3 194 #undef CYTHON_USE_ASYNC_SLOTS 195 #define CYTHON_USE_ASYNC_SLOTS 0 196 #elif !defined(CYTHON_USE_ASYNC_SLOTS) 197 #define CYTHON_USE_ASYNC_SLOTS 1 199 #if PY_VERSION_HEX < 0x02070000 200 #undef CYTHON_USE_PYLONG_INTERNALS 201 #define CYTHON_USE_PYLONG_INTERNALS 0 202 #elif !defined(CYTHON_USE_PYLONG_INTERNALS) 203 #define CYTHON_USE_PYLONG_INTERNALS 1 205 #ifndef CYTHON_USE_PYLIST_INTERNALS 206 #define CYTHON_USE_PYLIST_INTERNALS 1 208 #ifndef CYTHON_USE_UNICODE_INTERNALS 209 #define CYTHON_USE_UNICODE_INTERNALS 1 211 #if PY_VERSION_HEX < 0x030300F0 212 #undef CYTHON_USE_UNICODE_WRITER 213 #define CYTHON_USE_UNICODE_WRITER 0 214 #elif !defined(CYTHON_USE_UNICODE_WRITER) 215 #define CYTHON_USE_UNICODE_WRITER 1 217 #ifndef CYTHON_AVOID_BORROWED_REFS 218 #define CYTHON_AVOID_BORROWED_REFS 0 220 #ifndef CYTHON_ASSUME_SAFE_MACROS 221 #define CYTHON_ASSUME_SAFE_MACROS 1 223 #ifndef CYTHON_UNPACK_METHODS 224 #define CYTHON_UNPACK_METHODS 1 226 #ifndef CYTHON_FAST_THREAD_STATE 227 #define CYTHON_FAST_THREAD_STATE 1 229 #ifndef CYTHON_FAST_PYCALL 230 #define CYTHON_FAST_PYCALL 1 232 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT 233 #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) 235 #ifndef CYTHON_USE_TP_FINALIZE 236 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) 238 #ifndef CYTHON_USE_DICT_VERSIONS 239 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) 241 #ifndef CYTHON_USE_EXC_INFO_STACK 242 #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) 245 #if !defined(CYTHON_FAST_PYCCALL) 246 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) 248 #if CYTHON_USE_PYLONG_INTERNALS 249 #include "longintrepr.h" 254 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P ==
sizeof(
void*)) };
257 #ifndef __has_attribute 258 #define __has_attribute(x) 0 260 #ifndef __has_cpp_attribute 261 #define __has_cpp_attribute(x) 0 263 #ifndef CYTHON_RESTRICT 264 #if defined(__GNUC__) 265 #define CYTHON_RESTRICT __restrict__ 266 #elif defined(_MSC_VER) && _MSC_VER >= 1400 267 #define CYTHON_RESTRICT __restrict 268 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 269 #define CYTHON_RESTRICT restrict 271 #define CYTHON_RESTRICT 274 #ifndef CYTHON_UNUSED 275 # if defined(__GNUC__) 276 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) 277 # define CYTHON_UNUSED __attribute__ ((__unused__)) 279 # define CYTHON_UNUSED 281 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) 282 # define CYTHON_UNUSED __attribute__ ((__unused__)) 284 # define CYTHON_UNUSED 287 #ifndef CYTHON_MAYBE_UNUSED_VAR 288 # if defined(__cplusplus) 289 template<
class T>
void CYTHON_MAYBE_UNUSED_VAR(
const T& ) { }
291 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) 294 #ifndef CYTHON_NCP_UNUSED 295 # if CYTHON_COMPILING_IN_CPYTHON 296 # define CYTHON_NCP_UNUSED 298 # define CYTHON_NCP_UNUSED CYTHON_UNUSED 301 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) 303 #ifndef _MSC_STDINT_H_ 305 typedef unsigned char uint8_t;
306 typedef unsigned int uint32_t;
308 typedef unsigned __int8 uint8_t;
309 typedef unsigned __int32 uint32_t;
315 #ifndef CYTHON_FALLTHROUGH 316 #if defined(__cplusplus) && __cplusplus >= 201103L 317 #if __has_cpp_attribute(fallthrough) 318 #define CYTHON_FALLTHROUGH [[fallthrough]] 319 #elif __has_cpp_attribute(clang::fallthrough) 320 #define CYTHON_FALLTHROUGH [[clang::fallthrough]] 321 #elif __has_cpp_attribute(gnu::fallthrough) 322 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] 325 #ifndef CYTHON_FALLTHROUGH 326 #if __has_attribute(fallthrough) 327 #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) 329 #define CYTHON_FALLTHROUGH 332 #if defined(__clang__ ) && defined(__apple_build_version__) 333 #if __apple_build_version__ < 7000000 334 #undef CYTHON_FALLTHROUGH 335 #define CYTHON_FALLTHROUGH 341 #error "Cython files generated with the C++ option must be compiled with a C++ compiler." 343 #ifndef CYTHON_INLINE 344 #if defined(__clang__) 345 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) 347 #define CYTHON_INLINE inline 351 void __Pyx_call_destructor(T& x) {
355 class __Pyx_FakeReference {
357 __Pyx_FakeReference() : ptr(NULL) { }
358 __Pyx_FakeReference(
const T& ref) : ptr(const_cast<T*>(&ref)) { }
359 T *operator->() {
return ptr; }
361 operator T&() {
return *ptr; }
362 template<
typename U>
bool operator ==(U other) {
return *ptr == other; }
363 template<
typename U>
bool operator !=(U other) {
return *ptr != other; }
368 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) 369 #define Py_OptimizeFlag 0 371 #define __PYX_BUILD_PY_SSIZE_T "n" 372 #define CYTHON_FORMAT_SSIZE_T "z" 373 #if PY_MAJOR_VERSION < 3 374 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" 375 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ 376 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) 377 #define __Pyx_DefaultClassType PyClass_Type 379 #define __Pyx_BUILTIN_MODULE_NAME "builtins" 380 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ 381 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) 382 #define __Pyx_DefaultClassType PyType_Type 384 #ifndef Py_TPFLAGS_CHECKTYPES 385 #define Py_TPFLAGS_CHECKTYPES 0 387 #ifndef Py_TPFLAGS_HAVE_INDEX 388 #define Py_TPFLAGS_HAVE_INDEX 0 390 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER 391 #define Py_TPFLAGS_HAVE_NEWBUFFER 0 393 #ifndef Py_TPFLAGS_HAVE_FINALIZE 394 #define Py_TPFLAGS_HAVE_FINALIZE 0 396 #ifndef METH_STACKLESS 397 #define METH_STACKLESS 0 399 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) 400 #ifndef METH_FASTCALL 401 #define METH_FASTCALL 0x80 403 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *
self, PyObject *
const *args, Py_ssize_t nargs);
404 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *
self, PyObject *
const *args,
405 Py_ssize_t nargs, PyObject *kwnames);
407 #define __Pyx_PyCFunctionFast _PyCFunctionFast 408 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords 410 #if CYTHON_FAST_PYCCALL 411 #define __Pyx_PyFastCFunction_Check(func)\ 412 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) 414 #define __Pyx_PyFastCFunction_Check(func) 0 416 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) 417 #define PyObject_Malloc(s) PyMem_Malloc(s) 418 #define PyObject_Free(p) PyMem_Free(p) 419 #define PyObject_Realloc(p) PyMem_Realloc(p) 421 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 422 #define PyMem_RawMalloc(n) PyMem_Malloc(n) 423 #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) 424 #define PyMem_RawFree(p) PyMem_Free(p) 426 #if CYTHON_COMPILING_IN_PYSTON 427 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) 428 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) 430 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) 431 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) 433 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 434 #define __Pyx_PyThreadState_Current PyThreadState_GET() 435 #elif PY_VERSION_HEX >= 0x03060000 436 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() 437 #elif PY_VERSION_HEX >= 0x03000000 438 #define __Pyx_PyThreadState_Current PyThreadState_GET() 440 #define __Pyx_PyThreadState_Current _PyThreadState_Current 442 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) 443 #include "pythread.h" 444 #define Py_tss_NEEDS_INIT 0 445 typedef int Py_tss_t;
446 static CYTHON_INLINE
int PyThread_tss_create(Py_tss_t *key) {
447 *key = PyThread_create_key();
450 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(
void) {
451 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(
sizeof(Py_tss_t));
452 *key = Py_tss_NEEDS_INIT;
455 static CYTHON_INLINE
void PyThread_tss_free(Py_tss_t *key) {
458 static CYTHON_INLINE
int PyThread_tss_is_created(Py_tss_t *key) {
459 return *key != Py_tss_NEEDS_INIT;
461 static CYTHON_INLINE
void PyThread_tss_delete(Py_tss_t *key) {
462 PyThread_delete_key(*key);
463 *key = Py_tss_NEEDS_INIT;
465 static CYTHON_INLINE
int PyThread_tss_set(Py_tss_t *key,
void *value) {
466 return PyThread_set_key_value(*key, value);
468 static CYTHON_INLINE
void * PyThread_tss_get(Py_tss_t *key) {
469 return PyThread_get_key_value(*key);
472 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) 473 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) 475 #define __Pyx_PyDict_NewPresized(n) PyDict_New() 477 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION 478 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) 479 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) 481 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) 482 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) 484 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS 485 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) 487 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) 489 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) 490 #define CYTHON_PEP393_ENABLED 1 491 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 492 0 : _PyUnicode_Ready((PyObject *)(op))) 493 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) 494 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) 495 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) 496 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) 497 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) 498 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) 499 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) 500 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) 502 #define CYTHON_PEP393_ENABLED 0 503 #define PyUnicode_1BYTE_KIND 1 504 #define PyUnicode_2BYTE_KIND 2 505 #define PyUnicode_4BYTE_KIND 4 506 #define __Pyx_PyUnicode_READY(op) (0) 507 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) 508 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) 509 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) 510 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) 511 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) 512 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) 513 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) 514 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) 516 #if CYTHON_COMPILING_IN_PYPY 517 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) 518 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) 520 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) 521 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ 522 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) 524 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) 525 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) 527 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) 528 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) 530 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) 531 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) 533 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) 534 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) 535 #if PY_MAJOR_VERSION >= 3 536 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) 538 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) 540 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) 541 #define PyObject_ASCII(o) PyObject_Repr(o) 543 #if PY_MAJOR_VERSION >= 3 544 #define PyBaseString_Type PyUnicode_Type 545 #define PyStringObject PyUnicodeObject 546 #define PyString_Type PyUnicode_Type 547 #define PyString_Check PyUnicode_Check 548 #define PyString_CheckExact PyUnicode_CheckExact 549 #define PyObject_Unicode PyObject_Str 551 #if PY_MAJOR_VERSION >= 3 552 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) 553 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) 555 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) 556 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) 558 #ifndef PySet_CheckExact 559 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) 561 #if CYTHON_ASSUME_SAFE_MACROS 562 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) 564 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) 566 #if PY_MAJOR_VERSION >= 3 567 #define PyIntObject PyLongObject 568 #define PyInt_Type PyLong_Type 569 #define PyInt_Check(op) PyLong_Check(op) 570 #define PyInt_CheckExact(op) PyLong_CheckExact(op) 571 #define PyInt_FromString PyLong_FromString 572 #define PyInt_FromUnicode PyLong_FromUnicode 573 #define PyInt_FromLong PyLong_FromLong 574 #define PyInt_FromSize_t PyLong_FromSize_t 575 #define PyInt_FromSsize_t PyLong_FromSsize_t 576 #define PyInt_AsLong PyLong_AsLong 577 #define PyInt_AS_LONG PyLong_AS_LONG 578 #define PyInt_AsSsize_t PyLong_AsSsize_t 579 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask 580 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask 581 #define PyNumber_Int PyNumber_Long 583 #if PY_MAJOR_VERSION >= 3 584 #define PyBoolObject PyLongObject 586 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY 587 #ifndef PyUnicode_InternFromString 588 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) 591 #if PY_VERSION_HEX < 0x030200A4 592 typedef long Py_hash_t;
593 #define __Pyx_PyInt_FromHash_t PyInt_FromLong 594 #define __Pyx_PyInt_AsHash_t PyInt_AsLong 596 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t 597 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t 599 #if PY_MAJOR_VERSION >= 3 600 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) 602 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) 604 #if CYTHON_USE_ASYNC_SLOTS 605 #if PY_VERSION_HEX >= 0x030500B1 606 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods 607 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) 609 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) 612 #define __Pyx_PyType_AsAsync(obj) NULL 614 #ifndef __Pyx_PyAsyncMethodsStruct 619 } __Pyx_PyAsyncMethodsStruct;
622 #if defined(WIN32) || defined(MS_WINDOWS) 623 #define _USE_MATH_DEFINES 627 #define __PYX_NAN() ((float) NAN) 629 static CYTHON_INLINE
float __PYX_NAN() {
631 memset(&value, 0xFF,
sizeof(value));
635 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) 636 #define __Pyx_truncl trunc 638 #define __Pyx_truncl truncl 642 #define __PYX_ERR(f_index, lineno, Ln_error) \ 644 __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ 647 #ifndef __PYX_EXTERN_C 649 #define __PYX_EXTERN_C extern "C" 651 #define __PYX_EXTERN_C extern 655 #define __PYX_HAVE__PyClical 656 #define __PYX_HAVE_API__PyClical 668 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) 669 #define CYTHON_WITHOUT_ASSERTIONS 672 typedef struct {PyObject **p;
const char *s;
const Py_ssize_t n;
const char* encoding;
673 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
675 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 676 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 677 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) 678 #define __PYX_DEFAULT_STRING_ENCODING "" 679 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString 680 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize 681 #define __Pyx_uchar_cast(c) ((unsigned char)c) 682 #define __Pyx_long_cast(x) ((long)x) 683 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ 684 (sizeof(type) < sizeof(Py_ssize_t)) ||\ 685 (sizeof(type) > sizeof(Py_ssize_t) &&\ 686 likely(v < (type)PY_SSIZE_T_MAX ||\ 687 v == (type)PY_SSIZE_T_MAX) &&\ 688 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ 689 v == (type)PY_SSIZE_T_MIN))) ||\ 690 (sizeof(type) == sizeof(Py_ssize_t) &&\ 691 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ 692 v == (type)PY_SSIZE_T_MAX))) ) 693 static CYTHON_INLINE
int __Pyx_is_valid_index(Py_ssize_t
i, Py_ssize_t limit) {
694 return (
size_t)
i < (size_t) limit;
696 #if defined (__cplusplus) && __cplusplus >= 201103L 698 #define __Pyx_sst_abs(value) std::abs(value) 699 #elif SIZEOF_INT >= SIZEOF_SIZE_T 700 #define __Pyx_sst_abs(value) abs(value) 701 #elif SIZEOF_LONG >= SIZEOF_SIZE_T 702 #define __Pyx_sst_abs(value) labs(value) 703 #elif defined (_MSC_VER) 704 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) 705 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 706 #define __Pyx_sst_abs(value) llabs(value) 707 #elif defined (__GNUC__) 708 #define __Pyx_sst_abs(value) __builtin_llabs(value) 710 #define __Pyx_sst_abs(value) ((value<0) ? -value : value) 712 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
713 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
714 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) 715 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) 716 #define __Pyx_PyBytes_FromString PyBytes_FromString 717 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize 718 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
719 #if PY_MAJOR_VERSION < 3 720 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString 721 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize 723 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString 724 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize 726 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) 727 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) 728 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) 729 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) 730 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) 731 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) 732 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) 733 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) 734 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) 735 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) 736 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) 737 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) 738 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) 739 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) 740 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) 741 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) 742 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *u) {
743 const Py_UNICODE *u_end = u;
745 return (
size_t)(u_end - u - 1);
747 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) 748 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode 749 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode 750 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) 751 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) 752 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
753 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
754 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
755 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
756 #define __Pyx_PySequence_Tuple(obj)\ 757 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) 758 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
759 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
760 #if CYTHON_ASSUME_SAFE_MACROS 761 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) 763 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) 765 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) 766 #if PY_MAJOR_VERSION >= 3 767 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) 769 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) 771 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) 772 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 773 static int __Pyx_sys_getdefaultencoding_not_ascii;
774 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
776 PyObject* default_encoding = NULL;
777 PyObject* ascii_chars_u = NULL;
778 PyObject* ascii_chars_b = NULL;
779 const char* default_encoding_c;
780 sys = PyImport_ImportModule(
"sys");
782 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
784 if (!default_encoding)
goto bad;
785 default_encoding_c = PyBytes_AsString(default_encoding);
786 if (!default_encoding_c)
goto bad;
787 if (strcmp(default_encoding_c,
"ascii") == 0) {
788 __Pyx_sys_getdefaultencoding_not_ascii = 0;
790 char ascii_chars[128];
792 for (c = 0; c < 128; c++) {
795 __Pyx_sys_getdefaultencoding_not_ascii = 1;
796 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
797 if (!ascii_chars_u)
goto bad;
798 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
799 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
802 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
806 Py_DECREF(ascii_chars_u);
807 Py_DECREF(ascii_chars_b);
809 Py_DECREF(default_encoding);
812 Py_XDECREF(default_encoding);
813 Py_XDECREF(ascii_chars_u);
814 Py_XDECREF(ascii_chars_b);
818 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 819 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) 821 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) 822 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 823 static char* __PYX_DEFAULT_STRING_ENCODING;
824 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
826 PyObject* default_encoding = NULL;
827 char* default_encoding_c;
828 sys = PyImport_ImportModule(
"sys");
830 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
832 if (!default_encoding)
goto bad;
833 default_encoding_c = PyBytes_AsString(default_encoding);
834 if (!default_encoding_c)
goto bad;
835 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c) + 1);
836 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
837 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
838 Py_DECREF(default_encoding);
841 Py_XDECREF(default_encoding);
849 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) 850 #define likely(x) __builtin_expect(!!(x), 1) 851 #define unlikely(x) __builtin_expect(!!(x), 0) 853 #define likely(x) (x) 854 #define unlikely(x) (x) 856 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
858 static PyObject *__pyx_m = NULL;
859 static PyObject *__pyx_d;
860 static PyObject *__pyx_b;
861 static PyObject *__pyx_cython_runtime = NULL;
862 static PyObject *__pyx_empty_tuple;
863 static PyObject *__pyx_empty_bytes;
864 static PyObject *__pyx_empty_unicode;
865 static int __pyx_lineno;
866 static int __pyx_clineno = 0;
867 static const char * __pyx_cfilenm= __FILE__;
868 static const char *__pyx_filename;
871 static const char *__pyx_f[] = {
877 struct __pyx_obj_8PyClical_index_set;
878 struct __pyx_obj_8PyClical_clifford;
879 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__;
880 struct __pyx_opt_args_8PyClical_sqrt;
881 struct __pyx_opt_args_8PyClical_log;
882 struct __pyx_opt_args_8PyClical_cos;
883 struct __pyx_opt_args_8PyClical_acos;
884 struct __pyx_opt_args_8PyClical_acosh;
885 struct __pyx_opt_args_8PyClical_sin;
886 struct __pyx_opt_args_8PyClical_asin;
887 struct __pyx_opt_args_8PyClical_asinh;
888 struct __pyx_opt_args_8PyClical_tan;
889 struct __pyx_opt_args_8PyClical_atan;
890 struct __pyx_opt_args_8PyClical_atanh;
891 struct __pyx_opt_args_8PyClical_random_clifford;
900 struct __pyx_opt_args_8PyClical_sqrt {
912 struct __pyx_opt_args_8PyClical_log {
924 struct __pyx_opt_args_8PyClical_cos {
936 struct __pyx_opt_args_8PyClical_acos {
948 struct __pyx_opt_args_8PyClical_acosh {
960 struct __pyx_opt_args_8PyClical_sin {
972 struct __pyx_opt_args_8PyClical_asin {
984 struct __pyx_opt_args_8PyClical_asinh {
996 struct __pyx_opt_args_8PyClical_tan {
1008 struct __pyx_opt_args_8PyClical_atan {
1020 struct __pyx_opt_args_8PyClical_atanh {
1032 struct __pyx_opt_args_8PyClical_random_clifford {
1044 struct __pyx_obj_8PyClical_index_set {
1046 struct __pyx_vtabstruct_8PyClical_index_set *__pyx_vtab;
1058 struct __pyx_obj_8PyClical_clifford {
1060 struct __pyx_vtabstruct_8PyClical_clifford *__pyx_vtab;
1072 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ {
1074 PyObject *__pyx_v_idx;
1075 struct __pyx_obj_8PyClical_index_set *__pyx_v_self;
1076 PyObject *__pyx_t_0;
1077 Py_ssize_t __pyx_t_1;
1078 PyObject *(*__pyx_t_2)(PyObject *);
1091 struct __pyx_vtabstruct_8PyClical_index_set {
1092 PyObject *(*wrap)(
struct __pyx_obj_8PyClical_index_set *,
IndexSet);
1093 IndexSet (*unwrap)(
struct __pyx_obj_8PyClical_index_set *);
1094 PyObject *(*copy)(
struct __pyx_obj_8PyClical_index_set *,
int __pyx_skip_dispatch);
1096 static struct __pyx_vtabstruct_8PyClical_index_set *__pyx_vtabptr_8PyClical_index_set;
1097 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_9index_set_wrap(
struct __pyx_obj_8PyClical_index_set *,
IndexSet);
1098 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_9index_set_unwrap(
struct __pyx_obj_8PyClical_index_set *);
1109 struct __pyx_vtabstruct_8PyClical_clifford {
1110 PyObject *(*wrap)(
struct __pyx_obj_8PyClical_clifford *,
Clifford);
1111 Clifford (*unwrap)(
struct __pyx_obj_8PyClical_clifford *);
1112 PyObject *(*copy)(
struct __pyx_obj_8PyClical_clifford *,
int __pyx_skip_dispatch);
1114 static struct __pyx_vtabstruct_8PyClical_clifford *__pyx_vtabptr_8PyClical_clifford;
1115 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_8clifford_wrap(
struct __pyx_obj_8PyClical_clifford *,
Clifford);
1116 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_8clifford_unwrap(
struct __pyx_obj_8PyClical_clifford *);
1120 #ifndef CYTHON_REFNANNY 1121 #define CYTHON_REFNANNY 0 1125 void (*INCREF)(
void*, PyObject*, int);
1126 void (*DECREF)(
void*, PyObject*, int);
1127 void (*GOTREF)(
void*, PyObject*, int);
1128 void (*GIVEREF)(
void*, PyObject*, int);
1129 void* (*SetupContext)(
const char*, int,
const char*);
1130 void (*FinishContext)(
void**);
1131 } __Pyx_RefNannyAPIStruct;
1132 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1133 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1134 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; 1136 #define __Pyx_RefNannySetupContext(name, acquire_gil)\ 1138 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ 1139 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ 1140 PyGILState_Release(__pyx_gilstate_save);\ 1142 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ 1145 #define __Pyx_RefNannySetupContext(name, acquire_gil)\ 1146 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) 1148 #define __Pyx_RefNannyFinishContext()\ 1149 __Pyx_RefNanny->FinishContext(&__pyx_refnanny) 1150 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1151 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1152 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1153 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1154 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) 1155 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) 1156 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) 1157 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) 1159 #define __Pyx_RefNannyDeclarations 1160 #define __Pyx_RefNannySetupContext(name, acquire_gil) 1161 #define __Pyx_RefNannyFinishContext() 1162 #define __Pyx_INCREF(r) Py_INCREF(r) 1163 #define __Pyx_DECREF(r) Py_DECREF(r) 1164 #define __Pyx_GOTREF(r) 1165 #define __Pyx_GIVEREF(r) 1166 #define __Pyx_XINCREF(r) Py_XINCREF(r) 1167 #define __Pyx_XDECREF(r) Py_XDECREF(r) 1168 #define __Pyx_XGOTREF(r) 1169 #define __Pyx_XGIVEREF(r) 1171 #define __Pyx_XDECREF_SET(r, v) do {\ 1172 PyObject *tmp = (PyObject *) r;\ 1173 r = v; __Pyx_XDECREF(tmp);\ 1175 #define __Pyx_DECREF_SET(r, v) do {\ 1176 PyObject *tmp = (PyObject *) r;\ 1177 r = v; __Pyx_DECREF(tmp);\ 1179 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) 1180 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) 1183 #if CYTHON_USE_TYPE_SLOTS 1184 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject*
obj, PyObject* attr_name);
1186 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) 1190 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1193 #if CYTHON_FAST_PYCCALL 1194 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1196 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) 1200 #if CYTHON_FAST_PYCALL 1201 #define __Pyx_PyFunction_FastCall(func, args, nargs)\ 1202 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) 1203 #if 1 || PY_VERSION_HEX < 0x030600B1 1204 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
int nargs, PyObject *kwargs);
1206 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) 1208 #define __Pyx_BUILD_ASSERT_EXPR(cond)\ 1209 (sizeof(char [1 - 2*!(cond)]) - 1) 1210 #ifndef Py_MEMBER_SIZE 1211 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) 1213 static size_t __pyx_pyframe_localsplus_offset = 0;
1214 #include "frameobject.h" 1215 #define __Pxy_PyFrame_Initialize_Offsets()\ 1216 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ 1217 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) 1218 #define __Pyx_PyFrame_GetLocalsplus(frame)\ 1219 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) 1223 #if CYTHON_COMPILING_IN_CPYTHON 1224 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1226 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) 1230 #if CYTHON_COMPILING_IN_CPYTHON 1231 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1235 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1238 #if CYTHON_FAST_THREAD_STATE 1239 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; 1240 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; 1241 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type 1243 #define __Pyx_PyThreadState_declare 1244 #define __Pyx_PyThreadState_assign 1245 #define __Pyx_PyErr_Occurred() PyErr_Occurred() 1249 #if CYTHON_FAST_THREAD_STATE 1250 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) 1251 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) 1252 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) 1253 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) 1254 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) 1255 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1256 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1257 #if CYTHON_COMPILING_IN_CPYTHON 1258 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) 1260 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) 1263 #define __Pyx_PyErr_Clear() PyErr_Clear() 1264 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) 1265 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) 1266 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) 1267 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) 1268 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) 1269 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) 1270 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) 1274 static void __Pyx_WriteUnraisable(
const char *name,
int clineno,
1275 int lineno,
const char *filename,
1276 int full_traceback,
int nogil);
1279 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS 1280 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) 1281 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) 1282 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ 1283 (version_var) = __PYX_GET_DICT_VERSION(dict);\ 1284 (cache_var) = (value); 1285 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ 1286 static PY_UINT64_T __pyx_dict_version = 0;\ 1287 static PyObject *__pyx_dict_cached_value = NULL;\ 1288 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ 1289 (VAR) = __pyx_dict_cached_value;\ 1291 (VAR) = __pyx_dict_cached_value = (LOOKUP);\ 1292 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ 1295 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *
obj);
1296 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *
obj);
1297 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject*
obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1299 #define __PYX_GET_DICT_VERSION(dict) (0) 1300 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) 1301 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); 1305 #if CYTHON_COMPILING_IN_CPYTHON 1306 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1308 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) 1312 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
1315 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1316 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1317 const char* function_name);
1320 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1321 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1324 #if CYTHON_USE_DICT_VERSIONS 1325 #define __Pyx_GetModuleGlobalName(var, name) {\ 1326 static PY_UINT64_T __pyx_dict_version = 0;\ 1327 static PyObject *__pyx_dict_cached_value = NULL;\ 1328 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ 1329 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ 1330 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ 1332 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\ 1333 PY_UINT64_T __pyx_dict_version;\ 1334 PyObject *__pyx_dict_cached_value;\ 1335 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ 1337 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1339 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) 1340 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) 1341 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1345 #if CYTHON_USE_EXC_INFO_STACK 1346 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1350 #if CYTHON_FAST_THREAD_STATE 1351 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) 1352 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1353 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) 1354 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1356 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) 1357 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) 1361 #if CYTHON_FAST_THREAD_STATE 1362 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) 1363 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1365 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) 1369 #if CYTHON_FAST_THREAD_STATE 1370 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) 1371 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1373 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1377 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1380 #if !CYTHON_COMPILING_IN_PYPY 1381 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2,
long intval,
int inplace,
int zerodivision_check);
1383 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\ 1384 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) 1388 static CYTHON_INLINE
int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq,
int eq) {
1389 int result = PySequence_Contains(seq, item);
1390 return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
1394 #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ 1395 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ 1396 __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\ 1397 (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\ 1398 __Pyx_SetItemInt_Generic(o, to_py_func(i), v))) 1399 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
1400 static CYTHON_INLINE
int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t
i, PyObject *v,
1401 int is_list,
int wraparound,
int boundscheck);
1404 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2);
1407 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ 1408 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\ 1409 __Pyx__ArgTypeTest(obj, type, name, exact)) 1410 static int __Pyx__ArgTypeTest(PyObject *
obj, PyTypeObject *type,
const char *name,
int exact);
1413 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
1419 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 1420 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject*
obj, PyObject* attr_name);
1422 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr 1426 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 1427 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject*
obj, PyObject* attr_name);
1429 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr 1433 static int __Pyx_SetVtable(PyObject *dict,
void *vtable);
1436 static int __Pyx_setup_reduce(PyObject* type_obj);
1439 #if !CYTHON_COMPILING_IN_PYPY 1440 static PyObject* __Pyx_PyFloat_DivideObjC(PyObject *op1, PyObject *op2,
double floatval,
int inplace,
int zerodivision_check);
1442 #define __Pyx_PyFloat_DivideObjC(op1, op2, floatval, inplace, zerodivision_check)\ 1443 ((inplace ? __Pyx_PyNumber_InPlaceDivide(op1, op2) : __Pyx_PyNumber_Divide(op1, op2))) 1447 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals);
1450 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals);
1453 #if PY_MAJOR_VERSION >= 3 1454 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals 1456 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals 1460 #ifdef CYTHON_CLINE_IN_TRACEBACK 1461 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) 1463 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
1468 PyCodeObject* code_object;
1470 } __Pyx_CodeObjectCacheEntry;
1471 struct __Pyx_CodeObjectCache {
1474 __Pyx_CodeObjectCacheEntry* entries;
1476 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1477 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
1478 static PyCodeObject *__pyx_find_code_object(
int code_line);
1479 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
1482 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
1483 int py_line,
const char *filename);
1486 #ifndef __Pyx_CppExn2PyErr 1489 #include <stdexcept> 1491 static void __Pyx_CppExn2PyErr() {
1493 if (PyErr_Occurred())
1497 }
catch (
const std::bad_alloc& exn) {
1498 PyErr_SetString(PyExc_MemoryError, exn.what());
1499 }
catch (
const std::bad_cast& exn) {
1500 PyErr_SetString(PyExc_TypeError, exn.what());
1501 }
catch (
const std::bad_typeid& exn) {
1502 PyErr_SetString(PyExc_TypeError, exn.what());
1503 }
catch (
const std::domain_error& exn) {
1504 PyErr_SetString(PyExc_ValueError, exn.what());
1505 }
catch (
const std::invalid_argument& exn) {
1506 PyErr_SetString(PyExc_ValueError, exn.what());
1507 }
catch (
const std::ios_base::failure& exn) {
1508 PyErr_SetString(PyExc_IOError, exn.what());
1509 }
catch (
const std::out_of_range& exn) {
1510 PyErr_SetString(PyExc_IndexError, exn.what());
1511 }
catch (
const std::overflow_error& exn) {
1512 PyErr_SetString(PyExc_OverflowError, exn.what());
1513 }
catch (
const std::range_error& exn) {
1514 PyErr_SetString(PyExc_ArithmeticError, exn.what());
1515 }
catch (
const std::underflow_error& exn) {
1516 PyErr_SetString(PyExc_ArithmeticError, exn.what());
1517 }
catch (
const std::exception& exn) {
1518 PyErr_SetString(PyExc_RuntimeError, exn.what());
1522 PyErr_SetString(PyExc_RuntimeError,
"Unknown exception");
1528 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
1531 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
1534 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
1537 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
1540 #if CYTHON_COMPILING_IN_CPYTHON 1541 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) 1542 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1543 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1544 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1546 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) 1547 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) 1548 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) 1550 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) 1553 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
1556 #if CYTHON_FAST_THREAD_STATE 1557 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) 1558 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1560 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
1564 static int __Pyx_PyObject_GetMethod(PyObject *
obj, PyObject *name, PyObject **method);
1567 static PyObject* __Pyx_PyObject_CallMethod1(PyObject*
obj, PyObject* method_name, PyObject* arg);
1570 typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyThreadState *, PyObject *);
1571 #if CYTHON_USE_EXC_INFO_STACK 1572 #define __Pyx_ExcInfoStruct _PyErr_StackItem 1576 PyObject *exc_value;
1577 PyObject *exc_traceback;
1578 } __Pyx_ExcInfoStruct;
1582 __pyx_coroutine_body_t body;
1584 __Pyx_ExcInfoStruct gi_exc_state;
1585 PyObject *gi_weakreflist;
1587 PyObject *yieldfrom;
1589 PyObject *gi_qualname;
1590 PyObject *gi_modulename;
1594 } __pyx_CoroutineObject;
1595 static __pyx_CoroutineObject *__Pyx__Coroutine_New(
1596 PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
1597 PyObject *name, PyObject *qualname, PyObject *module_name);
1598 static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
1599 __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
1600 PyObject *name, PyObject *qualname, PyObject *module_name);
1601 static CYTHON_INLINE
void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *
self);
1602 static int __Pyx_Coroutine_clear(PyObject *
self);
1603 static PyObject *__Pyx_Coroutine_Send(PyObject *
self, PyObject *value);
1604 static PyObject *__Pyx_Coroutine_Close(PyObject *
self);
1605 static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
1606 #if CYTHON_USE_EXC_INFO_STACK 1607 #define __Pyx_Coroutine_SwapException(self) 1608 #define __Pyx_Coroutine_ResetAndClearException(self) __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state) 1610 #define __Pyx_Coroutine_SwapException(self) {\ 1611 __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\ 1612 __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\ 1614 #define __Pyx_Coroutine_ResetAndClearException(self) {\ 1615 __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\ 1616 (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\ 1619 #if CYTHON_FAST_THREAD_STATE 1620 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ 1621 __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue) 1623 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ 1624 __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue) 1626 static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue);
1627 static CYTHON_INLINE
void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state);
1630 static PyObject* __Pyx_Coroutine_patch_module(PyObject* module,
const char* py_code);
1633 static int __Pyx_patch_abc(
void);
1636 #define __Pyx_Generator_USED 1637 static PyTypeObject *__pyx_GeneratorType = 0;
1638 #define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType) 1639 #define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\ 1640 __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name) 1641 static PyObject *__Pyx_Generator_Next(PyObject *
self);
1642 static int __pyx_Generator_init(
void);
1645 static int __Pyx_check_binary_version(
void);
1648 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1650 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_9index_set_wrap(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self,
IndexSet __pyx_v_other);
1651 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_9index_set_unwrap(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
1652 static PyObject *__pyx_f_8PyClical_9index_set_copy(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self,
int __pyx_skip_dispatch);
1653 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_8clifford_wrap(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self,
Clifford __pyx_v_other);
1654 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_8clifford_unwrap(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
1655 static PyObject *__pyx_f_8PyClical_8clifford_copy(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self,
int __pyx_skip_dispatch);
1662 static PyTypeObject *__pyx_ptype_8PyClical_index_set = 0;
1663 static PyTypeObject *__pyx_ptype_8PyClical_clifford = 0;
1664 static PyTypeObject *__pyx_ptype_8PyClical___pyx_scope_struct____iter__ = 0;
1665 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_toIndexSet(PyObject *);
1666 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_compare(PyObject *, PyObject *,
int __pyx_skip_dispatch);
1667 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_min_neg(PyObject *,
int __pyx_skip_dispatch);
1668 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_max_pos(PyObject *,
int __pyx_skip_dispatch);
1669 static CYTHON_INLINE std::vector<scalar_t> __pyx_f_8PyClical_list_to_vector(PyObject *);
1670 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_toClifford(PyObject *);
1671 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_inv(PyObject *,
int __pyx_skip_dispatch);
1672 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_scalar(PyObject *,
int __pyx_skip_dispatch);
1673 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_real(PyObject *,
int __pyx_skip_dispatch);
1674 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_imag(PyObject *,
int __pyx_skip_dispatch);
1675 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_pure(PyObject *,
int __pyx_skip_dispatch);
1676 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_even(PyObject *,
int __pyx_skip_dispatch);
1677 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_odd(PyObject *,
int __pyx_skip_dispatch);
1678 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_involute(PyObject *,
int __pyx_skip_dispatch);
1679 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_reverse(PyObject *,
int __pyx_skip_dispatch);
1680 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_conj(PyObject *,
int __pyx_skip_dispatch);
1681 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_quad(PyObject *,
int __pyx_skip_dispatch);
1682 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_norm(PyObject *,
int __pyx_skip_dispatch);
1683 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_abs(PyObject *,
int __pyx_skip_dispatch);
1684 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_max_abs(PyObject *,
int __pyx_skip_dispatch);
1685 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_pow(PyObject *, PyObject *,
int __pyx_skip_dispatch);
1686 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_outer_pow(PyObject *, PyObject *,
int __pyx_skip_dispatch);
1687 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_complexifier(PyObject *,
int __pyx_skip_dispatch);
1688 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_sqrt(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_sqrt *__pyx_optional_args);
1689 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_exp(PyObject *,
int __pyx_skip_dispatch);
1690 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_log(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_log *__pyx_optional_args);
1691 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cos(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_cos *__pyx_optional_args);
1692 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_acos(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_acos *__pyx_optional_args);
1693 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cosh(PyObject *,
int __pyx_skip_dispatch);
1694 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_acosh(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_acosh *__pyx_optional_args);
1695 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_sin(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_sin *__pyx_optional_args);
1696 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_asin(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_asin *__pyx_optional_args);
1697 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_sinh(PyObject *,
int __pyx_skip_dispatch);
1698 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_asinh(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_asinh *__pyx_optional_args);
1699 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_tan(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_tan *__pyx_optional_args);
1700 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_atan(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_atan *__pyx_optional_args);
1701 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_tanh(PyObject *,
int __pyx_skip_dispatch);
1702 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_atanh(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_atanh *__pyx_optional_args);
1703 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);
1704 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cga3(PyObject *,
int __pyx_skip_dispatch);
1705 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cga3std(PyObject *,
int __pyx_skip_dispatch);
1706 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_agc3(PyObject *,
int __pyx_skip_dispatch);
1707 #define __Pyx_MODULE_NAME "PyClical" 1708 extern int __pyx_module_is_main_PyClical;
1709 int __pyx_module_is_main_PyClical = 0;
1712 static PyObject *__pyx_builtin_IndexError;
1713 static PyObject *__pyx_builtin_RuntimeError;
1714 static PyObject *__pyx_builtin_TypeError;
1715 static PyObject *__pyx_builtin_ValueError;
1716 static PyObject *__pyx_builtin_NotImplemented;
1717 static PyObject *__pyx_builtin_range;
1718 static PyObject *__pyx_builtin_xrange;
1719 static const char __pyx_k_[] =
".";
1720 static const char __pyx_k_e[] =
"e";
1721 static const char __pyx_k_i[] =
"i";
1722 static const char __pyx_k_m[] =
"m";
1723 static const char __pyx_k_p[] =
"p";
1724 static const char __pyx_k_q[] =
"q";
1725 static const char __pyx_k__2[] =
" ";
1726 static const char __pyx_k__5[] =
":";
1727 static const char __pyx_k__6[] =
"\n\t";
1728 static const char __pyx_k__7[] =
" (";
1729 static const char __pyx_k__8[] =
", ";
1730 static const char __pyx_k__9[] =
").";
1731 static const char __pyx_k_cl[] =
"cl";
1732 static const char __pyx_k_pi[] =
"pi";
1733 static const char __pyx_k_cos[] =
"cos";
1734 static const char __pyx_k_exp[] =
"exp";
1735 static const char __pyx_k_frm[] =
"frm";
1736 static const char __pyx_k_inv[] =
"inv";
1737 static const char __pyx_k_ist[] =
"ist";
1738 static const char __pyx_k_ixt[] =
"ixt";
1739 static const char __pyx_k_lhs[] =
"lhs";
1740 static const char __pyx_k_log[] =
"log";
1741 static const char __pyx_k_max[] =
"max";
1742 static const char __pyx_k_min[] =
"min";
1743 static const char __pyx_k_obj[] =
"obj";
1744 static const char __pyx_k_odd[] =
"odd";
1745 static const char __pyx_k_pow[] =
"pow";
1746 static const char __pyx_k_rhs[] =
"rhs";
1747 static const char __pyx_k_sin[] =
"sin";
1748 static const char __pyx_k_tan[] =
"tan";
1749 static const char __pyx_k_tau[] =
"tau";
1750 static const char __pyx_k_Real[] =
"Real";
1751 static const char __pyx_k_acos[] =
"acos";
1752 static const char __pyx_k_args[] =
"args";
1753 static const char __pyx_k_asin[] =
"asin";
1754 static const char __pyx_k_atan[] =
"atan";
1755 static const char __pyx_k_conj[] =
"conj";
1756 static const char __pyx_k_copy[] =
"copy";
1757 static const char __pyx_k_cosh[] =
"cosh";
1758 static const char __pyx_k_even[] =
"even";
1759 static const char __pyx_k_fill[] =
"fill";
1760 static const char __pyx_k_from[] =
" from ";
1761 static const char __pyx_k_iter[] =
"__iter__";
1762 static const char __pyx_k_main[] =
"__main__";
1763 static const char __pyx_k_math[] =
"math";
1764 static const char __pyx_k_name[] =
"__name__";
1765 static const char __pyx_k_norm[] =
"norm";
1766 static const char __pyx_k_pure[] =
"pure";
1767 static const char __pyx_k_quad[] =
"quad";
1768 static const char __pyx_k_send[] =
"send";
1769 static const char __pyx_k_sinh[] =
"sinh";
1770 static const char __pyx_k_sqrt[] =
"sqrt";
1771 static const char __pyx_k_tanh[] =
"tanh";
1772 static const char __pyx_k_test[] =
"_test";
1773 static const char __pyx_k_0_8_2[] =
"0.8.2";
1774 static const char __pyx_k_acosh[] =
"acosh";
1775 static const char __pyx_k_asinh[] =
"asinh";
1776 static const char __pyx_k_atanh[] =
"atanh";
1777 static const char __pyx_k_close[] =
"close";
1778 static const char __pyx_k_grade[] =
"grade";
1779 static const char __pyx_k_istpq[] =
"istpq";
1780 static const char __pyx_k_nbar3[] =
"nbar3";
1781 static const char __pyx_k_ninf3[] =
"ninf3";
1782 static const char __pyx_k_other[] =
"other";
1783 static const char __pyx_k_range[] =
"range";
1784 static const char __pyx_k_throw[] =
"throw";
1785 static const char __pyx_k_using[] =
" using (";
1786 static const char __pyx_k_value[] =
" value ";
1787 static const char __pyx_k_import[] =
"__import__";
1788 static const char __pyx_k_reduce[] =
"__reduce__";
1789 static const char __pyx_k_scalar[] =
"scalar";
1790 static const char __pyx_k_test_2[] =
"__test__";
1791 static const char __pyx_k_xrange[] =
"xrange";
1792 static const char __pyx_k_doctest[] =
"doctest";
1793 static const char __pyx_k_invalid[] =
" invalid ";
1794 static const char __pyx_k_numbers[] =
"numbers";
1795 static const char __pyx_k_reverse[] =
"reverse";
1796 static const char __pyx_k_testmod[] =
"testmod";
1797 static const char __pyx_k_version[] =
"__version__";
1798 static const char __pyx_k_Integral[] =
"Integral";
1799 static const char __pyx_k_PyClical[] =
"PyClical";
1800 static const char __pyx_k_Sequence[] =
"Sequence";
1801 static const char __pyx_k_as_frame[] =
" as frame:\n\t";
1802 static const char __pyx_k_clifford[] =
"clifford";
1803 static const char __pyx_k_getstate[] =
"__getstate__";
1804 static const char __pyx_k_involute[] =
"involute";
1805 static const char __pyx_k_setstate[] =
"__setstate__";
1806 static const char __pyx_k_to_frame[] =
" to frame ";
1807 static const char __pyx_k_TypeError[] =
"TypeError";
1808 static const char __pyx_k_index_set[] =
"index_set";
1809 static const char __pyx_k_outer_pow[] =
"outer_pow";
1810 static const char __pyx_k_reduce_ex[] =
"__reduce_ex__";
1811 static const char __pyx_k_IndexError[] =
"IndexError";
1812 static const char __pyx_k_ValueError[] =
"ValueError";
1813 static const char __pyx_k_pyx_vtable[] =
"__pyx_vtable__";
1814 static const char __pyx_k_collections[] =
"collections";
1815 static const char __pyx_k_e_line_1887[] =
"e (line 1887)";
1816 static const char __pyx_k_PyClical_pyx[] =
"PyClical.pyx";
1817 static const char __pyx_k_RuntimeError[] =
"RuntimeError";
1818 static const char __pyx_k_abs_line_1473[] =
"abs (line 1473)";
1819 static const char __pyx_k_cos_line_1602[] =
"cos (line 1602)";
1820 static const char __pyx_k_exp_line_1565[] =
"exp (line 1565)";
1821 static const char __pyx_k_inv_line_1329[] =
"inv (line 1329)";
1822 static const char __pyx_k_log_line_1579[] =
"log (line 1579)";
1823 static const char __pyx_k_odd_line_1397[] =
"odd (line 1397)";
1824 static const char __pyx_k_pow_line_1494[] =
"pow (line 1494)";
1825 static const char __pyx_k_reduce_cython[] =
"__reduce_cython__";
1826 static const char __pyx_k_sin_line_1679[] =
"sin (line 1679)";
1827 static const char __pyx_k_tan_line_1752[] =
"tan (line 1752)";
1828 static const char __pyx_k_using_invalid[] =
" using invalid ";
1829 static const char __pyx_k_Cannot_reframe[] =
"Cannot reframe";
1830 static const char __pyx_k_NotImplemented[] =
"NotImplemented";
1831 static const char __pyx_k_Not_applicable[] =
"Not applicable.";
1832 static const char __pyx_k_acos_line_1619[] =
"acos (line 1619)";
1833 static const char __pyx_k_agc3_line_1844[] =
"agc3 (line 1844)";
1834 static const char __pyx_k_asin_line_1698[] =
"asin (line 1698)";
1835 static const char __pyx_k_atan_line_1769[] =
"atan (line 1769)";
1836 static const char __pyx_k_cga3_line_1824[] =
"cga3 (line 1824)";
1837 static const char __pyx_k_conj_line_1436[] =
"conj (line 1436)";
1838 static const char __pyx_k_cosh_line_1640[] =
"cosh (line 1640)";
1839 static const char __pyx_k_even_line_1388[] =
"even (line 1388)";
1840 static const char __pyx_k_imag_line_1366[] =
"imag (line 1366)";
1841 static const char __pyx_k_invalid_string[] =
" invalid string ";
1842 static const char __pyx_k_norm_line_1462[] =
"norm (line 1462)";
1843 static const char __pyx_k_pure_line_1377[] =
"pure (line 1377)";
1844 static const char __pyx_k_quad_line_1451[] =
"quad (line 1451)";
1845 static const char __pyx_k_real_line_1355[] =
"real (line 1355)";
1846 static const char __pyx_k_sinh_line_1719[] =
"sinh (line 1719)";
1847 static const char __pyx_k_sqrt_line_1542[] =
"sqrt (line 1542)";
1848 static const char __pyx_k_tanh_line_1786[] =
"tanh (line 1786)";
1849 static const char __pyx_k_acosh_line_1656[] =
"acosh (line 1656)";
1850 static const char __pyx_k_asinh_line_1733[] =
"asinh (line 1733)";
1851 static const char __pyx_k_atanh_line_1798[] =
"atanh (line 1798)";
1852 static const char __pyx_k_istpq_line_1900[] =
"istpq (line 1900)";
1853 static const char __pyx_k_setstate_cython[] =
"__setstate_cython__";
1854 static const char __pyx_k_compare_line_490[] =
"compare (line 490)";
1855 static const char __pyx_k_index_set___iter[] =
"index_set.__iter__";
1856 static const char __pyx_k_max_pos_line_511[] =
"max_pos (line 511)";
1857 static const char __pyx_k_min_neg_line_502[] =
"min_neg (line 502)";
1858 static const char __pyx_k_scalar_line_1344[] =
"scalar (line 1344)";
1859 static const char __pyx_k_cga3std_line_1833[] =
"cga3std (line 1833)";
1860 static const char __pyx_k_max_abs_line_1482[] =
"max_abs (line 1482)";
1861 static const char __pyx_k_reverse_line_1421[] =
"reverse (line 1421)";
1862 static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
1863 static const char __pyx_k_involute_line_1406[] =
"involute (line 1406)";
1864 static const char __pyx_k_outer_pow_line_1518[] =
"outer_pow (line 1518)";
1865 static const char __pyx_k_clifford_inv_line_925[] =
"clifford.inv (line 925)";
1866 static const char __pyx_k_clifford_pow_line_979[] =
"clifford.pow (line 979)";
1867 static const char __pyx_k_clifford_abs_line_1174[] =
"clifford.abs (line 1174)";
1868 static const char __pyx_k_clifford_copy_line_554[] =
"clifford.copy (line 554)";
1869 static const char __pyx_k_clifford_odd_line_1069[] =
"clifford.odd (line 1069)";
1870 static const char __pyx_k_complexifier_line_1527[] =
"complexifier (line 1527)";
1871 static const char __pyx_k_index_set_copy_line_64[] =
"index_set.copy (line 64)";
1872 static const char __pyx_k_index_set_max_line_349[] =
"index_set.max (line 349)";
1873 static const char __pyx_k_index_set_min_line_340[] =
"index_set.min (line 340)";
1874 static const char __pyx_k_clifford_conj_line_1137[] =
"clifford.conj (line 1137)";
1875 static const char __pyx_k_clifford_even_line_1060[] =
"clifford.even (line 1060)";
1876 static const char __pyx_k_clifford_norm_line_1163[] =
"clifford.norm (line 1163)";
1877 static const char __pyx_k_clifford_pure_line_1049[] =
"clifford.pure (line 1049)";
1878 static const char __pyx_k_clifford_quad_line_1152[] =
"clifford.quad (line 1152)";
1879 static const char __pyx_k_Unary_print_clifford_1_1[] =
"\n Unary -.\n\n >>> print -clifford(\"{1}\")\n -{1}\n ";
1880 static const char __pyx_k_clifford___or___line_938[] =
"clifford.__or__ (line 938)";
1881 static const char __pyx_k_clifford_frame_line_1214[] =
"clifford.frame (line 1214)";
1882 static const char __pyx_k_clifford_hidden_doctests[] =
"clifford_hidden_doctests";
1883 static const char __pyx_k_clifford_isnan_line_1205[] =
"clifford.isnan (line 1205)";
1884 static const char __pyx_k_index_set_count_line_313[] =
"index_set.count (line 313)";
1885 static const char __pyx_k_clifford___add___line_739[] =
"clifford.__add__ (line 739)";
1886 static const char __pyx_k_clifford___and___line_835[] =
"clifford.__and__ (line 835)";
1887 static const char __pyx_k_clifford___div___line_895[] =
"clifford.__div__ (line 895)";
1888 static const char __pyx_k_clifford___ior___line_949[] =
"clifford.__ior__ (line 949)";
1889 static const char __pyx_k_clifford___mod___line_805[] =
"clifford.__mod__ (line 805)";
1890 static const char __pyx_k_clifford___mul___line_779[] =
"clifford.__mul__ (line 779)";
1891 static const char __pyx_k_clifford___neg___line_721[] =
"clifford.__neg__ (line 721)";
1892 static const char __pyx_k_clifford___pos___line_730[] =
"clifford.__pos__ (line 730)";
1893 static const char __pyx_k_clifford___pow___line_960[] =
"clifford.__pow__ (line 960)";
1894 static const char __pyx_k_clifford___sub___line_759[] =
"clifford.__sub__ (line 759)";
1895 static const char __pyx_k_clifford___xor___line_865[] =
"clifford.__xor__ (line 865)";
1896 static const char __pyx_k_clifford_reframe_line_648[] =
"clifford.reframe (line 648)";
1897 static const char __pyx_k_clifford_scalar_line_1038[] =
"clifford.scalar (line 1038)";
1898 static const char __pyx_k_index_set___or___line_291[] =
"index_set.__or__ (line 291)";
1899 static const char __pyx_k_index_set_hidden_doctests[] =
"index_set_hidden_doctests";
1900 static const char __pyx_k_random_clifford_line_1815[] =
"random_clifford (line 1815)";
1901 static const char __pyx_k_Cannot_take_vector_part_of[] =
"Cannot take vector part of ";
1902 static const char __pyx_k_Unary_print_clifford_1_1_2[] =
"\n Unary +.\n\n >>> print +clifford(\"{1}\")\n {1}\n ";
1903 static const char __pyx_k_clifford___iadd___line_750[] =
"clifford.__iadd__ (line 750)";
1904 static const char __pyx_k_clifford___iand___line_850[] =
"clifford.__iand__ (line 850)";
1905 static const char __pyx_k_clifford___idiv___line_910[] =
"clifford.__idiv__ (line 910)";
1906 static const char __pyx_k_clifford___imod___line_820[] =
"clifford.__imod__ (line 820)";
1907 static const char __pyx_k_clifford___imul___line_792[] =
"clifford.__imul__ (line 792)";
1908 static const char __pyx_k_clifford___isub___line_770[] =
"clifford.__isub__ (line 770)";
1909 static const char __pyx_k_clifford___iter___line_637[] =
"clifford.__iter__ (line 637)";
1910 static const char __pyx_k_clifford___ixor___line_880[] =
"clifford.__ixor__ (line 880)";
1911 static const char __pyx_k_clifford___str___line_1234[] =
"clifford.__str__ (line 1234)";
1912 static const char __pyx_k_clifford_max_abs_line_1183[] =
"clifford.max_abs (line 1183)";
1913 static const char __pyx_k_clifford_reverse_line_1122[] =
"clifford.reverse (line 1122)";
1914 static const char __pyx_k_index_set___and___line_269[] =
"index_set.__and__ (line 269)";
1915 static const char __pyx_k_index_set___ior___line_302[] =
"index_set.__ior__ (line 302)";
1916 static const char __pyx_k_index_set___str___line_393[] =
"index_set.__str__ (line 393)";
1917 static const char __pyx_k_index_set___xor___line_247[] =
"index_set.__xor__ (line 247)";
1918 static const char __pyx_k_clifford___call___line_1019[] =
"clifford.__call__ (line 1019)";
1919 static const char __pyx_k_clifford___repr___line_1225[] =
"clifford.__repr__ (line 1225)";
1920 static const char __pyx_k_clifford_involute_line_1106[] =
"clifford.involute (line 1106)";
1921 static const char __pyx_k_index_set___iand___line_280[] =
"index_set.__iand__ (line 280)";
1922 static const char __pyx_k_index_set___iter___line_227[] =
"index_set.__iter__ (line 227)";
1923 static const char __pyx_k_index_set___ixor___line_258[] =
"index_set.__ixor__ (line 258)";
1924 static const char __pyx_k_index_set___repr___line_382[] =
"index_set.__repr__ (line 382)";
1925 static const char __pyx_k_clifford_outer_pow_line_1003[] =
"clifford.outer_pow (line 1003)";
1926 static const char __pyx_k_clifford_truncated_line_1194[] =
"clifford.truncated (line 1194)";
1927 static const char __pyx_k_index_set_count_neg_line_322[] =
"index_set.count_neg (line 322)";
1928 static const char __pyx_k_index_set_count_pos_line_331[] =
"index_set.count_pos (line 331)";
1929 static const char __pyx_k_clifford___getitem___line_706[] =
"clifford.__getitem__ (line 706)";
1930 static const char __pyx_k_index_set___invert___line_238[] =
"index_set.__invert__ (line 238)";
1931 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 ";
1932 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 ";
1933 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 ";
1934 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 ";
1935 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 ";
1936 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 ";
1937 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 ";
1938 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 ";
1939 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 ";
1940 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 ";
1941 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 ";
1942 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 ";
1943 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 ";
1944 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 ";
1945 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 ";
1946 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 ";
1947 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 ";
1948 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 ";
1949 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 ";
1950 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 ";
1951 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 ";
1952 static const char __pyx_k_clifford_vector_part_line_1078[] =
"clifford.vector_part (line 1078)";
1953 static const char __pyx_k_index_set___getitem___line_189[] =
"index_set.__getitem__ (line 189)";
1954 static const char __pyx_k_index_set___setitem___line_177[] =
"index_set.__setitem__ (line 177)";
1955 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 ";
1956 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 ";
1957 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 ";
1958 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 ";
1959 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 ";
1960 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 ";
1961 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 ";
1962 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 ";
1963 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 ";
1964 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 ";
1965 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 ";
1966 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 ";
1967 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 ";
1968 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 ";
1969 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 ";
1970 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 ";
1971 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 ";
1972 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 ";
1973 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 ";
1974 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 ";
1975 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 ";
1976 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 ";
1977 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 ";
1978 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 ";
1979 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 ";
1980 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 ";
1981 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 ";
1982 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 ";
1983 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 ";
1984 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 ";
1985 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 ";
1986 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 ";
1987 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 ";
1988 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 ";
1989 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 ";
1990 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 ";
1991 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 ";
1992 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 ";
1993 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 ";
1994 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 ";
1995 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 ";
1996 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 ";
1997 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 ";
1998 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 ";
1999 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 ";
2000 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 ";
2001 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 ";
2002 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 ";
2003 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 ";
2004 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 ";
2005 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 ";
2006 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 ";
2007 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 ";
2008 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 ";
2009 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 ";
2010 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 ";
2011 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 ";
2012 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 ";
2013 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 ";
2014 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 ";
2015 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 ";
2016 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 ";
2017 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 ";
2018 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 ";
2019 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 ";
2020 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 ";
2021 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 ";
2022 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 ";
2023 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 ";
2024 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 ";
2025 static const char __pyx_k_This_comparison_operator_is_not[] =
"This comparison operator is not implemented for ";
2026 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 ";
2027 static const char __pyx_k_index_set_sign_of_mult_line_364[] =
"index_set.sign_of_mult (line 364)";
2028 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 ";
2029 static const char __pyx_k_Cannot_initialize_clifford_objec[] =
"Cannot initialize clifford object from";
2030 static const char __pyx_k_Cannot_initialize_index_set_obje[] =
"Cannot initialize index_set object from";
2031 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 ";
2032 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 ";
2033 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 ";
2034 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 ";
2035 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 ";
2036 static const char __pyx_k_clifford_hidden_doctests_line_12[] =
"clifford_hidden_doctests (line 1243)";
2037 static const char __pyx_k_index_set_hidden_doctests_line_4[] =
"index_set_hidden_doctests (line 404)";
2038 static const char __pyx_k_index_set_sign_of_square_line_37[] =
"index_set.sign_of_square (line 373)";
2039 static const char __pyx_k_no_default___reduce___due_to_non[] =
"no default __reduce__ due to non-trivial __cinit__";
2040 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 ";
2041 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 ";
2042 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 ";
2043 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 ";
2044 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 ";
2045 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 ";
2046 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 ";
2047 static PyObject *__pyx_kp_s_;
2048 static PyObject *__pyx_kp_s_0_8_2;
2049 static PyObject *__pyx_kp_u_Abbreviation_for_clifford_index;
2050 static PyObject *__pyx_kp_u_Abbreviation_for_index_set_q_p;
2051 static PyObject *__pyx_kp_u_Absolute_value_of_multivector_m;
2052 static PyObject *__pyx_kp_u_Absolute_value_square_root_of_n;
2053 static PyObject *__pyx_kp_s_Cannot_initialize_clifford_objec;
2054 static PyObject *__pyx_kp_s_Cannot_initialize_index_set_obje;
2055 static PyObject *__pyx_kp_s_Cannot_reframe;
2056 static PyObject *__pyx_kp_s_Cannot_take_vector_part_of;
2057 static PyObject *__pyx_kp_u_Cardinality_Number_of_indices_i;
2058 static PyObject *__pyx_kp_u_Check_if_a_multivector_contains;
2059 static PyObject *__pyx_kp_u_Conjugation_reverse_o_involute;
2060 static PyObject *__pyx_kp_u_Conjugation_reverse_o_involute_2;
2061 static PyObject *__pyx_kp_u_Contraction_print_clifford_1_cl;
2062 static PyObject *__pyx_kp_u_Contraction_x_clifford_1_x_clif;
2063 static PyObject *__pyx_kp_u_Convert_CGA3_null_vector_to_Euc;
2064 static PyObject *__pyx_kp_u_Convert_CGA3_null_vector_to_sta;
2065 static PyObject *__pyx_kp_u_Convert_Euclidean_3D_multivecto;
2066 static PyObject *__pyx_kp_u_Copy_this_clifford_object_x_cli;
2067 static PyObject *__pyx_kp_u_Copy_this_index_set_object_s_in;
2068 static PyObject *__pyx_kp_u_Cosine_of_multivector_with_opti;
2069 static PyObject *__pyx_kp_u_Even_part_of_multivector_sum_of;
2070 static PyObject *__pyx_kp_u_Even_part_of_multivector_sum_of_2;
2071 static PyObject *__pyx_kp_u_Exponential_of_multivector_x_cl;
2072 static PyObject *__pyx_kp_u_Geometric_difference_print_clif;
2073 static PyObject *__pyx_kp_u_Geometric_difference_x_clifford;
2074 static PyObject *__pyx_kp_u_Geometric_multiplicative_invers;
2075 static PyObject *__pyx_kp_u_Geometric_multiplicative_invers_2;
2076 static PyObject *__pyx_kp_u_Geometric_product_print_cliffor;
2077 static PyObject *__pyx_kp_u_Geometric_product_x_clifford_2;
2078 static PyObject *__pyx_kp_u_Geometric_quotient_print_cliffo;
2079 static PyObject *__pyx_kp_u_Geometric_quotient_x_clifford_1;
2080 static PyObject *__pyx_kp_u_Geometric_sum_print_clifford_1;
2081 static PyObject *__pyx_kp_u_Geometric_sum_x_clifford_1_x_cl;
2082 static PyObject *__pyx_kp_u_Get_the_value_of_an_index_set_o;
2083 static PyObject *__pyx_kp_u_Hyperbolic_cosine_of_multivecto;
2084 static PyObject *__pyx_kp_u_Hyperbolic_sine_of_multivector;
2085 static PyObject *__pyx_kp_u_Hyperbolic_tangent_of_multivect;
2086 static PyObject *__pyx_kp_u_Imaginary_part_deprecated_alway;
2087 static PyObject *__pyx_n_s_IndexError;
2088 static PyObject *__pyx_kp_u_Inner_product_print_clifford_1;
2089 static PyObject *__pyx_kp_u_Inner_product_x_clifford_1_x_cl;
2090 static PyObject *__pyx_kp_u_Integer_power_of_multivector_ob;
2091 static PyObject *__pyx_n_s_Integral;
2092 static PyObject *__pyx_kp_u_Inverse_cosine_of_multivector_w;
2093 static PyObject *__pyx_kp_u_Inverse_hyperbolic_cosine_of_mu;
2094 static PyObject *__pyx_kp_u_Inverse_hyperbolic_sine_of_mult;
2095 static PyObject *__pyx_kp_u_Inverse_hyperbolic_tangent_of_m;
2096 static PyObject *__pyx_kp_u_Inverse_sine_of_multivector_wit;
2097 static PyObject *__pyx_kp_u_Inverse_tangent_of_multivector;
2098 static PyObject *__pyx_kp_u_Iterate_over_the_indices_of_an;
2099 static PyObject *__pyx_kp_u_Main_involution_each_i_is_repla;
2100 static PyObject *__pyx_kp_u_Main_involution_each_i_is_repla_2;
2101 static PyObject *__pyx_kp_u_Maximum_absolute_value_of_coord;
2102 static PyObject *__pyx_kp_u_Maximum_member_index_set_1_1_2;
2103 static PyObject *__pyx_kp_u_Maximum_of_absolute_values_of_c;
2104 static PyObject *__pyx_kp_u_Maximum_positive_index_or_0_if;
2105 static PyObject *__pyx_kp_u_Minimum_member_index_set_1_1_2;
2106 static PyObject *__pyx_kp_u_Minimum_negative_index_or_0_if;
2107 static PyObject *__pyx_kp_u_Natural_logarithm_of_multivecto;
2108 static PyObject *__pyx_kp_u_Norm_sum_of_squares_of_coordina;
2109 static PyObject *__pyx_n_s_NotImplemented;
2110 static PyObject *__pyx_kp_s_Not_applicable;
2111 static PyObject *__pyx_kp_u_Not_applicable_for_a_in_cliffor;
2112 static PyObject *__pyx_kp_u_Number_of_negative_indices_incl;
2113 static PyObject *__pyx_kp_u_Number_of_positive_indices_incl;
2114 static PyObject *__pyx_kp_u_Odd_part_of_multivector_sum_of;
2115 static PyObject *__pyx_kp_u_Odd_part_of_multivector_sum_of_2;
2116 static PyObject *__pyx_kp_u_Outer_product_power_of_multivec;
2117 static PyObject *__pyx_kp_u_Outer_product_power_x_clifford;
2118 static PyObject *__pyx_kp_u_Outer_product_print_clifford_1;
2119 static PyObject *__pyx_kp_u_Outer_product_x_clifford_1_x_cl;
2120 static PyObject *__pyx_kp_u_Power_self_to_the_m_x_clifford;
2121 static PyObject *__pyx_kp_u_Power_self_to_the_m_x_clifford_2;
2122 static PyObject *__pyx_kp_u_Pure_grade_vector_part_print_cl;
2123 static PyObject *__pyx_kp_u_Pure_part_print_clifford_1_1_1;
2124 static PyObject *__pyx_kp_u_Pure_part_print_pure_clifford_1;
2125 static PyObject *__pyx_kp_u_Put_self_into_a_larger_frame_co;
2126 static PyObject *__pyx_n_s_PyClical;
2127 static PyObject *__pyx_kp_s_PyClical_pyx;
2128 static PyObject *__pyx_kp_u_Quadratic_form_rev_x_x_0_print;
2129 static PyObject *__pyx_kp_u_Quadratic_form_rev_x_x_0_print_2;
2130 static PyObject *__pyx_kp_u_Random_multivector_within_a_fra;
2131 static PyObject *__pyx_n_s_Real;
2132 static PyObject *__pyx_kp_u_Real_part_synonym_for_scalar_pa;
2133 static PyObject *__pyx_kp_u_Remove_all_terms_of_self_with_r;
2134 static PyObject *__pyx_kp_u_Reversion_eg_1_2_2_1_print_reve;
2135 static PyObject *__pyx_kp_u_Reversion_eg_clifford_1_cliffor;
2136 static PyObject *__pyx_n_s_RuntimeError;
2137 static PyObject *__pyx_kp_u_Scalar_part_clifford_1_1_1_2_sc;
2138 static PyObject *__pyx_kp_u_Scalar_part_scalar_clifford_1_1;
2139 static PyObject *__pyx_n_s_Sequence;
2140 static PyObject *__pyx_kp_u_Set_complement_not_print_index;
2141 static PyObject *__pyx_kp_u_Set_intersection_and_print_inde;
2142 static PyObject *__pyx_kp_u_Set_intersection_and_x_index_se;
2143 static PyObject *__pyx_kp_u_Set_the_value_of_an_index_set_o;
2144 static PyObject *__pyx_kp_u_Set_union_or_print_index_set_1;
2145 static PyObject *__pyx_kp_u_Set_union_or_x_index_set_1_x_in;
2146 static PyObject *__pyx_kp_u_Sign_of_geometric_product_of_tw;
2147 static PyObject *__pyx_kp_u_Sign_of_geometric_square_of_a_C;
2148 static PyObject *__pyx_kp_u_Sine_of_multivector_with_option;
2149 static PyObject *__pyx_kp_u_Square_root_of_1_which_commutes;
2150 static PyObject *__pyx_kp_u_Square_root_of_multivector_with;
2151 static PyObject *__pyx_kp_u_Subalgebra_generated_by_all_gen;
2152 static PyObject *__pyx_kp_u_Subscripting_map_from_index_set;
2153 static PyObject *__pyx_kp_u_Symmetric_set_difference_exclus;
2154 static PyObject *__pyx_kp_u_Symmetric_set_difference_exclus_2;
2155 static PyObject *__pyx_kp_u_Tangent_of_multivector_with_opt;
2156 static PyObject *__pyx_kp_u_Tests_for_functions_that_Doctes;
2157 static PyObject *__pyx_kp_u_Tests_for_functions_that_Doctes_2;
2158 static PyObject *__pyx_kp_u_The_informal_string_representat;
2159 static PyObject *__pyx_kp_u_The_informal_string_representat_2;
2160 static PyObject *__pyx_kp_u_The_official_string_representat;
2161 static PyObject *__pyx_kp_u_The_official_string_representat_2;
2162 static PyObject *__pyx_kp_s_This_comparison_operator_is_not;
2163 static PyObject *__pyx_kp_u_Transform_left_hand_side_using;
2164 static PyObject *__pyx_kp_u_Transform_left_hand_side_using_2;
2165 static PyObject *__pyx_n_s_TypeError;
2166 static PyObject *__pyx_kp_u_Unary_print_clifford_1_1;
2167 static PyObject *__pyx_kp_u_Unary_print_clifford_1_1_2;
2168 static PyObject *__pyx_n_s_ValueError;
2169 static PyObject *__pyx_kp_u_Vector_part_of_multivector_as_a;
2170 static PyObject *__pyx_kp_s__2;
2171 static PyObject *__pyx_kp_s__5;
2172 static PyObject *__pyx_kp_s__6;
2173 static PyObject *__pyx_kp_s__7;
2174 static PyObject *__pyx_kp_s__8;
2175 static PyObject *__pyx_kp_s__9;
2176 static PyObject *__pyx_kp_u_abs_line_1473;
2177 static PyObject *__pyx_n_s_acos;
2178 static PyObject *__pyx_kp_u_acos_line_1619;
2179 static PyObject *__pyx_n_s_acosh;
2180 static PyObject *__pyx_kp_u_acosh_line_1656;
2181 static PyObject *__pyx_kp_u_agc3_line_1844;
2182 static PyObject *__pyx_n_s_args;
2183 static PyObject *__pyx_kp_s_as_frame;
2184 static PyObject *__pyx_n_s_asin;
2185 static PyObject *__pyx_kp_u_asin_line_1698;
2186 static PyObject *__pyx_n_s_asinh;
2187 static PyObject *__pyx_kp_u_asinh_line_1733;
2188 static PyObject *__pyx_n_s_atan;
2189 static PyObject *__pyx_kp_u_atan_line_1769;
2190 static PyObject *__pyx_n_s_atanh;
2191 static PyObject *__pyx_kp_u_atanh_line_1798;
2192 static PyObject *__pyx_kp_u_cga3_line_1824;
2193 static PyObject *__pyx_kp_u_cga3std_line_1833;
2194 static PyObject *__pyx_n_s_cl;
2195 static PyObject *__pyx_n_s_clifford;
2196 static PyObject *__pyx_kp_u_clifford___add___line_739;
2197 static PyObject *__pyx_kp_u_clifford___and___line_835;
2198 static PyObject *__pyx_kp_u_clifford___call___line_1019;
2199 static PyObject *__pyx_kp_u_clifford___div___line_895;
2200 static PyObject *__pyx_kp_u_clifford___getitem___line_706;
2201 static PyObject *__pyx_kp_u_clifford___iadd___line_750;
2202 static PyObject *__pyx_kp_u_clifford___iand___line_850;
2203 static PyObject *__pyx_kp_u_clifford___idiv___line_910;
2204 static PyObject *__pyx_kp_u_clifford___imod___line_820;
2205 static PyObject *__pyx_kp_u_clifford___imul___line_792;
2206 static PyObject *__pyx_kp_u_clifford___ior___line_949;
2207 static PyObject *__pyx_kp_u_clifford___isub___line_770;
2208 static PyObject *__pyx_kp_u_clifford___iter___line_637;
2209 static PyObject *__pyx_kp_u_clifford___ixor___line_880;
2210 static PyObject *__pyx_kp_u_clifford___mod___line_805;
2211 static PyObject *__pyx_kp_u_clifford___mul___line_779;
2212 static PyObject *__pyx_kp_u_clifford___neg___line_721;
2213 static PyObject *__pyx_kp_u_clifford___or___line_938;
2214 static PyObject *__pyx_kp_u_clifford___pos___line_730;
2215 static PyObject *__pyx_kp_u_clifford___pow___line_960;
2216 static PyObject *__pyx_kp_u_clifford___repr___line_1225;
2217 static PyObject *__pyx_kp_u_clifford___str___line_1234;
2218 static PyObject *__pyx_kp_u_clifford___sub___line_759;
2219 static PyObject *__pyx_kp_u_clifford___xor___line_865;
2220 static PyObject *__pyx_kp_u_clifford_abs_line_1174;
2221 static PyObject *__pyx_kp_u_clifford_conj_line_1137;
2222 static PyObject *__pyx_kp_u_clifford_copy_line_554;
2223 static PyObject *__pyx_kp_u_clifford_even_line_1060;
2224 static PyObject *__pyx_kp_u_clifford_frame_line_1214;
2225 static PyObject *__pyx_n_s_clifford_hidden_doctests;
2226 static PyObject *__pyx_kp_u_clifford_hidden_doctests_line_12;
2227 static PyObject *__pyx_kp_u_clifford_inv_line_925;
2228 static PyObject *__pyx_kp_u_clifford_involute_line_1106;
2229 static PyObject *__pyx_kp_u_clifford_isnan_line_1205;
2230 static PyObject *__pyx_kp_u_clifford_max_abs_line_1183;
2231 static PyObject *__pyx_kp_u_clifford_norm_line_1163;
2232 static PyObject *__pyx_kp_u_clifford_odd_line_1069;
2233 static PyObject *__pyx_kp_u_clifford_outer_pow_line_1003;
2234 static PyObject *__pyx_kp_u_clifford_pow_line_979;
2235 static PyObject *__pyx_kp_u_clifford_pure_line_1049;
2236 static PyObject *__pyx_kp_u_clifford_quad_line_1152;
2237 static PyObject *__pyx_kp_u_clifford_reframe_line_648;
2238 static PyObject *__pyx_kp_u_clifford_reverse_line_1122;
2239 static PyObject *__pyx_kp_u_clifford_scalar_line_1038;
2240 static PyObject *__pyx_kp_u_clifford_truncated_line_1194;
2241 static PyObject *__pyx_kp_u_clifford_vector_part_line_1078;
2242 static PyObject *__pyx_n_s_cline_in_traceback;
2243 static PyObject *__pyx_n_s_close;
2244 static PyObject *__pyx_n_s_collections;
2245 static PyObject *__pyx_kp_u_compare_line_490;
2246 static PyObject *__pyx_kp_u_complexifier_line_1527;
2247 static PyObject *__pyx_n_s_conj;
2248 static PyObject *__pyx_kp_u_conj_line_1436;
2249 static PyObject *__pyx_n_s_copy;
2250 static PyObject *__pyx_n_s_cos;
2251 static PyObject *__pyx_kp_u_cos_line_1602;
2252 static PyObject *__pyx_n_s_cosh;
2253 static PyObject *__pyx_kp_u_cosh_line_1640;
2254 static PyObject *__pyx_n_s_doctest;
2255 static PyObject *__pyx_n_s_e;
2256 static PyObject *__pyx_kp_u_e_line_1887;
2257 static PyObject *__pyx_n_s_even;
2258 static PyObject *__pyx_kp_u_even_line_1388;
2259 static PyObject *__pyx_n_s_exp;
2260 static PyObject *__pyx_kp_u_exp_line_1565;
2261 static PyObject *__pyx_n_s_fill;
2262 static PyObject *__pyx_n_s_frm;
2263 static PyObject *__pyx_kp_s_from;
2264 static PyObject *__pyx_n_s_getstate;
2265 static PyObject *__pyx_n_s_grade;
2266 static PyObject *__pyx_n_s_i;
2267 static PyObject *__pyx_kp_u_imag_line_1366;
2268 static PyObject *__pyx_n_s_import;
2269 static PyObject *__pyx_n_s_index_set;
2270 static PyObject *__pyx_kp_u_index_set___and___line_269;
2271 static PyObject *__pyx_kp_u_index_set___getitem___line_189;
2272 static PyObject *__pyx_kp_u_index_set___iand___line_280;
2273 static PyObject *__pyx_kp_u_index_set___invert___line_238;
2274 static PyObject *__pyx_kp_u_index_set___ior___line_302;
2275 static PyObject *__pyx_n_s_index_set___iter;
2276 static PyObject *__pyx_kp_u_index_set___iter___line_227;
2277 static PyObject *__pyx_kp_u_index_set___ixor___line_258;
2278 static PyObject *__pyx_kp_u_index_set___or___line_291;
2279 static PyObject *__pyx_kp_u_index_set___repr___line_382;
2280 static PyObject *__pyx_kp_u_index_set___setitem___line_177;
2281 static PyObject *__pyx_kp_u_index_set___str___line_393;
2282 static PyObject *__pyx_kp_u_index_set___xor___line_247;
2283 static PyObject *__pyx_kp_u_index_set_copy_line_64;
2284 static PyObject *__pyx_kp_u_index_set_count_line_313;
2285 static PyObject *__pyx_kp_u_index_set_count_neg_line_322;
2286 static PyObject *__pyx_kp_u_index_set_count_pos_line_331;
2287 static PyObject *__pyx_n_s_index_set_hidden_doctests;
2288 static PyObject *__pyx_kp_u_index_set_hidden_doctests_line_4;
2289 static PyObject *__pyx_kp_u_index_set_max_line_349;
2290 static PyObject *__pyx_kp_u_index_set_min_line_340;
2291 static PyObject *__pyx_kp_u_index_set_sign_of_mult_line_364;
2292 static PyObject *__pyx_kp_u_index_set_sign_of_square_line_37;
2293 static PyObject *__pyx_n_s_inv;
2294 static PyObject *__pyx_kp_u_inv_line_1329;
2295 static PyObject *__pyx_kp_s_invalid;
2296 static PyObject *__pyx_kp_s_invalid_string;
2297 static PyObject *__pyx_n_s_involute;
2298 static PyObject *__pyx_kp_u_involute_line_1406;
2299 static PyObject *__pyx_n_s_ist;
2300 static PyObject *__pyx_n_s_istpq;
2301 static PyObject *__pyx_kp_u_istpq_line_1900;
2302 static PyObject *__pyx_n_s_iter;
2303 static PyObject *__pyx_n_s_ixt;
2304 static PyObject *__pyx_kp_u_lexicographic_compare_eg_3_4_5;
2305 static PyObject *__pyx_n_s_lhs;
2306 static PyObject *__pyx_n_s_log;
2307 static PyObject *__pyx_kp_u_log_line_1579;
2308 static PyObject *__pyx_n_s_m;
2309 static PyObject *__pyx_n_s_main;
2310 static PyObject *__pyx_n_s_math;
2311 static PyObject *__pyx_n_s_max;
2312 static PyObject *__pyx_kp_u_max_abs_line_1482;
2313 static PyObject *__pyx_kp_u_max_pos_line_511;
2314 static PyObject *__pyx_n_s_min;
2315 static PyObject *__pyx_kp_u_min_neg_line_502;
2316 static PyObject *__pyx_n_s_name;
2317 static PyObject *__pyx_n_s_nbar3;
2318 static PyObject *__pyx_n_s_ninf3;
2319 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2320 static PyObject *__pyx_n_s_norm;
2321 static PyObject *__pyx_kp_u_norm_line_1462;
2322 static PyObject *__pyx_kp_u_norm_sum_of_squares_of_coordina;
2323 static PyObject *__pyx_n_s_numbers;
2324 static PyObject *__pyx_n_s_obj;
2325 static PyObject *__pyx_n_s_odd;
2326 static PyObject *__pyx_kp_u_odd_line_1397;
2327 static PyObject *__pyx_n_s_other;
2328 static PyObject *__pyx_n_s_outer_pow;
2329 static PyObject *__pyx_kp_u_outer_pow_line_1518;
2330 static PyObject *__pyx_n_s_p;
2331 static PyObject *__pyx_n_s_pi;
2332 static PyObject *__pyx_n_s_pow;
2333 static PyObject *__pyx_kp_u_pow_line_1494;
2334 static PyObject *__pyx_n_s_pure;
2335 static PyObject *__pyx_kp_u_pure_line_1377;
2336 static PyObject *__pyx_n_s_pyx_vtable;
2337 static PyObject *__pyx_n_s_q;
2338 static PyObject *__pyx_n_s_quad;
2339 static PyObject *__pyx_kp_u_quad_line_1451;
2340 static PyObject *__pyx_kp_u_random_clifford_line_1815;
2341 static PyObject *__pyx_n_s_range;
2342 static PyObject *__pyx_kp_u_real_line_1355;
2343 static PyObject *__pyx_n_s_reduce;
2344 static PyObject *__pyx_n_s_reduce_cython;
2345 static PyObject *__pyx_n_s_reduce_ex;
2346 static PyObject *__pyx_n_s_reverse;
2347 static PyObject *__pyx_kp_u_reverse_line_1421;
2348 static PyObject *__pyx_n_s_rhs;
2349 static PyObject *__pyx_n_s_scalar;
2350 static PyObject *__pyx_kp_u_scalar_line_1344;
2351 static PyObject *__pyx_n_s_send;
2352 static PyObject *__pyx_n_s_setstate;
2353 static PyObject *__pyx_n_s_setstate_cython;
2354 static PyObject *__pyx_n_s_sin;
2355 static PyObject *__pyx_kp_u_sin_line_1679;
2356 static PyObject *__pyx_n_s_sinh;
2357 static PyObject *__pyx_kp_u_sinh_line_1719;
2358 static PyObject *__pyx_n_s_sqrt;
2359 static PyObject *__pyx_kp_u_sqrt_line_1542;
2360 static PyObject *__pyx_n_s_tan;
2361 static PyObject *__pyx_kp_u_tan_line_1752;
2362 static PyObject *__pyx_n_s_tanh;
2363 static PyObject *__pyx_kp_u_tanh_line_1786;
2364 static PyObject *__pyx_n_s_tau;
2365 static PyObject *__pyx_n_s_test;
2366 static PyObject *__pyx_n_s_test_2;
2367 static PyObject *__pyx_n_s_testmod;
2368 static PyObject *__pyx_n_s_throw;
2369 static PyObject *__pyx_kp_s_to_frame;
2370 static PyObject *__pyx_kp_s_using;
2371 static PyObject *__pyx_kp_s_using_invalid;
2372 static PyObject *__pyx_kp_s_value;
2373 static PyObject *__pyx_n_s_version;
2374 static PyObject *__pyx_n_s_xrange;
2375 static PyObject *__pyx_pf_8PyClical_9index_set_copy(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2376 static int __pyx_pf_8PyClical_9index_set_2__cinit__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_other);
2377 static void __pyx_pf_8PyClical_9index_set_4__dealloc__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2378 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);
2379 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);
2380 static PyObject *__pyx_pf_8PyClical_9index_set_10__getitem__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_idx);
2381 static int __pyx_pf_8PyClical_9index_set_12__contains__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_idx);
2382 static PyObject *__pyx_pf_8PyClical_9index_set_14__iter__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2383 static PyObject *__pyx_pf_8PyClical_9index_set_17__invert__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2384 static PyObject *__pyx_pf_8PyClical_9index_set_19__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2385 static PyObject *__pyx_pf_8PyClical_9index_set_21__ixor__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs);
2386 static PyObject *__pyx_pf_8PyClical_9index_set_23__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2387 static PyObject *__pyx_pf_8PyClical_9index_set_25__iand__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs);
2388 static PyObject *__pyx_pf_8PyClical_9index_set_27__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2389 static PyObject *__pyx_pf_8PyClical_9index_set_29__ior__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs);
2390 static PyObject *__pyx_pf_8PyClical_9index_set_31count(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2391 static PyObject *__pyx_pf_8PyClical_9index_set_33count_neg(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2392 static PyObject *__pyx_pf_8PyClical_9index_set_35count_pos(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2393 static PyObject *__pyx_pf_8PyClical_9index_set_37min(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2394 static PyObject *__pyx_pf_8PyClical_9index_set_39max(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2395 static PyObject *__pyx_pf_8PyClical_9index_set_41hash_fn(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2396 static PyObject *__pyx_pf_8PyClical_9index_set_43sign_of_mult(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs);
2397 static PyObject *__pyx_pf_8PyClical_9index_set_45sign_of_square(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2398 static PyObject *__pyx_pf_8PyClical_9index_set_47__repr__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2399 static PyObject *__pyx_pf_8PyClical_9index_set_49__str__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2400 static PyObject *__pyx_pf_8PyClical_9index_set_51__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2401 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);
2402 static PyObject *__pyx_pf_8PyClical_index_set_hidden_doctests(CYTHON_UNUSED PyObject *__pyx_self);
2403 static PyObject *__pyx_pf_8PyClical_2compare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2404 static PyObject *__pyx_pf_8PyClical_4min_neg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2405 static PyObject *__pyx_pf_8PyClical_6max_pos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2406 static PyObject *__pyx_pf_8PyClical_8clifford_copy(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2407 static int __pyx_pf_8PyClical_8clifford_2__cinit__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_ixt);
2408 static void __pyx_pf_8PyClical_8clifford_4__dealloc__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2409 static int __pyx_pf_8PyClical_8clifford_6__contains__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_x);
2410 static PyObject *__pyx_pf_8PyClical_8clifford_8__iter__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2411 static PyObject *__pyx_pf_8PyClical_8clifford_10reframe(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_ixt);
2412 static PyObject *__pyx_pf_8PyClical_8clifford_12__richcmp__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op);
2413 static PyObject *__pyx_pf_8PyClical_8clifford_14__getitem__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_ixt);
2414 static PyObject *__pyx_pf_8PyClical_8clifford_16__neg__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2415 static PyObject *__pyx_pf_8PyClical_8clifford_18__pos__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2416 static PyObject *__pyx_pf_8PyClical_8clifford_20__add__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2417 static PyObject *__pyx_pf_8PyClical_8clifford_22__iadd__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2418 static PyObject *__pyx_pf_8PyClical_8clifford_24__sub__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2419 static PyObject *__pyx_pf_8PyClical_8clifford_26__isub__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2420 static PyObject *__pyx_pf_8PyClical_8clifford_28__mul__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2421 static PyObject *__pyx_pf_8PyClical_8clifford_30__imul__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2422 static PyObject *__pyx_pf_8PyClical_8clifford_32__mod__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2423 static PyObject *__pyx_pf_8PyClical_8clifford_34__imod__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2424 static PyObject *__pyx_pf_8PyClical_8clifford_36__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2425 static PyObject *__pyx_pf_8PyClical_8clifford_38__iand__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2426 static PyObject *__pyx_pf_8PyClical_8clifford_40__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2427 static PyObject *__pyx_pf_8PyClical_8clifford_42__ixor__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2428 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 2429 static PyObject *__pyx_pf_8PyClical_8clifford_44__div__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2431 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 2432 static PyObject *__pyx_pf_8PyClical_8clifford_46__idiv__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2434 static PyObject *__pyx_pf_8PyClical_8clifford_48inv(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2435 static PyObject *__pyx_pf_8PyClical_8clifford_50__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2436 static PyObject *__pyx_pf_8PyClical_8clifford_52__ior__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2437 static PyObject *__pyx_pf_8PyClical_8clifford_54__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_m, CYTHON_UNUSED PyObject *__pyx_v_dummy);
2438 static PyObject *__pyx_pf_8PyClical_8clifford_56pow(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_m);
2439 static PyObject *__pyx_pf_8PyClical_8clifford_58outer_pow(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_m);
2440 static PyObject *__pyx_pf_8PyClical_8clifford_60__call__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_grade);
2441 static PyObject *__pyx_pf_8PyClical_8clifford_62scalar(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2442 static PyObject *__pyx_pf_8PyClical_8clifford_64pure(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2443 static PyObject *__pyx_pf_8PyClical_8clifford_66even(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2444 static PyObject *__pyx_pf_8PyClical_8clifford_68odd(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2445 static PyObject *__pyx_pf_8PyClical_8clifford_70vector_part(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_frm);
2446 static PyObject *__pyx_pf_8PyClical_8clifford_72involute(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2447 static PyObject *__pyx_pf_8PyClical_8clifford_74reverse(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2448 static PyObject *__pyx_pf_8PyClical_8clifford_76conj(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2449 static PyObject *__pyx_pf_8PyClical_8clifford_78quad(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2450 static PyObject *__pyx_pf_8PyClical_8clifford_80norm(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2451 static PyObject *__pyx_pf_8PyClical_8clifford_82abs(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2452 static PyObject *__pyx_pf_8PyClical_8clifford_84max_abs(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2453 static PyObject *__pyx_pf_8PyClical_8clifford_86truncated(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_limit);
2454 static PyObject *__pyx_pf_8PyClical_8clifford_88isnan(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2455 static PyObject *__pyx_pf_8PyClical_8clifford_90frame(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2456 static PyObject *__pyx_pf_8PyClical_8clifford_92__repr__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2457 static PyObject *__pyx_pf_8PyClical_8clifford_94__str__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2458 static PyObject *__pyx_pf_8PyClical_8clifford_96__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2459 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);
2460 static PyObject *__pyx_pf_8PyClical_8clifford_hidden_doctests(CYTHON_UNUSED PyObject *__pyx_self);
2461 static PyObject *__pyx_pf_8PyClical_10inv(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2462 static PyObject *__pyx_pf_8PyClical_12scalar(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2463 static PyObject *__pyx_pf_8PyClical_14real(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2464 static PyObject *__pyx_pf_8PyClical_16imag(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2465 static PyObject *__pyx_pf_8PyClical_18pure(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2466 static PyObject *__pyx_pf_8PyClical_20even(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2467 static PyObject *__pyx_pf_8PyClical_22odd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2468 static PyObject *__pyx_pf_8PyClical_24involute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2469 static PyObject *__pyx_pf_8PyClical_26reverse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2470 static PyObject *__pyx_pf_8PyClical_28conj(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2471 static PyObject *__pyx_pf_8PyClical_30quad(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2472 static PyObject *__pyx_pf_8PyClical_32norm(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2473 static PyObject *__pyx_pf_8PyClical_34abs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2474 static PyObject *__pyx_pf_8PyClical_36max_abs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2475 static PyObject *__pyx_pf_8PyClical_38pow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_m);
2476 static PyObject *__pyx_pf_8PyClical_40outer_pow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_m);
2477 static PyObject *__pyx_pf_8PyClical_42complexifier(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2478 static PyObject *__pyx_pf_8PyClical_44sqrt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2479 static PyObject *__pyx_pf_8PyClical_46exp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2480 static PyObject *__pyx_pf_8PyClical_48log(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2481 static PyObject *__pyx_pf_8PyClical_50cos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2482 static PyObject *__pyx_pf_8PyClical_52acos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2483 static PyObject *__pyx_pf_8PyClical_54cosh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2484 static PyObject *__pyx_pf_8PyClical_56acosh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2485 static PyObject *__pyx_pf_8PyClical_58sin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2486 static PyObject *__pyx_pf_8PyClical_60asin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2487 static PyObject *__pyx_pf_8PyClical_62sinh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2488 static PyObject *__pyx_pf_8PyClical_64asinh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2489 static PyObject *__pyx_pf_8PyClical_66tan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2490 static PyObject *__pyx_pf_8PyClical_68atan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2491 static PyObject *__pyx_pf_8PyClical_70tanh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2492 static PyObject *__pyx_pf_8PyClical_72atanh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2493 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);
2494 static PyObject *__pyx_pf_8PyClical_76cga3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2495 static PyObject *__pyx_pf_8PyClical_78cga3std(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2496 static PyObject *__pyx_pf_8PyClical_80agc3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2497 static PyObject *__pyx_pf_8PyClical_82e(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2498 static PyObject *__pyx_pf_8PyClical_84istpq(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_p, PyObject *__pyx_v_q);
2499 static PyObject *__pyx_pf_8PyClical_86_test(CYTHON_UNUSED PyObject *__pyx_self);
2500 static PyObject *__pyx_tp_new_8PyClical_index_set(PyTypeObject *t, PyObject *a, PyObject *k);
2501 static PyObject *__pyx_tp_new_8PyClical_clifford(PyTypeObject *t, PyObject *a, PyObject *k);
2502 static PyObject *__pyx_tp_new_8PyClical___pyx_scope_struct____iter__(PyTypeObject *t, PyObject *a, PyObject *k);
2503 static PyObject *__pyx_float_0_0;
2504 static PyObject *__pyx_float_1_0;
2505 static PyObject *__pyx_float_2_0;
2506 static PyObject *__pyx_float_8_0;
2507 static PyObject *__pyx_int_0;
2508 static PyObject *__pyx_int_1;
2509 static PyObject *__pyx_int_4;
2510 static PyObject *__pyx_int_neg_1;
2511 static PyObject *__pyx_tuple__3;
2512 static PyObject *__pyx_tuple__4;
2513 static PyObject *__pyx_tuple__10;
2514 static PyObject *__pyx_tuple__11;
2515 static PyObject *__pyx_tuple__12;
2516 static PyObject *__pyx_tuple__15;
2517 static PyObject *__pyx_tuple__16;
2518 static PyObject *__pyx_tuple__18;
2519 static PyObject *__pyx_tuple__20;
2520 static PyObject *__pyx_tuple__21;
2521 static PyObject *__pyx_tuple__22;
2522 static PyObject *__pyx_codeobj__13;
2523 static PyObject *__pyx_codeobj__14;
2524 static PyObject *__pyx_codeobj__17;
2525 static PyObject *__pyx_codeobj__19;
2526 static PyObject *__pyx_codeobj__23;
2537 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_toIndexSet(PyObject *__pyx_v_obj) {
2539 __Pyx_RefNannyDeclarations
2540 PyObject *__pyx_t_1 = NULL;
2541 __Pyx_RefNannySetupContext(
"toIndexSet", 0);
2550 __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)
2551 __Pyx_GOTREF(__pyx_t_1);
2552 __pyx_r = (((
struct __pyx_obj_8PyClical_index_set *)__pyx_t_1)->instance[0]);
2553 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2566 __Pyx_XDECREF(__pyx_t_1);
2567 __Pyx_WriteUnraisable(
"PyClical.toIndexSet", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
2568 __Pyx_pretend_to_initialize(&__pyx_r);
2570 __Pyx_RefNannyFinishContext();
2582 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_9index_set_wrap(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self,
IndexSet __pyx_v_other) {
2583 PyObject *__pyx_r = NULL;
2584 __Pyx_RefNannyDeclarations
2585 __Pyx_RefNannySetupContext(
"wrap", 0);
2594 (__pyx_v_self->instance[0]) = __pyx_v_other;
2603 __Pyx_XDECREF(__pyx_r);
2604 __Pyx_INCREF(((PyObject *)__pyx_v_self));
2605 __pyx_r = ((PyObject *)__pyx_v_self);
2618 __Pyx_XGIVEREF(__pyx_r);
2619 __Pyx_RefNannyFinishContext();
2631 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_9index_set_unwrap(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
2633 __Pyx_RefNannyDeclarations
2634 __Pyx_RefNannySetupContext(
"unwrap", 0);
2643 __pyx_r = (__pyx_v_self->instance[0]);
2656 __Pyx_RefNannyFinishContext();
2668 static PyObject *__pyx_pw_8PyClical_9index_set_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
2669 static PyObject *__pyx_f_8PyClical_9index_set_copy(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self,
int __pyx_skip_dispatch) {
2670 PyObject *__pyx_r = NULL;
2671 __Pyx_RefNannyDeclarations
2672 PyObject *__pyx_t_1 = NULL;
2673 PyObject *__pyx_t_2 = NULL;
2674 PyObject *__pyx_t_3 = NULL;
2675 PyObject *__pyx_t_4 = NULL;
2676 __Pyx_RefNannySetupContext(
"copy", 0);
2678 if (unlikely(__pyx_skip_dispatch)) ;
2680 else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
2681 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS 2682 static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
2683 if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
2684 PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
2686 __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)
2687 __Pyx_GOTREF(__pyx_t_1);
2688 if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(
void*)__pyx_pw_8PyClical_9index_set_1copy)) {
2689 __Pyx_XDECREF(__pyx_r);
2690 __Pyx_INCREF(__pyx_t_1);
2691 __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
2692 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
2693 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
2694 if (likely(__pyx_t_4)) {
2695 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
2696 __Pyx_INCREF(__pyx_t_4);
2697 __Pyx_INCREF(
function);
2698 __Pyx_DECREF_SET(__pyx_t_3,
function);
2701 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
2702 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
2703 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error)
2704 __Pyx_GOTREF(__pyx_t_2);
2705 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2706 __pyx_r = __pyx_t_2;
2708 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2711 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS 2712 __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
2713 __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
2714 if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
2715 __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
2718 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2719 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS 2731 __Pyx_XDECREF(__pyx_r);
2732 __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)
2733 __Pyx_GOTREF(__pyx_t_1);
2734 __pyx_r = __pyx_t_1;
2748 __Pyx_XDECREF(__pyx_t_1);
2749 __Pyx_XDECREF(__pyx_t_2);
2750 __Pyx_XDECREF(__pyx_t_3);
2751 __Pyx_XDECREF(__pyx_t_4);
2752 __Pyx_AddTraceback(
"PyClical.index_set.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
2755 __Pyx_XGIVEREF(__pyx_r);
2756 __Pyx_RefNannyFinishContext();
2761 static PyObject *__pyx_pw_8PyClical_9index_set_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
2762 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 ";
2763 static PyObject *__pyx_pw_8PyClical_9index_set_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
2764 PyObject *__pyx_r = 0;
2765 __Pyx_RefNannyDeclarations
2766 __Pyx_RefNannySetupContext(
"copy (wrapper)", 0);
2767 __pyx_r = __pyx_pf_8PyClical_9index_set_copy(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
2770 __Pyx_RefNannyFinishContext();
2774 static PyObject *__pyx_pf_8PyClical_9index_set_copy(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
2775 PyObject *__pyx_r = NULL;
2776 __Pyx_RefNannyDeclarations
2777 PyObject *__pyx_t_1 = NULL;
2778 __Pyx_RefNannySetupContext(
"copy", 0);
2779 __Pyx_XDECREF(__pyx_r);
2780 __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)
2781 __Pyx_GOTREF(__pyx_t_1);
2782 __pyx_r = __pyx_t_1;
2788 __Pyx_XDECREF(__pyx_t_1);
2789 __Pyx_AddTraceback(
"PyClical.index_set.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
2792 __Pyx_XGIVEREF(__pyx_r);
2793 __Pyx_RefNannyFinishContext();
2806 static int __pyx_pw_8PyClical_9index_set_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2807 static int __pyx_pw_8PyClical_9index_set_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2808 PyObject *__pyx_v_other = 0;
2810 __Pyx_RefNannyDeclarations
2811 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
2813 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,0};
2814 PyObject* values[1] = {0};
2815 values[0] = ((PyObject *)__pyx_int_0);
2816 if (unlikely(__pyx_kwds)) {
2818 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2820 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2823 default:
goto __pyx_L5_argtuple_error;
2825 kw_args = PyDict_Size(__pyx_kwds);
2829 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other);
2830 if (value) { values[0] = value; kw_args--; }
2833 if (unlikely(kw_args > 0)) {
2834 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(0, 73, __pyx_L3_error)
2837 switch (PyTuple_GET_SIZE(__pyx_args)) {
2838 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2841 default:
goto __pyx_L5_argtuple_error;
2844 __pyx_v_other = values[0];
2846 goto __pyx_L4_argument_unpacking_done;
2847 __pyx_L5_argtuple_error:;
2848 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 73, __pyx_L3_error)
2850 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2851 __Pyx_RefNannyFinishContext();
2853 __pyx_L4_argument_unpacking_done:;
2854 __pyx_r = __pyx_pf_8PyClical_9index_set_2__cinit__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), __pyx_v_other);
2857 __Pyx_RefNannyFinishContext();
2861 static int __pyx_pf_8PyClical_9index_set_2__cinit__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_other) {
2862 PyObject *__pyx_v_error_msg_prefix = NULL;
2863 PyObject *__pyx_v_idx = NULL;
2865 __Pyx_RefNannyDeclarations
2869 PyObject *__pyx_t_4 = NULL;
2870 PyObject *__pyx_t_5 = NULL;
2873 PyObject *__pyx_t_8 = NULL;
2874 PyObject *__pyx_t_9 = NULL;
2875 PyObject *__pyx_t_10 = NULL;
2876 Py_ssize_t __pyx_t_11;
2877 PyObject *(*__pyx_t_12)(PyObject *);
2878 PyObject *__pyx_t_13 = NULL;
2879 PyObject *__pyx_t_14 = NULL;
2880 PyObject *__pyx_t_15 = NULL;
2881 PyObject *__pyx_t_16 = NULL;
2883 __Pyx_RefNannySetupContext(
"__cinit__", 0);
2892 __Pyx_INCREF(__pyx_kp_s_Cannot_initialize_index_set_obje);
2893 __pyx_v_error_msg_prefix = __pyx_kp_s_Cannot_initialize_index_set_obje;
2902 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8PyClical_index_set);
2903 __pyx_t_2 = (__pyx_t_1 != 0);
2914 __pyx_t_3 =
new IndexSet(__pyx_f_8PyClical_9index_set_unwrap(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_other)));
2916 __Pyx_CppExn2PyErr();
2917 __PYX_ERR(0, 94, __pyx_L1_error)
2919 __pyx_v_self->instance = __pyx_t_3;
2938 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_numbers);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 95, __pyx_L1_error)
2939 __Pyx_GOTREF(__pyx_t_4);
2940 __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)
2941 __Pyx_GOTREF(__pyx_t_5);
2942 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2943 __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)
2944 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2945 __pyx_t_1 = (__pyx_t_2 != 0);
2955 __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)
2957 __pyx_t_3 =
new IndexSet(((
int)__pyx_t_6));
2959 __Pyx_CppExn2PyErr();
2960 __PYX_ERR(0, 96, __pyx_L1_error)
2962 __pyx_v_self->instance = __pyx_t_3;
2981 __pyx_t_2 = PySet_Check(__pyx_v_other);
2982 __pyx_t_7 = (__pyx_t_2 != 0);
2985 __pyx_t_1 = __pyx_t_7;
2986 goto __pyx_L4_bool_binop_done;
2988 __pyx_t_7 = PyFrozenSet_Check(__pyx_v_other);
2989 __pyx_t_2 = (__pyx_t_7 != 0);
2990 __pyx_t_1 = __pyx_t_2;
2991 __pyx_L4_bool_binop_done:;
2992 __pyx_t_2 = (__pyx_t_1 != 0);
3003 __Pyx_PyThreadState_declare
3004 __Pyx_PyThreadState_assign
3005 __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
3006 __Pyx_XGOTREF(__pyx_t_8);
3007 __Pyx_XGOTREF(__pyx_t_9);
3008 __Pyx_XGOTREF(__pyx_t_10);
3019 __pyx_v_self->instance = __pyx_t_3;
3028 if (likely(PyList_CheckExact(__pyx_v_other)) || PyTuple_CheckExact(__pyx_v_other)) {
3029 __pyx_t_5 = __pyx_v_other; __Pyx_INCREF(__pyx_t_5); __pyx_t_11 = 0;
3032 __pyx_t_11 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_other);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 100, __pyx_L6_error)
3033 __Pyx_GOTREF(__pyx_t_5);
3034 __pyx_t_12 = Py_TYPE(__pyx_t_5)->tp_iternext;
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 100, __pyx_L6_error)
3037 if (likely(!__pyx_t_12)) {
3038 if (likely(PyList_CheckExact(__pyx_t_5))) {
3039 if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_5))
break;
3040 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 3041 __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)
3043 __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)
3044 __Pyx_GOTREF(__pyx_t_4);
3047 if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_5))
break;
3048 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 3049 __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)
3051 __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)
3052 __Pyx_GOTREF(__pyx_t_4);
3056 __pyx_t_4 = __pyx_t_12(__pyx_t_5);
3057 if (unlikely(!__pyx_t_4)) {
3058 PyObject* exc_type = PyErr_Occurred();
3060 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
3061 else __PYX_ERR(0, 100, __pyx_L6_error)
3065 __Pyx_GOTREF(__pyx_t_4);
3067 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_4);
3077 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self), __pyx_v_idx, Py_True) < 0)) __PYX_ERR(0, 101, __pyx_L6_error)
3087 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3097 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3098 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
3099 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3100 goto __pyx_L11_try_end;
3102 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3103 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3112 __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_IndexError);
3114 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3115 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_13) < 0) __PYX_ERR(0, 102, __pyx_L8_except_error)
3116 __Pyx_GOTREF(__pyx_t_5);
3117 __Pyx_GOTREF(__pyx_t_4);
3118 __Pyx_GOTREF(__pyx_t_13);
3127 __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)
3128 __Pyx_GOTREF(__pyx_t_14);
3129 __pyx_t_15 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 103, __pyx_L8_except_error)
3130 __Pyx_GOTREF(__pyx_t_15);
3131 __pyx_t_16 = PyNumber_Add(__pyx_t_14, __pyx_t_15);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 103, __pyx_L8_except_error)
3132 __Pyx_GOTREF(__pyx_t_16);
3133 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3134 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3135 __pyx_t_15 = PyNumber_Add(__pyx_t_16, __pyx_kp_s_);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 103, __pyx_L8_except_error)
3136 __Pyx_GOTREF(__pyx_t_15);
3137 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3138 __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)
3139 __Pyx_GOTREF(__pyx_t_16);
3140 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3141 __Pyx_Raise(__pyx_t_16, 0, 0, 0);
3142 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3143 __PYX_ERR(0, 103, __pyx_L8_except_error)
3153 __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
3155 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3156 if (__Pyx_GetException(&__pyx_t_13, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(0, 104, __pyx_L8_except_error)
3157 __Pyx_GOTREF(__pyx_t_13);
3158 __Pyx_GOTREF(__pyx_t_4);
3159 __Pyx_GOTREF(__pyx_t_5);
3168 __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)
3169 __Pyx_GOTREF(__pyx_t_16);
3170 __pyx_t_15 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 105, __pyx_L8_except_error)
3171 __Pyx_GOTREF(__pyx_t_15);
3172 __pyx_t_14 = PyNumber_Add(__pyx_t_16, __pyx_t_15);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 105, __pyx_L8_except_error)
3173 __Pyx_GOTREF(__pyx_t_14);
3174 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3175 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3176 __pyx_t_15 = PyNumber_Add(__pyx_t_14, __pyx_kp_s_);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 105, __pyx_L8_except_error)
3177 __Pyx_GOTREF(__pyx_t_15);
3178 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3179 __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)
3180 __Pyx_GOTREF(__pyx_t_14);
3181 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3182 __Pyx_Raise(__pyx_t_14, 0, 0, 0);
3183 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3184 __PYX_ERR(0, 105, __pyx_L8_except_error)
3186 goto __pyx_L8_except_error;
3187 __pyx_L8_except_error:;
3196 __Pyx_XGIVEREF(__pyx_t_8);
3197 __Pyx_XGIVEREF(__pyx_t_9);
3198 __Pyx_XGIVEREF(__pyx_t_10);
3199 __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
3200 goto __pyx_L1_error;
3221 __pyx_t_2 = PyString_Check(__pyx_v_other);
3222 __pyx_t_1 = (__pyx_t_2 != 0);
3223 if (likely(__pyx_t_1)) {
3233 __Pyx_PyThreadState_declare
3234 __Pyx_PyThreadState_assign
3235 __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
3236 __Pyx_XGOTREF(__pyx_t_10);
3237 __Pyx_XGOTREF(__pyx_t_9);
3238 __Pyx_XGOTREF(__pyx_t_8);
3248 __pyx_t_17 = __Pyx_PyObject_AsWritableString(__pyx_v_other);
if (unlikely((!__pyx_t_17) && PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L18_error)
3250 __pyx_t_3 =
new IndexSet(((
char *)__pyx_t_17));
3252 __Pyx_CppExn2PyErr();
3253 __PYX_ERR(0, 108, __pyx_L18_error)
3255 __pyx_v_self->instance = __pyx_t_3;
3265 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3266 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
3267 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3268 goto __pyx_L23_try_end;
3270 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
3271 __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
3272 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
3273 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
3274 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3275 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3284 __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
3286 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3287 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_13) < 0) __PYX_ERR(0, 109, __pyx_L20_except_error)
3288 __Pyx_GOTREF(__pyx_t_5);
3289 __Pyx_GOTREF(__pyx_t_4);
3290 __Pyx_GOTREF(__pyx_t_13);
3299 __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)
3300 __Pyx_GOTREF(__pyx_t_14);
3301 __pyx_t_15 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 110, __pyx_L20_except_error)
3302 __Pyx_GOTREF(__pyx_t_15);
3303 __pyx_t_16 = PyNumber_Add(__pyx_t_14, __pyx_t_15);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 110, __pyx_L20_except_error)
3304 __Pyx_GOTREF(__pyx_t_16);
3305 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3306 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3307 __pyx_t_15 = PyNumber_Add(__pyx_t_16, __pyx_kp_s_);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 110, __pyx_L20_except_error)
3308 __Pyx_GOTREF(__pyx_t_15);
3309 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3310 __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)
3311 __Pyx_GOTREF(__pyx_t_16);
3312 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3313 __Pyx_Raise(__pyx_t_16, 0, 0, 0);
3314 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3315 __PYX_ERR(0, 110, __pyx_L20_except_error)
3317 goto __pyx_L20_except_error;
3318 __pyx_L20_except_error:;
3327 __Pyx_XGIVEREF(__pyx_t_10);
3328 __Pyx_XGIVEREF(__pyx_t_9);
3329 __Pyx_XGIVEREF(__pyx_t_8);
3330 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8);
3331 goto __pyx_L1_error;
3353 __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)
3354 __Pyx_GOTREF(__pyx_t_13);
3355 __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)
3356 __Pyx_GOTREF(__pyx_t_4);
3357 __pyx_t_5 = PyNumber_Add(__pyx_t_13, __pyx_t_4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 112, __pyx_L1_error)
3358 __Pyx_GOTREF(__pyx_t_5);
3359 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
3360 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3361 __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_kp_s_);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 112, __pyx_L1_error)
3362 __Pyx_GOTREF(__pyx_t_4);
3363 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3364 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 112, __pyx_L1_error)
3365 __Pyx_GOTREF(__pyx_t_5);
3366 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3367 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
3368 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3369 __PYX_ERR(0, 112, __pyx_L1_error)
3385 __Pyx_XDECREF(__pyx_t_4);
3386 __Pyx_XDECREF(__pyx_t_5);
3387 __Pyx_XDECREF(__pyx_t_13);
3388 __Pyx_XDECREF(__pyx_t_14);
3389 __Pyx_XDECREF(__pyx_t_15);
3390 __Pyx_XDECREF(__pyx_t_16);
3391 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3394 __Pyx_XDECREF(__pyx_v_error_msg_prefix);
3395 __Pyx_XDECREF(__pyx_v_idx);
3396 __Pyx_RefNannyFinishContext();
3409 static void __pyx_pw_8PyClical_9index_set_5__dealloc__(PyObject *__pyx_v_self);
3410 static void __pyx_pw_8PyClical_9index_set_5__dealloc__(PyObject *__pyx_v_self) {
3411 __Pyx_RefNannyDeclarations
3412 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
3413 __pyx_pf_8PyClical_9index_set_4__dealloc__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
3416 __Pyx_RefNannyFinishContext();
3419 static void __pyx_pf_8PyClical_9index_set_4__dealloc__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
3420 __Pyx_RefNannyDeclarations
3421 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
3430 delete __pyx_v_self->instance;
3441 __Pyx_RefNannyFinishContext();
3453 static PyObject *__pyx_pw_8PyClical_9index_set_7__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op);
3454 static PyObject *__pyx_pw_8PyClical_9index_set_7__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op) {
3455 PyObject *__pyx_r = 0;
3456 __Pyx_RefNannyDeclarations
3457 __Pyx_RefNannySetupContext(
"__richcmp__ (wrapper)", 0);
3458 __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));
3461 __Pyx_RefNannyFinishContext();
3465 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) {
3466 PyObject *__pyx_v_eq = NULL;
3467 PyObject *__pyx_v_lt = NULL;
3468 PyObject *__pyx_r = NULL;
3469 __Pyx_RefNannyDeclarations
3473 PyObject *__pyx_t_4 = NULL;
3474 __Pyx_RefNannySetupContext(
"__richcmp__", 0);
3483 __pyx_t_2 = (((PyObject *)__pyx_v_lhs) == Py_None);
3484 __pyx_t_3 = (__pyx_t_2 != 0);
3487 __pyx_t_1 = __pyx_t_3;
3488 goto __pyx_L4_bool_binop_done;
3490 __pyx_t_3 = (__pyx_v_rhs == Py_None);
3491 __pyx_t_2 = (__pyx_t_3 != 0);
3492 __pyx_t_1 = __pyx_t_2;
3493 __pyx_L4_bool_binop_done:;
3503 __pyx_t_1 = (((PyObject *)__pyx_v_lhs) == __pyx_v_rhs);
3504 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 142, __pyx_L1_error)
3505 __Pyx_GOTREF(__pyx_t_4);
3506 __pyx_v_eq = __pyx_t_4;
3516 switch (__pyx_v_op) {
3526 __Pyx_XDECREF(__pyx_r);
3527 __Pyx_INCREF(__pyx_v_eq);
3528 __pyx_r = __pyx_v_eq;
3548 __Pyx_XDECREF(__pyx_r);
3549 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_eq);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 146, __pyx_L1_error)
3550 __pyx_t_4 = __Pyx_PyBool_FromLong((!__pyx_t_1));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error)
3551 __Pyx_GOTREF(__pyx_t_4);
3552 __pyx_r = __pyx_t_4;
3573 switch (__pyx_v_op) {
3583 __Pyx_XDECREF(__pyx_r);
3584 __Pyx_INCREF(Py_False);
3605 __Pyx_XDECREF(__pyx_r);
3606 __Pyx_INCREF(__pyx_v_eq);
3607 __pyx_r = __pyx_v_eq;
3627 __Pyx_XDECREF(__pyx_r);
3628 __Pyx_INCREF(Py_False);
3649 __Pyx_XDECREF(__pyx_r);
3650 __Pyx_INCREF(__pyx_v_eq);
3651 __pyx_r = __pyx_v_eq;
3671 __Pyx_XDECREF(__pyx_r);
3672 __Pyx_INCREF(__pyx_builtin_NotImplemented);
3673 __pyx_r = __pyx_builtin_NotImplemented;
3697 __pyx_t_1 = (__pyx_f_8PyClical_toIndexSet(((PyObject *)__pyx_v_lhs)) == __pyx_f_8PyClical_toIndexSet(__pyx_v_rhs));
3698 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error)
3699 __Pyx_GOTREF(__pyx_t_4);
3700 __pyx_v_eq = __pyx_t_4;
3710 switch (__pyx_v_op) {
3720 __Pyx_XDECREF(__pyx_r);
3721 __Pyx_INCREF(__pyx_v_eq);
3722 __pyx_r = __pyx_v_eq;
3742 __Pyx_XDECREF(__pyx_r);
3743 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_eq);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 163, __pyx_L1_error)
3744 __pyx_t_4 = __Pyx_PyBool_FromLong((!__pyx_t_1));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error)
3745 __Pyx_GOTREF(__pyx_t_4);
3746 __pyx_r = __pyx_t_4;
3767 __pyx_t_1 = (__pyx_f_8PyClical_toIndexSet(((PyObject *)__pyx_v_lhs)) < __pyx_f_8PyClical_toIndexSet(__pyx_v_rhs));
3768 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error)
3769 __Pyx_GOTREF(__pyx_t_4);
3770 __pyx_v_lt = __pyx_t_4;
3780 switch (__pyx_v_op) {
3790 __Pyx_XDECREF(__pyx_r);
3791 __Pyx_INCREF(__pyx_v_lt);
3792 __pyx_r = __pyx_v_lt;
3812 __Pyx_XDECREF(__pyx_r);
3813 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_lt);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 169, __pyx_L1_error)
3816 __Pyx_INCREF(__pyx_v_lt);
3817 __pyx_t_4 = __pyx_v_lt;
3818 goto __pyx_L6_bool_binop_done;
3820 __Pyx_INCREF(__pyx_v_eq);
3821 __pyx_t_4 = __pyx_v_eq;
3822 __pyx_L6_bool_binop_done:;
3823 __pyx_r = __pyx_t_4;
3844 __Pyx_XDECREF(__pyx_r);
3845 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_lt);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 171, __pyx_L1_error)
3848 __pyx_t_1 = __pyx_t_2;
3849 goto __pyx_L8_bool_binop_done;
3851 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_eq);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 171, __pyx_L1_error)
3852 __pyx_t_1 = __pyx_t_2;
3853 __pyx_L8_bool_binop_done:;
3854 __pyx_t_4 = __Pyx_PyBool_FromLong((!__pyx_t_1));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error)
3855 __Pyx_GOTREF(__pyx_t_4);
3856 __pyx_r = __pyx_t_4;
3877 __Pyx_XDECREF(__pyx_r);
3878 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_lt);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 173, __pyx_L1_error)
3879 __pyx_t_4 = __Pyx_PyBool_FromLong((!__pyx_t_1));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 173, __pyx_L1_error)
3880 __Pyx_GOTREF(__pyx_t_4);
3881 __pyx_r = __pyx_t_4;
3902 __Pyx_XDECREF(__pyx_r);
3903 __Pyx_INCREF(__pyx_builtin_NotImplemented);
3904 __pyx_r = __pyx_builtin_NotImplemented;
3922 __Pyx_XDECREF(__pyx_t_4);
3923 __Pyx_AddTraceback(
"PyClical.index_set.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3926 __Pyx_XDECREF(__pyx_v_eq);
3927 __Pyx_XDECREF(__pyx_v_lt);
3928 __Pyx_XGIVEREF(__pyx_r);
3929 __Pyx_RefNannyFinishContext();
3942 static int __pyx_pw_8PyClical_9index_set_9__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx, PyObject *__pyx_v_val);
3943 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 ";
3944 #if CYTHON_COMPILING_IN_CPYTHON 3945 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_8__setitem__;
3947 static int __pyx_pw_8PyClical_9index_set_9__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx, PyObject *__pyx_v_val) {
3949 __Pyx_RefNannyDeclarations
3950 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
3951 __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));
3954 __Pyx_RefNannyFinishContext();
3958 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) {
3960 __Pyx_RefNannyDeclarations
3963 __Pyx_RefNannySetupContext(
"__setitem__", 0);
3972 __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)
3973 __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)
3975 __pyx_v_self->instance->set(__pyx_t_1, __pyx_t_2);
3977 __Pyx_CppExn2PyErr();
3978 __PYX_ERR(0, 186, __pyx_L1_error)
4001 __Pyx_AddTraceback(
"PyClical.index_set.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4004 __Pyx_RefNannyFinishContext();
4017 static PyObject *__pyx_pw_8PyClical_9index_set_11__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx);
4018 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 ";
4019 #if CYTHON_COMPILING_IN_CPYTHON 4020 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_10__getitem__;
4022 static PyObject *__pyx_pw_8PyClical_9index_set_11__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx) {
4023 PyObject *__pyx_r = 0;
4024 __Pyx_RefNannyDeclarations
4025 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
4026 __pyx_r = __pyx_pf_8PyClical_9index_set_10__getitem__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_idx));
4029 __Pyx_RefNannyFinishContext();
4033 static PyObject *__pyx_pf_8PyClical_9index_set_10__getitem__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_idx) {
4034 PyObject *__pyx_r = NULL;
4035 __Pyx_RefNannyDeclarations
4037 PyObject *__pyx_t_2 = NULL;
4038 __Pyx_RefNannySetupContext(
"__getitem__", 0);
4047 __Pyx_XDECREF(__pyx_r);
4048 __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)
4049 __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)
4050 __Pyx_GOTREF(__pyx_t_2);
4051 __pyx_r = __pyx_t_2;
4065 __Pyx_XDECREF(__pyx_t_2);
4066 __Pyx_AddTraceback(
"PyClical.index_set.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4069 __Pyx_XGIVEREF(__pyx_r);
4070 __Pyx_RefNannyFinishContext();
4083 static int __pyx_pw_8PyClical_9index_set_13__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx);
4084 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 ";
4085 #if CYTHON_COMPILING_IN_CPYTHON 4086 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_12__contains__;
4088 static int __pyx_pw_8PyClical_9index_set_13__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx) {
4090 __Pyx_RefNannyDeclarations
4091 __Pyx_RefNannySetupContext(
"__contains__ (wrapper)", 0);
4092 __pyx_r = __pyx_pf_8PyClical_9index_set_12__contains__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_idx));
4095 __Pyx_RefNannyFinishContext();
4099 static int __pyx_pf_8PyClical_9index_set_12__contains__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_idx) {
4101 __Pyx_RefNannyDeclarations
4103 __Pyx_RefNannySetupContext(
"__contains__", 0);
4112 __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)
4113 __pyx_r = __pyx_v_self->instance->operator[](__pyx_t_1);
4126 __Pyx_AddTraceback(
"PyClical.index_set.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4129 __Pyx_RefNannyFinishContext();
4132 static PyObject *__pyx_gb_8PyClical_9index_set_16generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value);
4143 static PyObject *__pyx_pw_8PyClical_9index_set_15__iter__(PyObject *__pyx_v_self);
4144 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 ";
4145 #if CYTHON_COMPILING_IN_CPYTHON 4146 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_14__iter__;
4148 static PyObject *__pyx_pw_8PyClical_9index_set_15__iter__(PyObject *__pyx_v_self) {
4149 PyObject *__pyx_r = 0;
4150 __Pyx_RefNannyDeclarations
4151 __Pyx_RefNannySetupContext(
"__iter__ (wrapper)", 0);
4152 __pyx_r = __pyx_pf_8PyClical_9index_set_14__iter__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
4155 __Pyx_RefNannyFinishContext();
4159 static PyObject *__pyx_pf_8PyClical_9index_set_14__iter__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
4160 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *__pyx_cur_scope;
4161 PyObject *__pyx_r = NULL;
4162 __Pyx_RefNannyDeclarations
4163 __Pyx_RefNannySetupContext(
"__iter__", 0);
4164 __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);
4165 if (unlikely(!__pyx_cur_scope)) {
4166 __pyx_cur_scope = ((
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)Py_None);
4167 __Pyx_INCREF(Py_None);
4168 __PYX_ERR(0, 227, __pyx_L1_error)
4170 __Pyx_GOTREF(__pyx_cur_scope);
4172 __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
4173 __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
4174 __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
4176 __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)
4177 __Pyx_DECREF(__pyx_cur_scope);
4178 __Pyx_RefNannyFinishContext();
4179 return (PyObject *) gen;
4184 __Pyx_AddTraceback(
"PyClical.index_set.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4186 __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
4187 __Pyx_XGIVEREF(__pyx_r);
4188 __Pyx_RefNannyFinishContext();
4192 static PyObject *__pyx_gb_8PyClical_9index_set_16generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value)
4194 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *__pyx_cur_scope = ((
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)__pyx_generator->closure);
4195 PyObject *__pyx_r = NULL;
4196 PyObject *__pyx_t_1 = NULL;
4197 PyObject *__pyx_t_2 = NULL;
4198 PyObject *__pyx_t_3 = NULL;
4199 PyObject *__pyx_t_4 = NULL;
4200 Py_ssize_t __pyx_t_5;
4201 PyObject *(*__pyx_t_6)(PyObject *);
4204 __Pyx_RefNannyDeclarations
4205 __Pyx_RefNannySetupContext(
"__iter__", 0);
4206 switch (__pyx_generator->resume_label) {
4207 case 0:
goto __pyx_L3_first_run;
4208 case 1:
goto __pyx_L7_resume_from_yield;
4210 __Pyx_RefNannyFinishContext();
4213 __pyx_L3_first_run:;
4214 if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 227, __pyx_L1_error)
4223 __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)
4224 __Pyx_GOTREF(__pyx_t_2);
4226 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
4227 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
4228 if (likely(__pyx_t_3)) {
4229 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
4230 __Pyx_INCREF(__pyx_t_3);
4231 __Pyx_INCREF(
function);
4232 __Pyx_DECREF_SET(__pyx_t_2,
function);
4235 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
4236 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4237 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error)
4238 __Pyx_GOTREF(__pyx_t_1);
4239 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4240 __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)
4241 __Pyx_GOTREF(__pyx_t_3);
4243 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4244 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
4245 if (likely(__pyx_t_4)) {
4246 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4247 __Pyx_INCREF(__pyx_t_4);
4248 __Pyx_INCREF(
function);
4249 __Pyx_DECREF_SET(__pyx_t_3,
function);
4252 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
4253 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4254 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error)
4255 __Pyx_GOTREF(__pyx_t_2);
4256 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4257 __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 234, __pyx_L1_error)
4258 __Pyx_GOTREF(__pyx_t_3);
4259 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4260 __pyx_t_2 = PyTuple_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error)
4261 __Pyx_GOTREF(__pyx_t_2);
4262 __Pyx_GIVEREF(__pyx_t_1);
4263 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
4264 __Pyx_GIVEREF(__pyx_t_3);
4265 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
4268 __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)
4269 __Pyx_GOTREF(__pyx_t_3);
4270 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4271 if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
4272 __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
4275 __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error)
4276 __Pyx_GOTREF(__pyx_t_2);
4277 __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext;
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error)
4279 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4281 if (likely(!__pyx_t_6)) {
4282 if (likely(PyList_CheckExact(__pyx_t_2))) {
4283 if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2))
break;
4284 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 4285 __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)
4287 __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)
4288 __Pyx_GOTREF(__pyx_t_3);
4291 if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2))
break;
4292 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 4293 __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)
4295 __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)
4296 __Pyx_GOTREF(__pyx_t_3);
4300 __pyx_t_3 = __pyx_t_6(__pyx_t_2);
4301 if (unlikely(!__pyx_t_3)) {
4302 PyObject* exc_type = PyErr_Occurred();
4304 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
4305 else __PYX_ERR(0, 234, __pyx_L1_error)
4309 __Pyx_GOTREF(__pyx_t_3);
4311 __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_idx);
4312 __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_idx, __pyx_t_3);
4313 __Pyx_GIVEREF(__pyx_t_3);
4323 __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)
4324 __pyx_t_8 = (__pyx_t_7 != 0);
4334 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_idx);
4335 __pyx_r = __pyx_cur_scope->__pyx_v_idx;
4336 __Pyx_XGIVEREF(__pyx_t_2);
4337 __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
4338 __pyx_cur_scope->__pyx_t_1 = __pyx_t_5;
4339 __pyx_cur_scope->__pyx_t_2 = __pyx_t_6;
4340 __Pyx_XGIVEREF(__pyx_r);
4341 __Pyx_RefNannyFinishContext();
4342 __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
4344 __pyx_generator->resume_label = 1;
4346 __pyx_L7_resume_from_yield:;
4347 __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
4348 __pyx_cur_scope->__pyx_t_0 = 0;
4349 __Pyx_XGOTREF(__pyx_t_2);
4350 __pyx_t_5 = __pyx_cur_scope->__pyx_t_1;
4351 __pyx_t_6 = __pyx_cur_scope->__pyx_t_2;
4352 if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 236, __pyx_L1_error)
4371 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4372 CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
4383 PyErr_SetNone(PyExc_StopIteration);
4386 __Pyx_XDECREF(__pyx_t_1);
4387 __Pyx_XDECREF(__pyx_t_2);
4388 __Pyx_XDECREF(__pyx_t_3);
4389 __Pyx_XDECREF(__pyx_t_4);
4390 __Pyx_AddTraceback(
"__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4392 __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
4393 #if !CYTHON_USE_EXC_INFO_STACK 4394 __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
4396 __pyx_generator->resume_label = -1;
4397 __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
4398 __Pyx_RefNannyFinishContext();
4411 static PyObject *__pyx_pw_8PyClical_9index_set_18__invert__(PyObject *__pyx_v_self);
4412 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 ";
4413 #if CYTHON_COMPILING_IN_CPYTHON 4414 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_17__invert__;
4416 static PyObject *__pyx_pw_8PyClical_9index_set_18__invert__(PyObject *__pyx_v_self) {
4417 PyObject *__pyx_r = 0;
4418 __Pyx_RefNannyDeclarations
4419 __Pyx_RefNannySetupContext(
"__invert__ (wrapper)", 0);
4420 __pyx_r = __pyx_pf_8PyClical_9index_set_17__invert__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
4423 __Pyx_RefNannyFinishContext();
4427 static PyObject *__pyx_pf_8PyClical_9index_set_17__invert__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
4428 PyObject *__pyx_r = NULL;
4429 __Pyx_RefNannyDeclarations
4430 PyObject *__pyx_t_1 = NULL;
4431 PyObject *__pyx_t_2 = NULL;
4432 __Pyx_RefNannySetupContext(
"__invert__", 0);
4441 __Pyx_XDECREF(__pyx_r);
4442 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_index_set));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 245, __pyx_L1_error)
4443 __Pyx_GOTREF(__pyx_t_1);
4444 __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)
4445 __Pyx_GOTREF(__pyx_t_2);
4446 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4447 __pyx_r = __pyx_t_2;
4461 __Pyx_XDECREF(__pyx_t_1);
4462 __Pyx_XDECREF(__pyx_t_2);
4463 __Pyx_AddTraceback(
"PyClical.index_set.__invert__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4466 __Pyx_XGIVEREF(__pyx_r);
4467 __Pyx_RefNannyFinishContext();
4480 static PyObject *__pyx_pw_8PyClical_9index_set_20__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
4481 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 ";
4482 #if CYTHON_COMPILING_IN_CPYTHON 4483 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_19__xor__;
4485 static PyObject *__pyx_pw_8PyClical_9index_set_20__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4486 PyObject *__pyx_r = 0;
4487 __Pyx_RefNannyDeclarations
4488 __Pyx_RefNannySetupContext(
"__xor__ (wrapper)", 0);
4489 __pyx_r = __pyx_pf_8PyClical_9index_set_19__xor__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
4492 __Pyx_RefNannyFinishContext();
4496 static PyObject *__pyx_pf_8PyClical_9index_set_19__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4497 PyObject *__pyx_r = NULL;
4498 __Pyx_RefNannyDeclarations
4499 PyObject *__pyx_t_1 = NULL;
4500 PyObject *__pyx_t_2 = NULL;
4501 __Pyx_RefNannySetupContext(
"__xor__", 0);
4510 __Pyx_XDECREF(__pyx_r);
4511 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_index_set));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error)
4512 __Pyx_GOTREF(__pyx_t_1);
4513 __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)
4514 __Pyx_GOTREF(__pyx_t_2);
4515 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4516 __pyx_r = __pyx_t_2;
4530 __Pyx_XDECREF(__pyx_t_1);
4531 __Pyx_XDECREF(__pyx_t_2);
4532 __Pyx_AddTraceback(
"PyClical.index_set.__xor__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4535 __Pyx_XGIVEREF(__pyx_r);
4536 __Pyx_RefNannyFinishContext();
4549 static PyObject *__pyx_pw_8PyClical_9index_set_22__ixor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
4550 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 ";
4551 #if CYTHON_COMPILING_IN_CPYTHON 4552 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_21__ixor__;
4554 static PyObject *__pyx_pw_8PyClical_9index_set_22__ixor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
4555 PyObject *__pyx_r = 0;
4556 __Pyx_RefNannyDeclarations
4557 __Pyx_RefNannySetupContext(
"__ixor__ (wrapper)", 0);
4558 __pyx_r = __pyx_pf_8PyClical_9index_set_21__ixor__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
4561 __Pyx_RefNannyFinishContext();
4565 static PyObject *__pyx_pf_8PyClical_9index_set_21__ixor__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs) {
4566 PyObject *__pyx_r = NULL;
4567 __Pyx_RefNannyDeclarations
4568 PyObject *__pyx_t_1 = NULL;
4569 __Pyx_RefNannySetupContext(
"__ixor__", 0);
4578 __Pyx_XDECREF(__pyx_r);
4579 __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)
4580 __Pyx_GOTREF(__pyx_t_1);
4581 __pyx_r = __pyx_t_1;
4595 __Pyx_XDECREF(__pyx_t_1);
4596 __Pyx_AddTraceback(
"PyClical.index_set.__ixor__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4599 __Pyx_XGIVEREF(__pyx_r);
4600 __Pyx_RefNannyFinishContext();
4613 static PyObject *__pyx_pw_8PyClical_9index_set_24__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
4614 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 ";
4615 #if CYTHON_COMPILING_IN_CPYTHON 4616 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_23__and__;
4618 static PyObject *__pyx_pw_8PyClical_9index_set_24__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4619 PyObject *__pyx_r = 0;
4620 __Pyx_RefNannyDeclarations
4621 __Pyx_RefNannySetupContext(
"__and__ (wrapper)", 0);
4622 __pyx_r = __pyx_pf_8PyClical_9index_set_23__and__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
4625 __Pyx_RefNannyFinishContext();
4629 static PyObject *__pyx_pf_8PyClical_9index_set_23__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4630 PyObject *__pyx_r = NULL;
4631 __Pyx_RefNannyDeclarations
4632 PyObject *__pyx_t_1 = NULL;
4633 PyObject *__pyx_t_2 = NULL;
4634 __Pyx_RefNannySetupContext(
"__and__", 0);
4643 __Pyx_XDECREF(__pyx_r);
4644 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_index_set));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __pyx_L1_error)
4645 __Pyx_GOTREF(__pyx_t_1);
4646 __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)
4647 __Pyx_GOTREF(__pyx_t_2);
4648 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4649 __pyx_r = __pyx_t_2;
4663 __Pyx_XDECREF(__pyx_t_1);
4664 __Pyx_XDECREF(__pyx_t_2);
4665 __Pyx_AddTraceback(
"PyClical.index_set.__and__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4668 __Pyx_XGIVEREF(__pyx_r);
4669 __Pyx_RefNannyFinishContext();
4682 static PyObject *__pyx_pw_8PyClical_9index_set_26__iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
4683 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 ";
4684 #if CYTHON_COMPILING_IN_CPYTHON 4685 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_25__iand__;
4687 static PyObject *__pyx_pw_8PyClical_9index_set_26__iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
4688 PyObject *__pyx_r = 0;
4689 __Pyx_RefNannyDeclarations
4690 __Pyx_RefNannySetupContext(
"__iand__ (wrapper)", 0);
4691 __pyx_r = __pyx_pf_8PyClical_9index_set_25__iand__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
4694 __Pyx_RefNannyFinishContext();
4698 static PyObject *__pyx_pf_8PyClical_9index_set_25__iand__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs) {
4699 PyObject *__pyx_r = NULL;
4700 __Pyx_RefNannyDeclarations
4701 PyObject *__pyx_t_1 = NULL;
4702 __Pyx_RefNannySetupContext(
"__iand__", 0);
4711 __Pyx_XDECREF(__pyx_r);
4712 __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)
4713 __Pyx_GOTREF(__pyx_t_1);
4714 __pyx_r = __pyx_t_1;
4728 __Pyx_XDECREF(__pyx_t_1);
4729 __Pyx_AddTraceback(
"PyClical.index_set.__iand__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4732 __Pyx_XGIVEREF(__pyx_r);
4733 __Pyx_RefNannyFinishContext();
4746 static PyObject *__pyx_pw_8PyClical_9index_set_28__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
4747 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 ";
4748 #if CYTHON_COMPILING_IN_CPYTHON 4749 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_27__or__;
4751 static PyObject *__pyx_pw_8PyClical_9index_set_28__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4752 PyObject *__pyx_r = 0;
4753 __Pyx_RefNannyDeclarations
4754 __Pyx_RefNannySetupContext(
"__or__ (wrapper)", 0);
4755 __pyx_r = __pyx_pf_8PyClical_9index_set_27__or__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
4758 __Pyx_RefNannyFinishContext();
4762 static PyObject *__pyx_pf_8PyClical_9index_set_27__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4763 PyObject *__pyx_r = NULL;
4764 __Pyx_RefNannyDeclarations
4765 PyObject *__pyx_t_1 = NULL;
4766 PyObject *__pyx_t_2 = NULL;
4767 __Pyx_RefNannySetupContext(
"__or__", 0);
4776 __Pyx_XDECREF(__pyx_r);
4777 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_index_set));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error)
4778 __Pyx_GOTREF(__pyx_t_1);
4779 __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)
4780 __Pyx_GOTREF(__pyx_t_2);
4781 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4782 __pyx_r = __pyx_t_2;
4796 __Pyx_XDECREF(__pyx_t_1);
4797 __Pyx_XDECREF(__pyx_t_2);
4798 __Pyx_AddTraceback(
"PyClical.index_set.__or__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4801 __Pyx_XGIVEREF(__pyx_r);
4802 __Pyx_RefNannyFinishContext();
4815 static PyObject *__pyx_pw_8PyClical_9index_set_30__ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
4816 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 ";
4817 #if CYTHON_COMPILING_IN_CPYTHON 4818 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_29__ior__;
4820 static PyObject *__pyx_pw_8PyClical_9index_set_30__ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
4821 PyObject *__pyx_r = 0;
4822 __Pyx_RefNannyDeclarations
4823 __Pyx_RefNannySetupContext(
"__ior__ (wrapper)", 0);
4824 __pyx_r = __pyx_pf_8PyClical_9index_set_29__ior__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
4827 __Pyx_RefNannyFinishContext();
4831 static PyObject *__pyx_pf_8PyClical_9index_set_29__ior__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs) {
4832 PyObject *__pyx_r = NULL;
4833 __Pyx_RefNannyDeclarations
4834 PyObject *__pyx_t_1 = NULL;
4835 __Pyx_RefNannySetupContext(
"__ior__", 0);
4844 __Pyx_XDECREF(__pyx_r);
4845 __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)
4846 __Pyx_GOTREF(__pyx_t_1);
4847 __pyx_r = __pyx_t_1;
4861 __Pyx_XDECREF(__pyx_t_1);
4862 __Pyx_AddTraceback(
"PyClical.index_set.__ior__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4865 __Pyx_XGIVEREF(__pyx_r);
4866 __Pyx_RefNannyFinishContext();
4879 static PyObject *__pyx_pw_8PyClical_9index_set_32count(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4880 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 ";
4881 static PyObject *__pyx_pw_8PyClical_9index_set_32count(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4882 PyObject *__pyx_r = 0;
4883 __Pyx_RefNannyDeclarations
4884 __Pyx_RefNannySetupContext(
"count (wrapper)", 0);
4885 __pyx_r = __pyx_pf_8PyClical_9index_set_31count(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
4888 __Pyx_RefNannyFinishContext();
4892 static PyObject *__pyx_pf_8PyClical_9index_set_31count(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
4893 PyObject *__pyx_r = NULL;
4894 __Pyx_RefNannyDeclarations
4895 PyObject *__pyx_t_1 = NULL;
4896 __Pyx_RefNannySetupContext(
"count", 0);
4905 __Pyx_XDECREF(__pyx_r);
4906 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->instance->count());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error)
4907 __Pyx_GOTREF(__pyx_t_1);
4908 __pyx_r = __pyx_t_1;
4922 __Pyx_XDECREF(__pyx_t_1);
4923 __Pyx_AddTraceback(
"PyClical.index_set.count", __pyx_clineno, __pyx_lineno, __pyx_filename);
4926 __Pyx_XGIVEREF(__pyx_r);
4927 __Pyx_RefNannyFinishContext();
4940 static PyObject *__pyx_pw_8PyClical_9index_set_34count_neg(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4941 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 ";
4942 static PyObject *__pyx_pw_8PyClical_9index_set_34count_neg(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4943 PyObject *__pyx_r = 0;
4944 __Pyx_RefNannyDeclarations
4945 __Pyx_RefNannySetupContext(
"count_neg (wrapper)", 0);
4946 __pyx_r = __pyx_pf_8PyClical_9index_set_33count_neg(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
4949 __Pyx_RefNannyFinishContext();
4953 static PyObject *__pyx_pf_8PyClical_9index_set_33count_neg(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
4954 PyObject *__pyx_r = NULL;
4955 __Pyx_RefNannyDeclarations
4956 PyObject *__pyx_t_1 = NULL;
4957 __Pyx_RefNannySetupContext(
"count_neg", 0);
4966 __Pyx_XDECREF(__pyx_r);
4967 __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)
4968 __Pyx_GOTREF(__pyx_t_1);
4969 __pyx_r = __pyx_t_1;
4983 __Pyx_XDECREF(__pyx_t_1);
4984 __Pyx_AddTraceback(
"PyClical.index_set.count_neg", __pyx_clineno, __pyx_lineno, __pyx_filename);
4987 __Pyx_XGIVEREF(__pyx_r);
4988 __Pyx_RefNannyFinishContext();
5001 static PyObject *__pyx_pw_8PyClical_9index_set_36count_pos(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5002 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 ";
5003 static PyObject *__pyx_pw_8PyClical_9index_set_36count_pos(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5004 PyObject *__pyx_r = 0;
5005 __Pyx_RefNannyDeclarations
5006 __Pyx_RefNannySetupContext(
"count_pos (wrapper)", 0);
5007 __pyx_r = __pyx_pf_8PyClical_9index_set_35count_pos(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5010 __Pyx_RefNannyFinishContext();
5014 static PyObject *__pyx_pf_8PyClical_9index_set_35count_pos(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5015 PyObject *__pyx_r = NULL;
5016 __Pyx_RefNannyDeclarations
5017 PyObject *__pyx_t_1 = NULL;
5018 __Pyx_RefNannySetupContext(
"count_pos", 0);
5027 __Pyx_XDECREF(__pyx_r);
5028 __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)
5029 __Pyx_GOTREF(__pyx_t_1);
5030 __pyx_r = __pyx_t_1;
5044 __Pyx_XDECREF(__pyx_t_1);
5045 __Pyx_AddTraceback(
"PyClical.index_set.count_pos", __pyx_clineno, __pyx_lineno, __pyx_filename);
5048 __Pyx_XGIVEREF(__pyx_r);
5049 __Pyx_RefNannyFinishContext();
5062 static PyObject *__pyx_pw_8PyClical_9index_set_38min(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5063 static char __pyx_doc_8PyClical_9index_set_37min[] =
"\n Minimum member.\n\n >>> index_set({-1,1,2}).min()\n -1\n ";
5064 static PyObject *__pyx_pw_8PyClical_9index_set_38min(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5065 PyObject *__pyx_r = 0;
5066 __Pyx_RefNannyDeclarations
5067 __Pyx_RefNannySetupContext(
"min (wrapper)", 0);
5068 __pyx_r = __pyx_pf_8PyClical_9index_set_37min(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5071 __Pyx_RefNannyFinishContext();
5075 static PyObject *__pyx_pf_8PyClical_9index_set_37min(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5076 PyObject *__pyx_r = NULL;
5077 __Pyx_RefNannyDeclarations
5078 PyObject *__pyx_t_1 = NULL;
5079 __Pyx_RefNannySetupContext(
"min", 0);
5088 __Pyx_XDECREF(__pyx_r);
5089 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->instance->min());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 347, __pyx_L1_error)
5090 __Pyx_GOTREF(__pyx_t_1);
5091 __pyx_r = __pyx_t_1;
5105 __Pyx_XDECREF(__pyx_t_1);
5106 __Pyx_AddTraceback(
"PyClical.index_set.min", __pyx_clineno, __pyx_lineno, __pyx_filename);
5109 __Pyx_XGIVEREF(__pyx_r);
5110 __Pyx_RefNannyFinishContext();
5123 static PyObject *__pyx_pw_8PyClical_9index_set_40max(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5124 static char __pyx_doc_8PyClical_9index_set_39max[] =
"\n Maximum member.\n\n >>> index_set({-1,1,2}).max()\n 2\n ";
5125 static PyObject *__pyx_pw_8PyClical_9index_set_40max(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5126 PyObject *__pyx_r = 0;
5127 __Pyx_RefNannyDeclarations
5128 __Pyx_RefNannySetupContext(
"max (wrapper)", 0);
5129 __pyx_r = __pyx_pf_8PyClical_9index_set_39max(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5132 __Pyx_RefNannyFinishContext();
5136 static PyObject *__pyx_pf_8PyClical_9index_set_39max(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5137 PyObject *__pyx_r = NULL;
5138 __Pyx_RefNannyDeclarations
5139 PyObject *__pyx_t_1 = NULL;
5140 __Pyx_RefNannySetupContext(
"max", 0);
5149 __Pyx_XDECREF(__pyx_r);
5150 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->instance->max());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error)
5151 __Pyx_GOTREF(__pyx_t_1);
5152 __pyx_r = __pyx_t_1;
5166 __Pyx_XDECREF(__pyx_t_1);
5167 __Pyx_AddTraceback(
"PyClical.index_set.max", __pyx_clineno, __pyx_lineno, __pyx_filename);
5170 __Pyx_XGIVEREF(__pyx_r);
5171 __Pyx_RefNannyFinishContext();
5184 static PyObject *__pyx_pw_8PyClical_9index_set_42hash_fn(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5185 static char __pyx_doc_8PyClical_9index_set_41hash_fn[] =
"\n Hash function.\n ";
5186 static PyObject *__pyx_pw_8PyClical_9index_set_42hash_fn(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5187 PyObject *__pyx_r = 0;
5188 __Pyx_RefNannyDeclarations
5189 __Pyx_RefNannySetupContext(
"hash_fn (wrapper)", 0);
5190 __pyx_r = __pyx_pf_8PyClical_9index_set_41hash_fn(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5193 __Pyx_RefNannyFinishContext();
5197 static PyObject *__pyx_pf_8PyClical_9index_set_41hash_fn(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5198 PyObject *__pyx_r = NULL;
5199 __Pyx_RefNannyDeclarations
5200 PyObject *__pyx_t_1 = NULL;
5201 __Pyx_RefNannySetupContext(
"hash_fn", 0);
5210 __Pyx_XDECREF(__pyx_r);
5211 __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)
5212 __Pyx_GOTREF(__pyx_t_1);
5213 __pyx_r = __pyx_t_1;
5227 __Pyx_XDECREF(__pyx_t_1);
5228 __Pyx_AddTraceback(
"PyClical.index_set.hash_fn", __pyx_clineno, __pyx_lineno, __pyx_filename);
5231 __Pyx_XGIVEREF(__pyx_r);
5232 __Pyx_RefNannyFinishContext();
5245 static PyObject *__pyx_pw_8PyClical_9index_set_44sign_of_mult(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
5246 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 ";
5247 static PyObject *__pyx_pw_8PyClical_9index_set_44sign_of_mult(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
5248 PyObject *__pyx_r = 0;
5249 __Pyx_RefNannyDeclarations
5250 __Pyx_RefNannySetupContext(
"sign_of_mult (wrapper)", 0);
5251 __pyx_r = __pyx_pf_8PyClical_9index_set_43sign_of_mult(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
5254 __Pyx_RefNannyFinishContext();
5258 static PyObject *__pyx_pf_8PyClical_9index_set_43sign_of_mult(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs) {
5259 PyObject *__pyx_r = NULL;
5260 __Pyx_RefNannyDeclarations
5261 PyObject *__pyx_t_1 = NULL;
5262 __Pyx_RefNannySetupContext(
"sign_of_mult", 0);
5271 __Pyx_XDECREF(__pyx_r);
5272 __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)
5273 __Pyx_GOTREF(__pyx_t_1);
5274 __pyx_r = __pyx_t_1;
5288 __Pyx_XDECREF(__pyx_t_1);
5289 __Pyx_AddTraceback(
"PyClical.index_set.sign_of_mult", __pyx_clineno, __pyx_lineno, __pyx_filename);
5292 __Pyx_XGIVEREF(__pyx_r);
5293 __Pyx_RefNannyFinishContext();
5306 static PyObject *__pyx_pw_8PyClical_9index_set_46sign_of_square(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5307 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 ";
5308 static PyObject *__pyx_pw_8PyClical_9index_set_46sign_of_square(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5309 PyObject *__pyx_r = 0;
5310 __Pyx_RefNannyDeclarations
5311 __Pyx_RefNannySetupContext(
"sign_of_square (wrapper)", 0);
5312 __pyx_r = __pyx_pf_8PyClical_9index_set_45sign_of_square(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5315 __Pyx_RefNannyFinishContext();
5319 static PyObject *__pyx_pf_8PyClical_9index_set_45sign_of_square(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5320 PyObject *__pyx_r = NULL;
5321 __Pyx_RefNannyDeclarations
5322 PyObject *__pyx_t_1 = NULL;
5323 __Pyx_RefNannySetupContext(
"sign_of_square", 0);
5332 __Pyx_XDECREF(__pyx_r);
5333 __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)
5334 __Pyx_GOTREF(__pyx_t_1);
5335 __pyx_r = __pyx_t_1;
5349 __Pyx_XDECREF(__pyx_t_1);
5350 __Pyx_AddTraceback(
"PyClical.index_set.sign_of_square", __pyx_clineno, __pyx_lineno, __pyx_filename);
5353 __Pyx_XGIVEREF(__pyx_r);
5354 __Pyx_RefNannyFinishContext();
5367 static PyObject *__pyx_pw_8PyClical_9index_set_48__repr__(PyObject *__pyx_v_self);
5368 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 ";
5369 #if CYTHON_COMPILING_IN_CPYTHON 5370 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_47__repr__;
5372 static PyObject *__pyx_pw_8PyClical_9index_set_48__repr__(PyObject *__pyx_v_self) {
5373 PyObject *__pyx_r = 0;
5374 __Pyx_RefNannyDeclarations
5375 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
5376 __pyx_r = __pyx_pf_8PyClical_9index_set_47__repr__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5379 __Pyx_RefNannyFinishContext();
5383 static PyObject *__pyx_pf_8PyClical_9index_set_47__repr__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5384 PyObject *__pyx_r = NULL;
5385 __Pyx_RefNannyDeclarations
5386 PyObject *__pyx_t_1 = NULL;
5387 __Pyx_RefNannySetupContext(
"__repr__", 0);
5396 __Pyx_XDECREF(__pyx_r);
5397 __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)
5398 __Pyx_GOTREF(__pyx_t_1);
5399 __pyx_r = __pyx_t_1;
5413 __Pyx_XDECREF(__pyx_t_1);
5414 __Pyx_AddTraceback(
"PyClical.index_set.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5417 __Pyx_XGIVEREF(__pyx_r);
5418 __Pyx_RefNannyFinishContext();
5431 static PyObject *__pyx_pw_8PyClical_9index_set_50__str__(PyObject *__pyx_v_self);
5432 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 ";
5433 #if CYTHON_COMPILING_IN_CPYTHON 5434 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_49__str__;
5436 static PyObject *__pyx_pw_8PyClical_9index_set_50__str__(PyObject *__pyx_v_self) {
5437 PyObject *__pyx_r = 0;
5438 __Pyx_RefNannyDeclarations
5439 __Pyx_RefNannySetupContext(
"__str__ (wrapper)", 0);
5440 __pyx_r = __pyx_pf_8PyClical_9index_set_49__str__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5443 __Pyx_RefNannyFinishContext();
5447 static PyObject *__pyx_pf_8PyClical_9index_set_49__str__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5448 PyObject *__pyx_r = NULL;
5449 __Pyx_RefNannyDeclarations
5450 PyObject *__pyx_t_1 = NULL;
5451 __Pyx_RefNannySetupContext(
"__str__", 0);
5460 __Pyx_XDECREF(__pyx_r);
5461 __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)
5462 __Pyx_GOTREF(__pyx_t_1);
5463 __pyx_r = __pyx_t_1;
5477 __Pyx_XDECREF(__pyx_t_1);
5478 __Pyx_AddTraceback(
"PyClical.index_set.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5481 __Pyx_XGIVEREF(__pyx_r);
5482 __Pyx_RefNannyFinishContext();
5493 static PyObject *__pyx_pw_8PyClical_9index_set_52__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5494 static PyObject *__pyx_pw_8PyClical_9index_set_52__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5495 PyObject *__pyx_r = 0;
5496 __Pyx_RefNannyDeclarations
5497 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
5498 __pyx_r = __pyx_pf_8PyClical_9index_set_51__reduce_cython__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5501 __Pyx_RefNannyFinishContext();
5505 static PyObject *__pyx_pf_8PyClical_9index_set_51__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5506 PyObject *__pyx_r = NULL;
5507 __Pyx_RefNannyDeclarations
5508 PyObject *__pyx_t_1 = NULL;
5509 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
5517 __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)
5518 __Pyx_GOTREF(__pyx_t_1);
5519 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5520 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5521 __PYX_ERR(1, 2, __pyx_L1_error)
5531 __Pyx_XDECREF(__pyx_t_1);
5532 __Pyx_AddTraceback(
"PyClical.index_set.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5534 __Pyx_XGIVEREF(__pyx_r);
5535 __Pyx_RefNannyFinishContext();
5547 static PyObject *__pyx_pw_8PyClical_9index_set_54__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
5548 static PyObject *__pyx_pw_8PyClical_9index_set_54__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
5549 PyObject *__pyx_r = 0;
5550 __Pyx_RefNannyDeclarations
5551 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
5552 __pyx_r = __pyx_pf_8PyClical_9index_set_53__setstate_cython__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
5555 __Pyx_RefNannyFinishContext();
5559 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) {
5560 PyObject *__pyx_r = NULL;
5561 __Pyx_RefNannyDeclarations
5562 PyObject *__pyx_t_1 = NULL;
5563 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
5570 __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)
5571 __Pyx_GOTREF(__pyx_t_1);
5572 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5573 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5574 __PYX_ERR(1, 4, __pyx_L1_error)
5585 __Pyx_XDECREF(__pyx_t_1);
5586 __Pyx_AddTraceback(
"PyClical.index_set.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5588 __Pyx_XGIVEREF(__pyx_r);
5589 __Pyx_RefNannyFinishContext();
5602 static PyObject *__pyx_pw_8PyClical_1index_set_hidden_doctests(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused);
5603 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 ";
5604 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};
5605 static PyObject *__pyx_pw_8PyClical_1index_set_hidden_doctests(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
5606 PyObject *__pyx_r = 0;
5607 __Pyx_RefNannyDeclarations
5608 __Pyx_RefNannySetupContext(
"index_set_hidden_doctests (wrapper)", 0);
5609 __pyx_r = __pyx_pf_8PyClical_index_set_hidden_doctests(__pyx_self);
5612 __Pyx_RefNannyFinishContext();
5616 static PyObject *__pyx_pf_8PyClical_index_set_hidden_doctests(CYTHON_UNUSED PyObject *__pyx_self) {
5617 PyObject *__pyx_r = NULL;
5618 __Pyx_RefNannyDeclarations
5619 __Pyx_RefNannySetupContext(
"index_set_hidden_doctests", 0);
5628 __Pyx_XDECREF(__pyx_r);
5629 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5642 __Pyx_XGIVEREF(__pyx_r);
5643 __Pyx_RefNannyFinishContext();
5655 static PyObject *__pyx_pw_8PyClical_3compare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5656 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_compare(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs, CYTHON_UNUSED
int __pyx_skip_dispatch) {
5657 PyObject *__pyx_r = NULL;
5658 __Pyx_RefNannyDeclarations
5659 PyObject *__pyx_t_1 = NULL;
5660 __Pyx_RefNannySetupContext(
"compare", 0);
5669 __Pyx_XDECREF(__pyx_r);
5670 __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)
5671 __Pyx_GOTREF(__pyx_t_1);
5672 __pyx_r = __pyx_t_1;
5686 __Pyx_XDECREF(__pyx_t_1);
5687 __Pyx_AddTraceback(
"PyClical.compare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5690 __Pyx_XGIVEREF(__pyx_r);
5691 __Pyx_RefNannyFinishContext();
5696 static PyObject *__pyx_pw_8PyClical_3compare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5697 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 ";
5698 static PyObject *__pyx_pw_8PyClical_3compare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5699 PyObject *__pyx_v_lhs = 0;
5700 PyObject *__pyx_v_rhs = 0;
5701 PyObject *__pyx_r = 0;
5702 __Pyx_RefNannyDeclarations
5703 __Pyx_RefNannySetupContext(
"compare (wrapper)", 0);
5705 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lhs,&__pyx_n_s_rhs,0};
5706 PyObject* values[2] = {0,0};
5707 if (unlikely(__pyx_kwds)) {
5709 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5711 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5713 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5716 default:
goto __pyx_L5_argtuple_error;
5718 kw_args = PyDict_Size(__pyx_kwds);
5721 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lhs)) != 0)) kw_args--;
5722 else goto __pyx_L5_argtuple_error;
5725 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rhs)) != 0)) kw_args--;
5727 __Pyx_RaiseArgtupleInvalid(
"compare", 1, 2, 2, 1); __PYX_ERR(0, 490, __pyx_L3_error)
5730 if (unlikely(kw_args > 0)) {
5731 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"compare") < 0)) __PYX_ERR(0, 490, __pyx_L3_error)
5733 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5734 goto __pyx_L5_argtuple_error;
5736 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5737 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5739 __pyx_v_lhs = values[0];
5740 __pyx_v_rhs = values[1];
5742 goto __pyx_L4_argument_unpacking_done;
5743 __pyx_L5_argtuple_error:;
5744 __Pyx_RaiseArgtupleInvalid(
"compare", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 490, __pyx_L3_error)
5746 __Pyx_AddTraceback(
"PyClical.compare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5747 __Pyx_RefNannyFinishContext();
5749 __pyx_L4_argument_unpacking_done:;
5750 __pyx_r = __pyx_pf_8PyClical_2compare(__pyx_self, __pyx_v_lhs, __pyx_v_rhs);
5753 __Pyx_RefNannyFinishContext();
5757 static PyObject *__pyx_pf_8PyClical_2compare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
5758 PyObject *__pyx_r = NULL;
5759 __Pyx_RefNannyDeclarations
5760 PyObject *__pyx_t_1 = NULL;
5761 __Pyx_RefNannySetupContext(
"compare", 0);
5762 __Pyx_XDECREF(__pyx_r);
5763 __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)
5764 __Pyx_GOTREF(__pyx_t_1);
5765 __pyx_r = __pyx_t_1;
5771 __Pyx_XDECREF(__pyx_t_1);
5772 __Pyx_AddTraceback(
"PyClical.compare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5775 __Pyx_XGIVEREF(__pyx_r);
5776 __Pyx_RefNannyFinishContext();
5788 static PyObject *__pyx_pw_8PyClical_5min_neg(PyObject *__pyx_self, PyObject *__pyx_v_obj);
5789 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_min_neg(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
5790 PyObject *__pyx_r = NULL;
5791 __Pyx_RefNannyDeclarations
5792 PyObject *__pyx_t_1 = NULL;
5793 __Pyx_RefNannySetupContext(
"min_neg", 0);
5802 __Pyx_XDECREF(__pyx_r);
5803 __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)
5804 __Pyx_GOTREF(__pyx_t_1);
5805 __pyx_r = __pyx_t_1;
5819 __Pyx_XDECREF(__pyx_t_1);
5820 __Pyx_AddTraceback(
"PyClical.min_neg", __pyx_clineno, __pyx_lineno, __pyx_filename);
5823 __Pyx_XGIVEREF(__pyx_r);
5824 __Pyx_RefNannyFinishContext();
5829 static PyObject *__pyx_pw_8PyClical_5min_neg(PyObject *__pyx_self, PyObject *__pyx_v_obj);
5830 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 ";
5831 static PyObject *__pyx_pw_8PyClical_5min_neg(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
5832 PyObject *__pyx_r = 0;
5833 __Pyx_RefNannyDeclarations
5834 __Pyx_RefNannySetupContext(
"min_neg (wrapper)", 0);
5835 __pyx_r = __pyx_pf_8PyClical_4min_neg(__pyx_self, ((PyObject *)__pyx_v_obj));
5838 __Pyx_RefNannyFinishContext();
5842 static PyObject *__pyx_pf_8PyClical_4min_neg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
5843 PyObject *__pyx_r = NULL;
5844 __Pyx_RefNannyDeclarations
5845 PyObject *__pyx_t_1 = NULL;
5846 __Pyx_RefNannySetupContext(
"min_neg", 0);
5847 __Pyx_XDECREF(__pyx_r);
5848 __pyx_t_1 = __pyx_f_8PyClical_min_neg(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 502, __pyx_L1_error)
5849 __Pyx_GOTREF(__pyx_t_1);
5850 __pyx_r = __pyx_t_1;
5856 __Pyx_XDECREF(__pyx_t_1);
5857 __Pyx_AddTraceback(
"PyClical.min_neg", __pyx_clineno, __pyx_lineno, __pyx_filename);
5860 __Pyx_XGIVEREF(__pyx_r);
5861 __Pyx_RefNannyFinishContext();
5873 static PyObject *__pyx_pw_8PyClical_7max_pos(PyObject *__pyx_self, PyObject *__pyx_v_obj);
5874 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_max_pos(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
5875 PyObject *__pyx_r = NULL;
5876 __Pyx_RefNannyDeclarations
5877 PyObject *__pyx_t_1 = NULL;
5878 __Pyx_RefNannySetupContext(
"max_pos", 0);
5887 __Pyx_XDECREF(__pyx_r);
5888 __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)
5889 __Pyx_GOTREF(__pyx_t_1);
5890 __pyx_r = __pyx_t_1;
5904 __Pyx_XDECREF(__pyx_t_1);
5905 __Pyx_AddTraceback(
"PyClical.max_pos", __pyx_clineno, __pyx_lineno, __pyx_filename);
5908 __Pyx_XGIVEREF(__pyx_r);
5909 __Pyx_RefNannyFinishContext();
5914 static PyObject *__pyx_pw_8PyClical_7max_pos(PyObject *__pyx_self, PyObject *__pyx_v_obj);
5915 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 ";
5916 static PyObject *__pyx_pw_8PyClical_7max_pos(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
5917 PyObject *__pyx_r = 0;
5918 __Pyx_RefNannyDeclarations
5919 __Pyx_RefNannySetupContext(
"max_pos (wrapper)", 0);
5920 __pyx_r = __pyx_pf_8PyClical_6max_pos(__pyx_self, ((PyObject *)__pyx_v_obj));
5923 __Pyx_RefNannyFinishContext();
5927 static PyObject *__pyx_pf_8PyClical_6max_pos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
5928 PyObject *__pyx_r = NULL;
5929 __Pyx_RefNannyDeclarations
5930 PyObject *__pyx_t_1 = NULL;
5931 __Pyx_RefNannySetupContext(
"max_pos", 0);
5932 __Pyx_XDECREF(__pyx_r);
5933 __pyx_t_1 = __pyx_f_8PyClical_max_pos(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 511, __pyx_L1_error)
5934 __Pyx_GOTREF(__pyx_t_1);
5935 __pyx_r = __pyx_t_1;
5941 __Pyx_XDECREF(__pyx_t_1);
5942 __Pyx_AddTraceback(
"PyClical.max_pos", __pyx_clineno, __pyx_lineno, __pyx_filename);
5945 __Pyx_XGIVEREF(__pyx_r);
5946 __Pyx_RefNannyFinishContext();
5958 static CYTHON_INLINE std::vector<scalar_t> __pyx_f_8PyClical_list_to_vector(PyObject *__pyx_v_lst) {
5959 std::vector<scalar_t> __pyx_v_v;
5960 PyObject *__pyx_v_s = NULL;
5961 std::vector<scalar_t> __pyx_r;
5962 __Pyx_RefNannyDeclarations
5963 PyObject *__pyx_t_1 = NULL;
5964 Py_ssize_t __pyx_t_2;
5965 PyObject *(*__pyx_t_3)(PyObject *);
5966 PyObject *__pyx_t_4 = NULL;
5968 __Pyx_RefNannySetupContext(
"list_to_vector", 0);
5977 if (likely(PyList_CheckExact(__pyx_v_lst)) || PyTuple_CheckExact(__pyx_v_lst)) {
5978 __pyx_t_1 = __pyx_v_lst; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
5981 __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_lst);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error)
5982 __Pyx_GOTREF(__pyx_t_1);
5983 __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 525, __pyx_L1_error)
5986 if (likely(!__pyx_t_3)) {
5987 if (likely(PyList_CheckExact(__pyx_t_1))) {
5988 if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1))
break;
5989 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 5990 __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)
5992 __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)
5993 __Pyx_GOTREF(__pyx_t_4);
5996 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1))
break;
5997 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 5998 __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)
6000 __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)
6001 __Pyx_GOTREF(__pyx_t_4);
6005 __pyx_t_4 = __pyx_t_3(__pyx_t_1);
6006 if (unlikely(!__pyx_t_4)) {
6007 PyObject* exc_type = PyErr_Occurred();
6009 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
6010 else __PYX_ERR(0, 525, __pyx_L1_error)
6014 __Pyx_GOTREF(__pyx_t_4);
6016 __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_4);
6026 __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)
6028 __pyx_v_v.push_back(((
scalar_t)__pyx_t_5));
6030 __Pyx_CppExn2PyErr();
6031 __PYX_ERR(0, 526, __pyx_L1_error)
6042 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6051 __pyx_r = __pyx_v_v;
6064 __Pyx_XDECREF(__pyx_t_1);
6065 __Pyx_XDECREF(__pyx_t_4);
6066 __Pyx_WriteUnraisable(
"PyClical.list_to_vector", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6067 __Pyx_pretend_to_initialize(&__pyx_r);
6069 __Pyx_XDECREF(__pyx_v_s);
6070 __Pyx_RefNannyFinishContext();
6082 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_toClifford(PyObject *__pyx_v_obj) {
6084 __Pyx_RefNannyDeclarations
6085 PyObject *__pyx_t_1 = NULL;
6086 __Pyx_RefNannySetupContext(
"toClifford", 0);
6095 __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)
6096 __Pyx_GOTREF(__pyx_t_1);
6097 __pyx_r = (((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_1)->instance[0]);
6098 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6111 __Pyx_XDECREF(__pyx_t_1);
6112 __Pyx_WriteUnraisable(
"PyClical.toClifford", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6113 __Pyx_pretend_to_initialize(&__pyx_r);
6115 __Pyx_RefNannyFinishContext();
6127 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_8clifford_wrap(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self,
Clifford __pyx_v_other) {
6128 PyObject *__pyx_r = NULL;
6129 __Pyx_RefNannyDeclarations
6130 __Pyx_RefNannySetupContext(
"wrap", 0);
6139 (__pyx_v_self->instance[0]) = __pyx_v_other;
6148 __Pyx_XDECREF(__pyx_r);
6149 __Pyx_INCREF(((PyObject *)__pyx_v_self));
6150 __pyx_r = ((PyObject *)__pyx_v_self);
6163 __Pyx_XGIVEREF(__pyx_r);
6164 __Pyx_RefNannyFinishContext();
6176 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_8clifford_unwrap(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
6178 __Pyx_RefNannyDeclarations
6179 __Pyx_RefNannySetupContext(
"unwrap", 0);
6188 __pyx_r = (__pyx_v_self->instance[0]);
6201 __Pyx_RefNannyFinishContext();
6213 static PyObject *__pyx_pw_8PyClical_8clifford_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
6214 static PyObject *__pyx_f_8PyClical_8clifford_copy(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self,
int __pyx_skip_dispatch) {
6215 PyObject *__pyx_r = NULL;
6216 __Pyx_RefNannyDeclarations
6217 PyObject *__pyx_t_1 = NULL;
6218 PyObject *__pyx_t_2 = NULL;
6219 PyObject *__pyx_t_3 = NULL;
6220 PyObject *__pyx_t_4 = NULL;
6221 __Pyx_RefNannySetupContext(
"copy", 0);
6223 if (unlikely(__pyx_skip_dispatch)) ;
6225 else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
6226 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS 6227 static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
6228 if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
6229 PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
6231 __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)
6232 __Pyx_GOTREF(__pyx_t_1);
6233 if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(
void*)__pyx_pw_8PyClical_8clifford_1copy)) {
6234 __Pyx_XDECREF(__pyx_r);
6235 __Pyx_INCREF(__pyx_t_1);
6236 __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
6237 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
6238 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
6239 if (likely(__pyx_t_4)) {
6240 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
6241 __Pyx_INCREF(__pyx_t_4);
6242 __Pyx_INCREF(
function);
6243 __Pyx_DECREF_SET(__pyx_t_3,
function);
6246 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
6247 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6248 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 554, __pyx_L1_error)
6249 __Pyx_GOTREF(__pyx_t_2);
6250 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6251 __pyx_r = __pyx_t_2;
6253 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6256 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS 6257 __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
6258 __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
6259 if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
6260 __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
6263 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6264 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS 6276 __Pyx_XDECREF(__pyx_r);
6277 __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)
6278 __Pyx_GOTREF(__pyx_t_1);
6279 __pyx_r = __pyx_t_1;
6293 __Pyx_XDECREF(__pyx_t_1);
6294 __Pyx_XDECREF(__pyx_t_2);
6295 __Pyx_XDECREF(__pyx_t_3);
6296 __Pyx_XDECREF(__pyx_t_4);
6297 __Pyx_AddTraceback(
"PyClical.clifford.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
6300 __Pyx_XGIVEREF(__pyx_r);
6301 __Pyx_RefNannyFinishContext();
6306 static PyObject *__pyx_pw_8PyClical_8clifford_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
6307 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 ";
6308 static PyObject *__pyx_pw_8PyClical_8clifford_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
6309 PyObject *__pyx_r = 0;
6310 __Pyx_RefNannyDeclarations
6311 __Pyx_RefNannySetupContext(
"copy (wrapper)", 0);
6312 __pyx_r = __pyx_pf_8PyClical_8clifford_copy(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
6315 __Pyx_RefNannyFinishContext();
6319 static PyObject *__pyx_pf_8PyClical_8clifford_copy(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
6320 PyObject *__pyx_r = NULL;
6321 __Pyx_RefNannyDeclarations
6322 PyObject *__pyx_t_1 = NULL;
6323 __Pyx_RefNannySetupContext(
"copy", 0);
6324 __Pyx_XDECREF(__pyx_r);
6325 __pyx_t_1 = __pyx_f_8PyClical_8clifford_copy(__pyx_v_self, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 554, __pyx_L1_error)
6326 __Pyx_GOTREF(__pyx_t_1);
6327 __pyx_r = __pyx_t_1;
6333 __Pyx_XDECREF(__pyx_t_1);
6334 __Pyx_AddTraceback(
"PyClical.clifford.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
6337 __Pyx_XGIVEREF(__pyx_r);
6338 __Pyx_RefNannyFinishContext();
6351 static int __pyx_pw_8PyClical_8clifford_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6352 static int __pyx_pw_8PyClical_8clifford_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6353 PyObject *__pyx_v_other = 0;
6354 PyObject *__pyx_v_ixt = 0;
6356 __Pyx_RefNannyDeclarations
6357 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
6359 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_ixt,0};
6360 PyObject* values[2] = {0,0};
6361 values[0] = ((PyObject *)__pyx_int_0);
6362 values[1] = ((PyObject *)Py_None);
6363 if (unlikely(__pyx_kwds)) {
6365 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6367 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6369 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6372 default:
goto __pyx_L5_argtuple_error;
6374 kw_args = PyDict_Size(__pyx_kwds);
6378 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other);
6379 if (value) { values[0] = value; kw_args--; }
6384 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ixt);
6385 if (value) { values[1] = value; kw_args--; }
6388 if (unlikely(kw_args > 0)) {
6389 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(0, 563, __pyx_L3_error)
6392 switch (PyTuple_GET_SIZE(__pyx_args)) {
6393 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6395 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6398 default:
goto __pyx_L5_argtuple_error;
6401 __pyx_v_other = values[0];
6402 __pyx_v_ixt = values[1];
6404 goto __pyx_L4_argument_unpacking_done;
6405 __pyx_L5_argtuple_error:;
6406 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 563, __pyx_L3_error)
6408 __Pyx_AddTraceback(
"PyClical.clifford.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6409 __Pyx_RefNannyFinishContext();
6411 __pyx_L4_argument_unpacking_done:;
6412 __pyx_r = __pyx_pf_8PyClical_8clifford_2__cinit__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), __pyx_v_other, __pyx_v_ixt);
6415 __Pyx_RefNannyFinishContext();
6419 static int __pyx_pf_8PyClical_8clifford_2__cinit__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_ixt) {
6420 PyObject *__pyx_v_error_msg_prefix = NULL;
6421 PyObject *__pyx_v_err = NULL;
6423 __Pyx_RefNannyDeclarations
6426 PyObject *__pyx_t_3 = NULL;
6427 PyObject *__pyx_t_4 = NULL;
6428 PyObject *__pyx_t_5 = NULL;
6430 PyObject *__pyx_t_7 = NULL;
6431 PyObject *__pyx_t_8 = NULL;
6433 PyObject *__pyx_t_10 = NULL;
6434 PyObject *__pyx_t_11 = NULL;
6435 PyObject *__pyx_t_12 = NULL;
6438 PyObject *__pyx_t_15 = NULL;
6439 PyObject *__pyx_t_16 = NULL;
6440 PyObject *__pyx_t_17 = NULL;
6441 PyObject *__pyx_t_18 = NULL;
6442 __Pyx_RefNannySetupContext(
"__cinit__", 0);
6451 __Pyx_INCREF(__pyx_kp_s_Cannot_initialize_clifford_objec);
6452 __pyx_v_error_msg_prefix = __pyx_kp_s_Cannot_initialize_clifford_objec;
6461 __pyx_t_1 = (__pyx_v_ixt == Py_None);
6462 __pyx_t_2 = (__pyx_t_1 != 0);
6473 __Pyx_PyThreadState_declare
6474 __Pyx_PyThreadState_assign
6475 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
6476 __Pyx_XGOTREF(__pyx_t_3);
6477 __Pyx_XGOTREF(__pyx_t_4);
6478 __Pyx_XGOTREF(__pyx_t_5);
6488 __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8PyClical_clifford);
6489 __pyx_t_1 = (__pyx_t_2 != 0);
6500 __pyx_t_6 =
new Clifford(__pyx_f_8PyClical_8clifford_unwrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_other)));
6502 __Pyx_CppExn2PyErr();
6503 __PYX_ERR(0, 592, __pyx_L4_error)
6505 __pyx_v_self->instance = __pyx_t_6;
6524 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8PyClical_index_set);
6525 __pyx_t_2 = (__pyx_t_1 != 0);
6536 __pyx_t_6 =
new Clifford(__pyx_f_8PyClical_9index_set_unwrap(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_other)), ((
scalar_t)1.0));
6538 __Pyx_CppExn2PyErr();
6539 __PYX_ERR(0, 594, __pyx_L4_error)
6541 __pyx_v_self->instance = __pyx_t_6;
6560 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_numbers);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 595, __pyx_L4_error)
6561 __Pyx_GOTREF(__pyx_t_7);
6562 __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)
6563 __Pyx_GOTREF(__pyx_t_8);
6564 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6565 __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)
6566 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6567 __pyx_t_1 = (__pyx_t_2 != 0);
6577 __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)
6581 __Pyx_CppExn2PyErr();
6582 __PYX_ERR(0, 596, __pyx_L4_error)
6584 __pyx_v_self->instance = __pyx_t_6;
6603 __pyx_t_1 = PyString_Check(__pyx_v_other);
6604 __pyx_t_2 = (__pyx_t_1 != 0);
6605 if (likely(__pyx_t_2)) {
6615 __Pyx_PyThreadState_declare
6616 __Pyx_PyThreadState_assign
6617 __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
6618 __Pyx_XGOTREF(__pyx_t_10);
6619 __Pyx_XGOTREF(__pyx_t_11);
6620 __Pyx_XGOTREF(__pyx_t_12);
6630 __pyx_t_13 = __Pyx_PyObject_AsWritableString(__pyx_v_other);
if (unlikely((!__pyx_t_13) && PyErr_Occurred())) __PYX_ERR(0, 599, __pyx_L11_error)
6632 __pyx_t_6 =
new Clifford(((
char *)__pyx_t_13));
6634 __Pyx_CppExn2PyErr();
6635 __PYX_ERR(0, 599, __pyx_L11_error)
6637 __pyx_v_self->instance = __pyx_t_6;
6647 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
6648 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
6649 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
6650 goto __pyx_L16_try_end;
6652 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6653 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
6662 __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
6664 __Pyx_AddTraceback(
"PyClical.clifford.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6665 if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_15) < 0) __PYX_ERR(0, 600, __pyx_L13_except_error)
6666 __Pyx_GOTREF(__pyx_t_8);
6667 __Pyx_GOTREF(__pyx_t_7);
6668 __Pyx_GOTREF(__pyx_t_15);
6677 __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)
6678 __Pyx_GOTREF(__pyx_t_16);
6679 __pyx_t_17 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 601, __pyx_L13_except_error)
6680 __Pyx_GOTREF(__pyx_t_17);
6681 __pyx_t_18 = PyNumber_Add(__pyx_t_16, __pyx_t_17);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 601, __pyx_L13_except_error)
6682 __Pyx_GOTREF(__pyx_t_18);
6683 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6684 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6685 __pyx_t_17 = PyNumber_Add(__pyx_t_18, __pyx_kp_s_);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 601, __pyx_L13_except_error)
6686 __Pyx_GOTREF(__pyx_t_17);
6687 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6688 __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)
6689 __Pyx_GOTREF(__pyx_t_18);
6690 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6691 __Pyx_Raise(__pyx_t_18, 0, 0, 0);
6692 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6693 __PYX_ERR(0, 601, __pyx_L13_except_error)
6695 goto __pyx_L13_except_error;
6696 __pyx_L13_except_error:;
6705 __Pyx_XGIVEREF(__pyx_t_10);
6706 __Pyx_XGIVEREF(__pyx_t_11);
6707 __Pyx_XGIVEREF(__pyx_t_12);
6708 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
6709 goto __pyx_L4_error;
6731 __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)
6732 __Pyx_GOTREF(__pyx_t_15);
6733 __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)
6734 __Pyx_GOTREF(__pyx_t_7);
6735 __pyx_t_8 = PyNumber_Add(__pyx_t_15, __pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 603, __pyx_L4_error)
6736 __Pyx_GOTREF(__pyx_t_8);
6737 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6738 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6739 __pyx_t_7 = PyNumber_Add(__pyx_t_8, __pyx_kp_s_);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 603, __pyx_L4_error)
6740 __Pyx_GOTREF(__pyx_t_7);
6741 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6742 __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 603, __pyx_L4_error)
6743 __Pyx_GOTREF(__pyx_t_8);
6744 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6745 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
6746 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6747 __PYX_ERR(0, 603, __pyx_L4_error)
6759 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6760 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6761 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
6762 goto __pyx_L9_try_end;
6764 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
6765 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
6766 __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
6767 __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
6768 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6769 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
6778 __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
6780 __Pyx_AddTraceback(
"PyClical.clifford.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6781 if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_15) < 0) __PYX_ERR(0, 604, __pyx_L6_except_error)
6782 __Pyx_GOTREF(__pyx_t_8);
6783 __Pyx_GOTREF(__pyx_t_7);
6784 __Pyx_GOTREF(__pyx_t_15);
6785 __Pyx_INCREF(__pyx_t_7);
6786 __pyx_v_err = __pyx_t_7;
6795 __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)
6796 __Pyx_GOTREF(__pyx_t_18);
6797 __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)
6798 __Pyx_GOTREF(__pyx_t_17);
6799 __pyx_t_16 = PyNumber_Add(__pyx_t_18, __pyx_t_17);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 605, __pyx_L6_except_error)
6800 __Pyx_GOTREF(__pyx_t_16);
6801 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6802 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6811 __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)
6812 __Pyx_GOTREF(__pyx_t_17);
6813 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6814 __pyx_t_16 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 606, __pyx_L6_except_error)
6815 __Pyx_GOTREF(__pyx_t_16);
6816 __pyx_t_18 = PyNumber_Add(__pyx_t_17, __pyx_t_16);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 606, __pyx_L6_except_error)
6817 __Pyx_GOTREF(__pyx_t_18);
6818 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6819 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6820 __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)
6821 __Pyx_GOTREF(__pyx_t_16);
6822 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6831 __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)
6832 __Pyx_GOTREF(__pyx_t_18);
6833 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6834 __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)
6835 __Pyx_GOTREF(__pyx_t_16);
6836 __pyx_t_17 = PyNumber_Add(__pyx_t_18, __pyx_t_16);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 607, __pyx_L6_except_error)
6837 __Pyx_GOTREF(__pyx_t_17);
6838 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6839 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6848 __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)
6849 __Pyx_GOTREF(__pyx_t_16);
6850 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6851 __Pyx_Raise(__pyx_t_16, 0, 0, 0);
6852 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6853 __PYX_ERR(0, 605, __pyx_L6_except_error)
6855 goto __pyx_L6_except_error;
6856 __pyx_L6_except_error:;
6865 __Pyx_XGIVEREF(__pyx_t_3);
6866 __Pyx_XGIVEREF(__pyx_t_4);
6867 __Pyx_XGIVEREF(__pyx_t_5);
6868 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
6869 goto __pyx_L1_error;
6890 __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_ixt, __pyx_ptype_8PyClical_index_set);
6891 __pyx_t_1 = (__pyx_t_2 != 0);
6892 if (likely(__pyx_t_1)) {
6901 __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_numbers);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 609, __pyx_L1_error)
6902 __Pyx_GOTREF(__pyx_t_15);
6903 __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)
6904 __Pyx_GOTREF(__pyx_t_7);
6905 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6906 __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)
6907 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6908 __pyx_t_2 = (__pyx_t_1 != 0);
6918 __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)
6920 __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));
6922 __Pyx_CppExn2PyErr();
6923 __PYX_ERR(0, 610, __pyx_L1_error)
6925 __pyx_v_self->instance = __pyx_t_6;
6944 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_collections);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 611, __pyx_L1_error)
6945 __Pyx_GOTREF(__pyx_t_7);
6946 __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)
6947 __Pyx_GOTREF(__pyx_t_15);
6948 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6949 __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)
6950 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6951 __pyx_t_1 = (__pyx_t_2 != 0);
6952 if (likely(__pyx_t_1)) {
6962 __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)));
6964 __Pyx_CppExn2PyErr();
6965 __PYX_ERR(0, 612, __pyx_L1_error)
6967 __pyx_v_self->instance = __pyx_t_6;
6987 __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)
6988 __Pyx_GOTREF(__pyx_t_15);
6989 __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)
6990 __Pyx_GOTREF(__pyx_t_7);
6991 __pyx_t_8 = PyNumber_Add(__pyx_t_15, __pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 614, __pyx_L1_error)
6992 __Pyx_GOTREF(__pyx_t_8);
6993 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6994 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7003 __pyx_t_7 = PyNumber_Add(__pyx_t_8, __pyx_kp_s__8);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 615, __pyx_L1_error)
7004 __Pyx_GOTREF(__pyx_t_7);
7005 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7006 __pyx_t_8 = PyObject_Repr(__pyx_v_ixt);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 615, __pyx_L1_error)
7007 __Pyx_GOTREF(__pyx_t_8);
7008 __pyx_t_15 = PyNumber_Add(__pyx_t_7, __pyx_t_8);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 615, __pyx_L1_error)
7009 __Pyx_GOTREF(__pyx_t_15);
7010 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7011 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7012 __pyx_t_8 = PyNumber_Add(__pyx_t_15, __pyx_kp_s__9);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 615, __pyx_L1_error)
7013 __Pyx_GOTREF(__pyx_t_8);
7014 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7023 __pyx_t_15 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_8);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 614, __pyx_L1_error)
7024 __Pyx_GOTREF(__pyx_t_15);
7025 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7026 __Pyx_Raise(__pyx_t_15, 0, 0, 0);
7027 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7028 __PYX_ERR(0, 614, __pyx_L1_error)
7050 __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)
7051 __Pyx_GOTREF(__pyx_t_15);
7052 __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)
7053 __Pyx_GOTREF(__pyx_t_8);
7054 __pyx_t_7 = PyNumber_Add(__pyx_t_15, __pyx_t_8);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 617, __pyx_L1_error)
7055 __Pyx_GOTREF(__pyx_t_7);
7056 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7057 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7066 __pyx_t_8 = PyNumber_Add(__pyx_t_7, __pyx_kp_s__8);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 618, __pyx_L1_error)
7067 __Pyx_GOTREF(__pyx_t_8);
7068 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7069 __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)
7070 __Pyx_GOTREF(__pyx_t_7);
7071 __pyx_t_15 = PyNumber_Add(__pyx_t_8, __pyx_t_7);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 618, __pyx_L1_error)
7072 __Pyx_GOTREF(__pyx_t_15);
7073 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7074 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7075 __pyx_t_7 = PyNumber_Add(__pyx_t_15, __pyx_kp_s__9);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 618, __pyx_L1_error)
7076 __Pyx_GOTREF(__pyx_t_7);
7077 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7086 __pyx_t_15 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 617, __pyx_L1_error)
7087 __Pyx_GOTREF(__pyx_t_15);
7088 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7089 __Pyx_Raise(__pyx_t_15, 0, 0, 0);
7090 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7091 __PYX_ERR(0, 617, __pyx_L1_error)
7107 __Pyx_XDECREF(__pyx_t_7);
7108 __Pyx_XDECREF(__pyx_t_8);
7109 __Pyx_XDECREF(__pyx_t_15);
7110 __Pyx_XDECREF(__pyx_t_16);
7111 __Pyx_XDECREF(__pyx_t_17);
7112 __Pyx_XDECREF(__pyx_t_18);
7113 __Pyx_AddTraceback(
"PyClical.clifford.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7116 __Pyx_XDECREF(__pyx_v_error_msg_prefix);
7117 __Pyx_XDECREF(__pyx_v_err);
7118 __Pyx_RefNannyFinishContext();
7131 static void __pyx_pw_8PyClical_8clifford_5__dealloc__(PyObject *__pyx_v_self);
7132 static void __pyx_pw_8PyClical_8clifford_5__dealloc__(PyObject *__pyx_v_self) {
7133 __Pyx_RefNannyDeclarations
7134 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
7135 __pyx_pf_8PyClical_8clifford_4__dealloc__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
7138 __Pyx_RefNannyFinishContext();
7141 static void __pyx_pf_8PyClical_8clifford_4__dealloc__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
7142 __Pyx_RefNannyDeclarations
7143 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
7152 delete __pyx_v_self->instance;
7163 __Pyx_RefNannyFinishContext();
7175 static int __pyx_pw_8PyClical_8clifford_7__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_x);
7176 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 ";
7177 #if CYTHON_COMPILING_IN_CPYTHON 7178 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_6__contains__;
7180 static int __pyx_pw_8PyClical_8clifford_7__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_x) {
7182 __Pyx_RefNannyDeclarations
7183 __Pyx_RefNannySetupContext(
"__contains__ (wrapper)", 0);
7184 __pyx_r = __pyx_pf_8PyClical_8clifford_6__contains__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_x));
7187 __Pyx_RefNannyFinishContext();
7191 static int __pyx_pf_8PyClical_8clifford_6__contains__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_x) {
7193 __Pyx_RefNannyDeclarations
7194 PyObject *__pyx_t_1 = NULL;
7195 __Pyx_RefNannySetupContext(
"__contains__", 0);
7204 __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)
7205 __Pyx_GOTREF(__pyx_t_1);
7206 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
7207 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7208 __PYX_ERR(0, 635, __pyx_L1_error)
7220 __Pyx_XDECREF(__pyx_t_1);
7221 __Pyx_AddTraceback(
"PyClical.clifford.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7223 __Pyx_RefNannyFinishContext();
7236 static PyObject *__pyx_pw_8PyClical_8clifford_9__iter__(PyObject *__pyx_v_self);
7237 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 ";
7238 #if CYTHON_COMPILING_IN_CPYTHON 7239 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_8__iter__;
7241 static PyObject *__pyx_pw_8PyClical_8clifford_9__iter__(PyObject *__pyx_v_self) {
7242 PyObject *__pyx_r = 0;
7243 __Pyx_RefNannyDeclarations
7244 __Pyx_RefNannySetupContext(
"__iter__ (wrapper)", 0);
7245 __pyx_r = __pyx_pf_8PyClical_8clifford_8__iter__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
7248 __Pyx_RefNannyFinishContext();
7252 static PyObject *__pyx_pf_8PyClical_8clifford_8__iter__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
7253 PyObject *__pyx_r = NULL;
7254 __Pyx_RefNannyDeclarations
7255 PyObject *__pyx_t_1 = NULL;
7256 __Pyx_RefNannySetupContext(
"__iter__", 0);
7265 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__10, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 646, __pyx_L1_error)
7266 __Pyx_GOTREF(__pyx_t_1);
7267 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
7268 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7269 __PYX_ERR(0, 646, __pyx_L1_error)
7281 __Pyx_XDECREF(__pyx_t_1);
7282 __Pyx_AddTraceback(
"PyClical.clifford.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7284 __Pyx_XGIVEREF(__pyx_r);
7285 __Pyx_RefNannyFinishContext();
7298 static PyObject *__pyx_pw_8PyClical_8clifford_11reframe(PyObject *__pyx_v_self, PyObject *__pyx_v_ixt);
7299 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 ";
7300 static PyObject *__pyx_pw_8PyClical_8clifford_11reframe(PyObject *__pyx_v_self, PyObject *__pyx_v_ixt) {
7301 PyObject *__pyx_r = 0;
7302 __Pyx_RefNannyDeclarations
7303 __Pyx_RefNannySetupContext(
"reframe (wrapper)", 0);
7304 __pyx_r = __pyx_pf_8PyClical_8clifford_10reframe(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_ixt));
7307 __Pyx_RefNannyFinishContext();
7311 static PyObject *__pyx_pf_8PyClical_8clifford_10reframe(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_ixt) {
7312 PyObject *__pyx_v_error_msg_prefix = NULL;
7313 struct __pyx_obj_8PyClical_clifford *__pyx_v_result = NULL;
7314 PyObject *__pyx_v_err = NULL;
7315 PyObject *__pyx_r = NULL;
7316 __Pyx_RefNannyDeclarations
7319 PyObject *__pyx_t_3 = NULL;
7320 PyObject *__pyx_t_4 = NULL;
7321 PyObject *__pyx_t_5 = NULL;
7322 PyObject *__pyx_t_6 = NULL;
7325 PyObject *__pyx_t_9 = NULL;
7326 PyObject *__pyx_t_10 = NULL;
7327 PyObject *__pyx_t_11 = NULL;
7328 PyObject *__pyx_t_12 = NULL;
7329 PyObject *__pyx_t_13 = NULL;
7330 __Pyx_RefNannySetupContext(
"reframe", 0);
7339 __Pyx_INCREF(__pyx_kp_s_Cannot_reframe);
7340 __pyx_v_error_msg_prefix = __pyx_kp_s_Cannot_reframe;
7349 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_ixt, __pyx_ptype_8PyClical_index_set);
7350 __pyx_t_2 = (__pyx_t_1 != 0);
7351 if (likely(__pyx_t_2)) {
7361 __Pyx_PyThreadState_declare
7362 __Pyx_PyThreadState_assign
7363 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
7364 __Pyx_XGOTREF(__pyx_t_3);
7365 __Pyx_XGOTREF(__pyx_t_4);
7366 __Pyx_XGOTREF(__pyx_t_5);
7376 __pyx_t_6 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 661, __pyx_L4_error)
7377 __Pyx_GOTREF(__pyx_t_6);
7378 __pyx_v_result = ((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_6);
7389 __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)));
7391 __Pyx_CppExn2PyErr();
7392 __PYX_ERR(0, 662, __pyx_L4_error)
7394 __pyx_v_result->instance = __pyx_t_7;
7404 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7405 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7406 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
7407 goto __pyx_L9_try_end;
7409 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
7418 __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
7420 __Pyx_AddTraceback(
"PyClical.clifford.reframe", __pyx_clineno, __pyx_lineno, __pyx_filename);
7421 if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 663, __pyx_L6_except_error)
7422 __Pyx_GOTREF(__pyx_t_6);
7423 __Pyx_GOTREF(__pyx_t_9);
7424 __Pyx_GOTREF(__pyx_t_10);
7425 __Pyx_INCREF(__pyx_t_9);
7426 __pyx_v_err = __pyx_t_9;
7435 __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)
7436 __Pyx_GOTREF(__pyx_t_11);
7437 __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)
7438 __Pyx_GOTREF(__pyx_t_12);
7439 __pyx_t_13 = PyNumber_Add(__pyx_t_11, __pyx_t_12);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 664, __pyx_L6_except_error)
7440 __Pyx_GOTREF(__pyx_t_13);
7441 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7442 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7443 __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)
7444 __Pyx_GOTREF(__pyx_t_12);
7445 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7454 __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)
7455 __Pyx_GOTREF(__pyx_t_13);
7456 __pyx_t_11 = PyNumber_Add(__pyx_t_12, __pyx_t_13);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 665, __pyx_L6_except_error)
7457 __Pyx_GOTREF(__pyx_t_11);
7458 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7459 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7460 __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)
7461 __Pyx_GOTREF(__pyx_t_13);
7462 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7471 __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)
7472 __Pyx_GOTREF(__pyx_t_11);
7473 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7474 __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)
7475 __Pyx_GOTREF(__pyx_t_13);
7476 __pyx_t_12 = PyNumber_Add(__pyx_t_11, __pyx_t_13);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 666, __pyx_L6_except_error)
7477 __Pyx_GOTREF(__pyx_t_12);
7478 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7479 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7488 __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)
7489 __Pyx_GOTREF(__pyx_t_13);
7490 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7491 __Pyx_Raise(__pyx_t_13, 0, 0, 0);
7492 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7493 __PYX_ERR(0, 664, __pyx_L6_except_error)
7495 goto __pyx_L6_except_error;
7496 __pyx_L6_except_error:;
7505 __Pyx_XGIVEREF(__pyx_t_3);
7506 __Pyx_XGIVEREF(__pyx_t_4);
7507 __Pyx_XGIVEREF(__pyx_t_5);
7508 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
7509 goto __pyx_L1_error;
7531 __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)
7532 __Pyx_GOTREF(__pyx_t_10);
7533 __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)
7534 __Pyx_GOTREF(__pyx_t_9);
7535 __pyx_t_6 = PyNumber_Add(__pyx_t_10, __pyx_t_9);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 668, __pyx_L1_error)
7536 __Pyx_GOTREF(__pyx_t_6);
7537 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7538 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7539 __pyx_t_9 = PyNumber_Add(__pyx_t_6, __pyx_kp_s__9);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 668, __pyx_L1_error)
7540 __Pyx_GOTREF(__pyx_t_9);
7541 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7542 __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_9);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 668, __pyx_L1_error)
7543 __Pyx_GOTREF(__pyx_t_6);
7544 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7545 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
7546 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7547 __PYX_ERR(0, 668, __pyx_L1_error)
7558 __Pyx_XDECREF(__pyx_r);
7559 __Pyx_INCREF(((PyObject *)__pyx_v_result));
7560 __pyx_r = ((PyObject *)__pyx_v_result);
7573 __Pyx_XDECREF(__pyx_t_6);
7574 __Pyx_XDECREF(__pyx_t_9);
7575 __Pyx_XDECREF(__pyx_t_10);
7576 __Pyx_XDECREF(__pyx_t_11);
7577 __Pyx_XDECREF(__pyx_t_12);
7578 __Pyx_XDECREF(__pyx_t_13);
7579 __Pyx_AddTraceback(
"PyClical.clifford.reframe", __pyx_clineno, __pyx_lineno, __pyx_filename);
7582 __Pyx_XDECREF(__pyx_v_error_msg_prefix);
7583 __Pyx_XDECREF((PyObject *)__pyx_v_result);
7584 __Pyx_XDECREF(__pyx_v_err);
7585 __Pyx_XGIVEREF(__pyx_r);
7586 __Pyx_RefNannyFinishContext();
7599 static PyObject *__pyx_pw_8PyClical_8clifford_13__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op);
7600 static PyObject *__pyx_pw_8PyClical_8clifford_13__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op) {
7601 PyObject *__pyx_r = 0;
7602 __Pyx_RefNannyDeclarations
7603 __Pyx_RefNannySetupContext(
"__richcmp__ (wrapper)", 0);
7604 __pyx_r = __pyx_pf_8PyClical_8clifford_12__richcmp__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs), ((
int)__pyx_v_op));
7607 __Pyx_RefNannyFinishContext();
7611 static PyObject *__pyx_pf_8PyClical_8clifford_12__richcmp__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op) {
7612 PyObject *__pyx_r = NULL;
7613 __Pyx_RefNannyDeclarations
7617 PyObject *__pyx_t_4 = NULL;
7618 PyObject *__pyx_t_5 = NULL;
7619 PyObject *__pyx_t_6 = NULL;
7620 __Pyx_RefNannySetupContext(
"__richcmp__", 0);
7629 __pyx_t_1 = ((__pyx_v_op == 2) != 0);
7639 __pyx_t_2 = (((PyObject *)__pyx_v_lhs) == Py_None);
7640 __pyx_t_3 = (__pyx_t_2 != 0);
7643 __pyx_t_1 = __pyx_t_3;
7644 goto __pyx_L5_bool_binop_done;
7646 __pyx_t_3 = (__pyx_v_rhs == Py_None);
7647 __pyx_t_2 = (__pyx_t_3 != 0);
7648 __pyx_t_1 = __pyx_t_2;
7649 __pyx_L5_bool_binop_done:;
7659 __Pyx_XDECREF(__pyx_r);
7660 __pyx_t_1 = (((PyObject *)__pyx_v_lhs) == __pyx_v_rhs);
7661 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error)
7662 __Pyx_GOTREF(__pyx_t_4);
7663 __pyx_r = __pyx_t_4;
7684 __Pyx_XDECREF(__pyx_r);
7685 __pyx_t_1 = (__pyx_f_8PyClical_toClifford(((PyObject *)__pyx_v_lhs)) == __pyx_f_8PyClical_toClifford(__pyx_v_rhs));
7686 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 694, __pyx_L1_error)
7687 __Pyx_GOTREF(__pyx_t_4);
7688 __pyx_r = __pyx_t_4;
7709 __pyx_t_1 = ((__pyx_v_op == 3) != 0);
7719 __pyx_t_2 = (((PyObject *)__pyx_v_lhs) == Py_None);
7720 __pyx_t_3 = (__pyx_t_2 != 0);
7723 __pyx_t_1 = __pyx_t_3;
7724 goto __pyx_L8_bool_binop_done;
7726 __pyx_t_3 = (__pyx_v_rhs == Py_None);
7727 __pyx_t_2 = (__pyx_t_3 != 0);
7728 __pyx_t_1 = __pyx_t_2;
7729 __pyx_L8_bool_binop_done:;
7739 __Pyx_XDECREF(__pyx_r);
7740 __pyx_t_1 = (((PyObject *)__pyx_v_lhs) == __pyx_v_rhs);
7741 __pyx_t_4 = __Pyx_PyBool_FromLong((!((!(!__pyx_t_1)) != 0)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 697, __pyx_L1_error)
7742 __Pyx_GOTREF(__pyx_t_4);
7743 __pyx_r = __pyx_t_4;
7764 __Pyx_XDECREF(__pyx_r);
7765 __pyx_t_1 = (__pyx_f_8PyClical_toClifford(((PyObject *)__pyx_v_lhs)) != __pyx_f_8PyClical_toClifford(__pyx_v_rhs));
7766 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 699, __pyx_L1_error)
7767 __Pyx_GOTREF(__pyx_t_4);
7768 __pyx_r = __pyx_t_4;
7789 __pyx_t_2 = __Pyx_TypeCheck(((PyObject *)__pyx_v_lhs), __pyx_ptype_8PyClical_clifford);
7790 __pyx_t_3 = (__pyx_t_2 != 0);
7793 __pyx_t_1 = __pyx_t_3;
7794 goto __pyx_L10_bool_binop_done;
7796 __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_rhs, __pyx_ptype_8PyClical_clifford);
7797 __pyx_t_2 = (__pyx_t_3 != 0);
7798 __pyx_t_1 = __pyx_t_2;
7799 __pyx_L10_bool_binop_done:;
7800 if (unlikely(__pyx_t_1)) {
7809 __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)
7810 __Pyx_GOTREF(__pyx_t_4);
7811 __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)
7812 __Pyx_GOTREF(__pyx_t_5);
7813 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7814 __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_kp_s__8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 702, __pyx_L1_error)
7815 __Pyx_GOTREF(__pyx_t_4);
7816 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7817 __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)
7818 __Pyx_GOTREF(__pyx_t_5);
7819 __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_t_5);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 702, __pyx_L1_error)
7820 __Pyx_GOTREF(__pyx_t_6);
7821 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7822 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7823 __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_kp_s_);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 702, __pyx_L1_error)
7824 __Pyx_GOTREF(__pyx_t_5);
7825 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7834 __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_5);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 701, __pyx_L1_error)
7835 __Pyx_GOTREF(__pyx_t_6);
7836 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7837 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
7838 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7839 __PYX_ERR(0, 701, __pyx_L1_error)
7858 __Pyx_XDECREF(__pyx_r);
7859 __Pyx_INCREF(__pyx_builtin_NotImplemented);
7860 __pyx_r = __pyx_builtin_NotImplemented;
7874 __Pyx_XDECREF(__pyx_t_4);
7875 __Pyx_XDECREF(__pyx_t_5);
7876 __Pyx_XDECREF(__pyx_t_6);
7877 __Pyx_AddTraceback(
"PyClical.clifford.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7880 __Pyx_XGIVEREF(__pyx_r);
7881 __Pyx_RefNannyFinishContext();
7894 static PyObject *__pyx_pw_8PyClical_8clifford_15__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ixt);
7895 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 ";
7896 #if CYTHON_COMPILING_IN_CPYTHON 7897 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_14__getitem__;
7899 static PyObject *__pyx_pw_8PyClical_8clifford_15__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ixt) {
7900 PyObject *__pyx_r = 0;
7901 __Pyx_RefNannyDeclarations
7902 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
7903 __pyx_r = __pyx_pf_8PyClical_8clifford_14__getitem__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_ixt));
7906 __Pyx_RefNannyFinishContext();
7910 static PyObject *__pyx_pf_8PyClical_8clifford_14__getitem__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_ixt) {
7911 PyObject *__pyx_r = NULL;
7912 __Pyx_RefNannyDeclarations
7913 PyObject *__pyx_t_1 = NULL;
7914 __Pyx_RefNannySetupContext(
"__getitem__", 0);
7923 __Pyx_XDECREF(__pyx_r);
7924 __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)
7925 __Pyx_GOTREF(__pyx_t_1);
7926 __pyx_r = __pyx_t_1;
7940 __Pyx_XDECREF(__pyx_t_1);
7941 __Pyx_AddTraceback(
"PyClical.clifford.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7944 __Pyx_XGIVEREF(__pyx_r);
7945 __Pyx_RefNannyFinishContext();
7958 static PyObject *__pyx_pw_8PyClical_8clifford_17__neg__(PyObject *__pyx_v_self);
7959 static char __pyx_doc_8PyClical_8clifford_16__neg__[] =
"\n Unary -.\n\n >>> print -clifford(\"{1}\")\n -{1}\n ";
7960 #if CYTHON_COMPILING_IN_CPYTHON 7961 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_16__neg__;
7963 static PyObject *__pyx_pw_8PyClical_8clifford_17__neg__(PyObject *__pyx_v_self) {
7964 PyObject *__pyx_r = 0;
7965 __Pyx_RefNannyDeclarations
7966 __Pyx_RefNannySetupContext(
"__neg__ (wrapper)", 0);
7967 __pyx_r = __pyx_pf_8PyClical_8clifford_16__neg__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
7970 __Pyx_RefNannyFinishContext();
7974 static PyObject *__pyx_pf_8PyClical_8clifford_16__neg__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
7975 PyObject *__pyx_r = NULL;
7976 __Pyx_RefNannyDeclarations
7977 PyObject *__pyx_t_1 = NULL;
7978 PyObject *__pyx_t_2 = NULL;
7979 __Pyx_RefNannySetupContext(
"__neg__", 0);
7988 __Pyx_XDECREF(__pyx_r);
7989 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 728, __pyx_L1_error)
7990 __Pyx_GOTREF(__pyx_t_1);
7991 __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)
7992 __Pyx_GOTREF(__pyx_t_2);
7993 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7994 __pyx_r = __pyx_t_2;
8008 __Pyx_XDECREF(__pyx_t_1);
8009 __Pyx_XDECREF(__pyx_t_2);
8010 __Pyx_AddTraceback(
"PyClical.clifford.__neg__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8013 __Pyx_XGIVEREF(__pyx_r);
8014 __Pyx_RefNannyFinishContext();
8027 static PyObject *__pyx_pw_8PyClical_8clifford_19__pos__(PyObject *__pyx_v_self);
8028 static char __pyx_doc_8PyClical_8clifford_18__pos__[] =
"\n Unary +.\n\n >>> print +clifford(\"{1}\")\n {1}\n ";
8029 #if CYTHON_COMPILING_IN_CPYTHON 8030 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_18__pos__;
8032 static PyObject *__pyx_pw_8PyClical_8clifford_19__pos__(PyObject *__pyx_v_self) {
8033 PyObject *__pyx_r = 0;
8034 __Pyx_RefNannyDeclarations
8035 __Pyx_RefNannySetupContext(
"__pos__ (wrapper)", 0);
8036 __pyx_r = __pyx_pf_8PyClical_8clifford_18__pos__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
8039 __Pyx_RefNannyFinishContext();
8043 static PyObject *__pyx_pf_8PyClical_8clifford_18__pos__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
8044 PyObject *__pyx_r = NULL;
8045 __Pyx_RefNannyDeclarations
8046 PyObject *__pyx_t_1 = NULL;
8047 __Pyx_RefNannySetupContext(
"__pos__", 0);
8056 __Pyx_XDECREF(__pyx_r);
8057 __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)
8058 __Pyx_GOTREF(__pyx_t_1);
8059 __pyx_r = __pyx_t_1;
8073 __Pyx_XDECREF(__pyx_t_1);
8074 __Pyx_AddTraceback(
"PyClical.clifford.__pos__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8077 __Pyx_XGIVEREF(__pyx_r);
8078 __Pyx_RefNannyFinishContext();
8091 static PyObject *__pyx_pw_8PyClical_8clifford_21__add__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8092 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 ";
8093 #if CYTHON_COMPILING_IN_CPYTHON 8094 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_20__add__;
8096 static PyObject *__pyx_pw_8PyClical_8clifford_21__add__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8097 PyObject *__pyx_r = 0;
8098 __Pyx_RefNannyDeclarations
8099 __Pyx_RefNannySetupContext(
"__add__ (wrapper)", 0);
8100 __pyx_r = __pyx_pf_8PyClical_8clifford_20__add__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8103 __Pyx_RefNannyFinishContext();
8107 static PyObject *__pyx_pf_8PyClical_8clifford_20__add__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8108 PyObject *__pyx_r = NULL;
8109 __Pyx_RefNannyDeclarations
8110 PyObject *__pyx_t_1 = NULL;
8111 PyObject *__pyx_t_2 = NULL;
8112 __Pyx_RefNannySetupContext(
"__add__", 0);
8121 __Pyx_XDECREF(__pyx_r);
8122 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 748, __pyx_L1_error)
8123 __Pyx_GOTREF(__pyx_t_1);
8124 __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)
8125 __Pyx_GOTREF(__pyx_t_2);
8126 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8127 __pyx_r = __pyx_t_2;
8141 __Pyx_XDECREF(__pyx_t_1);
8142 __Pyx_XDECREF(__pyx_t_2);
8143 __Pyx_AddTraceback(
"PyClical.clifford.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8146 __Pyx_XGIVEREF(__pyx_r);
8147 __Pyx_RefNannyFinishContext();
8160 static PyObject *__pyx_pw_8PyClical_8clifford_23__iadd__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8161 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 ";
8162 #if CYTHON_COMPILING_IN_CPYTHON 8163 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_22__iadd__;
8165 static PyObject *__pyx_pw_8PyClical_8clifford_23__iadd__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8166 PyObject *__pyx_r = 0;
8167 __Pyx_RefNannyDeclarations
8168 __Pyx_RefNannySetupContext(
"__iadd__ (wrapper)", 0);
8169 __pyx_r = __pyx_pf_8PyClical_8clifford_22__iadd__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8172 __Pyx_RefNannyFinishContext();
8176 static PyObject *__pyx_pf_8PyClical_8clifford_22__iadd__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8177 PyObject *__pyx_r = NULL;
8178 __Pyx_RefNannyDeclarations
8179 PyObject *__pyx_t_1 = NULL;
8180 __Pyx_RefNannySetupContext(
"__iadd__", 0);
8189 __Pyx_XDECREF(__pyx_r);
8190 __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)
8191 __Pyx_GOTREF(__pyx_t_1);
8192 __pyx_r = __pyx_t_1;
8206 __Pyx_XDECREF(__pyx_t_1);
8207 __Pyx_AddTraceback(
"PyClical.clifford.__iadd__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8210 __Pyx_XGIVEREF(__pyx_r);
8211 __Pyx_RefNannyFinishContext();
8224 static PyObject *__pyx_pw_8PyClical_8clifford_25__sub__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8225 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 ";
8226 #if CYTHON_COMPILING_IN_CPYTHON 8227 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_24__sub__;
8229 static PyObject *__pyx_pw_8PyClical_8clifford_25__sub__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8230 PyObject *__pyx_r = 0;
8231 __Pyx_RefNannyDeclarations
8232 __Pyx_RefNannySetupContext(
"__sub__ (wrapper)", 0);
8233 __pyx_r = __pyx_pf_8PyClical_8clifford_24__sub__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8236 __Pyx_RefNannyFinishContext();
8240 static PyObject *__pyx_pf_8PyClical_8clifford_24__sub__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8241 PyObject *__pyx_r = NULL;
8242 __Pyx_RefNannyDeclarations
8243 PyObject *__pyx_t_1 = NULL;
8244 PyObject *__pyx_t_2 = NULL;
8245 __Pyx_RefNannySetupContext(
"__sub__", 0);
8254 __Pyx_XDECREF(__pyx_r);
8255 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 768, __pyx_L1_error)
8256 __Pyx_GOTREF(__pyx_t_1);
8257 __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)
8258 __Pyx_GOTREF(__pyx_t_2);
8259 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8260 __pyx_r = __pyx_t_2;
8274 __Pyx_XDECREF(__pyx_t_1);
8275 __Pyx_XDECREF(__pyx_t_2);
8276 __Pyx_AddTraceback(
"PyClical.clifford.__sub__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8279 __Pyx_XGIVEREF(__pyx_r);
8280 __Pyx_RefNannyFinishContext();
8293 static PyObject *__pyx_pw_8PyClical_8clifford_27__isub__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8294 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 ";
8295 #if CYTHON_COMPILING_IN_CPYTHON 8296 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_26__isub__;
8298 static PyObject *__pyx_pw_8PyClical_8clifford_27__isub__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8299 PyObject *__pyx_r = 0;
8300 __Pyx_RefNannyDeclarations
8301 __Pyx_RefNannySetupContext(
"__isub__ (wrapper)", 0);
8302 __pyx_r = __pyx_pf_8PyClical_8clifford_26__isub__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8305 __Pyx_RefNannyFinishContext();
8309 static PyObject *__pyx_pf_8PyClical_8clifford_26__isub__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8310 PyObject *__pyx_r = NULL;
8311 __Pyx_RefNannyDeclarations
8312 PyObject *__pyx_t_1 = NULL;
8313 __Pyx_RefNannySetupContext(
"__isub__", 0);
8322 __Pyx_XDECREF(__pyx_r);
8323 __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)
8324 __Pyx_GOTREF(__pyx_t_1);
8325 __pyx_r = __pyx_t_1;
8339 __Pyx_XDECREF(__pyx_t_1);
8340 __Pyx_AddTraceback(
"PyClical.clifford.__isub__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8343 __Pyx_XGIVEREF(__pyx_r);
8344 __Pyx_RefNannyFinishContext();
8357 static PyObject *__pyx_pw_8PyClical_8clifford_29__mul__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8358 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 ";
8359 #if CYTHON_COMPILING_IN_CPYTHON 8360 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_28__mul__;
8362 static PyObject *__pyx_pw_8PyClical_8clifford_29__mul__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8363 PyObject *__pyx_r = 0;
8364 __Pyx_RefNannyDeclarations
8365 __Pyx_RefNannySetupContext(
"__mul__ (wrapper)", 0);
8366 __pyx_r = __pyx_pf_8PyClical_8clifford_28__mul__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8369 __Pyx_RefNannyFinishContext();
8373 static PyObject *__pyx_pf_8PyClical_8clifford_28__mul__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8374 PyObject *__pyx_r = NULL;
8375 __Pyx_RefNannyDeclarations
8376 PyObject *__pyx_t_1 = NULL;
8377 PyObject *__pyx_t_2 = NULL;
8378 __Pyx_RefNannySetupContext(
"__mul__", 0);
8387 __Pyx_XDECREF(__pyx_r);
8388 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 790, __pyx_L1_error)
8389 __Pyx_GOTREF(__pyx_t_1);
8390 __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)
8391 __Pyx_GOTREF(__pyx_t_2);
8392 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8393 __pyx_r = __pyx_t_2;
8407 __Pyx_XDECREF(__pyx_t_1);
8408 __Pyx_XDECREF(__pyx_t_2);
8409 __Pyx_AddTraceback(
"PyClical.clifford.__mul__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8412 __Pyx_XGIVEREF(__pyx_r);
8413 __Pyx_RefNannyFinishContext();
8426 static PyObject *__pyx_pw_8PyClical_8clifford_31__imul__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8427 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 ";
8428 #if CYTHON_COMPILING_IN_CPYTHON 8429 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_30__imul__;
8431 static PyObject *__pyx_pw_8PyClical_8clifford_31__imul__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8432 PyObject *__pyx_r = 0;
8433 __Pyx_RefNannyDeclarations
8434 __Pyx_RefNannySetupContext(
"__imul__ (wrapper)", 0);
8435 __pyx_r = __pyx_pf_8PyClical_8clifford_30__imul__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8438 __Pyx_RefNannyFinishContext();
8442 static PyObject *__pyx_pf_8PyClical_8clifford_30__imul__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8443 PyObject *__pyx_r = NULL;
8444 __Pyx_RefNannyDeclarations
8445 PyObject *__pyx_t_1 = NULL;
8446 __Pyx_RefNannySetupContext(
"__imul__", 0);
8455 __Pyx_XDECREF(__pyx_r);
8456 __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)
8457 __Pyx_GOTREF(__pyx_t_1);
8458 __pyx_r = __pyx_t_1;
8472 __Pyx_XDECREF(__pyx_t_1);
8473 __Pyx_AddTraceback(
"PyClical.clifford.__imul__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8476 __Pyx_XGIVEREF(__pyx_r);
8477 __Pyx_RefNannyFinishContext();
8490 static PyObject *__pyx_pw_8PyClical_8clifford_33__mod__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8491 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 ";
8492 #if CYTHON_COMPILING_IN_CPYTHON 8493 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_32__mod__;
8495 static PyObject *__pyx_pw_8PyClical_8clifford_33__mod__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8496 PyObject *__pyx_r = 0;
8497 __Pyx_RefNannyDeclarations
8498 __Pyx_RefNannySetupContext(
"__mod__ (wrapper)", 0);
8499 __pyx_r = __pyx_pf_8PyClical_8clifford_32__mod__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8502 __Pyx_RefNannyFinishContext();
8506 static PyObject *__pyx_pf_8PyClical_8clifford_32__mod__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8507 PyObject *__pyx_r = NULL;
8508 __Pyx_RefNannyDeclarations
8509 PyObject *__pyx_t_1 = NULL;
8510 PyObject *__pyx_t_2 = NULL;
8511 __Pyx_RefNannySetupContext(
"__mod__", 0);
8520 __Pyx_XDECREF(__pyx_r);
8521 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 818, __pyx_L1_error)
8522 __Pyx_GOTREF(__pyx_t_1);
8523 __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)
8524 __Pyx_GOTREF(__pyx_t_2);
8525 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8526 __pyx_r = __pyx_t_2;
8540 __Pyx_XDECREF(__pyx_t_1);
8541 __Pyx_XDECREF(__pyx_t_2);
8542 __Pyx_AddTraceback(
"PyClical.clifford.__mod__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8545 __Pyx_XGIVEREF(__pyx_r);
8546 __Pyx_RefNannyFinishContext();
8559 static PyObject *__pyx_pw_8PyClical_8clifford_35__imod__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8560 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 ";
8561 #if CYTHON_COMPILING_IN_CPYTHON 8562 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_34__imod__;
8564 static PyObject *__pyx_pw_8PyClical_8clifford_35__imod__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8565 PyObject *__pyx_r = 0;
8566 __Pyx_RefNannyDeclarations
8567 __Pyx_RefNannySetupContext(
"__imod__ (wrapper)", 0);
8568 __pyx_r = __pyx_pf_8PyClical_8clifford_34__imod__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8571 __Pyx_RefNannyFinishContext();
8575 static PyObject *__pyx_pf_8PyClical_8clifford_34__imod__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8576 PyObject *__pyx_r = NULL;
8577 __Pyx_RefNannyDeclarations
8578 PyObject *__pyx_t_1 = NULL;
8579 __Pyx_RefNannySetupContext(
"__imod__", 0);
8588 __Pyx_XDECREF(__pyx_r);
8589 __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)
8590 __Pyx_GOTREF(__pyx_t_1);
8591 __pyx_r = __pyx_t_1;
8605 __Pyx_XDECREF(__pyx_t_1);
8606 __Pyx_AddTraceback(
"PyClical.clifford.__imod__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8609 __Pyx_XGIVEREF(__pyx_r);
8610 __Pyx_RefNannyFinishContext();
8623 static PyObject *__pyx_pw_8PyClical_8clifford_37__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8624 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 ";
8625 #if CYTHON_COMPILING_IN_CPYTHON 8626 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_36__and__;
8628 static PyObject *__pyx_pw_8PyClical_8clifford_37__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8629 PyObject *__pyx_r = 0;
8630 __Pyx_RefNannyDeclarations
8631 __Pyx_RefNannySetupContext(
"__and__ (wrapper)", 0);
8632 __pyx_r = __pyx_pf_8PyClical_8clifford_36__and__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8635 __Pyx_RefNannyFinishContext();
8639 static PyObject *__pyx_pf_8PyClical_8clifford_36__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8640 PyObject *__pyx_r = NULL;
8641 __Pyx_RefNannyDeclarations
8642 PyObject *__pyx_t_1 = NULL;
8643 PyObject *__pyx_t_2 = NULL;
8644 __Pyx_RefNannySetupContext(
"__and__", 0);
8653 __Pyx_XDECREF(__pyx_r);
8654 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 848, __pyx_L1_error)
8655 __Pyx_GOTREF(__pyx_t_1);
8656 __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)
8657 __Pyx_GOTREF(__pyx_t_2);
8658 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8659 __pyx_r = __pyx_t_2;
8673 __Pyx_XDECREF(__pyx_t_1);
8674 __Pyx_XDECREF(__pyx_t_2);
8675 __Pyx_AddTraceback(
"PyClical.clifford.__and__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8678 __Pyx_XGIVEREF(__pyx_r);
8679 __Pyx_RefNannyFinishContext();
8692 static PyObject *__pyx_pw_8PyClical_8clifford_39__iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8693 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 ";
8694 #if CYTHON_COMPILING_IN_CPYTHON 8695 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_38__iand__;
8697 static PyObject *__pyx_pw_8PyClical_8clifford_39__iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8698 PyObject *__pyx_r = 0;
8699 __Pyx_RefNannyDeclarations
8700 __Pyx_RefNannySetupContext(
"__iand__ (wrapper)", 0);
8701 __pyx_r = __pyx_pf_8PyClical_8clifford_38__iand__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8704 __Pyx_RefNannyFinishContext();
8708 static PyObject *__pyx_pf_8PyClical_8clifford_38__iand__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8709 PyObject *__pyx_r = NULL;
8710 __Pyx_RefNannyDeclarations
8711 PyObject *__pyx_t_1 = NULL;
8712 __Pyx_RefNannySetupContext(
"__iand__", 0);
8721 __Pyx_XDECREF(__pyx_r);
8722 __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)
8723 __Pyx_GOTREF(__pyx_t_1);
8724 __pyx_r = __pyx_t_1;
8738 __Pyx_XDECREF(__pyx_t_1);
8739 __Pyx_AddTraceback(
"PyClical.clifford.__iand__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8742 __Pyx_XGIVEREF(__pyx_r);
8743 __Pyx_RefNannyFinishContext();
8756 static PyObject *__pyx_pw_8PyClical_8clifford_41__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8757 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 ";
8758 #if CYTHON_COMPILING_IN_CPYTHON 8759 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_40__xor__;
8761 static PyObject *__pyx_pw_8PyClical_8clifford_41__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8762 PyObject *__pyx_r = 0;
8763 __Pyx_RefNannyDeclarations
8764 __Pyx_RefNannySetupContext(
"__xor__ (wrapper)", 0);
8765 __pyx_r = __pyx_pf_8PyClical_8clifford_40__xor__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8768 __Pyx_RefNannyFinishContext();
8772 static PyObject *__pyx_pf_8PyClical_8clifford_40__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8773 PyObject *__pyx_r = NULL;
8774 __Pyx_RefNannyDeclarations
8775 PyObject *__pyx_t_1 = NULL;
8776 PyObject *__pyx_t_2 = NULL;
8777 __Pyx_RefNannySetupContext(
"__xor__", 0);
8786 __Pyx_XDECREF(__pyx_r);
8787 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 878, __pyx_L1_error)
8788 __Pyx_GOTREF(__pyx_t_1);
8789 __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)
8790 __Pyx_GOTREF(__pyx_t_2);
8791 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8792 __pyx_r = __pyx_t_2;
8806 __Pyx_XDECREF(__pyx_t_1);
8807 __Pyx_XDECREF(__pyx_t_2);
8808 __Pyx_AddTraceback(
"PyClical.clifford.__xor__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8811 __Pyx_XGIVEREF(__pyx_r);
8812 __Pyx_RefNannyFinishContext();
8825 static PyObject *__pyx_pw_8PyClical_8clifford_43__ixor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8826 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 ";
8827 #if CYTHON_COMPILING_IN_CPYTHON 8828 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_42__ixor__;
8830 static PyObject *__pyx_pw_8PyClical_8clifford_43__ixor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8831 PyObject *__pyx_r = 0;
8832 __Pyx_RefNannyDeclarations
8833 __Pyx_RefNannySetupContext(
"__ixor__ (wrapper)", 0);
8834 __pyx_r = __pyx_pf_8PyClical_8clifford_42__ixor__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8837 __Pyx_RefNannyFinishContext();
8841 static PyObject *__pyx_pf_8PyClical_8clifford_42__ixor__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8842 PyObject *__pyx_r = NULL;
8843 __Pyx_RefNannyDeclarations
8844 PyObject *__pyx_t_1 = NULL;
8845 __Pyx_RefNannySetupContext(
"__ixor__", 0);
8854 __Pyx_XDECREF(__pyx_r);
8855 __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)
8856 __Pyx_GOTREF(__pyx_t_1);
8857 __pyx_r = __pyx_t_1;
8871 __Pyx_XDECREF(__pyx_t_1);
8872 __Pyx_AddTraceback(
"PyClical.clifford.__ixor__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8875 __Pyx_XGIVEREF(__pyx_r);
8876 __Pyx_RefNannyFinishContext();
8889 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 8890 static PyObject *__pyx_pw_8PyClical_8clifford_45__div__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8891 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 ";
8892 #if CYTHON_COMPILING_IN_CPYTHON 8893 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_44__div__;
8895 static PyObject *__pyx_pw_8PyClical_8clifford_45__div__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8896 PyObject *__pyx_r = 0;
8897 __Pyx_RefNannyDeclarations
8898 __Pyx_RefNannySetupContext(
"__div__ (wrapper)", 0);
8899 __pyx_r = __pyx_pf_8PyClical_8clifford_44__div__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8902 __Pyx_RefNannyFinishContext();
8907 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 8908 static PyObject *__pyx_pf_8PyClical_8clifford_44__div__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8909 PyObject *__pyx_r = NULL;
8910 __Pyx_RefNannyDeclarations
8911 PyObject *__pyx_t_1 = NULL;
8912 PyObject *__pyx_t_2 = NULL;
8913 __Pyx_RefNannySetupContext(
"__div__", 0);
8922 __Pyx_XDECREF(__pyx_r);
8923 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 908, __pyx_L1_error)
8924 __Pyx_GOTREF(__pyx_t_1);
8925 __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)
8926 __Pyx_GOTREF(__pyx_t_2);
8927 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8928 __pyx_r = __pyx_t_2;
8942 __Pyx_XDECREF(__pyx_t_1);
8943 __Pyx_XDECREF(__pyx_t_2);
8944 __Pyx_AddTraceback(
"PyClical.clifford.__div__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8947 __Pyx_XGIVEREF(__pyx_r);
8948 __Pyx_RefNannyFinishContext();
8962 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 8963 static PyObject *__pyx_pw_8PyClical_8clifford_47__idiv__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8964 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 ";
8965 #if CYTHON_COMPILING_IN_CPYTHON 8966 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_46__idiv__;
8968 static PyObject *__pyx_pw_8PyClical_8clifford_47__idiv__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8969 PyObject *__pyx_r = 0;
8970 __Pyx_RefNannyDeclarations
8971 __Pyx_RefNannySetupContext(
"__idiv__ (wrapper)", 0);
8972 __pyx_r = __pyx_pf_8PyClical_8clifford_46__idiv__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8975 __Pyx_RefNannyFinishContext();
8980 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 8981 static PyObject *__pyx_pf_8PyClical_8clifford_46__idiv__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8982 PyObject *__pyx_r = NULL;
8983 __Pyx_RefNannyDeclarations
8984 PyObject *__pyx_t_1 = NULL;
8985 __Pyx_RefNannySetupContext(
"__idiv__", 0);
8994 __Pyx_XDECREF(__pyx_r);
8995 __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)
8996 __Pyx_GOTREF(__pyx_t_1);
8997 __pyx_r = __pyx_t_1;
9011 __Pyx_XDECREF(__pyx_t_1);
9012 __Pyx_AddTraceback(
"PyClical.clifford.__idiv__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9015 __Pyx_XGIVEREF(__pyx_r);
9016 __Pyx_RefNannyFinishContext();
9030 static PyObject *__pyx_pw_8PyClical_8clifford_49inv(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9031 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 ";
9032 static PyObject *__pyx_pw_8PyClical_8clifford_49inv(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9033 PyObject *__pyx_r = 0;
9034 __Pyx_RefNannyDeclarations
9035 __Pyx_RefNannySetupContext(
"inv (wrapper)", 0);
9036 __pyx_r = __pyx_pf_8PyClical_8clifford_48inv(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
9039 __Pyx_RefNannyFinishContext();
9043 static PyObject *__pyx_pf_8PyClical_8clifford_48inv(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
9044 PyObject *__pyx_r = NULL;
9045 __Pyx_RefNannyDeclarations
9046 PyObject *__pyx_t_1 = NULL;
9047 PyObject *__pyx_t_2 = NULL;
9048 __Pyx_RefNannySetupContext(
"inv", 0);
9057 __Pyx_XDECREF(__pyx_r);
9058 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 936, __pyx_L1_error)
9059 __Pyx_GOTREF(__pyx_t_1);
9060 __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)
9061 __Pyx_GOTREF(__pyx_t_2);
9062 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9063 __pyx_r = __pyx_t_2;
9077 __Pyx_XDECREF(__pyx_t_1);
9078 __Pyx_XDECREF(__pyx_t_2);
9079 __Pyx_AddTraceback(
"PyClical.clifford.inv", __pyx_clineno, __pyx_lineno, __pyx_filename);
9082 __Pyx_XGIVEREF(__pyx_r);
9083 __Pyx_RefNannyFinishContext();
9096 static PyObject *__pyx_pw_8PyClical_8clifford_51__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
9097 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 ";
9098 #if CYTHON_COMPILING_IN_CPYTHON 9099 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_50__or__;
9101 static PyObject *__pyx_pw_8PyClical_8clifford_51__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
9102 PyObject *__pyx_r = 0;
9103 __Pyx_RefNannyDeclarations
9104 __Pyx_RefNannySetupContext(
"__or__ (wrapper)", 0);
9105 __pyx_r = __pyx_pf_8PyClical_8clifford_50__or__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
9108 __Pyx_RefNannyFinishContext();
9112 static PyObject *__pyx_pf_8PyClical_8clifford_50__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
9113 PyObject *__pyx_r = NULL;
9114 __Pyx_RefNannyDeclarations
9115 PyObject *__pyx_t_1 = NULL;
9116 PyObject *__pyx_t_2 = NULL;
9117 __Pyx_RefNannySetupContext(
"__or__", 0);
9126 __Pyx_XDECREF(__pyx_r);
9127 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 947, __pyx_L1_error)
9128 __Pyx_GOTREF(__pyx_t_1);
9129 __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)
9130 __Pyx_GOTREF(__pyx_t_2);
9131 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9132 __pyx_r = __pyx_t_2;
9146 __Pyx_XDECREF(__pyx_t_1);
9147 __Pyx_XDECREF(__pyx_t_2);
9148 __Pyx_AddTraceback(
"PyClical.clifford.__or__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9151 __Pyx_XGIVEREF(__pyx_r);
9152 __Pyx_RefNannyFinishContext();
9165 static PyObject *__pyx_pw_8PyClical_8clifford_53__ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
9166 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 ";
9167 #if CYTHON_COMPILING_IN_CPYTHON 9168 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_52__ior__;
9170 static PyObject *__pyx_pw_8PyClical_8clifford_53__ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
9171 PyObject *__pyx_r = 0;
9172 __Pyx_RefNannyDeclarations
9173 __Pyx_RefNannySetupContext(
"__ior__ (wrapper)", 0);
9174 __pyx_r = __pyx_pf_8PyClical_8clifford_52__ior__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
9177 __Pyx_RefNannyFinishContext();
9181 static PyObject *__pyx_pf_8PyClical_8clifford_52__ior__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
9182 PyObject *__pyx_r = NULL;
9183 __Pyx_RefNannyDeclarations
9184 PyObject *__pyx_t_1 = NULL;
9185 __Pyx_RefNannySetupContext(
"__ior__", 0);
9194 __Pyx_XDECREF(__pyx_r);
9195 __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)
9196 __Pyx_GOTREF(__pyx_t_1);
9197 __pyx_r = __pyx_t_1;
9211 __Pyx_XDECREF(__pyx_t_1);
9212 __Pyx_AddTraceback(
"PyClical.clifford.__ior__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9215 __Pyx_XGIVEREF(__pyx_r);
9216 __Pyx_RefNannyFinishContext();
9229 static PyObject *__pyx_pw_8PyClical_8clifford_55__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_m, PyObject *__pyx_v_dummy);
9230 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 ";
9231 #if CYTHON_COMPILING_IN_CPYTHON 9232 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_54__pow__;
9234 static PyObject *__pyx_pw_8PyClical_8clifford_55__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_m, PyObject *__pyx_v_dummy) {
9235 PyObject *__pyx_r = 0;
9236 __Pyx_RefNannyDeclarations
9237 __Pyx_RefNannySetupContext(
"__pow__ (wrapper)", 0);
9238 __pyx_r = __pyx_pf_8PyClical_8clifford_54__pow__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_m), ((PyObject *)__pyx_v_dummy));
9241 __Pyx_RefNannyFinishContext();
9245 static PyObject *__pyx_pf_8PyClical_8clifford_54__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_m, CYTHON_UNUSED PyObject *__pyx_v_dummy) {
9246 PyObject *__pyx_r = NULL;
9247 __Pyx_RefNannyDeclarations
9248 PyObject *__pyx_t_1 = NULL;
9249 __Pyx_RefNannySetupContext(
"__pow__", 0);
9258 __Pyx_XDECREF(__pyx_r);
9259 __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)
9260 __Pyx_GOTREF(__pyx_t_1);
9261 __pyx_r = __pyx_t_1;
9275 __Pyx_XDECREF(__pyx_t_1);
9276 __Pyx_AddTraceback(
"PyClical.clifford.__pow__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9279 __Pyx_XGIVEREF(__pyx_r);
9280 __Pyx_RefNannyFinishContext();
9293 static PyObject *__pyx_pw_8PyClical_8clifford_57pow(PyObject *__pyx_v_self, PyObject *__pyx_v_m);
9294 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 ";
9295 static PyObject *__pyx_pw_8PyClical_8clifford_57pow(PyObject *__pyx_v_self, PyObject *__pyx_v_m) {
9296 PyObject *__pyx_r = 0;
9297 __Pyx_RefNannyDeclarations
9298 __Pyx_RefNannySetupContext(
"pow (wrapper)", 0);
9299 __pyx_r = __pyx_pf_8PyClical_8clifford_56pow(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_m));
9302 __Pyx_RefNannyFinishContext();
9306 static PyObject *__pyx_pf_8PyClical_8clifford_56pow(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_m) {
9307 PyObject *__pyx_r = NULL;
9308 __Pyx_RefNannyDeclarations
9309 PyObject *__pyx_t_1 = NULL;
9310 PyObject *__pyx_t_2 = NULL;
9314 __Pyx_RefNannySetupContext(
"pow", 0);
9323 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_numbers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __pyx_L1_error)
9324 __Pyx_GOTREF(__pyx_t_1);
9325 __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)
9326 __Pyx_GOTREF(__pyx_t_2);
9327 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9328 __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)
9329 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9330 __pyx_t_4 = (__pyx_t_3 != 0);
9340 __Pyx_XDECREF(__pyx_r);
9341 __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 999, __pyx_L1_error)
9342 __Pyx_GOTREF(__pyx_t_2);
9343 __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)
9344 __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)
9345 __Pyx_GOTREF(__pyx_t_1);
9346 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9347 __pyx_r = __pyx_t_1;
9368 __Pyx_XDECREF(__pyx_r);
9369 __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)
9370 __Pyx_GOTREF(__pyx_t_1);
9371 __pyx_t_2 = PyNumber_Multiply(__pyx_v_m, __pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1001, __pyx_L1_error)
9372 __Pyx_GOTREF(__pyx_t_2);
9373 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9374 __pyx_t_1 = __pyx_f_8PyClical_exp(__pyx_t_2, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1001, __pyx_L1_error)
9375 __Pyx_GOTREF(__pyx_t_1);
9376 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9377 __pyx_r = __pyx_t_1;
9392 __Pyx_XDECREF(__pyx_t_1);
9393 __Pyx_XDECREF(__pyx_t_2);
9394 __Pyx_AddTraceback(
"PyClical.clifford.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
9397 __Pyx_XGIVEREF(__pyx_r);
9398 __Pyx_RefNannyFinishContext();
9411 static PyObject *__pyx_pw_8PyClical_8clifford_59outer_pow(PyObject *__pyx_v_self, PyObject *__pyx_v_m);
9412 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 ";
9413 static PyObject *__pyx_pw_8PyClical_8clifford_59outer_pow(PyObject *__pyx_v_self, PyObject *__pyx_v_m) {
9414 PyObject *__pyx_r = 0;
9415 __Pyx_RefNannyDeclarations
9416 __Pyx_RefNannySetupContext(
"outer_pow (wrapper)", 0);
9417 __pyx_r = __pyx_pf_8PyClical_8clifford_58outer_pow(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_m));
9420 __Pyx_RefNannyFinishContext();
9424 static PyObject *__pyx_pf_8PyClical_8clifford_58outer_pow(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_m) {
9425 PyObject *__pyx_r = NULL;
9426 __Pyx_RefNannyDeclarations
9427 PyObject *__pyx_t_1 = NULL;
9429 PyObject *__pyx_t_3 = NULL;
9430 __Pyx_RefNannySetupContext(
"outer_pow", 0);
9439 __Pyx_XDECREF(__pyx_r);
9440 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1017, __pyx_L1_error)
9441 __Pyx_GOTREF(__pyx_t_1);
9442 __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)
9443 __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)
9444 __Pyx_GOTREF(__pyx_t_3);
9445 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9446 __pyx_r = __pyx_t_3;
9460 __Pyx_XDECREF(__pyx_t_1);
9461 __Pyx_XDECREF(__pyx_t_3);
9462 __Pyx_AddTraceback(
"PyClical.clifford.outer_pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
9465 __Pyx_XGIVEREF(__pyx_r);
9466 __Pyx_RefNannyFinishContext();
9479 static PyObject *__pyx_pw_8PyClical_8clifford_61__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
9480 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 ";
9481 #if CYTHON_COMPILING_IN_CPYTHON 9482 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_60__call__;
9484 static PyObject *__pyx_pw_8PyClical_8clifford_61__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9485 PyObject *__pyx_v_grade = 0;
9486 PyObject *__pyx_r = 0;
9487 __Pyx_RefNannyDeclarations
9488 __Pyx_RefNannySetupContext(
"__call__ (wrapper)", 0);
9490 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_grade,0};
9491 PyObject* values[1] = {0};
9492 if (unlikely(__pyx_kwds)) {
9494 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9496 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9499 default:
goto __pyx_L5_argtuple_error;
9501 kw_args = PyDict_Size(__pyx_kwds);
9504 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_grade)) != 0)) kw_args--;
9505 else goto __pyx_L5_argtuple_error;
9507 if (unlikely(kw_args > 0)) {
9508 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__call__") < 0)) __PYX_ERR(0, 1019, __pyx_L3_error)
9510 }
else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
9511 goto __pyx_L5_argtuple_error;
9513 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9515 __pyx_v_grade = values[0];
9517 goto __pyx_L4_argument_unpacking_done;
9518 __pyx_L5_argtuple_error:;
9519 __Pyx_RaiseArgtupleInvalid(
"__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1019, __pyx_L3_error)
9521 __Pyx_AddTraceback(
"PyClical.clifford.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9522 __Pyx_RefNannyFinishContext();
9524 __pyx_L4_argument_unpacking_done:;
9525 __pyx_r = __pyx_pf_8PyClical_8clifford_60__call__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), __pyx_v_grade);
9528 __Pyx_RefNannyFinishContext();
9532 static PyObject *__pyx_pf_8PyClical_8clifford_60__call__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_grade) {
9533 PyObject *__pyx_r = NULL;
9534 __Pyx_RefNannyDeclarations
9535 PyObject *__pyx_t_1 = NULL;
9537 PyObject *__pyx_t_3 = NULL;
9538 __Pyx_RefNannySetupContext(
"__call__", 0);
9547 __Pyx_XDECREF(__pyx_r);
9548 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1036, __pyx_L1_error)
9549 __Pyx_GOTREF(__pyx_t_1);
9550 __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)
9551 __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)
9552 __Pyx_GOTREF(__pyx_t_3);
9553 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9554 __pyx_r = __pyx_t_3;
9568 __Pyx_XDECREF(__pyx_t_1);
9569 __Pyx_XDECREF(__pyx_t_3);
9570 __Pyx_AddTraceback(
"PyClical.clifford.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9573 __Pyx_XGIVEREF(__pyx_r);
9574 __Pyx_RefNannyFinishContext();
9587 static PyObject *__pyx_pw_8PyClical_8clifford_63scalar(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9588 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 ";
9589 static PyObject *__pyx_pw_8PyClical_8clifford_63scalar(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9590 PyObject *__pyx_r = 0;
9591 __Pyx_RefNannyDeclarations
9592 __Pyx_RefNannySetupContext(
"scalar (wrapper)", 0);
9593 __pyx_r = __pyx_pf_8PyClical_8clifford_62scalar(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
9596 __Pyx_RefNannyFinishContext();
9600 static PyObject *__pyx_pf_8PyClical_8clifford_62scalar(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
9601 PyObject *__pyx_r = NULL;
9602 __Pyx_RefNannyDeclarations
9603 PyObject *__pyx_t_1 = NULL;
9604 __Pyx_RefNannySetupContext(
"scalar", 0);
9613 __Pyx_XDECREF(__pyx_r);
9614 __pyx_t_1 =
PyFloat_FromDouble(__pyx_v_self->instance->scalar());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1047, __pyx_L1_error)
9615 __Pyx_GOTREF(__pyx_t_1);
9616 __pyx_r = __pyx_t_1;
9630 __Pyx_XDECREF(__pyx_t_1);
9631 __Pyx_AddTraceback(
"PyClical.clifford.scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
9634 __Pyx_XGIVEREF(__pyx_r);
9635 __Pyx_RefNannyFinishContext();
9648 static PyObject *__pyx_pw_8PyClical_8clifford_65pure(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9649 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 ";
9650 static PyObject *__pyx_pw_8PyClical_8clifford_65pure(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9651 PyObject *__pyx_r = 0;
9652 __Pyx_RefNannyDeclarations
9653 __Pyx_RefNannySetupContext(
"pure (wrapper)", 0);
9654 __pyx_r = __pyx_pf_8PyClical_8clifford_64pure(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
9657 __Pyx_RefNannyFinishContext();
9661 static PyObject *__pyx_pf_8PyClical_8clifford_64pure(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
9662 PyObject *__pyx_r = NULL;
9663 __Pyx_RefNannyDeclarations
9664 PyObject *__pyx_t_1 = NULL;
9665 PyObject *__pyx_t_2 = NULL;
9666 __Pyx_RefNannySetupContext(
"pure", 0);
9675 __Pyx_XDECREF(__pyx_r);
9676 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1058, __pyx_L1_error)
9677 __Pyx_GOTREF(__pyx_t_1);
9678 __pyx_t_2 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_1), __pyx_v_self->instance->pure());
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1058, __pyx_L1_error)
9679 __Pyx_GOTREF(__pyx_t_2);
9680 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9681 __pyx_r = __pyx_t_2;
9695 __Pyx_XDECREF(__pyx_t_1);
9696 __Pyx_XDECREF(__pyx_t_2);
9697 __Pyx_AddTraceback(
"PyClical.clifford.pure", __pyx_clineno, __pyx_lineno, __pyx_filename);
9700 __Pyx_XGIVEREF(__pyx_r);
9701 __Pyx_RefNannyFinishContext();
9714 static PyObject *__pyx_pw_8PyClical_8clifford_67even(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9715 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 ";
9716 static PyObject *__pyx_pw_8PyClical_8clifford_67even(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9717 PyObject *__pyx_r = 0;
9718 __Pyx_RefNannyDeclarations
9719 __Pyx_RefNannySetupContext(
"even (wrapper)", 0);
9720 __pyx_r = __pyx_pf_8PyClical_8clifford_66even(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
9723 __Pyx_RefNannyFinishContext();
9727 static PyObject *__pyx_pf_8PyClical_8clifford_66even(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
9728 PyObject *__pyx_r = NULL;
9729 __Pyx_RefNannyDeclarations
9730 PyObject *__pyx_t_1 = NULL;
9731 PyObject *__pyx_t_2 = NULL;
9732 __Pyx_RefNannySetupContext(
"even", 0);
9741 __Pyx_XDECREF(__pyx_r);
9742 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1067, __pyx_L1_error)
9743 __Pyx_GOTREF(__pyx_t_1);
9744 __pyx_t_2 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_1), __pyx_v_self->instance->even());
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1067, __pyx_L1_error)
9745 __Pyx_GOTREF(__pyx_t_2);
9746 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9747 __pyx_r = __pyx_t_2;
9761 __Pyx_XDECREF(__pyx_t_1);
9762 __Pyx_XDECREF(__pyx_t_2);
9763 __Pyx_AddTraceback(
"PyClical.clifford.even", __pyx_clineno, __pyx_lineno, __pyx_filename);
9766 __Pyx_XGIVEREF(__pyx_r);
9767 __Pyx_RefNannyFinishContext();
9780 static PyObject *__pyx_pw_8PyClical_8clifford_69odd(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9781 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 ";
9782 static PyObject *__pyx_pw_8PyClical_8clifford_69odd(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9783 PyObject *__pyx_r = 0;
9784 __Pyx_RefNannyDeclarations
9785 __Pyx_RefNannySetupContext(
"odd (wrapper)", 0);
9786 __pyx_r = __pyx_pf_8PyClical_8clifford_68odd(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
9789 __Pyx_RefNannyFinishContext();
9793 static PyObject *__pyx_pf_8PyClical_8clifford_68odd(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
9794 PyObject *__pyx_r = NULL;
9795 __Pyx_RefNannyDeclarations
9796 PyObject *__pyx_t_1 = NULL;
9797 PyObject *__pyx_t_2 = NULL;
9798 __Pyx_RefNannySetupContext(
"odd", 0);
9807 __Pyx_XDECREF(__pyx_r);
9808 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1076, __pyx_L1_error)
9809 __Pyx_GOTREF(__pyx_t_1);
9810 __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)
9811 __Pyx_GOTREF(__pyx_t_2);
9812 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9813 __pyx_r = __pyx_t_2;
9827 __Pyx_XDECREF(__pyx_t_1);
9828 __Pyx_XDECREF(__pyx_t_2);
9829 __Pyx_AddTraceback(
"PyClical.clifford.odd", __pyx_clineno, __pyx_lineno, __pyx_filename);
9832 __Pyx_XGIVEREF(__pyx_r);
9833 __Pyx_RefNannyFinishContext();
9846 static PyObject *__pyx_pw_8PyClical_8clifford_71vector_part(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
9847 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 ";
9848 static PyObject *__pyx_pw_8PyClical_8clifford_71vector_part(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9849 PyObject *__pyx_v_frm = 0;
9850 PyObject *__pyx_r = 0;
9851 __Pyx_RefNannyDeclarations
9852 __Pyx_RefNannySetupContext(
"vector_part (wrapper)", 0);
9854 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frm,0};
9855 PyObject* values[1] = {0};
9856 values[0] = ((PyObject *)Py_None);
9857 if (unlikely(__pyx_kwds)) {
9859 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9861 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9864 default:
goto __pyx_L5_argtuple_error;
9866 kw_args = PyDict_Size(__pyx_kwds);
9870 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_frm);
9871 if (value) { values[0] = value; kw_args--; }
9874 if (unlikely(kw_args > 0)) {
9875 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"vector_part") < 0)) __PYX_ERR(0, 1078, __pyx_L3_error)
9878 switch (PyTuple_GET_SIZE(__pyx_args)) {
9879 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9882 default:
goto __pyx_L5_argtuple_error;
9885 __pyx_v_frm = values[0];
9887 goto __pyx_L4_argument_unpacking_done;
9888 __pyx_L5_argtuple_error:;
9889 __Pyx_RaiseArgtupleInvalid(
"vector_part", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1078, __pyx_L3_error)
9891 __Pyx_AddTraceback(
"PyClical.clifford.vector_part", __pyx_clineno, __pyx_lineno, __pyx_filename);
9892 __Pyx_RefNannyFinishContext();
9894 __pyx_L4_argument_unpacking_done:;
9895 __pyx_r = __pyx_pf_8PyClical_8clifford_70vector_part(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), __pyx_v_frm);
9898 __Pyx_RefNannyFinishContext();
9902 static PyObject *__pyx_pf_8PyClical_8clifford_70vector_part(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_frm) {
9903 PyObject *__pyx_v_error_msg_prefix = NULL;
9904 std::vector<scalar_t> __pyx_v_vec;
9907 PyObject *__pyx_v_lst = NULL;
9908 PyObject *__pyx_v_err = NULL;
9909 PyObject *__pyx_r = NULL;
9910 __Pyx_RefNannyDeclarations
9911 PyObject *__pyx_t_1 = NULL;
9912 PyObject *__pyx_t_2 = NULL;
9913 PyObject *__pyx_t_3 = NULL;
9916 std::vector<scalar_t> __pyx_t_6;
9917 PyObject *__pyx_t_7 = NULL;
9921 PyObject *__pyx_t_11 = NULL;
9922 PyObject *__pyx_t_12 = NULL;
9923 PyObject *__pyx_t_13 = NULL;
9924 PyObject *__pyx_t_14 = NULL;
9925 PyObject *__pyx_t_15 = NULL;
9926 __Pyx_RefNannySetupContext(
"vector_part", 0);
9935 __Pyx_INCREF(__pyx_kp_s_Cannot_take_vector_part_of);
9936 __pyx_v_error_msg_prefix = __pyx_kp_s_Cannot_take_vector_part_of;
9946 __Pyx_PyThreadState_declare
9947 __Pyx_PyThreadState_assign
9948 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
9949 __Pyx_XGOTREF(__pyx_t_1);
9950 __Pyx_XGOTREF(__pyx_t_2);
9951 __Pyx_XGOTREF(__pyx_t_3);
9961 __pyx_t_4 = (__pyx_v_frm == Py_None);
9962 __pyx_t_5 = (__pyx_t_4 != 0);
9972 __pyx_t_6 = __pyx_v_self->instance->vector_part();
9973 __pyx_v_vec = __pyx_t_6;
9994 __pyx_t_6 = __pyx_v_self->instance->vector_part(__pyx_f_8PyClical_9index_set_unwrap(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_frm)));
9996 __Pyx_CppExn2PyErr();
9997 __PYX_ERR(0, 1095, __pyx_L3_error)
9999 __pyx_v_vec = __pyx_t_6;
10010 __pyx_v_n = __pyx_v_vec.size();
10019 __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)
10020 __Pyx_GOTREF(__pyx_t_7);
10021 { Py_ssize_t __pyx_temp;
10022 for (__pyx_temp=0; __pyx_temp < __pyx_v_n; __pyx_temp++) {
10023 __Pyx_INCREF(__pyx_float_0_0);
10024 __Pyx_GIVEREF(__pyx_float_0_0);
10025 PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_float_0_0);
10028 __pyx_v_lst = ((PyObject*)__pyx_t_7);
10038 __pyx_t_8 = __pyx_v_n;
10039 __pyx_t_9 = __pyx_t_8;
10040 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
10041 __pyx_v_i = __pyx_t_10;
10050 __pyx_t_7 =
PyFloat_FromDouble((__pyx_v_vec[__pyx_v_i]));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1099, __pyx_L3_error)
10051 __Pyx_GOTREF(__pyx_t_7);
10052 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)
10053 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10063 __Pyx_XDECREF(__pyx_r);
10064 __Pyx_INCREF(__pyx_v_lst);
10065 __pyx_r = __pyx_v_lst;
10066 goto __pyx_L7_try_return;
10077 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10086 __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
10088 __Pyx_AddTraceback(
"PyClical.clifford.vector_part", __pyx_clineno, __pyx_lineno, __pyx_filename);
10089 if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_11, &__pyx_t_12) < 0) __PYX_ERR(0, 1101, __pyx_L5_except_error)
10090 __Pyx_GOTREF(__pyx_t_7);
10091 __Pyx_GOTREF(__pyx_t_11);
10092 __Pyx_GOTREF(__pyx_t_12);
10093 __Pyx_INCREF(__pyx_t_11);
10094 __pyx_v_err = __pyx_t_11;
10103 __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)
10104 __Pyx_GOTREF(__pyx_t_13);
10105 __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)
10106 __Pyx_GOTREF(__pyx_t_14);
10107 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
10108 __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)
10109 __Pyx_GOTREF(__pyx_t_13);
10110 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
10119 __pyx_t_14 = PyObject_Repr(__pyx_v_frm);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1103, __pyx_L5_except_error)
10120 __Pyx_GOTREF(__pyx_t_14);
10121 __pyx_t_15 = PyNumber_Add(__pyx_t_13, __pyx_t_14);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1103, __pyx_L5_except_error)
10122 __Pyx_GOTREF(__pyx_t_15);
10123 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
10124 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
10125 __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)
10126 __Pyx_GOTREF(__pyx_t_14);
10127 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
10136 __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)
10137 __Pyx_GOTREF(__pyx_t_15);
10138 __pyx_t_13 = PyNumber_Add(__pyx_t_14, __pyx_t_15);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1104, __pyx_L5_except_error)
10139 __Pyx_GOTREF(__pyx_t_13);
10140 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
10141 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
10150 __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)
10151 __Pyx_GOTREF(__pyx_t_15);
10152 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
10153 __Pyx_Raise(__pyx_t_15, 0, 0, 0);
10154 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
10155 __PYX_ERR(0, 1102, __pyx_L5_except_error)
10157 goto __pyx_L5_except_error;
10158 __pyx_L5_except_error:;
10167 __Pyx_XGIVEREF(__pyx_t_1);
10168 __Pyx_XGIVEREF(__pyx_t_2);
10169 __Pyx_XGIVEREF(__pyx_t_3);
10170 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
10171 goto __pyx_L1_error;
10172 __pyx_L7_try_return:;
10173 __Pyx_XGIVEREF(__pyx_t_1);
10174 __Pyx_XGIVEREF(__pyx_t_2);
10175 __Pyx_XGIVEREF(__pyx_t_3);
10176 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
10190 __Pyx_XDECREF(__pyx_t_7);
10191 __Pyx_XDECREF(__pyx_t_11);
10192 __Pyx_XDECREF(__pyx_t_12);
10193 __Pyx_XDECREF(__pyx_t_13);
10194 __Pyx_XDECREF(__pyx_t_14);
10195 __Pyx_XDECREF(__pyx_t_15);
10196 __Pyx_AddTraceback(
"PyClical.clifford.vector_part", __pyx_clineno, __pyx_lineno, __pyx_filename);
10199 __Pyx_XDECREF(__pyx_v_error_msg_prefix);
10200 __Pyx_XDECREF(__pyx_v_lst);
10201 __Pyx_XDECREF(__pyx_v_err);
10202 __Pyx_XGIVEREF(__pyx_r);
10203 __Pyx_RefNannyFinishContext();
10216 static PyObject *__pyx_pw_8PyClical_8clifford_73involute(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10217 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 ";
10218 static PyObject *__pyx_pw_8PyClical_8clifford_73involute(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10219 PyObject *__pyx_r = 0;
10220 __Pyx_RefNannyDeclarations
10221 __Pyx_RefNannySetupContext(
"involute (wrapper)", 0);
10222 __pyx_r = __pyx_pf_8PyClical_8clifford_72involute(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10225 __Pyx_RefNannyFinishContext();
10229 static PyObject *__pyx_pf_8PyClical_8clifford_72involute(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10230 PyObject *__pyx_r = NULL;
10231 __Pyx_RefNannyDeclarations
10232 PyObject *__pyx_t_1 = NULL;
10233 PyObject *__pyx_t_2 = NULL;
10234 __Pyx_RefNannySetupContext(
"involute", 0);
10243 __Pyx_XDECREF(__pyx_r);
10244 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1120, __pyx_L1_error)
10245 __Pyx_GOTREF(__pyx_t_1);
10246 __pyx_t_2 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_1), __pyx_v_self->instance->involute());
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1120, __pyx_L1_error)
10247 __Pyx_GOTREF(__pyx_t_2);
10248 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10249 __pyx_r = __pyx_t_2;
10263 __Pyx_XDECREF(__pyx_t_1);
10264 __Pyx_XDECREF(__pyx_t_2);
10265 __Pyx_AddTraceback(
"PyClical.clifford.involute", __pyx_clineno, __pyx_lineno, __pyx_filename);
10268 __Pyx_XGIVEREF(__pyx_r);
10269 __Pyx_RefNannyFinishContext();
10282 static PyObject *__pyx_pw_8PyClical_8clifford_75reverse(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10283 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 ";
10284 static PyObject *__pyx_pw_8PyClical_8clifford_75reverse(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10285 PyObject *__pyx_r = 0;
10286 __Pyx_RefNannyDeclarations
10287 __Pyx_RefNannySetupContext(
"reverse (wrapper)", 0);
10288 __pyx_r = __pyx_pf_8PyClical_8clifford_74reverse(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10291 __Pyx_RefNannyFinishContext();
10295 static PyObject *__pyx_pf_8PyClical_8clifford_74reverse(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10296 PyObject *__pyx_r = NULL;
10297 __Pyx_RefNannyDeclarations
10298 PyObject *__pyx_t_1 = NULL;
10299 PyObject *__pyx_t_2 = NULL;
10300 __Pyx_RefNannySetupContext(
"reverse", 0);
10309 __Pyx_XDECREF(__pyx_r);
10310 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1135, __pyx_L1_error)
10311 __Pyx_GOTREF(__pyx_t_1);
10312 __pyx_t_2 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_1), __pyx_v_self->instance->reverse());
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1135, __pyx_L1_error)
10313 __Pyx_GOTREF(__pyx_t_2);
10314 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10315 __pyx_r = __pyx_t_2;
10329 __Pyx_XDECREF(__pyx_t_1);
10330 __Pyx_XDECREF(__pyx_t_2);
10331 __Pyx_AddTraceback(
"PyClical.clifford.reverse", __pyx_clineno, __pyx_lineno, __pyx_filename);
10334 __Pyx_XGIVEREF(__pyx_r);
10335 __Pyx_RefNannyFinishContext();
10348 static PyObject *__pyx_pw_8PyClical_8clifford_77conj(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10349 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 ";
10350 static PyObject *__pyx_pw_8PyClical_8clifford_77conj(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10351 PyObject *__pyx_r = 0;
10352 __Pyx_RefNannyDeclarations
10353 __Pyx_RefNannySetupContext(
"conj (wrapper)", 0);
10354 __pyx_r = __pyx_pf_8PyClical_8clifford_76conj(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10357 __Pyx_RefNannyFinishContext();
10361 static PyObject *__pyx_pf_8PyClical_8clifford_76conj(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10362 PyObject *__pyx_r = NULL;
10363 __Pyx_RefNannyDeclarations
10364 PyObject *__pyx_t_1 = NULL;
10365 PyObject *__pyx_t_2 = NULL;
10366 __Pyx_RefNannySetupContext(
"conj", 0);
10375 __Pyx_XDECREF(__pyx_r);
10376 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1150, __pyx_L1_error)
10377 __Pyx_GOTREF(__pyx_t_1);
10378 __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)
10379 __Pyx_GOTREF(__pyx_t_2);
10380 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10381 __pyx_r = __pyx_t_2;
10395 __Pyx_XDECREF(__pyx_t_1);
10396 __Pyx_XDECREF(__pyx_t_2);
10397 __Pyx_AddTraceback(
"PyClical.clifford.conj", __pyx_clineno, __pyx_lineno, __pyx_filename);
10400 __Pyx_XGIVEREF(__pyx_r);
10401 __Pyx_RefNannyFinishContext();
10414 static PyObject *__pyx_pw_8PyClical_8clifford_79quad(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10415 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 ";
10416 static PyObject *__pyx_pw_8PyClical_8clifford_79quad(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10417 PyObject *__pyx_r = 0;
10418 __Pyx_RefNannyDeclarations
10419 __Pyx_RefNannySetupContext(
"quad (wrapper)", 0);
10420 __pyx_r = __pyx_pf_8PyClical_8clifford_78quad(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10423 __Pyx_RefNannyFinishContext();
10427 static PyObject *__pyx_pf_8PyClical_8clifford_78quad(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10428 PyObject *__pyx_r = NULL;
10429 __Pyx_RefNannyDeclarations
10430 PyObject *__pyx_t_1 = NULL;
10431 __Pyx_RefNannySetupContext(
"quad", 0);
10440 __Pyx_XDECREF(__pyx_r);
10441 __pyx_t_1 =
PyFloat_FromDouble(__pyx_v_self->instance->quad());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1161, __pyx_L1_error)
10442 __Pyx_GOTREF(__pyx_t_1);
10443 __pyx_r = __pyx_t_1;
10457 __Pyx_XDECREF(__pyx_t_1);
10458 __Pyx_AddTraceback(
"PyClical.clifford.quad", __pyx_clineno, __pyx_lineno, __pyx_filename);
10461 __Pyx_XGIVEREF(__pyx_r);
10462 __Pyx_RefNannyFinishContext();
10475 static PyObject *__pyx_pw_8PyClical_8clifford_81norm(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10476 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 ";
10477 static PyObject *__pyx_pw_8PyClical_8clifford_81norm(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10478 PyObject *__pyx_r = 0;
10479 __Pyx_RefNannyDeclarations
10480 __Pyx_RefNannySetupContext(
"norm (wrapper)", 0);
10481 __pyx_r = __pyx_pf_8PyClical_8clifford_80norm(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10484 __Pyx_RefNannyFinishContext();
10488 static PyObject *__pyx_pf_8PyClical_8clifford_80norm(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10489 PyObject *__pyx_r = NULL;
10490 __Pyx_RefNannyDeclarations
10491 PyObject *__pyx_t_1 = NULL;
10492 __Pyx_RefNannySetupContext(
"norm", 0);
10501 __Pyx_XDECREF(__pyx_r);
10502 __pyx_t_1 =
PyFloat_FromDouble(__pyx_v_self->instance->norm());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1172, __pyx_L1_error)
10503 __Pyx_GOTREF(__pyx_t_1);
10504 __pyx_r = __pyx_t_1;
10518 __Pyx_XDECREF(__pyx_t_1);
10519 __Pyx_AddTraceback(
"PyClical.clifford.norm", __pyx_clineno, __pyx_lineno, __pyx_filename);
10522 __Pyx_XGIVEREF(__pyx_r);
10523 __Pyx_RefNannyFinishContext();
10536 static PyObject *__pyx_pw_8PyClical_8clifford_83abs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10537 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 ";
10538 static PyObject *__pyx_pw_8PyClical_8clifford_83abs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10539 PyObject *__pyx_r = 0;
10540 __Pyx_RefNannyDeclarations
10541 __Pyx_RefNannySetupContext(
"abs (wrapper)", 0);
10542 __pyx_r = __pyx_pf_8PyClical_8clifford_82abs(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10545 __Pyx_RefNannyFinishContext();
10549 static PyObject *__pyx_pf_8PyClical_8clifford_82abs(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10550 PyObject *__pyx_r = NULL;
10551 __Pyx_RefNannyDeclarations
10552 PyObject *__pyx_t_1 = NULL;
10553 __Pyx_RefNannySetupContext(
"abs", 0);
10562 __Pyx_XDECREF(__pyx_r);
10563 __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)
10564 __Pyx_GOTREF(__pyx_t_1);
10565 __pyx_r = __pyx_t_1;
10579 __Pyx_XDECREF(__pyx_t_1);
10580 __Pyx_AddTraceback(
"PyClical.clifford.abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
10583 __Pyx_XGIVEREF(__pyx_r);
10584 __Pyx_RefNannyFinishContext();
10597 static PyObject *__pyx_pw_8PyClical_8clifford_85max_abs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10598 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 ";
10599 static PyObject *__pyx_pw_8PyClical_8clifford_85max_abs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10600 PyObject *__pyx_r = 0;
10601 __Pyx_RefNannyDeclarations
10602 __Pyx_RefNannySetupContext(
"max_abs (wrapper)", 0);
10603 __pyx_r = __pyx_pf_8PyClical_8clifford_84max_abs(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10606 __Pyx_RefNannyFinishContext();
10610 static PyObject *__pyx_pf_8PyClical_8clifford_84max_abs(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10611 PyObject *__pyx_r = NULL;
10612 __Pyx_RefNannyDeclarations
10613 PyObject *__pyx_t_1 = NULL;
10614 __Pyx_RefNannySetupContext(
"max_abs", 0);
10623 __Pyx_XDECREF(__pyx_r);
10624 __pyx_t_1 =
PyFloat_FromDouble(__pyx_v_self->instance->max_abs());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1192, __pyx_L1_error)
10625 __Pyx_GOTREF(__pyx_t_1);
10626 __pyx_r = __pyx_t_1;
10640 __Pyx_XDECREF(__pyx_t_1);
10641 __Pyx_AddTraceback(
"PyClical.clifford.max_abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
10644 __Pyx_XGIVEREF(__pyx_r);
10645 __Pyx_RefNannyFinishContext();
10658 static PyObject *__pyx_pw_8PyClical_8clifford_87truncated(PyObject *__pyx_v_self, PyObject *__pyx_v_limit);
10659 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 ";
10660 static PyObject *__pyx_pw_8PyClical_8clifford_87truncated(PyObject *__pyx_v_self, PyObject *__pyx_v_limit) {
10661 PyObject *__pyx_r = 0;
10662 __Pyx_RefNannyDeclarations
10663 __Pyx_RefNannySetupContext(
"truncated (wrapper)", 0);
10664 __pyx_r = __pyx_pf_8PyClical_8clifford_86truncated(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_limit));
10667 __Pyx_RefNannyFinishContext();
10671 static PyObject *__pyx_pf_8PyClical_8clifford_86truncated(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_limit) {
10672 PyObject *__pyx_r = NULL;
10673 __Pyx_RefNannyDeclarations
10674 PyObject *__pyx_t_1 = NULL;
10676 PyObject *__pyx_t_3 = NULL;
10677 __Pyx_RefNannySetupContext(
"truncated", 0);
10686 __Pyx_XDECREF(__pyx_r);
10687 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1203, __pyx_L1_error)
10688 __Pyx_GOTREF(__pyx_t_1);
10689 __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)
10690 __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)
10691 __Pyx_GOTREF(__pyx_t_3);
10692 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10693 __pyx_r = __pyx_t_3;
10707 __Pyx_XDECREF(__pyx_t_1);
10708 __Pyx_XDECREF(__pyx_t_3);
10709 __Pyx_AddTraceback(
"PyClical.clifford.truncated", __pyx_clineno, __pyx_lineno, __pyx_filename);
10712 __Pyx_XGIVEREF(__pyx_r);
10713 __Pyx_RefNannyFinishContext();
10726 static PyObject *__pyx_pw_8PyClical_8clifford_89isnan(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10727 static char __pyx_doc_8PyClical_8clifford_88isnan[] =
"\n Check if a multivector contains any IEEE NaN values.\n\n >>> clifford().isnan()\n False\n ";
10728 static PyObject *__pyx_pw_8PyClical_8clifford_89isnan(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10729 PyObject *__pyx_r = 0;
10730 __Pyx_RefNannyDeclarations
10731 __Pyx_RefNannySetupContext(
"isnan (wrapper)", 0);
10732 __pyx_r = __pyx_pf_8PyClical_8clifford_88isnan(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10735 __Pyx_RefNannyFinishContext();
10739 static PyObject *__pyx_pf_8PyClical_8clifford_88isnan(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10740 PyObject *__pyx_r = NULL;
10741 __Pyx_RefNannyDeclarations
10742 PyObject *__pyx_t_1 = NULL;
10743 __Pyx_RefNannySetupContext(
"isnan", 0);
10752 __Pyx_XDECREF(__pyx_r);
10753 __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->instance->isnan());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1212, __pyx_L1_error)
10754 __Pyx_GOTREF(__pyx_t_1);
10755 __pyx_r = __pyx_t_1;
10769 __Pyx_XDECREF(__pyx_t_1);
10770 __Pyx_AddTraceback(
"PyClical.clifford.isnan", __pyx_clineno, __pyx_lineno, __pyx_filename);
10773 __Pyx_XGIVEREF(__pyx_r);
10774 __Pyx_RefNannyFinishContext();
10787 static PyObject *__pyx_pw_8PyClical_8clifford_91frame(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10788 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 ";
10789 static PyObject *__pyx_pw_8PyClical_8clifford_91frame(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10790 PyObject *__pyx_r = 0;
10791 __Pyx_RefNannyDeclarations
10792 __Pyx_RefNannySetupContext(
"frame (wrapper)", 0);
10793 __pyx_r = __pyx_pf_8PyClical_8clifford_90frame(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10796 __Pyx_RefNannyFinishContext();
10800 static PyObject *__pyx_pf_8PyClical_8clifford_90frame(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10801 PyObject *__pyx_r = NULL;
10802 __Pyx_RefNannyDeclarations
10803 PyObject *__pyx_t_1 = NULL;
10804 PyObject *__pyx_t_2 = NULL;
10805 __Pyx_RefNannySetupContext(
"frame", 0);
10814 __Pyx_XDECREF(__pyx_r);
10815 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_index_set));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1223, __pyx_L1_error)
10816 __Pyx_GOTREF(__pyx_t_1);
10817 __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)
10818 __Pyx_GOTREF(__pyx_t_2);
10819 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10820 __pyx_r = __pyx_t_2;
10834 __Pyx_XDECREF(__pyx_t_1);
10835 __Pyx_XDECREF(__pyx_t_2);
10836 __Pyx_AddTraceback(
"PyClical.clifford.frame", __pyx_clineno, __pyx_lineno, __pyx_filename);
10839 __Pyx_XGIVEREF(__pyx_r);
10840 __Pyx_RefNannyFinishContext();
10853 static PyObject *__pyx_pw_8PyClical_8clifford_93__repr__(PyObject *__pyx_v_self);
10854 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 ";
10855 #if CYTHON_COMPILING_IN_CPYTHON 10856 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_92__repr__;
10858 static PyObject *__pyx_pw_8PyClical_8clifford_93__repr__(PyObject *__pyx_v_self) {
10859 PyObject *__pyx_r = 0;
10860 __Pyx_RefNannyDeclarations
10861 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
10862 __pyx_r = __pyx_pf_8PyClical_8clifford_92__repr__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10865 __Pyx_RefNannyFinishContext();
10869 static PyObject *__pyx_pf_8PyClical_8clifford_92__repr__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10870 PyObject *__pyx_r = NULL;
10871 __Pyx_RefNannyDeclarations
10872 PyObject *__pyx_t_1 = NULL;
10873 __Pyx_RefNannySetupContext(
"__repr__", 0);
10882 __Pyx_XDECREF(__pyx_r);
10883 __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)
10884 __Pyx_GOTREF(__pyx_t_1);
10885 __pyx_r = __pyx_t_1;
10899 __Pyx_XDECREF(__pyx_t_1);
10900 __Pyx_AddTraceback(
"PyClical.clifford.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10903 __Pyx_XGIVEREF(__pyx_r);
10904 __Pyx_RefNannyFinishContext();
10917 static PyObject *__pyx_pw_8PyClical_8clifford_95__str__(PyObject *__pyx_v_self);
10918 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 ";
10919 #if CYTHON_COMPILING_IN_CPYTHON 10920 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_94__str__;
10922 static PyObject *__pyx_pw_8PyClical_8clifford_95__str__(PyObject *__pyx_v_self) {
10923 PyObject *__pyx_r = 0;
10924 __Pyx_RefNannyDeclarations
10925 __Pyx_RefNannySetupContext(
"__str__ (wrapper)", 0);
10926 __pyx_r = __pyx_pf_8PyClical_8clifford_94__str__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10929 __Pyx_RefNannyFinishContext();
10933 static PyObject *__pyx_pf_8PyClical_8clifford_94__str__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10934 PyObject *__pyx_r = NULL;
10935 __Pyx_RefNannyDeclarations
10936 PyObject *__pyx_t_1 = NULL;
10937 __Pyx_RefNannySetupContext(
"__str__", 0);
10946 __Pyx_XDECREF(__pyx_r);
10947 __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)
10948 __Pyx_GOTREF(__pyx_t_1);
10949 __pyx_r = __pyx_t_1;
10963 __Pyx_XDECREF(__pyx_t_1);
10964 __Pyx_AddTraceback(
"PyClical.clifford.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10967 __Pyx_XGIVEREF(__pyx_r);
10968 __Pyx_RefNannyFinishContext();
10979 static PyObject *__pyx_pw_8PyClical_8clifford_97__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10980 static PyObject *__pyx_pw_8PyClical_8clifford_97__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10981 PyObject *__pyx_r = 0;
10982 __Pyx_RefNannyDeclarations
10983 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
10984 __pyx_r = __pyx_pf_8PyClical_8clifford_96__reduce_cython__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10987 __Pyx_RefNannyFinishContext();
10991 static PyObject *__pyx_pf_8PyClical_8clifford_96__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10992 PyObject *__pyx_r = NULL;
10993 __Pyx_RefNannyDeclarations
10994 PyObject *__pyx_t_1 = NULL;
10995 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
11003 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
11004 __Pyx_GOTREF(__pyx_t_1);
11005 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
11006 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11007 __PYX_ERR(1, 2, __pyx_L1_error)
11017 __Pyx_XDECREF(__pyx_t_1);
11018 __Pyx_AddTraceback(
"PyClical.clifford.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11020 __Pyx_XGIVEREF(__pyx_r);
11021 __Pyx_RefNannyFinishContext();
11033 static PyObject *__pyx_pw_8PyClical_8clifford_99__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
11034 static PyObject *__pyx_pw_8PyClical_8clifford_99__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
11035 PyObject *__pyx_r = 0;
11036 __Pyx_RefNannyDeclarations
11037 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
11038 __pyx_r = __pyx_pf_8PyClical_8clifford_98__setstate_cython__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
11041 __Pyx_RefNannyFinishContext();
11045 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) {
11046 PyObject *__pyx_r = NULL;
11047 __Pyx_RefNannyDeclarations
11048 PyObject *__pyx_t_1 = NULL;
11049 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
11056 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__12, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
11057 __Pyx_GOTREF(__pyx_t_1);
11058 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
11059 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11060 __PYX_ERR(1, 4, __pyx_L1_error)
11071 __Pyx_XDECREF(__pyx_t_1);
11072 __Pyx_AddTraceback(
"PyClical.clifford.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11074 __Pyx_XGIVEREF(__pyx_r);
11075 __Pyx_RefNannyFinishContext();
11088 static PyObject *__pyx_pw_8PyClical_9clifford_hidden_doctests(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused);
11089 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 ";
11090 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};
11091 static PyObject *__pyx_pw_8PyClical_9clifford_hidden_doctests(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
11092 PyObject *__pyx_r = 0;
11093 __Pyx_RefNannyDeclarations
11094 __Pyx_RefNannySetupContext(
"clifford_hidden_doctests (wrapper)", 0);
11095 __pyx_r = __pyx_pf_8PyClical_8clifford_hidden_doctests(__pyx_self);
11098 __Pyx_RefNannyFinishContext();
11102 static PyObject *__pyx_pf_8PyClical_8clifford_hidden_doctests(CYTHON_UNUSED PyObject *__pyx_self) {
11103 PyObject *__pyx_r = NULL;
11104 __Pyx_RefNannyDeclarations
11105 __Pyx_RefNannySetupContext(
"clifford_hidden_doctests", 0);
11114 __Pyx_XDECREF(__pyx_r);
11115 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11128 __Pyx_XGIVEREF(__pyx_r);
11129 __Pyx_RefNannyFinishContext();
11141 static PyObject *__pyx_pw_8PyClical_11inv(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11142 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_inv(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11143 PyObject *__pyx_r = NULL;
11144 __Pyx_RefNannyDeclarations
11145 PyObject *__pyx_t_1 = NULL;
11146 PyObject *__pyx_t_2 = NULL;
11147 PyObject *__pyx_t_3 = NULL;
11148 __Pyx_RefNannySetupContext(
"inv", 0);
11157 __Pyx_XDECREF(__pyx_r);
11158 __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)
11159 __Pyx_GOTREF(__pyx_t_2);
11160 __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)
11161 __Pyx_GOTREF(__pyx_t_3);
11162 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11164 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11165 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11166 if (likely(__pyx_t_2)) {
11167 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
11168 __Pyx_INCREF(__pyx_t_2);
11169 __Pyx_INCREF(
function);
11170 __Pyx_DECREF_SET(__pyx_t_3,
function);
11173 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
11174 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11175 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1342, __pyx_L1_error)
11176 __Pyx_GOTREF(__pyx_t_1);
11177 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11178 __pyx_r = __pyx_t_1;
11192 __Pyx_XDECREF(__pyx_t_1);
11193 __Pyx_XDECREF(__pyx_t_2);
11194 __Pyx_XDECREF(__pyx_t_3);
11195 __Pyx_AddTraceback(
"PyClical.inv", __pyx_clineno, __pyx_lineno, __pyx_filename);
11198 __Pyx_XGIVEREF(__pyx_r);
11199 __Pyx_RefNannyFinishContext();
11204 static PyObject *__pyx_pw_8PyClical_11inv(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11205 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 ";
11206 static PyObject *__pyx_pw_8PyClical_11inv(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11207 PyObject *__pyx_r = 0;
11208 __Pyx_RefNannyDeclarations
11209 __Pyx_RefNannySetupContext(
"inv (wrapper)", 0);
11210 __pyx_r = __pyx_pf_8PyClical_10inv(__pyx_self, ((PyObject *)__pyx_v_obj));
11213 __Pyx_RefNannyFinishContext();
11217 static PyObject *__pyx_pf_8PyClical_10inv(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11218 PyObject *__pyx_r = NULL;
11219 __Pyx_RefNannyDeclarations
11220 PyObject *__pyx_t_1 = NULL;
11221 __Pyx_RefNannySetupContext(
"inv", 0);
11222 __Pyx_XDECREF(__pyx_r);
11223 __pyx_t_1 = __pyx_f_8PyClical_inv(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1329, __pyx_L1_error)
11224 __Pyx_GOTREF(__pyx_t_1);
11225 __pyx_r = __pyx_t_1;
11231 __Pyx_XDECREF(__pyx_t_1);
11232 __Pyx_AddTraceback(
"PyClical.inv", __pyx_clineno, __pyx_lineno, __pyx_filename);
11235 __Pyx_XGIVEREF(__pyx_r);
11236 __Pyx_RefNannyFinishContext();
11248 static PyObject *__pyx_pw_8PyClical_13scalar(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11249 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_scalar(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11250 PyObject *__pyx_r = NULL;
11251 __Pyx_RefNannyDeclarations
11252 PyObject *__pyx_t_1 = NULL;
11253 PyObject *__pyx_t_2 = NULL;
11254 PyObject *__pyx_t_3 = NULL;
11255 __Pyx_RefNannySetupContext(
"scalar", 0);
11264 __Pyx_XDECREF(__pyx_r);
11265 __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)
11266 __Pyx_GOTREF(__pyx_t_2);
11267 __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)
11268 __Pyx_GOTREF(__pyx_t_3);
11269 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11271 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11272 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11273 if (likely(__pyx_t_2)) {
11274 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
11275 __Pyx_INCREF(__pyx_t_2);
11276 __Pyx_INCREF(
function);
11277 __Pyx_DECREF_SET(__pyx_t_3,
function);
11280 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
11281 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11282 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1353, __pyx_L1_error)
11283 __Pyx_GOTREF(__pyx_t_1);
11284 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11285 __pyx_r = __pyx_t_1;
11299 __Pyx_XDECREF(__pyx_t_1);
11300 __Pyx_XDECREF(__pyx_t_2);
11301 __Pyx_XDECREF(__pyx_t_3);
11302 __Pyx_AddTraceback(
"PyClical.scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
11305 __Pyx_XGIVEREF(__pyx_r);
11306 __Pyx_RefNannyFinishContext();
11311 static PyObject *__pyx_pw_8PyClical_13scalar(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11312 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 ";
11313 static PyObject *__pyx_pw_8PyClical_13scalar(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11314 PyObject *__pyx_r = 0;
11315 __Pyx_RefNannyDeclarations
11316 __Pyx_RefNannySetupContext(
"scalar (wrapper)", 0);
11317 __pyx_r = __pyx_pf_8PyClical_12scalar(__pyx_self, ((PyObject *)__pyx_v_obj));
11320 __Pyx_RefNannyFinishContext();
11324 static PyObject *__pyx_pf_8PyClical_12scalar(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11325 PyObject *__pyx_r = NULL;
11326 __Pyx_RefNannyDeclarations
11327 PyObject *__pyx_t_1 = NULL;
11328 __Pyx_RefNannySetupContext(
"scalar", 0);
11329 __Pyx_XDECREF(__pyx_r);
11330 __pyx_t_1 = __pyx_f_8PyClical_scalar(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1344, __pyx_L1_error)
11331 __Pyx_GOTREF(__pyx_t_1);
11332 __pyx_r = __pyx_t_1;
11338 __Pyx_XDECREF(__pyx_t_1);
11339 __Pyx_AddTraceback(
"PyClical.scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
11342 __Pyx_XGIVEREF(__pyx_r);
11343 __Pyx_RefNannyFinishContext();
11355 static PyObject *__pyx_pw_8PyClical_15real(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11356 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_real(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11357 PyObject *__pyx_r = NULL;
11358 __Pyx_RefNannyDeclarations
11359 PyObject *__pyx_t_1 = NULL;
11360 PyObject *__pyx_t_2 = NULL;
11361 PyObject *__pyx_t_3 = NULL;
11362 __Pyx_RefNannySetupContext(
"real", 0);
11371 __Pyx_XDECREF(__pyx_r);
11372 __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)
11373 __Pyx_GOTREF(__pyx_t_2);
11374 __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)
11375 __Pyx_GOTREF(__pyx_t_3);
11376 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11378 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11379 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11380 if (likely(__pyx_t_2)) {
11381 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
11382 __Pyx_INCREF(__pyx_t_2);
11383 __Pyx_INCREF(
function);
11384 __Pyx_DECREF_SET(__pyx_t_3,
function);
11387 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
11388 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11389 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1364, __pyx_L1_error)
11390 __Pyx_GOTREF(__pyx_t_1);
11391 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11392 __pyx_r = __pyx_t_1;
11406 __Pyx_XDECREF(__pyx_t_1);
11407 __Pyx_XDECREF(__pyx_t_2);
11408 __Pyx_XDECREF(__pyx_t_3);
11409 __Pyx_AddTraceback(
"PyClical.real", __pyx_clineno, __pyx_lineno, __pyx_filename);
11412 __Pyx_XGIVEREF(__pyx_r);
11413 __Pyx_RefNannyFinishContext();
11418 static PyObject *__pyx_pw_8PyClical_15real(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11419 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 ";
11420 static PyObject *__pyx_pw_8PyClical_15real(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11421 PyObject *__pyx_r = 0;
11422 __Pyx_RefNannyDeclarations
11423 __Pyx_RefNannySetupContext(
"real (wrapper)", 0);
11424 __pyx_r = __pyx_pf_8PyClical_14real(__pyx_self, ((PyObject *)__pyx_v_obj));
11427 __Pyx_RefNannyFinishContext();
11431 static PyObject *__pyx_pf_8PyClical_14real(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11432 PyObject *__pyx_r = NULL;
11433 __Pyx_RefNannyDeclarations
11434 PyObject *__pyx_t_1 = NULL;
11435 __Pyx_RefNannySetupContext(
"real", 0);
11436 __Pyx_XDECREF(__pyx_r);
11437 __pyx_t_1 = __pyx_f_8PyClical_real(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1355, __pyx_L1_error)
11438 __Pyx_GOTREF(__pyx_t_1);
11439 __pyx_r = __pyx_t_1;
11445 __Pyx_XDECREF(__pyx_t_1);
11446 __Pyx_AddTraceback(
"PyClical.real", __pyx_clineno, __pyx_lineno, __pyx_filename);
11449 __Pyx_XGIVEREF(__pyx_r);
11450 __Pyx_RefNannyFinishContext();
11462 static PyObject *__pyx_pw_8PyClical_17imag(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11463 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_imag(CYTHON_UNUSED PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11464 PyObject *__pyx_r = NULL;
11465 __Pyx_RefNannyDeclarations
11466 __Pyx_RefNannySetupContext(
"imag", 0);
11475 __Pyx_XDECREF(__pyx_r);
11476 __Pyx_INCREF(__pyx_float_0_0);
11477 __pyx_r = __pyx_float_0_0;
11490 __Pyx_XGIVEREF(__pyx_r);
11491 __Pyx_RefNannyFinishContext();
11496 static PyObject *__pyx_pw_8PyClical_17imag(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11497 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 ";
11498 static PyObject *__pyx_pw_8PyClical_17imag(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11499 PyObject *__pyx_r = 0;
11500 __Pyx_RefNannyDeclarations
11501 __Pyx_RefNannySetupContext(
"imag (wrapper)", 0);
11502 __pyx_r = __pyx_pf_8PyClical_16imag(__pyx_self, ((PyObject *)__pyx_v_obj));
11505 __Pyx_RefNannyFinishContext();
11509 static PyObject *__pyx_pf_8PyClical_16imag(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11510 PyObject *__pyx_r = NULL;
11511 __Pyx_RefNannyDeclarations
11512 PyObject *__pyx_t_1 = NULL;
11513 __Pyx_RefNannySetupContext(
"imag", 0);
11514 __Pyx_XDECREF(__pyx_r);
11515 __pyx_t_1 = __pyx_f_8PyClical_imag(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1366, __pyx_L1_error)
11516 __Pyx_GOTREF(__pyx_t_1);
11517 __pyx_r = __pyx_t_1;
11523 __Pyx_XDECREF(__pyx_t_1);
11524 __Pyx_AddTraceback(
"PyClical.imag", __pyx_clineno, __pyx_lineno, __pyx_filename);
11527 __Pyx_XGIVEREF(__pyx_r);
11528 __Pyx_RefNannyFinishContext();
11540 static PyObject *__pyx_pw_8PyClical_19pure(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11541 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_pure(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11542 PyObject *__pyx_r = NULL;
11543 __Pyx_RefNannyDeclarations
11544 PyObject *__pyx_t_1 = NULL;
11545 PyObject *__pyx_t_2 = NULL;
11546 PyObject *__pyx_t_3 = NULL;
11547 __Pyx_RefNannySetupContext(
"pure", 0);
11556 __Pyx_XDECREF(__pyx_r);
11557 __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)
11558 __Pyx_GOTREF(__pyx_t_2);
11559 __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)
11560 __Pyx_GOTREF(__pyx_t_3);
11561 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11563 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11564 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11565 if (likely(__pyx_t_2)) {
11566 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
11567 __Pyx_INCREF(__pyx_t_2);
11568 __Pyx_INCREF(
function);
11569 __Pyx_DECREF_SET(__pyx_t_3,
function);
11572 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
11573 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11574 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1386, __pyx_L1_error)
11575 __Pyx_GOTREF(__pyx_t_1);
11576 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11577 __pyx_r = __pyx_t_1;
11591 __Pyx_XDECREF(__pyx_t_1);
11592 __Pyx_XDECREF(__pyx_t_2);
11593 __Pyx_XDECREF(__pyx_t_3);
11594 __Pyx_AddTraceback(
"PyClical.pure", __pyx_clineno, __pyx_lineno, __pyx_filename);
11597 __Pyx_XGIVEREF(__pyx_r);
11598 __Pyx_RefNannyFinishContext();
11603 static PyObject *__pyx_pw_8PyClical_19pure(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11604 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 ";
11605 static PyObject *__pyx_pw_8PyClical_19pure(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11606 PyObject *__pyx_r = 0;
11607 __Pyx_RefNannyDeclarations
11608 __Pyx_RefNannySetupContext(
"pure (wrapper)", 0);
11609 __pyx_r = __pyx_pf_8PyClical_18pure(__pyx_self, ((PyObject *)__pyx_v_obj));
11612 __Pyx_RefNannyFinishContext();
11616 static PyObject *__pyx_pf_8PyClical_18pure(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11617 PyObject *__pyx_r = NULL;
11618 __Pyx_RefNannyDeclarations
11619 PyObject *__pyx_t_1 = NULL;
11620 __Pyx_RefNannySetupContext(
"pure", 0);
11621 __Pyx_XDECREF(__pyx_r);
11622 __pyx_t_1 = __pyx_f_8PyClical_pure(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1377, __pyx_L1_error)
11623 __Pyx_GOTREF(__pyx_t_1);
11624 __pyx_r = __pyx_t_1;
11630 __Pyx_XDECREF(__pyx_t_1);
11631 __Pyx_AddTraceback(
"PyClical.pure", __pyx_clineno, __pyx_lineno, __pyx_filename);
11634 __Pyx_XGIVEREF(__pyx_r);
11635 __Pyx_RefNannyFinishContext();
11647 static PyObject *__pyx_pw_8PyClical_21even(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11648 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_even(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11649 PyObject *__pyx_r = NULL;
11650 __Pyx_RefNannyDeclarations
11651 PyObject *__pyx_t_1 = NULL;
11652 PyObject *__pyx_t_2 = NULL;
11653 PyObject *__pyx_t_3 = NULL;
11654 __Pyx_RefNannySetupContext(
"even", 0);
11663 __Pyx_XDECREF(__pyx_r);
11664 __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)
11665 __Pyx_GOTREF(__pyx_t_2);
11666 __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)
11667 __Pyx_GOTREF(__pyx_t_3);
11668 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11670 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11671 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11672 if (likely(__pyx_t_2)) {
11673 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
11674 __Pyx_INCREF(__pyx_t_2);
11675 __Pyx_INCREF(
function);
11676 __Pyx_DECREF_SET(__pyx_t_3,
function);
11679 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
11680 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11681 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1395, __pyx_L1_error)
11682 __Pyx_GOTREF(__pyx_t_1);
11683 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11684 __pyx_r = __pyx_t_1;
11698 __Pyx_XDECREF(__pyx_t_1);
11699 __Pyx_XDECREF(__pyx_t_2);
11700 __Pyx_XDECREF(__pyx_t_3);
11701 __Pyx_AddTraceback(
"PyClical.even", __pyx_clineno, __pyx_lineno, __pyx_filename);
11704 __Pyx_XGIVEREF(__pyx_r);
11705 __Pyx_RefNannyFinishContext();
11710 static PyObject *__pyx_pw_8PyClical_21even(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11711 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 ";
11712 static PyObject *__pyx_pw_8PyClical_21even(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11713 PyObject *__pyx_r = 0;
11714 __Pyx_RefNannyDeclarations
11715 __Pyx_RefNannySetupContext(
"even (wrapper)", 0);
11716 __pyx_r = __pyx_pf_8PyClical_20even(__pyx_self, ((PyObject *)__pyx_v_obj));
11719 __Pyx_RefNannyFinishContext();
11723 static PyObject *__pyx_pf_8PyClical_20even(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11724 PyObject *__pyx_r = NULL;
11725 __Pyx_RefNannyDeclarations
11726 PyObject *__pyx_t_1 = NULL;
11727 __Pyx_RefNannySetupContext(
"even", 0);
11728 __Pyx_XDECREF(__pyx_r);
11729 __pyx_t_1 = __pyx_f_8PyClical_even(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1388, __pyx_L1_error)
11730 __Pyx_GOTREF(__pyx_t_1);
11731 __pyx_r = __pyx_t_1;
11737 __Pyx_XDECREF(__pyx_t_1);
11738 __Pyx_AddTraceback(
"PyClical.even", __pyx_clineno, __pyx_lineno, __pyx_filename);
11741 __Pyx_XGIVEREF(__pyx_r);
11742 __Pyx_RefNannyFinishContext();
11754 static PyObject *__pyx_pw_8PyClical_23odd(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11755 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_odd(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11756 PyObject *__pyx_r = NULL;
11757 __Pyx_RefNannyDeclarations
11758 PyObject *__pyx_t_1 = NULL;
11759 PyObject *__pyx_t_2 = NULL;
11760 PyObject *__pyx_t_3 = NULL;
11761 __Pyx_RefNannySetupContext(
"odd", 0);
11770 __Pyx_XDECREF(__pyx_r);
11771 __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)
11772 __Pyx_GOTREF(__pyx_t_2);
11773 __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)
11774 __Pyx_GOTREF(__pyx_t_3);
11775 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11777 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11778 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11779 if (likely(__pyx_t_2)) {
11780 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
11781 __Pyx_INCREF(__pyx_t_2);
11782 __Pyx_INCREF(
function);
11783 __Pyx_DECREF_SET(__pyx_t_3,
function);
11786 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
11787 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11788 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1404, __pyx_L1_error)
11789 __Pyx_GOTREF(__pyx_t_1);
11790 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11791 __pyx_r = __pyx_t_1;
11805 __Pyx_XDECREF(__pyx_t_1);
11806 __Pyx_XDECREF(__pyx_t_2);
11807 __Pyx_XDECREF(__pyx_t_3);
11808 __Pyx_AddTraceback(
"PyClical.odd", __pyx_clineno, __pyx_lineno, __pyx_filename);
11811 __Pyx_XGIVEREF(__pyx_r);
11812 __Pyx_RefNannyFinishContext();
11817 static PyObject *__pyx_pw_8PyClical_23odd(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11818 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 ";
11819 static PyObject *__pyx_pw_8PyClical_23odd(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11820 PyObject *__pyx_r = 0;
11821 __Pyx_RefNannyDeclarations
11822 __Pyx_RefNannySetupContext(
"odd (wrapper)", 0);
11823 __pyx_r = __pyx_pf_8PyClical_22odd(__pyx_self, ((PyObject *)__pyx_v_obj));
11826 __Pyx_RefNannyFinishContext();
11830 static PyObject *__pyx_pf_8PyClical_22odd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11831 PyObject *__pyx_r = NULL;
11832 __Pyx_RefNannyDeclarations
11833 PyObject *__pyx_t_1 = NULL;
11834 __Pyx_RefNannySetupContext(
"odd", 0);
11835 __Pyx_XDECREF(__pyx_r);
11836 __pyx_t_1 = __pyx_f_8PyClical_odd(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1397, __pyx_L1_error)
11837 __Pyx_GOTREF(__pyx_t_1);
11838 __pyx_r = __pyx_t_1;
11844 __Pyx_XDECREF(__pyx_t_1);
11845 __Pyx_AddTraceback(
"PyClical.odd", __pyx_clineno, __pyx_lineno, __pyx_filename);
11848 __Pyx_XGIVEREF(__pyx_r);
11849 __Pyx_RefNannyFinishContext();
11861 static PyObject *__pyx_pw_8PyClical_25involute(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11862 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_involute(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11863 PyObject *__pyx_r = NULL;
11864 __Pyx_RefNannyDeclarations
11865 PyObject *__pyx_t_1 = NULL;
11866 PyObject *__pyx_t_2 = NULL;
11867 PyObject *__pyx_t_3 = NULL;
11868 __Pyx_RefNannySetupContext(
"involute", 0);
11877 __Pyx_XDECREF(__pyx_r);
11878 __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)
11879 __Pyx_GOTREF(__pyx_t_2);
11880 __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)
11881 __Pyx_GOTREF(__pyx_t_3);
11882 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11884 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11885 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11886 if (likely(__pyx_t_2)) {
11887 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
11888 __Pyx_INCREF(__pyx_t_2);
11889 __Pyx_INCREF(
function);
11890 __Pyx_DECREF_SET(__pyx_t_3,
function);
11893 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
11894 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11895 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1419, __pyx_L1_error)
11896 __Pyx_GOTREF(__pyx_t_1);
11897 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11898 __pyx_r = __pyx_t_1;
11912 __Pyx_XDECREF(__pyx_t_1);
11913 __Pyx_XDECREF(__pyx_t_2);
11914 __Pyx_XDECREF(__pyx_t_3);
11915 __Pyx_AddTraceback(
"PyClical.involute", __pyx_clineno, __pyx_lineno, __pyx_filename);
11918 __Pyx_XGIVEREF(__pyx_r);
11919 __Pyx_RefNannyFinishContext();
11924 static PyObject *__pyx_pw_8PyClical_25involute(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11925 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 ";
11926 static PyObject *__pyx_pw_8PyClical_25involute(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11927 PyObject *__pyx_r = 0;
11928 __Pyx_RefNannyDeclarations
11929 __Pyx_RefNannySetupContext(
"involute (wrapper)", 0);
11930 __pyx_r = __pyx_pf_8PyClical_24involute(__pyx_self, ((PyObject *)__pyx_v_obj));
11933 __Pyx_RefNannyFinishContext();
11937 static PyObject *__pyx_pf_8PyClical_24involute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11938 PyObject *__pyx_r = NULL;
11939 __Pyx_RefNannyDeclarations
11940 PyObject *__pyx_t_1 = NULL;
11941 __Pyx_RefNannySetupContext(
"involute", 0);
11942 __Pyx_XDECREF(__pyx_r);
11943 __pyx_t_1 = __pyx_f_8PyClical_involute(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1406, __pyx_L1_error)
11944 __Pyx_GOTREF(__pyx_t_1);
11945 __pyx_r = __pyx_t_1;
11951 __Pyx_XDECREF(__pyx_t_1);
11952 __Pyx_AddTraceback(
"PyClical.involute", __pyx_clineno, __pyx_lineno, __pyx_filename);
11955 __Pyx_XGIVEREF(__pyx_r);
11956 __Pyx_RefNannyFinishContext();
11968 static PyObject *__pyx_pw_8PyClical_27reverse(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11969 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_reverse(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11970 PyObject *__pyx_r = NULL;
11971 __Pyx_RefNannyDeclarations
11972 PyObject *__pyx_t_1 = NULL;
11973 PyObject *__pyx_t_2 = NULL;
11974 PyObject *__pyx_t_3 = NULL;
11975 __Pyx_RefNannySetupContext(
"reverse", 0);
11984 __Pyx_XDECREF(__pyx_r);
11985 __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)
11986 __Pyx_GOTREF(__pyx_t_2);
11987 __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)
11988 __Pyx_GOTREF(__pyx_t_3);
11989 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11991 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11992 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11993 if (likely(__pyx_t_2)) {
11994 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
11995 __Pyx_INCREF(__pyx_t_2);
11996 __Pyx_INCREF(
function);
11997 __Pyx_DECREF_SET(__pyx_t_3,
function);
12000 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
12001 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12002 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1434, __pyx_L1_error)
12003 __Pyx_GOTREF(__pyx_t_1);
12004 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12005 __pyx_r = __pyx_t_1;
12019 __Pyx_XDECREF(__pyx_t_1);
12020 __Pyx_XDECREF(__pyx_t_2);
12021 __Pyx_XDECREF(__pyx_t_3);
12022 __Pyx_AddTraceback(
"PyClical.reverse", __pyx_clineno, __pyx_lineno, __pyx_filename);
12025 __Pyx_XGIVEREF(__pyx_r);
12026 __Pyx_RefNannyFinishContext();
12031 static PyObject *__pyx_pw_8PyClical_27reverse(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12032 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 ";
12033 static PyObject *__pyx_pw_8PyClical_27reverse(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12034 PyObject *__pyx_r = 0;
12035 __Pyx_RefNannyDeclarations
12036 __Pyx_RefNannySetupContext(
"reverse (wrapper)", 0);
12037 __pyx_r = __pyx_pf_8PyClical_26reverse(__pyx_self, ((PyObject *)__pyx_v_obj));
12040 __Pyx_RefNannyFinishContext();
12044 static PyObject *__pyx_pf_8PyClical_26reverse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12045 PyObject *__pyx_r = NULL;
12046 __Pyx_RefNannyDeclarations
12047 PyObject *__pyx_t_1 = NULL;
12048 __Pyx_RefNannySetupContext(
"reverse", 0);
12049 __Pyx_XDECREF(__pyx_r);
12050 __pyx_t_1 = __pyx_f_8PyClical_reverse(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1421, __pyx_L1_error)
12051 __Pyx_GOTREF(__pyx_t_1);
12052 __pyx_r = __pyx_t_1;
12058 __Pyx_XDECREF(__pyx_t_1);
12059 __Pyx_AddTraceback(
"PyClical.reverse", __pyx_clineno, __pyx_lineno, __pyx_filename);
12062 __Pyx_XGIVEREF(__pyx_r);
12063 __Pyx_RefNannyFinishContext();
12075 static PyObject *__pyx_pw_8PyClical_29conj(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12076 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_conj(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12077 PyObject *__pyx_r = NULL;
12078 __Pyx_RefNannyDeclarations
12079 PyObject *__pyx_t_1 = NULL;
12080 PyObject *__pyx_t_2 = NULL;
12081 PyObject *__pyx_t_3 = NULL;
12082 __Pyx_RefNannySetupContext(
"conj", 0);
12091 __Pyx_XDECREF(__pyx_r);
12092 __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)
12093 __Pyx_GOTREF(__pyx_t_2);
12094 __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)
12095 __Pyx_GOTREF(__pyx_t_3);
12096 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12098 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
12099 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
12100 if (likely(__pyx_t_2)) {
12101 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
12102 __Pyx_INCREF(__pyx_t_2);
12103 __Pyx_INCREF(
function);
12104 __Pyx_DECREF_SET(__pyx_t_3,
function);
12107 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
12108 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12109 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1449, __pyx_L1_error)
12110 __Pyx_GOTREF(__pyx_t_1);
12111 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12112 __pyx_r = __pyx_t_1;
12126 __Pyx_XDECREF(__pyx_t_1);
12127 __Pyx_XDECREF(__pyx_t_2);
12128 __Pyx_XDECREF(__pyx_t_3);
12129 __Pyx_AddTraceback(
"PyClical.conj", __pyx_clineno, __pyx_lineno, __pyx_filename);
12132 __Pyx_XGIVEREF(__pyx_r);
12133 __Pyx_RefNannyFinishContext();
12138 static PyObject *__pyx_pw_8PyClical_29conj(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12139 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 ";
12140 static PyObject *__pyx_pw_8PyClical_29conj(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12141 PyObject *__pyx_r = 0;
12142 __Pyx_RefNannyDeclarations
12143 __Pyx_RefNannySetupContext(
"conj (wrapper)", 0);
12144 __pyx_r = __pyx_pf_8PyClical_28conj(__pyx_self, ((PyObject *)__pyx_v_obj));
12147 __Pyx_RefNannyFinishContext();
12151 static PyObject *__pyx_pf_8PyClical_28conj(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12152 PyObject *__pyx_r = NULL;
12153 __Pyx_RefNannyDeclarations
12154 PyObject *__pyx_t_1 = NULL;
12155 __Pyx_RefNannySetupContext(
"conj", 0);
12156 __Pyx_XDECREF(__pyx_r);
12157 __pyx_t_1 = __pyx_f_8PyClical_conj(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1436, __pyx_L1_error)
12158 __Pyx_GOTREF(__pyx_t_1);
12159 __pyx_r = __pyx_t_1;
12165 __Pyx_XDECREF(__pyx_t_1);
12166 __Pyx_AddTraceback(
"PyClical.conj", __pyx_clineno, __pyx_lineno, __pyx_filename);
12169 __Pyx_XGIVEREF(__pyx_r);
12170 __Pyx_RefNannyFinishContext();
12182 static PyObject *__pyx_pw_8PyClical_31quad(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12183 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_quad(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12184 PyObject *__pyx_r = NULL;
12185 __Pyx_RefNannyDeclarations
12186 PyObject *__pyx_t_1 = NULL;
12187 PyObject *__pyx_t_2 = NULL;
12188 PyObject *__pyx_t_3 = NULL;
12189 __Pyx_RefNannySetupContext(
"quad", 0);
12198 __Pyx_XDECREF(__pyx_r);
12199 __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)
12200 __Pyx_GOTREF(__pyx_t_2);
12201 __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)
12202 __Pyx_GOTREF(__pyx_t_3);
12203 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12205 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
12206 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
12207 if (likely(__pyx_t_2)) {
12208 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
12209 __Pyx_INCREF(__pyx_t_2);
12210 __Pyx_INCREF(
function);
12211 __Pyx_DECREF_SET(__pyx_t_3,
function);
12214 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
12215 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12216 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1460, __pyx_L1_error)
12217 __Pyx_GOTREF(__pyx_t_1);
12218 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12219 __pyx_r = __pyx_t_1;
12233 __Pyx_XDECREF(__pyx_t_1);
12234 __Pyx_XDECREF(__pyx_t_2);
12235 __Pyx_XDECREF(__pyx_t_3);
12236 __Pyx_AddTraceback(
"PyClical.quad", __pyx_clineno, __pyx_lineno, __pyx_filename);
12239 __Pyx_XGIVEREF(__pyx_r);
12240 __Pyx_RefNannyFinishContext();
12245 static PyObject *__pyx_pw_8PyClical_31quad(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12246 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 ";
12247 static PyObject *__pyx_pw_8PyClical_31quad(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12248 PyObject *__pyx_r = 0;
12249 __Pyx_RefNannyDeclarations
12250 __Pyx_RefNannySetupContext(
"quad (wrapper)", 0);
12251 __pyx_r = __pyx_pf_8PyClical_30quad(__pyx_self, ((PyObject *)__pyx_v_obj));
12254 __Pyx_RefNannyFinishContext();
12258 static PyObject *__pyx_pf_8PyClical_30quad(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12259 PyObject *__pyx_r = NULL;
12260 __Pyx_RefNannyDeclarations
12261 PyObject *__pyx_t_1 = NULL;
12262 __Pyx_RefNannySetupContext(
"quad", 0);
12263 __Pyx_XDECREF(__pyx_r);
12264 __pyx_t_1 = __pyx_f_8PyClical_quad(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1451, __pyx_L1_error)
12265 __Pyx_GOTREF(__pyx_t_1);
12266 __pyx_r = __pyx_t_1;
12272 __Pyx_XDECREF(__pyx_t_1);
12273 __Pyx_AddTraceback(
"PyClical.quad", __pyx_clineno, __pyx_lineno, __pyx_filename);
12276 __Pyx_XGIVEREF(__pyx_r);
12277 __Pyx_RefNannyFinishContext();
12289 static PyObject *__pyx_pw_8PyClical_33norm(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12290 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_norm(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12291 PyObject *__pyx_r = NULL;
12292 __Pyx_RefNannyDeclarations
12293 PyObject *__pyx_t_1 = NULL;
12294 PyObject *__pyx_t_2 = NULL;
12295 PyObject *__pyx_t_3 = NULL;
12296 __Pyx_RefNannySetupContext(
"norm", 0);
12305 __Pyx_XDECREF(__pyx_r);
12306 __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)
12307 __Pyx_GOTREF(__pyx_t_2);
12308 __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)
12309 __Pyx_GOTREF(__pyx_t_3);
12310 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12312 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
12313 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
12314 if (likely(__pyx_t_2)) {
12315 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
12316 __Pyx_INCREF(__pyx_t_2);
12317 __Pyx_INCREF(
function);
12318 __Pyx_DECREF_SET(__pyx_t_3,
function);
12321 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
12322 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12323 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1471, __pyx_L1_error)
12324 __Pyx_GOTREF(__pyx_t_1);
12325 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12326 __pyx_r = __pyx_t_1;
12340 __Pyx_XDECREF(__pyx_t_1);
12341 __Pyx_XDECREF(__pyx_t_2);
12342 __Pyx_XDECREF(__pyx_t_3);
12343 __Pyx_AddTraceback(
"PyClical.norm", __pyx_clineno, __pyx_lineno, __pyx_filename);
12346 __Pyx_XGIVEREF(__pyx_r);
12347 __Pyx_RefNannyFinishContext();
12352 static PyObject *__pyx_pw_8PyClical_33norm(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12353 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 ";
12354 static PyObject *__pyx_pw_8PyClical_33norm(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12355 PyObject *__pyx_r = 0;
12356 __Pyx_RefNannyDeclarations
12357 __Pyx_RefNannySetupContext(
"norm (wrapper)", 0);
12358 __pyx_r = __pyx_pf_8PyClical_32norm(__pyx_self, ((PyObject *)__pyx_v_obj));
12361 __Pyx_RefNannyFinishContext();
12365 static PyObject *__pyx_pf_8PyClical_32norm(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12366 PyObject *__pyx_r = NULL;
12367 __Pyx_RefNannyDeclarations
12368 PyObject *__pyx_t_1 = NULL;
12369 __Pyx_RefNannySetupContext(
"norm", 0);
12370 __Pyx_XDECREF(__pyx_r);
12371 __pyx_t_1 = __pyx_f_8PyClical_norm(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1462, __pyx_L1_error)
12372 __Pyx_GOTREF(__pyx_t_1);
12373 __pyx_r = __pyx_t_1;
12379 __Pyx_XDECREF(__pyx_t_1);
12380 __Pyx_AddTraceback(
"PyClical.norm", __pyx_clineno, __pyx_lineno, __pyx_filename);
12383 __Pyx_XGIVEREF(__pyx_r);
12384 __Pyx_RefNannyFinishContext();
12396 static PyObject *__pyx_pw_8PyClical_35abs(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12397 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_abs(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12398 PyObject *__pyx_r = NULL;
12399 __Pyx_RefNannyDeclarations
12400 PyObject *__pyx_t_1 = NULL;
12401 __Pyx_RefNannySetupContext(
"abs", 0);
12410 __Pyx_XDECREF(__pyx_r);
12411 __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)
12412 __Pyx_GOTREF(__pyx_t_1);
12413 __pyx_r = __pyx_t_1;
12427 __Pyx_XDECREF(__pyx_t_1);
12428 __Pyx_AddTraceback(
"PyClical.abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
12431 __Pyx_XGIVEREF(__pyx_r);
12432 __Pyx_RefNannyFinishContext();
12437 static PyObject *__pyx_pw_8PyClical_35abs(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12438 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 ";
12439 static PyObject *__pyx_pw_8PyClical_35abs(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12440 PyObject *__pyx_r = 0;
12441 __Pyx_RefNannyDeclarations
12442 __Pyx_RefNannySetupContext(
"abs (wrapper)", 0);
12443 __pyx_r = __pyx_pf_8PyClical_34abs(__pyx_self, ((PyObject *)__pyx_v_obj));
12446 __Pyx_RefNannyFinishContext();
12450 static PyObject *__pyx_pf_8PyClical_34abs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12451 PyObject *__pyx_r = NULL;
12452 __Pyx_RefNannyDeclarations
12453 PyObject *__pyx_t_1 = NULL;
12454 __Pyx_RefNannySetupContext(
"abs", 0);
12455 __Pyx_XDECREF(__pyx_r);
12456 __pyx_t_1 = __pyx_f_8PyClical_abs(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1473, __pyx_L1_error)
12457 __Pyx_GOTREF(__pyx_t_1);
12458 __pyx_r = __pyx_t_1;
12464 __Pyx_XDECREF(__pyx_t_1);
12465 __Pyx_AddTraceback(
"PyClical.abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
12468 __Pyx_XGIVEREF(__pyx_r);
12469 __Pyx_RefNannyFinishContext();
12481 static PyObject *__pyx_pw_8PyClical_37max_abs(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12482 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_max_abs(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12483 PyObject *__pyx_r = NULL;
12484 __Pyx_RefNannyDeclarations
12485 PyObject *__pyx_t_1 = NULL;
12486 __Pyx_RefNannySetupContext(
"max_abs", 0);
12495 __Pyx_XDECREF(__pyx_r);
12496 __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)
12497 __Pyx_GOTREF(__pyx_t_1);
12498 __pyx_r = __pyx_t_1;
12512 __Pyx_XDECREF(__pyx_t_1);
12513 __Pyx_AddTraceback(
"PyClical.max_abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
12516 __Pyx_XGIVEREF(__pyx_r);
12517 __Pyx_RefNannyFinishContext();
12522 static PyObject *__pyx_pw_8PyClical_37max_abs(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12523 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 ";
12524 static PyObject *__pyx_pw_8PyClical_37max_abs(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12525 PyObject *__pyx_r = 0;
12526 __Pyx_RefNannyDeclarations
12527 __Pyx_RefNannySetupContext(
"max_abs (wrapper)", 0);
12528 __pyx_r = __pyx_pf_8PyClical_36max_abs(__pyx_self, ((PyObject *)__pyx_v_obj));
12531 __Pyx_RefNannyFinishContext();
12535 static PyObject *__pyx_pf_8PyClical_36max_abs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12536 PyObject *__pyx_r = NULL;
12537 __Pyx_RefNannyDeclarations
12538 PyObject *__pyx_t_1 = NULL;
12539 __Pyx_RefNannySetupContext(
"max_abs", 0);
12540 __Pyx_XDECREF(__pyx_r);
12541 __pyx_t_1 = __pyx_f_8PyClical_max_abs(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1482, __pyx_L1_error)
12542 __Pyx_GOTREF(__pyx_t_1);
12543 __pyx_r = __pyx_t_1;
12549 __Pyx_XDECREF(__pyx_t_1);
12550 __Pyx_AddTraceback(
"PyClical.max_abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
12553 __Pyx_XGIVEREF(__pyx_r);
12554 __Pyx_RefNannyFinishContext();
12566 static PyObject *__pyx_pw_8PyClical_39pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
12567 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_pow(PyObject *__pyx_v_obj, PyObject *__pyx_v_m, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12568 PyObject *__pyx_r = NULL;
12569 __Pyx_RefNannyDeclarations
12570 PyObject *__pyx_t_1 = NULL;
12571 PyObject *__pyx_t_2 = NULL;
12572 PyObject *__pyx_t_3 = NULL;
12573 PyObject *__pyx_t_4 = NULL;
12574 PyObject *__pyx_t_5 = NULL;
12575 PyObject *__pyx_t_6 = NULL;
12577 PyObject *__pyx_t_8 = NULL;
12578 PyObject *__pyx_t_9 = NULL;
12579 PyObject *__pyx_t_10 = NULL;
12580 __Pyx_RefNannySetupContext(
"pow", 0);
12590 __Pyx_PyThreadState_declare
12591 __Pyx_PyThreadState_assign
12592 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
12593 __Pyx_XGOTREF(__pyx_t_1);
12594 __Pyx_XGOTREF(__pyx_t_2);
12595 __Pyx_XGOTREF(__pyx_t_3);
12605 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1514, __pyx_L3_error)
12606 __Pyx_GOTREF(__pyx_t_5);
12607 __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)
12608 __Pyx_GOTREF(__pyx_t_6);
12609 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12612 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
12613 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
12614 if (likely(__pyx_t_5)) {
12615 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
12616 __Pyx_INCREF(__pyx_t_5);
12617 __Pyx_INCREF(
function);
12618 __Pyx_DECREF_SET(__pyx_t_6,
function);
12622 #if CYTHON_FAST_PYCALL 12623 if (PyFunction_Check(__pyx_t_6)) {
12624 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_obj, __pyx_v_m};
12625 __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)
12626 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12627 __Pyx_GOTREF(__pyx_t_4);
12630 #if CYTHON_FAST_PYCCALL 12631 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
12632 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_obj, __pyx_v_m};
12633 __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)
12634 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12635 __Pyx_GOTREF(__pyx_t_4);
12639 __pyx_t_8 = PyTuple_New(2+__pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1514, __pyx_L3_error)
12640 __Pyx_GOTREF(__pyx_t_8);
12642 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
12644 __Pyx_INCREF(__pyx_v_obj);
12645 __Pyx_GIVEREF(__pyx_v_obj);
12646 PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_obj);
12647 __Pyx_INCREF(__pyx_v_m);
12648 __Pyx_GIVEREF(__pyx_v_m);
12649 PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_m);
12650 __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)
12651 __Pyx_GOTREF(__pyx_t_4);
12652 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12654 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12655 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12665 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12666 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12667 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12668 goto __pyx_L8_try_end;
12670 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12671 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12672 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12673 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
12683 __Pyx_AddTraceback(
"PyClical.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
12684 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_8) < 0) __PYX_ERR(0, 1515, __pyx_L5_except_error)
12685 __Pyx_GOTREF(__pyx_t_4);
12686 __Pyx_GOTREF(__pyx_t_6);
12687 __Pyx_GOTREF(__pyx_t_8);
12696 __Pyx_XDECREF(__pyx_r);
12697 __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)
12698 __Pyx_GOTREF(__pyx_t_9);
12699 __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)
12700 __Pyx_GOTREF(__pyx_t_10);
12701 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12703 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
12704 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
12705 if (likely(__pyx_t_9)) {
12706 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_10);
12707 __Pyx_INCREF(__pyx_t_9);
12708 __Pyx_INCREF(
function);
12709 __Pyx_DECREF_SET(__pyx_t_10,
function);
12712 __pyx_t_5 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_9, __pyx_v_m) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_m);
12713 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
12714 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1516, __pyx_L5_except_error)
12715 __Pyx_GOTREF(__pyx_t_5);
12716 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12717 __pyx_r = __pyx_t_5;
12719 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12720 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12721 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12722 goto __pyx_L6_except_return;
12724 __pyx_L5_except_error:;
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);
12737 goto __pyx_L1_error;
12738 __pyx_L6_except_return:;
12739 __Pyx_XGIVEREF(__pyx_t_1);
12740 __Pyx_XGIVEREF(__pyx_t_2);
12741 __Pyx_XGIVEREF(__pyx_t_3);
12742 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
12756 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12759 __Pyx_XDECREF(__pyx_t_4);
12760 __Pyx_XDECREF(__pyx_t_5);
12761 __Pyx_XDECREF(__pyx_t_6);
12762 __Pyx_XDECREF(__pyx_t_8);
12763 __Pyx_XDECREF(__pyx_t_9);
12764 __Pyx_XDECREF(__pyx_t_10);
12765 __Pyx_AddTraceback(
"PyClical.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
12768 __Pyx_XGIVEREF(__pyx_r);
12769 __Pyx_RefNannyFinishContext();
12774 static PyObject *__pyx_pw_8PyClical_39pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
12775 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 ";
12776 static PyObject *__pyx_pw_8PyClical_39pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
12777 PyObject *__pyx_v_obj = 0;
12778 PyObject *__pyx_v_m = 0;
12779 PyObject *__pyx_r = 0;
12780 __Pyx_RefNannyDeclarations
12781 __Pyx_RefNannySetupContext(
"pow (wrapper)", 0);
12783 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_m,0};
12784 PyObject* values[2] = {0,0};
12785 if (unlikely(__pyx_kwds)) {
12786 Py_ssize_t kw_args;
12787 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
12788 switch (pos_args) {
12789 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12790 CYTHON_FALLTHROUGH;
12791 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12792 CYTHON_FALLTHROUGH;
12794 default:
goto __pyx_L5_argtuple_error;
12796 kw_args = PyDict_Size(__pyx_kwds);
12797 switch (pos_args) {
12799 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
12800 else goto __pyx_L5_argtuple_error;
12801 CYTHON_FALLTHROUGH;
12803 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
12805 __Pyx_RaiseArgtupleInvalid(
"pow", 1, 2, 2, 1); __PYX_ERR(0, 1494, __pyx_L3_error)
12808 if (unlikely(kw_args > 0)) {
12809 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"pow") < 0)) __PYX_ERR(0, 1494, __pyx_L3_error)
12811 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
12812 goto __pyx_L5_argtuple_error;
12814 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12815 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12817 __pyx_v_obj = values[0];
12818 __pyx_v_m = values[1];
12820 goto __pyx_L4_argument_unpacking_done;
12821 __pyx_L5_argtuple_error:;
12822 __Pyx_RaiseArgtupleInvalid(
"pow", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1494, __pyx_L3_error)
12824 __Pyx_AddTraceback(
"PyClical.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
12825 __Pyx_RefNannyFinishContext();
12827 __pyx_L4_argument_unpacking_done:;
12828 __pyx_r = __pyx_pf_8PyClical_38pow(__pyx_self, __pyx_v_obj, __pyx_v_m);
12831 __Pyx_RefNannyFinishContext();
12835 static PyObject *__pyx_pf_8PyClical_38pow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_m) {
12836 PyObject *__pyx_r = NULL;
12837 __Pyx_RefNannyDeclarations
12838 PyObject *__pyx_t_1 = NULL;
12839 __Pyx_RefNannySetupContext(
"pow", 0);
12840 __Pyx_XDECREF(__pyx_r);
12841 __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)
12842 __Pyx_GOTREF(__pyx_t_1);
12843 __pyx_r = __pyx_t_1;
12849 __Pyx_XDECREF(__pyx_t_1);
12850 __Pyx_AddTraceback(
"PyClical.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
12853 __Pyx_XGIVEREF(__pyx_r);
12854 __Pyx_RefNannyFinishContext();
12866 static PyObject *__pyx_pw_8PyClical_41outer_pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
12867 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_outer_pow(PyObject *__pyx_v_obj, PyObject *__pyx_v_m, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12868 PyObject *__pyx_r = NULL;
12869 __Pyx_RefNannyDeclarations
12870 PyObject *__pyx_t_1 = NULL;
12871 PyObject *__pyx_t_2 = NULL;
12872 PyObject *__pyx_t_3 = NULL;
12873 __Pyx_RefNannySetupContext(
"outer_pow", 0);
12882 __Pyx_XDECREF(__pyx_r);
12883 __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)
12884 __Pyx_GOTREF(__pyx_t_2);
12885 __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)
12886 __Pyx_GOTREF(__pyx_t_3);
12887 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12889 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
12890 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
12891 if (likely(__pyx_t_2)) {
12892 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
12893 __Pyx_INCREF(__pyx_t_2);
12894 __Pyx_INCREF(
function);
12895 __Pyx_DECREF_SET(__pyx_t_3,
function);
12898 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_m) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_m);
12899 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12900 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1525, __pyx_L1_error)
12901 __Pyx_GOTREF(__pyx_t_1);
12902 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12903 __pyx_r = __pyx_t_1;
12917 __Pyx_XDECREF(__pyx_t_1);
12918 __Pyx_XDECREF(__pyx_t_2);
12919 __Pyx_XDECREF(__pyx_t_3);
12920 __Pyx_AddTraceback(
"PyClical.outer_pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
12923 __Pyx_XGIVEREF(__pyx_r);
12924 __Pyx_RefNannyFinishContext();
12929 static PyObject *__pyx_pw_8PyClical_41outer_pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
12930 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 ";
12931 static PyObject *__pyx_pw_8PyClical_41outer_pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
12932 PyObject *__pyx_v_obj = 0;
12933 PyObject *__pyx_v_m = 0;
12934 PyObject *__pyx_r = 0;
12935 __Pyx_RefNannyDeclarations
12936 __Pyx_RefNannySetupContext(
"outer_pow (wrapper)", 0);
12938 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_m,0};
12939 PyObject* values[2] = {0,0};
12940 if (unlikely(__pyx_kwds)) {
12941 Py_ssize_t kw_args;
12942 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
12943 switch (pos_args) {
12944 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12945 CYTHON_FALLTHROUGH;
12946 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12947 CYTHON_FALLTHROUGH;
12949 default:
goto __pyx_L5_argtuple_error;
12951 kw_args = PyDict_Size(__pyx_kwds);
12952 switch (pos_args) {
12954 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
12955 else goto __pyx_L5_argtuple_error;
12956 CYTHON_FALLTHROUGH;
12958 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
12960 __Pyx_RaiseArgtupleInvalid(
"outer_pow", 1, 2, 2, 1); __PYX_ERR(0, 1518, __pyx_L3_error)
12963 if (unlikely(kw_args > 0)) {
12964 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"outer_pow") < 0)) __PYX_ERR(0, 1518, __pyx_L3_error)
12966 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
12967 goto __pyx_L5_argtuple_error;
12969 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12970 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12972 __pyx_v_obj = values[0];
12973 __pyx_v_m = values[1];
12975 goto __pyx_L4_argument_unpacking_done;
12976 __pyx_L5_argtuple_error:;
12977 __Pyx_RaiseArgtupleInvalid(
"outer_pow", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1518, __pyx_L3_error)
12979 __Pyx_AddTraceback(
"PyClical.outer_pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
12980 __Pyx_RefNannyFinishContext();
12982 __pyx_L4_argument_unpacking_done:;
12983 __pyx_r = __pyx_pf_8PyClical_40outer_pow(__pyx_self, __pyx_v_obj, __pyx_v_m);
12986 __Pyx_RefNannyFinishContext();
12990 static PyObject *__pyx_pf_8PyClical_40outer_pow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_m) {
12991 PyObject *__pyx_r = NULL;
12992 __Pyx_RefNannyDeclarations
12993 PyObject *__pyx_t_1 = NULL;
12994 __Pyx_RefNannySetupContext(
"outer_pow", 0);
12995 __Pyx_XDECREF(__pyx_r);
12996 __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)
12997 __Pyx_GOTREF(__pyx_t_1);
12998 __pyx_r = __pyx_t_1;
13004 __Pyx_XDECREF(__pyx_t_1);
13005 __Pyx_AddTraceback(
"PyClical.outer_pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
13008 __Pyx_XGIVEREF(__pyx_r);
13009 __Pyx_RefNannyFinishContext();
13021 static PyObject *__pyx_pw_8PyClical_43complexifier(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13022 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_complexifier(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
13023 PyObject *__pyx_r = NULL;
13024 __Pyx_RefNannyDeclarations
13025 PyObject *__pyx_t_1 = NULL;
13026 PyObject *__pyx_t_2 = NULL;
13027 __Pyx_RefNannySetupContext(
"complexifier", 0);
13036 __Pyx_XDECREF(__pyx_r);
13037 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1540, __pyx_L1_error)
13038 __Pyx_GOTREF(__pyx_t_1);
13039 __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)
13040 __Pyx_GOTREF(__pyx_t_2);
13041 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13042 __pyx_r = __pyx_t_2;
13056 __Pyx_XDECREF(__pyx_t_1);
13057 __Pyx_XDECREF(__pyx_t_2);
13058 __Pyx_AddTraceback(
"PyClical.complexifier", __pyx_clineno, __pyx_lineno, __pyx_filename);
13061 __Pyx_XGIVEREF(__pyx_r);
13062 __Pyx_RefNannyFinishContext();
13067 static PyObject *__pyx_pw_8PyClical_43complexifier(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13068 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 ";
13069 static PyObject *__pyx_pw_8PyClical_43complexifier(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13070 PyObject *__pyx_r = 0;
13071 __Pyx_RefNannyDeclarations
13072 __Pyx_RefNannySetupContext(
"complexifier (wrapper)", 0);
13073 __pyx_r = __pyx_pf_8PyClical_42complexifier(__pyx_self, ((PyObject *)__pyx_v_obj));
13076 __Pyx_RefNannyFinishContext();
13080 static PyObject *__pyx_pf_8PyClical_42complexifier(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13081 PyObject *__pyx_r = NULL;
13082 __Pyx_RefNannyDeclarations
13083 PyObject *__pyx_t_1 = NULL;
13084 __Pyx_RefNannySetupContext(
"complexifier", 0);
13085 __Pyx_XDECREF(__pyx_r);
13086 __pyx_t_1 = __pyx_f_8PyClical_complexifier(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1527, __pyx_L1_error)
13087 __Pyx_GOTREF(__pyx_t_1);
13088 __pyx_r = __pyx_t_1;
13094 __Pyx_XDECREF(__pyx_t_1);
13095 __Pyx_AddTraceback(
"PyClical.complexifier", __pyx_clineno, __pyx_lineno, __pyx_filename);
13098 __Pyx_XGIVEREF(__pyx_r);
13099 __Pyx_RefNannyFinishContext();
13111 static PyObject *__pyx_pw_8PyClical_45sqrt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13112 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) {
13113 PyObject *__pyx_v_i = ((PyObject *)Py_None);
13114 PyObject *__pyx_r = NULL;
13115 __Pyx_RefNannyDeclarations
13118 PyObject *__pyx_t_3 = NULL;
13120 PyObject *__pyx_t_5 = NULL;
13121 PyObject *__pyx_t_6 = NULL;
13122 PyObject *__pyx_t_7 = NULL;
13123 PyObject *__pyx_t_8 = NULL;
13124 PyObject *__pyx_t_9 = NULL;
13125 PyObject *__pyx_t_10 = NULL;
13126 PyObject *__pyx_t_11 = NULL;
13127 __Pyx_RefNannySetupContext(
"sqrt", 0);
13128 if (__pyx_optional_args) {
13129 if (__pyx_optional_args->__pyx_n > 0) {
13130 __pyx_v_i = __pyx_optional_args->i;
13141 __pyx_t_1 = (__pyx_v_i != Py_None);
13142 __pyx_t_2 = (__pyx_t_1 != 0);
13152 __Pyx_XDECREF(__pyx_r);
13153 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1558, __pyx_L1_error)
13154 __Pyx_GOTREF(__pyx_t_3);
13156 __pyx_t_4 =
sqrt(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
13158 __Pyx_CppExn2PyErr();
13159 __PYX_ERR(0, 1558, __pyx_L1_error)
13161 __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)
13162 __Pyx_GOTREF(__pyx_t_5);
13163 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13164 __pyx_r = __pyx_t_5;
13186 __Pyx_PyThreadState_declare
13187 __Pyx_PyThreadState_assign
13188 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
13189 __Pyx_XGOTREF(__pyx_t_6);
13190 __Pyx_XGOTREF(__pyx_t_7);
13191 __Pyx_XGOTREF(__pyx_t_8);
13201 __Pyx_XDECREF(__pyx_r);
13202 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1561, __pyx_L4_error)
13203 __Pyx_GOTREF(__pyx_t_3);
13204 __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)
13205 __Pyx_GOTREF(__pyx_t_9);
13206 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13208 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
13209 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
13210 if (likely(__pyx_t_3)) {
13211 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
13212 __Pyx_INCREF(__pyx_t_3);
13213 __Pyx_INCREF(
function);
13214 __Pyx_DECREF_SET(__pyx_t_9,
function);
13217 __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_3, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
13218 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13219 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1561, __pyx_L4_error)
13220 __Pyx_GOTREF(__pyx_t_5);
13221 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13222 __pyx_r = __pyx_t_5;
13224 goto __pyx_L8_try_return;
13235 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13236 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13237 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
13247 __Pyx_AddTraceback(
"PyClical.sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename);
13248 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1562, __pyx_L6_except_error)
13249 __Pyx_GOTREF(__pyx_t_5);
13250 __Pyx_GOTREF(__pyx_t_9);
13251 __Pyx_GOTREF(__pyx_t_3);
13260 __Pyx_XDECREF(__pyx_r);
13261 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1563, __pyx_L6_except_error)
13262 __Pyx_GOTREF(__pyx_t_10);
13263 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_10),
sqrt(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1563, __pyx_L6_except_error)
13264 __Pyx_GOTREF(__pyx_t_11);
13265 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13266 __pyx_r = __pyx_t_11;
13268 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13269 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13270 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13271 goto __pyx_L7_except_return;
13273 __pyx_L6_except_error:;
13282 __Pyx_XGIVEREF(__pyx_t_6);
13283 __Pyx_XGIVEREF(__pyx_t_7);
13284 __Pyx_XGIVEREF(__pyx_t_8);
13285 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
13286 goto __pyx_L1_error;
13287 __pyx_L8_try_return:;
13288 __Pyx_XGIVEREF(__pyx_t_6);
13289 __Pyx_XGIVEREF(__pyx_t_7);
13290 __Pyx_XGIVEREF(__pyx_t_8);
13291 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
13293 __pyx_L7_except_return:;
13294 __Pyx_XGIVEREF(__pyx_t_6);
13295 __Pyx_XGIVEREF(__pyx_t_7);
13296 __Pyx_XGIVEREF(__pyx_t_8);
13297 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
13312 __Pyx_XDECREF(__pyx_t_3);
13313 __Pyx_XDECREF(__pyx_t_5);
13314 __Pyx_XDECREF(__pyx_t_9);
13315 __Pyx_XDECREF(__pyx_t_10);
13316 __Pyx_XDECREF(__pyx_t_11);
13317 __Pyx_AddTraceback(
"PyClical.sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename);
13320 __Pyx_XGIVEREF(__pyx_r);
13321 __Pyx_RefNannyFinishContext();
13326 static PyObject *__pyx_pw_8PyClical_45sqrt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13327 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 ";
13328 static PyObject *__pyx_pw_8PyClical_45sqrt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13329 PyObject *__pyx_v_obj = 0;
13330 PyObject *__pyx_v_i = 0;
13331 PyObject *__pyx_r = 0;
13332 __Pyx_RefNannyDeclarations
13333 __Pyx_RefNannySetupContext(
"sqrt (wrapper)", 0);
13335 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
13336 PyObject* values[2] = {0,0};
13337 values[1] = ((PyObject *)Py_None);
13338 if (unlikely(__pyx_kwds)) {
13339 Py_ssize_t kw_args;
13340 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13341 switch (pos_args) {
13342 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13343 CYTHON_FALLTHROUGH;
13344 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13345 CYTHON_FALLTHROUGH;
13347 default:
goto __pyx_L5_argtuple_error;
13349 kw_args = PyDict_Size(__pyx_kwds);
13350 switch (pos_args) {
13352 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
13353 else goto __pyx_L5_argtuple_error;
13354 CYTHON_FALLTHROUGH;
13357 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
13358 if (value) { values[1] = value; kw_args--; }
13361 if (unlikely(kw_args > 0)) {
13362 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"sqrt") < 0)) __PYX_ERR(0, 1542, __pyx_L3_error)
13365 switch (PyTuple_GET_SIZE(__pyx_args)) {
13366 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13367 CYTHON_FALLTHROUGH;
13368 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13370 default:
goto __pyx_L5_argtuple_error;
13373 __pyx_v_obj = values[0];
13374 __pyx_v_i = values[1];
13376 goto __pyx_L4_argument_unpacking_done;
13377 __pyx_L5_argtuple_error:;
13378 __Pyx_RaiseArgtupleInvalid(
"sqrt", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1542, __pyx_L3_error)
13380 __Pyx_AddTraceback(
"PyClical.sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename);
13381 __Pyx_RefNannyFinishContext();
13383 __pyx_L4_argument_unpacking_done:;
13384 __pyx_r = __pyx_pf_8PyClical_44sqrt(__pyx_self, __pyx_v_obj, __pyx_v_i);
13387 __Pyx_RefNannyFinishContext();
13391 static PyObject *__pyx_pf_8PyClical_44sqrt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
13392 PyObject *__pyx_r = NULL;
13393 __Pyx_RefNannyDeclarations
13394 PyObject *__pyx_t_1 = NULL;
13395 struct __pyx_opt_args_8PyClical_sqrt __pyx_t_2;
13396 __Pyx_RefNannySetupContext(
"sqrt", 0);
13397 __Pyx_XDECREF(__pyx_r);
13398 __pyx_t_2.__pyx_n = 1;
13399 __pyx_t_2.i = __pyx_v_i;
13400 __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)
13401 __Pyx_GOTREF(__pyx_t_1);
13402 __pyx_r = __pyx_t_1;
13408 __Pyx_XDECREF(__pyx_t_1);
13409 __Pyx_AddTraceback(
"PyClical.sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename);
13412 __Pyx_XGIVEREF(__pyx_r);
13413 __Pyx_RefNannyFinishContext();
13425 static PyObject *__pyx_pw_8PyClical_47exp(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13426 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_exp(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
13427 PyObject *__pyx_r = NULL;
13428 __Pyx_RefNannyDeclarations
13429 PyObject *__pyx_t_1 = NULL;
13430 PyObject *__pyx_t_2 = NULL;
13431 PyObject *__pyx_t_3 = NULL;
13432 PyObject *__pyx_t_4 = NULL;
13433 PyObject *__pyx_t_5 = NULL;
13434 PyObject *__pyx_t_6 = NULL;
13435 PyObject *__pyx_t_7 = NULL;
13436 PyObject *__pyx_t_8 = NULL;
13437 __Pyx_RefNannySetupContext(
"exp", 0);
13447 __Pyx_PyThreadState_declare
13448 __Pyx_PyThreadState_assign
13449 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
13450 __Pyx_XGOTREF(__pyx_t_1);
13451 __Pyx_XGOTREF(__pyx_t_2);
13452 __Pyx_XGOTREF(__pyx_t_3);
13462 __Pyx_XDECREF(__pyx_r);
13463 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1575, __pyx_L3_error)
13464 __Pyx_GOTREF(__pyx_t_5);
13465 __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)
13466 __Pyx_GOTREF(__pyx_t_6);
13467 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13469 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
13470 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
13471 if (likely(__pyx_t_5)) {
13472 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
13473 __Pyx_INCREF(__pyx_t_5);
13474 __Pyx_INCREF(
function);
13475 __Pyx_DECREF_SET(__pyx_t_6,
function);
13478 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_obj);
13479 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13480 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1575, __pyx_L3_error)
13481 __Pyx_GOTREF(__pyx_t_4);
13482 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13483 __pyx_r = __pyx_t_4;
13485 goto __pyx_L7_try_return;
13496 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
13497 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13498 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
13508 __Pyx_AddTraceback(
"PyClical.exp", __pyx_clineno, __pyx_lineno, __pyx_filename);
13509 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(0, 1576, __pyx_L5_except_error)
13510 __Pyx_GOTREF(__pyx_t_4);
13511 __Pyx_GOTREF(__pyx_t_6);
13512 __Pyx_GOTREF(__pyx_t_5);
13521 __Pyx_XDECREF(__pyx_r);
13522 __pyx_t_7 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1577, __pyx_L5_except_error)
13523 __Pyx_GOTREF(__pyx_t_7);
13524 __pyx_t_8 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_7),
exp(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1577, __pyx_L5_except_error)
13525 __Pyx_GOTREF(__pyx_t_8);
13526 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13527 __pyx_r = __pyx_t_8;
13529 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13530 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13531 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13532 goto __pyx_L6_except_return;
13534 __pyx_L5_except_error:;
13543 __Pyx_XGIVEREF(__pyx_t_1);
13544 __Pyx_XGIVEREF(__pyx_t_2);
13545 __Pyx_XGIVEREF(__pyx_t_3);
13546 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
13547 goto __pyx_L1_error;
13548 __pyx_L7_try_return:;
13549 __Pyx_XGIVEREF(__pyx_t_1);
13550 __Pyx_XGIVEREF(__pyx_t_2);
13551 __Pyx_XGIVEREF(__pyx_t_3);
13552 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
13554 __pyx_L6_except_return:;
13555 __Pyx_XGIVEREF(__pyx_t_1);
13556 __Pyx_XGIVEREF(__pyx_t_2);
13557 __Pyx_XGIVEREF(__pyx_t_3);
13558 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
13572 __Pyx_XDECREF(__pyx_t_4);
13573 __Pyx_XDECREF(__pyx_t_5);
13574 __Pyx_XDECREF(__pyx_t_6);
13575 __Pyx_XDECREF(__pyx_t_7);
13576 __Pyx_XDECREF(__pyx_t_8);
13577 __Pyx_AddTraceback(
"PyClical.exp", __pyx_clineno, __pyx_lineno, __pyx_filename);
13580 __Pyx_XGIVEREF(__pyx_r);
13581 __Pyx_RefNannyFinishContext();
13586 static PyObject *__pyx_pw_8PyClical_47exp(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13587 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 ";
13588 static PyObject *__pyx_pw_8PyClical_47exp(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13589 PyObject *__pyx_r = 0;
13590 __Pyx_RefNannyDeclarations
13591 __Pyx_RefNannySetupContext(
"exp (wrapper)", 0);
13592 __pyx_r = __pyx_pf_8PyClical_46exp(__pyx_self, ((PyObject *)__pyx_v_obj));
13595 __Pyx_RefNannyFinishContext();
13599 static PyObject *__pyx_pf_8PyClical_46exp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13600 PyObject *__pyx_r = NULL;
13601 __Pyx_RefNannyDeclarations
13602 PyObject *__pyx_t_1 = NULL;
13603 __Pyx_RefNannySetupContext(
"exp", 0);
13604 __Pyx_XDECREF(__pyx_r);
13605 __pyx_t_1 = __pyx_f_8PyClical_exp(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1565, __pyx_L1_error)
13606 __Pyx_GOTREF(__pyx_t_1);
13607 __pyx_r = __pyx_t_1;
13613 __Pyx_XDECREF(__pyx_t_1);
13614 __Pyx_AddTraceback(
"PyClical.exp", __pyx_clineno, __pyx_lineno, __pyx_filename);
13617 __Pyx_XGIVEREF(__pyx_r);
13618 __Pyx_RefNannyFinishContext();
13630 static PyObject *__pyx_pw_8PyClical_49log(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13631 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) {
13632 PyObject *__pyx_v_i = ((PyObject *)Py_None);
13633 PyObject *__pyx_r = NULL;
13634 __Pyx_RefNannyDeclarations
13637 PyObject *__pyx_t_3 = NULL;
13639 PyObject *__pyx_t_5 = NULL;
13640 PyObject *__pyx_t_6 = NULL;
13641 PyObject *__pyx_t_7 = NULL;
13642 PyObject *__pyx_t_8 = NULL;
13643 PyObject *__pyx_t_9 = NULL;
13644 PyObject *__pyx_t_10 = NULL;
13645 PyObject *__pyx_t_11 = NULL;
13646 __Pyx_RefNannySetupContext(
"log", 0);
13647 if (__pyx_optional_args) {
13648 if (__pyx_optional_args->__pyx_n > 0) {
13649 __pyx_v_i = __pyx_optional_args->i;
13660 __pyx_t_1 = (__pyx_v_i != Py_None);
13661 __pyx_t_2 = (__pyx_t_1 != 0);
13671 __Pyx_XDECREF(__pyx_r);
13672 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1595, __pyx_L1_error)
13673 __Pyx_GOTREF(__pyx_t_3);
13675 __pyx_t_4 =
log(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
13677 __Pyx_CppExn2PyErr();
13678 __PYX_ERR(0, 1595, __pyx_L1_error)
13680 __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)
13681 __Pyx_GOTREF(__pyx_t_5);
13682 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13683 __pyx_r = __pyx_t_5;
13705 __Pyx_PyThreadState_declare
13706 __Pyx_PyThreadState_assign
13707 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
13708 __Pyx_XGOTREF(__pyx_t_6);
13709 __Pyx_XGOTREF(__pyx_t_7);
13710 __Pyx_XGOTREF(__pyx_t_8);
13720 __Pyx_XDECREF(__pyx_r);
13721 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1598, __pyx_L4_error)
13722 __Pyx_GOTREF(__pyx_t_3);
13723 __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)
13724 __Pyx_GOTREF(__pyx_t_9);
13725 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13727 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
13728 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
13729 if (likely(__pyx_t_3)) {
13730 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
13731 __Pyx_INCREF(__pyx_t_3);
13732 __Pyx_INCREF(
function);
13733 __Pyx_DECREF_SET(__pyx_t_9,
function);
13736 __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_3, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
13737 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13738 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1598, __pyx_L4_error)
13739 __Pyx_GOTREF(__pyx_t_5);
13740 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13741 __pyx_r = __pyx_t_5;
13743 goto __pyx_L8_try_return;
13754 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13755 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13756 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
13766 __Pyx_AddTraceback(
"PyClical.log", __pyx_clineno, __pyx_lineno, __pyx_filename);
13767 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1599, __pyx_L6_except_error)
13768 __Pyx_GOTREF(__pyx_t_5);
13769 __Pyx_GOTREF(__pyx_t_9);
13770 __Pyx_GOTREF(__pyx_t_3);
13779 __Pyx_XDECREF(__pyx_r);
13780 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1600, __pyx_L6_except_error)
13781 __Pyx_GOTREF(__pyx_t_10);
13782 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_10),
log(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1600, __pyx_L6_except_error)
13783 __Pyx_GOTREF(__pyx_t_11);
13784 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13785 __pyx_r = __pyx_t_11;
13787 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13788 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13789 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13790 goto __pyx_L7_except_return;
13792 __pyx_L6_except_error:;
13801 __Pyx_XGIVEREF(__pyx_t_6);
13802 __Pyx_XGIVEREF(__pyx_t_7);
13803 __Pyx_XGIVEREF(__pyx_t_8);
13804 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
13805 goto __pyx_L1_error;
13806 __pyx_L8_try_return:;
13807 __Pyx_XGIVEREF(__pyx_t_6);
13808 __Pyx_XGIVEREF(__pyx_t_7);
13809 __Pyx_XGIVEREF(__pyx_t_8);
13810 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
13812 __pyx_L7_except_return:;
13813 __Pyx_XGIVEREF(__pyx_t_6);
13814 __Pyx_XGIVEREF(__pyx_t_7);
13815 __Pyx_XGIVEREF(__pyx_t_8);
13816 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
13831 __Pyx_XDECREF(__pyx_t_3);
13832 __Pyx_XDECREF(__pyx_t_5);
13833 __Pyx_XDECREF(__pyx_t_9);
13834 __Pyx_XDECREF(__pyx_t_10);
13835 __Pyx_XDECREF(__pyx_t_11);
13836 __Pyx_AddTraceback(
"PyClical.log", __pyx_clineno, __pyx_lineno, __pyx_filename);
13839 __Pyx_XGIVEREF(__pyx_r);
13840 __Pyx_RefNannyFinishContext();
13845 static PyObject *__pyx_pw_8PyClical_49log(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13846 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 ";
13847 static PyObject *__pyx_pw_8PyClical_49log(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13848 PyObject *__pyx_v_obj = 0;
13849 PyObject *__pyx_v_i = 0;
13850 PyObject *__pyx_r = 0;
13851 __Pyx_RefNannyDeclarations
13852 __Pyx_RefNannySetupContext(
"log (wrapper)", 0);
13854 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
13855 PyObject* values[2] = {0,0};
13856 values[1] = ((PyObject *)Py_None);
13857 if (unlikely(__pyx_kwds)) {
13858 Py_ssize_t kw_args;
13859 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13860 switch (pos_args) {
13861 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13862 CYTHON_FALLTHROUGH;
13863 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13864 CYTHON_FALLTHROUGH;
13866 default:
goto __pyx_L5_argtuple_error;
13868 kw_args = PyDict_Size(__pyx_kwds);
13869 switch (pos_args) {
13871 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
13872 else goto __pyx_L5_argtuple_error;
13873 CYTHON_FALLTHROUGH;
13876 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
13877 if (value) { values[1] = value; kw_args--; }
13880 if (unlikely(kw_args > 0)) {
13881 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"log") < 0)) __PYX_ERR(0, 1579, __pyx_L3_error)
13884 switch (PyTuple_GET_SIZE(__pyx_args)) {
13885 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13886 CYTHON_FALLTHROUGH;
13887 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13889 default:
goto __pyx_L5_argtuple_error;
13892 __pyx_v_obj = values[0];
13893 __pyx_v_i = values[1];
13895 goto __pyx_L4_argument_unpacking_done;
13896 __pyx_L5_argtuple_error:;
13897 __Pyx_RaiseArgtupleInvalid(
"log", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1579, __pyx_L3_error)
13899 __Pyx_AddTraceback(
"PyClical.log", __pyx_clineno, __pyx_lineno, __pyx_filename);
13900 __Pyx_RefNannyFinishContext();
13902 __pyx_L4_argument_unpacking_done:;
13903 __pyx_r = __pyx_pf_8PyClical_48log(__pyx_self, __pyx_v_obj, __pyx_v_i);
13906 __Pyx_RefNannyFinishContext();
13910 static PyObject *__pyx_pf_8PyClical_48log(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
13911 PyObject *__pyx_r = NULL;
13912 __Pyx_RefNannyDeclarations
13913 PyObject *__pyx_t_1 = NULL;
13914 struct __pyx_opt_args_8PyClical_log __pyx_t_2;
13915 __Pyx_RefNannySetupContext(
"log", 0);
13916 __Pyx_XDECREF(__pyx_r);
13917 __pyx_t_2.__pyx_n = 1;
13918 __pyx_t_2.i = __pyx_v_i;
13919 __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)
13920 __Pyx_GOTREF(__pyx_t_1);
13921 __pyx_r = __pyx_t_1;
13927 __Pyx_XDECREF(__pyx_t_1);
13928 __Pyx_AddTraceback(
"PyClical.log", __pyx_clineno, __pyx_lineno, __pyx_filename);
13931 __Pyx_XGIVEREF(__pyx_r);
13932 __Pyx_RefNannyFinishContext();
13944 static PyObject *__pyx_pw_8PyClical_51cos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13945 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) {
13946 PyObject *__pyx_v_i = ((PyObject *)Py_None);
13947 PyObject *__pyx_r = NULL;
13948 __Pyx_RefNannyDeclarations
13951 PyObject *__pyx_t_3 = NULL;
13953 PyObject *__pyx_t_5 = NULL;
13954 PyObject *__pyx_t_6 = NULL;
13955 PyObject *__pyx_t_7 = NULL;
13956 PyObject *__pyx_t_8 = NULL;
13957 PyObject *__pyx_t_9 = NULL;
13958 PyObject *__pyx_t_10 = NULL;
13959 PyObject *__pyx_t_11 = NULL;
13960 __Pyx_RefNannySetupContext(
"cos", 0);
13961 if (__pyx_optional_args) {
13962 if (__pyx_optional_args->__pyx_n > 0) {
13963 __pyx_v_i = __pyx_optional_args->i;
13974 __pyx_t_1 = (__pyx_v_i != Py_None);
13975 __pyx_t_2 = (__pyx_t_1 != 0);
13985 __Pyx_XDECREF(__pyx_r);
13986 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1612, __pyx_L1_error)
13987 __Pyx_GOTREF(__pyx_t_3);
13989 __pyx_t_4 =
cos(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
13991 __Pyx_CppExn2PyErr();
13992 __PYX_ERR(0, 1612, __pyx_L1_error)
13994 __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)
13995 __Pyx_GOTREF(__pyx_t_5);
13996 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13997 __pyx_r = __pyx_t_5;
14019 __Pyx_PyThreadState_declare
14020 __Pyx_PyThreadState_assign
14021 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
14022 __Pyx_XGOTREF(__pyx_t_6);
14023 __Pyx_XGOTREF(__pyx_t_7);
14024 __Pyx_XGOTREF(__pyx_t_8);
14034 __Pyx_XDECREF(__pyx_r);
14035 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1615, __pyx_L4_error)
14036 __Pyx_GOTREF(__pyx_t_3);
14037 __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)
14038 __Pyx_GOTREF(__pyx_t_9);
14039 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14041 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
14042 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
14043 if (likely(__pyx_t_3)) {
14044 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
14045 __Pyx_INCREF(__pyx_t_3);
14046 __Pyx_INCREF(
function);
14047 __Pyx_DECREF_SET(__pyx_t_9,
function);
14050 __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_3, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
14051 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14052 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1615, __pyx_L4_error)
14053 __Pyx_GOTREF(__pyx_t_5);
14054 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14055 __pyx_r = __pyx_t_5;
14057 goto __pyx_L8_try_return;
14068 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14069 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14070 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
14080 __Pyx_AddTraceback(
"PyClical.cos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14081 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1616, __pyx_L6_except_error)
14082 __Pyx_GOTREF(__pyx_t_5);
14083 __Pyx_GOTREF(__pyx_t_9);
14084 __Pyx_GOTREF(__pyx_t_3);
14093 __Pyx_XDECREF(__pyx_r);
14094 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1617, __pyx_L6_except_error)
14095 __Pyx_GOTREF(__pyx_t_10);
14096 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_10),
cos(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1617, __pyx_L6_except_error)
14097 __Pyx_GOTREF(__pyx_t_11);
14098 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14099 __pyx_r = __pyx_t_11;
14101 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14102 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14103 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14104 goto __pyx_L7_except_return;
14106 __pyx_L6_except_error:;
14115 __Pyx_XGIVEREF(__pyx_t_6);
14116 __Pyx_XGIVEREF(__pyx_t_7);
14117 __Pyx_XGIVEREF(__pyx_t_8);
14118 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14119 goto __pyx_L1_error;
14120 __pyx_L8_try_return:;
14121 __Pyx_XGIVEREF(__pyx_t_6);
14122 __Pyx_XGIVEREF(__pyx_t_7);
14123 __Pyx_XGIVEREF(__pyx_t_8);
14124 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14126 __pyx_L7_except_return:;
14127 __Pyx_XGIVEREF(__pyx_t_6);
14128 __Pyx_XGIVEREF(__pyx_t_7);
14129 __Pyx_XGIVEREF(__pyx_t_8);
14130 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14145 __Pyx_XDECREF(__pyx_t_3);
14146 __Pyx_XDECREF(__pyx_t_5);
14147 __Pyx_XDECREF(__pyx_t_9);
14148 __Pyx_XDECREF(__pyx_t_10);
14149 __Pyx_XDECREF(__pyx_t_11);
14150 __Pyx_AddTraceback(
"PyClical.cos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14153 __Pyx_XGIVEREF(__pyx_r);
14154 __Pyx_RefNannyFinishContext();
14159 static PyObject *__pyx_pw_8PyClical_51cos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14160 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 ";
14161 static PyObject *__pyx_pw_8PyClical_51cos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14162 PyObject *__pyx_v_obj = 0;
14163 PyObject *__pyx_v_i = 0;
14164 PyObject *__pyx_r = 0;
14165 __Pyx_RefNannyDeclarations
14166 __Pyx_RefNannySetupContext(
"cos (wrapper)", 0);
14168 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
14169 PyObject* values[2] = {0,0};
14170 values[1] = ((PyObject *)Py_None);
14171 if (unlikely(__pyx_kwds)) {
14172 Py_ssize_t kw_args;
14173 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14174 switch (pos_args) {
14175 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14176 CYTHON_FALLTHROUGH;
14177 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14178 CYTHON_FALLTHROUGH;
14180 default:
goto __pyx_L5_argtuple_error;
14182 kw_args = PyDict_Size(__pyx_kwds);
14183 switch (pos_args) {
14185 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
14186 else goto __pyx_L5_argtuple_error;
14187 CYTHON_FALLTHROUGH;
14190 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
14191 if (value) { values[1] = value; kw_args--; }
14194 if (unlikely(kw_args > 0)) {
14195 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"cos") < 0)) __PYX_ERR(0, 1602, __pyx_L3_error)
14198 switch (PyTuple_GET_SIZE(__pyx_args)) {
14199 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14200 CYTHON_FALLTHROUGH;
14201 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14203 default:
goto __pyx_L5_argtuple_error;
14206 __pyx_v_obj = values[0];
14207 __pyx_v_i = values[1];
14209 goto __pyx_L4_argument_unpacking_done;
14210 __pyx_L5_argtuple_error:;
14211 __Pyx_RaiseArgtupleInvalid(
"cos", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1602, __pyx_L3_error)
14213 __Pyx_AddTraceback(
"PyClical.cos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14214 __Pyx_RefNannyFinishContext();
14216 __pyx_L4_argument_unpacking_done:;
14217 __pyx_r = __pyx_pf_8PyClical_50cos(__pyx_self, __pyx_v_obj, __pyx_v_i);
14220 __Pyx_RefNannyFinishContext();
14224 static PyObject *__pyx_pf_8PyClical_50cos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
14225 PyObject *__pyx_r = NULL;
14226 __Pyx_RefNannyDeclarations
14227 PyObject *__pyx_t_1 = NULL;
14228 struct __pyx_opt_args_8PyClical_cos __pyx_t_2;
14229 __Pyx_RefNannySetupContext(
"cos", 0);
14230 __Pyx_XDECREF(__pyx_r);
14231 __pyx_t_2.__pyx_n = 1;
14232 __pyx_t_2.i = __pyx_v_i;
14233 __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)
14234 __Pyx_GOTREF(__pyx_t_1);
14235 __pyx_r = __pyx_t_1;
14241 __Pyx_XDECREF(__pyx_t_1);
14242 __Pyx_AddTraceback(
"PyClical.cos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14245 __Pyx_XGIVEREF(__pyx_r);
14246 __Pyx_RefNannyFinishContext();
14258 static PyObject *__pyx_pw_8PyClical_53acos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14259 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) {
14260 PyObject *__pyx_v_i = ((PyObject *)Py_None);
14261 PyObject *__pyx_r = NULL;
14262 __Pyx_RefNannyDeclarations
14265 PyObject *__pyx_t_3 = NULL;
14267 PyObject *__pyx_t_5 = NULL;
14268 PyObject *__pyx_t_6 = NULL;
14269 PyObject *__pyx_t_7 = NULL;
14270 PyObject *__pyx_t_8 = NULL;
14271 PyObject *__pyx_t_9 = NULL;
14272 PyObject *__pyx_t_10 = NULL;
14273 PyObject *__pyx_t_11 = NULL;
14274 __Pyx_RefNannySetupContext(
"acos", 0);
14275 if (__pyx_optional_args) {
14276 if (__pyx_optional_args->__pyx_n > 0) {
14277 __pyx_v_i = __pyx_optional_args->i;
14288 __pyx_t_1 = (__pyx_v_i != Py_None);
14289 __pyx_t_2 = (__pyx_t_1 != 0);
14299 __Pyx_XDECREF(__pyx_r);
14300 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1633, __pyx_L1_error)
14301 __Pyx_GOTREF(__pyx_t_3);
14303 __pyx_t_4 =
acos(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
14305 __Pyx_CppExn2PyErr();
14306 __PYX_ERR(0, 1633, __pyx_L1_error)
14308 __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)
14309 __Pyx_GOTREF(__pyx_t_5);
14310 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14311 __pyx_r = __pyx_t_5;
14333 __Pyx_PyThreadState_declare
14334 __Pyx_PyThreadState_assign
14335 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
14336 __Pyx_XGOTREF(__pyx_t_6);
14337 __Pyx_XGOTREF(__pyx_t_7);
14338 __Pyx_XGOTREF(__pyx_t_8);
14348 __Pyx_XDECREF(__pyx_r);
14349 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1636, __pyx_L4_error)
14350 __Pyx_GOTREF(__pyx_t_3);
14351 __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)
14352 __Pyx_GOTREF(__pyx_t_9);
14353 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14355 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
14356 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
14357 if (likely(__pyx_t_3)) {
14358 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
14359 __Pyx_INCREF(__pyx_t_3);
14360 __Pyx_INCREF(
function);
14361 __Pyx_DECREF_SET(__pyx_t_9,
function);
14364 __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_3, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
14365 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14366 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1636, __pyx_L4_error)
14367 __Pyx_GOTREF(__pyx_t_5);
14368 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14369 __pyx_r = __pyx_t_5;
14371 goto __pyx_L8_try_return;
14382 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14383 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14384 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
14394 __Pyx_AddTraceback(
"PyClical.acos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14395 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1637, __pyx_L6_except_error)
14396 __Pyx_GOTREF(__pyx_t_5);
14397 __Pyx_GOTREF(__pyx_t_9);
14398 __Pyx_GOTREF(__pyx_t_3);
14407 __Pyx_XDECREF(__pyx_r);
14408 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1638, __pyx_L6_except_error)
14409 __Pyx_GOTREF(__pyx_t_10);
14410 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_10),
acos(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1638, __pyx_L6_except_error)
14411 __Pyx_GOTREF(__pyx_t_11);
14412 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14413 __pyx_r = __pyx_t_11;
14415 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14416 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14417 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14418 goto __pyx_L7_except_return;
14420 __pyx_L6_except_error:;
14429 __Pyx_XGIVEREF(__pyx_t_6);
14430 __Pyx_XGIVEREF(__pyx_t_7);
14431 __Pyx_XGIVEREF(__pyx_t_8);
14432 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14433 goto __pyx_L1_error;
14434 __pyx_L8_try_return:;
14435 __Pyx_XGIVEREF(__pyx_t_6);
14436 __Pyx_XGIVEREF(__pyx_t_7);
14437 __Pyx_XGIVEREF(__pyx_t_8);
14438 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14440 __pyx_L7_except_return:;
14441 __Pyx_XGIVEREF(__pyx_t_6);
14442 __Pyx_XGIVEREF(__pyx_t_7);
14443 __Pyx_XGIVEREF(__pyx_t_8);
14444 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14459 __Pyx_XDECREF(__pyx_t_3);
14460 __Pyx_XDECREF(__pyx_t_5);
14461 __Pyx_XDECREF(__pyx_t_9);
14462 __Pyx_XDECREF(__pyx_t_10);
14463 __Pyx_XDECREF(__pyx_t_11);
14464 __Pyx_AddTraceback(
"PyClical.acos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14467 __Pyx_XGIVEREF(__pyx_r);
14468 __Pyx_RefNannyFinishContext();
14473 static PyObject *__pyx_pw_8PyClical_53acos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14474 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 ";
14475 static PyObject *__pyx_pw_8PyClical_53acos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14476 PyObject *__pyx_v_obj = 0;
14477 PyObject *__pyx_v_i = 0;
14478 PyObject *__pyx_r = 0;
14479 __Pyx_RefNannyDeclarations
14480 __Pyx_RefNannySetupContext(
"acos (wrapper)", 0);
14482 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
14483 PyObject* values[2] = {0,0};
14484 values[1] = ((PyObject *)Py_None);
14485 if (unlikely(__pyx_kwds)) {
14486 Py_ssize_t kw_args;
14487 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14488 switch (pos_args) {
14489 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14490 CYTHON_FALLTHROUGH;
14491 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14492 CYTHON_FALLTHROUGH;
14494 default:
goto __pyx_L5_argtuple_error;
14496 kw_args = PyDict_Size(__pyx_kwds);
14497 switch (pos_args) {
14499 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
14500 else goto __pyx_L5_argtuple_error;
14501 CYTHON_FALLTHROUGH;
14504 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
14505 if (value) { values[1] = value; kw_args--; }
14508 if (unlikely(kw_args > 0)) {
14509 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"acos") < 0)) __PYX_ERR(0, 1619, __pyx_L3_error)
14512 switch (PyTuple_GET_SIZE(__pyx_args)) {
14513 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14514 CYTHON_FALLTHROUGH;
14515 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14517 default:
goto __pyx_L5_argtuple_error;
14520 __pyx_v_obj = values[0];
14521 __pyx_v_i = values[1];
14523 goto __pyx_L4_argument_unpacking_done;
14524 __pyx_L5_argtuple_error:;
14525 __Pyx_RaiseArgtupleInvalid(
"acos", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1619, __pyx_L3_error)
14527 __Pyx_AddTraceback(
"PyClical.acos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14528 __Pyx_RefNannyFinishContext();
14530 __pyx_L4_argument_unpacking_done:;
14531 __pyx_r = __pyx_pf_8PyClical_52acos(__pyx_self, __pyx_v_obj, __pyx_v_i);
14534 __Pyx_RefNannyFinishContext();
14538 static PyObject *__pyx_pf_8PyClical_52acos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
14539 PyObject *__pyx_r = NULL;
14540 __Pyx_RefNannyDeclarations
14541 PyObject *__pyx_t_1 = NULL;
14542 struct __pyx_opt_args_8PyClical_acos __pyx_t_2;
14543 __Pyx_RefNannySetupContext(
"acos", 0);
14544 __Pyx_XDECREF(__pyx_r);
14545 __pyx_t_2.__pyx_n = 1;
14546 __pyx_t_2.i = __pyx_v_i;
14547 __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)
14548 __Pyx_GOTREF(__pyx_t_1);
14549 __pyx_r = __pyx_t_1;
14555 __Pyx_XDECREF(__pyx_t_1);
14556 __Pyx_AddTraceback(
"PyClical.acos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14559 __Pyx_XGIVEREF(__pyx_r);
14560 __Pyx_RefNannyFinishContext();
14572 static PyObject *__pyx_pw_8PyClical_55cosh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
14573 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cosh(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
14574 PyObject *__pyx_r = NULL;
14575 __Pyx_RefNannyDeclarations
14576 PyObject *__pyx_t_1 = NULL;
14577 PyObject *__pyx_t_2 = NULL;
14578 PyObject *__pyx_t_3 = NULL;
14579 PyObject *__pyx_t_4 = NULL;
14580 PyObject *__pyx_t_5 = NULL;
14581 PyObject *__pyx_t_6 = NULL;
14582 PyObject *__pyx_t_7 = NULL;
14583 PyObject *__pyx_t_8 = NULL;
14584 __Pyx_RefNannySetupContext(
"cosh", 0);
14594 __Pyx_PyThreadState_declare
14595 __Pyx_PyThreadState_assign
14596 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
14597 __Pyx_XGOTREF(__pyx_t_1);
14598 __Pyx_XGOTREF(__pyx_t_2);
14599 __Pyx_XGOTREF(__pyx_t_3);
14609 __Pyx_XDECREF(__pyx_r);
14610 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1652, __pyx_L3_error)
14611 __Pyx_GOTREF(__pyx_t_5);
14612 __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)
14613 __Pyx_GOTREF(__pyx_t_6);
14614 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14616 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
14617 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
14618 if (likely(__pyx_t_5)) {
14619 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
14620 __Pyx_INCREF(__pyx_t_5);
14621 __Pyx_INCREF(
function);
14622 __Pyx_DECREF_SET(__pyx_t_6,
function);
14625 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_obj);
14626 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14627 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1652, __pyx_L3_error)
14628 __Pyx_GOTREF(__pyx_t_4);
14629 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14630 __pyx_r = __pyx_t_4;
14632 goto __pyx_L7_try_return;
14643 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
14644 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14645 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
14655 __Pyx_AddTraceback(
"PyClical.cosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
14656 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(0, 1653, __pyx_L5_except_error)
14657 __Pyx_GOTREF(__pyx_t_4);
14658 __Pyx_GOTREF(__pyx_t_6);
14659 __Pyx_GOTREF(__pyx_t_5);
14668 __Pyx_XDECREF(__pyx_r);
14669 __pyx_t_7 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1654, __pyx_L5_except_error)
14670 __Pyx_GOTREF(__pyx_t_7);
14671 __pyx_t_8 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_7),
cosh(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1654, __pyx_L5_except_error)
14672 __Pyx_GOTREF(__pyx_t_8);
14673 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14674 __pyx_r = __pyx_t_8;
14676 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14677 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14678 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14679 goto __pyx_L6_except_return;
14681 __pyx_L5_except_error:;
14690 __Pyx_XGIVEREF(__pyx_t_1);
14691 __Pyx_XGIVEREF(__pyx_t_2);
14692 __Pyx_XGIVEREF(__pyx_t_3);
14693 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
14694 goto __pyx_L1_error;
14695 __pyx_L7_try_return:;
14696 __Pyx_XGIVEREF(__pyx_t_1);
14697 __Pyx_XGIVEREF(__pyx_t_2);
14698 __Pyx_XGIVEREF(__pyx_t_3);
14699 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
14701 __pyx_L6_except_return:;
14702 __Pyx_XGIVEREF(__pyx_t_1);
14703 __Pyx_XGIVEREF(__pyx_t_2);
14704 __Pyx_XGIVEREF(__pyx_t_3);
14705 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
14719 __Pyx_XDECREF(__pyx_t_4);
14720 __Pyx_XDECREF(__pyx_t_5);
14721 __Pyx_XDECREF(__pyx_t_6);
14722 __Pyx_XDECREF(__pyx_t_7);
14723 __Pyx_XDECREF(__pyx_t_8);
14724 __Pyx_AddTraceback(
"PyClical.cosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
14727 __Pyx_XGIVEREF(__pyx_r);
14728 __Pyx_RefNannyFinishContext();
14733 static PyObject *__pyx_pw_8PyClical_55cosh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
14734 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 ";
14735 static PyObject *__pyx_pw_8PyClical_55cosh(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
14736 PyObject *__pyx_r = 0;
14737 __Pyx_RefNannyDeclarations
14738 __Pyx_RefNannySetupContext(
"cosh (wrapper)", 0);
14739 __pyx_r = __pyx_pf_8PyClical_54cosh(__pyx_self, ((PyObject *)__pyx_v_obj));
14742 __Pyx_RefNannyFinishContext();
14746 static PyObject *__pyx_pf_8PyClical_54cosh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
14747 PyObject *__pyx_r = NULL;
14748 __Pyx_RefNannyDeclarations
14749 PyObject *__pyx_t_1 = NULL;
14750 __Pyx_RefNannySetupContext(
"cosh", 0);
14751 __Pyx_XDECREF(__pyx_r);
14752 __pyx_t_1 = __pyx_f_8PyClical_cosh(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1640, __pyx_L1_error)
14753 __Pyx_GOTREF(__pyx_t_1);
14754 __pyx_r = __pyx_t_1;
14760 __Pyx_XDECREF(__pyx_t_1);
14761 __Pyx_AddTraceback(
"PyClical.cosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
14764 __Pyx_XGIVEREF(__pyx_r);
14765 __Pyx_RefNannyFinishContext();
14777 static PyObject *__pyx_pw_8PyClical_57acosh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14778 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) {
14779 PyObject *__pyx_v_i = ((PyObject *)Py_None);
14780 PyObject *__pyx_r = NULL;
14781 __Pyx_RefNannyDeclarations
14784 PyObject *__pyx_t_3 = NULL;
14786 PyObject *__pyx_t_5 = NULL;
14787 PyObject *__pyx_t_6 = NULL;
14788 PyObject *__pyx_t_7 = NULL;
14789 PyObject *__pyx_t_8 = NULL;
14790 PyObject *__pyx_t_9 = NULL;
14791 PyObject *__pyx_t_10 = NULL;
14792 PyObject *__pyx_t_11 = NULL;
14793 __Pyx_RefNannySetupContext(
"acosh", 0);
14794 if (__pyx_optional_args) {
14795 if (__pyx_optional_args->__pyx_n > 0) {
14796 __pyx_v_i = __pyx_optional_args->i;
14807 __pyx_t_1 = (__pyx_v_i != Py_None);
14808 __pyx_t_2 = (__pyx_t_1 != 0);
14818 __Pyx_XDECREF(__pyx_r);
14819 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1672, __pyx_L1_error)
14820 __Pyx_GOTREF(__pyx_t_3);
14822 __pyx_t_4 =
acosh(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
14824 __Pyx_CppExn2PyErr();
14825 __PYX_ERR(0, 1672, __pyx_L1_error)
14827 __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)
14828 __Pyx_GOTREF(__pyx_t_5);
14829 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14830 __pyx_r = __pyx_t_5;
14852 __Pyx_PyThreadState_declare
14853 __Pyx_PyThreadState_assign
14854 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
14855 __Pyx_XGOTREF(__pyx_t_6);
14856 __Pyx_XGOTREF(__pyx_t_7);
14857 __Pyx_XGOTREF(__pyx_t_8);
14867 __Pyx_XDECREF(__pyx_r);
14868 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1675, __pyx_L4_error)
14869 __Pyx_GOTREF(__pyx_t_3);
14870 __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)
14871 __Pyx_GOTREF(__pyx_t_9);
14872 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14874 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
14875 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
14876 if (likely(__pyx_t_3)) {
14877 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
14878 __Pyx_INCREF(__pyx_t_3);
14879 __Pyx_INCREF(
function);
14880 __Pyx_DECREF_SET(__pyx_t_9,
function);
14883 __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_3, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
14884 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14885 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1675, __pyx_L4_error)
14886 __Pyx_GOTREF(__pyx_t_5);
14887 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14888 __pyx_r = __pyx_t_5;
14890 goto __pyx_L8_try_return;
14901 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14902 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14903 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
14913 __Pyx_AddTraceback(
"PyClical.acosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
14914 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1676, __pyx_L6_except_error)
14915 __Pyx_GOTREF(__pyx_t_5);
14916 __Pyx_GOTREF(__pyx_t_9);
14917 __Pyx_GOTREF(__pyx_t_3);
14926 __Pyx_XDECREF(__pyx_r);
14927 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1677, __pyx_L6_except_error)
14928 __Pyx_GOTREF(__pyx_t_10);
14929 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_10),
acosh(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1677, __pyx_L6_except_error)
14930 __Pyx_GOTREF(__pyx_t_11);
14931 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14932 __pyx_r = __pyx_t_11;
14934 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14935 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14936 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14937 goto __pyx_L7_except_return;
14939 __pyx_L6_except_error:;
14948 __Pyx_XGIVEREF(__pyx_t_6);
14949 __Pyx_XGIVEREF(__pyx_t_7);
14950 __Pyx_XGIVEREF(__pyx_t_8);
14951 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14952 goto __pyx_L1_error;
14953 __pyx_L8_try_return:;
14954 __Pyx_XGIVEREF(__pyx_t_6);
14955 __Pyx_XGIVEREF(__pyx_t_7);
14956 __Pyx_XGIVEREF(__pyx_t_8);
14957 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14959 __pyx_L7_except_return:;
14960 __Pyx_XGIVEREF(__pyx_t_6);
14961 __Pyx_XGIVEREF(__pyx_t_7);
14962 __Pyx_XGIVEREF(__pyx_t_8);
14963 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14978 __Pyx_XDECREF(__pyx_t_3);
14979 __Pyx_XDECREF(__pyx_t_5);
14980 __Pyx_XDECREF(__pyx_t_9);
14981 __Pyx_XDECREF(__pyx_t_10);
14982 __Pyx_XDECREF(__pyx_t_11);
14983 __Pyx_AddTraceback(
"PyClical.acosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
14986 __Pyx_XGIVEREF(__pyx_r);
14987 __Pyx_RefNannyFinishContext();
14992 static PyObject *__pyx_pw_8PyClical_57acosh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14993 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 ";
14994 static PyObject *__pyx_pw_8PyClical_57acosh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14995 PyObject *__pyx_v_obj = 0;
14996 PyObject *__pyx_v_i = 0;
14997 PyObject *__pyx_r = 0;
14998 __Pyx_RefNannyDeclarations
14999 __Pyx_RefNannySetupContext(
"acosh (wrapper)", 0);
15001 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
15002 PyObject* values[2] = {0,0};
15003 values[1] = ((PyObject *)Py_None);
15004 if (unlikely(__pyx_kwds)) {
15005 Py_ssize_t kw_args;
15006 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15007 switch (pos_args) {
15008 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15009 CYTHON_FALLTHROUGH;
15010 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15011 CYTHON_FALLTHROUGH;
15013 default:
goto __pyx_L5_argtuple_error;
15015 kw_args = PyDict_Size(__pyx_kwds);
15016 switch (pos_args) {
15018 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
15019 else goto __pyx_L5_argtuple_error;
15020 CYTHON_FALLTHROUGH;
15023 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
15024 if (value) { values[1] = value; kw_args--; }
15027 if (unlikely(kw_args > 0)) {
15028 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"acosh") < 0)) __PYX_ERR(0, 1656, __pyx_L3_error)
15031 switch (PyTuple_GET_SIZE(__pyx_args)) {
15032 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15033 CYTHON_FALLTHROUGH;
15034 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15036 default:
goto __pyx_L5_argtuple_error;
15039 __pyx_v_obj = values[0];
15040 __pyx_v_i = values[1];
15042 goto __pyx_L4_argument_unpacking_done;
15043 __pyx_L5_argtuple_error:;
15044 __Pyx_RaiseArgtupleInvalid(
"acosh", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1656, __pyx_L3_error)
15046 __Pyx_AddTraceback(
"PyClical.acosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15047 __Pyx_RefNannyFinishContext();
15049 __pyx_L4_argument_unpacking_done:;
15050 __pyx_r = __pyx_pf_8PyClical_56acosh(__pyx_self, __pyx_v_obj, __pyx_v_i);
15053 __Pyx_RefNannyFinishContext();
15057 static PyObject *__pyx_pf_8PyClical_56acosh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
15058 PyObject *__pyx_r = NULL;
15059 __Pyx_RefNannyDeclarations
15060 PyObject *__pyx_t_1 = NULL;
15061 struct __pyx_opt_args_8PyClical_acosh __pyx_t_2;
15062 __Pyx_RefNannySetupContext(
"acosh", 0);
15063 __Pyx_XDECREF(__pyx_r);
15064 __pyx_t_2.__pyx_n = 1;
15065 __pyx_t_2.i = __pyx_v_i;
15066 __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)
15067 __Pyx_GOTREF(__pyx_t_1);
15068 __pyx_r = __pyx_t_1;
15074 __Pyx_XDECREF(__pyx_t_1);
15075 __Pyx_AddTraceback(
"PyClical.acosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15078 __Pyx_XGIVEREF(__pyx_r);
15079 __Pyx_RefNannyFinishContext();
15091 static PyObject *__pyx_pw_8PyClical_59sin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15092 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) {
15093 PyObject *__pyx_v_i = ((PyObject *)Py_None);
15094 PyObject *__pyx_r = NULL;
15095 __Pyx_RefNannyDeclarations
15098 PyObject *__pyx_t_3 = NULL;
15100 PyObject *__pyx_t_5 = NULL;
15101 PyObject *__pyx_t_6 = NULL;
15102 PyObject *__pyx_t_7 = NULL;
15103 PyObject *__pyx_t_8 = NULL;
15104 PyObject *__pyx_t_9 = NULL;
15105 PyObject *__pyx_t_10 = NULL;
15106 PyObject *__pyx_t_11 = NULL;
15107 __Pyx_RefNannySetupContext(
"sin", 0);
15108 if (__pyx_optional_args) {
15109 if (__pyx_optional_args->__pyx_n > 0) {
15110 __pyx_v_i = __pyx_optional_args->i;
15121 __pyx_t_1 = (__pyx_v_i != Py_None);
15122 __pyx_t_2 = (__pyx_t_1 != 0);
15132 __Pyx_XDECREF(__pyx_r);
15133 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1691, __pyx_L1_error)
15134 __Pyx_GOTREF(__pyx_t_3);
15136 __pyx_t_4 =
sin(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
15138 __Pyx_CppExn2PyErr();
15139 __PYX_ERR(0, 1691, __pyx_L1_error)
15141 __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)
15142 __Pyx_GOTREF(__pyx_t_5);
15143 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15144 __pyx_r = __pyx_t_5;
15166 __Pyx_PyThreadState_declare
15167 __Pyx_PyThreadState_assign
15168 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
15169 __Pyx_XGOTREF(__pyx_t_6);
15170 __Pyx_XGOTREF(__pyx_t_7);
15171 __Pyx_XGOTREF(__pyx_t_8);
15181 __Pyx_XDECREF(__pyx_r);
15182 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1694, __pyx_L4_error)
15183 __Pyx_GOTREF(__pyx_t_3);
15184 __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)
15185 __Pyx_GOTREF(__pyx_t_9);
15186 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15188 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
15189 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
15190 if (likely(__pyx_t_3)) {
15191 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
15192 __Pyx_INCREF(__pyx_t_3);
15193 __Pyx_INCREF(
function);
15194 __Pyx_DECREF_SET(__pyx_t_9,
function);
15197 __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_3, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
15198 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15199 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1694, __pyx_L4_error)
15200 __Pyx_GOTREF(__pyx_t_5);
15201 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15202 __pyx_r = __pyx_t_5;
15204 goto __pyx_L8_try_return;
15215 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15216 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15217 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
15227 __Pyx_AddTraceback(
"PyClical.sin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15228 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1695, __pyx_L6_except_error)
15229 __Pyx_GOTREF(__pyx_t_5);
15230 __Pyx_GOTREF(__pyx_t_9);
15231 __Pyx_GOTREF(__pyx_t_3);
15240 __Pyx_XDECREF(__pyx_r);
15241 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1696, __pyx_L6_except_error)
15242 __Pyx_GOTREF(__pyx_t_10);
15243 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_10),
sin(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1696, __pyx_L6_except_error)
15244 __Pyx_GOTREF(__pyx_t_11);
15245 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15246 __pyx_r = __pyx_t_11;
15248 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15249 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15250 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15251 goto __pyx_L7_except_return;
15253 __pyx_L6_except_error:;
15262 __Pyx_XGIVEREF(__pyx_t_6);
15263 __Pyx_XGIVEREF(__pyx_t_7);
15264 __Pyx_XGIVEREF(__pyx_t_8);
15265 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15266 goto __pyx_L1_error;
15267 __pyx_L8_try_return:;
15268 __Pyx_XGIVEREF(__pyx_t_6);
15269 __Pyx_XGIVEREF(__pyx_t_7);
15270 __Pyx_XGIVEREF(__pyx_t_8);
15271 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15273 __pyx_L7_except_return:;
15274 __Pyx_XGIVEREF(__pyx_t_6);
15275 __Pyx_XGIVEREF(__pyx_t_7);
15276 __Pyx_XGIVEREF(__pyx_t_8);
15277 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15292 __Pyx_XDECREF(__pyx_t_3);
15293 __Pyx_XDECREF(__pyx_t_5);
15294 __Pyx_XDECREF(__pyx_t_9);
15295 __Pyx_XDECREF(__pyx_t_10);
15296 __Pyx_XDECREF(__pyx_t_11);
15297 __Pyx_AddTraceback(
"PyClical.sin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15300 __Pyx_XGIVEREF(__pyx_r);
15301 __Pyx_RefNannyFinishContext();
15306 static PyObject *__pyx_pw_8PyClical_59sin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15307 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 ";
15308 static PyObject *__pyx_pw_8PyClical_59sin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15309 PyObject *__pyx_v_obj = 0;
15310 PyObject *__pyx_v_i = 0;
15311 PyObject *__pyx_r = 0;
15312 __Pyx_RefNannyDeclarations
15313 __Pyx_RefNannySetupContext(
"sin (wrapper)", 0);
15315 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
15316 PyObject* values[2] = {0,0};
15317 values[1] = ((PyObject *)Py_None);
15318 if (unlikely(__pyx_kwds)) {
15319 Py_ssize_t kw_args;
15320 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15321 switch (pos_args) {
15322 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15323 CYTHON_FALLTHROUGH;
15324 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15325 CYTHON_FALLTHROUGH;
15327 default:
goto __pyx_L5_argtuple_error;
15329 kw_args = PyDict_Size(__pyx_kwds);
15330 switch (pos_args) {
15332 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
15333 else goto __pyx_L5_argtuple_error;
15334 CYTHON_FALLTHROUGH;
15337 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
15338 if (value) { values[1] = value; kw_args--; }
15341 if (unlikely(kw_args > 0)) {
15342 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"sin") < 0)) __PYX_ERR(0, 1679, __pyx_L3_error)
15345 switch (PyTuple_GET_SIZE(__pyx_args)) {
15346 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15347 CYTHON_FALLTHROUGH;
15348 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15350 default:
goto __pyx_L5_argtuple_error;
15353 __pyx_v_obj = values[0];
15354 __pyx_v_i = values[1];
15356 goto __pyx_L4_argument_unpacking_done;
15357 __pyx_L5_argtuple_error:;
15358 __Pyx_RaiseArgtupleInvalid(
"sin", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1679, __pyx_L3_error)
15360 __Pyx_AddTraceback(
"PyClical.sin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15361 __Pyx_RefNannyFinishContext();
15363 __pyx_L4_argument_unpacking_done:;
15364 __pyx_r = __pyx_pf_8PyClical_58sin(__pyx_self, __pyx_v_obj, __pyx_v_i);
15367 __Pyx_RefNannyFinishContext();
15371 static PyObject *__pyx_pf_8PyClical_58sin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
15372 PyObject *__pyx_r = NULL;
15373 __Pyx_RefNannyDeclarations
15374 PyObject *__pyx_t_1 = NULL;
15375 struct __pyx_opt_args_8PyClical_sin __pyx_t_2;
15376 __Pyx_RefNannySetupContext(
"sin", 0);
15377 __Pyx_XDECREF(__pyx_r);
15378 __pyx_t_2.__pyx_n = 1;
15379 __pyx_t_2.i = __pyx_v_i;
15380 __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)
15381 __Pyx_GOTREF(__pyx_t_1);
15382 __pyx_r = __pyx_t_1;
15388 __Pyx_XDECREF(__pyx_t_1);
15389 __Pyx_AddTraceback(
"PyClical.sin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15392 __Pyx_XGIVEREF(__pyx_r);
15393 __Pyx_RefNannyFinishContext();
15405 static PyObject *__pyx_pw_8PyClical_61asin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15406 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) {
15407 PyObject *__pyx_v_i = ((PyObject *)Py_None);
15408 PyObject *__pyx_r = NULL;
15409 __Pyx_RefNannyDeclarations
15412 PyObject *__pyx_t_3 = NULL;
15414 PyObject *__pyx_t_5 = NULL;
15415 PyObject *__pyx_t_6 = NULL;
15416 PyObject *__pyx_t_7 = NULL;
15417 PyObject *__pyx_t_8 = NULL;
15418 PyObject *__pyx_t_9 = NULL;
15419 PyObject *__pyx_t_10 = NULL;
15420 PyObject *__pyx_t_11 = NULL;
15421 __Pyx_RefNannySetupContext(
"asin", 0);
15422 if (__pyx_optional_args) {
15423 if (__pyx_optional_args->__pyx_n > 0) {
15424 __pyx_v_i = __pyx_optional_args->i;
15435 __pyx_t_1 = (__pyx_v_i != Py_None);
15436 __pyx_t_2 = (__pyx_t_1 != 0);
15446 __Pyx_XDECREF(__pyx_r);
15447 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1712, __pyx_L1_error)
15448 __Pyx_GOTREF(__pyx_t_3);
15450 __pyx_t_4 =
asin(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
15452 __Pyx_CppExn2PyErr();
15453 __PYX_ERR(0, 1712, __pyx_L1_error)
15455 __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)
15456 __Pyx_GOTREF(__pyx_t_5);
15457 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15458 __pyx_r = __pyx_t_5;
15480 __Pyx_PyThreadState_declare
15481 __Pyx_PyThreadState_assign
15482 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
15483 __Pyx_XGOTREF(__pyx_t_6);
15484 __Pyx_XGOTREF(__pyx_t_7);
15485 __Pyx_XGOTREF(__pyx_t_8);
15495 __Pyx_XDECREF(__pyx_r);
15496 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1715, __pyx_L4_error)
15497 __Pyx_GOTREF(__pyx_t_3);
15498 __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)
15499 __Pyx_GOTREF(__pyx_t_9);
15500 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15502 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
15503 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
15504 if (likely(__pyx_t_3)) {
15505 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
15506 __Pyx_INCREF(__pyx_t_3);
15507 __Pyx_INCREF(
function);
15508 __Pyx_DECREF_SET(__pyx_t_9,
function);
15511 __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_3, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
15512 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15513 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1715, __pyx_L4_error)
15514 __Pyx_GOTREF(__pyx_t_5);
15515 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15516 __pyx_r = __pyx_t_5;
15518 goto __pyx_L8_try_return;
15529 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15530 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15531 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
15541 __Pyx_AddTraceback(
"PyClical.asin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15542 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1716, __pyx_L6_except_error)
15543 __Pyx_GOTREF(__pyx_t_5);
15544 __Pyx_GOTREF(__pyx_t_9);
15545 __Pyx_GOTREF(__pyx_t_3);
15554 __Pyx_XDECREF(__pyx_r);
15555 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1717, __pyx_L6_except_error)
15556 __Pyx_GOTREF(__pyx_t_10);
15557 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_10),
asin(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1717, __pyx_L6_except_error)
15558 __Pyx_GOTREF(__pyx_t_11);
15559 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15560 __pyx_r = __pyx_t_11;
15562 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15563 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15564 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15565 goto __pyx_L7_except_return;
15567 __pyx_L6_except_error:;
15576 __Pyx_XGIVEREF(__pyx_t_6);
15577 __Pyx_XGIVEREF(__pyx_t_7);
15578 __Pyx_XGIVEREF(__pyx_t_8);
15579 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15580 goto __pyx_L1_error;
15581 __pyx_L8_try_return:;
15582 __Pyx_XGIVEREF(__pyx_t_6);
15583 __Pyx_XGIVEREF(__pyx_t_7);
15584 __Pyx_XGIVEREF(__pyx_t_8);
15585 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15587 __pyx_L7_except_return:;
15588 __Pyx_XGIVEREF(__pyx_t_6);
15589 __Pyx_XGIVEREF(__pyx_t_7);
15590 __Pyx_XGIVEREF(__pyx_t_8);
15591 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15606 __Pyx_XDECREF(__pyx_t_3);
15607 __Pyx_XDECREF(__pyx_t_5);
15608 __Pyx_XDECREF(__pyx_t_9);
15609 __Pyx_XDECREF(__pyx_t_10);
15610 __Pyx_XDECREF(__pyx_t_11);
15611 __Pyx_AddTraceback(
"PyClical.asin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15614 __Pyx_XGIVEREF(__pyx_r);
15615 __Pyx_RefNannyFinishContext();
15620 static PyObject *__pyx_pw_8PyClical_61asin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15621 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 ";
15622 static PyObject *__pyx_pw_8PyClical_61asin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15623 PyObject *__pyx_v_obj = 0;
15624 PyObject *__pyx_v_i = 0;
15625 PyObject *__pyx_r = 0;
15626 __Pyx_RefNannyDeclarations
15627 __Pyx_RefNannySetupContext(
"asin (wrapper)", 0);
15629 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
15630 PyObject* values[2] = {0,0};
15631 values[1] = ((PyObject *)Py_None);
15632 if (unlikely(__pyx_kwds)) {
15633 Py_ssize_t kw_args;
15634 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15635 switch (pos_args) {
15636 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15637 CYTHON_FALLTHROUGH;
15638 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15639 CYTHON_FALLTHROUGH;
15641 default:
goto __pyx_L5_argtuple_error;
15643 kw_args = PyDict_Size(__pyx_kwds);
15644 switch (pos_args) {
15646 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
15647 else goto __pyx_L5_argtuple_error;
15648 CYTHON_FALLTHROUGH;
15651 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
15652 if (value) { values[1] = value; kw_args--; }
15655 if (unlikely(kw_args > 0)) {
15656 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"asin") < 0)) __PYX_ERR(0, 1698, __pyx_L3_error)
15659 switch (PyTuple_GET_SIZE(__pyx_args)) {
15660 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15661 CYTHON_FALLTHROUGH;
15662 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15664 default:
goto __pyx_L5_argtuple_error;
15667 __pyx_v_obj = values[0];
15668 __pyx_v_i = values[1];
15670 goto __pyx_L4_argument_unpacking_done;
15671 __pyx_L5_argtuple_error:;
15672 __Pyx_RaiseArgtupleInvalid(
"asin", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1698, __pyx_L3_error)
15674 __Pyx_AddTraceback(
"PyClical.asin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15675 __Pyx_RefNannyFinishContext();
15677 __pyx_L4_argument_unpacking_done:;
15678 __pyx_r = __pyx_pf_8PyClical_60asin(__pyx_self, __pyx_v_obj, __pyx_v_i);
15681 __Pyx_RefNannyFinishContext();
15685 static PyObject *__pyx_pf_8PyClical_60asin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
15686 PyObject *__pyx_r = NULL;
15687 __Pyx_RefNannyDeclarations
15688 PyObject *__pyx_t_1 = NULL;
15689 struct __pyx_opt_args_8PyClical_asin __pyx_t_2;
15690 __Pyx_RefNannySetupContext(
"asin", 0);
15691 __Pyx_XDECREF(__pyx_r);
15692 __pyx_t_2.__pyx_n = 1;
15693 __pyx_t_2.i = __pyx_v_i;
15694 __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)
15695 __Pyx_GOTREF(__pyx_t_1);
15696 __pyx_r = __pyx_t_1;
15702 __Pyx_XDECREF(__pyx_t_1);
15703 __Pyx_AddTraceback(
"PyClical.asin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15706 __Pyx_XGIVEREF(__pyx_r);
15707 __Pyx_RefNannyFinishContext();
15719 static PyObject *__pyx_pw_8PyClical_63sinh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
15720 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_sinh(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
15721 PyObject *__pyx_r = NULL;
15722 __Pyx_RefNannyDeclarations
15723 PyObject *__pyx_t_1 = NULL;
15724 PyObject *__pyx_t_2 = NULL;
15725 PyObject *__pyx_t_3 = NULL;
15726 PyObject *__pyx_t_4 = NULL;
15727 PyObject *__pyx_t_5 = NULL;
15728 PyObject *__pyx_t_6 = NULL;
15729 PyObject *__pyx_t_7 = NULL;
15730 PyObject *__pyx_t_8 = NULL;
15731 __Pyx_RefNannySetupContext(
"sinh", 0);
15741 __Pyx_PyThreadState_declare
15742 __Pyx_PyThreadState_assign
15743 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
15744 __Pyx_XGOTREF(__pyx_t_1);
15745 __Pyx_XGOTREF(__pyx_t_2);
15746 __Pyx_XGOTREF(__pyx_t_3);
15756 __Pyx_XDECREF(__pyx_r);
15757 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1729, __pyx_L3_error)
15758 __Pyx_GOTREF(__pyx_t_5);
15759 __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)
15760 __Pyx_GOTREF(__pyx_t_6);
15761 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15763 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
15764 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
15765 if (likely(__pyx_t_5)) {
15766 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
15767 __Pyx_INCREF(__pyx_t_5);
15768 __Pyx_INCREF(
function);
15769 __Pyx_DECREF_SET(__pyx_t_6,
function);
15772 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_obj);
15773 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15774 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1729, __pyx_L3_error)
15775 __Pyx_GOTREF(__pyx_t_4);
15776 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15777 __pyx_r = __pyx_t_4;
15779 goto __pyx_L7_try_return;
15790 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
15791 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15792 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
15802 __Pyx_AddTraceback(
"PyClical.sinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15803 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(0, 1730, __pyx_L5_except_error)
15804 __Pyx_GOTREF(__pyx_t_4);
15805 __Pyx_GOTREF(__pyx_t_6);
15806 __Pyx_GOTREF(__pyx_t_5);
15815 __Pyx_XDECREF(__pyx_r);
15816 __pyx_t_7 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1731, __pyx_L5_except_error)
15817 __Pyx_GOTREF(__pyx_t_7);
15818 __pyx_t_8 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_7),
sinh(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1731, __pyx_L5_except_error)
15819 __Pyx_GOTREF(__pyx_t_8);
15820 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15821 __pyx_r = __pyx_t_8;
15823 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15824 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15825 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15826 goto __pyx_L6_except_return;
15828 __pyx_L5_except_error:;
15837 __Pyx_XGIVEREF(__pyx_t_1);
15838 __Pyx_XGIVEREF(__pyx_t_2);
15839 __Pyx_XGIVEREF(__pyx_t_3);
15840 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
15841 goto __pyx_L1_error;
15842 __pyx_L7_try_return:;
15843 __Pyx_XGIVEREF(__pyx_t_1);
15844 __Pyx_XGIVEREF(__pyx_t_2);
15845 __Pyx_XGIVEREF(__pyx_t_3);
15846 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
15848 __pyx_L6_except_return:;
15849 __Pyx_XGIVEREF(__pyx_t_1);
15850 __Pyx_XGIVEREF(__pyx_t_2);
15851 __Pyx_XGIVEREF(__pyx_t_3);
15852 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
15866 __Pyx_XDECREF(__pyx_t_4);
15867 __Pyx_XDECREF(__pyx_t_5);
15868 __Pyx_XDECREF(__pyx_t_6);
15869 __Pyx_XDECREF(__pyx_t_7);
15870 __Pyx_XDECREF(__pyx_t_8);
15871 __Pyx_AddTraceback(
"PyClical.sinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15874 __Pyx_XGIVEREF(__pyx_r);
15875 __Pyx_RefNannyFinishContext();
15880 static PyObject *__pyx_pw_8PyClical_63sinh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
15881 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 ";
15882 static PyObject *__pyx_pw_8PyClical_63sinh(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
15883 PyObject *__pyx_r = 0;
15884 __Pyx_RefNannyDeclarations
15885 __Pyx_RefNannySetupContext(
"sinh (wrapper)", 0);
15886 __pyx_r = __pyx_pf_8PyClical_62sinh(__pyx_self, ((PyObject *)__pyx_v_obj));
15889 __Pyx_RefNannyFinishContext();
15893 static PyObject *__pyx_pf_8PyClical_62sinh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
15894 PyObject *__pyx_r = NULL;
15895 __Pyx_RefNannyDeclarations
15896 PyObject *__pyx_t_1 = NULL;
15897 __Pyx_RefNannySetupContext(
"sinh", 0);
15898 __Pyx_XDECREF(__pyx_r);
15899 __pyx_t_1 = __pyx_f_8PyClical_sinh(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1719, __pyx_L1_error)
15900 __Pyx_GOTREF(__pyx_t_1);
15901 __pyx_r = __pyx_t_1;
15907 __Pyx_XDECREF(__pyx_t_1);
15908 __Pyx_AddTraceback(
"PyClical.sinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15911 __Pyx_XGIVEREF(__pyx_r);
15912 __Pyx_RefNannyFinishContext();
15924 static PyObject *__pyx_pw_8PyClical_65asinh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15925 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) {
15926 PyObject *__pyx_v_i = ((PyObject *)Py_None);
15927 PyObject *__pyx_r = NULL;
15928 __Pyx_RefNannyDeclarations
15931 PyObject *__pyx_t_3 = NULL;
15933 PyObject *__pyx_t_5 = NULL;
15934 PyObject *__pyx_t_6 = NULL;
15935 PyObject *__pyx_t_7 = NULL;
15936 PyObject *__pyx_t_8 = NULL;
15937 PyObject *__pyx_t_9 = NULL;
15938 PyObject *__pyx_t_10 = NULL;
15939 PyObject *__pyx_t_11 = NULL;
15940 __Pyx_RefNannySetupContext(
"asinh", 0);
15941 if (__pyx_optional_args) {
15942 if (__pyx_optional_args->__pyx_n > 0) {
15943 __pyx_v_i = __pyx_optional_args->i;
15954 __pyx_t_1 = (__pyx_v_i != Py_None);
15955 __pyx_t_2 = (__pyx_t_1 != 0);
15965 __Pyx_XDECREF(__pyx_r);
15966 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1745, __pyx_L1_error)
15967 __Pyx_GOTREF(__pyx_t_3);
15969 __pyx_t_4 =
asinh(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
15971 __Pyx_CppExn2PyErr();
15972 __PYX_ERR(0, 1745, __pyx_L1_error)
15974 __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)
15975 __Pyx_GOTREF(__pyx_t_5);
15976 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15977 __pyx_r = __pyx_t_5;
15999 __Pyx_PyThreadState_declare
16000 __Pyx_PyThreadState_assign
16001 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
16002 __Pyx_XGOTREF(__pyx_t_6);
16003 __Pyx_XGOTREF(__pyx_t_7);
16004 __Pyx_XGOTREF(__pyx_t_8);
16014 __Pyx_XDECREF(__pyx_r);
16015 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1748, __pyx_L4_error)
16016 __Pyx_GOTREF(__pyx_t_3);
16017 __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)
16018 __Pyx_GOTREF(__pyx_t_9);
16019 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16021 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
16022 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
16023 if (likely(__pyx_t_3)) {
16024 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
16025 __Pyx_INCREF(__pyx_t_3);
16026 __Pyx_INCREF(
function);
16027 __Pyx_DECREF_SET(__pyx_t_9,
function);
16030 __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_3, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
16031 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16032 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1748, __pyx_L4_error)
16033 __Pyx_GOTREF(__pyx_t_5);
16034 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16035 __pyx_r = __pyx_t_5;
16037 goto __pyx_L8_try_return;
16048 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16049 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16050 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
16060 __Pyx_AddTraceback(
"PyClical.asinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16061 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1749, __pyx_L6_except_error)
16062 __Pyx_GOTREF(__pyx_t_5);
16063 __Pyx_GOTREF(__pyx_t_9);
16064 __Pyx_GOTREF(__pyx_t_3);
16073 __Pyx_XDECREF(__pyx_r);
16074 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1750, __pyx_L6_except_error)
16075 __Pyx_GOTREF(__pyx_t_10);
16076 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_10),
asinh(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1750, __pyx_L6_except_error)
16077 __Pyx_GOTREF(__pyx_t_11);
16078 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16079 __pyx_r = __pyx_t_11;
16081 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16082 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16083 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16084 goto __pyx_L7_except_return;
16086 __pyx_L6_except_error:;
16095 __Pyx_XGIVEREF(__pyx_t_6);
16096 __Pyx_XGIVEREF(__pyx_t_7);
16097 __Pyx_XGIVEREF(__pyx_t_8);
16098 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16099 goto __pyx_L1_error;
16100 __pyx_L8_try_return:;
16101 __Pyx_XGIVEREF(__pyx_t_6);
16102 __Pyx_XGIVEREF(__pyx_t_7);
16103 __Pyx_XGIVEREF(__pyx_t_8);
16104 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16106 __pyx_L7_except_return:;
16107 __Pyx_XGIVEREF(__pyx_t_6);
16108 __Pyx_XGIVEREF(__pyx_t_7);
16109 __Pyx_XGIVEREF(__pyx_t_8);
16110 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16125 __Pyx_XDECREF(__pyx_t_3);
16126 __Pyx_XDECREF(__pyx_t_5);
16127 __Pyx_XDECREF(__pyx_t_9);
16128 __Pyx_XDECREF(__pyx_t_10);
16129 __Pyx_XDECREF(__pyx_t_11);
16130 __Pyx_AddTraceback(
"PyClical.asinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16133 __Pyx_XGIVEREF(__pyx_r);
16134 __Pyx_RefNannyFinishContext();
16139 static PyObject *__pyx_pw_8PyClical_65asinh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16140 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 ";
16141 static PyObject *__pyx_pw_8PyClical_65asinh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16142 PyObject *__pyx_v_obj = 0;
16143 PyObject *__pyx_v_i = 0;
16144 PyObject *__pyx_r = 0;
16145 __Pyx_RefNannyDeclarations
16146 __Pyx_RefNannySetupContext(
"asinh (wrapper)", 0);
16148 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
16149 PyObject* values[2] = {0,0};
16150 values[1] = ((PyObject *)Py_None);
16151 if (unlikely(__pyx_kwds)) {
16152 Py_ssize_t kw_args;
16153 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16154 switch (pos_args) {
16155 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16156 CYTHON_FALLTHROUGH;
16157 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16158 CYTHON_FALLTHROUGH;
16160 default:
goto __pyx_L5_argtuple_error;
16162 kw_args = PyDict_Size(__pyx_kwds);
16163 switch (pos_args) {
16165 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
16166 else goto __pyx_L5_argtuple_error;
16167 CYTHON_FALLTHROUGH;
16170 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
16171 if (value) { values[1] = value; kw_args--; }
16174 if (unlikely(kw_args > 0)) {
16175 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"asinh") < 0)) __PYX_ERR(0, 1733, __pyx_L3_error)
16178 switch (PyTuple_GET_SIZE(__pyx_args)) {
16179 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16180 CYTHON_FALLTHROUGH;
16181 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16183 default:
goto __pyx_L5_argtuple_error;
16186 __pyx_v_obj = values[0];
16187 __pyx_v_i = values[1];
16189 goto __pyx_L4_argument_unpacking_done;
16190 __pyx_L5_argtuple_error:;
16191 __Pyx_RaiseArgtupleInvalid(
"asinh", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1733, __pyx_L3_error)
16193 __Pyx_AddTraceback(
"PyClical.asinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16194 __Pyx_RefNannyFinishContext();
16196 __pyx_L4_argument_unpacking_done:;
16197 __pyx_r = __pyx_pf_8PyClical_64asinh(__pyx_self, __pyx_v_obj, __pyx_v_i);
16200 __Pyx_RefNannyFinishContext();
16204 static PyObject *__pyx_pf_8PyClical_64asinh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
16205 PyObject *__pyx_r = NULL;
16206 __Pyx_RefNannyDeclarations
16207 PyObject *__pyx_t_1 = NULL;
16208 struct __pyx_opt_args_8PyClical_asinh __pyx_t_2;
16209 __Pyx_RefNannySetupContext(
"asinh", 0);
16210 __Pyx_XDECREF(__pyx_r);
16211 __pyx_t_2.__pyx_n = 1;
16212 __pyx_t_2.i = __pyx_v_i;
16213 __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)
16214 __Pyx_GOTREF(__pyx_t_1);
16215 __pyx_r = __pyx_t_1;
16221 __Pyx_XDECREF(__pyx_t_1);
16222 __Pyx_AddTraceback(
"PyClical.asinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16225 __Pyx_XGIVEREF(__pyx_r);
16226 __Pyx_RefNannyFinishContext();
16238 static PyObject *__pyx_pw_8PyClical_67tan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16239 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) {
16240 PyObject *__pyx_v_i = ((PyObject *)Py_None);
16241 PyObject *__pyx_r = NULL;
16242 __Pyx_RefNannyDeclarations
16245 PyObject *__pyx_t_3 = NULL;
16247 PyObject *__pyx_t_5 = NULL;
16248 PyObject *__pyx_t_6 = NULL;
16249 PyObject *__pyx_t_7 = NULL;
16250 PyObject *__pyx_t_8 = NULL;
16251 PyObject *__pyx_t_9 = NULL;
16252 PyObject *__pyx_t_10 = NULL;
16253 PyObject *__pyx_t_11 = NULL;
16254 __Pyx_RefNannySetupContext(
"tan", 0);
16255 if (__pyx_optional_args) {
16256 if (__pyx_optional_args->__pyx_n > 0) {
16257 __pyx_v_i = __pyx_optional_args->i;
16268 __pyx_t_1 = (__pyx_v_i != Py_None);
16269 __pyx_t_2 = (__pyx_t_1 != 0);
16279 __Pyx_XDECREF(__pyx_r);
16280 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1762, __pyx_L1_error)
16281 __Pyx_GOTREF(__pyx_t_3);
16283 __pyx_t_4 =
tan(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
16285 __Pyx_CppExn2PyErr();
16286 __PYX_ERR(0, 1762, __pyx_L1_error)
16288 __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)
16289 __Pyx_GOTREF(__pyx_t_5);
16290 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16291 __pyx_r = __pyx_t_5;
16313 __Pyx_PyThreadState_declare
16314 __Pyx_PyThreadState_assign
16315 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
16316 __Pyx_XGOTREF(__pyx_t_6);
16317 __Pyx_XGOTREF(__pyx_t_7);
16318 __Pyx_XGOTREF(__pyx_t_8);
16328 __Pyx_XDECREF(__pyx_r);
16329 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1765, __pyx_L4_error)
16330 __Pyx_GOTREF(__pyx_t_3);
16331 __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)
16332 __Pyx_GOTREF(__pyx_t_9);
16333 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16335 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
16336 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
16337 if (likely(__pyx_t_3)) {
16338 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
16339 __Pyx_INCREF(__pyx_t_3);
16340 __Pyx_INCREF(
function);
16341 __Pyx_DECREF_SET(__pyx_t_9,
function);
16344 __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_3, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
16345 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16346 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1765, __pyx_L4_error)
16347 __Pyx_GOTREF(__pyx_t_5);
16348 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16349 __pyx_r = __pyx_t_5;
16351 goto __pyx_L8_try_return;
16362 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16363 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16364 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
16374 __Pyx_AddTraceback(
"PyClical.tan", __pyx_clineno, __pyx_lineno, __pyx_filename);
16375 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1766, __pyx_L6_except_error)
16376 __Pyx_GOTREF(__pyx_t_5);
16377 __Pyx_GOTREF(__pyx_t_9);
16378 __Pyx_GOTREF(__pyx_t_3);
16387 __Pyx_XDECREF(__pyx_r);
16388 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1767, __pyx_L6_except_error)
16389 __Pyx_GOTREF(__pyx_t_10);
16390 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_10),
tan(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1767, __pyx_L6_except_error)
16391 __Pyx_GOTREF(__pyx_t_11);
16392 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16393 __pyx_r = __pyx_t_11;
16395 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16396 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16397 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16398 goto __pyx_L7_except_return;
16400 __pyx_L6_except_error:;
16409 __Pyx_XGIVEREF(__pyx_t_6);
16410 __Pyx_XGIVEREF(__pyx_t_7);
16411 __Pyx_XGIVEREF(__pyx_t_8);
16412 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16413 goto __pyx_L1_error;
16414 __pyx_L8_try_return:;
16415 __Pyx_XGIVEREF(__pyx_t_6);
16416 __Pyx_XGIVEREF(__pyx_t_7);
16417 __Pyx_XGIVEREF(__pyx_t_8);
16418 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16420 __pyx_L7_except_return:;
16421 __Pyx_XGIVEREF(__pyx_t_6);
16422 __Pyx_XGIVEREF(__pyx_t_7);
16423 __Pyx_XGIVEREF(__pyx_t_8);
16424 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16439 __Pyx_XDECREF(__pyx_t_3);
16440 __Pyx_XDECREF(__pyx_t_5);
16441 __Pyx_XDECREF(__pyx_t_9);
16442 __Pyx_XDECREF(__pyx_t_10);
16443 __Pyx_XDECREF(__pyx_t_11);
16444 __Pyx_AddTraceback(
"PyClical.tan", __pyx_clineno, __pyx_lineno, __pyx_filename);
16447 __Pyx_XGIVEREF(__pyx_r);
16448 __Pyx_RefNannyFinishContext();
16453 static PyObject *__pyx_pw_8PyClical_67tan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16454 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 ";
16455 static PyObject *__pyx_pw_8PyClical_67tan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16456 PyObject *__pyx_v_obj = 0;
16457 PyObject *__pyx_v_i = 0;
16458 PyObject *__pyx_r = 0;
16459 __Pyx_RefNannyDeclarations
16460 __Pyx_RefNannySetupContext(
"tan (wrapper)", 0);
16462 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
16463 PyObject* values[2] = {0,0};
16464 values[1] = ((PyObject *)Py_None);
16465 if (unlikely(__pyx_kwds)) {
16466 Py_ssize_t kw_args;
16467 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16468 switch (pos_args) {
16469 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16470 CYTHON_FALLTHROUGH;
16471 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16472 CYTHON_FALLTHROUGH;
16474 default:
goto __pyx_L5_argtuple_error;
16476 kw_args = PyDict_Size(__pyx_kwds);
16477 switch (pos_args) {
16479 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
16480 else goto __pyx_L5_argtuple_error;
16481 CYTHON_FALLTHROUGH;
16484 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
16485 if (value) { values[1] = value; kw_args--; }
16488 if (unlikely(kw_args > 0)) {
16489 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"tan") < 0)) __PYX_ERR(0, 1752, __pyx_L3_error)
16492 switch (PyTuple_GET_SIZE(__pyx_args)) {
16493 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16494 CYTHON_FALLTHROUGH;
16495 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16497 default:
goto __pyx_L5_argtuple_error;
16500 __pyx_v_obj = values[0];
16501 __pyx_v_i = values[1];
16503 goto __pyx_L4_argument_unpacking_done;
16504 __pyx_L5_argtuple_error:;
16505 __Pyx_RaiseArgtupleInvalid(
"tan", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1752, __pyx_L3_error)
16507 __Pyx_AddTraceback(
"PyClical.tan", __pyx_clineno, __pyx_lineno, __pyx_filename);
16508 __Pyx_RefNannyFinishContext();
16510 __pyx_L4_argument_unpacking_done:;
16511 __pyx_r = __pyx_pf_8PyClical_66tan(__pyx_self, __pyx_v_obj, __pyx_v_i);
16514 __Pyx_RefNannyFinishContext();
16518 static PyObject *__pyx_pf_8PyClical_66tan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
16519 PyObject *__pyx_r = NULL;
16520 __Pyx_RefNannyDeclarations
16521 PyObject *__pyx_t_1 = NULL;
16522 struct __pyx_opt_args_8PyClical_tan __pyx_t_2;
16523 __Pyx_RefNannySetupContext(
"tan", 0);
16524 __Pyx_XDECREF(__pyx_r);
16525 __pyx_t_2.__pyx_n = 1;
16526 __pyx_t_2.i = __pyx_v_i;
16527 __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)
16528 __Pyx_GOTREF(__pyx_t_1);
16529 __pyx_r = __pyx_t_1;
16535 __Pyx_XDECREF(__pyx_t_1);
16536 __Pyx_AddTraceback(
"PyClical.tan", __pyx_clineno, __pyx_lineno, __pyx_filename);
16539 __Pyx_XGIVEREF(__pyx_r);
16540 __Pyx_RefNannyFinishContext();
16552 static PyObject *__pyx_pw_8PyClical_69atan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16553 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) {
16554 PyObject *__pyx_v_i = ((PyObject *)Py_None);
16555 PyObject *__pyx_r = NULL;
16556 __Pyx_RefNannyDeclarations
16559 PyObject *__pyx_t_3 = NULL;
16561 PyObject *__pyx_t_5 = NULL;
16562 PyObject *__pyx_t_6 = NULL;
16563 PyObject *__pyx_t_7 = NULL;
16564 PyObject *__pyx_t_8 = NULL;
16565 PyObject *__pyx_t_9 = NULL;
16566 PyObject *__pyx_t_10 = NULL;
16567 PyObject *__pyx_t_11 = NULL;
16568 __Pyx_RefNannySetupContext(
"atan", 0);
16569 if (__pyx_optional_args) {
16570 if (__pyx_optional_args->__pyx_n > 0) {
16571 __pyx_v_i = __pyx_optional_args->i;
16582 __pyx_t_1 = (__pyx_v_i != Py_None);
16583 __pyx_t_2 = (__pyx_t_1 != 0);
16593 __Pyx_XDECREF(__pyx_r);
16594 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1779, __pyx_L1_error)
16595 __Pyx_GOTREF(__pyx_t_3);
16597 __pyx_t_4 =
atan(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
16599 __Pyx_CppExn2PyErr();
16600 __PYX_ERR(0, 1779, __pyx_L1_error)
16602 __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)
16603 __Pyx_GOTREF(__pyx_t_5);
16604 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16605 __pyx_r = __pyx_t_5;
16627 __Pyx_PyThreadState_declare
16628 __Pyx_PyThreadState_assign
16629 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
16630 __Pyx_XGOTREF(__pyx_t_6);
16631 __Pyx_XGOTREF(__pyx_t_7);
16632 __Pyx_XGOTREF(__pyx_t_8);
16642 __Pyx_XDECREF(__pyx_r);
16643 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1782, __pyx_L4_error)
16644 __Pyx_GOTREF(__pyx_t_3);
16645 __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)
16646 __Pyx_GOTREF(__pyx_t_9);
16647 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16649 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
16650 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
16651 if (likely(__pyx_t_3)) {
16652 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
16653 __Pyx_INCREF(__pyx_t_3);
16654 __Pyx_INCREF(
function);
16655 __Pyx_DECREF_SET(__pyx_t_9,
function);
16658 __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_3, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
16659 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16660 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1782, __pyx_L4_error)
16661 __Pyx_GOTREF(__pyx_t_5);
16662 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16663 __pyx_r = __pyx_t_5;
16665 goto __pyx_L8_try_return;
16676 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16677 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16678 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
16688 __Pyx_AddTraceback(
"PyClical.atan", __pyx_clineno, __pyx_lineno, __pyx_filename);
16689 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1783, __pyx_L6_except_error)
16690 __Pyx_GOTREF(__pyx_t_5);
16691 __Pyx_GOTREF(__pyx_t_9);
16692 __Pyx_GOTREF(__pyx_t_3);
16701 __Pyx_XDECREF(__pyx_r);
16702 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1784, __pyx_L6_except_error)
16703 __Pyx_GOTREF(__pyx_t_10);
16704 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_10),
atan(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1784, __pyx_L6_except_error)
16705 __Pyx_GOTREF(__pyx_t_11);
16706 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16707 __pyx_r = __pyx_t_11;
16709 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16710 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16711 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16712 goto __pyx_L7_except_return;
16714 __pyx_L6_except_error:;
16723 __Pyx_XGIVEREF(__pyx_t_6);
16724 __Pyx_XGIVEREF(__pyx_t_7);
16725 __Pyx_XGIVEREF(__pyx_t_8);
16726 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16727 goto __pyx_L1_error;
16728 __pyx_L8_try_return:;
16729 __Pyx_XGIVEREF(__pyx_t_6);
16730 __Pyx_XGIVEREF(__pyx_t_7);
16731 __Pyx_XGIVEREF(__pyx_t_8);
16732 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16734 __pyx_L7_except_return:;
16735 __Pyx_XGIVEREF(__pyx_t_6);
16736 __Pyx_XGIVEREF(__pyx_t_7);
16737 __Pyx_XGIVEREF(__pyx_t_8);
16738 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16753 __Pyx_XDECREF(__pyx_t_3);
16754 __Pyx_XDECREF(__pyx_t_5);
16755 __Pyx_XDECREF(__pyx_t_9);
16756 __Pyx_XDECREF(__pyx_t_10);
16757 __Pyx_XDECREF(__pyx_t_11);
16758 __Pyx_AddTraceback(
"PyClical.atan", __pyx_clineno, __pyx_lineno, __pyx_filename);
16761 __Pyx_XGIVEREF(__pyx_r);
16762 __Pyx_RefNannyFinishContext();
16767 static PyObject *__pyx_pw_8PyClical_69atan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16768 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 ";
16769 static PyObject *__pyx_pw_8PyClical_69atan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16770 PyObject *__pyx_v_obj = 0;
16771 PyObject *__pyx_v_i = 0;
16772 PyObject *__pyx_r = 0;
16773 __Pyx_RefNannyDeclarations
16774 __Pyx_RefNannySetupContext(
"atan (wrapper)", 0);
16776 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
16777 PyObject* values[2] = {0,0};
16778 values[1] = ((PyObject *)Py_None);
16779 if (unlikely(__pyx_kwds)) {
16780 Py_ssize_t kw_args;
16781 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16782 switch (pos_args) {
16783 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16784 CYTHON_FALLTHROUGH;
16785 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16786 CYTHON_FALLTHROUGH;
16788 default:
goto __pyx_L5_argtuple_error;
16790 kw_args = PyDict_Size(__pyx_kwds);
16791 switch (pos_args) {
16793 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
16794 else goto __pyx_L5_argtuple_error;
16795 CYTHON_FALLTHROUGH;
16798 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
16799 if (value) { values[1] = value; kw_args--; }
16802 if (unlikely(kw_args > 0)) {
16803 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"atan") < 0)) __PYX_ERR(0, 1769, __pyx_L3_error)
16806 switch (PyTuple_GET_SIZE(__pyx_args)) {
16807 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16808 CYTHON_FALLTHROUGH;
16809 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16811 default:
goto __pyx_L5_argtuple_error;
16814 __pyx_v_obj = values[0];
16815 __pyx_v_i = values[1];
16817 goto __pyx_L4_argument_unpacking_done;
16818 __pyx_L5_argtuple_error:;
16819 __Pyx_RaiseArgtupleInvalid(
"atan", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1769, __pyx_L3_error)
16821 __Pyx_AddTraceback(
"PyClical.atan", __pyx_clineno, __pyx_lineno, __pyx_filename);
16822 __Pyx_RefNannyFinishContext();
16824 __pyx_L4_argument_unpacking_done:;
16825 __pyx_r = __pyx_pf_8PyClical_68atan(__pyx_self, __pyx_v_obj, __pyx_v_i);
16828 __Pyx_RefNannyFinishContext();
16832 static PyObject *__pyx_pf_8PyClical_68atan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
16833 PyObject *__pyx_r = NULL;
16834 __Pyx_RefNannyDeclarations
16835 PyObject *__pyx_t_1 = NULL;
16836 struct __pyx_opt_args_8PyClical_atan __pyx_t_2;
16837 __Pyx_RefNannySetupContext(
"atan", 0);
16838 __Pyx_XDECREF(__pyx_r);
16839 __pyx_t_2.__pyx_n = 1;
16840 __pyx_t_2.i = __pyx_v_i;
16841 __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)
16842 __Pyx_GOTREF(__pyx_t_1);
16843 __pyx_r = __pyx_t_1;
16849 __Pyx_XDECREF(__pyx_t_1);
16850 __Pyx_AddTraceback(
"PyClical.atan", __pyx_clineno, __pyx_lineno, __pyx_filename);
16853 __Pyx_XGIVEREF(__pyx_r);
16854 __Pyx_RefNannyFinishContext();
16866 static PyObject *__pyx_pw_8PyClical_71tanh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
16867 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_tanh(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
16868 PyObject *__pyx_r = NULL;
16869 __Pyx_RefNannyDeclarations
16870 PyObject *__pyx_t_1 = NULL;
16871 PyObject *__pyx_t_2 = NULL;
16872 PyObject *__pyx_t_3 = NULL;
16873 PyObject *__pyx_t_4 = NULL;
16874 PyObject *__pyx_t_5 = NULL;
16875 PyObject *__pyx_t_6 = NULL;
16876 PyObject *__pyx_t_7 = NULL;
16877 PyObject *__pyx_t_8 = NULL;
16878 __Pyx_RefNannySetupContext(
"tanh", 0);
16888 __Pyx_PyThreadState_declare
16889 __Pyx_PyThreadState_assign
16890 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
16891 __Pyx_XGOTREF(__pyx_t_1);
16892 __Pyx_XGOTREF(__pyx_t_2);
16893 __Pyx_XGOTREF(__pyx_t_3);
16903 __Pyx_XDECREF(__pyx_r);
16904 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1794, __pyx_L3_error)
16905 __Pyx_GOTREF(__pyx_t_5);
16906 __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)
16907 __Pyx_GOTREF(__pyx_t_6);
16908 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16910 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
16911 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
16912 if (likely(__pyx_t_5)) {
16913 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
16914 __Pyx_INCREF(__pyx_t_5);
16915 __Pyx_INCREF(
function);
16916 __Pyx_DECREF_SET(__pyx_t_6,
function);
16919 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_obj);
16920 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16921 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1794, __pyx_L3_error)
16922 __Pyx_GOTREF(__pyx_t_4);
16923 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16924 __pyx_r = __pyx_t_4;
16926 goto __pyx_L7_try_return;
16937 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
16938 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16939 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
16949 __Pyx_AddTraceback(
"PyClical.tanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16950 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(0, 1795, __pyx_L5_except_error)
16951 __Pyx_GOTREF(__pyx_t_4);
16952 __Pyx_GOTREF(__pyx_t_6);
16953 __Pyx_GOTREF(__pyx_t_5);
16962 __Pyx_XDECREF(__pyx_r);
16963 __pyx_t_7 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1796, __pyx_L5_except_error)
16964 __Pyx_GOTREF(__pyx_t_7);
16965 __pyx_t_8 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_7),
tanh(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1796, __pyx_L5_except_error)
16966 __Pyx_GOTREF(__pyx_t_8);
16967 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16968 __pyx_r = __pyx_t_8;
16970 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16971 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16972 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16973 goto __pyx_L6_except_return;
16975 __pyx_L5_except_error:;
16984 __Pyx_XGIVEREF(__pyx_t_1);
16985 __Pyx_XGIVEREF(__pyx_t_2);
16986 __Pyx_XGIVEREF(__pyx_t_3);
16987 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
16988 goto __pyx_L1_error;
16989 __pyx_L7_try_return:;
16990 __Pyx_XGIVEREF(__pyx_t_1);
16991 __Pyx_XGIVEREF(__pyx_t_2);
16992 __Pyx_XGIVEREF(__pyx_t_3);
16993 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
16995 __pyx_L6_except_return:;
16996 __Pyx_XGIVEREF(__pyx_t_1);
16997 __Pyx_XGIVEREF(__pyx_t_2);
16998 __Pyx_XGIVEREF(__pyx_t_3);
16999 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
17013 __Pyx_XDECREF(__pyx_t_4);
17014 __Pyx_XDECREF(__pyx_t_5);
17015 __Pyx_XDECREF(__pyx_t_6);
17016 __Pyx_XDECREF(__pyx_t_7);
17017 __Pyx_XDECREF(__pyx_t_8);
17018 __Pyx_AddTraceback(
"PyClical.tanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17021 __Pyx_XGIVEREF(__pyx_r);
17022 __Pyx_RefNannyFinishContext();
17027 static PyObject *__pyx_pw_8PyClical_71tanh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
17028 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 ";
17029 static PyObject *__pyx_pw_8PyClical_71tanh(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
17030 PyObject *__pyx_r = 0;
17031 __Pyx_RefNannyDeclarations
17032 __Pyx_RefNannySetupContext(
"tanh (wrapper)", 0);
17033 __pyx_r = __pyx_pf_8PyClical_70tanh(__pyx_self, ((PyObject *)__pyx_v_obj));
17036 __Pyx_RefNannyFinishContext();
17040 static PyObject *__pyx_pf_8PyClical_70tanh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
17041 PyObject *__pyx_r = NULL;
17042 __Pyx_RefNannyDeclarations
17043 PyObject *__pyx_t_1 = NULL;
17044 __Pyx_RefNannySetupContext(
"tanh", 0);
17045 __Pyx_XDECREF(__pyx_r);
17046 __pyx_t_1 = __pyx_f_8PyClical_tanh(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1786, __pyx_L1_error)
17047 __Pyx_GOTREF(__pyx_t_1);
17048 __pyx_r = __pyx_t_1;
17054 __Pyx_XDECREF(__pyx_t_1);
17055 __Pyx_AddTraceback(
"PyClical.tanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17058 __Pyx_XGIVEREF(__pyx_r);
17059 __Pyx_RefNannyFinishContext();
17071 static PyObject *__pyx_pw_8PyClical_73atanh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17072 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) {
17073 PyObject *__pyx_v_i = ((PyObject *)Py_None);
17074 PyObject *__pyx_r = NULL;
17075 __Pyx_RefNannyDeclarations
17078 PyObject *__pyx_t_3 = NULL;
17080 PyObject *__pyx_t_5 = NULL;
17081 PyObject *__pyx_t_6 = NULL;
17082 PyObject *__pyx_t_7 = NULL;
17083 PyObject *__pyx_t_8 = NULL;
17084 PyObject *__pyx_t_9 = NULL;
17085 PyObject *__pyx_t_10 = NULL;
17086 PyObject *__pyx_t_11 = NULL;
17087 __Pyx_RefNannySetupContext(
"atanh", 0);
17088 if (__pyx_optional_args) {
17089 if (__pyx_optional_args->__pyx_n > 0) {
17090 __pyx_v_i = __pyx_optional_args->i;
17101 __pyx_t_1 = (__pyx_v_i != Py_None);
17102 __pyx_t_2 = (__pyx_t_1 != 0);
17112 __Pyx_XDECREF(__pyx_r);
17113 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1808, __pyx_L1_error)
17114 __Pyx_GOTREF(__pyx_t_3);
17116 __pyx_t_4 =
atanh(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
17118 __Pyx_CppExn2PyErr();
17119 __PYX_ERR(0, 1808, __pyx_L1_error)
17121 __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)
17122 __Pyx_GOTREF(__pyx_t_5);
17123 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17124 __pyx_r = __pyx_t_5;
17146 __Pyx_PyThreadState_declare
17147 __Pyx_PyThreadState_assign
17148 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
17149 __Pyx_XGOTREF(__pyx_t_6);
17150 __Pyx_XGOTREF(__pyx_t_7);
17151 __Pyx_XGOTREF(__pyx_t_8);
17161 __Pyx_XDECREF(__pyx_r);
17162 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1811, __pyx_L4_error)
17163 __Pyx_GOTREF(__pyx_t_3);
17164 __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)
17165 __Pyx_GOTREF(__pyx_t_9);
17166 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17168 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
17169 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
17170 if (likely(__pyx_t_3)) {
17171 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
17172 __Pyx_INCREF(__pyx_t_3);
17173 __Pyx_INCREF(
function);
17174 __Pyx_DECREF_SET(__pyx_t_9,
function);
17177 __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_3, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
17178 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17179 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1811, __pyx_L4_error)
17180 __Pyx_GOTREF(__pyx_t_5);
17181 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17182 __pyx_r = __pyx_t_5;
17184 goto __pyx_L8_try_return;
17195 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17196 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17197 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
17207 __Pyx_AddTraceback(
"PyClical.atanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17208 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1812, __pyx_L6_except_error)
17209 __Pyx_GOTREF(__pyx_t_5);
17210 __Pyx_GOTREF(__pyx_t_9);
17211 __Pyx_GOTREF(__pyx_t_3);
17220 __Pyx_XDECREF(__pyx_r);
17221 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1813, __pyx_L6_except_error)
17222 __Pyx_GOTREF(__pyx_t_10);
17223 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_10),
atanh(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1813, __pyx_L6_except_error)
17224 __Pyx_GOTREF(__pyx_t_11);
17225 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
17226 __pyx_r = __pyx_t_11;
17228 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17229 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17230 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17231 goto __pyx_L7_except_return;
17233 __pyx_L6_except_error:;
17242 __Pyx_XGIVEREF(__pyx_t_6);
17243 __Pyx_XGIVEREF(__pyx_t_7);
17244 __Pyx_XGIVEREF(__pyx_t_8);
17245 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17246 goto __pyx_L1_error;
17247 __pyx_L8_try_return:;
17248 __Pyx_XGIVEREF(__pyx_t_6);
17249 __Pyx_XGIVEREF(__pyx_t_7);
17250 __Pyx_XGIVEREF(__pyx_t_8);
17251 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17253 __pyx_L7_except_return:;
17254 __Pyx_XGIVEREF(__pyx_t_6);
17255 __Pyx_XGIVEREF(__pyx_t_7);
17256 __Pyx_XGIVEREF(__pyx_t_8);
17257 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17272 __Pyx_XDECREF(__pyx_t_3);
17273 __Pyx_XDECREF(__pyx_t_5);
17274 __Pyx_XDECREF(__pyx_t_9);
17275 __Pyx_XDECREF(__pyx_t_10);
17276 __Pyx_XDECREF(__pyx_t_11);
17277 __Pyx_AddTraceback(
"PyClical.atanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17280 __Pyx_XGIVEREF(__pyx_r);
17281 __Pyx_RefNannyFinishContext();
17286 static PyObject *__pyx_pw_8PyClical_73atanh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17287 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 ";
17288 static PyObject *__pyx_pw_8PyClical_73atanh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17289 PyObject *__pyx_v_obj = 0;
17290 PyObject *__pyx_v_i = 0;
17291 PyObject *__pyx_r = 0;
17292 __Pyx_RefNannyDeclarations
17293 __Pyx_RefNannySetupContext(
"atanh (wrapper)", 0);
17295 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
17296 PyObject* values[2] = {0,0};
17297 values[1] = ((PyObject *)Py_None);
17298 if (unlikely(__pyx_kwds)) {
17299 Py_ssize_t kw_args;
17300 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17301 switch (pos_args) {
17302 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17303 CYTHON_FALLTHROUGH;
17304 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17305 CYTHON_FALLTHROUGH;
17307 default:
goto __pyx_L5_argtuple_error;
17309 kw_args = PyDict_Size(__pyx_kwds);
17310 switch (pos_args) {
17312 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
17313 else goto __pyx_L5_argtuple_error;
17314 CYTHON_FALLTHROUGH;
17317 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
17318 if (value) { values[1] = value; kw_args--; }
17321 if (unlikely(kw_args > 0)) {
17322 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"atanh") < 0)) __PYX_ERR(0, 1798, __pyx_L3_error)
17325 switch (PyTuple_GET_SIZE(__pyx_args)) {
17326 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17327 CYTHON_FALLTHROUGH;
17328 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17330 default:
goto __pyx_L5_argtuple_error;
17333 __pyx_v_obj = values[0];
17334 __pyx_v_i = values[1];
17336 goto __pyx_L4_argument_unpacking_done;
17337 __pyx_L5_argtuple_error:;
17338 __Pyx_RaiseArgtupleInvalid(
"atanh", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1798, __pyx_L3_error)
17340 __Pyx_AddTraceback(
"PyClical.atanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17341 __Pyx_RefNannyFinishContext();
17343 __pyx_L4_argument_unpacking_done:;
17344 __pyx_r = __pyx_pf_8PyClical_72atanh(__pyx_self, __pyx_v_obj, __pyx_v_i);
17347 __Pyx_RefNannyFinishContext();
17351 static PyObject *__pyx_pf_8PyClical_72atanh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
17352 PyObject *__pyx_r = NULL;
17353 __Pyx_RefNannyDeclarations
17354 PyObject *__pyx_t_1 = NULL;
17355 struct __pyx_opt_args_8PyClical_atanh __pyx_t_2;
17356 __Pyx_RefNannySetupContext(
"atanh", 0);
17357 __Pyx_XDECREF(__pyx_r);
17358 __pyx_t_2.__pyx_n = 1;
17359 __pyx_t_2.i = __pyx_v_i;
17360 __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)
17361 __Pyx_GOTREF(__pyx_t_1);
17362 __pyx_r = __pyx_t_1;
17368 __Pyx_XDECREF(__pyx_t_1);
17369 __Pyx_AddTraceback(
"PyClical.atanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17372 __Pyx_XGIVEREF(__pyx_r);
17373 __Pyx_RefNannyFinishContext();
17385 static PyObject *__pyx_pw_8PyClical_75random_clifford(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17386 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) {
17387 PyObject *__pyx_v_fill = ((PyObject *)__pyx_float_1_0);
17388 PyObject *__pyx_r = NULL;
17389 __Pyx_RefNannyDeclarations
17390 PyObject *__pyx_t_1 = NULL;
17391 PyObject *__pyx_t_2 = NULL;
17393 PyObject *__pyx_t_4 = NULL;
17394 __Pyx_RefNannySetupContext(
"random_clifford", 0);
17395 if (__pyx_optional_args) {
17396 if (__pyx_optional_args->__pyx_n > 0) {
17397 __pyx_v_fill = __pyx_optional_args->fill;
17408 __Pyx_XDECREF(__pyx_r);
17409 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1822, __pyx_L1_error)
17410 __Pyx_GOTREF(__pyx_t_1);
17411 __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1822, __pyx_L1_error)
17412 __Pyx_GOTREF(__pyx_t_2);
17413 __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)
17414 __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)
17415 __Pyx_GOTREF(__pyx_t_4);
17416 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17417 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17418 __pyx_r = __pyx_t_4;
17432 __Pyx_XDECREF(__pyx_t_1);
17433 __Pyx_XDECREF(__pyx_t_2);
17434 __Pyx_XDECREF(__pyx_t_4);
17435 __Pyx_AddTraceback(
"PyClical.random_clifford", __pyx_clineno, __pyx_lineno, __pyx_filename);
17438 __Pyx_XGIVEREF(__pyx_r);
17439 __Pyx_RefNannyFinishContext();
17444 static PyObject *__pyx_pw_8PyClical_75random_clifford(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17445 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 ";
17446 static PyObject *__pyx_pw_8PyClical_75random_clifford(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17447 struct __pyx_obj_8PyClical_index_set *__pyx_v_ixt = 0;
17448 PyObject *__pyx_v_fill = 0;
17449 PyObject *__pyx_r = 0;
17450 __Pyx_RefNannyDeclarations
17451 __Pyx_RefNannySetupContext(
"random_clifford (wrapper)", 0);
17453 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ixt,&__pyx_n_s_fill,0};
17454 PyObject* values[2] = {0,0};
17455 values[1] = ((PyObject *)__pyx_float_1_0);
17456 if (unlikely(__pyx_kwds)) {
17457 Py_ssize_t kw_args;
17458 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17459 switch (pos_args) {
17460 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17461 CYTHON_FALLTHROUGH;
17462 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17463 CYTHON_FALLTHROUGH;
17465 default:
goto __pyx_L5_argtuple_error;
17467 kw_args = PyDict_Size(__pyx_kwds);
17468 switch (pos_args) {
17470 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ixt)) != 0)) kw_args--;
17471 else goto __pyx_L5_argtuple_error;
17472 CYTHON_FALLTHROUGH;
17475 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fill);
17476 if (value) { values[1] = value; kw_args--; }
17479 if (unlikely(kw_args > 0)) {
17480 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"random_clifford") < 0)) __PYX_ERR(0, 1815, __pyx_L3_error)
17483 switch (PyTuple_GET_SIZE(__pyx_args)) {
17484 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17485 CYTHON_FALLTHROUGH;
17486 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17488 default:
goto __pyx_L5_argtuple_error;
17491 __pyx_v_ixt = ((
struct __pyx_obj_8PyClical_index_set *)values[0]);
17492 __pyx_v_fill = values[1];
17494 goto __pyx_L4_argument_unpacking_done;
17495 __pyx_L5_argtuple_error:;
17496 __Pyx_RaiseArgtupleInvalid(
"random_clifford", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1815, __pyx_L3_error)
17498 __Pyx_AddTraceback(
"PyClical.random_clifford", __pyx_clineno, __pyx_lineno, __pyx_filename);
17499 __Pyx_RefNannyFinishContext();
17501 __pyx_L4_argument_unpacking_done:;
17502 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ixt), __pyx_ptype_8PyClical_index_set, 1,
"ixt", 0))) __PYX_ERR(0, 1815, __pyx_L1_error)
17503 __pyx_r = __pyx_pf_8PyClical_74random_clifford(__pyx_self, __pyx_v_ixt, __pyx_v_fill);
17510 __Pyx_RefNannyFinishContext();
17514 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) {
17515 PyObject *__pyx_r = NULL;
17516 __Pyx_RefNannyDeclarations
17517 PyObject *__pyx_t_1 = NULL;
17518 struct __pyx_opt_args_8PyClical_random_clifford __pyx_t_2;
17519 __Pyx_RefNannySetupContext(
"random_clifford", 0);
17520 __Pyx_XDECREF(__pyx_r);
17521 __pyx_t_2.__pyx_n = 1;
17522 __pyx_t_2.fill = __pyx_v_fill;
17523 __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)
17524 __Pyx_GOTREF(__pyx_t_1);
17525 __pyx_r = __pyx_t_1;
17531 __Pyx_XDECREF(__pyx_t_1);
17532 __Pyx_AddTraceback(
"PyClical.random_clifford", __pyx_clineno, __pyx_lineno, __pyx_filename);
17535 __Pyx_XGIVEREF(__pyx_r);
17536 __Pyx_RefNannyFinishContext();
17548 static PyObject *__pyx_pw_8PyClical_77cga3(PyObject *__pyx_self, PyObject *__pyx_v_obj);
17549 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cga3(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
17550 PyObject *__pyx_r = NULL;
17551 __Pyx_RefNannyDeclarations
17552 PyObject *__pyx_t_1 = NULL;
17553 PyObject *__pyx_t_2 = NULL;
17554 __Pyx_RefNannySetupContext(
"cga3", 0);
17563 __Pyx_XDECREF(__pyx_r);
17564 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1831, __pyx_L1_error)
17565 __Pyx_GOTREF(__pyx_t_1);
17566 __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)
17567 __Pyx_GOTREF(__pyx_t_2);
17568 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17569 __pyx_r = __pyx_t_2;
17583 __Pyx_XDECREF(__pyx_t_1);
17584 __Pyx_XDECREF(__pyx_t_2);
17585 __Pyx_AddTraceback(
"PyClical.cga3", __pyx_clineno, __pyx_lineno, __pyx_filename);
17588 __Pyx_XGIVEREF(__pyx_r);
17589 __Pyx_RefNannyFinishContext();
17594 static PyObject *__pyx_pw_8PyClical_77cga3(PyObject *__pyx_self, PyObject *__pyx_v_obj);
17595 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 ";
17596 static PyObject *__pyx_pw_8PyClical_77cga3(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
17597 PyObject *__pyx_r = 0;
17598 __Pyx_RefNannyDeclarations
17599 __Pyx_RefNannySetupContext(
"cga3 (wrapper)", 0);
17600 __pyx_r = __pyx_pf_8PyClical_76cga3(__pyx_self, ((PyObject *)__pyx_v_obj));
17603 __Pyx_RefNannyFinishContext();
17607 static PyObject *__pyx_pf_8PyClical_76cga3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
17608 PyObject *__pyx_r = NULL;
17609 __Pyx_RefNannyDeclarations
17610 PyObject *__pyx_t_1 = NULL;
17611 __Pyx_RefNannySetupContext(
"cga3", 0);
17612 __Pyx_XDECREF(__pyx_r);
17613 __pyx_t_1 = __pyx_f_8PyClical_cga3(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1824, __pyx_L1_error)
17614 __Pyx_GOTREF(__pyx_t_1);
17615 __pyx_r = __pyx_t_1;
17621 __Pyx_XDECREF(__pyx_t_1);
17622 __Pyx_AddTraceback(
"PyClical.cga3", __pyx_clineno, __pyx_lineno, __pyx_filename);
17625 __Pyx_XGIVEREF(__pyx_r);
17626 __Pyx_RefNannyFinishContext();
17638 static PyObject *__pyx_pw_8PyClical_79cga3std(PyObject *__pyx_self, PyObject *__pyx_v_obj);
17639 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cga3std(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
17640 PyObject *__pyx_r = NULL;
17641 __Pyx_RefNannyDeclarations
17642 PyObject *__pyx_t_1 = NULL;
17643 PyObject *__pyx_t_2 = NULL;
17644 __Pyx_RefNannySetupContext(
"cga3std", 0);
17653 __Pyx_XDECREF(__pyx_r);
17654 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1842, __pyx_L1_error)
17655 __Pyx_GOTREF(__pyx_t_1);
17656 __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)
17657 __Pyx_GOTREF(__pyx_t_2);
17658 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17659 __pyx_r = __pyx_t_2;
17673 __Pyx_XDECREF(__pyx_t_1);
17674 __Pyx_XDECREF(__pyx_t_2);
17675 __Pyx_AddTraceback(
"PyClical.cga3std", __pyx_clineno, __pyx_lineno, __pyx_filename);
17678 __Pyx_XGIVEREF(__pyx_r);
17679 __Pyx_RefNannyFinishContext();
17684 static PyObject *__pyx_pw_8PyClical_79cga3std(PyObject *__pyx_self, PyObject *__pyx_v_obj);
17685 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 ";
17686 static PyObject *__pyx_pw_8PyClical_79cga3std(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
17687 PyObject *__pyx_r = 0;
17688 __Pyx_RefNannyDeclarations
17689 __Pyx_RefNannySetupContext(
"cga3std (wrapper)", 0);
17690 __pyx_r = __pyx_pf_8PyClical_78cga3std(__pyx_self, ((PyObject *)__pyx_v_obj));
17693 __Pyx_RefNannyFinishContext();
17697 static PyObject *__pyx_pf_8PyClical_78cga3std(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
17698 PyObject *__pyx_r = NULL;
17699 __Pyx_RefNannyDeclarations
17700 PyObject *__pyx_t_1 = NULL;
17701 __Pyx_RefNannySetupContext(
"cga3std", 0);
17702 __Pyx_XDECREF(__pyx_r);
17703 __pyx_t_1 = __pyx_f_8PyClical_cga3std(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1833, __pyx_L1_error)
17704 __Pyx_GOTREF(__pyx_t_1);
17705 __pyx_r = __pyx_t_1;
17711 __Pyx_XDECREF(__pyx_t_1);
17712 __Pyx_AddTraceback(
"PyClical.cga3std", __pyx_clineno, __pyx_lineno, __pyx_filename);
17715 __Pyx_XGIVEREF(__pyx_r);
17716 __Pyx_RefNannyFinishContext();
17728 static PyObject *__pyx_pw_8PyClical_81agc3(PyObject *__pyx_self, PyObject *__pyx_v_obj);
17729 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_agc3(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
17730 PyObject *__pyx_r = NULL;
17731 __Pyx_RefNannyDeclarations
17732 PyObject *__pyx_t_1 = NULL;
17733 PyObject *__pyx_t_2 = NULL;
17734 __Pyx_RefNannySetupContext(
"agc3", 0);
17743 __Pyx_XDECREF(__pyx_r);
17744 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1853, __pyx_L1_error)
17745 __Pyx_GOTREF(__pyx_t_1);
17746 __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)
17747 __Pyx_GOTREF(__pyx_t_2);
17748 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17749 __pyx_r = __pyx_t_2;
17763 __Pyx_XDECREF(__pyx_t_1);
17764 __Pyx_XDECREF(__pyx_t_2);
17765 __Pyx_AddTraceback(
"PyClical.agc3", __pyx_clineno, __pyx_lineno, __pyx_filename);
17768 __Pyx_XGIVEREF(__pyx_r);
17769 __Pyx_RefNannyFinishContext();
17774 static PyObject *__pyx_pw_8PyClical_81agc3(PyObject *__pyx_self, PyObject *__pyx_v_obj);
17775 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 ";
17776 static PyObject *__pyx_pw_8PyClical_81agc3(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
17777 PyObject *__pyx_r = 0;
17778 __Pyx_RefNannyDeclarations
17779 __Pyx_RefNannySetupContext(
"agc3 (wrapper)", 0);
17780 __pyx_r = __pyx_pf_8PyClical_80agc3(__pyx_self, ((PyObject *)__pyx_v_obj));
17783 __Pyx_RefNannyFinishContext();
17787 static PyObject *__pyx_pf_8PyClical_80agc3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
17788 PyObject *__pyx_r = NULL;
17789 __Pyx_RefNannyDeclarations
17790 PyObject *__pyx_t_1 = NULL;
17791 __Pyx_RefNannySetupContext(
"agc3", 0);
17792 __Pyx_XDECREF(__pyx_r);
17793 __pyx_t_1 = __pyx_f_8PyClical_agc3(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1844, __pyx_L1_error)
17794 __Pyx_GOTREF(__pyx_t_1);
17795 __pyx_r = __pyx_t_1;
17801 __Pyx_XDECREF(__pyx_t_1);
17802 __Pyx_AddTraceback(
"PyClical.agc3", __pyx_clineno, __pyx_lineno, __pyx_filename);
17805 __Pyx_XGIVEREF(__pyx_r);
17806 __Pyx_RefNannyFinishContext();
17819 static PyObject *__pyx_pw_8PyClical_83e(PyObject *__pyx_self, PyObject *__pyx_v_obj);
17820 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 ";
17821 static PyMethodDef __pyx_mdef_8PyClical_83e = {
"e", (PyCFunction)__pyx_pw_8PyClical_83e, METH_O, __pyx_doc_8PyClical_82e};
17822 static PyObject *__pyx_pw_8PyClical_83e(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
17823 PyObject *__pyx_r = 0;
17824 __Pyx_RefNannyDeclarations
17825 __Pyx_RefNannySetupContext(
"e (wrapper)", 0);
17826 __pyx_r = __pyx_pf_8PyClical_82e(__pyx_self, ((PyObject *)__pyx_v_obj));
17829 __Pyx_RefNannyFinishContext();
17833 static PyObject *__pyx_pf_8PyClical_82e(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
17834 PyObject *__pyx_r = NULL;
17835 __Pyx_RefNannyDeclarations
17836 PyObject *__pyx_t_1 = NULL;
17837 PyObject *__pyx_t_2 = NULL;
17838 __Pyx_RefNannySetupContext(
"e", 0);
17847 __Pyx_XDECREF(__pyx_r);
17848 __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)
17849 __Pyx_GOTREF(__pyx_t_1);
17850 __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)
17851 __Pyx_GOTREF(__pyx_t_2);
17852 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17853 __pyx_r = __pyx_t_2;
17867 __Pyx_XDECREF(__pyx_t_1);
17868 __Pyx_XDECREF(__pyx_t_2);
17869 __Pyx_AddTraceback(
"PyClical.e", __pyx_clineno, __pyx_lineno, __pyx_filename);
17872 __Pyx_XGIVEREF(__pyx_r);
17873 __Pyx_RefNannyFinishContext();
17886 static PyObject *__pyx_pw_8PyClical_85istpq(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17887 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 ";
17888 static PyMethodDef __pyx_mdef_8PyClical_85istpq = {
"istpq", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_85istpq, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_84istpq};
17889 static PyObject *__pyx_pw_8PyClical_85istpq(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17890 PyObject *__pyx_v_p = 0;
17891 PyObject *__pyx_v_q = 0;
17892 PyObject *__pyx_r = 0;
17893 __Pyx_RefNannyDeclarations
17894 __Pyx_RefNannySetupContext(
"istpq (wrapper)", 0);
17896 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,&__pyx_n_s_q,0};
17897 PyObject* values[2] = {0,0};
17898 if (unlikely(__pyx_kwds)) {
17899 Py_ssize_t kw_args;
17900 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17901 switch (pos_args) {
17902 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17903 CYTHON_FALLTHROUGH;
17904 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17905 CYTHON_FALLTHROUGH;
17907 default:
goto __pyx_L5_argtuple_error;
17909 kw_args = PyDict_Size(__pyx_kwds);
17910 switch (pos_args) {
17912 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p)) != 0)) kw_args--;
17913 else goto __pyx_L5_argtuple_error;
17914 CYTHON_FALLTHROUGH;
17916 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q)) != 0)) kw_args--;
17918 __Pyx_RaiseArgtupleInvalid(
"istpq", 1, 2, 2, 1); __PYX_ERR(0, 1900, __pyx_L3_error)
17921 if (unlikely(kw_args > 0)) {
17922 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"istpq") < 0)) __PYX_ERR(0, 1900, __pyx_L3_error)
17924 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
17925 goto __pyx_L5_argtuple_error;
17927 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17928 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17930 __pyx_v_p = values[0];
17931 __pyx_v_q = values[1];
17933 goto __pyx_L4_argument_unpacking_done;
17934 __pyx_L5_argtuple_error:;
17935 __Pyx_RaiseArgtupleInvalid(
"istpq", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1900, __pyx_L3_error)
17937 __Pyx_AddTraceback(
"PyClical.istpq", __pyx_clineno, __pyx_lineno, __pyx_filename);
17938 __Pyx_RefNannyFinishContext();
17940 __pyx_L4_argument_unpacking_done:;
17941 __pyx_r = __pyx_pf_8PyClical_84istpq(__pyx_self, __pyx_v_p, __pyx_v_q);
17944 __Pyx_RefNannyFinishContext();
17948 static PyObject *__pyx_pf_8PyClical_84istpq(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_p, PyObject *__pyx_v_q) {
17949 PyObject *__pyx_r = NULL;
17950 __Pyx_RefNannyDeclarations
17951 PyObject *__pyx_t_1 = NULL;
17952 PyObject *__pyx_t_2 = NULL;
17953 PyObject *__pyx_t_3 = NULL;
17954 __Pyx_RefNannySetupContext(
"istpq", 0);
17963 __Pyx_XDECREF(__pyx_r);
17964 __pyx_t_1 = PyNumber_Negative(__pyx_v_q);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1907, __pyx_L1_error)
17965 __Pyx_GOTREF(__pyx_t_1);
17966 __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_p, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1907, __pyx_L1_error)
17967 __Pyx_GOTREF(__pyx_t_2);
17968 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1907, __pyx_L1_error)
17969 __Pyx_GOTREF(__pyx_t_3);
17970 __Pyx_GIVEREF(__pyx_t_1);
17971 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
17972 __Pyx_GIVEREF(__pyx_t_2);
17973 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
17976 __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)
17977 __Pyx_GOTREF(__pyx_t_2);
17978 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17979 __pyx_t_3 = PySet_New(__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1907, __pyx_L1_error)
17980 __Pyx_GOTREF(__pyx_t_3);
17981 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17982 __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)
17983 __Pyx_GOTREF(__pyx_t_2);
17984 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17985 __pyx_r = __pyx_t_2;
17999 __Pyx_XDECREF(__pyx_t_1);
18000 __Pyx_XDECREF(__pyx_t_2);
18001 __Pyx_XDECREF(__pyx_t_3);
18002 __Pyx_AddTraceback(
"PyClical.istpq", __pyx_clineno, __pyx_lineno, __pyx_filename);
18005 __Pyx_XGIVEREF(__pyx_r);
18006 __Pyx_RefNannyFinishContext();
18019 static PyObject *__pyx_pw_8PyClical_87_test(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused);
18020 static PyMethodDef __pyx_mdef_8PyClical_87_test = {
"_test", (PyCFunction)__pyx_pw_8PyClical_87_test, METH_NOARGS, 0};
18021 static PyObject *__pyx_pw_8PyClical_87_test(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
18022 PyObject *__pyx_r = 0;
18023 __Pyx_RefNannyDeclarations
18024 __Pyx_RefNannySetupContext(
"_test (wrapper)", 0);
18025 __pyx_r = __pyx_pf_8PyClical_86_test(__pyx_self);
18028 __Pyx_RefNannyFinishContext();
18032 static PyObject *__pyx_pf_8PyClical_86_test(CYTHON_UNUSED PyObject *__pyx_self) {
18033 PyObject *__pyx_v_PyClical = NULL;
18034 PyObject *__pyx_v_doctest = NULL;
18035 PyObject *__pyx_r = NULL;
18036 __Pyx_RefNannyDeclarations
18037 PyObject *__pyx_t_1 = NULL;
18038 PyObject *__pyx_t_2 = NULL;
18039 PyObject *__pyx_t_3 = NULL;
18040 __Pyx_RefNannySetupContext(
"_test", 0);
18049 __pyx_t_1 = __Pyx_Import(__pyx_n_s_PyClical, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1914, __pyx_L1_error)
18050 __Pyx_GOTREF(__pyx_t_1);
18051 __pyx_v_PyClical = __pyx_t_1;
18053 __pyx_t_1 = __Pyx_Import(__pyx_n_s_doctest, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1914, __pyx_L1_error)
18054 __Pyx_GOTREF(__pyx_t_1);
18055 __pyx_v_doctest = __pyx_t_1;
18065 __Pyx_XDECREF(__pyx_r);
18066 __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)
18067 __Pyx_GOTREF(__pyx_t_2);
18069 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
18070 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
18071 if (likely(__pyx_t_3)) {
18072 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
18073 __Pyx_INCREF(__pyx_t_3);
18074 __Pyx_INCREF(
function);
18075 __Pyx_DECREF_SET(__pyx_t_2,
function);
18078 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_PyClical) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_PyClical);
18079 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18080 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1915, __pyx_L1_error)
18081 __Pyx_GOTREF(__pyx_t_1);
18082 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18083 __pyx_r = __pyx_t_1;
18097 __Pyx_XDECREF(__pyx_t_1);
18098 __Pyx_XDECREF(__pyx_t_2);
18099 __Pyx_XDECREF(__pyx_t_3);
18100 __Pyx_AddTraceback(
"PyClical._test", __pyx_clineno, __pyx_lineno, __pyx_filename);
18103 __Pyx_XDECREF(__pyx_v_PyClical);
18104 __Pyx_XDECREF(__pyx_v_doctest);
18105 __Pyx_XGIVEREF(__pyx_r);
18106 __Pyx_RefNannyFinishContext();
18109 static struct __pyx_vtabstruct_8PyClical_index_set __pyx_vtable_8PyClical_index_set;
18111 static PyObject *__pyx_tp_new_8PyClical_index_set(PyTypeObject *t, PyObject *a, PyObject *k) {
18112 struct __pyx_obj_8PyClical_index_set *p;
18114 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
18115 o = (*t->tp_alloc)(t, 0);
18117 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
18119 if (unlikely(!o))
return 0;
18120 p = ((
struct __pyx_obj_8PyClical_index_set *)o);
18121 p->__pyx_vtab = __pyx_vtabptr_8PyClical_index_set;
18122 if (unlikely(__pyx_pw_8PyClical_9index_set_3__cinit__(o, a, k) < 0))
goto bad;
18125 Py_DECREF(o); o = 0;
18129 static void __pyx_tp_dealloc_8PyClical_index_set(PyObject *o) {
18130 #if CYTHON_USE_TP_FINALIZE 18131 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))) {
18132 if (PyObject_CallFinalizerFromDealloc(o))
return;
18136 PyObject *etype, *eval, *etb;
18137 PyErr_Fetch(&etype, &eval, &etb);
18139 __pyx_pw_8PyClical_9index_set_5__dealloc__(o);
18141 PyErr_Restore(etype, eval, etb);
18143 (*Py_TYPE(o)->tp_free)(o);
18145 static PyObject *__pyx_sq_item_8PyClical_index_set(PyObject *o, Py_ssize_t
i) {
18147 PyObject *x = PyInt_FromSsize_t(
i);
if(!x)
return 0;
18148 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
18153 static int __pyx_mp_ass_subscript_8PyClical_index_set(PyObject *o, PyObject *
i, PyObject *v) {
18155 return __pyx_pw_8PyClical_9index_set_9__setitem__(o,
i, v);
18158 PyErr_Format(PyExc_NotImplementedError,
18159 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
18164 static PyMethodDef __pyx_methods_8PyClical_index_set[] = {
18165 {
"copy", (PyCFunction)__pyx_pw_8PyClical_9index_set_1copy, METH_NOARGS, __pyx_doc_8PyClical_9index_set_copy},
18166 {
"count", (PyCFunction)__pyx_pw_8PyClical_9index_set_32count, METH_NOARGS, __pyx_doc_8PyClical_9index_set_31count},
18167 {
"count_neg", (PyCFunction)__pyx_pw_8PyClical_9index_set_34count_neg, METH_NOARGS, __pyx_doc_8PyClical_9index_set_33count_neg},
18168 {
"count_pos", (PyCFunction)__pyx_pw_8PyClical_9index_set_36count_pos, METH_NOARGS, __pyx_doc_8PyClical_9index_set_35count_pos},
18169 {
"min", (PyCFunction)__pyx_pw_8PyClical_9index_set_38min, METH_NOARGS, __pyx_doc_8PyClical_9index_set_37min},
18170 {
"max", (PyCFunction)__pyx_pw_8PyClical_9index_set_40max, METH_NOARGS, __pyx_doc_8PyClical_9index_set_39max},
18171 {
"hash_fn", (PyCFunction)__pyx_pw_8PyClical_9index_set_42hash_fn, METH_NOARGS, __pyx_doc_8PyClical_9index_set_41hash_fn},
18172 {
"sign_of_mult", (PyCFunction)__pyx_pw_8PyClical_9index_set_44sign_of_mult, METH_O, __pyx_doc_8PyClical_9index_set_43sign_of_mult},
18173 {
"sign_of_square", (PyCFunction)__pyx_pw_8PyClical_9index_set_46sign_of_square, METH_NOARGS, __pyx_doc_8PyClical_9index_set_45sign_of_square},
18174 {
"__reduce_cython__", (PyCFunction)__pyx_pw_8PyClical_9index_set_52__reduce_cython__, METH_NOARGS, 0},
18175 {
"__setstate_cython__", (PyCFunction)__pyx_pw_8PyClical_9index_set_54__setstate_cython__, METH_O, 0},
18179 static PyNumberMethods __pyx_tp_as_number_index_set = {
18183 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18193 __pyx_pw_8PyClical_9index_set_18__invert__,
18196 __pyx_pw_8PyClical_9index_set_24__and__,
18197 __pyx_pw_8PyClical_9index_set_20__xor__,
18198 __pyx_pw_8PyClical_9index_set_28__or__,
18199 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18203 #if PY_MAJOR_VERSION < 3 18209 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18212 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18218 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18225 __pyx_pw_8PyClical_9index_set_26__iand__,
18226 __pyx_pw_8PyClical_9index_set_22__ixor__,
18227 __pyx_pw_8PyClical_9index_set_30__ior__,
18233 #if PY_VERSION_HEX >= 0x03050000 18236 #if PY_VERSION_HEX >= 0x03050000 18241 static PySequenceMethods __pyx_tp_as_sequence_index_set = {
18245 __pyx_sq_item_8PyClical_index_set,
18249 __pyx_pw_8PyClical_9index_set_13__contains__,
18254 static PyMappingMethods __pyx_tp_as_mapping_index_set = {
18256 __pyx_pw_8PyClical_9index_set_11__getitem__,
18257 __pyx_mp_ass_subscript_8PyClical_index_set,
18260 static PyTypeObject __pyx_type_8PyClical_index_set = {
18261 PyVarObject_HEAD_INIT(0, 0)
18262 "PyClical.index_set",
18263 sizeof(
struct __pyx_obj_8PyClical_index_set),
18265 __pyx_tp_dealloc_8PyClical_index_set,
18269 #if PY_MAJOR_VERSION < 3
18272 #if PY_MAJOR_VERSION >= 3
18275 __pyx_pw_8PyClical_9index_set_48__repr__,
18276 &__pyx_tp_as_number_index_set,
18277 &__pyx_tp_as_sequence_index_set,
18278 &__pyx_tp_as_mapping_index_set,
18281 __pyx_pw_8PyClical_9index_set_50__str__,
18285 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
18286 "\n Python class index_set wraps C++ class IndexSet.\n ",
18289 __pyx_pw_8PyClical_9index_set_7__richcmp__,
18291 __pyx_pw_8PyClical_9index_set_15__iter__,
18293 __pyx_methods_8PyClical_index_set,
18303 __pyx_tp_new_8PyClical_index_set,
18313 #if PY_VERSION_HEX >= 0x030400a1 18317 static struct __pyx_vtabstruct_8PyClical_clifford __pyx_vtable_8PyClical_clifford;
18319 static PyObject *__pyx_tp_new_8PyClical_clifford(PyTypeObject *t, PyObject *a, PyObject *k) {
18320 struct __pyx_obj_8PyClical_clifford *p;
18322 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
18323 o = (*t->tp_alloc)(t, 0);
18325 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
18327 if (unlikely(!o))
return 0;
18328 p = ((
struct __pyx_obj_8PyClical_clifford *)o);
18329 p->__pyx_vtab = __pyx_vtabptr_8PyClical_clifford;
18330 if (unlikely(__pyx_pw_8PyClical_8clifford_3__cinit__(o, a, k) < 0))
goto bad;
18333 Py_DECREF(o); o = 0;
18337 static void __pyx_tp_dealloc_8PyClical_clifford(PyObject *o) {
18338 #if CYTHON_USE_TP_FINALIZE 18339 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))) {
18340 if (PyObject_CallFinalizerFromDealloc(o))
return;
18344 PyObject *etype, *eval, *etb;
18345 PyErr_Fetch(&etype, &eval, &etb);
18347 __pyx_pw_8PyClical_8clifford_5__dealloc__(o);
18349 PyErr_Restore(etype, eval, etb);
18351 (*Py_TYPE(o)->tp_free)(o);
18353 static PyObject *__pyx_sq_item_8PyClical_clifford(PyObject *o, Py_ssize_t
i) {
18355 PyObject *x = PyInt_FromSsize_t(
i);
if(!x)
return 0;
18356 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
18361 static PyMethodDef __pyx_methods_8PyClical_clifford[] = {
18362 {
"copy", (PyCFunction)__pyx_pw_8PyClical_8clifford_1copy, METH_NOARGS, __pyx_doc_8PyClical_8clifford_copy},
18363 {
"reframe", (PyCFunction)__pyx_pw_8PyClical_8clifford_11reframe, METH_O, __pyx_doc_8PyClical_8clifford_10reframe},
18364 {
"inv", (PyCFunction)__pyx_pw_8PyClical_8clifford_49inv, METH_NOARGS, __pyx_doc_8PyClical_8clifford_48inv},
18365 {
"pow", (PyCFunction)__pyx_pw_8PyClical_8clifford_57pow, METH_O, __pyx_doc_8PyClical_8clifford_56pow},
18366 {
"outer_pow", (PyCFunction)__pyx_pw_8PyClical_8clifford_59outer_pow, METH_O, __pyx_doc_8PyClical_8clifford_58outer_pow},
18367 {
"scalar", (PyCFunction)__pyx_pw_8PyClical_8clifford_63scalar, METH_NOARGS, __pyx_doc_8PyClical_8clifford_62scalar},
18368 {
"pure", (PyCFunction)__pyx_pw_8PyClical_8clifford_65pure, METH_NOARGS, __pyx_doc_8PyClical_8clifford_64pure},
18369 {
"even", (PyCFunction)__pyx_pw_8PyClical_8clifford_67even, METH_NOARGS, __pyx_doc_8PyClical_8clifford_66even},
18370 {
"odd", (PyCFunction)__pyx_pw_8PyClical_8clifford_69odd, METH_NOARGS, __pyx_doc_8PyClical_8clifford_68odd},
18371 {
"vector_part", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_8clifford_71vector_part, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_8clifford_70vector_part},
18372 {
"involute", (PyCFunction)__pyx_pw_8PyClical_8clifford_73involute, METH_NOARGS, __pyx_doc_8PyClical_8clifford_72involute},
18373 {
"reverse", (PyCFunction)__pyx_pw_8PyClical_8clifford_75reverse, METH_NOARGS, __pyx_doc_8PyClical_8clifford_74reverse},
18374 {
"conj", (PyCFunction)__pyx_pw_8PyClical_8clifford_77conj, METH_NOARGS, __pyx_doc_8PyClical_8clifford_76conj},
18375 {
"quad", (PyCFunction)__pyx_pw_8PyClical_8clifford_79quad, METH_NOARGS, __pyx_doc_8PyClical_8clifford_78quad},
18376 {
"norm", (PyCFunction)__pyx_pw_8PyClical_8clifford_81norm, METH_NOARGS, __pyx_doc_8PyClical_8clifford_80norm},
18377 {
"abs", (PyCFunction)__pyx_pw_8PyClical_8clifford_83abs, METH_NOARGS, __pyx_doc_8PyClical_8clifford_82abs},
18378 {
"max_abs", (PyCFunction)__pyx_pw_8PyClical_8clifford_85max_abs, METH_NOARGS, __pyx_doc_8PyClical_8clifford_84max_abs},
18379 {
"truncated", (PyCFunction)__pyx_pw_8PyClical_8clifford_87truncated, METH_O, __pyx_doc_8PyClical_8clifford_86truncated},
18380 {
"isnan", (PyCFunction)__pyx_pw_8PyClical_8clifford_89isnan, METH_NOARGS, __pyx_doc_8PyClical_8clifford_88isnan},
18381 {
"frame", (PyCFunction)__pyx_pw_8PyClical_8clifford_91frame, METH_NOARGS, __pyx_doc_8PyClical_8clifford_90frame},
18382 {
"__reduce_cython__", (PyCFunction)__pyx_pw_8PyClical_8clifford_97__reduce_cython__, METH_NOARGS, 0},
18383 {
"__setstate_cython__", (PyCFunction)__pyx_pw_8PyClical_8clifford_99__setstate_cython__, METH_O, 0},
18387 static PyNumberMethods __pyx_tp_as_number_clifford = {
18388 __pyx_pw_8PyClical_8clifford_21__add__,
18389 __pyx_pw_8PyClical_8clifford_25__sub__,
18390 __pyx_pw_8PyClical_8clifford_29__mul__,
18391 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18392 __pyx_pw_8PyClical_8clifford_45__div__,
18394 __pyx_pw_8PyClical_8clifford_33__mod__,
18396 __pyx_pw_8PyClical_8clifford_55__pow__,
18397 __pyx_pw_8PyClical_8clifford_17__neg__,
18398 __pyx_pw_8PyClical_8clifford_19__pos__,
18404 __pyx_pw_8PyClical_8clifford_37__and__,
18405 __pyx_pw_8PyClical_8clifford_41__xor__,
18406 __pyx_pw_8PyClical_8clifford_51__or__,
18407 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18411 #if PY_MAJOR_VERSION < 3 18417 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18420 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18423 __pyx_pw_8PyClical_8clifford_23__iadd__,
18424 __pyx_pw_8PyClical_8clifford_27__isub__,
18425 __pyx_pw_8PyClical_8clifford_31__imul__,
18426 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18427 __pyx_pw_8PyClical_8clifford_47__idiv__,
18429 __pyx_pw_8PyClical_8clifford_35__imod__,
18433 __pyx_pw_8PyClical_8clifford_39__iand__,
18434 __pyx_pw_8PyClical_8clifford_43__ixor__,
18435 __pyx_pw_8PyClical_8clifford_53__ior__,
18441 #if PY_VERSION_HEX >= 0x03050000 18444 #if PY_VERSION_HEX >= 0x03050000 18449 static PySequenceMethods __pyx_tp_as_sequence_clifford = {
18453 __pyx_sq_item_8PyClical_clifford,
18457 __pyx_pw_8PyClical_8clifford_7__contains__,
18462 static PyMappingMethods __pyx_tp_as_mapping_clifford = {
18464 __pyx_pw_8PyClical_8clifford_15__getitem__,
18468 static PyTypeObject __pyx_type_8PyClical_clifford = {
18469 PyVarObject_HEAD_INIT(0, 0)
18470 "PyClical.clifford",
18471 sizeof(
struct __pyx_obj_8PyClical_clifford),
18473 __pyx_tp_dealloc_8PyClical_clifford,
18477 #if PY_MAJOR_VERSION < 3
18480 #if PY_MAJOR_VERSION >= 3
18483 __pyx_pw_8PyClical_8clifford_93__repr__,
18484 &__pyx_tp_as_number_clifford,
18485 &__pyx_tp_as_sequence_clifford,
18486 &__pyx_tp_as_mapping_clifford,
18488 __pyx_pw_8PyClical_8clifford_61__call__,
18489 __pyx_pw_8PyClical_8clifford_95__str__,
18493 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
18494 "\n Python class clifford wraps C++ class Clifford.\n ",
18497 __pyx_pw_8PyClical_8clifford_13__richcmp__,
18499 __pyx_pw_8PyClical_8clifford_9__iter__,
18501 __pyx_methods_8PyClical_clifford,
18511 __pyx_tp_new_8PyClical_clifford,
18521 #if PY_VERSION_HEX >= 0x030400a1 18526 static struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *__pyx_freelist_8PyClical___pyx_scope_struct____iter__[8];
18527 static int __pyx_freecount_8PyClical___pyx_scope_struct____iter__ = 0;
18529 static PyObject *__pyx_tp_new_8PyClical___pyx_scope_struct____iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
18531 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__)))) {
18532 o = (PyObject*)__pyx_freelist_8PyClical___pyx_scope_struct____iter__[--__pyx_freecount_8PyClical___pyx_scope_struct____iter__];
18533 memset(o, 0,
sizeof(
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__));
18534 (void) PyObject_INIT(o, t);
18535 PyObject_GC_Track(o);
18537 o = (*t->tp_alloc)(t, 0);
18538 if (unlikely(!o))
return 0;
18543 static void __pyx_tp_dealloc_8PyClical___pyx_scope_struct____iter__(PyObject *o) {
18544 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *p = (
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)o;
18545 PyObject_GC_UnTrack(o);
18546 Py_CLEAR(p->__pyx_v_idx);
18547 Py_CLEAR(p->__pyx_v_self);
18548 Py_CLEAR(p->__pyx_t_0);
18549 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__)))) {
18550 __pyx_freelist_8PyClical___pyx_scope_struct____iter__[__pyx_freecount_8PyClical___pyx_scope_struct____iter__++] = ((
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)o);
18552 (*Py_TYPE(o)->tp_free)(o);
18556 static int __pyx_tp_traverse_8PyClical___pyx_scope_struct____iter__(PyObject *o, visitproc v,
void *a) {
18558 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *p = (
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)o;
18559 if (p->__pyx_v_idx) {
18560 e = (*v)(p->__pyx_v_idx, a);
if (
e)
return e;
18562 if (p->__pyx_v_self) {
18563 e = (*v)(((PyObject *)p->__pyx_v_self), a);
if (
e)
return e;
18565 if (p->__pyx_t_0) {
18566 e = (*v)(p->__pyx_t_0, a);
if (
e)
return e;
18571 static PyTypeObject __pyx_type_8PyClical___pyx_scope_struct____iter__ = {
18572 PyVarObject_HEAD_INIT(0, 0)
18573 "PyClical.__pyx_scope_struct____iter__",
18574 sizeof(
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__),
18576 __pyx_tp_dealloc_8PyClical___pyx_scope_struct____iter__,
18580 #if PY_MAJOR_VERSION < 3
18583 #if PY_MAJOR_VERSION >= 3
18596 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
18598 __pyx_tp_traverse_8PyClical___pyx_scope_struct____iter__,
18614 __pyx_tp_new_8PyClical___pyx_scope_struct____iter__,
18624 #if PY_VERSION_HEX >= 0x030400a1 18629 static PyMethodDef __pyx_methods[] = {
18630 {
"compare", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_3compare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_2compare},
18631 {
"min_neg", (PyCFunction)__pyx_pw_8PyClical_5min_neg, METH_O, __pyx_doc_8PyClical_4min_neg},
18632 {
"max_pos", (PyCFunction)__pyx_pw_8PyClical_7max_pos, METH_O, __pyx_doc_8PyClical_6max_pos},
18633 {
"inv", (PyCFunction)__pyx_pw_8PyClical_11inv, METH_O, __pyx_doc_8PyClical_10inv},
18634 {
"scalar", (PyCFunction)__pyx_pw_8PyClical_13scalar, METH_O, __pyx_doc_8PyClical_12scalar},
18635 {
"real", (PyCFunction)__pyx_pw_8PyClical_15real, METH_O, __pyx_doc_8PyClical_14real},
18636 {
"imag", (PyCFunction)__pyx_pw_8PyClical_17imag, METH_O, __pyx_doc_8PyClical_16imag},
18637 {
"pure", (PyCFunction)__pyx_pw_8PyClical_19pure, METH_O, __pyx_doc_8PyClical_18pure},
18638 {
"even", (PyCFunction)__pyx_pw_8PyClical_21even, METH_O, __pyx_doc_8PyClical_20even},
18639 {
"odd", (PyCFunction)__pyx_pw_8PyClical_23odd, METH_O, __pyx_doc_8PyClical_22odd},
18640 {
"involute", (PyCFunction)__pyx_pw_8PyClical_25involute, METH_O, __pyx_doc_8PyClical_24involute},
18641 {
"reverse", (PyCFunction)__pyx_pw_8PyClical_27reverse, METH_O, __pyx_doc_8PyClical_26reverse},
18642 {
"conj", (PyCFunction)__pyx_pw_8PyClical_29conj, METH_O, __pyx_doc_8PyClical_28conj},
18643 {
"quad", (PyCFunction)__pyx_pw_8PyClical_31quad, METH_O, __pyx_doc_8PyClical_30quad},
18644 {
"norm", (PyCFunction)__pyx_pw_8PyClical_33norm, METH_O, __pyx_doc_8PyClical_32norm},
18645 {
"abs", (PyCFunction)__pyx_pw_8PyClical_35abs, METH_O, __pyx_doc_8PyClical_34abs},
18646 {
"max_abs", (PyCFunction)__pyx_pw_8PyClical_37max_abs, METH_O, __pyx_doc_8PyClical_36max_abs},
18647 {
"pow", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_39pow, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_38pow},
18648 {
"outer_pow", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_41outer_pow, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_40outer_pow},
18649 {
"complexifier", (PyCFunction)__pyx_pw_8PyClical_43complexifier, METH_O, __pyx_doc_8PyClical_42complexifier},
18650 {
"sqrt", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_45sqrt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_44sqrt},
18651 {
"exp", (PyCFunction)__pyx_pw_8PyClical_47exp, METH_O, __pyx_doc_8PyClical_46exp},
18652 {
"log", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_49log, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_48log},
18653 {
"cos", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_51cos, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_50cos},
18654 {
"acos", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_53acos, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_52acos},
18655 {
"cosh", (PyCFunction)__pyx_pw_8PyClical_55cosh, METH_O, __pyx_doc_8PyClical_54cosh},
18656 {
"acosh", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_57acosh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_56acosh},
18657 {
"sin", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_59sin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_58sin},
18658 {
"asin", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_61asin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_60asin},
18659 {
"sinh", (PyCFunction)__pyx_pw_8PyClical_63sinh, METH_O, __pyx_doc_8PyClical_62sinh},
18660 {
"asinh", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_65asinh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_64asinh},
18661 {
"tan", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_67tan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_66tan},
18662 {
"atan", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_69atan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_68atan},
18663 {
"tanh", (PyCFunction)__pyx_pw_8PyClical_71tanh, METH_O, __pyx_doc_8PyClical_70tanh},
18664 {
"atanh", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_73atanh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_72atanh},
18665 {
"random_clifford", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_75random_clifford, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_74random_clifford},
18666 {
"cga3", (PyCFunction)__pyx_pw_8PyClical_77cga3, METH_O, __pyx_doc_8PyClical_76cga3},
18667 {
"cga3std", (PyCFunction)__pyx_pw_8PyClical_79cga3std, METH_O, __pyx_doc_8PyClical_78cga3std},
18668 {
"agc3", (PyCFunction)__pyx_pw_8PyClical_81agc3, METH_O, __pyx_doc_8PyClical_80agc3},
18672 #if PY_MAJOR_VERSION >= 3 18673 #if CYTHON_PEP489_MULTI_PHASE_INIT 18674 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
18675 static int __pyx_pymod_exec_PyClical(PyObject* module);
18676 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
18677 {Py_mod_create, (
void*)__pyx_pymod_create},
18678 {Py_mod_exec, (
void*)__pyx_pymod_exec_PyClical},
18683 static struct PyModuleDef __pyx_moduledef = {
18684 PyModuleDef_HEAD_INIT,
18687 #if CYTHON_PEP489_MULTI_PHASE_INIT 18693 #if CYTHON_PEP489_MULTI_PHASE_INIT 18694 __pyx_moduledef_slots,
18703 #ifndef CYTHON_SMALL_CODE 18704 #if defined(__clang__) 18705 #define CYTHON_SMALL_CODE 18706 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) 18707 #define CYTHON_SMALL_CODE __attribute__((cold)) 18709 #define CYTHON_SMALL_CODE 18713 static __Pyx_StringTabEntry __pyx_string_tab[] = {
18714 {&__pyx_kp_s_, __pyx_k_,
sizeof(__pyx_k_), 0, 0, 1, 0},
18715 {&__pyx_kp_s_0_8_2, __pyx_k_0_8_2,
sizeof(__pyx_k_0_8_2), 0, 0, 1, 0},
18716 {&__pyx_kp_u_Abbreviation_for_clifford_index, __pyx_k_Abbreviation_for_clifford_index,
sizeof(__pyx_k_Abbreviation_for_clifford_index), 0, 1, 0, 0},
18717 {&__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},
18718 {&__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},
18719 {&__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},
18720 {&__pyx_kp_s_Cannot_initialize_clifford_objec, __pyx_k_Cannot_initialize_clifford_objec,
sizeof(__pyx_k_Cannot_initialize_clifford_objec), 0, 0, 1, 0},
18721 {&__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},
18722 {&__pyx_kp_s_Cannot_reframe, __pyx_k_Cannot_reframe,
sizeof(__pyx_k_Cannot_reframe), 0, 0, 1, 0},
18723 {&__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},
18724 {&__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},
18725 {&__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},
18726 {&__pyx_kp_u_Conjugation_reverse_o_involute, __pyx_k_Conjugation_reverse_o_involute,
sizeof(__pyx_k_Conjugation_reverse_o_involute), 0, 1, 0, 0},
18727 {&__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},
18728 {&__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},
18729 {&__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},
18730 {&__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},
18731 {&__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},
18732 {&__pyx_kp_u_Convert_Euclidean_3D_multivecto, __pyx_k_Convert_Euclidean_3D_multivecto,
sizeof(__pyx_k_Convert_Euclidean_3D_multivecto), 0, 1, 0, 0},
18733 {&__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},
18734 {&__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},
18735 {&__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},
18736 {&__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},
18737 {&__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},
18738 {&__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},
18739 {&__pyx_kp_u_Geometric_difference_print_clif, __pyx_k_Geometric_difference_print_clif,
sizeof(__pyx_k_Geometric_difference_print_clif), 0, 1, 0, 0},
18740 {&__pyx_kp_u_Geometric_difference_x_clifford, __pyx_k_Geometric_difference_x_clifford,
sizeof(__pyx_k_Geometric_difference_x_clifford), 0, 1, 0, 0},
18741 {&__pyx_kp_u_Geometric_multiplicative_invers, __pyx_k_Geometric_multiplicative_invers,
sizeof(__pyx_k_Geometric_multiplicative_invers), 0, 1, 0, 0},
18742 {&__pyx_kp_u_Geometric_multiplicative_invers_2, __pyx_k_Geometric_multiplicative_invers_2,
sizeof(__pyx_k_Geometric_multiplicative_invers_2), 0, 1, 0, 0},
18743 {&__pyx_kp_u_Geometric_product_print_cliffor, __pyx_k_Geometric_product_print_cliffor,
sizeof(__pyx_k_Geometric_product_print_cliffor), 0, 1, 0, 0},
18744 {&__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},
18745 {&__pyx_kp_u_Geometric_quotient_print_cliffo, __pyx_k_Geometric_quotient_print_cliffo,
sizeof(__pyx_k_Geometric_quotient_print_cliffo), 0, 1, 0, 0},
18746 {&__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},
18747 {&__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},
18748 {&__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},
18749 {&__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},
18750 {&__pyx_kp_u_Hyperbolic_cosine_of_multivecto, __pyx_k_Hyperbolic_cosine_of_multivecto,
sizeof(__pyx_k_Hyperbolic_cosine_of_multivecto), 0, 1, 0, 0},
18751 {&__pyx_kp_u_Hyperbolic_sine_of_multivector, __pyx_k_Hyperbolic_sine_of_multivector,
sizeof(__pyx_k_Hyperbolic_sine_of_multivector), 0, 1, 0, 0},
18752 {&__pyx_kp_u_Hyperbolic_tangent_of_multivect, __pyx_k_Hyperbolic_tangent_of_multivect,
sizeof(__pyx_k_Hyperbolic_tangent_of_multivect), 0, 1, 0, 0},
18753 {&__pyx_kp_u_Imaginary_part_deprecated_alway, __pyx_k_Imaginary_part_deprecated_alway,
sizeof(__pyx_k_Imaginary_part_deprecated_alway), 0, 1, 0, 0},
18754 {&__pyx_n_s_IndexError, __pyx_k_IndexError,
sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
18755 {&__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},
18756 {&__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},
18757 {&__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},
18758 {&__pyx_n_s_Integral, __pyx_k_Integral,
sizeof(__pyx_k_Integral), 0, 0, 1, 1},
18759 {&__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},
18760 {&__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},
18761 {&__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},
18762 {&__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},
18763 {&__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},
18764 {&__pyx_kp_u_Inverse_tangent_of_multivector, __pyx_k_Inverse_tangent_of_multivector,
sizeof(__pyx_k_Inverse_tangent_of_multivector), 0, 1, 0, 0},
18765 {&__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},
18766 {&__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},
18767 {&__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},
18768 {&__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},
18769 {&__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},
18770 {&__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},
18771 {&__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},
18772 {&__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},
18773 {&__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},
18774 {&__pyx_kp_u_Natural_logarithm_of_multivecto, __pyx_k_Natural_logarithm_of_multivecto,
sizeof(__pyx_k_Natural_logarithm_of_multivecto), 0, 1, 0, 0},
18775 {&__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},
18776 {&__pyx_n_s_NotImplemented, __pyx_k_NotImplemented,
sizeof(__pyx_k_NotImplemented), 0, 0, 1, 1},
18777 {&__pyx_kp_s_Not_applicable, __pyx_k_Not_applicable,
sizeof(__pyx_k_Not_applicable), 0, 0, 1, 0},
18778 {&__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},
18779 {&__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},
18780 {&__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},
18781 {&__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},
18782 {&__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},
18783 {&__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},
18784 {&__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},
18785 {&__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},
18786 {&__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},
18787 {&__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},
18788 {&__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},
18789 {&__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},
18790 {&__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},
18791 {&__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},
18792 {&__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},
18793 {&__pyx_n_s_PyClical, __pyx_k_PyClical,
sizeof(__pyx_k_PyClical), 0, 0, 1, 1},
18794 {&__pyx_kp_s_PyClical_pyx, __pyx_k_PyClical_pyx,
sizeof(__pyx_k_PyClical_pyx), 0, 0, 1, 0},
18795 {&__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},
18796 {&__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},
18797 {&__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},
18798 {&__pyx_n_s_Real, __pyx_k_Real,
sizeof(__pyx_k_Real), 0, 0, 1, 1},
18799 {&__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},
18800 {&__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},
18801 {&__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},
18802 {&__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},
18803 {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError,
sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
18804 {&__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},
18805 {&__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},
18806 {&__pyx_n_s_Sequence, __pyx_k_Sequence,
sizeof(__pyx_k_Sequence), 0, 0, 1, 1},
18807 {&__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},
18808 {&__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},
18809 {&__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},
18810 {&__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},
18811 {&__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},
18812 {&__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},
18813 {&__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},
18814 {&__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},
18815 {&__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},
18816 {&__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},
18817 {&__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},
18818 {&__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},
18819 {&__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},
18820 {&__pyx_kp_u_Symmetric_set_difference_exclus, __pyx_k_Symmetric_set_difference_exclus,
sizeof(__pyx_k_Symmetric_set_difference_exclus), 0, 1, 0, 0},
18821 {&__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},
18822 {&__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},
18823 {&__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},
18824 {&__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},
18825 {&__pyx_kp_u_The_informal_string_representat, __pyx_k_The_informal_string_representat,
sizeof(__pyx_k_The_informal_string_representat), 0, 1, 0, 0},
18826 {&__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},
18827 {&__pyx_kp_u_The_official_string_representat, __pyx_k_The_official_string_representat,
sizeof(__pyx_k_The_official_string_representat), 0, 1, 0, 0},
18828 {&__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},
18829 {&__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},
18830 {&__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},
18831 {&__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},
18832 {&__pyx_n_s_TypeError, __pyx_k_TypeError,
sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
18833 {&__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},
18834 {&__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},
18835 {&__pyx_n_s_ValueError, __pyx_k_ValueError,
sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
18836 {&__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},
18837 {&__pyx_kp_s__2, __pyx_k__2,
sizeof(__pyx_k__2), 0, 0, 1, 0},
18838 {&__pyx_kp_s__5, __pyx_k__5,
sizeof(__pyx_k__5), 0, 0, 1, 0},
18839 {&__pyx_kp_s__6, __pyx_k__6,
sizeof(__pyx_k__6), 0, 0, 1, 0},
18840 {&__pyx_kp_s__7, __pyx_k__7,
sizeof(__pyx_k__7), 0, 0, 1, 0},
18841 {&__pyx_kp_s__8, __pyx_k__8,
sizeof(__pyx_k__8), 0, 0, 1, 0},
18842 {&__pyx_kp_s__9, __pyx_k__9,
sizeof(__pyx_k__9), 0, 0, 1, 0},
18843 {&__pyx_kp_u_abs_line_1473, __pyx_k_abs_line_1473,
sizeof(__pyx_k_abs_line_1473), 0, 1, 0, 0},
18844 {&__pyx_n_s_acos, __pyx_k_acos,
sizeof(__pyx_k_acos), 0, 0, 1, 1},
18845 {&__pyx_kp_u_acos_line_1619, __pyx_k_acos_line_1619,
sizeof(__pyx_k_acos_line_1619), 0, 1, 0, 0},
18846 {&__pyx_n_s_acosh, __pyx_k_acosh,
sizeof(__pyx_k_acosh), 0, 0, 1, 1},
18847 {&__pyx_kp_u_acosh_line_1656, __pyx_k_acosh_line_1656,
sizeof(__pyx_k_acosh_line_1656), 0, 1, 0, 0},
18848 {&__pyx_kp_u_agc3_line_1844, __pyx_k_agc3_line_1844,
sizeof(__pyx_k_agc3_line_1844), 0, 1, 0, 0},
18849 {&__pyx_n_s_args, __pyx_k_args,
sizeof(__pyx_k_args), 0, 0, 1, 1},
18850 {&__pyx_kp_s_as_frame, __pyx_k_as_frame,
sizeof(__pyx_k_as_frame), 0, 0, 1, 0},
18851 {&__pyx_n_s_asin, __pyx_k_asin,
sizeof(__pyx_k_asin), 0, 0, 1, 1},
18852 {&__pyx_kp_u_asin_line_1698, __pyx_k_asin_line_1698,
sizeof(__pyx_k_asin_line_1698), 0, 1, 0, 0},
18853 {&__pyx_n_s_asinh, __pyx_k_asinh,
sizeof(__pyx_k_asinh), 0, 0, 1, 1},
18854 {&__pyx_kp_u_asinh_line_1733, __pyx_k_asinh_line_1733,
sizeof(__pyx_k_asinh_line_1733), 0, 1, 0, 0},
18855 {&__pyx_n_s_atan, __pyx_k_atan,
sizeof(__pyx_k_atan), 0, 0, 1, 1},
18856 {&__pyx_kp_u_atan_line_1769, __pyx_k_atan_line_1769,
sizeof(__pyx_k_atan_line_1769), 0, 1, 0, 0},
18857 {&__pyx_n_s_atanh, __pyx_k_atanh,
sizeof(__pyx_k_atanh), 0, 0, 1, 1},
18858 {&__pyx_kp_u_atanh_line_1798, __pyx_k_atanh_line_1798,
sizeof(__pyx_k_atanh_line_1798), 0, 1, 0, 0},
18859 {&__pyx_kp_u_cga3_line_1824, __pyx_k_cga3_line_1824,
sizeof(__pyx_k_cga3_line_1824), 0, 1, 0, 0},
18860 {&__pyx_kp_u_cga3std_line_1833, __pyx_k_cga3std_line_1833,
sizeof(__pyx_k_cga3std_line_1833), 0, 1, 0, 0},
18861 {&__pyx_n_s_cl, __pyx_k_cl,
sizeof(__pyx_k_cl), 0, 0, 1, 1},
18862 {&__pyx_n_s_clifford, __pyx_k_clifford,
sizeof(__pyx_k_clifford), 0, 0, 1, 1},
18863 {&__pyx_kp_u_clifford___add___line_739, __pyx_k_clifford___add___line_739,
sizeof(__pyx_k_clifford___add___line_739), 0, 1, 0, 0},
18864 {&__pyx_kp_u_clifford___and___line_835, __pyx_k_clifford___and___line_835,
sizeof(__pyx_k_clifford___and___line_835), 0, 1, 0, 0},
18865 {&__pyx_kp_u_clifford___call___line_1019, __pyx_k_clifford___call___line_1019,
sizeof(__pyx_k_clifford___call___line_1019), 0, 1, 0, 0},
18866 {&__pyx_kp_u_clifford___div___line_895, __pyx_k_clifford___div___line_895,
sizeof(__pyx_k_clifford___div___line_895), 0, 1, 0, 0},
18867 {&__pyx_kp_u_clifford___getitem___line_706, __pyx_k_clifford___getitem___line_706,
sizeof(__pyx_k_clifford___getitem___line_706), 0, 1, 0, 0},
18868 {&__pyx_kp_u_clifford___iadd___line_750, __pyx_k_clifford___iadd___line_750,
sizeof(__pyx_k_clifford___iadd___line_750), 0, 1, 0, 0},
18869 {&__pyx_kp_u_clifford___iand___line_850, __pyx_k_clifford___iand___line_850,
sizeof(__pyx_k_clifford___iand___line_850), 0, 1, 0, 0},
18870 {&__pyx_kp_u_clifford___idiv___line_910, __pyx_k_clifford___idiv___line_910,
sizeof(__pyx_k_clifford___idiv___line_910), 0, 1, 0, 0},
18871 {&__pyx_kp_u_clifford___imod___line_820, __pyx_k_clifford___imod___line_820,
sizeof(__pyx_k_clifford___imod___line_820), 0, 1, 0, 0},
18872 {&__pyx_kp_u_clifford___imul___line_792, __pyx_k_clifford___imul___line_792,
sizeof(__pyx_k_clifford___imul___line_792), 0, 1, 0, 0},
18873 {&__pyx_kp_u_clifford___ior___line_949, __pyx_k_clifford___ior___line_949,
sizeof(__pyx_k_clifford___ior___line_949), 0, 1, 0, 0},
18874 {&__pyx_kp_u_clifford___isub___line_770, __pyx_k_clifford___isub___line_770,
sizeof(__pyx_k_clifford___isub___line_770), 0, 1, 0, 0},
18875 {&__pyx_kp_u_clifford___iter___line_637, __pyx_k_clifford___iter___line_637,
sizeof(__pyx_k_clifford___iter___line_637), 0, 1, 0, 0},
18876 {&__pyx_kp_u_clifford___ixor___line_880, __pyx_k_clifford___ixor___line_880,
sizeof(__pyx_k_clifford___ixor___line_880), 0, 1, 0, 0},
18877 {&__pyx_kp_u_clifford___mod___line_805, __pyx_k_clifford___mod___line_805,
sizeof(__pyx_k_clifford___mod___line_805), 0, 1, 0, 0},
18878 {&__pyx_kp_u_clifford___mul___line_779, __pyx_k_clifford___mul___line_779,
sizeof(__pyx_k_clifford___mul___line_779), 0, 1, 0, 0},
18879 {&__pyx_kp_u_clifford___neg___line_721, __pyx_k_clifford___neg___line_721,
sizeof(__pyx_k_clifford___neg___line_721), 0, 1, 0, 0},
18880 {&__pyx_kp_u_clifford___or___line_938, __pyx_k_clifford___or___line_938,
sizeof(__pyx_k_clifford___or___line_938), 0, 1, 0, 0},
18881 {&__pyx_kp_u_clifford___pos___line_730, __pyx_k_clifford___pos___line_730,
sizeof(__pyx_k_clifford___pos___line_730), 0, 1, 0, 0},
18882 {&__pyx_kp_u_clifford___pow___line_960, __pyx_k_clifford___pow___line_960,
sizeof(__pyx_k_clifford___pow___line_960), 0, 1, 0, 0},
18883 {&__pyx_kp_u_clifford___repr___line_1225, __pyx_k_clifford___repr___line_1225,
sizeof(__pyx_k_clifford___repr___line_1225), 0, 1, 0, 0},
18884 {&__pyx_kp_u_clifford___str___line_1234, __pyx_k_clifford___str___line_1234,
sizeof(__pyx_k_clifford___str___line_1234), 0, 1, 0, 0},
18885 {&__pyx_kp_u_clifford___sub___line_759, __pyx_k_clifford___sub___line_759,
sizeof(__pyx_k_clifford___sub___line_759), 0, 1, 0, 0},
18886 {&__pyx_kp_u_clifford___xor___line_865, __pyx_k_clifford___xor___line_865,
sizeof(__pyx_k_clifford___xor___line_865), 0, 1, 0, 0},
18887 {&__pyx_kp_u_clifford_abs_line_1174, __pyx_k_clifford_abs_line_1174,
sizeof(__pyx_k_clifford_abs_line_1174), 0, 1, 0, 0},
18888 {&__pyx_kp_u_clifford_conj_line_1137, __pyx_k_clifford_conj_line_1137,
sizeof(__pyx_k_clifford_conj_line_1137), 0, 1, 0, 0},
18889 {&__pyx_kp_u_clifford_copy_line_554, __pyx_k_clifford_copy_line_554,
sizeof(__pyx_k_clifford_copy_line_554), 0, 1, 0, 0},
18890 {&__pyx_kp_u_clifford_even_line_1060, __pyx_k_clifford_even_line_1060,
sizeof(__pyx_k_clifford_even_line_1060), 0, 1, 0, 0},
18891 {&__pyx_kp_u_clifford_frame_line_1214, __pyx_k_clifford_frame_line_1214,
sizeof(__pyx_k_clifford_frame_line_1214), 0, 1, 0, 0},
18892 {&__pyx_n_s_clifford_hidden_doctests, __pyx_k_clifford_hidden_doctests,
sizeof(__pyx_k_clifford_hidden_doctests), 0, 0, 1, 1},
18893 {&__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},
18894 {&__pyx_kp_u_clifford_inv_line_925, __pyx_k_clifford_inv_line_925,
sizeof(__pyx_k_clifford_inv_line_925), 0, 1, 0, 0},
18895 {&__pyx_kp_u_clifford_involute_line_1106, __pyx_k_clifford_involute_line_1106,
sizeof(__pyx_k_clifford_involute_line_1106), 0, 1, 0, 0},
18896 {&__pyx_kp_u_clifford_isnan_line_1205, __pyx_k_clifford_isnan_line_1205,
sizeof(__pyx_k_clifford_isnan_line_1205), 0, 1, 0, 0},
18897 {&__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},
18898 {&__pyx_kp_u_clifford_norm_line_1163, __pyx_k_clifford_norm_line_1163,
sizeof(__pyx_k_clifford_norm_line_1163), 0, 1, 0, 0},
18899 {&__pyx_kp_u_clifford_odd_line_1069, __pyx_k_clifford_odd_line_1069,
sizeof(__pyx_k_clifford_odd_line_1069), 0, 1, 0, 0},
18900 {&__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},
18901 {&__pyx_kp_u_clifford_pow_line_979, __pyx_k_clifford_pow_line_979,
sizeof(__pyx_k_clifford_pow_line_979), 0, 1, 0, 0},
18902 {&__pyx_kp_u_clifford_pure_line_1049, __pyx_k_clifford_pure_line_1049,
sizeof(__pyx_k_clifford_pure_line_1049), 0, 1, 0, 0},
18903 {&__pyx_kp_u_clifford_quad_line_1152, __pyx_k_clifford_quad_line_1152,
sizeof(__pyx_k_clifford_quad_line_1152), 0, 1, 0, 0},
18904 {&__pyx_kp_u_clifford_reframe_line_648, __pyx_k_clifford_reframe_line_648,
sizeof(__pyx_k_clifford_reframe_line_648), 0, 1, 0, 0},
18905 {&__pyx_kp_u_clifford_reverse_line_1122, __pyx_k_clifford_reverse_line_1122,
sizeof(__pyx_k_clifford_reverse_line_1122), 0, 1, 0, 0},
18906 {&__pyx_kp_u_clifford_scalar_line_1038, __pyx_k_clifford_scalar_line_1038,
sizeof(__pyx_k_clifford_scalar_line_1038), 0, 1, 0, 0},
18907 {&__pyx_kp_u_clifford_truncated_line_1194, __pyx_k_clifford_truncated_line_1194,
sizeof(__pyx_k_clifford_truncated_line_1194), 0, 1, 0, 0},
18908 {&__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},
18909 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback,
sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
18910 {&__pyx_n_s_close, __pyx_k_close,
sizeof(__pyx_k_close), 0, 0, 1, 1},
18911 {&__pyx_n_s_collections, __pyx_k_collections,
sizeof(__pyx_k_collections), 0, 0, 1, 1},
18912 {&__pyx_kp_u_compare_line_490, __pyx_k_compare_line_490,
sizeof(__pyx_k_compare_line_490), 0, 1, 0, 0},
18913 {&__pyx_kp_u_complexifier_line_1527, __pyx_k_complexifier_line_1527,
sizeof(__pyx_k_complexifier_line_1527), 0, 1, 0, 0},
18914 {&__pyx_n_s_conj, __pyx_k_conj,
sizeof(__pyx_k_conj), 0, 0, 1, 1},
18915 {&__pyx_kp_u_conj_line_1436, __pyx_k_conj_line_1436,
sizeof(__pyx_k_conj_line_1436), 0, 1, 0, 0},
18916 {&__pyx_n_s_copy, __pyx_k_copy,
sizeof(__pyx_k_copy), 0, 0, 1, 1},
18917 {&__pyx_n_s_cos, __pyx_k_cos,
sizeof(__pyx_k_cos), 0, 0, 1, 1},
18918 {&__pyx_kp_u_cos_line_1602, __pyx_k_cos_line_1602,
sizeof(__pyx_k_cos_line_1602), 0, 1, 0, 0},
18919 {&__pyx_n_s_cosh, __pyx_k_cosh,
sizeof(__pyx_k_cosh), 0, 0, 1, 1},
18920 {&__pyx_kp_u_cosh_line_1640, __pyx_k_cosh_line_1640,
sizeof(__pyx_k_cosh_line_1640), 0, 1, 0, 0},
18921 {&__pyx_n_s_doctest, __pyx_k_doctest,
sizeof(__pyx_k_doctest), 0, 0, 1, 1},
18922 {&__pyx_n_s_e, __pyx_k_e,
sizeof(__pyx_k_e), 0, 0, 1, 1},
18923 {&__pyx_kp_u_e_line_1887, __pyx_k_e_line_1887,
sizeof(__pyx_k_e_line_1887), 0, 1, 0, 0},
18924 {&__pyx_n_s_even, __pyx_k_even,
sizeof(__pyx_k_even), 0, 0, 1, 1},
18925 {&__pyx_kp_u_even_line_1388, __pyx_k_even_line_1388,
sizeof(__pyx_k_even_line_1388), 0, 1, 0, 0},
18926 {&__pyx_n_s_exp, __pyx_k_exp,
sizeof(__pyx_k_exp), 0, 0, 1, 1},
18927 {&__pyx_kp_u_exp_line_1565, __pyx_k_exp_line_1565,
sizeof(__pyx_k_exp_line_1565), 0, 1, 0, 0},
18928 {&__pyx_n_s_fill, __pyx_k_fill,
sizeof(__pyx_k_fill), 0, 0, 1, 1},
18929 {&__pyx_n_s_frm, __pyx_k_frm,
sizeof(__pyx_k_frm), 0, 0, 1, 1},
18930 {&__pyx_kp_s_from, __pyx_k_from,
sizeof(__pyx_k_from), 0, 0, 1, 0},
18931 {&__pyx_n_s_getstate, __pyx_k_getstate,
sizeof(__pyx_k_getstate), 0, 0, 1, 1},
18932 {&__pyx_n_s_grade, __pyx_k_grade,
sizeof(__pyx_k_grade), 0, 0, 1, 1},
18933 {&__pyx_n_s_i, __pyx_k_i,
sizeof(__pyx_k_i), 0, 0, 1, 1},
18934 {&__pyx_kp_u_imag_line_1366, __pyx_k_imag_line_1366,
sizeof(__pyx_k_imag_line_1366), 0, 1, 0, 0},
18935 {&__pyx_n_s_import, __pyx_k_import,
sizeof(__pyx_k_import), 0, 0, 1, 1},
18936 {&__pyx_n_s_index_set, __pyx_k_index_set,
sizeof(__pyx_k_index_set), 0, 0, 1, 1},
18937 {&__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},
18938 {&__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},
18939 {&__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},
18940 {&__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},
18941 {&__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},
18942 {&__pyx_n_s_index_set___iter, __pyx_k_index_set___iter,
sizeof(__pyx_k_index_set___iter), 0, 0, 1, 1},
18943 {&__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},
18944 {&__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},
18945 {&__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},
18946 {&__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},
18947 {&__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},
18948 {&__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},
18949 {&__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},
18950 {&__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},
18951 {&__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},
18952 {&__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},
18953 {&__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},
18954 {&__pyx_n_s_index_set_hidden_doctests, __pyx_k_index_set_hidden_doctests,
sizeof(__pyx_k_index_set_hidden_doctests), 0, 0, 1, 1},
18955 {&__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},
18956 {&__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},
18957 {&__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},
18958 {&__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},
18959 {&__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},
18960 {&__pyx_n_s_inv, __pyx_k_inv,
sizeof(__pyx_k_inv), 0, 0, 1, 1},
18961 {&__pyx_kp_u_inv_line_1329, __pyx_k_inv_line_1329,
sizeof(__pyx_k_inv_line_1329), 0, 1, 0, 0},
18962 {&__pyx_kp_s_invalid, __pyx_k_invalid,
sizeof(__pyx_k_invalid), 0, 0, 1, 0},
18963 {&__pyx_kp_s_invalid_string, __pyx_k_invalid_string,
sizeof(__pyx_k_invalid_string), 0, 0, 1, 0},
18964 {&__pyx_n_s_involute, __pyx_k_involute,
sizeof(__pyx_k_involute), 0, 0, 1, 1},
18965 {&__pyx_kp_u_involute_line_1406, __pyx_k_involute_line_1406,
sizeof(__pyx_k_involute_line_1406), 0, 1, 0, 0},
18966 {&__pyx_n_s_ist, __pyx_k_ist,
sizeof(__pyx_k_ist), 0, 0, 1, 1},
18967 {&__pyx_n_s_istpq, __pyx_k_istpq,
sizeof(__pyx_k_istpq), 0, 0, 1, 1},
18968 {&__pyx_kp_u_istpq_line_1900, __pyx_k_istpq_line_1900,
sizeof(__pyx_k_istpq_line_1900), 0, 1, 0, 0},
18969 {&__pyx_n_s_iter, __pyx_k_iter,
sizeof(__pyx_k_iter), 0, 0, 1, 1},
18970 {&__pyx_n_s_ixt, __pyx_k_ixt,
sizeof(__pyx_k_ixt), 0, 0, 1, 1},
18971 {&__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},
18972 {&__pyx_n_s_lhs, __pyx_k_lhs,
sizeof(__pyx_k_lhs), 0, 0, 1, 1},
18973 {&__pyx_n_s_log, __pyx_k_log,
sizeof(__pyx_k_log), 0, 0, 1, 1},
18974 {&__pyx_kp_u_log_line_1579, __pyx_k_log_line_1579,
sizeof(__pyx_k_log_line_1579), 0, 1, 0, 0},
18975 {&__pyx_n_s_m, __pyx_k_m,
sizeof(__pyx_k_m), 0, 0, 1, 1},
18976 {&__pyx_n_s_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 0, 1, 1},
18977 {&__pyx_n_s_math, __pyx_k_math,
sizeof(__pyx_k_math), 0, 0, 1, 1},
18978 {&__pyx_n_s_max, __pyx_k_max,
sizeof(__pyx_k_max), 0, 0, 1, 1},
18979 {&__pyx_kp_u_max_abs_line_1482, __pyx_k_max_abs_line_1482,
sizeof(__pyx_k_max_abs_line_1482), 0, 1, 0, 0},
18980 {&__pyx_kp_u_max_pos_line_511, __pyx_k_max_pos_line_511,
sizeof(__pyx_k_max_pos_line_511), 0, 1, 0, 0},
18981 {&__pyx_n_s_min, __pyx_k_min,
sizeof(__pyx_k_min), 0, 0, 1, 1},
18982 {&__pyx_kp_u_min_neg_line_502, __pyx_k_min_neg_line_502,
sizeof(__pyx_k_min_neg_line_502), 0, 1, 0, 0},
18983 {&__pyx_n_s_name, __pyx_k_name,
sizeof(__pyx_k_name), 0, 0, 1, 1},
18984 {&__pyx_n_s_nbar3, __pyx_k_nbar3,
sizeof(__pyx_k_nbar3), 0, 0, 1, 1},
18985 {&__pyx_n_s_ninf3, __pyx_k_ninf3,
sizeof(__pyx_k_ninf3), 0, 0, 1, 1},
18986 {&__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},
18987 {&__pyx_n_s_norm, __pyx_k_norm,
sizeof(__pyx_k_norm), 0, 0, 1, 1},
18988 {&__pyx_kp_u_norm_line_1462, __pyx_k_norm_line_1462,
sizeof(__pyx_k_norm_line_1462), 0, 1, 0, 0},
18989 {&__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},
18990 {&__pyx_n_s_numbers, __pyx_k_numbers,
sizeof(__pyx_k_numbers), 0, 0, 1, 1},
18991 {&__pyx_n_s_obj, __pyx_k_obj,
sizeof(__pyx_k_obj), 0, 0, 1, 1},
18992 {&__pyx_n_s_odd, __pyx_k_odd,
sizeof(__pyx_k_odd), 0, 0, 1, 1},
18993 {&__pyx_kp_u_odd_line_1397, __pyx_k_odd_line_1397,
sizeof(__pyx_k_odd_line_1397), 0, 1, 0, 0},
18994 {&__pyx_n_s_other, __pyx_k_other,
sizeof(__pyx_k_other), 0, 0, 1, 1},
18995 {&__pyx_n_s_outer_pow, __pyx_k_outer_pow,
sizeof(__pyx_k_outer_pow), 0, 0, 1, 1},
18996 {&__pyx_kp_u_outer_pow_line_1518, __pyx_k_outer_pow_line_1518,
sizeof(__pyx_k_outer_pow_line_1518), 0, 1, 0, 0},
18997 {&__pyx_n_s_p, __pyx_k_p,
sizeof(__pyx_k_p), 0, 0, 1, 1},
18998 {&__pyx_n_s_pi, __pyx_k_pi,
sizeof(__pyx_k_pi), 0, 0, 1, 1},
18999 {&__pyx_n_s_pow, __pyx_k_pow,
sizeof(__pyx_k_pow), 0, 0, 1, 1},
19000 {&__pyx_kp_u_pow_line_1494, __pyx_k_pow_line_1494,
sizeof(__pyx_k_pow_line_1494), 0, 1, 0, 0},
19001 {&__pyx_n_s_pure, __pyx_k_pure,
sizeof(__pyx_k_pure), 0, 0, 1, 1},
19002 {&__pyx_kp_u_pure_line_1377, __pyx_k_pure_line_1377,
sizeof(__pyx_k_pure_line_1377), 0, 1, 0, 0},
19003 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable,
sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
19004 {&__pyx_n_s_q, __pyx_k_q,
sizeof(__pyx_k_q), 0, 0, 1, 1},
19005 {&__pyx_n_s_quad, __pyx_k_quad,
sizeof(__pyx_k_quad), 0, 0, 1, 1},
19006 {&__pyx_kp_u_quad_line_1451, __pyx_k_quad_line_1451,
sizeof(__pyx_k_quad_line_1451), 0, 1, 0, 0},
19007 {&__pyx_kp_u_random_clifford_line_1815, __pyx_k_random_clifford_line_1815,
sizeof(__pyx_k_random_clifford_line_1815), 0, 1, 0, 0},
19008 {&__pyx_n_s_range, __pyx_k_range,
sizeof(__pyx_k_range), 0, 0, 1, 1},
19009 {&__pyx_kp_u_real_line_1355, __pyx_k_real_line_1355,
sizeof(__pyx_k_real_line_1355), 0, 1, 0, 0},
19010 {&__pyx_n_s_reduce, __pyx_k_reduce,
sizeof(__pyx_k_reduce), 0, 0, 1, 1},
19011 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython,
sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
19012 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex,
sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
19013 {&__pyx_n_s_reverse, __pyx_k_reverse,
sizeof(__pyx_k_reverse), 0, 0, 1, 1},
19014 {&__pyx_kp_u_reverse_line_1421, __pyx_k_reverse_line_1421,
sizeof(__pyx_k_reverse_line_1421), 0, 1, 0, 0},
19015 {&__pyx_n_s_rhs, __pyx_k_rhs,
sizeof(__pyx_k_rhs), 0, 0, 1, 1},
19016 {&__pyx_n_s_scalar, __pyx_k_scalar,
sizeof(__pyx_k_scalar), 0, 0, 1, 1},
19017 {&__pyx_kp_u_scalar_line_1344, __pyx_k_scalar_line_1344,
sizeof(__pyx_k_scalar_line_1344), 0, 1, 0, 0},
19018 {&__pyx_n_s_send, __pyx_k_send,
sizeof(__pyx_k_send), 0, 0, 1, 1},
19019 {&__pyx_n_s_setstate, __pyx_k_setstate,
sizeof(__pyx_k_setstate), 0, 0, 1, 1},
19020 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython,
sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
19021 {&__pyx_n_s_sin, __pyx_k_sin,
sizeof(__pyx_k_sin), 0, 0, 1, 1},
19022 {&__pyx_kp_u_sin_line_1679, __pyx_k_sin_line_1679,
sizeof(__pyx_k_sin_line_1679), 0, 1, 0, 0},
19023 {&__pyx_n_s_sinh, __pyx_k_sinh,
sizeof(__pyx_k_sinh), 0, 0, 1, 1},
19024 {&__pyx_kp_u_sinh_line_1719, __pyx_k_sinh_line_1719,
sizeof(__pyx_k_sinh_line_1719), 0, 1, 0, 0},
19025 {&__pyx_n_s_sqrt, __pyx_k_sqrt,
sizeof(__pyx_k_sqrt), 0, 0, 1, 1},
19026 {&__pyx_kp_u_sqrt_line_1542, __pyx_k_sqrt_line_1542,
sizeof(__pyx_k_sqrt_line_1542), 0, 1, 0, 0},
19027 {&__pyx_n_s_tan, __pyx_k_tan,
sizeof(__pyx_k_tan), 0, 0, 1, 1},
19028 {&__pyx_kp_u_tan_line_1752, __pyx_k_tan_line_1752,
sizeof(__pyx_k_tan_line_1752), 0, 1, 0, 0},
19029 {&__pyx_n_s_tanh, __pyx_k_tanh,
sizeof(__pyx_k_tanh), 0, 0, 1, 1},
19030 {&__pyx_kp_u_tanh_line_1786, __pyx_k_tanh_line_1786,
sizeof(__pyx_k_tanh_line_1786), 0, 1, 0, 0},
19031 {&__pyx_n_s_tau, __pyx_k_tau,
sizeof(__pyx_k_tau), 0, 0, 1, 1},
19032 {&__pyx_n_s_test, __pyx_k_test,
sizeof(__pyx_k_test), 0, 0, 1, 1},
19033 {&__pyx_n_s_test_2, __pyx_k_test_2,
sizeof(__pyx_k_test_2), 0, 0, 1, 1},
19034 {&__pyx_n_s_testmod, __pyx_k_testmod,
sizeof(__pyx_k_testmod), 0, 0, 1, 1},
19035 {&__pyx_n_s_throw, __pyx_k_throw,
sizeof(__pyx_k_throw), 0, 0, 1, 1},
19036 {&__pyx_kp_s_to_frame, __pyx_k_to_frame,
sizeof(__pyx_k_to_frame), 0, 0, 1, 0},
19037 {&__pyx_kp_s_using, __pyx_k_using,
sizeof(__pyx_k_using), 0, 0, 1, 0},
19038 {&__pyx_kp_s_using_invalid, __pyx_k_using_invalid,
sizeof(__pyx_k_using_invalid), 0, 0, 1, 0},
19039 {&__pyx_kp_s_value, __pyx_k_value,
sizeof(__pyx_k_value), 0, 0, 1, 0},
19040 {&__pyx_n_s_version, __pyx_k_version,
sizeof(__pyx_k_version), 0, 0, 1, 1},
19041 {&__pyx_n_s_xrange, __pyx_k_xrange,
sizeof(__pyx_k_xrange), 0, 0, 1, 1},
19042 {0, 0, 0, 0, 0, 0, 0}
19044 static CYTHON_SMALL_CODE
int __Pyx_InitCachedBuiltins(
void) {
19045 __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError);
if (!__pyx_builtin_IndexError) __PYX_ERR(0, 102, __pyx_L1_error)
19046 __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError);
if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 104, __pyx_L1_error)
19047 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError);
if (!__pyx_builtin_TypeError) __PYX_ERR(0, 104, __pyx_L1_error)
19048 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError);
if (!__pyx_builtin_ValueError) __PYX_ERR(0, 105, __pyx_L1_error)
19049 __pyx_builtin_NotImplemented = __Pyx_GetBuiltinName(__pyx_n_s_NotImplemented);
if (!__pyx_builtin_NotImplemented) __PYX_ERR(0, 157, __pyx_L1_error)
19050 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_range) __PYX_ERR(0, 234, __pyx_L1_error)
19051 #if PY_MAJOR_VERSION >= 3 19052 __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_xrange) __PYX_ERR(0, 1098, __pyx_L1_error)
19054 __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange);
if (!__pyx_builtin_xrange) __PYX_ERR(0, 1098, __pyx_L1_error)
19061 static CYTHON_SMALL_CODE
int __Pyx_InitCachedConstants(
void) {
19062 __Pyx_RefNannyDeclarations
19063 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
19071 __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)
19072 __Pyx_GOTREF(__pyx_tuple__3);
19073 __Pyx_GIVEREF(__pyx_tuple__3);
19080 __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)
19081 __Pyx_GOTREF(__pyx_tuple__4);
19082 __Pyx_GIVEREF(__pyx_tuple__4);
19091 __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Not_applicable);
if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 635, __pyx_L1_error)
19092 __Pyx_GOTREF(__pyx_tuple__10);
19093 __Pyx_GIVEREF(__pyx_tuple__10);
19101 __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 2, __pyx_L1_error)
19102 __Pyx_GOTREF(__pyx_tuple__11);
19103 __Pyx_GIVEREF(__pyx_tuple__11);
19110 __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 4, __pyx_L1_error)
19111 __Pyx_GOTREF(__pyx_tuple__12);
19112 __Pyx_GIVEREF(__pyx_tuple__12);
19121 __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_PyClical_pyx, __pyx_n_s_index_set_hidden_doctests, 404, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 404, __pyx_L1_error)
19130 __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_PyClical_pyx, __pyx_n_s_clifford_hidden_doctests, 1243, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 1243, __pyx_L1_error)
19139 __pyx_tuple__15 = PyTuple_Pack(1, __pyx_float_1_0);
if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 1856, __pyx_L1_error)
19140 __Pyx_GOTREF(__pyx_tuple__15);
19141 __Pyx_GIVEREF(__pyx_tuple__15);
19150 __pyx_tuple__16 = PyTuple_Pack(1, __pyx_n_s_obj);
if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 1887, __pyx_L1_error)
19151 __Pyx_GOTREF(__pyx_tuple__16);
19152 __Pyx_GIVEREF(__pyx_tuple__16);
19153 __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_PyClical_pyx, __pyx_n_s_e, 1887, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 1887, __pyx_L1_error)
19162 __pyx_tuple__18 = PyTuple_Pack(2, __pyx_n_s_p, __pyx_n_s_q);
if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 1900, __pyx_L1_error)
19163 __Pyx_GOTREF(__pyx_tuple__18);
19164 __Pyx_GIVEREF(__pyx_tuple__18);
19165 __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_PyClical_pyx, __pyx_n_s_istpq, 1900, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 1900, __pyx_L1_error)
19174 __pyx_tuple__20 = PyTuple_Pack(1, __pyx_int_4);
if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 1909, __pyx_L1_error)
19175 __Pyx_GOTREF(__pyx_tuple__20);
19176 __Pyx_GIVEREF(__pyx_tuple__20);
19177 __pyx_tuple__21 = PyTuple_Pack(1, __pyx_int_neg_1);
if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 1909, __pyx_L1_error)
19178 __Pyx_GOTREF(__pyx_tuple__21);
19179 __Pyx_GIVEREF(__pyx_tuple__21);
19188 __pyx_tuple__22 = PyTuple_Pack(2, __pyx_n_s_PyClical, __pyx_n_s_doctest);
if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 1913, __pyx_L1_error)
19189 __Pyx_GOTREF(__pyx_tuple__22);
19190 __Pyx_GIVEREF(__pyx_tuple__22);
19191 __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_PyClical_pyx, __pyx_n_s_test, 1913, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 1913, __pyx_L1_error)
19192 __Pyx_RefNannyFinishContext();
19195 __Pyx_RefNannyFinishContext();
19199 static CYTHON_SMALL_CODE
int __Pyx_InitGlobals(
void) {
19200 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
19201 __pyx_float_0_0 =
PyFloat_FromDouble(0.0);
if (unlikely(!__pyx_float_0_0)) __PYX_ERR(0, 1, __pyx_L1_error)
19202 __pyx_float_1_0 =
PyFloat_FromDouble(1.0);
if (unlikely(!__pyx_float_1_0)) __PYX_ERR(0, 1, __pyx_L1_error)
19203 __pyx_float_2_0 =
PyFloat_FromDouble(2.0);
if (unlikely(!__pyx_float_2_0)) __PYX_ERR(0, 1, __pyx_L1_error)
19204 __pyx_float_8_0 =
PyFloat_FromDouble(8.0);
if (unlikely(!__pyx_float_8_0)) __PYX_ERR(0, 1, __pyx_L1_error)
19205 __pyx_int_0 = PyInt_FromLong(0);
if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
19206 __pyx_int_1 = PyInt_FromLong(1);
if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
19207 __pyx_int_4 = PyInt_FromLong(4);
if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error)
19208 __pyx_int_neg_1 = PyInt_FromLong(-1);
if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
19214 static CYTHON_SMALL_CODE
int __Pyx_modinit_global_init_code(
void);
19215 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_export_code(
void);
19216 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_export_code(
void);
19217 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_init_code(
void);
19218 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_import_code(
void);
19219 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_import_code(
void);
19220 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_import_code(
void);
19222 static int __Pyx_modinit_global_init_code(
void) {
19223 __Pyx_RefNannyDeclarations
19224 __Pyx_RefNannySetupContext(
"__Pyx_modinit_global_init_code", 0);
19226 __Pyx_RefNannyFinishContext();
19230 static int __Pyx_modinit_variable_export_code(
void) {
19231 __Pyx_RefNannyDeclarations
19232 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_export_code", 0);
19234 __Pyx_RefNannyFinishContext();
19238 static int __Pyx_modinit_function_export_code(
void) {
19239 __Pyx_RefNannyDeclarations
19240 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_export_code", 0);
19242 __Pyx_RefNannyFinishContext();
19246 static int __Pyx_modinit_type_init_code(
void) {
19247 __Pyx_RefNannyDeclarations
19248 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_init_code", 0);
19250 __pyx_vtabptr_8PyClical_index_set = &__pyx_vtable_8PyClical_index_set;
19251 __pyx_vtable_8PyClical_index_set.wrap = (PyObject *(*)(
struct __pyx_obj_8PyClical_index_set *,
IndexSet))__pyx_f_8PyClical_9index_set_wrap;
19252 __pyx_vtable_8PyClical_index_set.unwrap = (
IndexSet (*)(
struct __pyx_obj_8PyClical_index_set *))__pyx_f_8PyClical_9index_set_unwrap;
19253 __pyx_vtable_8PyClical_index_set.copy = (PyObject *(*)(
struct __pyx_obj_8PyClical_index_set *,
int __pyx_skip_dispatch))__pyx_f_8PyClical_9index_set_copy;
19254 if (PyType_Ready(&__pyx_type_8PyClical_index_set) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
19255 __pyx_type_8PyClical_index_set.tp_print = 0;
19256 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)) {
19257 __pyx_type_8PyClical_index_set.tp_getattro = __Pyx_PyObject_GenericGetAttr;
19259 #if CYTHON_COMPILING_IN_CPYTHON 19261 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__setitem__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19262 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19263 __pyx_wrapperbase_8PyClical_9index_set_8__setitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19264 __pyx_wrapperbase_8PyClical_9index_set_8__setitem__.doc = __pyx_doc_8PyClical_9index_set_8__setitem__;
19265 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_8__setitem__;
19269 #if CYTHON_COMPILING_IN_CPYTHON 19271 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__getitem__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19272 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19273 __pyx_wrapperbase_8PyClical_9index_set_10__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19274 __pyx_wrapperbase_8PyClical_9index_set_10__getitem__.doc = __pyx_doc_8PyClical_9index_set_10__getitem__;
19275 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_10__getitem__;
19279 #if CYTHON_COMPILING_IN_CPYTHON 19281 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__contains__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19282 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19283 __pyx_wrapperbase_8PyClical_9index_set_12__contains__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19284 __pyx_wrapperbase_8PyClical_9index_set_12__contains__.doc = __pyx_doc_8PyClical_9index_set_12__contains__;
19285 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_12__contains__;
19289 #if CYTHON_COMPILING_IN_CPYTHON 19291 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__iter__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19292 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19293 __pyx_wrapperbase_8PyClical_9index_set_14__iter__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19294 __pyx_wrapperbase_8PyClical_9index_set_14__iter__.doc = __pyx_doc_8PyClical_9index_set_14__iter__;
19295 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_14__iter__;
19299 #if CYTHON_COMPILING_IN_CPYTHON 19301 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__invert__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19302 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19303 __pyx_wrapperbase_8PyClical_9index_set_17__invert__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19304 __pyx_wrapperbase_8PyClical_9index_set_17__invert__.doc = __pyx_doc_8PyClical_9index_set_17__invert__;
19305 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_17__invert__;
19309 #if CYTHON_COMPILING_IN_CPYTHON 19311 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__xor__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19312 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19313 __pyx_wrapperbase_8PyClical_9index_set_19__xor__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19314 __pyx_wrapperbase_8PyClical_9index_set_19__xor__.doc = __pyx_doc_8PyClical_9index_set_19__xor__;
19315 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_19__xor__;
19319 #if CYTHON_COMPILING_IN_CPYTHON 19321 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__ixor__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19322 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19323 __pyx_wrapperbase_8PyClical_9index_set_21__ixor__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19324 __pyx_wrapperbase_8PyClical_9index_set_21__ixor__.doc = __pyx_doc_8PyClical_9index_set_21__ixor__;
19325 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_21__ixor__;
19329 #if CYTHON_COMPILING_IN_CPYTHON 19331 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__and__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19332 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19333 __pyx_wrapperbase_8PyClical_9index_set_23__and__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19334 __pyx_wrapperbase_8PyClical_9index_set_23__and__.doc = __pyx_doc_8PyClical_9index_set_23__and__;
19335 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_23__and__;
19339 #if CYTHON_COMPILING_IN_CPYTHON 19341 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__iand__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19342 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19343 __pyx_wrapperbase_8PyClical_9index_set_25__iand__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19344 __pyx_wrapperbase_8PyClical_9index_set_25__iand__.doc = __pyx_doc_8PyClical_9index_set_25__iand__;
19345 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_25__iand__;
19349 #if CYTHON_COMPILING_IN_CPYTHON 19351 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__or__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19352 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19353 __pyx_wrapperbase_8PyClical_9index_set_27__or__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19354 __pyx_wrapperbase_8PyClical_9index_set_27__or__.doc = __pyx_doc_8PyClical_9index_set_27__or__;
19355 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_27__or__;
19359 #if CYTHON_COMPILING_IN_CPYTHON 19361 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__ior__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19362 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19363 __pyx_wrapperbase_8PyClical_9index_set_29__ior__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19364 __pyx_wrapperbase_8PyClical_9index_set_29__ior__.doc = __pyx_doc_8PyClical_9index_set_29__ior__;
19365 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_29__ior__;
19369 #if CYTHON_COMPILING_IN_CPYTHON 19371 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__repr__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19372 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19373 __pyx_wrapperbase_8PyClical_9index_set_47__repr__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19374 __pyx_wrapperbase_8PyClical_9index_set_47__repr__.doc = __pyx_doc_8PyClical_9index_set_47__repr__;
19375 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_47__repr__;
19379 #if CYTHON_COMPILING_IN_CPYTHON 19381 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__str__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
19382 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19383 __pyx_wrapperbase_8PyClical_9index_set_49__str__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19384 __pyx_wrapperbase_8PyClical_9index_set_49__str__.doc = __pyx_doc_8PyClical_9index_set_49__str__;
19385 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_49__str__;
19389 if (__Pyx_SetVtable(__pyx_type_8PyClical_index_set.tp_dict, __pyx_vtabptr_8PyClical_index_set) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
19390 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_index_set, (PyObject *)&__pyx_type_8PyClical_index_set) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
19391 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8PyClical_index_set) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
19392 __pyx_ptype_8PyClical_index_set = &__pyx_type_8PyClical_index_set;
19393 __pyx_vtabptr_8PyClical_clifford = &__pyx_vtable_8PyClical_clifford;
19394 __pyx_vtable_8PyClical_clifford.wrap = (PyObject *(*)(
struct __pyx_obj_8PyClical_clifford *,
Clifford))__pyx_f_8PyClical_8clifford_wrap;
19395 __pyx_vtable_8PyClical_clifford.unwrap = (
Clifford (*)(
struct __pyx_obj_8PyClical_clifford *))__pyx_f_8PyClical_8clifford_unwrap;
19396 __pyx_vtable_8PyClical_clifford.copy = (PyObject *(*)(
struct __pyx_obj_8PyClical_clifford *,
int __pyx_skip_dispatch))__pyx_f_8PyClical_8clifford_copy;
19397 if (PyType_Ready(&__pyx_type_8PyClical_clifford) < 0) __PYX_ERR(0, 535, __pyx_L1_error)
19398 __pyx_type_8PyClical_clifford.tp_print = 0;
19399 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8PyClical_clifford.tp_dictoffset && __pyx_type_8PyClical_clifford.tp_getattro == PyObject_GenericGetAttr)) {
19400 __pyx_type_8PyClical_clifford.tp_getattro = __Pyx_PyObject_GenericGetAttr;
19402 #if CYTHON_COMPILING_IN_CPYTHON 19404 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__contains__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19405 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19406 __pyx_wrapperbase_8PyClical_8clifford_6__contains__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19407 __pyx_wrapperbase_8PyClical_8clifford_6__contains__.doc = __pyx_doc_8PyClical_8clifford_6__contains__;
19408 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_6__contains__;
19412 #if CYTHON_COMPILING_IN_CPYTHON 19414 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__iter__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19415 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19416 __pyx_wrapperbase_8PyClical_8clifford_8__iter__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19417 __pyx_wrapperbase_8PyClical_8clifford_8__iter__.doc = __pyx_doc_8PyClical_8clifford_8__iter__;
19418 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_8__iter__;
19422 #if CYTHON_COMPILING_IN_CPYTHON 19424 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__getitem__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19425 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19426 __pyx_wrapperbase_8PyClical_8clifford_14__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19427 __pyx_wrapperbase_8PyClical_8clifford_14__getitem__.doc = __pyx_doc_8PyClical_8clifford_14__getitem__;
19428 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_14__getitem__;
19432 #if CYTHON_COMPILING_IN_CPYTHON 19434 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__neg__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19435 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19436 __pyx_wrapperbase_8PyClical_8clifford_16__neg__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19437 __pyx_wrapperbase_8PyClical_8clifford_16__neg__.doc = __pyx_doc_8PyClical_8clifford_16__neg__;
19438 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_16__neg__;
19442 #if CYTHON_COMPILING_IN_CPYTHON 19444 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__pos__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19445 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19446 __pyx_wrapperbase_8PyClical_8clifford_18__pos__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19447 __pyx_wrapperbase_8PyClical_8clifford_18__pos__.doc = __pyx_doc_8PyClical_8clifford_18__pos__;
19448 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_18__pos__;
19452 #if CYTHON_COMPILING_IN_CPYTHON 19454 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__add__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19455 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19456 __pyx_wrapperbase_8PyClical_8clifford_20__add__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19457 __pyx_wrapperbase_8PyClical_8clifford_20__add__.doc = __pyx_doc_8PyClical_8clifford_20__add__;
19458 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_20__add__;
19462 #if CYTHON_COMPILING_IN_CPYTHON 19464 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__iadd__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19465 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19466 __pyx_wrapperbase_8PyClical_8clifford_22__iadd__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19467 __pyx_wrapperbase_8PyClical_8clifford_22__iadd__.doc = __pyx_doc_8PyClical_8clifford_22__iadd__;
19468 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_22__iadd__;
19472 #if CYTHON_COMPILING_IN_CPYTHON 19474 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__sub__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19475 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19476 __pyx_wrapperbase_8PyClical_8clifford_24__sub__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19477 __pyx_wrapperbase_8PyClical_8clifford_24__sub__.doc = __pyx_doc_8PyClical_8clifford_24__sub__;
19478 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_24__sub__;
19482 #if CYTHON_COMPILING_IN_CPYTHON 19484 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__isub__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19485 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19486 __pyx_wrapperbase_8PyClical_8clifford_26__isub__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19487 __pyx_wrapperbase_8PyClical_8clifford_26__isub__.doc = __pyx_doc_8PyClical_8clifford_26__isub__;
19488 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_26__isub__;
19492 #if CYTHON_COMPILING_IN_CPYTHON 19494 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__mul__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19495 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19496 __pyx_wrapperbase_8PyClical_8clifford_28__mul__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19497 __pyx_wrapperbase_8PyClical_8clifford_28__mul__.doc = __pyx_doc_8PyClical_8clifford_28__mul__;
19498 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_28__mul__;
19502 #if CYTHON_COMPILING_IN_CPYTHON 19504 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__imul__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19505 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19506 __pyx_wrapperbase_8PyClical_8clifford_30__imul__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19507 __pyx_wrapperbase_8PyClical_8clifford_30__imul__.doc = __pyx_doc_8PyClical_8clifford_30__imul__;
19508 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_30__imul__;
19512 #if CYTHON_COMPILING_IN_CPYTHON 19514 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__mod__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19515 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19516 __pyx_wrapperbase_8PyClical_8clifford_32__mod__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19517 __pyx_wrapperbase_8PyClical_8clifford_32__mod__.doc = __pyx_doc_8PyClical_8clifford_32__mod__;
19518 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_32__mod__;
19522 #if CYTHON_COMPILING_IN_CPYTHON 19524 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__imod__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19525 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19526 __pyx_wrapperbase_8PyClical_8clifford_34__imod__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19527 __pyx_wrapperbase_8PyClical_8clifford_34__imod__.doc = __pyx_doc_8PyClical_8clifford_34__imod__;
19528 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_34__imod__;
19532 #if CYTHON_COMPILING_IN_CPYTHON 19534 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__and__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19535 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19536 __pyx_wrapperbase_8PyClical_8clifford_36__and__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19537 __pyx_wrapperbase_8PyClical_8clifford_36__and__.doc = __pyx_doc_8PyClical_8clifford_36__and__;
19538 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_36__and__;
19542 #if CYTHON_COMPILING_IN_CPYTHON 19544 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__iand__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19545 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19546 __pyx_wrapperbase_8PyClical_8clifford_38__iand__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19547 __pyx_wrapperbase_8PyClical_8clifford_38__iand__.doc = __pyx_doc_8PyClical_8clifford_38__iand__;
19548 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_38__iand__;
19552 #if CYTHON_COMPILING_IN_CPYTHON 19554 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__xor__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19555 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19556 __pyx_wrapperbase_8PyClical_8clifford_40__xor__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19557 __pyx_wrapperbase_8PyClical_8clifford_40__xor__.doc = __pyx_doc_8PyClical_8clifford_40__xor__;
19558 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_40__xor__;
19562 #if CYTHON_COMPILING_IN_CPYTHON 19564 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__ixor__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19565 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19566 __pyx_wrapperbase_8PyClical_8clifford_42__ixor__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19567 __pyx_wrapperbase_8PyClical_8clifford_42__ixor__.doc = __pyx_doc_8PyClical_8clifford_42__ixor__;
19568 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_42__ixor__;
19572 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 19573 #if CYTHON_COMPILING_IN_CPYTHON 19575 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__div__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19576 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19577 __pyx_wrapperbase_8PyClical_8clifford_44__div__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19578 __pyx_wrapperbase_8PyClical_8clifford_44__div__.doc = __pyx_doc_8PyClical_8clifford_44__div__;
19579 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_44__div__;
19584 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 19585 #if CYTHON_COMPILING_IN_CPYTHON 19587 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__idiv__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19588 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19589 __pyx_wrapperbase_8PyClical_8clifford_46__idiv__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19590 __pyx_wrapperbase_8PyClical_8clifford_46__idiv__.doc = __pyx_doc_8PyClical_8clifford_46__idiv__;
19591 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_46__idiv__;
19596 #if CYTHON_COMPILING_IN_CPYTHON 19598 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__or__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19599 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19600 __pyx_wrapperbase_8PyClical_8clifford_50__or__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19601 __pyx_wrapperbase_8PyClical_8clifford_50__or__.doc = __pyx_doc_8PyClical_8clifford_50__or__;
19602 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_50__or__;
19606 #if CYTHON_COMPILING_IN_CPYTHON 19608 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__ior__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19609 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19610 __pyx_wrapperbase_8PyClical_8clifford_52__ior__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19611 __pyx_wrapperbase_8PyClical_8clifford_52__ior__.doc = __pyx_doc_8PyClical_8clifford_52__ior__;
19612 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_52__ior__;
19616 #if CYTHON_COMPILING_IN_CPYTHON 19618 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__pow__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19619 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19620 __pyx_wrapperbase_8PyClical_8clifford_54__pow__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19621 __pyx_wrapperbase_8PyClical_8clifford_54__pow__.doc = __pyx_doc_8PyClical_8clifford_54__pow__;
19622 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_54__pow__;
19626 #if CYTHON_COMPILING_IN_CPYTHON 19628 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__call__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19629 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19630 __pyx_wrapperbase_8PyClical_8clifford_60__call__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19631 __pyx_wrapperbase_8PyClical_8clifford_60__call__.doc = __pyx_doc_8PyClical_8clifford_60__call__;
19632 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_60__call__;
19636 #if CYTHON_COMPILING_IN_CPYTHON 19638 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__repr__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19639 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19640 __pyx_wrapperbase_8PyClical_8clifford_92__repr__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19641 __pyx_wrapperbase_8PyClical_8clifford_92__repr__.doc = __pyx_doc_8PyClical_8clifford_92__repr__;
19642 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_92__repr__;
19646 #if CYTHON_COMPILING_IN_CPYTHON 19648 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__str__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
19649 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19650 __pyx_wrapperbase_8PyClical_8clifford_94__str__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19651 __pyx_wrapperbase_8PyClical_8clifford_94__str__.doc = __pyx_doc_8PyClical_8clifford_94__str__;
19652 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_94__str__;
19656 if (__Pyx_SetVtable(__pyx_type_8PyClical_clifford.tp_dict, __pyx_vtabptr_8PyClical_clifford) < 0) __PYX_ERR(0, 535, __pyx_L1_error)
19657 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_clifford, (PyObject *)&__pyx_type_8PyClical_clifford) < 0) __PYX_ERR(0, 535, __pyx_L1_error)
19658 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8PyClical_clifford) < 0) __PYX_ERR(0, 535, __pyx_L1_error)
19659 __pyx_ptype_8PyClical_clifford = &__pyx_type_8PyClical_clifford;
19660 if (PyType_Ready(&__pyx_type_8PyClical___pyx_scope_struct____iter__) < 0) __PYX_ERR(0, 227, __pyx_L1_error)
19661 __pyx_type_8PyClical___pyx_scope_struct____iter__.tp_print = 0;
19662 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)) {
19663 __pyx_type_8PyClical___pyx_scope_struct____iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
19665 __pyx_ptype_8PyClical___pyx_scope_struct____iter__ = &__pyx_type_8PyClical___pyx_scope_struct____iter__;
19666 __Pyx_RefNannyFinishContext();
19669 __Pyx_RefNannyFinishContext();
19673 static int __Pyx_modinit_type_import_code(
void) {
19674 __Pyx_RefNannyDeclarations
19675 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_import_code", 0);
19677 __Pyx_RefNannyFinishContext();
19681 static int __Pyx_modinit_variable_import_code(
void) {
19682 __Pyx_RefNannyDeclarations
19683 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_import_code", 0);
19685 __Pyx_RefNannyFinishContext();
19689 static int __Pyx_modinit_function_import_code(
void) {
19690 __Pyx_RefNannyDeclarations
19691 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_import_code", 0);
19693 __Pyx_RefNannyFinishContext();
19698 #if PY_MAJOR_VERSION < 3 19699 #ifdef CYTHON_NO_PYINIT_EXPORT 19700 #define __Pyx_PyMODINIT_FUNC void 19702 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC 19705 #ifdef CYTHON_NO_PYINIT_EXPORT 19706 #define __Pyx_PyMODINIT_FUNC PyObject * 19708 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC 19713 #if PY_MAJOR_VERSION < 3 19714 __Pyx_PyMODINIT_FUNC initPyClical(
void) CYTHON_SMALL_CODE;
19715 __Pyx_PyMODINIT_FUNC initPyClical(
void)
19717 __Pyx_PyMODINIT_FUNC PyInit_PyClical(
void) CYTHON_SMALL_CODE;
19718 __Pyx_PyMODINIT_FUNC PyInit_PyClical(
void)
19719 #if CYTHON_PEP489_MULTI_PHASE_INIT 19721 return PyModuleDef_Init(&__pyx_moduledef);
19723 static CYTHON_SMALL_CODE
int __Pyx_check_single_interpreter(
void) {
19724 #if PY_VERSION_HEX >= 0x030700A1 19725 static PY_INT64_T main_interpreter_id = -1;
19726 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
19727 if (main_interpreter_id == -1) {
19728 main_interpreter_id = current_id;
19729 return (unlikely(current_id == -1)) ? -1 : 0;
19730 }
else if (unlikely(main_interpreter_id != current_id))
19732 static PyInterpreterState *main_interpreter = NULL;
19733 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
19734 if (!main_interpreter) {
19735 main_interpreter = current_interpreter;
19736 }
else if (unlikely(main_interpreter != current_interpreter))
19741 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
19746 static CYTHON_SMALL_CODE
int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict,
const char* from_name,
const char* to_name,
int allow_none) {
19747 PyObject *value = PyObject_GetAttrString(spec, from_name);
19749 if (likely(value)) {
19750 if (allow_none || value != Py_None) {
19751 result = PyDict_SetItemString(moddict, to_name, value);
19754 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
19761 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
19762 PyObject *module = NULL, *moddict, *modname;
19763 if (__Pyx_check_single_interpreter())
19766 return __Pyx_NewRef(__pyx_m);
19767 modname = PyObject_GetAttrString(spec,
"name");
19768 if (unlikely(!modname))
goto bad;
19769 module = PyModule_NewObject(modname);
19770 Py_DECREF(modname);
19771 if (unlikely(!module))
goto bad;
19772 moddict = PyModule_GetDict(module);
19773 if (unlikely(!moddict))
goto bad;
19774 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__", 1) < 0))
goto bad;
19775 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__", 1) < 0))
goto bad;
19776 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__", 1) < 0))
goto bad;
19777 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__", 0) < 0))
goto bad;
19780 Py_XDECREF(module);
19785 static CYTHON_SMALL_CODE
int __pyx_pymod_exec_PyClical(PyObject *__pyx_pyinit_module)
19789 PyObject *__pyx_t_1 = NULL;
19790 PyObject *__pyx_t_2 = NULL;
19791 PyObject *__pyx_t_3 = NULL;
19793 __Pyx_RefNannyDeclarations
19794 #if CYTHON_PEP489_MULTI_PHASE_INIT 19796 if (__pyx_m == __pyx_pyinit_module)
return 0;
19797 PyErr_SetString(PyExc_RuntimeError,
"Module 'PyClical' has already been imported. Re-initialisation is not supported.");
19800 #elif PY_MAJOR_VERSION >= 3 19801 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
19803 #if CYTHON_REFNANNY 19804 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
19805 if (!__Pyx_RefNanny) {
19807 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
19808 if (!__Pyx_RefNanny)
19809 Py_FatalError(
"failed to import 'refnanny' module");
19812 __Pyx_RefNannySetupContext(
"__Pyx_PyMODINIT_FUNC PyInit_PyClical(void)", 0);
19813 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
19814 #ifdef __Pxy_PyFrame_Initialize_Offsets 19815 __Pxy_PyFrame_Initialize_Offsets();
19817 __pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
19818 __pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
19819 __pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
19820 #ifdef __Pyx_CyFunction_USED 19821 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
19823 #ifdef __Pyx_FusedFunction_USED 19824 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
19826 #ifdef __Pyx_Coroutine_USED 19827 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
19829 #ifdef __Pyx_Generator_USED 19830 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
19832 #ifdef __Pyx_AsyncGen_USED 19833 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
19835 #ifdef __Pyx_StopAsyncIteration_USED 19836 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
19840 #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS 19842 PyEval_InitThreads();
19846 #if CYTHON_PEP489_MULTI_PHASE_INIT 19847 __pyx_m = __pyx_pyinit_module;
19848 Py_INCREF(__pyx_m);
19850 #if PY_MAJOR_VERSION < 3 19851 __pyx_m = Py_InitModule4(
"PyClical", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
19853 __pyx_m = PyModule_Create(&__pyx_moduledef);
19855 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
19857 __pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
19858 Py_INCREF(__pyx_d);
19859 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
19860 __pyx_cython_runtime = PyImport_AddModule((
char *)
"cython_runtime");
if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
19861 #if CYTHON_COMPILING_IN_PYPY 19862 Py_INCREF(__pyx_b);
19864 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
19866 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
19867 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) 19868 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
19870 if (__pyx_module_is_main_PyClical) {
19871 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
19873 #if PY_MAJOR_VERSION >= 3 19875 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
19876 if (!PyDict_GetItemString(modules,
"PyClical")) {
19877 if (unlikely(PyDict_SetItemString(modules,
"PyClical", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
19882 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
19884 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
19886 (void)__Pyx_modinit_global_init_code();
19887 (void)__Pyx_modinit_variable_export_code();
19888 (void)__Pyx_modinit_function_export_code();
19889 if (unlikely(__Pyx_modinit_type_init_code() != 0))
goto __pyx_L1_error;
19890 (void)__Pyx_modinit_type_import_code();
19891 (void)__Pyx_modinit_variable_import_code();
19892 (void)__Pyx_modinit_function_import_code();
19894 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) 19895 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
19905 __pyx_t_1 = __Pyx_Import(__pyx_n_s_math, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
19906 __Pyx_GOTREF(__pyx_t_1);
19907 if (PyDict_SetItem(__pyx_d, __pyx_n_s_math, __pyx_t_1) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
19908 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19917 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numbers, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
19918 __Pyx_GOTREF(__pyx_t_1);
19919 if (PyDict_SetItem(__pyx_d, __pyx_n_s_numbers, __pyx_t_1) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
19920 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19929 __pyx_t_1 = __Pyx_Import(__pyx_n_s_collections, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error)
19930 __Pyx_GOTREF(__pyx_t_1);
19931 if (PyDict_SetItem(__pyx_d, __pyx_n_s_collections, __pyx_t_1) < 0) __PYX_ERR(0, 30, __pyx_L1_error)
19932 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19941 if (PyDict_SetItem(__pyx_d, __pyx_n_s_version, __pyx_kp_s_0_8_2) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
19950 __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)
19951 __Pyx_GOTREF(__pyx_t_1);
19952 if (PyDict_SetItem(__pyx_d, __pyx_n_s_index_set_hidden_doctests, __pyx_t_1) < 0) __PYX_ERR(0, 404, __pyx_L1_error)
19953 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19962 __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)
19963 __Pyx_GOTREF(__pyx_t_1);
19964 if (PyDict_SetItem(__pyx_d, __pyx_n_s_clifford_hidden_doctests, __pyx_t_1) < 0) __PYX_ERR(0, 1243, __pyx_L1_error)
19965 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19974 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_tuple__15, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1856, __pyx_L1_error)
19975 __Pyx_GOTREF(__pyx_t_1);
19976 __pyx_t_2 = __pyx_f_8PyClical_atan(__pyx_t_1, 0, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1856, __pyx_L1_error)
19977 __Pyx_GOTREF(__pyx_t_2);
19978 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19979 __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_float_8_0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1856, __pyx_L1_error)
19980 __Pyx_GOTREF(__pyx_t_1);
19981 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19982 if (PyDict_SetItem(__pyx_d, __pyx_n_s_tau, __pyx_t_1) < 0) __PYX_ERR(0, 1856, __pyx_L1_error)
19983 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19992 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_tau);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1857, __pyx_L1_error)
19993 __Pyx_GOTREF(__pyx_t_1);
19994 __pyx_t_2 = __Pyx_PyFloat_DivideObjC(__pyx_t_1, __pyx_float_2_0, 2.0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1857, __pyx_L1_error)
19995 __Pyx_GOTREF(__pyx_t_2);
19996 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19997 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pi, __pyx_t_2) < 0) __PYX_ERR(0, 1857, __pyx_L1_error)
19998 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20007 if (PyDict_SetItem(__pyx_d, __pyx_n_s_cl, ((PyObject *)__pyx_ptype_8PyClical_clifford)) < 0) __PYX_ERR(0, 1859, __pyx_L1_error)
20016 if (PyDict_SetItem(__pyx_d, __pyx_n_s_ist, ((PyObject *)__pyx_ptype_8PyClical_index_set)) < 0) __PYX_ERR(0, 1879, __pyx_L1_error)
20025 __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)
20026 __Pyx_GOTREF(__pyx_t_2);
20027 if (PyDict_SetItem(__pyx_d, __pyx_n_s_e, __pyx_t_2) < 0) __PYX_ERR(0, 1887, __pyx_L1_error)
20028 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20037 __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)
20038 __Pyx_GOTREF(__pyx_t_2);
20039 if (PyDict_SetItem(__pyx_d, __pyx_n_s_istpq, __pyx_t_2) < 0) __PYX_ERR(0, 1900, __pyx_L1_error)
20040 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20049 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_e);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1909, __pyx_L1_error)
20050 __Pyx_GOTREF(__pyx_t_2);
20051 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__20, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1909, __pyx_L1_error)
20052 __Pyx_GOTREF(__pyx_t_1);
20053 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20054 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_e);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1909, __pyx_L1_error)
20055 __Pyx_GOTREF(__pyx_t_2);
20056 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__21, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1909, __pyx_L1_error)
20057 __Pyx_GOTREF(__pyx_t_3);
20058 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20059 __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1909, __pyx_L1_error)
20060 __Pyx_GOTREF(__pyx_t_2);
20061 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20062 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20063 if (PyDict_SetItem(__pyx_d, __pyx_n_s_ninf3, __pyx_t_2) < 0) __PYX_ERR(0, 1909, __pyx_L1_error)
20064 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20073 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_e);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1910, __pyx_L1_error)
20074 __Pyx_GOTREF(__pyx_t_2);
20075 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__20, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1910, __pyx_L1_error)
20076 __Pyx_GOTREF(__pyx_t_3);
20077 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20078 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_e);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1910, __pyx_L1_error)
20079 __Pyx_GOTREF(__pyx_t_2);
20080 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__21, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1910, __pyx_L1_error)
20081 __Pyx_GOTREF(__pyx_t_1);
20082 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20083 __pyx_t_2 = PyNumber_Subtract(__pyx_t_3, __pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1910, __pyx_L1_error)
20084 __Pyx_GOTREF(__pyx_t_2);
20085 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20086 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20087 if (PyDict_SetItem(__pyx_d, __pyx_n_s_nbar3, __pyx_t_2) < 0) __PYX_ERR(0, 1910, __pyx_L1_error)
20088 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20097 __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)
20098 __Pyx_GOTREF(__pyx_t_2);
20099 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1913, __pyx_L1_error)
20100 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20108 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1917, __pyx_L1_error)
20109 __Pyx_GOTREF(__pyx_t_2);
20110 __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)
20111 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20119 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_test);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1918, __pyx_L1_error)
20120 __Pyx_GOTREF(__pyx_t_2);
20121 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1918, __pyx_L1_error)
20122 __Pyx_GOTREF(__pyx_t_1);
20123 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20124 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20139 __pyx_t_1 = __Pyx_PyDict_NewPresized(107);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
20140 __Pyx_GOTREF(__pyx_t_1);
20141 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)
20142 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)
20143 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)
20144 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)
20145 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)
20146 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)
20147 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)
20148 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)
20149 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)
20150 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)
20151 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)
20152 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)
20153 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)
20154 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)
20155 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)
20156 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)
20157 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)
20158 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)
20159 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)
20160 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)
20161 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)
20162 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)
20163 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)
20164 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)
20165 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)
20166 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)
20167 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)
20168 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)
20169 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)
20170 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)
20171 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)
20172 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)
20173 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)
20174 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)
20175 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)
20176 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)
20177 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)
20178 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)
20179 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)
20180 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)
20181 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)
20182 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)
20183 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)
20184 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)
20185 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)
20186 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)
20187 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)
20188 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)
20189 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)
20190 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)
20191 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)
20192 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)
20193 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)
20194 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)
20195 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)
20196 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)
20197 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)
20198 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)
20199 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)
20200 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)
20201 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)
20202 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)
20203 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)
20204 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)
20205 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)
20206 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)
20207 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)
20208 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)
20209 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)
20210 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)
20211 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)
20212 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)
20213 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)
20214 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)
20215 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)
20216 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)
20217 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)
20218 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)
20219 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)
20220 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)
20221 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)
20222 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)
20223 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)
20224 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)
20225 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)
20226 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)
20227 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)
20228 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)
20229 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)
20230 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)
20231 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)
20232 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)
20233 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)
20234 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)
20235 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)
20236 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)
20237 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)
20238 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)
20239 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)
20240 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)
20241 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)
20242 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)
20243 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)
20244 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)
20245 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)
20246 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)
20247 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)
20248 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_2, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20249 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20255 __Pyx_XDECREF(__pyx_t_1);
20256 __Pyx_XDECREF(__pyx_t_2);
20257 __Pyx_XDECREF(__pyx_t_3);
20260 __Pyx_AddTraceback(
"init PyClical", __pyx_clineno, __pyx_lineno, __pyx_filename);
20263 }
else if (!PyErr_Occurred()) {
20264 PyErr_SetString(PyExc_ImportError,
"init PyClical");
20267 __Pyx_RefNannyFinishContext();
20268 #if CYTHON_PEP489_MULTI_PHASE_INIT 20269 return (__pyx_m != NULL) ? 0 : -1;
20270 #elif PY_MAJOR_VERSION >= 3 20279 #if CYTHON_REFNANNY 20280 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
20281 PyObject *m = NULL, *p = NULL;
20283 m = PyImport_ImportModule(modname);
20285 p = PyObject_GetAttrString(m,
"RefNannyAPI");
20287 r = PyLong_AsVoidPtr(p);
20291 return (__Pyx_RefNannyAPIStruct *)r;
20296 #if CYTHON_USE_TYPE_SLOTS 20297 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject*
obj, PyObject* attr_name) {
20298 PyTypeObject* tp = Py_TYPE(
obj);
20299 if (likely(tp->tp_getattro))
20300 return tp->tp_getattro(
obj, attr_name);
20301 #if PY_MAJOR_VERSION < 3 20302 if (likely(tp->tp_getattr))
20303 return tp->tp_getattr(
obj, PyString_AS_STRING(attr_name));
20305 return PyObject_GetAttr(
obj, attr_name);
20310 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
20311 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
20312 if (unlikely(!result)) {
20313 PyErr_Format(PyExc_NameError,
20314 #
if PY_MAJOR_VERSION >= 3
20315 "name '%U' is not defined", name);
20317 "name '%.200s' is not defined", PyString_AS_STRING(name));
20324 #if CYTHON_FAST_PYCCALL 20325 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
20326 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
20327 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
20328 PyObject *
self = PyCFunction_GET_SELF(func);
20329 int flags = PyCFunction_GET_FLAGS(func);
20330 assert(PyCFunction_Check(func));
20331 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
20332 assert(nargs >= 0);
20333 assert(nargs == 0 || args != NULL);
20337 assert(!PyErr_Occurred());
20338 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
20339 return (*((__Pyx_PyCFunctionFastWithKeywords)(
void*)meth)) (
self, args, nargs, NULL);
20341 return (*((__Pyx_PyCFunctionFast)(
void*)meth)) (
self, args, nargs);
20347 #if CYTHON_FAST_PYCALL 20348 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
20349 PyObject *globals) {
20351 PyThreadState *tstate = __Pyx_PyThreadState_Current;
20352 PyObject **fastlocals;
20355 assert(globals != NULL);
20360 assert(tstate != NULL);
20361 f = PyFrame_New(tstate, co, globals, NULL);
20365 fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
20366 for (
i = 0;
i < na;
i++) {
20368 fastlocals[
i] = *args++;
20370 result = PyEval_EvalFrameEx(f,0);
20371 ++tstate->recursion_depth;
20373 --tstate->recursion_depth;
20376 #if 1 || PY_VERSION_HEX < 0x030600B1 20377 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
int nargs, PyObject *kwargs) {
20378 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
20379 PyObject *globals = PyFunction_GET_GLOBALS(func);
20380 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
20382 #if PY_MAJOR_VERSION >= 3 20385 PyObject *kwtuple, **k;
20390 assert(kwargs == NULL || PyDict_Check(kwargs));
20391 nk = kwargs ? PyDict_Size(kwargs) : 0;
20392 if (Py_EnterRecursiveCall((
char*)
" while calling a Python object")) {
20396 #
if PY_MAJOR_VERSION >= 3
20397 co->co_kwonlyargcount == 0 &&
20399 likely(kwargs == NULL || nk == 0) &&
20400 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
20401 if (argdefs == NULL && co->co_argcount == nargs) {
20402 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
20405 else if (nargs == 0 && argdefs != NULL
20406 && co->co_argcount == Py_SIZE(argdefs)) {
20409 args = &PyTuple_GET_ITEM(argdefs, 0);
20410 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
20414 if (kwargs != NULL) {
20416 kwtuple = PyTuple_New(2 * nk);
20417 if (kwtuple == NULL) {
20421 k = &PyTuple_GET_ITEM(kwtuple, 0);
20423 while (PyDict_Next(kwargs, &pos, &k[
i], &k[
i+1])) {
20434 closure = PyFunction_GET_CLOSURE(func);
20435 #if PY_MAJOR_VERSION >= 3 20436 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
20438 if (argdefs != NULL) {
20439 d = &PyTuple_GET_ITEM(argdefs, 0);
20440 nd = Py_SIZE(argdefs);
20446 #if PY_MAJOR_VERSION >= 3 20447 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
20450 d, (
int)nd, kwdefs, closure);
20452 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
20455 d, (
int)nd, closure);
20457 Py_XDECREF(kwtuple);
20459 Py_LeaveRecursiveCall();
20466 #if CYTHON_COMPILING_IN_CPYTHON 20467 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
20469 ternaryfunc call = func->ob_type->tp_call;
20470 if (unlikely(!call))
20471 return PyObject_Call(func, arg, kw);
20472 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
20474 result = (*call)(func, arg, kw);
20475 Py_LeaveRecursiveCall();
20476 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
20479 "NULL result without error in PyObject_Call");
20486 #if CYTHON_COMPILING_IN_CPYTHON 20487 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
20488 PyObject *
self, *result;
20490 cfunc = PyCFunction_GET_FUNCTION(func);
20491 self = PyCFunction_GET_SELF(func);
20492 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
20494 result = cfunc(
self, arg);
20495 Py_LeaveRecursiveCall();
20496 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
20499 "NULL result without error in PyObject_Call");
20506 #if CYTHON_COMPILING_IN_CPYTHON 20507 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
20509 PyObject *args = PyTuple_New(1);
20510 if (unlikely(!args))
return NULL;
20512 PyTuple_SET_ITEM(args, 0, arg);
20513 result = __Pyx_PyObject_Call(func, args, NULL);
20517 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
20518 #if CYTHON_FAST_PYCALL 20519 if (PyFunction_Check(func)) {
20520 return __Pyx_PyFunction_FastCall(func, &arg, 1);
20523 if (likely(PyCFunction_Check(func))) {
20524 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
20525 return __Pyx_PyObject_CallMethO(func, arg);
20526 #if CYTHON_FAST_PYCCALL 20527 }
else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
20528 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
20532 return __Pyx__PyObject_CallOneArg(func, arg);
20535 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
20537 PyObject *args = PyTuple_Pack(1, arg);
20538 if (unlikely(!args))
return NULL;
20539 result = __Pyx_PyObject_Call(func, args, NULL);
20546 #if CYTHON_FAST_THREAD_STATE 20547 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
20548 PyObject *tmp_type, *tmp_value, *tmp_tb;
20549 tmp_type = tstate->curexc_type;
20550 tmp_value = tstate->curexc_value;
20551 tmp_tb = tstate->curexc_traceback;
20552 tstate->curexc_type = type;
20553 tstate->curexc_value = value;
20554 tstate->curexc_traceback = tb;
20555 Py_XDECREF(tmp_type);
20556 Py_XDECREF(tmp_value);
20557 Py_XDECREF(tmp_tb);
20559 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
20560 *type = tstate->curexc_type;
20561 *value = tstate->curexc_value;
20562 *tb = tstate->curexc_traceback;
20563 tstate->curexc_type = 0;
20564 tstate->curexc_value = 0;
20565 tstate->curexc_traceback = 0;
20570 static void __Pyx_WriteUnraisable(
const char *name, CYTHON_UNUSED
int clineno,
20571 CYTHON_UNUSED
int lineno, CYTHON_UNUSED
const char *filename,
20572 int full_traceback, CYTHON_UNUSED
int nogil) {
20573 PyObject *old_exc, *old_val, *old_tb;
20575 __Pyx_PyThreadState_declare
20577 PyGILState_STATE state;
20579 state = PyGILState_Ensure();
20581 else state = (PyGILState_STATE)-1;
20584 __Pyx_PyThreadState_assign
20585 __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
20586 if (full_traceback) {
20587 Py_XINCREF(old_exc);
20588 Py_XINCREF(old_val);
20589 Py_XINCREF(old_tb);
20590 __Pyx_ErrRestore(old_exc, old_val, old_tb);
20593 #if PY_MAJOR_VERSION < 3 20594 ctx = PyString_FromString(name);
20596 ctx = PyUnicode_FromString(name);
20598 __Pyx_ErrRestore(old_exc, old_val, old_tb);
20600 PyErr_WriteUnraisable(Py_None);
20602 PyErr_WriteUnraisable(ctx);
20607 PyGILState_Release(state);
20612 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS 20613 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *
obj) {
20614 PyObject *dict = Py_TYPE(
obj)->tp_dict;
20615 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
20617 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *
obj) {
20618 PyObject **dictptr = NULL;
20619 Py_ssize_t offset = Py_TYPE(
obj)->tp_dictoffset;
20621 #if CYTHON_COMPILING_IN_CPYTHON 20622 dictptr = (likely(offset > 0)) ? (PyObject **) ((
char *)
obj + offset) : _PyObject_GetDictPtr(
obj);
20624 dictptr = _PyObject_GetDictPtr(
obj);
20627 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
20629 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject*
obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
20630 PyObject *dict = Py_TYPE(
obj)->tp_dict;
20631 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
20633 return obj_dict_version == __Pyx_get_object_dict_version(
obj);
20638 #if CYTHON_COMPILING_IN_CPYTHON 20639 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
20640 #if CYTHON_FAST_PYCALL 20641 if (PyFunction_Check(func)) {
20642 return __Pyx_PyFunction_FastCall(func, NULL, 0);
20645 #ifdef __Pyx_CyFunction_USED 20646 if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
20648 if (likely(PyCFunction_Check(func)))
20651 if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
20652 return __Pyx_PyObject_CallMethO(func, NULL);
20655 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
20660 static void __Pyx_RaiseDoubleKeywordsError(
20661 const char* func_name,
20664 PyErr_Format(PyExc_TypeError,
20665 #
if PY_MAJOR_VERSION >= 3
20666 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
20668 "%s() got multiple values for keyword argument '%s'", func_name,
20669 PyString_AsString(kw_name));
20674 static int __Pyx_ParseOptionalKeywords(
20676 PyObject **argnames[],
20678 PyObject *values[],
20679 Py_ssize_t num_pos_args,
20680 const char* function_name)
20682 PyObject *key = 0, *value = 0;
20683 Py_ssize_t pos = 0;
20685 PyObject*** first_kw_arg = argnames + num_pos_args;
20686 while (PyDict_Next(kwds, &pos, &key, &value)) {
20687 name = first_kw_arg;
20688 while (*name && (**name != key)) name++;
20690 values[name-argnames] = value;
20693 name = first_kw_arg;
20694 #if PY_MAJOR_VERSION < 3 20695 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
20697 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
20698 && _PyString_Eq(**name, key)) {
20699 values[name-argnames] = value;
20704 if (*name)
continue;
20706 PyObject*** argname = argnames;
20707 while (argname != first_kw_arg) {
20708 if ((**argname == key) || (
20709 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
20710 && _PyString_Eq(**argname, key))) {
20711 goto arg_passed_twice;
20718 if (likely(PyUnicode_Check(key))) {
20720 int cmp = (**name == key) ? 0 :
20721 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
20722 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
20724 PyUnicode_Compare(**name, key);
20725 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
20727 values[name-argnames] = value;
20732 if (*name)
continue;
20734 PyObject*** argname = argnames;
20735 while (argname != first_kw_arg) {
20736 int cmp = (**argname == key) ? 0 :
20737 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
20738 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
20740 PyUnicode_Compare(**argname, key);
20741 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
20742 if (cmp == 0)
goto arg_passed_twice;
20747 goto invalid_keyword_type;
20749 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
20751 goto invalid_keyword;
20756 __Pyx_RaiseDoubleKeywordsError(function_name, key);
20758 invalid_keyword_type:
20759 PyErr_Format(PyExc_TypeError,
20760 "%.200s() keywords must be strings", function_name);
20763 PyErr_Format(PyExc_TypeError,
20764 #
if PY_MAJOR_VERSION < 3
20765 "%.200s() got an unexpected keyword argument '%.200s'",
20766 function_name, PyString_AsString(key));
20768 "%s() got an unexpected keyword argument '%U'",
20769 function_name, key);
20776 static void __Pyx_RaiseArgtupleInvalid(
20777 const char* func_name,
20779 Py_ssize_t num_min,
20780 Py_ssize_t num_max,
20781 Py_ssize_t num_found)
20783 Py_ssize_t num_expected;
20784 const char *more_or_less;
20785 if (num_found < num_min) {
20786 num_expected = num_min;
20787 more_or_less =
"at least";
20789 num_expected = num_max;
20790 more_or_less =
"at most";
20793 more_or_less =
"exactly";
20795 PyErr_Format(PyExc_TypeError,
20796 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
20797 func_name, more_or_less, num_expected,
20798 (num_expected == 1) ?
"" :
"s", num_found);
20802 #if CYTHON_USE_DICT_VERSIONS 20803 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
20805 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
20809 #if !CYTHON_AVOID_BORROWED_REFS 20810 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 20811 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
20812 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
20813 if (likely(result)) {
20814 return __Pyx_NewRef(result);
20815 }
else if (unlikely(PyErr_Occurred())) {
20819 result = PyDict_GetItem(__pyx_d, name);
20820 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
20821 if (likely(result)) {
20822 return __Pyx_NewRef(result);
20826 result = PyObject_GetItem(__pyx_d, name);
20827 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
20828 if (likely(result)) {
20829 return __Pyx_NewRef(result);
20833 return __Pyx_GetBuiltinName(name);
20837 #if CYTHON_USE_EXC_INFO_STACK 20838 static _PyErr_StackItem *
20839 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
20841 _PyErr_StackItem *exc_info = tstate->exc_info;
20842 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
20843 exc_info->previous_item != NULL)
20845 exc_info = exc_info->previous_item;
20852 #if CYTHON_FAST_THREAD_STATE 20853 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
20854 #if CYTHON_USE_EXC_INFO_STACK 20855 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
20856 *type = exc_info->exc_type;
20857 *value = exc_info->exc_value;
20858 *tb = exc_info->exc_traceback;
20860 *type = tstate->exc_type;
20861 *value = tstate->exc_value;
20862 *tb = tstate->exc_traceback;
20865 Py_XINCREF(*value);
20868 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
20869 PyObject *tmp_type, *tmp_value, *tmp_tb;
20870 #if CYTHON_USE_EXC_INFO_STACK 20871 _PyErr_StackItem *exc_info = tstate->exc_info;
20872 tmp_type = exc_info->exc_type;
20873 tmp_value = exc_info->exc_value;
20874 tmp_tb = exc_info->exc_traceback;
20875 exc_info->exc_type = type;
20876 exc_info->exc_value = value;
20877 exc_info->exc_traceback = tb;
20879 tmp_type = tstate->exc_type;
20880 tmp_value = tstate->exc_value;
20881 tmp_tb = tstate->exc_traceback;
20882 tstate->exc_type = type;
20883 tstate->exc_value = value;
20884 tstate->exc_traceback = tb;
20886 Py_XDECREF(tmp_type);
20887 Py_XDECREF(tmp_value);
20888 Py_XDECREF(tmp_tb);
20893 #if CYTHON_FAST_THREAD_STATE 20894 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
20896 n = PyTuple_GET_SIZE(tuple);
20897 #if PY_MAJOR_VERSION >= 3 20898 for (
i=0;
i<n;
i++) {
20899 if (exc_type == PyTuple_GET_ITEM(tuple,
i))
return 1;
20902 for (
i=0;
i<n;
i++) {
20903 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple,
i)))
return 1;
20907 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
20908 PyObject *exc_type = tstate->curexc_type;
20909 if (exc_type == err)
return 1;
20910 if (unlikely(!exc_type))
return 0;
20911 if (unlikely(PyTuple_Check(err)))
20912 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
20913 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
20918 #if CYTHON_FAST_THREAD_STATE 20919 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
20921 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
20924 PyObject *local_type, *local_value, *local_tb;
20925 #if CYTHON_FAST_THREAD_STATE 20926 PyObject *tmp_type, *tmp_value, *tmp_tb;
20927 local_type = tstate->curexc_type;
20928 local_value = tstate->curexc_value;
20929 local_tb = tstate->curexc_traceback;
20930 tstate->curexc_type = 0;
20931 tstate->curexc_value = 0;
20932 tstate->curexc_traceback = 0;
20934 PyErr_Fetch(&local_type, &local_value, &local_tb);
20936 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
20937 #if CYTHON_FAST_THREAD_STATE 20938 if (unlikely(tstate->curexc_type))
20940 if (unlikely(PyErr_Occurred()))
20943 #if PY_MAJOR_VERSION >= 3 20945 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
20949 Py_XINCREF(local_tb);
20950 Py_XINCREF(local_type);
20951 Py_XINCREF(local_value);
20952 *type = local_type;
20953 *value = local_value;
20955 #if CYTHON_FAST_THREAD_STATE 20956 #if CYTHON_USE_EXC_INFO_STACK 20958 _PyErr_StackItem *exc_info = tstate->exc_info;
20959 tmp_type = exc_info->exc_type;
20960 tmp_value = exc_info->exc_value;
20961 tmp_tb = exc_info->exc_traceback;
20962 exc_info->exc_type = local_type;
20963 exc_info->exc_value = local_value;
20964 exc_info->exc_traceback = local_tb;
20967 tmp_type = tstate->exc_type;
20968 tmp_value = tstate->exc_value;
20969 tmp_tb = tstate->exc_traceback;
20970 tstate->exc_type = local_type;
20971 tstate->exc_value = local_value;
20972 tstate->exc_traceback = local_tb;
20974 Py_XDECREF(tmp_type);
20975 Py_XDECREF(tmp_value);
20976 Py_XDECREF(tmp_tb);
20978 PyErr_SetExcInfo(local_type, local_value, local_tb);
20985 Py_XDECREF(local_type);
20986 Py_XDECREF(local_value);
20987 Py_XDECREF(local_tb);
20992 #if PY_MAJOR_VERSION < 3 20993 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
20994 CYTHON_UNUSED PyObject *cause) {
20995 __Pyx_PyThreadState_declare
20997 if (!value || value == Py_None)
21001 if (!tb || tb == Py_None)
21005 if (!PyTraceBack_Check(tb)) {
21006 PyErr_SetString(PyExc_TypeError,
21007 "raise: arg 3 must be a traceback or None");
21011 if (PyType_Check(type)) {
21012 #if CYTHON_COMPILING_IN_PYPY 21014 Py_INCREF(Py_None);
21018 PyErr_NormalizeException(&type, &value, &tb);
21021 PyErr_SetString(PyExc_TypeError,
21022 "instance exception may not have a separate value");
21026 type = (PyObject*) Py_TYPE(type);
21028 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
21029 PyErr_SetString(PyExc_TypeError,
21030 "raise: exception class must be a subclass of BaseException");
21034 __Pyx_PyThreadState_assign
21035 __Pyx_ErrRestore(type, value, tb);
21044 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
21045 PyObject* owned_instance = NULL;
21046 if (tb == Py_None) {
21048 }
else if (tb && !PyTraceBack_Check(tb)) {
21049 PyErr_SetString(PyExc_TypeError,
21050 "raise: arg 3 must be a traceback or None");
21053 if (value == Py_None)
21055 if (PyExceptionInstance_Check(type)) {
21057 PyErr_SetString(PyExc_TypeError,
21058 "instance exception may not have a separate value");
21062 type = (PyObject*) Py_TYPE(value);
21063 }
else if (PyExceptionClass_Check(type)) {
21064 PyObject *instance_class = NULL;
21065 if (value && PyExceptionInstance_Check(value)) {
21066 instance_class = (PyObject*) Py_TYPE(value);
21067 if (instance_class != type) {
21068 int is_subclass = PyObject_IsSubclass(instance_class, type);
21069 if (!is_subclass) {
21070 instance_class = NULL;
21071 }
else if (unlikely(is_subclass == -1)) {
21074 type = instance_class;
21078 if (!instance_class) {
21081 args = PyTuple_New(0);
21082 else if (PyTuple_Check(value)) {
21086 args = PyTuple_Pack(1, value);
21089 owned_instance = PyObject_Call(type, args, NULL);
21091 if (!owned_instance)
21093 value = owned_instance;
21094 if (!PyExceptionInstance_Check(value)) {
21095 PyErr_Format(PyExc_TypeError,
21096 "calling %R should have returned an instance of " 21097 "BaseException, not %R",
21098 type, Py_TYPE(value));
21103 PyErr_SetString(PyExc_TypeError,
21104 "raise: exception class must be a subclass of BaseException");
21108 PyObject *fixed_cause;
21109 if (cause == Py_None) {
21110 fixed_cause = NULL;
21111 }
else if (PyExceptionClass_Check(cause)) {
21112 fixed_cause = PyObject_CallObject(cause, NULL);
21113 if (fixed_cause == NULL)
21115 }
else if (PyExceptionInstance_Check(cause)) {
21116 fixed_cause = cause;
21117 Py_INCREF(fixed_cause);
21119 PyErr_SetString(PyExc_TypeError,
21120 "exception causes must derive from " 21124 PyException_SetCause(value, fixed_cause);
21126 PyErr_SetObject(type, value);
21128 #if CYTHON_COMPILING_IN_PYPY 21129 PyObject *tmp_type, *tmp_value, *tmp_tb;
21130 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
21132 PyErr_Restore(tmp_type, tmp_value, tb);
21133 Py_XDECREF(tmp_tb);
21135 PyThreadState *tstate = __Pyx_PyThreadState_Current;
21136 PyObject* tmp_tb = tstate->curexc_traceback;
21137 if (tb != tmp_tb) {
21139 tstate->curexc_traceback = tb;
21140 Py_XDECREF(tmp_tb);
21145 Py_XDECREF(owned_instance);
21151 #if !CYTHON_COMPILING_IN_PYPY 21152 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
long intval,
int inplace,
int zerodivision_check) {
21154 (void)zerodivision_check;
21155 #if PY_MAJOR_VERSION < 3 21156 if (likely(PyInt_CheckExact(op1))) {
21157 const long b = intval;
21159 long a = PyInt_AS_LONG(op1);
21160 x = (long)((
unsigned long)a + b);
21161 if (likely((x^a) >= 0 || (x^b) >= 0))
21162 return PyInt_FromLong(x);
21163 return PyLong_Type.tp_as_number->nb_add(op1, op2);
21166 #if CYTHON_USE_PYLONG_INTERNALS 21167 if (likely(PyLong_CheckExact(op1))) {
21168 const long b = intval;
21170 #ifdef HAVE_LONG_LONG 21171 const PY_LONG_LONG llb = intval;
21172 PY_LONG_LONG lla, llx;
21174 const digit* digits = ((PyLongObject*)op1)->ob_digit;
21175 const Py_ssize_t size = Py_SIZE(op1);
21176 if (likely(__Pyx_sst_abs(size) <= 1)) {
21177 a = likely(size) ? digits[0] : 0;
21178 if (size == -1) a = -a;
21182 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
21183 a = -(long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21185 #ifdef HAVE_LONG_LONG 21186 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
21187 lla = -(PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
21191 CYTHON_FALLTHROUGH;
21193 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
21194 a = (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21196 #ifdef HAVE_LONG_LONG 21197 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
21198 lla = (PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
21202 CYTHON_FALLTHROUGH;
21204 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
21205 a = -(long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21207 #ifdef HAVE_LONG_LONG 21208 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
21209 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]));
21213 CYTHON_FALLTHROUGH;
21215 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
21216 a = (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21218 #ifdef HAVE_LONG_LONG 21219 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
21220 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]));
21224 CYTHON_FALLTHROUGH;
21226 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
21227 a = -(long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21229 #ifdef HAVE_LONG_LONG 21230 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
21231 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]));
21235 CYTHON_FALLTHROUGH;
21237 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
21238 a = (long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21240 #ifdef HAVE_LONG_LONG 21241 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
21242 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]));
21246 CYTHON_FALLTHROUGH;
21247 default:
return PyLong_Type.tp_as_number->nb_add(op1, op2);
21251 return PyLong_FromLong(x);
21252 #ifdef HAVE_LONG_LONG 21255 return PyLong_FromLongLong(llx);
21261 if (PyFloat_CheckExact(op1)) {
21262 const long b = intval;
21263 double a = PyFloat_AS_DOUBLE(op1);
21265 PyFPE_START_PROTECT(
"add",
return NULL)
21266 result = ((double)a) + (double)b;
21267 PyFPE_END_PROTECT(result)
21270 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
21275 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
21278 r = PyObject_SetItem(o, j, v);
21282 static CYTHON_INLINE
int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t
i, PyObject *v,
int is_list,
21283 CYTHON_NCP_UNUSED
int wraparound, CYTHON_NCP_UNUSED
int boundscheck) {
21284 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS 21285 if (is_list || PyList_CheckExact(o)) {
21286 Py_ssize_t n = (!wraparound) ?
i : ((likely(
i >= 0)) ?
i :
i + PyList_GET_SIZE(o));
21287 if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) {
21288 PyObject* old = PyList_GET_ITEM(o, n);
21290 PyList_SET_ITEM(o, n, v);
21295 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
21296 if (likely(m && m->sq_ass_item)) {
21297 if (wraparound && unlikely(
i < 0) && likely(m->sq_length)) {
21298 Py_ssize_t l = m->sq_length(o);
21299 if (likely(l >= 0)) {
21302 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
21307 return m->sq_ass_item(o,
i, v);
21311 #if CYTHON_COMPILING_IN_PYPY 21312 if (is_list || (PySequence_Check(o) && !PyDict_Check(o)))
21314 if (is_list || PySequence_Check(o))
21317 return PySequence_SetItem(o,
i, v);
21320 return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(
i), v);
21324 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2) {
21325 PyObject *args, *result = NULL;
21326 #if CYTHON_FAST_PYCALL 21327 if (PyFunction_Check(
function)) {
21328 PyObject *args[2] = {arg1, arg2};
21329 return __Pyx_PyFunction_FastCall(
function, args, 2);
21332 #if CYTHON_FAST_PYCCALL 21333 if (__Pyx_PyFastCFunction_Check(
function)) {
21334 PyObject *args[2] = {arg1, arg2};
21335 return __Pyx_PyCFunction_FastCall(
function, args, 2);
21338 args = PyTuple_New(2);
21339 if (unlikely(!args))
goto done;
21341 PyTuple_SET_ITEM(args, 0, arg1);
21343 PyTuple_SET_ITEM(args, 1, arg2);
21344 Py_INCREF(
function);
21345 result = __Pyx_PyObject_Call(
function, args, NULL);
21347 Py_DECREF(
function);
21353 static int __Pyx__ArgTypeTest(PyObject *
obj, PyTypeObject *type,
const char *name,
int exact)
21355 if (unlikely(!type)) {
21356 PyErr_SetString(PyExc_SystemError,
"Missing type object");
21360 #if PY_MAJOR_VERSION == 2 21361 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(
obj)))
return 1;
21365 if (likely(__Pyx_TypeCheck(
obj, type)))
return 1;
21367 PyErr_Format(PyExc_TypeError,
21368 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
21369 name, type->tp_name, Py_TYPE(
obj)->tp_name);
21374 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level) {
21375 PyObject *empty_list = 0;
21376 PyObject *module = 0;
21377 PyObject *global_dict = 0;
21378 PyObject *empty_dict = 0;
21380 #if PY_MAJOR_VERSION < 3 21381 PyObject *py_import;
21382 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
21389 empty_list = PyList_New(0);
21394 global_dict = PyModule_GetDict(__pyx_m);
21397 empty_dict = PyDict_New();
21401 #if PY_MAJOR_VERSION >= 3 21403 if (strchr(__Pyx_MODULE_NAME,
'.')) {
21404 module = PyImport_ImportModuleLevelObject(
21405 name, global_dict, empty_dict, list, 1);
21407 if (!PyErr_ExceptionMatches(PyExc_ImportError))
21416 #if PY_MAJOR_VERSION < 3 21417 PyObject *py_level = PyInt_FromLong(level);
21420 module = PyObject_CallFunctionObjArgs(py_import,
21421 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
21422 Py_DECREF(py_level);
21424 module = PyImport_ImportModuleLevelObject(
21425 name, global_dict, empty_dict, list, level);
21430 #if PY_MAJOR_VERSION < 3 21431 Py_XDECREF(py_import);
21433 Py_XDECREF(empty_list);
21434 Py_XDECREF(empty_dict);
21439 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 21440 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
21441 PyErr_Format(PyExc_AttributeError,
21442 #
if PY_MAJOR_VERSION >= 3
21443 "'%.50s' object has no attribute '%U'",
21444 tp->tp_name, attr_name);
21446 "'%.50s' object has no attribute '%.400s'",
21447 tp->tp_name, PyString_AS_STRING(attr_name));
21451 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject*
obj, PyObject* attr_name) {
21453 PyTypeObject *tp = Py_TYPE(
obj);
21454 if (unlikely(!PyString_Check(attr_name))) {
21455 return PyObject_GenericGetAttr(
obj, attr_name);
21457 assert(!tp->tp_dictoffset);
21458 descr = _PyType_Lookup(tp, attr_name);
21459 if (unlikely(!descr)) {
21460 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
21463 #if PY_MAJOR_VERSION < 3 21464 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
21467 descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
21469 PyObject *res = f(descr,
obj, (PyObject *)tp);
21479 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 21480 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject*
obj, PyObject* attr_name) {
21481 if (unlikely(Py_TYPE(
obj)->tp_dictoffset)) {
21482 return PyObject_GenericGetAttr(
obj, attr_name);
21484 return __Pyx_PyObject_GenericGetAttrNoDict(
obj, attr_name);
21489 static int __Pyx_SetVtable(PyObject *dict,
void *vtable) {
21490 #if PY_VERSION_HEX >= 0x02070000 21491 PyObject *ob = PyCapsule_New(vtable, 0, 0);
21493 PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
21497 if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
21507 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
21509 PyObject *name_attr;
21510 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name);
21511 if (likely(name_attr)) {
21512 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
21516 if (unlikely(ret < 0)) {
21520 Py_XDECREF(name_attr);
21523 static int __Pyx_setup_reduce(PyObject* type_obj) {
21525 PyObject *object_reduce = NULL;
21526 PyObject *object_reduce_ex = NULL;
21527 PyObject *reduce = NULL;
21528 PyObject *reduce_ex = NULL;
21529 PyObject *reduce_cython = NULL;
21530 PyObject *setstate = NULL;
21531 PyObject *setstate_cython = NULL;
21532 #if CYTHON_USE_PYTYPE_LOOKUP 21533 if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate))
goto GOOD;
21535 if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate))
goto GOOD;
21537 #if CYTHON_USE_PYTYPE_LOOKUP 21538 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto BAD;
21540 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto BAD;
21542 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex);
if (unlikely(!reduce_ex))
goto BAD;
21543 if (reduce_ex == object_reduce_ex) {
21544 #if CYTHON_USE_PYTYPE_LOOKUP 21545 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto BAD;
21547 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto BAD;
21549 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce);
if (unlikely(!reduce))
goto BAD;
21550 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
21551 reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython);
if (unlikely(!reduce_cython))
goto BAD;
21552 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython);
if (unlikely(ret < 0))
goto BAD;
21553 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython);
if (unlikely(ret < 0))
goto BAD;
21554 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
21555 if (!setstate) PyErr_Clear();
21556 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
21557 setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython);
if (unlikely(!setstate_cython))
goto BAD;
21558 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython);
if (unlikely(ret < 0))
goto BAD;
21559 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython);
if (unlikely(ret < 0))
goto BAD;
21561 PyType_Modified((PyTypeObject*)type_obj);
21566 if (!PyErr_Occurred())
21567 PyErr_Format(PyExc_RuntimeError,
"Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
21570 #if !CYTHON_USE_PYTYPE_LOOKUP 21571 Py_XDECREF(object_reduce);
21572 Py_XDECREF(object_reduce_ex);
21574 Py_XDECREF(reduce);
21575 Py_XDECREF(reduce_ex);
21576 Py_XDECREF(reduce_cython);
21577 Py_XDECREF(setstate);
21578 Py_XDECREF(setstate_cython);
21583 #if !CYTHON_COMPILING_IN_PYPY 21584 static PyObject* __Pyx_PyFloat_DivideObjC(PyObject *op1, PyObject *op2,
double floatval,
int inplace,
int zerodivision_check) {
21585 const double b = floatval;
21588 (void)zerodivision_check;
21589 if (likely(PyFloat_CheckExact(op1))) {
21590 a = PyFloat_AS_DOUBLE(op1);
21593 #if PY_MAJOR_VERSION < 3 21594 if (likely(PyInt_CheckExact(op1))) {
21595 a = (double) PyInt_AS_LONG(op1);
21599 if (likely(PyLong_CheckExact(op1))) {
21600 #if CYTHON_USE_PYLONG_INTERNALS 21601 const digit* digits = ((PyLongObject*)op1)->ob_digit;
21602 const Py_ssize_t size = Py_SIZE(op1);
21604 case 0: a = 0.0;
break;
21605 case -1: a = -(double) digits[0];
break;
21606 case 1: a = (double) digits[0];
break;
21609 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
21610 a = (double) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21611 if ((8 *
sizeof(
unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
21617 CYTHON_FALLTHROUGH;
21620 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
21621 a = (double) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21622 if ((8 *
sizeof(
unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
21628 CYTHON_FALLTHROUGH;
21631 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
21632 a = (double) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21633 if ((8 *
sizeof(
unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
21639 CYTHON_FALLTHROUGH;
21644 a = PyLong_AsDouble(op1);
21645 if (unlikely(a == -1.0 && PyErr_Occurred()))
return NULL;
21649 return (inplace ? __Pyx_PyNumber_InPlaceDivide(op1, op2) : __Pyx_PyNumber_Divide(op1, op2));
21652 PyFPE_START_PROTECT(
"divide",
return NULL)
21654 PyFPE_END_PROTECT(result)
21660 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals) {
21661 #if CYTHON_COMPILING_IN_PYPY 21662 return PyObject_RichCompareBool(s1, s2, equals);
21665 return (equals == Py_EQ);
21666 }
else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
21667 const char *ps1, *ps2;
21668 Py_ssize_t length = PyBytes_GET_SIZE(s1);
21669 if (length != PyBytes_GET_SIZE(s2))
21670 return (equals == Py_NE);
21671 ps1 = PyBytes_AS_STRING(s1);
21672 ps2 = PyBytes_AS_STRING(s2);
21673 if (ps1[0] != ps2[0]) {
21674 return (equals == Py_NE);
21675 }
else if (length == 1) {
21676 return (equals == Py_EQ);
21679 #if CYTHON_USE_UNICODE_INTERNALS 21680 Py_hash_t hash1, hash2;
21681 hash1 = ((PyBytesObject*)s1)->ob_shash;
21682 hash2 = ((PyBytesObject*)s2)->ob_shash;
21683 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
21684 return (equals == Py_NE);
21687 result = memcmp(ps1, ps2, (
size_t)length);
21688 return (equals == Py_EQ) ? (result == 0) : (result != 0);
21690 }
else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
21691 return (equals == Py_NE);
21692 }
else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
21693 return (equals == Py_NE);
21696 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
21699 result = __Pyx_PyObject_IsTrue(py_result);
21700 Py_DECREF(py_result);
21707 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals) {
21708 #if CYTHON_COMPILING_IN_PYPY 21709 return PyObject_RichCompareBool(s1, s2, equals);
21711 #if PY_MAJOR_VERSION < 3 21712 PyObject* owned_ref = NULL;
21714 int s1_is_unicode, s2_is_unicode;
21718 s1_is_unicode = PyUnicode_CheckExact(s1);
21719 s2_is_unicode = PyUnicode_CheckExact(s2);
21720 #if PY_MAJOR_VERSION < 3 21721 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
21722 owned_ref = PyUnicode_FromObject(s2);
21723 if (unlikely(!owned_ref))
21727 }
else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
21728 owned_ref = PyUnicode_FromObject(s1);
21729 if (unlikely(!owned_ref))
21733 }
else if (((!s2_is_unicode) & (!s1_is_unicode))) {
21734 return __Pyx_PyBytes_Equals(s1, s2, equals);
21737 if (s1_is_unicode & s2_is_unicode) {
21740 void *data1, *data2;
21741 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
21743 length = __Pyx_PyUnicode_GET_LENGTH(s1);
21744 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
21747 #if CYTHON_USE_UNICODE_INTERNALS 21749 Py_hash_t hash1, hash2;
21750 #if CYTHON_PEP393_ENABLED 21751 hash1 = ((PyASCIIObject*)s1)->hash;
21752 hash2 = ((PyASCIIObject*)s2)->hash;
21754 hash1 = ((PyUnicodeObject*)s1)->hash;
21755 hash2 = ((PyUnicodeObject*)s2)->hash;
21757 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
21762 kind = __Pyx_PyUnicode_KIND(s1);
21763 if (kind != __Pyx_PyUnicode_KIND(s2)) {
21766 data1 = __Pyx_PyUnicode_DATA(s1);
21767 data2 = __Pyx_PyUnicode_DATA(s2);
21768 if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
21770 }
else if (length == 1) {
21773 int result = memcmp(data1, data2, (
size_t)(length * kind));
21774 #if PY_MAJOR_VERSION < 3 21775 Py_XDECREF(owned_ref);
21777 return (equals == Py_EQ) ? (result == 0) : (result != 0);
21779 }
else if ((s1 == Py_None) & s2_is_unicode) {
21781 }
else if ((s2 == Py_None) & s1_is_unicode) {
21785 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
21786 #if PY_MAJOR_VERSION < 3 21787 Py_XDECREF(owned_ref);
21791 result = __Pyx_PyObject_IsTrue(py_result);
21792 Py_DECREF(py_result);
21796 #if PY_MAJOR_VERSION < 3 21797 Py_XDECREF(owned_ref);
21799 return (equals == Py_EQ);
21801 #if PY_MAJOR_VERSION < 3 21802 Py_XDECREF(owned_ref);
21804 return (equals == Py_NE);
21809 #ifndef CYTHON_CLINE_IN_TRACEBACK 21810 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line) {
21811 PyObject *use_cline;
21812 PyObject *ptype, *pvalue, *ptraceback;
21813 #if CYTHON_COMPILING_IN_CPYTHON 21814 PyObject **cython_runtime_dict;
21816 if (unlikely(!__pyx_cython_runtime)) {
21819 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
21820 #if CYTHON_COMPILING_IN_CPYTHON 21821 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
21822 if (likely(cython_runtime_dict)) {
21823 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
21824 use_cline, *cython_runtime_dict,
21825 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
21829 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
21830 if (use_cline_obj) {
21831 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
21832 Py_DECREF(use_cline_obj);
21840 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
21842 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
21845 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
21851 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
21852 int start = 0, mid = 0, end = count - 1;
21853 if (end >= 0 && code_line > entries[end].code_line) {
21856 while (start < end) {
21857 mid = start + (end - start) / 2;
21858 if (code_line < entries[mid].code_line) {
21860 }
else if (code_line > entries[mid].code_line) {
21866 if (code_line <= entries[mid].code_line) {
21872 static PyCodeObject *__pyx_find_code_object(
int code_line) {
21873 PyCodeObject* code_object;
21875 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
21878 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
21879 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
21882 code_object = __pyx_code_cache.entries[pos].code_object;
21883 Py_INCREF(code_object);
21884 return code_object;
21886 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
21888 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
21889 if (unlikely(!code_line)) {
21892 if (unlikely(!entries)) {
21893 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
21894 if (likely(entries)) {
21895 __pyx_code_cache.entries = entries;
21896 __pyx_code_cache.max_count = 64;
21897 __pyx_code_cache.count = 1;
21898 entries[0].code_line = code_line;
21899 entries[0].code_object = code_object;
21900 Py_INCREF(code_object);
21904 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
21905 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
21906 PyCodeObject* tmp = entries[pos].code_object;
21907 entries[pos].code_object = code_object;
21911 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
21912 int new_max = __pyx_code_cache.max_count + 64;
21913 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
21914 __pyx_code_cache.entries, (
size_t)new_max*
sizeof(__Pyx_CodeObjectCacheEntry));
21915 if (unlikely(!entries)) {
21918 __pyx_code_cache.entries = entries;
21919 __pyx_code_cache.max_count = new_max;
21921 for (
i=__pyx_code_cache.count;
i>pos;
i--) {
21922 entries[
i] = entries[
i-1];
21924 entries[pos].code_line = code_line;
21925 entries[pos].code_object = code_object;
21926 __pyx_code_cache.count++;
21927 Py_INCREF(code_object);
21931 #include "compile.h" 21932 #include "frameobject.h" 21933 #include "traceback.h" 21934 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
21935 const char *funcname,
int c_line,
21936 int py_line,
const char *filename) {
21937 PyCodeObject *py_code = 0;
21938 PyObject *py_srcfile = 0;
21939 PyObject *py_funcname = 0;
21940 #if PY_MAJOR_VERSION < 3 21941 py_srcfile = PyString_FromString(filename);
21943 py_srcfile = PyUnicode_FromString(filename);
21945 if (!py_srcfile)
goto bad;
21947 #if PY_MAJOR_VERSION < 3 21948 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
21950 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
21954 #if PY_MAJOR_VERSION < 3 21955 py_funcname = PyString_FromString(funcname);
21957 py_funcname = PyUnicode_FromString(funcname);
21960 if (!py_funcname)
goto bad;
21961 py_code = __Pyx_PyCode_New(
21978 Py_DECREF(py_srcfile);
21979 Py_DECREF(py_funcname);
21982 Py_XDECREF(py_srcfile);
21983 Py_XDECREF(py_funcname);
21986 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
21987 int py_line,
const char *filename) {
21988 PyCodeObject *py_code = 0;
21989 PyFrameObject *py_frame = 0;
21990 PyThreadState *tstate = __Pyx_PyThreadState_Current;
21992 c_line = __Pyx_CLineForTraceback(tstate, c_line);
21994 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
21996 py_code = __Pyx_CreateCodeObjectForTraceback(
21997 funcname, c_line, py_line, filename);
21998 if (!py_code)
goto bad;
21999 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
22001 py_frame = PyFrame_New(
22007 if (!py_frame)
goto bad;
22008 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
22009 PyTraceBack_Here(py_frame);
22011 Py_XDECREF(py_code);
22012 Py_XDECREF(py_frame);
22016 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ 22017 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) 22018 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ 22019 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) 22020 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ 22022 func_type value = func_value;\ 22023 if (sizeof(target_type) < sizeof(func_type)) {\ 22024 if (unlikely(value != (func_type) (target_type) value)) {\ 22025 func_type zero = 0;\ 22026 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ 22027 return (target_type) -1;\ 22028 if (is_unsigned && unlikely(value < zero))\ 22029 goto raise_neg_overflow;\ 22031 goto raise_overflow;\ 22034 return (target_type) value;\ 22038 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value) {
22039 const int neg_one = (int) ((
int) 0 - (int) 1), const_zero = (int) 0;
22040 const int is_unsigned = neg_one > const_zero;
22042 if (
sizeof(
int) <
sizeof(long)) {
22043 return PyInt_FromLong((
long) value);
22044 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
22045 return PyLong_FromUnsignedLong((
unsigned long) value);
22046 #ifdef HAVE_LONG_LONG 22047 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
22048 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
22052 if (
sizeof(
int) <=
sizeof(
long)) {
22053 return PyInt_FromLong((
long) value);
22054 #ifdef HAVE_LONG_LONG 22055 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
22056 return PyLong_FromLongLong((PY_LONG_LONG) value);
22061 int one = 1;
int little = (int)*(
unsigned char *)&one;
22062 unsigned char *bytes = (
unsigned char *)&value;
22063 return _PyLong_FromByteArray(bytes,
sizeof(
int),
22064 little, !is_unsigned);
22069 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *x) {
22070 const int neg_one = (int) ((
int) 0 - (int) 1), const_zero = (int) 0;
22071 const int is_unsigned = neg_one > const_zero;
22072 #if PY_MAJOR_VERSION < 3 22073 if (likely(PyInt_Check(x))) {
22074 if (
sizeof(
int) <
sizeof(long)) {
22075 __PYX_VERIFY_RETURN_INT(
int,
long, PyInt_AS_LONG(x))
22077 long val = PyInt_AS_LONG(x);
22078 if (is_unsigned && unlikely(val < 0)) {
22079 goto raise_neg_overflow;
22085 if (likely(PyLong_Check(x))) {
22087 #if CYTHON_USE_PYLONG_INTERNALS 22088 const digit* digits = ((PyLongObject*)x)->ob_digit;
22089 switch (Py_SIZE(x)) {
22090 case 0:
return (
int) 0;
22091 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, digits[0])
22093 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
22094 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22095 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22096 }
else if (8 *
sizeof(
int) >= 2 * PyLong_SHIFT) {
22097 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
22102 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
22103 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22104 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22105 }
else if (8 *
sizeof(
int) >= 3 * PyLong_SHIFT) {
22106 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
22111 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
22112 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22113 __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])))
22114 }
else if (8 *
sizeof(
int) >= 4 * PyLong_SHIFT) {
22115 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
22121 #if CYTHON_COMPILING_IN_CPYTHON 22122 if (unlikely(Py_SIZE(x) < 0)) {
22123 goto raise_neg_overflow;
22127 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
22128 if (unlikely(result < 0))
22130 if (unlikely(result == 1))
22131 goto raise_neg_overflow;
22134 if (
sizeof(
int) <=
sizeof(
unsigned long)) {
22135 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
22136 #ifdef HAVE_LONG_LONG 22137 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
22138 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
22142 #if CYTHON_USE_PYLONG_INTERNALS 22143 const digit* digits = ((PyLongObject*)x)->ob_digit;
22144 switch (Py_SIZE(x)) {
22145 case 0:
return (
int) 0;
22146 case -1: __PYX_VERIFY_RETURN_INT(
int, sdigit, (sdigit) (-(sdigit)digits[0]))
22147 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, +digits[0])
22149 if (8 *
sizeof(
int) - 1 > 1 * PyLong_SHIFT) {
22150 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22151 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22152 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
22153 return (
int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
22158 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
22159 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22160 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22161 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
22162 return (
int) ((((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
22167 if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
22168 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22169 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22170 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
22171 return (
int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
22176 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
22177 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22178 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22179 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
22180 return (
int) ((((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
22185 if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
22186 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22187 __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])))
22188 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
22189 return (
int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
22194 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
22195 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22196 __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])))
22197 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
22198 return (
int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
22204 if (
sizeof(
int) <=
sizeof(long)) {
22205 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
22206 #ifdef HAVE_LONG_LONG 22207 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
22208 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
22213 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) 22214 PyErr_SetString(PyExc_RuntimeError,
22215 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
22218 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
22219 #if PY_MAJOR_VERSION < 3 22220 if (likely(v) && !PyLong_Check(v)) {
22222 v = PyNumber_Long(tmp);
22227 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
22228 unsigned char *bytes = (
unsigned char *)&val;
22229 int ret = _PyLong_AsByteArray((PyLongObject *)v,
22230 bytes,
sizeof(val),
22231 is_little, !is_unsigned);
22241 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
22242 if (!tmp)
return (
int) -1;
22243 val = __Pyx_PyInt_As_int(tmp);
22248 PyErr_SetString(PyExc_OverflowError,
22249 "value too large to convert to int");
22251 raise_neg_overflow:
22252 PyErr_SetString(PyExc_OverflowError,
22253 "can't convert negative value to int");
22258 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value) {
22259 const long neg_one = (long) ((
long) 0 - (long) 1), const_zero = (long) 0;
22260 const int is_unsigned = neg_one > const_zero;
22262 if (
sizeof(
long) <
sizeof(long)) {
22263 return PyInt_FromLong((
long) value);
22264 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
22265 return PyLong_FromUnsignedLong((
unsigned long) value);
22266 #ifdef HAVE_LONG_LONG 22267 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
22268 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
22272 if (
sizeof(
long) <=
sizeof(
long)) {
22273 return PyInt_FromLong((
long) value);
22274 #ifdef HAVE_LONG_LONG 22275 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
22276 return PyLong_FromLongLong((PY_LONG_LONG) value);
22281 int one = 1;
int little = (int)*(
unsigned char *)&one;
22282 unsigned char *bytes = (
unsigned char *)&value;
22283 return _PyLong_FromByteArray(bytes,
sizeof(
long),
22284 little, !is_unsigned);
22289 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *x) {
22290 const long neg_one = (long) ((
long) 0 - (long) 1), const_zero = (long) 0;
22291 const int is_unsigned = neg_one > const_zero;
22292 #if PY_MAJOR_VERSION < 3 22293 if (likely(PyInt_Check(x))) {
22294 if (
sizeof(
long) <
sizeof(long)) {
22295 __PYX_VERIFY_RETURN_INT(
long,
long, PyInt_AS_LONG(x))
22297 long val = PyInt_AS_LONG(x);
22298 if (is_unsigned && unlikely(val < 0)) {
22299 goto raise_neg_overflow;
22305 if (likely(PyLong_Check(x))) {
22307 #if CYTHON_USE_PYLONG_INTERNALS 22308 const digit* digits = ((PyLongObject*)x)->ob_digit;
22309 switch (Py_SIZE(x)) {
22310 case 0:
return (
long) 0;
22311 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, digits[0])
22313 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
22314 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22315 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22316 }
else if (8 *
sizeof(
long) >= 2 * PyLong_SHIFT) {
22317 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
22322 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
22323 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22324 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22325 }
else if (8 *
sizeof(
long) >= 3 * PyLong_SHIFT) {
22326 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
22331 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
22332 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22333 __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])))
22334 }
else if (8 *
sizeof(
long) >= 4 * PyLong_SHIFT) {
22335 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
22341 #if CYTHON_COMPILING_IN_CPYTHON 22342 if (unlikely(Py_SIZE(x) < 0)) {
22343 goto raise_neg_overflow;
22347 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
22348 if (unlikely(result < 0))
22350 if (unlikely(result == 1))
22351 goto raise_neg_overflow;
22354 if (
sizeof(
long) <=
sizeof(
unsigned long)) {
22355 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
22356 #ifdef HAVE_LONG_LONG 22357 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
22358 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
22362 #if CYTHON_USE_PYLONG_INTERNALS 22363 const digit* digits = ((PyLongObject*)x)->ob_digit;
22364 switch (Py_SIZE(x)) {
22365 case 0:
return (
long) 0;
22366 case -1: __PYX_VERIFY_RETURN_INT(
long, sdigit, (sdigit) (-(sdigit)digits[0]))
22367 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, +digits[0])
22369 if (8 *
sizeof(
long) - 1 > 1 * PyLong_SHIFT) {
22370 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22371 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22372 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
22373 return (
long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
22378 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
22379 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22380 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22381 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
22382 return (
long) ((((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
22387 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
22388 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22389 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22390 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
22391 return (
long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
22396 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
22397 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22398 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22399 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
22400 return (
long) ((((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
22405 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
22406 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22407 __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])))
22408 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
22409 return (
long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
22414 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
22415 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22416 __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])))
22417 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
22418 return (
long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
22424 if (
sizeof(
long) <=
sizeof(long)) {
22425 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
22426 #ifdef HAVE_LONG_LONG 22427 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
22428 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
22433 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) 22434 PyErr_SetString(PyExc_RuntimeError,
22435 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
22438 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
22439 #if PY_MAJOR_VERSION < 3 22440 if (likely(v) && !PyLong_Check(v)) {
22442 v = PyNumber_Long(tmp);
22447 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
22448 unsigned char *bytes = (
unsigned char *)&val;
22449 int ret = _PyLong_AsByteArray((PyLongObject *)v,
22450 bytes,
sizeof(val),
22451 is_little, !is_unsigned);
22461 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
22462 if (!tmp)
return (
long) -1;
22463 val = __Pyx_PyInt_As_long(tmp);
22468 PyErr_SetString(PyExc_OverflowError,
22469 "value too large to convert to long");
22471 raise_neg_overflow:
22472 PyErr_SetString(PyExc_OverflowError,
22473 "can't convert negative value to long");
22478 #if CYTHON_COMPILING_IN_CPYTHON 22479 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
22485 return b == &PyBaseObject_Type;
22487 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
22489 if (a == b)
return 1;
22493 n = PyTuple_GET_SIZE(mro);
22494 for (
i = 0;
i < n;
i++) {
22495 if (PyTuple_GET_ITEM(mro,
i) == (PyObject *)b)
22500 return __Pyx_InBases(a, b);
22502 #if PY_MAJOR_VERSION == 2 22503 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
22504 PyObject *exception, *value, *tb;
22506 __Pyx_PyThreadState_declare
22507 __Pyx_PyThreadState_assign
22508 __Pyx_ErrFetch(&exception, &value, &tb);
22509 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
22510 if (unlikely(res == -1)) {
22511 PyErr_WriteUnraisable(err);
22515 res = PyObject_IsSubclass(err, exc_type2);
22516 if (unlikely(res == -1)) {
22517 PyErr_WriteUnraisable(err);
22521 __Pyx_ErrRestore(exception, value, tb);
22525 static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
22526 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
22528 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
22533 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
22535 assert(PyExceptionClass_Check(exc_type));
22536 n = PyTuple_GET_SIZE(tuple);
22537 #if PY_MAJOR_VERSION >= 3 22538 for (
i=0;
i<n;
i++) {
22539 if (exc_type == PyTuple_GET_ITEM(tuple,
i))
return 1;
22542 for (
i=0;
i<n;
i++) {
22543 PyObject *t = PyTuple_GET_ITEM(tuple,
i);
22544 #if PY_MAJOR_VERSION < 3 22545 if (likely(exc_type == t))
return 1;
22547 if (likely(PyExceptionClass_Check(t))) {
22548 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
22554 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
22555 if (likely(err == exc_type))
return 1;
22556 if (likely(PyExceptionClass_Check(err))) {
22557 if (likely(PyExceptionClass_Check(exc_type))) {
22558 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
22559 }
else if (likely(PyTuple_Check(exc_type))) {
22560 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
22564 return PyErr_GivenExceptionMatches(err, exc_type);
22566 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
22567 assert(PyExceptionClass_Check(exc_type1));
22568 assert(PyExceptionClass_Check(exc_type2));
22569 if (likely(err == exc_type1 || err == exc_type2))
return 1;
22570 if (likely(PyExceptionClass_Check(err))) {
22571 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
22573 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
22578 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
22579 PyObject* fake_module;
22580 PyTypeObject* cached_type = NULL;
22581 fake_module = PyImport_AddModule((
char*)
"_cython_" CYTHON_ABI);
22582 if (!fake_module)
return NULL;
22583 Py_INCREF(fake_module);
22584 cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
22586 if (!PyType_Check((PyObject*)cached_type)) {
22587 PyErr_Format(PyExc_TypeError,
22588 "Shared Cython type %.200s is not a type object",
22592 if (cached_type->tp_basicsize != type->tp_basicsize) {
22593 PyErr_Format(PyExc_TypeError,
22594 "Shared Cython type %.200s has the wrong size, try recompiling",
22599 if (!PyErr_ExceptionMatches(PyExc_AttributeError))
goto bad;
22601 if (PyType_Ready(type) < 0)
goto bad;
22602 if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
22605 cached_type = type;
22608 Py_DECREF(fake_module);
22609 return cached_type;
22611 Py_XDECREF(cached_type);
22612 cached_type = NULL;
22617 #if CYTHON_FAST_THREAD_STATE 22618 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
22619 PyObject *tmp_type, *tmp_value, *tmp_tb;
22620 #if CYTHON_USE_EXC_INFO_STACK 22621 _PyErr_StackItem *exc_info = tstate->exc_info;
22622 tmp_type = exc_info->exc_type;
22623 tmp_value = exc_info->exc_value;
22624 tmp_tb = exc_info->exc_traceback;
22625 exc_info->exc_type = *type;
22626 exc_info->exc_value = *value;
22627 exc_info->exc_traceback = *tb;
22629 tmp_type = tstate->exc_type;
22630 tmp_value = tstate->exc_value;
22631 tmp_tb = tstate->exc_traceback;
22632 tstate->exc_type = *type;
22633 tstate->exc_value = *value;
22634 tstate->exc_traceback = *tb;
22637 *value = tmp_value;
22641 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
22642 PyObject *tmp_type, *tmp_value, *tmp_tb;
22643 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
22644 PyErr_SetExcInfo(*type, *value, *tb);
22646 *value = tmp_value;
22652 static int __Pyx_PyObject_GetMethod(PyObject *
obj, PyObject *name, PyObject **method) {
22654 #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP 22655 PyTypeObject *tp = Py_TYPE(
obj);
22657 descrgetfunc f = NULL;
22658 PyObject **dictptr, *dict;
22659 int meth_found = 0;
22660 assert (*method == NULL);
22661 if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
22662 attr = __Pyx_PyObject_GetAttrStr(
obj, name);
22665 if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
22668 descr = _PyType_Lookup(tp, name);
22669 if (likely(descr != NULL)) {
22671 #if PY_MAJOR_VERSION >= 3 22672 #ifdef __Pyx_CyFunction_USED 22673 if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
22675 if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type)))
22678 #ifdef __Pyx_CyFunction_USED 22679 if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
22681 if (likely(PyFunction_Check(descr)))
22687 f = Py_TYPE(descr)->tp_descr_get;
22688 if (f != NULL && PyDescr_IsData(descr)) {
22689 attr = f(descr,
obj, (PyObject *)Py_TYPE(
obj));
22695 dictptr = _PyObject_GetDictPtr(
obj);
22696 if (dictptr != NULL && (dict = *dictptr) != NULL) {
22698 attr = __Pyx_PyDict_GetItemStr(dict, name);
22699 if (attr != NULL) {
22712 attr = f(descr,
obj, (PyObject *)Py_TYPE(
obj));
22716 if (descr != NULL) {
22720 PyErr_Format(PyExc_AttributeError,
22721 #
if PY_MAJOR_VERSION >= 3
22722 "'%.50s' object has no attribute '%U'",
22723 tp->tp_name, name);
22725 "'%.50s' object has no attribute '%.400s'",
22726 tp->tp_name, PyString_AS_STRING(name));
22730 attr = __Pyx_PyObject_GetAttrStr(
obj, name);
22734 #if CYTHON_UNPACK_METHODS 22735 if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) ==
obj)) {
22736 PyObject *
function = PyMethod_GET_FUNCTION(attr);
22737 Py_INCREF(
function);
22739 *method =
function;
22748 static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
22749 PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
22753 static PyObject* __Pyx_PyObject_CallMethod1(PyObject*
obj, PyObject* method_name, PyObject* arg) {
22754 PyObject *method = NULL, *result;
22755 int is_method = __Pyx_PyObject_GetMethod(
obj, method_name, &method);
22756 if (likely(is_method)) {
22757 result = __Pyx_PyObject_Call2Args(method,
obj, arg);
22761 if (unlikely(!method))
return NULL;
22762 return __Pyx__PyObject_CallMethod1(method, arg);
22766 #include <structmember.h> 22767 #include <frameobject.h> 22768 #define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom) 22769 static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) {
22770 PyObject *et, *ev, *tb;
22771 PyObject *value = NULL;
22772 __Pyx_ErrFetch(&et, &ev, &tb);
22776 Py_INCREF(Py_None);
22780 if (likely(et == PyExc_StopIteration)) {
22782 Py_INCREF(Py_None);
22785 #if PY_VERSION_HEX >= 0x030300A0 22786 else if (Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) {
22787 value = ((PyStopIterationObject *)ev)->value;
22792 else if (unlikely(PyTuple_Check(ev))) {
22793 if (PyTuple_GET_SIZE(ev) >= 1) {
22794 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 22795 value = PyTuple_GET_ITEM(ev, 0);
22798 value = PySequence_ITEM(ev, 0);
22801 Py_INCREF(Py_None);
22806 else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
22809 if (likely(value)) {
22815 }
else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
22816 __Pyx_ErrRestore(et, ev, tb);
22819 PyErr_NormalizeException(&et, &ev, &tb);
22820 if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
22821 __Pyx_ErrRestore(et, ev, tb);
22826 #if PY_VERSION_HEX >= 0x030300A0 22827 value = ((PyStopIterationObject *)ev)->value;
22832 PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args);
22834 if (likely(args)) {
22835 value = PySequence_GetItem(args, 0);
22838 if (unlikely(!value)) {
22839 __Pyx_ErrRestore(NULL, NULL, NULL);
22840 Py_INCREF(Py_None);
22848 static CYTHON_INLINE
22849 void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) {
22850 PyObject *t, *v, *tb;
22851 t = exc_state->exc_type;
22852 v = exc_state->exc_value;
22853 tb = exc_state->exc_traceback;
22854 exc_state->exc_type = NULL;
22855 exc_state->exc_value = NULL;
22856 exc_state->exc_traceback = NULL;
22861 #define __Pyx_Coroutine_AlreadyRunningError(gen) (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL) 22862 static void __Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject *gen) {
22865 #ifdef __Pyx_Coroutine_USED 22866 }
else if (__Pyx_Coroutine_Check((PyObject*)gen)) {
22867 msg =
"coroutine already executing";
22869 #ifdef __Pyx_AsyncGen_USED 22870 }
else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
22871 msg =
"async generator already executing";
22874 msg =
"generator already executing";
22876 PyErr_SetString(PyExc_ValueError, msg);
22878 #define __Pyx_Coroutine_NotStartedError(gen) (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL) 22879 static void __Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject *gen) {
22882 #ifdef __Pyx_Coroutine_USED 22883 }
else if (__Pyx_Coroutine_Check(gen)) {
22884 msg =
"can't send non-None value to a just-started coroutine";
22886 #ifdef __Pyx_AsyncGen_USED 22887 }
else if (__Pyx_AsyncGen_CheckExact(gen)) {
22888 msg =
"can't send non-None value to a just-started async generator";
22891 msg =
"can't send non-None value to a just-started generator";
22893 PyErr_SetString(PyExc_TypeError, msg);
22895 #define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing) (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL) 22896 static void __Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject *gen, PyObject *value, CYTHON_UNUSED
int closing) {
22897 #ifdef __Pyx_Coroutine_USED 22898 if (!closing && __Pyx_Coroutine_Check(gen)) {
22899 PyErr_SetString(PyExc_RuntimeError,
"cannot reuse already awaited coroutine");
22903 #ifdef __Pyx_AsyncGen_USED 22904 if (__Pyx_AsyncGen_CheckExact(gen))
22905 PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration);
22908 PyErr_SetNone(PyExc_StopIteration);
22912 PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *
self, PyObject *value,
int closing) {
22913 __Pyx_PyThreadState_declare
22914 PyThreadState *tstate;
22915 __Pyx_ExcInfoStruct *exc_state;
22917 assert(!self->is_running);
22918 if (unlikely(self->resume_label == 0)) {
22919 if (unlikely(value && value != Py_None)) {
22920 return __Pyx_Coroutine_NotStartedError((PyObject*)
self);
22923 if (unlikely(self->resume_label == -1)) {
22924 return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)
self, value, closing);
22926 #if CYTHON_FAST_THREAD_STATE 22927 __Pyx_PyThreadState_assign
22928 tstate = __pyx_tstate;
22930 tstate = __Pyx_PyThreadState_Current;
22932 exc_state = &
self->gi_exc_state;
22933 if (exc_state->exc_type) {
22934 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON 22936 if (exc_state->exc_traceback) {
22937 PyTracebackObject *tb = (PyTracebackObject *) exc_state->exc_traceback;
22938 PyFrameObject *f = tb->tb_frame;
22939 Py_XINCREF(tstate->frame);
22940 assert(f->f_back == NULL);
22941 f->f_back = tstate->frame;
22945 #if CYTHON_USE_EXC_INFO_STACK 22946 exc_state->previous_item = tstate->exc_info;
22947 tstate->exc_info = exc_state;
22949 if (exc_state->exc_type) {
22950 __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
22952 __Pyx_Coroutine_ExceptionClear(exc_state);
22953 __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
22956 self->is_running = 1;
22957 retval =
self->body((PyObject *)
self, tstate, value);
22958 self->is_running = 0;
22959 #if CYTHON_USE_EXC_INFO_STACK 22960 exc_state = &
self->gi_exc_state;
22961 tstate->exc_info = exc_state->previous_item;
22962 exc_state->previous_item = NULL;
22963 __Pyx_Coroutine_ResetFrameBackpointer(exc_state);
22967 static CYTHON_INLINE
void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) {
22968 PyObject *exc_tb = exc_state->exc_traceback;
22969 if (likely(exc_tb)) {
22970 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON 22972 PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
22973 PyFrameObject *f = tb->tb_frame;
22974 Py_CLEAR(f->f_back);
22978 static CYTHON_INLINE
22979 PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *retval) {
22980 if (unlikely(!retval)) {
22981 __Pyx_PyThreadState_declare
22982 __Pyx_PyThreadState_assign
22983 if (!__Pyx_PyErr_Occurred()) {
22984 PyObject *exc = PyExc_StopIteration;
22985 #ifdef __Pyx_AsyncGen_USED 22986 if (__Pyx_AsyncGen_CheckExact(gen))
22987 exc = __Pyx_PyExc_StopAsyncIteration;
22989 __Pyx_PyErr_SetNone(exc);
22994 static CYTHON_INLINE
22995 PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
22997 PyObject *val = NULL;
22998 __Pyx_Coroutine_Undelegate(gen);
22999 __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
23000 ret = __Pyx_Coroutine_SendEx(gen, val, 0);
23004 static PyObject *__Pyx_Coroutine_Send(PyObject *
self, PyObject *value) {
23006 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*)
self;
23007 PyObject *yf = gen->yieldfrom;
23008 if (unlikely(gen->is_running))
23009 return __Pyx_Coroutine_AlreadyRunningError(gen);
23012 gen->is_running = 1;
23013 #ifdef __Pyx_Generator_USED 23014 if (__Pyx_Generator_CheckExact(yf)) {
23015 ret = __Pyx_Coroutine_Send(yf, value);
23018 #ifdef __Pyx_Coroutine_USED 23019 if (__Pyx_Coroutine_Check(yf)) {
23020 ret = __Pyx_Coroutine_Send(yf, value);
23023 #ifdef __Pyx_AsyncGen_USED 23024 if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
23025 ret = __Pyx_async_gen_asend_send(yf, value);
23028 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) 23029 if (PyGen_CheckExact(yf)) {
23030 ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
23033 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) 23034 if (PyCoro_CheckExact(yf)) {
23035 ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
23039 if (value == Py_None)
23040 ret = Py_TYPE(yf)->tp_iternext(yf);
23042 ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
23044 gen->is_running = 0;
23048 retval = __Pyx_Coroutine_FinishDelegation(gen);
23050 retval = __Pyx_Coroutine_SendEx(gen, value, 0);
23052 return __Pyx_Coroutine_MethodReturn(
self, retval);
23054 static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
23055 PyObject *retval = NULL;
23057 #ifdef __Pyx_Generator_USED 23058 if (__Pyx_Generator_CheckExact(yf)) {
23059 retval = __Pyx_Coroutine_Close(yf);
23064 #ifdef __Pyx_Coroutine_USED 23065 if (__Pyx_Coroutine_Check(yf)) {
23066 retval = __Pyx_Coroutine_Close(yf);
23070 if (__Pyx_CoroutineAwait_CheckExact(yf)) {
23071 retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL);
23076 #ifdef __Pyx_AsyncGen_USED 23077 if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
23078 retval = __Pyx_async_gen_asend_close(yf, NULL);
23080 if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
23081 retval = __Pyx_async_gen_athrow_close(yf, NULL);
23086 gen->is_running = 1;
23087 meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close);
23088 if (unlikely(!meth)) {
23089 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
23090 PyErr_WriteUnraisable(yf);
23094 retval = PyObject_CallFunction(meth, NULL);
23099 gen->is_running = 0;
23101 Py_XDECREF(retval);
23104 static PyObject *__Pyx_Generator_Next(PyObject *
self) {
23105 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*)
self;
23106 PyObject *yf = gen->yieldfrom;
23107 if (unlikely(gen->is_running))
23108 return __Pyx_Coroutine_AlreadyRunningError(gen);
23111 gen->is_running = 1;
23112 #ifdef __Pyx_Generator_USED 23113 if (__Pyx_Generator_CheckExact(yf)) {
23114 ret = __Pyx_Generator_Next(yf);
23117 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) 23118 if (PyGen_CheckExact(yf)) {
23119 ret = _PyGen_Send((PyGenObject*)yf, NULL);
23122 #ifdef __Pyx_Coroutine_USED 23123 if (__Pyx_Coroutine_Check(yf)) {
23124 ret = __Pyx_Coroutine_Send(yf, Py_None);
23127 ret = Py_TYPE(yf)->tp_iternext(yf);
23128 gen->is_running = 0;
23132 return __Pyx_Coroutine_FinishDelegation(gen);
23134 return __Pyx_Coroutine_SendEx(gen, Py_None, 0);
23136 static PyObject *__Pyx_Coroutine_Close_Method(PyObject *
self, CYTHON_UNUSED PyObject *arg) {
23137 return __Pyx_Coroutine_Close(
self);
23139 static PyObject *__Pyx_Coroutine_Close(PyObject *
self) {
23140 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
23141 PyObject *retval, *raised_exception;
23142 PyObject *yf = gen->yieldfrom;
23144 if (unlikely(gen->is_running))
23145 return __Pyx_Coroutine_AlreadyRunningError(gen);
23148 err = __Pyx_Coroutine_CloseIter(gen, yf);
23149 __Pyx_Coroutine_Undelegate(gen);
23153 PyErr_SetNone(PyExc_GeneratorExit);
23154 retval = __Pyx_Coroutine_SendEx(gen, NULL, 1);
23155 if (unlikely(retval)) {
23159 #ifdef __Pyx_Coroutine_USED 23160 }
else if (__Pyx_Coroutine_Check(
self)) {
23161 msg =
"coroutine ignored GeneratorExit";
23163 #ifdef __Pyx_AsyncGen_USED 23164 }
else if (__Pyx_AsyncGen_CheckExact(
self)) {
23165 #if PY_VERSION_HEX < 0x03060000 23166 msg =
"async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)";
23168 msg =
"async generator ignored GeneratorExit";
23172 msg =
"generator ignored GeneratorExit";
23174 PyErr_SetString(PyExc_RuntimeError, msg);
23177 raised_exception = PyErr_Occurred();
23178 if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) {
23179 if (raised_exception) PyErr_Clear();
23180 Py_INCREF(Py_None);
23185 static PyObject *__Pyx__Coroutine_Throw(PyObject *
self, PyObject *typ, PyObject *val, PyObject *tb,
23186 PyObject *args,
int close_on_genexit) {
23187 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
23188 PyObject *yf = gen->yieldfrom;
23189 if (unlikely(gen->is_running))
23190 return __Pyx_Coroutine_AlreadyRunningError(gen);
23194 if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
23195 int err = __Pyx_Coroutine_CloseIter(gen, yf);
23197 __Pyx_Coroutine_Undelegate(gen);
23199 return __Pyx_Coroutine_MethodReturn(
self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
23202 gen->is_running = 1;
23204 #ifdef __Pyx_Generator_USED
23205 || __Pyx_Generator_CheckExact(yf)
23207 #ifdef __Pyx_Coroutine_USED
23208 || __Pyx_Coroutine_Check(yf)
23211 ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
23212 #ifdef __Pyx_Coroutine_USED 23213 }
else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
23214 ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
23217 PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw);
23218 if (unlikely(!meth)) {
23220 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
23221 gen->is_running = 0;
23225 __Pyx_Coroutine_Undelegate(gen);
23226 gen->is_running = 0;
23229 if (likely(args)) {
23230 ret = PyObject_CallObject(meth, args);
23232 ret = PyObject_CallFunctionObjArgs(meth, typ, val, tb, NULL);
23236 gen->is_running = 0;
23239 ret = __Pyx_Coroutine_FinishDelegation(gen);
23241 return __Pyx_Coroutine_MethodReturn(
self, ret);
23244 __Pyx_Raise(typ, val, tb, NULL);
23245 return __Pyx_Coroutine_MethodReturn(
self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
23247 static PyObject *__Pyx_Coroutine_Throw(PyObject *
self, PyObject *args) {
23249 PyObject *val = NULL;
23250 PyObject *tb = NULL;
23251 if (!PyArg_UnpackTuple(args, (
char *)
"throw", 1, 3, &typ, &val, &tb))
23253 return __Pyx__Coroutine_Throw(
self, typ, val, tb, args, 1);
23255 static CYTHON_INLINE
int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit,
void *arg) {
23256 Py_VISIT(exc_state->exc_type);
23257 Py_VISIT(exc_state->exc_value);
23258 Py_VISIT(exc_state->exc_traceback);
23261 static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit,
void *arg) {
23262 Py_VISIT(gen->closure);
23263 Py_VISIT(gen->classobj);
23264 Py_VISIT(gen->yieldfrom);
23265 return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg);
23267 static int __Pyx_Coroutine_clear(PyObject *
self) {
23268 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
23269 Py_CLEAR(gen->closure);
23270 Py_CLEAR(gen->classobj);
23271 Py_CLEAR(gen->yieldfrom);
23272 __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state);
23273 #ifdef __Pyx_AsyncGen_USED 23274 if (__Pyx_AsyncGen_CheckExact(
self)) {
23275 Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
23278 Py_CLEAR(gen->gi_code);
23279 Py_CLEAR(gen->gi_name);
23280 Py_CLEAR(gen->gi_qualname);
23281 Py_CLEAR(gen->gi_modulename);
23284 static void __Pyx_Coroutine_dealloc(PyObject *
self) {
23285 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
23286 PyObject_GC_UnTrack(gen);
23287 if (gen->gi_weakreflist != NULL)
23288 PyObject_ClearWeakRefs(
self);
23289 if (gen->resume_label >= 0) {
23290 PyObject_GC_Track(
self);
23291 #if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE 23292 if (PyObject_CallFinalizerFromDealloc(
self))
23294 Py_TYPE(gen)->tp_del(
self);
23295 if (self->ob_refcnt > 0)
23300 PyObject_GC_UnTrack(
self);
23302 #ifdef __Pyx_AsyncGen_USED 23303 if (__Pyx_AsyncGen_CheckExact(
self)) {
23307 Py_CLEAR(((__pyx_PyAsyncGenObject*)
self)->ag_finalizer);
23310 __Pyx_Coroutine_clear(
self);
23311 PyObject_GC_Del(gen);
23313 static void __Pyx_Coroutine_del(PyObject *
self) {
23314 PyObject *error_type, *error_value, *error_traceback;
23315 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
23316 __Pyx_PyThreadState_declare
23317 if (gen->resume_label < 0) {
23320 #if !CYTHON_USE_TP_FINALIZE 23321 assert(self->ob_refcnt == 0);
23322 self->ob_refcnt = 1;
23324 __Pyx_PyThreadState_assign
23325 __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
23326 #ifdef __Pyx_AsyncGen_USED 23327 if (__Pyx_AsyncGen_CheckExact(
self)) {
23328 __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)
self;
23329 PyObject *finalizer = agen->ag_finalizer;
23330 if (finalizer && !agen->ag_closed) {
23331 PyObject *res = __Pyx_PyObject_CallOneArg(finalizer,
self);
23332 if (unlikely(!res)) {
23333 PyErr_WriteUnraisable(
self);
23337 __Pyx_ErrRestore(error_type, error_value, error_traceback);
23342 if (unlikely(gen->resume_label == 0 && !error_value)) {
23343 #ifdef __Pyx_Coroutine_USED 23344 #ifdef __Pyx_Generator_USED 23345 if (!__Pyx_Generator_CheckExact(
self))
23348 PyObject_GC_UnTrack(
self);
23349 #if PY_MAJOR_VERSION >= 3 || defined(PyErr_WarnFormat) 23350 if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1,
"coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
23351 PyErr_WriteUnraisable(
self);
23355 #if CYTHON_COMPILING_IN_PYPY 23357 cmsg = (
char*)
"coroutine was never awaited";
23360 PyObject *qualname;
23361 qualname = gen->gi_qualname;
23362 cname = PyString_AS_STRING(qualname);
23363 msg = PyString_FromFormat(
"coroutine '%.50s' was never awaited", cname);
23364 if (unlikely(!msg)) {
23366 cmsg = (
char*)
"coroutine was never awaited";
23368 cmsg = PyString_AS_STRING(msg);
23371 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0))
23372 PyErr_WriteUnraisable(
self);
23375 PyObject_GC_Track(
self);
23379 PyObject *res = __Pyx_Coroutine_Close(
self);
23380 if (unlikely(!res)) {
23381 if (PyErr_Occurred())
23382 PyErr_WriteUnraisable(
self);
23387 __Pyx_ErrRestore(error_type, error_value, error_traceback);
23388 #if !CYTHON_USE_TP_FINALIZE 23389 assert(self->ob_refcnt > 0);
23390 if (--self->ob_refcnt == 0) {
23394 Py_ssize_t refcnt =
self->ob_refcnt;
23395 _Py_NewReference(
self);
23396 self->ob_refcnt = refcnt;
23398 #if CYTHON_COMPILING_IN_CPYTHON 23399 assert(PyType_IS_GC(self->ob_type) &&
23400 _Py_AS_GC(
self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
23403 #ifdef COUNT_ALLOCS 23404 --Py_TYPE(
self)->tp_frees;
23405 --Py_TYPE(
self)->tp_allocs;
23410 __Pyx_Coroutine_get_name(__pyx_CoroutineObject *
self, CYTHON_UNUSED
void *context)
23412 PyObject *name =
self->gi_name;
23413 if (unlikely(!name)) name = Py_None;
23418 __Pyx_Coroutine_set_name(__pyx_CoroutineObject *
self, PyObject *value, CYTHON_UNUSED
void *context)
23421 #if PY_MAJOR_VERSION >= 3 23422 if (unlikely(value == NULL || !PyUnicode_Check(value)))
23424 if (unlikely(value == NULL || !PyString_Check(value)))
23427 PyErr_SetString(PyExc_TypeError,
23428 "__name__ must be set to a string object");
23431 tmp =
self->gi_name;
23433 self->gi_name = value;
23438 __Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *
self, CYTHON_UNUSED
void *context)
23440 PyObject *name =
self->gi_qualname;
23441 if (unlikely(!name)) name = Py_None;
23446 __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *
self, PyObject *value, CYTHON_UNUSED
void *context)
23449 #if PY_MAJOR_VERSION >= 3 23450 if (unlikely(value == NULL || !PyUnicode_Check(value)))
23452 if (unlikely(value == NULL || !PyString_Check(value)))
23455 PyErr_SetString(PyExc_TypeError,
23456 "__qualname__ must be set to a string object");
23459 tmp =
self->gi_qualname;
23461 self->gi_qualname = value;
23465 static __pyx_CoroutineObject *__Pyx__Coroutine_New(
23466 PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
23467 PyObject *name, PyObject *qualname, PyObject *module_name) {
23468 __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
23469 if (unlikely(!gen))
23471 return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name);
23473 static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
23474 __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
23475 PyObject *name, PyObject *qualname, PyObject *module_name) {
23477 gen->closure = closure;
23478 Py_XINCREF(closure);
23479 gen->is_running = 0;
23480 gen->resume_label = 0;
23481 gen->classobj = NULL;
23482 gen->yieldfrom = NULL;
23483 gen->gi_exc_state.exc_type = NULL;
23484 gen->gi_exc_state.exc_value = NULL;
23485 gen->gi_exc_state.exc_traceback = NULL;
23486 #if CYTHON_USE_EXC_INFO_STACK 23487 gen->gi_exc_state.previous_item = NULL;
23489 gen->gi_weakreflist = NULL;
23490 Py_XINCREF(qualname);
23491 gen->gi_qualname = qualname;
23493 gen->gi_name = name;
23494 Py_XINCREF(module_name);
23495 gen->gi_modulename = module_name;
23497 gen->gi_code = code;
23498 PyObject_GC_Track(gen);
23503 static PyObject* __Pyx_Coroutine_patch_module(PyObject* module,
const char* py_code) {
23504 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) 23506 PyObject *globals, *result_obj;
23507 globals = PyDict_New();
if (unlikely(!globals))
goto ignore;
23508 result = PyDict_SetItemString(globals,
"_cython_coroutine_type",
23509 #ifdef __Pyx_Coroutine_USED
23510 (PyObject*)__pyx_CoroutineType);
23514 if (unlikely(result < 0))
goto ignore;
23515 result = PyDict_SetItemString(globals,
"_cython_generator_type",
23516 #ifdef __Pyx_Generator_USED
23517 (PyObject*)__pyx_GeneratorType);
23521 if (unlikely(result < 0))
goto ignore;
23522 if (unlikely(PyDict_SetItemString(globals,
"_module", module) < 0))
goto ignore;
23523 if (unlikely(PyDict_SetItemString(globals,
"__builtins__", __pyx_b) < 0))
goto ignore;
23524 result_obj = PyRun_String(py_code, Py_file_input, globals, globals);
23525 if (unlikely(!result_obj))
goto ignore;
23526 Py_DECREF(result_obj);
23527 Py_DECREF(globals);
23530 Py_XDECREF(globals);
23531 PyErr_WriteUnraisable(module);
23532 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
"Cython module failed to patch module with custom type", 1) < 0)) {
23543 #ifndef CYTHON_REGISTER_ABCS 23544 #define CYTHON_REGISTER_ABCS 1 23546 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) 23547 static PyObject* __Pyx_patch_abc_module(PyObject *module);
23548 static PyObject* __Pyx_patch_abc_module(PyObject *module) {
23549 module = __Pyx_Coroutine_patch_module(
23551 "if _cython_generator_type is not None:\n" 23552 " try: Generator = _module.Generator\n" 23553 " except AttributeError: pass\n" 23554 " else: Generator.register(_cython_generator_type)\n" 23555 "if _cython_coroutine_type is not None:\n" 23556 " try: Coroutine = _module.Coroutine\n" 23557 " except AttributeError: pass\n" 23558 " else: Coroutine.register(_cython_coroutine_type)\n" 23563 static int __Pyx_patch_abc(
void) {
23564 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) 23565 static int abc_patched = 0;
23566 if (CYTHON_REGISTER_ABCS && !abc_patched) {
23568 module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ?
"collections.abc" :
"collections");
23570 PyErr_WriteUnraisable(NULL);
23571 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
23572 ((PY_MAJOR_VERSION >= 3) ?
23573 "Cython module failed to register with collections.abc module" :
23574 "Cython module failed to register with collections module"), 1) < 0)) {
23578 module = __Pyx_patch_abc_module(module);
23580 if (unlikely(!module))
23584 module = PyImport_ImportModule(
"backports_abc");
23586 module = __Pyx_patch_abc_module(module);
23587 Py_XDECREF(module);
23594 if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL);
23600 static PyMethodDef __pyx_Generator_methods[] = {
23601 {
"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
23602 (
char*) PyDoc_STR(
"send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
23603 {
"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
23604 (
char*) PyDoc_STR(
"throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
23605 {
"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS,
23606 (
char*) PyDoc_STR(
"close() -> raise GeneratorExit inside generator.")},
23609 static PyMemberDef __pyx_Generator_memberlist[] = {
23610 {(
char *)
"gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL},
23611 {(
char*)
"gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
23612 (
char*) PyDoc_STR(
"object being iterated by 'yield from', or None")},
23613 {(
char*)
"gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
23616 static PyGetSetDef __pyx_Generator_getsets[] = {
23617 {(
char *)
"__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
23618 (
char*) PyDoc_STR(
"name of the generator"), 0},
23619 {(
char *)
"__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
23620 (
char*) PyDoc_STR(
"qualified name of the generator"), 0},
23623 static PyTypeObject __pyx_GeneratorType_type = {
23624 PyVarObject_HEAD_INIT(0, 0)
23626 sizeof(__pyx_CoroutineObject),
23628 (destructor) __Pyx_Coroutine_dealloc,
23643 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
23645 (traverseproc) __Pyx_Coroutine_traverse,
23648 offsetof(__pyx_CoroutineObject, gi_weakreflist),
23650 (iternextfunc) __Pyx_Generator_Next,
23651 __pyx_Generator_methods,
23652 __pyx_Generator_memberlist,
23653 __pyx_Generator_getsets,
23669 #
if CYTHON_USE_TP_FINALIZE
23672 __Pyx_Coroutine_del,
23675 #
if CYTHON_USE_TP_FINALIZE
23676 __Pyx_Coroutine_del,
23677 #elif PY_VERSION_HEX >= 0x030400a1
23681 static int __pyx_Generator_init(
void) {
23682 __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
23683 __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
23684 __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
23685 if (unlikely(!__pyx_GeneratorType)) {
23692 static int __Pyx_check_binary_version(
void) {
23693 char ctversion[4], rtversion[4];
23694 PyOS_snprintf(ctversion, 4,
"%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
23695 PyOS_snprintf(rtversion, 4,
"%s", Py_GetVersion());
23696 if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
23698 PyOS_snprintf(message,
sizeof(message),
23699 "compiletime version %s of module '%.100s' " 23700 "does not match runtime version %s",
23701 ctversion, __Pyx_MODULE_NAME, rtversion);
23702 return PyErr_WarnEx(NULL, message, 1);
23708 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
23710 #if PY_MAJOR_VERSION < 3 23711 if (t->is_unicode) {
23712 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
23713 }
else if (t->intern) {
23714 *t->p = PyString_InternFromString(t->s);
23716 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
23719 if (t->is_unicode | t->is_str) {
23721 *t->p = PyUnicode_InternFromString(t->s);
23722 }
else if (t->encoding) {
23723 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
23725 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
23728 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
23733 if (PyObject_Hash(*t->p) == -1)
23740 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
23741 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
23743 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
23745 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
23747 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 23748 #if !CYTHON_PEP393_ENABLED 23749 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
23751 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
23752 if (!defenc)
return NULL;
23753 defenc_c = PyBytes_AS_STRING(defenc);
23754 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 23756 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
23758 for (c = defenc_c; c < end; c++) {
23759 if ((
unsigned char) (*c) >= 128) {
23760 PyUnicode_AsASCIIString(o);
23766 *length = PyBytes_GET_SIZE(defenc);
23770 static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
23771 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
23772 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 23773 if (likely(PyUnicode_IS_ASCII(o))) {
23774 *length = PyUnicode_GET_LENGTH(o);
23775 return PyUnicode_AsUTF8(o);
23777 PyUnicode_AsASCIIString(o);
23781 return PyUnicode_AsUTF8AndSize(o, length);
23786 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
23787 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 23789 #
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
23790 __Pyx_sys_getdefaultencoding_not_ascii &&
23792 PyUnicode_Check(o)) {
23793 return __Pyx_PyUnicode_AsStringAndSize(o, length);
23796 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) 23797 if (PyByteArray_Check(o)) {
23798 *length = PyByteArray_GET_SIZE(o);
23799 return PyByteArray_AS_STRING(o);
23804 int r = PyBytes_AsStringAndSize(o, &result, length);
23805 if (unlikely(r < 0)) {
23812 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
23813 int is_true = x == Py_True;
23814 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
23815 else return PyObject_IsTrue(x);
23817 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
23819 if (unlikely(!x))
return -1;
23820 retval = __Pyx_PyObject_IsTrue(x);
23824 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result,
const char* type_name) {
23825 #if PY_MAJOR_VERSION >= 3 23826 if (PyLong_Check(result)) {
23827 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
23828 "__int__ returned non-int (type %.200s). " 23829 "The ability to return an instance of a strict subclass of int " 23830 "is deprecated, and may be removed in a future version of Python.",
23831 Py_TYPE(result)->tp_name)) {
23838 PyErr_Format(PyExc_TypeError,
23839 "__%.4s__ returned non-%.4s (type %.200s)",
23840 type_name, type_name, Py_TYPE(result)->tp_name);
23844 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
23845 #if CYTHON_USE_TYPE_SLOTS 23846 PyNumberMethods *m;
23848 const char *name = NULL;
23849 PyObject *res = NULL;
23850 #if PY_MAJOR_VERSION < 3 23851 if (likely(PyInt_Check(x) || PyLong_Check(x)))
23853 if (likely(PyLong_Check(x)))
23855 return __Pyx_NewRef(x);
23856 #if CYTHON_USE_TYPE_SLOTS 23857 m = Py_TYPE(x)->tp_as_number;
23858 #if PY_MAJOR_VERSION < 3 23859 if (m && m->nb_int) {
23861 res = m->nb_int(x);
23863 else if (m && m->nb_long) {
23865 res = m->nb_long(x);
23868 if (likely(m && m->nb_int)) {
23870 res = m->nb_int(x);
23874 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
23875 res = PyNumber_Int(x);
23879 #if PY_MAJOR_VERSION < 3 23880 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
23882 if (unlikely(!PyLong_CheckExact(res))) {
23884 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
23887 else if (!PyErr_Occurred()) {
23888 PyErr_SetString(PyExc_TypeError,
23889 "an integer is required");
23893 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
23896 #if PY_MAJOR_VERSION < 3 23897 if (likely(PyInt_CheckExact(b))) {
23898 if (
sizeof(Py_ssize_t) >=
sizeof(
long))
23899 return PyInt_AS_LONG(b);
23901 return PyInt_AsSsize_t(b);
23904 if (likely(PyLong_CheckExact(b))) {
23905 #if CYTHON_USE_PYLONG_INTERNALS 23906 const digit* digits = ((PyLongObject*)b)->ob_digit;
23907 const Py_ssize_t size = Py_SIZE(b);
23908 if (likely(__Pyx_sst_abs(size) <= 1)) {
23909 ival = likely(size) ? digits[0] : 0;
23910 if (size == -1) ival = -ival;
23915 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
23916 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
23920 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
23921 return -(Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
23925 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
23926 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
23930 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
23931 return -(Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
23935 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
23936 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]));
23940 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
23941 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]));
23947 return PyLong_AsSsize_t(b);
23949 x = PyNumber_Index(b);
23951 ival = PyInt_AsSsize_t(x);
23955 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
23956 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
23958 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
23959 return PyInt_FromSize_t(ival);
int compare(const index_set< LO, HI > &a, const index_set< LO, HI > &b)
"lexicographic compare" eg. {3,4,5} is less than {3,7,8}
const Multivector< Scalar_T, LO, HI > sqrt(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Square root of multivector with specified complexifier.
String clifford_to_str(const Multivector_T &mv)
The "informal" string representation of Multivector_T mv.
const Multivector< Scalar_T, LO, HI > acosh(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Inverse hyperbolic cosine of multivector with specified complexifier.
String index_set_to_repr(const Index_Set_T &ist)
The “official” string representation of Index_Set_T ist.
const Multivector< Scalar_T, LO, HI > sinh(const Multivector< Scalar_T, LO, HI > &val)
Hyperbolic sine of multivector.
index_set< lo_ndx, hi_ndx > IndexSet
Scalar_T abs(const Multivector< Scalar_T, LO, HI > &val)
Absolute value == sqrt(norm)
const Multivector< Scalar_T, LO, HI > log(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Natural logarithm of multivector with specified complexifier.
String clifford_to_repr(const Multivector_T &mv)
The “official” string representation of Multivector_T mv.
Multivector_T cga3(const Multivector_T &x)
Convert Euclidean 3D vector to Conformal Geometric Algebra null vector [DL (10.50)].
const Multivector< Scalar_T, LO, HI > sin(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Sine of multivector with specified complexifier.
const Multivector< Scalar_T, LO, HI > atanh(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Inverse hyperbolic tangent of multivector with specified complexifier.
const framed_multi< Scalar_T, LO, HI > exp(const framed_multi< Scalar_T, LO, HI > &val)
Exponential of multivector.
const Multivector< Scalar_T, LO, HI > cos(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Cosine of multivector with specified complexifier.
const Multivector< Scalar_T, LO, HI > tanh(const Multivector< Scalar_T, LO, HI > &val)
Hyperbolic tangent of multivector.
index_t min_neg(const index_set< LO, HI > &ist)
Minimum negative index, or 0 if none.
const Multivector< Scalar_T, LO, HI > asin(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Inverse sine of multivector with specified complexifier.
const Multivector< Scalar_T, LO, HI > operator &(const Multivector< Scalar_T, LO, HI > &lhs, const RHS< Scalar_T, LO, HI > &rhs)
Inner product.
matrix_multi< scalar_t > Clifford
const Multivector< Scalar_T, LO, HI > complexifier(const Multivector< Scalar_T, LO, HI > &val)
Square root of -1 which commutes with all members of the frame of the given multivector.
PyObject * PyFloat_FromDouble(Scalar_T v)
const Multivector< Scalar_T, LO, HI > atan(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Inverse tangent of multivector with specified complexifier.
const Multivector< Scalar_T, LO, HI > tan(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Tangent of multivector with specified complexifier.
const Multivector< Scalar_T, LO, HI > acos(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Inverse cosine of multivector with specified complexifier.
String index_set_to_str(const Index_Set_T &ist)
The "informal" string representation of Index_Set_T ist.
index_t max_pos(const index_set< LO, HI > &ist)
Maximum positive index, or 0 if none.
const Multivector< Scalar_T, LO, HI > asinh(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Inverse hyperbolic sine of multivector with specified complexifier.
Scalar_T max_abs(const Multivector< Scalar_T, LO, HI > &val)
Maximum of absolute values of components of multivector: multivector infinity norm.
const Multivector< Scalar_T, LO, HI > cosh(const Multivector< Scalar_T, LO, HI > &val)
Hyperbolic cosine of multivector.
Multivector_T cga3std(const Multivector_T &X)
Convert CGA3 null vector to standard Conformal Geometric Algebra null vector [DL (10....
Multivector_T agc3(const Multivector_T &X)
Convert CGA3 null vector to Euclidean 3D vector [DL (10.50)].