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_27_3" 64 #define CYTHON_FUTURE_DIVISION 0 67 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) 69 #if !defined(WIN32) && !defined(MS_WINDOWS) 81 #define DL_IMPORT(t) t 84 #define DL_EXPORT(t) t 87 #ifndef HAVE_LONG_LONG 88 #if PY_VERSION_HEX >= 0x02070000 89 #define HAVE_LONG_LONG 93 #define PY_LONG_LONG LONG_LONG 96 #define Py_HUGE_VAL HUGE_VAL 99 #define CYTHON_COMPILING_IN_PYPY 1 100 #define CYTHON_COMPILING_IN_PYSTON 0 101 #define CYTHON_COMPILING_IN_CPYTHON 0 102 #undef CYTHON_USE_TYPE_SLOTS 103 #define CYTHON_USE_TYPE_SLOTS 0 104 #undef CYTHON_USE_PYTYPE_LOOKUP 105 #define CYTHON_USE_PYTYPE_LOOKUP 0 106 #if PY_VERSION_HEX < 0x03050000 107 #undef CYTHON_USE_ASYNC_SLOTS 108 #define CYTHON_USE_ASYNC_SLOTS 0 109 #elif !defined(CYTHON_USE_ASYNC_SLOTS) 110 #define CYTHON_USE_ASYNC_SLOTS 1 112 #undef CYTHON_USE_PYLIST_INTERNALS 113 #define CYTHON_USE_PYLIST_INTERNALS 0 114 #undef CYTHON_USE_UNICODE_INTERNALS 115 #define CYTHON_USE_UNICODE_INTERNALS 0 116 #undef CYTHON_USE_UNICODE_WRITER 117 #define CYTHON_USE_UNICODE_WRITER 0 118 #undef CYTHON_USE_PYLONG_INTERNALS 119 #define CYTHON_USE_PYLONG_INTERNALS 0 120 #undef CYTHON_AVOID_BORROWED_REFS 121 #define CYTHON_AVOID_BORROWED_REFS 1 122 #undef CYTHON_ASSUME_SAFE_MACROS 123 #define CYTHON_ASSUME_SAFE_MACROS 0 124 #undef CYTHON_UNPACK_METHODS 125 #define CYTHON_UNPACK_METHODS 0 126 #undef CYTHON_FAST_THREAD_STATE 127 #define CYTHON_FAST_THREAD_STATE 0 128 #undef CYTHON_FAST_PYCALL 129 #define CYTHON_FAST_PYCALL 0 130 #undef CYTHON_PEP489_MULTI_PHASE_INIT 131 #define CYTHON_PEP489_MULTI_PHASE_INIT 0 132 #undef CYTHON_USE_TP_FINALIZE 133 #define CYTHON_USE_TP_FINALIZE 0 134 #elif defined(PYSTON_VERSION) 135 #define CYTHON_COMPILING_IN_PYPY 0 136 #define CYTHON_COMPILING_IN_PYSTON 1 137 #define CYTHON_COMPILING_IN_CPYTHON 0 138 #ifndef CYTHON_USE_TYPE_SLOTS 139 #define CYTHON_USE_TYPE_SLOTS 1 141 #undef CYTHON_USE_PYTYPE_LOOKUP 142 #define CYTHON_USE_PYTYPE_LOOKUP 0 143 #undef CYTHON_USE_ASYNC_SLOTS 144 #define CYTHON_USE_ASYNC_SLOTS 0 145 #undef CYTHON_USE_PYLIST_INTERNALS 146 #define CYTHON_USE_PYLIST_INTERNALS 0 147 #ifndef CYTHON_USE_UNICODE_INTERNALS 148 #define CYTHON_USE_UNICODE_INTERNALS 1 150 #undef CYTHON_USE_UNICODE_WRITER 151 #define CYTHON_USE_UNICODE_WRITER 0 152 #undef CYTHON_USE_PYLONG_INTERNALS 153 #define CYTHON_USE_PYLONG_INTERNALS 0 154 #ifndef CYTHON_AVOID_BORROWED_REFS 155 #define CYTHON_AVOID_BORROWED_REFS 0 157 #ifndef CYTHON_ASSUME_SAFE_MACROS 158 #define CYTHON_ASSUME_SAFE_MACROS 1 160 #ifndef CYTHON_UNPACK_METHODS 161 #define CYTHON_UNPACK_METHODS 1 163 #undef CYTHON_FAST_THREAD_STATE 164 #define CYTHON_FAST_THREAD_STATE 0 165 #undef CYTHON_FAST_PYCALL 166 #define CYTHON_FAST_PYCALL 0 167 #undef CYTHON_PEP489_MULTI_PHASE_INIT 168 #define CYTHON_PEP489_MULTI_PHASE_INIT 0 169 #undef CYTHON_USE_TP_FINALIZE 170 #define CYTHON_USE_TP_FINALIZE 0 172 #define CYTHON_COMPILING_IN_PYPY 0 173 #define CYTHON_COMPILING_IN_PYSTON 0 174 #define CYTHON_COMPILING_IN_CPYTHON 1 175 #ifndef CYTHON_USE_TYPE_SLOTS 176 #define CYTHON_USE_TYPE_SLOTS 1 178 #if PY_VERSION_HEX < 0x02070000 179 #undef CYTHON_USE_PYTYPE_LOOKUP 180 #define CYTHON_USE_PYTYPE_LOOKUP 0 181 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) 182 #define CYTHON_USE_PYTYPE_LOOKUP 1 184 #if PY_MAJOR_VERSION < 3 185 #undef CYTHON_USE_ASYNC_SLOTS 186 #define CYTHON_USE_ASYNC_SLOTS 0 187 #elif !defined(CYTHON_USE_ASYNC_SLOTS) 188 #define CYTHON_USE_ASYNC_SLOTS 1 190 #if PY_VERSION_HEX < 0x02070000 191 #undef CYTHON_USE_PYLONG_INTERNALS 192 #define CYTHON_USE_PYLONG_INTERNALS 0 193 #elif !defined(CYTHON_USE_PYLONG_INTERNALS) 194 #define CYTHON_USE_PYLONG_INTERNALS 1 196 #ifndef CYTHON_USE_PYLIST_INTERNALS 197 #define CYTHON_USE_PYLIST_INTERNALS 1 199 #ifndef CYTHON_USE_UNICODE_INTERNALS 200 #define CYTHON_USE_UNICODE_INTERNALS 1 202 #if PY_VERSION_HEX < 0x030300F0 203 #undef CYTHON_USE_UNICODE_WRITER 204 #define CYTHON_USE_UNICODE_WRITER 0 205 #elif !defined(CYTHON_USE_UNICODE_WRITER) 206 #define CYTHON_USE_UNICODE_WRITER 1 208 #ifndef CYTHON_AVOID_BORROWED_REFS 209 #define CYTHON_AVOID_BORROWED_REFS 0 211 #ifndef CYTHON_ASSUME_SAFE_MACROS 212 #define CYTHON_ASSUME_SAFE_MACROS 1 214 #ifndef CYTHON_UNPACK_METHODS 215 #define CYTHON_UNPACK_METHODS 1 217 #ifndef CYTHON_FAST_THREAD_STATE 218 #define CYTHON_FAST_THREAD_STATE 1 220 #ifndef CYTHON_FAST_PYCALL 221 #define CYTHON_FAST_PYCALL 1 223 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT 224 #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000) 226 #ifndef CYTHON_USE_TP_FINALIZE 227 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) 230 #if !defined(CYTHON_FAST_PYCCALL) 231 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) 233 #if CYTHON_USE_PYLONG_INTERNALS 234 #include "longintrepr.h" 239 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) 240 #define Py_OptimizeFlag 0 242 #define __PYX_BUILD_PY_SSIZE_T "n" 243 #define CYTHON_FORMAT_SSIZE_T "z" 244 #if PY_MAJOR_VERSION < 3 245 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" 246 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ 247 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) 248 #define __Pyx_DefaultClassType PyClass_Type 250 #define __Pyx_BUILTIN_MODULE_NAME "builtins" 251 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ 252 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) 253 #define __Pyx_DefaultClassType PyType_Type 255 #ifndef Py_TPFLAGS_CHECKTYPES 256 #define Py_TPFLAGS_CHECKTYPES 0 258 #ifndef Py_TPFLAGS_HAVE_INDEX 259 #define Py_TPFLAGS_HAVE_INDEX 0 261 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER 262 #define Py_TPFLAGS_HAVE_NEWBUFFER 0 264 #ifndef Py_TPFLAGS_HAVE_FINALIZE 265 #define Py_TPFLAGS_HAVE_FINALIZE 0 267 #if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) 268 #ifndef METH_FASTCALL 269 #define METH_FASTCALL 0x80 271 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *
self, PyObject **args, Py_ssize_t nargs);
272 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *
self, PyObject **args,
273 Py_ssize_t nargs, PyObject *kwnames);
275 #define __Pyx_PyCFunctionFast _PyCFunctionFast 276 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords 278 #if CYTHON_FAST_PYCCALL 279 #define __Pyx_PyFastCFunction_Check(func)\ 280 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS))))) 282 #define __Pyx_PyFastCFunction_Check(func) 0 284 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 285 #define __Pyx_PyThreadState_Current PyThreadState_GET() 286 #elif PY_VERSION_HEX >= 0x03060000 287 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() 288 #elif PY_VERSION_HEX >= 0x03000000 289 #define __Pyx_PyThreadState_Current PyThreadState_GET() 291 #define __Pyx_PyThreadState_Current _PyThreadState_Current 293 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) 294 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) 296 #define __Pyx_PyDict_NewPresized(n) PyDict_New() 298 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION 299 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) 300 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) 302 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) 303 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) 305 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) 306 #define CYTHON_PEP393_ENABLED 1 307 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 308 0 : _PyUnicode_Ready((PyObject *)(op))) 309 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) 310 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) 311 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) 312 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) 313 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) 314 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) 315 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) 316 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) 318 #define CYTHON_PEP393_ENABLED 0 319 #define PyUnicode_1BYTE_KIND 1 320 #define PyUnicode_2BYTE_KIND 2 321 #define PyUnicode_4BYTE_KIND 4 322 #define __Pyx_PyUnicode_READY(op) (0) 323 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) 324 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) 325 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) 326 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) 327 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) 328 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) 329 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) 330 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) 332 #if CYTHON_COMPILING_IN_PYPY 333 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) 334 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) 336 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) 337 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ 338 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) 340 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) 341 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) 343 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) 344 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) 346 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) 347 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) 349 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) 350 #define PyObject_Malloc(s) PyMem_Malloc(s) 351 #define PyObject_Free(p) PyMem_Free(p) 352 #define PyObject_Realloc(p) PyMem_Realloc(p) 354 #if CYTHON_COMPILING_IN_PYSTON 355 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) 356 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) 358 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) 359 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) 361 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) 362 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) 363 #if PY_MAJOR_VERSION >= 3 364 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) 366 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) 368 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) 369 #define PyObject_ASCII(o) PyObject_Repr(o) 371 #if PY_MAJOR_VERSION >= 3 372 #define PyBaseString_Type PyUnicode_Type 373 #define PyStringObject PyUnicodeObject 374 #define PyString_Type PyUnicode_Type 375 #define PyString_Check PyUnicode_Check 376 #define PyString_CheckExact PyUnicode_CheckExact 378 #if PY_MAJOR_VERSION >= 3 379 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) 380 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) 382 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) 383 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) 385 #ifndef PySet_CheckExact 386 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) 388 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) 389 #if PY_MAJOR_VERSION >= 3 390 #define PyIntObject PyLongObject 391 #define PyInt_Type PyLong_Type 392 #define PyInt_Check(op) PyLong_Check(op) 393 #define PyInt_CheckExact(op) PyLong_CheckExact(op) 394 #define PyInt_FromString PyLong_FromString 395 #define PyInt_FromUnicode PyLong_FromUnicode 396 #define PyInt_FromLong PyLong_FromLong 397 #define PyInt_FromSize_t PyLong_FromSize_t 398 #define PyInt_FromSsize_t PyLong_FromSsize_t 399 #define PyInt_AsLong PyLong_AsLong 400 #define PyInt_AS_LONG PyLong_AS_LONG 401 #define PyInt_AsSsize_t PyLong_AsSsize_t 402 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask 403 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask 404 #define PyNumber_Int PyNumber_Long 406 #if PY_MAJOR_VERSION >= 3 407 #define PyBoolObject PyLongObject 409 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY 410 #ifndef PyUnicode_InternFromString 411 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) 414 #if PY_VERSION_HEX < 0x030200A4 415 typedef long Py_hash_t;
416 #define __Pyx_PyInt_FromHash_t PyInt_FromLong 417 #define __Pyx_PyInt_AsHash_t PyInt_AsLong 419 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t 420 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t 422 #if PY_MAJOR_VERSION >= 3 423 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) 425 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) 427 #ifndef __has_attribute 428 #define __has_attribute(x) 0 430 #ifndef __has_cpp_attribute 431 #define __has_cpp_attribute(x) 0 433 #if CYTHON_USE_ASYNC_SLOTS 434 #if PY_VERSION_HEX >= 0x030500B1 435 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods 436 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) 438 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) 441 #define __Pyx_PyType_AsAsync(obj) NULL 443 #ifndef __Pyx_PyAsyncMethodsStruct 448 } __Pyx_PyAsyncMethodsStruct;
450 #ifndef CYTHON_RESTRICT 451 #if defined(__GNUC__) 452 #define CYTHON_RESTRICT __restrict__ 453 #elif defined(_MSC_VER) && _MSC_VER >= 1400 454 #define CYTHON_RESTRICT __restrict 455 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 456 #define CYTHON_RESTRICT restrict 458 #define CYTHON_RESTRICT 461 #ifndef CYTHON_UNUSED 462 # if defined(__GNUC__) 463 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) 464 # define CYTHON_UNUSED __attribute__ ((__unused__)) 466 # define CYTHON_UNUSED 468 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) 469 # define CYTHON_UNUSED __attribute__ ((__unused__)) 471 # define CYTHON_UNUSED 474 #ifndef CYTHON_MAYBE_UNUSED_VAR 475 # if defined(__cplusplus) 476 template<
class T>
void CYTHON_MAYBE_UNUSED_VAR(
const T& ) { }
478 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) 481 #ifndef CYTHON_NCP_UNUSED 482 # if CYTHON_COMPILING_IN_CPYTHON 483 # define CYTHON_NCP_UNUSED 485 # define CYTHON_NCP_UNUSED CYTHON_UNUSED 488 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) 490 #ifndef _MSC_STDINT_H_ 492 typedef unsigned char uint8_t;
493 typedef unsigned int uint32_t;
495 typedef unsigned __int8 uint8_t;
496 typedef unsigned __int32 uint32_t;
502 #ifndef CYTHON_FALLTHROUGH 503 #if defined(__cplusplus) && __cplusplus >= 201103L 504 #if __has_cpp_attribute(fallthrough) 505 #define CYTHON_FALLTHROUGH [[fallthrough]] 506 #elif __has_cpp_attribute(clang::fallthrough) 507 #define CYTHON_FALLTHROUGH [[clang::fallthrough]] 508 #elif __has_cpp_attribute(gnu::fallthrough) 509 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] 512 #ifndef CYTHON_FALLTHROUGH 513 #if __has_attribute(fallthrough) 514 #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) 516 #define CYTHON_FALLTHROUGH 519 #if defined(__clang__ ) && defined(__apple_build_version__) 520 #if __apple_build_version__ < 7000000 521 #undef CYTHON_FALLTHROUGH 522 #define CYTHON_FALLTHROUGH 528 #error "Cython files generated with the C++ option must be compiled with a C++ compiler." 530 #ifndef CYTHON_INLINE 531 #if defined(__clang__) 532 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) 534 #define CYTHON_INLINE inline 538 void __Pyx_call_destructor(T& x) {
542 class __Pyx_FakeReference {
544 __Pyx_FakeReference() : ptr(NULL) { }
545 __Pyx_FakeReference(
const T& ref) : ptr(const_cast<T*>(&ref)) { }
546 T *operator->() {
return ptr; }
548 operator T&() {
return *ptr; }
549 template<
typename U>
bool operator ==(U other) {
return *ptr == other; }
550 template<
typename U>
bool operator !=(U other) {
return *ptr != other; }
555 #if defined(WIN32) || defined(MS_WINDOWS) 556 #define _USE_MATH_DEFINES 560 #define __PYX_NAN() ((float) NAN) 562 static CYTHON_INLINE
float __PYX_NAN() {
564 memset(&value, 0xFF,
sizeof(value));
568 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) 569 #define __Pyx_truncl trunc 571 #define __Pyx_truncl truncl 575 #define __PYX_ERR(f_index, lineno, Ln_error) \ 577 __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ 580 #ifndef __PYX_EXTERN_C 582 #define __PYX_EXTERN_C extern "C" 584 #define __PYX_EXTERN_C extern 588 #define __PYX_HAVE__PyClical 589 #define __PYX_HAVE_API__PyClical 600 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) 601 #define CYTHON_WITHOUT_ASSERTIONS 604 typedef struct {PyObject **p;
const char *s;
const Py_ssize_t n;
const char* encoding;
605 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
607 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 608 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 609 #define __PYX_DEFAULT_STRING_ENCODING "" 610 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString 611 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize 612 #define __Pyx_uchar_cast(c) ((unsigned char)c) 613 #define __Pyx_long_cast(x) ((long)x) 614 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ 615 (sizeof(type) < sizeof(Py_ssize_t)) ||\ 616 (sizeof(type) > sizeof(Py_ssize_t) &&\ 617 likely(v < (type)PY_SSIZE_T_MAX ||\ 618 v == (type)PY_SSIZE_T_MAX) &&\ 619 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ 620 v == (type)PY_SSIZE_T_MIN))) ||\ 621 (sizeof(type) == sizeof(Py_ssize_t) &&\ 622 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ 623 v == (type)PY_SSIZE_T_MAX))) ) 624 #if defined (__cplusplus) && __cplusplus >= 201103L 626 #define __Pyx_sst_abs(value) std::abs(value) 627 #elif SIZEOF_INT >= SIZEOF_SIZE_T 628 #define __Pyx_sst_abs(value) abs(value) 629 #elif SIZEOF_LONG >= SIZEOF_SIZE_T 630 #define __Pyx_sst_abs(value) labs(value) 631 #elif defined (_MSC_VER) 632 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) 633 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 634 #define __Pyx_sst_abs(value) llabs(value) 635 #elif defined (__GNUC__) 636 #define __Pyx_sst_abs(value) __builtin_llabs(value) 638 #define __Pyx_sst_abs(value) ((value<0) ? -value : value) 640 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
641 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
642 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) 643 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) 644 #define __Pyx_PyBytes_FromString PyBytes_FromString 645 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize 646 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
647 #if PY_MAJOR_VERSION < 3 648 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString 649 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize 651 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString 652 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize 654 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) 655 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) 656 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) 657 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) 658 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) 659 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) 660 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) 661 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) 662 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) 663 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) 664 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) 665 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) 666 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) 667 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) 668 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) 669 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) 670 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *u) {
671 const Py_UNICODE *u_end = u;
673 return (
size_t)(u_end - u - 1);
675 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) 676 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode 677 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode 678 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) 679 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) 680 #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) 681 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
682 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
683 #define __Pyx_PySequence_Tuple(obj)\ 684 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) 685 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
686 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
687 #if CYTHON_ASSUME_SAFE_MACROS 688 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) 690 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) 692 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) 693 #if PY_MAJOR_VERSION >= 3 694 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) 696 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) 698 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) 699 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 700 static int __Pyx_sys_getdefaultencoding_not_ascii;
701 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
703 PyObject* default_encoding = NULL;
704 PyObject* ascii_chars_u = NULL;
705 PyObject* ascii_chars_b = NULL;
706 const char* default_encoding_c;
707 sys = PyImport_ImportModule(
"sys");
709 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
711 if (!default_encoding)
goto bad;
712 default_encoding_c = PyBytes_AsString(default_encoding);
713 if (!default_encoding_c)
goto bad;
714 if (strcmp(default_encoding_c,
"ascii") == 0) {
715 __Pyx_sys_getdefaultencoding_not_ascii = 0;
717 char ascii_chars[128];
719 for (c = 0; c < 128; c++) {
722 __Pyx_sys_getdefaultencoding_not_ascii = 1;
723 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
724 if (!ascii_chars_u)
goto bad;
725 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
726 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
729 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
733 Py_DECREF(ascii_chars_u);
734 Py_DECREF(ascii_chars_b);
736 Py_DECREF(default_encoding);
739 Py_XDECREF(default_encoding);
740 Py_XDECREF(ascii_chars_u);
741 Py_XDECREF(ascii_chars_b);
745 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 746 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) 748 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) 749 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 750 static char* __PYX_DEFAULT_STRING_ENCODING;
751 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
753 PyObject* default_encoding = NULL;
754 char* default_encoding_c;
755 sys = PyImport_ImportModule(
"sys");
757 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
759 if (!default_encoding)
goto bad;
760 default_encoding_c = PyBytes_AsString(default_encoding);
761 if (!default_encoding_c)
goto bad;
762 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c));
763 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
764 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
765 Py_DECREF(default_encoding);
768 Py_XDECREF(default_encoding);
776 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) 777 #define likely(x) __builtin_expect(!!(x), 1) 778 #define unlikely(x) __builtin_expect(!!(x), 0) 780 #define likely(x) (x) 781 #define unlikely(x) (x) 783 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
785 static PyObject *__pyx_m = NULL;
786 static PyObject *__pyx_d;
787 static PyObject *__pyx_b;
788 static PyObject *__pyx_cython_runtime;
789 static PyObject *__pyx_empty_tuple;
790 static PyObject *__pyx_empty_bytes;
791 static PyObject *__pyx_empty_unicode;
792 static int __pyx_lineno;
793 static int __pyx_clineno = 0;
794 static const char * __pyx_cfilenm= __FILE__;
795 static const char *__pyx_filename;
798 static const char *__pyx_f[] = {
804 struct __pyx_obj_8PyClical_index_set;
805 struct __pyx_obj_8PyClical_clifford;
806 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__;
807 struct __pyx_opt_args_8PyClical_sqrt;
808 struct __pyx_opt_args_8PyClical_log;
809 struct __pyx_opt_args_8PyClical_cos;
810 struct __pyx_opt_args_8PyClical_acos;
811 struct __pyx_opt_args_8PyClical_acosh;
812 struct __pyx_opt_args_8PyClical_sin;
813 struct __pyx_opt_args_8PyClical_asin;
814 struct __pyx_opt_args_8PyClical_asinh;
815 struct __pyx_opt_args_8PyClical_tan;
816 struct __pyx_opt_args_8PyClical_atan;
817 struct __pyx_opt_args_8PyClical_atanh;
818 struct __pyx_opt_args_8PyClical_random_clifford;
827 struct __pyx_opt_args_8PyClical_sqrt {
839 struct __pyx_opt_args_8PyClical_log {
851 struct __pyx_opt_args_8PyClical_cos {
863 struct __pyx_opt_args_8PyClical_acos {
875 struct __pyx_opt_args_8PyClical_acosh {
887 struct __pyx_opt_args_8PyClical_sin {
899 struct __pyx_opt_args_8PyClical_asin {
911 struct __pyx_opt_args_8PyClical_asinh {
923 struct __pyx_opt_args_8PyClical_tan {
935 struct __pyx_opt_args_8PyClical_atan {
947 struct __pyx_opt_args_8PyClical_atanh {
959 struct __pyx_opt_args_8PyClical_random_clifford {
971 struct __pyx_obj_8PyClical_index_set {
973 struct __pyx_vtabstruct_8PyClical_index_set *__pyx_vtab;
985 struct __pyx_obj_8PyClical_clifford {
987 struct __pyx_vtabstruct_8PyClical_clifford *__pyx_vtab;
999 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ {
1001 PyObject *__pyx_v_idx;
1002 struct __pyx_obj_8PyClical_index_set *__pyx_v_self;
1003 PyObject *__pyx_t_0;
1004 Py_ssize_t __pyx_t_1;
1005 PyObject *(*__pyx_t_2)(PyObject *);
1018 struct __pyx_vtabstruct_8PyClical_index_set {
1019 PyObject *(*wrap)(
struct __pyx_obj_8PyClical_index_set *,
IndexSet);
1020 IndexSet (*unwrap)(
struct __pyx_obj_8PyClical_index_set *);
1021 PyObject *(*copy)(
struct __pyx_obj_8PyClical_index_set *,
int __pyx_skip_dispatch);
1023 static struct __pyx_vtabstruct_8PyClical_index_set *__pyx_vtabptr_8PyClical_index_set;
1024 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_9index_set_wrap(
struct __pyx_obj_8PyClical_index_set *,
IndexSet);
1025 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_9index_set_unwrap(
struct __pyx_obj_8PyClical_index_set *);
1036 struct __pyx_vtabstruct_8PyClical_clifford {
1037 PyObject *(*wrap)(
struct __pyx_obj_8PyClical_clifford *,
Clifford);
1038 Clifford (*unwrap)(
struct __pyx_obj_8PyClical_clifford *);
1039 PyObject *(*copy)(
struct __pyx_obj_8PyClical_clifford *,
int __pyx_skip_dispatch);
1041 static struct __pyx_vtabstruct_8PyClical_clifford *__pyx_vtabptr_8PyClical_clifford;
1042 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_8clifford_wrap(
struct __pyx_obj_8PyClical_clifford *,
Clifford);
1043 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_8clifford_unwrap(
struct __pyx_obj_8PyClical_clifford *);
1047 #ifndef CYTHON_REFNANNY 1048 #define CYTHON_REFNANNY 0 1052 void (*INCREF)(
void*, PyObject*, int);
1053 void (*DECREF)(
void*, PyObject*, int);
1054 void (*GOTREF)(
void*, PyObject*, int);
1055 void (*GIVEREF)(
void*, PyObject*, int);
1056 void* (*SetupContext)(
const char*, int,
const char*);
1057 void (*FinishContext)(
void**);
1058 } __Pyx_RefNannyAPIStruct;
1059 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1060 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1061 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; 1063 #define __Pyx_RefNannySetupContext(name, acquire_gil)\ 1065 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ 1066 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ 1067 PyGILState_Release(__pyx_gilstate_save);\ 1069 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ 1072 #define __Pyx_RefNannySetupContext(name, acquire_gil)\ 1073 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) 1075 #define __Pyx_RefNannyFinishContext()\ 1076 __Pyx_RefNanny->FinishContext(&__pyx_refnanny) 1077 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1078 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1079 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1080 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1081 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) 1082 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) 1083 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) 1084 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) 1086 #define __Pyx_RefNannyDeclarations 1087 #define __Pyx_RefNannySetupContext(name, acquire_gil) 1088 #define __Pyx_RefNannyFinishContext() 1089 #define __Pyx_INCREF(r) Py_INCREF(r) 1090 #define __Pyx_DECREF(r) Py_DECREF(r) 1091 #define __Pyx_GOTREF(r) 1092 #define __Pyx_GIVEREF(r) 1093 #define __Pyx_XINCREF(r) Py_XINCREF(r) 1094 #define __Pyx_XDECREF(r) Py_XDECREF(r) 1095 #define __Pyx_XGOTREF(r) 1096 #define __Pyx_XGIVEREF(r) 1098 #define __Pyx_XDECREF_SET(r, v) do {\ 1099 PyObject *tmp = (PyObject *) r;\ 1100 r = v; __Pyx_XDECREF(tmp);\ 1102 #define __Pyx_DECREF_SET(r, v) do {\ 1103 PyObject *tmp = (PyObject *) r;\ 1104 r = v; __Pyx_DECREF(tmp);\ 1106 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) 1107 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) 1110 #if CYTHON_USE_TYPE_SLOTS 1111 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject*
obj, PyObject* attr_name) {
1112 PyTypeObject* tp = Py_TYPE(
obj);
1113 if (likely(tp->tp_getattro))
1114 return tp->tp_getattro(
obj, attr_name);
1115 #if PY_MAJOR_VERSION < 3 1116 if (likely(tp->tp_getattr))
1117 return tp->tp_getattr(
obj, PyString_AS_STRING(attr_name));
1119 return PyObject_GetAttr(
obj, attr_name);
1122 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) 1126 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1129 #if CYTHON_COMPILING_IN_CPYTHON 1130 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1132 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) 1136 #if CYTHON_FAST_THREAD_STATE 1137 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; 1138 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; 1139 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type 1141 #define __Pyx_PyThreadState_declare 1142 #define __Pyx_PyThreadState_assign 1143 #define __Pyx_PyErr_Occurred() PyErr_Occurred() 1147 #if CYTHON_FAST_THREAD_STATE 1148 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) 1149 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) 1150 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) 1151 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) 1152 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) 1153 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1154 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1155 #if CYTHON_COMPILING_IN_CPYTHON 1156 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) 1158 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) 1161 #define __Pyx_PyErr_Clear() PyErr_Clear() 1162 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) 1163 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) 1164 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) 1165 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) 1166 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) 1167 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) 1168 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) 1172 static void __Pyx_WriteUnraisable(
const char *name,
int clineno,
1173 int lineno,
const char *filename,
1174 int full_traceback,
int nogil);
1177 #if CYTHON_FAST_PYCCALL 1178 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1180 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) 1184 #if CYTHON_FAST_PYCALL 1185 #define __Pyx_PyFunction_FastCall(func, args, nargs)\ 1186 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) 1187 #if 1 || PY_VERSION_HEX < 0x030600B1 1188 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
int nargs, PyObject *kwargs);
1190 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) 1195 #if CYTHON_COMPILING_IN_CPYTHON 1196 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1200 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1203 #if CYTHON_COMPILING_IN_CPYTHON 1204 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1206 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) 1210 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
1213 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1214 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1215 const char* function_name);
1218 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1219 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1222 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
1225 #if CYTHON_FAST_THREAD_STATE 1226 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) 1227 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1228 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) 1229 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1231 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) 1232 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) 1236 #if CYTHON_FAST_THREAD_STATE 1237 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) 1238 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1240 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) 1244 #if CYTHON_FAST_THREAD_STATE 1245 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) 1246 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1248 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1252 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1255 #if !CYTHON_COMPILING_IN_PYPY 1256 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2,
long intval,
int inplace);
1258 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\ 1259 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) 1263 static CYTHON_INLINE
int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq,
int eq) {
1264 int result = PySequence_Contains(seq, item);
1265 return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
1269 #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ 1270 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ 1271 __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\ 1272 (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\ 1273 __Pyx_SetItemInt_Generic(o, to_py_func(i), v))) 1274 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
1275 static CYTHON_INLINE
int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t
i, PyObject *v,
1276 int is_list,
int wraparound,
int boundscheck);
1279 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ 1280 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\ 1281 __Pyx__ArgTypeTest(obj, type, name, exact)) 1282 static int __Pyx__ArgTypeTest(PyObject *
obj, PyTypeObject *type,
const char *name,
int exact);
1285 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
1291 static int __Pyx_SetVtable(PyObject *dict,
void *vtable);
1294 static int __Pyx_setup_reduce(PyObject* type_obj);
1297 #if !CYTHON_COMPILING_IN_PYPY 1298 static PyObject* __Pyx_PyFloat_DivideObjC(PyObject *op1, PyObject *op2,
double floatval,
int inplace);
1300 #define __Pyx_PyFloat_DivideObjC(op1, op2, floatval, inplace)\ 1301 ((inplace ? __Pyx_PyNumber_InPlaceDivide(op1, op2) : __Pyx_PyNumber_Divide(op1, op2))) 1305 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals);
1308 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals);
1311 #if PY_MAJOR_VERSION >= 3 1312 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals 1314 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals 1318 #ifdef CYTHON_CLINE_IN_TRACEBACK 1319 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) 1321 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
1326 PyCodeObject* code_object;
1328 } __Pyx_CodeObjectCacheEntry;
1329 struct __Pyx_CodeObjectCache {
1332 __Pyx_CodeObjectCacheEntry* entries;
1334 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1335 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
1336 static PyCodeObject *__pyx_find_code_object(
int code_line);
1337 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
1340 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
1341 int py_line,
const char *filename);
1344 #ifndef __Pyx_CppExn2PyErr 1347 #include <stdexcept> 1349 static void __Pyx_CppExn2PyErr() {
1351 if (PyErr_Occurred())
1355 }
catch (
const std::bad_alloc& exn) {
1356 PyErr_SetString(PyExc_MemoryError, exn.what());
1357 }
catch (
const std::bad_cast& exn) {
1358 PyErr_SetString(PyExc_TypeError, exn.what());
1359 }
catch (
const std::bad_typeid& exn) {
1360 PyErr_SetString(PyExc_TypeError, exn.what());
1361 }
catch (
const std::domain_error& exn) {
1362 PyErr_SetString(PyExc_ValueError, exn.what());
1363 }
catch (
const std::invalid_argument& exn) {
1364 PyErr_SetString(PyExc_ValueError, exn.what());
1365 }
catch (
const std::ios_base::failure& exn) {
1366 PyErr_SetString(PyExc_IOError, exn.what());
1367 }
catch (
const std::out_of_range& exn) {
1368 PyErr_SetString(PyExc_IndexError, exn.what());
1369 }
catch (
const std::overflow_error& exn) {
1370 PyErr_SetString(PyExc_OverflowError, exn.what());
1371 }
catch (
const std::range_error& exn) {
1372 PyErr_SetString(PyExc_ArithmeticError, exn.what());
1373 }
catch (
const std::underflow_error& exn) {
1374 PyErr_SetString(PyExc_ArithmeticError, exn.what());
1375 }
catch (
const std::exception& exn) {
1376 PyErr_SetString(PyExc_RuntimeError, exn.what());
1380 PyErr_SetString(PyExc_RuntimeError,
"Unknown exception");
1386 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
1389 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
1392 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
1395 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
1398 #if CYTHON_COMPILING_IN_CPYTHON 1399 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) 1400 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1401 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1402 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1404 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) 1405 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) 1406 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) 1410 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
1413 #if CYTHON_FAST_THREAD_STATE 1414 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) 1415 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1417 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
1421 static PyObject* __Pyx_PyObject_CallMethod1(PyObject*
obj, PyObject* method_name, PyObject* arg);
1422 static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg);
1425 typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyThreadState *, PyObject *);
1428 __pyx_coroutine_body_t body;
1431 PyObject *exc_value;
1432 PyObject *exc_traceback;
1433 PyObject *gi_weakreflist;
1435 PyObject *yieldfrom;
1437 PyObject *gi_qualname;
1438 PyObject *gi_modulename;
1441 } __pyx_CoroutineObject;
1442 static __pyx_CoroutineObject *__Pyx__Coroutine_New(
1443 PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *closure,
1444 PyObject *name, PyObject *qualname, PyObject *module_name);
1445 static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
1446 __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *closure,
1447 PyObject *name, PyObject *qualname, PyObject *module_name);
1448 static int __Pyx_Coroutine_clear(PyObject *
self);
1449 static PyObject *__Pyx_Coroutine_Send(PyObject *
self, PyObject *value);
1450 static PyObject *__Pyx_Coroutine_Close(PyObject *
self);
1451 static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
1452 #define __Pyx_Coroutine_SwapException(self) {\ 1453 __Pyx_ExceptionSwap(&(self)->exc_type, &(self)->exc_value, &(self)->exc_traceback);\ 1454 __Pyx_Coroutine_ResetFrameBackpointer(self);\ 1456 #define __Pyx_Coroutine_ResetAndClearException(self) {\ 1457 __Pyx_ExceptionReset((self)->exc_type, (self)->exc_value, (self)->exc_traceback);\ 1458 (self)->exc_type = (self)->exc_value = (self)->exc_traceback = NULL;\ 1460 #if CYTHON_FAST_THREAD_STATE 1461 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ 1462 __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue) 1464 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ 1465 __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue) 1467 static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue);
1468 static CYTHON_INLINE
void __Pyx_Coroutine_ResetFrameBackpointer(__pyx_CoroutineObject *
self);
1471 static PyObject* __Pyx_Coroutine_patch_module(PyObject* module,
const char* py_code);
1474 static int __Pyx_patch_abc(
void);
1477 #define __Pyx_Generator_USED 1478 static PyTypeObject *__pyx_GeneratorType = 0;
1479 #define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType) 1480 #define __Pyx_Generator_New(body, closure, name, qualname, module_name)\ 1481 __Pyx__Coroutine_New(__pyx_GeneratorType, body, closure, name, qualname, module_name) 1482 static PyObject *__Pyx_Generator_Next(PyObject *
self);
1483 static int __pyx_Generator_init(
void);
1486 static int __Pyx_check_binary_version(
void);
1489 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1491 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_9index_set_wrap(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self,
IndexSet __pyx_v_other);
1492 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_9index_set_unwrap(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
1493 static PyObject *__pyx_f_8PyClical_9index_set_copy(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self,
int __pyx_skip_dispatch);
1494 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_8clifford_wrap(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self,
Clifford __pyx_v_other);
1495 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_8clifford_unwrap(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
1496 static PyObject *__pyx_f_8PyClical_8clifford_copy(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self,
int __pyx_skip_dispatch);
1503 static PyTypeObject *__pyx_ptype_8PyClical_index_set = 0;
1504 static PyTypeObject *__pyx_ptype_8PyClical_clifford = 0;
1505 static PyTypeObject *__pyx_ptype_8PyClical___pyx_scope_struct____iter__ = 0;
1506 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_toIndexSet(PyObject *);
1507 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_compare(PyObject *, PyObject *,
int __pyx_skip_dispatch);
1508 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_min_neg(PyObject *,
int __pyx_skip_dispatch);
1509 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_max_pos(PyObject *,
int __pyx_skip_dispatch);
1510 static CYTHON_INLINE std::vector<scalar_t> __pyx_f_8PyClical_list_to_vector(PyObject *);
1511 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_toClifford(PyObject *);
1512 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_inv(PyObject *,
int __pyx_skip_dispatch);
1513 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_scalar(PyObject *,
int __pyx_skip_dispatch);
1514 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_real(PyObject *,
int __pyx_skip_dispatch);
1515 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_imag(PyObject *,
int __pyx_skip_dispatch);
1516 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_pure(PyObject *,
int __pyx_skip_dispatch);
1517 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_even(PyObject *,
int __pyx_skip_dispatch);
1518 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_odd(PyObject *,
int __pyx_skip_dispatch);
1519 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_involute(PyObject *,
int __pyx_skip_dispatch);
1520 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_reverse(PyObject *,
int __pyx_skip_dispatch);
1521 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_conj(PyObject *,
int __pyx_skip_dispatch);
1522 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_quad(PyObject *,
int __pyx_skip_dispatch);
1523 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_norm(PyObject *,
int __pyx_skip_dispatch);
1524 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_abs(PyObject *,
int __pyx_skip_dispatch);
1525 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_max_abs(PyObject *,
int __pyx_skip_dispatch);
1526 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_pow(PyObject *, PyObject *,
int __pyx_skip_dispatch);
1527 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_outer_pow(PyObject *, PyObject *,
int __pyx_skip_dispatch);
1528 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_complexifier(PyObject *,
int __pyx_skip_dispatch);
1529 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_sqrt(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_sqrt *__pyx_optional_args);
1530 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_exp(PyObject *,
int __pyx_skip_dispatch);
1531 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_log(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_log *__pyx_optional_args);
1532 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cos(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_cos *__pyx_optional_args);
1533 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_acos(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_acos *__pyx_optional_args);
1534 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cosh(PyObject *,
int __pyx_skip_dispatch);
1535 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_acosh(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_acosh *__pyx_optional_args);
1536 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_sin(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_sin *__pyx_optional_args);
1537 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_asin(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_asin *__pyx_optional_args);
1538 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_sinh(PyObject *,
int __pyx_skip_dispatch);
1539 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_asinh(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_asinh *__pyx_optional_args);
1540 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_tan(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_tan *__pyx_optional_args);
1541 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_atan(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_atan *__pyx_optional_args);
1542 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_tanh(PyObject *,
int __pyx_skip_dispatch);
1543 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_atanh(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_atanh *__pyx_optional_args);
1544 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);
1545 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cga3(PyObject *,
int __pyx_skip_dispatch);
1546 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cga3std(PyObject *,
int __pyx_skip_dispatch);
1547 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_agc3(PyObject *,
int __pyx_skip_dispatch);
1548 #define __Pyx_MODULE_NAME "PyClical" 1549 extern int __pyx_module_is_main_PyClical;
1550 int __pyx_module_is_main_PyClical = 0;
1553 static PyObject *__pyx_builtin_IndexError;
1554 static PyObject *__pyx_builtin_RuntimeError;
1555 static PyObject *__pyx_builtin_TypeError;
1556 static PyObject *__pyx_builtin_ValueError;
1557 static PyObject *__pyx_builtin_NotImplemented;
1558 static PyObject *__pyx_builtin_range;
1559 static PyObject *__pyx_builtin_xrange;
1560 static const char __pyx_k_[] =
".";
1561 static const char __pyx_k_e[] =
"e";
1562 static const char __pyx_k_i[] =
"i";
1563 static const char __pyx_k_m[] =
"m";
1564 static const char __pyx_k_p[] =
"p";
1565 static const char __pyx_k_q[] =
"q";
1566 static const char __pyx_k__2[] =
" ";
1567 static const char __pyx_k__5[] =
":";
1568 static const char __pyx_k__6[] =
"\n\t";
1569 static const char __pyx_k__7[] =
" (";
1570 static const char __pyx_k__8[] =
", ";
1571 static const char __pyx_k__9[] =
").";
1572 static const char __pyx_k_cl[] =
"cl";
1573 static const char __pyx_k_pi[] =
"pi";
1574 static const char __pyx_k_cos[] =
"cos";
1575 static const char __pyx_k_exp[] =
"exp";
1576 static const char __pyx_k_frm[] =
"frm";
1577 static const char __pyx_k_inv[] =
"inv";
1578 static const char __pyx_k_ist[] =
"ist";
1579 static const char __pyx_k_ixt[] =
"ixt";
1580 static const char __pyx_k_lhs[] =
"lhs";
1581 static const char __pyx_k_log[] =
"log";
1582 static const char __pyx_k_max[] =
"max";
1583 static const char __pyx_k_min[] =
"min";
1584 static const char __pyx_k_obj[] =
"obj";
1585 static const char __pyx_k_odd[] =
"odd";
1586 static const char __pyx_k_pow[] =
"pow";
1587 static const char __pyx_k_rhs[] =
"rhs";
1588 static const char __pyx_k_sin[] =
"sin";
1589 static const char __pyx_k_tan[] =
"tan";
1590 static const char __pyx_k_tau[] =
"tau";
1591 static const char __pyx_k_Real[] =
"Real";
1592 static const char __pyx_k_acos[] =
"acos";
1593 static const char __pyx_k_args[] =
"args";
1594 static const char __pyx_k_asin[] =
"asin";
1595 static const char __pyx_k_atan[] =
"atan";
1596 static const char __pyx_k_conj[] =
"conj";
1597 static const char __pyx_k_copy[] =
"copy";
1598 static const char __pyx_k_cosh[] =
"cosh";
1599 static const char __pyx_k_even[] =
"even";
1600 static const char __pyx_k_fill[] =
"fill";
1601 static const char __pyx_k_from[] =
" from ";
1602 static const char __pyx_k_iter[] =
"__iter__";
1603 static const char __pyx_k_main[] =
"__main__";
1604 static const char __pyx_k_math[] =
"math";
1605 static const char __pyx_k_name[] =
"__name__";
1606 static const char __pyx_k_norm[] =
"norm";
1607 static const char __pyx_k_pure[] =
"pure";
1608 static const char __pyx_k_quad[] =
"quad";
1609 static const char __pyx_k_send[] =
"send";
1610 static const char __pyx_k_sinh[] =
"sinh";
1611 static const char __pyx_k_sqrt[] =
"sqrt";
1612 static const char __pyx_k_tanh[] =
"tanh";
1613 static const char __pyx_k_test[] =
"_test";
1614 static const char __pyx_k_0_8_2[] =
"0.8.2";
1615 static const char __pyx_k_acosh[] =
"acosh";
1616 static const char __pyx_k_asinh[] =
"asinh";
1617 static const char __pyx_k_atanh[] =
"atanh";
1618 static const char __pyx_k_close[] =
"close";
1619 static const char __pyx_k_grade[] =
"grade";
1620 static const char __pyx_k_istpq[] =
"istpq";
1621 static const char __pyx_k_nbar3[] =
"nbar3";
1622 static const char __pyx_k_ninf3[] =
"ninf3";
1623 static const char __pyx_k_other[] =
"other";
1624 static const char __pyx_k_range[] =
"range";
1625 static const char __pyx_k_throw[] =
"throw";
1626 static const char __pyx_k_using[] =
" using (";
1627 static const char __pyx_k_value[] =
" value ";
1628 static const char __pyx_k_import[] =
"__import__";
1629 static const char __pyx_k_reduce[] =
"__reduce__";
1630 static const char __pyx_k_scalar[] =
"scalar";
1631 static const char __pyx_k_test_2[] =
"__test__";
1632 static const char __pyx_k_xrange[] =
"xrange";
1633 static const char __pyx_k_doctest[] =
"doctest";
1634 static const char __pyx_k_invalid[] =
" invalid ";
1635 static const char __pyx_k_numbers[] =
"numbers";
1636 static const char __pyx_k_reverse[] =
"reverse";
1637 static const char __pyx_k_testmod[] =
"testmod";
1638 static const char __pyx_k_version[] =
"__version__";
1639 static const char __pyx_k_Integral[] =
"Integral";
1640 static const char __pyx_k_PyClical[] =
"PyClical";
1641 static const char __pyx_k_Sequence[] =
"Sequence";
1642 static const char __pyx_k_as_frame[] =
" as frame:\n\t";
1643 static const char __pyx_k_getstate[] =
"__getstate__";
1644 static const char __pyx_k_involute[] =
"involute";
1645 static const char __pyx_k_setstate[] =
"__setstate__";
1646 static const char __pyx_k_to_frame[] =
" to frame ";
1647 static const char __pyx_k_TypeError[] =
"TypeError";
1648 static const char __pyx_k_outer_pow[] =
"outer_pow";
1649 static const char __pyx_k_reduce_ex[] =
"__reduce_ex__";
1650 static const char __pyx_k_IndexError[] =
"IndexError";
1651 static const char __pyx_k_ValueError[] =
"ValueError";
1652 static const char __pyx_k_pyx_vtable[] =
"__pyx_vtable__";
1653 static const char __pyx_k_collections[] =
"collections";
1654 static const char __pyx_k_e_line_1887[] =
"e (line 1887)";
1655 static const char __pyx_k_PyClical_pyx[] =
"PyClical.pyx";
1656 static const char __pyx_k_RuntimeError[] =
"RuntimeError";
1657 static const char __pyx_k_abs_line_1473[] =
"abs (line 1473)";
1658 static const char __pyx_k_cos_line_1602[] =
"cos (line 1602)";
1659 static const char __pyx_k_exp_line_1565[] =
"exp (line 1565)";
1660 static const char __pyx_k_inv_line_1329[] =
"inv (line 1329)";
1661 static const char __pyx_k_log_line_1579[] =
"log (line 1579)";
1662 static const char __pyx_k_odd_line_1397[] =
"odd (line 1397)";
1663 static const char __pyx_k_pow_line_1494[] =
"pow (line 1494)";
1664 static const char __pyx_k_reduce_cython[] =
"__reduce_cython__";
1665 static const char __pyx_k_sin_line_1679[] =
"sin (line 1679)";
1666 static const char __pyx_k_tan_line_1752[] =
"tan (line 1752)";
1667 static const char __pyx_k_using_invalid[] =
" using invalid ";
1668 static const char __pyx_k_Cannot_reframe[] =
"Cannot reframe";
1669 static const char __pyx_k_NotImplemented[] =
"NotImplemented";
1670 static const char __pyx_k_Not_applicable[] =
"Not applicable.";
1671 static const char __pyx_k_acos_line_1619[] =
"acos (line 1619)";
1672 static const char __pyx_k_agc3_line_1844[] =
"agc3 (line 1844)";
1673 static const char __pyx_k_asin_line_1698[] =
"asin (line 1698)";
1674 static const char __pyx_k_atan_line_1769[] =
"atan (line 1769)";
1675 static const char __pyx_k_cga3_line_1824[] =
"cga3 (line 1824)";
1676 static const char __pyx_k_conj_line_1436[] =
"conj (line 1436)";
1677 static const char __pyx_k_cosh_line_1640[] =
"cosh (line 1640)";
1678 static const char __pyx_k_even_line_1388[] =
"even (line 1388)";
1679 static const char __pyx_k_imag_line_1366[] =
"imag (line 1366)";
1680 static const char __pyx_k_invalid_string[] =
" invalid string ";
1681 static const char __pyx_k_norm_line_1462[] =
"norm (line 1462)";
1682 static const char __pyx_k_pure_line_1377[] =
"pure (line 1377)";
1683 static const char __pyx_k_quad_line_1451[] =
"quad (line 1451)";
1684 static const char __pyx_k_real_line_1355[] =
"real (line 1355)";
1685 static const char __pyx_k_sinh_line_1719[] =
"sinh (line 1719)";
1686 static const char __pyx_k_sqrt_line_1542[] =
"sqrt (line 1542)";
1687 static const char __pyx_k_tanh_line_1786[] =
"tanh (line 1786)";
1688 static const char __pyx_k_acosh_line_1656[] =
"acosh (line 1656)";
1689 static const char __pyx_k_asinh_line_1733[] =
"asinh (line 1733)";
1690 static const char __pyx_k_atanh_line_1798[] =
"atanh (line 1798)";
1691 static const char __pyx_k_istpq_line_1900[] =
"istpq (line 1900)";
1692 static const char __pyx_k_setstate_cython[] =
"__setstate_cython__";
1693 static const char __pyx_k_compare_line_490[] =
"compare (line 490)";
1694 static const char __pyx_k_index_set___iter[] =
"index_set.__iter__";
1695 static const char __pyx_k_max_pos_line_511[] =
"max_pos (line 511)";
1696 static const char __pyx_k_min_neg_line_502[] =
"min_neg (line 502)";
1697 static const char __pyx_k_scalar_line_1344[] =
"scalar (line 1344)";
1698 static const char __pyx_k_cga3std_line_1833[] =
"cga3std (line 1833)";
1699 static const char __pyx_k_max_abs_line_1482[] =
"max_abs (line 1482)";
1700 static const char __pyx_k_reverse_line_1421[] =
"reverse (line 1421)";
1701 static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
1702 static const char __pyx_k_involute_line_1406[] =
"involute (line 1406)";
1703 static const char __pyx_k_outer_pow_line_1518[] =
"outer_pow (line 1518)";
1704 static const char __pyx_k_clifford_inv_line_925[] =
"clifford.inv (line 925)";
1705 static const char __pyx_k_clifford_pow_line_979[] =
"clifford.pow (line 979)";
1706 static const char __pyx_k_clifford_abs_line_1174[] =
"clifford.abs (line 1174)";
1707 static const char __pyx_k_clifford_copy_line_554[] =
"clifford.copy (line 554)";
1708 static const char __pyx_k_clifford_odd_line_1069[] =
"clifford.odd (line 1069)";
1709 static const char __pyx_k_complexifier_line_1527[] =
"complexifier (line 1527)";
1710 static const char __pyx_k_index_set_copy_line_64[] =
"index_set.copy (line 64)";
1711 static const char __pyx_k_index_set_max_line_349[] =
"index_set.max (line 349)";
1712 static const char __pyx_k_index_set_min_line_340[] =
"index_set.min (line 340)";
1713 static const char __pyx_k_clifford_conj_line_1137[] =
"clifford.conj (line 1137)";
1714 static const char __pyx_k_clifford_even_line_1060[] =
"clifford.even (line 1060)";
1715 static const char __pyx_k_clifford_norm_line_1163[] =
"clifford.norm (line 1163)";
1716 static const char __pyx_k_clifford_pure_line_1049[] =
"clifford.pure (line 1049)";
1717 static const char __pyx_k_clifford_quad_line_1152[] =
"clifford.quad (line 1152)";
1718 static const char __pyx_k_Unary_print_clifford_1_1[] =
"\n Unary -.\n\n >>> print -clifford(\"{1}\")\n -{1}\n ";
1719 static const char __pyx_k_clifford___or___line_938[] =
"clifford.__or__ (line 938)";
1720 static const char __pyx_k_clifford_frame_line_1214[] =
"clifford.frame (line 1214)";
1721 static const char __pyx_k_clifford_hidden_doctests[] =
"clifford_hidden_doctests";
1722 static const char __pyx_k_clifford_isnan_line_1205[] =
"clifford.isnan (line 1205)";
1723 static const char __pyx_k_index_set_count_line_313[] =
"index_set.count (line 313)";
1724 static const char __pyx_k_clifford___add___line_739[] =
"clifford.__add__ (line 739)";
1725 static const char __pyx_k_clifford___and___line_835[] =
"clifford.__and__ (line 835)";
1726 static const char __pyx_k_clifford___div___line_895[] =
"clifford.__div__ (line 895)";
1727 static const char __pyx_k_clifford___ior___line_949[] =
"clifford.__ior__ (line 949)";
1728 static const char __pyx_k_clifford___mod___line_805[] =
"clifford.__mod__ (line 805)";
1729 static const char __pyx_k_clifford___mul___line_779[] =
"clifford.__mul__ (line 779)";
1730 static const char __pyx_k_clifford___neg___line_721[] =
"clifford.__neg__ (line 721)";
1731 static const char __pyx_k_clifford___pos___line_730[] =
"clifford.__pos__ (line 730)";
1732 static const char __pyx_k_clifford___pow___line_960[] =
"clifford.__pow__ (line 960)";
1733 static const char __pyx_k_clifford___sub___line_759[] =
"clifford.__sub__ (line 759)";
1734 static const char __pyx_k_clifford___xor___line_865[] =
"clifford.__xor__ (line 865)";
1735 static const char __pyx_k_clifford_reframe_line_648[] =
"clifford.reframe (line 648)";
1736 static const char __pyx_k_clifford_scalar_line_1038[] =
"clifford.scalar (line 1038)";
1737 static const char __pyx_k_index_set___or___line_291[] =
"index_set.__or__ (line 291)";
1738 static const char __pyx_k_index_set_hidden_doctests[] =
"index_set_hidden_doctests";
1739 static const char __pyx_k_random_clifford_line_1815[] =
"random_clifford (line 1815)";
1740 static const char __pyx_k_Cannot_take_vector_part_of[] =
"Cannot take vector part of ";
1741 static const char __pyx_k_Unary_print_clifford_1_1_2[] =
"\n Unary +.\n\n >>> print +clifford(\"{1}\")\n {1}\n ";
1742 static const char __pyx_k_clifford___iadd___line_750[] =
"clifford.__iadd__ (line 750)";
1743 static const char __pyx_k_clifford___iand___line_850[] =
"clifford.__iand__ (line 850)";
1744 static const char __pyx_k_clifford___idiv___line_910[] =
"clifford.__idiv__ (line 910)";
1745 static const char __pyx_k_clifford___imod___line_820[] =
"clifford.__imod__ (line 820)";
1746 static const char __pyx_k_clifford___imul___line_792[] =
"clifford.__imul__ (line 792)";
1747 static const char __pyx_k_clifford___isub___line_770[] =
"clifford.__isub__ (line 770)";
1748 static const char __pyx_k_clifford___iter___line_637[] =
"clifford.__iter__ (line 637)";
1749 static const char __pyx_k_clifford___ixor___line_880[] =
"clifford.__ixor__ (line 880)";
1750 static const char __pyx_k_clifford___str___line_1234[] =
"clifford.__str__ (line 1234)";
1751 static const char __pyx_k_clifford_max_abs_line_1183[] =
"clifford.max_abs (line 1183)";
1752 static const char __pyx_k_clifford_reverse_line_1122[] =
"clifford.reverse (line 1122)";
1753 static const char __pyx_k_index_set___and___line_269[] =
"index_set.__and__ (line 269)";
1754 static const char __pyx_k_index_set___ior___line_302[] =
"index_set.__ior__ (line 302)";
1755 static const char __pyx_k_index_set___str___line_393[] =
"index_set.__str__ (line 393)";
1756 static const char __pyx_k_index_set___xor___line_247[] =
"index_set.__xor__ (line 247)";
1757 static const char __pyx_k_clifford___call___line_1019[] =
"clifford.__call__ (line 1019)";
1758 static const char __pyx_k_clifford___repr___line_1225[] =
"clifford.__repr__ (line 1225)";
1759 static const char __pyx_k_clifford_involute_line_1106[] =
"clifford.involute (line 1106)";
1760 static const char __pyx_k_index_set___iand___line_280[] =
"index_set.__iand__ (line 280)";
1761 static const char __pyx_k_index_set___iter___line_227[] =
"index_set.__iter__ (line 227)";
1762 static const char __pyx_k_index_set___ixor___line_258[] =
"index_set.__ixor__ (line 258)";
1763 static const char __pyx_k_index_set___repr___line_382[] =
"index_set.__repr__ (line 382)";
1764 static const char __pyx_k_clifford_outer_pow_line_1003[] =
"clifford.outer_pow (line 1003)";
1765 static const char __pyx_k_clifford_truncated_line_1194[] =
"clifford.truncated (line 1194)";
1766 static const char __pyx_k_index_set_count_neg_line_322[] =
"index_set.count_neg (line 322)";
1767 static const char __pyx_k_index_set_count_pos_line_331[] =
"index_set.count_pos (line 331)";
1768 static const char __pyx_k_clifford___getitem___line_706[] =
"clifford.__getitem__ (line 706)";
1769 static const char __pyx_k_index_set___invert___line_238[] =
"index_set.__invert__ (line 238)";
1770 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 ";
1771 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 ";
1772 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 ";
1773 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 ";
1774 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 ";
1775 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 ";
1776 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 ";
1777 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 ";
1778 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 ";
1779 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 ";
1780 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 ";
1781 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 ";
1782 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 ";
1783 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 ";
1784 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 ";
1785 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 ";
1786 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 ";
1787 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 ";
1788 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 ";
1789 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 ";
1790 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 ";
1791 static const char __pyx_k_clifford_vector_part_line_1078[] =
"clifford.vector_part (line 1078)";
1792 static const char __pyx_k_index_set___getitem___line_189[] =
"index_set.__getitem__ (line 189)";
1793 static const char __pyx_k_index_set___setitem___line_177[] =
"index_set.__setitem__ (line 177)";
1794 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 ";
1795 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 ";
1796 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 ";
1797 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 ";
1798 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 ";
1799 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 ";
1800 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 ";
1801 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 ";
1802 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 ";
1803 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 ";
1804 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 ";
1805 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 ";
1806 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 ";
1807 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 ";
1808 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 ";
1809 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 ";
1810 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 ";
1811 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 ";
1812 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 ";
1813 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 ";
1814 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 ";
1815 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 ";
1816 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 ";
1817 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 ";
1818 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 ";
1819 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 ";
1820 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 ";
1821 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 ";
1822 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 ";
1823 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 ";
1824 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 ";
1825 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 ";
1826 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 ";
1827 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 ";
1828 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 ";
1829 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 ";
1830 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 ";
1831 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 ";
1832 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 ";
1833 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 ";
1834 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 ";
1835 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 ";
1836 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 ";
1837 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 ";
1838 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 ";
1839 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 ";
1840 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 ";
1841 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 ";
1842 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 ";
1843 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 ";
1844 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 ";
1845 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 ";
1846 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 ";
1847 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 ";
1848 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 ";
1849 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 ";
1850 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 ";
1851 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 ";
1852 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 ";
1853 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 ";
1854 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 ";
1855 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 ";
1856 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 ";
1857 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 ";
1858 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 ";
1859 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 ";
1860 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 ";
1861 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 ";
1862 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 ";
1863 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 ";
1864 static const char __pyx_k_This_comparison_operator_is_not[] =
"This comparison operator is not implemented for ";
1865 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 ";
1866 static const char __pyx_k_index_set_sign_of_mult_line_364[] =
"index_set.sign_of_mult (line 364)";
1867 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 ";
1868 static const char __pyx_k_Cannot_initialize_clifford_objec[] =
"Cannot initialize clifford object from";
1869 static const char __pyx_k_Cannot_initialize_index_set_obje[] =
"Cannot initialize index_set object from";
1870 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 ";
1871 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 ";
1872 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 ";
1873 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 ";
1874 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 ";
1875 static const char __pyx_k_clifford_hidden_doctests_line_12[] =
"clifford_hidden_doctests (line 1243)";
1876 static const char __pyx_k_index_set_hidden_doctests_line_4[] =
"index_set_hidden_doctests (line 404)";
1877 static const char __pyx_k_index_set_sign_of_square_line_37[] =
"index_set.sign_of_square (line 373)";
1878 static const char __pyx_k_no_default___reduce___due_to_non[] =
"no default __reduce__ due to non-trivial __cinit__";
1879 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 ";
1880 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 ";
1881 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 ";
1882 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 ";
1883 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 ";
1884 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 ";
1885 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 ";
1886 static PyObject *__pyx_kp_s_;
1887 static PyObject *__pyx_kp_s_0_8_2;
1888 static PyObject *__pyx_kp_u_Abbreviation_for_clifford_index;
1889 static PyObject *__pyx_kp_u_Abbreviation_for_index_set_q_p;
1890 static PyObject *__pyx_kp_u_Absolute_value_of_multivector_m;
1891 static PyObject *__pyx_kp_u_Absolute_value_square_root_of_n;
1892 static PyObject *__pyx_kp_s_Cannot_initialize_clifford_objec;
1893 static PyObject *__pyx_kp_s_Cannot_initialize_index_set_obje;
1894 static PyObject *__pyx_kp_s_Cannot_reframe;
1895 static PyObject *__pyx_kp_s_Cannot_take_vector_part_of;
1896 static PyObject *__pyx_kp_u_Cardinality_Number_of_indices_i;
1897 static PyObject *__pyx_kp_u_Check_if_a_multivector_contains;
1898 static PyObject *__pyx_kp_u_Conjugation_reverse_o_involute;
1899 static PyObject *__pyx_kp_u_Conjugation_reverse_o_involute_2;
1900 static PyObject *__pyx_kp_u_Contraction_print_clifford_1_cl;
1901 static PyObject *__pyx_kp_u_Contraction_x_clifford_1_x_clif;
1902 static PyObject *__pyx_kp_u_Convert_CGA3_null_vector_to_Euc;
1903 static PyObject *__pyx_kp_u_Convert_CGA3_null_vector_to_sta;
1904 static PyObject *__pyx_kp_u_Convert_Euclidean_3D_multivecto;
1905 static PyObject *__pyx_kp_u_Copy_this_clifford_object_x_cli;
1906 static PyObject *__pyx_kp_u_Copy_this_index_set_object_s_in;
1907 static PyObject *__pyx_kp_u_Cosine_of_multivector_with_opti;
1908 static PyObject *__pyx_kp_u_Even_part_of_multivector_sum_of;
1909 static PyObject *__pyx_kp_u_Even_part_of_multivector_sum_of_2;
1910 static PyObject *__pyx_kp_u_Exponential_of_multivector_x_cl;
1911 static PyObject *__pyx_kp_u_Geometric_difference_print_clif;
1912 static PyObject *__pyx_kp_u_Geometric_difference_x_clifford;
1913 static PyObject *__pyx_kp_u_Geometric_multiplicative_invers;
1914 static PyObject *__pyx_kp_u_Geometric_multiplicative_invers_2;
1915 static PyObject *__pyx_kp_u_Geometric_product_print_cliffor;
1916 static PyObject *__pyx_kp_u_Geometric_product_x_clifford_2;
1917 static PyObject *__pyx_kp_u_Geometric_quotient_print_cliffo;
1918 static PyObject *__pyx_kp_u_Geometric_quotient_x_clifford_1;
1919 static PyObject *__pyx_kp_u_Geometric_sum_print_clifford_1;
1920 static PyObject *__pyx_kp_u_Geometric_sum_x_clifford_1_x_cl;
1921 static PyObject *__pyx_kp_u_Get_the_value_of_an_index_set_o;
1922 static PyObject *__pyx_kp_u_Hyperbolic_cosine_of_multivecto;
1923 static PyObject *__pyx_kp_u_Hyperbolic_sine_of_multivector;
1924 static PyObject *__pyx_kp_u_Hyperbolic_tangent_of_multivect;
1925 static PyObject *__pyx_kp_u_Imaginary_part_deprecated_alway;
1926 static PyObject *__pyx_n_s_IndexError;
1927 static PyObject *__pyx_kp_u_Inner_product_print_clifford_1;
1928 static PyObject *__pyx_kp_u_Inner_product_x_clifford_1_x_cl;
1929 static PyObject *__pyx_kp_u_Integer_power_of_multivector_ob;
1930 static PyObject *__pyx_n_s_Integral;
1931 static PyObject *__pyx_kp_u_Inverse_cosine_of_multivector_w;
1932 static PyObject *__pyx_kp_u_Inverse_hyperbolic_cosine_of_mu;
1933 static PyObject *__pyx_kp_u_Inverse_hyperbolic_sine_of_mult;
1934 static PyObject *__pyx_kp_u_Inverse_hyperbolic_tangent_of_m;
1935 static PyObject *__pyx_kp_u_Inverse_sine_of_multivector_wit;
1936 static PyObject *__pyx_kp_u_Inverse_tangent_of_multivector;
1937 static PyObject *__pyx_kp_u_Iterate_over_the_indices_of_an;
1938 static PyObject *__pyx_kp_u_Main_involution_each_i_is_repla;
1939 static PyObject *__pyx_kp_u_Main_involution_each_i_is_repla_2;
1940 static PyObject *__pyx_kp_u_Maximum_absolute_value_of_coord;
1941 static PyObject *__pyx_kp_u_Maximum_member_index_set_1_1_2;
1942 static PyObject *__pyx_kp_u_Maximum_of_absolute_values_of_c;
1943 static PyObject *__pyx_kp_u_Maximum_positive_index_or_0_if;
1944 static PyObject *__pyx_kp_u_Minimum_member_index_set_1_1_2;
1945 static PyObject *__pyx_kp_u_Minimum_negative_index_or_0_if;
1946 static PyObject *__pyx_kp_u_Natural_logarithm_of_multivecto;
1947 static PyObject *__pyx_kp_u_Norm_sum_of_squares_of_coordina;
1948 static PyObject *__pyx_n_s_NotImplemented;
1949 static PyObject *__pyx_kp_s_Not_applicable;
1950 static PyObject *__pyx_kp_u_Not_applicable_for_a_in_cliffor;
1951 static PyObject *__pyx_kp_u_Number_of_negative_indices_incl;
1952 static PyObject *__pyx_kp_u_Number_of_positive_indices_incl;
1953 static PyObject *__pyx_kp_u_Odd_part_of_multivector_sum_of;
1954 static PyObject *__pyx_kp_u_Odd_part_of_multivector_sum_of_2;
1955 static PyObject *__pyx_kp_u_Outer_product_power_of_multivec;
1956 static PyObject *__pyx_kp_u_Outer_product_power_x_clifford;
1957 static PyObject *__pyx_kp_u_Outer_product_print_clifford_1;
1958 static PyObject *__pyx_kp_u_Outer_product_x_clifford_1_x_cl;
1959 static PyObject *__pyx_kp_u_Power_self_to_the_m_x_clifford;
1960 static PyObject *__pyx_kp_u_Power_self_to_the_m_x_clifford_2;
1961 static PyObject *__pyx_kp_u_Pure_grade_vector_part_print_cl;
1962 static PyObject *__pyx_kp_u_Pure_part_print_clifford_1_1_1;
1963 static PyObject *__pyx_kp_u_Pure_part_print_pure_clifford_1;
1964 static PyObject *__pyx_kp_u_Put_self_into_a_larger_frame_co;
1965 static PyObject *__pyx_n_s_PyClical;
1966 static PyObject *__pyx_kp_s_PyClical_pyx;
1967 static PyObject *__pyx_kp_u_Quadratic_form_rev_x_x_0_print;
1968 static PyObject *__pyx_kp_u_Quadratic_form_rev_x_x_0_print_2;
1969 static PyObject *__pyx_kp_u_Random_multivector_within_a_fra;
1970 static PyObject *__pyx_n_s_Real;
1971 static PyObject *__pyx_kp_u_Real_part_synonym_for_scalar_pa;
1972 static PyObject *__pyx_kp_u_Remove_all_terms_of_self_with_r;
1973 static PyObject *__pyx_kp_u_Reversion_eg_1_2_2_1_print_reve;
1974 static PyObject *__pyx_kp_u_Reversion_eg_clifford_1_cliffor;
1975 static PyObject *__pyx_n_s_RuntimeError;
1976 static PyObject *__pyx_kp_u_Scalar_part_clifford_1_1_1_2_sc;
1977 static PyObject *__pyx_kp_u_Scalar_part_scalar_clifford_1_1;
1978 static PyObject *__pyx_n_s_Sequence;
1979 static PyObject *__pyx_kp_u_Set_complement_not_print_index;
1980 static PyObject *__pyx_kp_u_Set_intersection_and_print_inde;
1981 static PyObject *__pyx_kp_u_Set_intersection_and_x_index_se;
1982 static PyObject *__pyx_kp_u_Set_the_value_of_an_index_set_o;
1983 static PyObject *__pyx_kp_u_Set_union_or_print_index_set_1;
1984 static PyObject *__pyx_kp_u_Set_union_or_x_index_set_1_x_in;
1985 static PyObject *__pyx_kp_u_Sign_of_geometric_product_of_tw;
1986 static PyObject *__pyx_kp_u_Sign_of_geometric_square_of_a_C;
1987 static PyObject *__pyx_kp_u_Sine_of_multivector_with_option;
1988 static PyObject *__pyx_kp_u_Square_root_of_1_which_commutes;
1989 static PyObject *__pyx_kp_u_Square_root_of_multivector_with;
1990 static PyObject *__pyx_kp_u_Subalgebra_generated_by_all_gen;
1991 static PyObject *__pyx_kp_u_Subscripting_map_from_index_set;
1992 static PyObject *__pyx_kp_u_Symmetric_set_difference_exclus;
1993 static PyObject *__pyx_kp_u_Symmetric_set_difference_exclus_2;
1994 static PyObject *__pyx_kp_u_Tangent_of_multivector_with_opt;
1995 static PyObject *__pyx_kp_u_Tests_for_functions_that_Doctes;
1996 static PyObject *__pyx_kp_u_Tests_for_functions_that_Doctes_2;
1997 static PyObject *__pyx_kp_u_The_informal_string_representat;
1998 static PyObject *__pyx_kp_u_The_informal_string_representat_2;
1999 static PyObject *__pyx_kp_u_The_official_string_representat;
2000 static PyObject *__pyx_kp_u_The_official_string_representat_2;
2001 static PyObject *__pyx_kp_s_This_comparison_operator_is_not;
2002 static PyObject *__pyx_kp_u_Transform_left_hand_side_using;
2003 static PyObject *__pyx_kp_u_Transform_left_hand_side_using_2;
2004 static PyObject *__pyx_n_s_TypeError;
2005 static PyObject *__pyx_kp_u_Unary_print_clifford_1_1;
2006 static PyObject *__pyx_kp_u_Unary_print_clifford_1_1_2;
2007 static PyObject *__pyx_n_s_ValueError;
2008 static PyObject *__pyx_kp_u_Vector_part_of_multivector_as_a;
2009 static PyObject *__pyx_kp_s__2;
2010 static PyObject *__pyx_kp_s__5;
2011 static PyObject *__pyx_kp_s__6;
2012 static PyObject *__pyx_kp_s__7;
2013 static PyObject *__pyx_kp_s__8;
2014 static PyObject *__pyx_kp_s__9;
2015 static PyObject *__pyx_kp_u_abs_line_1473;
2016 static PyObject *__pyx_n_s_acos;
2017 static PyObject *__pyx_kp_u_acos_line_1619;
2018 static PyObject *__pyx_n_s_acosh;
2019 static PyObject *__pyx_kp_u_acosh_line_1656;
2020 static PyObject *__pyx_kp_u_agc3_line_1844;
2021 static PyObject *__pyx_n_s_args;
2022 static PyObject *__pyx_kp_s_as_frame;
2023 static PyObject *__pyx_n_s_asin;
2024 static PyObject *__pyx_kp_u_asin_line_1698;
2025 static PyObject *__pyx_n_s_asinh;
2026 static PyObject *__pyx_kp_u_asinh_line_1733;
2027 static PyObject *__pyx_n_s_atan;
2028 static PyObject *__pyx_kp_u_atan_line_1769;
2029 static PyObject *__pyx_n_s_atanh;
2030 static PyObject *__pyx_kp_u_atanh_line_1798;
2031 static PyObject *__pyx_kp_u_cga3_line_1824;
2032 static PyObject *__pyx_kp_u_cga3std_line_1833;
2033 static PyObject *__pyx_n_s_cl;
2034 static PyObject *__pyx_kp_u_clifford___add___line_739;
2035 static PyObject *__pyx_kp_u_clifford___and___line_835;
2036 static PyObject *__pyx_kp_u_clifford___call___line_1019;
2037 static PyObject *__pyx_kp_u_clifford___div___line_895;
2038 static PyObject *__pyx_kp_u_clifford___getitem___line_706;
2039 static PyObject *__pyx_kp_u_clifford___iadd___line_750;
2040 static PyObject *__pyx_kp_u_clifford___iand___line_850;
2041 static PyObject *__pyx_kp_u_clifford___idiv___line_910;
2042 static PyObject *__pyx_kp_u_clifford___imod___line_820;
2043 static PyObject *__pyx_kp_u_clifford___imul___line_792;
2044 static PyObject *__pyx_kp_u_clifford___ior___line_949;
2045 static PyObject *__pyx_kp_u_clifford___isub___line_770;
2046 static PyObject *__pyx_kp_u_clifford___iter___line_637;
2047 static PyObject *__pyx_kp_u_clifford___ixor___line_880;
2048 static PyObject *__pyx_kp_u_clifford___mod___line_805;
2049 static PyObject *__pyx_kp_u_clifford___mul___line_779;
2050 static PyObject *__pyx_kp_u_clifford___neg___line_721;
2051 static PyObject *__pyx_kp_u_clifford___or___line_938;
2052 static PyObject *__pyx_kp_u_clifford___pos___line_730;
2053 static PyObject *__pyx_kp_u_clifford___pow___line_960;
2054 static PyObject *__pyx_kp_u_clifford___repr___line_1225;
2055 static PyObject *__pyx_kp_u_clifford___str___line_1234;
2056 static PyObject *__pyx_kp_u_clifford___sub___line_759;
2057 static PyObject *__pyx_kp_u_clifford___xor___line_865;
2058 static PyObject *__pyx_kp_u_clifford_abs_line_1174;
2059 static PyObject *__pyx_kp_u_clifford_conj_line_1137;
2060 static PyObject *__pyx_kp_u_clifford_copy_line_554;
2061 static PyObject *__pyx_kp_u_clifford_even_line_1060;
2062 static PyObject *__pyx_kp_u_clifford_frame_line_1214;
2063 static PyObject *__pyx_n_s_clifford_hidden_doctests;
2064 static PyObject *__pyx_kp_u_clifford_hidden_doctests_line_12;
2065 static PyObject *__pyx_kp_u_clifford_inv_line_925;
2066 static PyObject *__pyx_kp_u_clifford_involute_line_1106;
2067 static PyObject *__pyx_kp_u_clifford_isnan_line_1205;
2068 static PyObject *__pyx_kp_u_clifford_max_abs_line_1183;
2069 static PyObject *__pyx_kp_u_clifford_norm_line_1163;
2070 static PyObject *__pyx_kp_u_clifford_odd_line_1069;
2071 static PyObject *__pyx_kp_u_clifford_outer_pow_line_1003;
2072 static PyObject *__pyx_kp_u_clifford_pow_line_979;
2073 static PyObject *__pyx_kp_u_clifford_pure_line_1049;
2074 static PyObject *__pyx_kp_u_clifford_quad_line_1152;
2075 static PyObject *__pyx_kp_u_clifford_reframe_line_648;
2076 static PyObject *__pyx_kp_u_clifford_reverse_line_1122;
2077 static PyObject *__pyx_kp_u_clifford_scalar_line_1038;
2078 static PyObject *__pyx_kp_u_clifford_truncated_line_1194;
2079 static PyObject *__pyx_kp_u_clifford_vector_part_line_1078;
2080 static PyObject *__pyx_n_s_cline_in_traceback;
2081 static PyObject *__pyx_n_s_close;
2082 static PyObject *__pyx_n_s_collections;
2083 static PyObject *__pyx_kp_u_compare_line_490;
2084 static PyObject *__pyx_kp_u_complexifier_line_1527;
2085 static PyObject *__pyx_n_s_conj;
2086 static PyObject *__pyx_kp_u_conj_line_1436;
2087 static PyObject *__pyx_n_s_copy;
2088 static PyObject *__pyx_n_s_cos;
2089 static PyObject *__pyx_kp_u_cos_line_1602;
2090 static PyObject *__pyx_n_s_cosh;
2091 static PyObject *__pyx_kp_u_cosh_line_1640;
2092 static PyObject *__pyx_n_s_doctest;
2093 static PyObject *__pyx_n_s_e;
2094 static PyObject *__pyx_kp_u_e_line_1887;
2095 static PyObject *__pyx_n_s_even;
2096 static PyObject *__pyx_kp_u_even_line_1388;
2097 static PyObject *__pyx_n_s_exp;
2098 static PyObject *__pyx_kp_u_exp_line_1565;
2099 static PyObject *__pyx_n_s_fill;
2100 static PyObject *__pyx_n_s_frm;
2101 static PyObject *__pyx_kp_s_from;
2102 static PyObject *__pyx_n_s_getstate;
2103 static PyObject *__pyx_n_s_grade;
2104 static PyObject *__pyx_n_s_i;
2105 static PyObject *__pyx_kp_u_imag_line_1366;
2106 static PyObject *__pyx_n_s_import;
2107 static PyObject *__pyx_kp_u_index_set___and___line_269;
2108 static PyObject *__pyx_kp_u_index_set___getitem___line_189;
2109 static PyObject *__pyx_kp_u_index_set___iand___line_280;
2110 static PyObject *__pyx_kp_u_index_set___invert___line_238;
2111 static PyObject *__pyx_kp_u_index_set___ior___line_302;
2112 static PyObject *__pyx_n_s_index_set___iter;
2113 static PyObject *__pyx_kp_u_index_set___iter___line_227;
2114 static PyObject *__pyx_kp_u_index_set___ixor___line_258;
2115 static PyObject *__pyx_kp_u_index_set___or___line_291;
2116 static PyObject *__pyx_kp_u_index_set___repr___line_382;
2117 static PyObject *__pyx_kp_u_index_set___setitem___line_177;
2118 static PyObject *__pyx_kp_u_index_set___str___line_393;
2119 static PyObject *__pyx_kp_u_index_set___xor___line_247;
2120 static PyObject *__pyx_kp_u_index_set_copy_line_64;
2121 static PyObject *__pyx_kp_u_index_set_count_line_313;
2122 static PyObject *__pyx_kp_u_index_set_count_neg_line_322;
2123 static PyObject *__pyx_kp_u_index_set_count_pos_line_331;
2124 static PyObject *__pyx_n_s_index_set_hidden_doctests;
2125 static PyObject *__pyx_kp_u_index_set_hidden_doctests_line_4;
2126 static PyObject *__pyx_kp_u_index_set_max_line_349;
2127 static PyObject *__pyx_kp_u_index_set_min_line_340;
2128 static PyObject *__pyx_kp_u_index_set_sign_of_mult_line_364;
2129 static PyObject *__pyx_kp_u_index_set_sign_of_square_line_37;
2130 static PyObject *__pyx_n_s_inv;
2131 static PyObject *__pyx_kp_u_inv_line_1329;
2132 static PyObject *__pyx_kp_s_invalid;
2133 static PyObject *__pyx_kp_s_invalid_string;
2134 static PyObject *__pyx_n_s_involute;
2135 static PyObject *__pyx_kp_u_involute_line_1406;
2136 static PyObject *__pyx_n_s_ist;
2137 static PyObject *__pyx_n_s_istpq;
2138 static PyObject *__pyx_kp_u_istpq_line_1900;
2139 static PyObject *__pyx_n_s_iter;
2140 static PyObject *__pyx_n_s_ixt;
2141 static PyObject *__pyx_kp_u_lexicographic_compare_eg_3_4_5;
2142 static PyObject *__pyx_n_s_lhs;
2143 static PyObject *__pyx_n_s_log;
2144 static PyObject *__pyx_kp_u_log_line_1579;
2145 static PyObject *__pyx_n_s_m;
2146 static PyObject *__pyx_n_s_main;
2147 static PyObject *__pyx_n_s_math;
2148 static PyObject *__pyx_n_s_max;
2149 static PyObject *__pyx_kp_u_max_abs_line_1482;
2150 static PyObject *__pyx_kp_u_max_pos_line_511;
2151 static PyObject *__pyx_n_s_min;
2152 static PyObject *__pyx_kp_u_min_neg_line_502;
2153 static PyObject *__pyx_n_s_name;
2154 static PyObject *__pyx_n_s_nbar3;
2155 static PyObject *__pyx_n_s_ninf3;
2156 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2157 static PyObject *__pyx_n_s_norm;
2158 static PyObject *__pyx_kp_u_norm_line_1462;
2159 static PyObject *__pyx_kp_u_norm_sum_of_squares_of_coordina;
2160 static PyObject *__pyx_n_s_numbers;
2161 static PyObject *__pyx_n_s_obj;
2162 static PyObject *__pyx_n_s_odd;
2163 static PyObject *__pyx_kp_u_odd_line_1397;
2164 static PyObject *__pyx_n_s_other;
2165 static PyObject *__pyx_n_s_outer_pow;
2166 static PyObject *__pyx_kp_u_outer_pow_line_1518;
2167 static PyObject *__pyx_n_s_p;
2168 static PyObject *__pyx_n_s_pi;
2169 static PyObject *__pyx_n_s_pow;
2170 static PyObject *__pyx_kp_u_pow_line_1494;
2171 static PyObject *__pyx_n_s_pure;
2172 static PyObject *__pyx_kp_u_pure_line_1377;
2173 static PyObject *__pyx_n_s_pyx_vtable;
2174 static PyObject *__pyx_n_s_q;
2175 static PyObject *__pyx_n_s_quad;
2176 static PyObject *__pyx_kp_u_quad_line_1451;
2177 static PyObject *__pyx_kp_u_random_clifford_line_1815;
2178 static PyObject *__pyx_n_s_range;
2179 static PyObject *__pyx_kp_u_real_line_1355;
2180 static PyObject *__pyx_n_s_reduce;
2181 static PyObject *__pyx_n_s_reduce_cython;
2182 static PyObject *__pyx_n_s_reduce_ex;
2183 static PyObject *__pyx_n_s_reverse;
2184 static PyObject *__pyx_kp_u_reverse_line_1421;
2185 static PyObject *__pyx_n_s_rhs;
2186 static PyObject *__pyx_n_s_scalar;
2187 static PyObject *__pyx_kp_u_scalar_line_1344;
2188 static PyObject *__pyx_n_s_send;
2189 static PyObject *__pyx_n_s_setstate;
2190 static PyObject *__pyx_n_s_setstate_cython;
2191 static PyObject *__pyx_n_s_sin;
2192 static PyObject *__pyx_kp_u_sin_line_1679;
2193 static PyObject *__pyx_n_s_sinh;
2194 static PyObject *__pyx_kp_u_sinh_line_1719;
2195 static PyObject *__pyx_n_s_sqrt;
2196 static PyObject *__pyx_kp_u_sqrt_line_1542;
2197 static PyObject *__pyx_n_s_tan;
2198 static PyObject *__pyx_kp_u_tan_line_1752;
2199 static PyObject *__pyx_n_s_tanh;
2200 static PyObject *__pyx_kp_u_tanh_line_1786;
2201 static PyObject *__pyx_n_s_tau;
2202 static PyObject *__pyx_n_s_test;
2203 static PyObject *__pyx_n_s_test_2;
2204 static PyObject *__pyx_n_s_testmod;
2205 static PyObject *__pyx_n_s_throw;
2206 static PyObject *__pyx_kp_s_to_frame;
2207 static PyObject *__pyx_kp_s_using;
2208 static PyObject *__pyx_kp_s_using_invalid;
2209 static PyObject *__pyx_kp_s_value;
2210 static PyObject *__pyx_n_s_version;
2211 static PyObject *__pyx_n_s_xrange;
2212 static PyObject *__pyx_pf_8PyClical_9index_set_copy(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2213 static int __pyx_pf_8PyClical_9index_set_2__cinit__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_other);
2214 static void __pyx_pf_8PyClical_9index_set_4__dealloc__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2215 static PyObject *__pyx_pf_8PyClical_9index_set_6__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op);
2216 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);
2217 static PyObject *__pyx_pf_8PyClical_9index_set_10__getitem__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_idx);
2218 static int __pyx_pf_8PyClical_9index_set_12__contains__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_idx);
2219 static PyObject *__pyx_pf_8PyClical_9index_set_14__iter__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2220 static PyObject *__pyx_pf_8PyClical_9index_set_17__invert__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2221 static PyObject *__pyx_pf_8PyClical_9index_set_19__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2222 static PyObject *__pyx_pf_8PyClical_9index_set_21__ixor__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs);
2223 static PyObject *__pyx_pf_8PyClical_9index_set_23__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2224 static PyObject *__pyx_pf_8PyClical_9index_set_25__iand__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs);
2225 static PyObject *__pyx_pf_8PyClical_9index_set_27__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2226 static PyObject *__pyx_pf_8PyClical_9index_set_29__ior__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs);
2227 static PyObject *__pyx_pf_8PyClical_9index_set_31count(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2228 static PyObject *__pyx_pf_8PyClical_9index_set_33count_neg(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2229 static PyObject *__pyx_pf_8PyClical_9index_set_35count_pos(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2230 static PyObject *__pyx_pf_8PyClical_9index_set_37min(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2231 static PyObject *__pyx_pf_8PyClical_9index_set_39max(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2232 static PyObject *__pyx_pf_8PyClical_9index_set_41hash_fn(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2233 static PyObject *__pyx_pf_8PyClical_9index_set_43sign_of_mult(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs);
2234 static PyObject *__pyx_pf_8PyClical_9index_set_45sign_of_square(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2235 static PyObject *__pyx_pf_8PyClical_9index_set_47__repr__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2236 static PyObject *__pyx_pf_8PyClical_9index_set_49__str__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2237 static PyObject *__pyx_pf_8PyClical_9index_set_51__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2238 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);
2239 static PyObject *__pyx_pf_8PyClical_index_set_hidden_doctests(CYTHON_UNUSED PyObject *__pyx_self);
2240 static PyObject *__pyx_pf_8PyClical_2compare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2241 static PyObject *__pyx_pf_8PyClical_4min_neg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2242 static PyObject *__pyx_pf_8PyClical_6max_pos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2243 static PyObject *__pyx_pf_8PyClical_8clifford_copy(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2244 static int __pyx_pf_8PyClical_8clifford_2__cinit__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_ixt);
2245 static void __pyx_pf_8PyClical_8clifford_4__dealloc__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2246 static int __pyx_pf_8PyClical_8clifford_6__contains__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_x);
2247 static PyObject *__pyx_pf_8PyClical_8clifford_8__iter__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2248 static PyObject *__pyx_pf_8PyClical_8clifford_10reframe(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_ixt);
2249 static PyObject *__pyx_pf_8PyClical_8clifford_12__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op);
2250 static PyObject *__pyx_pf_8PyClical_8clifford_14__getitem__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_ixt);
2251 static PyObject *__pyx_pf_8PyClical_8clifford_16__neg__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2252 static PyObject *__pyx_pf_8PyClical_8clifford_18__pos__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2253 static PyObject *__pyx_pf_8PyClical_8clifford_20__add__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2254 static PyObject *__pyx_pf_8PyClical_8clifford_22__iadd__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2255 static PyObject *__pyx_pf_8PyClical_8clifford_24__sub__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2256 static PyObject *__pyx_pf_8PyClical_8clifford_26__isub__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2257 static PyObject *__pyx_pf_8PyClical_8clifford_28__mul__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2258 static PyObject *__pyx_pf_8PyClical_8clifford_30__imul__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2259 static PyObject *__pyx_pf_8PyClical_8clifford_32__mod__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2260 static PyObject *__pyx_pf_8PyClical_8clifford_34__imod__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2261 static PyObject *__pyx_pf_8PyClical_8clifford_36__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2262 static PyObject *__pyx_pf_8PyClical_8clifford_38__iand__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2263 static PyObject *__pyx_pf_8PyClical_8clifford_40__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2264 static PyObject *__pyx_pf_8PyClical_8clifford_42__ixor__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2265 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 2266 static PyObject *__pyx_pf_8PyClical_8clifford_44__div__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2268 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 2269 static PyObject *__pyx_pf_8PyClical_8clifford_46__idiv__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2271 static PyObject *__pyx_pf_8PyClical_8clifford_48inv(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2272 static PyObject *__pyx_pf_8PyClical_8clifford_50__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2273 static PyObject *__pyx_pf_8PyClical_8clifford_52__ior__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2274 static PyObject *__pyx_pf_8PyClical_8clifford_54__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_m, CYTHON_UNUSED PyObject *__pyx_v_dummy);
2275 static PyObject *__pyx_pf_8PyClical_8clifford_56pow(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_m);
2276 static PyObject *__pyx_pf_8PyClical_8clifford_58outer_pow(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_m);
2277 static PyObject *__pyx_pf_8PyClical_8clifford_60__call__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_grade);
2278 static PyObject *__pyx_pf_8PyClical_8clifford_62scalar(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2279 static PyObject *__pyx_pf_8PyClical_8clifford_64pure(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2280 static PyObject *__pyx_pf_8PyClical_8clifford_66even(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2281 static PyObject *__pyx_pf_8PyClical_8clifford_68odd(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2282 static PyObject *__pyx_pf_8PyClical_8clifford_70vector_part(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_frm);
2283 static PyObject *__pyx_pf_8PyClical_8clifford_72involute(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2284 static PyObject *__pyx_pf_8PyClical_8clifford_74reverse(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2285 static PyObject *__pyx_pf_8PyClical_8clifford_76conj(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2286 static PyObject *__pyx_pf_8PyClical_8clifford_78quad(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2287 static PyObject *__pyx_pf_8PyClical_8clifford_80norm(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2288 static PyObject *__pyx_pf_8PyClical_8clifford_82abs(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2289 static PyObject *__pyx_pf_8PyClical_8clifford_84max_abs(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2290 static PyObject *__pyx_pf_8PyClical_8clifford_86truncated(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_limit);
2291 static PyObject *__pyx_pf_8PyClical_8clifford_88isnan(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2292 static PyObject *__pyx_pf_8PyClical_8clifford_90frame(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2293 static PyObject *__pyx_pf_8PyClical_8clifford_92__repr__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2294 static PyObject *__pyx_pf_8PyClical_8clifford_94__str__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2295 static PyObject *__pyx_pf_8PyClical_8clifford_96__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2296 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);
2297 static PyObject *__pyx_pf_8PyClical_8clifford_hidden_doctests(CYTHON_UNUSED PyObject *__pyx_self);
2298 static PyObject *__pyx_pf_8PyClical_10inv(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2299 static PyObject *__pyx_pf_8PyClical_12scalar(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2300 static PyObject *__pyx_pf_8PyClical_14real(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2301 static PyObject *__pyx_pf_8PyClical_16imag(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2302 static PyObject *__pyx_pf_8PyClical_18pure(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2303 static PyObject *__pyx_pf_8PyClical_20even(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2304 static PyObject *__pyx_pf_8PyClical_22odd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2305 static PyObject *__pyx_pf_8PyClical_24involute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2306 static PyObject *__pyx_pf_8PyClical_26reverse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2307 static PyObject *__pyx_pf_8PyClical_28conj(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2308 static PyObject *__pyx_pf_8PyClical_30quad(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2309 static PyObject *__pyx_pf_8PyClical_32norm(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2310 static PyObject *__pyx_pf_8PyClical_34abs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2311 static PyObject *__pyx_pf_8PyClical_36max_abs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2312 static PyObject *__pyx_pf_8PyClical_38pow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_m);
2313 static PyObject *__pyx_pf_8PyClical_40outer_pow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_m);
2314 static PyObject *__pyx_pf_8PyClical_42complexifier(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2315 static PyObject *__pyx_pf_8PyClical_44sqrt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2316 static PyObject *__pyx_pf_8PyClical_46exp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2317 static PyObject *__pyx_pf_8PyClical_48log(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2318 static PyObject *__pyx_pf_8PyClical_50cos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2319 static PyObject *__pyx_pf_8PyClical_52acos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2320 static PyObject *__pyx_pf_8PyClical_54cosh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2321 static PyObject *__pyx_pf_8PyClical_56acosh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2322 static PyObject *__pyx_pf_8PyClical_58sin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2323 static PyObject *__pyx_pf_8PyClical_60asin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2324 static PyObject *__pyx_pf_8PyClical_62sinh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2325 static PyObject *__pyx_pf_8PyClical_64asinh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2326 static PyObject *__pyx_pf_8PyClical_66tan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2327 static PyObject *__pyx_pf_8PyClical_68atan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2328 static PyObject *__pyx_pf_8PyClical_70tanh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2329 static PyObject *__pyx_pf_8PyClical_72atanh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2330 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);
2331 static PyObject *__pyx_pf_8PyClical_76cga3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2332 static PyObject *__pyx_pf_8PyClical_78cga3std(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2333 static PyObject *__pyx_pf_8PyClical_80agc3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2334 static PyObject *__pyx_pf_8PyClical_82e(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2335 static PyObject *__pyx_pf_8PyClical_84istpq(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_p, PyObject *__pyx_v_q);
2336 static PyObject *__pyx_pf_8PyClical_86_test(CYTHON_UNUSED PyObject *__pyx_self);
2337 static PyObject *__pyx_tp_new_8PyClical_index_set(PyTypeObject *t, PyObject *a, PyObject *k);
2338 static PyObject *__pyx_tp_new_8PyClical_clifford(PyTypeObject *t, PyObject *a, PyObject *k);
2339 static PyObject *__pyx_tp_new_8PyClical___pyx_scope_struct____iter__(PyTypeObject *t, PyObject *a, PyObject *k);
2340 static PyObject *__pyx_float_0_0;
2341 static PyObject *__pyx_float_1_0;
2342 static PyObject *__pyx_float_2_0;
2343 static PyObject *__pyx_float_8_0;
2344 static PyObject *__pyx_int_0;
2345 static PyObject *__pyx_int_1;
2346 static PyObject *__pyx_int_4;
2347 static PyObject *__pyx_int_neg_1;
2348 static PyObject *__pyx_tuple__3;
2349 static PyObject *__pyx_tuple__4;
2350 static PyObject *__pyx_tuple__10;
2351 static PyObject *__pyx_tuple__11;
2352 static PyObject *__pyx_tuple__12;
2353 static PyObject *__pyx_tuple__13;
2354 static PyObject *__pyx_tuple__16;
2355 static PyObject *__pyx_tuple__17;
2356 static PyObject *__pyx_tuple__19;
2357 static PyObject *__pyx_tuple__21;
2358 static PyObject *__pyx_tuple__22;
2359 static PyObject *__pyx_tuple__23;
2360 static PyObject *__pyx_tuple__24;
2361 static PyObject *__pyx_tuple__25;
2362 static PyObject *__pyx_codeobj__14;
2363 static PyObject *__pyx_codeobj__15;
2364 static PyObject *__pyx_codeobj__18;
2365 static PyObject *__pyx_codeobj__20;
2366 static PyObject *__pyx_codeobj__26;
2376 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_toIndexSet(PyObject *__pyx_v_obj) {
2378 __Pyx_RefNannyDeclarations
2379 PyObject *__pyx_t_1 = NULL;
2380 PyObject *__pyx_t_2 = NULL;
2381 __Pyx_RefNannySetupContext(
"toIndexSet", 0);
2390 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
2391 __Pyx_GOTREF(__pyx_t_1);
2392 __Pyx_INCREF(__pyx_v_obj);
2393 __Pyx_GIVEREF(__pyx_v_obj);
2394 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_obj);
2395 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_index_set), __pyx_t_1, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error)
2396 __Pyx_GOTREF(__pyx_t_2);
2397 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2398 __pyx_r = (((
struct __pyx_obj_8PyClical_index_set *)__pyx_t_2)->instance[0]);
2399 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2412 __Pyx_XDECREF(__pyx_t_1);
2413 __Pyx_XDECREF(__pyx_t_2);
2414 __Pyx_WriteUnraisable(
"PyClical.toIndexSet", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
2415 __Pyx_pretend_to_initialize(&__pyx_r);
2417 __Pyx_RefNannyFinishContext();
2429 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_9index_set_wrap(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self,
IndexSet __pyx_v_other) {
2430 PyObject *__pyx_r = NULL;
2431 __Pyx_RefNannyDeclarations
2432 __Pyx_RefNannySetupContext(
"wrap", 0);
2441 (__pyx_v_self->instance[0]) = __pyx_v_other;
2450 __Pyx_XDECREF(__pyx_r);
2451 __Pyx_INCREF(((PyObject *)__pyx_v_self));
2452 __pyx_r = ((PyObject *)__pyx_v_self);
2465 __Pyx_XGIVEREF(__pyx_r);
2466 __Pyx_RefNannyFinishContext();
2478 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_9index_set_unwrap(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
2480 __Pyx_RefNannyDeclarations
2481 __Pyx_RefNannySetupContext(
"unwrap", 0);
2490 __pyx_r = (__pyx_v_self->instance[0]);
2503 __Pyx_RefNannyFinishContext();
2515 static PyObject *__pyx_pw_8PyClical_9index_set_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
2516 static PyObject *__pyx_f_8PyClical_9index_set_copy(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self,
int __pyx_skip_dispatch) {
2517 PyObject *__pyx_r = NULL;
2518 __Pyx_RefNannyDeclarations
2519 PyObject *__pyx_t_1 = NULL;
2520 PyObject *__pyx_t_2 = NULL;
2521 PyObject *__pyx_t_3 = NULL;
2522 PyObject *__pyx_t_4 = NULL;
2523 __Pyx_RefNannySetupContext(
"copy", 0);
2525 if (unlikely(__pyx_skip_dispatch)) ;
2527 else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
2528 __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)
2529 __Pyx_GOTREF(__pyx_t_1);
2530 if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_8PyClical_9index_set_1copy)) {
2531 __Pyx_XDECREF(__pyx_r);
2532 __Pyx_INCREF(__pyx_t_1);
2533 __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
2534 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
2535 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
2536 if (likely(__pyx_t_4)) {
2537 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
2538 __Pyx_INCREF(__pyx_t_4);
2539 __Pyx_INCREF(
function);
2540 __Pyx_DECREF_SET(__pyx_t_3,
function);
2544 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error)
2545 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2547 __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error)
2549 __Pyx_GOTREF(__pyx_t_2);
2550 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2551 __pyx_r = __pyx_t_2;
2553 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2556 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2566 __Pyx_XDECREF(__pyx_r);
2567 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error)
2568 __Pyx_GOTREF(__pyx_t_1);
2569 __Pyx_INCREF(((PyObject *)__pyx_v_self));
2570 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
2571 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
2572 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_index_set), __pyx_t_1, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error)
2573 __Pyx_GOTREF(__pyx_t_2);
2574 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2575 __pyx_r = __pyx_t_2;
2589 __Pyx_XDECREF(__pyx_t_1);
2590 __Pyx_XDECREF(__pyx_t_2);
2591 __Pyx_XDECREF(__pyx_t_3);
2592 __Pyx_XDECREF(__pyx_t_4);
2593 __Pyx_AddTraceback(
"PyClical.index_set.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
2596 __Pyx_XGIVEREF(__pyx_r);
2597 __Pyx_RefNannyFinishContext();
2602 static PyObject *__pyx_pw_8PyClical_9index_set_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
2603 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 ";
2604 static PyObject *__pyx_pw_8PyClical_9index_set_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
2605 PyObject *__pyx_r = 0;
2606 __Pyx_RefNannyDeclarations
2607 __Pyx_RefNannySetupContext(
"copy (wrapper)", 0);
2608 __pyx_r = __pyx_pf_8PyClical_9index_set_copy(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
2611 __Pyx_RefNannyFinishContext();
2615 static PyObject *__pyx_pf_8PyClical_9index_set_copy(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
2616 PyObject *__pyx_r = NULL;
2617 __Pyx_RefNannyDeclarations
2618 PyObject *__pyx_t_1 = NULL;
2619 __Pyx_RefNannySetupContext(
"copy", 0);
2620 __Pyx_XDECREF(__pyx_r);
2621 __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)
2622 __Pyx_GOTREF(__pyx_t_1);
2623 __pyx_r = __pyx_t_1;
2629 __Pyx_XDECREF(__pyx_t_1);
2630 __Pyx_AddTraceback(
"PyClical.index_set.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
2633 __Pyx_XGIVEREF(__pyx_r);
2634 __Pyx_RefNannyFinishContext();
2647 static int __pyx_pw_8PyClical_9index_set_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2648 static int __pyx_pw_8PyClical_9index_set_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2649 PyObject *__pyx_v_other = 0;
2651 __Pyx_RefNannyDeclarations
2652 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
2654 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,0};
2655 PyObject* values[1] = {0};
2656 values[0] = ((PyObject *)__pyx_int_0);
2657 if (unlikely(__pyx_kwds)) {
2659 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2661 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2664 default:
goto __pyx_L5_argtuple_error;
2666 kw_args = PyDict_Size(__pyx_kwds);
2670 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other);
2671 if (value) { values[0] = value; kw_args--; }
2674 if (unlikely(kw_args > 0)) {
2675 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(0, 73, __pyx_L3_error)
2678 switch (PyTuple_GET_SIZE(__pyx_args)) {
2679 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2682 default:
goto __pyx_L5_argtuple_error;
2685 __pyx_v_other = values[0];
2687 goto __pyx_L4_argument_unpacking_done;
2688 __pyx_L5_argtuple_error:;
2689 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 73, __pyx_L3_error)
2691 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2692 __Pyx_RefNannyFinishContext();
2694 __pyx_L4_argument_unpacking_done:;
2695 __pyx_r = __pyx_pf_8PyClical_9index_set_2__cinit__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), __pyx_v_other);
2698 __Pyx_RefNannyFinishContext();
2702 static int __pyx_pf_8PyClical_9index_set_2__cinit__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_other) {
2703 PyObject *__pyx_v_error_msg_prefix = NULL;
2704 PyObject *__pyx_v_idx = NULL;
2706 __Pyx_RefNannyDeclarations
2710 PyObject *__pyx_t_4 = NULL;
2711 PyObject *__pyx_t_5 = NULL;
2714 PyObject *__pyx_t_8 = NULL;
2715 PyObject *__pyx_t_9 = NULL;
2716 PyObject *__pyx_t_10 = NULL;
2717 Py_ssize_t __pyx_t_11;
2718 PyObject *(*__pyx_t_12)(PyObject *);
2719 PyObject *__pyx_t_13 = NULL;
2720 PyObject *__pyx_t_14 = NULL;
2721 PyObject *__pyx_t_15 = NULL;
2722 PyObject *__pyx_t_16 = NULL;
2724 __Pyx_RefNannySetupContext(
"__cinit__", 0);
2733 __Pyx_INCREF(__pyx_kp_s_Cannot_initialize_index_set_obje);
2734 __pyx_v_error_msg_prefix = __pyx_kp_s_Cannot_initialize_index_set_obje;
2743 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8PyClical_index_set);
2744 __pyx_t_2 = (__pyx_t_1 != 0);
2755 __pyx_t_3 =
new IndexSet(__pyx_f_8PyClical_9index_set_unwrap(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_other)));
2757 __Pyx_CppExn2PyErr();
2758 __PYX_ERR(0, 94, __pyx_L1_error)
2760 __pyx_v_self->instance = __pyx_t_3;
2779 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numbers);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 95, __pyx_L1_error)
2780 __Pyx_GOTREF(__pyx_t_4);
2781 __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)
2782 __Pyx_GOTREF(__pyx_t_5);
2783 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2784 __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)
2785 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2786 __pyx_t_1 = (__pyx_t_2 != 0);
2796 __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)
2798 __pyx_t_3 =
new IndexSet(((
int)__pyx_t_6));
2800 __Pyx_CppExn2PyErr();
2801 __PYX_ERR(0, 96, __pyx_L1_error)
2803 __pyx_v_self->instance = __pyx_t_3;
2822 __pyx_t_2 = PySet_Check(__pyx_v_other);
2823 __pyx_t_7 = (__pyx_t_2 != 0);
2826 __pyx_t_1 = __pyx_t_7;
2827 goto __pyx_L4_bool_binop_done;
2829 __pyx_t_7 = PyFrozenSet_Check(__pyx_v_other);
2830 __pyx_t_2 = (__pyx_t_7 != 0);
2831 __pyx_t_1 = __pyx_t_2;
2832 __pyx_L4_bool_binop_done:;
2833 __pyx_t_2 = (__pyx_t_1 != 0);
2844 __Pyx_PyThreadState_declare
2845 __Pyx_PyThreadState_assign
2846 __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
2847 __Pyx_XGOTREF(__pyx_t_8);
2848 __Pyx_XGOTREF(__pyx_t_9);
2849 __Pyx_XGOTREF(__pyx_t_10);
2860 __pyx_v_self->instance = __pyx_t_3;
2869 if (likely(PyList_CheckExact(__pyx_v_other)) || PyTuple_CheckExact(__pyx_v_other)) {
2870 __pyx_t_5 = __pyx_v_other; __Pyx_INCREF(__pyx_t_5); __pyx_t_11 = 0;
2873 __pyx_t_11 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_other);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 100, __pyx_L6_error)
2874 __Pyx_GOTREF(__pyx_t_5);
2875 __pyx_t_12 = Py_TYPE(__pyx_t_5)->tp_iternext;
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 100, __pyx_L6_error)
2878 if (likely(!__pyx_t_12)) {
2879 if (likely(PyList_CheckExact(__pyx_t_5))) {
2880 if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_5))
break;
2881 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 2882 __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)
2884 __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)
2885 __Pyx_GOTREF(__pyx_t_4);
2888 if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_5))
break;
2889 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 2890 __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)
2892 __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)
2893 __Pyx_GOTREF(__pyx_t_4);
2897 __pyx_t_4 = __pyx_t_12(__pyx_t_5);
2898 if (unlikely(!__pyx_t_4)) {
2899 PyObject* exc_type = PyErr_Occurred();
2901 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
2902 else __PYX_ERR(0, 100, __pyx_L6_error)
2906 __Pyx_GOTREF(__pyx_t_4);
2908 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_4);
2918 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self), __pyx_v_idx, Py_True) < 0)) __PYX_ERR(0, 101, __pyx_L6_error)
2928 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2938 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
2939 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
2940 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
2941 goto __pyx_L11_try_end;
2943 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
2944 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
2953 __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_IndexError);
2955 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2956 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_13) < 0) __PYX_ERR(0, 102, __pyx_L8_except_error)
2957 __Pyx_GOTREF(__pyx_t_5);
2958 __Pyx_GOTREF(__pyx_t_4);
2959 __Pyx_GOTREF(__pyx_t_13);
2968 __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)
2969 __Pyx_GOTREF(__pyx_t_14);
2970 __pyx_t_15 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 103, __pyx_L8_except_error)
2971 __Pyx_GOTREF(__pyx_t_15);
2972 __pyx_t_16 = PyNumber_Add(__pyx_t_14, __pyx_t_15);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 103, __pyx_L8_except_error)
2973 __Pyx_GOTREF(__pyx_t_16);
2974 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
2975 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
2976 __pyx_t_15 = PyNumber_Add(__pyx_t_16, __pyx_kp_s_);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 103, __pyx_L8_except_error)
2977 __Pyx_GOTREF(__pyx_t_15);
2978 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
2979 __pyx_t_16 = PyTuple_New(1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 103, __pyx_L8_except_error)
2980 __Pyx_GOTREF(__pyx_t_16);
2981 __Pyx_GIVEREF(__pyx_t_15);
2982 PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_15);
2984 __pyx_t_15 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_16, NULL);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 103, __pyx_L8_except_error)
2985 __Pyx_GOTREF(__pyx_t_15);
2986 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
2987 __Pyx_Raise(__pyx_t_15, 0, 0, 0);
2988 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
2989 __PYX_ERR(0, 103, __pyx_L8_except_error)
2999 __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
3001 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3002 if (__Pyx_GetException(&__pyx_t_13, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(0, 104, __pyx_L8_except_error)
3003 __Pyx_GOTREF(__pyx_t_13);
3004 __Pyx_GOTREF(__pyx_t_4);
3005 __Pyx_GOTREF(__pyx_t_5);
3014 __pyx_t_15 = PyNumber_Add(__pyx_v_error_msg_prefix, __pyx_kp_s_invalid);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 105, __pyx_L8_except_error)
3015 __Pyx_GOTREF(__pyx_t_15);
3016 __pyx_t_16 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 105, __pyx_L8_except_error)
3017 __Pyx_GOTREF(__pyx_t_16);
3018 __pyx_t_14 = PyNumber_Add(__pyx_t_15, __pyx_t_16);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 105, __pyx_L8_except_error)
3019 __Pyx_GOTREF(__pyx_t_14);
3020 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3021 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3022 __pyx_t_16 = PyNumber_Add(__pyx_t_14, __pyx_kp_s_);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 105, __pyx_L8_except_error)
3023 __Pyx_GOTREF(__pyx_t_16);
3024 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3025 __pyx_t_14 = PyTuple_New(1);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 105, __pyx_L8_except_error)
3026 __Pyx_GOTREF(__pyx_t_14);
3027 __Pyx_GIVEREF(__pyx_t_16);
3028 PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_16);
3030 __pyx_t_16 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_14, NULL);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 105, __pyx_L8_except_error)
3031 __Pyx_GOTREF(__pyx_t_16);
3032 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3033 __Pyx_Raise(__pyx_t_16, 0, 0, 0);
3034 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3035 __PYX_ERR(0, 105, __pyx_L8_except_error)
3037 goto __pyx_L8_except_error;
3038 __pyx_L8_except_error:;
3047 __Pyx_XGIVEREF(__pyx_t_8);
3048 __Pyx_XGIVEREF(__pyx_t_9);
3049 __Pyx_XGIVEREF(__pyx_t_10);
3050 __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
3051 goto __pyx_L1_error;
3072 __pyx_t_2 = PyString_Check(__pyx_v_other);
3073 __pyx_t_1 = (__pyx_t_2 != 0);
3084 __Pyx_PyThreadState_declare
3085 __Pyx_PyThreadState_assign
3086 __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
3087 __Pyx_XGOTREF(__pyx_t_10);
3088 __Pyx_XGOTREF(__pyx_t_9);
3089 __Pyx_XGOTREF(__pyx_t_8);
3099 __pyx_t_17 = __Pyx_PyObject_AsWritableString(__pyx_v_other);
if (unlikely((!__pyx_t_17) && PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L18_error)
3101 __pyx_t_3 =
new IndexSet(((
char *)__pyx_t_17));
3103 __Pyx_CppExn2PyErr();
3104 __PYX_ERR(0, 108, __pyx_L18_error)
3106 __pyx_v_self->instance = __pyx_t_3;
3116 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3117 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
3118 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3119 goto __pyx_L23_try_end;
3121 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
3122 __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
3123 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
3124 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
3125 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3126 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3135 __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
3137 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3138 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_13) < 0) __PYX_ERR(0, 109, __pyx_L20_except_error)
3139 __Pyx_GOTREF(__pyx_t_5);
3140 __Pyx_GOTREF(__pyx_t_4);
3141 __Pyx_GOTREF(__pyx_t_13);
3150 __pyx_t_16 = PyNumber_Add(__pyx_v_error_msg_prefix, __pyx_kp_s_invalid_string);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 110, __pyx_L20_except_error)
3151 __Pyx_GOTREF(__pyx_t_16);
3152 __pyx_t_14 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 110, __pyx_L20_except_error)
3153 __Pyx_GOTREF(__pyx_t_14);
3154 __pyx_t_15 = PyNumber_Add(__pyx_t_16, __pyx_t_14);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 110, __pyx_L20_except_error)
3155 __Pyx_GOTREF(__pyx_t_15);
3156 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3157 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3158 __pyx_t_14 = PyNumber_Add(__pyx_t_15, __pyx_kp_s_);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 110, __pyx_L20_except_error)
3159 __Pyx_GOTREF(__pyx_t_14);
3160 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3161 __pyx_t_15 = PyTuple_New(1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 110, __pyx_L20_except_error)
3162 __Pyx_GOTREF(__pyx_t_15);
3163 __Pyx_GIVEREF(__pyx_t_14);
3164 PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_14);
3166 __pyx_t_14 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_15, NULL);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 110, __pyx_L20_except_error)
3167 __Pyx_GOTREF(__pyx_t_14);
3168 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3169 __Pyx_Raise(__pyx_t_14, 0, 0, 0);
3170 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3171 __PYX_ERR(0, 110, __pyx_L20_except_error)
3173 goto __pyx_L20_except_error;
3174 __pyx_L20_except_error:;
3183 __Pyx_XGIVEREF(__pyx_t_10);
3184 __Pyx_XGIVEREF(__pyx_t_9);
3185 __Pyx_XGIVEREF(__pyx_t_8);
3186 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8);
3187 goto __pyx_L1_error;
3209 __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)
3210 __Pyx_GOTREF(__pyx_t_13);
3211 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 112, __pyx_L1_error)
3212 __Pyx_GOTREF(__pyx_t_4);
3213 __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_other)));
3214 __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_other)));
3215 PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)Py_TYPE(__pyx_v_other)));
3216 __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_4, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 112, __pyx_L1_error)
3217 __Pyx_GOTREF(__pyx_t_5);
3218 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3219 __pyx_t_4 = PyNumber_Add(__pyx_t_13, __pyx_t_5);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 112, __pyx_L1_error)
3220 __Pyx_GOTREF(__pyx_t_4);
3221 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
3222 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3223 __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_kp_s_);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 112, __pyx_L1_error)
3224 __Pyx_GOTREF(__pyx_t_5);
3225 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3226 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 112, __pyx_L1_error)
3227 __Pyx_GOTREF(__pyx_t_4);
3228 __Pyx_GIVEREF(__pyx_t_5);
3229 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
3231 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_4, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 112, __pyx_L1_error)
3232 __Pyx_GOTREF(__pyx_t_5);
3233 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3234 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
3235 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3236 __PYX_ERR(0, 112, __pyx_L1_error)
3252 __Pyx_XDECREF(__pyx_t_4);
3253 __Pyx_XDECREF(__pyx_t_5);
3254 __Pyx_XDECREF(__pyx_t_13);
3255 __Pyx_XDECREF(__pyx_t_14);
3256 __Pyx_XDECREF(__pyx_t_15);
3257 __Pyx_XDECREF(__pyx_t_16);
3258 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3261 __Pyx_XDECREF(__pyx_v_error_msg_prefix);
3262 __Pyx_XDECREF(__pyx_v_idx);
3263 __Pyx_RefNannyFinishContext();
3276 static void __pyx_pw_8PyClical_9index_set_5__dealloc__(PyObject *__pyx_v_self);
3277 static void __pyx_pw_8PyClical_9index_set_5__dealloc__(PyObject *__pyx_v_self) {
3278 __Pyx_RefNannyDeclarations
3279 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
3280 __pyx_pf_8PyClical_9index_set_4__dealloc__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
3283 __Pyx_RefNannyFinishContext();
3286 static void __pyx_pf_8PyClical_9index_set_4__dealloc__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
3287 __Pyx_RefNannyDeclarations
3288 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
3297 delete __pyx_v_self->instance;
3308 __Pyx_RefNannyFinishContext();
3320 static PyObject *__pyx_pw_8PyClical_9index_set_7__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op);
3321 static PyObject *__pyx_pw_8PyClical_9index_set_7__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op) {
3322 PyObject *__pyx_r = 0;
3323 __Pyx_RefNannyDeclarations
3324 __Pyx_RefNannySetupContext(
"__richcmp__ (wrapper)", 0);
3325 __pyx_r = __pyx_pf_8PyClical_9index_set_6__richcmp__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs), ((
int)__pyx_v_op));
3328 __Pyx_RefNannyFinishContext();
3332 static PyObject *__pyx_pf_8PyClical_9index_set_6__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op) {
3333 PyObject *__pyx_v_eq = NULL;
3334 PyObject *__pyx_v_lt = NULL;
3335 PyObject *__pyx_r = NULL;
3336 __Pyx_RefNannyDeclarations
3340 PyObject *__pyx_t_4 = NULL;
3341 __Pyx_RefNannySetupContext(
"__richcmp__", 0);
3350 __pyx_t_2 = (__pyx_v_lhs == Py_None);
3351 __pyx_t_3 = (__pyx_t_2 != 0);
3354 __pyx_t_1 = __pyx_t_3;
3355 goto __pyx_L4_bool_binop_done;
3357 __pyx_t_3 = (__pyx_v_rhs == Py_None);
3358 __pyx_t_2 = (__pyx_t_3 != 0);
3359 __pyx_t_1 = __pyx_t_2;
3360 __pyx_L4_bool_binop_done:;
3370 __pyx_t_1 = (__pyx_v_lhs == __pyx_v_rhs);
3371 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 142, __pyx_L1_error)
3372 __Pyx_GOTREF(__pyx_t_4);
3373 __pyx_v_eq = __pyx_t_4;
3383 switch (__pyx_v_op) {
3393 __Pyx_XDECREF(__pyx_r);
3394 __Pyx_INCREF(__pyx_v_eq);
3395 __pyx_r = __pyx_v_eq;
3423 __Pyx_XDECREF(__pyx_r);
3424 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_eq);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 146, __pyx_L1_error)
3425 __pyx_t_4 = __Pyx_PyBool_FromLong((!__pyx_t_1));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error)
3426 __Pyx_GOTREF(__pyx_t_4);
3427 __pyx_r = __pyx_t_4;
3448 __pyx_t_1 = ((__pyx_v_op == 0) != 0);
3458 __Pyx_XDECREF(__pyx_r);
3459 __Pyx_INCREF(Py_False);
3479 __pyx_t_1 = ((__pyx_v_op == 1) != 0);
3489 __Pyx_XDECREF(__pyx_r);
3490 __Pyx_INCREF(__pyx_v_eq);
3491 __pyx_r = __pyx_v_eq;
3510 __pyx_t_1 = ((__pyx_v_op == 4) != 0);
3520 __Pyx_XDECREF(__pyx_r);
3521 __Pyx_INCREF(Py_False);
3541 __pyx_t_1 = ((__pyx_v_op == 5) != 0);
3551 __Pyx_XDECREF(__pyx_r);
3552 __Pyx_INCREF(__pyx_v_eq);
3553 __pyx_r = __pyx_v_eq;
3573 __Pyx_XDECREF(__pyx_r);
3574 __Pyx_INCREF(__pyx_builtin_NotImplemented);
3575 __pyx_r = __pyx_builtin_NotImplemented;
3598 __pyx_t_1 = (__pyx_f_8PyClical_toIndexSet(__pyx_v_lhs) == __pyx_f_8PyClical_toIndexSet(__pyx_v_rhs));
3599 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error)
3600 __Pyx_GOTREF(__pyx_t_4);
3601 __pyx_v_eq = __pyx_t_4;
3611 switch (__pyx_v_op) {
3621 __Pyx_XDECREF(__pyx_r);
3622 __Pyx_INCREF(__pyx_v_eq);
3623 __pyx_r = __pyx_v_eq;
3651 __Pyx_XDECREF(__pyx_r);
3652 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_eq);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 163, __pyx_L1_error)
3653 __pyx_t_4 = __Pyx_PyBool_FromLong((!__pyx_t_1));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error)
3654 __Pyx_GOTREF(__pyx_t_4);
3655 __pyx_r = __pyx_t_4;
3676 __pyx_t_1 = (__pyx_f_8PyClical_toIndexSet(__pyx_v_lhs) < __pyx_f_8PyClical_toIndexSet(__pyx_v_rhs));
3677 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error)
3678 __Pyx_GOTREF(__pyx_t_4);
3679 __pyx_v_lt = __pyx_t_4;
3689 __pyx_t_1 = ((__pyx_v_op == 0) != 0);
3699 __Pyx_XDECREF(__pyx_r);
3700 __Pyx_INCREF(__pyx_v_lt);
3701 __pyx_r = __pyx_v_lt;
3720 __pyx_t_1 = ((__pyx_v_op == 1) != 0);
3730 __Pyx_XDECREF(__pyx_r);
3731 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_lt);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 169, __pyx_L1_error)
3734 __Pyx_INCREF(__pyx_v_lt);
3735 __pyx_t_4 = __pyx_v_lt;
3736 goto __pyx_L8_bool_binop_done;
3738 __Pyx_INCREF(__pyx_v_eq);
3739 __pyx_t_4 = __pyx_v_eq;
3740 __pyx_L8_bool_binop_done:;
3741 __pyx_r = __pyx_t_4;
3761 __pyx_t_1 = ((__pyx_v_op == 4) != 0);
3771 __Pyx_XDECREF(__pyx_r);
3772 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_lt);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 171, __pyx_L1_error)
3775 __pyx_t_1 = __pyx_t_2;
3776 goto __pyx_L10_bool_binop_done;
3778 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_eq);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 171, __pyx_L1_error)
3779 __pyx_t_1 = __pyx_t_2;
3780 __pyx_L10_bool_binop_done:;
3781 __pyx_t_4 = __Pyx_PyBool_FromLong((!__pyx_t_1));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error)
3782 __Pyx_GOTREF(__pyx_t_4);
3783 __pyx_r = __pyx_t_4;
3803 __pyx_t_1 = ((__pyx_v_op == 5) != 0);
3813 __Pyx_XDECREF(__pyx_r);
3814 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_lt);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 173, __pyx_L1_error)
3815 __pyx_t_4 = __Pyx_PyBool_FromLong((!__pyx_t_1));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 173, __pyx_L1_error)
3816 __Pyx_GOTREF(__pyx_t_4);
3817 __pyx_r = __pyx_t_4;
3838 __Pyx_XDECREF(__pyx_r);
3839 __Pyx_INCREF(__pyx_builtin_NotImplemented);
3840 __pyx_r = __pyx_builtin_NotImplemented;
3857 __Pyx_XDECREF(__pyx_t_4);
3858 __Pyx_AddTraceback(
"PyClical.index_set.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3861 __Pyx_XDECREF(__pyx_v_eq);
3862 __Pyx_XDECREF(__pyx_v_lt);
3863 __Pyx_XGIVEREF(__pyx_r);
3864 __Pyx_RefNannyFinishContext();
3877 static int __pyx_pw_8PyClical_9index_set_9__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx, PyObject *__pyx_v_val);
3878 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 ";
3879 #if CYTHON_COMPILING_IN_CPYTHON 3880 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_8__setitem__;
3882 static int __pyx_pw_8PyClical_9index_set_9__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx, PyObject *__pyx_v_val) {
3884 __Pyx_RefNannyDeclarations
3885 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
3886 __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));
3889 __Pyx_RefNannyFinishContext();
3893 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) {
3895 __Pyx_RefNannyDeclarations
3898 __Pyx_RefNannySetupContext(
"__setitem__", 0);
3907 __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)
3908 __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)
3910 __pyx_v_self->instance->set(__pyx_t_1, __pyx_t_2);
3912 __Pyx_CppExn2PyErr();
3913 __PYX_ERR(0, 186, __pyx_L1_error)
3936 __Pyx_AddTraceback(
"PyClical.index_set.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3939 __Pyx_RefNannyFinishContext();
3952 static PyObject *__pyx_pw_8PyClical_9index_set_11__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx);
3953 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 ";
3954 #if CYTHON_COMPILING_IN_CPYTHON 3955 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_10__getitem__;
3957 static PyObject *__pyx_pw_8PyClical_9index_set_11__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx) {
3958 PyObject *__pyx_r = 0;
3959 __Pyx_RefNannyDeclarations
3960 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
3961 __pyx_r = __pyx_pf_8PyClical_9index_set_10__getitem__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_idx));
3964 __Pyx_RefNannyFinishContext();
3968 static PyObject *__pyx_pf_8PyClical_9index_set_10__getitem__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_idx) {
3969 PyObject *__pyx_r = NULL;
3970 __Pyx_RefNannyDeclarations
3972 PyObject *__pyx_t_2 = NULL;
3973 __Pyx_RefNannySetupContext(
"__getitem__", 0);
3982 __Pyx_XDECREF(__pyx_r);
3983 __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)
3984 __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)
3985 __Pyx_GOTREF(__pyx_t_2);
3986 __pyx_r = __pyx_t_2;
4000 __Pyx_XDECREF(__pyx_t_2);
4001 __Pyx_AddTraceback(
"PyClical.index_set.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4004 __Pyx_XGIVEREF(__pyx_r);
4005 __Pyx_RefNannyFinishContext();
4018 static int __pyx_pw_8PyClical_9index_set_13__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx);
4019 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 ";
4020 #if CYTHON_COMPILING_IN_CPYTHON 4021 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_12__contains__;
4023 static int __pyx_pw_8PyClical_9index_set_13__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx) {
4025 __Pyx_RefNannyDeclarations
4026 __Pyx_RefNannySetupContext(
"__contains__ (wrapper)", 0);
4027 __pyx_r = __pyx_pf_8PyClical_9index_set_12__contains__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_idx));
4030 __Pyx_RefNannyFinishContext();
4034 static int __pyx_pf_8PyClical_9index_set_12__contains__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_idx) {
4036 __Pyx_RefNannyDeclarations
4038 __Pyx_RefNannySetupContext(
"__contains__", 0);
4047 __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)
4048 __pyx_r = __pyx_v_self->instance->operator[](__pyx_t_1);
4061 __Pyx_AddTraceback(
"PyClical.index_set.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4064 __Pyx_RefNannyFinishContext();
4067 static PyObject *__pyx_gb_8PyClical_9index_set_16generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value);
4078 static PyObject *__pyx_pw_8PyClical_9index_set_15__iter__(PyObject *__pyx_v_self);
4079 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 ";
4080 #if CYTHON_COMPILING_IN_CPYTHON 4081 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_14__iter__;
4083 static PyObject *__pyx_pw_8PyClical_9index_set_15__iter__(PyObject *__pyx_v_self) {
4084 PyObject *__pyx_r = 0;
4085 __Pyx_RefNannyDeclarations
4086 __Pyx_RefNannySetupContext(
"__iter__ (wrapper)", 0);
4087 __pyx_r = __pyx_pf_8PyClical_9index_set_14__iter__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
4090 __Pyx_RefNannyFinishContext();
4094 static PyObject *__pyx_pf_8PyClical_9index_set_14__iter__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
4095 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *__pyx_cur_scope;
4096 PyObject *__pyx_r = NULL;
4097 __Pyx_RefNannyDeclarations
4098 __Pyx_RefNannySetupContext(
"__iter__", 0);
4099 __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);
4100 if (unlikely(!__pyx_cur_scope)) {
4101 __pyx_cur_scope = ((
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)Py_None);
4102 __Pyx_INCREF(Py_None);
4103 __PYX_ERR(0, 227, __pyx_L1_error)
4105 __Pyx_GOTREF(__pyx_cur_scope);
4107 __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
4108 __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
4109 __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
4111 __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_8PyClical_9index_set_16generator, (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)
4112 __Pyx_DECREF(__pyx_cur_scope);
4113 __Pyx_RefNannyFinishContext();
4114 return (PyObject *) gen;
4119 __Pyx_AddTraceback(
"PyClical.index_set.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4121 __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
4122 __Pyx_XGIVEREF(__pyx_r);
4123 __Pyx_RefNannyFinishContext();
4127 static PyObject *__pyx_gb_8PyClical_9index_set_16generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value)
4129 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *__pyx_cur_scope = ((
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)__pyx_generator->closure);
4130 PyObject *__pyx_r = NULL;
4131 PyObject *__pyx_t_1 = NULL;
4132 PyObject *__pyx_t_2 = NULL;
4133 PyObject *__pyx_t_3 = NULL;
4134 PyObject *__pyx_t_4 = NULL;
4135 Py_ssize_t __pyx_t_5;
4136 PyObject *(*__pyx_t_6)(PyObject *);
4139 __Pyx_RefNannyDeclarations
4140 __Pyx_RefNannySetupContext(
"__iter__", 0);
4141 switch (__pyx_generator->resume_label) {
4142 case 0:
goto __pyx_L3_first_run;
4143 case 1:
goto __pyx_L7_resume_from_yield;
4145 __Pyx_RefNannyFinishContext();
4148 __pyx_L3_first_run:;
4149 if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 227, __pyx_L1_error)
4158 __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)
4159 __Pyx_GOTREF(__pyx_t_2);
4161 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
4162 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
4163 if (likely(__pyx_t_3)) {
4164 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
4165 __Pyx_INCREF(__pyx_t_3);
4166 __Pyx_INCREF(
function);
4167 __Pyx_DECREF_SET(__pyx_t_2,
function);
4171 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error)
4172 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4174 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error)
4176 __Pyx_GOTREF(__pyx_t_1);
4177 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4178 __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)
4179 __Pyx_GOTREF(__pyx_t_3);
4181 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4182 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
4183 if (likely(__pyx_t_4)) {
4184 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4185 __Pyx_INCREF(__pyx_t_4);
4186 __Pyx_INCREF(
function);
4187 __Pyx_DECREF_SET(__pyx_t_3,
function);
4191 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error)
4192 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4194 __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error)
4196 __Pyx_GOTREF(__pyx_t_2);
4197 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4198 __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 234, __pyx_L1_error)
4199 __Pyx_GOTREF(__pyx_t_3);
4200 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4201 __pyx_t_2 = PyTuple_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error)
4202 __Pyx_GOTREF(__pyx_t_2);
4203 __Pyx_GIVEREF(__pyx_t_1);
4204 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
4205 __Pyx_GIVEREF(__pyx_t_3);
4206 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
4209 __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)
4210 __Pyx_GOTREF(__pyx_t_3);
4211 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4212 if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
4213 __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
4216 __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error)
4217 __Pyx_GOTREF(__pyx_t_2);
4218 __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext;
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error)
4220 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4222 if (likely(!__pyx_t_6)) {
4223 if (likely(PyList_CheckExact(__pyx_t_2))) {
4224 if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2))
break;
4225 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 4226 __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)
4228 __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)
4229 __Pyx_GOTREF(__pyx_t_3);
4232 if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2))
break;
4233 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 4234 __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)
4236 __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)
4237 __Pyx_GOTREF(__pyx_t_3);
4241 __pyx_t_3 = __pyx_t_6(__pyx_t_2);
4242 if (unlikely(!__pyx_t_3)) {
4243 PyObject* exc_type = PyErr_Occurred();
4245 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
4246 else __PYX_ERR(0, 234, __pyx_L1_error)
4250 __Pyx_GOTREF(__pyx_t_3);
4252 __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_idx);
4253 __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_idx, __pyx_t_3);
4254 __Pyx_GIVEREF(__pyx_t_3);
4264 __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)
4265 __pyx_t_8 = (__pyx_t_7 != 0);
4275 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_idx);
4276 __pyx_r = __pyx_cur_scope->__pyx_v_idx;
4277 __Pyx_XGIVEREF(__pyx_t_2);
4278 __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
4279 __pyx_cur_scope->__pyx_t_1 = __pyx_t_5;
4280 __pyx_cur_scope->__pyx_t_2 = __pyx_t_6;
4281 __Pyx_XGIVEREF(__pyx_r);
4282 __Pyx_RefNannyFinishContext();
4283 __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
4285 __pyx_generator->resume_label = 1;
4287 __pyx_L7_resume_from_yield:;
4288 __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
4289 __pyx_cur_scope->__pyx_t_0 = 0;
4290 __Pyx_XGOTREF(__pyx_t_2);
4291 __pyx_t_5 = __pyx_cur_scope->__pyx_t_1;
4292 __pyx_t_6 = __pyx_cur_scope->__pyx_t_2;
4293 if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 236, __pyx_L1_error)
4312 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4313 CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
4324 PyErr_SetNone(PyExc_StopIteration);
4327 __Pyx_XDECREF(__pyx_t_1);
4328 __Pyx_XDECREF(__pyx_t_2);
4329 __Pyx_XDECREF(__pyx_t_3);
4330 __Pyx_XDECREF(__pyx_t_4);
4331 __Pyx_AddTraceback(
"__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4333 __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
4334 __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
4335 __pyx_generator->resume_label = -1;
4336 __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
4337 __Pyx_RefNannyFinishContext();
4350 static PyObject *__pyx_pw_8PyClical_9index_set_18__invert__(PyObject *__pyx_v_self);
4351 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 ";
4352 #if CYTHON_COMPILING_IN_CPYTHON 4353 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_17__invert__;
4355 static PyObject *__pyx_pw_8PyClical_9index_set_18__invert__(PyObject *__pyx_v_self) {
4356 PyObject *__pyx_r = 0;
4357 __Pyx_RefNannyDeclarations
4358 __Pyx_RefNannySetupContext(
"__invert__ (wrapper)", 0);
4359 __pyx_r = __pyx_pf_8PyClical_9index_set_17__invert__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
4362 __Pyx_RefNannyFinishContext();
4366 static PyObject *__pyx_pf_8PyClical_9index_set_17__invert__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
4367 PyObject *__pyx_r = NULL;
4368 __Pyx_RefNannyDeclarations
4369 PyObject *__pyx_t_1 = NULL;
4370 PyObject *__pyx_t_2 = NULL;
4371 __Pyx_RefNannySetupContext(
"__invert__", 0);
4380 __Pyx_XDECREF(__pyx_r);
4381 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_index_set), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 245, __pyx_L1_error)
4382 __Pyx_GOTREF(__pyx_t_1);
4383 __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)
4384 __Pyx_GOTREF(__pyx_t_2);
4385 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4386 __pyx_r = __pyx_t_2;
4400 __Pyx_XDECREF(__pyx_t_1);
4401 __Pyx_XDECREF(__pyx_t_2);
4402 __Pyx_AddTraceback(
"PyClical.index_set.__invert__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4405 __Pyx_XGIVEREF(__pyx_r);
4406 __Pyx_RefNannyFinishContext();
4419 static PyObject *__pyx_pw_8PyClical_9index_set_20__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
4420 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 ";
4421 #if CYTHON_COMPILING_IN_CPYTHON 4422 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_19__xor__;
4424 static PyObject *__pyx_pw_8PyClical_9index_set_20__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4425 PyObject *__pyx_r = 0;
4426 __Pyx_RefNannyDeclarations
4427 __Pyx_RefNannySetupContext(
"__xor__ (wrapper)", 0);
4428 __pyx_r = __pyx_pf_8PyClical_9index_set_19__xor__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
4431 __Pyx_RefNannyFinishContext();
4435 static PyObject *__pyx_pf_8PyClical_9index_set_19__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4436 PyObject *__pyx_r = NULL;
4437 __Pyx_RefNannyDeclarations
4438 PyObject *__pyx_t_1 = NULL;
4439 PyObject *__pyx_t_2 = NULL;
4440 __Pyx_RefNannySetupContext(
"__xor__", 0);
4449 __Pyx_XDECREF(__pyx_r);
4450 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_index_set), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error)
4451 __Pyx_GOTREF(__pyx_t_1);
4452 __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)
4453 __Pyx_GOTREF(__pyx_t_2);
4454 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4455 __pyx_r = __pyx_t_2;
4469 __Pyx_XDECREF(__pyx_t_1);
4470 __Pyx_XDECREF(__pyx_t_2);
4471 __Pyx_AddTraceback(
"PyClical.index_set.__xor__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4474 __Pyx_XGIVEREF(__pyx_r);
4475 __Pyx_RefNannyFinishContext();
4488 static PyObject *__pyx_pw_8PyClical_9index_set_22__ixor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
4489 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 ";
4490 #if CYTHON_COMPILING_IN_CPYTHON 4491 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_21__ixor__;
4493 static PyObject *__pyx_pw_8PyClical_9index_set_22__ixor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
4494 PyObject *__pyx_r = 0;
4495 __Pyx_RefNannyDeclarations
4496 __Pyx_RefNannySetupContext(
"__ixor__ (wrapper)", 0);
4497 __pyx_r = __pyx_pf_8PyClical_9index_set_21__ixor__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
4500 __Pyx_RefNannyFinishContext();
4504 static PyObject *__pyx_pf_8PyClical_9index_set_21__ixor__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs) {
4505 PyObject *__pyx_r = NULL;
4506 __Pyx_RefNannyDeclarations
4507 PyObject *__pyx_t_1 = NULL;
4508 __Pyx_RefNannySetupContext(
"__ixor__", 0);
4517 __Pyx_XDECREF(__pyx_r);
4518 __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)
4519 __Pyx_GOTREF(__pyx_t_1);
4520 __pyx_r = __pyx_t_1;
4534 __Pyx_XDECREF(__pyx_t_1);
4535 __Pyx_AddTraceback(
"PyClical.index_set.__ixor__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4538 __Pyx_XGIVEREF(__pyx_r);
4539 __Pyx_RefNannyFinishContext();
4552 static PyObject *__pyx_pw_8PyClical_9index_set_24__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
4553 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 ";
4554 #if CYTHON_COMPILING_IN_CPYTHON 4555 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_23__and__;
4557 static PyObject *__pyx_pw_8PyClical_9index_set_24__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4558 PyObject *__pyx_r = 0;
4559 __Pyx_RefNannyDeclarations
4560 __Pyx_RefNannySetupContext(
"__and__ (wrapper)", 0);
4561 __pyx_r = __pyx_pf_8PyClical_9index_set_23__and__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
4564 __Pyx_RefNannyFinishContext();
4568 static PyObject *__pyx_pf_8PyClical_9index_set_23__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4569 PyObject *__pyx_r = NULL;
4570 __Pyx_RefNannyDeclarations
4571 PyObject *__pyx_t_1 = NULL;
4572 PyObject *__pyx_t_2 = NULL;
4573 __Pyx_RefNannySetupContext(
"__and__", 0);
4582 __Pyx_XDECREF(__pyx_r);
4583 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_index_set), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __pyx_L1_error)
4584 __Pyx_GOTREF(__pyx_t_1);
4585 __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)
4586 __Pyx_GOTREF(__pyx_t_2);
4587 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4588 __pyx_r = __pyx_t_2;
4602 __Pyx_XDECREF(__pyx_t_1);
4603 __Pyx_XDECREF(__pyx_t_2);
4604 __Pyx_AddTraceback(
"PyClical.index_set.__and__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4607 __Pyx_XGIVEREF(__pyx_r);
4608 __Pyx_RefNannyFinishContext();
4621 static PyObject *__pyx_pw_8PyClical_9index_set_26__iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
4622 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 ";
4623 #if CYTHON_COMPILING_IN_CPYTHON 4624 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_25__iand__;
4626 static PyObject *__pyx_pw_8PyClical_9index_set_26__iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
4627 PyObject *__pyx_r = 0;
4628 __Pyx_RefNannyDeclarations
4629 __Pyx_RefNannySetupContext(
"__iand__ (wrapper)", 0);
4630 __pyx_r = __pyx_pf_8PyClical_9index_set_25__iand__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
4633 __Pyx_RefNannyFinishContext();
4637 static PyObject *__pyx_pf_8PyClical_9index_set_25__iand__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs) {
4638 PyObject *__pyx_r = NULL;
4639 __Pyx_RefNannyDeclarations
4640 PyObject *__pyx_t_1 = NULL;
4641 __Pyx_RefNannySetupContext(
"__iand__", 0);
4650 __Pyx_XDECREF(__pyx_r);
4651 __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)
4652 __Pyx_GOTREF(__pyx_t_1);
4653 __pyx_r = __pyx_t_1;
4667 __Pyx_XDECREF(__pyx_t_1);
4668 __Pyx_AddTraceback(
"PyClical.index_set.__iand__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4671 __Pyx_XGIVEREF(__pyx_r);
4672 __Pyx_RefNannyFinishContext();
4685 static PyObject *__pyx_pw_8PyClical_9index_set_28__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
4686 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 ";
4687 #if CYTHON_COMPILING_IN_CPYTHON 4688 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_27__or__;
4690 static PyObject *__pyx_pw_8PyClical_9index_set_28__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4691 PyObject *__pyx_r = 0;
4692 __Pyx_RefNannyDeclarations
4693 __Pyx_RefNannySetupContext(
"__or__ (wrapper)", 0);
4694 __pyx_r = __pyx_pf_8PyClical_9index_set_27__or__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
4697 __Pyx_RefNannyFinishContext();
4701 static PyObject *__pyx_pf_8PyClical_9index_set_27__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4702 PyObject *__pyx_r = NULL;
4703 __Pyx_RefNannyDeclarations
4704 PyObject *__pyx_t_1 = NULL;
4705 PyObject *__pyx_t_2 = NULL;
4706 __Pyx_RefNannySetupContext(
"__or__", 0);
4715 __Pyx_XDECREF(__pyx_r);
4716 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_index_set), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error)
4717 __Pyx_GOTREF(__pyx_t_1);
4718 __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)
4719 __Pyx_GOTREF(__pyx_t_2);
4720 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4721 __pyx_r = __pyx_t_2;
4735 __Pyx_XDECREF(__pyx_t_1);
4736 __Pyx_XDECREF(__pyx_t_2);
4737 __Pyx_AddTraceback(
"PyClical.index_set.__or__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4740 __Pyx_XGIVEREF(__pyx_r);
4741 __Pyx_RefNannyFinishContext();
4754 static PyObject *__pyx_pw_8PyClical_9index_set_30__ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
4755 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 ";
4756 #if CYTHON_COMPILING_IN_CPYTHON 4757 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_29__ior__;
4759 static PyObject *__pyx_pw_8PyClical_9index_set_30__ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
4760 PyObject *__pyx_r = 0;
4761 __Pyx_RefNannyDeclarations
4762 __Pyx_RefNannySetupContext(
"__ior__ (wrapper)", 0);
4763 __pyx_r = __pyx_pf_8PyClical_9index_set_29__ior__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
4766 __Pyx_RefNannyFinishContext();
4770 static PyObject *__pyx_pf_8PyClical_9index_set_29__ior__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs) {
4771 PyObject *__pyx_r = NULL;
4772 __Pyx_RefNannyDeclarations
4773 PyObject *__pyx_t_1 = NULL;
4774 __Pyx_RefNannySetupContext(
"__ior__", 0);
4783 __Pyx_XDECREF(__pyx_r);
4784 __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)
4785 __Pyx_GOTREF(__pyx_t_1);
4786 __pyx_r = __pyx_t_1;
4800 __Pyx_XDECREF(__pyx_t_1);
4801 __Pyx_AddTraceback(
"PyClical.index_set.__ior__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4804 __Pyx_XGIVEREF(__pyx_r);
4805 __Pyx_RefNannyFinishContext();
4818 static PyObject *__pyx_pw_8PyClical_9index_set_32count(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4819 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 ";
4820 static PyObject *__pyx_pw_8PyClical_9index_set_32count(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4821 PyObject *__pyx_r = 0;
4822 __Pyx_RefNannyDeclarations
4823 __Pyx_RefNannySetupContext(
"count (wrapper)", 0);
4824 __pyx_r = __pyx_pf_8PyClical_9index_set_31count(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
4827 __Pyx_RefNannyFinishContext();
4831 static PyObject *__pyx_pf_8PyClical_9index_set_31count(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
4832 PyObject *__pyx_r = NULL;
4833 __Pyx_RefNannyDeclarations
4834 PyObject *__pyx_t_1 = NULL;
4835 __Pyx_RefNannySetupContext(
"count", 0);
4844 __Pyx_XDECREF(__pyx_r);
4845 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->instance->count());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __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.count", __pyx_clineno, __pyx_lineno, __pyx_filename);
4865 __Pyx_XGIVEREF(__pyx_r);
4866 __Pyx_RefNannyFinishContext();
4879 static PyObject *__pyx_pw_8PyClical_9index_set_34count_neg(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4880 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 ";
4881 static PyObject *__pyx_pw_8PyClical_9index_set_34count_neg(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4882 PyObject *__pyx_r = 0;
4883 __Pyx_RefNannyDeclarations
4884 __Pyx_RefNannySetupContext(
"count_neg (wrapper)", 0);
4885 __pyx_r = __pyx_pf_8PyClical_9index_set_33count_neg(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
4888 __Pyx_RefNannyFinishContext();
4892 static PyObject *__pyx_pf_8PyClical_9index_set_33count_neg(
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_neg", 0);
4905 __Pyx_XDECREF(__pyx_r);
4906 __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)
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_neg", __pyx_clineno, __pyx_lineno, __pyx_filename);
4926 __Pyx_XGIVEREF(__pyx_r);
4927 __Pyx_RefNannyFinishContext();
4940 static PyObject *__pyx_pw_8PyClical_9index_set_36count_pos(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4941 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 ";
4942 static PyObject *__pyx_pw_8PyClical_9index_set_36count_pos(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4943 PyObject *__pyx_r = 0;
4944 __Pyx_RefNannyDeclarations
4945 __Pyx_RefNannySetupContext(
"count_pos (wrapper)", 0);
4946 __pyx_r = __pyx_pf_8PyClical_9index_set_35count_pos(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
4949 __Pyx_RefNannyFinishContext();
4953 static PyObject *__pyx_pf_8PyClical_9index_set_35count_pos(
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_pos", 0);
4966 __Pyx_XDECREF(__pyx_r);
4967 __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)
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_pos", __pyx_clineno, __pyx_lineno, __pyx_filename);
4987 __Pyx_XGIVEREF(__pyx_r);
4988 __Pyx_RefNannyFinishContext();
5001 static PyObject *__pyx_pw_8PyClical_9index_set_38min(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5002 static char __pyx_doc_8PyClical_9index_set_37min[] =
"\n Minimum member.\n\n >>> index_set({-1,1,2}).min()\n -1\n ";
5003 static PyObject *__pyx_pw_8PyClical_9index_set_38min(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5004 PyObject *__pyx_r = 0;
5005 __Pyx_RefNannyDeclarations
5006 __Pyx_RefNannySetupContext(
"min (wrapper)", 0);
5007 __pyx_r = __pyx_pf_8PyClical_9index_set_37min(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5010 __Pyx_RefNannyFinishContext();
5014 static PyObject *__pyx_pf_8PyClical_9index_set_37min(
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(
"min", 0);
5027 __Pyx_XDECREF(__pyx_r);
5028 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->instance->min());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 347, __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.min", __pyx_clineno, __pyx_lineno, __pyx_filename);
5048 __Pyx_XGIVEREF(__pyx_r);
5049 __Pyx_RefNannyFinishContext();
5062 static PyObject *__pyx_pw_8PyClical_9index_set_40max(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5063 static char __pyx_doc_8PyClical_9index_set_39max[] =
"\n Maximum member.\n\n >>> index_set({-1,1,2}).max()\n 2\n ";
5064 static PyObject *__pyx_pw_8PyClical_9index_set_40max(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5065 PyObject *__pyx_r = 0;
5066 __Pyx_RefNannyDeclarations
5067 __Pyx_RefNannySetupContext(
"max (wrapper)", 0);
5068 __pyx_r = __pyx_pf_8PyClical_9index_set_39max(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5071 __Pyx_RefNannyFinishContext();
5075 static PyObject *__pyx_pf_8PyClical_9index_set_39max(
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(
"max", 0);
5088 __Pyx_XDECREF(__pyx_r);
5089 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->instance->max());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __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.max", __pyx_clineno, __pyx_lineno, __pyx_filename);
5109 __Pyx_XGIVEREF(__pyx_r);
5110 __Pyx_RefNannyFinishContext();
5123 static PyObject *__pyx_pw_8PyClical_9index_set_42hash_fn(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5124 static char __pyx_doc_8PyClical_9index_set_41hash_fn[] =
"\n Hash function.\n ";
5125 static PyObject *__pyx_pw_8PyClical_9index_set_42hash_fn(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5126 PyObject *__pyx_r = 0;
5127 __Pyx_RefNannyDeclarations
5128 __Pyx_RefNannySetupContext(
"hash_fn (wrapper)", 0);
5129 __pyx_r = __pyx_pf_8PyClical_9index_set_41hash_fn(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5132 __Pyx_RefNannyFinishContext();
5136 static PyObject *__pyx_pf_8PyClical_9index_set_41hash_fn(
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(
"hash_fn", 0);
5149 __Pyx_XDECREF(__pyx_r);
5150 __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)
5151 __Pyx_GOTREF(__pyx_t_1);
5152 __pyx_r = __pyx_t_1;
5166 __Pyx_XDECREF(__pyx_t_1);
5167 __Pyx_AddTraceback(
"PyClical.index_set.hash_fn", __pyx_clineno, __pyx_lineno, __pyx_filename);
5170 __Pyx_XGIVEREF(__pyx_r);
5171 __Pyx_RefNannyFinishContext();
5184 static PyObject *__pyx_pw_8PyClical_9index_set_44sign_of_mult(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
5185 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 ";
5186 static PyObject *__pyx_pw_8PyClical_9index_set_44sign_of_mult(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
5187 PyObject *__pyx_r = 0;
5188 __Pyx_RefNannyDeclarations
5189 __Pyx_RefNannySetupContext(
"sign_of_mult (wrapper)", 0);
5190 __pyx_r = __pyx_pf_8PyClical_9index_set_43sign_of_mult(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
5193 __Pyx_RefNannyFinishContext();
5197 static PyObject *__pyx_pf_8PyClical_9index_set_43sign_of_mult(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs) {
5198 PyObject *__pyx_r = NULL;
5199 __Pyx_RefNannyDeclarations
5200 PyObject *__pyx_t_1 = NULL;
5201 __Pyx_RefNannySetupContext(
"sign_of_mult", 0);
5210 __Pyx_XDECREF(__pyx_r);
5211 __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)
5212 __Pyx_GOTREF(__pyx_t_1);
5213 __pyx_r = __pyx_t_1;
5227 __Pyx_XDECREF(__pyx_t_1);
5228 __Pyx_AddTraceback(
"PyClical.index_set.sign_of_mult", __pyx_clineno, __pyx_lineno, __pyx_filename);
5231 __Pyx_XGIVEREF(__pyx_r);
5232 __Pyx_RefNannyFinishContext();
5245 static PyObject *__pyx_pw_8PyClical_9index_set_46sign_of_square(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5246 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 ";
5247 static PyObject *__pyx_pw_8PyClical_9index_set_46sign_of_square(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5248 PyObject *__pyx_r = 0;
5249 __Pyx_RefNannyDeclarations
5250 __Pyx_RefNannySetupContext(
"sign_of_square (wrapper)", 0);
5251 __pyx_r = __pyx_pf_8PyClical_9index_set_45sign_of_square(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5254 __Pyx_RefNannyFinishContext();
5258 static PyObject *__pyx_pf_8PyClical_9index_set_45sign_of_square(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5259 PyObject *__pyx_r = NULL;
5260 __Pyx_RefNannyDeclarations
5261 PyObject *__pyx_t_1 = NULL;
5262 __Pyx_RefNannySetupContext(
"sign_of_square", 0);
5271 __Pyx_XDECREF(__pyx_r);
5272 __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)
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_square", __pyx_clineno, __pyx_lineno, __pyx_filename);
5292 __Pyx_XGIVEREF(__pyx_r);
5293 __Pyx_RefNannyFinishContext();
5306 static PyObject *__pyx_pw_8PyClical_9index_set_48__repr__(PyObject *__pyx_v_self);
5307 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 ";
5308 #if CYTHON_COMPILING_IN_CPYTHON 5309 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_47__repr__;
5311 static PyObject *__pyx_pw_8PyClical_9index_set_48__repr__(PyObject *__pyx_v_self) {
5312 PyObject *__pyx_r = 0;
5313 __Pyx_RefNannyDeclarations
5314 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
5315 __pyx_r = __pyx_pf_8PyClical_9index_set_47__repr__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5318 __Pyx_RefNannyFinishContext();
5322 static PyObject *__pyx_pf_8PyClical_9index_set_47__repr__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5323 PyObject *__pyx_r = NULL;
5324 __Pyx_RefNannyDeclarations
5325 PyObject *__pyx_t_1 = NULL;
5326 __Pyx_RefNannySetupContext(
"__repr__", 0);
5335 __Pyx_XDECREF(__pyx_r);
5336 __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)
5337 __Pyx_GOTREF(__pyx_t_1);
5338 __pyx_r = __pyx_t_1;
5352 __Pyx_XDECREF(__pyx_t_1);
5353 __Pyx_AddTraceback(
"PyClical.index_set.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5356 __Pyx_XGIVEREF(__pyx_r);
5357 __Pyx_RefNannyFinishContext();
5370 static PyObject *__pyx_pw_8PyClical_9index_set_50__str__(PyObject *__pyx_v_self);
5371 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 ";
5372 #if CYTHON_COMPILING_IN_CPYTHON 5373 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_49__str__;
5375 static PyObject *__pyx_pw_8PyClical_9index_set_50__str__(PyObject *__pyx_v_self) {
5376 PyObject *__pyx_r = 0;
5377 __Pyx_RefNannyDeclarations
5378 __Pyx_RefNannySetupContext(
"__str__ (wrapper)", 0);
5379 __pyx_r = __pyx_pf_8PyClical_9index_set_49__str__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5382 __Pyx_RefNannyFinishContext();
5386 static PyObject *__pyx_pf_8PyClical_9index_set_49__str__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5387 PyObject *__pyx_r = NULL;
5388 __Pyx_RefNannyDeclarations
5389 PyObject *__pyx_t_1 = NULL;
5390 __Pyx_RefNannySetupContext(
"__str__", 0);
5399 __Pyx_XDECREF(__pyx_r);
5400 __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)
5401 __Pyx_GOTREF(__pyx_t_1);
5402 __pyx_r = __pyx_t_1;
5416 __Pyx_XDECREF(__pyx_t_1);
5417 __Pyx_AddTraceback(
"PyClical.index_set.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5420 __Pyx_XGIVEREF(__pyx_r);
5421 __Pyx_RefNannyFinishContext();
5432 static PyObject *__pyx_pw_8PyClical_9index_set_52__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5433 static PyObject *__pyx_pw_8PyClical_9index_set_52__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5434 PyObject *__pyx_r = 0;
5435 __Pyx_RefNannyDeclarations
5436 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
5437 __pyx_r = __pyx_pf_8PyClical_9index_set_51__reduce_cython__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5440 __Pyx_RefNannyFinishContext();
5444 static PyObject *__pyx_pf_8PyClical_9index_set_51__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5445 PyObject *__pyx_r = NULL;
5446 __Pyx_RefNannyDeclarations
5447 PyObject *__pyx_t_1 = NULL;
5448 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
5456 __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)
5457 __Pyx_GOTREF(__pyx_t_1);
5458 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5459 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5460 __PYX_ERR(1, 2, __pyx_L1_error)
5470 __Pyx_XDECREF(__pyx_t_1);
5471 __Pyx_AddTraceback(
"PyClical.index_set.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5473 __Pyx_XGIVEREF(__pyx_r);
5474 __Pyx_RefNannyFinishContext();
5486 static PyObject *__pyx_pw_8PyClical_9index_set_54__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
5487 static PyObject *__pyx_pw_8PyClical_9index_set_54__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
5488 PyObject *__pyx_r = 0;
5489 __Pyx_RefNannyDeclarations
5490 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
5491 __pyx_r = __pyx_pf_8PyClical_9index_set_53__setstate_cython__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
5494 __Pyx_RefNannyFinishContext();
5498 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) {
5499 PyObject *__pyx_r = NULL;
5500 __Pyx_RefNannyDeclarations
5501 PyObject *__pyx_t_1 = NULL;
5502 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
5509 __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)
5510 __Pyx_GOTREF(__pyx_t_1);
5511 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5512 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5513 __PYX_ERR(1, 4, __pyx_L1_error)
5524 __Pyx_XDECREF(__pyx_t_1);
5525 __Pyx_AddTraceback(
"PyClical.index_set.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5527 __Pyx_XGIVEREF(__pyx_r);
5528 __Pyx_RefNannyFinishContext();
5541 static PyObject *__pyx_pw_8PyClical_1index_set_hidden_doctests(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused);
5542 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 ";
5543 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};
5544 static PyObject *__pyx_pw_8PyClical_1index_set_hidden_doctests(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
5545 PyObject *__pyx_r = 0;
5546 __Pyx_RefNannyDeclarations
5547 __Pyx_RefNannySetupContext(
"index_set_hidden_doctests (wrapper)", 0);
5548 __pyx_r = __pyx_pf_8PyClical_index_set_hidden_doctests(__pyx_self);
5551 __Pyx_RefNannyFinishContext();
5555 static PyObject *__pyx_pf_8PyClical_index_set_hidden_doctests(CYTHON_UNUSED PyObject *__pyx_self) {
5556 PyObject *__pyx_r = NULL;
5557 __Pyx_RefNannyDeclarations
5558 __Pyx_RefNannySetupContext(
"index_set_hidden_doctests", 0);
5567 __Pyx_XDECREF(__pyx_r);
5568 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5581 __Pyx_XGIVEREF(__pyx_r);
5582 __Pyx_RefNannyFinishContext();
5594 static PyObject *__pyx_pw_8PyClical_3compare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5595 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_compare(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs, CYTHON_UNUSED
int __pyx_skip_dispatch) {
5596 PyObject *__pyx_r = NULL;
5597 __Pyx_RefNannyDeclarations
5598 PyObject *__pyx_t_1 = NULL;
5599 __Pyx_RefNannySetupContext(
"compare", 0);
5608 __Pyx_XDECREF(__pyx_r);
5609 __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)
5610 __Pyx_GOTREF(__pyx_t_1);
5611 __pyx_r = __pyx_t_1;
5625 __Pyx_XDECREF(__pyx_t_1);
5626 __Pyx_AddTraceback(
"PyClical.compare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5629 __Pyx_XGIVEREF(__pyx_r);
5630 __Pyx_RefNannyFinishContext();
5635 static PyObject *__pyx_pw_8PyClical_3compare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5636 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 ";
5637 static PyObject *__pyx_pw_8PyClical_3compare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5638 PyObject *__pyx_v_lhs = 0;
5639 PyObject *__pyx_v_rhs = 0;
5640 PyObject *__pyx_r = 0;
5641 __Pyx_RefNannyDeclarations
5642 __Pyx_RefNannySetupContext(
"compare (wrapper)", 0);
5644 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lhs,&__pyx_n_s_rhs,0};
5645 PyObject* values[2] = {0,0};
5646 if (unlikely(__pyx_kwds)) {
5648 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5650 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5652 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5655 default:
goto __pyx_L5_argtuple_error;
5657 kw_args = PyDict_Size(__pyx_kwds);
5660 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_lhs)) != 0)) kw_args--;
5661 else goto __pyx_L5_argtuple_error;
5664 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rhs)) != 0)) kw_args--;
5666 __Pyx_RaiseArgtupleInvalid(
"compare", 1, 2, 2, 1); __PYX_ERR(0, 490, __pyx_L3_error)
5669 if (unlikely(kw_args > 0)) {
5670 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"compare") < 0)) __PYX_ERR(0, 490, __pyx_L3_error)
5672 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5673 goto __pyx_L5_argtuple_error;
5675 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5676 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5678 __pyx_v_lhs = values[0];
5679 __pyx_v_rhs = values[1];
5681 goto __pyx_L4_argument_unpacking_done;
5682 __pyx_L5_argtuple_error:;
5683 __Pyx_RaiseArgtupleInvalid(
"compare", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 490, __pyx_L3_error)
5685 __Pyx_AddTraceback(
"PyClical.compare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5686 __Pyx_RefNannyFinishContext();
5688 __pyx_L4_argument_unpacking_done:;
5689 __pyx_r = __pyx_pf_8PyClical_2compare(__pyx_self, __pyx_v_lhs, __pyx_v_rhs);
5692 __Pyx_RefNannyFinishContext();
5696 static PyObject *__pyx_pf_8PyClical_2compare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
5697 PyObject *__pyx_r = NULL;
5698 __Pyx_RefNannyDeclarations
5699 PyObject *__pyx_t_1 = NULL;
5700 __Pyx_RefNannySetupContext(
"compare", 0);
5701 __Pyx_XDECREF(__pyx_r);
5702 __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)
5703 __Pyx_GOTREF(__pyx_t_1);
5704 __pyx_r = __pyx_t_1;
5710 __Pyx_XDECREF(__pyx_t_1);
5711 __Pyx_AddTraceback(
"PyClical.compare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5714 __Pyx_XGIVEREF(__pyx_r);
5715 __Pyx_RefNannyFinishContext();
5727 static PyObject *__pyx_pw_8PyClical_5min_neg(PyObject *__pyx_self, PyObject *__pyx_v_obj);
5728 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_min_neg(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
5729 PyObject *__pyx_r = NULL;
5730 __Pyx_RefNannyDeclarations
5731 PyObject *__pyx_t_1 = NULL;
5732 __Pyx_RefNannySetupContext(
"min_neg", 0);
5741 __Pyx_XDECREF(__pyx_r);
5742 __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)
5743 __Pyx_GOTREF(__pyx_t_1);
5744 __pyx_r = __pyx_t_1;
5758 __Pyx_XDECREF(__pyx_t_1);
5759 __Pyx_AddTraceback(
"PyClical.min_neg", __pyx_clineno, __pyx_lineno, __pyx_filename);
5762 __Pyx_XGIVEREF(__pyx_r);
5763 __Pyx_RefNannyFinishContext();
5768 static PyObject *__pyx_pw_8PyClical_5min_neg(PyObject *__pyx_self, PyObject *__pyx_v_obj);
5769 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 ";
5770 static PyObject *__pyx_pw_8PyClical_5min_neg(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
5771 PyObject *__pyx_r = 0;
5772 __Pyx_RefNannyDeclarations
5773 __Pyx_RefNannySetupContext(
"min_neg (wrapper)", 0);
5774 __pyx_r = __pyx_pf_8PyClical_4min_neg(__pyx_self, ((PyObject *)__pyx_v_obj));
5777 __Pyx_RefNannyFinishContext();
5781 static PyObject *__pyx_pf_8PyClical_4min_neg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
5782 PyObject *__pyx_r = NULL;
5783 __Pyx_RefNannyDeclarations
5784 PyObject *__pyx_t_1 = NULL;
5785 __Pyx_RefNannySetupContext(
"min_neg", 0);
5786 __Pyx_XDECREF(__pyx_r);
5787 __pyx_t_1 = __pyx_f_8PyClical_min_neg(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 502, __pyx_L1_error)
5788 __Pyx_GOTREF(__pyx_t_1);
5789 __pyx_r = __pyx_t_1;
5795 __Pyx_XDECREF(__pyx_t_1);
5796 __Pyx_AddTraceback(
"PyClical.min_neg", __pyx_clineno, __pyx_lineno, __pyx_filename);
5799 __Pyx_XGIVEREF(__pyx_r);
5800 __Pyx_RefNannyFinishContext();
5812 static PyObject *__pyx_pw_8PyClical_7max_pos(PyObject *__pyx_self, PyObject *__pyx_v_obj);
5813 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_max_pos(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
5814 PyObject *__pyx_r = NULL;
5815 __Pyx_RefNannyDeclarations
5816 PyObject *__pyx_t_1 = NULL;
5817 __Pyx_RefNannySetupContext(
"max_pos", 0);
5826 __Pyx_XDECREF(__pyx_r);
5827 __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)
5828 __Pyx_GOTREF(__pyx_t_1);
5829 __pyx_r = __pyx_t_1;
5843 __Pyx_XDECREF(__pyx_t_1);
5844 __Pyx_AddTraceback(
"PyClical.max_pos", __pyx_clineno, __pyx_lineno, __pyx_filename);
5847 __Pyx_XGIVEREF(__pyx_r);
5848 __Pyx_RefNannyFinishContext();
5853 static PyObject *__pyx_pw_8PyClical_7max_pos(PyObject *__pyx_self, PyObject *__pyx_v_obj);
5854 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 ";
5855 static PyObject *__pyx_pw_8PyClical_7max_pos(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
5856 PyObject *__pyx_r = 0;
5857 __Pyx_RefNannyDeclarations
5858 __Pyx_RefNannySetupContext(
"max_pos (wrapper)", 0);
5859 __pyx_r = __pyx_pf_8PyClical_6max_pos(__pyx_self, ((PyObject *)__pyx_v_obj));
5862 __Pyx_RefNannyFinishContext();
5866 static PyObject *__pyx_pf_8PyClical_6max_pos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
5867 PyObject *__pyx_r = NULL;
5868 __Pyx_RefNannyDeclarations
5869 PyObject *__pyx_t_1 = NULL;
5870 __Pyx_RefNannySetupContext(
"max_pos", 0);
5871 __Pyx_XDECREF(__pyx_r);
5872 __pyx_t_1 = __pyx_f_8PyClical_max_pos(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 511, __pyx_L1_error)
5873 __Pyx_GOTREF(__pyx_t_1);
5874 __pyx_r = __pyx_t_1;
5880 __Pyx_XDECREF(__pyx_t_1);
5881 __Pyx_AddTraceback(
"PyClical.max_pos", __pyx_clineno, __pyx_lineno, __pyx_filename);
5884 __Pyx_XGIVEREF(__pyx_r);
5885 __Pyx_RefNannyFinishContext();
5897 static CYTHON_INLINE std::vector<scalar_t> __pyx_f_8PyClical_list_to_vector(PyObject *__pyx_v_lst) {
5898 std::vector<scalar_t> __pyx_v_v;
5899 PyObject *__pyx_v_s = NULL;
5900 std::vector<scalar_t> __pyx_r;
5901 __Pyx_RefNannyDeclarations
5902 PyObject *__pyx_t_1 = NULL;
5903 Py_ssize_t __pyx_t_2;
5904 PyObject *(*__pyx_t_3)(PyObject *);
5905 PyObject *__pyx_t_4 = NULL;
5907 __Pyx_RefNannySetupContext(
"list_to_vector", 0);
5916 if (likely(PyList_CheckExact(__pyx_v_lst)) || PyTuple_CheckExact(__pyx_v_lst)) {
5917 __pyx_t_1 = __pyx_v_lst; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
5920 __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_lst);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error)
5921 __Pyx_GOTREF(__pyx_t_1);
5922 __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 525, __pyx_L1_error)
5925 if (likely(!__pyx_t_3)) {
5926 if (likely(PyList_CheckExact(__pyx_t_1))) {
5927 if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1))
break;
5928 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 5929 __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)
5931 __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)
5932 __Pyx_GOTREF(__pyx_t_4);
5935 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1))
break;
5936 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 5937 __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)
5939 __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)
5940 __Pyx_GOTREF(__pyx_t_4);
5944 __pyx_t_4 = __pyx_t_3(__pyx_t_1);
5945 if (unlikely(!__pyx_t_4)) {
5946 PyObject* exc_type = PyErr_Occurred();
5948 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
5949 else __PYX_ERR(0, 525, __pyx_L1_error)
5953 __Pyx_GOTREF(__pyx_t_4);
5955 __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_4);
5965 __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)
5967 __pyx_v_v.push_back(((
scalar_t)__pyx_t_5));
5969 __Pyx_CppExn2PyErr();
5970 __PYX_ERR(0, 526, __pyx_L1_error)
5981 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5990 __pyx_r = __pyx_v_v;
6003 __Pyx_XDECREF(__pyx_t_1);
6004 __Pyx_XDECREF(__pyx_t_4);
6005 __Pyx_WriteUnraisable(
"PyClical.list_to_vector", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6006 __Pyx_pretend_to_initialize(&__pyx_r);
6008 __Pyx_XDECREF(__pyx_v_s);
6009 __Pyx_RefNannyFinishContext();
6021 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_toClifford(PyObject *__pyx_v_obj) {
6023 __Pyx_RefNannyDeclarations
6024 PyObject *__pyx_t_1 = NULL;
6025 PyObject *__pyx_t_2 = NULL;
6026 __Pyx_RefNannySetupContext(
"toClifford", 0);
6035 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 533, __pyx_L1_error)
6036 __Pyx_GOTREF(__pyx_t_1);
6037 __Pyx_INCREF(__pyx_v_obj);
6038 __Pyx_GIVEREF(__pyx_v_obj);
6039 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_obj);
6040 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_t_1, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 533, __pyx_L1_error)
6041 __Pyx_GOTREF(__pyx_t_2);
6042 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6043 __pyx_r = (((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_2)->instance[0]);
6044 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6057 __Pyx_XDECREF(__pyx_t_1);
6058 __Pyx_XDECREF(__pyx_t_2);
6059 __Pyx_WriteUnraisable(
"PyClical.toClifford", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6060 __Pyx_pretend_to_initialize(&__pyx_r);
6062 __Pyx_RefNannyFinishContext();
6074 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_8clifford_wrap(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self,
Clifford __pyx_v_other) {
6075 PyObject *__pyx_r = NULL;
6076 __Pyx_RefNannyDeclarations
6077 __Pyx_RefNannySetupContext(
"wrap", 0);
6086 (__pyx_v_self->instance[0]) = __pyx_v_other;
6095 __Pyx_XDECREF(__pyx_r);
6096 __Pyx_INCREF(((PyObject *)__pyx_v_self));
6097 __pyx_r = ((PyObject *)__pyx_v_self);
6110 __Pyx_XGIVEREF(__pyx_r);
6111 __Pyx_RefNannyFinishContext();
6123 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_8clifford_unwrap(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
6125 __Pyx_RefNannyDeclarations
6126 __Pyx_RefNannySetupContext(
"unwrap", 0);
6135 __pyx_r = (__pyx_v_self->instance[0]);
6148 __Pyx_RefNannyFinishContext();
6160 static PyObject *__pyx_pw_8PyClical_8clifford_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
6161 static PyObject *__pyx_f_8PyClical_8clifford_copy(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self,
int __pyx_skip_dispatch) {
6162 PyObject *__pyx_r = NULL;
6163 __Pyx_RefNannyDeclarations
6164 PyObject *__pyx_t_1 = NULL;
6165 PyObject *__pyx_t_2 = NULL;
6166 PyObject *__pyx_t_3 = NULL;
6167 PyObject *__pyx_t_4 = NULL;
6168 __Pyx_RefNannySetupContext(
"copy", 0);
6170 if (unlikely(__pyx_skip_dispatch)) ;
6172 else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
6173 __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)
6174 __Pyx_GOTREF(__pyx_t_1);
6175 if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_8PyClical_8clifford_1copy)) {
6176 __Pyx_XDECREF(__pyx_r);
6177 __Pyx_INCREF(__pyx_t_1);
6178 __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
6179 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
6180 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
6181 if (likely(__pyx_t_4)) {
6182 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
6183 __Pyx_INCREF(__pyx_t_4);
6184 __Pyx_INCREF(
function);
6185 __Pyx_DECREF_SET(__pyx_t_3,
function);
6189 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 554, __pyx_L1_error)
6190 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6192 __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 554, __pyx_L1_error)
6194 __Pyx_GOTREF(__pyx_t_2);
6195 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6196 __pyx_r = __pyx_t_2;
6198 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6201 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6211 __Pyx_XDECREF(__pyx_r);
6212 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 561, __pyx_L1_error)
6213 __Pyx_GOTREF(__pyx_t_1);
6214 __Pyx_INCREF(((PyObject *)__pyx_v_self));
6215 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
6216 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
6217 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_t_1, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 561, __pyx_L1_error)
6218 __Pyx_GOTREF(__pyx_t_2);
6219 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6220 __pyx_r = __pyx_t_2;
6234 __Pyx_XDECREF(__pyx_t_1);
6235 __Pyx_XDECREF(__pyx_t_2);
6236 __Pyx_XDECREF(__pyx_t_3);
6237 __Pyx_XDECREF(__pyx_t_4);
6238 __Pyx_AddTraceback(
"PyClical.clifford.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
6241 __Pyx_XGIVEREF(__pyx_r);
6242 __Pyx_RefNannyFinishContext();
6247 static PyObject *__pyx_pw_8PyClical_8clifford_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
6248 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 ";
6249 static PyObject *__pyx_pw_8PyClical_8clifford_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
6250 PyObject *__pyx_r = 0;
6251 __Pyx_RefNannyDeclarations
6252 __Pyx_RefNannySetupContext(
"copy (wrapper)", 0);
6253 __pyx_r = __pyx_pf_8PyClical_8clifford_copy(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
6256 __Pyx_RefNannyFinishContext();
6260 static PyObject *__pyx_pf_8PyClical_8clifford_copy(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
6261 PyObject *__pyx_r = NULL;
6262 __Pyx_RefNannyDeclarations
6263 PyObject *__pyx_t_1 = NULL;
6264 __Pyx_RefNannySetupContext(
"copy", 0);
6265 __Pyx_XDECREF(__pyx_r);
6266 __pyx_t_1 = __pyx_f_8PyClical_8clifford_copy(__pyx_v_self, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 554, __pyx_L1_error)
6267 __Pyx_GOTREF(__pyx_t_1);
6268 __pyx_r = __pyx_t_1;
6274 __Pyx_XDECREF(__pyx_t_1);
6275 __Pyx_AddTraceback(
"PyClical.clifford.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
6278 __Pyx_XGIVEREF(__pyx_r);
6279 __Pyx_RefNannyFinishContext();
6292 static int __pyx_pw_8PyClical_8clifford_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6293 static int __pyx_pw_8PyClical_8clifford_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6294 PyObject *__pyx_v_other = 0;
6295 PyObject *__pyx_v_ixt = 0;
6297 __Pyx_RefNannyDeclarations
6298 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
6300 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_ixt,0};
6301 PyObject* values[2] = {0,0};
6302 values[0] = ((PyObject *)__pyx_int_0);
6303 values[1] = ((PyObject *)Py_None);
6304 if (unlikely(__pyx_kwds)) {
6306 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6308 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6310 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6313 default:
goto __pyx_L5_argtuple_error;
6315 kw_args = PyDict_Size(__pyx_kwds);
6319 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other);
6320 if (value) { values[0] = value; kw_args--; }
6325 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ixt);
6326 if (value) { values[1] = value; kw_args--; }
6329 if (unlikely(kw_args > 0)) {
6330 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(0, 563, __pyx_L3_error)
6333 switch (PyTuple_GET_SIZE(__pyx_args)) {
6334 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6336 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6339 default:
goto __pyx_L5_argtuple_error;
6342 __pyx_v_other = values[0];
6343 __pyx_v_ixt = values[1];
6345 goto __pyx_L4_argument_unpacking_done;
6346 __pyx_L5_argtuple_error:;
6347 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 563, __pyx_L3_error)
6349 __Pyx_AddTraceback(
"PyClical.clifford.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6350 __Pyx_RefNannyFinishContext();
6352 __pyx_L4_argument_unpacking_done:;
6353 __pyx_r = __pyx_pf_8PyClical_8clifford_2__cinit__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), __pyx_v_other, __pyx_v_ixt);
6356 __Pyx_RefNannyFinishContext();
6360 static int __pyx_pf_8PyClical_8clifford_2__cinit__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_ixt) {
6361 PyObject *__pyx_v_error_msg_prefix = NULL;
6362 PyObject *__pyx_v_err = NULL;
6364 __Pyx_RefNannyDeclarations
6367 PyObject *__pyx_t_3 = NULL;
6368 PyObject *__pyx_t_4 = NULL;
6369 PyObject *__pyx_t_5 = NULL;
6371 PyObject *__pyx_t_7 = NULL;
6372 PyObject *__pyx_t_8 = NULL;
6374 PyObject *__pyx_t_10 = NULL;
6375 PyObject *__pyx_t_11 = NULL;
6376 PyObject *__pyx_t_12 = NULL;
6379 PyObject *__pyx_t_15 = NULL;
6380 PyObject *__pyx_t_16 = NULL;
6381 PyObject *__pyx_t_17 = NULL;
6382 PyObject *__pyx_t_18 = NULL;
6383 __Pyx_RefNannySetupContext(
"__cinit__", 0);
6392 __Pyx_INCREF(__pyx_kp_s_Cannot_initialize_clifford_objec);
6393 __pyx_v_error_msg_prefix = __pyx_kp_s_Cannot_initialize_clifford_objec;
6402 __pyx_t_1 = (__pyx_v_ixt == Py_None);
6403 __pyx_t_2 = (__pyx_t_1 != 0);
6414 __Pyx_PyThreadState_declare
6415 __Pyx_PyThreadState_assign
6416 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
6417 __Pyx_XGOTREF(__pyx_t_3);
6418 __Pyx_XGOTREF(__pyx_t_4);
6419 __Pyx_XGOTREF(__pyx_t_5);
6429 __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8PyClical_clifford);
6430 __pyx_t_1 = (__pyx_t_2 != 0);
6441 __pyx_t_6 =
new Clifford(__pyx_f_8PyClical_8clifford_unwrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_other)));
6443 __Pyx_CppExn2PyErr();
6444 __PYX_ERR(0, 592, __pyx_L4_error)
6446 __pyx_v_self->instance = __pyx_t_6;
6465 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8PyClical_index_set);
6466 __pyx_t_2 = (__pyx_t_1 != 0);
6477 __pyx_t_6 =
new Clifford(__pyx_f_8PyClical_9index_set_unwrap(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_other)), ((
scalar_t)1.0));
6479 __Pyx_CppExn2PyErr();
6480 __PYX_ERR(0, 594, __pyx_L4_error)
6482 __pyx_v_self->instance = __pyx_t_6;
6501 __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numbers);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 595, __pyx_L4_error)
6502 __Pyx_GOTREF(__pyx_t_7);
6503 __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)
6504 __Pyx_GOTREF(__pyx_t_8);
6505 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6506 __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)
6507 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6508 __pyx_t_1 = (__pyx_t_2 != 0);
6518 __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)
6522 __Pyx_CppExn2PyErr();
6523 __PYX_ERR(0, 596, __pyx_L4_error)
6525 __pyx_v_self->instance = __pyx_t_6;
6544 __pyx_t_1 = PyString_Check(__pyx_v_other);
6545 __pyx_t_2 = (__pyx_t_1 != 0);
6556 __Pyx_PyThreadState_declare
6557 __Pyx_PyThreadState_assign
6558 __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
6559 __Pyx_XGOTREF(__pyx_t_10);
6560 __Pyx_XGOTREF(__pyx_t_11);
6561 __Pyx_XGOTREF(__pyx_t_12);
6571 __pyx_t_13 = __Pyx_PyObject_AsWritableString(__pyx_v_other);
if (unlikely((!__pyx_t_13) && PyErr_Occurred())) __PYX_ERR(0, 599, __pyx_L11_error)
6573 __pyx_t_6 =
new Clifford(((
char *)__pyx_t_13));
6575 __Pyx_CppExn2PyErr();
6576 __PYX_ERR(0, 599, __pyx_L11_error)
6578 __pyx_v_self->instance = __pyx_t_6;
6588 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
6589 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
6590 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
6591 goto __pyx_L16_try_end;
6593 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6594 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
6603 __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
6605 __Pyx_AddTraceback(
"PyClical.clifford.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6606 if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_15) < 0) __PYX_ERR(0, 600, __pyx_L13_except_error)
6607 __Pyx_GOTREF(__pyx_t_8);
6608 __Pyx_GOTREF(__pyx_t_7);
6609 __Pyx_GOTREF(__pyx_t_15);
6618 __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)
6619 __Pyx_GOTREF(__pyx_t_16);
6620 __pyx_t_17 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 601, __pyx_L13_except_error)
6621 __Pyx_GOTREF(__pyx_t_17);
6622 __pyx_t_18 = PyNumber_Add(__pyx_t_16, __pyx_t_17);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 601, __pyx_L13_except_error)
6623 __Pyx_GOTREF(__pyx_t_18);
6624 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6625 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6626 __pyx_t_17 = PyNumber_Add(__pyx_t_18, __pyx_kp_s_);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 601, __pyx_L13_except_error)
6627 __Pyx_GOTREF(__pyx_t_17);
6628 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6629 __pyx_t_18 = PyTuple_New(1);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 601, __pyx_L13_except_error)
6630 __Pyx_GOTREF(__pyx_t_18);
6631 __Pyx_GIVEREF(__pyx_t_17);
6632 PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_17);
6634 __pyx_t_17 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_18, NULL);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 601, __pyx_L13_except_error)
6635 __Pyx_GOTREF(__pyx_t_17);
6636 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6637 __Pyx_Raise(__pyx_t_17, 0, 0, 0);
6638 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6639 __PYX_ERR(0, 601, __pyx_L13_except_error)
6641 goto __pyx_L13_except_error;
6642 __pyx_L13_except_error:;
6651 __Pyx_XGIVEREF(__pyx_t_10);
6652 __Pyx_XGIVEREF(__pyx_t_11);
6653 __Pyx_XGIVEREF(__pyx_t_12);
6654 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
6655 goto __pyx_L4_error;
6677 __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)
6678 __Pyx_GOTREF(__pyx_t_15);
6679 __pyx_t_7 = PyTuple_New(1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 603, __pyx_L4_error)
6680 __Pyx_GOTREF(__pyx_t_7);
6681 __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_other)));
6682 __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_other)));
6683 PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)Py_TYPE(__pyx_v_other)));
6684 __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_7, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 603, __pyx_L4_error)
6685 __Pyx_GOTREF(__pyx_t_8);
6686 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6687 __pyx_t_7 = PyNumber_Add(__pyx_t_15, __pyx_t_8);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 603, __pyx_L4_error)
6688 __Pyx_GOTREF(__pyx_t_7);
6689 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6690 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6691 __pyx_t_8 = PyNumber_Add(__pyx_t_7, __pyx_kp_s_);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 603, __pyx_L4_error)
6692 __Pyx_GOTREF(__pyx_t_8);
6693 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6694 __pyx_t_7 = PyTuple_New(1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 603, __pyx_L4_error)
6695 __Pyx_GOTREF(__pyx_t_7);
6696 __Pyx_GIVEREF(__pyx_t_8);
6697 PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8);
6699 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_7, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 603, __pyx_L4_error)
6700 __Pyx_GOTREF(__pyx_t_8);
6701 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6702 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
6703 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6704 __PYX_ERR(0, 603, __pyx_L4_error)
6716 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6717 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6718 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
6719 goto __pyx_L9_try_end;
6721 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
6722 __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
6723 __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
6724 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
6725 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6726 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
6735 __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
6737 __Pyx_AddTraceback(
"PyClical.clifford.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6738 if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_15) < 0) __PYX_ERR(0, 604, __pyx_L6_except_error)
6739 __Pyx_GOTREF(__pyx_t_8);
6740 __Pyx_GOTREF(__pyx_t_7);
6741 __Pyx_GOTREF(__pyx_t_15);
6742 __Pyx_INCREF(__pyx_t_7);
6743 __pyx_v_err = __pyx_t_7;
6752 __pyx_t_17 = PyNumber_Add(__pyx_v_error_msg_prefix, __pyx_kp_s__2);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 605, __pyx_L6_except_error)
6753 __Pyx_GOTREF(__pyx_t_17);
6754 __pyx_t_18 = PyTuple_New(1);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 605, __pyx_L6_except_error)
6755 __Pyx_GOTREF(__pyx_t_18);
6756 __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_other)));
6757 __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_other)));
6758 PyTuple_SET_ITEM(__pyx_t_18, 0, ((PyObject *)Py_TYPE(__pyx_v_other)));
6759 __pyx_t_16 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_18, NULL);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 605, __pyx_L6_except_error)
6760 __Pyx_GOTREF(__pyx_t_16);
6761 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6762 __pyx_t_18 = PyNumber_Add(__pyx_t_17, __pyx_t_16);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 605, __pyx_L6_except_error)
6763 __Pyx_GOTREF(__pyx_t_18);
6764 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6765 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6774 __pyx_t_16 = PyNumber_Add(__pyx_t_18, __pyx_kp_s_value);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 606, __pyx_L6_except_error)
6775 __Pyx_GOTREF(__pyx_t_16);
6776 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6777 __pyx_t_18 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 606, __pyx_L6_except_error)
6778 __Pyx_GOTREF(__pyx_t_18);
6779 __pyx_t_17 = PyNumber_Add(__pyx_t_16, __pyx_t_18);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 606, __pyx_L6_except_error)
6780 __Pyx_GOTREF(__pyx_t_17);
6781 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6782 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6783 __pyx_t_18 = PyNumber_Add(__pyx_t_17, __pyx_kp_s__5);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 606, __pyx_L6_except_error)
6784 __Pyx_GOTREF(__pyx_t_18);
6785 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6794 __pyx_t_17 = PyNumber_Add(__pyx_t_18, __pyx_kp_s__6);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 607, __pyx_L6_except_error)
6795 __Pyx_GOTREF(__pyx_t_17);
6796 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6797 __pyx_t_18 = PyTuple_New(1);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 607, __pyx_L6_except_error)
6798 __Pyx_GOTREF(__pyx_t_18);
6799 __Pyx_INCREF(__pyx_v_err);
6800 __Pyx_GIVEREF(__pyx_v_err);
6801 PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_v_err);
6802 __pyx_t_16 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_18, NULL);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 607, __pyx_L6_except_error)
6803 __Pyx_GOTREF(__pyx_t_16);
6804 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6805 __pyx_t_18 = PyNumber_Add(__pyx_t_17, __pyx_t_16);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 607, __pyx_L6_except_error)
6806 __Pyx_GOTREF(__pyx_t_18);
6807 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6808 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6817 __pyx_t_16 = PyTuple_New(1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 605, __pyx_L6_except_error)
6818 __Pyx_GOTREF(__pyx_t_16);
6819 __Pyx_GIVEREF(__pyx_t_18);
6820 PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_18);
6822 __pyx_t_18 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_16, NULL);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 605, __pyx_L6_except_error)
6823 __Pyx_GOTREF(__pyx_t_18);
6824 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6825 __Pyx_Raise(__pyx_t_18, 0, 0, 0);
6826 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6827 __PYX_ERR(0, 605, __pyx_L6_except_error)
6829 goto __pyx_L6_except_error;
6830 __pyx_L6_except_error:;
6839 __Pyx_XGIVEREF(__pyx_t_3);
6840 __Pyx_XGIVEREF(__pyx_t_4);
6841 __Pyx_XGIVEREF(__pyx_t_5);
6842 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
6843 goto __pyx_L1_error;
6864 __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_ixt, __pyx_ptype_8PyClical_index_set);
6865 __pyx_t_1 = (__pyx_t_2 != 0);
6875 __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_numbers);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 609, __pyx_L1_error)
6876 __Pyx_GOTREF(__pyx_t_15);
6877 __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)
6878 __Pyx_GOTREF(__pyx_t_7);
6879 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6880 __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)
6881 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6882 __pyx_t_2 = (__pyx_t_1 != 0);
6892 __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)
6894 __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));
6896 __Pyx_CppExn2PyErr();
6897 __PYX_ERR(0, 610, __pyx_L1_error)
6899 __pyx_v_self->instance = __pyx_t_6;
6918 __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_collections);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 611, __pyx_L1_error)
6919 __Pyx_GOTREF(__pyx_t_7);
6920 __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)
6921 __Pyx_GOTREF(__pyx_t_15);
6922 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6923 __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)
6924 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6925 __pyx_t_1 = (__pyx_t_2 != 0);
6936 __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)));
6938 __Pyx_CppExn2PyErr();
6939 __PYX_ERR(0, 612, __pyx_L1_error)
6941 __pyx_v_self->instance = __pyx_t_6;
6961 __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)
6962 __Pyx_GOTREF(__pyx_t_15);
6963 __pyx_t_7 = PyTuple_New(1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 614, __pyx_L1_error)
6964 __Pyx_GOTREF(__pyx_t_7);
6965 __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_other)));
6966 __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_other)));
6967 PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)Py_TYPE(__pyx_v_other)));
6968 __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_7, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 614, __pyx_L1_error)
6969 __Pyx_GOTREF(__pyx_t_8);
6970 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6971 __pyx_t_7 = PyNumber_Add(__pyx_t_15, __pyx_t_8);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 614, __pyx_L1_error)
6972 __Pyx_GOTREF(__pyx_t_7);
6973 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6974 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6983 __pyx_t_8 = PyNumber_Add(__pyx_t_7, __pyx_kp_s__8);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 615, __pyx_L1_error)
6984 __Pyx_GOTREF(__pyx_t_8);
6985 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6986 __pyx_t_7 = PyObject_Repr(__pyx_v_ixt);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 615, __pyx_L1_error)
6987 __Pyx_GOTREF(__pyx_t_7);
6988 __pyx_t_15 = PyNumber_Add(__pyx_t_8, __pyx_t_7);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 615, __pyx_L1_error)
6989 __Pyx_GOTREF(__pyx_t_15);
6990 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6991 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6992 __pyx_t_7 = PyNumber_Add(__pyx_t_15, __pyx_kp_s__9);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 615, __pyx_L1_error)
6993 __Pyx_GOTREF(__pyx_t_7);
6994 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7003 __pyx_t_15 = PyTuple_New(1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 614, __pyx_L1_error)
7004 __Pyx_GOTREF(__pyx_t_15);
7005 __Pyx_GIVEREF(__pyx_t_7);
7006 PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_7);
7008 __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_15, NULL);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 614, __pyx_L1_error)
7009 __Pyx_GOTREF(__pyx_t_7);
7010 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7011 __Pyx_Raise(__pyx_t_7, 0, 0, 0);
7012 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7013 __PYX_ERR(0, 614, __pyx_L1_error)
7035 __pyx_t_7 = PyNumber_Add(__pyx_v_error_msg_prefix, __pyx_kp_s__7);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 617, __pyx_L1_error)
7036 __Pyx_GOTREF(__pyx_t_7);
7037 __pyx_t_15 = PyTuple_New(1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 617, __pyx_L1_error)
7038 __Pyx_GOTREF(__pyx_t_15);
7039 __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_other)));
7040 __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_other)));
7041 PyTuple_SET_ITEM(__pyx_t_15, 0, ((PyObject *)Py_TYPE(__pyx_v_other)));
7042 __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_15, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 617, __pyx_L1_error)
7043 __Pyx_GOTREF(__pyx_t_8);
7044 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7045 __pyx_t_15 = PyNumber_Add(__pyx_t_7, __pyx_t_8);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 617, __pyx_L1_error)
7046 __Pyx_GOTREF(__pyx_t_15);
7047 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7048 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7057 __pyx_t_8 = PyNumber_Add(__pyx_t_15, __pyx_kp_s__8);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 618, __pyx_L1_error)
7058 __Pyx_GOTREF(__pyx_t_8);
7059 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7060 __pyx_t_15 = PyTuple_New(1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 618, __pyx_L1_error)
7061 __Pyx_GOTREF(__pyx_t_15);
7062 __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_ixt)));
7063 __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_ixt)));
7064 PyTuple_SET_ITEM(__pyx_t_15, 0, ((PyObject *)Py_TYPE(__pyx_v_ixt)));
7065 __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_15, NULL);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 618, __pyx_L1_error)
7066 __Pyx_GOTREF(__pyx_t_7);
7067 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7068 __pyx_t_15 = PyNumber_Add(__pyx_t_8, __pyx_t_7);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 618, __pyx_L1_error)
7069 __Pyx_GOTREF(__pyx_t_15);
7070 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7071 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7072 __pyx_t_7 = PyNumber_Add(__pyx_t_15, __pyx_kp_s__9);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 618, __pyx_L1_error)
7073 __Pyx_GOTREF(__pyx_t_7);
7074 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7083 __pyx_t_15 = PyTuple_New(1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 617, __pyx_L1_error)
7084 __Pyx_GOTREF(__pyx_t_15);
7085 __Pyx_GIVEREF(__pyx_t_7);
7086 PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_7);
7088 __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_15, NULL);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 617, __pyx_L1_error)
7089 __Pyx_GOTREF(__pyx_t_7);
7090 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7091 __Pyx_Raise(__pyx_t_7, 0, 0, 0);
7092 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7093 __PYX_ERR(0, 617, __pyx_L1_error)
7109 __Pyx_XDECREF(__pyx_t_7);
7110 __Pyx_XDECREF(__pyx_t_8);
7111 __Pyx_XDECREF(__pyx_t_15);
7112 __Pyx_XDECREF(__pyx_t_16);
7113 __Pyx_XDECREF(__pyx_t_17);
7114 __Pyx_XDECREF(__pyx_t_18);
7115 __Pyx_AddTraceback(
"PyClical.clifford.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7118 __Pyx_XDECREF(__pyx_v_error_msg_prefix);
7119 __Pyx_XDECREF(__pyx_v_err);
7120 __Pyx_RefNannyFinishContext();
7133 static void __pyx_pw_8PyClical_8clifford_5__dealloc__(PyObject *__pyx_v_self);
7134 static void __pyx_pw_8PyClical_8clifford_5__dealloc__(PyObject *__pyx_v_self) {
7135 __Pyx_RefNannyDeclarations
7136 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
7137 __pyx_pf_8PyClical_8clifford_4__dealloc__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
7140 __Pyx_RefNannyFinishContext();
7143 static void __pyx_pf_8PyClical_8clifford_4__dealloc__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
7144 __Pyx_RefNannyDeclarations
7145 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
7154 delete __pyx_v_self->instance;
7165 __Pyx_RefNannyFinishContext();
7177 static int __pyx_pw_8PyClical_8clifford_7__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_x);
7178 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 ";
7179 #if CYTHON_COMPILING_IN_CPYTHON 7180 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_6__contains__;
7182 static int __pyx_pw_8PyClical_8clifford_7__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_x) {
7184 __Pyx_RefNannyDeclarations
7185 __Pyx_RefNannySetupContext(
"__contains__ (wrapper)", 0);
7186 __pyx_r = __pyx_pf_8PyClical_8clifford_6__contains__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_x));
7189 __Pyx_RefNannyFinishContext();
7193 static int __pyx_pf_8PyClical_8clifford_6__contains__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_x) {
7195 __Pyx_RefNannyDeclarations
7196 PyObject *__pyx_t_1 = NULL;
7197 __Pyx_RefNannySetupContext(
"__contains__", 0);
7206 __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)
7207 __Pyx_GOTREF(__pyx_t_1);
7208 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
7209 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7210 __PYX_ERR(0, 635, __pyx_L1_error)
7222 __Pyx_XDECREF(__pyx_t_1);
7223 __Pyx_AddTraceback(
"PyClical.clifford.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7225 __Pyx_RefNannyFinishContext();
7238 static PyObject *__pyx_pw_8PyClical_8clifford_9__iter__(PyObject *__pyx_v_self);
7239 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 ";
7240 #if CYTHON_COMPILING_IN_CPYTHON 7241 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_8__iter__;
7243 static PyObject *__pyx_pw_8PyClical_8clifford_9__iter__(PyObject *__pyx_v_self) {
7244 PyObject *__pyx_r = 0;
7245 __Pyx_RefNannyDeclarations
7246 __Pyx_RefNannySetupContext(
"__iter__ (wrapper)", 0);
7247 __pyx_r = __pyx_pf_8PyClical_8clifford_8__iter__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
7250 __Pyx_RefNannyFinishContext();
7254 static PyObject *__pyx_pf_8PyClical_8clifford_8__iter__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
7255 PyObject *__pyx_r = NULL;
7256 __Pyx_RefNannyDeclarations
7257 PyObject *__pyx_t_1 = NULL;
7258 __Pyx_RefNannySetupContext(
"__iter__", 0);
7267 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 646, __pyx_L1_error)
7268 __Pyx_GOTREF(__pyx_t_1);
7269 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
7270 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7271 __PYX_ERR(0, 646, __pyx_L1_error)
7283 __Pyx_XDECREF(__pyx_t_1);
7284 __Pyx_AddTraceback(
"PyClical.clifford.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7286 __Pyx_XGIVEREF(__pyx_r);
7287 __Pyx_RefNannyFinishContext();
7300 static PyObject *__pyx_pw_8PyClical_8clifford_11reframe(PyObject *__pyx_v_self, PyObject *__pyx_v_ixt);
7301 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 ";
7302 static PyObject *__pyx_pw_8PyClical_8clifford_11reframe(PyObject *__pyx_v_self, PyObject *__pyx_v_ixt) {
7303 PyObject *__pyx_r = 0;
7304 __Pyx_RefNannyDeclarations
7305 __Pyx_RefNannySetupContext(
"reframe (wrapper)", 0);
7306 __pyx_r = __pyx_pf_8PyClical_8clifford_10reframe(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_ixt));
7309 __Pyx_RefNannyFinishContext();
7313 static PyObject *__pyx_pf_8PyClical_8clifford_10reframe(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_ixt) {
7314 PyObject *__pyx_v_error_msg_prefix = NULL;
7315 struct __pyx_obj_8PyClical_clifford *__pyx_v_result = NULL;
7316 PyObject *__pyx_v_err = NULL;
7317 PyObject *__pyx_r = NULL;
7318 __Pyx_RefNannyDeclarations
7321 PyObject *__pyx_t_3 = NULL;
7322 PyObject *__pyx_t_4 = NULL;
7323 PyObject *__pyx_t_5 = NULL;
7324 PyObject *__pyx_t_6 = NULL;
7327 PyObject *__pyx_t_9 = NULL;
7328 PyObject *__pyx_t_10 = NULL;
7329 PyObject *__pyx_t_11 = NULL;
7330 PyObject *__pyx_t_12 = NULL;
7331 PyObject *__pyx_t_13 = NULL;
7332 __Pyx_RefNannySetupContext(
"reframe", 0);
7341 __Pyx_INCREF(__pyx_kp_s_Cannot_reframe);
7342 __pyx_v_error_msg_prefix = __pyx_kp_s_Cannot_reframe;
7351 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_ixt, __pyx_ptype_8PyClical_index_set);
7352 __pyx_t_2 = (__pyx_t_1 != 0);
7363 __Pyx_PyThreadState_declare
7364 __Pyx_PyThreadState_assign
7365 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
7366 __Pyx_XGOTREF(__pyx_t_3);
7367 __Pyx_XGOTREF(__pyx_t_4);
7368 __Pyx_XGOTREF(__pyx_t_5);
7378 __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 661, __pyx_L4_error)
7379 __Pyx_GOTREF(__pyx_t_6);
7380 __pyx_v_result = ((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_6);
7391 __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)));
7393 __Pyx_CppExn2PyErr();
7394 __PYX_ERR(0, 662, __pyx_L4_error)
7396 __pyx_v_result->instance = __pyx_t_7;
7406 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7407 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7408 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
7409 goto __pyx_L9_try_end;
7411 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
7420 __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
7422 __Pyx_AddTraceback(
"PyClical.clifford.reframe", __pyx_clineno, __pyx_lineno, __pyx_filename);
7423 if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 663, __pyx_L6_except_error)
7424 __Pyx_GOTREF(__pyx_t_6);
7425 __Pyx_GOTREF(__pyx_t_9);
7426 __Pyx_GOTREF(__pyx_t_10);
7427 __Pyx_INCREF(__pyx_t_9);
7428 __pyx_v_err = __pyx_t_9;
7437 __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)
7438 __Pyx_GOTREF(__pyx_t_11);
7439 __pyx_t_12 = PyTuple_New(1);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 664, __pyx_L6_except_error)
7440 __Pyx_GOTREF(__pyx_t_12);
7441 __Pyx_INCREF(((PyObject *)__pyx_v_self));
7442 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
7443 PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)__pyx_v_self));
7444 __pyx_t_13 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_12, NULL);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 664, __pyx_L6_except_error)
7445 __Pyx_GOTREF(__pyx_t_13);
7446 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7447 __pyx_t_12 = PyNumber_Add(__pyx_t_11, __pyx_t_13);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 664, __pyx_L6_except_error)
7448 __Pyx_GOTREF(__pyx_t_12);
7449 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7450 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7451 __pyx_t_13 = PyNumber_Add(__pyx_t_12, __pyx_kp_s_to_frame);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 664, __pyx_L6_except_error)
7452 __Pyx_GOTREF(__pyx_t_13);
7453 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7462 __pyx_t_12 = PyTuple_New(1);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 665, __pyx_L6_except_error)
7463 __Pyx_GOTREF(__pyx_t_12);
7464 __Pyx_INCREF(__pyx_v_ixt);
7465 __Pyx_GIVEREF(__pyx_v_ixt);
7466 PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_ixt);
7467 __pyx_t_11 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_12, NULL);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 665, __pyx_L6_except_error)
7468 __Pyx_GOTREF(__pyx_t_11);
7469 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7470 __pyx_t_12 = PyNumber_Add(__pyx_t_13, __pyx_t_11);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 665, __pyx_L6_except_error)
7471 __Pyx_GOTREF(__pyx_t_12);
7472 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7473 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7474 __pyx_t_11 = PyNumber_Add(__pyx_t_12, __pyx_kp_s__5);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 665, __pyx_L6_except_error)
7475 __Pyx_GOTREF(__pyx_t_11);
7476 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7485 __pyx_t_12 = PyNumber_Add(__pyx_t_11, __pyx_kp_s__6);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 666, __pyx_L6_except_error)
7486 __Pyx_GOTREF(__pyx_t_12);
7487 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7488 __pyx_t_11 = PyTuple_New(1);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 666, __pyx_L6_except_error)
7489 __Pyx_GOTREF(__pyx_t_11);
7490 __Pyx_INCREF(__pyx_v_err);
7491 __Pyx_GIVEREF(__pyx_v_err);
7492 PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_err);
7493 __pyx_t_13 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_11, NULL);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 666, __pyx_L6_except_error)
7494 __Pyx_GOTREF(__pyx_t_13);
7495 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7496 __pyx_t_11 = PyNumber_Add(__pyx_t_12, __pyx_t_13);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 666, __pyx_L6_except_error)
7497 __Pyx_GOTREF(__pyx_t_11);
7498 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7499 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7508 __pyx_t_13 = PyTuple_New(1);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 664, __pyx_L6_except_error)
7509 __Pyx_GOTREF(__pyx_t_13);
7510 __Pyx_GIVEREF(__pyx_t_11);
7511 PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11);
7513 __pyx_t_11 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_13, NULL);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 664, __pyx_L6_except_error)
7514 __Pyx_GOTREF(__pyx_t_11);
7515 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7516 __Pyx_Raise(__pyx_t_11, 0, 0, 0);
7517 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7518 __PYX_ERR(0, 664, __pyx_L6_except_error)
7520 goto __pyx_L6_except_error;
7521 __pyx_L6_except_error:;
7530 __Pyx_XGIVEREF(__pyx_t_3);
7531 __Pyx_XGIVEREF(__pyx_t_4);
7532 __Pyx_XGIVEREF(__pyx_t_5);
7533 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
7534 goto __pyx_L1_error;
7556 __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)
7557 __Pyx_GOTREF(__pyx_t_10);
7558 __pyx_t_9 = PyTuple_New(1);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 668, __pyx_L1_error)
7559 __Pyx_GOTREF(__pyx_t_9);
7560 __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_ixt)));
7561 __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_ixt)));
7562 PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)Py_TYPE(__pyx_v_ixt)));
7563 __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_9, NULL);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 668, __pyx_L1_error)
7564 __Pyx_GOTREF(__pyx_t_6);
7565 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7566 __pyx_t_9 = PyNumber_Add(__pyx_t_10, __pyx_t_6);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 668, __pyx_L1_error)
7567 __Pyx_GOTREF(__pyx_t_9);
7568 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7569 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7570 __pyx_t_6 = PyNumber_Add(__pyx_t_9, __pyx_kp_s__9);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 668, __pyx_L1_error)
7571 __Pyx_GOTREF(__pyx_t_6);
7572 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7573 __pyx_t_9 = PyTuple_New(1);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 668, __pyx_L1_error)
7574 __Pyx_GOTREF(__pyx_t_9);
7575 __Pyx_GIVEREF(__pyx_t_6);
7576 PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6);
7578 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_9, NULL);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 668, __pyx_L1_error)
7579 __Pyx_GOTREF(__pyx_t_6);
7580 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7581 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
7582 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7583 __PYX_ERR(0, 668, __pyx_L1_error)
7594 __Pyx_XDECREF(__pyx_r);
7595 __Pyx_INCREF(((PyObject *)__pyx_v_result));
7596 __pyx_r = ((PyObject *)__pyx_v_result);
7609 __Pyx_XDECREF(__pyx_t_6);
7610 __Pyx_XDECREF(__pyx_t_9);
7611 __Pyx_XDECREF(__pyx_t_10);
7612 __Pyx_XDECREF(__pyx_t_11);
7613 __Pyx_XDECREF(__pyx_t_12);
7614 __Pyx_XDECREF(__pyx_t_13);
7615 __Pyx_AddTraceback(
"PyClical.clifford.reframe", __pyx_clineno, __pyx_lineno, __pyx_filename);
7618 __Pyx_XDECREF(__pyx_v_error_msg_prefix);
7619 __Pyx_XDECREF((PyObject *)__pyx_v_result);
7620 __Pyx_XDECREF(__pyx_v_err);
7621 __Pyx_XGIVEREF(__pyx_r);
7622 __Pyx_RefNannyFinishContext();
7635 static PyObject *__pyx_pw_8PyClical_8clifford_13__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op);
7636 static PyObject *__pyx_pw_8PyClical_8clifford_13__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op) {
7637 PyObject *__pyx_r = 0;
7638 __Pyx_RefNannyDeclarations
7639 __Pyx_RefNannySetupContext(
"__richcmp__ (wrapper)", 0);
7640 __pyx_r = __pyx_pf_8PyClical_8clifford_12__richcmp__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs), ((
int)__pyx_v_op));
7643 __Pyx_RefNannyFinishContext();
7647 static PyObject *__pyx_pf_8PyClical_8clifford_12__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op) {
7648 PyObject *__pyx_r = NULL;
7649 __Pyx_RefNannyDeclarations
7653 PyObject *__pyx_t_4 = NULL;
7654 PyObject *__pyx_t_5 = NULL;
7655 PyObject *__pyx_t_6 = NULL;
7656 __Pyx_RefNannySetupContext(
"__richcmp__", 0);
7665 __pyx_t_1 = ((__pyx_v_op == 2) != 0);
7675 __pyx_t_2 = (__pyx_v_lhs == Py_None);
7676 __pyx_t_3 = (__pyx_t_2 != 0);
7679 __pyx_t_1 = __pyx_t_3;
7680 goto __pyx_L5_bool_binop_done;
7682 __pyx_t_3 = (__pyx_v_rhs == Py_None);
7683 __pyx_t_2 = (__pyx_t_3 != 0);
7684 __pyx_t_1 = __pyx_t_2;
7685 __pyx_L5_bool_binop_done:;
7695 __Pyx_XDECREF(__pyx_r);
7696 __pyx_t_1 = (__pyx_v_lhs == __pyx_v_rhs);
7697 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error)
7698 __Pyx_GOTREF(__pyx_t_4);
7699 __pyx_r = __pyx_t_4;
7720 __Pyx_XDECREF(__pyx_r);
7721 __pyx_t_1 = (__pyx_f_8PyClical_toClifford(__pyx_v_lhs) == __pyx_f_8PyClical_toClifford(__pyx_v_rhs));
7722 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 694, __pyx_L1_error)
7723 __Pyx_GOTREF(__pyx_t_4);
7724 __pyx_r = __pyx_t_4;
7745 __pyx_t_1 = ((__pyx_v_op == 3) != 0);
7755 __pyx_t_2 = (__pyx_v_lhs == Py_None);
7756 __pyx_t_3 = (__pyx_t_2 != 0);
7759 __pyx_t_1 = __pyx_t_3;
7760 goto __pyx_L8_bool_binop_done;
7762 __pyx_t_3 = (__pyx_v_rhs == Py_None);
7763 __pyx_t_2 = (__pyx_t_3 != 0);
7764 __pyx_t_1 = __pyx_t_2;
7765 __pyx_L8_bool_binop_done:;
7775 __Pyx_XDECREF(__pyx_r);
7776 __pyx_t_1 = (__pyx_v_lhs == __pyx_v_rhs);
7777 __pyx_t_4 = __Pyx_PyBool_FromLong((!((!(!__pyx_t_1)) != 0)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 697, __pyx_L1_error)
7778 __Pyx_GOTREF(__pyx_t_4);
7779 __pyx_r = __pyx_t_4;
7800 __Pyx_XDECREF(__pyx_r);
7801 __pyx_t_1 = (__pyx_f_8PyClical_toClifford(__pyx_v_lhs) != __pyx_f_8PyClical_toClifford(__pyx_v_rhs));
7802 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 699, __pyx_L1_error)
7803 __Pyx_GOTREF(__pyx_t_4);
7804 __pyx_r = __pyx_t_4;
7825 __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_lhs, __pyx_ptype_8PyClical_clifford);
7826 __pyx_t_3 = (__pyx_t_2 != 0);
7829 __pyx_t_1 = __pyx_t_3;
7830 goto __pyx_L10_bool_binop_done;
7832 __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_rhs, __pyx_ptype_8PyClical_clifford);
7833 __pyx_t_2 = (__pyx_t_3 != 0);
7834 __pyx_t_1 = __pyx_t_2;
7835 __pyx_L10_bool_binop_done:;
7845 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 702, __pyx_L1_error)
7846 __Pyx_GOTREF(__pyx_t_4);
7847 __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_lhs)));
7848 __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_lhs)));
7849 PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)Py_TYPE(__pyx_v_lhs)));
7850 __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_4, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 702, __pyx_L1_error)
7851 __Pyx_GOTREF(__pyx_t_5);
7852 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7853 __pyx_t_4 = PyNumber_Add(__pyx_kp_s_This_comparison_operator_is_not, __pyx_t_5);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 702, __pyx_L1_error)
7854 __Pyx_GOTREF(__pyx_t_4);
7855 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7856 __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_kp_s__8);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 702, __pyx_L1_error)
7857 __Pyx_GOTREF(__pyx_t_5);
7858 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7859 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 702, __pyx_L1_error)
7860 __Pyx_GOTREF(__pyx_t_4);
7861 __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_rhs)));
7862 __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_rhs)));
7863 PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)Py_TYPE(__pyx_v_rhs)));
7864 __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_4, NULL);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 702, __pyx_L1_error)
7865 __Pyx_GOTREF(__pyx_t_6);
7866 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7867 __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_t_6);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 702, __pyx_L1_error)
7868 __Pyx_GOTREF(__pyx_t_4);
7869 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7870 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7871 __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_kp_s_);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 702, __pyx_L1_error)
7872 __Pyx_GOTREF(__pyx_t_6);
7873 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7882 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 701, __pyx_L1_error)
7883 __Pyx_GOTREF(__pyx_t_4);
7884 __Pyx_GIVEREF(__pyx_t_6);
7885 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
7887 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_4, NULL);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 701, __pyx_L1_error)
7888 __Pyx_GOTREF(__pyx_t_6);
7889 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7890 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
7891 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7892 __PYX_ERR(0, 701, __pyx_L1_error)
7911 __Pyx_XDECREF(__pyx_r);
7912 __Pyx_INCREF(__pyx_builtin_NotImplemented);
7913 __pyx_r = __pyx_builtin_NotImplemented;
7927 __Pyx_XDECREF(__pyx_t_4);
7928 __Pyx_XDECREF(__pyx_t_5);
7929 __Pyx_XDECREF(__pyx_t_6);
7930 __Pyx_AddTraceback(
"PyClical.clifford.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7933 __Pyx_XGIVEREF(__pyx_r);
7934 __Pyx_RefNannyFinishContext();
7947 static PyObject *__pyx_pw_8PyClical_8clifford_15__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ixt);
7948 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 ";
7949 #if CYTHON_COMPILING_IN_CPYTHON 7950 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_14__getitem__;
7952 static PyObject *__pyx_pw_8PyClical_8clifford_15__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ixt) {
7953 PyObject *__pyx_r = 0;
7954 __Pyx_RefNannyDeclarations
7955 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
7956 __pyx_r = __pyx_pf_8PyClical_8clifford_14__getitem__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_ixt));
7959 __Pyx_RefNannyFinishContext();
7963 static PyObject *__pyx_pf_8PyClical_8clifford_14__getitem__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_ixt) {
7964 PyObject *__pyx_r = NULL;
7965 __Pyx_RefNannyDeclarations
7966 PyObject *__pyx_t_1 = NULL;
7967 __Pyx_RefNannySetupContext(
"__getitem__", 0);
7976 __Pyx_XDECREF(__pyx_r);
7977 __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)
7978 __Pyx_GOTREF(__pyx_t_1);
7979 __pyx_r = __pyx_t_1;
7993 __Pyx_XDECREF(__pyx_t_1);
7994 __Pyx_AddTraceback(
"PyClical.clifford.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7997 __Pyx_XGIVEREF(__pyx_r);
7998 __Pyx_RefNannyFinishContext();
8011 static PyObject *__pyx_pw_8PyClical_8clifford_17__neg__(PyObject *__pyx_v_self);
8012 static char __pyx_doc_8PyClical_8clifford_16__neg__[] =
"\n Unary -.\n\n >>> print -clifford(\"{1}\")\n -{1}\n ";
8013 #if CYTHON_COMPILING_IN_CPYTHON 8014 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_16__neg__;
8016 static PyObject *__pyx_pw_8PyClical_8clifford_17__neg__(PyObject *__pyx_v_self) {
8017 PyObject *__pyx_r = 0;
8018 __Pyx_RefNannyDeclarations
8019 __Pyx_RefNannySetupContext(
"__neg__ (wrapper)", 0);
8020 __pyx_r = __pyx_pf_8PyClical_8clifford_16__neg__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
8023 __Pyx_RefNannyFinishContext();
8027 static PyObject *__pyx_pf_8PyClical_8clifford_16__neg__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
8028 PyObject *__pyx_r = NULL;
8029 __Pyx_RefNannyDeclarations
8030 PyObject *__pyx_t_1 = NULL;
8031 PyObject *__pyx_t_2 = NULL;
8032 __Pyx_RefNannySetupContext(
"__neg__", 0);
8041 __Pyx_XDECREF(__pyx_r);
8042 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 728, __pyx_L1_error)
8043 __Pyx_GOTREF(__pyx_t_1);
8044 __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)
8045 __Pyx_GOTREF(__pyx_t_2);
8046 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8047 __pyx_r = __pyx_t_2;
8061 __Pyx_XDECREF(__pyx_t_1);
8062 __Pyx_XDECREF(__pyx_t_2);
8063 __Pyx_AddTraceback(
"PyClical.clifford.__neg__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8066 __Pyx_XGIVEREF(__pyx_r);
8067 __Pyx_RefNannyFinishContext();
8080 static PyObject *__pyx_pw_8PyClical_8clifford_19__pos__(PyObject *__pyx_v_self);
8081 static char __pyx_doc_8PyClical_8clifford_18__pos__[] =
"\n Unary +.\n\n >>> print +clifford(\"{1}\")\n {1}\n ";
8082 #if CYTHON_COMPILING_IN_CPYTHON 8083 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_18__pos__;
8085 static PyObject *__pyx_pw_8PyClical_8clifford_19__pos__(PyObject *__pyx_v_self) {
8086 PyObject *__pyx_r = 0;
8087 __Pyx_RefNannyDeclarations
8088 __Pyx_RefNannySetupContext(
"__pos__ (wrapper)", 0);
8089 __pyx_r = __pyx_pf_8PyClical_8clifford_18__pos__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
8092 __Pyx_RefNannyFinishContext();
8096 static PyObject *__pyx_pf_8PyClical_8clifford_18__pos__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
8097 PyObject *__pyx_r = NULL;
8098 __Pyx_RefNannyDeclarations
8099 PyObject *__pyx_t_1 = NULL;
8100 PyObject *__pyx_t_2 = NULL;
8101 __Pyx_RefNannySetupContext(
"__pos__", 0);
8110 __Pyx_XDECREF(__pyx_r);
8111 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 737, __pyx_L1_error)
8112 __Pyx_GOTREF(__pyx_t_1);
8113 __Pyx_INCREF(((PyObject *)__pyx_v_self));
8114 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
8115 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
8116 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_t_1, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 737, __pyx_L1_error)
8117 __Pyx_GOTREF(__pyx_t_2);
8118 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8119 __pyx_r = __pyx_t_2;
8133 __Pyx_XDECREF(__pyx_t_1);
8134 __Pyx_XDECREF(__pyx_t_2);
8135 __Pyx_AddTraceback(
"PyClical.clifford.__pos__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8138 __Pyx_XGIVEREF(__pyx_r);
8139 __Pyx_RefNannyFinishContext();
8152 static PyObject *__pyx_pw_8PyClical_8clifford_21__add__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8153 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 ";
8154 #if CYTHON_COMPILING_IN_CPYTHON 8155 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_20__add__;
8157 static PyObject *__pyx_pw_8PyClical_8clifford_21__add__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8158 PyObject *__pyx_r = 0;
8159 __Pyx_RefNannyDeclarations
8160 __Pyx_RefNannySetupContext(
"__add__ (wrapper)", 0);
8161 __pyx_r = __pyx_pf_8PyClical_8clifford_20__add__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8164 __Pyx_RefNannyFinishContext();
8168 static PyObject *__pyx_pf_8PyClical_8clifford_20__add__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8169 PyObject *__pyx_r = NULL;
8170 __Pyx_RefNannyDeclarations
8171 PyObject *__pyx_t_1 = NULL;
8172 PyObject *__pyx_t_2 = NULL;
8173 __Pyx_RefNannySetupContext(
"__add__", 0);
8182 __Pyx_XDECREF(__pyx_r);
8183 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 748, __pyx_L1_error)
8184 __Pyx_GOTREF(__pyx_t_1);
8185 __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)
8186 __Pyx_GOTREF(__pyx_t_2);
8187 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8188 __pyx_r = __pyx_t_2;
8202 __Pyx_XDECREF(__pyx_t_1);
8203 __Pyx_XDECREF(__pyx_t_2);
8204 __Pyx_AddTraceback(
"PyClical.clifford.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8207 __Pyx_XGIVEREF(__pyx_r);
8208 __Pyx_RefNannyFinishContext();
8221 static PyObject *__pyx_pw_8PyClical_8clifford_23__iadd__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8222 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 ";
8223 #if CYTHON_COMPILING_IN_CPYTHON 8224 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_22__iadd__;
8226 static PyObject *__pyx_pw_8PyClical_8clifford_23__iadd__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8227 PyObject *__pyx_r = 0;
8228 __Pyx_RefNannyDeclarations
8229 __Pyx_RefNannySetupContext(
"__iadd__ (wrapper)", 0);
8230 __pyx_r = __pyx_pf_8PyClical_8clifford_22__iadd__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8233 __Pyx_RefNannyFinishContext();
8237 static PyObject *__pyx_pf_8PyClical_8clifford_22__iadd__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8238 PyObject *__pyx_r = NULL;
8239 __Pyx_RefNannyDeclarations
8240 PyObject *__pyx_t_1 = NULL;
8241 __Pyx_RefNannySetupContext(
"__iadd__", 0);
8250 __Pyx_XDECREF(__pyx_r);
8251 __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)
8252 __Pyx_GOTREF(__pyx_t_1);
8253 __pyx_r = __pyx_t_1;
8267 __Pyx_XDECREF(__pyx_t_1);
8268 __Pyx_AddTraceback(
"PyClical.clifford.__iadd__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8271 __Pyx_XGIVEREF(__pyx_r);
8272 __Pyx_RefNannyFinishContext();
8285 static PyObject *__pyx_pw_8PyClical_8clifford_25__sub__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8286 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 ";
8287 #if CYTHON_COMPILING_IN_CPYTHON 8288 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_24__sub__;
8290 static PyObject *__pyx_pw_8PyClical_8clifford_25__sub__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8291 PyObject *__pyx_r = 0;
8292 __Pyx_RefNannyDeclarations
8293 __Pyx_RefNannySetupContext(
"__sub__ (wrapper)", 0);
8294 __pyx_r = __pyx_pf_8PyClical_8clifford_24__sub__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8297 __Pyx_RefNannyFinishContext();
8301 static PyObject *__pyx_pf_8PyClical_8clifford_24__sub__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8302 PyObject *__pyx_r = NULL;
8303 __Pyx_RefNannyDeclarations
8304 PyObject *__pyx_t_1 = NULL;
8305 PyObject *__pyx_t_2 = NULL;
8306 __Pyx_RefNannySetupContext(
"__sub__", 0);
8315 __Pyx_XDECREF(__pyx_r);
8316 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 768, __pyx_L1_error)
8317 __Pyx_GOTREF(__pyx_t_1);
8318 __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)
8319 __Pyx_GOTREF(__pyx_t_2);
8320 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8321 __pyx_r = __pyx_t_2;
8335 __Pyx_XDECREF(__pyx_t_1);
8336 __Pyx_XDECREF(__pyx_t_2);
8337 __Pyx_AddTraceback(
"PyClical.clifford.__sub__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8340 __Pyx_XGIVEREF(__pyx_r);
8341 __Pyx_RefNannyFinishContext();
8354 static PyObject *__pyx_pw_8PyClical_8clifford_27__isub__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8355 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 ";
8356 #if CYTHON_COMPILING_IN_CPYTHON 8357 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_26__isub__;
8359 static PyObject *__pyx_pw_8PyClical_8clifford_27__isub__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8360 PyObject *__pyx_r = 0;
8361 __Pyx_RefNannyDeclarations
8362 __Pyx_RefNannySetupContext(
"__isub__ (wrapper)", 0);
8363 __pyx_r = __pyx_pf_8PyClical_8clifford_26__isub__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8366 __Pyx_RefNannyFinishContext();
8370 static PyObject *__pyx_pf_8PyClical_8clifford_26__isub__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8371 PyObject *__pyx_r = NULL;
8372 __Pyx_RefNannyDeclarations
8373 PyObject *__pyx_t_1 = NULL;
8374 __Pyx_RefNannySetupContext(
"__isub__", 0);
8383 __Pyx_XDECREF(__pyx_r);
8384 __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)
8385 __Pyx_GOTREF(__pyx_t_1);
8386 __pyx_r = __pyx_t_1;
8400 __Pyx_XDECREF(__pyx_t_1);
8401 __Pyx_AddTraceback(
"PyClical.clifford.__isub__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8404 __Pyx_XGIVEREF(__pyx_r);
8405 __Pyx_RefNannyFinishContext();
8418 static PyObject *__pyx_pw_8PyClical_8clifford_29__mul__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8419 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 ";
8420 #if CYTHON_COMPILING_IN_CPYTHON 8421 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_28__mul__;
8423 static PyObject *__pyx_pw_8PyClical_8clifford_29__mul__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8424 PyObject *__pyx_r = 0;
8425 __Pyx_RefNannyDeclarations
8426 __Pyx_RefNannySetupContext(
"__mul__ (wrapper)", 0);
8427 __pyx_r = __pyx_pf_8PyClical_8clifford_28__mul__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8430 __Pyx_RefNannyFinishContext();
8434 static PyObject *__pyx_pf_8PyClical_8clifford_28__mul__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8435 PyObject *__pyx_r = NULL;
8436 __Pyx_RefNannyDeclarations
8437 PyObject *__pyx_t_1 = NULL;
8438 PyObject *__pyx_t_2 = NULL;
8439 __Pyx_RefNannySetupContext(
"__mul__", 0);
8448 __Pyx_XDECREF(__pyx_r);
8449 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 790, __pyx_L1_error)
8450 __Pyx_GOTREF(__pyx_t_1);
8451 __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)
8452 __Pyx_GOTREF(__pyx_t_2);
8453 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8454 __pyx_r = __pyx_t_2;
8468 __Pyx_XDECREF(__pyx_t_1);
8469 __Pyx_XDECREF(__pyx_t_2);
8470 __Pyx_AddTraceback(
"PyClical.clifford.__mul__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8473 __Pyx_XGIVEREF(__pyx_r);
8474 __Pyx_RefNannyFinishContext();
8487 static PyObject *__pyx_pw_8PyClical_8clifford_31__imul__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8488 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 ";
8489 #if CYTHON_COMPILING_IN_CPYTHON 8490 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_30__imul__;
8492 static PyObject *__pyx_pw_8PyClical_8clifford_31__imul__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8493 PyObject *__pyx_r = 0;
8494 __Pyx_RefNannyDeclarations
8495 __Pyx_RefNannySetupContext(
"__imul__ (wrapper)", 0);
8496 __pyx_r = __pyx_pf_8PyClical_8clifford_30__imul__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8499 __Pyx_RefNannyFinishContext();
8503 static PyObject *__pyx_pf_8PyClical_8clifford_30__imul__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8504 PyObject *__pyx_r = NULL;
8505 __Pyx_RefNannyDeclarations
8506 PyObject *__pyx_t_1 = NULL;
8507 __Pyx_RefNannySetupContext(
"__imul__", 0);
8516 __Pyx_XDECREF(__pyx_r);
8517 __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)
8518 __Pyx_GOTREF(__pyx_t_1);
8519 __pyx_r = __pyx_t_1;
8533 __Pyx_XDECREF(__pyx_t_1);
8534 __Pyx_AddTraceback(
"PyClical.clifford.__imul__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8537 __Pyx_XGIVEREF(__pyx_r);
8538 __Pyx_RefNannyFinishContext();
8551 static PyObject *__pyx_pw_8PyClical_8clifford_33__mod__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8552 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 ";
8553 #if CYTHON_COMPILING_IN_CPYTHON 8554 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_32__mod__;
8556 static PyObject *__pyx_pw_8PyClical_8clifford_33__mod__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8557 PyObject *__pyx_r = 0;
8558 __Pyx_RefNannyDeclarations
8559 __Pyx_RefNannySetupContext(
"__mod__ (wrapper)", 0);
8560 __pyx_r = __pyx_pf_8PyClical_8clifford_32__mod__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8563 __Pyx_RefNannyFinishContext();
8567 static PyObject *__pyx_pf_8PyClical_8clifford_32__mod__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8568 PyObject *__pyx_r = NULL;
8569 __Pyx_RefNannyDeclarations
8570 PyObject *__pyx_t_1 = NULL;
8571 PyObject *__pyx_t_2 = NULL;
8572 __Pyx_RefNannySetupContext(
"__mod__", 0);
8581 __Pyx_XDECREF(__pyx_r);
8582 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 818, __pyx_L1_error)
8583 __Pyx_GOTREF(__pyx_t_1);
8584 __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)
8585 __Pyx_GOTREF(__pyx_t_2);
8586 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8587 __pyx_r = __pyx_t_2;
8601 __Pyx_XDECREF(__pyx_t_1);
8602 __Pyx_XDECREF(__pyx_t_2);
8603 __Pyx_AddTraceback(
"PyClical.clifford.__mod__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8606 __Pyx_XGIVEREF(__pyx_r);
8607 __Pyx_RefNannyFinishContext();
8620 static PyObject *__pyx_pw_8PyClical_8clifford_35__imod__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8621 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 ";
8622 #if CYTHON_COMPILING_IN_CPYTHON 8623 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_34__imod__;
8625 static PyObject *__pyx_pw_8PyClical_8clifford_35__imod__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8626 PyObject *__pyx_r = 0;
8627 __Pyx_RefNannyDeclarations
8628 __Pyx_RefNannySetupContext(
"__imod__ (wrapper)", 0);
8629 __pyx_r = __pyx_pf_8PyClical_8clifford_34__imod__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8632 __Pyx_RefNannyFinishContext();
8636 static PyObject *__pyx_pf_8PyClical_8clifford_34__imod__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8637 PyObject *__pyx_r = NULL;
8638 __Pyx_RefNannyDeclarations
8639 PyObject *__pyx_t_1 = NULL;
8640 __Pyx_RefNannySetupContext(
"__imod__", 0);
8649 __Pyx_XDECREF(__pyx_r);
8650 __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)
8651 __Pyx_GOTREF(__pyx_t_1);
8652 __pyx_r = __pyx_t_1;
8666 __Pyx_XDECREF(__pyx_t_1);
8667 __Pyx_AddTraceback(
"PyClical.clifford.__imod__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8670 __Pyx_XGIVEREF(__pyx_r);
8671 __Pyx_RefNannyFinishContext();
8684 static PyObject *__pyx_pw_8PyClical_8clifford_37__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8685 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 ";
8686 #if CYTHON_COMPILING_IN_CPYTHON 8687 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_36__and__;
8689 static PyObject *__pyx_pw_8PyClical_8clifford_37__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8690 PyObject *__pyx_r = 0;
8691 __Pyx_RefNannyDeclarations
8692 __Pyx_RefNannySetupContext(
"__and__ (wrapper)", 0);
8693 __pyx_r = __pyx_pf_8PyClical_8clifford_36__and__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8696 __Pyx_RefNannyFinishContext();
8700 static PyObject *__pyx_pf_8PyClical_8clifford_36__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8701 PyObject *__pyx_r = NULL;
8702 __Pyx_RefNannyDeclarations
8703 PyObject *__pyx_t_1 = NULL;
8704 PyObject *__pyx_t_2 = NULL;
8705 __Pyx_RefNannySetupContext(
"__and__", 0);
8714 __Pyx_XDECREF(__pyx_r);
8715 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 848, __pyx_L1_error)
8716 __Pyx_GOTREF(__pyx_t_1);
8717 __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)
8718 __Pyx_GOTREF(__pyx_t_2);
8719 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8720 __pyx_r = __pyx_t_2;
8734 __Pyx_XDECREF(__pyx_t_1);
8735 __Pyx_XDECREF(__pyx_t_2);
8736 __Pyx_AddTraceback(
"PyClical.clifford.__and__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8739 __Pyx_XGIVEREF(__pyx_r);
8740 __Pyx_RefNannyFinishContext();
8753 static PyObject *__pyx_pw_8PyClical_8clifford_39__iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8754 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 ";
8755 #if CYTHON_COMPILING_IN_CPYTHON 8756 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_38__iand__;
8758 static PyObject *__pyx_pw_8PyClical_8clifford_39__iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8759 PyObject *__pyx_r = 0;
8760 __Pyx_RefNannyDeclarations
8761 __Pyx_RefNannySetupContext(
"__iand__ (wrapper)", 0);
8762 __pyx_r = __pyx_pf_8PyClical_8clifford_38__iand__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8765 __Pyx_RefNannyFinishContext();
8769 static PyObject *__pyx_pf_8PyClical_8clifford_38__iand__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8770 PyObject *__pyx_r = NULL;
8771 __Pyx_RefNannyDeclarations
8772 PyObject *__pyx_t_1 = NULL;
8773 __Pyx_RefNannySetupContext(
"__iand__", 0);
8782 __Pyx_XDECREF(__pyx_r);
8783 __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)
8784 __Pyx_GOTREF(__pyx_t_1);
8785 __pyx_r = __pyx_t_1;
8799 __Pyx_XDECREF(__pyx_t_1);
8800 __Pyx_AddTraceback(
"PyClical.clifford.__iand__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8803 __Pyx_XGIVEREF(__pyx_r);
8804 __Pyx_RefNannyFinishContext();
8817 static PyObject *__pyx_pw_8PyClical_8clifford_41__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8818 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 ";
8819 #if CYTHON_COMPILING_IN_CPYTHON 8820 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_40__xor__;
8822 static PyObject *__pyx_pw_8PyClical_8clifford_41__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8823 PyObject *__pyx_r = 0;
8824 __Pyx_RefNannyDeclarations
8825 __Pyx_RefNannySetupContext(
"__xor__ (wrapper)", 0);
8826 __pyx_r = __pyx_pf_8PyClical_8clifford_40__xor__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8829 __Pyx_RefNannyFinishContext();
8833 static PyObject *__pyx_pf_8PyClical_8clifford_40__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8834 PyObject *__pyx_r = NULL;
8835 __Pyx_RefNannyDeclarations
8836 PyObject *__pyx_t_1 = NULL;
8837 PyObject *__pyx_t_2 = NULL;
8838 __Pyx_RefNannySetupContext(
"__xor__", 0);
8847 __Pyx_XDECREF(__pyx_r);
8848 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 878, __pyx_L1_error)
8849 __Pyx_GOTREF(__pyx_t_1);
8850 __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)
8851 __Pyx_GOTREF(__pyx_t_2);
8852 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8853 __pyx_r = __pyx_t_2;
8867 __Pyx_XDECREF(__pyx_t_1);
8868 __Pyx_XDECREF(__pyx_t_2);
8869 __Pyx_AddTraceback(
"PyClical.clifford.__xor__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8872 __Pyx_XGIVEREF(__pyx_r);
8873 __Pyx_RefNannyFinishContext();
8886 static PyObject *__pyx_pw_8PyClical_8clifford_43__ixor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8887 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 ";
8888 #if CYTHON_COMPILING_IN_CPYTHON 8889 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_42__ixor__;
8891 static PyObject *__pyx_pw_8PyClical_8clifford_43__ixor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8892 PyObject *__pyx_r = 0;
8893 __Pyx_RefNannyDeclarations
8894 __Pyx_RefNannySetupContext(
"__ixor__ (wrapper)", 0);
8895 __pyx_r = __pyx_pf_8PyClical_8clifford_42__ixor__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8898 __Pyx_RefNannyFinishContext();
8902 static PyObject *__pyx_pf_8PyClical_8clifford_42__ixor__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8903 PyObject *__pyx_r = NULL;
8904 __Pyx_RefNannyDeclarations
8905 PyObject *__pyx_t_1 = NULL;
8906 __Pyx_RefNannySetupContext(
"__ixor__", 0);
8915 __Pyx_XDECREF(__pyx_r);
8916 __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)
8917 __Pyx_GOTREF(__pyx_t_1);
8918 __pyx_r = __pyx_t_1;
8932 __Pyx_XDECREF(__pyx_t_1);
8933 __Pyx_AddTraceback(
"PyClical.clifford.__ixor__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8936 __Pyx_XGIVEREF(__pyx_r);
8937 __Pyx_RefNannyFinishContext();
8950 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 8951 static PyObject *__pyx_pw_8PyClical_8clifford_45__div__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8952 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 ";
8953 #if CYTHON_COMPILING_IN_CPYTHON 8954 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_44__div__;
8956 static PyObject *__pyx_pw_8PyClical_8clifford_45__div__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8957 PyObject *__pyx_r = 0;
8958 __Pyx_RefNannyDeclarations
8959 __Pyx_RefNannySetupContext(
"__div__ (wrapper)", 0);
8960 __pyx_r = __pyx_pf_8PyClical_8clifford_44__div__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8963 __Pyx_RefNannyFinishContext();
8968 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 8969 static PyObject *__pyx_pf_8PyClical_8clifford_44__div__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8970 PyObject *__pyx_r = NULL;
8971 __Pyx_RefNannyDeclarations
8972 PyObject *__pyx_t_1 = NULL;
8973 PyObject *__pyx_t_2 = NULL;
8974 __Pyx_RefNannySetupContext(
"__div__", 0);
8983 __Pyx_XDECREF(__pyx_r);
8984 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 908, __pyx_L1_error)
8985 __Pyx_GOTREF(__pyx_t_1);
8986 __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)
8987 __Pyx_GOTREF(__pyx_t_2);
8988 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8989 __pyx_r = __pyx_t_2;
9003 __Pyx_XDECREF(__pyx_t_1);
9004 __Pyx_XDECREF(__pyx_t_2);
9005 __Pyx_AddTraceback(
"PyClical.clifford.__div__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9008 __Pyx_XGIVEREF(__pyx_r);
9009 __Pyx_RefNannyFinishContext();
9023 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 9024 static PyObject *__pyx_pw_8PyClical_8clifford_47__idiv__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
9025 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 ";
9026 #if CYTHON_COMPILING_IN_CPYTHON 9027 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_46__idiv__;
9029 static PyObject *__pyx_pw_8PyClical_8clifford_47__idiv__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
9030 PyObject *__pyx_r = 0;
9031 __Pyx_RefNannyDeclarations
9032 __Pyx_RefNannySetupContext(
"__idiv__ (wrapper)", 0);
9033 __pyx_r = __pyx_pf_8PyClical_8clifford_46__idiv__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
9036 __Pyx_RefNannyFinishContext();
9041 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 9042 static PyObject *__pyx_pf_8PyClical_8clifford_46__idiv__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
9043 PyObject *__pyx_r = NULL;
9044 __Pyx_RefNannyDeclarations
9045 PyObject *__pyx_t_1 = NULL;
9046 __Pyx_RefNannySetupContext(
"__idiv__", 0);
9055 __Pyx_XDECREF(__pyx_r);
9056 __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)
9057 __Pyx_GOTREF(__pyx_t_1);
9058 __pyx_r = __pyx_t_1;
9072 __Pyx_XDECREF(__pyx_t_1);
9073 __Pyx_AddTraceback(
"PyClical.clifford.__idiv__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9076 __Pyx_XGIVEREF(__pyx_r);
9077 __Pyx_RefNannyFinishContext();
9091 static PyObject *__pyx_pw_8PyClical_8clifford_49inv(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9092 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 ";
9093 static PyObject *__pyx_pw_8PyClical_8clifford_49inv(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9094 PyObject *__pyx_r = 0;
9095 __Pyx_RefNannyDeclarations
9096 __Pyx_RefNannySetupContext(
"inv (wrapper)", 0);
9097 __pyx_r = __pyx_pf_8PyClical_8clifford_48inv(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
9100 __Pyx_RefNannyFinishContext();
9104 static PyObject *__pyx_pf_8PyClical_8clifford_48inv(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
9105 PyObject *__pyx_r = NULL;
9106 __Pyx_RefNannyDeclarations
9107 PyObject *__pyx_t_1 = NULL;
9108 PyObject *__pyx_t_2 = NULL;
9109 __Pyx_RefNannySetupContext(
"inv", 0);
9118 __Pyx_XDECREF(__pyx_r);
9119 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 936, __pyx_L1_error)
9120 __Pyx_GOTREF(__pyx_t_1);
9121 __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)
9122 __Pyx_GOTREF(__pyx_t_2);
9123 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9124 __pyx_r = __pyx_t_2;
9138 __Pyx_XDECREF(__pyx_t_1);
9139 __Pyx_XDECREF(__pyx_t_2);
9140 __Pyx_AddTraceback(
"PyClical.clifford.inv", __pyx_clineno, __pyx_lineno, __pyx_filename);
9143 __Pyx_XGIVEREF(__pyx_r);
9144 __Pyx_RefNannyFinishContext();
9157 static PyObject *__pyx_pw_8PyClical_8clifford_51__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
9158 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 ";
9159 #if CYTHON_COMPILING_IN_CPYTHON 9160 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_50__or__;
9162 static PyObject *__pyx_pw_8PyClical_8clifford_51__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
9163 PyObject *__pyx_r = 0;
9164 __Pyx_RefNannyDeclarations
9165 __Pyx_RefNannySetupContext(
"__or__ (wrapper)", 0);
9166 __pyx_r = __pyx_pf_8PyClical_8clifford_50__or__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
9169 __Pyx_RefNannyFinishContext();
9173 static PyObject *__pyx_pf_8PyClical_8clifford_50__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
9174 PyObject *__pyx_r = NULL;
9175 __Pyx_RefNannyDeclarations
9176 PyObject *__pyx_t_1 = NULL;
9177 PyObject *__pyx_t_2 = NULL;
9178 __Pyx_RefNannySetupContext(
"__or__", 0);
9187 __Pyx_XDECREF(__pyx_r);
9188 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 947, __pyx_L1_error)
9189 __Pyx_GOTREF(__pyx_t_1);
9190 __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)
9191 __Pyx_GOTREF(__pyx_t_2);
9192 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9193 __pyx_r = __pyx_t_2;
9207 __Pyx_XDECREF(__pyx_t_1);
9208 __Pyx_XDECREF(__pyx_t_2);
9209 __Pyx_AddTraceback(
"PyClical.clifford.__or__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9212 __Pyx_XGIVEREF(__pyx_r);
9213 __Pyx_RefNannyFinishContext();
9226 static PyObject *__pyx_pw_8PyClical_8clifford_53__ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
9227 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 ";
9228 #if CYTHON_COMPILING_IN_CPYTHON 9229 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_52__ior__;
9231 static PyObject *__pyx_pw_8PyClical_8clifford_53__ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
9232 PyObject *__pyx_r = 0;
9233 __Pyx_RefNannyDeclarations
9234 __Pyx_RefNannySetupContext(
"__ior__ (wrapper)", 0);
9235 __pyx_r = __pyx_pf_8PyClical_8clifford_52__ior__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
9238 __Pyx_RefNannyFinishContext();
9242 static PyObject *__pyx_pf_8PyClical_8clifford_52__ior__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
9243 PyObject *__pyx_r = NULL;
9244 __Pyx_RefNannyDeclarations
9245 PyObject *__pyx_t_1 = NULL;
9246 __Pyx_RefNannySetupContext(
"__ior__", 0);
9255 __Pyx_XDECREF(__pyx_r);
9256 __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)
9257 __Pyx_GOTREF(__pyx_t_1);
9258 __pyx_r = __pyx_t_1;
9272 __Pyx_XDECREF(__pyx_t_1);
9273 __Pyx_AddTraceback(
"PyClical.clifford.__ior__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9276 __Pyx_XGIVEREF(__pyx_r);
9277 __Pyx_RefNannyFinishContext();
9290 static PyObject *__pyx_pw_8PyClical_8clifford_55__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_m, PyObject *__pyx_v_dummy);
9291 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 ";
9292 #if CYTHON_COMPILING_IN_CPYTHON 9293 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_54__pow__;
9295 static PyObject *__pyx_pw_8PyClical_8clifford_55__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_m, PyObject *__pyx_v_dummy) {
9296 PyObject *__pyx_r = 0;
9297 __Pyx_RefNannyDeclarations
9298 __Pyx_RefNannySetupContext(
"__pow__ (wrapper)", 0);
9299 __pyx_r = __pyx_pf_8PyClical_8clifford_54__pow__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_m), ((PyObject *)__pyx_v_dummy));
9302 __Pyx_RefNannyFinishContext();
9306 static PyObject *__pyx_pf_8PyClical_8clifford_54__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_m, CYTHON_UNUSED PyObject *__pyx_v_dummy) {
9307 PyObject *__pyx_r = NULL;
9308 __Pyx_RefNannyDeclarations
9309 PyObject *__pyx_t_1 = NULL;
9310 __Pyx_RefNannySetupContext(
"__pow__", 0);
9319 __Pyx_XDECREF(__pyx_r);
9320 __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)
9321 __Pyx_GOTREF(__pyx_t_1);
9322 __pyx_r = __pyx_t_1;
9336 __Pyx_XDECREF(__pyx_t_1);
9337 __Pyx_AddTraceback(
"PyClical.clifford.__pow__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9340 __Pyx_XGIVEREF(__pyx_r);
9341 __Pyx_RefNannyFinishContext();
9354 static PyObject *__pyx_pw_8PyClical_8clifford_57pow(PyObject *__pyx_v_self, PyObject *__pyx_v_m);
9355 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 ";
9356 static PyObject *__pyx_pw_8PyClical_8clifford_57pow(PyObject *__pyx_v_self, PyObject *__pyx_v_m) {
9357 PyObject *__pyx_r = 0;
9358 __Pyx_RefNannyDeclarations
9359 __Pyx_RefNannySetupContext(
"pow (wrapper)", 0);
9360 __pyx_r = __pyx_pf_8PyClical_8clifford_56pow(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_m));
9363 __Pyx_RefNannyFinishContext();
9367 static PyObject *__pyx_pf_8PyClical_8clifford_56pow(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_m) {
9368 PyObject *__pyx_r = NULL;
9369 __Pyx_RefNannyDeclarations
9370 PyObject *__pyx_t_1 = NULL;
9371 PyObject *__pyx_t_2 = NULL;
9375 __Pyx_RefNannySetupContext(
"pow", 0);
9384 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numbers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __pyx_L1_error)
9385 __Pyx_GOTREF(__pyx_t_1);
9386 __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)
9387 __Pyx_GOTREF(__pyx_t_2);
9388 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9389 __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)
9390 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9391 __pyx_t_4 = (__pyx_t_3 != 0);
9401 __Pyx_XDECREF(__pyx_r);
9402 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 999, __pyx_L1_error)
9403 __Pyx_GOTREF(__pyx_t_2);
9404 __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)
9405 __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)
9406 __Pyx_GOTREF(__pyx_t_1);
9407 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9408 __pyx_r = __pyx_t_1;
9429 __Pyx_XDECREF(__pyx_r);
9430 __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)
9431 __Pyx_GOTREF(__pyx_t_1);
9432 __pyx_t_2 = PyNumber_Multiply(__pyx_v_m, __pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1001, __pyx_L1_error)
9433 __Pyx_GOTREF(__pyx_t_2);
9434 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9435 __pyx_t_1 = __pyx_f_8PyClical_exp(__pyx_t_2, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1001, __pyx_L1_error)
9436 __Pyx_GOTREF(__pyx_t_1);
9437 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9438 __pyx_r = __pyx_t_1;
9453 __Pyx_XDECREF(__pyx_t_1);
9454 __Pyx_XDECREF(__pyx_t_2);
9455 __Pyx_AddTraceback(
"PyClical.clifford.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
9458 __Pyx_XGIVEREF(__pyx_r);
9459 __Pyx_RefNannyFinishContext();
9472 static PyObject *__pyx_pw_8PyClical_8clifford_59outer_pow(PyObject *__pyx_v_self, PyObject *__pyx_v_m);
9473 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 ";
9474 static PyObject *__pyx_pw_8PyClical_8clifford_59outer_pow(PyObject *__pyx_v_self, PyObject *__pyx_v_m) {
9475 PyObject *__pyx_r = 0;
9476 __Pyx_RefNannyDeclarations
9477 __Pyx_RefNannySetupContext(
"outer_pow (wrapper)", 0);
9478 __pyx_r = __pyx_pf_8PyClical_8clifford_58outer_pow(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_m));
9481 __Pyx_RefNannyFinishContext();
9485 static PyObject *__pyx_pf_8PyClical_8clifford_58outer_pow(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_m) {
9486 PyObject *__pyx_r = NULL;
9487 __Pyx_RefNannyDeclarations
9488 PyObject *__pyx_t_1 = NULL;
9490 PyObject *__pyx_t_3 = NULL;
9491 __Pyx_RefNannySetupContext(
"outer_pow", 0);
9500 __Pyx_XDECREF(__pyx_r);
9501 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1017, __pyx_L1_error)
9502 __Pyx_GOTREF(__pyx_t_1);
9503 __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)
9504 __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)
9505 __Pyx_GOTREF(__pyx_t_3);
9506 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9507 __pyx_r = __pyx_t_3;
9521 __Pyx_XDECREF(__pyx_t_1);
9522 __Pyx_XDECREF(__pyx_t_3);
9523 __Pyx_AddTraceback(
"PyClical.clifford.outer_pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
9526 __Pyx_XGIVEREF(__pyx_r);
9527 __Pyx_RefNannyFinishContext();
9540 static PyObject *__pyx_pw_8PyClical_8clifford_61__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
9541 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 ";
9542 #if CYTHON_COMPILING_IN_CPYTHON 9543 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_60__call__;
9545 static PyObject *__pyx_pw_8PyClical_8clifford_61__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9546 PyObject *__pyx_v_grade = 0;
9547 PyObject *__pyx_r = 0;
9548 __Pyx_RefNannyDeclarations
9549 __Pyx_RefNannySetupContext(
"__call__ (wrapper)", 0);
9551 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_grade,0};
9552 PyObject* values[1] = {0};
9553 if (unlikely(__pyx_kwds)) {
9555 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9557 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9560 default:
goto __pyx_L5_argtuple_error;
9562 kw_args = PyDict_Size(__pyx_kwds);
9565 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_grade)) != 0)) kw_args--;
9566 else goto __pyx_L5_argtuple_error;
9568 if (unlikely(kw_args > 0)) {
9569 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__call__") < 0)) __PYX_ERR(0, 1019, __pyx_L3_error)
9571 }
else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
9572 goto __pyx_L5_argtuple_error;
9574 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9576 __pyx_v_grade = values[0];
9578 goto __pyx_L4_argument_unpacking_done;
9579 __pyx_L5_argtuple_error:;
9580 __Pyx_RaiseArgtupleInvalid(
"__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1019, __pyx_L3_error)
9582 __Pyx_AddTraceback(
"PyClical.clifford.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9583 __Pyx_RefNannyFinishContext();
9585 __pyx_L4_argument_unpacking_done:;
9586 __pyx_r = __pyx_pf_8PyClical_8clifford_60__call__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), __pyx_v_grade);
9589 __Pyx_RefNannyFinishContext();
9593 static PyObject *__pyx_pf_8PyClical_8clifford_60__call__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_grade) {
9594 PyObject *__pyx_r = NULL;
9595 __Pyx_RefNannyDeclarations
9596 PyObject *__pyx_t_1 = NULL;
9598 PyObject *__pyx_t_3 = NULL;
9599 __Pyx_RefNannySetupContext(
"__call__", 0);
9608 __Pyx_XDECREF(__pyx_r);
9609 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1036, __pyx_L1_error)
9610 __Pyx_GOTREF(__pyx_t_1);
9611 __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)
9612 __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)
9613 __Pyx_GOTREF(__pyx_t_3);
9614 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9615 __pyx_r = __pyx_t_3;
9629 __Pyx_XDECREF(__pyx_t_1);
9630 __Pyx_XDECREF(__pyx_t_3);
9631 __Pyx_AddTraceback(
"PyClical.clifford.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9634 __Pyx_XGIVEREF(__pyx_r);
9635 __Pyx_RefNannyFinishContext();
9648 static PyObject *__pyx_pw_8PyClical_8clifford_63scalar(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9649 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 ";
9650 static PyObject *__pyx_pw_8PyClical_8clifford_63scalar(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9651 PyObject *__pyx_r = 0;
9652 __Pyx_RefNannyDeclarations
9653 __Pyx_RefNannySetupContext(
"scalar (wrapper)", 0);
9654 __pyx_r = __pyx_pf_8PyClical_8clifford_62scalar(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
9657 __Pyx_RefNannyFinishContext();
9661 static PyObject *__pyx_pf_8PyClical_8clifford_62scalar(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
9662 PyObject *__pyx_r = NULL;
9663 __Pyx_RefNannyDeclarations
9664 PyObject *__pyx_t_1 = NULL;
9665 __Pyx_RefNannySetupContext(
"scalar", 0);
9674 __Pyx_XDECREF(__pyx_r);
9675 __pyx_t_1 =
PyFloat_FromDouble(__pyx_v_self->instance->scalar());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1047, __pyx_L1_error)
9676 __Pyx_GOTREF(__pyx_t_1);
9677 __pyx_r = __pyx_t_1;
9691 __Pyx_XDECREF(__pyx_t_1);
9692 __Pyx_AddTraceback(
"PyClical.clifford.scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
9695 __Pyx_XGIVEREF(__pyx_r);
9696 __Pyx_RefNannyFinishContext();
9709 static PyObject *__pyx_pw_8PyClical_8clifford_65pure(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9710 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 ";
9711 static PyObject *__pyx_pw_8PyClical_8clifford_65pure(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9712 PyObject *__pyx_r = 0;
9713 __Pyx_RefNannyDeclarations
9714 __Pyx_RefNannySetupContext(
"pure (wrapper)", 0);
9715 __pyx_r = __pyx_pf_8PyClical_8clifford_64pure(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
9718 __Pyx_RefNannyFinishContext();
9722 static PyObject *__pyx_pf_8PyClical_8clifford_64pure(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
9723 PyObject *__pyx_r = NULL;
9724 __Pyx_RefNannyDeclarations
9725 PyObject *__pyx_t_1 = NULL;
9726 PyObject *__pyx_t_2 = NULL;
9727 __Pyx_RefNannySetupContext(
"pure", 0);
9736 __Pyx_XDECREF(__pyx_r);
9737 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1058, __pyx_L1_error)
9738 __Pyx_GOTREF(__pyx_t_1);
9739 __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)
9740 __Pyx_GOTREF(__pyx_t_2);
9741 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9742 __pyx_r = __pyx_t_2;
9756 __Pyx_XDECREF(__pyx_t_1);
9757 __Pyx_XDECREF(__pyx_t_2);
9758 __Pyx_AddTraceback(
"PyClical.clifford.pure", __pyx_clineno, __pyx_lineno, __pyx_filename);
9761 __Pyx_XGIVEREF(__pyx_r);
9762 __Pyx_RefNannyFinishContext();
9775 static PyObject *__pyx_pw_8PyClical_8clifford_67even(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9776 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 ";
9777 static PyObject *__pyx_pw_8PyClical_8clifford_67even(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9778 PyObject *__pyx_r = 0;
9779 __Pyx_RefNannyDeclarations
9780 __Pyx_RefNannySetupContext(
"even (wrapper)", 0);
9781 __pyx_r = __pyx_pf_8PyClical_8clifford_66even(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
9784 __Pyx_RefNannyFinishContext();
9788 static PyObject *__pyx_pf_8PyClical_8clifford_66even(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
9789 PyObject *__pyx_r = NULL;
9790 __Pyx_RefNannyDeclarations
9791 PyObject *__pyx_t_1 = NULL;
9792 PyObject *__pyx_t_2 = NULL;
9793 __Pyx_RefNannySetupContext(
"even", 0);
9802 __Pyx_XDECREF(__pyx_r);
9803 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1067, __pyx_L1_error)
9804 __Pyx_GOTREF(__pyx_t_1);
9805 __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)
9806 __Pyx_GOTREF(__pyx_t_2);
9807 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9808 __pyx_r = __pyx_t_2;
9822 __Pyx_XDECREF(__pyx_t_1);
9823 __Pyx_XDECREF(__pyx_t_2);
9824 __Pyx_AddTraceback(
"PyClical.clifford.even", __pyx_clineno, __pyx_lineno, __pyx_filename);
9827 __Pyx_XGIVEREF(__pyx_r);
9828 __Pyx_RefNannyFinishContext();
9841 static PyObject *__pyx_pw_8PyClical_8clifford_69odd(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9842 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 ";
9843 static PyObject *__pyx_pw_8PyClical_8clifford_69odd(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9844 PyObject *__pyx_r = 0;
9845 __Pyx_RefNannyDeclarations
9846 __Pyx_RefNannySetupContext(
"odd (wrapper)", 0);
9847 __pyx_r = __pyx_pf_8PyClical_8clifford_68odd(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
9850 __Pyx_RefNannyFinishContext();
9854 static PyObject *__pyx_pf_8PyClical_8clifford_68odd(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
9855 PyObject *__pyx_r = NULL;
9856 __Pyx_RefNannyDeclarations
9857 PyObject *__pyx_t_1 = NULL;
9858 PyObject *__pyx_t_2 = NULL;
9859 __Pyx_RefNannySetupContext(
"odd", 0);
9868 __Pyx_XDECREF(__pyx_r);
9869 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1076, __pyx_L1_error)
9870 __Pyx_GOTREF(__pyx_t_1);
9871 __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)
9872 __Pyx_GOTREF(__pyx_t_2);
9873 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9874 __pyx_r = __pyx_t_2;
9888 __Pyx_XDECREF(__pyx_t_1);
9889 __Pyx_XDECREF(__pyx_t_2);
9890 __Pyx_AddTraceback(
"PyClical.clifford.odd", __pyx_clineno, __pyx_lineno, __pyx_filename);
9893 __Pyx_XGIVEREF(__pyx_r);
9894 __Pyx_RefNannyFinishContext();
9907 static PyObject *__pyx_pw_8PyClical_8clifford_71vector_part(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
9908 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 ";
9909 static PyObject *__pyx_pw_8PyClical_8clifford_71vector_part(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9910 PyObject *__pyx_v_frm = 0;
9911 PyObject *__pyx_r = 0;
9912 __Pyx_RefNannyDeclarations
9913 __Pyx_RefNannySetupContext(
"vector_part (wrapper)", 0);
9915 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frm,0};
9916 PyObject* values[1] = {0};
9917 values[0] = ((PyObject *)Py_None);
9918 if (unlikely(__pyx_kwds)) {
9920 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9922 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9925 default:
goto __pyx_L5_argtuple_error;
9927 kw_args = PyDict_Size(__pyx_kwds);
9931 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_frm);
9932 if (value) { values[0] = value; kw_args--; }
9935 if (unlikely(kw_args > 0)) {
9936 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"vector_part") < 0)) __PYX_ERR(0, 1078, __pyx_L3_error)
9939 switch (PyTuple_GET_SIZE(__pyx_args)) {
9940 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9943 default:
goto __pyx_L5_argtuple_error;
9946 __pyx_v_frm = values[0];
9948 goto __pyx_L4_argument_unpacking_done;
9949 __pyx_L5_argtuple_error:;
9950 __Pyx_RaiseArgtupleInvalid(
"vector_part", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1078, __pyx_L3_error)
9952 __Pyx_AddTraceback(
"PyClical.clifford.vector_part", __pyx_clineno, __pyx_lineno, __pyx_filename);
9953 __Pyx_RefNannyFinishContext();
9955 __pyx_L4_argument_unpacking_done:;
9956 __pyx_r = __pyx_pf_8PyClical_8clifford_70vector_part(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), __pyx_v_frm);
9959 __Pyx_RefNannyFinishContext();
9963 static PyObject *__pyx_pf_8PyClical_8clifford_70vector_part(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_frm) {
9964 PyObject *__pyx_v_error_msg_prefix = NULL;
9965 std::vector<scalar_t> __pyx_v_vec;
9968 PyObject *__pyx_v_lst = NULL;
9969 PyObject *__pyx_v_err = NULL;
9970 PyObject *__pyx_r = NULL;
9971 __Pyx_RefNannyDeclarations
9972 PyObject *__pyx_t_1 = NULL;
9973 PyObject *__pyx_t_2 = NULL;
9974 PyObject *__pyx_t_3 = NULL;
9977 std::vector<scalar_t> __pyx_t_6;
9978 PyObject *__pyx_t_7 = NULL;
9981 PyObject *__pyx_t_10 = NULL;
9982 PyObject *__pyx_t_11 = NULL;
9983 PyObject *__pyx_t_12 = NULL;
9984 PyObject *__pyx_t_13 = NULL;
9985 PyObject *__pyx_t_14 = NULL;
9986 __Pyx_RefNannySetupContext(
"vector_part", 0);
9995 __Pyx_INCREF(__pyx_kp_s_Cannot_take_vector_part_of);
9996 __pyx_v_error_msg_prefix = __pyx_kp_s_Cannot_take_vector_part_of;
10006 __Pyx_PyThreadState_declare
10007 __Pyx_PyThreadState_assign
10008 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
10009 __Pyx_XGOTREF(__pyx_t_1);
10010 __Pyx_XGOTREF(__pyx_t_2);
10011 __Pyx_XGOTREF(__pyx_t_3);
10021 __pyx_t_4 = (__pyx_v_frm == Py_None);
10022 __pyx_t_5 = (__pyx_t_4 != 0);
10032 __pyx_t_6 = __pyx_v_self->instance->vector_part();
10033 __pyx_v_vec = __pyx_t_6;
10054 __pyx_t_6 = __pyx_v_self->instance->vector_part(__pyx_f_8PyClical_9index_set_unwrap(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_frm)));
10056 __Pyx_CppExn2PyErr();
10057 __PYX_ERR(0, 1095, __pyx_L3_error)
10059 __pyx_v_vec = __pyx_t_6;
10070 __pyx_v_n = __pyx_v_vec.size();
10079 __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)
10080 __Pyx_GOTREF(__pyx_t_7);
10081 { Py_ssize_t __pyx_temp;
10082 for (__pyx_temp=0; __pyx_temp < __pyx_v_n; __pyx_temp++) {
10083 __Pyx_INCREF(__pyx_float_0_0);
10084 __Pyx_GIVEREF(__pyx_float_0_0);
10085 PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_float_0_0);
10088 __pyx_v_lst = ((PyObject*)__pyx_t_7);
10098 __pyx_t_8 = __pyx_v_n;
10099 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
10100 __pyx_v_i = __pyx_t_9;
10109 __pyx_t_7 =
PyFloat_FromDouble((__pyx_v_vec[__pyx_v_i]));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1099, __pyx_L3_error)
10110 __Pyx_GOTREF(__pyx_t_7);
10111 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)
10112 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10122 __Pyx_XDECREF(__pyx_r);
10123 __Pyx_INCREF(__pyx_v_lst);
10124 __pyx_r = __pyx_v_lst;
10125 goto __pyx_L7_try_return;
10136 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10145 __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
10147 __Pyx_AddTraceback(
"PyClical.clifford.vector_part", __pyx_clineno, __pyx_lineno, __pyx_filename);
10148 if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_10, &__pyx_t_11) < 0) __PYX_ERR(0, 1101, __pyx_L5_except_error)
10149 __Pyx_GOTREF(__pyx_t_7);
10150 __Pyx_GOTREF(__pyx_t_10);
10151 __Pyx_GOTREF(__pyx_t_11);
10152 __Pyx_INCREF(__pyx_t_10);
10153 __pyx_v_err = __pyx_t_10;
10162 __pyx_t_12 = PyTuple_New(1);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1102, __pyx_L5_except_error)
10163 __Pyx_GOTREF(__pyx_t_12);
10164 __Pyx_INCREF(((PyObject *)__pyx_v_self));
10165 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
10166 PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)__pyx_v_self));
10167 __pyx_t_13 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_12, NULL);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1102, __pyx_L5_except_error)
10168 __Pyx_GOTREF(__pyx_t_13);
10169 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
10170 __pyx_t_12 = PyNumber_Add(__pyx_v_error_msg_prefix, __pyx_t_13);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1102, __pyx_L5_except_error)
10171 __Pyx_GOTREF(__pyx_t_12);
10172 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
10173 __pyx_t_13 = PyNumber_Add(__pyx_t_12, __pyx_kp_s_using_invalid);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1102, __pyx_L5_except_error)
10174 __Pyx_GOTREF(__pyx_t_13);
10175 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
10184 __pyx_t_12 = PyObject_Repr(__pyx_v_frm);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1103, __pyx_L5_except_error)
10185 __Pyx_GOTREF(__pyx_t_12);
10186 __pyx_t_14 = PyNumber_Add(__pyx_t_13, __pyx_t_12);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1103, __pyx_L5_except_error)
10187 __Pyx_GOTREF(__pyx_t_14);
10188 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
10189 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
10190 __pyx_t_12 = PyNumber_Add(__pyx_t_14, __pyx_kp_s_as_frame);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1103, __pyx_L5_except_error)
10191 __Pyx_GOTREF(__pyx_t_12);
10192 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
10201 __pyx_t_14 = PyTuple_New(1);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1104, __pyx_L5_except_error)
10202 __Pyx_GOTREF(__pyx_t_14);
10203 __Pyx_INCREF(__pyx_v_err);
10204 __Pyx_GIVEREF(__pyx_v_err);
10205 PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_err);
10206 __pyx_t_13 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_14, NULL);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1104, __pyx_L5_except_error)
10207 __Pyx_GOTREF(__pyx_t_13);
10208 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
10209 __pyx_t_14 = PyNumber_Add(__pyx_t_12, __pyx_t_13);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1104, __pyx_L5_except_error)
10210 __Pyx_GOTREF(__pyx_t_14);
10211 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
10212 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
10221 __pyx_t_13 = PyTuple_New(1);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1102, __pyx_L5_except_error)
10222 __Pyx_GOTREF(__pyx_t_13);
10223 __Pyx_GIVEREF(__pyx_t_14);
10224 PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_14);
10226 __pyx_t_14 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_13, NULL);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1102, __pyx_L5_except_error)
10227 __Pyx_GOTREF(__pyx_t_14);
10228 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
10229 __Pyx_Raise(__pyx_t_14, 0, 0, 0);
10230 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
10231 __PYX_ERR(0, 1102, __pyx_L5_except_error)
10233 goto __pyx_L5_except_error;
10234 __pyx_L5_except_error:;
10243 __Pyx_XGIVEREF(__pyx_t_1);
10244 __Pyx_XGIVEREF(__pyx_t_2);
10245 __Pyx_XGIVEREF(__pyx_t_3);
10246 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
10247 goto __pyx_L1_error;
10248 __pyx_L7_try_return:;
10249 __Pyx_XGIVEREF(__pyx_t_1);
10250 __Pyx_XGIVEREF(__pyx_t_2);
10251 __Pyx_XGIVEREF(__pyx_t_3);
10252 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
10266 __Pyx_XDECREF(__pyx_t_7);
10267 __Pyx_XDECREF(__pyx_t_10);
10268 __Pyx_XDECREF(__pyx_t_11);
10269 __Pyx_XDECREF(__pyx_t_12);
10270 __Pyx_XDECREF(__pyx_t_13);
10271 __Pyx_XDECREF(__pyx_t_14);
10272 __Pyx_AddTraceback(
"PyClical.clifford.vector_part", __pyx_clineno, __pyx_lineno, __pyx_filename);
10275 __Pyx_XDECREF(__pyx_v_error_msg_prefix);
10276 __Pyx_XDECREF(__pyx_v_lst);
10277 __Pyx_XDECREF(__pyx_v_err);
10278 __Pyx_XGIVEREF(__pyx_r);
10279 __Pyx_RefNannyFinishContext();
10292 static PyObject *__pyx_pw_8PyClical_8clifford_73involute(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10293 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 ";
10294 static PyObject *__pyx_pw_8PyClical_8clifford_73involute(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10295 PyObject *__pyx_r = 0;
10296 __Pyx_RefNannyDeclarations
10297 __Pyx_RefNannySetupContext(
"involute (wrapper)", 0);
10298 __pyx_r = __pyx_pf_8PyClical_8clifford_72involute(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10301 __Pyx_RefNannyFinishContext();
10305 static PyObject *__pyx_pf_8PyClical_8clifford_72involute(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10306 PyObject *__pyx_r = NULL;
10307 __Pyx_RefNannyDeclarations
10308 PyObject *__pyx_t_1 = NULL;
10309 PyObject *__pyx_t_2 = NULL;
10310 __Pyx_RefNannySetupContext(
"involute", 0);
10319 __Pyx_XDECREF(__pyx_r);
10320 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1120, __pyx_L1_error)
10321 __Pyx_GOTREF(__pyx_t_1);
10322 __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)
10323 __Pyx_GOTREF(__pyx_t_2);
10324 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10325 __pyx_r = __pyx_t_2;
10339 __Pyx_XDECREF(__pyx_t_1);
10340 __Pyx_XDECREF(__pyx_t_2);
10341 __Pyx_AddTraceback(
"PyClical.clifford.involute", __pyx_clineno, __pyx_lineno, __pyx_filename);
10344 __Pyx_XGIVEREF(__pyx_r);
10345 __Pyx_RefNannyFinishContext();
10358 static PyObject *__pyx_pw_8PyClical_8clifford_75reverse(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10359 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 ";
10360 static PyObject *__pyx_pw_8PyClical_8clifford_75reverse(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10361 PyObject *__pyx_r = 0;
10362 __Pyx_RefNannyDeclarations
10363 __Pyx_RefNannySetupContext(
"reverse (wrapper)", 0);
10364 __pyx_r = __pyx_pf_8PyClical_8clifford_74reverse(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10367 __Pyx_RefNannyFinishContext();
10371 static PyObject *__pyx_pf_8PyClical_8clifford_74reverse(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10372 PyObject *__pyx_r = NULL;
10373 __Pyx_RefNannyDeclarations
10374 PyObject *__pyx_t_1 = NULL;
10375 PyObject *__pyx_t_2 = NULL;
10376 __Pyx_RefNannySetupContext(
"reverse", 0);
10385 __Pyx_XDECREF(__pyx_r);
10386 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1135, __pyx_L1_error)
10387 __Pyx_GOTREF(__pyx_t_1);
10388 __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)
10389 __Pyx_GOTREF(__pyx_t_2);
10390 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10391 __pyx_r = __pyx_t_2;
10405 __Pyx_XDECREF(__pyx_t_1);
10406 __Pyx_XDECREF(__pyx_t_2);
10407 __Pyx_AddTraceback(
"PyClical.clifford.reverse", __pyx_clineno, __pyx_lineno, __pyx_filename);
10410 __Pyx_XGIVEREF(__pyx_r);
10411 __Pyx_RefNannyFinishContext();
10424 static PyObject *__pyx_pw_8PyClical_8clifford_77conj(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10425 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 ";
10426 static PyObject *__pyx_pw_8PyClical_8clifford_77conj(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10427 PyObject *__pyx_r = 0;
10428 __Pyx_RefNannyDeclarations
10429 __Pyx_RefNannySetupContext(
"conj (wrapper)", 0);
10430 __pyx_r = __pyx_pf_8PyClical_8clifford_76conj(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10433 __Pyx_RefNannyFinishContext();
10437 static PyObject *__pyx_pf_8PyClical_8clifford_76conj(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10438 PyObject *__pyx_r = NULL;
10439 __Pyx_RefNannyDeclarations
10440 PyObject *__pyx_t_1 = NULL;
10441 PyObject *__pyx_t_2 = NULL;
10442 __Pyx_RefNannySetupContext(
"conj", 0);
10451 __Pyx_XDECREF(__pyx_r);
10452 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1150, __pyx_L1_error)
10453 __Pyx_GOTREF(__pyx_t_1);
10454 __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)
10455 __Pyx_GOTREF(__pyx_t_2);
10456 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10457 __pyx_r = __pyx_t_2;
10471 __Pyx_XDECREF(__pyx_t_1);
10472 __Pyx_XDECREF(__pyx_t_2);
10473 __Pyx_AddTraceback(
"PyClical.clifford.conj", __pyx_clineno, __pyx_lineno, __pyx_filename);
10476 __Pyx_XGIVEREF(__pyx_r);
10477 __Pyx_RefNannyFinishContext();
10490 static PyObject *__pyx_pw_8PyClical_8clifford_79quad(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10491 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 ";
10492 static PyObject *__pyx_pw_8PyClical_8clifford_79quad(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10493 PyObject *__pyx_r = 0;
10494 __Pyx_RefNannyDeclarations
10495 __Pyx_RefNannySetupContext(
"quad (wrapper)", 0);
10496 __pyx_r = __pyx_pf_8PyClical_8clifford_78quad(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10499 __Pyx_RefNannyFinishContext();
10503 static PyObject *__pyx_pf_8PyClical_8clifford_78quad(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10504 PyObject *__pyx_r = NULL;
10505 __Pyx_RefNannyDeclarations
10506 PyObject *__pyx_t_1 = NULL;
10507 __Pyx_RefNannySetupContext(
"quad", 0);
10516 __Pyx_XDECREF(__pyx_r);
10517 __pyx_t_1 =
PyFloat_FromDouble(__pyx_v_self->instance->quad());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1161, __pyx_L1_error)
10518 __Pyx_GOTREF(__pyx_t_1);
10519 __pyx_r = __pyx_t_1;
10533 __Pyx_XDECREF(__pyx_t_1);
10534 __Pyx_AddTraceback(
"PyClical.clifford.quad", __pyx_clineno, __pyx_lineno, __pyx_filename);
10537 __Pyx_XGIVEREF(__pyx_r);
10538 __Pyx_RefNannyFinishContext();
10551 static PyObject *__pyx_pw_8PyClical_8clifford_81norm(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10552 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 ";
10553 static PyObject *__pyx_pw_8PyClical_8clifford_81norm(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10554 PyObject *__pyx_r = 0;
10555 __Pyx_RefNannyDeclarations
10556 __Pyx_RefNannySetupContext(
"norm (wrapper)", 0);
10557 __pyx_r = __pyx_pf_8PyClical_8clifford_80norm(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10560 __Pyx_RefNannyFinishContext();
10564 static PyObject *__pyx_pf_8PyClical_8clifford_80norm(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10565 PyObject *__pyx_r = NULL;
10566 __Pyx_RefNannyDeclarations
10567 PyObject *__pyx_t_1 = NULL;
10568 __Pyx_RefNannySetupContext(
"norm", 0);
10577 __Pyx_XDECREF(__pyx_r);
10578 __pyx_t_1 =
PyFloat_FromDouble(__pyx_v_self->instance->norm());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1172, __pyx_L1_error)
10579 __Pyx_GOTREF(__pyx_t_1);
10580 __pyx_r = __pyx_t_1;
10594 __Pyx_XDECREF(__pyx_t_1);
10595 __Pyx_AddTraceback(
"PyClical.clifford.norm", __pyx_clineno, __pyx_lineno, __pyx_filename);
10598 __Pyx_XGIVEREF(__pyx_r);
10599 __Pyx_RefNannyFinishContext();
10612 static PyObject *__pyx_pw_8PyClical_8clifford_83abs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10613 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 ";
10614 static PyObject *__pyx_pw_8PyClical_8clifford_83abs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10615 PyObject *__pyx_r = 0;
10616 __Pyx_RefNannyDeclarations
10617 __Pyx_RefNannySetupContext(
"abs (wrapper)", 0);
10618 __pyx_r = __pyx_pf_8PyClical_8clifford_82abs(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10621 __Pyx_RefNannyFinishContext();
10625 static PyObject *__pyx_pf_8PyClical_8clifford_82abs(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10626 PyObject *__pyx_r = NULL;
10627 __Pyx_RefNannyDeclarations
10628 PyObject *__pyx_t_1 = NULL;
10629 __Pyx_RefNannySetupContext(
"abs", 0);
10638 __Pyx_XDECREF(__pyx_r);
10639 __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)
10640 __Pyx_GOTREF(__pyx_t_1);
10641 __pyx_r = __pyx_t_1;
10655 __Pyx_XDECREF(__pyx_t_1);
10656 __Pyx_AddTraceback(
"PyClical.clifford.abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
10659 __Pyx_XGIVEREF(__pyx_r);
10660 __Pyx_RefNannyFinishContext();
10673 static PyObject *__pyx_pw_8PyClical_8clifford_85max_abs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10674 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 ";
10675 static PyObject *__pyx_pw_8PyClical_8clifford_85max_abs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10676 PyObject *__pyx_r = 0;
10677 __Pyx_RefNannyDeclarations
10678 __Pyx_RefNannySetupContext(
"max_abs (wrapper)", 0);
10679 __pyx_r = __pyx_pf_8PyClical_8clifford_84max_abs(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10682 __Pyx_RefNannyFinishContext();
10686 static PyObject *__pyx_pf_8PyClical_8clifford_84max_abs(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10687 PyObject *__pyx_r = NULL;
10688 __Pyx_RefNannyDeclarations
10689 PyObject *__pyx_t_1 = NULL;
10690 __Pyx_RefNannySetupContext(
"max_abs", 0);
10699 __Pyx_XDECREF(__pyx_r);
10700 __pyx_t_1 =
PyFloat_FromDouble(__pyx_v_self->instance->max_abs());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1192, __pyx_L1_error)
10701 __Pyx_GOTREF(__pyx_t_1);
10702 __pyx_r = __pyx_t_1;
10716 __Pyx_XDECREF(__pyx_t_1);
10717 __Pyx_AddTraceback(
"PyClical.clifford.max_abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
10720 __Pyx_XGIVEREF(__pyx_r);
10721 __Pyx_RefNannyFinishContext();
10734 static PyObject *__pyx_pw_8PyClical_8clifford_87truncated(PyObject *__pyx_v_self, PyObject *__pyx_v_limit);
10735 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 ";
10736 static PyObject *__pyx_pw_8PyClical_8clifford_87truncated(PyObject *__pyx_v_self, PyObject *__pyx_v_limit) {
10737 PyObject *__pyx_r = 0;
10738 __Pyx_RefNannyDeclarations
10739 __Pyx_RefNannySetupContext(
"truncated (wrapper)", 0);
10740 __pyx_r = __pyx_pf_8PyClical_8clifford_86truncated(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_limit));
10743 __Pyx_RefNannyFinishContext();
10747 static PyObject *__pyx_pf_8PyClical_8clifford_86truncated(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_limit) {
10748 PyObject *__pyx_r = NULL;
10749 __Pyx_RefNannyDeclarations
10750 PyObject *__pyx_t_1 = NULL;
10752 PyObject *__pyx_t_3 = NULL;
10753 __Pyx_RefNannySetupContext(
"truncated", 0);
10762 __Pyx_XDECREF(__pyx_r);
10763 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1203, __pyx_L1_error)
10764 __Pyx_GOTREF(__pyx_t_1);
10765 __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)
10766 __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)
10767 __Pyx_GOTREF(__pyx_t_3);
10768 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10769 __pyx_r = __pyx_t_3;
10783 __Pyx_XDECREF(__pyx_t_1);
10784 __Pyx_XDECREF(__pyx_t_3);
10785 __Pyx_AddTraceback(
"PyClical.clifford.truncated", __pyx_clineno, __pyx_lineno, __pyx_filename);
10788 __Pyx_XGIVEREF(__pyx_r);
10789 __Pyx_RefNannyFinishContext();
10802 static PyObject *__pyx_pw_8PyClical_8clifford_89isnan(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10803 static char __pyx_doc_8PyClical_8clifford_88isnan[] =
"\n Check if a multivector contains any IEEE NaN values.\n\n >>> clifford().isnan()\n False\n ";
10804 static PyObject *__pyx_pw_8PyClical_8clifford_89isnan(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10805 PyObject *__pyx_r = 0;
10806 __Pyx_RefNannyDeclarations
10807 __Pyx_RefNannySetupContext(
"isnan (wrapper)", 0);
10808 __pyx_r = __pyx_pf_8PyClical_8clifford_88isnan(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10811 __Pyx_RefNannyFinishContext();
10815 static PyObject *__pyx_pf_8PyClical_8clifford_88isnan(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10816 PyObject *__pyx_r = NULL;
10817 __Pyx_RefNannyDeclarations
10818 PyObject *__pyx_t_1 = NULL;
10819 __Pyx_RefNannySetupContext(
"isnan", 0);
10828 __Pyx_XDECREF(__pyx_r);
10829 __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->instance->isnan());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1212, __pyx_L1_error)
10830 __Pyx_GOTREF(__pyx_t_1);
10831 __pyx_r = __pyx_t_1;
10845 __Pyx_XDECREF(__pyx_t_1);
10846 __Pyx_AddTraceback(
"PyClical.clifford.isnan", __pyx_clineno, __pyx_lineno, __pyx_filename);
10849 __Pyx_XGIVEREF(__pyx_r);
10850 __Pyx_RefNannyFinishContext();
10863 static PyObject *__pyx_pw_8PyClical_8clifford_91frame(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10864 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 ";
10865 static PyObject *__pyx_pw_8PyClical_8clifford_91frame(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10866 PyObject *__pyx_r = 0;
10867 __Pyx_RefNannyDeclarations
10868 __Pyx_RefNannySetupContext(
"frame (wrapper)", 0);
10869 __pyx_r = __pyx_pf_8PyClical_8clifford_90frame(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10872 __Pyx_RefNannyFinishContext();
10876 static PyObject *__pyx_pf_8PyClical_8clifford_90frame(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10877 PyObject *__pyx_r = NULL;
10878 __Pyx_RefNannyDeclarations
10879 PyObject *__pyx_t_1 = NULL;
10880 PyObject *__pyx_t_2 = NULL;
10881 __Pyx_RefNannySetupContext(
"frame", 0);
10890 __Pyx_XDECREF(__pyx_r);
10891 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_index_set), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1223, __pyx_L1_error)
10892 __Pyx_GOTREF(__pyx_t_1);
10893 __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)
10894 __Pyx_GOTREF(__pyx_t_2);
10895 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10896 __pyx_r = __pyx_t_2;
10910 __Pyx_XDECREF(__pyx_t_1);
10911 __Pyx_XDECREF(__pyx_t_2);
10912 __Pyx_AddTraceback(
"PyClical.clifford.frame", __pyx_clineno, __pyx_lineno, __pyx_filename);
10915 __Pyx_XGIVEREF(__pyx_r);
10916 __Pyx_RefNannyFinishContext();
10929 static PyObject *__pyx_pw_8PyClical_8clifford_93__repr__(PyObject *__pyx_v_self);
10930 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 ";
10931 #if CYTHON_COMPILING_IN_CPYTHON 10932 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_92__repr__;
10934 static PyObject *__pyx_pw_8PyClical_8clifford_93__repr__(PyObject *__pyx_v_self) {
10935 PyObject *__pyx_r = 0;
10936 __Pyx_RefNannyDeclarations
10937 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
10938 __pyx_r = __pyx_pf_8PyClical_8clifford_92__repr__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10941 __Pyx_RefNannyFinishContext();
10945 static PyObject *__pyx_pf_8PyClical_8clifford_92__repr__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10946 PyObject *__pyx_r = NULL;
10947 __Pyx_RefNannyDeclarations
10948 PyObject *__pyx_t_1 = NULL;
10949 __Pyx_RefNannySetupContext(
"__repr__", 0);
10958 __Pyx_XDECREF(__pyx_r);
10959 __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)
10960 __Pyx_GOTREF(__pyx_t_1);
10961 __pyx_r = __pyx_t_1;
10975 __Pyx_XDECREF(__pyx_t_1);
10976 __Pyx_AddTraceback(
"PyClical.clifford.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10979 __Pyx_XGIVEREF(__pyx_r);
10980 __Pyx_RefNannyFinishContext();
10993 static PyObject *__pyx_pw_8PyClical_8clifford_95__str__(PyObject *__pyx_v_self);
10994 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 ";
10995 #if CYTHON_COMPILING_IN_CPYTHON 10996 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_94__str__;
10998 static PyObject *__pyx_pw_8PyClical_8clifford_95__str__(PyObject *__pyx_v_self) {
10999 PyObject *__pyx_r = 0;
11000 __Pyx_RefNannyDeclarations
11001 __Pyx_RefNannySetupContext(
"__str__ (wrapper)", 0);
11002 __pyx_r = __pyx_pf_8PyClical_8clifford_94__str__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
11005 __Pyx_RefNannyFinishContext();
11009 static PyObject *__pyx_pf_8PyClical_8clifford_94__str__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
11010 PyObject *__pyx_r = NULL;
11011 __Pyx_RefNannyDeclarations
11012 PyObject *__pyx_t_1 = NULL;
11013 __Pyx_RefNannySetupContext(
"__str__", 0);
11022 __Pyx_XDECREF(__pyx_r);
11023 __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)
11024 __Pyx_GOTREF(__pyx_t_1);
11025 __pyx_r = __pyx_t_1;
11039 __Pyx_XDECREF(__pyx_t_1);
11040 __Pyx_AddTraceback(
"PyClical.clifford.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11043 __Pyx_XGIVEREF(__pyx_r);
11044 __Pyx_RefNannyFinishContext();
11055 static PyObject *__pyx_pw_8PyClical_8clifford_97__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
11056 static PyObject *__pyx_pw_8PyClical_8clifford_97__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11057 PyObject *__pyx_r = 0;
11058 __Pyx_RefNannyDeclarations
11059 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
11060 __pyx_r = __pyx_pf_8PyClical_8clifford_96__reduce_cython__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
11063 __Pyx_RefNannyFinishContext();
11067 static PyObject *__pyx_pf_8PyClical_8clifford_96__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
11068 PyObject *__pyx_r = NULL;
11069 __Pyx_RefNannyDeclarations
11070 PyObject *__pyx_t_1 = NULL;
11071 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
11079 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__12, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
11080 __Pyx_GOTREF(__pyx_t_1);
11081 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
11082 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11083 __PYX_ERR(1, 2, __pyx_L1_error)
11093 __Pyx_XDECREF(__pyx_t_1);
11094 __Pyx_AddTraceback(
"PyClical.clifford.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11096 __Pyx_XGIVEREF(__pyx_r);
11097 __Pyx_RefNannyFinishContext();
11109 static PyObject *__pyx_pw_8PyClical_8clifford_99__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
11110 static PyObject *__pyx_pw_8PyClical_8clifford_99__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
11111 PyObject *__pyx_r = 0;
11112 __Pyx_RefNannyDeclarations
11113 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
11114 __pyx_r = __pyx_pf_8PyClical_8clifford_98__setstate_cython__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
11117 __Pyx_RefNannyFinishContext();
11121 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) {
11122 PyObject *__pyx_r = NULL;
11123 __Pyx_RefNannyDeclarations
11124 PyObject *__pyx_t_1 = NULL;
11125 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
11132 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__13, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
11133 __Pyx_GOTREF(__pyx_t_1);
11134 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
11135 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11136 __PYX_ERR(1, 4, __pyx_L1_error)
11147 __Pyx_XDECREF(__pyx_t_1);
11148 __Pyx_AddTraceback(
"PyClical.clifford.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11150 __Pyx_XGIVEREF(__pyx_r);
11151 __Pyx_RefNannyFinishContext();
11164 static PyObject *__pyx_pw_8PyClical_9clifford_hidden_doctests(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused);
11165 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 ";
11166 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};
11167 static PyObject *__pyx_pw_8PyClical_9clifford_hidden_doctests(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
11168 PyObject *__pyx_r = 0;
11169 __Pyx_RefNannyDeclarations
11170 __Pyx_RefNannySetupContext(
"clifford_hidden_doctests (wrapper)", 0);
11171 __pyx_r = __pyx_pf_8PyClical_8clifford_hidden_doctests(__pyx_self);
11174 __Pyx_RefNannyFinishContext();
11178 static PyObject *__pyx_pf_8PyClical_8clifford_hidden_doctests(CYTHON_UNUSED PyObject *__pyx_self) {
11179 PyObject *__pyx_r = NULL;
11180 __Pyx_RefNannyDeclarations
11181 __Pyx_RefNannySetupContext(
"clifford_hidden_doctests", 0);
11190 __Pyx_XDECREF(__pyx_r);
11191 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11204 __Pyx_XGIVEREF(__pyx_r);
11205 __Pyx_RefNannyFinishContext();
11217 static PyObject *__pyx_pw_8PyClical_11inv(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11218 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_inv(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11219 PyObject *__pyx_r = NULL;
11220 __Pyx_RefNannyDeclarations
11221 PyObject *__pyx_t_1 = NULL;
11222 PyObject *__pyx_t_2 = NULL;
11223 PyObject *__pyx_t_3 = NULL;
11224 __Pyx_RefNannySetupContext(
"inv", 0);
11233 __Pyx_XDECREF(__pyx_r);
11234 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1342, __pyx_L1_error)
11235 __Pyx_GOTREF(__pyx_t_2);
11236 __Pyx_INCREF(__pyx_v_obj);
11237 __Pyx_GIVEREF(__pyx_v_obj);
11238 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj);
11239 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_t_2, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1342, __pyx_L1_error)
11240 __Pyx_GOTREF(__pyx_t_3);
11241 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11242 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_inv);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1342, __pyx_L1_error)
11243 __Pyx_GOTREF(__pyx_t_2);
11244 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11246 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
11247 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
11248 if (likely(__pyx_t_3)) {
11249 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
11250 __Pyx_INCREF(__pyx_t_3);
11251 __Pyx_INCREF(
function);
11252 __Pyx_DECREF_SET(__pyx_t_2,
function);
11256 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1342, __pyx_L1_error)
11257 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11259 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1342, __pyx_L1_error)
11261 __Pyx_GOTREF(__pyx_t_1);
11262 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11263 __pyx_r = __pyx_t_1;
11277 __Pyx_XDECREF(__pyx_t_1);
11278 __Pyx_XDECREF(__pyx_t_2);
11279 __Pyx_XDECREF(__pyx_t_3);
11280 __Pyx_AddTraceback(
"PyClical.inv", __pyx_clineno, __pyx_lineno, __pyx_filename);
11283 __Pyx_XGIVEREF(__pyx_r);
11284 __Pyx_RefNannyFinishContext();
11289 static PyObject *__pyx_pw_8PyClical_11inv(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11290 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 ";
11291 static PyObject *__pyx_pw_8PyClical_11inv(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11292 PyObject *__pyx_r = 0;
11293 __Pyx_RefNannyDeclarations
11294 __Pyx_RefNannySetupContext(
"inv (wrapper)", 0);
11295 __pyx_r = __pyx_pf_8PyClical_10inv(__pyx_self, ((PyObject *)__pyx_v_obj));
11298 __Pyx_RefNannyFinishContext();
11302 static PyObject *__pyx_pf_8PyClical_10inv(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11303 PyObject *__pyx_r = NULL;
11304 __Pyx_RefNannyDeclarations
11305 PyObject *__pyx_t_1 = NULL;
11306 __Pyx_RefNannySetupContext(
"inv", 0);
11307 __Pyx_XDECREF(__pyx_r);
11308 __pyx_t_1 = __pyx_f_8PyClical_inv(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1329, __pyx_L1_error)
11309 __Pyx_GOTREF(__pyx_t_1);
11310 __pyx_r = __pyx_t_1;
11316 __Pyx_XDECREF(__pyx_t_1);
11317 __Pyx_AddTraceback(
"PyClical.inv", __pyx_clineno, __pyx_lineno, __pyx_filename);
11320 __Pyx_XGIVEREF(__pyx_r);
11321 __Pyx_RefNannyFinishContext();
11333 static PyObject *__pyx_pw_8PyClical_13scalar(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11334 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_scalar(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11335 PyObject *__pyx_r = NULL;
11336 __Pyx_RefNannyDeclarations
11337 PyObject *__pyx_t_1 = NULL;
11338 PyObject *__pyx_t_2 = NULL;
11339 PyObject *__pyx_t_3 = NULL;
11340 __Pyx_RefNannySetupContext(
"scalar", 0);
11349 __Pyx_XDECREF(__pyx_r);
11350 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1353, __pyx_L1_error)
11351 __Pyx_GOTREF(__pyx_t_2);
11352 __Pyx_INCREF(__pyx_v_obj);
11353 __Pyx_GIVEREF(__pyx_v_obj);
11354 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj);
11355 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_t_2, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1353, __pyx_L1_error)
11356 __Pyx_GOTREF(__pyx_t_3);
11357 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11358 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_scalar);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1353, __pyx_L1_error)
11359 __Pyx_GOTREF(__pyx_t_2);
11360 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11362 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
11363 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
11364 if (likely(__pyx_t_3)) {
11365 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
11366 __Pyx_INCREF(__pyx_t_3);
11367 __Pyx_INCREF(
function);
11368 __Pyx_DECREF_SET(__pyx_t_2,
function);
11372 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1353, __pyx_L1_error)
11373 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11375 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1353, __pyx_L1_error)
11377 __Pyx_GOTREF(__pyx_t_1);
11378 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11379 __pyx_r = __pyx_t_1;
11393 __Pyx_XDECREF(__pyx_t_1);
11394 __Pyx_XDECREF(__pyx_t_2);
11395 __Pyx_XDECREF(__pyx_t_3);
11396 __Pyx_AddTraceback(
"PyClical.scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
11399 __Pyx_XGIVEREF(__pyx_r);
11400 __Pyx_RefNannyFinishContext();
11405 static PyObject *__pyx_pw_8PyClical_13scalar(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11406 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 ";
11407 static PyObject *__pyx_pw_8PyClical_13scalar(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11408 PyObject *__pyx_r = 0;
11409 __Pyx_RefNannyDeclarations
11410 __Pyx_RefNannySetupContext(
"scalar (wrapper)", 0);
11411 __pyx_r = __pyx_pf_8PyClical_12scalar(__pyx_self, ((PyObject *)__pyx_v_obj));
11414 __Pyx_RefNannyFinishContext();
11418 static PyObject *__pyx_pf_8PyClical_12scalar(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11419 PyObject *__pyx_r = NULL;
11420 __Pyx_RefNannyDeclarations
11421 PyObject *__pyx_t_1 = NULL;
11422 __Pyx_RefNannySetupContext(
"scalar", 0);
11423 __Pyx_XDECREF(__pyx_r);
11424 __pyx_t_1 = __pyx_f_8PyClical_scalar(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1344, __pyx_L1_error)
11425 __Pyx_GOTREF(__pyx_t_1);
11426 __pyx_r = __pyx_t_1;
11432 __Pyx_XDECREF(__pyx_t_1);
11433 __Pyx_AddTraceback(
"PyClical.scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
11436 __Pyx_XGIVEREF(__pyx_r);
11437 __Pyx_RefNannyFinishContext();
11449 static PyObject *__pyx_pw_8PyClical_15real(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11450 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_real(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11451 PyObject *__pyx_r = NULL;
11452 __Pyx_RefNannyDeclarations
11453 PyObject *__pyx_t_1 = NULL;
11454 PyObject *__pyx_t_2 = NULL;
11455 PyObject *__pyx_t_3 = NULL;
11456 __Pyx_RefNannySetupContext(
"real", 0);
11465 __Pyx_XDECREF(__pyx_r);
11466 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1364, __pyx_L1_error)
11467 __Pyx_GOTREF(__pyx_t_2);
11468 __Pyx_INCREF(__pyx_v_obj);
11469 __Pyx_GIVEREF(__pyx_v_obj);
11470 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj);
11471 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_t_2, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1364, __pyx_L1_error)
11472 __Pyx_GOTREF(__pyx_t_3);
11473 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11474 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_scalar);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1364, __pyx_L1_error)
11475 __Pyx_GOTREF(__pyx_t_2);
11476 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11478 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
11479 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
11480 if (likely(__pyx_t_3)) {
11481 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
11482 __Pyx_INCREF(__pyx_t_3);
11483 __Pyx_INCREF(
function);
11484 __Pyx_DECREF_SET(__pyx_t_2,
function);
11488 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1364, __pyx_L1_error)
11489 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11491 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1364, __pyx_L1_error)
11493 __Pyx_GOTREF(__pyx_t_1);
11494 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11495 __pyx_r = __pyx_t_1;
11509 __Pyx_XDECREF(__pyx_t_1);
11510 __Pyx_XDECREF(__pyx_t_2);
11511 __Pyx_XDECREF(__pyx_t_3);
11512 __Pyx_AddTraceback(
"PyClical.real", __pyx_clineno, __pyx_lineno, __pyx_filename);
11515 __Pyx_XGIVEREF(__pyx_r);
11516 __Pyx_RefNannyFinishContext();
11521 static PyObject *__pyx_pw_8PyClical_15real(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11522 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 ";
11523 static PyObject *__pyx_pw_8PyClical_15real(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11524 PyObject *__pyx_r = 0;
11525 __Pyx_RefNannyDeclarations
11526 __Pyx_RefNannySetupContext(
"real (wrapper)", 0);
11527 __pyx_r = __pyx_pf_8PyClical_14real(__pyx_self, ((PyObject *)__pyx_v_obj));
11530 __Pyx_RefNannyFinishContext();
11534 static PyObject *__pyx_pf_8PyClical_14real(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11535 PyObject *__pyx_r = NULL;
11536 __Pyx_RefNannyDeclarations
11537 PyObject *__pyx_t_1 = NULL;
11538 __Pyx_RefNannySetupContext(
"real", 0);
11539 __Pyx_XDECREF(__pyx_r);
11540 __pyx_t_1 = __pyx_f_8PyClical_real(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1355, __pyx_L1_error)
11541 __Pyx_GOTREF(__pyx_t_1);
11542 __pyx_r = __pyx_t_1;
11548 __Pyx_XDECREF(__pyx_t_1);
11549 __Pyx_AddTraceback(
"PyClical.real", __pyx_clineno, __pyx_lineno, __pyx_filename);
11552 __Pyx_XGIVEREF(__pyx_r);
11553 __Pyx_RefNannyFinishContext();
11565 static PyObject *__pyx_pw_8PyClical_17imag(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11566 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_imag(CYTHON_UNUSED PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11567 PyObject *__pyx_r = NULL;
11568 __Pyx_RefNannyDeclarations
11569 __Pyx_RefNannySetupContext(
"imag", 0);
11578 __Pyx_XDECREF(__pyx_r);
11579 __Pyx_INCREF(__pyx_float_0_0);
11580 __pyx_r = __pyx_float_0_0;
11593 __Pyx_XGIVEREF(__pyx_r);
11594 __Pyx_RefNannyFinishContext();
11599 static PyObject *__pyx_pw_8PyClical_17imag(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11600 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 ";
11601 static PyObject *__pyx_pw_8PyClical_17imag(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11602 PyObject *__pyx_r = 0;
11603 __Pyx_RefNannyDeclarations
11604 __Pyx_RefNannySetupContext(
"imag (wrapper)", 0);
11605 __pyx_r = __pyx_pf_8PyClical_16imag(__pyx_self, ((PyObject *)__pyx_v_obj));
11608 __Pyx_RefNannyFinishContext();
11612 static PyObject *__pyx_pf_8PyClical_16imag(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11613 PyObject *__pyx_r = NULL;
11614 __Pyx_RefNannyDeclarations
11615 PyObject *__pyx_t_1 = NULL;
11616 __Pyx_RefNannySetupContext(
"imag", 0);
11617 __Pyx_XDECREF(__pyx_r);
11618 __pyx_t_1 = __pyx_f_8PyClical_imag(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1366, __pyx_L1_error)
11619 __Pyx_GOTREF(__pyx_t_1);
11620 __pyx_r = __pyx_t_1;
11626 __Pyx_XDECREF(__pyx_t_1);
11627 __Pyx_AddTraceback(
"PyClical.imag", __pyx_clineno, __pyx_lineno, __pyx_filename);
11630 __Pyx_XGIVEREF(__pyx_r);
11631 __Pyx_RefNannyFinishContext();
11643 static PyObject *__pyx_pw_8PyClical_19pure(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11644 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_pure(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11645 PyObject *__pyx_r = NULL;
11646 __Pyx_RefNannyDeclarations
11647 PyObject *__pyx_t_1 = NULL;
11648 PyObject *__pyx_t_2 = NULL;
11649 PyObject *__pyx_t_3 = NULL;
11650 __Pyx_RefNannySetupContext(
"pure", 0);
11659 __Pyx_XDECREF(__pyx_r);
11660 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1386, __pyx_L1_error)
11661 __Pyx_GOTREF(__pyx_t_2);
11662 __Pyx_INCREF(__pyx_v_obj);
11663 __Pyx_GIVEREF(__pyx_v_obj);
11664 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj);
11665 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_t_2, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1386, __pyx_L1_error)
11666 __Pyx_GOTREF(__pyx_t_3);
11667 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11668 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_pure);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1386, __pyx_L1_error)
11669 __Pyx_GOTREF(__pyx_t_2);
11670 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11672 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
11673 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
11674 if (likely(__pyx_t_3)) {
11675 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
11676 __Pyx_INCREF(__pyx_t_3);
11677 __Pyx_INCREF(
function);
11678 __Pyx_DECREF_SET(__pyx_t_2,
function);
11682 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1386, __pyx_L1_error)
11683 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11685 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1386, __pyx_L1_error)
11687 __Pyx_GOTREF(__pyx_t_1);
11688 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11689 __pyx_r = __pyx_t_1;
11703 __Pyx_XDECREF(__pyx_t_1);
11704 __Pyx_XDECREF(__pyx_t_2);
11705 __Pyx_XDECREF(__pyx_t_3);
11706 __Pyx_AddTraceback(
"PyClical.pure", __pyx_clineno, __pyx_lineno, __pyx_filename);
11709 __Pyx_XGIVEREF(__pyx_r);
11710 __Pyx_RefNannyFinishContext();
11715 static PyObject *__pyx_pw_8PyClical_19pure(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11716 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 ";
11717 static PyObject *__pyx_pw_8PyClical_19pure(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11718 PyObject *__pyx_r = 0;
11719 __Pyx_RefNannyDeclarations
11720 __Pyx_RefNannySetupContext(
"pure (wrapper)", 0);
11721 __pyx_r = __pyx_pf_8PyClical_18pure(__pyx_self, ((PyObject *)__pyx_v_obj));
11724 __Pyx_RefNannyFinishContext();
11728 static PyObject *__pyx_pf_8PyClical_18pure(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11729 PyObject *__pyx_r = NULL;
11730 __Pyx_RefNannyDeclarations
11731 PyObject *__pyx_t_1 = NULL;
11732 __Pyx_RefNannySetupContext(
"pure", 0);
11733 __Pyx_XDECREF(__pyx_r);
11734 __pyx_t_1 = __pyx_f_8PyClical_pure(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1377, __pyx_L1_error)
11735 __Pyx_GOTREF(__pyx_t_1);
11736 __pyx_r = __pyx_t_1;
11742 __Pyx_XDECREF(__pyx_t_1);
11743 __Pyx_AddTraceback(
"PyClical.pure", __pyx_clineno, __pyx_lineno, __pyx_filename);
11746 __Pyx_XGIVEREF(__pyx_r);
11747 __Pyx_RefNannyFinishContext();
11759 static PyObject *__pyx_pw_8PyClical_21even(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11760 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_even(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11761 PyObject *__pyx_r = NULL;
11762 __Pyx_RefNannyDeclarations
11763 PyObject *__pyx_t_1 = NULL;
11764 PyObject *__pyx_t_2 = NULL;
11765 PyObject *__pyx_t_3 = NULL;
11766 __Pyx_RefNannySetupContext(
"even", 0);
11775 __Pyx_XDECREF(__pyx_r);
11776 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1395, __pyx_L1_error)
11777 __Pyx_GOTREF(__pyx_t_2);
11778 __Pyx_INCREF(__pyx_v_obj);
11779 __Pyx_GIVEREF(__pyx_v_obj);
11780 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj);
11781 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_t_2, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1395, __pyx_L1_error)
11782 __Pyx_GOTREF(__pyx_t_3);
11783 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11784 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_even);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1395, __pyx_L1_error)
11785 __Pyx_GOTREF(__pyx_t_2);
11786 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11788 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
11789 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
11790 if (likely(__pyx_t_3)) {
11791 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
11792 __Pyx_INCREF(__pyx_t_3);
11793 __Pyx_INCREF(
function);
11794 __Pyx_DECREF_SET(__pyx_t_2,
function);
11798 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1395, __pyx_L1_error)
11799 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11801 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1395, __pyx_L1_error)
11803 __Pyx_GOTREF(__pyx_t_1);
11804 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11805 __pyx_r = __pyx_t_1;
11819 __Pyx_XDECREF(__pyx_t_1);
11820 __Pyx_XDECREF(__pyx_t_2);
11821 __Pyx_XDECREF(__pyx_t_3);
11822 __Pyx_AddTraceback(
"PyClical.even", __pyx_clineno, __pyx_lineno, __pyx_filename);
11825 __Pyx_XGIVEREF(__pyx_r);
11826 __Pyx_RefNannyFinishContext();
11831 static PyObject *__pyx_pw_8PyClical_21even(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11832 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 ";
11833 static PyObject *__pyx_pw_8PyClical_21even(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11834 PyObject *__pyx_r = 0;
11835 __Pyx_RefNannyDeclarations
11836 __Pyx_RefNannySetupContext(
"even (wrapper)", 0);
11837 __pyx_r = __pyx_pf_8PyClical_20even(__pyx_self, ((PyObject *)__pyx_v_obj));
11840 __Pyx_RefNannyFinishContext();
11844 static PyObject *__pyx_pf_8PyClical_20even(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11845 PyObject *__pyx_r = NULL;
11846 __Pyx_RefNannyDeclarations
11847 PyObject *__pyx_t_1 = NULL;
11848 __Pyx_RefNannySetupContext(
"even", 0);
11849 __Pyx_XDECREF(__pyx_r);
11850 __pyx_t_1 = __pyx_f_8PyClical_even(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1388, __pyx_L1_error)
11851 __Pyx_GOTREF(__pyx_t_1);
11852 __pyx_r = __pyx_t_1;
11858 __Pyx_XDECREF(__pyx_t_1);
11859 __Pyx_AddTraceback(
"PyClical.even", __pyx_clineno, __pyx_lineno, __pyx_filename);
11862 __Pyx_XGIVEREF(__pyx_r);
11863 __Pyx_RefNannyFinishContext();
11875 static PyObject *__pyx_pw_8PyClical_23odd(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11876 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_odd(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11877 PyObject *__pyx_r = NULL;
11878 __Pyx_RefNannyDeclarations
11879 PyObject *__pyx_t_1 = NULL;
11880 PyObject *__pyx_t_2 = NULL;
11881 PyObject *__pyx_t_3 = NULL;
11882 __Pyx_RefNannySetupContext(
"odd", 0);
11891 __Pyx_XDECREF(__pyx_r);
11892 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1404, __pyx_L1_error)
11893 __Pyx_GOTREF(__pyx_t_2);
11894 __Pyx_INCREF(__pyx_v_obj);
11895 __Pyx_GIVEREF(__pyx_v_obj);
11896 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj);
11897 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_t_2, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1404, __pyx_L1_error)
11898 __Pyx_GOTREF(__pyx_t_3);
11899 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11900 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_odd);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1404, __pyx_L1_error)
11901 __Pyx_GOTREF(__pyx_t_2);
11902 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11904 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
11905 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
11906 if (likely(__pyx_t_3)) {
11907 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
11908 __Pyx_INCREF(__pyx_t_3);
11909 __Pyx_INCREF(
function);
11910 __Pyx_DECREF_SET(__pyx_t_2,
function);
11914 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1404, __pyx_L1_error)
11915 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11917 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1404, __pyx_L1_error)
11919 __Pyx_GOTREF(__pyx_t_1);
11920 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11921 __pyx_r = __pyx_t_1;
11935 __Pyx_XDECREF(__pyx_t_1);
11936 __Pyx_XDECREF(__pyx_t_2);
11937 __Pyx_XDECREF(__pyx_t_3);
11938 __Pyx_AddTraceback(
"PyClical.odd", __pyx_clineno, __pyx_lineno, __pyx_filename);
11941 __Pyx_XGIVEREF(__pyx_r);
11942 __Pyx_RefNannyFinishContext();
11947 static PyObject *__pyx_pw_8PyClical_23odd(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11948 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 ";
11949 static PyObject *__pyx_pw_8PyClical_23odd(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11950 PyObject *__pyx_r = 0;
11951 __Pyx_RefNannyDeclarations
11952 __Pyx_RefNannySetupContext(
"odd (wrapper)", 0);
11953 __pyx_r = __pyx_pf_8PyClical_22odd(__pyx_self, ((PyObject *)__pyx_v_obj));
11956 __Pyx_RefNannyFinishContext();
11960 static PyObject *__pyx_pf_8PyClical_22odd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11961 PyObject *__pyx_r = NULL;
11962 __Pyx_RefNannyDeclarations
11963 PyObject *__pyx_t_1 = NULL;
11964 __Pyx_RefNannySetupContext(
"odd", 0);
11965 __Pyx_XDECREF(__pyx_r);
11966 __pyx_t_1 = __pyx_f_8PyClical_odd(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1397, __pyx_L1_error)
11967 __Pyx_GOTREF(__pyx_t_1);
11968 __pyx_r = __pyx_t_1;
11974 __Pyx_XDECREF(__pyx_t_1);
11975 __Pyx_AddTraceback(
"PyClical.odd", __pyx_clineno, __pyx_lineno, __pyx_filename);
11978 __Pyx_XGIVEREF(__pyx_r);
11979 __Pyx_RefNannyFinishContext();
11991 static PyObject *__pyx_pw_8PyClical_25involute(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11992 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_involute(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11993 PyObject *__pyx_r = NULL;
11994 __Pyx_RefNannyDeclarations
11995 PyObject *__pyx_t_1 = NULL;
11996 PyObject *__pyx_t_2 = NULL;
11997 PyObject *__pyx_t_3 = NULL;
11998 __Pyx_RefNannySetupContext(
"involute", 0);
12007 __Pyx_XDECREF(__pyx_r);
12008 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1419, __pyx_L1_error)
12009 __Pyx_GOTREF(__pyx_t_2);
12010 __Pyx_INCREF(__pyx_v_obj);
12011 __Pyx_GIVEREF(__pyx_v_obj);
12012 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj);
12013 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_t_2, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1419, __pyx_L1_error)
12014 __Pyx_GOTREF(__pyx_t_3);
12015 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12016 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_involute);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1419, __pyx_L1_error)
12017 __Pyx_GOTREF(__pyx_t_2);
12018 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12020 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
12021 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
12022 if (likely(__pyx_t_3)) {
12023 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
12024 __Pyx_INCREF(__pyx_t_3);
12025 __Pyx_INCREF(
function);
12026 __Pyx_DECREF_SET(__pyx_t_2,
function);
12030 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1419, __pyx_L1_error)
12031 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12033 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1419, __pyx_L1_error)
12035 __Pyx_GOTREF(__pyx_t_1);
12036 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12037 __pyx_r = __pyx_t_1;
12051 __Pyx_XDECREF(__pyx_t_1);
12052 __Pyx_XDECREF(__pyx_t_2);
12053 __Pyx_XDECREF(__pyx_t_3);
12054 __Pyx_AddTraceback(
"PyClical.involute", __pyx_clineno, __pyx_lineno, __pyx_filename);
12057 __Pyx_XGIVEREF(__pyx_r);
12058 __Pyx_RefNannyFinishContext();
12063 static PyObject *__pyx_pw_8PyClical_25involute(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12064 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 ";
12065 static PyObject *__pyx_pw_8PyClical_25involute(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12066 PyObject *__pyx_r = 0;
12067 __Pyx_RefNannyDeclarations
12068 __Pyx_RefNannySetupContext(
"involute (wrapper)", 0);
12069 __pyx_r = __pyx_pf_8PyClical_24involute(__pyx_self, ((PyObject *)__pyx_v_obj));
12072 __Pyx_RefNannyFinishContext();
12076 static PyObject *__pyx_pf_8PyClical_24involute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12077 PyObject *__pyx_r = NULL;
12078 __Pyx_RefNannyDeclarations
12079 PyObject *__pyx_t_1 = NULL;
12080 __Pyx_RefNannySetupContext(
"involute", 0);
12081 __Pyx_XDECREF(__pyx_r);
12082 __pyx_t_1 = __pyx_f_8PyClical_involute(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1406, __pyx_L1_error)
12083 __Pyx_GOTREF(__pyx_t_1);
12084 __pyx_r = __pyx_t_1;
12090 __Pyx_XDECREF(__pyx_t_1);
12091 __Pyx_AddTraceback(
"PyClical.involute", __pyx_clineno, __pyx_lineno, __pyx_filename);
12094 __Pyx_XGIVEREF(__pyx_r);
12095 __Pyx_RefNannyFinishContext();
12107 static PyObject *__pyx_pw_8PyClical_27reverse(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12108 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_reverse(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12109 PyObject *__pyx_r = NULL;
12110 __Pyx_RefNannyDeclarations
12111 PyObject *__pyx_t_1 = NULL;
12112 PyObject *__pyx_t_2 = NULL;
12113 PyObject *__pyx_t_3 = NULL;
12114 __Pyx_RefNannySetupContext(
"reverse", 0);
12123 __Pyx_XDECREF(__pyx_r);
12124 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1434, __pyx_L1_error)
12125 __Pyx_GOTREF(__pyx_t_2);
12126 __Pyx_INCREF(__pyx_v_obj);
12127 __Pyx_GIVEREF(__pyx_v_obj);
12128 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj);
12129 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_t_2, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1434, __pyx_L1_error)
12130 __Pyx_GOTREF(__pyx_t_3);
12131 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12132 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_reverse);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1434, __pyx_L1_error)
12133 __Pyx_GOTREF(__pyx_t_2);
12134 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12136 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
12137 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
12138 if (likely(__pyx_t_3)) {
12139 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
12140 __Pyx_INCREF(__pyx_t_3);
12141 __Pyx_INCREF(
function);
12142 __Pyx_DECREF_SET(__pyx_t_2,
function);
12146 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1434, __pyx_L1_error)
12147 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12149 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1434, __pyx_L1_error)
12151 __Pyx_GOTREF(__pyx_t_1);
12152 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12153 __pyx_r = __pyx_t_1;
12167 __Pyx_XDECREF(__pyx_t_1);
12168 __Pyx_XDECREF(__pyx_t_2);
12169 __Pyx_XDECREF(__pyx_t_3);
12170 __Pyx_AddTraceback(
"PyClical.reverse", __pyx_clineno, __pyx_lineno, __pyx_filename);
12173 __Pyx_XGIVEREF(__pyx_r);
12174 __Pyx_RefNannyFinishContext();
12179 static PyObject *__pyx_pw_8PyClical_27reverse(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12180 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 ";
12181 static PyObject *__pyx_pw_8PyClical_27reverse(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12182 PyObject *__pyx_r = 0;
12183 __Pyx_RefNannyDeclarations
12184 __Pyx_RefNannySetupContext(
"reverse (wrapper)", 0);
12185 __pyx_r = __pyx_pf_8PyClical_26reverse(__pyx_self, ((PyObject *)__pyx_v_obj));
12188 __Pyx_RefNannyFinishContext();
12192 static PyObject *__pyx_pf_8PyClical_26reverse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12193 PyObject *__pyx_r = NULL;
12194 __Pyx_RefNannyDeclarations
12195 PyObject *__pyx_t_1 = NULL;
12196 __Pyx_RefNannySetupContext(
"reverse", 0);
12197 __Pyx_XDECREF(__pyx_r);
12198 __pyx_t_1 = __pyx_f_8PyClical_reverse(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1421, __pyx_L1_error)
12199 __Pyx_GOTREF(__pyx_t_1);
12200 __pyx_r = __pyx_t_1;
12206 __Pyx_XDECREF(__pyx_t_1);
12207 __Pyx_AddTraceback(
"PyClical.reverse", __pyx_clineno, __pyx_lineno, __pyx_filename);
12210 __Pyx_XGIVEREF(__pyx_r);
12211 __Pyx_RefNannyFinishContext();
12223 static PyObject *__pyx_pw_8PyClical_29conj(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12224 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_conj(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12225 PyObject *__pyx_r = NULL;
12226 __Pyx_RefNannyDeclarations
12227 PyObject *__pyx_t_1 = NULL;
12228 PyObject *__pyx_t_2 = NULL;
12229 PyObject *__pyx_t_3 = NULL;
12230 __Pyx_RefNannySetupContext(
"conj", 0);
12239 __Pyx_XDECREF(__pyx_r);
12240 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1449, __pyx_L1_error)
12241 __Pyx_GOTREF(__pyx_t_2);
12242 __Pyx_INCREF(__pyx_v_obj);
12243 __Pyx_GIVEREF(__pyx_v_obj);
12244 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj);
12245 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_t_2, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1449, __pyx_L1_error)
12246 __Pyx_GOTREF(__pyx_t_3);
12247 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12248 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_conj);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1449, __pyx_L1_error)
12249 __Pyx_GOTREF(__pyx_t_2);
12250 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12252 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
12253 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
12254 if (likely(__pyx_t_3)) {
12255 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
12256 __Pyx_INCREF(__pyx_t_3);
12257 __Pyx_INCREF(
function);
12258 __Pyx_DECREF_SET(__pyx_t_2,
function);
12262 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1449, __pyx_L1_error)
12263 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12265 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1449, __pyx_L1_error)
12267 __Pyx_GOTREF(__pyx_t_1);
12268 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12269 __pyx_r = __pyx_t_1;
12283 __Pyx_XDECREF(__pyx_t_1);
12284 __Pyx_XDECREF(__pyx_t_2);
12285 __Pyx_XDECREF(__pyx_t_3);
12286 __Pyx_AddTraceback(
"PyClical.conj", __pyx_clineno, __pyx_lineno, __pyx_filename);
12289 __Pyx_XGIVEREF(__pyx_r);
12290 __Pyx_RefNannyFinishContext();
12295 static PyObject *__pyx_pw_8PyClical_29conj(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12296 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 ";
12297 static PyObject *__pyx_pw_8PyClical_29conj(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12298 PyObject *__pyx_r = 0;
12299 __Pyx_RefNannyDeclarations
12300 __Pyx_RefNannySetupContext(
"conj (wrapper)", 0);
12301 __pyx_r = __pyx_pf_8PyClical_28conj(__pyx_self, ((PyObject *)__pyx_v_obj));
12304 __Pyx_RefNannyFinishContext();
12308 static PyObject *__pyx_pf_8PyClical_28conj(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12309 PyObject *__pyx_r = NULL;
12310 __Pyx_RefNannyDeclarations
12311 PyObject *__pyx_t_1 = NULL;
12312 __Pyx_RefNannySetupContext(
"conj", 0);
12313 __Pyx_XDECREF(__pyx_r);
12314 __pyx_t_1 = __pyx_f_8PyClical_conj(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1436, __pyx_L1_error)
12315 __Pyx_GOTREF(__pyx_t_1);
12316 __pyx_r = __pyx_t_1;
12322 __Pyx_XDECREF(__pyx_t_1);
12323 __Pyx_AddTraceback(
"PyClical.conj", __pyx_clineno, __pyx_lineno, __pyx_filename);
12326 __Pyx_XGIVEREF(__pyx_r);
12327 __Pyx_RefNannyFinishContext();
12339 static PyObject *__pyx_pw_8PyClical_31quad(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12340 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_quad(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12341 PyObject *__pyx_r = NULL;
12342 __Pyx_RefNannyDeclarations
12343 PyObject *__pyx_t_1 = NULL;
12344 PyObject *__pyx_t_2 = NULL;
12345 PyObject *__pyx_t_3 = NULL;
12346 __Pyx_RefNannySetupContext(
"quad", 0);
12355 __Pyx_XDECREF(__pyx_r);
12356 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1460, __pyx_L1_error)
12357 __Pyx_GOTREF(__pyx_t_2);
12358 __Pyx_INCREF(__pyx_v_obj);
12359 __Pyx_GIVEREF(__pyx_v_obj);
12360 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj);
12361 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_t_2, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1460, __pyx_L1_error)
12362 __Pyx_GOTREF(__pyx_t_3);
12363 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12364 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_quad);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1460, __pyx_L1_error)
12365 __Pyx_GOTREF(__pyx_t_2);
12366 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12368 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
12369 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
12370 if (likely(__pyx_t_3)) {
12371 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
12372 __Pyx_INCREF(__pyx_t_3);
12373 __Pyx_INCREF(
function);
12374 __Pyx_DECREF_SET(__pyx_t_2,
function);
12378 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1460, __pyx_L1_error)
12379 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12381 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1460, __pyx_L1_error)
12383 __Pyx_GOTREF(__pyx_t_1);
12384 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12385 __pyx_r = __pyx_t_1;
12399 __Pyx_XDECREF(__pyx_t_1);
12400 __Pyx_XDECREF(__pyx_t_2);
12401 __Pyx_XDECREF(__pyx_t_3);
12402 __Pyx_AddTraceback(
"PyClical.quad", __pyx_clineno, __pyx_lineno, __pyx_filename);
12405 __Pyx_XGIVEREF(__pyx_r);
12406 __Pyx_RefNannyFinishContext();
12411 static PyObject *__pyx_pw_8PyClical_31quad(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12412 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 ";
12413 static PyObject *__pyx_pw_8PyClical_31quad(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12414 PyObject *__pyx_r = 0;
12415 __Pyx_RefNannyDeclarations
12416 __Pyx_RefNannySetupContext(
"quad (wrapper)", 0);
12417 __pyx_r = __pyx_pf_8PyClical_30quad(__pyx_self, ((PyObject *)__pyx_v_obj));
12420 __Pyx_RefNannyFinishContext();
12424 static PyObject *__pyx_pf_8PyClical_30quad(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12425 PyObject *__pyx_r = NULL;
12426 __Pyx_RefNannyDeclarations
12427 PyObject *__pyx_t_1 = NULL;
12428 __Pyx_RefNannySetupContext(
"quad", 0);
12429 __Pyx_XDECREF(__pyx_r);
12430 __pyx_t_1 = __pyx_f_8PyClical_quad(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1451, __pyx_L1_error)
12431 __Pyx_GOTREF(__pyx_t_1);
12432 __pyx_r = __pyx_t_1;
12438 __Pyx_XDECREF(__pyx_t_1);
12439 __Pyx_AddTraceback(
"PyClical.quad", __pyx_clineno, __pyx_lineno, __pyx_filename);
12442 __Pyx_XGIVEREF(__pyx_r);
12443 __Pyx_RefNannyFinishContext();
12455 static PyObject *__pyx_pw_8PyClical_33norm(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12456 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_norm(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12457 PyObject *__pyx_r = NULL;
12458 __Pyx_RefNannyDeclarations
12459 PyObject *__pyx_t_1 = NULL;
12460 PyObject *__pyx_t_2 = NULL;
12461 PyObject *__pyx_t_3 = NULL;
12462 __Pyx_RefNannySetupContext(
"norm", 0);
12471 __Pyx_XDECREF(__pyx_r);
12472 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1471, __pyx_L1_error)
12473 __Pyx_GOTREF(__pyx_t_2);
12474 __Pyx_INCREF(__pyx_v_obj);
12475 __Pyx_GIVEREF(__pyx_v_obj);
12476 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj);
12477 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_t_2, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1471, __pyx_L1_error)
12478 __Pyx_GOTREF(__pyx_t_3);
12479 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12480 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_norm);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1471, __pyx_L1_error)
12481 __Pyx_GOTREF(__pyx_t_2);
12482 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12484 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
12485 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
12486 if (likely(__pyx_t_3)) {
12487 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
12488 __Pyx_INCREF(__pyx_t_3);
12489 __Pyx_INCREF(
function);
12490 __Pyx_DECREF_SET(__pyx_t_2,
function);
12494 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1471, __pyx_L1_error)
12495 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12497 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1471, __pyx_L1_error)
12499 __Pyx_GOTREF(__pyx_t_1);
12500 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12501 __pyx_r = __pyx_t_1;
12515 __Pyx_XDECREF(__pyx_t_1);
12516 __Pyx_XDECREF(__pyx_t_2);
12517 __Pyx_XDECREF(__pyx_t_3);
12518 __Pyx_AddTraceback(
"PyClical.norm", __pyx_clineno, __pyx_lineno, __pyx_filename);
12521 __Pyx_XGIVEREF(__pyx_r);
12522 __Pyx_RefNannyFinishContext();
12527 static PyObject *__pyx_pw_8PyClical_33norm(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12528 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 ";
12529 static PyObject *__pyx_pw_8PyClical_33norm(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12530 PyObject *__pyx_r = 0;
12531 __Pyx_RefNannyDeclarations
12532 __Pyx_RefNannySetupContext(
"norm (wrapper)", 0);
12533 __pyx_r = __pyx_pf_8PyClical_32norm(__pyx_self, ((PyObject *)__pyx_v_obj));
12536 __Pyx_RefNannyFinishContext();
12540 static PyObject *__pyx_pf_8PyClical_32norm(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12541 PyObject *__pyx_r = NULL;
12542 __Pyx_RefNannyDeclarations
12543 PyObject *__pyx_t_1 = NULL;
12544 __Pyx_RefNannySetupContext(
"norm", 0);
12545 __Pyx_XDECREF(__pyx_r);
12546 __pyx_t_1 = __pyx_f_8PyClical_norm(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1462, __pyx_L1_error)
12547 __Pyx_GOTREF(__pyx_t_1);
12548 __pyx_r = __pyx_t_1;
12554 __Pyx_XDECREF(__pyx_t_1);
12555 __Pyx_AddTraceback(
"PyClical.norm", __pyx_clineno, __pyx_lineno, __pyx_filename);
12558 __Pyx_XGIVEREF(__pyx_r);
12559 __Pyx_RefNannyFinishContext();
12571 static PyObject *__pyx_pw_8PyClical_35abs(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12572 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_abs(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12573 PyObject *__pyx_r = NULL;
12574 __Pyx_RefNannyDeclarations
12575 PyObject *__pyx_t_1 = NULL;
12576 __Pyx_RefNannySetupContext(
"abs", 0);
12585 __Pyx_XDECREF(__pyx_r);
12586 __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)
12587 __Pyx_GOTREF(__pyx_t_1);
12588 __pyx_r = __pyx_t_1;
12602 __Pyx_XDECREF(__pyx_t_1);
12603 __Pyx_AddTraceback(
"PyClical.abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
12606 __Pyx_XGIVEREF(__pyx_r);
12607 __Pyx_RefNannyFinishContext();
12612 static PyObject *__pyx_pw_8PyClical_35abs(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12613 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 ";
12614 static PyObject *__pyx_pw_8PyClical_35abs(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12615 PyObject *__pyx_r = 0;
12616 __Pyx_RefNannyDeclarations
12617 __Pyx_RefNannySetupContext(
"abs (wrapper)", 0);
12618 __pyx_r = __pyx_pf_8PyClical_34abs(__pyx_self, ((PyObject *)__pyx_v_obj));
12621 __Pyx_RefNannyFinishContext();
12625 static PyObject *__pyx_pf_8PyClical_34abs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12626 PyObject *__pyx_r = NULL;
12627 __Pyx_RefNannyDeclarations
12628 PyObject *__pyx_t_1 = NULL;
12629 __Pyx_RefNannySetupContext(
"abs", 0);
12630 __Pyx_XDECREF(__pyx_r);
12631 __pyx_t_1 = __pyx_f_8PyClical_abs(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1473, __pyx_L1_error)
12632 __Pyx_GOTREF(__pyx_t_1);
12633 __pyx_r = __pyx_t_1;
12639 __Pyx_XDECREF(__pyx_t_1);
12640 __Pyx_AddTraceback(
"PyClical.abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
12643 __Pyx_XGIVEREF(__pyx_r);
12644 __Pyx_RefNannyFinishContext();
12656 static PyObject *__pyx_pw_8PyClical_37max_abs(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12657 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_max_abs(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12658 PyObject *__pyx_r = NULL;
12659 __Pyx_RefNannyDeclarations
12660 PyObject *__pyx_t_1 = NULL;
12661 __Pyx_RefNannySetupContext(
"max_abs", 0);
12670 __Pyx_XDECREF(__pyx_r);
12671 __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)
12672 __Pyx_GOTREF(__pyx_t_1);
12673 __pyx_r = __pyx_t_1;
12687 __Pyx_XDECREF(__pyx_t_1);
12688 __Pyx_AddTraceback(
"PyClical.max_abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
12691 __Pyx_XGIVEREF(__pyx_r);
12692 __Pyx_RefNannyFinishContext();
12697 static PyObject *__pyx_pw_8PyClical_37max_abs(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12698 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 ";
12699 static PyObject *__pyx_pw_8PyClical_37max_abs(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12700 PyObject *__pyx_r = 0;
12701 __Pyx_RefNannyDeclarations
12702 __Pyx_RefNannySetupContext(
"max_abs (wrapper)", 0);
12703 __pyx_r = __pyx_pf_8PyClical_36max_abs(__pyx_self, ((PyObject *)__pyx_v_obj));
12706 __Pyx_RefNannyFinishContext();
12710 static PyObject *__pyx_pf_8PyClical_36max_abs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12711 PyObject *__pyx_r = NULL;
12712 __Pyx_RefNannyDeclarations
12713 PyObject *__pyx_t_1 = NULL;
12714 __Pyx_RefNannySetupContext(
"max_abs", 0);
12715 __Pyx_XDECREF(__pyx_r);
12716 __pyx_t_1 = __pyx_f_8PyClical_max_abs(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1482, __pyx_L1_error)
12717 __Pyx_GOTREF(__pyx_t_1);
12718 __pyx_r = __pyx_t_1;
12724 __Pyx_XDECREF(__pyx_t_1);
12725 __Pyx_AddTraceback(
"PyClical.max_abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
12728 __Pyx_XGIVEREF(__pyx_r);
12729 __Pyx_RefNannyFinishContext();
12741 static PyObject *__pyx_pw_8PyClical_39pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
12742 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_pow(PyObject *__pyx_v_obj, PyObject *__pyx_v_m, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12743 PyObject *__pyx_r = NULL;
12744 __Pyx_RefNannyDeclarations
12745 PyObject *__pyx_t_1 = NULL;
12746 PyObject *__pyx_t_2 = NULL;
12747 PyObject *__pyx_t_3 = NULL;
12748 PyObject *__pyx_t_4 = NULL;
12749 PyObject *__pyx_t_5 = NULL;
12750 PyObject *__pyx_t_6 = NULL;
12752 PyObject *__pyx_t_8 = NULL;
12753 PyObject *__pyx_t_9 = NULL;
12754 PyObject *__pyx_t_10 = NULL;
12755 PyObject *__pyx_t_11 = NULL;
12756 __Pyx_RefNannySetupContext(
"pow", 0);
12766 __Pyx_PyThreadState_declare
12767 __Pyx_PyThreadState_assign
12768 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
12769 __Pyx_XGOTREF(__pyx_t_1);
12770 __Pyx_XGOTREF(__pyx_t_2);
12771 __Pyx_XGOTREF(__pyx_t_3);
12781 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1514, __pyx_L3_error)
12782 __Pyx_GOTREF(__pyx_t_5);
12783 __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)
12784 __Pyx_GOTREF(__pyx_t_6);
12785 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12788 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
12789 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
12790 if (likely(__pyx_t_5)) {
12791 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
12792 __Pyx_INCREF(__pyx_t_5);
12793 __Pyx_INCREF(
function);
12794 __Pyx_DECREF_SET(__pyx_t_6,
function);
12798 #if CYTHON_FAST_PYCALL 12799 if (PyFunction_Check(__pyx_t_6)) {
12800 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_obj, __pyx_v_m};
12801 __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)
12802 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12803 __Pyx_GOTREF(__pyx_t_4);
12806 #if CYTHON_FAST_PYCCALL 12807 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
12808 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_obj, __pyx_v_m};
12809 __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)
12810 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12811 __Pyx_GOTREF(__pyx_t_4);
12815 __pyx_t_8 = PyTuple_New(2+__pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1514, __pyx_L3_error)
12816 __Pyx_GOTREF(__pyx_t_8);
12818 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
12820 __Pyx_INCREF(__pyx_v_obj);
12821 __Pyx_GIVEREF(__pyx_v_obj);
12822 PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_obj);
12823 __Pyx_INCREF(__pyx_v_m);
12824 __Pyx_GIVEREF(__pyx_v_m);
12825 PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_m);
12826 __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)
12827 __Pyx_GOTREF(__pyx_t_4);
12828 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12830 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12831 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12841 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12842 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12843 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12844 goto __pyx_L8_try_end;
12846 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12847 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
12848 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12849 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12859 __Pyx_AddTraceback(
"PyClical.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
12860 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_8) < 0) __PYX_ERR(0, 1515, __pyx_L5_except_error)
12861 __Pyx_GOTREF(__pyx_t_4);
12862 __Pyx_GOTREF(__pyx_t_6);
12863 __Pyx_GOTREF(__pyx_t_8);
12872 __Pyx_XDECREF(__pyx_r);
12873 __pyx_t_9 = PyTuple_New(1);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1516, __pyx_L5_except_error)
12874 __Pyx_GOTREF(__pyx_t_9);
12875 __Pyx_INCREF(__pyx_v_obj);
12876 __Pyx_GIVEREF(__pyx_v_obj);
12877 PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_obj);
12878 __pyx_t_10 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_t_9, NULL);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1516, __pyx_L5_except_error)
12879 __Pyx_GOTREF(__pyx_t_10);
12880 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12881 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_pow);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1516, __pyx_L5_except_error)
12882 __Pyx_GOTREF(__pyx_t_9);
12883 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12885 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
12886 __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
12887 if (likely(__pyx_t_10)) {
12888 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
12889 __Pyx_INCREF(__pyx_t_10);
12890 __Pyx_INCREF(
function);
12891 __Pyx_DECREF_SET(__pyx_t_9,
function);
12895 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_m);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1516, __pyx_L5_except_error)
12896 __Pyx_GOTREF(__pyx_t_5);
12898 #if CYTHON_FAST_PYCALL 12899 if (PyFunction_Check(__pyx_t_9)) {
12900 PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_v_m};
12901 __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1516, __pyx_L5_except_error)
12902 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
12903 __Pyx_GOTREF(__pyx_t_5);
12906 #if CYTHON_FAST_PYCCALL 12907 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
12908 PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_v_m};
12909 __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1516, __pyx_L5_except_error)
12910 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
12911 __Pyx_GOTREF(__pyx_t_5);
12915 __pyx_t_11 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1516, __pyx_L5_except_error)
12916 __Pyx_GOTREF(__pyx_t_11);
12917 __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL;
12918 __Pyx_INCREF(__pyx_v_m);
12919 __Pyx_GIVEREF(__pyx_v_m);
12920 PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_v_m);
12921 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1516, __pyx_L5_except_error)
12922 __Pyx_GOTREF(__pyx_t_5);
12923 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
12926 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12927 __pyx_r = __pyx_t_5;
12929 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12930 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12931 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12932 goto __pyx_L6_except_return;
12934 __pyx_L5_except_error:;
12943 __Pyx_XGIVEREF(__pyx_t_1);
12944 __Pyx_XGIVEREF(__pyx_t_2);
12945 __Pyx_XGIVEREF(__pyx_t_3);
12946 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
12947 goto __pyx_L1_error;
12948 __pyx_L6_except_return:;
12949 __Pyx_XGIVEREF(__pyx_t_1);
12950 __Pyx_XGIVEREF(__pyx_t_2);
12951 __Pyx_XGIVEREF(__pyx_t_3);
12952 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
12966 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12969 __Pyx_XDECREF(__pyx_t_4);
12970 __Pyx_XDECREF(__pyx_t_5);
12971 __Pyx_XDECREF(__pyx_t_6);
12972 __Pyx_XDECREF(__pyx_t_8);
12973 __Pyx_XDECREF(__pyx_t_9);
12974 __Pyx_XDECREF(__pyx_t_10);
12975 __Pyx_XDECREF(__pyx_t_11);
12976 __Pyx_AddTraceback(
"PyClical.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
12979 __Pyx_XGIVEREF(__pyx_r);
12980 __Pyx_RefNannyFinishContext();
12985 static PyObject *__pyx_pw_8PyClical_39pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
12986 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 ";
12987 static PyObject *__pyx_pw_8PyClical_39pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
12988 PyObject *__pyx_v_obj = 0;
12989 PyObject *__pyx_v_m = 0;
12990 PyObject *__pyx_r = 0;
12991 __Pyx_RefNannyDeclarations
12992 __Pyx_RefNannySetupContext(
"pow (wrapper)", 0);
12994 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_m,0};
12995 PyObject* values[2] = {0,0};
12996 if (unlikely(__pyx_kwds)) {
12997 Py_ssize_t kw_args;
12998 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
12999 switch (pos_args) {
13000 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13001 CYTHON_FALLTHROUGH;
13002 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13003 CYTHON_FALLTHROUGH;
13005 default:
goto __pyx_L5_argtuple_error;
13007 kw_args = PyDict_Size(__pyx_kwds);
13008 switch (pos_args) {
13010 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
13011 else goto __pyx_L5_argtuple_error;
13012 CYTHON_FALLTHROUGH;
13014 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
13016 __Pyx_RaiseArgtupleInvalid(
"pow", 1, 2, 2, 1); __PYX_ERR(0, 1494, __pyx_L3_error)
13019 if (unlikely(kw_args > 0)) {
13020 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"pow") < 0)) __PYX_ERR(0, 1494, __pyx_L3_error)
13022 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
13023 goto __pyx_L5_argtuple_error;
13025 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13026 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13028 __pyx_v_obj = values[0];
13029 __pyx_v_m = values[1];
13031 goto __pyx_L4_argument_unpacking_done;
13032 __pyx_L5_argtuple_error:;
13033 __Pyx_RaiseArgtupleInvalid(
"pow", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1494, __pyx_L3_error)
13035 __Pyx_AddTraceback(
"PyClical.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
13036 __Pyx_RefNannyFinishContext();
13038 __pyx_L4_argument_unpacking_done:;
13039 __pyx_r = __pyx_pf_8PyClical_38pow(__pyx_self, __pyx_v_obj, __pyx_v_m);
13042 __Pyx_RefNannyFinishContext();
13046 static PyObject *__pyx_pf_8PyClical_38pow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_m) {
13047 PyObject *__pyx_r = NULL;
13048 __Pyx_RefNannyDeclarations
13049 PyObject *__pyx_t_1 = NULL;
13050 __Pyx_RefNannySetupContext(
"pow", 0);
13051 __Pyx_XDECREF(__pyx_r);
13052 __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)
13053 __Pyx_GOTREF(__pyx_t_1);
13054 __pyx_r = __pyx_t_1;
13060 __Pyx_XDECREF(__pyx_t_1);
13061 __Pyx_AddTraceback(
"PyClical.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
13064 __Pyx_XGIVEREF(__pyx_r);
13065 __Pyx_RefNannyFinishContext();
13077 static PyObject *__pyx_pw_8PyClical_41outer_pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13078 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_outer_pow(PyObject *__pyx_v_obj, PyObject *__pyx_v_m, CYTHON_UNUSED
int __pyx_skip_dispatch) {
13079 PyObject *__pyx_r = NULL;
13080 __Pyx_RefNannyDeclarations
13081 PyObject *__pyx_t_1 = NULL;
13082 PyObject *__pyx_t_2 = NULL;
13083 PyObject *__pyx_t_3 = NULL;
13084 PyObject *__pyx_t_4 = NULL;
13085 __Pyx_RefNannySetupContext(
"outer_pow", 0);
13094 __Pyx_XDECREF(__pyx_r);
13095 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1525, __pyx_L1_error)
13096 __Pyx_GOTREF(__pyx_t_2);
13097 __Pyx_INCREF(__pyx_v_obj);
13098 __Pyx_GIVEREF(__pyx_v_obj);
13099 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj);
13100 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_t_2, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1525, __pyx_L1_error)
13101 __Pyx_GOTREF(__pyx_t_3);
13102 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13103 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_outer_pow);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1525, __pyx_L1_error)
13104 __Pyx_GOTREF(__pyx_t_2);
13105 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13107 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
13108 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
13109 if (likely(__pyx_t_3)) {
13110 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
13111 __Pyx_INCREF(__pyx_t_3);
13112 __Pyx_INCREF(
function);
13113 __Pyx_DECREF_SET(__pyx_t_2,
function);
13117 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_m);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1525, __pyx_L1_error)
13118 __Pyx_GOTREF(__pyx_t_1);
13120 #if CYTHON_FAST_PYCALL 13121 if (PyFunction_Check(__pyx_t_2)) {
13122 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_m};
13123 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1525, __pyx_L1_error)
13124 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13125 __Pyx_GOTREF(__pyx_t_1);
13128 #if CYTHON_FAST_PYCCALL 13129 if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
13130 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_m};
13131 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1525, __pyx_L1_error)
13132 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13133 __Pyx_GOTREF(__pyx_t_1);
13137 __pyx_t_4 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1525, __pyx_L1_error)
13138 __Pyx_GOTREF(__pyx_t_4);
13139 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
13140 __Pyx_INCREF(__pyx_v_m);
13141 __Pyx_GIVEREF(__pyx_v_m);
13142 PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_m);
13143 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1525, __pyx_L1_error)
13144 __Pyx_GOTREF(__pyx_t_1);
13145 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13148 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13149 __pyx_r = __pyx_t_1;
13163 __Pyx_XDECREF(__pyx_t_1);
13164 __Pyx_XDECREF(__pyx_t_2);
13165 __Pyx_XDECREF(__pyx_t_3);
13166 __Pyx_XDECREF(__pyx_t_4);
13167 __Pyx_AddTraceback(
"PyClical.outer_pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
13170 __Pyx_XGIVEREF(__pyx_r);
13171 __Pyx_RefNannyFinishContext();
13176 static PyObject *__pyx_pw_8PyClical_41outer_pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13177 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 ";
13178 static PyObject *__pyx_pw_8PyClical_41outer_pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13179 PyObject *__pyx_v_obj = 0;
13180 PyObject *__pyx_v_m = 0;
13181 PyObject *__pyx_r = 0;
13182 __Pyx_RefNannyDeclarations
13183 __Pyx_RefNannySetupContext(
"outer_pow (wrapper)", 0);
13185 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_m,0};
13186 PyObject* values[2] = {0,0};
13187 if (unlikely(__pyx_kwds)) {
13188 Py_ssize_t kw_args;
13189 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13190 switch (pos_args) {
13191 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13192 CYTHON_FALLTHROUGH;
13193 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13194 CYTHON_FALLTHROUGH;
13196 default:
goto __pyx_L5_argtuple_error;
13198 kw_args = PyDict_Size(__pyx_kwds);
13199 switch (pos_args) {
13201 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
13202 else goto __pyx_L5_argtuple_error;
13203 CYTHON_FALLTHROUGH;
13205 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
13207 __Pyx_RaiseArgtupleInvalid(
"outer_pow", 1, 2, 2, 1); __PYX_ERR(0, 1518, __pyx_L3_error)
13210 if (unlikely(kw_args > 0)) {
13211 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"outer_pow") < 0)) __PYX_ERR(0, 1518, __pyx_L3_error)
13213 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
13214 goto __pyx_L5_argtuple_error;
13216 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13217 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13219 __pyx_v_obj = values[0];
13220 __pyx_v_m = values[1];
13222 goto __pyx_L4_argument_unpacking_done;
13223 __pyx_L5_argtuple_error:;
13224 __Pyx_RaiseArgtupleInvalid(
"outer_pow", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1518, __pyx_L3_error)
13226 __Pyx_AddTraceback(
"PyClical.outer_pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
13227 __Pyx_RefNannyFinishContext();
13229 __pyx_L4_argument_unpacking_done:;
13230 __pyx_r = __pyx_pf_8PyClical_40outer_pow(__pyx_self, __pyx_v_obj, __pyx_v_m);
13233 __Pyx_RefNannyFinishContext();
13237 static PyObject *__pyx_pf_8PyClical_40outer_pow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_m) {
13238 PyObject *__pyx_r = NULL;
13239 __Pyx_RefNannyDeclarations
13240 PyObject *__pyx_t_1 = NULL;
13241 __Pyx_RefNannySetupContext(
"outer_pow", 0);
13242 __Pyx_XDECREF(__pyx_r);
13243 __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)
13244 __Pyx_GOTREF(__pyx_t_1);
13245 __pyx_r = __pyx_t_1;
13251 __Pyx_XDECREF(__pyx_t_1);
13252 __Pyx_AddTraceback(
"PyClical.outer_pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
13255 __Pyx_XGIVEREF(__pyx_r);
13256 __Pyx_RefNannyFinishContext();
13268 static PyObject *__pyx_pw_8PyClical_43complexifier(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13269 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_complexifier(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
13270 PyObject *__pyx_r = NULL;
13271 __Pyx_RefNannyDeclarations
13272 PyObject *__pyx_t_1 = NULL;
13273 PyObject *__pyx_t_2 = NULL;
13274 __Pyx_RefNannySetupContext(
"complexifier", 0);
13283 __Pyx_XDECREF(__pyx_r);
13284 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1540, __pyx_L1_error)
13285 __Pyx_GOTREF(__pyx_t_1);
13286 __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)
13287 __Pyx_GOTREF(__pyx_t_2);
13288 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13289 __pyx_r = __pyx_t_2;
13303 __Pyx_XDECREF(__pyx_t_1);
13304 __Pyx_XDECREF(__pyx_t_2);
13305 __Pyx_AddTraceback(
"PyClical.complexifier", __pyx_clineno, __pyx_lineno, __pyx_filename);
13308 __Pyx_XGIVEREF(__pyx_r);
13309 __Pyx_RefNannyFinishContext();
13314 static PyObject *__pyx_pw_8PyClical_43complexifier(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13315 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 ";
13316 static PyObject *__pyx_pw_8PyClical_43complexifier(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13317 PyObject *__pyx_r = 0;
13318 __Pyx_RefNannyDeclarations
13319 __Pyx_RefNannySetupContext(
"complexifier (wrapper)", 0);
13320 __pyx_r = __pyx_pf_8PyClical_42complexifier(__pyx_self, ((PyObject *)__pyx_v_obj));
13323 __Pyx_RefNannyFinishContext();
13327 static PyObject *__pyx_pf_8PyClical_42complexifier(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13328 PyObject *__pyx_r = NULL;
13329 __Pyx_RefNannyDeclarations
13330 PyObject *__pyx_t_1 = NULL;
13331 __Pyx_RefNannySetupContext(
"complexifier", 0);
13332 __Pyx_XDECREF(__pyx_r);
13333 __pyx_t_1 = __pyx_f_8PyClical_complexifier(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1527, __pyx_L1_error)
13334 __Pyx_GOTREF(__pyx_t_1);
13335 __pyx_r = __pyx_t_1;
13341 __Pyx_XDECREF(__pyx_t_1);
13342 __Pyx_AddTraceback(
"PyClical.complexifier", __pyx_clineno, __pyx_lineno, __pyx_filename);
13345 __Pyx_XGIVEREF(__pyx_r);
13346 __Pyx_RefNannyFinishContext();
13358 static PyObject *__pyx_pw_8PyClical_45sqrt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13359 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) {
13360 PyObject *__pyx_v_i = ((PyObject *)Py_None);
13361 PyObject *__pyx_r = NULL;
13362 __Pyx_RefNannyDeclarations
13365 PyObject *__pyx_t_3 = NULL;
13367 PyObject *__pyx_t_5 = NULL;
13368 PyObject *__pyx_t_6 = NULL;
13369 PyObject *__pyx_t_7 = NULL;
13370 PyObject *__pyx_t_8 = NULL;
13371 PyObject *__pyx_t_9 = NULL;
13372 PyObject *__pyx_t_10 = NULL;
13373 PyObject *__pyx_t_11 = NULL;
13374 __Pyx_RefNannySetupContext(
"sqrt", 0);
13375 if (__pyx_optional_args) {
13376 if (__pyx_optional_args->__pyx_n > 0) {
13377 __pyx_v_i = __pyx_optional_args->i;
13388 __pyx_t_1 = (__pyx_v_i != Py_None);
13389 __pyx_t_2 = (__pyx_t_1 != 0);
13399 __Pyx_XDECREF(__pyx_r);
13400 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1558, __pyx_L1_error)
13401 __Pyx_GOTREF(__pyx_t_3);
13403 __pyx_t_4 =
sqrt(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
13405 __Pyx_CppExn2PyErr();
13406 __PYX_ERR(0, 1558, __pyx_L1_error)
13408 __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)
13409 __Pyx_GOTREF(__pyx_t_5);
13410 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13411 __pyx_r = __pyx_t_5;
13433 __Pyx_PyThreadState_declare
13434 __Pyx_PyThreadState_assign
13435 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
13436 __Pyx_XGOTREF(__pyx_t_6);
13437 __Pyx_XGOTREF(__pyx_t_7);
13438 __Pyx_XGOTREF(__pyx_t_8);
13448 __Pyx_XDECREF(__pyx_r);
13449 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1561, __pyx_L4_error)
13450 __Pyx_GOTREF(__pyx_t_3);
13451 __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)
13452 __Pyx_GOTREF(__pyx_t_9);
13453 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13455 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
13456 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
13457 if (likely(__pyx_t_3)) {
13458 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
13459 __Pyx_INCREF(__pyx_t_3);
13460 __Pyx_INCREF(
function);
13461 __Pyx_DECREF_SET(__pyx_t_9,
function);
13465 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1561, __pyx_L4_error)
13466 __Pyx_GOTREF(__pyx_t_5);
13468 #if CYTHON_FAST_PYCALL 13469 if (PyFunction_Check(__pyx_t_9)) {
13470 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
13471 __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1561, __pyx_L4_error)
13472 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13473 __Pyx_GOTREF(__pyx_t_5);
13476 #if CYTHON_FAST_PYCCALL 13477 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
13478 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
13479 __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1561, __pyx_L4_error)
13480 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13481 __Pyx_GOTREF(__pyx_t_5);
13485 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1561, __pyx_L4_error)
13486 __Pyx_GOTREF(__pyx_t_10);
13487 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
13488 __Pyx_INCREF(__pyx_v_obj);
13489 __Pyx_GIVEREF(__pyx_v_obj);
13490 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
13491 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1561, __pyx_L4_error)
13492 __Pyx_GOTREF(__pyx_t_5);
13493 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13496 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13497 __pyx_r = __pyx_t_5;
13499 goto __pyx_L8_try_return;
13510 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13511 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
13512 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
13513 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13523 __Pyx_AddTraceback(
"PyClical.sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename);
13524 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1562, __pyx_L6_except_error)
13525 __Pyx_GOTREF(__pyx_t_5);
13526 __Pyx_GOTREF(__pyx_t_9);
13527 __Pyx_GOTREF(__pyx_t_10);
13536 __Pyx_XDECREF(__pyx_r);
13537 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1563, __pyx_L6_except_error)
13538 __Pyx_GOTREF(__pyx_t_3);
13539 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_3),
sqrt(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1563, __pyx_L6_except_error)
13540 __Pyx_GOTREF(__pyx_t_11);
13541 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13542 __pyx_r = __pyx_t_11;
13544 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13545 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13546 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13547 goto __pyx_L7_except_return;
13549 __pyx_L6_except_error:;
13558 __Pyx_XGIVEREF(__pyx_t_6);
13559 __Pyx_XGIVEREF(__pyx_t_7);
13560 __Pyx_XGIVEREF(__pyx_t_8);
13561 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
13562 goto __pyx_L1_error;
13563 __pyx_L8_try_return:;
13564 __Pyx_XGIVEREF(__pyx_t_6);
13565 __Pyx_XGIVEREF(__pyx_t_7);
13566 __Pyx_XGIVEREF(__pyx_t_8);
13567 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
13569 __pyx_L7_except_return:;
13570 __Pyx_XGIVEREF(__pyx_t_6);
13571 __Pyx_XGIVEREF(__pyx_t_7);
13572 __Pyx_XGIVEREF(__pyx_t_8);
13573 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
13588 __Pyx_XDECREF(__pyx_t_3);
13589 __Pyx_XDECREF(__pyx_t_5);
13590 __Pyx_XDECREF(__pyx_t_9);
13591 __Pyx_XDECREF(__pyx_t_10);
13592 __Pyx_XDECREF(__pyx_t_11);
13593 __Pyx_AddTraceback(
"PyClical.sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename);
13596 __Pyx_XGIVEREF(__pyx_r);
13597 __Pyx_RefNannyFinishContext();
13602 static PyObject *__pyx_pw_8PyClical_45sqrt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13603 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 ";
13604 static PyObject *__pyx_pw_8PyClical_45sqrt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13605 PyObject *__pyx_v_obj = 0;
13606 PyObject *__pyx_v_i = 0;
13607 PyObject *__pyx_r = 0;
13608 __Pyx_RefNannyDeclarations
13609 __Pyx_RefNannySetupContext(
"sqrt (wrapper)", 0);
13611 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
13612 PyObject* values[2] = {0,0};
13613 values[1] = ((PyObject *)Py_None);
13614 if (unlikely(__pyx_kwds)) {
13615 Py_ssize_t kw_args;
13616 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13617 switch (pos_args) {
13618 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13619 CYTHON_FALLTHROUGH;
13620 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13621 CYTHON_FALLTHROUGH;
13623 default:
goto __pyx_L5_argtuple_error;
13625 kw_args = PyDict_Size(__pyx_kwds);
13626 switch (pos_args) {
13628 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
13629 else goto __pyx_L5_argtuple_error;
13630 CYTHON_FALLTHROUGH;
13633 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i);
13634 if (value) { values[1] = value; kw_args--; }
13637 if (unlikely(kw_args > 0)) {
13638 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"sqrt") < 0)) __PYX_ERR(0, 1542, __pyx_L3_error)
13641 switch (PyTuple_GET_SIZE(__pyx_args)) {
13642 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13643 CYTHON_FALLTHROUGH;
13644 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13646 default:
goto __pyx_L5_argtuple_error;
13649 __pyx_v_obj = values[0];
13650 __pyx_v_i = values[1];
13652 goto __pyx_L4_argument_unpacking_done;
13653 __pyx_L5_argtuple_error:;
13654 __Pyx_RaiseArgtupleInvalid(
"sqrt", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1542, __pyx_L3_error)
13656 __Pyx_AddTraceback(
"PyClical.sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename);
13657 __Pyx_RefNannyFinishContext();
13659 __pyx_L4_argument_unpacking_done:;
13660 __pyx_r = __pyx_pf_8PyClical_44sqrt(__pyx_self, __pyx_v_obj, __pyx_v_i);
13663 __Pyx_RefNannyFinishContext();
13667 static PyObject *__pyx_pf_8PyClical_44sqrt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
13668 PyObject *__pyx_r = NULL;
13669 __Pyx_RefNannyDeclarations
13670 PyObject *__pyx_t_1 = NULL;
13671 struct __pyx_opt_args_8PyClical_sqrt __pyx_t_2;
13672 __Pyx_RefNannySetupContext(
"sqrt", 0);
13673 __Pyx_XDECREF(__pyx_r);
13674 __pyx_t_2.__pyx_n = 1;
13675 __pyx_t_2.i = __pyx_v_i;
13676 __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)
13677 __Pyx_GOTREF(__pyx_t_1);
13678 __pyx_r = __pyx_t_1;
13684 __Pyx_XDECREF(__pyx_t_1);
13685 __Pyx_AddTraceback(
"PyClical.sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename);
13688 __Pyx_XGIVEREF(__pyx_r);
13689 __Pyx_RefNannyFinishContext();
13701 static PyObject *__pyx_pw_8PyClical_47exp(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13702 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_exp(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
13703 PyObject *__pyx_r = NULL;
13704 __Pyx_RefNannyDeclarations
13705 PyObject *__pyx_t_1 = NULL;
13706 PyObject *__pyx_t_2 = NULL;
13707 PyObject *__pyx_t_3 = NULL;
13708 PyObject *__pyx_t_4 = NULL;
13709 PyObject *__pyx_t_5 = NULL;
13710 PyObject *__pyx_t_6 = NULL;
13711 PyObject *__pyx_t_7 = NULL;
13712 PyObject *__pyx_t_8 = NULL;
13713 __Pyx_RefNannySetupContext(
"exp", 0);
13723 __Pyx_PyThreadState_declare
13724 __Pyx_PyThreadState_assign
13725 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
13726 __Pyx_XGOTREF(__pyx_t_1);
13727 __Pyx_XGOTREF(__pyx_t_2);
13728 __Pyx_XGOTREF(__pyx_t_3);
13738 __Pyx_XDECREF(__pyx_r);
13739 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1575, __pyx_L3_error)
13740 __Pyx_GOTREF(__pyx_t_5);
13741 __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)
13742 __Pyx_GOTREF(__pyx_t_6);
13743 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13745 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
13746 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
13747 if (likely(__pyx_t_5)) {
13748 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
13749 __Pyx_INCREF(__pyx_t_5);
13750 __Pyx_INCREF(
function);
13751 __Pyx_DECREF_SET(__pyx_t_6,
function);
13755 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_obj);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1575, __pyx_L3_error)
13756 __Pyx_GOTREF(__pyx_t_4);
13758 #if CYTHON_FAST_PYCALL 13759 if (PyFunction_Check(__pyx_t_6)) {
13760 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_obj};
13761 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1575, __pyx_L3_error)
13762 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13763 __Pyx_GOTREF(__pyx_t_4);
13766 #if CYTHON_FAST_PYCCALL 13767 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
13768 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_obj};
13769 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1575, __pyx_L3_error)
13770 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13771 __Pyx_GOTREF(__pyx_t_4);
13775 __pyx_t_7 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1575, __pyx_L3_error)
13776 __Pyx_GOTREF(__pyx_t_7);
13777 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
13778 __Pyx_INCREF(__pyx_v_obj);
13779 __Pyx_GIVEREF(__pyx_v_obj);
13780 PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_obj);
13781 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1575, __pyx_L3_error)
13782 __Pyx_GOTREF(__pyx_t_4);
13783 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13786 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13787 __pyx_r = __pyx_t_4;
13789 goto __pyx_L7_try_return;
13800 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13801 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
13802 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
13803 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
13813 __Pyx_AddTraceback(
"PyClical.exp", __pyx_clineno, __pyx_lineno, __pyx_filename);
13814 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1576, __pyx_L5_except_error)
13815 __Pyx_GOTREF(__pyx_t_4);
13816 __Pyx_GOTREF(__pyx_t_6);
13817 __Pyx_GOTREF(__pyx_t_7);
13826 __Pyx_XDECREF(__pyx_r);
13827 __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1577, __pyx_L5_except_error)
13828 __Pyx_GOTREF(__pyx_t_5);
13829 __pyx_t_8 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_5),
exp(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1577, __pyx_L5_except_error)
13830 __Pyx_GOTREF(__pyx_t_8);
13831 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13832 __pyx_r = __pyx_t_8;
13834 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13835 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13836 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13837 goto __pyx_L6_except_return;
13839 __pyx_L5_except_error:;
13848 __Pyx_XGIVEREF(__pyx_t_1);
13849 __Pyx_XGIVEREF(__pyx_t_2);
13850 __Pyx_XGIVEREF(__pyx_t_3);
13851 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
13852 goto __pyx_L1_error;
13853 __pyx_L7_try_return:;
13854 __Pyx_XGIVEREF(__pyx_t_1);
13855 __Pyx_XGIVEREF(__pyx_t_2);
13856 __Pyx_XGIVEREF(__pyx_t_3);
13857 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
13859 __pyx_L6_except_return:;
13860 __Pyx_XGIVEREF(__pyx_t_1);
13861 __Pyx_XGIVEREF(__pyx_t_2);
13862 __Pyx_XGIVEREF(__pyx_t_3);
13863 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
13877 __Pyx_XDECREF(__pyx_t_4);
13878 __Pyx_XDECREF(__pyx_t_5);
13879 __Pyx_XDECREF(__pyx_t_6);
13880 __Pyx_XDECREF(__pyx_t_7);
13881 __Pyx_XDECREF(__pyx_t_8);
13882 __Pyx_AddTraceback(
"PyClical.exp", __pyx_clineno, __pyx_lineno, __pyx_filename);
13885 __Pyx_XGIVEREF(__pyx_r);
13886 __Pyx_RefNannyFinishContext();
13891 static PyObject *__pyx_pw_8PyClical_47exp(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13892 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 ";
13893 static PyObject *__pyx_pw_8PyClical_47exp(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13894 PyObject *__pyx_r = 0;
13895 __Pyx_RefNannyDeclarations
13896 __Pyx_RefNannySetupContext(
"exp (wrapper)", 0);
13897 __pyx_r = __pyx_pf_8PyClical_46exp(__pyx_self, ((PyObject *)__pyx_v_obj));
13900 __Pyx_RefNannyFinishContext();
13904 static PyObject *__pyx_pf_8PyClical_46exp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13905 PyObject *__pyx_r = NULL;
13906 __Pyx_RefNannyDeclarations
13907 PyObject *__pyx_t_1 = NULL;
13908 __Pyx_RefNannySetupContext(
"exp", 0);
13909 __Pyx_XDECREF(__pyx_r);
13910 __pyx_t_1 = __pyx_f_8PyClical_exp(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1565, __pyx_L1_error)
13911 __Pyx_GOTREF(__pyx_t_1);
13912 __pyx_r = __pyx_t_1;
13918 __Pyx_XDECREF(__pyx_t_1);
13919 __Pyx_AddTraceback(
"PyClical.exp", __pyx_clineno, __pyx_lineno, __pyx_filename);
13922 __Pyx_XGIVEREF(__pyx_r);
13923 __Pyx_RefNannyFinishContext();
13935 static PyObject *__pyx_pw_8PyClical_49log(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13936 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) {
13937 PyObject *__pyx_v_i = ((PyObject *)Py_None);
13938 PyObject *__pyx_r = NULL;
13939 __Pyx_RefNannyDeclarations
13942 PyObject *__pyx_t_3 = NULL;
13944 PyObject *__pyx_t_5 = NULL;
13945 PyObject *__pyx_t_6 = NULL;
13946 PyObject *__pyx_t_7 = NULL;
13947 PyObject *__pyx_t_8 = NULL;
13948 PyObject *__pyx_t_9 = NULL;
13949 PyObject *__pyx_t_10 = NULL;
13950 PyObject *__pyx_t_11 = NULL;
13951 __Pyx_RefNannySetupContext(
"log", 0);
13952 if (__pyx_optional_args) {
13953 if (__pyx_optional_args->__pyx_n > 0) {
13954 __pyx_v_i = __pyx_optional_args->i;
13965 __pyx_t_1 = (__pyx_v_i != Py_None);
13966 __pyx_t_2 = (__pyx_t_1 != 0);
13976 __Pyx_XDECREF(__pyx_r);
13977 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1595, __pyx_L1_error)
13978 __Pyx_GOTREF(__pyx_t_3);
13980 __pyx_t_4 =
log(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
13982 __Pyx_CppExn2PyErr();
13983 __PYX_ERR(0, 1595, __pyx_L1_error)
13985 __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)
13986 __Pyx_GOTREF(__pyx_t_5);
13987 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13988 __pyx_r = __pyx_t_5;
14010 __Pyx_PyThreadState_declare
14011 __Pyx_PyThreadState_assign
14012 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
14013 __Pyx_XGOTREF(__pyx_t_6);
14014 __Pyx_XGOTREF(__pyx_t_7);
14015 __Pyx_XGOTREF(__pyx_t_8);
14025 __Pyx_XDECREF(__pyx_r);
14026 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1598, __pyx_L4_error)
14027 __Pyx_GOTREF(__pyx_t_3);
14028 __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)
14029 __Pyx_GOTREF(__pyx_t_9);
14030 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14032 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
14033 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
14034 if (likely(__pyx_t_3)) {
14035 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
14036 __Pyx_INCREF(__pyx_t_3);
14037 __Pyx_INCREF(
function);
14038 __Pyx_DECREF_SET(__pyx_t_9,
function);
14042 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1598, __pyx_L4_error)
14043 __Pyx_GOTREF(__pyx_t_5);
14045 #if CYTHON_FAST_PYCALL 14046 if (PyFunction_Check(__pyx_t_9)) {
14047 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
14048 __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1598, __pyx_L4_error)
14049 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14050 __Pyx_GOTREF(__pyx_t_5);
14053 #if CYTHON_FAST_PYCCALL 14054 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
14055 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
14056 __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1598, __pyx_L4_error)
14057 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14058 __Pyx_GOTREF(__pyx_t_5);
14062 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1598, __pyx_L4_error)
14063 __Pyx_GOTREF(__pyx_t_10);
14064 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
14065 __Pyx_INCREF(__pyx_v_obj);
14066 __Pyx_GIVEREF(__pyx_v_obj);
14067 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
14068 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1598, __pyx_L4_error)
14069 __Pyx_GOTREF(__pyx_t_5);
14070 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14073 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14074 __pyx_r = __pyx_t_5;
14076 goto __pyx_L8_try_return;
14087 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14088 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
14089 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
14090 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14100 __Pyx_AddTraceback(
"PyClical.log", __pyx_clineno, __pyx_lineno, __pyx_filename);
14101 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1599, __pyx_L6_except_error)
14102 __Pyx_GOTREF(__pyx_t_5);
14103 __Pyx_GOTREF(__pyx_t_9);
14104 __Pyx_GOTREF(__pyx_t_10);
14113 __Pyx_XDECREF(__pyx_r);
14114 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1600, __pyx_L6_except_error)
14115 __Pyx_GOTREF(__pyx_t_3);
14116 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_3),
log(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1600, __pyx_L6_except_error)
14117 __Pyx_GOTREF(__pyx_t_11);
14118 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14119 __pyx_r = __pyx_t_11;
14121 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14122 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14123 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14124 goto __pyx_L7_except_return;
14126 __pyx_L6_except_error:;
14135 __Pyx_XGIVEREF(__pyx_t_6);
14136 __Pyx_XGIVEREF(__pyx_t_7);
14137 __Pyx_XGIVEREF(__pyx_t_8);
14138 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14139 goto __pyx_L1_error;
14140 __pyx_L8_try_return:;
14141 __Pyx_XGIVEREF(__pyx_t_6);
14142 __Pyx_XGIVEREF(__pyx_t_7);
14143 __Pyx_XGIVEREF(__pyx_t_8);
14144 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14146 __pyx_L7_except_return:;
14147 __Pyx_XGIVEREF(__pyx_t_6);
14148 __Pyx_XGIVEREF(__pyx_t_7);
14149 __Pyx_XGIVEREF(__pyx_t_8);
14150 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14165 __Pyx_XDECREF(__pyx_t_3);
14166 __Pyx_XDECREF(__pyx_t_5);
14167 __Pyx_XDECREF(__pyx_t_9);
14168 __Pyx_XDECREF(__pyx_t_10);
14169 __Pyx_XDECREF(__pyx_t_11);
14170 __Pyx_AddTraceback(
"PyClical.log", __pyx_clineno, __pyx_lineno, __pyx_filename);
14173 __Pyx_XGIVEREF(__pyx_r);
14174 __Pyx_RefNannyFinishContext();
14179 static PyObject *__pyx_pw_8PyClical_49log(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14180 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 ";
14181 static PyObject *__pyx_pw_8PyClical_49log(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14182 PyObject *__pyx_v_obj = 0;
14183 PyObject *__pyx_v_i = 0;
14184 PyObject *__pyx_r = 0;
14185 __Pyx_RefNannyDeclarations
14186 __Pyx_RefNannySetupContext(
"log (wrapper)", 0);
14188 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
14189 PyObject* values[2] = {0,0};
14190 values[1] = ((PyObject *)Py_None);
14191 if (unlikely(__pyx_kwds)) {
14192 Py_ssize_t kw_args;
14193 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14194 switch (pos_args) {
14195 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14196 CYTHON_FALLTHROUGH;
14197 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14198 CYTHON_FALLTHROUGH;
14200 default:
goto __pyx_L5_argtuple_error;
14202 kw_args = PyDict_Size(__pyx_kwds);
14203 switch (pos_args) {
14205 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
14206 else goto __pyx_L5_argtuple_error;
14207 CYTHON_FALLTHROUGH;
14210 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i);
14211 if (value) { values[1] = value; kw_args--; }
14214 if (unlikely(kw_args > 0)) {
14215 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"log") < 0)) __PYX_ERR(0, 1579, __pyx_L3_error)
14218 switch (PyTuple_GET_SIZE(__pyx_args)) {
14219 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14220 CYTHON_FALLTHROUGH;
14221 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14223 default:
goto __pyx_L5_argtuple_error;
14226 __pyx_v_obj = values[0];
14227 __pyx_v_i = values[1];
14229 goto __pyx_L4_argument_unpacking_done;
14230 __pyx_L5_argtuple_error:;
14231 __Pyx_RaiseArgtupleInvalid(
"log", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1579, __pyx_L3_error)
14233 __Pyx_AddTraceback(
"PyClical.log", __pyx_clineno, __pyx_lineno, __pyx_filename);
14234 __Pyx_RefNannyFinishContext();
14236 __pyx_L4_argument_unpacking_done:;
14237 __pyx_r = __pyx_pf_8PyClical_48log(__pyx_self, __pyx_v_obj, __pyx_v_i);
14240 __Pyx_RefNannyFinishContext();
14244 static PyObject *__pyx_pf_8PyClical_48log(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
14245 PyObject *__pyx_r = NULL;
14246 __Pyx_RefNannyDeclarations
14247 PyObject *__pyx_t_1 = NULL;
14248 struct __pyx_opt_args_8PyClical_log __pyx_t_2;
14249 __Pyx_RefNannySetupContext(
"log", 0);
14250 __Pyx_XDECREF(__pyx_r);
14251 __pyx_t_2.__pyx_n = 1;
14252 __pyx_t_2.i = __pyx_v_i;
14253 __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)
14254 __Pyx_GOTREF(__pyx_t_1);
14255 __pyx_r = __pyx_t_1;
14261 __Pyx_XDECREF(__pyx_t_1);
14262 __Pyx_AddTraceback(
"PyClical.log", __pyx_clineno, __pyx_lineno, __pyx_filename);
14265 __Pyx_XGIVEREF(__pyx_r);
14266 __Pyx_RefNannyFinishContext();
14278 static PyObject *__pyx_pw_8PyClical_51cos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14279 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) {
14280 PyObject *__pyx_v_i = ((PyObject *)Py_None);
14281 PyObject *__pyx_r = NULL;
14282 __Pyx_RefNannyDeclarations
14285 PyObject *__pyx_t_3 = NULL;
14287 PyObject *__pyx_t_5 = NULL;
14288 PyObject *__pyx_t_6 = NULL;
14289 PyObject *__pyx_t_7 = NULL;
14290 PyObject *__pyx_t_8 = NULL;
14291 PyObject *__pyx_t_9 = NULL;
14292 PyObject *__pyx_t_10 = NULL;
14293 PyObject *__pyx_t_11 = NULL;
14294 __Pyx_RefNannySetupContext(
"cos", 0);
14295 if (__pyx_optional_args) {
14296 if (__pyx_optional_args->__pyx_n > 0) {
14297 __pyx_v_i = __pyx_optional_args->i;
14308 __pyx_t_1 = (__pyx_v_i != Py_None);
14309 __pyx_t_2 = (__pyx_t_1 != 0);
14319 __Pyx_XDECREF(__pyx_r);
14320 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1612, __pyx_L1_error)
14321 __Pyx_GOTREF(__pyx_t_3);
14323 __pyx_t_4 =
cos(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
14325 __Pyx_CppExn2PyErr();
14326 __PYX_ERR(0, 1612, __pyx_L1_error)
14328 __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)
14329 __Pyx_GOTREF(__pyx_t_5);
14330 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14331 __pyx_r = __pyx_t_5;
14353 __Pyx_PyThreadState_declare
14354 __Pyx_PyThreadState_assign
14355 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
14356 __Pyx_XGOTREF(__pyx_t_6);
14357 __Pyx_XGOTREF(__pyx_t_7);
14358 __Pyx_XGOTREF(__pyx_t_8);
14368 __Pyx_XDECREF(__pyx_r);
14369 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1615, __pyx_L4_error)
14370 __Pyx_GOTREF(__pyx_t_3);
14371 __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)
14372 __Pyx_GOTREF(__pyx_t_9);
14373 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14375 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
14376 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
14377 if (likely(__pyx_t_3)) {
14378 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
14379 __Pyx_INCREF(__pyx_t_3);
14380 __Pyx_INCREF(
function);
14381 __Pyx_DECREF_SET(__pyx_t_9,
function);
14385 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1615, __pyx_L4_error)
14386 __Pyx_GOTREF(__pyx_t_5);
14388 #if CYTHON_FAST_PYCALL 14389 if (PyFunction_Check(__pyx_t_9)) {
14390 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
14391 __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1615, __pyx_L4_error)
14392 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14393 __Pyx_GOTREF(__pyx_t_5);
14396 #if CYTHON_FAST_PYCCALL 14397 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
14398 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
14399 __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1615, __pyx_L4_error)
14400 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14401 __Pyx_GOTREF(__pyx_t_5);
14405 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1615, __pyx_L4_error)
14406 __Pyx_GOTREF(__pyx_t_10);
14407 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
14408 __Pyx_INCREF(__pyx_v_obj);
14409 __Pyx_GIVEREF(__pyx_v_obj);
14410 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
14411 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1615, __pyx_L4_error)
14412 __Pyx_GOTREF(__pyx_t_5);
14413 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14416 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14417 __pyx_r = __pyx_t_5;
14419 goto __pyx_L8_try_return;
14430 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14431 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
14432 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
14433 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14443 __Pyx_AddTraceback(
"PyClical.cos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14444 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1616, __pyx_L6_except_error)
14445 __Pyx_GOTREF(__pyx_t_5);
14446 __Pyx_GOTREF(__pyx_t_9);
14447 __Pyx_GOTREF(__pyx_t_10);
14456 __Pyx_XDECREF(__pyx_r);
14457 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1617, __pyx_L6_except_error)
14458 __Pyx_GOTREF(__pyx_t_3);
14459 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_3),
cos(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1617, __pyx_L6_except_error)
14460 __Pyx_GOTREF(__pyx_t_11);
14461 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14462 __pyx_r = __pyx_t_11;
14464 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14465 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14466 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14467 goto __pyx_L7_except_return;
14469 __pyx_L6_except_error:;
14478 __Pyx_XGIVEREF(__pyx_t_6);
14479 __Pyx_XGIVEREF(__pyx_t_7);
14480 __Pyx_XGIVEREF(__pyx_t_8);
14481 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14482 goto __pyx_L1_error;
14483 __pyx_L8_try_return:;
14484 __Pyx_XGIVEREF(__pyx_t_6);
14485 __Pyx_XGIVEREF(__pyx_t_7);
14486 __Pyx_XGIVEREF(__pyx_t_8);
14487 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14489 __pyx_L7_except_return:;
14490 __Pyx_XGIVEREF(__pyx_t_6);
14491 __Pyx_XGIVEREF(__pyx_t_7);
14492 __Pyx_XGIVEREF(__pyx_t_8);
14493 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14508 __Pyx_XDECREF(__pyx_t_3);
14509 __Pyx_XDECREF(__pyx_t_5);
14510 __Pyx_XDECREF(__pyx_t_9);
14511 __Pyx_XDECREF(__pyx_t_10);
14512 __Pyx_XDECREF(__pyx_t_11);
14513 __Pyx_AddTraceback(
"PyClical.cos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14516 __Pyx_XGIVEREF(__pyx_r);
14517 __Pyx_RefNannyFinishContext();
14522 static PyObject *__pyx_pw_8PyClical_51cos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14523 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 ";
14524 static PyObject *__pyx_pw_8PyClical_51cos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14525 PyObject *__pyx_v_obj = 0;
14526 PyObject *__pyx_v_i = 0;
14527 PyObject *__pyx_r = 0;
14528 __Pyx_RefNannyDeclarations
14529 __Pyx_RefNannySetupContext(
"cos (wrapper)", 0);
14531 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
14532 PyObject* values[2] = {0,0};
14533 values[1] = ((PyObject *)Py_None);
14534 if (unlikely(__pyx_kwds)) {
14535 Py_ssize_t kw_args;
14536 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14537 switch (pos_args) {
14538 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14539 CYTHON_FALLTHROUGH;
14540 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14541 CYTHON_FALLTHROUGH;
14543 default:
goto __pyx_L5_argtuple_error;
14545 kw_args = PyDict_Size(__pyx_kwds);
14546 switch (pos_args) {
14548 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
14549 else goto __pyx_L5_argtuple_error;
14550 CYTHON_FALLTHROUGH;
14553 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i);
14554 if (value) { values[1] = value; kw_args--; }
14557 if (unlikely(kw_args > 0)) {
14558 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"cos") < 0)) __PYX_ERR(0, 1602, __pyx_L3_error)
14561 switch (PyTuple_GET_SIZE(__pyx_args)) {
14562 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14563 CYTHON_FALLTHROUGH;
14564 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14566 default:
goto __pyx_L5_argtuple_error;
14569 __pyx_v_obj = values[0];
14570 __pyx_v_i = values[1];
14572 goto __pyx_L4_argument_unpacking_done;
14573 __pyx_L5_argtuple_error:;
14574 __Pyx_RaiseArgtupleInvalid(
"cos", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1602, __pyx_L3_error)
14576 __Pyx_AddTraceback(
"PyClical.cos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14577 __Pyx_RefNannyFinishContext();
14579 __pyx_L4_argument_unpacking_done:;
14580 __pyx_r = __pyx_pf_8PyClical_50cos(__pyx_self, __pyx_v_obj, __pyx_v_i);
14583 __Pyx_RefNannyFinishContext();
14587 static PyObject *__pyx_pf_8PyClical_50cos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
14588 PyObject *__pyx_r = NULL;
14589 __Pyx_RefNannyDeclarations
14590 PyObject *__pyx_t_1 = NULL;
14591 struct __pyx_opt_args_8PyClical_cos __pyx_t_2;
14592 __Pyx_RefNannySetupContext(
"cos", 0);
14593 __Pyx_XDECREF(__pyx_r);
14594 __pyx_t_2.__pyx_n = 1;
14595 __pyx_t_2.i = __pyx_v_i;
14596 __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)
14597 __Pyx_GOTREF(__pyx_t_1);
14598 __pyx_r = __pyx_t_1;
14604 __Pyx_XDECREF(__pyx_t_1);
14605 __Pyx_AddTraceback(
"PyClical.cos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14608 __Pyx_XGIVEREF(__pyx_r);
14609 __Pyx_RefNannyFinishContext();
14621 static PyObject *__pyx_pw_8PyClical_53acos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14622 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) {
14623 PyObject *__pyx_v_i = ((PyObject *)Py_None);
14624 PyObject *__pyx_r = NULL;
14625 __Pyx_RefNannyDeclarations
14628 PyObject *__pyx_t_3 = NULL;
14630 PyObject *__pyx_t_5 = NULL;
14631 PyObject *__pyx_t_6 = NULL;
14632 PyObject *__pyx_t_7 = NULL;
14633 PyObject *__pyx_t_8 = NULL;
14634 PyObject *__pyx_t_9 = NULL;
14635 PyObject *__pyx_t_10 = NULL;
14636 PyObject *__pyx_t_11 = NULL;
14637 __Pyx_RefNannySetupContext(
"acos", 0);
14638 if (__pyx_optional_args) {
14639 if (__pyx_optional_args->__pyx_n > 0) {
14640 __pyx_v_i = __pyx_optional_args->i;
14651 __pyx_t_1 = (__pyx_v_i != Py_None);
14652 __pyx_t_2 = (__pyx_t_1 != 0);
14662 __Pyx_XDECREF(__pyx_r);
14663 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1633, __pyx_L1_error)
14664 __Pyx_GOTREF(__pyx_t_3);
14666 __pyx_t_4 =
acos(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
14668 __Pyx_CppExn2PyErr();
14669 __PYX_ERR(0, 1633, __pyx_L1_error)
14671 __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)
14672 __Pyx_GOTREF(__pyx_t_5);
14673 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14674 __pyx_r = __pyx_t_5;
14696 __Pyx_PyThreadState_declare
14697 __Pyx_PyThreadState_assign
14698 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
14699 __Pyx_XGOTREF(__pyx_t_6);
14700 __Pyx_XGOTREF(__pyx_t_7);
14701 __Pyx_XGOTREF(__pyx_t_8);
14711 __Pyx_XDECREF(__pyx_r);
14712 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1636, __pyx_L4_error)
14713 __Pyx_GOTREF(__pyx_t_3);
14714 __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)
14715 __Pyx_GOTREF(__pyx_t_9);
14716 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14718 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
14719 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
14720 if (likely(__pyx_t_3)) {
14721 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
14722 __Pyx_INCREF(__pyx_t_3);
14723 __Pyx_INCREF(
function);
14724 __Pyx_DECREF_SET(__pyx_t_9,
function);
14728 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1636, __pyx_L4_error)
14729 __Pyx_GOTREF(__pyx_t_5);
14731 #if CYTHON_FAST_PYCALL 14732 if (PyFunction_Check(__pyx_t_9)) {
14733 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
14734 __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1636, __pyx_L4_error)
14735 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14736 __Pyx_GOTREF(__pyx_t_5);
14739 #if CYTHON_FAST_PYCCALL 14740 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
14741 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
14742 __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1636, __pyx_L4_error)
14743 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14744 __Pyx_GOTREF(__pyx_t_5);
14748 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1636, __pyx_L4_error)
14749 __Pyx_GOTREF(__pyx_t_10);
14750 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
14751 __Pyx_INCREF(__pyx_v_obj);
14752 __Pyx_GIVEREF(__pyx_v_obj);
14753 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
14754 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1636, __pyx_L4_error)
14755 __Pyx_GOTREF(__pyx_t_5);
14756 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14759 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14760 __pyx_r = __pyx_t_5;
14762 goto __pyx_L8_try_return;
14773 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14774 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
14775 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
14776 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14786 __Pyx_AddTraceback(
"PyClical.acos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14787 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1637, __pyx_L6_except_error)
14788 __Pyx_GOTREF(__pyx_t_5);
14789 __Pyx_GOTREF(__pyx_t_9);
14790 __Pyx_GOTREF(__pyx_t_10);
14799 __Pyx_XDECREF(__pyx_r);
14800 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1638, __pyx_L6_except_error)
14801 __Pyx_GOTREF(__pyx_t_3);
14802 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_3),
acos(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1638, __pyx_L6_except_error)
14803 __Pyx_GOTREF(__pyx_t_11);
14804 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14805 __pyx_r = __pyx_t_11;
14807 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14808 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14809 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14810 goto __pyx_L7_except_return;
14812 __pyx_L6_except_error:;
14821 __Pyx_XGIVEREF(__pyx_t_6);
14822 __Pyx_XGIVEREF(__pyx_t_7);
14823 __Pyx_XGIVEREF(__pyx_t_8);
14824 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14825 goto __pyx_L1_error;
14826 __pyx_L8_try_return:;
14827 __Pyx_XGIVEREF(__pyx_t_6);
14828 __Pyx_XGIVEREF(__pyx_t_7);
14829 __Pyx_XGIVEREF(__pyx_t_8);
14830 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14832 __pyx_L7_except_return:;
14833 __Pyx_XGIVEREF(__pyx_t_6);
14834 __Pyx_XGIVEREF(__pyx_t_7);
14835 __Pyx_XGIVEREF(__pyx_t_8);
14836 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14851 __Pyx_XDECREF(__pyx_t_3);
14852 __Pyx_XDECREF(__pyx_t_5);
14853 __Pyx_XDECREF(__pyx_t_9);
14854 __Pyx_XDECREF(__pyx_t_10);
14855 __Pyx_XDECREF(__pyx_t_11);
14856 __Pyx_AddTraceback(
"PyClical.acos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14859 __Pyx_XGIVEREF(__pyx_r);
14860 __Pyx_RefNannyFinishContext();
14865 static PyObject *__pyx_pw_8PyClical_53acos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14866 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 ";
14867 static PyObject *__pyx_pw_8PyClical_53acos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14868 PyObject *__pyx_v_obj = 0;
14869 PyObject *__pyx_v_i = 0;
14870 PyObject *__pyx_r = 0;
14871 __Pyx_RefNannyDeclarations
14872 __Pyx_RefNannySetupContext(
"acos (wrapper)", 0);
14874 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
14875 PyObject* values[2] = {0,0};
14876 values[1] = ((PyObject *)Py_None);
14877 if (unlikely(__pyx_kwds)) {
14878 Py_ssize_t kw_args;
14879 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14880 switch (pos_args) {
14881 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14882 CYTHON_FALLTHROUGH;
14883 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14884 CYTHON_FALLTHROUGH;
14886 default:
goto __pyx_L5_argtuple_error;
14888 kw_args = PyDict_Size(__pyx_kwds);
14889 switch (pos_args) {
14891 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
14892 else goto __pyx_L5_argtuple_error;
14893 CYTHON_FALLTHROUGH;
14896 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i);
14897 if (value) { values[1] = value; kw_args--; }
14900 if (unlikely(kw_args > 0)) {
14901 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"acos") < 0)) __PYX_ERR(0, 1619, __pyx_L3_error)
14904 switch (PyTuple_GET_SIZE(__pyx_args)) {
14905 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14906 CYTHON_FALLTHROUGH;
14907 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14909 default:
goto __pyx_L5_argtuple_error;
14912 __pyx_v_obj = values[0];
14913 __pyx_v_i = values[1];
14915 goto __pyx_L4_argument_unpacking_done;
14916 __pyx_L5_argtuple_error:;
14917 __Pyx_RaiseArgtupleInvalid(
"acos", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1619, __pyx_L3_error)
14919 __Pyx_AddTraceback(
"PyClical.acos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14920 __Pyx_RefNannyFinishContext();
14922 __pyx_L4_argument_unpacking_done:;
14923 __pyx_r = __pyx_pf_8PyClical_52acos(__pyx_self, __pyx_v_obj, __pyx_v_i);
14926 __Pyx_RefNannyFinishContext();
14930 static PyObject *__pyx_pf_8PyClical_52acos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
14931 PyObject *__pyx_r = NULL;
14932 __Pyx_RefNannyDeclarations
14933 PyObject *__pyx_t_1 = NULL;
14934 struct __pyx_opt_args_8PyClical_acos __pyx_t_2;
14935 __Pyx_RefNannySetupContext(
"acos", 0);
14936 __Pyx_XDECREF(__pyx_r);
14937 __pyx_t_2.__pyx_n = 1;
14938 __pyx_t_2.i = __pyx_v_i;
14939 __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)
14940 __Pyx_GOTREF(__pyx_t_1);
14941 __pyx_r = __pyx_t_1;
14947 __Pyx_XDECREF(__pyx_t_1);
14948 __Pyx_AddTraceback(
"PyClical.acos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14951 __Pyx_XGIVEREF(__pyx_r);
14952 __Pyx_RefNannyFinishContext();
14964 static PyObject *__pyx_pw_8PyClical_55cosh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
14965 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cosh(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
14966 PyObject *__pyx_r = NULL;
14967 __Pyx_RefNannyDeclarations
14968 PyObject *__pyx_t_1 = NULL;
14969 PyObject *__pyx_t_2 = NULL;
14970 PyObject *__pyx_t_3 = NULL;
14971 PyObject *__pyx_t_4 = NULL;
14972 PyObject *__pyx_t_5 = NULL;
14973 PyObject *__pyx_t_6 = NULL;
14974 PyObject *__pyx_t_7 = NULL;
14975 PyObject *__pyx_t_8 = NULL;
14976 __Pyx_RefNannySetupContext(
"cosh", 0);
14986 __Pyx_PyThreadState_declare
14987 __Pyx_PyThreadState_assign
14988 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
14989 __Pyx_XGOTREF(__pyx_t_1);
14990 __Pyx_XGOTREF(__pyx_t_2);
14991 __Pyx_XGOTREF(__pyx_t_3);
15001 __Pyx_XDECREF(__pyx_r);
15002 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1652, __pyx_L3_error)
15003 __Pyx_GOTREF(__pyx_t_5);
15004 __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)
15005 __Pyx_GOTREF(__pyx_t_6);
15006 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15008 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
15009 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
15010 if (likely(__pyx_t_5)) {
15011 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
15012 __Pyx_INCREF(__pyx_t_5);
15013 __Pyx_INCREF(
function);
15014 __Pyx_DECREF_SET(__pyx_t_6,
function);
15018 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_obj);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1652, __pyx_L3_error)
15019 __Pyx_GOTREF(__pyx_t_4);
15021 #if CYTHON_FAST_PYCALL 15022 if (PyFunction_Check(__pyx_t_6)) {
15023 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_obj};
15024 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1652, __pyx_L3_error)
15025 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15026 __Pyx_GOTREF(__pyx_t_4);
15029 #if CYTHON_FAST_PYCCALL 15030 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
15031 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_obj};
15032 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1652, __pyx_L3_error)
15033 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15034 __Pyx_GOTREF(__pyx_t_4);
15038 __pyx_t_7 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1652, __pyx_L3_error)
15039 __Pyx_GOTREF(__pyx_t_7);
15040 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
15041 __Pyx_INCREF(__pyx_v_obj);
15042 __Pyx_GIVEREF(__pyx_v_obj);
15043 PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_obj);
15044 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1652, __pyx_L3_error)
15045 __Pyx_GOTREF(__pyx_t_4);
15046 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15049 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15050 __pyx_r = __pyx_t_4;
15052 goto __pyx_L7_try_return;
15063 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15064 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
15065 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
15066 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
15076 __Pyx_AddTraceback(
"PyClical.cosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15077 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1653, __pyx_L5_except_error)
15078 __Pyx_GOTREF(__pyx_t_4);
15079 __Pyx_GOTREF(__pyx_t_6);
15080 __Pyx_GOTREF(__pyx_t_7);
15089 __Pyx_XDECREF(__pyx_r);
15090 __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1654, __pyx_L5_except_error)
15091 __Pyx_GOTREF(__pyx_t_5);
15092 __pyx_t_8 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_5),
cosh(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1654, __pyx_L5_except_error)
15093 __Pyx_GOTREF(__pyx_t_8);
15094 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15095 __pyx_r = __pyx_t_8;
15097 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15098 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15099 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15100 goto __pyx_L6_except_return;
15102 __pyx_L5_except_error:;
15111 __Pyx_XGIVEREF(__pyx_t_1);
15112 __Pyx_XGIVEREF(__pyx_t_2);
15113 __Pyx_XGIVEREF(__pyx_t_3);
15114 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
15115 goto __pyx_L1_error;
15116 __pyx_L7_try_return:;
15117 __Pyx_XGIVEREF(__pyx_t_1);
15118 __Pyx_XGIVEREF(__pyx_t_2);
15119 __Pyx_XGIVEREF(__pyx_t_3);
15120 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
15122 __pyx_L6_except_return:;
15123 __Pyx_XGIVEREF(__pyx_t_1);
15124 __Pyx_XGIVEREF(__pyx_t_2);
15125 __Pyx_XGIVEREF(__pyx_t_3);
15126 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
15140 __Pyx_XDECREF(__pyx_t_4);
15141 __Pyx_XDECREF(__pyx_t_5);
15142 __Pyx_XDECREF(__pyx_t_6);
15143 __Pyx_XDECREF(__pyx_t_7);
15144 __Pyx_XDECREF(__pyx_t_8);
15145 __Pyx_AddTraceback(
"PyClical.cosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15148 __Pyx_XGIVEREF(__pyx_r);
15149 __Pyx_RefNannyFinishContext();
15154 static PyObject *__pyx_pw_8PyClical_55cosh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
15155 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 ";
15156 static PyObject *__pyx_pw_8PyClical_55cosh(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
15157 PyObject *__pyx_r = 0;
15158 __Pyx_RefNannyDeclarations
15159 __Pyx_RefNannySetupContext(
"cosh (wrapper)", 0);
15160 __pyx_r = __pyx_pf_8PyClical_54cosh(__pyx_self, ((PyObject *)__pyx_v_obj));
15163 __Pyx_RefNannyFinishContext();
15167 static PyObject *__pyx_pf_8PyClical_54cosh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
15168 PyObject *__pyx_r = NULL;
15169 __Pyx_RefNannyDeclarations
15170 PyObject *__pyx_t_1 = NULL;
15171 __Pyx_RefNannySetupContext(
"cosh", 0);
15172 __Pyx_XDECREF(__pyx_r);
15173 __pyx_t_1 = __pyx_f_8PyClical_cosh(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1640, __pyx_L1_error)
15174 __Pyx_GOTREF(__pyx_t_1);
15175 __pyx_r = __pyx_t_1;
15181 __Pyx_XDECREF(__pyx_t_1);
15182 __Pyx_AddTraceback(
"PyClical.cosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15185 __Pyx_XGIVEREF(__pyx_r);
15186 __Pyx_RefNannyFinishContext();
15198 static PyObject *__pyx_pw_8PyClical_57acosh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15199 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) {
15200 PyObject *__pyx_v_i = ((PyObject *)Py_None);
15201 PyObject *__pyx_r = NULL;
15202 __Pyx_RefNannyDeclarations
15205 PyObject *__pyx_t_3 = NULL;
15207 PyObject *__pyx_t_5 = NULL;
15208 PyObject *__pyx_t_6 = NULL;
15209 PyObject *__pyx_t_7 = NULL;
15210 PyObject *__pyx_t_8 = NULL;
15211 PyObject *__pyx_t_9 = NULL;
15212 PyObject *__pyx_t_10 = NULL;
15213 PyObject *__pyx_t_11 = NULL;
15214 __Pyx_RefNannySetupContext(
"acosh", 0);
15215 if (__pyx_optional_args) {
15216 if (__pyx_optional_args->__pyx_n > 0) {
15217 __pyx_v_i = __pyx_optional_args->i;
15228 __pyx_t_1 = (__pyx_v_i != Py_None);
15229 __pyx_t_2 = (__pyx_t_1 != 0);
15239 __Pyx_XDECREF(__pyx_r);
15240 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1672, __pyx_L1_error)
15241 __Pyx_GOTREF(__pyx_t_3);
15243 __pyx_t_4 =
acosh(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
15245 __Pyx_CppExn2PyErr();
15246 __PYX_ERR(0, 1672, __pyx_L1_error)
15248 __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)
15249 __Pyx_GOTREF(__pyx_t_5);
15250 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15251 __pyx_r = __pyx_t_5;
15273 __Pyx_PyThreadState_declare
15274 __Pyx_PyThreadState_assign
15275 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
15276 __Pyx_XGOTREF(__pyx_t_6);
15277 __Pyx_XGOTREF(__pyx_t_7);
15278 __Pyx_XGOTREF(__pyx_t_8);
15288 __Pyx_XDECREF(__pyx_r);
15289 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1675, __pyx_L4_error)
15290 __Pyx_GOTREF(__pyx_t_3);
15291 __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)
15292 __Pyx_GOTREF(__pyx_t_9);
15293 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15295 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
15296 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
15297 if (likely(__pyx_t_3)) {
15298 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
15299 __Pyx_INCREF(__pyx_t_3);
15300 __Pyx_INCREF(
function);
15301 __Pyx_DECREF_SET(__pyx_t_9,
function);
15305 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1675, __pyx_L4_error)
15306 __Pyx_GOTREF(__pyx_t_5);
15308 #if CYTHON_FAST_PYCALL 15309 if (PyFunction_Check(__pyx_t_9)) {
15310 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
15311 __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1675, __pyx_L4_error)
15312 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15313 __Pyx_GOTREF(__pyx_t_5);
15316 #if CYTHON_FAST_PYCCALL 15317 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
15318 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
15319 __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1675, __pyx_L4_error)
15320 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15321 __Pyx_GOTREF(__pyx_t_5);
15325 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1675, __pyx_L4_error)
15326 __Pyx_GOTREF(__pyx_t_10);
15327 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
15328 __Pyx_INCREF(__pyx_v_obj);
15329 __Pyx_GIVEREF(__pyx_v_obj);
15330 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
15331 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1675, __pyx_L4_error)
15332 __Pyx_GOTREF(__pyx_t_5);
15333 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15336 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15337 __pyx_r = __pyx_t_5;
15339 goto __pyx_L8_try_return;
15350 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15351 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
15352 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
15353 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15363 __Pyx_AddTraceback(
"PyClical.acosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15364 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1676, __pyx_L6_except_error)
15365 __Pyx_GOTREF(__pyx_t_5);
15366 __Pyx_GOTREF(__pyx_t_9);
15367 __Pyx_GOTREF(__pyx_t_10);
15376 __Pyx_XDECREF(__pyx_r);
15377 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1677, __pyx_L6_except_error)
15378 __Pyx_GOTREF(__pyx_t_3);
15379 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_3),
acosh(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1677, __pyx_L6_except_error)
15380 __Pyx_GOTREF(__pyx_t_11);
15381 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15382 __pyx_r = __pyx_t_11;
15384 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15385 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15386 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15387 goto __pyx_L7_except_return;
15389 __pyx_L6_except_error:;
15398 __Pyx_XGIVEREF(__pyx_t_6);
15399 __Pyx_XGIVEREF(__pyx_t_7);
15400 __Pyx_XGIVEREF(__pyx_t_8);
15401 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15402 goto __pyx_L1_error;
15403 __pyx_L8_try_return:;
15404 __Pyx_XGIVEREF(__pyx_t_6);
15405 __Pyx_XGIVEREF(__pyx_t_7);
15406 __Pyx_XGIVEREF(__pyx_t_8);
15407 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15409 __pyx_L7_except_return:;
15410 __Pyx_XGIVEREF(__pyx_t_6);
15411 __Pyx_XGIVEREF(__pyx_t_7);
15412 __Pyx_XGIVEREF(__pyx_t_8);
15413 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15428 __Pyx_XDECREF(__pyx_t_3);
15429 __Pyx_XDECREF(__pyx_t_5);
15430 __Pyx_XDECREF(__pyx_t_9);
15431 __Pyx_XDECREF(__pyx_t_10);
15432 __Pyx_XDECREF(__pyx_t_11);
15433 __Pyx_AddTraceback(
"PyClical.acosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15436 __Pyx_XGIVEREF(__pyx_r);
15437 __Pyx_RefNannyFinishContext();
15442 static PyObject *__pyx_pw_8PyClical_57acosh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15443 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 ";
15444 static PyObject *__pyx_pw_8PyClical_57acosh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15445 PyObject *__pyx_v_obj = 0;
15446 PyObject *__pyx_v_i = 0;
15447 PyObject *__pyx_r = 0;
15448 __Pyx_RefNannyDeclarations
15449 __Pyx_RefNannySetupContext(
"acosh (wrapper)", 0);
15451 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
15452 PyObject* values[2] = {0,0};
15453 values[1] = ((PyObject *)Py_None);
15454 if (unlikely(__pyx_kwds)) {
15455 Py_ssize_t kw_args;
15456 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15457 switch (pos_args) {
15458 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15459 CYTHON_FALLTHROUGH;
15460 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15461 CYTHON_FALLTHROUGH;
15463 default:
goto __pyx_L5_argtuple_error;
15465 kw_args = PyDict_Size(__pyx_kwds);
15466 switch (pos_args) {
15468 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
15469 else goto __pyx_L5_argtuple_error;
15470 CYTHON_FALLTHROUGH;
15473 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i);
15474 if (value) { values[1] = value; kw_args--; }
15477 if (unlikely(kw_args > 0)) {
15478 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"acosh") < 0)) __PYX_ERR(0, 1656, __pyx_L3_error)
15481 switch (PyTuple_GET_SIZE(__pyx_args)) {
15482 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15483 CYTHON_FALLTHROUGH;
15484 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15486 default:
goto __pyx_L5_argtuple_error;
15489 __pyx_v_obj = values[0];
15490 __pyx_v_i = values[1];
15492 goto __pyx_L4_argument_unpacking_done;
15493 __pyx_L5_argtuple_error:;
15494 __Pyx_RaiseArgtupleInvalid(
"acosh", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1656, __pyx_L3_error)
15496 __Pyx_AddTraceback(
"PyClical.acosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15497 __Pyx_RefNannyFinishContext();
15499 __pyx_L4_argument_unpacking_done:;
15500 __pyx_r = __pyx_pf_8PyClical_56acosh(__pyx_self, __pyx_v_obj, __pyx_v_i);
15503 __Pyx_RefNannyFinishContext();
15507 static PyObject *__pyx_pf_8PyClical_56acosh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
15508 PyObject *__pyx_r = NULL;
15509 __Pyx_RefNannyDeclarations
15510 PyObject *__pyx_t_1 = NULL;
15511 struct __pyx_opt_args_8PyClical_acosh __pyx_t_2;
15512 __Pyx_RefNannySetupContext(
"acosh", 0);
15513 __Pyx_XDECREF(__pyx_r);
15514 __pyx_t_2.__pyx_n = 1;
15515 __pyx_t_2.i = __pyx_v_i;
15516 __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)
15517 __Pyx_GOTREF(__pyx_t_1);
15518 __pyx_r = __pyx_t_1;
15524 __Pyx_XDECREF(__pyx_t_1);
15525 __Pyx_AddTraceback(
"PyClical.acosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15528 __Pyx_XGIVEREF(__pyx_r);
15529 __Pyx_RefNannyFinishContext();
15541 static PyObject *__pyx_pw_8PyClical_59sin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15542 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) {
15543 PyObject *__pyx_v_i = ((PyObject *)Py_None);
15544 PyObject *__pyx_r = NULL;
15545 __Pyx_RefNannyDeclarations
15548 PyObject *__pyx_t_3 = NULL;
15550 PyObject *__pyx_t_5 = NULL;
15551 PyObject *__pyx_t_6 = NULL;
15552 PyObject *__pyx_t_7 = NULL;
15553 PyObject *__pyx_t_8 = NULL;
15554 PyObject *__pyx_t_9 = NULL;
15555 PyObject *__pyx_t_10 = NULL;
15556 PyObject *__pyx_t_11 = NULL;
15557 __Pyx_RefNannySetupContext(
"sin", 0);
15558 if (__pyx_optional_args) {
15559 if (__pyx_optional_args->__pyx_n > 0) {
15560 __pyx_v_i = __pyx_optional_args->i;
15571 __pyx_t_1 = (__pyx_v_i != Py_None);
15572 __pyx_t_2 = (__pyx_t_1 != 0);
15582 __Pyx_XDECREF(__pyx_r);
15583 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1691, __pyx_L1_error)
15584 __Pyx_GOTREF(__pyx_t_3);
15586 __pyx_t_4 =
sin(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
15588 __Pyx_CppExn2PyErr();
15589 __PYX_ERR(0, 1691, __pyx_L1_error)
15591 __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)
15592 __Pyx_GOTREF(__pyx_t_5);
15593 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15594 __pyx_r = __pyx_t_5;
15616 __Pyx_PyThreadState_declare
15617 __Pyx_PyThreadState_assign
15618 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
15619 __Pyx_XGOTREF(__pyx_t_6);
15620 __Pyx_XGOTREF(__pyx_t_7);
15621 __Pyx_XGOTREF(__pyx_t_8);
15631 __Pyx_XDECREF(__pyx_r);
15632 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1694, __pyx_L4_error)
15633 __Pyx_GOTREF(__pyx_t_3);
15634 __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)
15635 __Pyx_GOTREF(__pyx_t_9);
15636 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15638 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
15639 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
15640 if (likely(__pyx_t_3)) {
15641 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
15642 __Pyx_INCREF(__pyx_t_3);
15643 __Pyx_INCREF(
function);
15644 __Pyx_DECREF_SET(__pyx_t_9,
function);
15648 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1694, __pyx_L4_error)
15649 __Pyx_GOTREF(__pyx_t_5);
15651 #if CYTHON_FAST_PYCALL 15652 if (PyFunction_Check(__pyx_t_9)) {
15653 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
15654 __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1694, __pyx_L4_error)
15655 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15656 __Pyx_GOTREF(__pyx_t_5);
15659 #if CYTHON_FAST_PYCCALL 15660 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
15661 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
15662 __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1694, __pyx_L4_error)
15663 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15664 __Pyx_GOTREF(__pyx_t_5);
15668 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1694, __pyx_L4_error)
15669 __Pyx_GOTREF(__pyx_t_10);
15670 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
15671 __Pyx_INCREF(__pyx_v_obj);
15672 __Pyx_GIVEREF(__pyx_v_obj);
15673 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
15674 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1694, __pyx_L4_error)
15675 __Pyx_GOTREF(__pyx_t_5);
15676 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15679 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15680 __pyx_r = __pyx_t_5;
15682 goto __pyx_L8_try_return;
15693 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15694 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
15695 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
15696 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15706 __Pyx_AddTraceback(
"PyClical.sin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15707 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1695, __pyx_L6_except_error)
15708 __Pyx_GOTREF(__pyx_t_5);
15709 __Pyx_GOTREF(__pyx_t_9);
15710 __Pyx_GOTREF(__pyx_t_10);
15719 __Pyx_XDECREF(__pyx_r);
15720 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1696, __pyx_L6_except_error)
15721 __Pyx_GOTREF(__pyx_t_3);
15722 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_3),
sin(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1696, __pyx_L6_except_error)
15723 __Pyx_GOTREF(__pyx_t_11);
15724 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15725 __pyx_r = __pyx_t_11;
15727 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15728 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15729 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15730 goto __pyx_L7_except_return;
15732 __pyx_L6_except_error:;
15741 __Pyx_XGIVEREF(__pyx_t_6);
15742 __Pyx_XGIVEREF(__pyx_t_7);
15743 __Pyx_XGIVEREF(__pyx_t_8);
15744 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15745 goto __pyx_L1_error;
15746 __pyx_L8_try_return:;
15747 __Pyx_XGIVEREF(__pyx_t_6);
15748 __Pyx_XGIVEREF(__pyx_t_7);
15749 __Pyx_XGIVEREF(__pyx_t_8);
15750 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15752 __pyx_L7_except_return:;
15753 __Pyx_XGIVEREF(__pyx_t_6);
15754 __Pyx_XGIVEREF(__pyx_t_7);
15755 __Pyx_XGIVEREF(__pyx_t_8);
15756 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15771 __Pyx_XDECREF(__pyx_t_3);
15772 __Pyx_XDECREF(__pyx_t_5);
15773 __Pyx_XDECREF(__pyx_t_9);
15774 __Pyx_XDECREF(__pyx_t_10);
15775 __Pyx_XDECREF(__pyx_t_11);
15776 __Pyx_AddTraceback(
"PyClical.sin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15779 __Pyx_XGIVEREF(__pyx_r);
15780 __Pyx_RefNannyFinishContext();
15785 static PyObject *__pyx_pw_8PyClical_59sin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15786 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 ";
15787 static PyObject *__pyx_pw_8PyClical_59sin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15788 PyObject *__pyx_v_obj = 0;
15789 PyObject *__pyx_v_i = 0;
15790 PyObject *__pyx_r = 0;
15791 __Pyx_RefNannyDeclarations
15792 __Pyx_RefNannySetupContext(
"sin (wrapper)", 0);
15794 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
15795 PyObject* values[2] = {0,0};
15796 values[1] = ((PyObject *)Py_None);
15797 if (unlikely(__pyx_kwds)) {
15798 Py_ssize_t kw_args;
15799 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15800 switch (pos_args) {
15801 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15802 CYTHON_FALLTHROUGH;
15803 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15804 CYTHON_FALLTHROUGH;
15806 default:
goto __pyx_L5_argtuple_error;
15808 kw_args = PyDict_Size(__pyx_kwds);
15809 switch (pos_args) {
15811 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
15812 else goto __pyx_L5_argtuple_error;
15813 CYTHON_FALLTHROUGH;
15816 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i);
15817 if (value) { values[1] = value; kw_args--; }
15820 if (unlikely(kw_args > 0)) {
15821 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"sin") < 0)) __PYX_ERR(0, 1679, __pyx_L3_error)
15824 switch (PyTuple_GET_SIZE(__pyx_args)) {
15825 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15826 CYTHON_FALLTHROUGH;
15827 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15829 default:
goto __pyx_L5_argtuple_error;
15832 __pyx_v_obj = values[0];
15833 __pyx_v_i = values[1];
15835 goto __pyx_L4_argument_unpacking_done;
15836 __pyx_L5_argtuple_error:;
15837 __Pyx_RaiseArgtupleInvalid(
"sin", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1679, __pyx_L3_error)
15839 __Pyx_AddTraceback(
"PyClical.sin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15840 __Pyx_RefNannyFinishContext();
15842 __pyx_L4_argument_unpacking_done:;
15843 __pyx_r = __pyx_pf_8PyClical_58sin(__pyx_self, __pyx_v_obj, __pyx_v_i);
15846 __Pyx_RefNannyFinishContext();
15850 static PyObject *__pyx_pf_8PyClical_58sin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
15851 PyObject *__pyx_r = NULL;
15852 __Pyx_RefNannyDeclarations
15853 PyObject *__pyx_t_1 = NULL;
15854 struct __pyx_opt_args_8PyClical_sin __pyx_t_2;
15855 __Pyx_RefNannySetupContext(
"sin", 0);
15856 __Pyx_XDECREF(__pyx_r);
15857 __pyx_t_2.__pyx_n = 1;
15858 __pyx_t_2.i = __pyx_v_i;
15859 __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)
15860 __Pyx_GOTREF(__pyx_t_1);
15861 __pyx_r = __pyx_t_1;
15867 __Pyx_XDECREF(__pyx_t_1);
15868 __Pyx_AddTraceback(
"PyClical.sin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15871 __Pyx_XGIVEREF(__pyx_r);
15872 __Pyx_RefNannyFinishContext();
15884 static PyObject *__pyx_pw_8PyClical_61asin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15885 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) {
15886 PyObject *__pyx_v_i = ((PyObject *)Py_None);
15887 PyObject *__pyx_r = NULL;
15888 __Pyx_RefNannyDeclarations
15891 PyObject *__pyx_t_3 = NULL;
15893 PyObject *__pyx_t_5 = NULL;
15894 PyObject *__pyx_t_6 = NULL;
15895 PyObject *__pyx_t_7 = NULL;
15896 PyObject *__pyx_t_8 = NULL;
15897 PyObject *__pyx_t_9 = NULL;
15898 PyObject *__pyx_t_10 = NULL;
15899 PyObject *__pyx_t_11 = NULL;
15900 __Pyx_RefNannySetupContext(
"asin", 0);
15901 if (__pyx_optional_args) {
15902 if (__pyx_optional_args->__pyx_n > 0) {
15903 __pyx_v_i = __pyx_optional_args->i;
15914 __pyx_t_1 = (__pyx_v_i != Py_None);
15915 __pyx_t_2 = (__pyx_t_1 != 0);
15925 __Pyx_XDECREF(__pyx_r);
15926 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1712, __pyx_L1_error)
15927 __Pyx_GOTREF(__pyx_t_3);
15929 __pyx_t_4 =
asin(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
15931 __Pyx_CppExn2PyErr();
15932 __PYX_ERR(0, 1712, __pyx_L1_error)
15934 __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)
15935 __Pyx_GOTREF(__pyx_t_5);
15936 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15937 __pyx_r = __pyx_t_5;
15959 __Pyx_PyThreadState_declare
15960 __Pyx_PyThreadState_assign
15961 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
15962 __Pyx_XGOTREF(__pyx_t_6);
15963 __Pyx_XGOTREF(__pyx_t_7);
15964 __Pyx_XGOTREF(__pyx_t_8);
15974 __Pyx_XDECREF(__pyx_r);
15975 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1715, __pyx_L4_error)
15976 __Pyx_GOTREF(__pyx_t_3);
15977 __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)
15978 __Pyx_GOTREF(__pyx_t_9);
15979 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15981 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
15982 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
15983 if (likely(__pyx_t_3)) {
15984 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
15985 __Pyx_INCREF(__pyx_t_3);
15986 __Pyx_INCREF(
function);
15987 __Pyx_DECREF_SET(__pyx_t_9,
function);
15991 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1715, __pyx_L4_error)
15992 __Pyx_GOTREF(__pyx_t_5);
15994 #if CYTHON_FAST_PYCALL 15995 if (PyFunction_Check(__pyx_t_9)) {
15996 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
15997 __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1715, __pyx_L4_error)
15998 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15999 __Pyx_GOTREF(__pyx_t_5);
16002 #if CYTHON_FAST_PYCCALL 16003 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
16004 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
16005 __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1715, __pyx_L4_error)
16006 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16007 __Pyx_GOTREF(__pyx_t_5);
16011 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1715, __pyx_L4_error)
16012 __Pyx_GOTREF(__pyx_t_10);
16013 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
16014 __Pyx_INCREF(__pyx_v_obj);
16015 __Pyx_GIVEREF(__pyx_v_obj);
16016 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
16017 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1715, __pyx_L4_error)
16018 __Pyx_GOTREF(__pyx_t_5);
16019 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16022 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16023 __pyx_r = __pyx_t_5;
16025 goto __pyx_L8_try_return;
16036 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16037 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
16038 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
16039 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16049 __Pyx_AddTraceback(
"PyClical.asin", __pyx_clineno, __pyx_lineno, __pyx_filename);
16050 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1716, __pyx_L6_except_error)
16051 __Pyx_GOTREF(__pyx_t_5);
16052 __Pyx_GOTREF(__pyx_t_9);
16053 __Pyx_GOTREF(__pyx_t_10);
16062 __Pyx_XDECREF(__pyx_r);
16063 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1717, __pyx_L6_except_error)
16064 __Pyx_GOTREF(__pyx_t_3);
16065 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_3),
asin(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1717, __pyx_L6_except_error)
16066 __Pyx_GOTREF(__pyx_t_11);
16067 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16068 __pyx_r = __pyx_t_11;
16070 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16071 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16072 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16073 goto __pyx_L7_except_return;
16075 __pyx_L6_except_error:;
16084 __Pyx_XGIVEREF(__pyx_t_6);
16085 __Pyx_XGIVEREF(__pyx_t_7);
16086 __Pyx_XGIVEREF(__pyx_t_8);
16087 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16088 goto __pyx_L1_error;
16089 __pyx_L8_try_return:;
16090 __Pyx_XGIVEREF(__pyx_t_6);
16091 __Pyx_XGIVEREF(__pyx_t_7);
16092 __Pyx_XGIVEREF(__pyx_t_8);
16093 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16095 __pyx_L7_except_return:;
16096 __Pyx_XGIVEREF(__pyx_t_6);
16097 __Pyx_XGIVEREF(__pyx_t_7);
16098 __Pyx_XGIVEREF(__pyx_t_8);
16099 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16114 __Pyx_XDECREF(__pyx_t_3);
16115 __Pyx_XDECREF(__pyx_t_5);
16116 __Pyx_XDECREF(__pyx_t_9);
16117 __Pyx_XDECREF(__pyx_t_10);
16118 __Pyx_XDECREF(__pyx_t_11);
16119 __Pyx_AddTraceback(
"PyClical.asin", __pyx_clineno, __pyx_lineno, __pyx_filename);
16122 __Pyx_XGIVEREF(__pyx_r);
16123 __Pyx_RefNannyFinishContext();
16128 static PyObject *__pyx_pw_8PyClical_61asin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16129 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 ";
16130 static PyObject *__pyx_pw_8PyClical_61asin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16131 PyObject *__pyx_v_obj = 0;
16132 PyObject *__pyx_v_i = 0;
16133 PyObject *__pyx_r = 0;
16134 __Pyx_RefNannyDeclarations
16135 __Pyx_RefNannySetupContext(
"asin (wrapper)", 0);
16137 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
16138 PyObject* values[2] = {0,0};
16139 values[1] = ((PyObject *)Py_None);
16140 if (unlikely(__pyx_kwds)) {
16141 Py_ssize_t kw_args;
16142 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16143 switch (pos_args) {
16144 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16145 CYTHON_FALLTHROUGH;
16146 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16147 CYTHON_FALLTHROUGH;
16149 default:
goto __pyx_L5_argtuple_error;
16151 kw_args = PyDict_Size(__pyx_kwds);
16152 switch (pos_args) {
16154 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
16155 else goto __pyx_L5_argtuple_error;
16156 CYTHON_FALLTHROUGH;
16159 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i);
16160 if (value) { values[1] = value; kw_args--; }
16163 if (unlikely(kw_args > 0)) {
16164 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"asin") < 0)) __PYX_ERR(0, 1698, __pyx_L3_error)
16167 switch (PyTuple_GET_SIZE(__pyx_args)) {
16168 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16169 CYTHON_FALLTHROUGH;
16170 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16172 default:
goto __pyx_L5_argtuple_error;
16175 __pyx_v_obj = values[0];
16176 __pyx_v_i = values[1];
16178 goto __pyx_L4_argument_unpacking_done;
16179 __pyx_L5_argtuple_error:;
16180 __Pyx_RaiseArgtupleInvalid(
"asin", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1698, __pyx_L3_error)
16182 __Pyx_AddTraceback(
"PyClical.asin", __pyx_clineno, __pyx_lineno, __pyx_filename);
16183 __Pyx_RefNannyFinishContext();
16185 __pyx_L4_argument_unpacking_done:;
16186 __pyx_r = __pyx_pf_8PyClical_60asin(__pyx_self, __pyx_v_obj, __pyx_v_i);
16189 __Pyx_RefNannyFinishContext();
16193 static PyObject *__pyx_pf_8PyClical_60asin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
16194 PyObject *__pyx_r = NULL;
16195 __Pyx_RefNannyDeclarations
16196 PyObject *__pyx_t_1 = NULL;
16197 struct __pyx_opt_args_8PyClical_asin __pyx_t_2;
16198 __Pyx_RefNannySetupContext(
"asin", 0);
16199 __Pyx_XDECREF(__pyx_r);
16200 __pyx_t_2.__pyx_n = 1;
16201 __pyx_t_2.i = __pyx_v_i;
16202 __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)
16203 __Pyx_GOTREF(__pyx_t_1);
16204 __pyx_r = __pyx_t_1;
16210 __Pyx_XDECREF(__pyx_t_1);
16211 __Pyx_AddTraceback(
"PyClical.asin", __pyx_clineno, __pyx_lineno, __pyx_filename);
16214 __Pyx_XGIVEREF(__pyx_r);
16215 __Pyx_RefNannyFinishContext();
16227 static PyObject *__pyx_pw_8PyClical_63sinh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
16228 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_sinh(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
16229 PyObject *__pyx_r = NULL;
16230 __Pyx_RefNannyDeclarations
16231 PyObject *__pyx_t_1 = NULL;
16232 PyObject *__pyx_t_2 = NULL;
16233 PyObject *__pyx_t_3 = NULL;
16234 PyObject *__pyx_t_4 = NULL;
16235 PyObject *__pyx_t_5 = NULL;
16236 PyObject *__pyx_t_6 = NULL;
16237 PyObject *__pyx_t_7 = NULL;
16238 PyObject *__pyx_t_8 = NULL;
16239 __Pyx_RefNannySetupContext(
"sinh", 0);
16249 __Pyx_PyThreadState_declare
16250 __Pyx_PyThreadState_assign
16251 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
16252 __Pyx_XGOTREF(__pyx_t_1);
16253 __Pyx_XGOTREF(__pyx_t_2);
16254 __Pyx_XGOTREF(__pyx_t_3);
16264 __Pyx_XDECREF(__pyx_r);
16265 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1729, __pyx_L3_error)
16266 __Pyx_GOTREF(__pyx_t_5);
16267 __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)
16268 __Pyx_GOTREF(__pyx_t_6);
16269 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16271 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
16272 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
16273 if (likely(__pyx_t_5)) {
16274 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
16275 __Pyx_INCREF(__pyx_t_5);
16276 __Pyx_INCREF(
function);
16277 __Pyx_DECREF_SET(__pyx_t_6,
function);
16281 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_obj);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1729, __pyx_L3_error)
16282 __Pyx_GOTREF(__pyx_t_4);
16284 #if CYTHON_FAST_PYCALL 16285 if (PyFunction_Check(__pyx_t_6)) {
16286 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_obj};
16287 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1729, __pyx_L3_error)
16288 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16289 __Pyx_GOTREF(__pyx_t_4);
16292 #if CYTHON_FAST_PYCCALL 16293 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
16294 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_obj};
16295 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1729, __pyx_L3_error)
16296 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16297 __Pyx_GOTREF(__pyx_t_4);
16301 __pyx_t_7 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1729, __pyx_L3_error)
16302 __Pyx_GOTREF(__pyx_t_7);
16303 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
16304 __Pyx_INCREF(__pyx_v_obj);
16305 __Pyx_GIVEREF(__pyx_v_obj);
16306 PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_obj);
16307 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1729, __pyx_L3_error)
16308 __Pyx_GOTREF(__pyx_t_4);
16309 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16312 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16313 __pyx_r = __pyx_t_4;
16315 goto __pyx_L7_try_return;
16326 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16327 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
16328 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
16329 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
16339 __Pyx_AddTraceback(
"PyClical.sinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16340 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1730, __pyx_L5_except_error)
16341 __Pyx_GOTREF(__pyx_t_4);
16342 __Pyx_GOTREF(__pyx_t_6);
16343 __Pyx_GOTREF(__pyx_t_7);
16352 __Pyx_XDECREF(__pyx_r);
16353 __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1731, __pyx_L5_except_error)
16354 __Pyx_GOTREF(__pyx_t_5);
16355 __pyx_t_8 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_5),
sinh(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1731, __pyx_L5_except_error)
16356 __Pyx_GOTREF(__pyx_t_8);
16357 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16358 __pyx_r = __pyx_t_8;
16360 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16361 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16362 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16363 goto __pyx_L6_except_return;
16365 __pyx_L5_except_error:;
16374 __Pyx_XGIVEREF(__pyx_t_1);
16375 __Pyx_XGIVEREF(__pyx_t_2);
16376 __Pyx_XGIVEREF(__pyx_t_3);
16377 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
16378 goto __pyx_L1_error;
16379 __pyx_L7_try_return:;
16380 __Pyx_XGIVEREF(__pyx_t_1);
16381 __Pyx_XGIVEREF(__pyx_t_2);
16382 __Pyx_XGIVEREF(__pyx_t_3);
16383 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
16385 __pyx_L6_except_return:;
16386 __Pyx_XGIVEREF(__pyx_t_1);
16387 __Pyx_XGIVEREF(__pyx_t_2);
16388 __Pyx_XGIVEREF(__pyx_t_3);
16389 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
16403 __Pyx_XDECREF(__pyx_t_4);
16404 __Pyx_XDECREF(__pyx_t_5);
16405 __Pyx_XDECREF(__pyx_t_6);
16406 __Pyx_XDECREF(__pyx_t_7);
16407 __Pyx_XDECREF(__pyx_t_8);
16408 __Pyx_AddTraceback(
"PyClical.sinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16411 __Pyx_XGIVEREF(__pyx_r);
16412 __Pyx_RefNannyFinishContext();
16417 static PyObject *__pyx_pw_8PyClical_63sinh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
16418 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 ";
16419 static PyObject *__pyx_pw_8PyClical_63sinh(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
16420 PyObject *__pyx_r = 0;
16421 __Pyx_RefNannyDeclarations
16422 __Pyx_RefNannySetupContext(
"sinh (wrapper)", 0);
16423 __pyx_r = __pyx_pf_8PyClical_62sinh(__pyx_self, ((PyObject *)__pyx_v_obj));
16426 __Pyx_RefNannyFinishContext();
16430 static PyObject *__pyx_pf_8PyClical_62sinh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
16431 PyObject *__pyx_r = NULL;
16432 __Pyx_RefNannyDeclarations
16433 PyObject *__pyx_t_1 = NULL;
16434 __Pyx_RefNannySetupContext(
"sinh", 0);
16435 __Pyx_XDECREF(__pyx_r);
16436 __pyx_t_1 = __pyx_f_8PyClical_sinh(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1719, __pyx_L1_error)
16437 __Pyx_GOTREF(__pyx_t_1);
16438 __pyx_r = __pyx_t_1;
16444 __Pyx_XDECREF(__pyx_t_1);
16445 __Pyx_AddTraceback(
"PyClical.sinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16448 __Pyx_XGIVEREF(__pyx_r);
16449 __Pyx_RefNannyFinishContext();
16461 static PyObject *__pyx_pw_8PyClical_65asinh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16462 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) {
16463 PyObject *__pyx_v_i = ((PyObject *)Py_None);
16464 PyObject *__pyx_r = NULL;
16465 __Pyx_RefNannyDeclarations
16468 PyObject *__pyx_t_3 = NULL;
16470 PyObject *__pyx_t_5 = NULL;
16471 PyObject *__pyx_t_6 = NULL;
16472 PyObject *__pyx_t_7 = NULL;
16473 PyObject *__pyx_t_8 = NULL;
16474 PyObject *__pyx_t_9 = NULL;
16475 PyObject *__pyx_t_10 = NULL;
16476 PyObject *__pyx_t_11 = NULL;
16477 __Pyx_RefNannySetupContext(
"asinh", 0);
16478 if (__pyx_optional_args) {
16479 if (__pyx_optional_args->__pyx_n > 0) {
16480 __pyx_v_i = __pyx_optional_args->i;
16491 __pyx_t_1 = (__pyx_v_i != Py_None);
16492 __pyx_t_2 = (__pyx_t_1 != 0);
16502 __Pyx_XDECREF(__pyx_r);
16503 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1745, __pyx_L1_error)
16504 __Pyx_GOTREF(__pyx_t_3);
16506 __pyx_t_4 =
asinh(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
16508 __Pyx_CppExn2PyErr();
16509 __PYX_ERR(0, 1745, __pyx_L1_error)
16511 __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)
16512 __Pyx_GOTREF(__pyx_t_5);
16513 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16514 __pyx_r = __pyx_t_5;
16536 __Pyx_PyThreadState_declare
16537 __Pyx_PyThreadState_assign
16538 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
16539 __Pyx_XGOTREF(__pyx_t_6);
16540 __Pyx_XGOTREF(__pyx_t_7);
16541 __Pyx_XGOTREF(__pyx_t_8);
16551 __Pyx_XDECREF(__pyx_r);
16552 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1748, __pyx_L4_error)
16553 __Pyx_GOTREF(__pyx_t_3);
16554 __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)
16555 __Pyx_GOTREF(__pyx_t_9);
16556 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16558 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
16559 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
16560 if (likely(__pyx_t_3)) {
16561 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
16562 __Pyx_INCREF(__pyx_t_3);
16563 __Pyx_INCREF(
function);
16564 __Pyx_DECREF_SET(__pyx_t_9,
function);
16568 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1748, __pyx_L4_error)
16569 __Pyx_GOTREF(__pyx_t_5);
16571 #if CYTHON_FAST_PYCALL 16572 if (PyFunction_Check(__pyx_t_9)) {
16573 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
16574 __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1748, __pyx_L4_error)
16575 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16576 __Pyx_GOTREF(__pyx_t_5);
16579 #if CYTHON_FAST_PYCCALL 16580 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
16581 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
16582 __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1748, __pyx_L4_error)
16583 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16584 __Pyx_GOTREF(__pyx_t_5);
16588 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1748, __pyx_L4_error)
16589 __Pyx_GOTREF(__pyx_t_10);
16590 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
16591 __Pyx_INCREF(__pyx_v_obj);
16592 __Pyx_GIVEREF(__pyx_v_obj);
16593 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
16594 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1748, __pyx_L4_error)
16595 __Pyx_GOTREF(__pyx_t_5);
16596 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16599 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16600 __pyx_r = __pyx_t_5;
16602 goto __pyx_L8_try_return;
16613 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16614 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
16615 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
16616 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16626 __Pyx_AddTraceback(
"PyClical.asinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16627 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1749, __pyx_L6_except_error)
16628 __Pyx_GOTREF(__pyx_t_5);
16629 __Pyx_GOTREF(__pyx_t_9);
16630 __Pyx_GOTREF(__pyx_t_10);
16639 __Pyx_XDECREF(__pyx_r);
16640 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1750, __pyx_L6_except_error)
16641 __Pyx_GOTREF(__pyx_t_3);
16642 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_3),
asinh(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1750, __pyx_L6_except_error)
16643 __Pyx_GOTREF(__pyx_t_11);
16644 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16645 __pyx_r = __pyx_t_11;
16647 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16648 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16649 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16650 goto __pyx_L7_except_return;
16652 __pyx_L6_except_error:;
16661 __Pyx_XGIVEREF(__pyx_t_6);
16662 __Pyx_XGIVEREF(__pyx_t_7);
16663 __Pyx_XGIVEREF(__pyx_t_8);
16664 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16665 goto __pyx_L1_error;
16666 __pyx_L8_try_return:;
16667 __Pyx_XGIVEREF(__pyx_t_6);
16668 __Pyx_XGIVEREF(__pyx_t_7);
16669 __Pyx_XGIVEREF(__pyx_t_8);
16670 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16672 __pyx_L7_except_return:;
16673 __Pyx_XGIVEREF(__pyx_t_6);
16674 __Pyx_XGIVEREF(__pyx_t_7);
16675 __Pyx_XGIVEREF(__pyx_t_8);
16676 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16691 __Pyx_XDECREF(__pyx_t_3);
16692 __Pyx_XDECREF(__pyx_t_5);
16693 __Pyx_XDECREF(__pyx_t_9);
16694 __Pyx_XDECREF(__pyx_t_10);
16695 __Pyx_XDECREF(__pyx_t_11);
16696 __Pyx_AddTraceback(
"PyClical.asinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16699 __Pyx_XGIVEREF(__pyx_r);
16700 __Pyx_RefNannyFinishContext();
16705 static PyObject *__pyx_pw_8PyClical_65asinh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16706 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 ";
16707 static PyObject *__pyx_pw_8PyClical_65asinh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16708 PyObject *__pyx_v_obj = 0;
16709 PyObject *__pyx_v_i = 0;
16710 PyObject *__pyx_r = 0;
16711 __Pyx_RefNannyDeclarations
16712 __Pyx_RefNannySetupContext(
"asinh (wrapper)", 0);
16714 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
16715 PyObject* values[2] = {0,0};
16716 values[1] = ((PyObject *)Py_None);
16717 if (unlikely(__pyx_kwds)) {
16718 Py_ssize_t kw_args;
16719 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16720 switch (pos_args) {
16721 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16722 CYTHON_FALLTHROUGH;
16723 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16724 CYTHON_FALLTHROUGH;
16726 default:
goto __pyx_L5_argtuple_error;
16728 kw_args = PyDict_Size(__pyx_kwds);
16729 switch (pos_args) {
16731 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
16732 else goto __pyx_L5_argtuple_error;
16733 CYTHON_FALLTHROUGH;
16736 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i);
16737 if (value) { values[1] = value; kw_args--; }
16740 if (unlikely(kw_args > 0)) {
16741 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"asinh") < 0)) __PYX_ERR(0, 1733, __pyx_L3_error)
16744 switch (PyTuple_GET_SIZE(__pyx_args)) {
16745 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16746 CYTHON_FALLTHROUGH;
16747 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16749 default:
goto __pyx_L5_argtuple_error;
16752 __pyx_v_obj = values[0];
16753 __pyx_v_i = values[1];
16755 goto __pyx_L4_argument_unpacking_done;
16756 __pyx_L5_argtuple_error:;
16757 __Pyx_RaiseArgtupleInvalid(
"asinh", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1733, __pyx_L3_error)
16759 __Pyx_AddTraceback(
"PyClical.asinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16760 __Pyx_RefNannyFinishContext();
16762 __pyx_L4_argument_unpacking_done:;
16763 __pyx_r = __pyx_pf_8PyClical_64asinh(__pyx_self, __pyx_v_obj, __pyx_v_i);
16766 __Pyx_RefNannyFinishContext();
16770 static PyObject *__pyx_pf_8PyClical_64asinh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
16771 PyObject *__pyx_r = NULL;
16772 __Pyx_RefNannyDeclarations
16773 PyObject *__pyx_t_1 = NULL;
16774 struct __pyx_opt_args_8PyClical_asinh __pyx_t_2;
16775 __Pyx_RefNannySetupContext(
"asinh", 0);
16776 __Pyx_XDECREF(__pyx_r);
16777 __pyx_t_2.__pyx_n = 1;
16778 __pyx_t_2.i = __pyx_v_i;
16779 __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)
16780 __Pyx_GOTREF(__pyx_t_1);
16781 __pyx_r = __pyx_t_1;
16787 __Pyx_XDECREF(__pyx_t_1);
16788 __Pyx_AddTraceback(
"PyClical.asinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16791 __Pyx_XGIVEREF(__pyx_r);
16792 __Pyx_RefNannyFinishContext();
16804 static PyObject *__pyx_pw_8PyClical_67tan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16805 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) {
16806 PyObject *__pyx_v_i = ((PyObject *)Py_None);
16807 PyObject *__pyx_r = NULL;
16808 __Pyx_RefNannyDeclarations
16811 PyObject *__pyx_t_3 = NULL;
16813 PyObject *__pyx_t_5 = NULL;
16814 PyObject *__pyx_t_6 = NULL;
16815 PyObject *__pyx_t_7 = NULL;
16816 PyObject *__pyx_t_8 = NULL;
16817 PyObject *__pyx_t_9 = NULL;
16818 PyObject *__pyx_t_10 = NULL;
16819 PyObject *__pyx_t_11 = NULL;
16820 __Pyx_RefNannySetupContext(
"tan", 0);
16821 if (__pyx_optional_args) {
16822 if (__pyx_optional_args->__pyx_n > 0) {
16823 __pyx_v_i = __pyx_optional_args->i;
16834 __pyx_t_1 = (__pyx_v_i != Py_None);
16835 __pyx_t_2 = (__pyx_t_1 != 0);
16845 __Pyx_XDECREF(__pyx_r);
16846 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1762, __pyx_L1_error)
16847 __Pyx_GOTREF(__pyx_t_3);
16849 __pyx_t_4 =
tan(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
16851 __Pyx_CppExn2PyErr();
16852 __PYX_ERR(0, 1762, __pyx_L1_error)
16854 __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)
16855 __Pyx_GOTREF(__pyx_t_5);
16856 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16857 __pyx_r = __pyx_t_5;
16879 __Pyx_PyThreadState_declare
16880 __Pyx_PyThreadState_assign
16881 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
16882 __Pyx_XGOTREF(__pyx_t_6);
16883 __Pyx_XGOTREF(__pyx_t_7);
16884 __Pyx_XGOTREF(__pyx_t_8);
16894 __Pyx_XDECREF(__pyx_r);
16895 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1765, __pyx_L4_error)
16896 __Pyx_GOTREF(__pyx_t_3);
16897 __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)
16898 __Pyx_GOTREF(__pyx_t_9);
16899 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16901 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
16902 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
16903 if (likely(__pyx_t_3)) {
16904 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
16905 __Pyx_INCREF(__pyx_t_3);
16906 __Pyx_INCREF(
function);
16907 __Pyx_DECREF_SET(__pyx_t_9,
function);
16911 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1765, __pyx_L4_error)
16912 __Pyx_GOTREF(__pyx_t_5);
16914 #if CYTHON_FAST_PYCALL 16915 if (PyFunction_Check(__pyx_t_9)) {
16916 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
16917 __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1765, __pyx_L4_error)
16918 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16919 __Pyx_GOTREF(__pyx_t_5);
16922 #if CYTHON_FAST_PYCCALL 16923 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
16924 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
16925 __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1765, __pyx_L4_error)
16926 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16927 __Pyx_GOTREF(__pyx_t_5);
16931 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1765, __pyx_L4_error)
16932 __Pyx_GOTREF(__pyx_t_10);
16933 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
16934 __Pyx_INCREF(__pyx_v_obj);
16935 __Pyx_GIVEREF(__pyx_v_obj);
16936 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
16937 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1765, __pyx_L4_error)
16938 __Pyx_GOTREF(__pyx_t_5);
16939 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16942 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16943 __pyx_r = __pyx_t_5;
16945 goto __pyx_L8_try_return;
16956 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16957 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
16958 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
16959 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16969 __Pyx_AddTraceback(
"PyClical.tan", __pyx_clineno, __pyx_lineno, __pyx_filename);
16970 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1766, __pyx_L6_except_error)
16971 __Pyx_GOTREF(__pyx_t_5);
16972 __Pyx_GOTREF(__pyx_t_9);
16973 __Pyx_GOTREF(__pyx_t_10);
16982 __Pyx_XDECREF(__pyx_r);
16983 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1767, __pyx_L6_except_error)
16984 __Pyx_GOTREF(__pyx_t_3);
16985 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_3),
tan(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1767, __pyx_L6_except_error)
16986 __Pyx_GOTREF(__pyx_t_11);
16987 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16988 __pyx_r = __pyx_t_11;
16990 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16991 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16992 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16993 goto __pyx_L7_except_return;
16995 __pyx_L6_except_error:;
17004 __Pyx_XGIVEREF(__pyx_t_6);
17005 __Pyx_XGIVEREF(__pyx_t_7);
17006 __Pyx_XGIVEREF(__pyx_t_8);
17007 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17008 goto __pyx_L1_error;
17009 __pyx_L8_try_return:;
17010 __Pyx_XGIVEREF(__pyx_t_6);
17011 __Pyx_XGIVEREF(__pyx_t_7);
17012 __Pyx_XGIVEREF(__pyx_t_8);
17013 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17015 __pyx_L7_except_return:;
17016 __Pyx_XGIVEREF(__pyx_t_6);
17017 __Pyx_XGIVEREF(__pyx_t_7);
17018 __Pyx_XGIVEREF(__pyx_t_8);
17019 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17034 __Pyx_XDECREF(__pyx_t_3);
17035 __Pyx_XDECREF(__pyx_t_5);
17036 __Pyx_XDECREF(__pyx_t_9);
17037 __Pyx_XDECREF(__pyx_t_10);
17038 __Pyx_XDECREF(__pyx_t_11);
17039 __Pyx_AddTraceback(
"PyClical.tan", __pyx_clineno, __pyx_lineno, __pyx_filename);
17042 __Pyx_XGIVEREF(__pyx_r);
17043 __Pyx_RefNannyFinishContext();
17048 static PyObject *__pyx_pw_8PyClical_67tan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17049 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 ";
17050 static PyObject *__pyx_pw_8PyClical_67tan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17051 PyObject *__pyx_v_obj = 0;
17052 PyObject *__pyx_v_i = 0;
17053 PyObject *__pyx_r = 0;
17054 __Pyx_RefNannyDeclarations
17055 __Pyx_RefNannySetupContext(
"tan (wrapper)", 0);
17057 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
17058 PyObject* values[2] = {0,0};
17059 values[1] = ((PyObject *)Py_None);
17060 if (unlikely(__pyx_kwds)) {
17061 Py_ssize_t kw_args;
17062 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17063 switch (pos_args) {
17064 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17065 CYTHON_FALLTHROUGH;
17066 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17067 CYTHON_FALLTHROUGH;
17069 default:
goto __pyx_L5_argtuple_error;
17071 kw_args = PyDict_Size(__pyx_kwds);
17072 switch (pos_args) {
17074 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
17075 else goto __pyx_L5_argtuple_error;
17076 CYTHON_FALLTHROUGH;
17079 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i);
17080 if (value) { values[1] = value; kw_args--; }
17083 if (unlikely(kw_args > 0)) {
17084 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"tan") < 0)) __PYX_ERR(0, 1752, __pyx_L3_error)
17087 switch (PyTuple_GET_SIZE(__pyx_args)) {
17088 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17089 CYTHON_FALLTHROUGH;
17090 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17092 default:
goto __pyx_L5_argtuple_error;
17095 __pyx_v_obj = values[0];
17096 __pyx_v_i = values[1];
17098 goto __pyx_L4_argument_unpacking_done;
17099 __pyx_L5_argtuple_error:;
17100 __Pyx_RaiseArgtupleInvalid(
"tan", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1752, __pyx_L3_error)
17102 __Pyx_AddTraceback(
"PyClical.tan", __pyx_clineno, __pyx_lineno, __pyx_filename);
17103 __Pyx_RefNannyFinishContext();
17105 __pyx_L4_argument_unpacking_done:;
17106 __pyx_r = __pyx_pf_8PyClical_66tan(__pyx_self, __pyx_v_obj, __pyx_v_i);
17109 __Pyx_RefNannyFinishContext();
17113 static PyObject *__pyx_pf_8PyClical_66tan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
17114 PyObject *__pyx_r = NULL;
17115 __Pyx_RefNannyDeclarations
17116 PyObject *__pyx_t_1 = NULL;
17117 struct __pyx_opt_args_8PyClical_tan __pyx_t_2;
17118 __Pyx_RefNannySetupContext(
"tan", 0);
17119 __Pyx_XDECREF(__pyx_r);
17120 __pyx_t_2.__pyx_n = 1;
17121 __pyx_t_2.i = __pyx_v_i;
17122 __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)
17123 __Pyx_GOTREF(__pyx_t_1);
17124 __pyx_r = __pyx_t_1;
17130 __Pyx_XDECREF(__pyx_t_1);
17131 __Pyx_AddTraceback(
"PyClical.tan", __pyx_clineno, __pyx_lineno, __pyx_filename);
17134 __Pyx_XGIVEREF(__pyx_r);
17135 __Pyx_RefNannyFinishContext();
17147 static PyObject *__pyx_pw_8PyClical_69atan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17148 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) {
17149 PyObject *__pyx_v_i = ((PyObject *)Py_None);
17150 PyObject *__pyx_r = NULL;
17151 __Pyx_RefNannyDeclarations
17154 PyObject *__pyx_t_3 = NULL;
17156 PyObject *__pyx_t_5 = NULL;
17157 PyObject *__pyx_t_6 = NULL;
17158 PyObject *__pyx_t_7 = NULL;
17159 PyObject *__pyx_t_8 = NULL;
17160 PyObject *__pyx_t_9 = NULL;
17161 PyObject *__pyx_t_10 = NULL;
17162 PyObject *__pyx_t_11 = NULL;
17163 __Pyx_RefNannySetupContext(
"atan", 0);
17164 if (__pyx_optional_args) {
17165 if (__pyx_optional_args->__pyx_n > 0) {
17166 __pyx_v_i = __pyx_optional_args->i;
17177 __pyx_t_1 = (__pyx_v_i != Py_None);
17178 __pyx_t_2 = (__pyx_t_1 != 0);
17188 __Pyx_XDECREF(__pyx_r);
17189 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1779, __pyx_L1_error)
17190 __Pyx_GOTREF(__pyx_t_3);
17192 __pyx_t_4 =
atan(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
17194 __Pyx_CppExn2PyErr();
17195 __PYX_ERR(0, 1779, __pyx_L1_error)
17197 __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)
17198 __Pyx_GOTREF(__pyx_t_5);
17199 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17200 __pyx_r = __pyx_t_5;
17222 __Pyx_PyThreadState_declare
17223 __Pyx_PyThreadState_assign
17224 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
17225 __Pyx_XGOTREF(__pyx_t_6);
17226 __Pyx_XGOTREF(__pyx_t_7);
17227 __Pyx_XGOTREF(__pyx_t_8);
17237 __Pyx_XDECREF(__pyx_r);
17238 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1782, __pyx_L4_error)
17239 __Pyx_GOTREF(__pyx_t_3);
17240 __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)
17241 __Pyx_GOTREF(__pyx_t_9);
17242 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17244 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
17245 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
17246 if (likely(__pyx_t_3)) {
17247 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
17248 __Pyx_INCREF(__pyx_t_3);
17249 __Pyx_INCREF(
function);
17250 __Pyx_DECREF_SET(__pyx_t_9,
function);
17254 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1782, __pyx_L4_error)
17255 __Pyx_GOTREF(__pyx_t_5);
17257 #if CYTHON_FAST_PYCALL 17258 if (PyFunction_Check(__pyx_t_9)) {
17259 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
17260 __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1782, __pyx_L4_error)
17261 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17262 __Pyx_GOTREF(__pyx_t_5);
17265 #if CYTHON_FAST_PYCCALL 17266 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
17267 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
17268 __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1782, __pyx_L4_error)
17269 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17270 __Pyx_GOTREF(__pyx_t_5);
17274 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1782, __pyx_L4_error)
17275 __Pyx_GOTREF(__pyx_t_10);
17276 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
17277 __Pyx_INCREF(__pyx_v_obj);
17278 __Pyx_GIVEREF(__pyx_v_obj);
17279 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
17280 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1782, __pyx_L4_error)
17281 __Pyx_GOTREF(__pyx_t_5);
17282 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
17285 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17286 __pyx_r = __pyx_t_5;
17288 goto __pyx_L8_try_return;
17299 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17300 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
17301 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
17302 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17312 __Pyx_AddTraceback(
"PyClical.atan", __pyx_clineno, __pyx_lineno, __pyx_filename);
17313 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1783, __pyx_L6_except_error)
17314 __Pyx_GOTREF(__pyx_t_5);
17315 __Pyx_GOTREF(__pyx_t_9);
17316 __Pyx_GOTREF(__pyx_t_10);
17325 __Pyx_XDECREF(__pyx_r);
17326 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1784, __pyx_L6_except_error)
17327 __Pyx_GOTREF(__pyx_t_3);
17328 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_3),
atan(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1784, __pyx_L6_except_error)
17329 __Pyx_GOTREF(__pyx_t_11);
17330 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17331 __pyx_r = __pyx_t_11;
17333 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17334 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17335 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
17336 goto __pyx_L7_except_return;
17338 __pyx_L6_except_error:;
17347 __Pyx_XGIVEREF(__pyx_t_6);
17348 __Pyx_XGIVEREF(__pyx_t_7);
17349 __Pyx_XGIVEREF(__pyx_t_8);
17350 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17351 goto __pyx_L1_error;
17352 __pyx_L8_try_return:;
17353 __Pyx_XGIVEREF(__pyx_t_6);
17354 __Pyx_XGIVEREF(__pyx_t_7);
17355 __Pyx_XGIVEREF(__pyx_t_8);
17356 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17358 __pyx_L7_except_return:;
17359 __Pyx_XGIVEREF(__pyx_t_6);
17360 __Pyx_XGIVEREF(__pyx_t_7);
17361 __Pyx_XGIVEREF(__pyx_t_8);
17362 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17377 __Pyx_XDECREF(__pyx_t_3);
17378 __Pyx_XDECREF(__pyx_t_5);
17379 __Pyx_XDECREF(__pyx_t_9);
17380 __Pyx_XDECREF(__pyx_t_10);
17381 __Pyx_XDECREF(__pyx_t_11);
17382 __Pyx_AddTraceback(
"PyClical.atan", __pyx_clineno, __pyx_lineno, __pyx_filename);
17385 __Pyx_XGIVEREF(__pyx_r);
17386 __Pyx_RefNannyFinishContext();
17391 static PyObject *__pyx_pw_8PyClical_69atan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17392 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 ";
17393 static PyObject *__pyx_pw_8PyClical_69atan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17394 PyObject *__pyx_v_obj = 0;
17395 PyObject *__pyx_v_i = 0;
17396 PyObject *__pyx_r = 0;
17397 __Pyx_RefNannyDeclarations
17398 __Pyx_RefNannySetupContext(
"atan (wrapper)", 0);
17400 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
17401 PyObject* values[2] = {0,0};
17402 values[1] = ((PyObject *)Py_None);
17403 if (unlikely(__pyx_kwds)) {
17404 Py_ssize_t kw_args;
17405 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17406 switch (pos_args) {
17407 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17408 CYTHON_FALLTHROUGH;
17409 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17410 CYTHON_FALLTHROUGH;
17412 default:
goto __pyx_L5_argtuple_error;
17414 kw_args = PyDict_Size(__pyx_kwds);
17415 switch (pos_args) {
17417 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
17418 else goto __pyx_L5_argtuple_error;
17419 CYTHON_FALLTHROUGH;
17422 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i);
17423 if (value) { values[1] = value; kw_args--; }
17426 if (unlikely(kw_args > 0)) {
17427 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"atan") < 0)) __PYX_ERR(0, 1769, __pyx_L3_error)
17430 switch (PyTuple_GET_SIZE(__pyx_args)) {
17431 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17432 CYTHON_FALLTHROUGH;
17433 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17435 default:
goto __pyx_L5_argtuple_error;
17438 __pyx_v_obj = values[0];
17439 __pyx_v_i = values[1];
17441 goto __pyx_L4_argument_unpacking_done;
17442 __pyx_L5_argtuple_error:;
17443 __Pyx_RaiseArgtupleInvalid(
"atan", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1769, __pyx_L3_error)
17445 __Pyx_AddTraceback(
"PyClical.atan", __pyx_clineno, __pyx_lineno, __pyx_filename);
17446 __Pyx_RefNannyFinishContext();
17448 __pyx_L4_argument_unpacking_done:;
17449 __pyx_r = __pyx_pf_8PyClical_68atan(__pyx_self, __pyx_v_obj, __pyx_v_i);
17452 __Pyx_RefNannyFinishContext();
17456 static PyObject *__pyx_pf_8PyClical_68atan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
17457 PyObject *__pyx_r = NULL;
17458 __Pyx_RefNannyDeclarations
17459 PyObject *__pyx_t_1 = NULL;
17460 struct __pyx_opt_args_8PyClical_atan __pyx_t_2;
17461 __Pyx_RefNannySetupContext(
"atan", 0);
17462 __Pyx_XDECREF(__pyx_r);
17463 __pyx_t_2.__pyx_n = 1;
17464 __pyx_t_2.i = __pyx_v_i;
17465 __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)
17466 __Pyx_GOTREF(__pyx_t_1);
17467 __pyx_r = __pyx_t_1;
17473 __Pyx_XDECREF(__pyx_t_1);
17474 __Pyx_AddTraceback(
"PyClical.atan", __pyx_clineno, __pyx_lineno, __pyx_filename);
17477 __Pyx_XGIVEREF(__pyx_r);
17478 __Pyx_RefNannyFinishContext();
17490 static PyObject *__pyx_pw_8PyClical_71tanh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
17491 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_tanh(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
17492 PyObject *__pyx_r = NULL;
17493 __Pyx_RefNannyDeclarations
17494 PyObject *__pyx_t_1 = NULL;
17495 PyObject *__pyx_t_2 = NULL;
17496 PyObject *__pyx_t_3 = NULL;
17497 PyObject *__pyx_t_4 = NULL;
17498 PyObject *__pyx_t_5 = NULL;
17499 PyObject *__pyx_t_6 = NULL;
17500 PyObject *__pyx_t_7 = NULL;
17501 PyObject *__pyx_t_8 = NULL;
17502 __Pyx_RefNannySetupContext(
"tanh", 0);
17512 __Pyx_PyThreadState_declare
17513 __Pyx_PyThreadState_assign
17514 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
17515 __Pyx_XGOTREF(__pyx_t_1);
17516 __Pyx_XGOTREF(__pyx_t_2);
17517 __Pyx_XGOTREF(__pyx_t_3);
17527 __Pyx_XDECREF(__pyx_r);
17528 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1794, __pyx_L3_error)
17529 __Pyx_GOTREF(__pyx_t_5);
17530 __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)
17531 __Pyx_GOTREF(__pyx_t_6);
17532 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17534 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
17535 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
17536 if (likely(__pyx_t_5)) {
17537 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
17538 __Pyx_INCREF(__pyx_t_5);
17539 __Pyx_INCREF(
function);
17540 __Pyx_DECREF_SET(__pyx_t_6,
function);
17544 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_obj);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1794, __pyx_L3_error)
17545 __Pyx_GOTREF(__pyx_t_4);
17547 #if CYTHON_FAST_PYCALL 17548 if (PyFunction_Check(__pyx_t_6)) {
17549 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_obj};
17550 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1794, __pyx_L3_error)
17551 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17552 __Pyx_GOTREF(__pyx_t_4);
17555 #if CYTHON_FAST_PYCCALL 17556 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
17557 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_obj};
17558 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1794, __pyx_L3_error)
17559 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17560 __Pyx_GOTREF(__pyx_t_4);
17564 __pyx_t_7 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1794, __pyx_L3_error)
17565 __Pyx_GOTREF(__pyx_t_7);
17566 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
17567 __Pyx_INCREF(__pyx_v_obj);
17568 __Pyx_GIVEREF(__pyx_v_obj);
17569 PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_obj);
17570 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1794, __pyx_L3_error)
17571 __Pyx_GOTREF(__pyx_t_4);
17572 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
17575 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17576 __pyx_r = __pyx_t_4;
17578 goto __pyx_L7_try_return;
17589 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17590 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
17591 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
17592 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
17602 __Pyx_AddTraceback(
"PyClical.tanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17603 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1795, __pyx_L5_except_error)
17604 __Pyx_GOTREF(__pyx_t_4);
17605 __Pyx_GOTREF(__pyx_t_6);
17606 __Pyx_GOTREF(__pyx_t_7);
17615 __Pyx_XDECREF(__pyx_r);
17616 __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1796, __pyx_L5_except_error)
17617 __Pyx_GOTREF(__pyx_t_5);
17618 __pyx_t_8 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_5),
tanh(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1796, __pyx_L5_except_error)
17619 __Pyx_GOTREF(__pyx_t_8);
17620 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17621 __pyx_r = __pyx_t_8;
17623 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17624 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17625 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
17626 goto __pyx_L6_except_return;
17628 __pyx_L5_except_error:;
17637 __Pyx_XGIVEREF(__pyx_t_1);
17638 __Pyx_XGIVEREF(__pyx_t_2);
17639 __Pyx_XGIVEREF(__pyx_t_3);
17640 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
17641 goto __pyx_L1_error;
17642 __pyx_L7_try_return:;
17643 __Pyx_XGIVEREF(__pyx_t_1);
17644 __Pyx_XGIVEREF(__pyx_t_2);
17645 __Pyx_XGIVEREF(__pyx_t_3);
17646 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
17648 __pyx_L6_except_return:;
17649 __Pyx_XGIVEREF(__pyx_t_1);
17650 __Pyx_XGIVEREF(__pyx_t_2);
17651 __Pyx_XGIVEREF(__pyx_t_3);
17652 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
17666 __Pyx_XDECREF(__pyx_t_4);
17667 __Pyx_XDECREF(__pyx_t_5);
17668 __Pyx_XDECREF(__pyx_t_6);
17669 __Pyx_XDECREF(__pyx_t_7);
17670 __Pyx_XDECREF(__pyx_t_8);
17671 __Pyx_AddTraceback(
"PyClical.tanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17674 __Pyx_XGIVEREF(__pyx_r);
17675 __Pyx_RefNannyFinishContext();
17680 static PyObject *__pyx_pw_8PyClical_71tanh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
17681 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 ";
17682 static PyObject *__pyx_pw_8PyClical_71tanh(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
17683 PyObject *__pyx_r = 0;
17684 __Pyx_RefNannyDeclarations
17685 __Pyx_RefNannySetupContext(
"tanh (wrapper)", 0);
17686 __pyx_r = __pyx_pf_8PyClical_70tanh(__pyx_self, ((PyObject *)__pyx_v_obj));
17689 __Pyx_RefNannyFinishContext();
17693 static PyObject *__pyx_pf_8PyClical_70tanh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
17694 PyObject *__pyx_r = NULL;
17695 __Pyx_RefNannyDeclarations
17696 PyObject *__pyx_t_1 = NULL;
17697 __Pyx_RefNannySetupContext(
"tanh", 0);
17698 __Pyx_XDECREF(__pyx_r);
17699 __pyx_t_1 = __pyx_f_8PyClical_tanh(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1786, __pyx_L1_error)
17700 __Pyx_GOTREF(__pyx_t_1);
17701 __pyx_r = __pyx_t_1;
17707 __Pyx_XDECREF(__pyx_t_1);
17708 __Pyx_AddTraceback(
"PyClical.tanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17711 __Pyx_XGIVEREF(__pyx_r);
17712 __Pyx_RefNannyFinishContext();
17724 static PyObject *__pyx_pw_8PyClical_73atanh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17725 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) {
17726 PyObject *__pyx_v_i = ((PyObject *)Py_None);
17727 PyObject *__pyx_r = NULL;
17728 __Pyx_RefNannyDeclarations
17731 PyObject *__pyx_t_3 = NULL;
17733 PyObject *__pyx_t_5 = NULL;
17734 PyObject *__pyx_t_6 = NULL;
17735 PyObject *__pyx_t_7 = NULL;
17736 PyObject *__pyx_t_8 = NULL;
17737 PyObject *__pyx_t_9 = NULL;
17738 PyObject *__pyx_t_10 = NULL;
17739 PyObject *__pyx_t_11 = NULL;
17740 __Pyx_RefNannySetupContext(
"atanh", 0);
17741 if (__pyx_optional_args) {
17742 if (__pyx_optional_args->__pyx_n > 0) {
17743 __pyx_v_i = __pyx_optional_args->i;
17754 __pyx_t_1 = (__pyx_v_i != Py_None);
17755 __pyx_t_2 = (__pyx_t_1 != 0);
17765 __Pyx_XDECREF(__pyx_r);
17766 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1808, __pyx_L1_error)
17767 __Pyx_GOTREF(__pyx_t_3);
17769 __pyx_t_4 =
atanh(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
17771 __Pyx_CppExn2PyErr();
17772 __PYX_ERR(0, 1808, __pyx_L1_error)
17774 __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)
17775 __Pyx_GOTREF(__pyx_t_5);
17776 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17777 __pyx_r = __pyx_t_5;
17799 __Pyx_PyThreadState_declare
17800 __Pyx_PyThreadState_assign
17801 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
17802 __Pyx_XGOTREF(__pyx_t_6);
17803 __Pyx_XGOTREF(__pyx_t_7);
17804 __Pyx_XGOTREF(__pyx_t_8);
17814 __Pyx_XDECREF(__pyx_r);
17815 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1811, __pyx_L4_error)
17816 __Pyx_GOTREF(__pyx_t_3);
17817 __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)
17818 __Pyx_GOTREF(__pyx_t_9);
17819 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17821 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
17822 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
17823 if (likely(__pyx_t_3)) {
17824 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
17825 __Pyx_INCREF(__pyx_t_3);
17826 __Pyx_INCREF(
function);
17827 __Pyx_DECREF_SET(__pyx_t_9,
function);
17831 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1811, __pyx_L4_error)
17832 __Pyx_GOTREF(__pyx_t_5);
17834 #if CYTHON_FAST_PYCALL 17835 if (PyFunction_Check(__pyx_t_9)) {
17836 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
17837 __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1811, __pyx_L4_error)
17838 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17839 __Pyx_GOTREF(__pyx_t_5);
17842 #if CYTHON_FAST_PYCCALL 17843 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
17844 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
17845 __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1811, __pyx_L4_error)
17846 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17847 __Pyx_GOTREF(__pyx_t_5);
17851 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1811, __pyx_L4_error)
17852 __Pyx_GOTREF(__pyx_t_10);
17853 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
17854 __Pyx_INCREF(__pyx_v_obj);
17855 __Pyx_GIVEREF(__pyx_v_obj);
17856 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
17857 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1811, __pyx_L4_error)
17858 __Pyx_GOTREF(__pyx_t_5);
17859 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
17862 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17863 __pyx_r = __pyx_t_5;
17865 goto __pyx_L8_try_return;
17876 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17877 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
17878 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
17879 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17889 __Pyx_AddTraceback(
"PyClical.atanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17890 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1812, __pyx_L6_except_error)
17891 __Pyx_GOTREF(__pyx_t_5);
17892 __Pyx_GOTREF(__pyx_t_9);
17893 __Pyx_GOTREF(__pyx_t_10);
17902 __Pyx_XDECREF(__pyx_r);
17903 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1813, __pyx_L6_except_error)
17904 __Pyx_GOTREF(__pyx_t_3);
17905 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_3),
atanh(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1813, __pyx_L6_except_error)
17906 __Pyx_GOTREF(__pyx_t_11);
17907 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17908 __pyx_r = __pyx_t_11;
17910 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17911 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17912 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
17913 goto __pyx_L7_except_return;
17915 __pyx_L6_except_error:;
17924 __Pyx_XGIVEREF(__pyx_t_6);
17925 __Pyx_XGIVEREF(__pyx_t_7);
17926 __Pyx_XGIVEREF(__pyx_t_8);
17927 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17928 goto __pyx_L1_error;
17929 __pyx_L8_try_return:;
17930 __Pyx_XGIVEREF(__pyx_t_6);
17931 __Pyx_XGIVEREF(__pyx_t_7);
17932 __Pyx_XGIVEREF(__pyx_t_8);
17933 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17935 __pyx_L7_except_return:;
17936 __Pyx_XGIVEREF(__pyx_t_6);
17937 __Pyx_XGIVEREF(__pyx_t_7);
17938 __Pyx_XGIVEREF(__pyx_t_8);
17939 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17954 __Pyx_XDECREF(__pyx_t_3);
17955 __Pyx_XDECREF(__pyx_t_5);
17956 __Pyx_XDECREF(__pyx_t_9);
17957 __Pyx_XDECREF(__pyx_t_10);
17958 __Pyx_XDECREF(__pyx_t_11);
17959 __Pyx_AddTraceback(
"PyClical.atanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17962 __Pyx_XGIVEREF(__pyx_r);
17963 __Pyx_RefNannyFinishContext();
17968 static PyObject *__pyx_pw_8PyClical_73atanh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17969 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 ";
17970 static PyObject *__pyx_pw_8PyClical_73atanh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17971 PyObject *__pyx_v_obj = 0;
17972 PyObject *__pyx_v_i = 0;
17973 PyObject *__pyx_r = 0;
17974 __Pyx_RefNannyDeclarations
17975 __Pyx_RefNannySetupContext(
"atanh (wrapper)", 0);
17977 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
17978 PyObject* values[2] = {0,0};
17979 values[1] = ((PyObject *)Py_None);
17980 if (unlikely(__pyx_kwds)) {
17981 Py_ssize_t kw_args;
17982 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17983 switch (pos_args) {
17984 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17985 CYTHON_FALLTHROUGH;
17986 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17987 CYTHON_FALLTHROUGH;
17989 default:
goto __pyx_L5_argtuple_error;
17991 kw_args = PyDict_Size(__pyx_kwds);
17992 switch (pos_args) {
17994 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
17995 else goto __pyx_L5_argtuple_error;
17996 CYTHON_FALLTHROUGH;
17999 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i);
18000 if (value) { values[1] = value; kw_args--; }
18003 if (unlikely(kw_args > 0)) {
18004 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"atanh") < 0)) __PYX_ERR(0, 1798, __pyx_L3_error)
18007 switch (PyTuple_GET_SIZE(__pyx_args)) {
18008 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18009 CYTHON_FALLTHROUGH;
18010 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18012 default:
goto __pyx_L5_argtuple_error;
18015 __pyx_v_obj = values[0];
18016 __pyx_v_i = values[1];
18018 goto __pyx_L4_argument_unpacking_done;
18019 __pyx_L5_argtuple_error:;
18020 __Pyx_RaiseArgtupleInvalid(
"atanh", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1798, __pyx_L3_error)
18022 __Pyx_AddTraceback(
"PyClical.atanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
18023 __Pyx_RefNannyFinishContext();
18025 __pyx_L4_argument_unpacking_done:;
18026 __pyx_r = __pyx_pf_8PyClical_72atanh(__pyx_self, __pyx_v_obj, __pyx_v_i);
18029 __Pyx_RefNannyFinishContext();
18033 static PyObject *__pyx_pf_8PyClical_72atanh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
18034 PyObject *__pyx_r = NULL;
18035 __Pyx_RefNannyDeclarations
18036 PyObject *__pyx_t_1 = NULL;
18037 struct __pyx_opt_args_8PyClical_atanh __pyx_t_2;
18038 __Pyx_RefNannySetupContext(
"atanh", 0);
18039 __Pyx_XDECREF(__pyx_r);
18040 __pyx_t_2.__pyx_n = 1;
18041 __pyx_t_2.i = __pyx_v_i;
18042 __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)
18043 __Pyx_GOTREF(__pyx_t_1);
18044 __pyx_r = __pyx_t_1;
18050 __Pyx_XDECREF(__pyx_t_1);
18051 __Pyx_AddTraceback(
"PyClical.atanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
18054 __Pyx_XGIVEREF(__pyx_r);
18055 __Pyx_RefNannyFinishContext();
18067 static PyObject *__pyx_pw_8PyClical_75random_clifford(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
18068 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) {
18069 PyObject *__pyx_v_fill = ((PyObject *)__pyx_float_1_0);
18070 PyObject *__pyx_r = NULL;
18071 __Pyx_RefNannyDeclarations
18072 PyObject *__pyx_t_1 = NULL;
18073 PyObject *__pyx_t_2 = NULL;
18075 PyObject *__pyx_t_4 = NULL;
18076 __Pyx_RefNannySetupContext(
"random_clifford", 0);
18077 if (__pyx_optional_args) {
18078 if (__pyx_optional_args->__pyx_n > 0) {
18079 __pyx_v_fill = __pyx_optional_args->fill;
18090 __Pyx_XDECREF(__pyx_r);
18091 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1822, __pyx_L1_error)
18092 __Pyx_GOTREF(__pyx_t_1);
18093 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1822, __pyx_L1_error)
18094 __Pyx_GOTREF(__pyx_t_2);
18095 __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)
18096 __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)
18097 __Pyx_GOTREF(__pyx_t_4);
18098 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18099 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18100 __pyx_r = __pyx_t_4;
18114 __Pyx_XDECREF(__pyx_t_1);
18115 __Pyx_XDECREF(__pyx_t_2);
18116 __Pyx_XDECREF(__pyx_t_4);
18117 __Pyx_AddTraceback(
"PyClical.random_clifford", __pyx_clineno, __pyx_lineno, __pyx_filename);
18120 __Pyx_XGIVEREF(__pyx_r);
18121 __Pyx_RefNannyFinishContext();
18126 static PyObject *__pyx_pw_8PyClical_75random_clifford(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
18127 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 ";
18128 static PyObject *__pyx_pw_8PyClical_75random_clifford(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18129 struct __pyx_obj_8PyClical_index_set *__pyx_v_ixt = 0;
18130 PyObject *__pyx_v_fill = 0;
18131 PyObject *__pyx_r = 0;
18132 __Pyx_RefNannyDeclarations
18133 __Pyx_RefNannySetupContext(
"random_clifford (wrapper)", 0);
18135 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ixt,&__pyx_n_s_fill,0};
18136 PyObject* values[2] = {0,0};
18137 values[1] = ((PyObject *)__pyx_float_1_0);
18138 if (unlikely(__pyx_kwds)) {
18139 Py_ssize_t kw_args;
18140 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
18141 switch (pos_args) {
18142 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18143 CYTHON_FALLTHROUGH;
18144 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18145 CYTHON_FALLTHROUGH;
18147 default:
goto __pyx_L5_argtuple_error;
18149 kw_args = PyDict_Size(__pyx_kwds);
18150 switch (pos_args) {
18152 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ixt)) != 0)) kw_args--;
18153 else goto __pyx_L5_argtuple_error;
18154 CYTHON_FALLTHROUGH;
18157 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill);
18158 if (value) { values[1] = value; kw_args--; }
18161 if (unlikely(kw_args > 0)) {
18162 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"random_clifford") < 0)) __PYX_ERR(0, 1815, __pyx_L3_error)
18165 switch (PyTuple_GET_SIZE(__pyx_args)) {
18166 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18167 CYTHON_FALLTHROUGH;
18168 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18170 default:
goto __pyx_L5_argtuple_error;
18173 __pyx_v_ixt = ((
struct __pyx_obj_8PyClical_index_set *)values[0]);
18174 __pyx_v_fill = values[1];
18176 goto __pyx_L4_argument_unpacking_done;
18177 __pyx_L5_argtuple_error:;
18178 __Pyx_RaiseArgtupleInvalid(
"random_clifford", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1815, __pyx_L3_error)
18180 __Pyx_AddTraceback(
"PyClical.random_clifford", __pyx_clineno, __pyx_lineno, __pyx_filename);
18181 __Pyx_RefNannyFinishContext();
18183 __pyx_L4_argument_unpacking_done:;
18184 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ixt), __pyx_ptype_8PyClical_index_set, 1,
"ixt", 0))) __PYX_ERR(0, 1815, __pyx_L1_error)
18185 __pyx_r = __pyx_pf_8PyClical_74random_clifford(__pyx_self, __pyx_v_ixt, __pyx_v_fill);
18192 __Pyx_RefNannyFinishContext();
18196 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) {
18197 PyObject *__pyx_r = NULL;
18198 __Pyx_RefNannyDeclarations
18199 PyObject *__pyx_t_1 = NULL;
18200 struct __pyx_opt_args_8PyClical_random_clifford __pyx_t_2;
18201 __Pyx_RefNannySetupContext(
"random_clifford", 0);
18202 __Pyx_XDECREF(__pyx_r);
18203 __pyx_t_2.__pyx_n = 1;
18204 __pyx_t_2.fill = __pyx_v_fill;
18205 __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)
18206 __Pyx_GOTREF(__pyx_t_1);
18207 __pyx_r = __pyx_t_1;
18213 __Pyx_XDECREF(__pyx_t_1);
18214 __Pyx_AddTraceback(
"PyClical.random_clifford", __pyx_clineno, __pyx_lineno, __pyx_filename);
18217 __Pyx_XGIVEREF(__pyx_r);
18218 __Pyx_RefNannyFinishContext();
18230 static PyObject *__pyx_pw_8PyClical_77cga3(PyObject *__pyx_self, PyObject *__pyx_v_obj);
18231 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cga3(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
18232 PyObject *__pyx_r = NULL;
18233 __Pyx_RefNannyDeclarations
18234 PyObject *__pyx_t_1 = NULL;
18235 PyObject *__pyx_t_2 = NULL;
18236 __Pyx_RefNannySetupContext(
"cga3", 0);
18245 __Pyx_XDECREF(__pyx_r);
18246 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1831, __pyx_L1_error)
18247 __Pyx_GOTREF(__pyx_t_1);
18248 __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)
18249 __Pyx_GOTREF(__pyx_t_2);
18250 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18251 __pyx_r = __pyx_t_2;
18265 __Pyx_XDECREF(__pyx_t_1);
18266 __Pyx_XDECREF(__pyx_t_2);
18267 __Pyx_AddTraceback(
"PyClical.cga3", __pyx_clineno, __pyx_lineno, __pyx_filename);
18270 __Pyx_XGIVEREF(__pyx_r);
18271 __Pyx_RefNannyFinishContext();
18276 static PyObject *__pyx_pw_8PyClical_77cga3(PyObject *__pyx_self, PyObject *__pyx_v_obj);
18277 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 ";
18278 static PyObject *__pyx_pw_8PyClical_77cga3(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18279 PyObject *__pyx_r = 0;
18280 __Pyx_RefNannyDeclarations
18281 __Pyx_RefNannySetupContext(
"cga3 (wrapper)", 0);
18282 __pyx_r = __pyx_pf_8PyClical_76cga3(__pyx_self, ((PyObject *)__pyx_v_obj));
18285 __Pyx_RefNannyFinishContext();
18289 static PyObject *__pyx_pf_8PyClical_76cga3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18290 PyObject *__pyx_r = NULL;
18291 __Pyx_RefNannyDeclarations
18292 PyObject *__pyx_t_1 = NULL;
18293 __Pyx_RefNannySetupContext(
"cga3", 0);
18294 __Pyx_XDECREF(__pyx_r);
18295 __pyx_t_1 = __pyx_f_8PyClical_cga3(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1824, __pyx_L1_error)
18296 __Pyx_GOTREF(__pyx_t_1);
18297 __pyx_r = __pyx_t_1;
18303 __Pyx_XDECREF(__pyx_t_1);
18304 __Pyx_AddTraceback(
"PyClical.cga3", __pyx_clineno, __pyx_lineno, __pyx_filename);
18307 __Pyx_XGIVEREF(__pyx_r);
18308 __Pyx_RefNannyFinishContext();
18320 static PyObject *__pyx_pw_8PyClical_79cga3std(PyObject *__pyx_self, PyObject *__pyx_v_obj);
18321 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cga3std(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
18322 PyObject *__pyx_r = NULL;
18323 __Pyx_RefNannyDeclarations
18324 PyObject *__pyx_t_1 = NULL;
18325 PyObject *__pyx_t_2 = NULL;
18326 __Pyx_RefNannySetupContext(
"cga3std", 0);
18335 __Pyx_XDECREF(__pyx_r);
18336 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1842, __pyx_L1_error)
18337 __Pyx_GOTREF(__pyx_t_1);
18338 __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)
18339 __Pyx_GOTREF(__pyx_t_2);
18340 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18341 __pyx_r = __pyx_t_2;
18355 __Pyx_XDECREF(__pyx_t_1);
18356 __Pyx_XDECREF(__pyx_t_2);
18357 __Pyx_AddTraceback(
"PyClical.cga3std", __pyx_clineno, __pyx_lineno, __pyx_filename);
18360 __Pyx_XGIVEREF(__pyx_r);
18361 __Pyx_RefNannyFinishContext();
18366 static PyObject *__pyx_pw_8PyClical_79cga3std(PyObject *__pyx_self, PyObject *__pyx_v_obj);
18367 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 ";
18368 static PyObject *__pyx_pw_8PyClical_79cga3std(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18369 PyObject *__pyx_r = 0;
18370 __Pyx_RefNannyDeclarations
18371 __Pyx_RefNannySetupContext(
"cga3std (wrapper)", 0);
18372 __pyx_r = __pyx_pf_8PyClical_78cga3std(__pyx_self, ((PyObject *)__pyx_v_obj));
18375 __Pyx_RefNannyFinishContext();
18379 static PyObject *__pyx_pf_8PyClical_78cga3std(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18380 PyObject *__pyx_r = NULL;
18381 __Pyx_RefNannyDeclarations
18382 PyObject *__pyx_t_1 = NULL;
18383 __Pyx_RefNannySetupContext(
"cga3std", 0);
18384 __Pyx_XDECREF(__pyx_r);
18385 __pyx_t_1 = __pyx_f_8PyClical_cga3std(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1833, __pyx_L1_error)
18386 __Pyx_GOTREF(__pyx_t_1);
18387 __pyx_r = __pyx_t_1;
18393 __Pyx_XDECREF(__pyx_t_1);
18394 __Pyx_AddTraceback(
"PyClical.cga3std", __pyx_clineno, __pyx_lineno, __pyx_filename);
18397 __Pyx_XGIVEREF(__pyx_r);
18398 __Pyx_RefNannyFinishContext();
18410 static PyObject *__pyx_pw_8PyClical_81agc3(PyObject *__pyx_self, PyObject *__pyx_v_obj);
18411 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_agc3(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
18412 PyObject *__pyx_r = NULL;
18413 __Pyx_RefNannyDeclarations
18414 PyObject *__pyx_t_1 = NULL;
18415 PyObject *__pyx_t_2 = NULL;
18416 __Pyx_RefNannySetupContext(
"agc3", 0);
18425 __Pyx_XDECREF(__pyx_r);
18426 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1853, __pyx_L1_error)
18427 __Pyx_GOTREF(__pyx_t_1);
18428 __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)
18429 __Pyx_GOTREF(__pyx_t_2);
18430 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18431 __pyx_r = __pyx_t_2;
18445 __Pyx_XDECREF(__pyx_t_1);
18446 __Pyx_XDECREF(__pyx_t_2);
18447 __Pyx_AddTraceback(
"PyClical.agc3", __pyx_clineno, __pyx_lineno, __pyx_filename);
18450 __Pyx_XGIVEREF(__pyx_r);
18451 __Pyx_RefNannyFinishContext();
18456 static PyObject *__pyx_pw_8PyClical_81agc3(PyObject *__pyx_self, PyObject *__pyx_v_obj);
18457 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 ";
18458 static PyObject *__pyx_pw_8PyClical_81agc3(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18459 PyObject *__pyx_r = 0;
18460 __Pyx_RefNannyDeclarations
18461 __Pyx_RefNannySetupContext(
"agc3 (wrapper)", 0);
18462 __pyx_r = __pyx_pf_8PyClical_80agc3(__pyx_self, ((PyObject *)__pyx_v_obj));
18465 __Pyx_RefNannyFinishContext();
18469 static PyObject *__pyx_pf_8PyClical_80agc3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18470 PyObject *__pyx_r = NULL;
18471 __Pyx_RefNannyDeclarations
18472 PyObject *__pyx_t_1 = NULL;
18473 __Pyx_RefNannySetupContext(
"agc3", 0);
18474 __Pyx_XDECREF(__pyx_r);
18475 __pyx_t_1 = __pyx_f_8PyClical_agc3(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1844, __pyx_L1_error)
18476 __Pyx_GOTREF(__pyx_t_1);
18477 __pyx_r = __pyx_t_1;
18483 __Pyx_XDECREF(__pyx_t_1);
18484 __Pyx_AddTraceback(
"PyClical.agc3", __pyx_clineno, __pyx_lineno, __pyx_filename);
18487 __Pyx_XGIVEREF(__pyx_r);
18488 __Pyx_RefNannyFinishContext();
18501 static PyObject *__pyx_pw_8PyClical_83e(PyObject *__pyx_self, PyObject *__pyx_v_obj);
18502 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 ";
18503 static PyMethodDef __pyx_mdef_8PyClical_83e = {
"e", (PyCFunction)__pyx_pw_8PyClical_83e, METH_O, __pyx_doc_8PyClical_82e};
18504 static PyObject *__pyx_pw_8PyClical_83e(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18505 PyObject *__pyx_r = 0;
18506 __Pyx_RefNannyDeclarations
18507 __Pyx_RefNannySetupContext(
"e (wrapper)", 0);
18508 __pyx_r = __pyx_pf_8PyClical_82e(__pyx_self, ((PyObject *)__pyx_v_obj));
18511 __Pyx_RefNannyFinishContext();
18515 static PyObject *__pyx_pf_8PyClical_82e(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18516 PyObject *__pyx_r = NULL;
18517 __Pyx_RefNannyDeclarations
18518 PyObject *__pyx_t_1 = NULL;
18519 PyObject *__pyx_t_2 = NULL;
18520 __Pyx_RefNannySetupContext(
"e", 0);
18529 __Pyx_XDECREF(__pyx_r);
18530 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1898, __pyx_L1_error)
18531 __Pyx_GOTREF(__pyx_t_1);
18532 __Pyx_INCREF(__pyx_v_obj);
18533 __Pyx_GIVEREF(__pyx_v_obj);
18534 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_obj);
18535 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_index_set), __pyx_t_1, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1898, __pyx_L1_error)
18536 __Pyx_GOTREF(__pyx_t_2);
18537 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18538 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1898, __pyx_L1_error)
18539 __Pyx_GOTREF(__pyx_t_1);
18540 __Pyx_GIVEREF(__pyx_t_2);
18541 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
18543 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_t_1, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1898, __pyx_L1_error)
18544 __Pyx_GOTREF(__pyx_t_2);
18545 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18546 __pyx_r = __pyx_t_2;
18560 __Pyx_XDECREF(__pyx_t_1);
18561 __Pyx_XDECREF(__pyx_t_2);
18562 __Pyx_AddTraceback(
"PyClical.e", __pyx_clineno, __pyx_lineno, __pyx_filename);
18565 __Pyx_XGIVEREF(__pyx_r);
18566 __Pyx_RefNannyFinishContext();
18579 static PyObject *__pyx_pw_8PyClical_85istpq(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
18580 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 ";
18581 static PyMethodDef __pyx_mdef_8PyClical_85istpq = {
"istpq", (PyCFunction)__pyx_pw_8PyClical_85istpq, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_84istpq};
18582 static PyObject *__pyx_pw_8PyClical_85istpq(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18583 PyObject *__pyx_v_p = 0;
18584 PyObject *__pyx_v_q = 0;
18585 PyObject *__pyx_r = 0;
18586 __Pyx_RefNannyDeclarations
18587 __Pyx_RefNannySetupContext(
"istpq (wrapper)", 0);
18589 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,&__pyx_n_s_q,0};
18590 PyObject* values[2] = {0,0};
18591 if (unlikely(__pyx_kwds)) {
18592 Py_ssize_t kw_args;
18593 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
18594 switch (pos_args) {
18595 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18596 CYTHON_FALLTHROUGH;
18597 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18598 CYTHON_FALLTHROUGH;
18600 default:
goto __pyx_L5_argtuple_error;
18602 kw_args = PyDict_Size(__pyx_kwds);
18603 switch (pos_args) {
18605 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_p)) != 0)) kw_args--;
18606 else goto __pyx_L5_argtuple_error;
18607 CYTHON_FALLTHROUGH;
18609 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q)) != 0)) kw_args--;
18611 __Pyx_RaiseArgtupleInvalid(
"istpq", 1, 2, 2, 1); __PYX_ERR(0, 1900, __pyx_L3_error)
18614 if (unlikely(kw_args > 0)) {
18615 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"istpq") < 0)) __PYX_ERR(0, 1900, __pyx_L3_error)
18617 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
18618 goto __pyx_L5_argtuple_error;
18620 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18621 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18623 __pyx_v_p = values[0];
18624 __pyx_v_q = values[1];
18626 goto __pyx_L4_argument_unpacking_done;
18627 __pyx_L5_argtuple_error:;
18628 __Pyx_RaiseArgtupleInvalid(
"istpq", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1900, __pyx_L3_error)
18630 __Pyx_AddTraceback(
"PyClical.istpq", __pyx_clineno, __pyx_lineno, __pyx_filename);
18631 __Pyx_RefNannyFinishContext();
18633 __pyx_L4_argument_unpacking_done:;
18634 __pyx_r = __pyx_pf_8PyClical_84istpq(__pyx_self, __pyx_v_p, __pyx_v_q);
18637 __Pyx_RefNannyFinishContext();
18641 static PyObject *__pyx_pf_8PyClical_84istpq(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_p, PyObject *__pyx_v_q) {
18642 PyObject *__pyx_r = NULL;
18643 __Pyx_RefNannyDeclarations
18644 PyObject *__pyx_t_1 = NULL;
18645 PyObject *__pyx_t_2 = NULL;
18646 PyObject *__pyx_t_3 = NULL;
18647 __Pyx_RefNannySetupContext(
"istpq", 0);
18656 __Pyx_XDECREF(__pyx_r);
18657 __pyx_t_1 = PyNumber_Negative(__pyx_v_q);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1907, __pyx_L1_error)
18658 __Pyx_GOTREF(__pyx_t_1);
18659 __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_p, __pyx_int_1, 1, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1907, __pyx_L1_error)
18660 __Pyx_GOTREF(__pyx_t_2);
18661 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1907, __pyx_L1_error)
18662 __Pyx_GOTREF(__pyx_t_3);
18663 __Pyx_GIVEREF(__pyx_t_1);
18664 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
18665 __Pyx_GIVEREF(__pyx_t_2);
18666 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
18669 __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)
18670 __Pyx_GOTREF(__pyx_t_2);
18671 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18672 __pyx_t_3 = PySet_New(__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1907, __pyx_L1_error)
18673 __Pyx_GOTREF(__pyx_t_3);
18674 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18675 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1907, __pyx_L1_error)
18676 __Pyx_GOTREF(__pyx_t_2);
18677 __Pyx_GIVEREF(__pyx_t_3);
18678 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
18680 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_index_set), __pyx_t_2, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1907, __pyx_L1_error)
18681 __Pyx_GOTREF(__pyx_t_3);
18682 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18683 __pyx_r = __pyx_t_3;
18697 __Pyx_XDECREF(__pyx_t_1);
18698 __Pyx_XDECREF(__pyx_t_2);
18699 __Pyx_XDECREF(__pyx_t_3);
18700 __Pyx_AddTraceback(
"PyClical.istpq", __pyx_clineno, __pyx_lineno, __pyx_filename);
18703 __Pyx_XGIVEREF(__pyx_r);
18704 __Pyx_RefNannyFinishContext();
18717 static PyObject *__pyx_pw_8PyClical_87_test(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused);
18718 static PyMethodDef __pyx_mdef_8PyClical_87_test = {
"_test", (PyCFunction)__pyx_pw_8PyClical_87_test, METH_NOARGS, 0};
18719 static PyObject *__pyx_pw_8PyClical_87_test(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
18720 PyObject *__pyx_r = 0;
18721 __Pyx_RefNannyDeclarations
18722 __Pyx_RefNannySetupContext(
"_test (wrapper)", 0);
18723 __pyx_r = __pyx_pf_8PyClical_86_test(__pyx_self);
18726 __Pyx_RefNannyFinishContext();
18730 static PyObject *__pyx_pf_8PyClical_86_test(CYTHON_UNUSED PyObject *__pyx_self) {
18731 PyObject *__pyx_v_PyClical = NULL;
18732 PyObject *__pyx_v_doctest = NULL;
18733 PyObject *__pyx_r = NULL;
18734 __Pyx_RefNannyDeclarations
18735 PyObject *__pyx_t_1 = NULL;
18736 PyObject *__pyx_t_2 = NULL;
18737 PyObject *__pyx_t_3 = NULL;
18738 PyObject *__pyx_t_4 = NULL;
18739 __Pyx_RefNannySetupContext(
"_test", 0);
18748 __pyx_t_1 = __Pyx_Import(__pyx_n_s_PyClical, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1914, __pyx_L1_error)
18749 __Pyx_GOTREF(__pyx_t_1);
18750 __pyx_v_PyClical = __pyx_t_1;
18752 __pyx_t_1 = __Pyx_Import(__pyx_n_s_doctest, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1914, __pyx_L1_error)
18753 __Pyx_GOTREF(__pyx_t_1);
18754 __pyx_v_doctest = __pyx_t_1;
18764 __Pyx_XDECREF(__pyx_r);
18765 __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)
18766 __Pyx_GOTREF(__pyx_t_2);
18768 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
18769 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
18770 if (likely(__pyx_t_3)) {
18771 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
18772 __Pyx_INCREF(__pyx_t_3);
18773 __Pyx_INCREF(
function);
18774 __Pyx_DECREF_SET(__pyx_t_2,
function);
18778 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_PyClical);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1915, __pyx_L1_error)
18779 __Pyx_GOTREF(__pyx_t_1);
18781 #if CYTHON_FAST_PYCALL 18782 if (PyFunction_Check(__pyx_t_2)) {
18783 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_PyClical};
18784 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1915, __pyx_L1_error)
18785 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18786 __Pyx_GOTREF(__pyx_t_1);
18789 #if CYTHON_FAST_PYCCALL 18790 if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
18791 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_PyClical};
18792 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1915, __pyx_L1_error)
18793 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18794 __Pyx_GOTREF(__pyx_t_1);
18798 __pyx_t_4 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1915, __pyx_L1_error)
18799 __Pyx_GOTREF(__pyx_t_4);
18800 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
18801 __Pyx_INCREF(__pyx_v_PyClical);
18802 __Pyx_GIVEREF(__pyx_v_PyClical);
18803 PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_PyClical);
18804 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1915, __pyx_L1_error)
18805 __Pyx_GOTREF(__pyx_t_1);
18806 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18809 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18810 __pyx_r = __pyx_t_1;
18824 __Pyx_XDECREF(__pyx_t_1);
18825 __Pyx_XDECREF(__pyx_t_2);
18826 __Pyx_XDECREF(__pyx_t_3);
18827 __Pyx_XDECREF(__pyx_t_4);
18828 __Pyx_AddTraceback(
"PyClical._test", __pyx_clineno, __pyx_lineno, __pyx_filename);
18831 __Pyx_XDECREF(__pyx_v_PyClical);
18832 __Pyx_XDECREF(__pyx_v_doctest);
18833 __Pyx_XGIVEREF(__pyx_r);
18834 __Pyx_RefNannyFinishContext();
18837 static struct __pyx_vtabstruct_8PyClical_index_set __pyx_vtable_8PyClical_index_set;
18839 static PyObject *__pyx_tp_new_8PyClical_index_set(PyTypeObject *t, PyObject *a, PyObject *k) {
18840 struct __pyx_obj_8PyClical_index_set *p;
18842 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
18843 o = (*t->tp_alloc)(t, 0);
18845 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
18847 if (unlikely(!o))
return 0;
18848 p = ((
struct __pyx_obj_8PyClical_index_set *)o);
18849 p->__pyx_vtab = __pyx_vtabptr_8PyClical_index_set;
18850 if (unlikely(__pyx_pw_8PyClical_9index_set_3__cinit__(o, a, k) < 0))
goto bad;
18853 Py_DECREF(o); o = 0;
18857 static void __pyx_tp_dealloc_8PyClical_index_set(PyObject *o) {
18858 #if CYTHON_USE_TP_FINALIZE 18859 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))) {
18860 if (PyObject_CallFinalizerFromDealloc(o))
return;
18864 PyObject *etype, *eval, *etb;
18865 PyErr_Fetch(&etype, &eval, &etb);
18867 __pyx_pw_8PyClical_9index_set_5__dealloc__(o);
18869 PyErr_Restore(etype, eval, etb);
18871 (*Py_TYPE(o)->tp_free)(o);
18873 static PyObject *__pyx_sq_item_8PyClical_index_set(PyObject *o, Py_ssize_t
i) {
18875 PyObject *x = PyInt_FromSsize_t(
i);
if(!x)
return 0;
18876 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
18881 static int __pyx_mp_ass_subscript_8PyClical_index_set(PyObject *o, PyObject *
i, PyObject *v) {
18883 return __pyx_pw_8PyClical_9index_set_9__setitem__(o,
i, v);
18886 PyErr_Format(PyExc_NotImplementedError,
18887 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
18892 static PyMethodDef __pyx_methods_8PyClical_index_set[] = {
18893 {
"copy", (PyCFunction)__pyx_pw_8PyClical_9index_set_1copy, METH_NOARGS, __pyx_doc_8PyClical_9index_set_copy},
18894 {
"count", (PyCFunction)__pyx_pw_8PyClical_9index_set_32count, METH_NOARGS, __pyx_doc_8PyClical_9index_set_31count},
18895 {
"count_neg", (PyCFunction)__pyx_pw_8PyClical_9index_set_34count_neg, METH_NOARGS, __pyx_doc_8PyClical_9index_set_33count_neg},
18896 {
"count_pos", (PyCFunction)__pyx_pw_8PyClical_9index_set_36count_pos, METH_NOARGS, __pyx_doc_8PyClical_9index_set_35count_pos},
18897 {
"min", (PyCFunction)__pyx_pw_8PyClical_9index_set_38min, METH_NOARGS, __pyx_doc_8PyClical_9index_set_37min},
18898 {
"max", (PyCFunction)__pyx_pw_8PyClical_9index_set_40max, METH_NOARGS, __pyx_doc_8PyClical_9index_set_39max},
18899 {
"hash_fn", (PyCFunction)__pyx_pw_8PyClical_9index_set_42hash_fn, METH_NOARGS, __pyx_doc_8PyClical_9index_set_41hash_fn},
18900 {
"sign_of_mult", (PyCFunction)__pyx_pw_8PyClical_9index_set_44sign_of_mult, METH_O, __pyx_doc_8PyClical_9index_set_43sign_of_mult},
18901 {
"sign_of_square", (PyCFunction)__pyx_pw_8PyClical_9index_set_46sign_of_square, METH_NOARGS, __pyx_doc_8PyClical_9index_set_45sign_of_square},
18902 {
"__reduce_cython__", (PyCFunction)__pyx_pw_8PyClical_9index_set_52__reduce_cython__, METH_NOARGS, 0},
18903 {
"__setstate_cython__", (PyCFunction)__pyx_pw_8PyClical_9index_set_54__setstate_cython__, METH_O, 0},
18907 static PyNumberMethods __pyx_tp_as_number_index_set = {
18911 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18921 __pyx_pw_8PyClical_9index_set_18__invert__,
18924 __pyx_pw_8PyClical_9index_set_24__and__,
18925 __pyx_pw_8PyClical_9index_set_20__xor__,
18926 __pyx_pw_8PyClical_9index_set_28__or__,
18927 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18931 #if PY_MAJOR_VERSION < 3 18937 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18940 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18946 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18953 __pyx_pw_8PyClical_9index_set_26__iand__,
18954 __pyx_pw_8PyClical_9index_set_22__ixor__,
18955 __pyx_pw_8PyClical_9index_set_30__ior__,
18961 #if PY_VERSION_HEX >= 0x03050000 18964 #if PY_VERSION_HEX >= 0x03050000 18969 static PySequenceMethods __pyx_tp_as_sequence_index_set = {
18973 __pyx_sq_item_8PyClical_index_set,
18977 __pyx_pw_8PyClical_9index_set_13__contains__,
18982 static PyMappingMethods __pyx_tp_as_mapping_index_set = {
18984 __pyx_pw_8PyClical_9index_set_11__getitem__,
18985 __pyx_mp_ass_subscript_8PyClical_index_set,
18988 static PyTypeObject __pyx_type_8PyClical_index_set = {
18989 PyVarObject_HEAD_INIT(0, 0)
18990 "PyClical.index_set",
18991 sizeof(
struct __pyx_obj_8PyClical_index_set),
18993 __pyx_tp_dealloc_8PyClical_index_set,
18997 #if PY_MAJOR_VERSION < 3
19000 #if PY_MAJOR_VERSION >= 3
19003 __pyx_pw_8PyClical_9index_set_48__repr__,
19004 &__pyx_tp_as_number_index_set,
19005 &__pyx_tp_as_sequence_index_set,
19006 &__pyx_tp_as_mapping_index_set,
19009 __pyx_pw_8PyClical_9index_set_50__str__,
19013 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
19014 "\n Python class index_set wraps C++ class IndexSet.\n ",
19017 __pyx_pw_8PyClical_9index_set_7__richcmp__,
19019 __pyx_pw_8PyClical_9index_set_15__iter__,
19021 __pyx_methods_8PyClical_index_set,
19031 __pyx_tp_new_8PyClical_index_set,
19041 #if PY_VERSION_HEX >= 0x030400a1 19045 static struct __pyx_vtabstruct_8PyClical_clifford __pyx_vtable_8PyClical_clifford;
19047 static PyObject *__pyx_tp_new_8PyClical_clifford(PyTypeObject *t, PyObject *a, PyObject *k) {
19048 struct __pyx_obj_8PyClical_clifford *p;
19050 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
19051 o = (*t->tp_alloc)(t, 0);
19053 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
19055 if (unlikely(!o))
return 0;
19056 p = ((
struct __pyx_obj_8PyClical_clifford *)o);
19057 p->__pyx_vtab = __pyx_vtabptr_8PyClical_clifford;
19058 if (unlikely(__pyx_pw_8PyClical_8clifford_3__cinit__(o, a, k) < 0))
goto bad;
19061 Py_DECREF(o); o = 0;
19065 static void __pyx_tp_dealloc_8PyClical_clifford(PyObject *o) {
19066 #if CYTHON_USE_TP_FINALIZE 19067 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))) {
19068 if (PyObject_CallFinalizerFromDealloc(o))
return;
19072 PyObject *etype, *eval, *etb;
19073 PyErr_Fetch(&etype, &eval, &etb);
19075 __pyx_pw_8PyClical_8clifford_5__dealloc__(o);
19077 PyErr_Restore(etype, eval, etb);
19079 (*Py_TYPE(o)->tp_free)(o);
19081 static PyObject *__pyx_sq_item_8PyClical_clifford(PyObject *o, Py_ssize_t
i) {
19083 PyObject *x = PyInt_FromSsize_t(
i);
if(!x)
return 0;
19084 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
19089 static PyMethodDef __pyx_methods_8PyClical_clifford[] = {
19090 {
"copy", (PyCFunction)__pyx_pw_8PyClical_8clifford_1copy, METH_NOARGS, __pyx_doc_8PyClical_8clifford_copy},
19091 {
"reframe", (PyCFunction)__pyx_pw_8PyClical_8clifford_11reframe, METH_O, __pyx_doc_8PyClical_8clifford_10reframe},
19092 {
"inv", (PyCFunction)__pyx_pw_8PyClical_8clifford_49inv, METH_NOARGS, __pyx_doc_8PyClical_8clifford_48inv},
19093 {
"pow", (PyCFunction)__pyx_pw_8PyClical_8clifford_57pow, METH_O, __pyx_doc_8PyClical_8clifford_56pow},
19094 {
"outer_pow", (PyCFunction)__pyx_pw_8PyClical_8clifford_59outer_pow, METH_O, __pyx_doc_8PyClical_8clifford_58outer_pow},
19095 {
"scalar", (PyCFunction)__pyx_pw_8PyClical_8clifford_63scalar, METH_NOARGS, __pyx_doc_8PyClical_8clifford_62scalar},
19096 {
"pure", (PyCFunction)__pyx_pw_8PyClical_8clifford_65pure, METH_NOARGS, __pyx_doc_8PyClical_8clifford_64pure},
19097 {
"even", (PyCFunction)__pyx_pw_8PyClical_8clifford_67even, METH_NOARGS, __pyx_doc_8PyClical_8clifford_66even},
19098 {
"odd", (PyCFunction)__pyx_pw_8PyClical_8clifford_69odd, METH_NOARGS, __pyx_doc_8PyClical_8clifford_68odd},
19099 {
"vector_part", (PyCFunction)__pyx_pw_8PyClical_8clifford_71vector_part, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_8clifford_70vector_part},
19100 {
"involute", (PyCFunction)__pyx_pw_8PyClical_8clifford_73involute, METH_NOARGS, __pyx_doc_8PyClical_8clifford_72involute},
19101 {
"reverse", (PyCFunction)__pyx_pw_8PyClical_8clifford_75reverse, METH_NOARGS, __pyx_doc_8PyClical_8clifford_74reverse},
19102 {
"conj", (PyCFunction)__pyx_pw_8PyClical_8clifford_77conj, METH_NOARGS, __pyx_doc_8PyClical_8clifford_76conj},
19103 {
"quad", (PyCFunction)__pyx_pw_8PyClical_8clifford_79quad, METH_NOARGS, __pyx_doc_8PyClical_8clifford_78quad},
19104 {
"norm", (PyCFunction)__pyx_pw_8PyClical_8clifford_81norm, METH_NOARGS, __pyx_doc_8PyClical_8clifford_80norm},
19105 {
"abs", (PyCFunction)__pyx_pw_8PyClical_8clifford_83abs, METH_NOARGS, __pyx_doc_8PyClical_8clifford_82abs},
19106 {
"max_abs", (PyCFunction)__pyx_pw_8PyClical_8clifford_85max_abs, METH_NOARGS, __pyx_doc_8PyClical_8clifford_84max_abs},
19107 {
"truncated", (PyCFunction)__pyx_pw_8PyClical_8clifford_87truncated, METH_O, __pyx_doc_8PyClical_8clifford_86truncated},
19108 {
"isnan", (PyCFunction)__pyx_pw_8PyClical_8clifford_89isnan, METH_NOARGS, __pyx_doc_8PyClical_8clifford_88isnan},
19109 {
"frame", (PyCFunction)__pyx_pw_8PyClical_8clifford_91frame, METH_NOARGS, __pyx_doc_8PyClical_8clifford_90frame},
19110 {
"__reduce_cython__", (PyCFunction)__pyx_pw_8PyClical_8clifford_97__reduce_cython__, METH_NOARGS, 0},
19111 {
"__setstate_cython__", (PyCFunction)__pyx_pw_8PyClical_8clifford_99__setstate_cython__, METH_O, 0},
19115 static PyNumberMethods __pyx_tp_as_number_clifford = {
19116 __pyx_pw_8PyClical_8clifford_21__add__,
19117 __pyx_pw_8PyClical_8clifford_25__sub__,
19118 __pyx_pw_8PyClical_8clifford_29__mul__,
19119 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 19120 __pyx_pw_8PyClical_8clifford_45__div__,
19122 __pyx_pw_8PyClical_8clifford_33__mod__,
19124 __pyx_pw_8PyClical_8clifford_55__pow__,
19125 __pyx_pw_8PyClical_8clifford_17__neg__,
19126 __pyx_pw_8PyClical_8clifford_19__pos__,
19132 __pyx_pw_8PyClical_8clifford_37__and__,
19133 __pyx_pw_8PyClical_8clifford_41__xor__,
19134 __pyx_pw_8PyClical_8clifford_51__or__,
19135 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 19139 #if PY_MAJOR_VERSION < 3 19145 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 19148 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 19151 __pyx_pw_8PyClical_8clifford_23__iadd__,
19152 __pyx_pw_8PyClical_8clifford_27__isub__,
19153 __pyx_pw_8PyClical_8clifford_31__imul__,
19154 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 19155 __pyx_pw_8PyClical_8clifford_47__idiv__,
19157 __pyx_pw_8PyClical_8clifford_35__imod__,
19161 __pyx_pw_8PyClical_8clifford_39__iand__,
19162 __pyx_pw_8PyClical_8clifford_43__ixor__,
19163 __pyx_pw_8PyClical_8clifford_53__ior__,
19169 #if PY_VERSION_HEX >= 0x03050000 19172 #if PY_VERSION_HEX >= 0x03050000 19177 static PySequenceMethods __pyx_tp_as_sequence_clifford = {
19181 __pyx_sq_item_8PyClical_clifford,
19185 __pyx_pw_8PyClical_8clifford_7__contains__,
19190 static PyMappingMethods __pyx_tp_as_mapping_clifford = {
19192 __pyx_pw_8PyClical_8clifford_15__getitem__,
19196 static PyTypeObject __pyx_type_8PyClical_clifford = {
19197 PyVarObject_HEAD_INIT(0, 0)
19198 "PyClical.clifford",
19199 sizeof(
struct __pyx_obj_8PyClical_clifford),
19201 __pyx_tp_dealloc_8PyClical_clifford,
19205 #if PY_MAJOR_VERSION < 3
19208 #if PY_MAJOR_VERSION >= 3
19211 __pyx_pw_8PyClical_8clifford_93__repr__,
19212 &__pyx_tp_as_number_clifford,
19213 &__pyx_tp_as_sequence_clifford,
19214 &__pyx_tp_as_mapping_clifford,
19216 __pyx_pw_8PyClical_8clifford_61__call__,
19217 __pyx_pw_8PyClical_8clifford_95__str__,
19221 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
19222 "\n Python class clifford wraps C++ class Clifford.\n ",
19225 __pyx_pw_8PyClical_8clifford_13__richcmp__,
19227 __pyx_pw_8PyClical_8clifford_9__iter__,
19229 __pyx_methods_8PyClical_clifford,
19239 __pyx_tp_new_8PyClical_clifford,
19249 #if PY_VERSION_HEX >= 0x030400a1 19254 static struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *__pyx_freelist_8PyClical___pyx_scope_struct____iter__[8];
19255 static int __pyx_freecount_8PyClical___pyx_scope_struct____iter__ = 0;
19257 static PyObject *__pyx_tp_new_8PyClical___pyx_scope_struct____iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
19259 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__)))) {
19260 o = (PyObject*)__pyx_freelist_8PyClical___pyx_scope_struct____iter__[--__pyx_freecount_8PyClical___pyx_scope_struct____iter__];
19261 memset(o, 0,
sizeof(
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__));
19262 (void) PyObject_INIT(o, t);
19263 PyObject_GC_Track(o);
19265 o = (*t->tp_alloc)(t, 0);
19266 if (unlikely(!o))
return 0;
19271 static void __pyx_tp_dealloc_8PyClical___pyx_scope_struct____iter__(PyObject *o) {
19272 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *p = (
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)o;
19273 PyObject_GC_UnTrack(o);
19274 Py_CLEAR(p->__pyx_v_idx);
19275 Py_CLEAR(p->__pyx_v_self);
19276 Py_CLEAR(p->__pyx_t_0);
19277 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__)))) {
19278 __pyx_freelist_8PyClical___pyx_scope_struct____iter__[__pyx_freecount_8PyClical___pyx_scope_struct____iter__++] = ((
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)o);
19280 (*Py_TYPE(o)->tp_free)(o);
19284 static int __pyx_tp_traverse_8PyClical___pyx_scope_struct____iter__(PyObject *o, visitproc v,
void *a) {
19286 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *p = (
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)o;
19287 if (p->__pyx_v_idx) {
19288 e = (*v)(p->__pyx_v_idx, a);
if (
e)
return e;
19290 if (p->__pyx_v_self) {
19291 e = (*v)(((PyObject *)p->__pyx_v_self), a);
if (
e)
return e;
19293 if (p->__pyx_t_0) {
19294 e = (*v)(p->__pyx_t_0, a);
if (
e)
return e;
19299 static PyTypeObject __pyx_type_8PyClical___pyx_scope_struct____iter__ = {
19300 PyVarObject_HEAD_INIT(0, 0)
19301 "PyClical.__pyx_scope_struct____iter__",
19302 sizeof(
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__),
19304 __pyx_tp_dealloc_8PyClical___pyx_scope_struct____iter__,
19308 #if PY_MAJOR_VERSION < 3
19311 #if PY_MAJOR_VERSION >= 3
19324 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
19326 __pyx_tp_traverse_8PyClical___pyx_scope_struct____iter__,
19342 __pyx_tp_new_8PyClical___pyx_scope_struct____iter__,
19352 #if PY_VERSION_HEX >= 0x030400a1 19357 static PyMethodDef __pyx_methods[] = {
19358 {
"compare", (PyCFunction)__pyx_pw_8PyClical_3compare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_2compare},
19359 {
"min_neg", (PyCFunction)__pyx_pw_8PyClical_5min_neg, METH_O, __pyx_doc_8PyClical_4min_neg},
19360 {
"max_pos", (PyCFunction)__pyx_pw_8PyClical_7max_pos, METH_O, __pyx_doc_8PyClical_6max_pos},
19361 {
"inv", (PyCFunction)__pyx_pw_8PyClical_11inv, METH_O, __pyx_doc_8PyClical_10inv},
19362 {
"scalar", (PyCFunction)__pyx_pw_8PyClical_13scalar, METH_O, __pyx_doc_8PyClical_12scalar},
19363 {
"real", (PyCFunction)__pyx_pw_8PyClical_15real, METH_O, __pyx_doc_8PyClical_14real},
19364 {
"imag", (PyCFunction)__pyx_pw_8PyClical_17imag, METH_O, __pyx_doc_8PyClical_16imag},
19365 {
"pure", (PyCFunction)__pyx_pw_8PyClical_19pure, METH_O, __pyx_doc_8PyClical_18pure},
19366 {
"even", (PyCFunction)__pyx_pw_8PyClical_21even, METH_O, __pyx_doc_8PyClical_20even},
19367 {
"odd", (PyCFunction)__pyx_pw_8PyClical_23odd, METH_O, __pyx_doc_8PyClical_22odd},
19368 {
"involute", (PyCFunction)__pyx_pw_8PyClical_25involute, METH_O, __pyx_doc_8PyClical_24involute},
19369 {
"reverse", (PyCFunction)__pyx_pw_8PyClical_27reverse, METH_O, __pyx_doc_8PyClical_26reverse},
19370 {
"conj", (PyCFunction)__pyx_pw_8PyClical_29conj, METH_O, __pyx_doc_8PyClical_28conj},
19371 {
"quad", (PyCFunction)__pyx_pw_8PyClical_31quad, METH_O, __pyx_doc_8PyClical_30quad},
19372 {
"norm", (PyCFunction)__pyx_pw_8PyClical_33norm, METH_O, __pyx_doc_8PyClical_32norm},
19373 {
"abs", (PyCFunction)__pyx_pw_8PyClical_35abs, METH_O, __pyx_doc_8PyClical_34abs},
19374 {
"max_abs", (PyCFunction)__pyx_pw_8PyClical_37max_abs, METH_O, __pyx_doc_8PyClical_36max_abs},
19375 {
"pow", (PyCFunction)__pyx_pw_8PyClical_39pow, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_38pow},
19376 {
"outer_pow", (PyCFunction)__pyx_pw_8PyClical_41outer_pow, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_40outer_pow},
19377 {
"complexifier", (PyCFunction)__pyx_pw_8PyClical_43complexifier, METH_O, __pyx_doc_8PyClical_42complexifier},
19378 {
"sqrt", (PyCFunction)__pyx_pw_8PyClical_45sqrt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_44sqrt},
19379 {
"exp", (PyCFunction)__pyx_pw_8PyClical_47exp, METH_O, __pyx_doc_8PyClical_46exp},
19380 {
"log", (PyCFunction)__pyx_pw_8PyClical_49log, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_48log},
19381 {
"cos", (PyCFunction)__pyx_pw_8PyClical_51cos, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_50cos},
19382 {
"acos", (PyCFunction)__pyx_pw_8PyClical_53acos, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_52acos},
19383 {
"cosh", (PyCFunction)__pyx_pw_8PyClical_55cosh, METH_O, __pyx_doc_8PyClical_54cosh},
19384 {
"acosh", (PyCFunction)__pyx_pw_8PyClical_57acosh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_56acosh},
19385 {
"sin", (PyCFunction)__pyx_pw_8PyClical_59sin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_58sin},
19386 {
"asin", (PyCFunction)__pyx_pw_8PyClical_61asin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_60asin},
19387 {
"sinh", (PyCFunction)__pyx_pw_8PyClical_63sinh, METH_O, __pyx_doc_8PyClical_62sinh},
19388 {
"asinh", (PyCFunction)__pyx_pw_8PyClical_65asinh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_64asinh},
19389 {
"tan", (PyCFunction)__pyx_pw_8PyClical_67tan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_66tan},
19390 {
"atan", (PyCFunction)__pyx_pw_8PyClical_69atan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_68atan},
19391 {
"tanh", (PyCFunction)__pyx_pw_8PyClical_71tanh, METH_O, __pyx_doc_8PyClical_70tanh},
19392 {
"atanh", (PyCFunction)__pyx_pw_8PyClical_73atanh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_72atanh},
19393 {
"random_clifford", (PyCFunction)__pyx_pw_8PyClical_75random_clifford, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_74random_clifford},
19394 {
"cga3", (PyCFunction)__pyx_pw_8PyClical_77cga3, METH_O, __pyx_doc_8PyClical_76cga3},
19395 {
"cga3std", (PyCFunction)__pyx_pw_8PyClical_79cga3std, METH_O, __pyx_doc_8PyClical_78cga3std},
19396 {
"agc3", (PyCFunction)__pyx_pw_8PyClical_81agc3, METH_O, __pyx_doc_8PyClical_80agc3},
19400 #if PY_MAJOR_VERSION >= 3 19401 #if CYTHON_PEP489_MULTI_PHASE_INIT 19402 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
19403 static int __pyx_pymod_exec_PyClical(PyObject* module);
19404 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
19405 {Py_mod_create, (
void*)__pyx_pymod_create},
19406 {Py_mod_exec, (
void*)__pyx_pymod_exec_PyClical},
19411 static struct PyModuleDef __pyx_moduledef = {
19412 PyModuleDef_HEAD_INIT,
19415 #if CYTHON_PEP489_MULTI_PHASE_INIT 19421 #if CYTHON_PEP489_MULTI_PHASE_INIT 19422 __pyx_moduledef_slots,
19432 static __Pyx_StringTabEntry __pyx_string_tab[] = {
19433 {&__pyx_kp_s_, __pyx_k_,
sizeof(__pyx_k_), 0, 0, 1, 0},
19434 {&__pyx_kp_s_0_8_2, __pyx_k_0_8_2,
sizeof(__pyx_k_0_8_2), 0, 0, 1, 0},
19435 {&__pyx_kp_u_Abbreviation_for_clifford_index, __pyx_k_Abbreviation_for_clifford_index,
sizeof(__pyx_k_Abbreviation_for_clifford_index), 0, 1, 0, 0},
19436 {&__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},
19437 {&__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},
19438 {&__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},
19439 {&__pyx_kp_s_Cannot_initialize_clifford_objec, __pyx_k_Cannot_initialize_clifford_objec,
sizeof(__pyx_k_Cannot_initialize_clifford_objec), 0, 0, 1, 0},
19440 {&__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},
19441 {&__pyx_kp_s_Cannot_reframe, __pyx_k_Cannot_reframe,
sizeof(__pyx_k_Cannot_reframe), 0, 0, 1, 0},
19442 {&__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},
19443 {&__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},
19444 {&__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},
19445 {&__pyx_kp_u_Conjugation_reverse_o_involute, __pyx_k_Conjugation_reverse_o_involute,
sizeof(__pyx_k_Conjugation_reverse_o_involute), 0, 1, 0, 0},
19446 {&__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},
19447 {&__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},
19448 {&__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},
19449 {&__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},
19450 {&__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},
19451 {&__pyx_kp_u_Convert_Euclidean_3D_multivecto, __pyx_k_Convert_Euclidean_3D_multivecto,
sizeof(__pyx_k_Convert_Euclidean_3D_multivecto), 0, 1, 0, 0},
19452 {&__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},
19453 {&__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},
19454 {&__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},
19455 {&__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},
19456 {&__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},
19457 {&__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},
19458 {&__pyx_kp_u_Geometric_difference_print_clif, __pyx_k_Geometric_difference_print_clif,
sizeof(__pyx_k_Geometric_difference_print_clif), 0, 1, 0, 0},
19459 {&__pyx_kp_u_Geometric_difference_x_clifford, __pyx_k_Geometric_difference_x_clifford,
sizeof(__pyx_k_Geometric_difference_x_clifford), 0, 1, 0, 0},
19460 {&__pyx_kp_u_Geometric_multiplicative_invers, __pyx_k_Geometric_multiplicative_invers,
sizeof(__pyx_k_Geometric_multiplicative_invers), 0, 1, 0, 0},
19461 {&__pyx_kp_u_Geometric_multiplicative_invers_2, __pyx_k_Geometric_multiplicative_invers_2,
sizeof(__pyx_k_Geometric_multiplicative_invers_2), 0, 1, 0, 0},
19462 {&__pyx_kp_u_Geometric_product_print_cliffor, __pyx_k_Geometric_product_print_cliffor,
sizeof(__pyx_k_Geometric_product_print_cliffor), 0, 1, 0, 0},
19463 {&__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},
19464 {&__pyx_kp_u_Geometric_quotient_print_cliffo, __pyx_k_Geometric_quotient_print_cliffo,
sizeof(__pyx_k_Geometric_quotient_print_cliffo), 0, 1, 0, 0},
19465 {&__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},
19466 {&__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},
19467 {&__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},
19468 {&__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},
19469 {&__pyx_kp_u_Hyperbolic_cosine_of_multivecto, __pyx_k_Hyperbolic_cosine_of_multivecto,
sizeof(__pyx_k_Hyperbolic_cosine_of_multivecto), 0, 1, 0, 0},
19470 {&__pyx_kp_u_Hyperbolic_sine_of_multivector, __pyx_k_Hyperbolic_sine_of_multivector,
sizeof(__pyx_k_Hyperbolic_sine_of_multivector), 0, 1, 0, 0},
19471 {&__pyx_kp_u_Hyperbolic_tangent_of_multivect, __pyx_k_Hyperbolic_tangent_of_multivect,
sizeof(__pyx_k_Hyperbolic_tangent_of_multivect), 0, 1, 0, 0},
19472 {&__pyx_kp_u_Imaginary_part_deprecated_alway, __pyx_k_Imaginary_part_deprecated_alway,
sizeof(__pyx_k_Imaginary_part_deprecated_alway), 0, 1, 0, 0},
19473 {&__pyx_n_s_IndexError, __pyx_k_IndexError,
sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
19474 {&__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},
19475 {&__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},
19476 {&__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},
19477 {&__pyx_n_s_Integral, __pyx_k_Integral,
sizeof(__pyx_k_Integral), 0, 0, 1, 1},
19478 {&__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},
19479 {&__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},
19480 {&__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},
19481 {&__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},
19482 {&__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},
19483 {&__pyx_kp_u_Inverse_tangent_of_multivector, __pyx_k_Inverse_tangent_of_multivector,
sizeof(__pyx_k_Inverse_tangent_of_multivector), 0, 1, 0, 0},
19484 {&__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},
19485 {&__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},
19486 {&__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},
19487 {&__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},
19488 {&__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},
19489 {&__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},
19490 {&__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},
19491 {&__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},
19492 {&__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},
19493 {&__pyx_kp_u_Natural_logarithm_of_multivecto, __pyx_k_Natural_logarithm_of_multivecto,
sizeof(__pyx_k_Natural_logarithm_of_multivecto), 0, 1, 0, 0},
19494 {&__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},
19495 {&__pyx_n_s_NotImplemented, __pyx_k_NotImplemented,
sizeof(__pyx_k_NotImplemented), 0, 0, 1, 1},
19496 {&__pyx_kp_s_Not_applicable, __pyx_k_Not_applicable,
sizeof(__pyx_k_Not_applicable), 0, 0, 1, 0},
19497 {&__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},
19498 {&__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},
19499 {&__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},
19500 {&__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},
19501 {&__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},
19502 {&__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},
19503 {&__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},
19504 {&__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},
19505 {&__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},
19506 {&__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},
19507 {&__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},
19508 {&__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},
19509 {&__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},
19510 {&__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},
19511 {&__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},
19512 {&__pyx_n_s_PyClical, __pyx_k_PyClical,
sizeof(__pyx_k_PyClical), 0, 0, 1, 1},
19513 {&__pyx_kp_s_PyClical_pyx, __pyx_k_PyClical_pyx,
sizeof(__pyx_k_PyClical_pyx), 0, 0, 1, 0},
19514 {&__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},
19515 {&__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},
19516 {&__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},
19517 {&__pyx_n_s_Real, __pyx_k_Real,
sizeof(__pyx_k_Real), 0, 0, 1, 1},
19518 {&__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},
19519 {&__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},
19520 {&__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},
19521 {&__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},
19522 {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError,
sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
19523 {&__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},
19524 {&__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},
19525 {&__pyx_n_s_Sequence, __pyx_k_Sequence,
sizeof(__pyx_k_Sequence), 0, 0, 1, 1},
19526 {&__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},
19527 {&__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},
19528 {&__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},
19529 {&__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},
19530 {&__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},
19531 {&__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},
19532 {&__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},
19533 {&__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},
19534 {&__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},
19535 {&__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},
19536 {&__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},
19537 {&__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},
19538 {&__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},
19539 {&__pyx_kp_u_Symmetric_set_difference_exclus, __pyx_k_Symmetric_set_difference_exclus,
sizeof(__pyx_k_Symmetric_set_difference_exclus), 0, 1, 0, 0},
19540 {&__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},
19541 {&__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},
19542 {&__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},
19543 {&__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},
19544 {&__pyx_kp_u_The_informal_string_representat, __pyx_k_The_informal_string_representat,
sizeof(__pyx_k_The_informal_string_representat), 0, 1, 0, 0},
19545 {&__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},
19546 {&__pyx_kp_u_The_official_string_representat, __pyx_k_The_official_string_representat,
sizeof(__pyx_k_The_official_string_representat), 0, 1, 0, 0},
19547 {&__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},
19548 {&__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},
19549 {&__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},
19550 {&__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},
19551 {&__pyx_n_s_TypeError, __pyx_k_TypeError,
sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
19552 {&__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},
19553 {&__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},
19554 {&__pyx_n_s_ValueError, __pyx_k_ValueError,
sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
19555 {&__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},
19556 {&__pyx_kp_s__2, __pyx_k__2,
sizeof(__pyx_k__2), 0, 0, 1, 0},
19557 {&__pyx_kp_s__5, __pyx_k__5,
sizeof(__pyx_k__5), 0, 0, 1, 0},
19558 {&__pyx_kp_s__6, __pyx_k__6,
sizeof(__pyx_k__6), 0, 0, 1, 0},
19559 {&__pyx_kp_s__7, __pyx_k__7,
sizeof(__pyx_k__7), 0, 0, 1, 0},
19560 {&__pyx_kp_s__8, __pyx_k__8,
sizeof(__pyx_k__8), 0, 0, 1, 0},
19561 {&__pyx_kp_s__9, __pyx_k__9,
sizeof(__pyx_k__9), 0, 0, 1, 0},
19562 {&__pyx_kp_u_abs_line_1473, __pyx_k_abs_line_1473,
sizeof(__pyx_k_abs_line_1473), 0, 1, 0, 0},
19563 {&__pyx_n_s_acos, __pyx_k_acos,
sizeof(__pyx_k_acos), 0, 0, 1, 1},
19564 {&__pyx_kp_u_acos_line_1619, __pyx_k_acos_line_1619,
sizeof(__pyx_k_acos_line_1619), 0, 1, 0, 0},
19565 {&__pyx_n_s_acosh, __pyx_k_acosh,
sizeof(__pyx_k_acosh), 0, 0, 1, 1},
19566 {&__pyx_kp_u_acosh_line_1656, __pyx_k_acosh_line_1656,
sizeof(__pyx_k_acosh_line_1656), 0, 1, 0, 0},
19567 {&__pyx_kp_u_agc3_line_1844, __pyx_k_agc3_line_1844,
sizeof(__pyx_k_agc3_line_1844), 0, 1, 0, 0},
19568 {&__pyx_n_s_args, __pyx_k_args,
sizeof(__pyx_k_args), 0, 0, 1, 1},
19569 {&__pyx_kp_s_as_frame, __pyx_k_as_frame,
sizeof(__pyx_k_as_frame), 0, 0, 1, 0},
19570 {&__pyx_n_s_asin, __pyx_k_asin,
sizeof(__pyx_k_asin), 0, 0, 1, 1},
19571 {&__pyx_kp_u_asin_line_1698, __pyx_k_asin_line_1698,
sizeof(__pyx_k_asin_line_1698), 0, 1, 0, 0},
19572 {&__pyx_n_s_asinh, __pyx_k_asinh,
sizeof(__pyx_k_asinh), 0, 0, 1, 1},
19573 {&__pyx_kp_u_asinh_line_1733, __pyx_k_asinh_line_1733,
sizeof(__pyx_k_asinh_line_1733), 0, 1, 0, 0},
19574 {&__pyx_n_s_atan, __pyx_k_atan,
sizeof(__pyx_k_atan), 0, 0, 1, 1},
19575 {&__pyx_kp_u_atan_line_1769, __pyx_k_atan_line_1769,
sizeof(__pyx_k_atan_line_1769), 0, 1, 0, 0},
19576 {&__pyx_n_s_atanh, __pyx_k_atanh,
sizeof(__pyx_k_atanh), 0, 0, 1, 1},
19577 {&__pyx_kp_u_atanh_line_1798, __pyx_k_atanh_line_1798,
sizeof(__pyx_k_atanh_line_1798), 0, 1, 0, 0},
19578 {&__pyx_kp_u_cga3_line_1824, __pyx_k_cga3_line_1824,
sizeof(__pyx_k_cga3_line_1824), 0, 1, 0, 0},
19579 {&__pyx_kp_u_cga3std_line_1833, __pyx_k_cga3std_line_1833,
sizeof(__pyx_k_cga3std_line_1833), 0, 1, 0, 0},
19580 {&__pyx_n_s_cl, __pyx_k_cl,
sizeof(__pyx_k_cl), 0, 0, 1, 1},
19581 {&__pyx_kp_u_clifford___add___line_739, __pyx_k_clifford___add___line_739,
sizeof(__pyx_k_clifford___add___line_739), 0, 1, 0, 0},
19582 {&__pyx_kp_u_clifford___and___line_835, __pyx_k_clifford___and___line_835,
sizeof(__pyx_k_clifford___and___line_835), 0, 1, 0, 0},
19583 {&__pyx_kp_u_clifford___call___line_1019, __pyx_k_clifford___call___line_1019,
sizeof(__pyx_k_clifford___call___line_1019), 0, 1, 0, 0},
19584 {&__pyx_kp_u_clifford___div___line_895, __pyx_k_clifford___div___line_895,
sizeof(__pyx_k_clifford___div___line_895), 0, 1, 0, 0},
19585 {&__pyx_kp_u_clifford___getitem___line_706, __pyx_k_clifford___getitem___line_706,
sizeof(__pyx_k_clifford___getitem___line_706), 0, 1, 0, 0},
19586 {&__pyx_kp_u_clifford___iadd___line_750, __pyx_k_clifford___iadd___line_750,
sizeof(__pyx_k_clifford___iadd___line_750), 0, 1, 0, 0},
19587 {&__pyx_kp_u_clifford___iand___line_850, __pyx_k_clifford___iand___line_850,
sizeof(__pyx_k_clifford___iand___line_850), 0, 1, 0, 0},
19588 {&__pyx_kp_u_clifford___idiv___line_910, __pyx_k_clifford___idiv___line_910,
sizeof(__pyx_k_clifford___idiv___line_910), 0, 1, 0, 0},
19589 {&__pyx_kp_u_clifford___imod___line_820, __pyx_k_clifford___imod___line_820,
sizeof(__pyx_k_clifford___imod___line_820), 0, 1, 0, 0},
19590 {&__pyx_kp_u_clifford___imul___line_792, __pyx_k_clifford___imul___line_792,
sizeof(__pyx_k_clifford___imul___line_792), 0, 1, 0, 0},
19591 {&__pyx_kp_u_clifford___ior___line_949, __pyx_k_clifford___ior___line_949,
sizeof(__pyx_k_clifford___ior___line_949), 0, 1, 0, 0},
19592 {&__pyx_kp_u_clifford___isub___line_770, __pyx_k_clifford___isub___line_770,
sizeof(__pyx_k_clifford___isub___line_770), 0, 1, 0, 0},
19593 {&__pyx_kp_u_clifford___iter___line_637, __pyx_k_clifford___iter___line_637,
sizeof(__pyx_k_clifford___iter___line_637), 0, 1, 0, 0},
19594 {&__pyx_kp_u_clifford___ixor___line_880, __pyx_k_clifford___ixor___line_880,
sizeof(__pyx_k_clifford___ixor___line_880), 0, 1, 0, 0},
19595 {&__pyx_kp_u_clifford___mod___line_805, __pyx_k_clifford___mod___line_805,
sizeof(__pyx_k_clifford___mod___line_805), 0, 1, 0, 0},
19596 {&__pyx_kp_u_clifford___mul___line_779, __pyx_k_clifford___mul___line_779,
sizeof(__pyx_k_clifford___mul___line_779), 0, 1, 0, 0},
19597 {&__pyx_kp_u_clifford___neg___line_721, __pyx_k_clifford___neg___line_721,
sizeof(__pyx_k_clifford___neg___line_721), 0, 1, 0, 0},
19598 {&__pyx_kp_u_clifford___or___line_938, __pyx_k_clifford___or___line_938,
sizeof(__pyx_k_clifford___or___line_938), 0, 1, 0, 0},
19599 {&__pyx_kp_u_clifford___pos___line_730, __pyx_k_clifford___pos___line_730,
sizeof(__pyx_k_clifford___pos___line_730), 0, 1, 0, 0},
19600 {&__pyx_kp_u_clifford___pow___line_960, __pyx_k_clifford___pow___line_960,
sizeof(__pyx_k_clifford___pow___line_960), 0, 1, 0, 0},
19601 {&__pyx_kp_u_clifford___repr___line_1225, __pyx_k_clifford___repr___line_1225,
sizeof(__pyx_k_clifford___repr___line_1225), 0, 1, 0, 0},
19602 {&__pyx_kp_u_clifford___str___line_1234, __pyx_k_clifford___str___line_1234,
sizeof(__pyx_k_clifford___str___line_1234), 0, 1, 0, 0},
19603 {&__pyx_kp_u_clifford___sub___line_759, __pyx_k_clifford___sub___line_759,
sizeof(__pyx_k_clifford___sub___line_759), 0, 1, 0, 0},
19604 {&__pyx_kp_u_clifford___xor___line_865, __pyx_k_clifford___xor___line_865,
sizeof(__pyx_k_clifford___xor___line_865), 0, 1, 0, 0},
19605 {&__pyx_kp_u_clifford_abs_line_1174, __pyx_k_clifford_abs_line_1174,
sizeof(__pyx_k_clifford_abs_line_1174), 0, 1, 0, 0},
19606 {&__pyx_kp_u_clifford_conj_line_1137, __pyx_k_clifford_conj_line_1137,
sizeof(__pyx_k_clifford_conj_line_1137), 0, 1, 0, 0},
19607 {&__pyx_kp_u_clifford_copy_line_554, __pyx_k_clifford_copy_line_554,
sizeof(__pyx_k_clifford_copy_line_554), 0, 1, 0, 0},
19608 {&__pyx_kp_u_clifford_even_line_1060, __pyx_k_clifford_even_line_1060,
sizeof(__pyx_k_clifford_even_line_1060), 0, 1, 0, 0},
19609 {&__pyx_kp_u_clifford_frame_line_1214, __pyx_k_clifford_frame_line_1214,
sizeof(__pyx_k_clifford_frame_line_1214), 0, 1, 0, 0},
19610 {&__pyx_n_s_clifford_hidden_doctests, __pyx_k_clifford_hidden_doctests,
sizeof(__pyx_k_clifford_hidden_doctests), 0, 0, 1, 1},
19611 {&__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},
19612 {&__pyx_kp_u_clifford_inv_line_925, __pyx_k_clifford_inv_line_925,
sizeof(__pyx_k_clifford_inv_line_925), 0, 1, 0, 0},
19613 {&__pyx_kp_u_clifford_involute_line_1106, __pyx_k_clifford_involute_line_1106,
sizeof(__pyx_k_clifford_involute_line_1106), 0, 1, 0, 0},
19614 {&__pyx_kp_u_clifford_isnan_line_1205, __pyx_k_clifford_isnan_line_1205,
sizeof(__pyx_k_clifford_isnan_line_1205), 0, 1, 0, 0},
19615 {&__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},
19616 {&__pyx_kp_u_clifford_norm_line_1163, __pyx_k_clifford_norm_line_1163,
sizeof(__pyx_k_clifford_norm_line_1163), 0, 1, 0, 0},
19617 {&__pyx_kp_u_clifford_odd_line_1069, __pyx_k_clifford_odd_line_1069,
sizeof(__pyx_k_clifford_odd_line_1069), 0, 1, 0, 0},
19618 {&__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},
19619 {&__pyx_kp_u_clifford_pow_line_979, __pyx_k_clifford_pow_line_979,
sizeof(__pyx_k_clifford_pow_line_979), 0, 1, 0, 0},
19620 {&__pyx_kp_u_clifford_pure_line_1049, __pyx_k_clifford_pure_line_1049,
sizeof(__pyx_k_clifford_pure_line_1049), 0, 1, 0, 0},
19621 {&__pyx_kp_u_clifford_quad_line_1152, __pyx_k_clifford_quad_line_1152,
sizeof(__pyx_k_clifford_quad_line_1152), 0, 1, 0, 0},
19622 {&__pyx_kp_u_clifford_reframe_line_648, __pyx_k_clifford_reframe_line_648,
sizeof(__pyx_k_clifford_reframe_line_648), 0, 1, 0, 0},
19623 {&__pyx_kp_u_clifford_reverse_line_1122, __pyx_k_clifford_reverse_line_1122,
sizeof(__pyx_k_clifford_reverse_line_1122), 0, 1, 0, 0},
19624 {&__pyx_kp_u_clifford_scalar_line_1038, __pyx_k_clifford_scalar_line_1038,
sizeof(__pyx_k_clifford_scalar_line_1038), 0, 1, 0, 0},
19625 {&__pyx_kp_u_clifford_truncated_line_1194, __pyx_k_clifford_truncated_line_1194,
sizeof(__pyx_k_clifford_truncated_line_1194), 0, 1, 0, 0},
19626 {&__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},
19627 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback,
sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
19628 {&__pyx_n_s_close, __pyx_k_close,
sizeof(__pyx_k_close), 0, 0, 1, 1},
19629 {&__pyx_n_s_collections, __pyx_k_collections,
sizeof(__pyx_k_collections), 0, 0, 1, 1},
19630 {&__pyx_kp_u_compare_line_490, __pyx_k_compare_line_490,
sizeof(__pyx_k_compare_line_490), 0, 1, 0, 0},
19631 {&__pyx_kp_u_complexifier_line_1527, __pyx_k_complexifier_line_1527,
sizeof(__pyx_k_complexifier_line_1527), 0, 1, 0, 0},
19632 {&__pyx_n_s_conj, __pyx_k_conj,
sizeof(__pyx_k_conj), 0, 0, 1, 1},
19633 {&__pyx_kp_u_conj_line_1436, __pyx_k_conj_line_1436,
sizeof(__pyx_k_conj_line_1436), 0, 1, 0, 0},
19634 {&__pyx_n_s_copy, __pyx_k_copy,
sizeof(__pyx_k_copy), 0, 0, 1, 1},
19635 {&__pyx_n_s_cos, __pyx_k_cos,
sizeof(__pyx_k_cos), 0, 0, 1, 1},
19636 {&__pyx_kp_u_cos_line_1602, __pyx_k_cos_line_1602,
sizeof(__pyx_k_cos_line_1602), 0, 1, 0, 0},
19637 {&__pyx_n_s_cosh, __pyx_k_cosh,
sizeof(__pyx_k_cosh), 0, 0, 1, 1},
19638 {&__pyx_kp_u_cosh_line_1640, __pyx_k_cosh_line_1640,
sizeof(__pyx_k_cosh_line_1640), 0, 1, 0, 0},
19639 {&__pyx_n_s_doctest, __pyx_k_doctest,
sizeof(__pyx_k_doctest), 0, 0, 1, 1},
19640 {&__pyx_n_s_e, __pyx_k_e,
sizeof(__pyx_k_e), 0, 0, 1, 1},
19641 {&__pyx_kp_u_e_line_1887, __pyx_k_e_line_1887,
sizeof(__pyx_k_e_line_1887), 0, 1, 0, 0},
19642 {&__pyx_n_s_even, __pyx_k_even,
sizeof(__pyx_k_even), 0, 0, 1, 1},
19643 {&__pyx_kp_u_even_line_1388, __pyx_k_even_line_1388,
sizeof(__pyx_k_even_line_1388), 0, 1, 0, 0},
19644 {&__pyx_n_s_exp, __pyx_k_exp,
sizeof(__pyx_k_exp), 0, 0, 1, 1},
19645 {&__pyx_kp_u_exp_line_1565, __pyx_k_exp_line_1565,
sizeof(__pyx_k_exp_line_1565), 0, 1, 0, 0},
19646 {&__pyx_n_s_fill, __pyx_k_fill,
sizeof(__pyx_k_fill), 0, 0, 1, 1},
19647 {&__pyx_n_s_frm, __pyx_k_frm,
sizeof(__pyx_k_frm), 0, 0, 1, 1},
19648 {&__pyx_kp_s_from, __pyx_k_from,
sizeof(__pyx_k_from), 0, 0, 1, 0},
19649 {&__pyx_n_s_getstate, __pyx_k_getstate,
sizeof(__pyx_k_getstate), 0, 0, 1, 1},
19650 {&__pyx_n_s_grade, __pyx_k_grade,
sizeof(__pyx_k_grade), 0, 0, 1, 1},
19651 {&__pyx_n_s_i, __pyx_k_i,
sizeof(__pyx_k_i), 0, 0, 1, 1},
19652 {&__pyx_kp_u_imag_line_1366, __pyx_k_imag_line_1366,
sizeof(__pyx_k_imag_line_1366), 0, 1, 0, 0},
19653 {&__pyx_n_s_import, __pyx_k_import,
sizeof(__pyx_k_import), 0, 0, 1, 1},
19654 {&__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},
19655 {&__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},
19656 {&__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},
19657 {&__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},
19658 {&__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},
19659 {&__pyx_n_s_index_set___iter, __pyx_k_index_set___iter,
sizeof(__pyx_k_index_set___iter), 0, 0, 1, 1},
19660 {&__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},
19661 {&__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},
19662 {&__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},
19663 {&__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},
19664 {&__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},
19665 {&__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},
19666 {&__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},
19667 {&__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},
19668 {&__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},
19669 {&__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},
19670 {&__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},
19671 {&__pyx_n_s_index_set_hidden_doctests, __pyx_k_index_set_hidden_doctests,
sizeof(__pyx_k_index_set_hidden_doctests), 0, 0, 1, 1},
19672 {&__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},
19673 {&__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},
19674 {&__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},
19675 {&__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},
19676 {&__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},
19677 {&__pyx_n_s_inv, __pyx_k_inv,
sizeof(__pyx_k_inv), 0, 0, 1, 1},
19678 {&__pyx_kp_u_inv_line_1329, __pyx_k_inv_line_1329,
sizeof(__pyx_k_inv_line_1329), 0, 1, 0, 0},
19679 {&__pyx_kp_s_invalid, __pyx_k_invalid,
sizeof(__pyx_k_invalid), 0, 0, 1, 0},
19680 {&__pyx_kp_s_invalid_string, __pyx_k_invalid_string,
sizeof(__pyx_k_invalid_string), 0, 0, 1, 0},
19681 {&__pyx_n_s_involute, __pyx_k_involute,
sizeof(__pyx_k_involute), 0, 0, 1, 1},
19682 {&__pyx_kp_u_involute_line_1406, __pyx_k_involute_line_1406,
sizeof(__pyx_k_involute_line_1406), 0, 1, 0, 0},
19683 {&__pyx_n_s_ist, __pyx_k_ist,
sizeof(__pyx_k_ist), 0, 0, 1, 1},
19684 {&__pyx_n_s_istpq, __pyx_k_istpq,
sizeof(__pyx_k_istpq), 0, 0, 1, 1},
19685 {&__pyx_kp_u_istpq_line_1900, __pyx_k_istpq_line_1900,
sizeof(__pyx_k_istpq_line_1900), 0, 1, 0, 0},
19686 {&__pyx_n_s_iter, __pyx_k_iter,
sizeof(__pyx_k_iter), 0, 0, 1, 1},
19687 {&__pyx_n_s_ixt, __pyx_k_ixt,
sizeof(__pyx_k_ixt), 0, 0, 1, 1},
19688 {&__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},
19689 {&__pyx_n_s_lhs, __pyx_k_lhs,
sizeof(__pyx_k_lhs), 0, 0, 1, 1},
19690 {&__pyx_n_s_log, __pyx_k_log,
sizeof(__pyx_k_log), 0, 0, 1, 1},
19691 {&__pyx_kp_u_log_line_1579, __pyx_k_log_line_1579,
sizeof(__pyx_k_log_line_1579), 0, 1, 0, 0},
19692 {&__pyx_n_s_m, __pyx_k_m,
sizeof(__pyx_k_m), 0, 0, 1, 1},
19693 {&__pyx_n_s_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 0, 1, 1},
19694 {&__pyx_n_s_math, __pyx_k_math,
sizeof(__pyx_k_math), 0, 0, 1, 1},
19695 {&__pyx_n_s_max, __pyx_k_max,
sizeof(__pyx_k_max), 0, 0, 1, 1},
19696 {&__pyx_kp_u_max_abs_line_1482, __pyx_k_max_abs_line_1482,
sizeof(__pyx_k_max_abs_line_1482), 0, 1, 0, 0},
19697 {&__pyx_kp_u_max_pos_line_511, __pyx_k_max_pos_line_511,
sizeof(__pyx_k_max_pos_line_511), 0, 1, 0, 0},
19698 {&__pyx_n_s_min, __pyx_k_min,
sizeof(__pyx_k_min), 0, 0, 1, 1},
19699 {&__pyx_kp_u_min_neg_line_502, __pyx_k_min_neg_line_502,
sizeof(__pyx_k_min_neg_line_502), 0, 1, 0, 0},
19700 {&__pyx_n_s_name, __pyx_k_name,
sizeof(__pyx_k_name), 0, 0, 1, 1},
19701 {&__pyx_n_s_nbar3, __pyx_k_nbar3,
sizeof(__pyx_k_nbar3), 0, 0, 1, 1},
19702 {&__pyx_n_s_ninf3, __pyx_k_ninf3,
sizeof(__pyx_k_ninf3), 0, 0, 1, 1},
19703 {&__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},
19704 {&__pyx_n_s_norm, __pyx_k_norm,
sizeof(__pyx_k_norm), 0, 0, 1, 1},
19705 {&__pyx_kp_u_norm_line_1462, __pyx_k_norm_line_1462,
sizeof(__pyx_k_norm_line_1462), 0, 1, 0, 0},
19706 {&__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},
19707 {&__pyx_n_s_numbers, __pyx_k_numbers,
sizeof(__pyx_k_numbers), 0, 0, 1, 1},
19708 {&__pyx_n_s_obj, __pyx_k_obj,
sizeof(__pyx_k_obj), 0, 0, 1, 1},
19709 {&__pyx_n_s_odd, __pyx_k_odd,
sizeof(__pyx_k_odd), 0, 0, 1, 1},
19710 {&__pyx_kp_u_odd_line_1397, __pyx_k_odd_line_1397,
sizeof(__pyx_k_odd_line_1397), 0, 1, 0, 0},
19711 {&__pyx_n_s_other, __pyx_k_other,
sizeof(__pyx_k_other), 0, 0, 1, 1},
19712 {&__pyx_n_s_outer_pow, __pyx_k_outer_pow,
sizeof(__pyx_k_outer_pow), 0, 0, 1, 1},
19713 {&__pyx_kp_u_outer_pow_line_1518, __pyx_k_outer_pow_line_1518,
sizeof(__pyx_k_outer_pow_line_1518), 0, 1, 0, 0},
19714 {&__pyx_n_s_p, __pyx_k_p,
sizeof(__pyx_k_p), 0, 0, 1, 1},
19715 {&__pyx_n_s_pi, __pyx_k_pi,
sizeof(__pyx_k_pi), 0, 0, 1, 1},
19716 {&__pyx_n_s_pow, __pyx_k_pow,
sizeof(__pyx_k_pow), 0, 0, 1, 1},
19717 {&__pyx_kp_u_pow_line_1494, __pyx_k_pow_line_1494,
sizeof(__pyx_k_pow_line_1494), 0, 1, 0, 0},
19718 {&__pyx_n_s_pure, __pyx_k_pure,
sizeof(__pyx_k_pure), 0, 0, 1, 1},
19719 {&__pyx_kp_u_pure_line_1377, __pyx_k_pure_line_1377,
sizeof(__pyx_k_pure_line_1377), 0, 1, 0, 0},
19720 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable,
sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
19721 {&__pyx_n_s_q, __pyx_k_q,
sizeof(__pyx_k_q), 0, 0, 1, 1},
19722 {&__pyx_n_s_quad, __pyx_k_quad,
sizeof(__pyx_k_quad), 0, 0, 1, 1},
19723 {&__pyx_kp_u_quad_line_1451, __pyx_k_quad_line_1451,
sizeof(__pyx_k_quad_line_1451), 0, 1, 0, 0},
19724 {&__pyx_kp_u_random_clifford_line_1815, __pyx_k_random_clifford_line_1815,
sizeof(__pyx_k_random_clifford_line_1815), 0, 1, 0, 0},
19725 {&__pyx_n_s_range, __pyx_k_range,
sizeof(__pyx_k_range), 0, 0, 1, 1},
19726 {&__pyx_kp_u_real_line_1355, __pyx_k_real_line_1355,
sizeof(__pyx_k_real_line_1355), 0, 1, 0, 0},
19727 {&__pyx_n_s_reduce, __pyx_k_reduce,
sizeof(__pyx_k_reduce), 0, 0, 1, 1},
19728 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython,
sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
19729 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex,
sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
19730 {&__pyx_n_s_reverse, __pyx_k_reverse,
sizeof(__pyx_k_reverse), 0, 0, 1, 1},
19731 {&__pyx_kp_u_reverse_line_1421, __pyx_k_reverse_line_1421,
sizeof(__pyx_k_reverse_line_1421), 0, 1, 0, 0},
19732 {&__pyx_n_s_rhs, __pyx_k_rhs,
sizeof(__pyx_k_rhs), 0, 0, 1, 1},
19733 {&__pyx_n_s_scalar, __pyx_k_scalar,
sizeof(__pyx_k_scalar), 0, 0, 1, 1},
19734 {&__pyx_kp_u_scalar_line_1344, __pyx_k_scalar_line_1344,
sizeof(__pyx_k_scalar_line_1344), 0, 1, 0, 0},
19735 {&__pyx_n_s_send, __pyx_k_send,
sizeof(__pyx_k_send), 0, 0, 1, 1},
19736 {&__pyx_n_s_setstate, __pyx_k_setstate,
sizeof(__pyx_k_setstate), 0, 0, 1, 1},
19737 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython,
sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
19738 {&__pyx_n_s_sin, __pyx_k_sin,
sizeof(__pyx_k_sin), 0, 0, 1, 1},
19739 {&__pyx_kp_u_sin_line_1679, __pyx_k_sin_line_1679,
sizeof(__pyx_k_sin_line_1679), 0, 1, 0, 0},
19740 {&__pyx_n_s_sinh, __pyx_k_sinh,
sizeof(__pyx_k_sinh), 0, 0, 1, 1},
19741 {&__pyx_kp_u_sinh_line_1719, __pyx_k_sinh_line_1719,
sizeof(__pyx_k_sinh_line_1719), 0, 1, 0, 0},
19742 {&__pyx_n_s_sqrt, __pyx_k_sqrt,
sizeof(__pyx_k_sqrt), 0, 0, 1, 1},
19743 {&__pyx_kp_u_sqrt_line_1542, __pyx_k_sqrt_line_1542,
sizeof(__pyx_k_sqrt_line_1542), 0, 1, 0, 0},
19744 {&__pyx_n_s_tan, __pyx_k_tan,
sizeof(__pyx_k_tan), 0, 0, 1, 1},
19745 {&__pyx_kp_u_tan_line_1752, __pyx_k_tan_line_1752,
sizeof(__pyx_k_tan_line_1752), 0, 1, 0, 0},
19746 {&__pyx_n_s_tanh, __pyx_k_tanh,
sizeof(__pyx_k_tanh), 0, 0, 1, 1},
19747 {&__pyx_kp_u_tanh_line_1786, __pyx_k_tanh_line_1786,
sizeof(__pyx_k_tanh_line_1786), 0, 1, 0, 0},
19748 {&__pyx_n_s_tau, __pyx_k_tau,
sizeof(__pyx_k_tau), 0, 0, 1, 1},
19749 {&__pyx_n_s_test, __pyx_k_test,
sizeof(__pyx_k_test), 0, 0, 1, 1},
19750 {&__pyx_n_s_test_2, __pyx_k_test_2,
sizeof(__pyx_k_test_2), 0, 0, 1, 1},
19751 {&__pyx_n_s_testmod, __pyx_k_testmod,
sizeof(__pyx_k_testmod), 0, 0, 1, 1},
19752 {&__pyx_n_s_throw, __pyx_k_throw,
sizeof(__pyx_k_throw), 0, 0, 1, 1},
19753 {&__pyx_kp_s_to_frame, __pyx_k_to_frame,
sizeof(__pyx_k_to_frame), 0, 0, 1, 0},
19754 {&__pyx_kp_s_using, __pyx_k_using,
sizeof(__pyx_k_using), 0, 0, 1, 0},
19755 {&__pyx_kp_s_using_invalid, __pyx_k_using_invalid,
sizeof(__pyx_k_using_invalid), 0, 0, 1, 0},
19756 {&__pyx_kp_s_value, __pyx_k_value,
sizeof(__pyx_k_value), 0, 0, 1, 0},
19757 {&__pyx_n_s_version, __pyx_k_version,
sizeof(__pyx_k_version), 0, 0, 1, 1},
19758 {&__pyx_n_s_xrange, __pyx_k_xrange,
sizeof(__pyx_k_xrange), 0, 0, 1, 1},
19759 {0, 0, 0, 0, 0, 0, 0}
19761 static int __Pyx_InitCachedBuiltins(
void) {
19762 __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError);
if (!__pyx_builtin_IndexError) __PYX_ERR(0, 102, __pyx_L1_error)
19763 __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError);
if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 104, __pyx_L1_error)
19764 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError);
if (!__pyx_builtin_TypeError) __PYX_ERR(0, 104, __pyx_L1_error)
19765 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError);
if (!__pyx_builtin_ValueError) __PYX_ERR(0, 105, __pyx_L1_error)
19766 __pyx_builtin_NotImplemented = __Pyx_GetBuiltinName(__pyx_n_s_NotImplemented);
if (!__pyx_builtin_NotImplemented) __PYX_ERR(0, 157, __pyx_L1_error)
19767 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_range) __PYX_ERR(0, 234, __pyx_L1_error)
19768 #if PY_MAJOR_VERSION >= 3 19769 __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_xrange) __PYX_ERR(0, 1098, __pyx_L1_error)
19771 __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange);
if (!__pyx_builtin_xrange) __PYX_ERR(0, 1098, __pyx_L1_error)
19778 static int __Pyx_InitCachedConstants(
void) {
19779 __Pyx_RefNannyDeclarations
19780 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
19788 __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)
19789 __Pyx_GOTREF(__pyx_tuple__3);
19790 __Pyx_GIVEREF(__pyx_tuple__3);
19797 __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)
19798 __Pyx_GOTREF(__pyx_tuple__4);
19799 __Pyx_GIVEREF(__pyx_tuple__4);
19808 __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Not_applicable);
if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 635, __pyx_L1_error)
19809 __Pyx_GOTREF(__pyx_tuple__10);
19810 __Pyx_GIVEREF(__pyx_tuple__10);
19819 __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Not_applicable);
if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 646, __pyx_L1_error)
19820 __Pyx_GOTREF(__pyx_tuple__11);
19821 __Pyx_GIVEREF(__pyx_tuple__11);
19829 __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 2, __pyx_L1_error)
19830 __Pyx_GOTREF(__pyx_tuple__12);
19831 __Pyx_GIVEREF(__pyx_tuple__12);
19838 __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 4, __pyx_L1_error)
19839 __Pyx_GOTREF(__pyx_tuple__13);
19840 __Pyx_GIVEREF(__pyx_tuple__13);
19849 __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_PyClical_pyx, __pyx_n_s_index_set_hidden_doctests, 404, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 404, __pyx_L1_error)
19858 __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_PyClical_pyx, __pyx_n_s_clifford_hidden_doctests, 1243, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 1243, __pyx_L1_error)
19867 __pyx_tuple__16 = PyTuple_Pack(1, __pyx_float_1_0);
if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 1856, __pyx_L1_error)
19868 __Pyx_GOTREF(__pyx_tuple__16);
19869 __Pyx_GIVEREF(__pyx_tuple__16);
19878 __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_obj);
if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 1887, __pyx_L1_error)
19879 __Pyx_GOTREF(__pyx_tuple__17);
19880 __Pyx_GIVEREF(__pyx_tuple__17);
19881 __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_PyClical_pyx, __pyx_n_s_e, 1887, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 1887, __pyx_L1_error)
19890 __pyx_tuple__19 = PyTuple_Pack(2, __pyx_n_s_p, __pyx_n_s_q);
if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 1900, __pyx_L1_error)
19891 __Pyx_GOTREF(__pyx_tuple__19);
19892 __Pyx_GIVEREF(__pyx_tuple__19);
19893 __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_PyClical_pyx, __pyx_n_s_istpq, 1900, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 1900, __pyx_L1_error)
19902 __pyx_tuple__21 = PyTuple_Pack(1, __pyx_int_4);
if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 1909, __pyx_L1_error)
19903 __Pyx_GOTREF(__pyx_tuple__21);
19904 __Pyx_GIVEREF(__pyx_tuple__21);
19905 __pyx_tuple__22 = PyTuple_Pack(1, __pyx_int_neg_1);
if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 1909, __pyx_L1_error)
19906 __Pyx_GOTREF(__pyx_tuple__22);
19907 __Pyx_GIVEREF(__pyx_tuple__22);
19916 __pyx_tuple__23 = PyTuple_Pack(1, __pyx_int_4);
if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 1910, __pyx_L1_error)
19917 __Pyx_GOTREF(__pyx_tuple__23);
19918 __Pyx_GIVEREF(__pyx_tuple__23);
19919 __pyx_tuple__24 = PyTuple_Pack(1, __pyx_int_neg_1);
if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 1910, __pyx_L1_error)
19920 __Pyx_GOTREF(__pyx_tuple__24);
19921 __Pyx_GIVEREF(__pyx_tuple__24);
19930 __pyx_tuple__25 = PyTuple_Pack(2, __pyx_n_s_PyClical, __pyx_n_s_doctest);
if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 1913, __pyx_L1_error)
19931 __Pyx_GOTREF(__pyx_tuple__25);
19932 __Pyx_GIVEREF(__pyx_tuple__25);
19933 __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_PyClical_pyx, __pyx_n_s_test, 1913, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 1913, __pyx_L1_error)
19934 __Pyx_RefNannyFinishContext();
19937 __Pyx_RefNannyFinishContext();
19941 static int __Pyx_InitGlobals(
void) {
19942 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
19943 __pyx_float_0_0 =
PyFloat_FromDouble(0.0);
if (unlikely(!__pyx_float_0_0)) __PYX_ERR(0, 1, __pyx_L1_error)
19944 __pyx_float_1_0 =
PyFloat_FromDouble(1.0);
if (unlikely(!__pyx_float_1_0)) __PYX_ERR(0, 1, __pyx_L1_error)
19945 __pyx_float_2_0 =
PyFloat_FromDouble(2.0);
if (unlikely(!__pyx_float_2_0)) __PYX_ERR(0, 1, __pyx_L1_error)
19946 __pyx_float_8_0 =
PyFloat_FromDouble(8.0);
if (unlikely(!__pyx_float_8_0)) __PYX_ERR(0, 1, __pyx_L1_error)
19947 __pyx_int_0 = PyInt_FromLong(0);
if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
19948 __pyx_int_1 = PyInt_FromLong(1);
if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
19949 __pyx_int_4 = PyInt_FromLong(4);
if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error)
19950 __pyx_int_neg_1 = PyInt_FromLong(-1);
if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
19956 #if PY_MAJOR_VERSION < 3 19957 PyMODINIT_FUNC initPyClical(
void);
19958 PyMODINIT_FUNC initPyClical(
void)
19960 PyMODINIT_FUNC PyInit_PyClical(
void);
19961 PyMODINIT_FUNC PyInit_PyClical(
void)
19962 #if CYTHON_PEP489_MULTI_PHASE_INIT 19964 return PyModuleDef_Init(&__pyx_moduledef);
19966 static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict,
const char* from_name,
const char* to_name) {
19967 PyObject *value = PyObject_GetAttrString(spec, from_name);
19969 if (likely(value)) {
19970 result = PyDict_SetItemString(moddict, to_name, value);
19972 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
19979 static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
19980 PyObject *module = NULL, *moddict, *modname;
19982 return __Pyx_NewRef(__pyx_m);
19983 modname = PyObject_GetAttrString(spec,
"name");
19984 if (unlikely(!modname))
goto bad;
19985 module = PyModule_NewObject(modname);
19986 Py_DECREF(modname);
19987 if (unlikely(!module))
goto bad;
19988 moddict = PyModule_GetDict(module);
19989 if (unlikely(!moddict))
goto bad;
19990 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__") < 0))
goto bad;
19991 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__") < 0))
goto bad;
19992 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__") < 0))
goto bad;
19993 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__") < 0))
goto bad;
19996 Py_XDECREF(module);
20001 static int __pyx_pymod_exec_PyClical(PyObject *__pyx_pyinit_module)
20005 PyObject *__pyx_t_1 = NULL;
20006 PyObject *__pyx_t_2 = NULL;
20007 PyObject *__pyx_t_3 = NULL;
20009 __Pyx_RefNannyDeclarations
20010 #if CYTHON_PEP489_MULTI_PHASE_INIT 20011 if (__pyx_m && __pyx_m == __pyx_pyinit_module)
return 0;
20013 #if CYTHON_REFNANNY 20014 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
20015 if (!__Pyx_RefNanny) {
20017 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
20018 if (!__Pyx_RefNanny)
20019 Py_FatalError(
"failed to import 'refnanny' module");
20022 __Pyx_RefNannySetupContext(
"PyMODINIT_FUNC PyInit_PyClical(void)", 0);
20023 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20024 __pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
20025 __pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
20026 __pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
20027 #ifdef __Pyx_CyFunction_USED 20028 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20030 #ifdef __Pyx_FusedFunction_USED 20031 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20033 #ifdef __Pyx_Coroutine_USED 20034 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20036 #ifdef __Pyx_Generator_USED 20037 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20039 #ifdef __Pyx_AsyncGen_USED 20040 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20042 #ifdef __Pyx_StopAsyncIteration_USED 20043 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20047 #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS 20049 PyEval_InitThreads();
20053 #if CYTHON_PEP489_MULTI_PHASE_INIT 20054 __pyx_m = __pyx_pyinit_module;
20055 Py_INCREF(__pyx_m);
20057 #if PY_MAJOR_VERSION < 3 20058 __pyx_m = Py_InitModule4(
"PyClical", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
20060 __pyx_m = PyModule_Create(&__pyx_moduledef);
20062 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
20064 __pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
20065 Py_INCREF(__pyx_d);
20066 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
20067 __pyx_cython_runtime = PyImport_AddModule((
char *)
"cython_runtime");
if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
20068 #if CYTHON_COMPILING_IN_PYPY 20069 Py_INCREF(__pyx_b);
20071 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
20073 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20074 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) 20075 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20077 if (__pyx_module_is_main_PyClical) {
20078 if (PyObject_SetAttrString(__pyx_m,
"__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20080 #if PY_MAJOR_VERSION >= 3 20082 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
20083 if (!PyDict_GetItemString(modules,
"PyClical")) {
20084 if (unlikely(PyDict_SetItemString(modules,
"PyClical", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
20089 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20091 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20096 __pyx_vtabptr_8PyClical_index_set = &__pyx_vtable_8PyClical_index_set;
20097 __pyx_vtable_8PyClical_index_set.wrap = (PyObject *(*)(
struct __pyx_obj_8PyClical_index_set *,
IndexSet))__pyx_f_8PyClical_9index_set_wrap;
20098 __pyx_vtable_8PyClical_index_set.unwrap = (
IndexSet (*)(
struct __pyx_obj_8PyClical_index_set *))__pyx_f_8PyClical_9index_set_unwrap;
20099 __pyx_vtable_8PyClical_index_set.copy = (PyObject *(*)(
struct __pyx_obj_8PyClical_index_set *,
int __pyx_skip_dispatch))__pyx_f_8PyClical_9index_set_copy;
20100 if (PyType_Ready(&__pyx_type_8PyClical_index_set) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
20101 __pyx_type_8PyClical_index_set.tp_print = 0;
20102 #if CYTHON_COMPILING_IN_CPYTHON 20104 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__setitem__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
20105 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20106 __pyx_wrapperbase_8PyClical_9index_set_8__setitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20107 __pyx_wrapperbase_8PyClical_9index_set_8__setitem__.doc = __pyx_doc_8PyClical_9index_set_8__setitem__;
20108 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_8__setitem__;
20112 #if CYTHON_COMPILING_IN_CPYTHON 20114 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__getitem__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
20115 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20116 __pyx_wrapperbase_8PyClical_9index_set_10__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20117 __pyx_wrapperbase_8PyClical_9index_set_10__getitem__.doc = __pyx_doc_8PyClical_9index_set_10__getitem__;
20118 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_10__getitem__;
20122 #if CYTHON_COMPILING_IN_CPYTHON 20124 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__contains__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
20125 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20126 __pyx_wrapperbase_8PyClical_9index_set_12__contains__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20127 __pyx_wrapperbase_8PyClical_9index_set_12__contains__.doc = __pyx_doc_8PyClical_9index_set_12__contains__;
20128 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_12__contains__;
20132 #if CYTHON_COMPILING_IN_CPYTHON 20134 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__iter__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
20135 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20136 __pyx_wrapperbase_8PyClical_9index_set_14__iter__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20137 __pyx_wrapperbase_8PyClical_9index_set_14__iter__.doc = __pyx_doc_8PyClical_9index_set_14__iter__;
20138 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_14__iter__;
20142 #if CYTHON_COMPILING_IN_CPYTHON 20144 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__invert__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
20145 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20146 __pyx_wrapperbase_8PyClical_9index_set_17__invert__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20147 __pyx_wrapperbase_8PyClical_9index_set_17__invert__.doc = __pyx_doc_8PyClical_9index_set_17__invert__;
20148 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_17__invert__;
20152 #if CYTHON_COMPILING_IN_CPYTHON 20154 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__xor__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
20155 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20156 __pyx_wrapperbase_8PyClical_9index_set_19__xor__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20157 __pyx_wrapperbase_8PyClical_9index_set_19__xor__.doc = __pyx_doc_8PyClical_9index_set_19__xor__;
20158 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_19__xor__;
20162 #if CYTHON_COMPILING_IN_CPYTHON 20164 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__ixor__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
20165 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20166 __pyx_wrapperbase_8PyClical_9index_set_21__ixor__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20167 __pyx_wrapperbase_8PyClical_9index_set_21__ixor__.doc = __pyx_doc_8PyClical_9index_set_21__ixor__;
20168 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_21__ixor__;
20172 #if CYTHON_COMPILING_IN_CPYTHON 20174 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__and__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
20175 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20176 __pyx_wrapperbase_8PyClical_9index_set_23__and__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20177 __pyx_wrapperbase_8PyClical_9index_set_23__and__.doc = __pyx_doc_8PyClical_9index_set_23__and__;
20178 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_23__and__;
20182 #if CYTHON_COMPILING_IN_CPYTHON 20184 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__iand__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
20185 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20186 __pyx_wrapperbase_8PyClical_9index_set_25__iand__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20187 __pyx_wrapperbase_8PyClical_9index_set_25__iand__.doc = __pyx_doc_8PyClical_9index_set_25__iand__;
20188 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_25__iand__;
20192 #if CYTHON_COMPILING_IN_CPYTHON 20194 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__or__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
20195 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20196 __pyx_wrapperbase_8PyClical_9index_set_27__or__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20197 __pyx_wrapperbase_8PyClical_9index_set_27__or__.doc = __pyx_doc_8PyClical_9index_set_27__or__;
20198 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_27__or__;
20202 #if CYTHON_COMPILING_IN_CPYTHON 20204 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__ior__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
20205 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20206 __pyx_wrapperbase_8PyClical_9index_set_29__ior__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20207 __pyx_wrapperbase_8PyClical_9index_set_29__ior__.doc = __pyx_doc_8PyClical_9index_set_29__ior__;
20208 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_29__ior__;
20212 #if CYTHON_COMPILING_IN_CPYTHON 20214 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__repr__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
20215 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20216 __pyx_wrapperbase_8PyClical_9index_set_47__repr__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20217 __pyx_wrapperbase_8PyClical_9index_set_47__repr__.doc = __pyx_doc_8PyClical_9index_set_47__repr__;
20218 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_47__repr__;
20222 #if CYTHON_COMPILING_IN_CPYTHON 20224 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__str__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
20225 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20226 __pyx_wrapperbase_8PyClical_9index_set_49__str__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20227 __pyx_wrapperbase_8PyClical_9index_set_49__str__.doc = __pyx_doc_8PyClical_9index_set_49__str__;
20228 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_49__str__;
20232 if (__Pyx_SetVtable(__pyx_type_8PyClical_index_set.tp_dict, __pyx_vtabptr_8PyClical_index_set) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
20233 if (PyObject_SetAttrString(__pyx_m,
"index_set", (PyObject *)&__pyx_type_8PyClical_index_set) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
20234 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8PyClical_index_set) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
20235 __pyx_ptype_8PyClical_index_set = &__pyx_type_8PyClical_index_set;
20236 __pyx_vtabptr_8PyClical_clifford = &__pyx_vtable_8PyClical_clifford;
20237 __pyx_vtable_8PyClical_clifford.wrap = (PyObject *(*)(
struct __pyx_obj_8PyClical_clifford *,
Clifford))__pyx_f_8PyClical_8clifford_wrap;
20238 __pyx_vtable_8PyClical_clifford.unwrap = (
Clifford (*)(
struct __pyx_obj_8PyClical_clifford *))__pyx_f_8PyClical_8clifford_unwrap;
20239 __pyx_vtable_8PyClical_clifford.copy = (PyObject *(*)(
struct __pyx_obj_8PyClical_clifford *,
int __pyx_skip_dispatch))__pyx_f_8PyClical_8clifford_copy;
20240 if (PyType_Ready(&__pyx_type_8PyClical_clifford) < 0) __PYX_ERR(0, 535, __pyx_L1_error)
20241 __pyx_type_8PyClical_clifford.tp_print = 0;
20242 #if CYTHON_COMPILING_IN_CPYTHON 20244 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__contains__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20245 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20246 __pyx_wrapperbase_8PyClical_8clifford_6__contains__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20247 __pyx_wrapperbase_8PyClical_8clifford_6__contains__.doc = __pyx_doc_8PyClical_8clifford_6__contains__;
20248 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_6__contains__;
20252 #if CYTHON_COMPILING_IN_CPYTHON 20254 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__iter__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20255 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20256 __pyx_wrapperbase_8PyClical_8clifford_8__iter__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20257 __pyx_wrapperbase_8PyClical_8clifford_8__iter__.doc = __pyx_doc_8PyClical_8clifford_8__iter__;
20258 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_8__iter__;
20262 #if CYTHON_COMPILING_IN_CPYTHON 20264 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__getitem__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20265 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20266 __pyx_wrapperbase_8PyClical_8clifford_14__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20267 __pyx_wrapperbase_8PyClical_8clifford_14__getitem__.doc = __pyx_doc_8PyClical_8clifford_14__getitem__;
20268 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_14__getitem__;
20272 #if CYTHON_COMPILING_IN_CPYTHON 20274 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__neg__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20275 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20276 __pyx_wrapperbase_8PyClical_8clifford_16__neg__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20277 __pyx_wrapperbase_8PyClical_8clifford_16__neg__.doc = __pyx_doc_8PyClical_8clifford_16__neg__;
20278 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_16__neg__;
20282 #if CYTHON_COMPILING_IN_CPYTHON 20284 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__pos__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20285 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20286 __pyx_wrapperbase_8PyClical_8clifford_18__pos__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20287 __pyx_wrapperbase_8PyClical_8clifford_18__pos__.doc = __pyx_doc_8PyClical_8clifford_18__pos__;
20288 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_18__pos__;
20292 #if CYTHON_COMPILING_IN_CPYTHON 20294 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__add__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20295 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20296 __pyx_wrapperbase_8PyClical_8clifford_20__add__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20297 __pyx_wrapperbase_8PyClical_8clifford_20__add__.doc = __pyx_doc_8PyClical_8clifford_20__add__;
20298 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_20__add__;
20302 #if CYTHON_COMPILING_IN_CPYTHON 20304 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__iadd__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20305 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20306 __pyx_wrapperbase_8PyClical_8clifford_22__iadd__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20307 __pyx_wrapperbase_8PyClical_8clifford_22__iadd__.doc = __pyx_doc_8PyClical_8clifford_22__iadd__;
20308 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_22__iadd__;
20312 #if CYTHON_COMPILING_IN_CPYTHON 20314 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__sub__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20315 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20316 __pyx_wrapperbase_8PyClical_8clifford_24__sub__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20317 __pyx_wrapperbase_8PyClical_8clifford_24__sub__.doc = __pyx_doc_8PyClical_8clifford_24__sub__;
20318 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_24__sub__;
20322 #if CYTHON_COMPILING_IN_CPYTHON 20324 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__isub__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20325 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20326 __pyx_wrapperbase_8PyClical_8clifford_26__isub__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20327 __pyx_wrapperbase_8PyClical_8clifford_26__isub__.doc = __pyx_doc_8PyClical_8clifford_26__isub__;
20328 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_26__isub__;
20332 #if CYTHON_COMPILING_IN_CPYTHON 20334 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__mul__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20335 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20336 __pyx_wrapperbase_8PyClical_8clifford_28__mul__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20337 __pyx_wrapperbase_8PyClical_8clifford_28__mul__.doc = __pyx_doc_8PyClical_8clifford_28__mul__;
20338 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_28__mul__;
20342 #if CYTHON_COMPILING_IN_CPYTHON 20344 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__imul__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20345 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20346 __pyx_wrapperbase_8PyClical_8clifford_30__imul__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20347 __pyx_wrapperbase_8PyClical_8clifford_30__imul__.doc = __pyx_doc_8PyClical_8clifford_30__imul__;
20348 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_30__imul__;
20352 #if CYTHON_COMPILING_IN_CPYTHON 20354 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__mod__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20355 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20356 __pyx_wrapperbase_8PyClical_8clifford_32__mod__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20357 __pyx_wrapperbase_8PyClical_8clifford_32__mod__.doc = __pyx_doc_8PyClical_8clifford_32__mod__;
20358 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_32__mod__;
20362 #if CYTHON_COMPILING_IN_CPYTHON 20364 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__imod__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20365 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20366 __pyx_wrapperbase_8PyClical_8clifford_34__imod__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20367 __pyx_wrapperbase_8PyClical_8clifford_34__imod__.doc = __pyx_doc_8PyClical_8clifford_34__imod__;
20368 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_34__imod__;
20372 #if CYTHON_COMPILING_IN_CPYTHON 20374 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__and__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20375 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20376 __pyx_wrapperbase_8PyClical_8clifford_36__and__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20377 __pyx_wrapperbase_8PyClical_8clifford_36__and__.doc = __pyx_doc_8PyClical_8clifford_36__and__;
20378 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_36__and__;
20382 #if CYTHON_COMPILING_IN_CPYTHON 20384 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__iand__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20385 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20386 __pyx_wrapperbase_8PyClical_8clifford_38__iand__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20387 __pyx_wrapperbase_8PyClical_8clifford_38__iand__.doc = __pyx_doc_8PyClical_8clifford_38__iand__;
20388 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_38__iand__;
20392 #if CYTHON_COMPILING_IN_CPYTHON 20394 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__xor__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20395 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20396 __pyx_wrapperbase_8PyClical_8clifford_40__xor__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20397 __pyx_wrapperbase_8PyClical_8clifford_40__xor__.doc = __pyx_doc_8PyClical_8clifford_40__xor__;
20398 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_40__xor__;
20402 #if CYTHON_COMPILING_IN_CPYTHON 20404 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__ixor__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20405 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20406 __pyx_wrapperbase_8PyClical_8clifford_42__ixor__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20407 __pyx_wrapperbase_8PyClical_8clifford_42__ixor__.doc = __pyx_doc_8PyClical_8clifford_42__ixor__;
20408 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_42__ixor__;
20412 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 20413 #if CYTHON_COMPILING_IN_CPYTHON 20415 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__div__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20416 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20417 __pyx_wrapperbase_8PyClical_8clifford_44__div__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20418 __pyx_wrapperbase_8PyClical_8clifford_44__div__.doc = __pyx_doc_8PyClical_8clifford_44__div__;
20419 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_44__div__;
20424 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 20425 #if CYTHON_COMPILING_IN_CPYTHON 20427 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__idiv__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20428 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20429 __pyx_wrapperbase_8PyClical_8clifford_46__idiv__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20430 __pyx_wrapperbase_8PyClical_8clifford_46__idiv__.doc = __pyx_doc_8PyClical_8clifford_46__idiv__;
20431 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_46__idiv__;
20436 #if CYTHON_COMPILING_IN_CPYTHON 20438 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__or__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20439 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20440 __pyx_wrapperbase_8PyClical_8clifford_50__or__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20441 __pyx_wrapperbase_8PyClical_8clifford_50__or__.doc = __pyx_doc_8PyClical_8clifford_50__or__;
20442 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_50__or__;
20446 #if CYTHON_COMPILING_IN_CPYTHON 20448 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__ior__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20449 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20450 __pyx_wrapperbase_8PyClical_8clifford_52__ior__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20451 __pyx_wrapperbase_8PyClical_8clifford_52__ior__.doc = __pyx_doc_8PyClical_8clifford_52__ior__;
20452 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_52__ior__;
20456 #if CYTHON_COMPILING_IN_CPYTHON 20458 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__pow__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20459 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20460 __pyx_wrapperbase_8PyClical_8clifford_54__pow__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20461 __pyx_wrapperbase_8PyClical_8clifford_54__pow__.doc = __pyx_doc_8PyClical_8clifford_54__pow__;
20462 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_54__pow__;
20466 #if CYTHON_COMPILING_IN_CPYTHON 20468 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__call__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20469 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20470 __pyx_wrapperbase_8PyClical_8clifford_60__call__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20471 __pyx_wrapperbase_8PyClical_8clifford_60__call__.doc = __pyx_doc_8PyClical_8clifford_60__call__;
20472 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_60__call__;
20476 #if CYTHON_COMPILING_IN_CPYTHON 20478 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__repr__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20479 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20480 __pyx_wrapperbase_8PyClical_8clifford_92__repr__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20481 __pyx_wrapperbase_8PyClical_8clifford_92__repr__.doc = __pyx_doc_8PyClical_8clifford_92__repr__;
20482 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_92__repr__;
20486 #if CYTHON_COMPILING_IN_CPYTHON 20488 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__str__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20489 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20490 __pyx_wrapperbase_8PyClical_8clifford_94__str__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20491 __pyx_wrapperbase_8PyClical_8clifford_94__str__.doc = __pyx_doc_8PyClical_8clifford_94__str__;
20492 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_94__str__;
20496 if (__Pyx_SetVtable(__pyx_type_8PyClical_clifford.tp_dict, __pyx_vtabptr_8PyClical_clifford) < 0) __PYX_ERR(0, 535, __pyx_L1_error)
20497 if (PyObject_SetAttrString(__pyx_m,
"clifford", (PyObject *)&__pyx_type_8PyClical_clifford) < 0) __PYX_ERR(0, 535, __pyx_L1_error)
20498 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8PyClical_clifford) < 0) __PYX_ERR(0, 535, __pyx_L1_error)
20499 __pyx_ptype_8PyClical_clifford = &__pyx_type_8PyClical_clifford;
20500 if (PyType_Ready(&__pyx_type_8PyClical___pyx_scope_struct____iter__) < 0) __PYX_ERR(0, 227, __pyx_L1_error)
20501 __pyx_type_8PyClical___pyx_scope_struct____iter__.tp_print = 0;
20502 __pyx_ptype_8PyClical___pyx_scope_struct____iter__ = &__pyx_type_8PyClical___pyx_scope_struct____iter__;
20507 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) 20508 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20518 __pyx_t_1 = __Pyx_Import(__pyx_n_s_math, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
20519 __Pyx_GOTREF(__pyx_t_1);
20520 if (PyDict_SetItem(__pyx_d, __pyx_n_s_math, __pyx_t_1) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
20521 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20530 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numbers, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
20531 __Pyx_GOTREF(__pyx_t_1);
20532 if (PyDict_SetItem(__pyx_d, __pyx_n_s_numbers, __pyx_t_1) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
20533 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20542 __pyx_t_1 = __Pyx_Import(__pyx_n_s_collections, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error)
20543 __Pyx_GOTREF(__pyx_t_1);
20544 if (PyDict_SetItem(__pyx_d, __pyx_n_s_collections, __pyx_t_1) < 0) __PYX_ERR(0, 30, __pyx_L1_error)
20545 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20554 if (PyDict_SetItem(__pyx_d, __pyx_n_s_version, __pyx_kp_s_0_8_2) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
20563 __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)
20564 __Pyx_GOTREF(__pyx_t_1);
20565 if (PyDict_SetItem(__pyx_d, __pyx_n_s_index_set_hidden_doctests, __pyx_t_1) < 0) __PYX_ERR(0, 404, __pyx_L1_error)
20566 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20575 __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)
20576 __Pyx_GOTREF(__pyx_t_1);
20577 if (PyDict_SetItem(__pyx_d, __pyx_n_s_clifford_hidden_doctests, __pyx_t_1) < 0) __PYX_ERR(0, 1243, __pyx_L1_error)
20578 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20587 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_tuple__16, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1856, __pyx_L1_error)
20588 __Pyx_GOTREF(__pyx_t_1);
20589 __pyx_t_2 = __pyx_f_8PyClical_atan(__pyx_t_1, 0, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1856, __pyx_L1_error)
20590 __Pyx_GOTREF(__pyx_t_2);
20591 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20592 __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_float_8_0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1856, __pyx_L1_error)
20593 __Pyx_GOTREF(__pyx_t_1);
20594 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20595 if (PyDict_SetItem(__pyx_d, __pyx_n_s_tau, __pyx_t_1) < 0) __PYX_ERR(0, 1856, __pyx_L1_error)
20596 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20605 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_tau);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1857, __pyx_L1_error)
20606 __Pyx_GOTREF(__pyx_t_1);
20607 __pyx_t_2 = __Pyx_PyFloat_DivideObjC(__pyx_t_1, __pyx_float_2_0, 2.0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1857, __pyx_L1_error)
20608 __Pyx_GOTREF(__pyx_t_2);
20609 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20610 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pi, __pyx_t_2) < 0) __PYX_ERR(0, 1857, __pyx_L1_error)
20611 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20620 if (PyDict_SetItem(__pyx_d, __pyx_n_s_cl, ((PyObject *)__pyx_ptype_8PyClical_clifford)) < 0) __PYX_ERR(0, 1859, __pyx_L1_error)
20629 if (PyDict_SetItem(__pyx_d, __pyx_n_s_ist, ((PyObject *)__pyx_ptype_8PyClical_index_set)) < 0) __PYX_ERR(0, 1879, __pyx_L1_error)
20638 __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)
20639 __Pyx_GOTREF(__pyx_t_2);
20640 if (PyDict_SetItem(__pyx_d, __pyx_n_s_e, __pyx_t_2) < 0) __PYX_ERR(0, 1887, __pyx_L1_error)
20641 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20650 __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)
20651 __Pyx_GOTREF(__pyx_t_2);
20652 if (PyDict_SetItem(__pyx_d, __pyx_n_s_istpq, __pyx_t_2) < 0) __PYX_ERR(0, 1900, __pyx_L1_error)
20653 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20662 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_e);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1909, __pyx_L1_error)
20663 __Pyx_GOTREF(__pyx_t_2);
20664 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__21, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1909, __pyx_L1_error)
20665 __Pyx_GOTREF(__pyx_t_1);
20666 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20667 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_e);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1909, __pyx_L1_error)
20668 __Pyx_GOTREF(__pyx_t_2);
20669 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__22, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1909, __pyx_L1_error)
20670 __Pyx_GOTREF(__pyx_t_3);
20671 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20672 __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1909, __pyx_L1_error)
20673 __Pyx_GOTREF(__pyx_t_2);
20674 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20675 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20676 if (PyDict_SetItem(__pyx_d, __pyx_n_s_ninf3, __pyx_t_2) < 0) __PYX_ERR(0, 1909, __pyx_L1_error)
20677 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20686 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_e);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1910, __pyx_L1_error)
20687 __Pyx_GOTREF(__pyx_t_2);
20688 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__23, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1910, __pyx_L1_error)
20689 __Pyx_GOTREF(__pyx_t_3);
20690 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20691 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_e);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1910, __pyx_L1_error)
20692 __Pyx_GOTREF(__pyx_t_2);
20693 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__24, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1910, __pyx_L1_error)
20694 __Pyx_GOTREF(__pyx_t_1);
20695 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20696 __pyx_t_2 = PyNumber_Subtract(__pyx_t_3, __pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1910, __pyx_L1_error)
20697 __Pyx_GOTREF(__pyx_t_2);
20698 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20699 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20700 if (PyDict_SetItem(__pyx_d, __pyx_n_s_nbar3, __pyx_t_2) < 0) __PYX_ERR(0, 1910, __pyx_L1_error)
20701 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20710 __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)
20711 __Pyx_GOTREF(__pyx_t_2);
20712 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1913, __pyx_L1_error)
20713 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20721 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1917, __pyx_L1_error)
20722 __Pyx_GOTREF(__pyx_t_2);
20723 __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)
20724 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20732 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_test);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1918, __pyx_L1_error)
20733 __Pyx_GOTREF(__pyx_t_1);
20735 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
20736 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
20737 if (likely(__pyx_t_3)) {
20738 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
20739 __Pyx_INCREF(__pyx_t_3);
20740 __Pyx_INCREF(
function);
20741 __Pyx_DECREF_SET(__pyx_t_1,
function);
20745 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1918, __pyx_L1_error)
20746 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20748 __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1918, __pyx_L1_error)
20750 __Pyx_GOTREF(__pyx_t_2);
20751 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20752 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20767 __pyx_t_2 = __Pyx_PyDict_NewPresized(107);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
20768 __Pyx_GOTREF(__pyx_t_2);
20769 if (PyDict_SetItem(__pyx_t_2, __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)
20770 if (PyDict_SetItem(__pyx_t_2, __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)
20771 if (PyDict_SetItem(__pyx_t_2, __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)
20772 if (PyDict_SetItem(__pyx_t_2, __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)
20773 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_index_set___invert___line_238, __pyx_kp_u_Set_complement_not_print_index) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20774 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_index_set___xor___line_247, __pyx_kp_u_Symmetric_set_difference_exclus) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20775 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_index_set___ixor___line_258, __pyx_kp_u_Symmetric_set_difference_exclus_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20776 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_index_set___and___line_269, __pyx_kp_u_Set_intersection_and_print_inde) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20777 if (PyDict_SetItem(__pyx_t_2, __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)
20778 if (PyDict_SetItem(__pyx_t_2, __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)
20779 if (PyDict_SetItem(__pyx_t_2, __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)
20780 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_index_set_count_line_313, __pyx_kp_u_Cardinality_Number_of_indices_i) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20781 if (PyDict_SetItem(__pyx_t_2, __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)
20782 if (PyDict_SetItem(__pyx_t_2, __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)
20783 if (PyDict_SetItem(__pyx_t_2, __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)
20784 if (PyDict_SetItem(__pyx_t_2, __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)
20785 if (PyDict_SetItem(__pyx_t_2, __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)
20786 if (PyDict_SetItem(__pyx_t_2, __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)
20787 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_index_set___repr___line_382, __pyx_kp_u_The_official_string_representat) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20788 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_index_set___str___line_393, __pyx_kp_u_The_informal_string_representat) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20789 if (PyDict_SetItem(__pyx_t_2, __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)
20790 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_compare_line_490, __pyx_kp_u_lexicographic_compare_eg_3_4_5) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20791 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_min_neg_line_502, __pyx_kp_u_Minimum_negative_index_or_0_if) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20792 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_max_pos_line_511, __pyx_kp_u_Maximum_positive_index_or_0_if) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20793 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford_copy_line_554, __pyx_kp_u_Copy_this_clifford_object_x_cli) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20794 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford___iter___line_637, __pyx_kp_u_Not_applicable_for_a_in_cliffor) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20795 if (PyDict_SetItem(__pyx_t_2, __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)
20796 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford___getitem___line_706, __pyx_kp_u_Subscripting_map_from_index_set) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20797 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford___neg___line_721, __pyx_kp_u_Unary_print_clifford_1_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20798 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford___pos___line_730, __pyx_kp_u_Unary_print_clifford_1_1_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20799 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford___add___line_739, __pyx_kp_u_Geometric_sum_print_clifford_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20800 if (PyDict_SetItem(__pyx_t_2, __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)
20801 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford___sub___line_759, __pyx_kp_u_Geometric_difference_print_clif) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20802 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford___isub___line_770, __pyx_kp_u_Geometric_difference_x_clifford) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20803 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford___mul___line_779, __pyx_kp_u_Geometric_product_print_cliffor) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20804 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford___imul___line_792, __pyx_kp_u_Geometric_product_x_clifford_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20805 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford___mod___line_805, __pyx_kp_u_Contraction_print_clifford_1_cl) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20806 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford___imod___line_820, __pyx_kp_u_Contraction_x_clifford_1_x_clif) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20807 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford___and___line_835, __pyx_kp_u_Inner_product_print_clifford_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20808 if (PyDict_SetItem(__pyx_t_2, __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)
20809 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford___xor___line_865, __pyx_kp_u_Outer_product_print_clifford_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20810 if (PyDict_SetItem(__pyx_t_2, __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)
20811 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford___div___line_895, __pyx_kp_u_Geometric_quotient_print_cliffo) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20812 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford___idiv___line_910, __pyx_kp_u_Geometric_quotient_x_clifford_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20813 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford_inv_line_925, __pyx_kp_u_Geometric_multiplicative_invers) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20814 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford___or___line_938, __pyx_kp_u_Transform_left_hand_side_using) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20815 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford___ior___line_949, __pyx_kp_u_Transform_left_hand_side_using_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20816 if (PyDict_SetItem(__pyx_t_2, __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)
20817 if (PyDict_SetItem(__pyx_t_2, __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)
20818 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford_outer_pow_line_1003, __pyx_kp_u_Outer_product_power_x_clifford) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20819 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford___call___line_1019, __pyx_kp_u_Pure_grade_vector_part_print_cl) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20820 if (PyDict_SetItem(__pyx_t_2, __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)
20821 if (PyDict_SetItem(__pyx_t_2, __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)
20822 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford_even_line_1060, __pyx_kp_u_Even_part_of_multivector_sum_of) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20823 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford_odd_line_1069, __pyx_kp_u_Odd_part_of_multivector_sum_of) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20824 if (PyDict_SetItem(__pyx_t_2, __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)
20825 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford_involute_line_1106, __pyx_kp_u_Main_involution_each_i_is_repla) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20826 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford_reverse_line_1122, __pyx_kp_u_Reversion_eg_clifford_1_cliffor) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20827 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford_conj_line_1137, __pyx_kp_u_Conjugation_reverse_o_involute) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20828 if (PyDict_SetItem(__pyx_t_2, __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)
20829 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford_norm_line_1163, __pyx_kp_u_Norm_sum_of_squares_of_coordina) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20830 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford_abs_line_1174, __pyx_kp_u_Absolute_value_square_root_of_n) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20831 if (PyDict_SetItem(__pyx_t_2, __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)
20832 if (PyDict_SetItem(__pyx_t_2, __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)
20833 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford_isnan_line_1205, __pyx_kp_u_Check_if_a_multivector_contains) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20834 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford_frame_line_1214, __pyx_kp_u_Subalgebra_generated_by_all_gen) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20835 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford___repr___line_1225, __pyx_kp_u_The_official_string_representat_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20836 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford___str___line_1234, __pyx_kp_u_The_informal_string_representat_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20837 if (PyDict_SetItem(__pyx_t_2, __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)
20838 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_inv_line_1329, __pyx_kp_u_Geometric_multiplicative_invers_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20839 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_scalar_line_1344, __pyx_kp_u_Scalar_part_scalar_clifford_1_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20840 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_real_line_1355, __pyx_kp_u_Real_part_synonym_for_scalar_pa) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20841 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_imag_line_1366, __pyx_kp_u_Imaginary_part_deprecated_alway) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20842 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_pure_line_1377, __pyx_kp_u_Pure_part_print_pure_clifford_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20843 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_even_line_1388, __pyx_kp_u_Even_part_of_multivector_sum_of_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20844 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_odd_line_1397, __pyx_kp_u_Odd_part_of_multivector_sum_of_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20845 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_involute_line_1406, __pyx_kp_u_Main_involution_each_i_is_repla_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20846 if (PyDict_SetItem(__pyx_t_2, __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)
20847 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_conj_line_1436, __pyx_kp_u_Conjugation_reverse_o_involute_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20848 if (PyDict_SetItem(__pyx_t_2, __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)
20849 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_norm_line_1462, __pyx_kp_u_norm_sum_of_squares_of_coordina) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20850 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_abs_line_1473, __pyx_kp_u_Absolute_value_of_multivector_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20851 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_max_abs_line_1482, __pyx_kp_u_Maximum_absolute_value_of_coord) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20852 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_pow_line_1494, __pyx_kp_u_Integer_power_of_multivector_ob) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20853 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_outer_pow_line_1518, __pyx_kp_u_Outer_product_power_of_multivec) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20854 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_complexifier_line_1527, __pyx_kp_u_Square_root_of_1_which_commutes) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20855 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_sqrt_line_1542, __pyx_kp_u_Square_root_of_multivector_with) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20856 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_exp_line_1565, __pyx_kp_u_Exponential_of_multivector_x_cl) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20857 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_log_line_1579, __pyx_kp_u_Natural_logarithm_of_multivecto) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20858 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_cos_line_1602, __pyx_kp_u_Cosine_of_multivector_with_opti) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20859 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_acos_line_1619, __pyx_kp_u_Inverse_cosine_of_multivector_w) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20860 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_cosh_line_1640, __pyx_kp_u_Hyperbolic_cosine_of_multivecto) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20861 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_acosh_line_1656, __pyx_kp_u_Inverse_hyperbolic_cosine_of_mu) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20862 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_sin_line_1679, __pyx_kp_u_Sine_of_multivector_with_option) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20863 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_asin_line_1698, __pyx_kp_u_Inverse_sine_of_multivector_wit) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20864 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_sinh_line_1719, __pyx_kp_u_Hyperbolic_sine_of_multivector) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20865 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_asinh_line_1733, __pyx_kp_u_Inverse_hyperbolic_sine_of_mult) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20866 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_tan_line_1752, __pyx_kp_u_Tangent_of_multivector_with_opt) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20867 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_atan_line_1769, __pyx_kp_u_Inverse_tangent_of_multivector) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20868 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_tanh_line_1786, __pyx_kp_u_Hyperbolic_tangent_of_multivect) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20869 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_atanh_line_1798, __pyx_kp_u_Inverse_hyperbolic_tangent_of_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20870 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_random_clifford_line_1815, __pyx_kp_u_Random_multivector_within_a_fra) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20871 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_cga3_line_1824, __pyx_kp_u_Convert_Euclidean_3D_multivecto) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20872 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_cga3std_line_1833, __pyx_kp_u_Convert_CGA3_null_vector_to_sta) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20873 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_agc3_line_1844, __pyx_kp_u_Convert_CGA3_null_vector_to_Euc) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20874 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_e_line_1887, __pyx_kp_u_Abbreviation_for_clifford_index) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20875 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_istpq_line_1900, __pyx_kp_u_Abbreviation_for_index_set_q_p) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20876 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_2, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20877 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20883 __Pyx_XDECREF(__pyx_t_1);
20884 __Pyx_XDECREF(__pyx_t_2);
20885 __Pyx_XDECREF(__pyx_t_3);
20888 __Pyx_AddTraceback(
"init PyClical", 0, __pyx_lineno, __pyx_filename);
20890 Py_DECREF(__pyx_m); __pyx_m = 0;
20891 }
else if (!PyErr_Occurred()) {
20892 PyErr_SetString(PyExc_ImportError,
"init PyClical");
20895 __Pyx_RefNannyFinishContext();
20896 #if CYTHON_PEP489_MULTI_PHASE_INIT 20897 return (__pyx_m != NULL) ? 0 : -1;
20898 #elif PY_MAJOR_VERSION >= 3 20907 #if CYTHON_REFNANNY 20908 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
20909 PyObject *m = NULL, *p = NULL;
20911 m = PyImport_ImportModule((
char *)modname);
20913 p = PyObject_GetAttrString(m, (
char *)
"RefNannyAPI");
20915 r = PyLong_AsVoidPtr(p);
20919 return (__Pyx_RefNannyAPIStruct *)r;
20924 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
20925 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
20926 if (unlikely(!result)) {
20927 PyErr_Format(PyExc_NameError,
20928 #
if PY_MAJOR_VERSION >= 3
20929 "name '%U' is not defined", name);
20931 "name '%.200s' is not defined", PyString_AS_STRING(name));
20938 #if CYTHON_COMPILING_IN_CPYTHON 20939 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
20941 ternaryfunc call = func->ob_type->tp_call;
20942 if (unlikely(!call))
20943 return PyObject_Call(func, arg, kw);
20944 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
20946 result = (*call)(func, arg, kw);
20947 Py_LeaveRecursiveCall();
20948 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
20951 "NULL result without error in PyObject_Call");
20958 #if CYTHON_FAST_THREAD_STATE 20959 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
20960 PyObject *tmp_type, *tmp_value, *tmp_tb;
20961 tmp_type = tstate->curexc_type;
20962 tmp_value = tstate->curexc_value;
20963 tmp_tb = tstate->curexc_traceback;
20964 tstate->curexc_type = type;
20965 tstate->curexc_value = value;
20966 tstate->curexc_traceback = tb;
20967 Py_XDECREF(tmp_type);
20968 Py_XDECREF(tmp_value);
20969 Py_XDECREF(tmp_tb);
20971 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
20972 *type = tstate->curexc_type;
20973 *value = tstate->curexc_value;
20974 *tb = tstate->curexc_traceback;
20975 tstate->curexc_type = 0;
20976 tstate->curexc_value = 0;
20977 tstate->curexc_traceback = 0;
20982 static void __Pyx_WriteUnraisable(
const char *name, CYTHON_UNUSED
int clineno,
20983 CYTHON_UNUSED
int lineno, CYTHON_UNUSED
const char *filename,
20984 int full_traceback, CYTHON_UNUSED
int nogil) {
20985 PyObject *old_exc, *old_val, *old_tb;
20987 __Pyx_PyThreadState_declare
20989 PyGILState_STATE state;
20991 state = PyGILState_Ensure();
20993 else state = (PyGILState_STATE)-1;
20996 __Pyx_PyThreadState_assign
20997 __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
20998 if (full_traceback) {
20999 Py_XINCREF(old_exc);
21000 Py_XINCREF(old_val);
21001 Py_XINCREF(old_tb);
21002 __Pyx_ErrRestore(old_exc, old_val, old_tb);
21005 #if PY_MAJOR_VERSION < 3 21006 ctx = PyString_FromString(name);
21008 ctx = PyUnicode_FromString(name);
21010 __Pyx_ErrRestore(old_exc, old_val, old_tb);
21012 PyErr_WriteUnraisable(Py_None);
21014 PyErr_WriteUnraisable(ctx);
21019 PyGILState_Release(state);
21024 #if CYTHON_FAST_PYCCALL 21025 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
21026 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
21027 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
21028 PyObject *
self = PyCFunction_GET_SELF(func);
21029 int flags = PyCFunction_GET_FLAGS(func);
21030 assert(PyCFunction_Check(func));
21031 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)));
21032 assert(nargs >= 0);
21033 assert(nargs == 0 || args != NULL);
21037 assert(!PyErr_Occurred());
21038 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
21039 return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (
self, args, nargs, NULL);
21041 return (*((__Pyx_PyCFunctionFast)meth)) (
self, args, nargs);
21047 #if CYTHON_FAST_PYCALL 21048 #include "frameobject.h" 21049 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
21050 PyObject *globals) {
21052 PyThreadState *tstate = __Pyx_PyThreadState_Current;
21053 PyObject **fastlocals;
21056 assert(globals != NULL);
21061 assert(tstate != NULL);
21062 f = PyFrame_New(tstate, co, globals, NULL);
21066 fastlocals = f->f_localsplus;
21067 for (
i = 0;
i < na;
i++) {
21069 fastlocals[
i] = *args++;
21071 result = PyEval_EvalFrameEx(f,0);
21072 ++tstate->recursion_depth;
21074 --tstate->recursion_depth;
21077 #if 1 || PY_VERSION_HEX < 0x030600B1 21078 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
int nargs, PyObject *kwargs) {
21079 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
21080 PyObject *globals = PyFunction_GET_GLOBALS(func);
21081 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
21083 #if PY_MAJOR_VERSION >= 3 21086 PyObject *kwtuple, **k;
21091 assert(kwargs == NULL || PyDict_Check(kwargs));
21092 nk = kwargs ? PyDict_Size(kwargs) : 0;
21093 if (Py_EnterRecursiveCall((
char*)
" while calling a Python object")) {
21097 #
if PY_MAJOR_VERSION >= 3
21098 co->co_kwonlyargcount == 0 &&
21100 likely(kwargs == NULL || nk == 0) &&
21101 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
21102 if (argdefs == NULL && co->co_argcount == nargs) {
21103 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
21106 else if (nargs == 0 && argdefs != NULL
21107 && co->co_argcount == Py_SIZE(argdefs)) {
21110 args = &PyTuple_GET_ITEM(argdefs, 0);
21111 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
21115 if (kwargs != NULL) {
21117 kwtuple = PyTuple_New(2 * nk);
21118 if (kwtuple == NULL) {
21122 k = &PyTuple_GET_ITEM(kwtuple, 0);
21124 while (PyDict_Next(kwargs, &pos, &k[
i], &k[
i+1])) {
21135 closure = PyFunction_GET_CLOSURE(func);
21136 #if PY_MAJOR_VERSION >= 3 21137 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
21139 if (argdefs != NULL) {
21140 d = &PyTuple_GET_ITEM(argdefs, 0);
21141 nd = Py_SIZE(argdefs);
21147 #if PY_MAJOR_VERSION >= 3 21148 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
21151 d, (
int)nd, kwdefs, closure);
21153 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
21156 d, (
int)nd, closure);
21158 Py_XDECREF(kwtuple);
21160 Py_LeaveRecursiveCall();
21167 #if CYTHON_COMPILING_IN_CPYTHON 21168 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
21169 PyObject *
self, *result;
21171 cfunc = PyCFunction_GET_FUNCTION(func);
21172 self = PyCFunction_GET_SELF(func);
21173 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
21175 result = cfunc(
self, arg);
21176 Py_LeaveRecursiveCall();
21177 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
21180 "NULL result without error in PyObject_Call");
21187 #if CYTHON_COMPILING_IN_CPYTHON 21188 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
21190 PyObject *args = PyTuple_New(1);
21191 if (unlikely(!args))
return NULL;
21193 PyTuple_SET_ITEM(args, 0, arg);
21194 result = __Pyx_PyObject_Call(func, args, NULL);
21198 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
21199 #if CYTHON_FAST_PYCALL 21200 if (PyFunction_Check(func)) {
21201 return __Pyx_PyFunction_FastCall(func, &arg, 1);
21204 if (likely(PyCFunction_Check(func))) {
21205 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
21206 return __Pyx_PyObject_CallMethO(func, arg);
21207 #if CYTHON_FAST_PYCCALL 21208 }
else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
21209 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
21213 return __Pyx__PyObject_CallOneArg(func, arg);
21216 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
21218 PyObject *args = PyTuple_Pack(1, arg);
21219 if (unlikely(!args))
return NULL;
21220 result = __Pyx_PyObject_Call(func, args, NULL);
21227 #if CYTHON_COMPILING_IN_CPYTHON 21228 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
21229 #if CYTHON_FAST_PYCALL 21230 if (PyFunction_Check(func)) {
21231 return __Pyx_PyFunction_FastCall(func, NULL, 0);
21234 #ifdef __Pyx_CyFunction_USED 21235 if (likely(PyCFunction_Check(func) || __Pyx_TypeCheck(func, __pyx_CyFunctionType))) {
21237 if (likely(PyCFunction_Check(func))) {
21239 if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
21240 return __Pyx_PyObject_CallMethO(func, NULL);
21243 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
21248 static void __Pyx_RaiseDoubleKeywordsError(
21249 const char* func_name,
21252 PyErr_Format(PyExc_TypeError,
21253 #
if PY_MAJOR_VERSION >= 3
21254 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
21256 "%s() got multiple values for keyword argument '%s'", func_name,
21257 PyString_AsString(kw_name));
21262 static int __Pyx_ParseOptionalKeywords(
21264 PyObject **argnames[],
21266 PyObject *values[],
21267 Py_ssize_t num_pos_args,
21268 const char* function_name)
21270 PyObject *key = 0, *value = 0;
21271 Py_ssize_t pos = 0;
21273 PyObject*** first_kw_arg = argnames + num_pos_args;
21274 while (PyDict_Next(kwds, &pos, &key, &value)) {
21275 name = first_kw_arg;
21276 while (*name && (**name != key)) name++;
21278 values[name-argnames] = value;
21281 name = first_kw_arg;
21282 #if PY_MAJOR_VERSION < 3 21283 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
21285 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
21286 && _PyString_Eq(**name, key)) {
21287 values[name-argnames] = value;
21292 if (*name)
continue;
21294 PyObject*** argname = argnames;
21295 while (argname != first_kw_arg) {
21296 if ((**argname == key) || (
21297 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
21298 && _PyString_Eq(**argname, key))) {
21299 goto arg_passed_twice;
21306 if (likely(PyUnicode_Check(key))) {
21308 int cmp = (**name == key) ? 0 :
21309 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
21310 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
21312 PyUnicode_Compare(**name, key);
21313 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
21315 values[name-argnames] = value;
21320 if (*name)
continue;
21322 PyObject*** argname = argnames;
21323 while (argname != first_kw_arg) {
21324 int cmp = (**argname == key) ? 0 :
21325 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
21326 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
21328 PyUnicode_Compare(**argname, key);
21329 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
21330 if (cmp == 0)
goto arg_passed_twice;
21335 goto invalid_keyword_type;
21337 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
21339 goto invalid_keyword;
21344 __Pyx_RaiseDoubleKeywordsError(function_name, key);
21346 invalid_keyword_type:
21347 PyErr_Format(PyExc_TypeError,
21348 "%.200s() keywords must be strings", function_name);
21351 PyErr_Format(PyExc_TypeError,
21352 #
if PY_MAJOR_VERSION < 3
21353 "%.200s() got an unexpected keyword argument '%.200s'",
21354 function_name, PyString_AsString(key));
21356 "%s() got an unexpected keyword argument '%U'",
21357 function_name, key);
21364 static void __Pyx_RaiseArgtupleInvalid(
21365 const char* func_name,
21367 Py_ssize_t num_min,
21368 Py_ssize_t num_max,
21369 Py_ssize_t num_found)
21371 Py_ssize_t num_expected;
21372 const char *more_or_less;
21373 if (num_found < num_min) {
21374 num_expected = num_min;
21375 more_or_less =
"at least";
21377 num_expected = num_max;
21378 more_or_less =
"at most";
21381 more_or_less =
"exactly";
21383 PyErr_Format(PyExc_TypeError,
21384 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
21385 func_name, more_or_less, num_expected,
21386 (num_expected == 1) ?
"" :
"s", num_found);
21390 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
21392 #if !CYTHON_AVOID_BORROWED_REFS 21393 result = PyDict_GetItem(__pyx_d, name);
21394 if (likely(result)) {
21398 result = PyObject_GetItem(__pyx_d, name);
21402 result = __Pyx_GetBuiltinName(name);
21408 #if CYTHON_FAST_THREAD_STATE 21409 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
21410 #if PY_VERSION_HEX >= 0x030700A2 21411 *type = tstate->exc_state.exc_type;
21412 *value = tstate->exc_state.exc_value;
21413 *tb = tstate->exc_state.exc_traceback;
21415 *type = tstate->exc_type;
21416 *value = tstate->exc_value;
21417 *tb = tstate->exc_traceback;
21420 Py_XINCREF(*value);
21423 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
21424 PyObject *tmp_type, *tmp_value, *tmp_tb;
21425 #if PY_VERSION_HEX >= 0x030700A2 21426 tmp_type = tstate->exc_state.exc_type;
21427 tmp_value = tstate->exc_state.exc_value;
21428 tmp_tb = tstate->exc_state.exc_traceback;
21429 tstate->exc_state.exc_type = type;
21430 tstate->exc_state.exc_value = value;
21431 tstate->exc_state.exc_traceback = tb;
21433 tmp_type = tstate->exc_type;
21434 tmp_value = tstate->exc_value;
21435 tmp_tb = tstate->exc_traceback;
21436 tstate->exc_type = type;
21437 tstate->exc_value = value;
21438 tstate->exc_traceback = tb;
21440 Py_XDECREF(tmp_type);
21441 Py_XDECREF(tmp_value);
21442 Py_XDECREF(tmp_tb);
21447 #if CYTHON_FAST_THREAD_STATE 21448 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
21450 n = PyTuple_GET_SIZE(tuple);
21451 #if PY_MAJOR_VERSION >= 3 21452 for (
i=0;
i<n;
i++) {
21453 if (exc_type == PyTuple_GET_ITEM(tuple,
i))
return 1;
21456 for (
i=0;
i<n;
i++) {
21457 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple,
i)))
return 1;
21461 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
21462 PyObject *exc_type = tstate->curexc_type;
21463 if (exc_type == err)
return 1;
21464 if (unlikely(!exc_type))
return 0;
21465 if (unlikely(PyTuple_Check(err)))
21466 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
21467 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
21472 #if CYTHON_FAST_THREAD_STATE 21473 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
21475 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
21477 PyObject *local_type, *local_value, *local_tb;
21478 #if CYTHON_FAST_THREAD_STATE 21479 PyObject *tmp_type, *tmp_value, *tmp_tb;
21480 local_type = tstate->curexc_type;
21481 local_value = tstate->curexc_value;
21482 local_tb = tstate->curexc_traceback;
21483 tstate->curexc_type = 0;
21484 tstate->curexc_value = 0;
21485 tstate->curexc_traceback = 0;
21487 PyErr_Fetch(&local_type, &local_value, &local_tb);
21489 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
21490 #if CYTHON_FAST_THREAD_STATE 21491 if (unlikely(tstate->curexc_type))
21493 if (unlikely(PyErr_Occurred()))
21496 #if PY_MAJOR_VERSION >= 3 21498 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
21502 Py_XINCREF(local_tb);
21503 Py_XINCREF(local_type);
21504 Py_XINCREF(local_value);
21505 *type = local_type;
21506 *value = local_value;
21508 #if CYTHON_FAST_THREAD_STATE 21509 #if PY_VERSION_HEX >= 0x030700A2 21510 tmp_type = tstate->exc_state.exc_type;
21511 tmp_value = tstate->exc_state.exc_value;
21512 tmp_tb = tstate->exc_state.exc_traceback;
21513 tstate->exc_state.exc_type = local_type;
21514 tstate->exc_state.exc_value = local_value;
21515 tstate->exc_state.exc_traceback = local_tb;
21517 tmp_type = tstate->exc_type;
21518 tmp_value = tstate->exc_value;
21519 tmp_tb = tstate->exc_traceback;
21520 tstate->exc_type = local_type;
21521 tstate->exc_value = local_value;
21522 tstate->exc_traceback = local_tb;
21524 Py_XDECREF(tmp_type);
21525 Py_XDECREF(tmp_value);
21526 Py_XDECREF(tmp_tb);
21528 PyErr_SetExcInfo(local_type, local_value, local_tb);
21535 Py_XDECREF(local_type);
21536 Py_XDECREF(local_value);
21537 Py_XDECREF(local_tb);
21542 #if PY_MAJOR_VERSION < 3 21543 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
21544 CYTHON_UNUSED PyObject *cause) {
21545 __Pyx_PyThreadState_declare
21547 if (!value || value == Py_None)
21551 if (!tb || tb == Py_None)
21555 if (!PyTraceBack_Check(tb)) {
21556 PyErr_SetString(PyExc_TypeError,
21557 "raise: arg 3 must be a traceback or None");
21561 if (PyType_Check(type)) {
21562 #if CYTHON_COMPILING_IN_PYPY 21564 Py_INCREF(Py_None);
21568 PyErr_NormalizeException(&type, &value, &tb);
21571 PyErr_SetString(PyExc_TypeError,
21572 "instance exception may not have a separate value");
21576 type = (PyObject*) Py_TYPE(type);
21578 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
21579 PyErr_SetString(PyExc_TypeError,
21580 "raise: exception class must be a subclass of BaseException");
21584 __Pyx_PyThreadState_assign
21585 __Pyx_ErrRestore(type, value, tb);
21594 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
21595 PyObject* owned_instance = NULL;
21596 if (tb == Py_None) {
21598 }
else if (tb && !PyTraceBack_Check(tb)) {
21599 PyErr_SetString(PyExc_TypeError,
21600 "raise: arg 3 must be a traceback or None");
21603 if (value == Py_None)
21605 if (PyExceptionInstance_Check(type)) {
21607 PyErr_SetString(PyExc_TypeError,
21608 "instance exception may not have a separate value");
21612 type = (PyObject*) Py_TYPE(value);
21613 }
else if (PyExceptionClass_Check(type)) {
21614 PyObject *instance_class = NULL;
21615 if (value && PyExceptionInstance_Check(value)) {
21616 instance_class = (PyObject*) Py_TYPE(value);
21617 if (instance_class != type) {
21618 int is_subclass = PyObject_IsSubclass(instance_class, type);
21619 if (!is_subclass) {
21620 instance_class = NULL;
21621 }
else if (unlikely(is_subclass == -1)) {
21624 type = instance_class;
21628 if (!instance_class) {
21631 args = PyTuple_New(0);
21632 else if (PyTuple_Check(value)) {
21636 args = PyTuple_Pack(1, value);
21639 owned_instance = PyObject_Call(type, args, NULL);
21641 if (!owned_instance)
21643 value = owned_instance;
21644 if (!PyExceptionInstance_Check(value)) {
21645 PyErr_Format(PyExc_TypeError,
21646 "calling %R should have returned an instance of " 21647 "BaseException, not %R",
21648 type, Py_TYPE(value));
21653 PyErr_SetString(PyExc_TypeError,
21654 "raise: exception class must be a subclass of BaseException");
21658 PyObject *fixed_cause;
21659 if (cause == Py_None) {
21660 fixed_cause = NULL;
21661 }
else if (PyExceptionClass_Check(cause)) {
21662 fixed_cause = PyObject_CallObject(cause, NULL);
21663 if (fixed_cause == NULL)
21665 }
else if (PyExceptionInstance_Check(cause)) {
21666 fixed_cause = cause;
21667 Py_INCREF(fixed_cause);
21669 PyErr_SetString(PyExc_TypeError,
21670 "exception causes must derive from " 21674 PyException_SetCause(value, fixed_cause);
21676 PyErr_SetObject(type, value);
21678 #if CYTHON_COMPILING_IN_PYPY 21679 PyObject *tmp_type, *tmp_value, *tmp_tb;
21680 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
21682 PyErr_Restore(tmp_type, tmp_value, tb);
21683 Py_XDECREF(tmp_tb);
21685 PyThreadState *tstate = __Pyx_PyThreadState_Current;
21686 PyObject* tmp_tb = tstate->curexc_traceback;
21687 if (tb != tmp_tb) {
21689 tstate->curexc_traceback = tb;
21690 Py_XDECREF(tmp_tb);
21695 Py_XDECREF(owned_instance);
21701 #if !CYTHON_COMPILING_IN_PYPY 21702 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
long intval, CYTHON_UNUSED
int inplace) {
21703 #if PY_MAJOR_VERSION < 3 21704 if (likely(PyInt_CheckExact(op1))) {
21705 const long b = intval;
21707 long a = PyInt_AS_LONG(op1);
21708 x = (long)((
unsigned long)a + b);
21709 if (likely((x^a) >= 0 || (x^b) >= 0))
21710 return PyInt_FromLong(x);
21711 return PyLong_Type.tp_as_number->nb_add(op1, op2);
21714 #if CYTHON_USE_PYLONG_INTERNALS 21715 if (likely(PyLong_CheckExact(op1))) {
21716 const long b = intval;
21718 #ifdef HAVE_LONG_LONG 21719 const PY_LONG_LONG llb = intval;
21720 PY_LONG_LONG lla, llx;
21722 const digit* digits = ((PyLongObject*)op1)->ob_digit;
21723 const Py_ssize_t size = Py_SIZE(op1);
21724 if (likely(__Pyx_sst_abs(size) <= 1)) {
21725 a = likely(size) ? digits[0] : 0;
21726 if (size == -1) a = -a;
21730 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
21731 a = -(long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21733 #ifdef HAVE_LONG_LONG 21734 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
21735 lla = -(PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
21740 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
21741 a = (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21743 #ifdef HAVE_LONG_LONG 21744 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
21745 lla = (PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
21750 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
21751 a = -(long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21753 #ifdef HAVE_LONG_LONG 21754 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
21755 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]));
21760 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
21761 a = (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21763 #ifdef HAVE_LONG_LONG 21764 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
21765 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]));
21770 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
21771 a = -(long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21773 #ifdef HAVE_LONG_LONG 21774 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
21775 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]));
21780 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
21781 a = (long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21783 #ifdef HAVE_LONG_LONG 21784 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
21785 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]));
21789 default:
return PyLong_Type.tp_as_number->nb_add(op1, op2);
21793 return PyLong_FromLong(x);
21794 #ifdef HAVE_LONG_LONG 21797 return PyLong_FromLongLong(llx);
21803 if (PyFloat_CheckExact(op1)) {
21804 const long b = intval;
21805 double a = PyFloat_AS_DOUBLE(op1);
21807 PyFPE_START_PROTECT(
"add",
return NULL)
21808 result = ((double)a) + (double)b;
21809 PyFPE_END_PROTECT(result)
21812 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
21817 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
21820 r = PyObject_SetItem(o, j, v);
21824 static CYTHON_INLINE
int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t
i, PyObject *v,
int is_list,
21825 CYTHON_NCP_UNUSED
int wraparound, CYTHON_NCP_UNUSED
int boundscheck) {
21826 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS 21827 if (is_list || PyList_CheckExact(o)) {
21828 Py_ssize_t n = (!wraparound) ?
i : ((likely(
i >= 0)) ?
i :
i + PyList_GET_SIZE(o));
21829 if ((!boundscheck) || likely((n >= 0) & (n < PyList_GET_SIZE(o)))) {
21830 PyObject* old = PyList_GET_ITEM(o, n);
21832 PyList_SET_ITEM(o, n, v);
21837 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
21838 if (likely(m && m->sq_ass_item)) {
21839 if (wraparound && unlikely(
i < 0) && likely(m->sq_length)) {
21840 Py_ssize_t l = m->sq_length(o);
21841 if (likely(l >= 0)) {
21844 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
21849 return m->sq_ass_item(o,
i, v);
21853 #if CYTHON_COMPILING_IN_PYPY 21854 if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) {
21856 if (is_list || PySequence_Check(o)) {
21858 return PySequence_SetItem(o,
i, v);
21861 return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(
i), v);
21865 static int __Pyx__ArgTypeTest(PyObject *
obj, PyTypeObject *type,
const char *name,
int exact)
21867 if (unlikely(!type)) {
21868 PyErr_SetString(PyExc_SystemError,
"Missing type object");
21872 #if PY_MAJOR_VERSION == 2 21873 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(
obj)))
return 1;
21877 if (likely(__Pyx_TypeCheck(
obj, type)))
return 1;
21879 PyErr_Format(PyExc_TypeError,
21880 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
21881 name, type->tp_name, Py_TYPE(
obj)->tp_name);
21886 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level) {
21887 PyObject *empty_list = 0;
21888 PyObject *module = 0;
21889 PyObject *global_dict = 0;
21890 PyObject *empty_dict = 0;
21892 #if PY_MAJOR_VERSION < 3 21893 PyObject *py_import;
21894 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
21901 empty_list = PyList_New(0);
21906 global_dict = PyModule_GetDict(__pyx_m);
21909 empty_dict = PyDict_New();
21913 #if PY_MAJOR_VERSION >= 3 21915 if (strchr(__Pyx_MODULE_NAME,
'.')) {
21916 module = PyImport_ImportModuleLevelObject(
21917 name, global_dict, empty_dict, list, 1);
21919 if (!PyErr_ExceptionMatches(PyExc_ImportError))
21928 #if PY_MAJOR_VERSION < 3 21929 PyObject *py_level = PyInt_FromLong(level);
21932 module = PyObject_CallFunctionObjArgs(py_import,
21933 name, global_dict, empty_dict, list, py_level, NULL);
21934 Py_DECREF(py_level);
21936 module = PyImport_ImportModuleLevelObject(
21937 name, global_dict, empty_dict, list, level);
21942 #if PY_MAJOR_VERSION < 3 21943 Py_XDECREF(py_import);
21945 Py_XDECREF(empty_list);
21946 Py_XDECREF(empty_dict);
21951 static int __Pyx_SetVtable(PyObject *dict,
void *vtable) {
21952 #if PY_VERSION_HEX >= 0x02070000 21953 PyObject *ob = PyCapsule_New(vtable, 0, 0);
21955 PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
21959 if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
21969 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
21971 PyObject *name_attr;
21972 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name);
21973 if (likely(name_attr)) {
21974 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
21978 if (unlikely(ret < 0)) {
21982 Py_XDECREF(name_attr);
21985 static int __Pyx_setup_reduce(PyObject* type_obj) {
21987 PyObject *object_reduce = NULL;
21988 PyObject *object_reduce_ex = NULL;
21989 PyObject *reduce = NULL;
21990 PyObject *reduce_ex = NULL;
21991 PyObject *reduce_cython = NULL;
21992 PyObject *setstate = NULL;
21993 PyObject *setstate_cython = NULL;
21994 #if CYTHON_USE_PYTYPE_LOOKUP 21995 if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate))
goto GOOD;
21997 if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate))
goto GOOD;
21999 #if CYTHON_USE_PYTYPE_LOOKUP 22000 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto BAD;
22002 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto BAD;
22004 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex);
if (unlikely(!reduce_ex))
goto BAD;
22005 if (reduce_ex == object_reduce_ex) {
22006 #if CYTHON_USE_PYTYPE_LOOKUP 22007 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto BAD;
22009 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto BAD;
22011 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce);
if (unlikely(!reduce))
goto BAD;
22012 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
22013 reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython);
if (unlikely(!reduce_cython))
goto BAD;
22014 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython);
if (unlikely(ret < 0))
goto BAD;
22015 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython);
if (unlikely(ret < 0))
goto BAD;
22016 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
22017 if (!setstate) PyErr_Clear();
22018 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
22019 setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython);
if (unlikely(!setstate_cython))
goto BAD;
22020 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython);
if (unlikely(ret < 0))
goto BAD;
22021 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython);
if (unlikely(ret < 0))
goto BAD;
22023 PyType_Modified((PyTypeObject*)type_obj);
22028 if (!PyErr_Occurred())
22029 PyErr_Format(PyExc_RuntimeError,
"Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
22032 #if !CYTHON_USE_PYTYPE_LOOKUP 22033 Py_XDECREF(object_reduce);
22034 Py_XDECREF(object_reduce_ex);
22036 Py_XDECREF(reduce);
22037 Py_XDECREF(reduce_ex);
22038 Py_XDECREF(reduce_cython);
22039 Py_XDECREF(setstate);
22040 Py_XDECREF(setstate_cython);
22045 #if !CYTHON_COMPILING_IN_PYPY 22046 static PyObject* __Pyx_PyFloat_DivideObjC(PyObject *op1, PyObject *op2,
double floatval, CYTHON_UNUSED
int inplace) {
22047 const double b = floatval;
22049 if (likely(PyFloat_CheckExact(op1))) {
22050 a = PyFloat_AS_DOUBLE(op1);
22052 #if PY_MAJOR_VERSION < 3 22053 if (likely(PyInt_CheckExact(op1))) {
22054 a = (double) PyInt_AS_LONG(op1);
22057 if (likely(PyLong_CheckExact(op1))) {
22058 #if CYTHON_USE_PYLONG_INTERNALS 22059 const digit* digits = ((PyLongObject*)op1)->ob_digit;
22060 const Py_ssize_t size = Py_SIZE(op1);
22062 case 0: a = 0.0;
break;
22063 case -1: a = -(double) digits[0];
break;
22064 case 1: a = (double) digits[0];
break;
22067 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
22068 a = (double) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
22069 if ((8 *
sizeof(
unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
22077 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
22078 a = (double) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
22079 if ((8 *
sizeof(
unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
22087 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
22088 a = (double) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
22089 if ((8 *
sizeof(
unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
22099 a = PyLong_AsDouble(op1);
22100 if (unlikely(a == -1.0 && PyErr_Occurred()))
return NULL;
22103 return (inplace ? __Pyx_PyNumber_InPlaceDivide(op1, op2) : __Pyx_PyNumber_Divide(op1, op2));
22105 PyFPE_START_PROTECT(
"divide",
return NULL)
22107 PyFPE_END_PROTECT(result)
22113 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals) {
22114 #if CYTHON_COMPILING_IN_PYPY 22115 return PyObject_RichCompareBool(s1, s2, equals);
22118 return (equals == Py_EQ);
22119 }
else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
22120 const char *ps1, *ps2;
22121 Py_ssize_t length = PyBytes_GET_SIZE(s1);
22122 if (length != PyBytes_GET_SIZE(s2))
22123 return (equals == Py_NE);
22124 ps1 = PyBytes_AS_STRING(s1);
22125 ps2 = PyBytes_AS_STRING(s2);
22126 if (ps1[0] != ps2[0]) {
22127 return (equals == Py_NE);
22128 }
else if (length == 1) {
22129 return (equals == Py_EQ);
22132 #if CYTHON_USE_UNICODE_INTERNALS 22133 Py_hash_t hash1, hash2;
22134 hash1 = ((PyBytesObject*)s1)->ob_shash;
22135 hash2 = ((PyBytesObject*)s2)->ob_shash;
22136 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
22137 return (equals == Py_NE);
22140 result = memcmp(ps1, ps2, (
size_t)length);
22141 return (equals == Py_EQ) ? (result == 0) : (result != 0);
22143 }
else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
22144 return (equals == Py_NE);
22145 }
else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
22146 return (equals == Py_NE);
22149 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
22152 result = __Pyx_PyObject_IsTrue(py_result);
22153 Py_DECREF(py_result);
22160 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals) {
22161 #if CYTHON_COMPILING_IN_PYPY 22162 return PyObject_RichCompareBool(s1, s2, equals);
22164 #if PY_MAJOR_VERSION < 3 22165 PyObject* owned_ref = NULL;
22167 int s1_is_unicode, s2_is_unicode;
22171 s1_is_unicode = PyUnicode_CheckExact(s1);
22172 s2_is_unicode = PyUnicode_CheckExact(s2);
22173 #if PY_MAJOR_VERSION < 3 22174 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
22175 owned_ref = PyUnicode_FromObject(s2);
22176 if (unlikely(!owned_ref))
22180 }
else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
22181 owned_ref = PyUnicode_FromObject(s1);
22182 if (unlikely(!owned_ref))
22186 }
else if (((!s2_is_unicode) & (!s1_is_unicode))) {
22187 return __Pyx_PyBytes_Equals(s1, s2, equals);
22190 if (s1_is_unicode & s2_is_unicode) {
22193 void *data1, *data2;
22194 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
22196 length = __Pyx_PyUnicode_GET_LENGTH(s1);
22197 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
22200 #if CYTHON_USE_UNICODE_INTERNALS 22202 Py_hash_t hash1, hash2;
22203 #if CYTHON_PEP393_ENABLED 22204 hash1 = ((PyASCIIObject*)s1)->hash;
22205 hash2 = ((PyASCIIObject*)s2)->hash;
22207 hash1 = ((PyUnicodeObject*)s1)->hash;
22208 hash2 = ((PyUnicodeObject*)s2)->hash;
22210 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
22215 kind = __Pyx_PyUnicode_KIND(s1);
22216 if (kind != __Pyx_PyUnicode_KIND(s2)) {
22219 data1 = __Pyx_PyUnicode_DATA(s1);
22220 data2 = __Pyx_PyUnicode_DATA(s2);
22221 if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
22223 }
else if (length == 1) {
22226 int result = memcmp(data1, data2, (
size_t)(length * kind));
22227 #if PY_MAJOR_VERSION < 3 22228 Py_XDECREF(owned_ref);
22230 return (equals == Py_EQ) ? (result == 0) : (result != 0);
22232 }
else if ((s1 == Py_None) & s2_is_unicode) {
22234 }
else if ((s2 == Py_None) & s1_is_unicode) {
22238 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
22241 result = __Pyx_PyObject_IsTrue(py_result);
22242 Py_DECREF(py_result);
22246 #if PY_MAJOR_VERSION < 3 22247 Py_XDECREF(owned_ref);
22249 return (equals == Py_EQ);
22251 #if PY_MAJOR_VERSION < 3 22252 Py_XDECREF(owned_ref);
22254 return (equals == Py_NE);
22259 #ifndef CYTHON_CLINE_IN_TRACEBACK 22260 static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate,
int c_line) {
22261 PyObject *use_cline;
22262 PyObject *ptype, *pvalue, *ptraceback;
22263 #if CYTHON_COMPILING_IN_CPYTHON 22264 PyObject **cython_runtime_dict;
22266 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
22267 #if CYTHON_COMPILING_IN_CPYTHON 22268 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
22269 if (likely(cython_runtime_dict)) {
22270 use_cline = PyDict_GetItem(*cython_runtime_dict, __pyx_n_s_cline_in_traceback);
22274 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
22275 if (use_cline_obj) {
22276 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
22277 Py_DECREF(use_cline_obj);
22285 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
22287 else if (PyObject_Not(use_cline) != 0) {
22290 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
22296 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
22297 int start = 0, mid = 0, end = count - 1;
22298 if (end >= 0 && code_line > entries[end].code_line) {
22301 while (start < end) {
22302 mid = start + (end - start) / 2;
22303 if (code_line < entries[mid].code_line) {
22305 }
else if (code_line > entries[mid].code_line) {
22311 if (code_line <= entries[mid].code_line) {
22317 static PyCodeObject *__pyx_find_code_object(
int code_line) {
22318 PyCodeObject* code_object;
22320 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
22323 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
22324 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
22327 code_object = __pyx_code_cache.entries[pos].code_object;
22328 Py_INCREF(code_object);
22329 return code_object;
22331 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
22333 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
22334 if (unlikely(!code_line)) {
22337 if (unlikely(!entries)) {
22338 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
22339 if (likely(entries)) {
22340 __pyx_code_cache.entries = entries;
22341 __pyx_code_cache.max_count = 64;
22342 __pyx_code_cache.count = 1;
22343 entries[0].code_line = code_line;
22344 entries[0].code_object = code_object;
22345 Py_INCREF(code_object);
22349 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
22350 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
22351 PyCodeObject* tmp = entries[pos].code_object;
22352 entries[pos].code_object = code_object;
22356 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
22357 int new_max = __pyx_code_cache.max_count + 64;
22358 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
22359 __pyx_code_cache.entries, (
size_t)new_max*
sizeof(__Pyx_CodeObjectCacheEntry));
22360 if (unlikely(!entries)) {
22363 __pyx_code_cache.entries = entries;
22364 __pyx_code_cache.max_count = new_max;
22366 for (
i=__pyx_code_cache.count;
i>pos;
i--) {
22367 entries[
i] = entries[
i-1];
22369 entries[pos].code_line = code_line;
22370 entries[pos].code_object = code_object;
22371 __pyx_code_cache.count++;
22372 Py_INCREF(code_object);
22376 #include "compile.h" 22377 #include "frameobject.h" 22378 #include "traceback.h" 22379 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
22380 const char *funcname,
int c_line,
22381 int py_line,
const char *filename) {
22382 PyCodeObject *py_code = 0;
22383 PyObject *py_srcfile = 0;
22384 PyObject *py_funcname = 0;
22385 #if PY_MAJOR_VERSION < 3 22386 py_srcfile = PyString_FromString(filename);
22388 py_srcfile = PyUnicode_FromString(filename);
22390 if (!py_srcfile)
goto bad;
22392 #if PY_MAJOR_VERSION < 3 22393 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
22395 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
22399 #if PY_MAJOR_VERSION < 3 22400 py_funcname = PyString_FromString(funcname);
22402 py_funcname = PyUnicode_FromString(funcname);
22405 if (!py_funcname)
goto bad;
22406 py_code = __Pyx_PyCode_New(
22423 Py_DECREF(py_srcfile);
22424 Py_DECREF(py_funcname);
22427 Py_XDECREF(py_srcfile);
22428 Py_XDECREF(py_funcname);
22431 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
22432 int py_line,
const char *filename) {
22433 PyCodeObject *py_code = 0;
22434 PyFrameObject *py_frame = 0;
22435 PyThreadState *tstate = __Pyx_PyThreadState_Current;
22437 c_line = __Pyx_CLineForTraceback(tstate, c_line);
22439 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
22441 py_code = __Pyx_CreateCodeObjectForTraceback(
22442 funcname, c_line, py_line, filename);
22443 if (!py_code)
goto bad;
22444 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
22446 py_frame = PyFrame_New(
22452 if (!py_frame)
goto bad;
22453 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
22454 PyTraceBack_Here(py_frame);
22456 Py_XDECREF(py_code);
22457 Py_XDECREF(py_frame);
22461 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ 22462 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) 22463 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ 22464 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) 22465 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ 22467 func_type value = func_value;\ 22468 if (sizeof(target_type) < sizeof(func_type)) {\ 22469 if (unlikely(value != (func_type) (target_type) value)) {\ 22470 func_type zero = 0;\ 22471 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ 22472 return (target_type) -1;\ 22473 if (is_unsigned && unlikely(value < zero))\ 22474 goto raise_neg_overflow;\ 22476 goto raise_overflow;\ 22479 return (target_type) value;\ 22483 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value) {
22484 const int neg_one = (int) -1, const_zero = (
int) 0;
22485 const int is_unsigned = neg_one > const_zero;
22487 if (
sizeof(
int) <
sizeof(long)) {
22488 return PyInt_FromLong((
long) value);
22489 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
22490 return PyLong_FromUnsignedLong((
unsigned long) value);
22491 #ifdef HAVE_LONG_LONG 22492 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
22493 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
22497 if (
sizeof(
int) <=
sizeof(
long)) {
22498 return PyInt_FromLong((
long) value);
22499 #ifdef HAVE_LONG_LONG 22500 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
22501 return PyLong_FromLongLong((PY_LONG_LONG) value);
22506 int one = 1;
int little = (int)*(
unsigned char *)&one;
22507 unsigned char *bytes = (
unsigned char *)&value;
22508 return _PyLong_FromByteArray(bytes,
sizeof(
int),
22509 little, !is_unsigned);
22514 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *x) {
22515 const int neg_one = (int) -1, const_zero = (
int) 0;
22516 const int is_unsigned = neg_one > const_zero;
22517 #if PY_MAJOR_VERSION < 3 22518 if (likely(PyInt_Check(x))) {
22519 if (
sizeof(
int) <
sizeof(long)) {
22520 __PYX_VERIFY_RETURN_INT(
int,
long, PyInt_AS_LONG(x))
22522 long val = PyInt_AS_LONG(x);
22523 if (is_unsigned && unlikely(val < 0)) {
22524 goto raise_neg_overflow;
22530 if (likely(PyLong_Check(x))) {
22532 #if CYTHON_USE_PYLONG_INTERNALS 22533 const digit* digits = ((PyLongObject*)x)->ob_digit;
22534 switch (Py_SIZE(x)) {
22535 case 0:
return (
int) 0;
22536 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, digits[0])
22538 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
22539 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22540 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22541 }
else if (8 *
sizeof(
int) >= 2 * PyLong_SHIFT) {
22542 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
22547 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
22548 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22549 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22550 }
else if (8 *
sizeof(
int) >= 3 * PyLong_SHIFT) {
22551 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
22556 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
22557 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22558 __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])))
22559 }
else if (8 *
sizeof(
int) >= 4 * PyLong_SHIFT) {
22560 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
22566 #if CYTHON_COMPILING_IN_CPYTHON 22567 if (unlikely(Py_SIZE(x) < 0)) {
22568 goto raise_neg_overflow;
22572 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
22573 if (unlikely(result < 0))
22575 if (unlikely(result == 1))
22576 goto raise_neg_overflow;
22579 if (
sizeof(
int) <=
sizeof(
unsigned long)) {
22580 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
22581 #ifdef HAVE_LONG_LONG 22582 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
22583 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
22587 #if CYTHON_USE_PYLONG_INTERNALS 22588 const digit* digits = ((PyLongObject*)x)->ob_digit;
22589 switch (Py_SIZE(x)) {
22590 case 0:
return (
int) 0;
22591 case -1: __PYX_VERIFY_RETURN_INT(
int, sdigit, (sdigit) (-(sdigit)digits[0]))
22592 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, +digits[0])
22594 if (8 *
sizeof(
int) - 1 > 1 * PyLong_SHIFT) {
22595 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22596 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22597 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
22598 return (
int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
22603 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
22604 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22605 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22606 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
22607 return (
int) ((((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
22612 if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
22613 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22614 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22615 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
22616 return (
int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
22621 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
22622 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22623 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22624 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
22625 return (
int) ((((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
22630 if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
22631 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22632 __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])))
22633 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
22634 return (
int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
22639 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
22640 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22641 __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])))
22642 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
22643 return (
int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
22649 if (
sizeof(
int) <=
sizeof(long)) {
22650 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
22651 #ifdef HAVE_LONG_LONG 22652 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
22653 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
22658 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) 22659 PyErr_SetString(PyExc_RuntimeError,
22660 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
22663 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
22664 #if PY_MAJOR_VERSION < 3 22665 if (likely(v) && !PyLong_Check(v)) {
22667 v = PyNumber_Long(tmp);
22672 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
22673 unsigned char *bytes = (
unsigned char *)&val;
22674 int ret = _PyLong_AsByteArray((PyLongObject *)v,
22675 bytes,
sizeof(val),
22676 is_little, !is_unsigned);
22686 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
22687 if (!tmp)
return (
int) -1;
22688 val = __Pyx_PyInt_As_int(tmp);
22693 PyErr_SetString(PyExc_OverflowError,
22694 "value too large to convert to int");
22696 raise_neg_overflow:
22697 PyErr_SetString(PyExc_OverflowError,
22698 "can't convert negative value to int");
22703 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value) {
22704 const long neg_one = (long) -1, const_zero = (
long) 0;
22705 const int is_unsigned = neg_one > const_zero;
22707 if (
sizeof(
long) <
sizeof(long)) {
22708 return PyInt_FromLong((
long) value);
22709 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
22710 return PyLong_FromUnsignedLong((
unsigned long) value);
22711 #ifdef HAVE_LONG_LONG 22712 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
22713 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
22717 if (
sizeof(
long) <=
sizeof(
long)) {
22718 return PyInt_FromLong((
long) value);
22719 #ifdef HAVE_LONG_LONG 22720 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
22721 return PyLong_FromLongLong((PY_LONG_LONG) value);
22726 int one = 1;
int little = (int)*(
unsigned char *)&one;
22727 unsigned char *bytes = (
unsigned char *)&value;
22728 return _PyLong_FromByteArray(bytes,
sizeof(
long),
22729 little, !is_unsigned);
22734 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *x) {
22735 const long neg_one = (long) -1, const_zero = (
long) 0;
22736 const int is_unsigned = neg_one > const_zero;
22737 #if PY_MAJOR_VERSION < 3 22738 if (likely(PyInt_Check(x))) {
22739 if (
sizeof(
long) <
sizeof(long)) {
22740 __PYX_VERIFY_RETURN_INT(
long,
long, PyInt_AS_LONG(x))
22742 long val = PyInt_AS_LONG(x);
22743 if (is_unsigned && unlikely(val < 0)) {
22744 goto raise_neg_overflow;
22750 if (likely(PyLong_Check(x))) {
22752 #if CYTHON_USE_PYLONG_INTERNALS 22753 const digit* digits = ((PyLongObject*)x)->ob_digit;
22754 switch (Py_SIZE(x)) {
22755 case 0:
return (
long) 0;
22756 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, digits[0])
22758 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
22759 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22760 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22761 }
else if (8 *
sizeof(
long) >= 2 * PyLong_SHIFT) {
22762 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
22767 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
22768 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22769 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22770 }
else if (8 *
sizeof(
long) >= 3 * PyLong_SHIFT) {
22771 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
22776 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
22777 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22778 __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])))
22779 }
else if (8 *
sizeof(
long) >= 4 * PyLong_SHIFT) {
22780 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
22786 #if CYTHON_COMPILING_IN_CPYTHON 22787 if (unlikely(Py_SIZE(x) < 0)) {
22788 goto raise_neg_overflow;
22792 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
22793 if (unlikely(result < 0))
22795 if (unlikely(result == 1))
22796 goto raise_neg_overflow;
22799 if (
sizeof(
long) <=
sizeof(
unsigned long)) {
22800 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
22801 #ifdef HAVE_LONG_LONG 22802 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
22803 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
22807 #if CYTHON_USE_PYLONG_INTERNALS 22808 const digit* digits = ((PyLongObject*)x)->ob_digit;
22809 switch (Py_SIZE(x)) {
22810 case 0:
return (
long) 0;
22811 case -1: __PYX_VERIFY_RETURN_INT(
long, sdigit, (sdigit) (-(sdigit)digits[0]))
22812 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, +digits[0])
22814 if (8 *
sizeof(
long) - 1 > 1 * PyLong_SHIFT) {
22815 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22816 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22817 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
22818 return (
long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
22823 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
22824 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22825 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22826 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
22827 return (
long) ((((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
22832 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
22833 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22834 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22835 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
22836 return (
long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
22841 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
22842 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22843 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22844 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
22845 return (
long) ((((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
22850 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
22851 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22852 __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])))
22853 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
22854 return (
long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
22859 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
22860 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22861 __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])))
22862 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
22863 return (
long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
22869 if (
sizeof(
long) <=
sizeof(long)) {
22870 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
22871 #ifdef HAVE_LONG_LONG 22872 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
22873 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
22878 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) 22879 PyErr_SetString(PyExc_RuntimeError,
22880 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
22883 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
22884 #if PY_MAJOR_VERSION < 3 22885 if (likely(v) && !PyLong_Check(v)) {
22887 v = PyNumber_Long(tmp);
22892 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
22893 unsigned char *bytes = (
unsigned char *)&val;
22894 int ret = _PyLong_AsByteArray((PyLongObject *)v,
22895 bytes,
sizeof(val),
22896 is_little, !is_unsigned);
22906 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
22907 if (!tmp)
return (
long) -1;
22908 val = __Pyx_PyInt_As_long(tmp);
22913 PyErr_SetString(PyExc_OverflowError,
22914 "value too large to convert to long");
22916 raise_neg_overflow:
22917 PyErr_SetString(PyExc_OverflowError,
22918 "can't convert negative value to long");
22923 #if CYTHON_COMPILING_IN_CPYTHON 22924 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
22930 return b == &PyBaseObject_Type;
22932 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
22934 if (a == b)
return 1;
22938 n = PyTuple_GET_SIZE(mro);
22939 for (
i = 0;
i < n;
i++) {
22940 if (PyTuple_GET_ITEM(mro,
i) == (PyObject *)b)
22945 return __Pyx_InBases(a, b);
22947 #if PY_MAJOR_VERSION == 2 22948 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
22949 PyObject *exception, *value, *tb;
22951 __Pyx_PyThreadState_declare
22952 __Pyx_PyThreadState_assign
22953 __Pyx_ErrFetch(&exception, &value, &tb);
22954 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
22955 if (unlikely(res == -1)) {
22956 PyErr_WriteUnraisable(err);
22960 res = PyObject_IsSubclass(err, exc_type2);
22961 if (unlikely(res == -1)) {
22962 PyErr_WriteUnraisable(err);
22966 __Pyx_ErrRestore(exception, value, tb);
22970 static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
22971 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
22973 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
22978 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
22979 if (likely(err == exc_type))
return 1;
22980 if (likely(PyExceptionClass_Check(err))) {
22981 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
22983 return PyErr_GivenExceptionMatches(err, exc_type);
22985 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
22986 if (likely(err == exc_type1 || err == exc_type2))
return 1;
22987 if (likely(PyExceptionClass_Check(err))) {
22988 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
22990 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
22995 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
22996 PyObject* fake_module;
22997 PyTypeObject* cached_type = NULL;
22998 fake_module = PyImport_AddModule((
char*)
"_cython_" CYTHON_ABI);
22999 if (!fake_module)
return NULL;
23000 Py_INCREF(fake_module);
23001 cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
23003 if (!PyType_Check((PyObject*)cached_type)) {
23004 PyErr_Format(PyExc_TypeError,
23005 "Shared Cython type %.200s is not a type object",
23009 if (cached_type->tp_basicsize != type->tp_basicsize) {
23010 PyErr_Format(PyExc_TypeError,
23011 "Shared Cython type %.200s has the wrong size, try recompiling",
23016 if (!PyErr_ExceptionMatches(PyExc_AttributeError))
goto bad;
23018 if (PyType_Ready(type) < 0)
goto bad;
23019 if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
23022 cached_type = type;
23025 Py_DECREF(fake_module);
23026 return cached_type;
23028 Py_XDECREF(cached_type);
23029 cached_type = NULL;
23034 #if CYTHON_FAST_THREAD_STATE 23035 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
23036 PyObject *tmp_type, *tmp_value, *tmp_tb;
23037 #if PY_VERSION_HEX >= 0x030700A2 23038 tmp_type = tstate->exc_state.exc_type;
23039 tmp_value = tstate->exc_state.exc_value;
23040 tmp_tb = tstate->exc_state.exc_traceback;
23041 tstate->exc_state.exc_type = *type;
23042 tstate->exc_state.exc_value = *value;
23043 tstate->exc_state.exc_traceback = *tb;
23045 tmp_type = tstate->exc_type;
23046 tmp_value = tstate->exc_value;
23047 tmp_tb = tstate->exc_traceback;
23048 tstate->exc_type = *type;
23049 tstate->exc_value = *value;
23050 tstate->exc_traceback = *tb;
23053 *value = tmp_value;
23057 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
23058 PyObject *tmp_type, *tmp_value, *tmp_tb;
23059 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
23060 PyErr_SetExcInfo(*type, *value, *tb);
23062 *value = tmp_value;
23068 static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
23069 PyObject *result = NULL;
23070 #if CYTHON_UNPACK_METHODS 23071 if (likely(PyMethod_Check(method))) {
23072 PyObject *
self = PyMethod_GET_SELF(method);
23073 if (likely(
self)) {
23075 PyObject *
function = PyMethod_GET_FUNCTION(method);
23076 #if CYTHON_FAST_PYCALL 23077 if (PyFunction_Check(
function)) {
23078 PyObject *args[2] = {
self, arg};
23079 result = __Pyx_PyFunction_FastCall(
function, args, 2);
23083 #if CYTHON_FAST_PYCCALL 23084 if (__Pyx_PyFastCFunction_Check(
function)) {
23085 PyObject *args[2] = {
self, arg};
23086 result = __Pyx_PyCFunction_FastCall(
function, args, 2);
23090 args = PyTuple_New(2);
23091 if (unlikely(!args))
goto done;
23093 PyTuple_SET_ITEM(args, 0,
self);
23095 PyTuple_SET_ITEM(args, 1, arg);
23096 Py_INCREF(
function);
23097 result = __Pyx_PyObject_Call(
function, args, NULL);
23099 Py_DECREF(
function);
23104 result = __Pyx_PyObject_CallOneArg(method, arg);
23109 static PyObject* __Pyx_PyObject_CallMethod1(PyObject*
obj, PyObject* method_name, PyObject* arg) {
23110 PyObject *method, *result = NULL;
23111 method = __Pyx_PyObject_GetAttrStr(
obj, method_name);
23112 if (unlikely(!method))
goto done;
23113 result = __Pyx__PyObject_CallMethod1(method, arg);
23115 Py_XDECREF(method);
23120 #include <structmember.h> 23121 #include <frameobject.h> 23122 #define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom) 23123 static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) {
23124 PyObject *et, *ev, *tb;
23125 PyObject *value = NULL;
23126 __Pyx_ErrFetch(&et, &ev, &tb);
23130 Py_INCREF(Py_None);
23134 if (likely(et == PyExc_StopIteration)) {
23136 Py_INCREF(Py_None);
23139 #if PY_VERSION_HEX >= 0x030300A0 23140 else if (Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) {
23141 value = ((PyStopIterationObject *)ev)->value;
23146 else if (unlikely(PyTuple_Check(ev))) {
23147 if (PyTuple_GET_SIZE(ev) >= 1) {
23148 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 23149 value = PyTuple_GET_ITEM(ev, 0);
23152 value = PySequence_ITEM(ev, 0);
23155 Py_INCREF(Py_None);
23160 else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
23163 if (likely(value)) {
23169 }
else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
23170 __Pyx_ErrRestore(et, ev, tb);
23173 PyErr_NormalizeException(&et, &ev, &tb);
23174 if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
23175 __Pyx_ErrRestore(et, ev, tb);
23180 #if PY_VERSION_HEX >= 0x030300A0 23181 value = ((PyStopIterationObject *)ev)->value;
23186 PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args);
23188 if (likely(args)) {
23189 value = PySequence_GetItem(args, 0);
23192 if (unlikely(!value)) {
23193 __Pyx_ErrRestore(NULL, NULL, NULL);
23194 Py_INCREF(Py_None);
23202 static CYTHON_INLINE
23203 void __Pyx_Coroutine_ExceptionClear(__pyx_CoroutineObject *
self) {
23204 PyObject *exc_type =
self->exc_type;
23205 PyObject *exc_value =
self->exc_value;
23206 PyObject *exc_traceback =
self->exc_traceback;
23207 self->exc_type = NULL;
23208 self->exc_value = NULL;
23209 self->exc_traceback = NULL;
23210 Py_XDECREF(exc_type);
23211 Py_XDECREF(exc_value);
23212 Py_XDECREF(exc_traceback);
23214 #define __Pyx_Coroutine_AlreadyRunningError(gen) (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL) 23215 static void __Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject *gen) {
23218 #ifdef __Pyx_Coroutine_USED 23219 }
else if (__Pyx_Coroutine_CheckExact((PyObject*)gen)) {
23220 msg =
"coroutine already executing";
23222 #ifdef __Pyx_AsyncGen_USED 23223 }
else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
23224 msg =
"async generator already executing";
23227 msg =
"generator already executing";
23229 PyErr_SetString(PyExc_ValueError, msg);
23231 #define __Pyx_Coroutine_NotStartedError(gen) (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL) 23232 static void __Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject *gen) {
23235 #ifdef __Pyx_Coroutine_USED 23236 }
else if (__Pyx_Coroutine_CheckExact(gen)) {
23237 msg =
"can't send non-None value to a just-started coroutine";
23239 #ifdef __Pyx_AsyncGen_USED 23240 }
else if (__Pyx_AsyncGen_CheckExact(gen)) {
23241 msg =
"can't send non-None value to a just-started async generator";
23244 msg =
"can't send non-None value to a just-started generator";
23246 PyErr_SetString(PyExc_TypeError, msg);
23248 #define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing) (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL) 23249 static void __Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject *gen, PyObject *value, CYTHON_UNUSED
int closing) {
23250 #ifdef __Pyx_Coroutine_USED 23251 if (!closing && __Pyx_Coroutine_CheckExact(gen)) {
23252 PyErr_SetString(PyExc_RuntimeError,
"cannot reuse already awaited coroutine");
23256 #ifdef __Pyx_AsyncGen_USED 23257 if (__Pyx_AsyncGen_CheckExact(gen))
23258 PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration);
23261 PyErr_SetNone(PyExc_StopIteration);
23265 PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *
self, PyObject *value,
int closing) {
23266 __Pyx_PyThreadState_declare
23267 PyThreadState *tstate;
23269 assert(!self->is_running);
23270 if (unlikely(self->resume_label == 0)) {
23271 if (unlikely(value && value != Py_None)) {
23272 return __Pyx_Coroutine_NotStartedError((PyObject*)
self);
23275 if (unlikely(self->resume_label == -1)) {
23276 return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)
self, value, closing);
23278 #if CYTHON_FAST_THREAD_STATE 23279 __Pyx_PyThreadState_assign
23280 tstate = __pyx_tstate;
23282 tstate = __Pyx_PyThreadState_Current;
23284 if (self->exc_type) {
23285 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON 23287 if (self->exc_traceback) {
23288 PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
23289 PyFrameObject *f = tb->tb_frame;
23290 Py_XINCREF(tstate->frame);
23291 assert(f->f_back == NULL);
23292 f->f_back = tstate->frame;
23295 __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value,
23296 &self->exc_traceback);
23298 __Pyx_Coroutine_ExceptionClear(
self);
23299 __Pyx_ExceptionSave(&self->exc_type, &self->exc_value, &self->exc_traceback);
23301 self->is_running = 1;
23302 retval =
self->body((PyObject *)
self, tstate, value);
23303 self->is_running = 0;
23306 static CYTHON_INLINE
void __Pyx_Coroutine_ResetFrameBackpointer(__pyx_CoroutineObject *
self) {
23307 if (likely(self->exc_traceback)) {
23308 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON 23310 PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
23311 PyFrameObject *f = tb->tb_frame;
23312 Py_CLEAR(f->f_back);
23316 static CYTHON_INLINE
23317 PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *retval) {
23318 if (unlikely(!retval)) {
23319 __Pyx_PyThreadState_declare
23320 __Pyx_PyThreadState_assign
23321 if (!__Pyx_PyErr_Occurred()) {
23322 PyObject *exc = PyExc_StopIteration;
23323 #ifdef __Pyx_AsyncGen_USED 23324 if (__Pyx_AsyncGen_CheckExact(gen))
23325 exc = __Pyx_PyExc_StopAsyncIteration;
23327 __Pyx_PyErr_SetNone(exc);
23332 static CYTHON_INLINE
23333 PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
23335 PyObject *val = NULL;
23336 __Pyx_Coroutine_Undelegate(gen);
23337 __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
23338 ret = __Pyx_Coroutine_SendEx(gen, val, 0);
23342 static PyObject *__Pyx_Coroutine_Send(PyObject *
self, PyObject *value) {
23344 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*)
self;
23345 PyObject *yf = gen->yieldfrom;
23346 if (unlikely(gen->is_running))
23347 return __Pyx_Coroutine_AlreadyRunningError(gen);
23350 gen->is_running = 1;
23351 #ifdef __Pyx_Generator_USED 23352 if (__Pyx_Generator_CheckExact(yf)) {
23353 ret = __Pyx_Coroutine_Send(yf, value);
23356 #ifdef __Pyx_Coroutine_USED 23357 if (__Pyx_Coroutine_CheckExact(yf)) {
23358 ret = __Pyx_Coroutine_Send(yf, value);
23361 #ifdef __Pyx_AsyncGen_USED 23362 if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
23363 ret = __Pyx_async_gen_asend_send(yf, value);
23366 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) 23367 if (PyGen_CheckExact(yf)) {
23368 ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
23371 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) 23372 if (PyCoro_CheckExact(yf)) {
23373 ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
23377 if (value == Py_None)
23378 ret = Py_TYPE(yf)->tp_iternext(yf);
23380 ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
23382 gen->is_running = 0;
23386 retval = __Pyx_Coroutine_FinishDelegation(gen);
23388 retval = __Pyx_Coroutine_SendEx(gen, value, 0);
23390 return __Pyx_Coroutine_MethodReturn(
self, retval);
23392 static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
23393 PyObject *retval = NULL;
23395 #ifdef __Pyx_Generator_USED 23396 if (__Pyx_Generator_CheckExact(yf)) {
23397 retval = __Pyx_Coroutine_Close(yf);
23402 #ifdef __Pyx_Coroutine_USED 23403 if (__Pyx_Coroutine_CheckExact(yf)) {
23404 retval = __Pyx_Coroutine_Close(yf);
23408 if (__Pyx_CoroutineAwait_CheckExact(yf)) {
23409 retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf);
23414 #ifdef __Pyx_AsyncGen_USED 23415 if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
23416 retval = __Pyx_async_gen_asend_close(yf, NULL);
23418 if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
23419 retval = __Pyx_async_gen_athrow_close(yf, NULL);
23424 gen->is_running = 1;
23425 meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close);
23426 if (unlikely(!meth)) {
23427 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
23428 PyErr_WriteUnraisable(yf);
23432 retval = PyObject_CallFunction(meth, NULL);
23437 gen->is_running = 0;
23439 Py_XDECREF(retval);
23442 static PyObject *__Pyx_Generator_Next(PyObject *
self) {
23443 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*)
self;
23444 PyObject *yf = gen->yieldfrom;
23445 if (unlikely(gen->is_running))
23446 return __Pyx_Coroutine_AlreadyRunningError(gen);
23449 gen->is_running = 1;
23450 #ifdef __Pyx_Generator_USED 23451 if (__Pyx_Generator_CheckExact(yf)) {
23452 ret = __Pyx_Generator_Next(yf);
23455 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) 23456 if (PyGen_CheckExact(yf)) {
23457 ret = _PyGen_Send((PyGenObject*)yf, NULL);
23460 ret = Py_TYPE(yf)->tp_iternext(yf);
23461 gen->is_running = 0;
23465 return __Pyx_Coroutine_FinishDelegation(gen);
23467 return __Pyx_Coroutine_SendEx(gen, Py_None, 0);
23469 static PyObject *__Pyx_Coroutine_Close(PyObject *
self) {
23470 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
23471 PyObject *retval, *raised_exception;
23472 PyObject *yf = gen->yieldfrom;
23474 if (unlikely(gen->is_running))
23475 return __Pyx_Coroutine_AlreadyRunningError(gen);
23478 err = __Pyx_Coroutine_CloseIter(gen, yf);
23479 __Pyx_Coroutine_Undelegate(gen);
23483 PyErr_SetNone(PyExc_GeneratorExit);
23484 retval = __Pyx_Coroutine_SendEx(gen, NULL, 1);
23485 if (unlikely(retval)) {
23489 #ifdef __Pyx_Coroutine_USED 23490 }
else if (__Pyx_Coroutine_CheckExact(
self)) {
23491 msg =
"coroutine ignored GeneratorExit";
23493 #ifdef __Pyx_AsyncGen_USED 23494 }
else if (__Pyx_AsyncGen_CheckExact(
self)) {
23495 #if PY_VERSION_HEX < 0x03060000 23496 msg =
"async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)";
23498 msg =
"async generator ignored GeneratorExit";
23502 msg =
"generator ignored GeneratorExit";
23504 PyErr_SetString(PyExc_RuntimeError, msg);
23507 raised_exception = PyErr_Occurred();
23508 if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) {
23509 if (raised_exception) PyErr_Clear();
23510 Py_INCREF(Py_None);
23515 static PyObject *__Pyx__Coroutine_Throw(PyObject *
self, PyObject *typ, PyObject *val, PyObject *tb,
23516 PyObject *args,
int close_on_genexit) {
23517 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
23518 PyObject *yf = gen->yieldfrom;
23519 if (unlikely(gen->is_running))
23520 return __Pyx_Coroutine_AlreadyRunningError(gen);
23524 if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
23525 int err = __Pyx_Coroutine_CloseIter(gen, yf);
23527 __Pyx_Coroutine_Undelegate(gen);
23529 return __Pyx_Coroutine_MethodReturn(
self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
23532 gen->is_running = 1;
23534 #ifdef __Pyx_Generator_USED
23535 || __Pyx_Generator_CheckExact(yf)
23537 #ifdef __Pyx_Coroutine_USED
23538 || __Pyx_Coroutine_CheckExact(yf)
23541 ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
23542 #ifdef __Pyx_Coroutine_USED 23543 }
else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
23544 ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
23547 PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw);
23548 if (unlikely(!meth)) {
23550 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
23551 gen->is_running = 0;
23555 __Pyx_Coroutine_Undelegate(gen);
23556 gen->is_running = 0;
23559 if (likely(args)) {
23560 ret = PyObject_CallObject(meth, args);
23562 ret = PyObject_CallFunctionObjArgs(meth, typ, val, tb, NULL);
23566 gen->is_running = 0;
23569 ret = __Pyx_Coroutine_FinishDelegation(gen);
23571 return __Pyx_Coroutine_MethodReturn(
self, ret);
23574 __Pyx_Raise(typ, val, tb, NULL);
23575 return __Pyx_Coroutine_MethodReturn(
self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
23577 static PyObject *__Pyx_Coroutine_Throw(PyObject *
self, PyObject *args) {
23579 PyObject *val = NULL;
23580 PyObject *tb = NULL;
23581 if (!PyArg_UnpackTuple(args, (
char *)
"throw", 1, 3, &typ, &val, &tb))
23583 return __Pyx__Coroutine_Throw(
self, typ, val, tb, args, 1);
23585 static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit,
void *arg) {
23586 Py_VISIT(gen->closure);
23587 Py_VISIT(gen->classobj);
23588 Py_VISIT(gen->yieldfrom);
23589 Py_VISIT(gen->exc_type);
23590 Py_VISIT(gen->exc_value);
23591 Py_VISIT(gen->exc_traceback);
23594 static int __Pyx_Coroutine_clear(PyObject *
self) {
23595 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
23596 Py_CLEAR(gen->closure);
23597 Py_CLEAR(gen->classobj);
23598 Py_CLEAR(gen->yieldfrom);
23599 Py_CLEAR(gen->exc_type);
23600 Py_CLEAR(gen->exc_value);
23601 Py_CLEAR(gen->exc_traceback);
23602 #ifdef __Pyx_AsyncGen_USED 23603 if (__Pyx_AsyncGen_CheckExact(
self)) {
23604 Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
23607 Py_CLEAR(gen->gi_name);
23608 Py_CLEAR(gen->gi_qualname);
23609 Py_CLEAR(gen->gi_modulename);
23612 static void __Pyx_Coroutine_dealloc(PyObject *
self) {
23613 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
23614 PyObject_GC_UnTrack(gen);
23615 if (gen->gi_weakreflist != NULL)
23616 PyObject_ClearWeakRefs(
self);
23617 if (gen->resume_label >= 0) {
23618 PyObject_GC_Track(
self);
23619 #if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE 23620 if (PyObject_CallFinalizerFromDealloc(
self))
23622 Py_TYPE(gen)->tp_del(
self);
23623 if (self->ob_refcnt > 0)
23628 PyObject_GC_UnTrack(
self);
23630 #ifdef __Pyx_AsyncGen_USED 23631 if (__Pyx_AsyncGen_CheckExact(
self)) {
23635 Py_CLEAR(((__pyx_PyAsyncGenObject*)
self)->ag_finalizer);
23638 __Pyx_Coroutine_clear(
self);
23639 PyObject_GC_Del(gen);
23641 static void __Pyx_Coroutine_del(PyObject *
self) {
23642 PyObject *error_type, *error_value, *error_traceback;
23643 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
23644 __Pyx_PyThreadState_declare
23645 if (gen->resume_label < 0) {
23648 #if !CYTHON_USE_TP_FINALIZE 23649 assert(self->ob_refcnt == 0);
23650 self->ob_refcnt = 1;
23652 __Pyx_PyThreadState_assign
23653 __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
23654 #ifdef __Pyx_AsyncGen_USED 23655 if (__Pyx_AsyncGen_CheckExact(
self)) {
23656 __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)
self;
23657 PyObject *finalizer = agen->ag_finalizer;
23658 if (finalizer && !agen->ag_closed) {
23659 PyObject *res = __Pyx_PyObject_CallOneArg(finalizer,
self);
23660 if (unlikely(!res)) {
23661 PyErr_WriteUnraisable(
self);
23665 __Pyx_ErrRestore(error_type, error_value, error_traceback);
23670 if (unlikely(gen->resume_label == 0 && !error_value)) {
23671 #ifdef __Pyx_Coroutine_USED 23672 #ifdef __Pyx_Generator_USED 23673 if (!__Pyx_Generator_CheckExact(
self))
23676 PyObject_GC_UnTrack(
self);
23677 #if PY_MAJOR_VERSION >= 3 || defined(PyErr_WarnFormat) 23678 if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1,
"coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
23679 PyErr_WriteUnraisable(
self);
23683 #if CYTHON_COMPILING_IN_PYPY 23685 cmsg = (
char*)
"coroutine was never awaited";
23688 PyObject *qualname;
23689 qualname = gen->gi_qualname;
23690 cname = PyString_AS_STRING(qualname);
23691 msg = PyString_FromFormat(
"coroutine '%.50s' was never awaited", cname);
23692 if (unlikely(!msg)) {
23694 cmsg = (
char*)
"coroutine was never awaited";
23696 cmsg = PyString_AS_STRING(msg);
23699 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0))
23700 PyErr_WriteUnraisable(
self);
23703 PyObject_GC_Track(
self);
23707 PyObject *res = __Pyx_Coroutine_Close(
self);
23708 if (unlikely(!res)) {
23709 if (PyErr_Occurred())
23710 PyErr_WriteUnraisable(
self);
23715 __Pyx_ErrRestore(error_type, error_value, error_traceback);
23716 #if !CYTHON_USE_TP_FINALIZE 23717 assert(self->ob_refcnt > 0);
23718 if (--self->ob_refcnt == 0) {
23722 Py_ssize_t refcnt =
self->ob_refcnt;
23723 _Py_NewReference(
self);
23724 self->ob_refcnt = refcnt;
23726 #if CYTHON_COMPILING_IN_CPYTHON 23727 assert(PyType_IS_GC(self->ob_type) &&
23728 _Py_AS_GC(
self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
23731 #ifdef COUNT_ALLOCS 23732 --Py_TYPE(
self)->tp_frees;
23733 --Py_TYPE(
self)->tp_allocs;
23738 __Pyx_Coroutine_get_name(__pyx_CoroutineObject *
self)
23740 PyObject *name =
self->gi_name;
23741 if (unlikely(!name)) name = Py_None;
23746 __Pyx_Coroutine_set_name(__pyx_CoroutineObject *
self, PyObject *value)
23749 #if PY_MAJOR_VERSION >= 3 23750 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
23752 if (unlikely(value == NULL || !PyString_Check(value))) {
23754 PyErr_SetString(PyExc_TypeError,
23755 "__name__ must be set to a string object");
23758 tmp =
self->gi_name;
23760 self->gi_name = value;
23765 __Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *
self)
23767 PyObject *name =
self->gi_qualname;
23768 if (unlikely(!name)) name = Py_None;
23773 __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *
self, PyObject *value)
23776 #if PY_MAJOR_VERSION >= 3 23777 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
23779 if (unlikely(value == NULL || !PyString_Check(value))) {
23781 PyErr_SetString(PyExc_TypeError,
23782 "__qualname__ must be set to a string object");
23785 tmp =
self->gi_qualname;
23787 self->gi_qualname = value;
23791 static __pyx_CoroutineObject *__Pyx__Coroutine_New(
23792 PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *closure,
23793 PyObject *name, PyObject *qualname, PyObject *module_name) {
23794 __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
23795 if (unlikely(!gen))
23797 return __Pyx__Coroutine_NewInit(gen, body, closure, name, qualname, module_name);
23799 static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
23800 __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *closure,
23801 PyObject *name, PyObject *qualname, PyObject *module_name) {
23803 gen->closure = closure;
23804 Py_XINCREF(closure);
23805 gen->is_running = 0;
23806 gen->resume_label = 0;
23807 gen->classobj = NULL;
23808 gen->yieldfrom = NULL;
23809 gen->exc_type = NULL;
23810 gen->exc_value = NULL;
23811 gen->exc_traceback = NULL;
23812 gen->gi_weakreflist = NULL;
23813 Py_XINCREF(qualname);
23814 gen->gi_qualname = qualname;
23816 gen->gi_name = name;
23817 Py_XINCREF(module_name);
23818 gen->gi_modulename = module_name;
23819 PyObject_GC_Track(gen);
23824 static PyObject* __Pyx_Coroutine_patch_module(PyObject* module,
const char* py_code) {
23825 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) 23827 PyObject *globals, *result_obj;
23828 globals = PyDict_New();
if (unlikely(!globals))
goto ignore;
23829 result = PyDict_SetItemString(globals,
"_cython_coroutine_type",
23830 #ifdef __Pyx_Coroutine_USED
23831 (PyObject*)__pyx_CoroutineType);
23835 if (unlikely(result < 0))
goto ignore;
23836 result = PyDict_SetItemString(globals,
"_cython_generator_type",
23837 #ifdef __Pyx_Generator_USED
23838 (PyObject*)__pyx_GeneratorType);
23842 if (unlikely(result < 0))
goto ignore;
23843 if (unlikely(PyDict_SetItemString(globals,
"_module", module) < 0))
goto ignore;
23844 if (unlikely(PyDict_SetItemString(globals,
"__builtins__", __pyx_b) < 0))
goto ignore;
23845 result_obj = PyRun_String(py_code, Py_file_input, globals, globals);
23846 if (unlikely(!result_obj))
goto ignore;
23847 Py_DECREF(result_obj);
23848 Py_DECREF(globals);
23851 Py_XDECREF(globals);
23852 PyErr_WriteUnraisable(module);
23853 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
"Cython module failed to patch module with custom type", 1) < 0)) {
23864 #ifndef CYTHON_REGISTER_ABCS 23865 #define CYTHON_REGISTER_ABCS 1 23867 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) 23868 static PyObject* __Pyx_patch_abc_module(PyObject *module);
23869 static PyObject* __Pyx_patch_abc_module(PyObject *module) {
23870 module = __Pyx_Coroutine_patch_module(
23872 "if _cython_generator_type is not None:\n" 23873 " try: Generator = _module.Generator\n" 23874 " except AttributeError: pass\n" 23875 " else: Generator.register(_cython_generator_type)\n" 23876 "if _cython_coroutine_type is not None:\n" 23877 " try: Coroutine = _module.Coroutine\n" 23878 " except AttributeError: pass\n" 23879 " else: Coroutine.register(_cython_coroutine_type)\n" 23884 static int __Pyx_patch_abc(
void) {
23885 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) 23886 static int abc_patched = 0;
23887 if (CYTHON_REGISTER_ABCS && !abc_patched) {
23889 module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ?
"collections.abc" :
"collections");
23891 PyErr_WriteUnraisable(NULL);
23892 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
23893 ((PY_MAJOR_VERSION >= 3) ?
23894 "Cython module failed to register with collections.abc module" :
23895 "Cython module failed to register with collections module"), 1) < 0)) {
23899 module = __Pyx_patch_abc_module(module);
23901 if (unlikely(!module))
23905 module = PyImport_ImportModule(
"backports_abc");
23907 module = __Pyx_patch_abc_module(module);
23908 Py_XDECREF(module);
23915 if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL);
23921 static PyMethodDef __pyx_Generator_methods[] = {
23922 {
"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
23923 (
char*) PyDoc_STR(
"send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
23924 {
"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
23925 (
char*) PyDoc_STR(
"throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
23926 {
"close", (PyCFunction) __Pyx_Coroutine_Close, METH_NOARGS,
23927 (
char*) PyDoc_STR(
"close() -> raise GeneratorExit inside generator.")},
23930 static PyMemberDef __pyx_Generator_memberlist[] = {
23931 {(
char *)
"gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL},
23932 {(
char*)
"gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
23933 (
char*) PyDoc_STR(
"object being iterated by 'yield from', or None")},
23936 static PyGetSetDef __pyx_Generator_getsets[] = {
23937 {(
char *)
"__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
23938 (
char*) PyDoc_STR(
"name of the generator"), 0},
23939 {(
char *)
"__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
23940 (
char*) PyDoc_STR(
"qualified name of the generator"), 0},
23943 static PyTypeObject __pyx_GeneratorType_type = {
23944 PyVarObject_HEAD_INIT(0, 0)
23946 sizeof(__pyx_CoroutineObject),
23948 (destructor) __Pyx_Coroutine_dealloc,
23963 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
23965 (traverseproc) __Pyx_Coroutine_traverse,
23968 offsetof(__pyx_CoroutineObject, gi_weakreflist),
23970 (iternextfunc) __Pyx_Generator_Next,
23971 __pyx_Generator_methods,
23972 __pyx_Generator_memberlist,
23973 __pyx_Generator_getsets,
23989 #
if CYTHON_USE_TP_FINALIZE
23992 __Pyx_Coroutine_del,
23995 #
if CYTHON_USE_TP_FINALIZE
23996 __Pyx_Coroutine_del,
23997 #elif PY_VERSION_HEX >= 0x030400a1
24001 static int __pyx_Generator_init(
void) {
24002 __pyx_GeneratorType_type.tp_getattro = PyObject_GenericGetAttr;
24003 __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
24004 __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
24005 if (unlikely(!__pyx_GeneratorType)) {
24012 static int __Pyx_check_binary_version(
void) {
24013 char ctversion[4], rtversion[4];
24014 PyOS_snprintf(ctversion, 4,
"%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
24015 PyOS_snprintf(rtversion, 4,
"%s", Py_GetVersion());
24016 if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
24018 PyOS_snprintf(message,
sizeof(message),
24019 "compiletime version %s of module '%.100s' " 24020 "does not match runtime version %s",
24021 ctversion, __Pyx_MODULE_NAME, rtversion);
24022 return PyErr_WarnEx(NULL, message, 1);
24028 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
24030 #if PY_MAJOR_VERSION < 3 24031 if (t->is_unicode) {
24032 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
24033 }
else if (t->intern) {
24034 *t->p = PyString_InternFromString(t->s);
24036 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
24039 if (t->is_unicode | t->is_str) {
24041 *t->p = PyUnicode_InternFromString(t->s);
24042 }
else if (t->encoding) {
24043 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
24045 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
24048 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
24053 if (PyObject_Hash(*t->p) == -1)
24060 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
24061 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
24063 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
24065 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
24067 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 24068 #if !CYTHON_PEP393_ENABLED 24069 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
24071 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
24072 if (!defenc)
return NULL;
24073 defenc_c = PyBytes_AS_STRING(defenc);
24074 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 24076 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
24078 for (c = defenc_c; c < end; c++) {
24079 if ((
unsigned char) (*c) >= 128) {
24080 PyUnicode_AsASCIIString(o);
24086 *length = PyBytes_GET_SIZE(defenc);
24090 static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
24091 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
24092 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 24093 if (likely(PyUnicode_IS_ASCII(o))) {
24094 *length = PyUnicode_GET_LENGTH(o);
24095 return PyUnicode_AsUTF8(o);
24097 PyUnicode_AsASCIIString(o);
24101 return PyUnicode_AsUTF8AndSize(o, length);
24106 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
24107 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 24109 #
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
24110 __Pyx_sys_getdefaultencoding_not_ascii &&
24112 PyUnicode_Check(o)) {
24113 return __Pyx_PyUnicode_AsStringAndSize(o, length);
24116 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) 24117 if (PyByteArray_Check(o)) {
24118 *length = PyByteArray_GET_SIZE(o);
24119 return PyByteArray_AS_STRING(o);
24124 int r = PyBytes_AsStringAndSize(o, &result, length);
24125 if (unlikely(r < 0)) {
24132 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
24133 int is_true = x == Py_True;
24134 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
24135 else return PyObject_IsTrue(x);
24137 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result,
const char* type_name) {
24138 #if PY_MAJOR_VERSION >= 3 24139 if (PyLong_Check(result)) {
24140 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
24141 "__int__ returned non-int (type %.200s). " 24142 "The ability to return an instance of a strict subclass of int " 24143 "is deprecated, and may be removed in a future version of Python.",
24144 Py_TYPE(result)->tp_name)) {
24151 PyErr_Format(PyExc_TypeError,
24152 "__%.4s__ returned non-%.4s (type %.200s)",
24153 type_name, type_name, Py_TYPE(result)->tp_name);
24157 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
24158 #if CYTHON_USE_TYPE_SLOTS 24159 PyNumberMethods *m;
24161 const char *name = NULL;
24162 PyObject *res = NULL;
24163 #if PY_MAJOR_VERSION < 3 24164 if (likely(PyInt_Check(x) || PyLong_Check(x)))
24166 if (likely(PyLong_Check(x)))
24168 return __Pyx_NewRef(x);
24169 #if CYTHON_USE_TYPE_SLOTS 24170 m = Py_TYPE(x)->tp_as_number;
24171 #if PY_MAJOR_VERSION < 3 24172 if (m && m->nb_int) {
24174 res = m->nb_int(x);
24176 else if (m && m->nb_long) {
24178 res = m->nb_long(x);
24181 if (likely(m && m->nb_int)) {
24183 res = m->nb_int(x);
24187 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
24188 res = PyNumber_Int(x);
24192 #if PY_MAJOR_VERSION < 3 24193 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
24195 if (unlikely(!PyLong_CheckExact(res))) {
24197 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
24200 else if (!PyErr_Occurred()) {
24201 PyErr_SetString(PyExc_TypeError,
24202 "an integer is required");
24206 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
24209 #if PY_MAJOR_VERSION < 3 24210 if (likely(PyInt_CheckExact(b))) {
24211 if (
sizeof(Py_ssize_t) >=
sizeof(
long))
24212 return PyInt_AS_LONG(b);
24214 return PyInt_AsSsize_t(x);
24217 if (likely(PyLong_CheckExact(b))) {
24218 #if CYTHON_USE_PYLONG_INTERNALS 24219 const digit* digits = ((PyLongObject*)b)->ob_digit;
24220 const Py_ssize_t size = Py_SIZE(b);
24221 if (likely(__Pyx_sst_abs(size) <= 1)) {
24222 ival = likely(size) ? digits[0] : 0;
24223 if (size == -1) ival = -ival;
24228 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
24229 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
24233 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
24234 return -(Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
24238 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
24239 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
24243 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
24244 return -(Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
24248 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
24249 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]));
24253 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
24254 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]));
24260 return PyLong_AsSsize_t(b);
24262 x = PyNumber_Index(b);
24264 ival = PyInt_AsSsize_t(x);
24268 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
24269 return PyInt_FromSize_t(ival);
int compare(const index_set< LO, HI > &a, const index_set< LO, HI > &b)
"lexicographic compare" eg. {3,4,5} is less than {3,7,8}
const Multivector< Scalar_T, LO, HI > sqrt(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Square root of multivector with specified complexifier.
String clifford_to_str(const Multivector_T &mv)
The "informal" string representation of Multivector_T mv.
const Multivector< Scalar_T, LO, HI > acosh(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Inverse hyperbolic cosine of multivector with specified complexifier.
String index_set_to_repr(const Index_Set_T &ist)
The “official” string representation of Index_Set_T ist.
const Multivector< Scalar_T, LO, HI > sinh(const Multivector< Scalar_T, LO, HI > &val)
Hyperbolic sine of multivector.
index_set< lo_ndx, hi_ndx > IndexSet
Scalar_T abs(const Multivector< Scalar_T, LO, HI > &val)
Absolute value == sqrt(norm)
const Multivector< Scalar_T, LO, HI > log(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Natural logarithm of multivector with specified complexifier.
String clifford_to_repr(const Multivector_T &mv)
The “official” string representation of Multivector_T mv.
Multivector_T cga3(const Multivector_T &x)
Convert Euclidean 3D vector to Conformal Geometric Algebra null vector [DL (10.50)].
const Multivector< Scalar_T, LO, HI > sin(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Sine of multivector with specified complexifier.
const Multivector< Scalar_T, LO, HI > atanh(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Inverse hyperbolic tangent of multivector with specified complexifier.
const framed_multi< Scalar_T, LO, HI > exp(const framed_multi< Scalar_T, LO, HI > &val)
Exponential of multivector.
const Multivector< Scalar_T, LO, HI > cos(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Cosine of multivector with specified complexifier.
const Multivector< Scalar_T, LO, HI > tanh(const Multivector< Scalar_T, LO, HI > &val)
Hyperbolic tangent of multivector.
index_t min_neg(const index_set< LO, HI > &ist)
Minimum negative index, or 0 if none.
const Multivector< Scalar_T, LO, HI > asin(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Inverse sine of multivector with specified complexifier.
matrix_multi< scalar_t > Clifford
const Multivector< Scalar_T, LO, HI > complexifier(const Multivector< Scalar_T, LO, HI > &val)
Square root of -1 which commutes with all members of the frame of the given multivector.
PyObject * PyFloat_FromDouble(Scalar_T v)
const Multivector< Scalar_T, LO, HI > atan(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Inverse tangent of multivector with specified complexifier.
const Multivector< Scalar_T, LO, HI > tan(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Tangent of multivector with specified complexifier.
const Multivector< Scalar_T, LO, HI > acos(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Inverse cosine of multivector with specified complexifier.
String index_set_to_str(const Index_Set_T &ist)
The "informal" string representation of Index_Set_T ist.
index_t max_pos(const index_set< LO, HI > &ist)
Maximum positive index, or 0 if none.
const Multivector< Scalar_T, LO, HI > asinh(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Inverse hyperbolic sine of multivector with specified complexifier.
const Multivector< Scalar_T, LO, HI > operator &(const Multivector< Scalar_T, LO, HI > &lhs, const RHS< Scalar_T, LO, HI > &rhs)
Inner product.
Scalar_T max_abs(const Multivector< Scalar_T, LO, HI > &val)
Maximum of absolute values of components of multivector: multivector infinity norm.
const Multivector< Scalar_T, LO, HI > cosh(const Multivector< Scalar_T, LO, HI > &val)
Hyperbolic cosine of multivector.
bool operator!=(const Multivector< Scalar_T, LO, HI > &lhs, const RHS< Scalar_T, LO, HI > &rhs)
Test for inequality of multivectors.
Multivector_T cga3std(const Multivector_T &X)
Convert CGA3 null vector to standard Conformal Geometric Algebra null vector [DL (10.52)].
Multivector_T agc3(const Multivector_T &X)
Convert CGA3 null vector to Euclidean 3D vector [DL (10.50)].