58 #define PY_SSIZE_T_CLEAN 61 #error Python headers needed to compile C extensions, please install development version of Python. 62 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) 63 #error Cython requires Python 2.6+ or Python 3.3+. 65 #define CYTHON_ABI "0_27_3" 66 #define CYTHON_FUTURE_DIVISION 0 69 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) 71 #if !defined(WIN32) && !defined(MS_WINDOWS) 83 #define DL_IMPORT(t) t 86 #define DL_EXPORT(t) t 89 #ifndef HAVE_LONG_LONG 90 #if PY_VERSION_HEX >= 0x02070000 91 #define HAVE_LONG_LONG 95 #define PY_LONG_LONG LONG_LONG 98 #define Py_HUGE_VAL HUGE_VAL 101 #define CYTHON_COMPILING_IN_PYPY 1 102 #define CYTHON_COMPILING_IN_PYSTON 0 103 #define CYTHON_COMPILING_IN_CPYTHON 0 104 #undef CYTHON_USE_TYPE_SLOTS 105 #define CYTHON_USE_TYPE_SLOTS 0 106 #undef CYTHON_USE_PYTYPE_LOOKUP 107 #define CYTHON_USE_PYTYPE_LOOKUP 0 108 #if PY_VERSION_HEX < 0x03050000 109 #undef CYTHON_USE_ASYNC_SLOTS 110 #define CYTHON_USE_ASYNC_SLOTS 0 111 #elif !defined(CYTHON_USE_ASYNC_SLOTS) 112 #define CYTHON_USE_ASYNC_SLOTS 1 114 #undef CYTHON_USE_PYLIST_INTERNALS 115 #define CYTHON_USE_PYLIST_INTERNALS 0 116 #undef CYTHON_USE_UNICODE_INTERNALS 117 #define CYTHON_USE_UNICODE_INTERNALS 0 118 #undef CYTHON_USE_UNICODE_WRITER 119 #define CYTHON_USE_UNICODE_WRITER 0 120 #undef CYTHON_USE_PYLONG_INTERNALS 121 #define CYTHON_USE_PYLONG_INTERNALS 0 122 #undef CYTHON_AVOID_BORROWED_REFS 123 #define CYTHON_AVOID_BORROWED_REFS 1 124 #undef CYTHON_ASSUME_SAFE_MACROS 125 #define CYTHON_ASSUME_SAFE_MACROS 0 126 #undef CYTHON_UNPACK_METHODS 127 #define CYTHON_UNPACK_METHODS 0 128 #undef CYTHON_FAST_THREAD_STATE 129 #define CYTHON_FAST_THREAD_STATE 0 130 #undef CYTHON_FAST_PYCALL 131 #define CYTHON_FAST_PYCALL 0 132 #undef CYTHON_PEP489_MULTI_PHASE_INIT 133 #define CYTHON_PEP489_MULTI_PHASE_INIT 0 134 #undef CYTHON_USE_TP_FINALIZE 135 #define CYTHON_USE_TP_FINALIZE 0 136 #elif defined(PYSTON_VERSION) 137 #define CYTHON_COMPILING_IN_PYPY 0 138 #define CYTHON_COMPILING_IN_PYSTON 1 139 #define CYTHON_COMPILING_IN_CPYTHON 0 140 #ifndef CYTHON_USE_TYPE_SLOTS 141 #define CYTHON_USE_TYPE_SLOTS 1 143 #undef CYTHON_USE_PYTYPE_LOOKUP 144 #define CYTHON_USE_PYTYPE_LOOKUP 0 145 #undef CYTHON_USE_ASYNC_SLOTS 146 #define CYTHON_USE_ASYNC_SLOTS 0 147 #undef CYTHON_USE_PYLIST_INTERNALS 148 #define CYTHON_USE_PYLIST_INTERNALS 0 149 #ifndef CYTHON_USE_UNICODE_INTERNALS 150 #define CYTHON_USE_UNICODE_INTERNALS 1 152 #undef CYTHON_USE_UNICODE_WRITER 153 #define CYTHON_USE_UNICODE_WRITER 0 154 #undef CYTHON_USE_PYLONG_INTERNALS 155 #define CYTHON_USE_PYLONG_INTERNALS 0 156 #ifndef CYTHON_AVOID_BORROWED_REFS 157 #define CYTHON_AVOID_BORROWED_REFS 0 159 #ifndef CYTHON_ASSUME_SAFE_MACROS 160 #define CYTHON_ASSUME_SAFE_MACROS 1 162 #ifndef CYTHON_UNPACK_METHODS 163 #define CYTHON_UNPACK_METHODS 1 165 #undef CYTHON_FAST_THREAD_STATE 166 #define CYTHON_FAST_THREAD_STATE 0 167 #undef CYTHON_FAST_PYCALL 168 #define CYTHON_FAST_PYCALL 0 169 #undef CYTHON_PEP489_MULTI_PHASE_INIT 170 #define CYTHON_PEP489_MULTI_PHASE_INIT 0 171 #undef CYTHON_USE_TP_FINALIZE 172 #define CYTHON_USE_TP_FINALIZE 0 174 #define CYTHON_COMPILING_IN_PYPY 0 175 #define CYTHON_COMPILING_IN_PYSTON 0 176 #define CYTHON_COMPILING_IN_CPYTHON 1 177 #ifndef CYTHON_USE_TYPE_SLOTS 178 #define CYTHON_USE_TYPE_SLOTS 1 180 #if PY_VERSION_HEX < 0x02070000 181 #undef CYTHON_USE_PYTYPE_LOOKUP 182 #define CYTHON_USE_PYTYPE_LOOKUP 0 183 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) 184 #define CYTHON_USE_PYTYPE_LOOKUP 1 186 #if PY_MAJOR_VERSION < 3 187 #undef CYTHON_USE_ASYNC_SLOTS 188 #define CYTHON_USE_ASYNC_SLOTS 0 189 #elif !defined(CYTHON_USE_ASYNC_SLOTS) 190 #define CYTHON_USE_ASYNC_SLOTS 1 192 #if PY_VERSION_HEX < 0x02070000 193 #undef CYTHON_USE_PYLONG_INTERNALS 194 #define CYTHON_USE_PYLONG_INTERNALS 0 195 #elif !defined(CYTHON_USE_PYLONG_INTERNALS) 196 #define CYTHON_USE_PYLONG_INTERNALS 1 198 #ifndef CYTHON_USE_PYLIST_INTERNALS 199 #define CYTHON_USE_PYLIST_INTERNALS 1 201 #ifndef CYTHON_USE_UNICODE_INTERNALS 202 #define CYTHON_USE_UNICODE_INTERNALS 1 204 #if PY_VERSION_HEX < 0x030300F0 205 #undef CYTHON_USE_UNICODE_WRITER 206 #define CYTHON_USE_UNICODE_WRITER 0 207 #elif !defined(CYTHON_USE_UNICODE_WRITER) 208 #define CYTHON_USE_UNICODE_WRITER 1 210 #ifndef CYTHON_AVOID_BORROWED_REFS 211 #define CYTHON_AVOID_BORROWED_REFS 0 213 #ifndef CYTHON_ASSUME_SAFE_MACROS 214 #define CYTHON_ASSUME_SAFE_MACROS 1 216 #ifndef CYTHON_UNPACK_METHODS 217 #define CYTHON_UNPACK_METHODS 1 219 #ifndef CYTHON_FAST_THREAD_STATE 220 #define CYTHON_FAST_THREAD_STATE 1 222 #ifndef CYTHON_FAST_PYCALL 223 #define CYTHON_FAST_PYCALL 1 225 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT 226 #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000) 228 #ifndef CYTHON_USE_TP_FINALIZE 229 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) 232 #if !defined(CYTHON_FAST_PYCCALL) 233 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) 235 #if CYTHON_USE_PYLONG_INTERNALS 236 #include "longintrepr.h" 241 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) 242 #define Py_OptimizeFlag 0 244 #define __PYX_BUILD_PY_SSIZE_T "n" 245 #define CYTHON_FORMAT_SSIZE_T "z" 246 #if PY_MAJOR_VERSION < 3 247 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" 248 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ 249 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) 250 #define __Pyx_DefaultClassType PyClass_Type 252 #define __Pyx_BUILTIN_MODULE_NAME "builtins" 253 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ 254 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) 255 #define __Pyx_DefaultClassType PyType_Type 257 #ifndef Py_TPFLAGS_CHECKTYPES 258 #define Py_TPFLAGS_CHECKTYPES 0 260 #ifndef Py_TPFLAGS_HAVE_INDEX 261 #define Py_TPFLAGS_HAVE_INDEX 0 263 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER 264 #define Py_TPFLAGS_HAVE_NEWBUFFER 0 266 #ifndef Py_TPFLAGS_HAVE_FINALIZE 267 #define Py_TPFLAGS_HAVE_FINALIZE 0 269 #if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) 270 #ifndef METH_FASTCALL 271 #define METH_FASTCALL 0x80 273 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *
self, PyObject **args, Py_ssize_t nargs);
274 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *
self, PyObject **args,
275 Py_ssize_t nargs, PyObject *kwnames);
277 #define __Pyx_PyCFunctionFast _PyCFunctionFast 278 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords 280 #if CYTHON_FAST_PYCCALL 281 #define __Pyx_PyFastCFunction_Check(func)\ 282 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS))))) 284 #define __Pyx_PyFastCFunction_Check(func) 0 286 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 287 #define __Pyx_PyThreadState_Current PyThreadState_GET() 288 #elif PY_VERSION_HEX >= 0x03060000 289 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() 290 #elif PY_VERSION_HEX >= 0x03000000 291 #define __Pyx_PyThreadState_Current PyThreadState_GET() 293 #define __Pyx_PyThreadState_Current _PyThreadState_Current 295 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) 296 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) 298 #define __Pyx_PyDict_NewPresized(n) PyDict_New() 300 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION 301 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) 302 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) 304 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) 305 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) 307 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) 308 #define CYTHON_PEP393_ENABLED 1 309 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 310 0 : _PyUnicode_Ready((PyObject *)(op))) 311 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) 312 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) 313 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) 314 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) 315 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) 316 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) 317 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) 318 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) 320 #define CYTHON_PEP393_ENABLED 0 321 #define PyUnicode_1BYTE_KIND 1 322 #define PyUnicode_2BYTE_KIND 2 323 #define PyUnicode_4BYTE_KIND 4 324 #define __Pyx_PyUnicode_READY(op) (0) 325 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) 326 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) 327 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) 328 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) 329 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) 330 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) 331 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) 332 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) 334 #if CYTHON_COMPILING_IN_PYPY 335 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) 336 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) 338 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) 339 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ 340 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) 342 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) 343 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) 345 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) 346 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) 348 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) 349 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) 351 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) 352 #define PyObject_Malloc(s) PyMem_Malloc(s) 353 #define PyObject_Free(p) PyMem_Free(p) 354 #define PyObject_Realloc(p) PyMem_Realloc(p) 356 #if CYTHON_COMPILING_IN_PYSTON 357 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) 358 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) 360 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) 361 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) 363 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) 364 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) 365 #if PY_MAJOR_VERSION >= 3 366 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) 368 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) 370 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) 371 #define PyObject_ASCII(o) PyObject_Repr(o) 373 #if PY_MAJOR_VERSION >= 3 374 #define PyBaseString_Type PyUnicode_Type 375 #define PyStringObject PyUnicodeObject 376 #define PyString_Type PyUnicode_Type 377 #define PyString_Check PyUnicode_Check 378 #define PyString_CheckExact PyUnicode_CheckExact 380 #if PY_MAJOR_VERSION >= 3 381 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) 382 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) 384 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) 385 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) 387 #ifndef PySet_CheckExact 388 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) 390 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) 391 #if PY_MAJOR_VERSION >= 3 392 #define PyIntObject PyLongObject 393 #define PyInt_Type PyLong_Type 394 #define PyInt_Check(op) PyLong_Check(op) 395 #define PyInt_CheckExact(op) PyLong_CheckExact(op) 396 #define PyInt_FromString PyLong_FromString 397 #define PyInt_FromUnicode PyLong_FromUnicode 398 #define PyInt_FromLong PyLong_FromLong 399 #define PyInt_FromSize_t PyLong_FromSize_t 400 #define PyInt_FromSsize_t PyLong_FromSsize_t 401 #define PyInt_AsLong PyLong_AsLong 402 #define PyInt_AS_LONG PyLong_AS_LONG 403 #define PyInt_AsSsize_t PyLong_AsSsize_t 404 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask 405 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask 406 #define PyNumber_Int PyNumber_Long 408 #if PY_MAJOR_VERSION >= 3 409 #define PyBoolObject PyLongObject 411 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY 412 #ifndef PyUnicode_InternFromString 413 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) 416 #if PY_VERSION_HEX < 0x030200A4 417 typedef long Py_hash_t;
418 #define __Pyx_PyInt_FromHash_t PyInt_FromLong 419 #define __Pyx_PyInt_AsHash_t PyInt_AsLong 421 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t 422 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t 424 #if PY_MAJOR_VERSION >= 3 425 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) 427 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) 429 #ifndef __has_attribute 430 #define __has_attribute(x) 0 432 #ifndef __has_cpp_attribute 433 #define __has_cpp_attribute(x) 0 435 #if CYTHON_USE_ASYNC_SLOTS 436 #if PY_VERSION_HEX >= 0x030500B1 437 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods 438 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) 440 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) 443 #define __Pyx_PyType_AsAsync(obj) NULL 445 #ifndef __Pyx_PyAsyncMethodsStruct 450 } __Pyx_PyAsyncMethodsStruct;
452 #ifndef CYTHON_RESTRICT 453 #if defined(__GNUC__) 454 #define CYTHON_RESTRICT __restrict__ 455 #elif defined(_MSC_VER) && _MSC_VER >= 1400 456 #define CYTHON_RESTRICT __restrict 457 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 458 #define CYTHON_RESTRICT restrict 460 #define CYTHON_RESTRICT 463 #ifndef CYTHON_UNUSED 464 # if defined(__GNUC__) 465 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) 466 # define CYTHON_UNUSED __attribute__ ((__unused__)) 468 # define CYTHON_UNUSED 470 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) 471 # define CYTHON_UNUSED __attribute__ ((__unused__)) 473 # define CYTHON_UNUSED 476 #ifndef CYTHON_MAYBE_UNUSED_VAR 477 # if defined(__cplusplus) 478 template<
class T>
void CYTHON_MAYBE_UNUSED_VAR(
const T& ) { }
480 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) 483 #ifndef CYTHON_NCP_UNUSED 484 # if CYTHON_COMPILING_IN_CPYTHON 485 # define CYTHON_NCP_UNUSED 487 # define CYTHON_NCP_UNUSED CYTHON_UNUSED 490 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) 492 #ifndef _MSC_STDINT_H_ 494 typedef unsigned char uint8_t;
495 typedef unsigned int uint32_t;
497 typedef unsigned __int8 uint8_t;
498 typedef unsigned __int32 uint32_t;
504 #ifndef CYTHON_FALLTHROUGH 505 #if defined(__cplusplus) && __cplusplus >= 201103L 506 #if __has_cpp_attribute(fallthrough) 507 #define CYTHON_FALLTHROUGH [[fallthrough]] 508 #elif __has_cpp_attribute(clang::fallthrough) 509 #define CYTHON_FALLTHROUGH [[clang::fallthrough]] 510 #elif __has_cpp_attribute(gnu::fallthrough) 511 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] 514 #ifndef CYTHON_FALLTHROUGH 515 #if __has_attribute(fallthrough) 516 #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) 518 #define CYTHON_FALLTHROUGH 521 #if defined(__clang__ ) && defined(__apple_build_version__) 522 #if __apple_build_version__ < 7000000 523 #undef CYTHON_FALLTHROUGH 524 #define CYTHON_FALLTHROUGH 530 #error "Cython files generated with the C++ option must be compiled with a C++ compiler." 532 #ifndef CYTHON_INLINE 533 #if defined(__clang__) 534 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) 536 #define CYTHON_INLINE inline 540 void __Pyx_call_destructor(T& x) {
544 class __Pyx_FakeReference {
546 __Pyx_FakeReference() : ptr(NULL) { }
547 __Pyx_FakeReference(
const T& ref) : ptr(const_cast<T*>(&ref)) { }
548 T *operator->() {
return ptr; }
550 operator T&() {
return *ptr; }
551 template<
typename U>
bool operator ==(U other) {
return *ptr == other; }
552 template<
typename U>
bool operator !=(U other) {
return *ptr != other; }
557 #if defined(WIN32) || defined(MS_WINDOWS) 558 #define _USE_MATH_DEFINES 562 #define __PYX_NAN() ((float) NAN) 564 static CYTHON_INLINE
float __PYX_NAN() {
566 memset(&value, 0xFF,
sizeof(value));
570 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) 571 #define __Pyx_truncl trunc 573 #define __Pyx_truncl truncl 577 #define __PYX_ERR(f_index, lineno, Ln_error) \ 579 __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ 582 #ifndef __PYX_EXTERN_C 584 #define __PYX_EXTERN_C extern "C" 586 #define __PYX_EXTERN_C extern 590 #define __PYX_HAVE__PyClical 591 #define __PYX_HAVE_API__PyClical 602 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) 603 #define CYTHON_WITHOUT_ASSERTIONS 606 typedef struct {PyObject **p;
const char *s;
const Py_ssize_t n;
const char* encoding;
607 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
609 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 610 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 611 #define __PYX_DEFAULT_STRING_ENCODING "" 612 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString 613 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize 614 #define __Pyx_uchar_cast(c) ((unsigned char)c) 615 #define __Pyx_long_cast(x) ((long)x) 616 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ 617 (sizeof(type) < sizeof(Py_ssize_t)) ||\ 618 (sizeof(type) > sizeof(Py_ssize_t) &&\ 619 likely(v < (type)PY_SSIZE_T_MAX ||\ 620 v == (type)PY_SSIZE_T_MAX) &&\ 621 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ 622 v == (type)PY_SSIZE_T_MIN))) ||\ 623 (sizeof(type) == sizeof(Py_ssize_t) &&\ 624 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ 625 v == (type)PY_SSIZE_T_MAX))) ) 626 #if defined (__cplusplus) && __cplusplus >= 201103L 628 #define __Pyx_sst_abs(value) std::abs(value) 629 #elif SIZEOF_INT >= SIZEOF_SIZE_T 630 #define __Pyx_sst_abs(value) abs(value) 631 #elif SIZEOF_LONG >= SIZEOF_SIZE_T 632 #define __Pyx_sst_abs(value) labs(value) 633 #elif defined (_MSC_VER) 634 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) 635 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 636 #define __Pyx_sst_abs(value) llabs(value) 637 #elif defined (__GNUC__) 638 #define __Pyx_sst_abs(value) __builtin_llabs(value) 640 #define __Pyx_sst_abs(value) ((value<0) ? -value : value) 642 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
643 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
644 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) 645 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) 646 #define __Pyx_PyBytes_FromString PyBytes_FromString 647 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize 648 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
649 #if PY_MAJOR_VERSION < 3 650 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString 651 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize 653 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString 654 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize 656 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) 657 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) 658 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) 659 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) 660 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) 661 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) 662 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) 663 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) 664 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) 665 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) 666 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) 667 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) 668 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) 669 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) 670 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) 671 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) 672 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *u) {
673 const Py_UNICODE *u_end = u;
675 return (
size_t)(u_end - u - 1);
677 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) 678 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode 679 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode 680 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) 681 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) 682 #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) 683 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
684 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
685 #define __Pyx_PySequence_Tuple(obj)\ 686 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) 687 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
688 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
689 #if CYTHON_ASSUME_SAFE_MACROS 690 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) 692 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) 694 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) 695 #if PY_MAJOR_VERSION >= 3 696 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) 698 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) 700 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) 701 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 702 static int __Pyx_sys_getdefaultencoding_not_ascii;
703 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
705 PyObject* default_encoding = NULL;
706 PyObject* ascii_chars_u = NULL;
707 PyObject* ascii_chars_b = NULL;
708 const char* default_encoding_c;
709 sys = PyImport_ImportModule(
"sys");
711 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
713 if (!default_encoding)
goto bad;
714 default_encoding_c = PyBytes_AsString(default_encoding);
715 if (!default_encoding_c)
goto bad;
716 if (strcmp(default_encoding_c,
"ascii") == 0) {
717 __Pyx_sys_getdefaultencoding_not_ascii = 0;
719 char ascii_chars[128];
721 for (c = 0; c < 128; c++) {
724 __Pyx_sys_getdefaultencoding_not_ascii = 1;
725 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
726 if (!ascii_chars_u)
goto bad;
727 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
728 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
731 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
735 Py_DECREF(ascii_chars_u);
736 Py_DECREF(ascii_chars_b);
738 Py_DECREF(default_encoding);
741 Py_XDECREF(default_encoding);
742 Py_XDECREF(ascii_chars_u);
743 Py_XDECREF(ascii_chars_b);
747 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 748 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) 750 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) 751 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 752 static char* __PYX_DEFAULT_STRING_ENCODING;
753 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
755 PyObject* default_encoding = NULL;
756 char* default_encoding_c;
757 sys = PyImport_ImportModule(
"sys");
759 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
761 if (!default_encoding)
goto bad;
762 default_encoding_c = PyBytes_AsString(default_encoding);
763 if (!default_encoding_c)
goto bad;
764 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c));
765 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
766 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
767 Py_DECREF(default_encoding);
770 Py_XDECREF(default_encoding);
778 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) 779 #define likely(x) __builtin_expect(!!(x), 1) 780 #define unlikely(x) __builtin_expect(!!(x), 0) 782 #define likely(x) (x) 783 #define unlikely(x) (x) 785 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
787 static PyObject *__pyx_m = NULL;
788 static PyObject *__pyx_d;
789 static PyObject *__pyx_b;
790 static PyObject *__pyx_cython_runtime;
791 static PyObject *__pyx_empty_tuple;
792 static PyObject *__pyx_empty_bytes;
793 static PyObject *__pyx_empty_unicode;
794 static int __pyx_lineno;
795 static int __pyx_clineno = 0;
796 static const char * __pyx_cfilenm= __FILE__;
797 static const char *__pyx_filename;
800 static const char *__pyx_f[] = {
806 struct __pyx_obj_8PyClical_index_set;
807 struct __pyx_obj_8PyClical_clifford;
808 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__;
809 struct __pyx_opt_args_8PyClical_sqrt;
810 struct __pyx_opt_args_8PyClical_log;
811 struct __pyx_opt_args_8PyClical_cos;
812 struct __pyx_opt_args_8PyClical_acos;
813 struct __pyx_opt_args_8PyClical_acosh;
814 struct __pyx_opt_args_8PyClical_sin;
815 struct __pyx_opt_args_8PyClical_asin;
816 struct __pyx_opt_args_8PyClical_asinh;
817 struct __pyx_opt_args_8PyClical_tan;
818 struct __pyx_opt_args_8PyClical_atan;
819 struct __pyx_opt_args_8PyClical_atanh;
820 struct __pyx_opt_args_8PyClical_random_clifford;
829 struct __pyx_opt_args_8PyClical_sqrt {
841 struct __pyx_opt_args_8PyClical_log {
853 struct __pyx_opt_args_8PyClical_cos {
865 struct __pyx_opt_args_8PyClical_acos {
877 struct __pyx_opt_args_8PyClical_acosh {
889 struct __pyx_opt_args_8PyClical_sin {
901 struct __pyx_opt_args_8PyClical_asin {
913 struct __pyx_opt_args_8PyClical_asinh {
925 struct __pyx_opt_args_8PyClical_tan {
937 struct __pyx_opt_args_8PyClical_atan {
949 struct __pyx_opt_args_8PyClical_atanh {
961 struct __pyx_opt_args_8PyClical_random_clifford {
973 struct __pyx_obj_8PyClical_index_set {
975 struct __pyx_vtabstruct_8PyClical_index_set *__pyx_vtab;
987 struct __pyx_obj_8PyClical_clifford {
989 struct __pyx_vtabstruct_8PyClical_clifford *__pyx_vtab;
1001 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ {
1003 PyObject *__pyx_v_idx;
1004 struct __pyx_obj_8PyClical_index_set *__pyx_v_self;
1005 PyObject *__pyx_t_0;
1006 Py_ssize_t __pyx_t_1;
1007 PyObject *(*__pyx_t_2)(PyObject *);
1020 struct __pyx_vtabstruct_8PyClical_index_set {
1021 PyObject *(*wrap)(
struct __pyx_obj_8PyClical_index_set *,
IndexSet);
1022 IndexSet (*unwrap)(
struct __pyx_obj_8PyClical_index_set *);
1023 PyObject *(*copy)(
struct __pyx_obj_8PyClical_index_set *,
int __pyx_skip_dispatch);
1025 static struct __pyx_vtabstruct_8PyClical_index_set *__pyx_vtabptr_8PyClical_index_set;
1026 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_9index_set_wrap(
struct __pyx_obj_8PyClical_index_set *,
IndexSet);
1027 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_9index_set_unwrap(
struct __pyx_obj_8PyClical_index_set *);
1038 struct __pyx_vtabstruct_8PyClical_clifford {
1039 PyObject *(*wrap)(
struct __pyx_obj_8PyClical_clifford *,
Clifford);
1040 Clifford (*unwrap)(
struct __pyx_obj_8PyClical_clifford *);
1041 PyObject *(*copy)(
struct __pyx_obj_8PyClical_clifford *,
int __pyx_skip_dispatch);
1043 static struct __pyx_vtabstruct_8PyClical_clifford *__pyx_vtabptr_8PyClical_clifford;
1044 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_8clifford_wrap(
struct __pyx_obj_8PyClical_clifford *,
Clifford);
1045 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_8clifford_unwrap(
struct __pyx_obj_8PyClical_clifford *);
1049 #ifndef CYTHON_REFNANNY 1050 #define CYTHON_REFNANNY 0 1054 void (*INCREF)(
void*, PyObject*, int);
1055 void (*DECREF)(
void*, PyObject*, int);
1056 void (*GOTREF)(
void*, PyObject*, int);
1057 void (*GIVEREF)(
void*, PyObject*, int);
1058 void* (*SetupContext)(
const char*, int,
const char*);
1059 void (*FinishContext)(
void**);
1060 } __Pyx_RefNannyAPIStruct;
1061 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1062 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1063 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; 1065 #define __Pyx_RefNannySetupContext(name, acquire_gil)\ 1067 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ 1068 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ 1069 PyGILState_Release(__pyx_gilstate_save);\ 1071 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ 1074 #define __Pyx_RefNannySetupContext(name, acquire_gil)\ 1075 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) 1077 #define __Pyx_RefNannyFinishContext()\ 1078 __Pyx_RefNanny->FinishContext(&__pyx_refnanny) 1079 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1080 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1081 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1082 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1083 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) 1084 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) 1085 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) 1086 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) 1088 #define __Pyx_RefNannyDeclarations 1089 #define __Pyx_RefNannySetupContext(name, acquire_gil) 1090 #define __Pyx_RefNannyFinishContext() 1091 #define __Pyx_INCREF(r) Py_INCREF(r) 1092 #define __Pyx_DECREF(r) Py_DECREF(r) 1093 #define __Pyx_GOTREF(r) 1094 #define __Pyx_GIVEREF(r) 1095 #define __Pyx_XINCREF(r) Py_XINCREF(r) 1096 #define __Pyx_XDECREF(r) Py_XDECREF(r) 1097 #define __Pyx_XGOTREF(r) 1098 #define __Pyx_XGIVEREF(r) 1100 #define __Pyx_XDECREF_SET(r, v) do {\ 1101 PyObject *tmp = (PyObject *) r;\ 1102 r = v; __Pyx_XDECREF(tmp);\ 1104 #define __Pyx_DECREF_SET(r, v) do {\ 1105 PyObject *tmp = (PyObject *) r;\ 1106 r = v; __Pyx_DECREF(tmp);\ 1108 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) 1109 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) 1112 #if CYTHON_USE_TYPE_SLOTS 1113 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject*
obj, PyObject* attr_name) {
1114 PyTypeObject* tp = Py_TYPE(
obj);
1115 if (likely(tp->tp_getattro))
1116 return tp->tp_getattro(
obj, attr_name);
1117 #if PY_MAJOR_VERSION < 3 1118 if (likely(tp->tp_getattr))
1119 return tp->tp_getattr(
obj, PyString_AS_STRING(attr_name));
1121 return PyObject_GetAttr(
obj, attr_name);
1124 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) 1128 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1131 #if CYTHON_COMPILING_IN_CPYTHON 1132 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1134 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) 1138 #if CYTHON_FAST_THREAD_STATE 1139 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; 1140 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; 1141 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type 1143 #define __Pyx_PyThreadState_declare 1144 #define __Pyx_PyThreadState_assign 1145 #define __Pyx_PyErr_Occurred() PyErr_Occurred() 1149 #if CYTHON_FAST_THREAD_STATE 1150 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) 1151 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) 1152 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) 1153 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) 1154 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) 1155 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1156 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1157 #if CYTHON_COMPILING_IN_CPYTHON 1158 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) 1160 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) 1163 #define __Pyx_PyErr_Clear() PyErr_Clear() 1164 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) 1165 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) 1166 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) 1167 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) 1168 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) 1169 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) 1170 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) 1174 static void __Pyx_WriteUnraisable(
const char *name,
int clineno,
1175 int lineno,
const char *filename,
1176 int full_traceback,
int nogil);
1179 #if CYTHON_FAST_PYCCALL 1180 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1182 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) 1186 #if CYTHON_FAST_PYCALL 1187 #define __Pyx_PyFunction_FastCall(func, args, nargs)\ 1188 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) 1189 #if 1 || PY_VERSION_HEX < 0x030600B1 1190 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
int nargs, PyObject *kwargs);
1192 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) 1197 #if CYTHON_COMPILING_IN_CPYTHON 1198 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1202 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1205 #if CYTHON_COMPILING_IN_CPYTHON 1206 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1208 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) 1212 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
1215 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1216 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1217 const char* function_name);
1220 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1221 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1224 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
1227 #if CYTHON_FAST_THREAD_STATE 1228 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) 1229 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1230 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) 1231 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1233 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) 1234 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) 1238 #if CYTHON_FAST_THREAD_STATE 1239 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) 1240 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1242 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) 1246 #if CYTHON_FAST_THREAD_STATE 1247 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) 1248 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1250 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1254 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1257 #if !CYTHON_COMPILING_IN_PYPY 1258 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2,
long intval,
int inplace);
1260 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\ 1261 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) 1265 static CYTHON_INLINE
int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq,
int eq) {
1266 int result = PySequence_Contains(seq, item);
1267 return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
1271 #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ 1272 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ 1273 __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\ 1274 (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\ 1275 __Pyx_SetItemInt_Generic(o, to_py_func(i), v))) 1276 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
1277 static CYTHON_INLINE
int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t
i, PyObject *v,
1278 int is_list,
int wraparound,
int boundscheck);
1281 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ 1282 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\ 1283 __Pyx__ArgTypeTest(obj, type, name, exact)) 1284 static int __Pyx__ArgTypeTest(PyObject *
obj, PyTypeObject *type,
const char *name,
int exact);
1287 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
1293 static int __Pyx_SetVtable(PyObject *dict,
void *vtable);
1296 static int __Pyx_setup_reduce(PyObject* type_obj);
1299 #if !CYTHON_COMPILING_IN_PYPY 1300 static PyObject* __Pyx_PyFloat_DivideObjC(PyObject *op1, PyObject *op2,
double floatval,
int inplace);
1302 #define __Pyx_PyFloat_DivideObjC(op1, op2, floatval, inplace)\ 1303 ((inplace ? __Pyx_PyNumber_InPlaceDivide(op1, op2) : __Pyx_PyNumber_Divide(op1, op2))) 1307 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals);
1310 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals);
1313 #if PY_MAJOR_VERSION >= 3 1314 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals 1316 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals 1320 #ifdef CYTHON_CLINE_IN_TRACEBACK 1321 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) 1323 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
1328 PyCodeObject* code_object;
1330 } __Pyx_CodeObjectCacheEntry;
1331 struct __Pyx_CodeObjectCache {
1334 __Pyx_CodeObjectCacheEntry* entries;
1336 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1337 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
1338 static PyCodeObject *__pyx_find_code_object(
int code_line);
1339 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
1342 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
1343 int py_line,
const char *filename);
1346 #ifndef __Pyx_CppExn2PyErr 1349 #include <stdexcept> 1351 static void __Pyx_CppExn2PyErr() {
1353 if (PyErr_Occurred())
1357 }
catch (
const std::bad_alloc& exn) {
1358 PyErr_SetString(PyExc_MemoryError, exn.what());
1359 }
catch (
const std::bad_cast& exn) {
1360 PyErr_SetString(PyExc_TypeError, exn.what());
1361 }
catch (
const std::bad_typeid& exn) {
1362 PyErr_SetString(PyExc_TypeError, exn.what());
1363 }
catch (
const std::domain_error& exn) {
1364 PyErr_SetString(PyExc_ValueError, exn.what());
1365 }
catch (
const std::invalid_argument& exn) {
1366 PyErr_SetString(PyExc_ValueError, exn.what());
1367 }
catch (
const std::ios_base::failure& exn) {
1368 PyErr_SetString(PyExc_IOError, exn.what());
1369 }
catch (
const std::out_of_range& exn) {
1370 PyErr_SetString(PyExc_IndexError, exn.what());
1371 }
catch (
const std::overflow_error& exn) {
1372 PyErr_SetString(PyExc_OverflowError, exn.what());
1373 }
catch (
const std::range_error& exn) {
1374 PyErr_SetString(PyExc_ArithmeticError, exn.what());
1375 }
catch (
const std::underflow_error& exn) {
1376 PyErr_SetString(PyExc_ArithmeticError, exn.what());
1377 }
catch (
const std::exception& exn) {
1378 PyErr_SetString(PyExc_RuntimeError, exn.what());
1382 PyErr_SetString(PyExc_RuntimeError,
"Unknown exception");
1388 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
1391 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
1394 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
1397 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
1400 #if CYTHON_COMPILING_IN_CPYTHON 1401 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) 1402 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1403 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1404 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1406 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) 1407 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) 1408 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) 1412 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
1415 #if CYTHON_FAST_THREAD_STATE 1416 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) 1417 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1419 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
1423 static PyObject* __Pyx_PyObject_CallMethod1(PyObject*
obj, PyObject* method_name, PyObject* arg);
1424 static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg);
1427 typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyThreadState *, PyObject *);
1430 __pyx_coroutine_body_t body;
1433 PyObject *exc_value;
1434 PyObject *exc_traceback;
1435 PyObject *gi_weakreflist;
1437 PyObject *yieldfrom;
1439 PyObject *gi_qualname;
1440 PyObject *gi_modulename;
1443 } __pyx_CoroutineObject;
1444 static __pyx_CoroutineObject *__Pyx__Coroutine_New(
1445 PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *closure,
1446 PyObject *name, PyObject *qualname, PyObject *module_name);
1447 static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
1448 __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *closure,
1449 PyObject *name, PyObject *qualname, PyObject *module_name);
1450 static int __Pyx_Coroutine_clear(PyObject *
self);
1451 static PyObject *__Pyx_Coroutine_Send(PyObject *
self, PyObject *value);
1452 static PyObject *__Pyx_Coroutine_Close(PyObject *
self);
1453 static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
1454 #define __Pyx_Coroutine_SwapException(self) {\ 1455 __Pyx_ExceptionSwap(&(self)->exc_type, &(self)->exc_value, &(self)->exc_traceback);\ 1456 __Pyx_Coroutine_ResetFrameBackpointer(self);\ 1458 #define __Pyx_Coroutine_ResetAndClearException(self) {\ 1459 __Pyx_ExceptionReset((self)->exc_type, (self)->exc_value, (self)->exc_traceback);\ 1460 (self)->exc_type = (self)->exc_value = (self)->exc_traceback = NULL;\ 1462 #if CYTHON_FAST_THREAD_STATE 1463 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ 1464 __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue) 1466 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ 1467 __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue) 1469 static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue);
1470 static CYTHON_INLINE
void __Pyx_Coroutine_ResetFrameBackpointer(__pyx_CoroutineObject *
self);
1473 static PyObject* __Pyx_Coroutine_patch_module(PyObject* module,
const char* py_code);
1476 static int __Pyx_patch_abc(
void);
1479 #define __Pyx_Generator_USED 1480 static PyTypeObject *__pyx_GeneratorType = 0;
1481 #define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType) 1482 #define __Pyx_Generator_New(body, closure, name, qualname, module_name)\ 1483 __Pyx__Coroutine_New(__pyx_GeneratorType, body, closure, name, qualname, module_name) 1484 static PyObject *__Pyx_Generator_Next(PyObject *
self);
1485 static int __pyx_Generator_init(
void);
1488 static int __Pyx_check_binary_version(
void);
1491 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1493 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_9index_set_wrap(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self,
IndexSet __pyx_v_other);
1494 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_9index_set_unwrap(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
1495 static PyObject *__pyx_f_8PyClical_9index_set_copy(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self,
int __pyx_skip_dispatch);
1496 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_8clifford_wrap(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self,
Clifford __pyx_v_other);
1497 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_8clifford_unwrap(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
1498 static PyObject *__pyx_f_8PyClical_8clifford_copy(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self,
int __pyx_skip_dispatch);
1505 static PyTypeObject *__pyx_ptype_8PyClical_index_set = 0;
1506 static PyTypeObject *__pyx_ptype_8PyClical_clifford = 0;
1507 static PyTypeObject *__pyx_ptype_8PyClical___pyx_scope_struct____iter__ = 0;
1508 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_toIndexSet(PyObject *);
1509 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_compare(PyObject *, PyObject *,
int __pyx_skip_dispatch);
1510 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_min_neg(PyObject *,
int __pyx_skip_dispatch);
1511 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_max_pos(PyObject *,
int __pyx_skip_dispatch);
1512 static CYTHON_INLINE std::vector<scalar_t> __pyx_f_8PyClical_list_to_vector(PyObject *);
1513 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_toClifford(PyObject *);
1514 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_inv(PyObject *,
int __pyx_skip_dispatch);
1515 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_scalar(PyObject *,
int __pyx_skip_dispatch);
1516 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_real(PyObject *,
int __pyx_skip_dispatch);
1517 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_imag(PyObject *,
int __pyx_skip_dispatch);
1518 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_pure(PyObject *,
int __pyx_skip_dispatch);
1519 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_even(PyObject *,
int __pyx_skip_dispatch);
1520 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_odd(PyObject *,
int __pyx_skip_dispatch);
1521 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_involute(PyObject *,
int __pyx_skip_dispatch);
1522 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_reverse(PyObject *,
int __pyx_skip_dispatch);
1523 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_conj(PyObject *,
int __pyx_skip_dispatch);
1524 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_quad(PyObject *,
int __pyx_skip_dispatch);
1525 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_norm(PyObject *,
int __pyx_skip_dispatch);
1526 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_abs(PyObject *,
int __pyx_skip_dispatch);
1527 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_max_abs(PyObject *,
int __pyx_skip_dispatch);
1528 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_pow(PyObject *, PyObject *,
int __pyx_skip_dispatch);
1529 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_outer_pow(PyObject *, PyObject *,
int __pyx_skip_dispatch);
1530 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_complexifier(PyObject *,
int __pyx_skip_dispatch);
1531 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_sqrt(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_sqrt *__pyx_optional_args);
1532 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_exp(PyObject *,
int __pyx_skip_dispatch);
1533 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_log(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_log *__pyx_optional_args);
1534 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cos(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_cos *__pyx_optional_args);
1535 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_acos(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_acos *__pyx_optional_args);
1536 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cosh(PyObject *,
int __pyx_skip_dispatch);
1537 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_acosh(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_acosh *__pyx_optional_args);
1538 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_sin(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_sin *__pyx_optional_args);
1539 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_asin(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_asin *__pyx_optional_args);
1540 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_sinh(PyObject *,
int __pyx_skip_dispatch);
1541 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_asinh(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_asinh *__pyx_optional_args);
1542 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_tan(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_tan *__pyx_optional_args);
1543 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_atan(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_atan *__pyx_optional_args);
1544 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_tanh(PyObject *,
int __pyx_skip_dispatch);
1545 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_atanh(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_atanh *__pyx_optional_args);
1546 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);
1547 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cga3(PyObject *,
int __pyx_skip_dispatch);
1548 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cga3std(PyObject *,
int __pyx_skip_dispatch);
1549 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_agc3(PyObject *,
int __pyx_skip_dispatch);
1550 #define __Pyx_MODULE_NAME "PyClical" 1551 extern int __pyx_module_is_main_PyClical;
1552 int __pyx_module_is_main_PyClical = 0;
1555 static PyObject *__pyx_builtin_IndexError;
1556 static PyObject *__pyx_builtin_RuntimeError;
1557 static PyObject *__pyx_builtin_TypeError;
1558 static PyObject *__pyx_builtin_ValueError;
1559 static PyObject *__pyx_builtin_NotImplemented;
1560 static PyObject *__pyx_builtin_range;
1561 static PyObject *__pyx_builtin_xrange;
1562 static const char __pyx_k_[] =
".";
1563 static const char __pyx_k_e[] =
"e";
1564 static const char __pyx_k_i[] =
"i";
1565 static const char __pyx_k_m[] =
"m";
1566 static const char __pyx_k_p[] =
"p";
1567 static const char __pyx_k_q[] =
"q";
1568 static const char __pyx_k__2[] =
" ";
1569 static const char __pyx_k__5[] =
":";
1570 static const char __pyx_k__6[] =
"\n\t";
1571 static const char __pyx_k__7[] =
" (";
1572 static const char __pyx_k__8[] =
", ";
1573 static const char __pyx_k__9[] =
").";
1574 static const char __pyx_k_cl[] =
"cl";
1575 static const char __pyx_k_pi[] =
"pi";
1576 static const char __pyx_k_cos[] =
"cos";
1577 static const char __pyx_k_exp[] =
"exp";
1578 static const char __pyx_k_frm[] =
"frm";
1579 static const char __pyx_k_inv[] =
"inv";
1580 static const char __pyx_k_ist[] =
"ist";
1581 static const char __pyx_k_ixt[] =
"ixt";
1582 static const char __pyx_k_lhs[] =
"lhs";
1583 static const char __pyx_k_log[] =
"log";
1584 static const char __pyx_k_max[] =
"max";
1585 static const char __pyx_k_min[] =
"min";
1586 static const char __pyx_k_obj[] =
"obj";
1587 static const char __pyx_k_odd[] =
"odd";
1588 static const char __pyx_k_pow[] =
"pow";
1589 static const char __pyx_k_rhs[] =
"rhs";
1590 static const char __pyx_k_sin[] =
"sin";
1591 static const char __pyx_k_tan[] =
"tan";
1592 static const char __pyx_k_tau[] =
"tau";
1593 static const char __pyx_k_Real[] =
"Real";
1594 static const char __pyx_k_acos[] =
"acos";
1595 static const char __pyx_k_args[] =
"args";
1596 static const char __pyx_k_asin[] =
"asin";
1597 static const char __pyx_k_atan[] =
"atan";
1598 static const char __pyx_k_conj[] =
"conj";
1599 static const char __pyx_k_copy[] =
"copy";
1600 static const char __pyx_k_cosh[] =
"cosh";
1601 static const char __pyx_k_even[] =
"even";
1602 static const char __pyx_k_fill[] =
"fill";
1603 static const char __pyx_k_from[] =
" from ";
1604 static const char __pyx_k_iter[] =
"__iter__";
1605 static const char __pyx_k_main[] =
"__main__";
1606 static const char __pyx_k_math[] =
"math";
1607 static const char __pyx_k_name[] =
"__name__";
1608 static const char __pyx_k_norm[] =
"norm";
1609 static const char __pyx_k_pure[] =
"pure";
1610 static const char __pyx_k_quad[] =
"quad";
1611 static const char __pyx_k_send[] =
"send";
1612 static const char __pyx_k_sinh[] =
"sinh";
1613 static const char __pyx_k_sqrt[] =
"sqrt";
1614 static const char __pyx_k_tanh[] =
"tanh";
1615 static const char __pyx_k_test[] =
"_test";
1616 static const char __pyx_k_0_8_2[] =
"0.8.2";
1617 static const char __pyx_k_acosh[] =
"acosh";
1618 static const char __pyx_k_asinh[] =
"asinh";
1619 static const char __pyx_k_atanh[] =
"atanh";
1620 static const char __pyx_k_close[] =
"close";
1621 static const char __pyx_k_grade[] =
"grade";
1622 static const char __pyx_k_istpq[] =
"istpq";
1623 static const char __pyx_k_nbar3[] =
"nbar3";
1624 static const char __pyx_k_ninf3[] =
"ninf3";
1625 static const char __pyx_k_other[] =
"other";
1626 static const char __pyx_k_range[] =
"range";
1627 static const char __pyx_k_throw[] =
"throw";
1628 static const char __pyx_k_using[] =
" using (";
1629 static const char __pyx_k_value[] =
" value ";
1630 static const char __pyx_k_import[] =
"__import__";
1631 static const char __pyx_k_reduce[] =
"__reduce__";
1632 static const char __pyx_k_scalar[] =
"scalar";
1633 static const char __pyx_k_test_2[] =
"__test__";
1634 static const char __pyx_k_xrange[] =
"xrange";
1635 static const char __pyx_k_doctest[] =
"doctest";
1636 static const char __pyx_k_invalid[] =
" invalid ";
1637 static const char __pyx_k_numbers[] =
"numbers";
1638 static const char __pyx_k_reverse[] =
"reverse";
1639 static const char __pyx_k_testmod[] =
"testmod";
1640 static const char __pyx_k_version[] =
"__version__";
1641 static const char __pyx_k_Integral[] =
"Integral";
1642 static const char __pyx_k_PyClical[] =
"PyClical";
1643 static const char __pyx_k_Sequence[] =
"Sequence";
1644 static const char __pyx_k_as_frame[] =
" as frame:\n\t";
1645 static const char __pyx_k_getstate[] =
"__getstate__";
1646 static const char __pyx_k_involute[] =
"involute";
1647 static const char __pyx_k_setstate[] =
"__setstate__";
1648 static const char __pyx_k_to_frame[] =
" to frame ";
1649 static const char __pyx_k_TypeError[] =
"TypeError";
1650 static const char __pyx_k_outer_pow[] =
"outer_pow";
1651 static const char __pyx_k_reduce_ex[] =
"__reduce_ex__";
1652 static const char __pyx_k_IndexError[] =
"IndexError";
1653 static const char __pyx_k_ValueError[] =
"ValueError";
1654 static const char __pyx_k_pyx_vtable[] =
"__pyx_vtable__";
1655 static const char __pyx_k_collections[] =
"collections";
1656 static const char __pyx_k_e_line_1887[] =
"e (line 1887)";
1657 static const char __pyx_k_PyClical_pyx[] =
"PyClical.pyx";
1658 static const char __pyx_k_RuntimeError[] =
"RuntimeError";
1659 static const char __pyx_k_abs_line_1473[] =
"abs (line 1473)";
1660 static const char __pyx_k_cos_line_1602[] =
"cos (line 1602)";
1661 static const char __pyx_k_exp_line_1565[] =
"exp (line 1565)";
1662 static const char __pyx_k_inv_line_1329[] =
"inv (line 1329)";
1663 static const char __pyx_k_log_line_1579[] =
"log (line 1579)";
1664 static const char __pyx_k_odd_line_1397[] =
"odd (line 1397)";
1665 static const char __pyx_k_pow_line_1494[] =
"pow (line 1494)";
1666 static const char __pyx_k_reduce_cython[] =
"__reduce_cython__";
1667 static const char __pyx_k_sin_line_1679[] =
"sin (line 1679)";
1668 static const char __pyx_k_tan_line_1752[] =
"tan (line 1752)";
1669 static const char __pyx_k_using_invalid[] =
" using invalid ";
1670 static const char __pyx_k_Cannot_reframe[] =
"Cannot reframe";
1671 static const char __pyx_k_NotImplemented[] =
"NotImplemented";
1672 static const char __pyx_k_Not_applicable[] =
"Not applicable.";
1673 static const char __pyx_k_acos_line_1619[] =
"acos (line 1619)";
1674 static const char __pyx_k_agc3_line_1844[] =
"agc3 (line 1844)";
1675 static const char __pyx_k_asin_line_1698[] =
"asin (line 1698)";
1676 static const char __pyx_k_atan_line_1769[] =
"atan (line 1769)";
1677 static const char __pyx_k_cga3_line_1824[] =
"cga3 (line 1824)";
1678 static const char __pyx_k_conj_line_1436[] =
"conj (line 1436)";
1679 static const char __pyx_k_cosh_line_1640[] =
"cosh (line 1640)";
1680 static const char __pyx_k_even_line_1388[] =
"even (line 1388)";
1681 static const char __pyx_k_imag_line_1366[] =
"imag (line 1366)";
1682 static const char __pyx_k_invalid_string[] =
" invalid string ";
1683 static const char __pyx_k_norm_line_1462[] =
"norm (line 1462)";
1684 static const char __pyx_k_pure_line_1377[] =
"pure (line 1377)";
1685 static const char __pyx_k_quad_line_1451[] =
"quad (line 1451)";
1686 static const char __pyx_k_real_line_1355[] =
"real (line 1355)";
1687 static const char __pyx_k_sinh_line_1719[] =
"sinh (line 1719)";
1688 static const char __pyx_k_sqrt_line_1542[] =
"sqrt (line 1542)";
1689 static const char __pyx_k_tanh_line_1786[] =
"tanh (line 1786)";
1690 static const char __pyx_k_acosh_line_1656[] =
"acosh (line 1656)";
1691 static const char __pyx_k_asinh_line_1733[] =
"asinh (line 1733)";
1692 static const char __pyx_k_atanh_line_1798[] =
"atanh (line 1798)";
1693 static const char __pyx_k_istpq_line_1900[] =
"istpq (line 1900)";
1694 static const char __pyx_k_setstate_cython[] =
"__setstate_cython__";
1695 static const char __pyx_k_compare_line_490[] =
"compare (line 490)";
1696 static const char __pyx_k_index_set___iter[] =
"index_set.__iter__";
1697 static const char __pyx_k_max_pos_line_511[] =
"max_pos (line 511)";
1698 static const char __pyx_k_min_neg_line_502[] =
"min_neg (line 502)";
1699 static const char __pyx_k_scalar_line_1344[] =
"scalar (line 1344)";
1700 static const char __pyx_k_cga3std_line_1833[] =
"cga3std (line 1833)";
1701 static const char __pyx_k_max_abs_line_1482[] =
"max_abs (line 1482)";
1702 static const char __pyx_k_reverse_line_1421[] =
"reverse (line 1421)";
1703 static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
1704 static const char __pyx_k_involute_line_1406[] =
"involute (line 1406)";
1705 static const char __pyx_k_outer_pow_line_1518[] =
"outer_pow (line 1518)";
1706 static const char __pyx_k_clifford_inv_line_925[] =
"clifford.inv (line 925)";
1707 static const char __pyx_k_clifford_pow_line_979[] =
"clifford.pow (line 979)";
1708 static const char __pyx_k_clifford_abs_line_1174[] =
"clifford.abs (line 1174)";
1709 static const char __pyx_k_clifford_copy_line_554[] =
"clifford.copy (line 554)";
1710 static const char __pyx_k_clifford_odd_line_1069[] =
"clifford.odd (line 1069)";
1711 static const char __pyx_k_complexifier_line_1527[] =
"complexifier (line 1527)";
1712 static const char __pyx_k_index_set_copy_line_64[] =
"index_set.copy (line 64)";
1713 static const char __pyx_k_index_set_max_line_349[] =
"index_set.max (line 349)";
1714 static const char __pyx_k_index_set_min_line_340[] =
"index_set.min (line 340)";
1715 static const char __pyx_k_clifford_conj_line_1137[] =
"clifford.conj (line 1137)";
1716 static const char __pyx_k_clifford_even_line_1060[] =
"clifford.even (line 1060)";
1717 static const char __pyx_k_clifford_norm_line_1163[] =
"clifford.norm (line 1163)";
1718 static const char __pyx_k_clifford_pure_line_1049[] =
"clifford.pure (line 1049)";
1719 static const char __pyx_k_clifford_quad_line_1152[] =
"clifford.quad (line 1152)";
1720 static const char __pyx_k_Unary_print_clifford_1_1[] =
"\n Unary -.\n\n >>> print -clifford(\"{1}\")\n -{1}\n ";
1721 static const char __pyx_k_clifford___or___line_938[] =
"clifford.__or__ (line 938)";
1722 static const char __pyx_k_clifford_frame_line_1214[] =
"clifford.frame (line 1214)";
1723 static const char __pyx_k_clifford_hidden_doctests[] =
"clifford_hidden_doctests";
1724 static const char __pyx_k_clifford_isnan_line_1205[] =
"clifford.isnan (line 1205)";
1725 static const char __pyx_k_index_set_count_line_313[] =
"index_set.count (line 313)";
1726 static const char __pyx_k_clifford___add___line_739[] =
"clifford.__add__ (line 739)";
1727 static const char __pyx_k_clifford___and___line_835[] =
"clifford.__and__ (line 835)";
1728 static const char __pyx_k_clifford___div___line_895[] =
"clifford.__div__ (line 895)";
1729 static const char __pyx_k_clifford___ior___line_949[] =
"clifford.__ior__ (line 949)";
1730 static const char __pyx_k_clifford___mod___line_805[] =
"clifford.__mod__ (line 805)";
1731 static const char __pyx_k_clifford___mul___line_779[] =
"clifford.__mul__ (line 779)";
1732 static const char __pyx_k_clifford___neg___line_721[] =
"clifford.__neg__ (line 721)";
1733 static const char __pyx_k_clifford___pos___line_730[] =
"clifford.__pos__ (line 730)";
1734 static const char __pyx_k_clifford___pow___line_960[] =
"clifford.__pow__ (line 960)";
1735 static const char __pyx_k_clifford___sub___line_759[] =
"clifford.__sub__ (line 759)";
1736 static const char __pyx_k_clifford___xor___line_865[] =
"clifford.__xor__ (line 865)";
1737 static const char __pyx_k_clifford_reframe_line_648[] =
"clifford.reframe (line 648)";
1738 static const char __pyx_k_clifford_scalar_line_1038[] =
"clifford.scalar (line 1038)";
1739 static const char __pyx_k_index_set___or___line_291[] =
"index_set.__or__ (line 291)";
1740 static const char __pyx_k_index_set_hidden_doctests[] =
"index_set_hidden_doctests";
1741 static const char __pyx_k_random_clifford_line_1815[] =
"random_clifford (line 1815)";
1742 static const char __pyx_k_Cannot_take_vector_part_of[] =
"Cannot take vector part of ";
1743 static const char __pyx_k_Unary_print_clifford_1_1_2[] =
"\n Unary +.\n\n >>> print +clifford(\"{1}\")\n {1}\n ";
1744 static const char __pyx_k_clifford___iadd___line_750[] =
"clifford.__iadd__ (line 750)";
1745 static const char __pyx_k_clifford___iand___line_850[] =
"clifford.__iand__ (line 850)";
1746 static const char __pyx_k_clifford___idiv___line_910[] =
"clifford.__idiv__ (line 910)";
1747 static const char __pyx_k_clifford___imod___line_820[] =
"clifford.__imod__ (line 820)";
1748 static const char __pyx_k_clifford___imul___line_792[] =
"clifford.__imul__ (line 792)";
1749 static const char __pyx_k_clifford___isub___line_770[] =
"clifford.__isub__ (line 770)";
1750 static const char __pyx_k_clifford___iter___line_637[] =
"clifford.__iter__ (line 637)";
1751 static const char __pyx_k_clifford___ixor___line_880[] =
"clifford.__ixor__ (line 880)";
1752 static const char __pyx_k_clifford___str___line_1234[] =
"clifford.__str__ (line 1234)";
1753 static const char __pyx_k_clifford_max_abs_line_1183[] =
"clifford.max_abs (line 1183)";
1754 static const char __pyx_k_clifford_reverse_line_1122[] =
"clifford.reverse (line 1122)";
1755 static const char __pyx_k_index_set___and___line_269[] =
"index_set.__and__ (line 269)";
1756 static const char __pyx_k_index_set___ior___line_302[] =
"index_set.__ior__ (line 302)";
1757 static const char __pyx_k_index_set___str___line_393[] =
"index_set.__str__ (line 393)";
1758 static const char __pyx_k_index_set___xor___line_247[] =
"index_set.__xor__ (line 247)";
1759 static const char __pyx_k_clifford___call___line_1019[] =
"clifford.__call__ (line 1019)";
1760 static const char __pyx_k_clifford___repr___line_1225[] =
"clifford.__repr__ (line 1225)";
1761 static const char __pyx_k_clifford_involute_line_1106[] =
"clifford.involute (line 1106)";
1762 static const char __pyx_k_index_set___iand___line_280[] =
"index_set.__iand__ (line 280)";
1763 static const char __pyx_k_index_set___iter___line_227[] =
"index_set.__iter__ (line 227)";
1764 static const char __pyx_k_index_set___ixor___line_258[] =
"index_set.__ixor__ (line 258)";
1765 static const char __pyx_k_index_set___repr___line_382[] =
"index_set.__repr__ (line 382)";
1766 static const char __pyx_k_clifford_outer_pow_line_1003[] =
"clifford.outer_pow (line 1003)";
1767 static const char __pyx_k_clifford_truncated_line_1194[] =
"clifford.truncated (line 1194)";
1768 static const char __pyx_k_index_set_count_neg_line_322[] =
"index_set.count_neg (line 322)";
1769 static const char __pyx_k_index_set_count_pos_line_331[] =
"index_set.count_pos (line 331)";
1770 static const char __pyx_k_clifford___getitem___line_706[] =
"clifford.__getitem__ (line 706)";
1771 static const char __pyx_k_index_set___invert___line_238[] =
"index_set.__invert__ (line 238)";
1772 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 ";
1773 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 ";
1774 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 ";
1775 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 ";
1776 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 ";
1777 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 ";
1778 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 ";
1779 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 ";
1780 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 ";
1781 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 ";
1782 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 ";
1783 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 ";
1784 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 ";
1785 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 ";
1786 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 ";
1787 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 ";
1788 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 ";
1789 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 ";
1790 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 ";
1791 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 ";
1792 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 ";
1793 static const char __pyx_k_clifford_vector_part_line_1078[] =
"clifford.vector_part (line 1078)";
1794 static const char __pyx_k_index_set___getitem___line_189[] =
"index_set.__getitem__ (line 189)";
1795 static const char __pyx_k_index_set___setitem___line_177[] =
"index_set.__setitem__ (line 177)";
1796 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 ";
1797 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 ";
1798 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 ";
1799 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 ";
1800 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 ";
1801 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 ";
1802 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 ";
1803 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 ";
1804 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 ";
1805 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 ";
1806 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 ";
1807 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 ";
1808 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 ";
1809 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 ";
1810 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 ";
1811 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 ";
1812 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 ";
1813 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 ";
1814 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 ";
1815 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 ";
1816 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 ";
1817 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 ";
1818 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 ";
1819 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 ";
1820 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 ";
1821 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 ";
1822 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 ";
1823 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 ";
1824 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 ";
1825 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 ";
1826 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 ";
1827 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 ";
1828 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 ";
1829 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 ";
1830 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 ";
1831 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 ";
1832 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 ";
1833 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 ";
1834 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 ";
1835 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 ";
1836 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 ";
1837 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 ";
1838 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 ";
1839 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 ";
1840 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 ";
1841 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 ";
1842 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 ";
1843 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 ";
1844 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 ";
1845 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 ";
1846 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 ";
1847 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 ";
1848 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 ";
1849 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 ";
1850 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 ";
1851 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 ";
1852 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 ";
1853 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 ";
1854 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 ";
1855 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 ";
1856 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 ";
1857 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 ";
1858 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 ";
1859 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 ";
1860 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 ";
1861 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 ";
1862 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 ";
1863 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 ";
1864 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 ";
1865 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 ";
1866 static const char __pyx_k_This_comparison_operator_is_not[] =
"This comparison operator is not implemented for ";
1867 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 ";
1868 static const char __pyx_k_index_set_sign_of_mult_line_364[] =
"index_set.sign_of_mult (line 364)";
1869 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 ";
1870 static const char __pyx_k_Cannot_initialize_clifford_objec[] =
"Cannot initialize clifford object from";
1871 static const char __pyx_k_Cannot_initialize_index_set_obje[] =
"Cannot initialize index_set object from";
1872 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 ";
1873 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 ";
1874 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 ";
1875 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 ";
1876 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 ";
1877 static const char __pyx_k_clifford_hidden_doctests_line_12[] =
"clifford_hidden_doctests (line 1243)";
1878 static const char __pyx_k_index_set_hidden_doctests_line_4[] =
"index_set_hidden_doctests (line 404)";
1879 static const char __pyx_k_index_set_sign_of_square_line_37[] =
"index_set.sign_of_square (line 373)";
1880 static const char __pyx_k_no_default___reduce___due_to_non[] =
"no default __reduce__ due to non-trivial __cinit__";
1881 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 ";
1882 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 ";
1883 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 ";
1884 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 ";
1885 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 ";
1886 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 ";
1887 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 ";
1888 static PyObject *__pyx_kp_s_;
1889 static PyObject *__pyx_kp_s_0_8_2;
1890 static PyObject *__pyx_kp_u_Abbreviation_for_clifford_index;
1891 static PyObject *__pyx_kp_u_Abbreviation_for_index_set_q_p;
1892 static PyObject *__pyx_kp_u_Absolute_value_of_multivector_m;
1893 static PyObject *__pyx_kp_u_Absolute_value_square_root_of_n;
1894 static PyObject *__pyx_kp_s_Cannot_initialize_clifford_objec;
1895 static PyObject *__pyx_kp_s_Cannot_initialize_index_set_obje;
1896 static PyObject *__pyx_kp_s_Cannot_reframe;
1897 static PyObject *__pyx_kp_s_Cannot_take_vector_part_of;
1898 static PyObject *__pyx_kp_u_Cardinality_Number_of_indices_i;
1899 static PyObject *__pyx_kp_u_Check_if_a_multivector_contains;
1900 static PyObject *__pyx_kp_u_Conjugation_reverse_o_involute;
1901 static PyObject *__pyx_kp_u_Conjugation_reverse_o_involute_2;
1902 static PyObject *__pyx_kp_u_Contraction_print_clifford_1_cl;
1903 static PyObject *__pyx_kp_u_Contraction_x_clifford_1_x_clif;
1904 static PyObject *__pyx_kp_u_Convert_CGA3_null_vector_to_Euc;
1905 static PyObject *__pyx_kp_u_Convert_CGA3_null_vector_to_sta;
1906 static PyObject *__pyx_kp_u_Convert_Euclidean_3D_multivecto;
1907 static PyObject *__pyx_kp_u_Copy_this_clifford_object_x_cli;
1908 static PyObject *__pyx_kp_u_Copy_this_index_set_object_s_in;
1909 static PyObject *__pyx_kp_u_Cosine_of_multivector_with_opti;
1910 static PyObject *__pyx_kp_u_Even_part_of_multivector_sum_of;
1911 static PyObject *__pyx_kp_u_Even_part_of_multivector_sum_of_2;
1912 static PyObject *__pyx_kp_u_Exponential_of_multivector_x_cl;
1913 static PyObject *__pyx_kp_u_Geometric_difference_print_clif;
1914 static PyObject *__pyx_kp_u_Geometric_difference_x_clifford;
1915 static PyObject *__pyx_kp_u_Geometric_multiplicative_invers;
1916 static PyObject *__pyx_kp_u_Geometric_multiplicative_invers_2;
1917 static PyObject *__pyx_kp_u_Geometric_product_print_cliffor;
1918 static PyObject *__pyx_kp_u_Geometric_product_x_clifford_2;
1919 static PyObject *__pyx_kp_u_Geometric_quotient_print_cliffo;
1920 static PyObject *__pyx_kp_u_Geometric_quotient_x_clifford_1;
1921 static PyObject *__pyx_kp_u_Geometric_sum_print_clifford_1;
1922 static PyObject *__pyx_kp_u_Geometric_sum_x_clifford_1_x_cl;
1923 static PyObject *__pyx_kp_u_Get_the_value_of_an_index_set_o;
1924 static PyObject *__pyx_kp_u_Hyperbolic_cosine_of_multivecto;
1925 static PyObject *__pyx_kp_u_Hyperbolic_sine_of_multivector;
1926 static PyObject *__pyx_kp_u_Hyperbolic_tangent_of_multivect;
1927 static PyObject *__pyx_kp_u_Imaginary_part_deprecated_alway;
1928 static PyObject *__pyx_n_s_IndexError;
1929 static PyObject *__pyx_kp_u_Inner_product_print_clifford_1;
1930 static PyObject *__pyx_kp_u_Inner_product_x_clifford_1_x_cl;
1931 static PyObject *__pyx_kp_u_Integer_power_of_multivector_ob;
1932 static PyObject *__pyx_n_s_Integral;
1933 static PyObject *__pyx_kp_u_Inverse_cosine_of_multivector_w;
1934 static PyObject *__pyx_kp_u_Inverse_hyperbolic_cosine_of_mu;
1935 static PyObject *__pyx_kp_u_Inverse_hyperbolic_sine_of_mult;
1936 static PyObject *__pyx_kp_u_Inverse_hyperbolic_tangent_of_m;
1937 static PyObject *__pyx_kp_u_Inverse_sine_of_multivector_wit;
1938 static PyObject *__pyx_kp_u_Inverse_tangent_of_multivector;
1939 static PyObject *__pyx_kp_u_Iterate_over_the_indices_of_an;
1940 static PyObject *__pyx_kp_u_Main_involution_each_i_is_repla;
1941 static PyObject *__pyx_kp_u_Main_involution_each_i_is_repla_2;
1942 static PyObject *__pyx_kp_u_Maximum_absolute_value_of_coord;
1943 static PyObject *__pyx_kp_u_Maximum_member_index_set_1_1_2;
1944 static PyObject *__pyx_kp_u_Maximum_of_absolute_values_of_c;
1945 static PyObject *__pyx_kp_u_Maximum_positive_index_or_0_if;
1946 static PyObject *__pyx_kp_u_Minimum_member_index_set_1_1_2;
1947 static PyObject *__pyx_kp_u_Minimum_negative_index_or_0_if;
1948 static PyObject *__pyx_kp_u_Natural_logarithm_of_multivecto;
1949 static PyObject *__pyx_kp_u_Norm_sum_of_squares_of_coordina;
1950 static PyObject *__pyx_n_s_NotImplemented;
1951 static PyObject *__pyx_kp_s_Not_applicable;
1952 static PyObject *__pyx_kp_u_Not_applicable_for_a_in_cliffor;
1953 static PyObject *__pyx_kp_u_Number_of_negative_indices_incl;
1954 static PyObject *__pyx_kp_u_Number_of_positive_indices_incl;
1955 static PyObject *__pyx_kp_u_Odd_part_of_multivector_sum_of;
1956 static PyObject *__pyx_kp_u_Odd_part_of_multivector_sum_of_2;
1957 static PyObject *__pyx_kp_u_Outer_product_power_of_multivec;
1958 static PyObject *__pyx_kp_u_Outer_product_power_x_clifford;
1959 static PyObject *__pyx_kp_u_Outer_product_print_clifford_1;
1960 static PyObject *__pyx_kp_u_Outer_product_x_clifford_1_x_cl;
1961 static PyObject *__pyx_kp_u_Power_self_to_the_m_x_clifford;
1962 static PyObject *__pyx_kp_u_Power_self_to_the_m_x_clifford_2;
1963 static PyObject *__pyx_kp_u_Pure_grade_vector_part_print_cl;
1964 static PyObject *__pyx_kp_u_Pure_part_print_clifford_1_1_1;
1965 static PyObject *__pyx_kp_u_Pure_part_print_pure_clifford_1;
1966 static PyObject *__pyx_kp_u_Put_self_into_a_larger_frame_co;
1967 static PyObject *__pyx_n_s_PyClical;
1968 static PyObject *__pyx_kp_s_PyClical_pyx;
1969 static PyObject *__pyx_kp_u_Quadratic_form_rev_x_x_0_print;
1970 static PyObject *__pyx_kp_u_Quadratic_form_rev_x_x_0_print_2;
1971 static PyObject *__pyx_kp_u_Random_multivector_within_a_fra;
1972 static PyObject *__pyx_n_s_Real;
1973 static PyObject *__pyx_kp_u_Real_part_synonym_for_scalar_pa;
1974 static PyObject *__pyx_kp_u_Remove_all_terms_of_self_with_r;
1975 static PyObject *__pyx_kp_u_Reversion_eg_1_2_2_1_print_reve;
1976 static PyObject *__pyx_kp_u_Reversion_eg_clifford_1_cliffor;
1977 static PyObject *__pyx_n_s_RuntimeError;
1978 static PyObject *__pyx_kp_u_Scalar_part_clifford_1_1_1_2_sc;
1979 static PyObject *__pyx_kp_u_Scalar_part_scalar_clifford_1_1;
1980 static PyObject *__pyx_n_s_Sequence;
1981 static PyObject *__pyx_kp_u_Set_complement_not_print_index;
1982 static PyObject *__pyx_kp_u_Set_intersection_and_print_inde;
1983 static PyObject *__pyx_kp_u_Set_intersection_and_x_index_se;
1984 static PyObject *__pyx_kp_u_Set_the_value_of_an_index_set_o;
1985 static PyObject *__pyx_kp_u_Set_union_or_print_index_set_1;
1986 static PyObject *__pyx_kp_u_Set_union_or_x_index_set_1_x_in;
1987 static PyObject *__pyx_kp_u_Sign_of_geometric_product_of_tw;
1988 static PyObject *__pyx_kp_u_Sign_of_geometric_square_of_a_C;
1989 static PyObject *__pyx_kp_u_Sine_of_multivector_with_option;
1990 static PyObject *__pyx_kp_u_Square_root_of_1_which_commutes;
1991 static PyObject *__pyx_kp_u_Square_root_of_multivector_with;
1992 static PyObject *__pyx_kp_u_Subalgebra_generated_by_all_gen;
1993 static PyObject *__pyx_kp_u_Subscripting_map_from_index_set;
1994 static PyObject *__pyx_kp_u_Symmetric_set_difference_exclus;
1995 static PyObject *__pyx_kp_u_Symmetric_set_difference_exclus_2;
1996 static PyObject *__pyx_kp_u_Tangent_of_multivector_with_opt;
1997 static PyObject *__pyx_kp_u_Tests_for_functions_that_Doctes;
1998 static PyObject *__pyx_kp_u_Tests_for_functions_that_Doctes_2;
1999 static PyObject *__pyx_kp_u_The_informal_string_representat;
2000 static PyObject *__pyx_kp_u_The_informal_string_representat_2;
2001 static PyObject *__pyx_kp_u_The_official_string_representat;
2002 static PyObject *__pyx_kp_u_The_official_string_representat_2;
2003 static PyObject *__pyx_kp_s_This_comparison_operator_is_not;
2004 static PyObject *__pyx_kp_u_Transform_left_hand_side_using;
2005 static PyObject *__pyx_kp_u_Transform_left_hand_side_using_2;
2006 static PyObject *__pyx_n_s_TypeError;
2007 static PyObject *__pyx_kp_u_Unary_print_clifford_1_1;
2008 static PyObject *__pyx_kp_u_Unary_print_clifford_1_1_2;
2009 static PyObject *__pyx_n_s_ValueError;
2010 static PyObject *__pyx_kp_u_Vector_part_of_multivector_as_a;
2011 static PyObject *__pyx_kp_s__2;
2012 static PyObject *__pyx_kp_s__5;
2013 static PyObject *__pyx_kp_s__6;
2014 static PyObject *__pyx_kp_s__7;
2015 static PyObject *__pyx_kp_s__8;
2016 static PyObject *__pyx_kp_s__9;
2017 static PyObject *__pyx_kp_u_abs_line_1473;
2018 static PyObject *__pyx_n_s_acos;
2019 static PyObject *__pyx_kp_u_acos_line_1619;
2020 static PyObject *__pyx_n_s_acosh;
2021 static PyObject *__pyx_kp_u_acosh_line_1656;
2022 static PyObject *__pyx_kp_u_agc3_line_1844;
2023 static PyObject *__pyx_n_s_args;
2024 static PyObject *__pyx_kp_s_as_frame;
2025 static PyObject *__pyx_n_s_asin;
2026 static PyObject *__pyx_kp_u_asin_line_1698;
2027 static PyObject *__pyx_n_s_asinh;
2028 static PyObject *__pyx_kp_u_asinh_line_1733;
2029 static PyObject *__pyx_n_s_atan;
2030 static PyObject *__pyx_kp_u_atan_line_1769;
2031 static PyObject *__pyx_n_s_atanh;
2032 static PyObject *__pyx_kp_u_atanh_line_1798;
2033 static PyObject *__pyx_kp_u_cga3_line_1824;
2034 static PyObject *__pyx_kp_u_cga3std_line_1833;
2035 static PyObject *__pyx_n_s_cl;
2036 static PyObject *__pyx_kp_u_clifford___add___line_739;
2037 static PyObject *__pyx_kp_u_clifford___and___line_835;
2038 static PyObject *__pyx_kp_u_clifford___call___line_1019;
2039 static PyObject *__pyx_kp_u_clifford___div___line_895;
2040 static PyObject *__pyx_kp_u_clifford___getitem___line_706;
2041 static PyObject *__pyx_kp_u_clifford___iadd___line_750;
2042 static PyObject *__pyx_kp_u_clifford___iand___line_850;
2043 static PyObject *__pyx_kp_u_clifford___idiv___line_910;
2044 static PyObject *__pyx_kp_u_clifford___imod___line_820;
2045 static PyObject *__pyx_kp_u_clifford___imul___line_792;
2046 static PyObject *__pyx_kp_u_clifford___ior___line_949;
2047 static PyObject *__pyx_kp_u_clifford___isub___line_770;
2048 static PyObject *__pyx_kp_u_clifford___iter___line_637;
2049 static PyObject *__pyx_kp_u_clifford___ixor___line_880;
2050 static PyObject *__pyx_kp_u_clifford___mod___line_805;
2051 static PyObject *__pyx_kp_u_clifford___mul___line_779;
2052 static PyObject *__pyx_kp_u_clifford___neg___line_721;
2053 static PyObject *__pyx_kp_u_clifford___or___line_938;
2054 static PyObject *__pyx_kp_u_clifford___pos___line_730;
2055 static PyObject *__pyx_kp_u_clifford___pow___line_960;
2056 static PyObject *__pyx_kp_u_clifford___repr___line_1225;
2057 static PyObject *__pyx_kp_u_clifford___str___line_1234;
2058 static PyObject *__pyx_kp_u_clifford___sub___line_759;
2059 static PyObject *__pyx_kp_u_clifford___xor___line_865;
2060 static PyObject *__pyx_kp_u_clifford_abs_line_1174;
2061 static PyObject *__pyx_kp_u_clifford_conj_line_1137;
2062 static PyObject *__pyx_kp_u_clifford_copy_line_554;
2063 static PyObject *__pyx_kp_u_clifford_even_line_1060;
2064 static PyObject *__pyx_kp_u_clifford_frame_line_1214;
2065 static PyObject *__pyx_n_s_clifford_hidden_doctests;
2066 static PyObject *__pyx_kp_u_clifford_hidden_doctests_line_12;
2067 static PyObject *__pyx_kp_u_clifford_inv_line_925;
2068 static PyObject *__pyx_kp_u_clifford_involute_line_1106;
2069 static PyObject *__pyx_kp_u_clifford_isnan_line_1205;
2070 static PyObject *__pyx_kp_u_clifford_max_abs_line_1183;
2071 static PyObject *__pyx_kp_u_clifford_norm_line_1163;
2072 static PyObject *__pyx_kp_u_clifford_odd_line_1069;
2073 static PyObject *__pyx_kp_u_clifford_outer_pow_line_1003;
2074 static PyObject *__pyx_kp_u_clifford_pow_line_979;
2075 static PyObject *__pyx_kp_u_clifford_pure_line_1049;
2076 static PyObject *__pyx_kp_u_clifford_quad_line_1152;
2077 static PyObject *__pyx_kp_u_clifford_reframe_line_648;
2078 static PyObject *__pyx_kp_u_clifford_reverse_line_1122;
2079 static PyObject *__pyx_kp_u_clifford_scalar_line_1038;
2080 static PyObject *__pyx_kp_u_clifford_truncated_line_1194;
2081 static PyObject *__pyx_kp_u_clifford_vector_part_line_1078;
2082 static PyObject *__pyx_n_s_cline_in_traceback;
2083 static PyObject *__pyx_n_s_close;
2084 static PyObject *__pyx_n_s_collections;
2085 static PyObject *__pyx_kp_u_compare_line_490;
2086 static PyObject *__pyx_kp_u_complexifier_line_1527;
2087 static PyObject *__pyx_n_s_conj;
2088 static PyObject *__pyx_kp_u_conj_line_1436;
2089 static PyObject *__pyx_n_s_copy;
2090 static PyObject *__pyx_n_s_cos;
2091 static PyObject *__pyx_kp_u_cos_line_1602;
2092 static PyObject *__pyx_n_s_cosh;
2093 static PyObject *__pyx_kp_u_cosh_line_1640;
2094 static PyObject *__pyx_n_s_doctest;
2095 static PyObject *__pyx_n_s_e;
2096 static PyObject *__pyx_kp_u_e_line_1887;
2097 static PyObject *__pyx_n_s_even;
2098 static PyObject *__pyx_kp_u_even_line_1388;
2099 static PyObject *__pyx_n_s_exp;
2100 static PyObject *__pyx_kp_u_exp_line_1565;
2101 static PyObject *__pyx_n_s_fill;
2102 static PyObject *__pyx_n_s_frm;
2103 static PyObject *__pyx_kp_s_from;
2104 static PyObject *__pyx_n_s_getstate;
2105 static PyObject *__pyx_n_s_grade;
2106 static PyObject *__pyx_n_s_i;
2107 static PyObject *__pyx_kp_u_imag_line_1366;
2108 static PyObject *__pyx_n_s_import;
2109 static PyObject *__pyx_kp_u_index_set___and___line_269;
2110 static PyObject *__pyx_kp_u_index_set___getitem___line_189;
2111 static PyObject *__pyx_kp_u_index_set___iand___line_280;
2112 static PyObject *__pyx_kp_u_index_set___invert___line_238;
2113 static PyObject *__pyx_kp_u_index_set___ior___line_302;
2114 static PyObject *__pyx_n_s_index_set___iter;
2115 static PyObject *__pyx_kp_u_index_set___iter___line_227;
2116 static PyObject *__pyx_kp_u_index_set___ixor___line_258;
2117 static PyObject *__pyx_kp_u_index_set___or___line_291;
2118 static PyObject *__pyx_kp_u_index_set___repr___line_382;
2119 static PyObject *__pyx_kp_u_index_set___setitem___line_177;
2120 static PyObject *__pyx_kp_u_index_set___str___line_393;
2121 static PyObject *__pyx_kp_u_index_set___xor___line_247;
2122 static PyObject *__pyx_kp_u_index_set_copy_line_64;
2123 static PyObject *__pyx_kp_u_index_set_count_line_313;
2124 static PyObject *__pyx_kp_u_index_set_count_neg_line_322;
2125 static PyObject *__pyx_kp_u_index_set_count_pos_line_331;
2126 static PyObject *__pyx_n_s_index_set_hidden_doctests;
2127 static PyObject *__pyx_kp_u_index_set_hidden_doctests_line_4;
2128 static PyObject *__pyx_kp_u_index_set_max_line_349;
2129 static PyObject *__pyx_kp_u_index_set_min_line_340;
2130 static PyObject *__pyx_kp_u_index_set_sign_of_mult_line_364;
2131 static PyObject *__pyx_kp_u_index_set_sign_of_square_line_37;
2132 static PyObject *__pyx_n_s_inv;
2133 static PyObject *__pyx_kp_u_inv_line_1329;
2134 static PyObject *__pyx_kp_s_invalid;
2135 static PyObject *__pyx_kp_s_invalid_string;
2136 static PyObject *__pyx_n_s_involute;
2137 static PyObject *__pyx_kp_u_involute_line_1406;
2138 static PyObject *__pyx_n_s_ist;
2139 static PyObject *__pyx_n_s_istpq;
2140 static PyObject *__pyx_kp_u_istpq_line_1900;
2141 static PyObject *__pyx_n_s_iter;
2142 static PyObject *__pyx_n_s_ixt;
2143 static PyObject *__pyx_kp_u_lexicographic_compare_eg_3_4_5;
2144 static PyObject *__pyx_n_s_lhs;
2145 static PyObject *__pyx_n_s_log;
2146 static PyObject *__pyx_kp_u_log_line_1579;
2147 static PyObject *__pyx_n_s_m;
2148 static PyObject *__pyx_n_s_main;
2149 static PyObject *__pyx_n_s_math;
2150 static PyObject *__pyx_n_s_max;
2151 static PyObject *__pyx_kp_u_max_abs_line_1482;
2152 static PyObject *__pyx_kp_u_max_pos_line_511;
2153 static PyObject *__pyx_n_s_min;
2154 static PyObject *__pyx_kp_u_min_neg_line_502;
2155 static PyObject *__pyx_n_s_name;
2156 static PyObject *__pyx_n_s_nbar3;
2157 static PyObject *__pyx_n_s_ninf3;
2158 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2159 static PyObject *__pyx_n_s_norm;
2160 static PyObject *__pyx_kp_u_norm_line_1462;
2161 static PyObject *__pyx_kp_u_norm_sum_of_squares_of_coordina;
2162 static PyObject *__pyx_n_s_numbers;
2163 static PyObject *__pyx_n_s_obj;
2164 static PyObject *__pyx_n_s_odd;
2165 static PyObject *__pyx_kp_u_odd_line_1397;
2166 static PyObject *__pyx_n_s_other;
2167 static PyObject *__pyx_n_s_outer_pow;
2168 static PyObject *__pyx_kp_u_outer_pow_line_1518;
2169 static PyObject *__pyx_n_s_p;
2170 static PyObject *__pyx_n_s_pi;
2171 static PyObject *__pyx_n_s_pow;
2172 static PyObject *__pyx_kp_u_pow_line_1494;
2173 static PyObject *__pyx_n_s_pure;
2174 static PyObject *__pyx_kp_u_pure_line_1377;
2175 static PyObject *__pyx_n_s_pyx_vtable;
2176 static PyObject *__pyx_n_s_q;
2177 static PyObject *__pyx_n_s_quad;
2178 static PyObject *__pyx_kp_u_quad_line_1451;
2179 static PyObject *__pyx_kp_u_random_clifford_line_1815;
2180 static PyObject *__pyx_n_s_range;
2181 static PyObject *__pyx_kp_u_real_line_1355;
2182 static PyObject *__pyx_n_s_reduce;
2183 static PyObject *__pyx_n_s_reduce_cython;
2184 static PyObject *__pyx_n_s_reduce_ex;
2185 static PyObject *__pyx_n_s_reverse;
2186 static PyObject *__pyx_kp_u_reverse_line_1421;
2187 static PyObject *__pyx_n_s_rhs;
2188 static PyObject *__pyx_n_s_scalar;
2189 static PyObject *__pyx_kp_u_scalar_line_1344;
2190 static PyObject *__pyx_n_s_send;
2191 static PyObject *__pyx_n_s_setstate;
2192 static PyObject *__pyx_n_s_setstate_cython;
2193 static PyObject *__pyx_n_s_sin;
2194 static PyObject *__pyx_kp_u_sin_line_1679;
2195 static PyObject *__pyx_n_s_sinh;
2196 static PyObject *__pyx_kp_u_sinh_line_1719;
2197 static PyObject *__pyx_n_s_sqrt;
2198 static PyObject *__pyx_kp_u_sqrt_line_1542;
2199 static PyObject *__pyx_n_s_tan;
2200 static PyObject *__pyx_kp_u_tan_line_1752;
2201 static PyObject *__pyx_n_s_tanh;
2202 static PyObject *__pyx_kp_u_tanh_line_1786;
2203 static PyObject *__pyx_n_s_tau;
2204 static PyObject *__pyx_n_s_test;
2205 static PyObject *__pyx_n_s_test_2;
2206 static PyObject *__pyx_n_s_testmod;
2207 static PyObject *__pyx_n_s_throw;
2208 static PyObject *__pyx_kp_s_to_frame;
2209 static PyObject *__pyx_kp_s_using;
2210 static PyObject *__pyx_kp_s_using_invalid;
2211 static PyObject *__pyx_kp_s_value;
2212 static PyObject *__pyx_n_s_version;
2213 static PyObject *__pyx_n_s_xrange;
2214 static PyObject *__pyx_pf_8PyClical_9index_set_copy(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2215 static int __pyx_pf_8PyClical_9index_set_2__cinit__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_other);
2216 static void __pyx_pf_8PyClical_9index_set_4__dealloc__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2217 static PyObject *__pyx_pf_8PyClical_9index_set_6__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op);
2218 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);
2219 static PyObject *__pyx_pf_8PyClical_9index_set_10__getitem__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_idx);
2220 static int __pyx_pf_8PyClical_9index_set_12__contains__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_idx);
2221 static PyObject *__pyx_pf_8PyClical_9index_set_14__iter__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2222 static PyObject *__pyx_pf_8PyClical_9index_set_17__invert__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2223 static PyObject *__pyx_pf_8PyClical_9index_set_19__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2224 static PyObject *__pyx_pf_8PyClical_9index_set_21__ixor__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs);
2225 static PyObject *__pyx_pf_8PyClical_9index_set_23__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2226 static PyObject *__pyx_pf_8PyClical_9index_set_25__iand__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs);
2227 static PyObject *__pyx_pf_8PyClical_9index_set_27__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2228 static PyObject *__pyx_pf_8PyClical_9index_set_29__ior__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs);
2229 static PyObject *__pyx_pf_8PyClical_9index_set_31count(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2230 static PyObject *__pyx_pf_8PyClical_9index_set_33count_neg(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2231 static PyObject *__pyx_pf_8PyClical_9index_set_35count_pos(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2232 static PyObject *__pyx_pf_8PyClical_9index_set_37min(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2233 static PyObject *__pyx_pf_8PyClical_9index_set_39max(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2234 static PyObject *__pyx_pf_8PyClical_9index_set_41hash_fn(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2235 static PyObject *__pyx_pf_8PyClical_9index_set_43sign_of_mult(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs);
2236 static PyObject *__pyx_pf_8PyClical_9index_set_45sign_of_square(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2237 static PyObject *__pyx_pf_8PyClical_9index_set_47__repr__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2238 static PyObject *__pyx_pf_8PyClical_9index_set_49__str__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2239 static PyObject *__pyx_pf_8PyClical_9index_set_51__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2240 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);
2241 static PyObject *__pyx_pf_8PyClical_index_set_hidden_doctests(CYTHON_UNUSED PyObject *__pyx_self);
2242 static PyObject *__pyx_pf_8PyClical_2compare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2243 static PyObject *__pyx_pf_8PyClical_4min_neg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2244 static PyObject *__pyx_pf_8PyClical_6max_pos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2245 static PyObject *__pyx_pf_8PyClical_8clifford_copy(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2246 static int __pyx_pf_8PyClical_8clifford_2__cinit__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_ixt);
2247 static void __pyx_pf_8PyClical_8clifford_4__dealloc__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2248 static int __pyx_pf_8PyClical_8clifford_6__contains__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_x);
2249 static PyObject *__pyx_pf_8PyClical_8clifford_8__iter__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2250 static PyObject *__pyx_pf_8PyClical_8clifford_10reframe(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_ixt);
2251 static PyObject *__pyx_pf_8PyClical_8clifford_12__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op);
2252 static PyObject *__pyx_pf_8PyClical_8clifford_14__getitem__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_ixt);
2253 static PyObject *__pyx_pf_8PyClical_8clifford_16__neg__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2254 static PyObject *__pyx_pf_8PyClical_8clifford_18__pos__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2255 static PyObject *__pyx_pf_8PyClical_8clifford_20__add__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2256 static PyObject *__pyx_pf_8PyClical_8clifford_22__iadd__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2257 static PyObject *__pyx_pf_8PyClical_8clifford_24__sub__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2258 static PyObject *__pyx_pf_8PyClical_8clifford_26__isub__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2259 static PyObject *__pyx_pf_8PyClical_8clifford_28__mul__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2260 static PyObject *__pyx_pf_8PyClical_8clifford_30__imul__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2261 static PyObject *__pyx_pf_8PyClical_8clifford_32__mod__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2262 static PyObject *__pyx_pf_8PyClical_8clifford_34__imod__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2263 static PyObject *__pyx_pf_8PyClical_8clifford_36__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2264 static PyObject *__pyx_pf_8PyClical_8clifford_38__iand__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2265 static PyObject *__pyx_pf_8PyClical_8clifford_40__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2266 static PyObject *__pyx_pf_8PyClical_8clifford_42__ixor__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2267 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 2268 static PyObject *__pyx_pf_8PyClical_8clifford_44__div__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2270 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 2271 static PyObject *__pyx_pf_8PyClical_8clifford_46__idiv__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2273 static PyObject *__pyx_pf_8PyClical_8clifford_48inv(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2274 static PyObject *__pyx_pf_8PyClical_8clifford_50__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2275 static PyObject *__pyx_pf_8PyClical_8clifford_52__ior__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2276 static PyObject *__pyx_pf_8PyClical_8clifford_54__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_m, CYTHON_UNUSED PyObject *__pyx_v_dummy);
2277 static PyObject *__pyx_pf_8PyClical_8clifford_56pow(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_m);
2278 static PyObject *__pyx_pf_8PyClical_8clifford_58outer_pow(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_m);
2279 static PyObject *__pyx_pf_8PyClical_8clifford_60__call__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_grade);
2280 static PyObject *__pyx_pf_8PyClical_8clifford_62scalar(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2281 static PyObject *__pyx_pf_8PyClical_8clifford_64pure(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2282 static PyObject *__pyx_pf_8PyClical_8clifford_66even(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2283 static PyObject *__pyx_pf_8PyClical_8clifford_68odd(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2284 static PyObject *__pyx_pf_8PyClical_8clifford_70vector_part(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_frm);
2285 static PyObject *__pyx_pf_8PyClical_8clifford_72involute(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2286 static PyObject *__pyx_pf_8PyClical_8clifford_74reverse(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2287 static PyObject *__pyx_pf_8PyClical_8clifford_76conj(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2288 static PyObject *__pyx_pf_8PyClical_8clifford_78quad(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2289 static PyObject *__pyx_pf_8PyClical_8clifford_80norm(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2290 static PyObject *__pyx_pf_8PyClical_8clifford_82abs(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2291 static PyObject *__pyx_pf_8PyClical_8clifford_84max_abs(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2292 static PyObject *__pyx_pf_8PyClical_8clifford_86truncated(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_limit);
2293 static PyObject *__pyx_pf_8PyClical_8clifford_88isnan(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2294 static PyObject *__pyx_pf_8PyClical_8clifford_90frame(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2295 static PyObject *__pyx_pf_8PyClical_8clifford_92__repr__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2296 static PyObject *__pyx_pf_8PyClical_8clifford_94__str__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2297 static PyObject *__pyx_pf_8PyClical_8clifford_96__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2298 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);
2299 static PyObject *__pyx_pf_8PyClical_8clifford_hidden_doctests(CYTHON_UNUSED PyObject *__pyx_self);
2300 static PyObject *__pyx_pf_8PyClical_10inv(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2301 static PyObject *__pyx_pf_8PyClical_12scalar(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2302 static PyObject *__pyx_pf_8PyClical_14real(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2303 static PyObject *__pyx_pf_8PyClical_16imag(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2304 static PyObject *__pyx_pf_8PyClical_18pure(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2305 static PyObject *__pyx_pf_8PyClical_20even(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2306 static PyObject *__pyx_pf_8PyClical_22odd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2307 static PyObject *__pyx_pf_8PyClical_24involute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2308 static PyObject *__pyx_pf_8PyClical_26reverse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2309 static PyObject *__pyx_pf_8PyClical_28conj(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2310 static PyObject *__pyx_pf_8PyClical_30quad(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2311 static PyObject *__pyx_pf_8PyClical_32norm(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2312 static PyObject *__pyx_pf_8PyClical_34abs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2313 static PyObject *__pyx_pf_8PyClical_36max_abs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2314 static PyObject *__pyx_pf_8PyClical_38pow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_m);
2315 static PyObject *__pyx_pf_8PyClical_40outer_pow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_m);
2316 static PyObject *__pyx_pf_8PyClical_42complexifier(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2317 static PyObject *__pyx_pf_8PyClical_44sqrt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2318 static PyObject *__pyx_pf_8PyClical_46exp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2319 static PyObject *__pyx_pf_8PyClical_48log(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2320 static PyObject *__pyx_pf_8PyClical_50cos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2321 static PyObject *__pyx_pf_8PyClical_52acos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2322 static PyObject *__pyx_pf_8PyClical_54cosh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2323 static PyObject *__pyx_pf_8PyClical_56acosh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2324 static PyObject *__pyx_pf_8PyClical_58sin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2325 static PyObject *__pyx_pf_8PyClical_60asin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2326 static PyObject *__pyx_pf_8PyClical_62sinh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2327 static PyObject *__pyx_pf_8PyClical_64asinh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2328 static PyObject *__pyx_pf_8PyClical_66tan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2329 static PyObject *__pyx_pf_8PyClical_68atan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2330 static PyObject *__pyx_pf_8PyClical_70tanh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2331 static PyObject *__pyx_pf_8PyClical_72atanh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2332 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);
2333 static PyObject *__pyx_pf_8PyClical_76cga3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2334 static PyObject *__pyx_pf_8PyClical_78cga3std(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2335 static PyObject *__pyx_pf_8PyClical_80agc3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2336 static PyObject *__pyx_pf_8PyClical_82e(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2337 static PyObject *__pyx_pf_8PyClical_84istpq(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_p, PyObject *__pyx_v_q);
2338 static PyObject *__pyx_pf_8PyClical_86_test(CYTHON_UNUSED PyObject *__pyx_self);
2339 static PyObject *__pyx_tp_new_8PyClical_index_set(PyTypeObject *t, PyObject *a, PyObject *k);
2340 static PyObject *__pyx_tp_new_8PyClical_clifford(PyTypeObject *t, PyObject *a, PyObject *k);
2341 static PyObject *__pyx_tp_new_8PyClical___pyx_scope_struct____iter__(PyTypeObject *t, PyObject *a, PyObject *k);
2342 static PyObject *__pyx_float_0_0;
2343 static PyObject *__pyx_float_1_0;
2344 static PyObject *__pyx_float_2_0;
2345 static PyObject *__pyx_float_8_0;
2346 static PyObject *__pyx_int_0;
2347 static PyObject *__pyx_int_1;
2348 static PyObject *__pyx_int_4;
2349 static PyObject *__pyx_int_neg_1;
2350 static PyObject *__pyx_tuple__3;
2351 static PyObject *__pyx_tuple__4;
2352 static PyObject *__pyx_tuple__10;
2353 static PyObject *__pyx_tuple__11;
2354 static PyObject *__pyx_tuple__12;
2355 static PyObject *__pyx_tuple__13;
2356 static PyObject *__pyx_tuple__16;
2357 static PyObject *__pyx_tuple__17;
2358 static PyObject *__pyx_tuple__19;
2359 static PyObject *__pyx_tuple__21;
2360 static PyObject *__pyx_tuple__22;
2361 static PyObject *__pyx_tuple__23;
2362 static PyObject *__pyx_tuple__24;
2363 static PyObject *__pyx_tuple__25;
2364 static PyObject *__pyx_codeobj__14;
2365 static PyObject *__pyx_codeobj__15;
2366 static PyObject *__pyx_codeobj__18;
2367 static PyObject *__pyx_codeobj__20;
2368 static PyObject *__pyx_codeobj__26;
2378 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_toIndexSet(PyObject *__pyx_v_obj) {
2380 __Pyx_RefNannyDeclarations
2381 PyObject *__pyx_t_1 = NULL;
2382 PyObject *__pyx_t_2 = NULL;
2383 __Pyx_RefNannySetupContext(
"toIndexSet", 0);
2392 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
2393 __Pyx_GOTREF(__pyx_t_1);
2394 __Pyx_INCREF(__pyx_v_obj);
2395 __Pyx_GIVEREF(__pyx_v_obj);
2396 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_obj);
2397 __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)
2398 __Pyx_GOTREF(__pyx_t_2);
2399 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2400 __pyx_r = (((
struct __pyx_obj_8PyClical_index_set *)__pyx_t_2)->instance[0]);
2401 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2414 __Pyx_XDECREF(__pyx_t_1);
2415 __Pyx_XDECREF(__pyx_t_2);
2416 __Pyx_WriteUnraisable(
"PyClical.toIndexSet", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
2417 __Pyx_pretend_to_initialize(&__pyx_r);
2419 __Pyx_RefNannyFinishContext();
2431 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_9index_set_wrap(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self,
IndexSet __pyx_v_other) {
2432 PyObject *__pyx_r = NULL;
2433 __Pyx_RefNannyDeclarations
2434 __Pyx_RefNannySetupContext(
"wrap", 0);
2443 (__pyx_v_self->instance[0]) = __pyx_v_other;
2452 __Pyx_XDECREF(__pyx_r);
2453 __Pyx_INCREF(((PyObject *)__pyx_v_self));
2454 __pyx_r = ((PyObject *)__pyx_v_self);
2467 __Pyx_XGIVEREF(__pyx_r);
2468 __Pyx_RefNannyFinishContext();
2480 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_9index_set_unwrap(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
2482 __Pyx_RefNannyDeclarations
2483 __Pyx_RefNannySetupContext(
"unwrap", 0);
2492 __pyx_r = (__pyx_v_self->instance[0]);
2505 __Pyx_RefNannyFinishContext();
2517 static PyObject *__pyx_pw_8PyClical_9index_set_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
2518 static PyObject *__pyx_f_8PyClical_9index_set_copy(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self,
int __pyx_skip_dispatch) {
2519 PyObject *__pyx_r = NULL;
2520 __Pyx_RefNannyDeclarations
2521 PyObject *__pyx_t_1 = NULL;
2522 PyObject *__pyx_t_2 = NULL;
2523 PyObject *__pyx_t_3 = NULL;
2524 PyObject *__pyx_t_4 = NULL;
2525 __Pyx_RefNannySetupContext(
"copy", 0);
2527 if (unlikely(__pyx_skip_dispatch)) ;
2529 else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
2530 __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)
2531 __Pyx_GOTREF(__pyx_t_1);
2532 if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_8PyClical_9index_set_1copy)) {
2533 __Pyx_XDECREF(__pyx_r);
2534 __Pyx_INCREF(__pyx_t_1);
2535 __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
2536 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
2537 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
2538 if (likely(__pyx_t_4)) {
2539 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
2540 __Pyx_INCREF(__pyx_t_4);
2541 __Pyx_INCREF(
function);
2542 __Pyx_DECREF_SET(__pyx_t_3,
function);
2546 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error)
2547 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2549 __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error)
2551 __Pyx_GOTREF(__pyx_t_2);
2552 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2553 __pyx_r = __pyx_t_2;
2555 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2558 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2568 __Pyx_XDECREF(__pyx_r);
2569 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error)
2570 __Pyx_GOTREF(__pyx_t_1);
2571 __Pyx_INCREF(((PyObject *)__pyx_v_self));
2572 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
2573 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
2574 __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)
2575 __Pyx_GOTREF(__pyx_t_2);
2576 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2577 __pyx_r = __pyx_t_2;
2591 __Pyx_XDECREF(__pyx_t_1);
2592 __Pyx_XDECREF(__pyx_t_2);
2593 __Pyx_XDECREF(__pyx_t_3);
2594 __Pyx_XDECREF(__pyx_t_4);
2595 __Pyx_AddTraceback(
"PyClical.index_set.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
2598 __Pyx_XGIVEREF(__pyx_r);
2599 __Pyx_RefNannyFinishContext();
2604 static PyObject *__pyx_pw_8PyClical_9index_set_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
2605 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 ";
2606 static PyObject *__pyx_pw_8PyClical_9index_set_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
2607 PyObject *__pyx_r = 0;
2608 __Pyx_RefNannyDeclarations
2609 __Pyx_RefNannySetupContext(
"copy (wrapper)", 0);
2610 __pyx_r = __pyx_pf_8PyClical_9index_set_copy(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
2613 __Pyx_RefNannyFinishContext();
2617 static PyObject *__pyx_pf_8PyClical_9index_set_copy(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
2618 PyObject *__pyx_r = NULL;
2619 __Pyx_RefNannyDeclarations
2620 PyObject *__pyx_t_1 = NULL;
2621 __Pyx_RefNannySetupContext(
"copy", 0);
2622 __Pyx_XDECREF(__pyx_r);
2623 __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)
2624 __Pyx_GOTREF(__pyx_t_1);
2625 __pyx_r = __pyx_t_1;
2631 __Pyx_XDECREF(__pyx_t_1);
2632 __Pyx_AddTraceback(
"PyClical.index_set.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
2635 __Pyx_XGIVEREF(__pyx_r);
2636 __Pyx_RefNannyFinishContext();
2649 static int __pyx_pw_8PyClical_9index_set_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2650 static int __pyx_pw_8PyClical_9index_set_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2651 PyObject *__pyx_v_other = 0;
2653 __Pyx_RefNannyDeclarations
2654 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
2656 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,0};
2657 PyObject* values[1] = {0};
2658 values[0] = ((PyObject *)__pyx_int_0);
2659 if (unlikely(__pyx_kwds)) {
2661 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2663 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2666 default:
goto __pyx_L5_argtuple_error;
2668 kw_args = PyDict_Size(__pyx_kwds);
2672 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other);
2673 if (value) { values[0] = value; kw_args--; }
2676 if (unlikely(kw_args > 0)) {
2677 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(0, 73, __pyx_L3_error)
2680 switch (PyTuple_GET_SIZE(__pyx_args)) {
2681 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2684 default:
goto __pyx_L5_argtuple_error;
2687 __pyx_v_other = values[0];
2689 goto __pyx_L4_argument_unpacking_done;
2690 __pyx_L5_argtuple_error:;
2691 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 73, __pyx_L3_error)
2693 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2694 __Pyx_RefNannyFinishContext();
2696 __pyx_L4_argument_unpacking_done:;
2697 __pyx_r = __pyx_pf_8PyClical_9index_set_2__cinit__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), __pyx_v_other);
2700 __Pyx_RefNannyFinishContext();
2704 static int __pyx_pf_8PyClical_9index_set_2__cinit__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_other) {
2705 PyObject *__pyx_v_error_msg_prefix = NULL;
2706 PyObject *__pyx_v_idx = NULL;
2708 __Pyx_RefNannyDeclarations
2712 PyObject *__pyx_t_4 = NULL;
2713 PyObject *__pyx_t_5 = NULL;
2716 PyObject *__pyx_t_8 = NULL;
2717 PyObject *__pyx_t_9 = NULL;
2718 PyObject *__pyx_t_10 = NULL;
2719 Py_ssize_t __pyx_t_11;
2720 PyObject *(*__pyx_t_12)(PyObject *);
2721 PyObject *__pyx_t_13 = NULL;
2722 PyObject *__pyx_t_14 = NULL;
2723 PyObject *__pyx_t_15 = NULL;
2724 PyObject *__pyx_t_16 = NULL;
2726 __Pyx_RefNannySetupContext(
"__cinit__", 0);
2735 __Pyx_INCREF(__pyx_kp_s_Cannot_initialize_index_set_obje);
2736 __pyx_v_error_msg_prefix = __pyx_kp_s_Cannot_initialize_index_set_obje;
2745 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8PyClical_index_set);
2746 __pyx_t_2 = (__pyx_t_1 != 0);
2757 __pyx_t_3 =
new IndexSet(__pyx_f_8PyClical_9index_set_unwrap(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_other)));
2759 __Pyx_CppExn2PyErr();
2760 __PYX_ERR(0, 94, __pyx_L1_error)
2762 __pyx_v_self->instance = __pyx_t_3;
2781 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numbers);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 95, __pyx_L1_error)
2782 __Pyx_GOTREF(__pyx_t_4);
2783 __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)
2784 __Pyx_GOTREF(__pyx_t_5);
2785 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2786 __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)
2787 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2788 __pyx_t_1 = (__pyx_t_2 != 0);
2798 __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)
2800 __pyx_t_3 =
new IndexSet(((
int)__pyx_t_6));
2802 __Pyx_CppExn2PyErr();
2803 __PYX_ERR(0, 96, __pyx_L1_error)
2805 __pyx_v_self->instance = __pyx_t_3;
2824 __pyx_t_2 = PySet_Check(__pyx_v_other);
2825 __pyx_t_7 = (__pyx_t_2 != 0);
2828 __pyx_t_1 = __pyx_t_7;
2829 goto __pyx_L4_bool_binop_done;
2831 __pyx_t_7 = PyFrozenSet_Check(__pyx_v_other);
2832 __pyx_t_2 = (__pyx_t_7 != 0);
2833 __pyx_t_1 = __pyx_t_2;
2834 __pyx_L4_bool_binop_done:;
2835 __pyx_t_2 = (__pyx_t_1 != 0);
2846 __Pyx_PyThreadState_declare
2847 __Pyx_PyThreadState_assign
2848 __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
2849 __Pyx_XGOTREF(__pyx_t_8);
2850 __Pyx_XGOTREF(__pyx_t_9);
2851 __Pyx_XGOTREF(__pyx_t_10);
2862 __pyx_v_self->instance = __pyx_t_3;
2871 if (likely(PyList_CheckExact(__pyx_v_other)) || PyTuple_CheckExact(__pyx_v_other)) {
2872 __pyx_t_5 = __pyx_v_other; __Pyx_INCREF(__pyx_t_5); __pyx_t_11 = 0;
2875 __pyx_t_11 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_other);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 100, __pyx_L6_error)
2876 __Pyx_GOTREF(__pyx_t_5);
2877 __pyx_t_12 = Py_TYPE(__pyx_t_5)->tp_iternext;
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 100, __pyx_L6_error)
2880 if (likely(!__pyx_t_12)) {
2881 if (likely(PyList_CheckExact(__pyx_t_5))) {
2882 if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_5))
break;
2883 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 2884 __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)
2886 __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)
2887 __Pyx_GOTREF(__pyx_t_4);
2890 if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_5))
break;
2891 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 2892 __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)
2894 __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)
2895 __Pyx_GOTREF(__pyx_t_4);
2899 __pyx_t_4 = __pyx_t_12(__pyx_t_5);
2900 if (unlikely(!__pyx_t_4)) {
2901 PyObject* exc_type = PyErr_Occurred();
2903 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
2904 else __PYX_ERR(0, 100, __pyx_L6_error)
2908 __Pyx_GOTREF(__pyx_t_4);
2910 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_4);
2920 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self), __pyx_v_idx, Py_True) < 0)) __PYX_ERR(0, 101, __pyx_L6_error)
2930 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2940 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
2941 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
2942 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
2943 goto __pyx_L11_try_end;
2945 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
2946 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
2955 __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_IndexError);
2957 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2958 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_13) < 0) __PYX_ERR(0, 102, __pyx_L8_except_error)
2959 __Pyx_GOTREF(__pyx_t_5);
2960 __Pyx_GOTREF(__pyx_t_4);
2961 __Pyx_GOTREF(__pyx_t_13);
2970 __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)
2971 __Pyx_GOTREF(__pyx_t_14);
2972 __pyx_t_15 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 103, __pyx_L8_except_error)
2973 __Pyx_GOTREF(__pyx_t_15);
2974 __pyx_t_16 = PyNumber_Add(__pyx_t_14, __pyx_t_15);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 103, __pyx_L8_except_error)
2975 __Pyx_GOTREF(__pyx_t_16);
2976 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
2977 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
2978 __pyx_t_15 = PyNumber_Add(__pyx_t_16, __pyx_kp_s_);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 103, __pyx_L8_except_error)
2979 __Pyx_GOTREF(__pyx_t_15);
2980 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
2981 __pyx_t_16 = PyTuple_New(1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 103, __pyx_L8_except_error)
2982 __Pyx_GOTREF(__pyx_t_16);
2983 __Pyx_GIVEREF(__pyx_t_15);
2984 PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_15);
2986 __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)
2987 __Pyx_GOTREF(__pyx_t_15);
2988 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
2989 __Pyx_Raise(__pyx_t_15, 0, 0, 0);
2990 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
2991 __PYX_ERR(0, 103, __pyx_L8_except_error)
3001 __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
3003 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3004 if (__Pyx_GetException(&__pyx_t_13, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(0, 104, __pyx_L8_except_error)
3005 __Pyx_GOTREF(__pyx_t_13);
3006 __Pyx_GOTREF(__pyx_t_4);
3007 __Pyx_GOTREF(__pyx_t_5);
3016 __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)
3017 __Pyx_GOTREF(__pyx_t_15);
3018 __pyx_t_16 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 105, __pyx_L8_except_error)
3019 __Pyx_GOTREF(__pyx_t_16);
3020 __pyx_t_14 = PyNumber_Add(__pyx_t_15, __pyx_t_16);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 105, __pyx_L8_except_error)
3021 __Pyx_GOTREF(__pyx_t_14);
3022 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3023 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3024 __pyx_t_16 = PyNumber_Add(__pyx_t_14, __pyx_kp_s_);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 105, __pyx_L8_except_error)
3025 __Pyx_GOTREF(__pyx_t_16);
3026 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3027 __pyx_t_14 = PyTuple_New(1);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 105, __pyx_L8_except_error)
3028 __Pyx_GOTREF(__pyx_t_14);
3029 __Pyx_GIVEREF(__pyx_t_16);
3030 PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_16);
3032 __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)
3033 __Pyx_GOTREF(__pyx_t_16);
3034 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3035 __Pyx_Raise(__pyx_t_16, 0, 0, 0);
3036 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3037 __PYX_ERR(0, 105, __pyx_L8_except_error)
3039 goto __pyx_L8_except_error;
3040 __pyx_L8_except_error:;
3049 __Pyx_XGIVEREF(__pyx_t_8);
3050 __Pyx_XGIVEREF(__pyx_t_9);
3051 __Pyx_XGIVEREF(__pyx_t_10);
3052 __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
3053 goto __pyx_L1_error;
3074 __pyx_t_2 = PyString_Check(__pyx_v_other);
3075 __pyx_t_1 = (__pyx_t_2 != 0);
3086 __Pyx_PyThreadState_declare
3087 __Pyx_PyThreadState_assign
3088 __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
3089 __Pyx_XGOTREF(__pyx_t_10);
3090 __Pyx_XGOTREF(__pyx_t_9);
3091 __Pyx_XGOTREF(__pyx_t_8);
3101 __pyx_t_17 = __Pyx_PyObject_AsWritableString(__pyx_v_other);
if (unlikely((!__pyx_t_17) && PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L18_error)
3103 __pyx_t_3 =
new IndexSet(((
char *)__pyx_t_17));
3105 __Pyx_CppExn2PyErr();
3106 __PYX_ERR(0, 108, __pyx_L18_error)
3108 __pyx_v_self->instance = __pyx_t_3;
3118 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3119 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
3120 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3121 goto __pyx_L23_try_end;
3123 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
3124 __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
3125 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
3126 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
3127 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3128 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3137 __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
3139 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3140 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_13) < 0) __PYX_ERR(0, 109, __pyx_L20_except_error)
3141 __Pyx_GOTREF(__pyx_t_5);
3142 __Pyx_GOTREF(__pyx_t_4);
3143 __Pyx_GOTREF(__pyx_t_13);
3152 __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)
3153 __Pyx_GOTREF(__pyx_t_16);
3154 __pyx_t_14 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 110, __pyx_L20_except_error)
3155 __Pyx_GOTREF(__pyx_t_14);
3156 __pyx_t_15 = PyNumber_Add(__pyx_t_16, __pyx_t_14);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 110, __pyx_L20_except_error)
3157 __Pyx_GOTREF(__pyx_t_15);
3158 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3159 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3160 __pyx_t_14 = PyNumber_Add(__pyx_t_15, __pyx_kp_s_);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 110, __pyx_L20_except_error)
3161 __Pyx_GOTREF(__pyx_t_14);
3162 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3163 __pyx_t_15 = PyTuple_New(1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 110, __pyx_L20_except_error)
3164 __Pyx_GOTREF(__pyx_t_15);
3165 __Pyx_GIVEREF(__pyx_t_14);
3166 PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_14);
3168 __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)
3169 __Pyx_GOTREF(__pyx_t_14);
3170 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3171 __Pyx_Raise(__pyx_t_14, 0, 0, 0);
3172 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3173 __PYX_ERR(0, 110, __pyx_L20_except_error)
3175 goto __pyx_L20_except_error;
3176 __pyx_L20_except_error:;
3185 __Pyx_XGIVEREF(__pyx_t_10);
3186 __Pyx_XGIVEREF(__pyx_t_9);
3187 __Pyx_XGIVEREF(__pyx_t_8);
3188 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8);
3189 goto __pyx_L1_error;
3211 __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)
3212 __Pyx_GOTREF(__pyx_t_13);
3213 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 112, __pyx_L1_error)
3214 __Pyx_GOTREF(__pyx_t_4);
3215 __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_other)));
3216 __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_other)));
3217 PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)Py_TYPE(__pyx_v_other)));
3218 __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)
3219 __Pyx_GOTREF(__pyx_t_5);
3220 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3221 __pyx_t_4 = PyNumber_Add(__pyx_t_13, __pyx_t_5);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 112, __pyx_L1_error)
3222 __Pyx_GOTREF(__pyx_t_4);
3223 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
3224 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3225 __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_kp_s_);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 112, __pyx_L1_error)
3226 __Pyx_GOTREF(__pyx_t_5);
3227 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3228 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 112, __pyx_L1_error)
3229 __Pyx_GOTREF(__pyx_t_4);
3230 __Pyx_GIVEREF(__pyx_t_5);
3231 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
3233 __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)
3234 __Pyx_GOTREF(__pyx_t_5);
3235 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3236 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
3237 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3238 __PYX_ERR(0, 112, __pyx_L1_error)
3254 __Pyx_XDECREF(__pyx_t_4);
3255 __Pyx_XDECREF(__pyx_t_5);
3256 __Pyx_XDECREF(__pyx_t_13);
3257 __Pyx_XDECREF(__pyx_t_14);
3258 __Pyx_XDECREF(__pyx_t_15);
3259 __Pyx_XDECREF(__pyx_t_16);
3260 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3263 __Pyx_XDECREF(__pyx_v_error_msg_prefix);
3264 __Pyx_XDECREF(__pyx_v_idx);
3265 __Pyx_RefNannyFinishContext();
3278 static void __pyx_pw_8PyClical_9index_set_5__dealloc__(PyObject *__pyx_v_self);
3279 static void __pyx_pw_8PyClical_9index_set_5__dealloc__(PyObject *__pyx_v_self) {
3280 __Pyx_RefNannyDeclarations
3281 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
3282 __pyx_pf_8PyClical_9index_set_4__dealloc__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
3285 __Pyx_RefNannyFinishContext();
3288 static void __pyx_pf_8PyClical_9index_set_4__dealloc__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
3289 __Pyx_RefNannyDeclarations
3290 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
3299 delete __pyx_v_self->instance;
3310 __Pyx_RefNannyFinishContext();
3322 static PyObject *__pyx_pw_8PyClical_9index_set_7__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op);
3323 static PyObject *__pyx_pw_8PyClical_9index_set_7__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op) {
3324 PyObject *__pyx_r = 0;
3325 __Pyx_RefNannyDeclarations
3326 __Pyx_RefNannySetupContext(
"__richcmp__ (wrapper)", 0);
3327 __pyx_r = __pyx_pf_8PyClical_9index_set_6__richcmp__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs), ((
int)__pyx_v_op));
3330 __Pyx_RefNannyFinishContext();
3334 static PyObject *__pyx_pf_8PyClical_9index_set_6__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op) {
3335 PyObject *__pyx_v_eq = NULL;
3336 PyObject *__pyx_v_lt = NULL;
3337 PyObject *__pyx_r = NULL;
3338 __Pyx_RefNannyDeclarations
3342 PyObject *__pyx_t_4 = NULL;
3343 __Pyx_RefNannySetupContext(
"__richcmp__", 0);
3352 __pyx_t_2 = (__pyx_v_lhs == Py_None);
3353 __pyx_t_3 = (__pyx_t_2 != 0);
3356 __pyx_t_1 = __pyx_t_3;
3357 goto __pyx_L4_bool_binop_done;
3359 __pyx_t_3 = (__pyx_v_rhs == Py_None);
3360 __pyx_t_2 = (__pyx_t_3 != 0);
3361 __pyx_t_1 = __pyx_t_2;
3362 __pyx_L4_bool_binop_done:;
3372 __pyx_t_1 = (__pyx_v_lhs == __pyx_v_rhs);
3373 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 142, __pyx_L1_error)
3374 __Pyx_GOTREF(__pyx_t_4);
3375 __pyx_v_eq = __pyx_t_4;
3385 switch (__pyx_v_op) {
3395 __Pyx_XDECREF(__pyx_r);
3396 __Pyx_INCREF(__pyx_v_eq);
3397 __pyx_r = __pyx_v_eq;
3425 __Pyx_XDECREF(__pyx_r);
3426 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_eq);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 146, __pyx_L1_error)
3427 __pyx_t_4 = __Pyx_PyBool_FromLong((!__pyx_t_1));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error)
3428 __Pyx_GOTREF(__pyx_t_4);
3429 __pyx_r = __pyx_t_4;
3450 __pyx_t_1 = ((__pyx_v_op == 0) != 0);
3460 __Pyx_XDECREF(__pyx_r);
3461 __Pyx_INCREF(Py_False);
3481 __pyx_t_1 = ((__pyx_v_op == 1) != 0);
3491 __Pyx_XDECREF(__pyx_r);
3492 __Pyx_INCREF(__pyx_v_eq);
3493 __pyx_r = __pyx_v_eq;
3512 __pyx_t_1 = ((__pyx_v_op == 4) != 0);
3522 __Pyx_XDECREF(__pyx_r);
3523 __Pyx_INCREF(Py_False);
3543 __pyx_t_1 = ((__pyx_v_op == 5) != 0);
3553 __Pyx_XDECREF(__pyx_r);
3554 __Pyx_INCREF(__pyx_v_eq);
3555 __pyx_r = __pyx_v_eq;
3575 __Pyx_XDECREF(__pyx_r);
3576 __Pyx_INCREF(__pyx_builtin_NotImplemented);
3577 __pyx_r = __pyx_builtin_NotImplemented;
3600 __pyx_t_1 = (__pyx_f_8PyClical_toIndexSet(__pyx_v_lhs) == __pyx_f_8PyClical_toIndexSet(__pyx_v_rhs));
3601 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error)
3602 __Pyx_GOTREF(__pyx_t_4);
3603 __pyx_v_eq = __pyx_t_4;
3613 switch (__pyx_v_op) {
3623 __Pyx_XDECREF(__pyx_r);
3624 __Pyx_INCREF(__pyx_v_eq);
3625 __pyx_r = __pyx_v_eq;
3653 __Pyx_XDECREF(__pyx_r);
3654 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_eq);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 163, __pyx_L1_error)
3655 __pyx_t_4 = __Pyx_PyBool_FromLong((!__pyx_t_1));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error)
3656 __Pyx_GOTREF(__pyx_t_4);
3657 __pyx_r = __pyx_t_4;
3678 __pyx_t_1 = (__pyx_f_8PyClical_toIndexSet(__pyx_v_lhs) < __pyx_f_8PyClical_toIndexSet(__pyx_v_rhs));
3679 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error)
3680 __Pyx_GOTREF(__pyx_t_4);
3681 __pyx_v_lt = __pyx_t_4;
3691 __pyx_t_1 = ((__pyx_v_op == 0) != 0);
3701 __Pyx_XDECREF(__pyx_r);
3702 __Pyx_INCREF(__pyx_v_lt);
3703 __pyx_r = __pyx_v_lt;
3722 __pyx_t_1 = ((__pyx_v_op == 1) != 0);
3732 __Pyx_XDECREF(__pyx_r);
3733 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_lt);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 169, __pyx_L1_error)
3736 __Pyx_INCREF(__pyx_v_lt);
3737 __pyx_t_4 = __pyx_v_lt;
3738 goto __pyx_L8_bool_binop_done;
3740 __Pyx_INCREF(__pyx_v_eq);
3741 __pyx_t_4 = __pyx_v_eq;
3742 __pyx_L8_bool_binop_done:;
3743 __pyx_r = __pyx_t_4;
3763 __pyx_t_1 = ((__pyx_v_op == 4) != 0);
3773 __Pyx_XDECREF(__pyx_r);
3774 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_lt);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 171, __pyx_L1_error)
3777 __pyx_t_1 = __pyx_t_2;
3778 goto __pyx_L10_bool_binop_done;
3780 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_eq);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 171, __pyx_L1_error)
3781 __pyx_t_1 = __pyx_t_2;
3782 __pyx_L10_bool_binop_done:;
3783 __pyx_t_4 = __Pyx_PyBool_FromLong((!__pyx_t_1));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error)
3784 __Pyx_GOTREF(__pyx_t_4);
3785 __pyx_r = __pyx_t_4;
3805 __pyx_t_1 = ((__pyx_v_op == 5) != 0);
3815 __Pyx_XDECREF(__pyx_r);
3816 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_lt);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 173, __pyx_L1_error)
3817 __pyx_t_4 = __Pyx_PyBool_FromLong((!__pyx_t_1));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 173, __pyx_L1_error)
3818 __Pyx_GOTREF(__pyx_t_4);
3819 __pyx_r = __pyx_t_4;
3840 __Pyx_XDECREF(__pyx_r);
3841 __Pyx_INCREF(__pyx_builtin_NotImplemented);
3842 __pyx_r = __pyx_builtin_NotImplemented;
3859 __Pyx_XDECREF(__pyx_t_4);
3860 __Pyx_AddTraceback(
"PyClical.index_set.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3863 __Pyx_XDECREF(__pyx_v_eq);
3864 __Pyx_XDECREF(__pyx_v_lt);
3865 __Pyx_XGIVEREF(__pyx_r);
3866 __Pyx_RefNannyFinishContext();
3879 static int __pyx_pw_8PyClical_9index_set_9__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx, PyObject *__pyx_v_val);
3880 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 ";
3881 #if CYTHON_COMPILING_IN_CPYTHON 3882 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_8__setitem__;
3884 static int __pyx_pw_8PyClical_9index_set_9__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx, PyObject *__pyx_v_val) {
3886 __Pyx_RefNannyDeclarations
3887 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
3888 __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));
3891 __Pyx_RefNannyFinishContext();
3895 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) {
3897 __Pyx_RefNannyDeclarations
3900 __Pyx_RefNannySetupContext(
"__setitem__", 0);
3909 __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)
3910 __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)
3912 __pyx_v_self->instance->set(__pyx_t_1, __pyx_t_2);
3914 __Pyx_CppExn2PyErr();
3915 __PYX_ERR(0, 186, __pyx_L1_error)
3938 __Pyx_AddTraceback(
"PyClical.index_set.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3941 __Pyx_RefNannyFinishContext();
3954 static PyObject *__pyx_pw_8PyClical_9index_set_11__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx);
3955 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 ";
3956 #if CYTHON_COMPILING_IN_CPYTHON 3957 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_10__getitem__;
3959 static PyObject *__pyx_pw_8PyClical_9index_set_11__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx) {
3960 PyObject *__pyx_r = 0;
3961 __Pyx_RefNannyDeclarations
3962 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
3963 __pyx_r = __pyx_pf_8PyClical_9index_set_10__getitem__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_idx));
3966 __Pyx_RefNannyFinishContext();
3970 static PyObject *__pyx_pf_8PyClical_9index_set_10__getitem__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_idx) {
3971 PyObject *__pyx_r = NULL;
3972 __Pyx_RefNannyDeclarations
3974 PyObject *__pyx_t_2 = NULL;
3975 __Pyx_RefNannySetupContext(
"__getitem__", 0);
3984 __Pyx_XDECREF(__pyx_r);
3985 __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)
3986 __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)
3987 __Pyx_GOTREF(__pyx_t_2);
3988 __pyx_r = __pyx_t_2;
4002 __Pyx_XDECREF(__pyx_t_2);
4003 __Pyx_AddTraceback(
"PyClical.index_set.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4006 __Pyx_XGIVEREF(__pyx_r);
4007 __Pyx_RefNannyFinishContext();
4020 static int __pyx_pw_8PyClical_9index_set_13__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx);
4021 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 ";
4022 #if CYTHON_COMPILING_IN_CPYTHON 4023 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_12__contains__;
4025 static int __pyx_pw_8PyClical_9index_set_13__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx) {
4027 __Pyx_RefNannyDeclarations
4028 __Pyx_RefNannySetupContext(
"__contains__ (wrapper)", 0);
4029 __pyx_r = __pyx_pf_8PyClical_9index_set_12__contains__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_idx));
4032 __Pyx_RefNannyFinishContext();
4036 static int __pyx_pf_8PyClical_9index_set_12__contains__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_idx) {
4038 __Pyx_RefNannyDeclarations
4040 __Pyx_RefNannySetupContext(
"__contains__", 0);
4049 __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)
4050 __pyx_r = __pyx_v_self->instance->operator[](__pyx_t_1);
4063 __Pyx_AddTraceback(
"PyClical.index_set.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4066 __Pyx_RefNannyFinishContext();
4069 static PyObject *__pyx_gb_8PyClical_9index_set_16generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value);
4080 static PyObject *__pyx_pw_8PyClical_9index_set_15__iter__(PyObject *__pyx_v_self);
4081 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 ";
4082 #if CYTHON_COMPILING_IN_CPYTHON 4083 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_14__iter__;
4085 static PyObject *__pyx_pw_8PyClical_9index_set_15__iter__(PyObject *__pyx_v_self) {
4086 PyObject *__pyx_r = 0;
4087 __Pyx_RefNannyDeclarations
4088 __Pyx_RefNannySetupContext(
"__iter__ (wrapper)", 0);
4089 __pyx_r = __pyx_pf_8PyClical_9index_set_14__iter__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
4092 __Pyx_RefNannyFinishContext();
4096 static PyObject *__pyx_pf_8PyClical_9index_set_14__iter__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
4097 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *__pyx_cur_scope;
4098 PyObject *__pyx_r = NULL;
4099 __Pyx_RefNannyDeclarations
4100 __Pyx_RefNannySetupContext(
"__iter__", 0);
4101 __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);
4102 if (unlikely(!__pyx_cur_scope)) {
4103 __pyx_cur_scope = ((
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)Py_None);
4104 __Pyx_INCREF(Py_None);
4105 __PYX_ERR(0, 227, __pyx_L1_error)
4107 __Pyx_GOTREF(__pyx_cur_scope);
4109 __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
4110 __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
4111 __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
4113 __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)
4114 __Pyx_DECREF(__pyx_cur_scope);
4115 __Pyx_RefNannyFinishContext();
4116 return (PyObject *) gen;
4121 __Pyx_AddTraceback(
"PyClical.index_set.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4123 __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
4124 __Pyx_XGIVEREF(__pyx_r);
4125 __Pyx_RefNannyFinishContext();
4129 static PyObject *__pyx_gb_8PyClical_9index_set_16generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value)
4131 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *__pyx_cur_scope = ((
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)__pyx_generator->closure);
4132 PyObject *__pyx_r = NULL;
4133 PyObject *__pyx_t_1 = NULL;
4134 PyObject *__pyx_t_2 = NULL;
4135 PyObject *__pyx_t_3 = NULL;
4136 PyObject *__pyx_t_4 = NULL;
4137 Py_ssize_t __pyx_t_5;
4138 PyObject *(*__pyx_t_6)(PyObject *);
4141 __Pyx_RefNannyDeclarations
4142 __Pyx_RefNannySetupContext(
"__iter__", 0);
4143 switch (__pyx_generator->resume_label) {
4144 case 0:
goto __pyx_L3_first_run;
4145 case 1:
goto __pyx_L7_resume_from_yield;
4147 __Pyx_RefNannyFinishContext();
4150 __pyx_L3_first_run:;
4151 if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 227, __pyx_L1_error)
4160 __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)
4161 __Pyx_GOTREF(__pyx_t_2);
4163 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
4164 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
4165 if (likely(__pyx_t_3)) {
4166 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
4167 __Pyx_INCREF(__pyx_t_3);
4168 __Pyx_INCREF(
function);
4169 __Pyx_DECREF_SET(__pyx_t_2,
function);
4173 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error)
4174 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4176 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error)
4178 __Pyx_GOTREF(__pyx_t_1);
4179 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4180 __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)
4181 __Pyx_GOTREF(__pyx_t_3);
4183 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4184 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
4185 if (likely(__pyx_t_4)) {
4186 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4187 __Pyx_INCREF(__pyx_t_4);
4188 __Pyx_INCREF(
function);
4189 __Pyx_DECREF_SET(__pyx_t_3,
function);
4193 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error)
4194 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4196 __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error)
4198 __Pyx_GOTREF(__pyx_t_2);
4199 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4200 __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)
4201 __Pyx_GOTREF(__pyx_t_3);
4202 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4203 __pyx_t_2 = PyTuple_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error)
4204 __Pyx_GOTREF(__pyx_t_2);
4205 __Pyx_GIVEREF(__pyx_t_1);
4206 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
4207 __Pyx_GIVEREF(__pyx_t_3);
4208 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
4211 __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)
4212 __Pyx_GOTREF(__pyx_t_3);
4213 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4214 if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
4215 __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
4218 __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error)
4219 __Pyx_GOTREF(__pyx_t_2);
4220 __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext;
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error)
4222 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4224 if (likely(!__pyx_t_6)) {
4225 if (likely(PyList_CheckExact(__pyx_t_2))) {
4226 if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2))
break;
4227 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 4228 __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)
4230 __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)
4231 __Pyx_GOTREF(__pyx_t_3);
4234 if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2))
break;
4235 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 4236 __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)
4238 __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)
4239 __Pyx_GOTREF(__pyx_t_3);
4243 __pyx_t_3 = __pyx_t_6(__pyx_t_2);
4244 if (unlikely(!__pyx_t_3)) {
4245 PyObject* exc_type = PyErr_Occurred();
4247 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
4248 else __PYX_ERR(0, 234, __pyx_L1_error)
4252 __Pyx_GOTREF(__pyx_t_3);
4254 __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_idx);
4255 __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_idx, __pyx_t_3);
4256 __Pyx_GIVEREF(__pyx_t_3);
4266 __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)
4267 __pyx_t_8 = (__pyx_t_7 != 0);
4277 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_idx);
4278 __pyx_r = __pyx_cur_scope->__pyx_v_idx;
4279 __Pyx_XGIVEREF(__pyx_t_2);
4280 __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
4281 __pyx_cur_scope->__pyx_t_1 = __pyx_t_5;
4282 __pyx_cur_scope->__pyx_t_2 = __pyx_t_6;
4283 __Pyx_XGIVEREF(__pyx_r);
4284 __Pyx_RefNannyFinishContext();
4285 __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
4287 __pyx_generator->resume_label = 1;
4289 __pyx_L7_resume_from_yield:;
4290 __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
4291 __pyx_cur_scope->__pyx_t_0 = 0;
4292 __Pyx_XGOTREF(__pyx_t_2);
4293 __pyx_t_5 = __pyx_cur_scope->__pyx_t_1;
4294 __pyx_t_6 = __pyx_cur_scope->__pyx_t_2;
4295 if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 236, __pyx_L1_error)
4314 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4315 CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
4326 PyErr_SetNone(PyExc_StopIteration);
4329 __Pyx_XDECREF(__pyx_t_1);
4330 __Pyx_XDECREF(__pyx_t_2);
4331 __Pyx_XDECREF(__pyx_t_3);
4332 __Pyx_XDECREF(__pyx_t_4);
4333 __Pyx_AddTraceback(
"__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4335 __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
4336 __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
4337 __pyx_generator->resume_label = -1;
4338 __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
4339 __Pyx_RefNannyFinishContext();
4352 static PyObject *__pyx_pw_8PyClical_9index_set_18__invert__(PyObject *__pyx_v_self);
4353 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 ";
4354 #if CYTHON_COMPILING_IN_CPYTHON 4355 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_17__invert__;
4357 static PyObject *__pyx_pw_8PyClical_9index_set_18__invert__(PyObject *__pyx_v_self) {
4358 PyObject *__pyx_r = 0;
4359 __Pyx_RefNannyDeclarations
4360 __Pyx_RefNannySetupContext(
"__invert__ (wrapper)", 0);
4361 __pyx_r = __pyx_pf_8PyClical_9index_set_17__invert__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
4364 __Pyx_RefNannyFinishContext();
4368 static PyObject *__pyx_pf_8PyClical_9index_set_17__invert__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
4369 PyObject *__pyx_r = NULL;
4370 __Pyx_RefNannyDeclarations
4371 PyObject *__pyx_t_1 = NULL;
4372 PyObject *__pyx_t_2 = NULL;
4373 __Pyx_RefNannySetupContext(
"__invert__", 0);
4382 __Pyx_XDECREF(__pyx_r);
4383 __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)
4384 __Pyx_GOTREF(__pyx_t_1);
4385 __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)
4386 __Pyx_GOTREF(__pyx_t_2);
4387 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4388 __pyx_r = __pyx_t_2;
4402 __Pyx_XDECREF(__pyx_t_1);
4403 __Pyx_XDECREF(__pyx_t_2);
4404 __Pyx_AddTraceback(
"PyClical.index_set.__invert__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4407 __Pyx_XGIVEREF(__pyx_r);
4408 __Pyx_RefNannyFinishContext();
4421 static PyObject *__pyx_pw_8PyClical_9index_set_20__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
4422 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 ";
4423 #if CYTHON_COMPILING_IN_CPYTHON 4424 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_19__xor__;
4426 static PyObject *__pyx_pw_8PyClical_9index_set_20__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4427 PyObject *__pyx_r = 0;
4428 __Pyx_RefNannyDeclarations
4429 __Pyx_RefNannySetupContext(
"__xor__ (wrapper)", 0);
4430 __pyx_r = __pyx_pf_8PyClical_9index_set_19__xor__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
4433 __Pyx_RefNannyFinishContext();
4437 static PyObject *__pyx_pf_8PyClical_9index_set_19__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4438 PyObject *__pyx_r = NULL;
4439 __Pyx_RefNannyDeclarations
4440 PyObject *__pyx_t_1 = NULL;
4441 PyObject *__pyx_t_2 = NULL;
4442 __Pyx_RefNannySetupContext(
"__xor__", 0);
4451 __Pyx_XDECREF(__pyx_r);
4452 __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)
4453 __Pyx_GOTREF(__pyx_t_1);
4454 __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)
4455 __Pyx_GOTREF(__pyx_t_2);
4456 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4457 __pyx_r = __pyx_t_2;
4471 __Pyx_XDECREF(__pyx_t_1);
4472 __Pyx_XDECREF(__pyx_t_2);
4473 __Pyx_AddTraceback(
"PyClical.index_set.__xor__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4476 __Pyx_XGIVEREF(__pyx_r);
4477 __Pyx_RefNannyFinishContext();
4490 static PyObject *__pyx_pw_8PyClical_9index_set_22__ixor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
4491 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 ";
4492 #if CYTHON_COMPILING_IN_CPYTHON 4493 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_21__ixor__;
4495 static PyObject *__pyx_pw_8PyClical_9index_set_22__ixor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
4496 PyObject *__pyx_r = 0;
4497 __Pyx_RefNannyDeclarations
4498 __Pyx_RefNannySetupContext(
"__ixor__ (wrapper)", 0);
4499 __pyx_r = __pyx_pf_8PyClical_9index_set_21__ixor__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
4502 __Pyx_RefNannyFinishContext();
4506 static PyObject *__pyx_pf_8PyClical_9index_set_21__ixor__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs) {
4507 PyObject *__pyx_r = NULL;
4508 __Pyx_RefNannyDeclarations
4509 PyObject *__pyx_t_1 = NULL;
4510 __Pyx_RefNannySetupContext(
"__ixor__", 0);
4519 __Pyx_XDECREF(__pyx_r);
4520 __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)
4521 __Pyx_GOTREF(__pyx_t_1);
4522 __pyx_r = __pyx_t_1;
4536 __Pyx_XDECREF(__pyx_t_1);
4537 __Pyx_AddTraceback(
"PyClical.index_set.__ixor__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4540 __Pyx_XGIVEREF(__pyx_r);
4541 __Pyx_RefNannyFinishContext();
4554 static PyObject *__pyx_pw_8PyClical_9index_set_24__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
4555 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 ";
4556 #if CYTHON_COMPILING_IN_CPYTHON 4557 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_23__and__;
4559 static PyObject *__pyx_pw_8PyClical_9index_set_24__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4560 PyObject *__pyx_r = 0;
4561 __Pyx_RefNannyDeclarations
4562 __Pyx_RefNannySetupContext(
"__and__ (wrapper)", 0);
4563 __pyx_r = __pyx_pf_8PyClical_9index_set_23__and__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
4566 __Pyx_RefNannyFinishContext();
4570 static PyObject *__pyx_pf_8PyClical_9index_set_23__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4571 PyObject *__pyx_r = NULL;
4572 __Pyx_RefNannyDeclarations
4573 PyObject *__pyx_t_1 = NULL;
4574 PyObject *__pyx_t_2 = NULL;
4575 __Pyx_RefNannySetupContext(
"__and__", 0);
4584 __Pyx_XDECREF(__pyx_r);
4585 __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)
4586 __Pyx_GOTREF(__pyx_t_1);
4587 __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)
4588 __Pyx_GOTREF(__pyx_t_2);
4589 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4590 __pyx_r = __pyx_t_2;
4604 __Pyx_XDECREF(__pyx_t_1);
4605 __Pyx_XDECREF(__pyx_t_2);
4606 __Pyx_AddTraceback(
"PyClical.index_set.__and__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4609 __Pyx_XGIVEREF(__pyx_r);
4610 __Pyx_RefNannyFinishContext();
4623 static PyObject *__pyx_pw_8PyClical_9index_set_26__iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
4624 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 ";
4625 #if CYTHON_COMPILING_IN_CPYTHON 4626 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_25__iand__;
4628 static PyObject *__pyx_pw_8PyClical_9index_set_26__iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
4629 PyObject *__pyx_r = 0;
4630 __Pyx_RefNannyDeclarations
4631 __Pyx_RefNannySetupContext(
"__iand__ (wrapper)", 0);
4632 __pyx_r = __pyx_pf_8PyClical_9index_set_25__iand__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
4635 __Pyx_RefNannyFinishContext();
4639 static PyObject *__pyx_pf_8PyClical_9index_set_25__iand__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs) {
4640 PyObject *__pyx_r = NULL;
4641 __Pyx_RefNannyDeclarations
4642 PyObject *__pyx_t_1 = NULL;
4643 __Pyx_RefNannySetupContext(
"__iand__", 0);
4652 __Pyx_XDECREF(__pyx_r);
4653 __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)
4654 __Pyx_GOTREF(__pyx_t_1);
4655 __pyx_r = __pyx_t_1;
4669 __Pyx_XDECREF(__pyx_t_1);
4670 __Pyx_AddTraceback(
"PyClical.index_set.__iand__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4673 __Pyx_XGIVEREF(__pyx_r);
4674 __Pyx_RefNannyFinishContext();
4687 static PyObject *__pyx_pw_8PyClical_9index_set_28__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
4688 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 ";
4689 #if CYTHON_COMPILING_IN_CPYTHON 4690 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_27__or__;
4692 static PyObject *__pyx_pw_8PyClical_9index_set_28__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4693 PyObject *__pyx_r = 0;
4694 __Pyx_RefNannyDeclarations
4695 __Pyx_RefNannySetupContext(
"__or__ (wrapper)", 0);
4696 __pyx_r = __pyx_pf_8PyClical_9index_set_27__or__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
4699 __Pyx_RefNannyFinishContext();
4703 static PyObject *__pyx_pf_8PyClical_9index_set_27__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4704 PyObject *__pyx_r = NULL;
4705 __Pyx_RefNannyDeclarations
4706 PyObject *__pyx_t_1 = NULL;
4707 PyObject *__pyx_t_2 = NULL;
4708 __Pyx_RefNannySetupContext(
"__or__", 0);
4717 __Pyx_XDECREF(__pyx_r);
4718 __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)
4719 __Pyx_GOTREF(__pyx_t_1);
4720 __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)
4721 __Pyx_GOTREF(__pyx_t_2);
4722 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4723 __pyx_r = __pyx_t_2;
4737 __Pyx_XDECREF(__pyx_t_1);
4738 __Pyx_XDECREF(__pyx_t_2);
4739 __Pyx_AddTraceback(
"PyClical.index_set.__or__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4742 __Pyx_XGIVEREF(__pyx_r);
4743 __Pyx_RefNannyFinishContext();
4756 static PyObject *__pyx_pw_8PyClical_9index_set_30__ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
4757 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 ";
4758 #if CYTHON_COMPILING_IN_CPYTHON 4759 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_29__ior__;
4761 static PyObject *__pyx_pw_8PyClical_9index_set_30__ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
4762 PyObject *__pyx_r = 0;
4763 __Pyx_RefNannyDeclarations
4764 __Pyx_RefNannySetupContext(
"__ior__ (wrapper)", 0);
4765 __pyx_r = __pyx_pf_8PyClical_9index_set_29__ior__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
4768 __Pyx_RefNannyFinishContext();
4772 static PyObject *__pyx_pf_8PyClical_9index_set_29__ior__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs) {
4773 PyObject *__pyx_r = NULL;
4774 __Pyx_RefNannyDeclarations
4775 PyObject *__pyx_t_1 = NULL;
4776 __Pyx_RefNannySetupContext(
"__ior__", 0);
4785 __Pyx_XDECREF(__pyx_r);
4786 __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)
4787 __Pyx_GOTREF(__pyx_t_1);
4788 __pyx_r = __pyx_t_1;
4802 __Pyx_XDECREF(__pyx_t_1);
4803 __Pyx_AddTraceback(
"PyClical.index_set.__ior__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4806 __Pyx_XGIVEREF(__pyx_r);
4807 __Pyx_RefNannyFinishContext();
4820 static PyObject *__pyx_pw_8PyClical_9index_set_32count(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4821 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 ";
4822 static PyObject *__pyx_pw_8PyClical_9index_set_32count(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4823 PyObject *__pyx_r = 0;
4824 __Pyx_RefNannyDeclarations
4825 __Pyx_RefNannySetupContext(
"count (wrapper)", 0);
4826 __pyx_r = __pyx_pf_8PyClical_9index_set_31count(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
4829 __Pyx_RefNannyFinishContext();
4833 static PyObject *__pyx_pf_8PyClical_9index_set_31count(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
4834 PyObject *__pyx_r = NULL;
4835 __Pyx_RefNannyDeclarations
4836 PyObject *__pyx_t_1 = NULL;
4837 __Pyx_RefNannySetupContext(
"count", 0);
4846 __Pyx_XDECREF(__pyx_r);
4847 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->instance->count());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error)
4848 __Pyx_GOTREF(__pyx_t_1);
4849 __pyx_r = __pyx_t_1;
4863 __Pyx_XDECREF(__pyx_t_1);
4864 __Pyx_AddTraceback(
"PyClical.index_set.count", __pyx_clineno, __pyx_lineno, __pyx_filename);
4867 __Pyx_XGIVEREF(__pyx_r);
4868 __Pyx_RefNannyFinishContext();
4881 static PyObject *__pyx_pw_8PyClical_9index_set_34count_neg(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4882 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 ";
4883 static PyObject *__pyx_pw_8PyClical_9index_set_34count_neg(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4884 PyObject *__pyx_r = 0;
4885 __Pyx_RefNannyDeclarations
4886 __Pyx_RefNannySetupContext(
"count_neg (wrapper)", 0);
4887 __pyx_r = __pyx_pf_8PyClical_9index_set_33count_neg(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
4890 __Pyx_RefNannyFinishContext();
4894 static PyObject *__pyx_pf_8PyClical_9index_set_33count_neg(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
4895 PyObject *__pyx_r = NULL;
4896 __Pyx_RefNannyDeclarations
4897 PyObject *__pyx_t_1 = NULL;
4898 __Pyx_RefNannySetupContext(
"count_neg", 0);
4907 __Pyx_XDECREF(__pyx_r);
4908 __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)
4909 __Pyx_GOTREF(__pyx_t_1);
4910 __pyx_r = __pyx_t_1;
4924 __Pyx_XDECREF(__pyx_t_1);
4925 __Pyx_AddTraceback(
"PyClical.index_set.count_neg", __pyx_clineno, __pyx_lineno, __pyx_filename);
4928 __Pyx_XGIVEREF(__pyx_r);
4929 __Pyx_RefNannyFinishContext();
4942 static PyObject *__pyx_pw_8PyClical_9index_set_36count_pos(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4943 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 ";
4944 static PyObject *__pyx_pw_8PyClical_9index_set_36count_pos(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4945 PyObject *__pyx_r = 0;
4946 __Pyx_RefNannyDeclarations
4947 __Pyx_RefNannySetupContext(
"count_pos (wrapper)", 0);
4948 __pyx_r = __pyx_pf_8PyClical_9index_set_35count_pos(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
4951 __Pyx_RefNannyFinishContext();
4955 static PyObject *__pyx_pf_8PyClical_9index_set_35count_pos(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
4956 PyObject *__pyx_r = NULL;
4957 __Pyx_RefNannyDeclarations
4958 PyObject *__pyx_t_1 = NULL;
4959 __Pyx_RefNannySetupContext(
"count_pos", 0);
4968 __Pyx_XDECREF(__pyx_r);
4969 __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)
4970 __Pyx_GOTREF(__pyx_t_1);
4971 __pyx_r = __pyx_t_1;
4985 __Pyx_XDECREF(__pyx_t_1);
4986 __Pyx_AddTraceback(
"PyClical.index_set.count_pos", __pyx_clineno, __pyx_lineno, __pyx_filename);
4989 __Pyx_XGIVEREF(__pyx_r);
4990 __Pyx_RefNannyFinishContext();
5003 static PyObject *__pyx_pw_8PyClical_9index_set_38min(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5004 static char __pyx_doc_8PyClical_9index_set_37min[] =
"\n Minimum member.\n\n >>> index_set({-1,1,2}).min()\n -1\n ";
5005 static PyObject *__pyx_pw_8PyClical_9index_set_38min(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5006 PyObject *__pyx_r = 0;
5007 __Pyx_RefNannyDeclarations
5008 __Pyx_RefNannySetupContext(
"min (wrapper)", 0);
5009 __pyx_r = __pyx_pf_8PyClical_9index_set_37min(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5012 __Pyx_RefNannyFinishContext();
5016 static PyObject *__pyx_pf_8PyClical_9index_set_37min(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5017 PyObject *__pyx_r = NULL;
5018 __Pyx_RefNannyDeclarations
5019 PyObject *__pyx_t_1 = NULL;
5020 __Pyx_RefNannySetupContext(
"min", 0);
5029 __Pyx_XDECREF(__pyx_r);
5030 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->instance->min());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 347, __pyx_L1_error)
5031 __Pyx_GOTREF(__pyx_t_1);
5032 __pyx_r = __pyx_t_1;
5046 __Pyx_XDECREF(__pyx_t_1);
5047 __Pyx_AddTraceback(
"PyClical.index_set.min", __pyx_clineno, __pyx_lineno, __pyx_filename);
5050 __Pyx_XGIVEREF(__pyx_r);
5051 __Pyx_RefNannyFinishContext();
5064 static PyObject *__pyx_pw_8PyClical_9index_set_40max(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5065 static char __pyx_doc_8PyClical_9index_set_39max[] =
"\n Maximum member.\n\n >>> index_set({-1,1,2}).max()\n 2\n ";
5066 static PyObject *__pyx_pw_8PyClical_9index_set_40max(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5067 PyObject *__pyx_r = 0;
5068 __Pyx_RefNannyDeclarations
5069 __Pyx_RefNannySetupContext(
"max (wrapper)", 0);
5070 __pyx_r = __pyx_pf_8PyClical_9index_set_39max(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5073 __Pyx_RefNannyFinishContext();
5077 static PyObject *__pyx_pf_8PyClical_9index_set_39max(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5078 PyObject *__pyx_r = NULL;
5079 __Pyx_RefNannyDeclarations
5080 PyObject *__pyx_t_1 = NULL;
5081 __Pyx_RefNannySetupContext(
"max", 0);
5090 __Pyx_XDECREF(__pyx_r);
5091 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->instance->max());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error)
5092 __Pyx_GOTREF(__pyx_t_1);
5093 __pyx_r = __pyx_t_1;
5107 __Pyx_XDECREF(__pyx_t_1);
5108 __Pyx_AddTraceback(
"PyClical.index_set.max", __pyx_clineno, __pyx_lineno, __pyx_filename);
5111 __Pyx_XGIVEREF(__pyx_r);
5112 __Pyx_RefNannyFinishContext();
5125 static PyObject *__pyx_pw_8PyClical_9index_set_42hash_fn(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5126 static char __pyx_doc_8PyClical_9index_set_41hash_fn[] =
"\n Hash function.\n ";
5127 static PyObject *__pyx_pw_8PyClical_9index_set_42hash_fn(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5128 PyObject *__pyx_r = 0;
5129 __Pyx_RefNannyDeclarations
5130 __Pyx_RefNannySetupContext(
"hash_fn (wrapper)", 0);
5131 __pyx_r = __pyx_pf_8PyClical_9index_set_41hash_fn(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5134 __Pyx_RefNannyFinishContext();
5138 static PyObject *__pyx_pf_8PyClical_9index_set_41hash_fn(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5139 PyObject *__pyx_r = NULL;
5140 __Pyx_RefNannyDeclarations
5141 PyObject *__pyx_t_1 = NULL;
5142 __Pyx_RefNannySetupContext(
"hash_fn", 0);
5151 __Pyx_XDECREF(__pyx_r);
5152 __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)
5153 __Pyx_GOTREF(__pyx_t_1);
5154 __pyx_r = __pyx_t_1;
5168 __Pyx_XDECREF(__pyx_t_1);
5169 __Pyx_AddTraceback(
"PyClical.index_set.hash_fn", __pyx_clineno, __pyx_lineno, __pyx_filename);
5172 __Pyx_XGIVEREF(__pyx_r);
5173 __Pyx_RefNannyFinishContext();
5186 static PyObject *__pyx_pw_8PyClical_9index_set_44sign_of_mult(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
5187 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 ";
5188 static PyObject *__pyx_pw_8PyClical_9index_set_44sign_of_mult(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
5189 PyObject *__pyx_r = 0;
5190 __Pyx_RefNannyDeclarations
5191 __Pyx_RefNannySetupContext(
"sign_of_mult (wrapper)", 0);
5192 __pyx_r = __pyx_pf_8PyClical_9index_set_43sign_of_mult(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
5195 __Pyx_RefNannyFinishContext();
5199 static PyObject *__pyx_pf_8PyClical_9index_set_43sign_of_mult(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs) {
5200 PyObject *__pyx_r = NULL;
5201 __Pyx_RefNannyDeclarations
5202 PyObject *__pyx_t_1 = NULL;
5203 __Pyx_RefNannySetupContext(
"sign_of_mult", 0);
5212 __Pyx_XDECREF(__pyx_r);
5213 __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)
5214 __Pyx_GOTREF(__pyx_t_1);
5215 __pyx_r = __pyx_t_1;
5229 __Pyx_XDECREF(__pyx_t_1);
5230 __Pyx_AddTraceback(
"PyClical.index_set.sign_of_mult", __pyx_clineno, __pyx_lineno, __pyx_filename);
5233 __Pyx_XGIVEREF(__pyx_r);
5234 __Pyx_RefNannyFinishContext();
5247 static PyObject *__pyx_pw_8PyClical_9index_set_46sign_of_square(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5248 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 ";
5249 static PyObject *__pyx_pw_8PyClical_9index_set_46sign_of_square(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5250 PyObject *__pyx_r = 0;
5251 __Pyx_RefNannyDeclarations
5252 __Pyx_RefNannySetupContext(
"sign_of_square (wrapper)", 0);
5253 __pyx_r = __pyx_pf_8PyClical_9index_set_45sign_of_square(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5256 __Pyx_RefNannyFinishContext();
5260 static PyObject *__pyx_pf_8PyClical_9index_set_45sign_of_square(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5261 PyObject *__pyx_r = NULL;
5262 __Pyx_RefNannyDeclarations
5263 PyObject *__pyx_t_1 = NULL;
5264 __Pyx_RefNannySetupContext(
"sign_of_square", 0);
5273 __Pyx_XDECREF(__pyx_r);
5274 __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)
5275 __Pyx_GOTREF(__pyx_t_1);
5276 __pyx_r = __pyx_t_1;
5290 __Pyx_XDECREF(__pyx_t_1);
5291 __Pyx_AddTraceback(
"PyClical.index_set.sign_of_square", __pyx_clineno, __pyx_lineno, __pyx_filename);
5294 __Pyx_XGIVEREF(__pyx_r);
5295 __Pyx_RefNannyFinishContext();
5308 static PyObject *__pyx_pw_8PyClical_9index_set_48__repr__(PyObject *__pyx_v_self);
5309 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 ";
5310 #if CYTHON_COMPILING_IN_CPYTHON 5311 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_47__repr__;
5313 static PyObject *__pyx_pw_8PyClical_9index_set_48__repr__(PyObject *__pyx_v_self) {
5314 PyObject *__pyx_r = 0;
5315 __Pyx_RefNannyDeclarations
5316 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
5317 __pyx_r = __pyx_pf_8PyClical_9index_set_47__repr__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5320 __Pyx_RefNannyFinishContext();
5324 static PyObject *__pyx_pf_8PyClical_9index_set_47__repr__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5325 PyObject *__pyx_r = NULL;
5326 __Pyx_RefNannyDeclarations
5327 PyObject *__pyx_t_1 = NULL;
5328 __Pyx_RefNannySetupContext(
"__repr__", 0);
5337 __Pyx_XDECREF(__pyx_r);
5338 __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)
5339 __Pyx_GOTREF(__pyx_t_1);
5340 __pyx_r = __pyx_t_1;
5354 __Pyx_XDECREF(__pyx_t_1);
5355 __Pyx_AddTraceback(
"PyClical.index_set.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5358 __Pyx_XGIVEREF(__pyx_r);
5359 __Pyx_RefNannyFinishContext();
5372 static PyObject *__pyx_pw_8PyClical_9index_set_50__str__(PyObject *__pyx_v_self);
5373 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 ";
5374 #if CYTHON_COMPILING_IN_CPYTHON 5375 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_49__str__;
5377 static PyObject *__pyx_pw_8PyClical_9index_set_50__str__(PyObject *__pyx_v_self) {
5378 PyObject *__pyx_r = 0;
5379 __Pyx_RefNannyDeclarations
5380 __Pyx_RefNannySetupContext(
"__str__ (wrapper)", 0);
5381 __pyx_r = __pyx_pf_8PyClical_9index_set_49__str__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5384 __Pyx_RefNannyFinishContext();
5388 static PyObject *__pyx_pf_8PyClical_9index_set_49__str__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5389 PyObject *__pyx_r = NULL;
5390 __Pyx_RefNannyDeclarations
5391 PyObject *__pyx_t_1 = NULL;
5392 __Pyx_RefNannySetupContext(
"__str__", 0);
5401 __Pyx_XDECREF(__pyx_r);
5402 __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)
5403 __Pyx_GOTREF(__pyx_t_1);
5404 __pyx_r = __pyx_t_1;
5418 __Pyx_XDECREF(__pyx_t_1);
5419 __Pyx_AddTraceback(
"PyClical.index_set.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5422 __Pyx_XGIVEREF(__pyx_r);
5423 __Pyx_RefNannyFinishContext();
5434 static PyObject *__pyx_pw_8PyClical_9index_set_52__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5435 static PyObject *__pyx_pw_8PyClical_9index_set_52__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5436 PyObject *__pyx_r = 0;
5437 __Pyx_RefNannyDeclarations
5438 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
5439 __pyx_r = __pyx_pf_8PyClical_9index_set_51__reduce_cython__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5442 __Pyx_RefNannyFinishContext();
5446 static PyObject *__pyx_pf_8PyClical_9index_set_51__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5447 PyObject *__pyx_r = NULL;
5448 __Pyx_RefNannyDeclarations
5449 PyObject *__pyx_t_1 = NULL;
5450 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
5458 __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)
5459 __Pyx_GOTREF(__pyx_t_1);
5460 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5461 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5462 __PYX_ERR(1, 2, __pyx_L1_error)
5472 __Pyx_XDECREF(__pyx_t_1);
5473 __Pyx_AddTraceback(
"PyClical.index_set.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5475 __Pyx_XGIVEREF(__pyx_r);
5476 __Pyx_RefNannyFinishContext();
5488 static PyObject *__pyx_pw_8PyClical_9index_set_54__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
5489 static PyObject *__pyx_pw_8PyClical_9index_set_54__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
5490 PyObject *__pyx_r = 0;
5491 __Pyx_RefNannyDeclarations
5492 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
5493 __pyx_r = __pyx_pf_8PyClical_9index_set_53__setstate_cython__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
5496 __Pyx_RefNannyFinishContext();
5500 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) {
5501 PyObject *__pyx_r = NULL;
5502 __Pyx_RefNannyDeclarations
5503 PyObject *__pyx_t_1 = NULL;
5504 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
5511 __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)
5512 __Pyx_GOTREF(__pyx_t_1);
5513 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5514 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5515 __PYX_ERR(1, 4, __pyx_L1_error)
5526 __Pyx_XDECREF(__pyx_t_1);
5527 __Pyx_AddTraceback(
"PyClical.index_set.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5529 __Pyx_XGIVEREF(__pyx_r);
5530 __Pyx_RefNannyFinishContext();
5543 static PyObject *__pyx_pw_8PyClical_1index_set_hidden_doctests(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused);
5544 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 ";
5545 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};
5546 static PyObject *__pyx_pw_8PyClical_1index_set_hidden_doctests(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
5547 PyObject *__pyx_r = 0;
5548 __Pyx_RefNannyDeclarations
5549 __Pyx_RefNannySetupContext(
"index_set_hidden_doctests (wrapper)", 0);
5550 __pyx_r = __pyx_pf_8PyClical_index_set_hidden_doctests(__pyx_self);
5553 __Pyx_RefNannyFinishContext();
5557 static PyObject *__pyx_pf_8PyClical_index_set_hidden_doctests(CYTHON_UNUSED PyObject *__pyx_self) {
5558 PyObject *__pyx_r = NULL;
5559 __Pyx_RefNannyDeclarations
5560 __Pyx_RefNannySetupContext(
"index_set_hidden_doctests", 0);
5569 __Pyx_XDECREF(__pyx_r);
5570 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5583 __Pyx_XGIVEREF(__pyx_r);
5584 __Pyx_RefNannyFinishContext();
5596 static PyObject *__pyx_pw_8PyClical_3compare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5597 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_compare(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs, CYTHON_UNUSED
int __pyx_skip_dispatch) {
5598 PyObject *__pyx_r = NULL;
5599 __Pyx_RefNannyDeclarations
5600 PyObject *__pyx_t_1 = NULL;
5601 __Pyx_RefNannySetupContext(
"compare", 0);
5610 __Pyx_XDECREF(__pyx_r);
5611 __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)
5612 __Pyx_GOTREF(__pyx_t_1);
5613 __pyx_r = __pyx_t_1;
5627 __Pyx_XDECREF(__pyx_t_1);
5628 __Pyx_AddTraceback(
"PyClical.compare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5631 __Pyx_XGIVEREF(__pyx_r);
5632 __Pyx_RefNannyFinishContext();
5637 static PyObject *__pyx_pw_8PyClical_3compare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5638 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 ";
5639 static PyObject *__pyx_pw_8PyClical_3compare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5640 PyObject *__pyx_v_lhs = 0;
5641 PyObject *__pyx_v_rhs = 0;
5642 PyObject *__pyx_r = 0;
5643 __Pyx_RefNannyDeclarations
5644 __Pyx_RefNannySetupContext(
"compare (wrapper)", 0);
5646 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lhs,&__pyx_n_s_rhs,0};
5647 PyObject* values[2] = {0,0};
5648 if (unlikely(__pyx_kwds)) {
5650 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5652 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5654 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5657 default:
goto __pyx_L5_argtuple_error;
5659 kw_args = PyDict_Size(__pyx_kwds);
5662 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_lhs)) != 0)) kw_args--;
5663 else goto __pyx_L5_argtuple_error;
5666 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rhs)) != 0)) kw_args--;
5668 __Pyx_RaiseArgtupleInvalid(
"compare", 1, 2, 2, 1); __PYX_ERR(0, 490, __pyx_L3_error)
5671 if (unlikely(kw_args > 0)) {
5672 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"compare") < 0)) __PYX_ERR(0, 490, __pyx_L3_error)
5674 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5675 goto __pyx_L5_argtuple_error;
5677 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5678 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5680 __pyx_v_lhs = values[0];
5681 __pyx_v_rhs = values[1];
5683 goto __pyx_L4_argument_unpacking_done;
5684 __pyx_L5_argtuple_error:;
5685 __Pyx_RaiseArgtupleInvalid(
"compare", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 490, __pyx_L3_error)
5687 __Pyx_AddTraceback(
"PyClical.compare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5688 __Pyx_RefNannyFinishContext();
5690 __pyx_L4_argument_unpacking_done:;
5691 __pyx_r = __pyx_pf_8PyClical_2compare(__pyx_self, __pyx_v_lhs, __pyx_v_rhs);
5694 __Pyx_RefNannyFinishContext();
5698 static PyObject *__pyx_pf_8PyClical_2compare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
5699 PyObject *__pyx_r = NULL;
5700 __Pyx_RefNannyDeclarations
5701 PyObject *__pyx_t_1 = NULL;
5702 __Pyx_RefNannySetupContext(
"compare", 0);
5703 __Pyx_XDECREF(__pyx_r);
5704 __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)
5705 __Pyx_GOTREF(__pyx_t_1);
5706 __pyx_r = __pyx_t_1;
5712 __Pyx_XDECREF(__pyx_t_1);
5713 __Pyx_AddTraceback(
"PyClical.compare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5716 __Pyx_XGIVEREF(__pyx_r);
5717 __Pyx_RefNannyFinishContext();
5729 static PyObject *__pyx_pw_8PyClical_5min_neg(PyObject *__pyx_self, PyObject *__pyx_v_obj);
5730 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_min_neg(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
5731 PyObject *__pyx_r = NULL;
5732 __Pyx_RefNannyDeclarations
5733 PyObject *__pyx_t_1 = NULL;
5734 __Pyx_RefNannySetupContext(
"min_neg", 0);
5743 __Pyx_XDECREF(__pyx_r);
5744 __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)
5745 __Pyx_GOTREF(__pyx_t_1);
5746 __pyx_r = __pyx_t_1;
5760 __Pyx_XDECREF(__pyx_t_1);
5761 __Pyx_AddTraceback(
"PyClical.min_neg", __pyx_clineno, __pyx_lineno, __pyx_filename);
5764 __Pyx_XGIVEREF(__pyx_r);
5765 __Pyx_RefNannyFinishContext();
5770 static PyObject *__pyx_pw_8PyClical_5min_neg(PyObject *__pyx_self, PyObject *__pyx_v_obj);
5771 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 ";
5772 static PyObject *__pyx_pw_8PyClical_5min_neg(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
5773 PyObject *__pyx_r = 0;
5774 __Pyx_RefNannyDeclarations
5775 __Pyx_RefNannySetupContext(
"min_neg (wrapper)", 0);
5776 __pyx_r = __pyx_pf_8PyClical_4min_neg(__pyx_self, ((PyObject *)__pyx_v_obj));
5779 __Pyx_RefNannyFinishContext();
5783 static PyObject *__pyx_pf_8PyClical_4min_neg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
5784 PyObject *__pyx_r = NULL;
5785 __Pyx_RefNannyDeclarations
5786 PyObject *__pyx_t_1 = NULL;
5787 __Pyx_RefNannySetupContext(
"min_neg", 0);
5788 __Pyx_XDECREF(__pyx_r);
5789 __pyx_t_1 = __pyx_f_8PyClical_min_neg(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 502, __pyx_L1_error)
5790 __Pyx_GOTREF(__pyx_t_1);
5791 __pyx_r = __pyx_t_1;
5797 __Pyx_XDECREF(__pyx_t_1);
5798 __Pyx_AddTraceback(
"PyClical.min_neg", __pyx_clineno, __pyx_lineno, __pyx_filename);
5801 __Pyx_XGIVEREF(__pyx_r);
5802 __Pyx_RefNannyFinishContext();
5814 static PyObject *__pyx_pw_8PyClical_7max_pos(PyObject *__pyx_self, PyObject *__pyx_v_obj);
5815 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_max_pos(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
5816 PyObject *__pyx_r = NULL;
5817 __Pyx_RefNannyDeclarations
5818 PyObject *__pyx_t_1 = NULL;
5819 __Pyx_RefNannySetupContext(
"max_pos", 0);
5828 __Pyx_XDECREF(__pyx_r);
5829 __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)
5830 __Pyx_GOTREF(__pyx_t_1);
5831 __pyx_r = __pyx_t_1;
5845 __Pyx_XDECREF(__pyx_t_1);
5846 __Pyx_AddTraceback(
"PyClical.max_pos", __pyx_clineno, __pyx_lineno, __pyx_filename);
5849 __Pyx_XGIVEREF(__pyx_r);
5850 __Pyx_RefNannyFinishContext();
5855 static PyObject *__pyx_pw_8PyClical_7max_pos(PyObject *__pyx_self, PyObject *__pyx_v_obj);
5856 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 ";
5857 static PyObject *__pyx_pw_8PyClical_7max_pos(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
5858 PyObject *__pyx_r = 0;
5859 __Pyx_RefNannyDeclarations
5860 __Pyx_RefNannySetupContext(
"max_pos (wrapper)", 0);
5861 __pyx_r = __pyx_pf_8PyClical_6max_pos(__pyx_self, ((PyObject *)__pyx_v_obj));
5864 __Pyx_RefNannyFinishContext();
5868 static PyObject *__pyx_pf_8PyClical_6max_pos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
5869 PyObject *__pyx_r = NULL;
5870 __Pyx_RefNannyDeclarations
5871 PyObject *__pyx_t_1 = NULL;
5872 __Pyx_RefNannySetupContext(
"max_pos", 0);
5873 __Pyx_XDECREF(__pyx_r);
5874 __pyx_t_1 = __pyx_f_8PyClical_max_pos(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 511, __pyx_L1_error)
5875 __Pyx_GOTREF(__pyx_t_1);
5876 __pyx_r = __pyx_t_1;
5882 __Pyx_XDECREF(__pyx_t_1);
5883 __Pyx_AddTraceback(
"PyClical.max_pos", __pyx_clineno, __pyx_lineno, __pyx_filename);
5886 __Pyx_XGIVEREF(__pyx_r);
5887 __Pyx_RefNannyFinishContext();
5899 static CYTHON_INLINE std::vector<scalar_t> __pyx_f_8PyClical_list_to_vector(PyObject *__pyx_v_lst) {
5900 std::vector<scalar_t> __pyx_v_v;
5901 PyObject *__pyx_v_s = NULL;
5902 std::vector<scalar_t> __pyx_r;
5903 __Pyx_RefNannyDeclarations
5904 PyObject *__pyx_t_1 = NULL;
5905 Py_ssize_t __pyx_t_2;
5906 PyObject *(*__pyx_t_3)(PyObject *);
5907 PyObject *__pyx_t_4 = NULL;
5909 __Pyx_RefNannySetupContext(
"list_to_vector", 0);
5918 if (likely(PyList_CheckExact(__pyx_v_lst)) || PyTuple_CheckExact(__pyx_v_lst)) {
5919 __pyx_t_1 = __pyx_v_lst; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
5922 __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_lst);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error)
5923 __Pyx_GOTREF(__pyx_t_1);
5924 __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 525, __pyx_L1_error)
5927 if (likely(!__pyx_t_3)) {
5928 if (likely(PyList_CheckExact(__pyx_t_1))) {
5929 if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1))
break;
5930 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 5931 __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)
5933 __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)
5934 __Pyx_GOTREF(__pyx_t_4);
5937 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1))
break;
5938 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 5939 __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)
5941 __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)
5942 __Pyx_GOTREF(__pyx_t_4);
5946 __pyx_t_4 = __pyx_t_3(__pyx_t_1);
5947 if (unlikely(!__pyx_t_4)) {
5948 PyObject* exc_type = PyErr_Occurred();
5950 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
5951 else __PYX_ERR(0, 525, __pyx_L1_error)
5955 __Pyx_GOTREF(__pyx_t_4);
5957 __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_4);
5967 __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)
5969 __pyx_v_v.push_back(((
scalar_t)__pyx_t_5));
5971 __Pyx_CppExn2PyErr();
5972 __PYX_ERR(0, 526, __pyx_L1_error)
5983 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5992 __pyx_r = __pyx_v_v;
6005 __Pyx_XDECREF(__pyx_t_1);
6006 __Pyx_XDECREF(__pyx_t_4);
6007 __Pyx_WriteUnraisable(
"PyClical.list_to_vector", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6008 __Pyx_pretend_to_initialize(&__pyx_r);
6010 __Pyx_XDECREF(__pyx_v_s);
6011 __Pyx_RefNannyFinishContext();
6023 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_toClifford(PyObject *__pyx_v_obj) {
6025 __Pyx_RefNannyDeclarations
6026 PyObject *__pyx_t_1 = NULL;
6027 PyObject *__pyx_t_2 = NULL;
6028 __Pyx_RefNannySetupContext(
"toClifford", 0);
6037 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 533, __pyx_L1_error)
6038 __Pyx_GOTREF(__pyx_t_1);
6039 __Pyx_INCREF(__pyx_v_obj);
6040 __Pyx_GIVEREF(__pyx_v_obj);
6041 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_obj);
6042 __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)
6043 __Pyx_GOTREF(__pyx_t_2);
6044 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6045 __pyx_r = (((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_2)->instance[0]);
6046 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6059 __Pyx_XDECREF(__pyx_t_1);
6060 __Pyx_XDECREF(__pyx_t_2);
6061 __Pyx_WriteUnraisable(
"PyClical.toClifford", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6062 __Pyx_pretend_to_initialize(&__pyx_r);
6064 __Pyx_RefNannyFinishContext();
6076 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_8clifford_wrap(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self,
Clifford __pyx_v_other) {
6077 PyObject *__pyx_r = NULL;
6078 __Pyx_RefNannyDeclarations
6079 __Pyx_RefNannySetupContext(
"wrap", 0);
6088 (__pyx_v_self->instance[0]) = __pyx_v_other;
6097 __Pyx_XDECREF(__pyx_r);
6098 __Pyx_INCREF(((PyObject *)__pyx_v_self));
6099 __pyx_r = ((PyObject *)__pyx_v_self);
6112 __Pyx_XGIVEREF(__pyx_r);
6113 __Pyx_RefNannyFinishContext();
6125 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_8clifford_unwrap(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
6127 __Pyx_RefNannyDeclarations
6128 __Pyx_RefNannySetupContext(
"unwrap", 0);
6137 __pyx_r = (__pyx_v_self->instance[0]);
6150 __Pyx_RefNannyFinishContext();
6162 static PyObject *__pyx_pw_8PyClical_8clifford_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
6163 static PyObject *__pyx_f_8PyClical_8clifford_copy(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self,
int __pyx_skip_dispatch) {
6164 PyObject *__pyx_r = NULL;
6165 __Pyx_RefNannyDeclarations
6166 PyObject *__pyx_t_1 = NULL;
6167 PyObject *__pyx_t_2 = NULL;
6168 PyObject *__pyx_t_3 = NULL;
6169 PyObject *__pyx_t_4 = NULL;
6170 __Pyx_RefNannySetupContext(
"copy", 0);
6172 if (unlikely(__pyx_skip_dispatch)) ;
6174 else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
6175 __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)
6176 __Pyx_GOTREF(__pyx_t_1);
6177 if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_8PyClical_8clifford_1copy)) {
6178 __Pyx_XDECREF(__pyx_r);
6179 __Pyx_INCREF(__pyx_t_1);
6180 __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
6181 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
6182 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
6183 if (likely(__pyx_t_4)) {
6184 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
6185 __Pyx_INCREF(__pyx_t_4);
6186 __Pyx_INCREF(
function);
6187 __Pyx_DECREF_SET(__pyx_t_3,
function);
6191 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 554, __pyx_L1_error)
6192 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6194 __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 554, __pyx_L1_error)
6196 __Pyx_GOTREF(__pyx_t_2);
6197 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6198 __pyx_r = __pyx_t_2;
6200 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6203 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6213 __Pyx_XDECREF(__pyx_r);
6214 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 561, __pyx_L1_error)
6215 __Pyx_GOTREF(__pyx_t_1);
6216 __Pyx_INCREF(((PyObject *)__pyx_v_self));
6217 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
6218 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
6219 __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)
6220 __Pyx_GOTREF(__pyx_t_2);
6221 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6222 __pyx_r = __pyx_t_2;
6236 __Pyx_XDECREF(__pyx_t_1);
6237 __Pyx_XDECREF(__pyx_t_2);
6238 __Pyx_XDECREF(__pyx_t_3);
6239 __Pyx_XDECREF(__pyx_t_4);
6240 __Pyx_AddTraceback(
"PyClical.clifford.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
6243 __Pyx_XGIVEREF(__pyx_r);
6244 __Pyx_RefNannyFinishContext();
6249 static PyObject *__pyx_pw_8PyClical_8clifford_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
6250 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 ";
6251 static PyObject *__pyx_pw_8PyClical_8clifford_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
6252 PyObject *__pyx_r = 0;
6253 __Pyx_RefNannyDeclarations
6254 __Pyx_RefNannySetupContext(
"copy (wrapper)", 0);
6255 __pyx_r = __pyx_pf_8PyClical_8clifford_copy(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
6258 __Pyx_RefNannyFinishContext();
6262 static PyObject *__pyx_pf_8PyClical_8clifford_copy(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
6263 PyObject *__pyx_r = NULL;
6264 __Pyx_RefNannyDeclarations
6265 PyObject *__pyx_t_1 = NULL;
6266 __Pyx_RefNannySetupContext(
"copy", 0);
6267 __Pyx_XDECREF(__pyx_r);
6268 __pyx_t_1 = __pyx_f_8PyClical_8clifford_copy(__pyx_v_self, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 554, __pyx_L1_error)
6269 __Pyx_GOTREF(__pyx_t_1);
6270 __pyx_r = __pyx_t_1;
6276 __Pyx_XDECREF(__pyx_t_1);
6277 __Pyx_AddTraceback(
"PyClical.clifford.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
6280 __Pyx_XGIVEREF(__pyx_r);
6281 __Pyx_RefNannyFinishContext();
6294 static int __pyx_pw_8PyClical_8clifford_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6295 static int __pyx_pw_8PyClical_8clifford_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6296 PyObject *__pyx_v_other = 0;
6297 PyObject *__pyx_v_ixt = 0;
6299 __Pyx_RefNannyDeclarations
6300 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
6302 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_ixt,0};
6303 PyObject* values[2] = {0,0};
6304 values[0] = ((PyObject *)__pyx_int_0);
6305 values[1] = ((PyObject *)Py_None);
6306 if (unlikely(__pyx_kwds)) {
6308 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6310 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6312 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6315 default:
goto __pyx_L5_argtuple_error;
6317 kw_args = PyDict_Size(__pyx_kwds);
6321 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other);
6322 if (value) { values[0] = value; kw_args--; }
6327 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ixt);
6328 if (value) { values[1] = value; kw_args--; }
6331 if (unlikely(kw_args > 0)) {
6332 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(0, 563, __pyx_L3_error)
6335 switch (PyTuple_GET_SIZE(__pyx_args)) {
6336 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6338 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6341 default:
goto __pyx_L5_argtuple_error;
6344 __pyx_v_other = values[0];
6345 __pyx_v_ixt = values[1];
6347 goto __pyx_L4_argument_unpacking_done;
6348 __pyx_L5_argtuple_error:;
6349 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 563, __pyx_L3_error)
6351 __Pyx_AddTraceback(
"PyClical.clifford.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6352 __Pyx_RefNannyFinishContext();
6354 __pyx_L4_argument_unpacking_done:;
6355 __pyx_r = __pyx_pf_8PyClical_8clifford_2__cinit__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), __pyx_v_other, __pyx_v_ixt);
6358 __Pyx_RefNannyFinishContext();
6362 static int __pyx_pf_8PyClical_8clifford_2__cinit__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_ixt) {
6363 PyObject *__pyx_v_error_msg_prefix = NULL;
6364 PyObject *__pyx_v_err = NULL;
6366 __Pyx_RefNannyDeclarations
6369 PyObject *__pyx_t_3 = NULL;
6370 PyObject *__pyx_t_4 = NULL;
6371 PyObject *__pyx_t_5 = NULL;
6373 PyObject *__pyx_t_7 = NULL;
6374 PyObject *__pyx_t_8 = NULL;
6376 PyObject *__pyx_t_10 = NULL;
6377 PyObject *__pyx_t_11 = NULL;
6378 PyObject *__pyx_t_12 = NULL;
6381 PyObject *__pyx_t_15 = NULL;
6382 PyObject *__pyx_t_16 = NULL;
6383 PyObject *__pyx_t_17 = NULL;
6384 PyObject *__pyx_t_18 = NULL;
6385 __Pyx_RefNannySetupContext(
"__cinit__", 0);
6394 __Pyx_INCREF(__pyx_kp_s_Cannot_initialize_clifford_objec);
6395 __pyx_v_error_msg_prefix = __pyx_kp_s_Cannot_initialize_clifford_objec;
6404 __pyx_t_1 = (__pyx_v_ixt == Py_None);
6405 __pyx_t_2 = (__pyx_t_1 != 0);
6416 __Pyx_PyThreadState_declare
6417 __Pyx_PyThreadState_assign
6418 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
6419 __Pyx_XGOTREF(__pyx_t_3);
6420 __Pyx_XGOTREF(__pyx_t_4);
6421 __Pyx_XGOTREF(__pyx_t_5);
6431 __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8PyClical_clifford);
6432 __pyx_t_1 = (__pyx_t_2 != 0);
6443 __pyx_t_6 =
new Clifford(__pyx_f_8PyClical_8clifford_unwrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_other)));
6445 __Pyx_CppExn2PyErr();
6446 __PYX_ERR(0, 592, __pyx_L4_error)
6448 __pyx_v_self->instance = __pyx_t_6;
6467 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8PyClical_index_set);
6468 __pyx_t_2 = (__pyx_t_1 != 0);
6479 __pyx_t_6 =
new Clifford(__pyx_f_8PyClical_9index_set_unwrap(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_other)), ((
scalar_t)1.0));
6481 __Pyx_CppExn2PyErr();
6482 __PYX_ERR(0, 594, __pyx_L4_error)
6484 __pyx_v_self->instance = __pyx_t_6;
6503 __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numbers);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 595, __pyx_L4_error)
6504 __Pyx_GOTREF(__pyx_t_7);
6505 __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)
6506 __Pyx_GOTREF(__pyx_t_8);
6507 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6508 __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)
6509 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6510 __pyx_t_1 = (__pyx_t_2 != 0);
6520 __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)
6524 __Pyx_CppExn2PyErr();
6525 __PYX_ERR(0, 596, __pyx_L4_error)
6527 __pyx_v_self->instance = __pyx_t_6;
6546 __pyx_t_1 = PyString_Check(__pyx_v_other);
6547 __pyx_t_2 = (__pyx_t_1 != 0);
6558 __Pyx_PyThreadState_declare
6559 __Pyx_PyThreadState_assign
6560 __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
6561 __Pyx_XGOTREF(__pyx_t_10);
6562 __Pyx_XGOTREF(__pyx_t_11);
6563 __Pyx_XGOTREF(__pyx_t_12);
6573 __pyx_t_13 = __Pyx_PyObject_AsWritableString(__pyx_v_other);
if (unlikely((!__pyx_t_13) && PyErr_Occurred())) __PYX_ERR(0, 599, __pyx_L11_error)
6575 __pyx_t_6 =
new Clifford(((
char *)__pyx_t_13));
6577 __Pyx_CppExn2PyErr();
6578 __PYX_ERR(0, 599, __pyx_L11_error)
6580 __pyx_v_self->instance = __pyx_t_6;
6590 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
6591 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
6592 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
6593 goto __pyx_L16_try_end;
6595 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6596 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
6605 __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
6607 __Pyx_AddTraceback(
"PyClical.clifford.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6608 if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_15) < 0) __PYX_ERR(0, 600, __pyx_L13_except_error)
6609 __Pyx_GOTREF(__pyx_t_8);
6610 __Pyx_GOTREF(__pyx_t_7);
6611 __Pyx_GOTREF(__pyx_t_15);
6620 __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)
6621 __Pyx_GOTREF(__pyx_t_16);
6622 __pyx_t_17 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 601, __pyx_L13_except_error)
6623 __Pyx_GOTREF(__pyx_t_17);
6624 __pyx_t_18 = PyNumber_Add(__pyx_t_16, __pyx_t_17);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 601, __pyx_L13_except_error)
6625 __Pyx_GOTREF(__pyx_t_18);
6626 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6627 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6628 __pyx_t_17 = PyNumber_Add(__pyx_t_18, __pyx_kp_s_);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 601, __pyx_L13_except_error)
6629 __Pyx_GOTREF(__pyx_t_17);
6630 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6631 __pyx_t_18 = PyTuple_New(1);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 601, __pyx_L13_except_error)
6632 __Pyx_GOTREF(__pyx_t_18);
6633 __Pyx_GIVEREF(__pyx_t_17);
6634 PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_17);
6636 __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)
6637 __Pyx_GOTREF(__pyx_t_17);
6638 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6639 __Pyx_Raise(__pyx_t_17, 0, 0, 0);
6640 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6641 __PYX_ERR(0, 601, __pyx_L13_except_error)
6643 goto __pyx_L13_except_error;
6644 __pyx_L13_except_error:;
6653 __Pyx_XGIVEREF(__pyx_t_10);
6654 __Pyx_XGIVEREF(__pyx_t_11);
6655 __Pyx_XGIVEREF(__pyx_t_12);
6656 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
6657 goto __pyx_L4_error;
6679 __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)
6680 __Pyx_GOTREF(__pyx_t_15);
6681 __pyx_t_7 = PyTuple_New(1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 603, __pyx_L4_error)
6682 __Pyx_GOTREF(__pyx_t_7);
6683 __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_other)));
6684 __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_other)));
6685 PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)Py_TYPE(__pyx_v_other)));
6686 __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)
6687 __Pyx_GOTREF(__pyx_t_8);
6688 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6689 __pyx_t_7 = PyNumber_Add(__pyx_t_15, __pyx_t_8);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 603, __pyx_L4_error)
6690 __Pyx_GOTREF(__pyx_t_7);
6691 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6692 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6693 __pyx_t_8 = PyNumber_Add(__pyx_t_7, __pyx_kp_s_);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 603, __pyx_L4_error)
6694 __Pyx_GOTREF(__pyx_t_8);
6695 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6696 __pyx_t_7 = PyTuple_New(1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 603, __pyx_L4_error)
6697 __Pyx_GOTREF(__pyx_t_7);
6698 __Pyx_GIVEREF(__pyx_t_8);
6699 PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8);
6701 __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)
6702 __Pyx_GOTREF(__pyx_t_8);
6703 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6704 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
6705 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6706 __PYX_ERR(0, 603, __pyx_L4_error)
6718 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6719 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6720 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
6721 goto __pyx_L9_try_end;
6723 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
6724 __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
6725 __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
6726 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
6727 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6728 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
6737 __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
6739 __Pyx_AddTraceback(
"PyClical.clifford.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6740 if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_15) < 0) __PYX_ERR(0, 604, __pyx_L6_except_error)
6741 __Pyx_GOTREF(__pyx_t_8);
6742 __Pyx_GOTREF(__pyx_t_7);
6743 __Pyx_GOTREF(__pyx_t_15);
6744 __Pyx_INCREF(__pyx_t_7);
6745 __pyx_v_err = __pyx_t_7;
6754 __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)
6755 __Pyx_GOTREF(__pyx_t_17);
6756 __pyx_t_18 = PyTuple_New(1);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 605, __pyx_L6_except_error)
6757 __Pyx_GOTREF(__pyx_t_18);
6758 __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_other)));
6759 __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_other)));
6760 PyTuple_SET_ITEM(__pyx_t_18, 0, ((PyObject *)Py_TYPE(__pyx_v_other)));
6761 __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)
6762 __Pyx_GOTREF(__pyx_t_16);
6763 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6764 __pyx_t_18 = PyNumber_Add(__pyx_t_17, __pyx_t_16);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 605, __pyx_L6_except_error)
6765 __Pyx_GOTREF(__pyx_t_18);
6766 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6767 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6776 __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)
6777 __Pyx_GOTREF(__pyx_t_16);
6778 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6779 __pyx_t_18 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 606, __pyx_L6_except_error)
6780 __Pyx_GOTREF(__pyx_t_18);
6781 __pyx_t_17 = PyNumber_Add(__pyx_t_16, __pyx_t_18);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 606, __pyx_L6_except_error)
6782 __Pyx_GOTREF(__pyx_t_17);
6783 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6784 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6785 __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)
6786 __Pyx_GOTREF(__pyx_t_18);
6787 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6796 __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)
6797 __Pyx_GOTREF(__pyx_t_17);
6798 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6799 __pyx_t_18 = PyTuple_New(1);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 607, __pyx_L6_except_error)
6800 __Pyx_GOTREF(__pyx_t_18);
6801 __Pyx_INCREF(__pyx_v_err);
6802 __Pyx_GIVEREF(__pyx_v_err);
6803 PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_v_err);
6804 __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)
6805 __Pyx_GOTREF(__pyx_t_16);
6806 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6807 __pyx_t_18 = PyNumber_Add(__pyx_t_17, __pyx_t_16);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 607, __pyx_L6_except_error)
6808 __Pyx_GOTREF(__pyx_t_18);
6809 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6810 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6819 __pyx_t_16 = PyTuple_New(1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 605, __pyx_L6_except_error)
6820 __Pyx_GOTREF(__pyx_t_16);
6821 __Pyx_GIVEREF(__pyx_t_18);
6822 PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_18);
6824 __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)
6825 __Pyx_GOTREF(__pyx_t_18);
6826 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6827 __Pyx_Raise(__pyx_t_18, 0, 0, 0);
6828 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6829 __PYX_ERR(0, 605, __pyx_L6_except_error)
6831 goto __pyx_L6_except_error;
6832 __pyx_L6_except_error:;
6841 __Pyx_XGIVEREF(__pyx_t_3);
6842 __Pyx_XGIVEREF(__pyx_t_4);
6843 __Pyx_XGIVEREF(__pyx_t_5);
6844 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
6845 goto __pyx_L1_error;
6866 __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_ixt, __pyx_ptype_8PyClical_index_set);
6867 __pyx_t_1 = (__pyx_t_2 != 0);
6877 __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_numbers);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 609, __pyx_L1_error)
6878 __Pyx_GOTREF(__pyx_t_15);
6879 __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)
6880 __Pyx_GOTREF(__pyx_t_7);
6881 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6882 __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)
6883 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6884 __pyx_t_2 = (__pyx_t_1 != 0);
6894 __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)
6896 __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));
6898 __Pyx_CppExn2PyErr();
6899 __PYX_ERR(0, 610, __pyx_L1_error)
6901 __pyx_v_self->instance = __pyx_t_6;
6920 __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_collections);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 611, __pyx_L1_error)
6921 __Pyx_GOTREF(__pyx_t_7);
6922 __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)
6923 __Pyx_GOTREF(__pyx_t_15);
6924 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6925 __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)
6926 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6927 __pyx_t_1 = (__pyx_t_2 != 0);
6938 __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)));
6940 __Pyx_CppExn2PyErr();
6941 __PYX_ERR(0, 612, __pyx_L1_error)
6943 __pyx_v_self->instance = __pyx_t_6;
6963 __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)
6964 __Pyx_GOTREF(__pyx_t_15);
6965 __pyx_t_7 = PyTuple_New(1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 614, __pyx_L1_error)
6966 __Pyx_GOTREF(__pyx_t_7);
6967 __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_other)));
6968 __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_other)));
6969 PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)Py_TYPE(__pyx_v_other)));
6970 __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)
6971 __Pyx_GOTREF(__pyx_t_8);
6972 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6973 __pyx_t_7 = PyNumber_Add(__pyx_t_15, __pyx_t_8);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 614, __pyx_L1_error)
6974 __Pyx_GOTREF(__pyx_t_7);
6975 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6976 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6985 __pyx_t_8 = PyNumber_Add(__pyx_t_7, __pyx_kp_s__8);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 615, __pyx_L1_error)
6986 __Pyx_GOTREF(__pyx_t_8);
6987 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6988 __pyx_t_7 = PyObject_Repr(__pyx_v_ixt);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 615, __pyx_L1_error)
6989 __Pyx_GOTREF(__pyx_t_7);
6990 __pyx_t_15 = PyNumber_Add(__pyx_t_8, __pyx_t_7);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 615, __pyx_L1_error)
6991 __Pyx_GOTREF(__pyx_t_15);
6992 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6993 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6994 __pyx_t_7 = PyNumber_Add(__pyx_t_15, __pyx_kp_s__9);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 615, __pyx_L1_error)
6995 __Pyx_GOTREF(__pyx_t_7);
6996 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7005 __pyx_t_15 = PyTuple_New(1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 614, __pyx_L1_error)
7006 __Pyx_GOTREF(__pyx_t_15);
7007 __Pyx_GIVEREF(__pyx_t_7);
7008 PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_7);
7010 __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)
7011 __Pyx_GOTREF(__pyx_t_7);
7012 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7013 __Pyx_Raise(__pyx_t_7, 0, 0, 0);
7014 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7015 __PYX_ERR(0, 614, __pyx_L1_error)
7037 __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)
7038 __Pyx_GOTREF(__pyx_t_7);
7039 __pyx_t_15 = PyTuple_New(1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 617, __pyx_L1_error)
7040 __Pyx_GOTREF(__pyx_t_15);
7041 __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_other)));
7042 __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_other)));
7043 PyTuple_SET_ITEM(__pyx_t_15, 0, ((PyObject *)Py_TYPE(__pyx_v_other)));
7044 __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)
7045 __Pyx_GOTREF(__pyx_t_8);
7046 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7047 __pyx_t_15 = PyNumber_Add(__pyx_t_7, __pyx_t_8);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 617, __pyx_L1_error)
7048 __Pyx_GOTREF(__pyx_t_15);
7049 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7050 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7059 __pyx_t_8 = PyNumber_Add(__pyx_t_15, __pyx_kp_s__8);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 618, __pyx_L1_error)
7060 __Pyx_GOTREF(__pyx_t_8);
7061 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7062 __pyx_t_15 = PyTuple_New(1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 618, __pyx_L1_error)
7063 __Pyx_GOTREF(__pyx_t_15);
7064 __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_ixt)));
7065 __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_ixt)));
7066 PyTuple_SET_ITEM(__pyx_t_15, 0, ((PyObject *)Py_TYPE(__pyx_v_ixt)));
7067 __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)
7068 __Pyx_GOTREF(__pyx_t_7);
7069 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7070 __pyx_t_15 = PyNumber_Add(__pyx_t_8, __pyx_t_7);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 618, __pyx_L1_error)
7071 __Pyx_GOTREF(__pyx_t_15);
7072 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7073 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7074 __pyx_t_7 = PyNumber_Add(__pyx_t_15, __pyx_kp_s__9);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 618, __pyx_L1_error)
7075 __Pyx_GOTREF(__pyx_t_7);
7076 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7085 __pyx_t_15 = PyTuple_New(1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 617, __pyx_L1_error)
7086 __Pyx_GOTREF(__pyx_t_15);
7087 __Pyx_GIVEREF(__pyx_t_7);
7088 PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_7);
7090 __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)
7091 __Pyx_GOTREF(__pyx_t_7);
7092 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7093 __Pyx_Raise(__pyx_t_7, 0, 0, 0);
7094 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7095 __PYX_ERR(0, 617, __pyx_L1_error)
7111 __Pyx_XDECREF(__pyx_t_7);
7112 __Pyx_XDECREF(__pyx_t_8);
7113 __Pyx_XDECREF(__pyx_t_15);
7114 __Pyx_XDECREF(__pyx_t_16);
7115 __Pyx_XDECREF(__pyx_t_17);
7116 __Pyx_XDECREF(__pyx_t_18);
7117 __Pyx_AddTraceback(
"PyClical.clifford.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7120 __Pyx_XDECREF(__pyx_v_error_msg_prefix);
7121 __Pyx_XDECREF(__pyx_v_err);
7122 __Pyx_RefNannyFinishContext();
7135 static void __pyx_pw_8PyClical_8clifford_5__dealloc__(PyObject *__pyx_v_self);
7136 static void __pyx_pw_8PyClical_8clifford_5__dealloc__(PyObject *__pyx_v_self) {
7137 __Pyx_RefNannyDeclarations
7138 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
7139 __pyx_pf_8PyClical_8clifford_4__dealloc__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
7142 __Pyx_RefNannyFinishContext();
7145 static void __pyx_pf_8PyClical_8clifford_4__dealloc__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
7146 __Pyx_RefNannyDeclarations
7147 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
7156 delete __pyx_v_self->instance;
7167 __Pyx_RefNannyFinishContext();
7179 static int __pyx_pw_8PyClical_8clifford_7__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_x);
7180 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 ";
7181 #if CYTHON_COMPILING_IN_CPYTHON 7182 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_6__contains__;
7184 static int __pyx_pw_8PyClical_8clifford_7__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_x) {
7186 __Pyx_RefNannyDeclarations
7187 __Pyx_RefNannySetupContext(
"__contains__ (wrapper)", 0);
7188 __pyx_r = __pyx_pf_8PyClical_8clifford_6__contains__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_x));
7191 __Pyx_RefNannyFinishContext();
7195 static int __pyx_pf_8PyClical_8clifford_6__contains__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_x) {
7197 __Pyx_RefNannyDeclarations
7198 PyObject *__pyx_t_1 = NULL;
7199 __Pyx_RefNannySetupContext(
"__contains__", 0);
7208 __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)
7209 __Pyx_GOTREF(__pyx_t_1);
7210 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
7211 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7212 __PYX_ERR(0, 635, __pyx_L1_error)
7224 __Pyx_XDECREF(__pyx_t_1);
7225 __Pyx_AddTraceback(
"PyClical.clifford.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7227 __Pyx_RefNannyFinishContext();
7240 static PyObject *__pyx_pw_8PyClical_8clifford_9__iter__(PyObject *__pyx_v_self);
7241 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 ";
7242 #if CYTHON_COMPILING_IN_CPYTHON 7243 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_8__iter__;
7245 static PyObject *__pyx_pw_8PyClical_8clifford_9__iter__(PyObject *__pyx_v_self) {
7246 PyObject *__pyx_r = 0;
7247 __Pyx_RefNannyDeclarations
7248 __Pyx_RefNannySetupContext(
"__iter__ (wrapper)", 0);
7249 __pyx_r = __pyx_pf_8PyClical_8clifford_8__iter__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
7252 __Pyx_RefNannyFinishContext();
7256 static PyObject *__pyx_pf_8PyClical_8clifford_8__iter__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
7257 PyObject *__pyx_r = NULL;
7258 __Pyx_RefNannyDeclarations
7259 PyObject *__pyx_t_1 = NULL;
7260 __Pyx_RefNannySetupContext(
"__iter__", 0);
7269 __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)
7270 __Pyx_GOTREF(__pyx_t_1);
7271 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
7272 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7273 __PYX_ERR(0, 646, __pyx_L1_error)
7285 __Pyx_XDECREF(__pyx_t_1);
7286 __Pyx_AddTraceback(
"PyClical.clifford.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7288 __Pyx_XGIVEREF(__pyx_r);
7289 __Pyx_RefNannyFinishContext();
7302 static PyObject *__pyx_pw_8PyClical_8clifford_11reframe(PyObject *__pyx_v_self, PyObject *__pyx_v_ixt);
7303 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 ";
7304 static PyObject *__pyx_pw_8PyClical_8clifford_11reframe(PyObject *__pyx_v_self, PyObject *__pyx_v_ixt) {
7305 PyObject *__pyx_r = 0;
7306 __Pyx_RefNannyDeclarations
7307 __Pyx_RefNannySetupContext(
"reframe (wrapper)", 0);
7308 __pyx_r = __pyx_pf_8PyClical_8clifford_10reframe(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_ixt));
7311 __Pyx_RefNannyFinishContext();
7315 static PyObject *__pyx_pf_8PyClical_8clifford_10reframe(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_ixt) {
7316 PyObject *__pyx_v_error_msg_prefix = NULL;
7317 struct __pyx_obj_8PyClical_clifford *__pyx_v_result = NULL;
7318 PyObject *__pyx_v_err = NULL;
7319 PyObject *__pyx_r = NULL;
7320 __Pyx_RefNannyDeclarations
7323 PyObject *__pyx_t_3 = NULL;
7324 PyObject *__pyx_t_4 = NULL;
7325 PyObject *__pyx_t_5 = NULL;
7326 PyObject *__pyx_t_6 = NULL;
7329 PyObject *__pyx_t_9 = NULL;
7330 PyObject *__pyx_t_10 = NULL;
7331 PyObject *__pyx_t_11 = NULL;
7332 PyObject *__pyx_t_12 = NULL;
7333 PyObject *__pyx_t_13 = NULL;
7334 __Pyx_RefNannySetupContext(
"reframe", 0);
7343 __Pyx_INCREF(__pyx_kp_s_Cannot_reframe);
7344 __pyx_v_error_msg_prefix = __pyx_kp_s_Cannot_reframe;
7353 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_ixt, __pyx_ptype_8PyClical_index_set);
7354 __pyx_t_2 = (__pyx_t_1 != 0);
7365 __Pyx_PyThreadState_declare
7366 __Pyx_PyThreadState_assign
7367 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
7368 __Pyx_XGOTREF(__pyx_t_3);
7369 __Pyx_XGOTREF(__pyx_t_4);
7370 __Pyx_XGOTREF(__pyx_t_5);
7380 __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)
7381 __Pyx_GOTREF(__pyx_t_6);
7382 __pyx_v_result = ((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_6);
7393 __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)));
7395 __Pyx_CppExn2PyErr();
7396 __PYX_ERR(0, 662, __pyx_L4_error)
7398 __pyx_v_result->instance = __pyx_t_7;
7408 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7409 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7410 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
7411 goto __pyx_L9_try_end;
7413 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
7422 __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
7424 __Pyx_AddTraceback(
"PyClical.clifford.reframe", __pyx_clineno, __pyx_lineno, __pyx_filename);
7425 if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 663, __pyx_L6_except_error)
7426 __Pyx_GOTREF(__pyx_t_6);
7427 __Pyx_GOTREF(__pyx_t_9);
7428 __Pyx_GOTREF(__pyx_t_10);
7429 __Pyx_INCREF(__pyx_t_9);
7430 __pyx_v_err = __pyx_t_9;
7439 __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)
7440 __Pyx_GOTREF(__pyx_t_11);
7441 __pyx_t_12 = PyTuple_New(1);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 664, __pyx_L6_except_error)
7442 __Pyx_GOTREF(__pyx_t_12);
7443 __Pyx_INCREF(((PyObject *)__pyx_v_self));
7444 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
7445 PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)__pyx_v_self));
7446 __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)
7447 __Pyx_GOTREF(__pyx_t_13);
7448 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7449 __pyx_t_12 = PyNumber_Add(__pyx_t_11, __pyx_t_13);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 664, __pyx_L6_except_error)
7450 __Pyx_GOTREF(__pyx_t_12);
7451 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7452 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7453 __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)
7454 __Pyx_GOTREF(__pyx_t_13);
7455 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7464 __pyx_t_12 = PyTuple_New(1);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 665, __pyx_L6_except_error)
7465 __Pyx_GOTREF(__pyx_t_12);
7466 __Pyx_INCREF(__pyx_v_ixt);
7467 __Pyx_GIVEREF(__pyx_v_ixt);
7468 PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_ixt);
7469 __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)
7470 __Pyx_GOTREF(__pyx_t_11);
7471 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7472 __pyx_t_12 = PyNumber_Add(__pyx_t_13, __pyx_t_11);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 665, __pyx_L6_except_error)
7473 __Pyx_GOTREF(__pyx_t_12);
7474 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7475 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7476 __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)
7477 __Pyx_GOTREF(__pyx_t_11);
7478 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7487 __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)
7488 __Pyx_GOTREF(__pyx_t_12);
7489 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7490 __pyx_t_11 = PyTuple_New(1);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 666, __pyx_L6_except_error)
7491 __Pyx_GOTREF(__pyx_t_11);
7492 __Pyx_INCREF(__pyx_v_err);
7493 __Pyx_GIVEREF(__pyx_v_err);
7494 PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_err);
7495 __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)
7496 __Pyx_GOTREF(__pyx_t_13);
7497 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7498 __pyx_t_11 = PyNumber_Add(__pyx_t_12, __pyx_t_13);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 666, __pyx_L6_except_error)
7499 __Pyx_GOTREF(__pyx_t_11);
7500 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7501 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7510 __pyx_t_13 = PyTuple_New(1);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 664, __pyx_L6_except_error)
7511 __Pyx_GOTREF(__pyx_t_13);
7512 __Pyx_GIVEREF(__pyx_t_11);
7513 PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11);
7515 __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)
7516 __Pyx_GOTREF(__pyx_t_11);
7517 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7518 __Pyx_Raise(__pyx_t_11, 0, 0, 0);
7519 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7520 __PYX_ERR(0, 664, __pyx_L6_except_error)
7522 goto __pyx_L6_except_error;
7523 __pyx_L6_except_error:;
7532 __Pyx_XGIVEREF(__pyx_t_3);
7533 __Pyx_XGIVEREF(__pyx_t_4);
7534 __Pyx_XGIVEREF(__pyx_t_5);
7535 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
7536 goto __pyx_L1_error;
7558 __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)
7559 __Pyx_GOTREF(__pyx_t_10);
7560 __pyx_t_9 = PyTuple_New(1);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 668, __pyx_L1_error)
7561 __Pyx_GOTREF(__pyx_t_9);
7562 __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_ixt)));
7563 __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_ixt)));
7564 PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)Py_TYPE(__pyx_v_ixt)));
7565 __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)
7566 __Pyx_GOTREF(__pyx_t_6);
7567 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7568 __pyx_t_9 = PyNumber_Add(__pyx_t_10, __pyx_t_6);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 668, __pyx_L1_error)
7569 __Pyx_GOTREF(__pyx_t_9);
7570 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7571 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7572 __pyx_t_6 = PyNumber_Add(__pyx_t_9, __pyx_kp_s__9);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 668, __pyx_L1_error)
7573 __Pyx_GOTREF(__pyx_t_6);
7574 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7575 __pyx_t_9 = PyTuple_New(1);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 668, __pyx_L1_error)
7576 __Pyx_GOTREF(__pyx_t_9);
7577 __Pyx_GIVEREF(__pyx_t_6);
7578 PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6);
7580 __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)
7581 __Pyx_GOTREF(__pyx_t_6);
7582 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7583 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
7584 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7585 __PYX_ERR(0, 668, __pyx_L1_error)
7596 __Pyx_XDECREF(__pyx_r);
7597 __Pyx_INCREF(((PyObject *)__pyx_v_result));
7598 __pyx_r = ((PyObject *)__pyx_v_result);
7611 __Pyx_XDECREF(__pyx_t_6);
7612 __Pyx_XDECREF(__pyx_t_9);
7613 __Pyx_XDECREF(__pyx_t_10);
7614 __Pyx_XDECREF(__pyx_t_11);
7615 __Pyx_XDECREF(__pyx_t_12);
7616 __Pyx_XDECREF(__pyx_t_13);
7617 __Pyx_AddTraceback(
"PyClical.clifford.reframe", __pyx_clineno, __pyx_lineno, __pyx_filename);
7620 __Pyx_XDECREF(__pyx_v_error_msg_prefix);
7621 __Pyx_XDECREF((PyObject *)__pyx_v_result);
7622 __Pyx_XDECREF(__pyx_v_err);
7623 __Pyx_XGIVEREF(__pyx_r);
7624 __Pyx_RefNannyFinishContext();
7637 static PyObject *__pyx_pw_8PyClical_8clifford_13__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op);
7638 static PyObject *__pyx_pw_8PyClical_8clifford_13__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op) {
7639 PyObject *__pyx_r = 0;
7640 __Pyx_RefNannyDeclarations
7641 __Pyx_RefNannySetupContext(
"__richcmp__ (wrapper)", 0);
7642 __pyx_r = __pyx_pf_8PyClical_8clifford_12__richcmp__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs), ((
int)__pyx_v_op));
7645 __Pyx_RefNannyFinishContext();
7649 static PyObject *__pyx_pf_8PyClical_8clifford_12__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op) {
7650 PyObject *__pyx_r = NULL;
7651 __Pyx_RefNannyDeclarations
7655 PyObject *__pyx_t_4 = NULL;
7656 PyObject *__pyx_t_5 = NULL;
7657 PyObject *__pyx_t_6 = NULL;
7658 __Pyx_RefNannySetupContext(
"__richcmp__", 0);
7667 __pyx_t_1 = ((__pyx_v_op == 2) != 0);
7677 __pyx_t_2 = (__pyx_v_lhs == Py_None);
7678 __pyx_t_3 = (__pyx_t_2 != 0);
7681 __pyx_t_1 = __pyx_t_3;
7682 goto __pyx_L5_bool_binop_done;
7684 __pyx_t_3 = (__pyx_v_rhs == Py_None);
7685 __pyx_t_2 = (__pyx_t_3 != 0);
7686 __pyx_t_1 = __pyx_t_2;
7687 __pyx_L5_bool_binop_done:;
7697 __Pyx_XDECREF(__pyx_r);
7698 __pyx_t_1 = (__pyx_v_lhs == __pyx_v_rhs);
7699 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error)
7700 __Pyx_GOTREF(__pyx_t_4);
7701 __pyx_r = __pyx_t_4;
7722 __Pyx_XDECREF(__pyx_r);
7723 __pyx_t_1 = (__pyx_f_8PyClical_toClifford(__pyx_v_lhs) == __pyx_f_8PyClical_toClifford(__pyx_v_rhs));
7724 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 694, __pyx_L1_error)
7725 __Pyx_GOTREF(__pyx_t_4);
7726 __pyx_r = __pyx_t_4;
7747 __pyx_t_1 = ((__pyx_v_op == 3) != 0);
7757 __pyx_t_2 = (__pyx_v_lhs == Py_None);
7758 __pyx_t_3 = (__pyx_t_2 != 0);
7761 __pyx_t_1 = __pyx_t_3;
7762 goto __pyx_L8_bool_binop_done;
7764 __pyx_t_3 = (__pyx_v_rhs == Py_None);
7765 __pyx_t_2 = (__pyx_t_3 != 0);
7766 __pyx_t_1 = __pyx_t_2;
7767 __pyx_L8_bool_binop_done:;
7777 __Pyx_XDECREF(__pyx_r);
7778 __pyx_t_1 = (__pyx_v_lhs == __pyx_v_rhs);
7779 __pyx_t_4 = __Pyx_PyBool_FromLong((!((!(!__pyx_t_1)) != 0)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 697, __pyx_L1_error)
7780 __Pyx_GOTREF(__pyx_t_4);
7781 __pyx_r = __pyx_t_4;
7802 __Pyx_XDECREF(__pyx_r);
7803 __pyx_t_1 = (__pyx_f_8PyClical_toClifford(__pyx_v_lhs) != __pyx_f_8PyClical_toClifford(__pyx_v_rhs));
7804 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 699, __pyx_L1_error)
7805 __Pyx_GOTREF(__pyx_t_4);
7806 __pyx_r = __pyx_t_4;
7827 __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_lhs, __pyx_ptype_8PyClical_clifford);
7828 __pyx_t_3 = (__pyx_t_2 != 0);
7831 __pyx_t_1 = __pyx_t_3;
7832 goto __pyx_L10_bool_binop_done;
7834 __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_rhs, __pyx_ptype_8PyClical_clifford);
7835 __pyx_t_2 = (__pyx_t_3 != 0);
7836 __pyx_t_1 = __pyx_t_2;
7837 __pyx_L10_bool_binop_done:;
7847 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 702, __pyx_L1_error)
7848 __Pyx_GOTREF(__pyx_t_4);
7849 __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_lhs)));
7850 __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_lhs)));
7851 PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)Py_TYPE(__pyx_v_lhs)));
7852 __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)
7853 __Pyx_GOTREF(__pyx_t_5);
7854 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7855 __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)
7856 __Pyx_GOTREF(__pyx_t_4);
7857 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7858 __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_kp_s__8);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 702, __pyx_L1_error)
7859 __Pyx_GOTREF(__pyx_t_5);
7860 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7861 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 702, __pyx_L1_error)
7862 __Pyx_GOTREF(__pyx_t_4);
7863 __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_rhs)));
7864 __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_rhs)));
7865 PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)Py_TYPE(__pyx_v_rhs)));
7866 __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)
7867 __Pyx_GOTREF(__pyx_t_6);
7868 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7869 __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_t_6);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 702, __pyx_L1_error)
7870 __Pyx_GOTREF(__pyx_t_4);
7871 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7872 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7873 __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_kp_s_);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 702, __pyx_L1_error)
7874 __Pyx_GOTREF(__pyx_t_6);
7875 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7884 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 701, __pyx_L1_error)
7885 __Pyx_GOTREF(__pyx_t_4);
7886 __Pyx_GIVEREF(__pyx_t_6);
7887 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
7889 __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)
7890 __Pyx_GOTREF(__pyx_t_6);
7891 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7892 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
7893 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7894 __PYX_ERR(0, 701, __pyx_L1_error)
7913 __Pyx_XDECREF(__pyx_r);
7914 __Pyx_INCREF(__pyx_builtin_NotImplemented);
7915 __pyx_r = __pyx_builtin_NotImplemented;
7929 __Pyx_XDECREF(__pyx_t_4);
7930 __Pyx_XDECREF(__pyx_t_5);
7931 __Pyx_XDECREF(__pyx_t_6);
7932 __Pyx_AddTraceback(
"PyClical.clifford.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7935 __Pyx_XGIVEREF(__pyx_r);
7936 __Pyx_RefNannyFinishContext();
7949 static PyObject *__pyx_pw_8PyClical_8clifford_15__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ixt);
7950 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 ";
7951 #if CYTHON_COMPILING_IN_CPYTHON 7952 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_14__getitem__;
7954 static PyObject *__pyx_pw_8PyClical_8clifford_15__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ixt) {
7955 PyObject *__pyx_r = 0;
7956 __Pyx_RefNannyDeclarations
7957 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
7958 __pyx_r = __pyx_pf_8PyClical_8clifford_14__getitem__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_ixt));
7961 __Pyx_RefNannyFinishContext();
7965 static PyObject *__pyx_pf_8PyClical_8clifford_14__getitem__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_ixt) {
7966 PyObject *__pyx_r = NULL;
7967 __Pyx_RefNannyDeclarations
7968 PyObject *__pyx_t_1 = NULL;
7969 __Pyx_RefNannySetupContext(
"__getitem__", 0);
7978 __Pyx_XDECREF(__pyx_r);
7979 __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)
7980 __Pyx_GOTREF(__pyx_t_1);
7981 __pyx_r = __pyx_t_1;
7995 __Pyx_XDECREF(__pyx_t_1);
7996 __Pyx_AddTraceback(
"PyClical.clifford.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7999 __Pyx_XGIVEREF(__pyx_r);
8000 __Pyx_RefNannyFinishContext();
8013 static PyObject *__pyx_pw_8PyClical_8clifford_17__neg__(PyObject *__pyx_v_self);
8014 static char __pyx_doc_8PyClical_8clifford_16__neg__[] =
"\n Unary -.\n\n >>> print -clifford(\"{1}\")\n -{1}\n ";
8015 #if CYTHON_COMPILING_IN_CPYTHON 8016 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_16__neg__;
8018 static PyObject *__pyx_pw_8PyClical_8clifford_17__neg__(PyObject *__pyx_v_self) {
8019 PyObject *__pyx_r = 0;
8020 __Pyx_RefNannyDeclarations
8021 __Pyx_RefNannySetupContext(
"__neg__ (wrapper)", 0);
8022 __pyx_r = __pyx_pf_8PyClical_8clifford_16__neg__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
8025 __Pyx_RefNannyFinishContext();
8029 static PyObject *__pyx_pf_8PyClical_8clifford_16__neg__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
8030 PyObject *__pyx_r = NULL;
8031 __Pyx_RefNannyDeclarations
8032 PyObject *__pyx_t_1 = NULL;
8033 PyObject *__pyx_t_2 = NULL;
8034 __Pyx_RefNannySetupContext(
"__neg__", 0);
8043 __Pyx_XDECREF(__pyx_r);
8044 __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)
8045 __Pyx_GOTREF(__pyx_t_1);
8046 __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)
8047 __Pyx_GOTREF(__pyx_t_2);
8048 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8049 __pyx_r = __pyx_t_2;
8063 __Pyx_XDECREF(__pyx_t_1);
8064 __Pyx_XDECREF(__pyx_t_2);
8065 __Pyx_AddTraceback(
"PyClical.clifford.__neg__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8068 __Pyx_XGIVEREF(__pyx_r);
8069 __Pyx_RefNannyFinishContext();
8082 static PyObject *__pyx_pw_8PyClical_8clifford_19__pos__(PyObject *__pyx_v_self);
8083 static char __pyx_doc_8PyClical_8clifford_18__pos__[] =
"\n Unary +.\n\n >>> print +clifford(\"{1}\")\n {1}\n ";
8084 #if CYTHON_COMPILING_IN_CPYTHON 8085 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_18__pos__;
8087 static PyObject *__pyx_pw_8PyClical_8clifford_19__pos__(PyObject *__pyx_v_self) {
8088 PyObject *__pyx_r = 0;
8089 __Pyx_RefNannyDeclarations
8090 __Pyx_RefNannySetupContext(
"__pos__ (wrapper)", 0);
8091 __pyx_r = __pyx_pf_8PyClical_8clifford_18__pos__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
8094 __Pyx_RefNannyFinishContext();
8098 static PyObject *__pyx_pf_8PyClical_8clifford_18__pos__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
8099 PyObject *__pyx_r = NULL;
8100 __Pyx_RefNannyDeclarations
8101 PyObject *__pyx_t_1 = NULL;
8102 PyObject *__pyx_t_2 = NULL;
8103 __Pyx_RefNannySetupContext(
"__pos__", 0);
8112 __Pyx_XDECREF(__pyx_r);
8113 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 737, __pyx_L1_error)
8114 __Pyx_GOTREF(__pyx_t_1);
8115 __Pyx_INCREF(((PyObject *)__pyx_v_self));
8116 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
8117 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
8118 __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)
8119 __Pyx_GOTREF(__pyx_t_2);
8120 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8121 __pyx_r = __pyx_t_2;
8135 __Pyx_XDECREF(__pyx_t_1);
8136 __Pyx_XDECREF(__pyx_t_2);
8137 __Pyx_AddTraceback(
"PyClical.clifford.__pos__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8140 __Pyx_XGIVEREF(__pyx_r);
8141 __Pyx_RefNannyFinishContext();
8154 static PyObject *__pyx_pw_8PyClical_8clifford_21__add__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8155 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 ";
8156 #if CYTHON_COMPILING_IN_CPYTHON 8157 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_20__add__;
8159 static PyObject *__pyx_pw_8PyClical_8clifford_21__add__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8160 PyObject *__pyx_r = 0;
8161 __Pyx_RefNannyDeclarations
8162 __Pyx_RefNannySetupContext(
"__add__ (wrapper)", 0);
8163 __pyx_r = __pyx_pf_8PyClical_8clifford_20__add__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8166 __Pyx_RefNannyFinishContext();
8170 static PyObject *__pyx_pf_8PyClical_8clifford_20__add__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8171 PyObject *__pyx_r = NULL;
8172 __Pyx_RefNannyDeclarations
8173 PyObject *__pyx_t_1 = NULL;
8174 PyObject *__pyx_t_2 = NULL;
8175 __Pyx_RefNannySetupContext(
"__add__", 0);
8184 __Pyx_XDECREF(__pyx_r);
8185 __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)
8186 __Pyx_GOTREF(__pyx_t_1);
8187 __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)
8188 __Pyx_GOTREF(__pyx_t_2);
8189 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8190 __pyx_r = __pyx_t_2;
8204 __Pyx_XDECREF(__pyx_t_1);
8205 __Pyx_XDECREF(__pyx_t_2);
8206 __Pyx_AddTraceback(
"PyClical.clifford.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8209 __Pyx_XGIVEREF(__pyx_r);
8210 __Pyx_RefNannyFinishContext();
8223 static PyObject *__pyx_pw_8PyClical_8clifford_23__iadd__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8224 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 ";
8225 #if CYTHON_COMPILING_IN_CPYTHON 8226 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_22__iadd__;
8228 static PyObject *__pyx_pw_8PyClical_8clifford_23__iadd__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8229 PyObject *__pyx_r = 0;
8230 __Pyx_RefNannyDeclarations
8231 __Pyx_RefNannySetupContext(
"__iadd__ (wrapper)", 0);
8232 __pyx_r = __pyx_pf_8PyClical_8clifford_22__iadd__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8235 __Pyx_RefNannyFinishContext();
8239 static PyObject *__pyx_pf_8PyClical_8clifford_22__iadd__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8240 PyObject *__pyx_r = NULL;
8241 __Pyx_RefNannyDeclarations
8242 PyObject *__pyx_t_1 = NULL;
8243 __Pyx_RefNannySetupContext(
"__iadd__", 0);
8252 __Pyx_XDECREF(__pyx_r);
8253 __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)
8254 __Pyx_GOTREF(__pyx_t_1);
8255 __pyx_r = __pyx_t_1;
8269 __Pyx_XDECREF(__pyx_t_1);
8270 __Pyx_AddTraceback(
"PyClical.clifford.__iadd__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8273 __Pyx_XGIVEREF(__pyx_r);
8274 __Pyx_RefNannyFinishContext();
8287 static PyObject *__pyx_pw_8PyClical_8clifford_25__sub__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8288 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 ";
8289 #if CYTHON_COMPILING_IN_CPYTHON 8290 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_24__sub__;
8292 static PyObject *__pyx_pw_8PyClical_8clifford_25__sub__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8293 PyObject *__pyx_r = 0;
8294 __Pyx_RefNannyDeclarations
8295 __Pyx_RefNannySetupContext(
"__sub__ (wrapper)", 0);
8296 __pyx_r = __pyx_pf_8PyClical_8clifford_24__sub__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8299 __Pyx_RefNannyFinishContext();
8303 static PyObject *__pyx_pf_8PyClical_8clifford_24__sub__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8304 PyObject *__pyx_r = NULL;
8305 __Pyx_RefNannyDeclarations
8306 PyObject *__pyx_t_1 = NULL;
8307 PyObject *__pyx_t_2 = NULL;
8308 __Pyx_RefNannySetupContext(
"__sub__", 0);
8317 __Pyx_XDECREF(__pyx_r);
8318 __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)
8319 __Pyx_GOTREF(__pyx_t_1);
8320 __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)
8321 __Pyx_GOTREF(__pyx_t_2);
8322 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8323 __pyx_r = __pyx_t_2;
8337 __Pyx_XDECREF(__pyx_t_1);
8338 __Pyx_XDECREF(__pyx_t_2);
8339 __Pyx_AddTraceback(
"PyClical.clifford.__sub__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8342 __Pyx_XGIVEREF(__pyx_r);
8343 __Pyx_RefNannyFinishContext();
8356 static PyObject *__pyx_pw_8PyClical_8clifford_27__isub__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8357 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 ";
8358 #if CYTHON_COMPILING_IN_CPYTHON 8359 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_26__isub__;
8361 static PyObject *__pyx_pw_8PyClical_8clifford_27__isub__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8362 PyObject *__pyx_r = 0;
8363 __Pyx_RefNannyDeclarations
8364 __Pyx_RefNannySetupContext(
"__isub__ (wrapper)", 0);
8365 __pyx_r = __pyx_pf_8PyClical_8clifford_26__isub__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8368 __Pyx_RefNannyFinishContext();
8372 static PyObject *__pyx_pf_8PyClical_8clifford_26__isub__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8373 PyObject *__pyx_r = NULL;
8374 __Pyx_RefNannyDeclarations
8375 PyObject *__pyx_t_1 = NULL;
8376 __Pyx_RefNannySetupContext(
"__isub__", 0);
8385 __Pyx_XDECREF(__pyx_r);
8386 __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)
8387 __Pyx_GOTREF(__pyx_t_1);
8388 __pyx_r = __pyx_t_1;
8402 __Pyx_XDECREF(__pyx_t_1);
8403 __Pyx_AddTraceback(
"PyClical.clifford.__isub__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8406 __Pyx_XGIVEREF(__pyx_r);
8407 __Pyx_RefNannyFinishContext();
8420 static PyObject *__pyx_pw_8PyClical_8clifford_29__mul__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8421 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 ";
8422 #if CYTHON_COMPILING_IN_CPYTHON 8423 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_28__mul__;
8425 static PyObject *__pyx_pw_8PyClical_8clifford_29__mul__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8426 PyObject *__pyx_r = 0;
8427 __Pyx_RefNannyDeclarations
8428 __Pyx_RefNannySetupContext(
"__mul__ (wrapper)", 0);
8429 __pyx_r = __pyx_pf_8PyClical_8clifford_28__mul__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8432 __Pyx_RefNannyFinishContext();
8436 static PyObject *__pyx_pf_8PyClical_8clifford_28__mul__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8437 PyObject *__pyx_r = NULL;
8438 __Pyx_RefNannyDeclarations
8439 PyObject *__pyx_t_1 = NULL;
8440 PyObject *__pyx_t_2 = NULL;
8441 __Pyx_RefNannySetupContext(
"__mul__", 0);
8450 __Pyx_XDECREF(__pyx_r);
8451 __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)
8452 __Pyx_GOTREF(__pyx_t_1);
8453 __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)
8454 __Pyx_GOTREF(__pyx_t_2);
8455 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8456 __pyx_r = __pyx_t_2;
8470 __Pyx_XDECREF(__pyx_t_1);
8471 __Pyx_XDECREF(__pyx_t_2);
8472 __Pyx_AddTraceback(
"PyClical.clifford.__mul__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8475 __Pyx_XGIVEREF(__pyx_r);
8476 __Pyx_RefNannyFinishContext();
8489 static PyObject *__pyx_pw_8PyClical_8clifford_31__imul__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8490 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 ";
8491 #if CYTHON_COMPILING_IN_CPYTHON 8492 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_30__imul__;
8494 static PyObject *__pyx_pw_8PyClical_8clifford_31__imul__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8495 PyObject *__pyx_r = 0;
8496 __Pyx_RefNannyDeclarations
8497 __Pyx_RefNannySetupContext(
"__imul__ (wrapper)", 0);
8498 __pyx_r = __pyx_pf_8PyClical_8clifford_30__imul__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8501 __Pyx_RefNannyFinishContext();
8505 static PyObject *__pyx_pf_8PyClical_8clifford_30__imul__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8506 PyObject *__pyx_r = NULL;
8507 __Pyx_RefNannyDeclarations
8508 PyObject *__pyx_t_1 = NULL;
8509 __Pyx_RefNannySetupContext(
"__imul__", 0);
8518 __Pyx_XDECREF(__pyx_r);
8519 __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)
8520 __Pyx_GOTREF(__pyx_t_1);
8521 __pyx_r = __pyx_t_1;
8535 __Pyx_XDECREF(__pyx_t_1);
8536 __Pyx_AddTraceback(
"PyClical.clifford.__imul__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8539 __Pyx_XGIVEREF(__pyx_r);
8540 __Pyx_RefNannyFinishContext();
8553 static PyObject *__pyx_pw_8PyClical_8clifford_33__mod__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8554 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 ";
8555 #if CYTHON_COMPILING_IN_CPYTHON 8556 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_32__mod__;
8558 static PyObject *__pyx_pw_8PyClical_8clifford_33__mod__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8559 PyObject *__pyx_r = 0;
8560 __Pyx_RefNannyDeclarations
8561 __Pyx_RefNannySetupContext(
"__mod__ (wrapper)", 0);
8562 __pyx_r = __pyx_pf_8PyClical_8clifford_32__mod__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8565 __Pyx_RefNannyFinishContext();
8569 static PyObject *__pyx_pf_8PyClical_8clifford_32__mod__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8570 PyObject *__pyx_r = NULL;
8571 __Pyx_RefNannyDeclarations
8572 PyObject *__pyx_t_1 = NULL;
8573 PyObject *__pyx_t_2 = NULL;
8574 __Pyx_RefNannySetupContext(
"__mod__", 0);
8583 __Pyx_XDECREF(__pyx_r);
8584 __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)
8585 __Pyx_GOTREF(__pyx_t_1);
8586 __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)
8587 __Pyx_GOTREF(__pyx_t_2);
8588 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8589 __pyx_r = __pyx_t_2;
8603 __Pyx_XDECREF(__pyx_t_1);
8604 __Pyx_XDECREF(__pyx_t_2);
8605 __Pyx_AddTraceback(
"PyClical.clifford.__mod__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8608 __Pyx_XGIVEREF(__pyx_r);
8609 __Pyx_RefNannyFinishContext();
8622 static PyObject *__pyx_pw_8PyClical_8clifford_35__imod__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8623 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 ";
8624 #if CYTHON_COMPILING_IN_CPYTHON 8625 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_34__imod__;
8627 static PyObject *__pyx_pw_8PyClical_8clifford_35__imod__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8628 PyObject *__pyx_r = 0;
8629 __Pyx_RefNannyDeclarations
8630 __Pyx_RefNannySetupContext(
"__imod__ (wrapper)", 0);
8631 __pyx_r = __pyx_pf_8PyClical_8clifford_34__imod__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8634 __Pyx_RefNannyFinishContext();
8638 static PyObject *__pyx_pf_8PyClical_8clifford_34__imod__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8639 PyObject *__pyx_r = NULL;
8640 __Pyx_RefNannyDeclarations
8641 PyObject *__pyx_t_1 = NULL;
8642 __Pyx_RefNannySetupContext(
"__imod__", 0);
8651 __Pyx_XDECREF(__pyx_r);
8652 __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)
8653 __Pyx_GOTREF(__pyx_t_1);
8654 __pyx_r = __pyx_t_1;
8668 __Pyx_XDECREF(__pyx_t_1);
8669 __Pyx_AddTraceback(
"PyClical.clifford.__imod__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8672 __Pyx_XGIVEREF(__pyx_r);
8673 __Pyx_RefNannyFinishContext();
8686 static PyObject *__pyx_pw_8PyClical_8clifford_37__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8687 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 ";
8688 #if CYTHON_COMPILING_IN_CPYTHON 8689 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_36__and__;
8691 static PyObject *__pyx_pw_8PyClical_8clifford_37__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8692 PyObject *__pyx_r = 0;
8693 __Pyx_RefNannyDeclarations
8694 __Pyx_RefNannySetupContext(
"__and__ (wrapper)", 0);
8695 __pyx_r = __pyx_pf_8PyClical_8clifford_36__and__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8698 __Pyx_RefNannyFinishContext();
8702 static PyObject *__pyx_pf_8PyClical_8clifford_36__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8703 PyObject *__pyx_r = NULL;
8704 __Pyx_RefNannyDeclarations
8705 PyObject *__pyx_t_1 = NULL;
8706 PyObject *__pyx_t_2 = NULL;
8707 __Pyx_RefNannySetupContext(
"__and__", 0);
8716 __Pyx_XDECREF(__pyx_r);
8717 __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)
8718 __Pyx_GOTREF(__pyx_t_1);
8719 __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)
8720 __Pyx_GOTREF(__pyx_t_2);
8721 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8722 __pyx_r = __pyx_t_2;
8736 __Pyx_XDECREF(__pyx_t_1);
8737 __Pyx_XDECREF(__pyx_t_2);
8738 __Pyx_AddTraceback(
"PyClical.clifford.__and__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8741 __Pyx_XGIVEREF(__pyx_r);
8742 __Pyx_RefNannyFinishContext();
8755 static PyObject *__pyx_pw_8PyClical_8clifford_39__iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8756 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 ";
8757 #if CYTHON_COMPILING_IN_CPYTHON 8758 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_38__iand__;
8760 static PyObject *__pyx_pw_8PyClical_8clifford_39__iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8761 PyObject *__pyx_r = 0;
8762 __Pyx_RefNannyDeclarations
8763 __Pyx_RefNannySetupContext(
"__iand__ (wrapper)", 0);
8764 __pyx_r = __pyx_pf_8PyClical_8clifford_38__iand__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8767 __Pyx_RefNannyFinishContext();
8771 static PyObject *__pyx_pf_8PyClical_8clifford_38__iand__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8772 PyObject *__pyx_r = NULL;
8773 __Pyx_RefNannyDeclarations
8774 PyObject *__pyx_t_1 = NULL;
8775 __Pyx_RefNannySetupContext(
"__iand__", 0);
8784 __Pyx_XDECREF(__pyx_r);
8785 __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)
8786 __Pyx_GOTREF(__pyx_t_1);
8787 __pyx_r = __pyx_t_1;
8801 __Pyx_XDECREF(__pyx_t_1);
8802 __Pyx_AddTraceback(
"PyClical.clifford.__iand__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8805 __Pyx_XGIVEREF(__pyx_r);
8806 __Pyx_RefNannyFinishContext();
8819 static PyObject *__pyx_pw_8PyClical_8clifford_41__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8820 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 ";
8821 #if CYTHON_COMPILING_IN_CPYTHON 8822 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_40__xor__;
8824 static PyObject *__pyx_pw_8PyClical_8clifford_41__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8825 PyObject *__pyx_r = 0;
8826 __Pyx_RefNannyDeclarations
8827 __Pyx_RefNannySetupContext(
"__xor__ (wrapper)", 0);
8828 __pyx_r = __pyx_pf_8PyClical_8clifford_40__xor__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8831 __Pyx_RefNannyFinishContext();
8835 static PyObject *__pyx_pf_8PyClical_8clifford_40__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8836 PyObject *__pyx_r = NULL;
8837 __Pyx_RefNannyDeclarations
8838 PyObject *__pyx_t_1 = NULL;
8839 PyObject *__pyx_t_2 = NULL;
8840 __Pyx_RefNannySetupContext(
"__xor__", 0);
8849 __Pyx_XDECREF(__pyx_r);
8850 __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)
8851 __Pyx_GOTREF(__pyx_t_1);
8852 __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)
8853 __Pyx_GOTREF(__pyx_t_2);
8854 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8855 __pyx_r = __pyx_t_2;
8869 __Pyx_XDECREF(__pyx_t_1);
8870 __Pyx_XDECREF(__pyx_t_2);
8871 __Pyx_AddTraceback(
"PyClical.clifford.__xor__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8874 __Pyx_XGIVEREF(__pyx_r);
8875 __Pyx_RefNannyFinishContext();
8888 static PyObject *__pyx_pw_8PyClical_8clifford_43__ixor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8889 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 ";
8890 #if CYTHON_COMPILING_IN_CPYTHON 8891 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_42__ixor__;
8893 static PyObject *__pyx_pw_8PyClical_8clifford_43__ixor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8894 PyObject *__pyx_r = 0;
8895 __Pyx_RefNannyDeclarations
8896 __Pyx_RefNannySetupContext(
"__ixor__ (wrapper)", 0);
8897 __pyx_r = __pyx_pf_8PyClical_8clifford_42__ixor__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8900 __Pyx_RefNannyFinishContext();
8904 static PyObject *__pyx_pf_8PyClical_8clifford_42__ixor__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8905 PyObject *__pyx_r = NULL;
8906 __Pyx_RefNannyDeclarations
8907 PyObject *__pyx_t_1 = NULL;
8908 __Pyx_RefNannySetupContext(
"__ixor__", 0);
8917 __Pyx_XDECREF(__pyx_r);
8918 __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)
8919 __Pyx_GOTREF(__pyx_t_1);
8920 __pyx_r = __pyx_t_1;
8934 __Pyx_XDECREF(__pyx_t_1);
8935 __Pyx_AddTraceback(
"PyClical.clifford.__ixor__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8938 __Pyx_XGIVEREF(__pyx_r);
8939 __Pyx_RefNannyFinishContext();
8952 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 8953 static PyObject *__pyx_pw_8PyClical_8clifford_45__div__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8954 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 ";
8955 #if CYTHON_COMPILING_IN_CPYTHON 8956 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_44__div__;
8958 static PyObject *__pyx_pw_8PyClical_8clifford_45__div__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8959 PyObject *__pyx_r = 0;
8960 __Pyx_RefNannyDeclarations
8961 __Pyx_RefNannySetupContext(
"__div__ (wrapper)", 0);
8962 __pyx_r = __pyx_pf_8PyClical_8clifford_44__div__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8965 __Pyx_RefNannyFinishContext();
8970 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 8971 static PyObject *__pyx_pf_8PyClical_8clifford_44__div__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8972 PyObject *__pyx_r = NULL;
8973 __Pyx_RefNannyDeclarations
8974 PyObject *__pyx_t_1 = NULL;
8975 PyObject *__pyx_t_2 = NULL;
8976 __Pyx_RefNannySetupContext(
"__div__", 0);
8985 __Pyx_XDECREF(__pyx_r);
8986 __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)
8987 __Pyx_GOTREF(__pyx_t_1);
8988 __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)
8989 __Pyx_GOTREF(__pyx_t_2);
8990 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8991 __pyx_r = __pyx_t_2;
9005 __Pyx_XDECREF(__pyx_t_1);
9006 __Pyx_XDECREF(__pyx_t_2);
9007 __Pyx_AddTraceback(
"PyClical.clifford.__div__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9010 __Pyx_XGIVEREF(__pyx_r);
9011 __Pyx_RefNannyFinishContext();
9025 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 9026 static PyObject *__pyx_pw_8PyClical_8clifford_47__idiv__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
9027 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 ";
9028 #if CYTHON_COMPILING_IN_CPYTHON 9029 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_46__idiv__;
9031 static PyObject *__pyx_pw_8PyClical_8clifford_47__idiv__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
9032 PyObject *__pyx_r = 0;
9033 __Pyx_RefNannyDeclarations
9034 __Pyx_RefNannySetupContext(
"__idiv__ (wrapper)", 0);
9035 __pyx_r = __pyx_pf_8PyClical_8clifford_46__idiv__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
9038 __Pyx_RefNannyFinishContext();
9043 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 9044 static PyObject *__pyx_pf_8PyClical_8clifford_46__idiv__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
9045 PyObject *__pyx_r = NULL;
9046 __Pyx_RefNannyDeclarations
9047 PyObject *__pyx_t_1 = NULL;
9048 __Pyx_RefNannySetupContext(
"__idiv__", 0);
9057 __Pyx_XDECREF(__pyx_r);
9058 __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)
9059 __Pyx_GOTREF(__pyx_t_1);
9060 __pyx_r = __pyx_t_1;
9074 __Pyx_XDECREF(__pyx_t_1);
9075 __Pyx_AddTraceback(
"PyClical.clifford.__idiv__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9078 __Pyx_XGIVEREF(__pyx_r);
9079 __Pyx_RefNannyFinishContext();
9093 static PyObject *__pyx_pw_8PyClical_8clifford_49inv(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9094 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 ";
9095 static PyObject *__pyx_pw_8PyClical_8clifford_49inv(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9096 PyObject *__pyx_r = 0;
9097 __Pyx_RefNannyDeclarations
9098 __Pyx_RefNannySetupContext(
"inv (wrapper)", 0);
9099 __pyx_r = __pyx_pf_8PyClical_8clifford_48inv(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
9102 __Pyx_RefNannyFinishContext();
9106 static PyObject *__pyx_pf_8PyClical_8clifford_48inv(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
9107 PyObject *__pyx_r = NULL;
9108 __Pyx_RefNannyDeclarations
9109 PyObject *__pyx_t_1 = NULL;
9110 PyObject *__pyx_t_2 = NULL;
9111 __Pyx_RefNannySetupContext(
"inv", 0);
9120 __Pyx_XDECREF(__pyx_r);
9121 __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)
9122 __Pyx_GOTREF(__pyx_t_1);
9123 __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)
9124 __Pyx_GOTREF(__pyx_t_2);
9125 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9126 __pyx_r = __pyx_t_2;
9140 __Pyx_XDECREF(__pyx_t_1);
9141 __Pyx_XDECREF(__pyx_t_2);
9142 __Pyx_AddTraceback(
"PyClical.clifford.inv", __pyx_clineno, __pyx_lineno, __pyx_filename);
9145 __Pyx_XGIVEREF(__pyx_r);
9146 __Pyx_RefNannyFinishContext();
9159 static PyObject *__pyx_pw_8PyClical_8clifford_51__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
9160 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 ";
9161 #if CYTHON_COMPILING_IN_CPYTHON 9162 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_50__or__;
9164 static PyObject *__pyx_pw_8PyClical_8clifford_51__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
9165 PyObject *__pyx_r = 0;
9166 __Pyx_RefNannyDeclarations
9167 __Pyx_RefNannySetupContext(
"__or__ (wrapper)", 0);
9168 __pyx_r = __pyx_pf_8PyClical_8clifford_50__or__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
9171 __Pyx_RefNannyFinishContext();
9175 static PyObject *__pyx_pf_8PyClical_8clifford_50__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
9176 PyObject *__pyx_r = NULL;
9177 __Pyx_RefNannyDeclarations
9178 PyObject *__pyx_t_1 = NULL;
9179 PyObject *__pyx_t_2 = NULL;
9180 __Pyx_RefNannySetupContext(
"__or__", 0);
9189 __Pyx_XDECREF(__pyx_r);
9190 __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)
9191 __Pyx_GOTREF(__pyx_t_1);
9192 __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)
9193 __Pyx_GOTREF(__pyx_t_2);
9194 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9195 __pyx_r = __pyx_t_2;
9209 __Pyx_XDECREF(__pyx_t_1);
9210 __Pyx_XDECREF(__pyx_t_2);
9211 __Pyx_AddTraceback(
"PyClical.clifford.__or__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9214 __Pyx_XGIVEREF(__pyx_r);
9215 __Pyx_RefNannyFinishContext();
9228 static PyObject *__pyx_pw_8PyClical_8clifford_53__ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
9229 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 ";
9230 #if CYTHON_COMPILING_IN_CPYTHON 9231 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_52__ior__;
9233 static PyObject *__pyx_pw_8PyClical_8clifford_53__ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
9234 PyObject *__pyx_r = 0;
9235 __Pyx_RefNannyDeclarations
9236 __Pyx_RefNannySetupContext(
"__ior__ (wrapper)", 0);
9237 __pyx_r = __pyx_pf_8PyClical_8clifford_52__ior__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
9240 __Pyx_RefNannyFinishContext();
9244 static PyObject *__pyx_pf_8PyClical_8clifford_52__ior__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
9245 PyObject *__pyx_r = NULL;
9246 __Pyx_RefNannyDeclarations
9247 PyObject *__pyx_t_1 = NULL;
9248 __Pyx_RefNannySetupContext(
"__ior__", 0);
9257 __Pyx_XDECREF(__pyx_r);
9258 __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)
9259 __Pyx_GOTREF(__pyx_t_1);
9260 __pyx_r = __pyx_t_1;
9274 __Pyx_XDECREF(__pyx_t_1);
9275 __Pyx_AddTraceback(
"PyClical.clifford.__ior__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9278 __Pyx_XGIVEREF(__pyx_r);
9279 __Pyx_RefNannyFinishContext();
9292 static PyObject *__pyx_pw_8PyClical_8clifford_55__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_m, PyObject *__pyx_v_dummy);
9293 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 ";
9294 #if CYTHON_COMPILING_IN_CPYTHON 9295 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_54__pow__;
9297 static PyObject *__pyx_pw_8PyClical_8clifford_55__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_m, PyObject *__pyx_v_dummy) {
9298 PyObject *__pyx_r = 0;
9299 __Pyx_RefNannyDeclarations
9300 __Pyx_RefNannySetupContext(
"__pow__ (wrapper)", 0);
9301 __pyx_r = __pyx_pf_8PyClical_8clifford_54__pow__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_m), ((PyObject *)__pyx_v_dummy));
9304 __Pyx_RefNannyFinishContext();
9308 static PyObject *__pyx_pf_8PyClical_8clifford_54__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_m, CYTHON_UNUSED PyObject *__pyx_v_dummy) {
9309 PyObject *__pyx_r = NULL;
9310 __Pyx_RefNannyDeclarations
9311 PyObject *__pyx_t_1 = NULL;
9312 __Pyx_RefNannySetupContext(
"__pow__", 0);
9321 __Pyx_XDECREF(__pyx_r);
9322 __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)
9323 __Pyx_GOTREF(__pyx_t_1);
9324 __pyx_r = __pyx_t_1;
9338 __Pyx_XDECREF(__pyx_t_1);
9339 __Pyx_AddTraceback(
"PyClical.clifford.__pow__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9342 __Pyx_XGIVEREF(__pyx_r);
9343 __Pyx_RefNannyFinishContext();
9356 static PyObject *__pyx_pw_8PyClical_8clifford_57pow(PyObject *__pyx_v_self, PyObject *__pyx_v_m);
9357 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 ";
9358 static PyObject *__pyx_pw_8PyClical_8clifford_57pow(PyObject *__pyx_v_self, PyObject *__pyx_v_m) {
9359 PyObject *__pyx_r = 0;
9360 __Pyx_RefNannyDeclarations
9361 __Pyx_RefNannySetupContext(
"pow (wrapper)", 0);
9362 __pyx_r = __pyx_pf_8PyClical_8clifford_56pow(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_m));
9365 __Pyx_RefNannyFinishContext();
9369 static PyObject *__pyx_pf_8PyClical_8clifford_56pow(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_m) {
9370 PyObject *__pyx_r = NULL;
9371 __Pyx_RefNannyDeclarations
9372 PyObject *__pyx_t_1 = NULL;
9373 PyObject *__pyx_t_2 = NULL;
9377 __Pyx_RefNannySetupContext(
"pow", 0);
9386 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numbers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __pyx_L1_error)
9387 __Pyx_GOTREF(__pyx_t_1);
9388 __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)
9389 __Pyx_GOTREF(__pyx_t_2);
9390 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9391 __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)
9392 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9393 __pyx_t_4 = (__pyx_t_3 != 0);
9403 __Pyx_XDECREF(__pyx_r);
9404 __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)
9405 __Pyx_GOTREF(__pyx_t_2);
9406 __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)
9407 __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)
9408 __Pyx_GOTREF(__pyx_t_1);
9409 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9410 __pyx_r = __pyx_t_1;
9431 __Pyx_XDECREF(__pyx_r);
9432 __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)
9433 __Pyx_GOTREF(__pyx_t_1);
9434 __pyx_t_2 = PyNumber_Multiply(__pyx_v_m, __pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1001, __pyx_L1_error)
9435 __Pyx_GOTREF(__pyx_t_2);
9436 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9437 __pyx_t_1 = __pyx_f_8PyClical_exp(__pyx_t_2, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1001, __pyx_L1_error)
9438 __Pyx_GOTREF(__pyx_t_1);
9439 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9440 __pyx_r = __pyx_t_1;
9455 __Pyx_XDECREF(__pyx_t_1);
9456 __Pyx_XDECREF(__pyx_t_2);
9457 __Pyx_AddTraceback(
"PyClical.clifford.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
9460 __Pyx_XGIVEREF(__pyx_r);
9461 __Pyx_RefNannyFinishContext();
9474 static PyObject *__pyx_pw_8PyClical_8clifford_59outer_pow(PyObject *__pyx_v_self, PyObject *__pyx_v_m);
9475 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 ";
9476 static PyObject *__pyx_pw_8PyClical_8clifford_59outer_pow(PyObject *__pyx_v_self, PyObject *__pyx_v_m) {
9477 PyObject *__pyx_r = 0;
9478 __Pyx_RefNannyDeclarations
9479 __Pyx_RefNannySetupContext(
"outer_pow (wrapper)", 0);
9480 __pyx_r = __pyx_pf_8PyClical_8clifford_58outer_pow(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_m));
9483 __Pyx_RefNannyFinishContext();
9487 static PyObject *__pyx_pf_8PyClical_8clifford_58outer_pow(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_m) {
9488 PyObject *__pyx_r = NULL;
9489 __Pyx_RefNannyDeclarations
9490 PyObject *__pyx_t_1 = NULL;
9492 PyObject *__pyx_t_3 = NULL;
9493 __Pyx_RefNannySetupContext(
"outer_pow", 0);
9502 __Pyx_XDECREF(__pyx_r);
9503 __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)
9504 __Pyx_GOTREF(__pyx_t_1);
9505 __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)
9506 __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)
9507 __Pyx_GOTREF(__pyx_t_3);
9508 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9509 __pyx_r = __pyx_t_3;
9523 __Pyx_XDECREF(__pyx_t_1);
9524 __Pyx_XDECREF(__pyx_t_3);
9525 __Pyx_AddTraceback(
"PyClical.clifford.outer_pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
9528 __Pyx_XGIVEREF(__pyx_r);
9529 __Pyx_RefNannyFinishContext();
9542 static PyObject *__pyx_pw_8PyClical_8clifford_61__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
9543 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 ";
9544 #if CYTHON_COMPILING_IN_CPYTHON 9545 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_60__call__;
9547 static PyObject *__pyx_pw_8PyClical_8clifford_61__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9548 PyObject *__pyx_v_grade = 0;
9549 PyObject *__pyx_r = 0;
9550 __Pyx_RefNannyDeclarations
9551 __Pyx_RefNannySetupContext(
"__call__ (wrapper)", 0);
9553 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_grade,0};
9554 PyObject* values[1] = {0};
9555 if (unlikely(__pyx_kwds)) {
9557 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9559 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9562 default:
goto __pyx_L5_argtuple_error;
9564 kw_args = PyDict_Size(__pyx_kwds);
9567 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_grade)) != 0)) kw_args--;
9568 else goto __pyx_L5_argtuple_error;
9570 if (unlikely(kw_args > 0)) {
9571 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__call__") < 0)) __PYX_ERR(0, 1019, __pyx_L3_error)
9573 }
else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
9574 goto __pyx_L5_argtuple_error;
9576 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9578 __pyx_v_grade = values[0];
9580 goto __pyx_L4_argument_unpacking_done;
9581 __pyx_L5_argtuple_error:;
9582 __Pyx_RaiseArgtupleInvalid(
"__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1019, __pyx_L3_error)
9584 __Pyx_AddTraceback(
"PyClical.clifford.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9585 __Pyx_RefNannyFinishContext();
9587 __pyx_L4_argument_unpacking_done:;
9588 __pyx_r = __pyx_pf_8PyClical_8clifford_60__call__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), __pyx_v_grade);
9591 __Pyx_RefNannyFinishContext();
9595 static PyObject *__pyx_pf_8PyClical_8clifford_60__call__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_grade) {
9596 PyObject *__pyx_r = NULL;
9597 __Pyx_RefNannyDeclarations
9598 PyObject *__pyx_t_1 = NULL;
9600 PyObject *__pyx_t_3 = NULL;
9601 __Pyx_RefNannySetupContext(
"__call__", 0);
9610 __Pyx_XDECREF(__pyx_r);
9611 __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)
9612 __Pyx_GOTREF(__pyx_t_1);
9613 __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)
9614 __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)
9615 __Pyx_GOTREF(__pyx_t_3);
9616 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9617 __pyx_r = __pyx_t_3;
9631 __Pyx_XDECREF(__pyx_t_1);
9632 __Pyx_XDECREF(__pyx_t_3);
9633 __Pyx_AddTraceback(
"PyClical.clifford.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9636 __Pyx_XGIVEREF(__pyx_r);
9637 __Pyx_RefNannyFinishContext();
9650 static PyObject *__pyx_pw_8PyClical_8clifford_63scalar(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9651 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 ";
9652 static PyObject *__pyx_pw_8PyClical_8clifford_63scalar(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9653 PyObject *__pyx_r = 0;
9654 __Pyx_RefNannyDeclarations
9655 __Pyx_RefNannySetupContext(
"scalar (wrapper)", 0);
9656 __pyx_r = __pyx_pf_8PyClical_8clifford_62scalar(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
9659 __Pyx_RefNannyFinishContext();
9663 static PyObject *__pyx_pf_8PyClical_8clifford_62scalar(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
9664 PyObject *__pyx_r = NULL;
9665 __Pyx_RefNannyDeclarations
9666 PyObject *__pyx_t_1 = NULL;
9667 __Pyx_RefNannySetupContext(
"scalar", 0);
9676 __Pyx_XDECREF(__pyx_r);
9677 __pyx_t_1 =
PyFloat_FromDouble(__pyx_v_self->instance->scalar());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1047, __pyx_L1_error)
9678 __Pyx_GOTREF(__pyx_t_1);
9679 __pyx_r = __pyx_t_1;
9693 __Pyx_XDECREF(__pyx_t_1);
9694 __Pyx_AddTraceback(
"PyClical.clifford.scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
9697 __Pyx_XGIVEREF(__pyx_r);
9698 __Pyx_RefNannyFinishContext();
9711 static PyObject *__pyx_pw_8PyClical_8clifford_65pure(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9712 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 ";
9713 static PyObject *__pyx_pw_8PyClical_8clifford_65pure(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9714 PyObject *__pyx_r = 0;
9715 __Pyx_RefNannyDeclarations
9716 __Pyx_RefNannySetupContext(
"pure (wrapper)", 0);
9717 __pyx_r = __pyx_pf_8PyClical_8clifford_64pure(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
9720 __Pyx_RefNannyFinishContext();
9724 static PyObject *__pyx_pf_8PyClical_8clifford_64pure(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
9725 PyObject *__pyx_r = NULL;
9726 __Pyx_RefNannyDeclarations
9727 PyObject *__pyx_t_1 = NULL;
9728 PyObject *__pyx_t_2 = NULL;
9729 __Pyx_RefNannySetupContext(
"pure", 0);
9738 __Pyx_XDECREF(__pyx_r);
9739 __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)
9740 __Pyx_GOTREF(__pyx_t_1);
9741 __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)
9742 __Pyx_GOTREF(__pyx_t_2);
9743 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9744 __pyx_r = __pyx_t_2;
9758 __Pyx_XDECREF(__pyx_t_1);
9759 __Pyx_XDECREF(__pyx_t_2);
9760 __Pyx_AddTraceback(
"PyClical.clifford.pure", __pyx_clineno, __pyx_lineno, __pyx_filename);
9763 __Pyx_XGIVEREF(__pyx_r);
9764 __Pyx_RefNannyFinishContext();
9777 static PyObject *__pyx_pw_8PyClical_8clifford_67even(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9778 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 ";
9779 static PyObject *__pyx_pw_8PyClical_8clifford_67even(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9780 PyObject *__pyx_r = 0;
9781 __Pyx_RefNannyDeclarations
9782 __Pyx_RefNannySetupContext(
"even (wrapper)", 0);
9783 __pyx_r = __pyx_pf_8PyClical_8clifford_66even(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
9786 __Pyx_RefNannyFinishContext();
9790 static PyObject *__pyx_pf_8PyClical_8clifford_66even(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
9791 PyObject *__pyx_r = NULL;
9792 __Pyx_RefNannyDeclarations
9793 PyObject *__pyx_t_1 = NULL;
9794 PyObject *__pyx_t_2 = NULL;
9795 __Pyx_RefNannySetupContext(
"even", 0);
9804 __Pyx_XDECREF(__pyx_r);
9805 __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)
9806 __Pyx_GOTREF(__pyx_t_1);
9807 __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)
9808 __Pyx_GOTREF(__pyx_t_2);
9809 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9810 __pyx_r = __pyx_t_2;
9824 __Pyx_XDECREF(__pyx_t_1);
9825 __Pyx_XDECREF(__pyx_t_2);
9826 __Pyx_AddTraceback(
"PyClical.clifford.even", __pyx_clineno, __pyx_lineno, __pyx_filename);
9829 __Pyx_XGIVEREF(__pyx_r);
9830 __Pyx_RefNannyFinishContext();
9843 static PyObject *__pyx_pw_8PyClical_8clifford_69odd(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9844 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 ";
9845 static PyObject *__pyx_pw_8PyClical_8clifford_69odd(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9846 PyObject *__pyx_r = 0;
9847 __Pyx_RefNannyDeclarations
9848 __Pyx_RefNannySetupContext(
"odd (wrapper)", 0);
9849 __pyx_r = __pyx_pf_8PyClical_8clifford_68odd(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
9852 __Pyx_RefNannyFinishContext();
9856 static PyObject *__pyx_pf_8PyClical_8clifford_68odd(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
9857 PyObject *__pyx_r = NULL;
9858 __Pyx_RefNannyDeclarations
9859 PyObject *__pyx_t_1 = NULL;
9860 PyObject *__pyx_t_2 = NULL;
9861 __Pyx_RefNannySetupContext(
"odd", 0);
9870 __Pyx_XDECREF(__pyx_r);
9871 __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)
9872 __Pyx_GOTREF(__pyx_t_1);
9873 __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)
9874 __Pyx_GOTREF(__pyx_t_2);
9875 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9876 __pyx_r = __pyx_t_2;
9890 __Pyx_XDECREF(__pyx_t_1);
9891 __Pyx_XDECREF(__pyx_t_2);
9892 __Pyx_AddTraceback(
"PyClical.clifford.odd", __pyx_clineno, __pyx_lineno, __pyx_filename);
9895 __Pyx_XGIVEREF(__pyx_r);
9896 __Pyx_RefNannyFinishContext();
9909 static PyObject *__pyx_pw_8PyClical_8clifford_71vector_part(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
9910 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 ";
9911 static PyObject *__pyx_pw_8PyClical_8clifford_71vector_part(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9912 PyObject *__pyx_v_frm = 0;
9913 PyObject *__pyx_r = 0;
9914 __Pyx_RefNannyDeclarations
9915 __Pyx_RefNannySetupContext(
"vector_part (wrapper)", 0);
9917 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frm,0};
9918 PyObject* values[1] = {0};
9919 values[0] = ((PyObject *)Py_None);
9920 if (unlikely(__pyx_kwds)) {
9922 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9924 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9927 default:
goto __pyx_L5_argtuple_error;
9929 kw_args = PyDict_Size(__pyx_kwds);
9933 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_frm);
9934 if (value) { values[0] = value; kw_args--; }
9937 if (unlikely(kw_args > 0)) {
9938 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"vector_part") < 0)) __PYX_ERR(0, 1078, __pyx_L3_error)
9941 switch (PyTuple_GET_SIZE(__pyx_args)) {
9942 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9945 default:
goto __pyx_L5_argtuple_error;
9948 __pyx_v_frm = values[0];
9950 goto __pyx_L4_argument_unpacking_done;
9951 __pyx_L5_argtuple_error:;
9952 __Pyx_RaiseArgtupleInvalid(
"vector_part", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1078, __pyx_L3_error)
9954 __Pyx_AddTraceback(
"PyClical.clifford.vector_part", __pyx_clineno, __pyx_lineno, __pyx_filename);
9955 __Pyx_RefNannyFinishContext();
9957 __pyx_L4_argument_unpacking_done:;
9958 __pyx_r = __pyx_pf_8PyClical_8clifford_70vector_part(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), __pyx_v_frm);
9961 __Pyx_RefNannyFinishContext();
9965 static PyObject *__pyx_pf_8PyClical_8clifford_70vector_part(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_frm) {
9966 PyObject *__pyx_v_error_msg_prefix = NULL;
9967 std::vector<scalar_t> __pyx_v_vec;
9970 PyObject *__pyx_v_lst = NULL;
9971 PyObject *__pyx_v_err = NULL;
9972 PyObject *__pyx_r = NULL;
9973 __Pyx_RefNannyDeclarations
9974 PyObject *__pyx_t_1 = NULL;
9975 PyObject *__pyx_t_2 = NULL;
9976 PyObject *__pyx_t_3 = NULL;
9979 std::vector<scalar_t> __pyx_t_6;
9980 PyObject *__pyx_t_7 = NULL;
9983 PyObject *__pyx_t_10 = NULL;
9984 PyObject *__pyx_t_11 = NULL;
9985 PyObject *__pyx_t_12 = NULL;
9986 PyObject *__pyx_t_13 = NULL;
9987 PyObject *__pyx_t_14 = NULL;
9988 __Pyx_RefNannySetupContext(
"vector_part", 0);
9997 __Pyx_INCREF(__pyx_kp_s_Cannot_take_vector_part_of);
9998 __pyx_v_error_msg_prefix = __pyx_kp_s_Cannot_take_vector_part_of;
10008 __Pyx_PyThreadState_declare
10009 __Pyx_PyThreadState_assign
10010 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
10011 __Pyx_XGOTREF(__pyx_t_1);
10012 __Pyx_XGOTREF(__pyx_t_2);
10013 __Pyx_XGOTREF(__pyx_t_3);
10023 __pyx_t_4 = (__pyx_v_frm == Py_None);
10024 __pyx_t_5 = (__pyx_t_4 != 0);
10034 __pyx_t_6 = __pyx_v_self->instance->vector_part();
10035 __pyx_v_vec = __pyx_t_6;
10056 __pyx_t_6 = __pyx_v_self->instance->vector_part(__pyx_f_8PyClical_9index_set_unwrap(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_frm)));
10058 __Pyx_CppExn2PyErr();
10059 __PYX_ERR(0, 1095, __pyx_L3_error)
10061 __pyx_v_vec = __pyx_t_6;
10072 __pyx_v_n = __pyx_v_vec.size();
10081 __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)
10082 __Pyx_GOTREF(__pyx_t_7);
10083 { Py_ssize_t __pyx_temp;
10084 for (__pyx_temp=0; __pyx_temp < __pyx_v_n; __pyx_temp++) {
10085 __Pyx_INCREF(__pyx_float_0_0);
10086 __Pyx_GIVEREF(__pyx_float_0_0);
10087 PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_float_0_0);
10090 __pyx_v_lst = ((PyObject*)__pyx_t_7);
10100 __pyx_t_8 = __pyx_v_n;
10101 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
10102 __pyx_v_i = __pyx_t_9;
10111 __pyx_t_7 =
PyFloat_FromDouble((__pyx_v_vec[__pyx_v_i]));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1099, __pyx_L3_error)
10112 __Pyx_GOTREF(__pyx_t_7);
10113 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)
10114 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10124 __Pyx_XDECREF(__pyx_r);
10125 __Pyx_INCREF(__pyx_v_lst);
10126 __pyx_r = __pyx_v_lst;
10127 goto __pyx_L7_try_return;
10138 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10147 __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
10149 __Pyx_AddTraceback(
"PyClical.clifford.vector_part", __pyx_clineno, __pyx_lineno, __pyx_filename);
10150 if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_10, &__pyx_t_11) < 0) __PYX_ERR(0, 1101, __pyx_L5_except_error)
10151 __Pyx_GOTREF(__pyx_t_7);
10152 __Pyx_GOTREF(__pyx_t_10);
10153 __Pyx_GOTREF(__pyx_t_11);
10154 __Pyx_INCREF(__pyx_t_10);
10155 __pyx_v_err = __pyx_t_10;
10164 __pyx_t_12 = PyTuple_New(1);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1102, __pyx_L5_except_error)
10165 __Pyx_GOTREF(__pyx_t_12);
10166 __Pyx_INCREF(((PyObject *)__pyx_v_self));
10167 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
10168 PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)__pyx_v_self));
10169 __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)
10170 __Pyx_GOTREF(__pyx_t_13);
10171 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
10172 __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)
10173 __Pyx_GOTREF(__pyx_t_12);
10174 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
10175 __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)
10176 __Pyx_GOTREF(__pyx_t_13);
10177 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
10186 __pyx_t_12 = PyObject_Repr(__pyx_v_frm);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1103, __pyx_L5_except_error)
10187 __Pyx_GOTREF(__pyx_t_12);
10188 __pyx_t_14 = PyNumber_Add(__pyx_t_13, __pyx_t_12);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1103, __pyx_L5_except_error)
10189 __Pyx_GOTREF(__pyx_t_14);
10190 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
10191 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
10192 __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)
10193 __Pyx_GOTREF(__pyx_t_12);
10194 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
10203 __pyx_t_14 = PyTuple_New(1);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1104, __pyx_L5_except_error)
10204 __Pyx_GOTREF(__pyx_t_14);
10205 __Pyx_INCREF(__pyx_v_err);
10206 __Pyx_GIVEREF(__pyx_v_err);
10207 PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_err);
10208 __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)
10209 __Pyx_GOTREF(__pyx_t_13);
10210 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
10211 __pyx_t_14 = PyNumber_Add(__pyx_t_12, __pyx_t_13);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1104, __pyx_L5_except_error)
10212 __Pyx_GOTREF(__pyx_t_14);
10213 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
10214 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
10223 __pyx_t_13 = PyTuple_New(1);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1102, __pyx_L5_except_error)
10224 __Pyx_GOTREF(__pyx_t_13);
10225 __Pyx_GIVEREF(__pyx_t_14);
10226 PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_14);
10228 __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)
10229 __Pyx_GOTREF(__pyx_t_14);
10230 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
10231 __Pyx_Raise(__pyx_t_14, 0, 0, 0);
10232 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
10233 __PYX_ERR(0, 1102, __pyx_L5_except_error)
10235 goto __pyx_L5_except_error;
10236 __pyx_L5_except_error:;
10245 __Pyx_XGIVEREF(__pyx_t_1);
10246 __Pyx_XGIVEREF(__pyx_t_2);
10247 __Pyx_XGIVEREF(__pyx_t_3);
10248 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
10249 goto __pyx_L1_error;
10250 __pyx_L7_try_return:;
10251 __Pyx_XGIVEREF(__pyx_t_1);
10252 __Pyx_XGIVEREF(__pyx_t_2);
10253 __Pyx_XGIVEREF(__pyx_t_3);
10254 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
10268 __Pyx_XDECREF(__pyx_t_7);
10269 __Pyx_XDECREF(__pyx_t_10);
10270 __Pyx_XDECREF(__pyx_t_11);
10271 __Pyx_XDECREF(__pyx_t_12);
10272 __Pyx_XDECREF(__pyx_t_13);
10273 __Pyx_XDECREF(__pyx_t_14);
10274 __Pyx_AddTraceback(
"PyClical.clifford.vector_part", __pyx_clineno, __pyx_lineno, __pyx_filename);
10277 __Pyx_XDECREF(__pyx_v_error_msg_prefix);
10278 __Pyx_XDECREF(__pyx_v_lst);
10279 __Pyx_XDECREF(__pyx_v_err);
10280 __Pyx_XGIVEREF(__pyx_r);
10281 __Pyx_RefNannyFinishContext();
10294 static PyObject *__pyx_pw_8PyClical_8clifford_73involute(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10295 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 ";
10296 static PyObject *__pyx_pw_8PyClical_8clifford_73involute(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10297 PyObject *__pyx_r = 0;
10298 __Pyx_RefNannyDeclarations
10299 __Pyx_RefNannySetupContext(
"involute (wrapper)", 0);
10300 __pyx_r = __pyx_pf_8PyClical_8clifford_72involute(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10303 __Pyx_RefNannyFinishContext();
10307 static PyObject *__pyx_pf_8PyClical_8clifford_72involute(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10308 PyObject *__pyx_r = NULL;
10309 __Pyx_RefNannyDeclarations
10310 PyObject *__pyx_t_1 = NULL;
10311 PyObject *__pyx_t_2 = NULL;
10312 __Pyx_RefNannySetupContext(
"involute", 0);
10321 __Pyx_XDECREF(__pyx_r);
10322 __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)
10323 __Pyx_GOTREF(__pyx_t_1);
10324 __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)
10325 __Pyx_GOTREF(__pyx_t_2);
10326 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10327 __pyx_r = __pyx_t_2;
10341 __Pyx_XDECREF(__pyx_t_1);
10342 __Pyx_XDECREF(__pyx_t_2);
10343 __Pyx_AddTraceback(
"PyClical.clifford.involute", __pyx_clineno, __pyx_lineno, __pyx_filename);
10346 __Pyx_XGIVEREF(__pyx_r);
10347 __Pyx_RefNannyFinishContext();
10360 static PyObject *__pyx_pw_8PyClical_8clifford_75reverse(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10361 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 ";
10362 static PyObject *__pyx_pw_8PyClical_8clifford_75reverse(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10363 PyObject *__pyx_r = 0;
10364 __Pyx_RefNannyDeclarations
10365 __Pyx_RefNannySetupContext(
"reverse (wrapper)", 0);
10366 __pyx_r = __pyx_pf_8PyClical_8clifford_74reverse(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10369 __Pyx_RefNannyFinishContext();
10373 static PyObject *__pyx_pf_8PyClical_8clifford_74reverse(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10374 PyObject *__pyx_r = NULL;
10375 __Pyx_RefNannyDeclarations
10376 PyObject *__pyx_t_1 = NULL;
10377 PyObject *__pyx_t_2 = NULL;
10378 __Pyx_RefNannySetupContext(
"reverse", 0);
10387 __Pyx_XDECREF(__pyx_r);
10388 __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)
10389 __Pyx_GOTREF(__pyx_t_1);
10390 __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)
10391 __Pyx_GOTREF(__pyx_t_2);
10392 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10393 __pyx_r = __pyx_t_2;
10407 __Pyx_XDECREF(__pyx_t_1);
10408 __Pyx_XDECREF(__pyx_t_2);
10409 __Pyx_AddTraceback(
"PyClical.clifford.reverse", __pyx_clineno, __pyx_lineno, __pyx_filename);
10412 __Pyx_XGIVEREF(__pyx_r);
10413 __Pyx_RefNannyFinishContext();
10426 static PyObject *__pyx_pw_8PyClical_8clifford_77conj(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10427 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 ";
10428 static PyObject *__pyx_pw_8PyClical_8clifford_77conj(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10429 PyObject *__pyx_r = 0;
10430 __Pyx_RefNannyDeclarations
10431 __Pyx_RefNannySetupContext(
"conj (wrapper)", 0);
10432 __pyx_r = __pyx_pf_8PyClical_8clifford_76conj(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10435 __Pyx_RefNannyFinishContext();
10439 static PyObject *__pyx_pf_8PyClical_8clifford_76conj(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10440 PyObject *__pyx_r = NULL;
10441 __Pyx_RefNannyDeclarations
10442 PyObject *__pyx_t_1 = NULL;
10443 PyObject *__pyx_t_2 = NULL;
10444 __Pyx_RefNannySetupContext(
"conj", 0);
10453 __Pyx_XDECREF(__pyx_r);
10454 __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)
10455 __Pyx_GOTREF(__pyx_t_1);
10456 __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)
10457 __Pyx_GOTREF(__pyx_t_2);
10458 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10459 __pyx_r = __pyx_t_2;
10473 __Pyx_XDECREF(__pyx_t_1);
10474 __Pyx_XDECREF(__pyx_t_2);
10475 __Pyx_AddTraceback(
"PyClical.clifford.conj", __pyx_clineno, __pyx_lineno, __pyx_filename);
10478 __Pyx_XGIVEREF(__pyx_r);
10479 __Pyx_RefNannyFinishContext();
10492 static PyObject *__pyx_pw_8PyClical_8clifford_79quad(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10493 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 ";
10494 static PyObject *__pyx_pw_8PyClical_8clifford_79quad(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10495 PyObject *__pyx_r = 0;
10496 __Pyx_RefNannyDeclarations
10497 __Pyx_RefNannySetupContext(
"quad (wrapper)", 0);
10498 __pyx_r = __pyx_pf_8PyClical_8clifford_78quad(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10501 __Pyx_RefNannyFinishContext();
10505 static PyObject *__pyx_pf_8PyClical_8clifford_78quad(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10506 PyObject *__pyx_r = NULL;
10507 __Pyx_RefNannyDeclarations
10508 PyObject *__pyx_t_1 = NULL;
10509 __Pyx_RefNannySetupContext(
"quad", 0);
10518 __Pyx_XDECREF(__pyx_r);
10519 __pyx_t_1 =
PyFloat_FromDouble(__pyx_v_self->instance->quad());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1161, __pyx_L1_error)
10520 __Pyx_GOTREF(__pyx_t_1);
10521 __pyx_r = __pyx_t_1;
10535 __Pyx_XDECREF(__pyx_t_1);
10536 __Pyx_AddTraceback(
"PyClical.clifford.quad", __pyx_clineno, __pyx_lineno, __pyx_filename);
10539 __Pyx_XGIVEREF(__pyx_r);
10540 __Pyx_RefNannyFinishContext();
10553 static PyObject *__pyx_pw_8PyClical_8clifford_81norm(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10554 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 ";
10555 static PyObject *__pyx_pw_8PyClical_8clifford_81norm(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10556 PyObject *__pyx_r = 0;
10557 __Pyx_RefNannyDeclarations
10558 __Pyx_RefNannySetupContext(
"norm (wrapper)", 0);
10559 __pyx_r = __pyx_pf_8PyClical_8clifford_80norm(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10562 __Pyx_RefNannyFinishContext();
10566 static PyObject *__pyx_pf_8PyClical_8clifford_80norm(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10567 PyObject *__pyx_r = NULL;
10568 __Pyx_RefNannyDeclarations
10569 PyObject *__pyx_t_1 = NULL;
10570 __Pyx_RefNannySetupContext(
"norm", 0);
10579 __Pyx_XDECREF(__pyx_r);
10580 __pyx_t_1 =
PyFloat_FromDouble(__pyx_v_self->instance->norm());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1172, __pyx_L1_error)
10581 __Pyx_GOTREF(__pyx_t_1);
10582 __pyx_r = __pyx_t_1;
10596 __Pyx_XDECREF(__pyx_t_1);
10597 __Pyx_AddTraceback(
"PyClical.clifford.norm", __pyx_clineno, __pyx_lineno, __pyx_filename);
10600 __Pyx_XGIVEREF(__pyx_r);
10601 __Pyx_RefNannyFinishContext();
10614 static PyObject *__pyx_pw_8PyClical_8clifford_83abs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10615 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 ";
10616 static PyObject *__pyx_pw_8PyClical_8clifford_83abs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10617 PyObject *__pyx_r = 0;
10618 __Pyx_RefNannyDeclarations
10619 __Pyx_RefNannySetupContext(
"abs (wrapper)", 0);
10620 __pyx_r = __pyx_pf_8PyClical_8clifford_82abs(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10623 __Pyx_RefNannyFinishContext();
10627 static PyObject *__pyx_pf_8PyClical_8clifford_82abs(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10628 PyObject *__pyx_r = NULL;
10629 __Pyx_RefNannyDeclarations
10630 PyObject *__pyx_t_1 = NULL;
10631 __Pyx_RefNannySetupContext(
"abs", 0);
10640 __Pyx_XDECREF(__pyx_r);
10641 __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)
10642 __Pyx_GOTREF(__pyx_t_1);
10643 __pyx_r = __pyx_t_1;
10657 __Pyx_XDECREF(__pyx_t_1);
10658 __Pyx_AddTraceback(
"PyClical.clifford.abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
10661 __Pyx_XGIVEREF(__pyx_r);
10662 __Pyx_RefNannyFinishContext();
10675 static PyObject *__pyx_pw_8PyClical_8clifford_85max_abs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10676 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 ";
10677 static PyObject *__pyx_pw_8PyClical_8clifford_85max_abs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10678 PyObject *__pyx_r = 0;
10679 __Pyx_RefNannyDeclarations
10680 __Pyx_RefNannySetupContext(
"max_abs (wrapper)", 0);
10681 __pyx_r = __pyx_pf_8PyClical_8clifford_84max_abs(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10684 __Pyx_RefNannyFinishContext();
10688 static PyObject *__pyx_pf_8PyClical_8clifford_84max_abs(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10689 PyObject *__pyx_r = NULL;
10690 __Pyx_RefNannyDeclarations
10691 PyObject *__pyx_t_1 = NULL;
10692 __Pyx_RefNannySetupContext(
"max_abs", 0);
10701 __Pyx_XDECREF(__pyx_r);
10702 __pyx_t_1 =
PyFloat_FromDouble(__pyx_v_self->instance->max_abs());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1192, __pyx_L1_error)
10703 __Pyx_GOTREF(__pyx_t_1);
10704 __pyx_r = __pyx_t_1;
10718 __Pyx_XDECREF(__pyx_t_1);
10719 __Pyx_AddTraceback(
"PyClical.clifford.max_abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
10722 __Pyx_XGIVEREF(__pyx_r);
10723 __Pyx_RefNannyFinishContext();
10736 static PyObject *__pyx_pw_8PyClical_8clifford_87truncated(PyObject *__pyx_v_self, PyObject *__pyx_v_limit);
10737 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 ";
10738 static PyObject *__pyx_pw_8PyClical_8clifford_87truncated(PyObject *__pyx_v_self, PyObject *__pyx_v_limit) {
10739 PyObject *__pyx_r = 0;
10740 __Pyx_RefNannyDeclarations
10741 __Pyx_RefNannySetupContext(
"truncated (wrapper)", 0);
10742 __pyx_r = __pyx_pf_8PyClical_8clifford_86truncated(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_limit));
10745 __Pyx_RefNannyFinishContext();
10749 static PyObject *__pyx_pf_8PyClical_8clifford_86truncated(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_limit) {
10750 PyObject *__pyx_r = NULL;
10751 __Pyx_RefNannyDeclarations
10752 PyObject *__pyx_t_1 = NULL;
10754 PyObject *__pyx_t_3 = NULL;
10755 __Pyx_RefNannySetupContext(
"truncated", 0);
10764 __Pyx_XDECREF(__pyx_r);
10765 __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)
10766 __Pyx_GOTREF(__pyx_t_1);
10767 __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)
10768 __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)
10769 __Pyx_GOTREF(__pyx_t_3);
10770 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10771 __pyx_r = __pyx_t_3;
10785 __Pyx_XDECREF(__pyx_t_1);
10786 __Pyx_XDECREF(__pyx_t_3);
10787 __Pyx_AddTraceback(
"PyClical.clifford.truncated", __pyx_clineno, __pyx_lineno, __pyx_filename);
10790 __Pyx_XGIVEREF(__pyx_r);
10791 __Pyx_RefNannyFinishContext();
10804 static PyObject *__pyx_pw_8PyClical_8clifford_89isnan(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10805 static char __pyx_doc_8PyClical_8clifford_88isnan[] =
"\n Check if a multivector contains any IEEE NaN values.\n\n >>> clifford().isnan()\n False\n ";
10806 static PyObject *__pyx_pw_8PyClical_8clifford_89isnan(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10807 PyObject *__pyx_r = 0;
10808 __Pyx_RefNannyDeclarations
10809 __Pyx_RefNannySetupContext(
"isnan (wrapper)", 0);
10810 __pyx_r = __pyx_pf_8PyClical_8clifford_88isnan(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10813 __Pyx_RefNannyFinishContext();
10817 static PyObject *__pyx_pf_8PyClical_8clifford_88isnan(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10818 PyObject *__pyx_r = NULL;
10819 __Pyx_RefNannyDeclarations
10820 PyObject *__pyx_t_1 = NULL;
10821 __Pyx_RefNannySetupContext(
"isnan", 0);
10830 __Pyx_XDECREF(__pyx_r);
10831 __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->instance->isnan());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1212, __pyx_L1_error)
10832 __Pyx_GOTREF(__pyx_t_1);
10833 __pyx_r = __pyx_t_1;
10847 __Pyx_XDECREF(__pyx_t_1);
10848 __Pyx_AddTraceback(
"PyClical.clifford.isnan", __pyx_clineno, __pyx_lineno, __pyx_filename);
10851 __Pyx_XGIVEREF(__pyx_r);
10852 __Pyx_RefNannyFinishContext();
10865 static PyObject *__pyx_pw_8PyClical_8clifford_91frame(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10866 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 ";
10867 static PyObject *__pyx_pw_8PyClical_8clifford_91frame(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10868 PyObject *__pyx_r = 0;
10869 __Pyx_RefNannyDeclarations
10870 __Pyx_RefNannySetupContext(
"frame (wrapper)", 0);
10871 __pyx_r = __pyx_pf_8PyClical_8clifford_90frame(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10874 __Pyx_RefNannyFinishContext();
10878 static PyObject *__pyx_pf_8PyClical_8clifford_90frame(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10879 PyObject *__pyx_r = NULL;
10880 __Pyx_RefNannyDeclarations
10881 PyObject *__pyx_t_1 = NULL;
10882 PyObject *__pyx_t_2 = NULL;
10883 __Pyx_RefNannySetupContext(
"frame", 0);
10892 __Pyx_XDECREF(__pyx_r);
10893 __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)
10894 __Pyx_GOTREF(__pyx_t_1);
10895 __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)
10896 __Pyx_GOTREF(__pyx_t_2);
10897 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10898 __pyx_r = __pyx_t_2;
10912 __Pyx_XDECREF(__pyx_t_1);
10913 __Pyx_XDECREF(__pyx_t_2);
10914 __Pyx_AddTraceback(
"PyClical.clifford.frame", __pyx_clineno, __pyx_lineno, __pyx_filename);
10917 __Pyx_XGIVEREF(__pyx_r);
10918 __Pyx_RefNannyFinishContext();
10931 static PyObject *__pyx_pw_8PyClical_8clifford_93__repr__(PyObject *__pyx_v_self);
10932 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 ";
10933 #if CYTHON_COMPILING_IN_CPYTHON 10934 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_92__repr__;
10936 static PyObject *__pyx_pw_8PyClical_8clifford_93__repr__(PyObject *__pyx_v_self) {
10937 PyObject *__pyx_r = 0;
10938 __Pyx_RefNannyDeclarations
10939 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
10940 __pyx_r = __pyx_pf_8PyClical_8clifford_92__repr__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10943 __Pyx_RefNannyFinishContext();
10947 static PyObject *__pyx_pf_8PyClical_8clifford_92__repr__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10948 PyObject *__pyx_r = NULL;
10949 __Pyx_RefNannyDeclarations
10950 PyObject *__pyx_t_1 = NULL;
10951 __Pyx_RefNannySetupContext(
"__repr__", 0);
10960 __Pyx_XDECREF(__pyx_r);
10961 __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)
10962 __Pyx_GOTREF(__pyx_t_1);
10963 __pyx_r = __pyx_t_1;
10977 __Pyx_XDECREF(__pyx_t_1);
10978 __Pyx_AddTraceback(
"PyClical.clifford.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10981 __Pyx_XGIVEREF(__pyx_r);
10982 __Pyx_RefNannyFinishContext();
10995 static PyObject *__pyx_pw_8PyClical_8clifford_95__str__(PyObject *__pyx_v_self);
10996 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 ";
10997 #if CYTHON_COMPILING_IN_CPYTHON 10998 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_94__str__;
11000 static PyObject *__pyx_pw_8PyClical_8clifford_95__str__(PyObject *__pyx_v_self) {
11001 PyObject *__pyx_r = 0;
11002 __Pyx_RefNannyDeclarations
11003 __Pyx_RefNannySetupContext(
"__str__ (wrapper)", 0);
11004 __pyx_r = __pyx_pf_8PyClical_8clifford_94__str__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
11007 __Pyx_RefNannyFinishContext();
11011 static PyObject *__pyx_pf_8PyClical_8clifford_94__str__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
11012 PyObject *__pyx_r = NULL;
11013 __Pyx_RefNannyDeclarations
11014 PyObject *__pyx_t_1 = NULL;
11015 __Pyx_RefNannySetupContext(
"__str__", 0);
11024 __Pyx_XDECREF(__pyx_r);
11025 __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)
11026 __Pyx_GOTREF(__pyx_t_1);
11027 __pyx_r = __pyx_t_1;
11041 __Pyx_XDECREF(__pyx_t_1);
11042 __Pyx_AddTraceback(
"PyClical.clifford.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11045 __Pyx_XGIVEREF(__pyx_r);
11046 __Pyx_RefNannyFinishContext();
11057 static PyObject *__pyx_pw_8PyClical_8clifford_97__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
11058 static PyObject *__pyx_pw_8PyClical_8clifford_97__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11059 PyObject *__pyx_r = 0;
11060 __Pyx_RefNannyDeclarations
11061 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
11062 __pyx_r = __pyx_pf_8PyClical_8clifford_96__reduce_cython__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
11065 __Pyx_RefNannyFinishContext();
11069 static PyObject *__pyx_pf_8PyClical_8clifford_96__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
11070 PyObject *__pyx_r = NULL;
11071 __Pyx_RefNannyDeclarations
11072 PyObject *__pyx_t_1 = NULL;
11073 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
11081 __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)
11082 __Pyx_GOTREF(__pyx_t_1);
11083 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
11084 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11085 __PYX_ERR(1, 2, __pyx_L1_error)
11095 __Pyx_XDECREF(__pyx_t_1);
11096 __Pyx_AddTraceback(
"PyClical.clifford.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11098 __Pyx_XGIVEREF(__pyx_r);
11099 __Pyx_RefNannyFinishContext();
11111 static PyObject *__pyx_pw_8PyClical_8clifford_99__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
11112 static PyObject *__pyx_pw_8PyClical_8clifford_99__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
11113 PyObject *__pyx_r = 0;
11114 __Pyx_RefNannyDeclarations
11115 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
11116 __pyx_r = __pyx_pf_8PyClical_8clifford_98__setstate_cython__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
11119 __Pyx_RefNannyFinishContext();
11123 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) {
11124 PyObject *__pyx_r = NULL;
11125 __Pyx_RefNannyDeclarations
11126 PyObject *__pyx_t_1 = NULL;
11127 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
11134 __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)
11135 __Pyx_GOTREF(__pyx_t_1);
11136 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
11137 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11138 __PYX_ERR(1, 4, __pyx_L1_error)
11149 __Pyx_XDECREF(__pyx_t_1);
11150 __Pyx_AddTraceback(
"PyClical.clifford.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11152 __Pyx_XGIVEREF(__pyx_r);
11153 __Pyx_RefNannyFinishContext();
11166 static PyObject *__pyx_pw_8PyClical_9clifford_hidden_doctests(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused);
11167 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 ";
11168 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};
11169 static PyObject *__pyx_pw_8PyClical_9clifford_hidden_doctests(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
11170 PyObject *__pyx_r = 0;
11171 __Pyx_RefNannyDeclarations
11172 __Pyx_RefNannySetupContext(
"clifford_hidden_doctests (wrapper)", 0);
11173 __pyx_r = __pyx_pf_8PyClical_8clifford_hidden_doctests(__pyx_self);
11176 __Pyx_RefNannyFinishContext();
11180 static PyObject *__pyx_pf_8PyClical_8clifford_hidden_doctests(CYTHON_UNUSED PyObject *__pyx_self) {
11181 PyObject *__pyx_r = NULL;
11182 __Pyx_RefNannyDeclarations
11183 __Pyx_RefNannySetupContext(
"clifford_hidden_doctests", 0);
11192 __Pyx_XDECREF(__pyx_r);
11193 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11206 __Pyx_XGIVEREF(__pyx_r);
11207 __Pyx_RefNannyFinishContext();
11219 static PyObject *__pyx_pw_8PyClical_11inv(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11220 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_inv(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11221 PyObject *__pyx_r = NULL;
11222 __Pyx_RefNannyDeclarations
11223 PyObject *__pyx_t_1 = NULL;
11224 PyObject *__pyx_t_2 = NULL;
11225 PyObject *__pyx_t_3 = NULL;
11226 __Pyx_RefNannySetupContext(
"inv", 0);
11235 __Pyx_XDECREF(__pyx_r);
11236 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1342, __pyx_L1_error)
11237 __Pyx_GOTREF(__pyx_t_2);
11238 __Pyx_INCREF(__pyx_v_obj);
11239 __Pyx_GIVEREF(__pyx_v_obj);
11240 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj);
11241 __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)
11242 __Pyx_GOTREF(__pyx_t_3);
11243 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11244 __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)
11245 __Pyx_GOTREF(__pyx_t_2);
11246 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11248 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
11249 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
11250 if (likely(__pyx_t_3)) {
11251 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
11252 __Pyx_INCREF(__pyx_t_3);
11253 __Pyx_INCREF(
function);
11254 __Pyx_DECREF_SET(__pyx_t_2,
function);
11258 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1342, __pyx_L1_error)
11259 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11261 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1342, __pyx_L1_error)
11263 __Pyx_GOTREF(__pyx_t_1);
11264 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11265 __pyx_r = __pyx_t_1;
11279 __Pyx_XDECREF(__pyx_t_1);
11280 __Pyx_XDECREF(__pyx_t_2);
11281 __Pyx_XDECREF(__pyx_t_3);
11282 __Pyx_AddTraceback(
"PyClical.inv", __pyx_clineno, __pyx_lineno, __pyx_filename);
11285 __Pyx_XGIVEREF(__pyx_r);
11286 __Pyx_RefNannyFinishContext();
11291 static PyObject *__pyx_pw_8PyClical_11inv(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11292 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 ";
11293 static PyObject *__pyx_pw_8PyClical_11inv(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11294 PyObject *__pyx_r = 0;
11295 __Pyx_RefNannyDeclarations
11296 __Pyx_RefNannySetupContext(
"inv (wrapper)", 0);
11297 __pyx_r = __pyx_pf_8PyClical_10inv(__pyx_self, ((PyObject *)__pyx_v_obj));
11300 __Pyx_RefNannyFinishContext();
11304 static PyObject *__pyx_pf_8PyClical_10inv(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11305 PyObject *__pyx_r = NULL;
11306 __Pyx_RefNannyDeclarations
11307 PyObject *__pyx_t_1 = NULL;
11308 __Pyx_RefNannySetupContext(
"inv", 0);
11309 __Pyx_XDECREF(__pyx_r);
11310 __pyx_t_1 = __pyx_f_8PyClical_inv(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1329, __pyx_L1_error)
11311 __Pyx_GOTREF(__pyx_t_1);
11312 __pyx_r = __pyx_t_1;
11318 __Pyx_XDECREF(__pyx_t_1);
11319 __Pyx_AddTraceback(
"PyClical.inv", __pyx_clineno, __pyx_lineno, __pyx_filename);
11322 __Pyx_XGIVEREF(__pyx_r);
11323 __Pyx_RefNannyFinishContext();
11335 static PyObject *__pyx_pw_8PyClical_13scalar(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11336 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_scalar(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11337 PyObject *__pyx_r = NULL;
11338 __Pyx_RefNannyDeclarations
11339 PyObject *__pyx_t_1 = NULL;
11340 PyObject *__pyx_t_2 = NULL;
11341 PyObject *__pyx_t_3 = NULL;
11342 __Pyx_RefNannySetupContext(
"scalar", 0);
11351 __Pyx_XDECREF(__pyx_r);
11352 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1353, __pyx_L1_error)
11353 __Pyx_GOTREF(__pyx_t_2);
11354 __Pyx_INCREF(__pyx_v_obj);
11355 __Pyx_GIVEREF(__pyx_v_obj);
11356 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj);
11357 __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)
11358 __Pyx_GOTREF(__pyx_t_3);
11359 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11360 __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)
11361 __Pyx_GOTREF(__pyx_t_2);
11362 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11364 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
11365 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
11366 if (likely(__pyx_t_3)) {
11367 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
11368 __Pyx_INCREF(__pyx_t_3);
11369 __Pyx_INCREF(
function);
11370 __Pyx_DECREF_SET(__pyx_t_2,
function);
11374 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1353, __pyx_L1_error)
11375 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11377 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1353, __pyx_L1_error)
11379 __Pyx_GOTREF(__pyx_t_1);
11380 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11381 __pyx_r = __pyx_t_1;
11395 __Pyx_XDECREF(__pyx_t_1);
11396 __Pyx_XDECREF(__pyx_t_2);
11397 __Pyx_XDECREF(__pyx_t_3);
11398 __Pyx_AddTraceback(
"PyClical.scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
11401 __Pyx_XGIVEREF(__pyx_r);
11402 __Pyx_RefNannyFinishContext();
11407 static PyObject *__pyx_pw_8PyClical_13scalar(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11408 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 ";
11409 static PyObject *__pyx_pw_8PyClical_13scalar(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11410 PyObject *__pyx_r = 0;
11411 __Pyx_RefNannyDeclarations
11412 __Pyx_RefNannySetupContext(
"scalar (wrapper)", 0);
11413 __pyx_r = __pyx_pf_8PyClical_12scalar(__pyx_self, ((PyObject *)__pyx_v_obj));
11416 __Pyx_RefNannyFinishContext();
11420 static PyObject *__pyx_pf_8PyClical_12scalar(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11421 PyObject *__pyx_r = NULL;
11422 __Pyx_RefNannyDeclarations
11423 PyObject *__pyx_t_1 = NULL;
11424 __Pyx_RefNannySetupContext(
"scalar", 0);
11425 __Pyx_XDECREF(__pyx_r);
11426 __pyx_t_1 = __pyx_f_8PyClical_scalar(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1344, __pyx_L1_error)
11427 __Pyx_GOTREF(__pyx_t_1);
11428 __pyx_r = __pyx_t_1;
11434 __Pyx_XDECREF(__pyx_t_1);
11435 __Pyx_AddTraceback(
"PyClical.scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
11438 __Pyx_XGIVEREF(__pyx_r);
11439 __Pyx_RefNannyFinishContext();
11451 static PyObject *__pyx_pw_8PyClical_15real(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11452 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_real(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11453 PyObject *__pyx_r = NULL;
11454 __Pyx_RefNannyDeclarations
11455 PyObject *__pyx_t_1 = NULL;
11456 PyObject *__pyx_t_2 = NULL;
11457 PyObject *__pyx_t_3 = NULL;
11458 __Pyx_RefNannySetupContext(
"real", 0);
11467 __Pyx_XDECREF(__pyx_r);
11468 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1364, __pyx_L1_error)
11469 __Pyx_GOTREF(__pyx_t_2);
11470 __Pyx_INCREF(__pyx_v_obj);
11471 __Pyx_GIVEREF(__pyx_v_obj);
11472 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj);
11473 __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)
11474 __Pyx_GOTREF(__pyx_t_3);
11475 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11476 __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)
11477 __Pyx_GOTREF(__pyx_t_2);
11478 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11480 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
11481 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
11482 if (likely(__pyx_t_3)) {
11483 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
11484 __Pyx_INCREF(__pyx_t_3);
11485 __Pyx_INCREF(
function);
11486 __Pyx_DECREF_SET(__pyx_t_2,
function);
11490 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1364, __pyx_L1_error)
11491 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11493 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1364, __pyx_L1_error)
11495 __Pyx_GOTREF(__pyx_t_1);
11496 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11497 __pyx_r = __pyx_t_1;
11511 __Pyx_XDECREF(__pyx_t_1);
11512 __Pyx_XDECREF(__pyx_t_2);
11513 __Pyx_XDECREF(__pyx_t_3);
11514 __Pyx_AddTraceback(
"PyClical.real", __pyx_clineno, __pyx_lineno, __pyx_filename);
11517 __Pyx_XGIVEREF(__pyx_r);
11518 __Pyx_RefNannyFinishContext();
11523 static PyObject *__pyx_pw_8PyClical_15real(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11524 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 ";
11525 static PyObject *__pyx_pw_8PyClical_15real(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11526 PyObject *__pyx_r = 0;
11527 __Pyx_RefNannyDeclarations
11528 __Pyx_RefNannySetupContext(
"real (wrapper)", 0);
11529 __pyx_r = __pyx_pf_8PyClical_14real(__pyx_self, ((PyObject *)__pyx_v_obj));
11532 __Pyx_RefNannyFinishContext();
11536 static PyObject *__pyx_pf_8PyClical_14real(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11537 PyObject *__pyx_r = NULL;
11538 __Pyx_RefNannyDeclarations
11539 PyObject *__pyx_t_1 = NULL;
11540 __Pyx_RefNannySetupContext(
"real", 0);
11541 __Pyx_XDECREF(__pyx_r);
11542 __pyx_t_1 = __pyx_f_8PyClical_real(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1355, __pyx_L1_error)
11543 __Pyx_GOTREF(__pyx_t_1);
11544 __pyx_r = __pyx_t_1;
11550 __Pyx_XDECREF(__pyx_t_1);
11551 __Pyx_AddTraceback(
"PyClical.real", __pyx_clineno, __pyx_lineno, __pyx_filename);
11554 __Pyx_XGIVEREF(__pyx_r);
11555 __Pyx_RefNannyFinishContext();
11567 static PyObject *__pyx_pw_8PyClical_17imag(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11568 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_imag(CYTHON_UNUSED PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11569 PyObject *__pyx_r = NULL;
11570 __Pyx_RefNannyDeclarations
11571 __Pyx_RefNannySetupContext(
"imag", 0);
11580 __Pyx_XDECREF(__pyx_r);
11581 __Pyx_INCREF(__pyx_float_0_0);
11582 __pyx_r = __pyx_float_0_0;
11595 __Pyx_XGIVEREF(__pyx_r);
11596 __Pyx_RefNannyFinishContext();
11601 static PyObject *__pyx_pw_8PyClical_17imag(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11602 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 ";
11603 static PyObject *__pyx_pw_8PyClical_17imag(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11604 PyObject *__pyx_r = 0;
11605 __Pyx_RefNannyDeclarations
11606 __Pyx_RefNannySetupContext(
"imag (wrapper)", 0);
11607 __pyx_r = __pyx_pf_8PyClical_16imag(__pyx_self, ((PyObject *)__pyx_v_obj));
11610 __Pyx_RefNannyFinishContext();
11614 static PyObject *__pyx_pf_8PyClical_16imag(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11615 PyObject *__pyx_r = NULL;
11616 __Pyx_RefNannyDeclarations
11617 PyObject *__pyx_t_1 = NULL;
11618 __Pyx_RefNannySetupContext(
"imag", 0);
11619 __Pyx_XDECREF(__pyx_r);
11620 __pyx_t_1 = __pyx_f_8PyClical_imag(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1366, __pyx_L1_error)
11621 __Pyx_GOTREF(__pyx_t_1);
11622 __pyx_r = __pyx_t_1;
11628 __Pyx_XDECREF(__pyx_t_1);
11629 __Pyx_AddTraceback(
"PyClical.imag", __pyx_clineno, __pyx_lineno, __pyx_filename);
11632 __Pyx_XGIVEREF(__pyx_r);
11633 __Pyx_RefNannyFinishContext();
11645 static PyObject *__pyx_pw_8PyClical_19pure(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11646 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_pure(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11647 PyObject *__pyx_r = NULL;
11648 __Pyx_RefNannyDeclarations
11649 PyObject *__pyx_t_1 = NULL;
11650 PyObject *__pyx_t_2 = NULL;
11651 PyObject *__pyx_t_3 = NULL;
11652 __Pyx_RefNannySetupContext(
"pure", 0);
11661 __Pyx_XDECREF(__pyx_r);
11662 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1386, __pyx_L1_error)
11663 __Pyx_GOTREF(__pyx_t_2);
11664 __Pyx_INCREF(__pyx_v_obj);
11665 __Pyx_GIVEREF(__pyx_v_obj);
11666 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj);
11667 __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)
11668 __Pyx_GOTREF(__pyx_t_3);
11669 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11670 __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)
11671 __Pyx_GOTREF(__pyx_t_2);
11672 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11674 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
11675 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
11676 if (likely(__pyx_t_3)) {
11677 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
11678 __Pyx_INCREF(__pyx_t_3);
11679 __Pyx_INCREF(
function);
11680 __Pyx_DECREF_SET(__pyx_t_2,
function);
11684 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1386, __pyx_L1_error)
11685 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11687 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1386, __pyx_L1_error)
11689 __Pyx_GOTREF(__pyx_t_1);
11690 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11691 __pyx_r = __pyx_t_1;
11705 __Pyx_XDECREF(__pyx_t_1);
11706 __Pyx_XDECREF(__pyx_t_2);
11707 __Pyx_XDECREF(__pyx_t_3);
11708 __Pyx_AddTraceback(
"PyClical.pure", __pyx_clineno, __pyx_lineno, __pyx_filename);
11711 __Pyx_XGIVEREF(__pyx_r);
11712 __Pyx_RefNannyFinishContext();
11717 static PyObject *__pyx_pw_8PyClical_19pure(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11718 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 ";
11719 static PyObject *__pyx_pw_8PyClical_19pure(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11720 PyObject *__pyx_r = 0;
11721 __Pyx_RefNannyDeclarations
11722 __Pyx_RefNannySetupContext(
"pure (wrapper)", 0);
11723 __pyx_r = __pyx_pf_8PyClical_18pure(__pyx_self, ((PyObject *)__pyx_v_obj));
11726 __Pyx_RefNannyFinishContext();
11730 static PyObject *__pyx_pf_8PyClical_18pure(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11731 PyObject *__pyx_r = NULL;
11732 __Pyx_RefNannyDeclarations
11733 PyObject *__pyx_t_1 = NULL;
11734 __Pyx_RefNannySetupContext(
"pure", 0);
11735 __Pyx_XDECREF(__pyx_r);
11736 __pyx_t_1 = __pyx_f_8PyClical_pure(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1377, __pyx_L1_error)
11737 __Pyx_GOTREF(__pyx_t_1);
11738 __pyx_r = __pyx_t_1;
11744 __Pyx_XDECREF(__pyx_t_1);
11745 __Pyx_AddTraceback(
"PyClical.pure", __pyx_clineno, __pyx_lineno, __pyx_filename);
11748 __Pyx_XGIVEREF(__pyx_r);
11749 __Pyx_RefNannyFinishContext();
11761 static PyObject *__pyx_pw_8PyClical_21even(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11762 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_even(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11763 PyObject *__pyx_r = NULL;
11764 __Pyx_RefNannyDeclarations
11765 PyObject *__pyx_t_1 = NULL;
11766 PyObject *__pyx_t_2 = NULL;
11767 PyObject *__pyx_t_3 = NULL;
11768 __Pyx_RefNannySetupContext(
"even", 0);
11777 __Pyx_XDECREF(__pyx_r);
11778 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1395, __pyx_L1_error)
11779 __Pyx_GOTREF(__pyx_t_2);
11780 __Pyx_INCREF(__pyx_v_obj);
11781 __Pyx_GIVEREF(__pyx_v_obj);
11782 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj);
11783 __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)
11784 __Pyx_GOTREF(__pyx_t_3);
11785 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11786 __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)
11787 __Pyx_GOTREF(__pyx_t_2);
11788 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11790 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
11791 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
11792 if (likely(__pyx_t_3)) {
11793 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
11794 __Pyx_INCREF(__pyx_t_3);
11795 __Pyx_INCREF(
function);
11796 __Pyx_DECREF_SET(__pyx_t_2,
function);
11800 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1395, __pyx_L1_error)
11801 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11803 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1395, __pyx_L1_error)
11805 __Pyx_GOTREF(__pyx_t_1);
11806 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11807 __pyx_r = __pyx_t_1;
11821 __Pyx_XDECREF(__pyx_t_1);
11822 __Pyx_XDECREF(__pyx_t_2);
11823 __Pyx_XDECREF(__pyx_t_3);
11824 __Pyx_AddTraceback(
"PyClical.even", __pyx_clineno, __pyx_lineno, __pyx_filename);
11827 __Pyx_XGIVEREF(__pyx_r);
11828 __Pyx_RefNannyFinishContext();
11833 static PyObject *__pyx_pw_8PyClical_21even(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11834 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 ";
11835 static PyObject *__pyx_pw_8PyClical_21even(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11836 PyObject *__pyx_r = 0;
11837 __Pyx_RefNannyDeclarations
11838 __Pyx_RefNannySetupContext(
"even (wrapper)", 0);
11839 __pyx_r = __pyx_pf_8PyClical_20even(__pyx_self, ((PyObject *)__pyx_v_obj));
11842 __Pyx_RefNannyFinishContext();
11846 static PyObject *__pyx_pf_8PyClical_20even(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11847 PyObject *__pyx_r = NULL;
11848 __Pyx_RefNannyDeclarations
11849 PyObject *__pyx_t_1 = NULL;
11850 __Pyx_RefNannySetupContext(
"even", 0);
11851 __Pyx_XDECREF(__pyx_r);
11852 __pyx_t_1 = __pyx_f_8PyClical_even(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1388, __pyx_L1_error)
11853 __Pyx_GOTREF(__pyx_t_1);
11854 __pyx_r = __pyx_t_1;
11860 __Pyx_XDECREF(__pyx_t_1);
11861 __Pyx_AddTraceback(
"PyClical.even", __pyx_clineno, __pyx_lineno, __pyx_filename);
11864 __Pyx_XGIVEREF(__pyx_r);
11865 __Pyx_RefNannyFinishContext();
11877 static PyObject *__pyx_pw_8PyClical_23odd(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11878 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_odd(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11879 PyObject *__pyx_r = NULL;
11880 __Pyx_RefNannyDeclarations
11881 PyObject *__pyx_t_1 = NULL;
11882 PyObject *__pyx_t_2 = NULL;
11883 PyObject *__pyx_t_3 = NULL;
11884 __Pyx_RefNannySetupContext(
"odd", 0);
11893 __Pyx_XDECREF(__pyx_r);
11894 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1404, __pyx_L1_error)
11895 __Pyx_GOTREF(__pyx_t_2);
11896 __Pyx_INCREF(__pyx_v_obj);
11897 __Pyx_GIVEREF(__pyx_v_obj);
11898 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj);
11899 __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)
11900 __Pyx_GOTREF(__pyx_t_3);
11901 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11902 __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)
11903 __Pyx_GOTREF(__pyx_t_2);
11904 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11906 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
11907 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
11908 if (likely(__pyx_t_3)) {
11909 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
11910 __Pyx_INCREF(__pyx_t_3);
11911 __Pyx_INCREF(
function);
11912 __Pyx_DECREF_SET(__pyx_t_2,
function);
11916 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1404, __pyx_L1_error)
11917 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11919 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1404, __pyx_L1_error)
11921 __Pyx_GOTREF(__pyx_t_1);
11922 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11923 __pyx_r = __pyx_t_1;
11937 __Pyx_XDECREF(__pyx_t_1);
11938 __Pyx_XDECREF(__pyx_t_2);
11939 __Pyx_XDECREF(__pyx_t_3);
11940 __Pyx_AddTraceback(
"PyClical.odd", __pyx_clineno, __pyx_lineno, __pyx_filename);
11943 __Pyx_XGIVEREF(__pyx_r);
11944 __Pyx_RefNannyFinishContext();
11949 static PyObject *__pyx_pw_8PyClical_23odd(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11950 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 ";
11951 static PyObject *__pyx_pw_8PyClical_23odd(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11952 PyObject *__pyx_r = 0;
11953 __Pyx_RefNannyDeclarations
11954 __Pyx_RefNannySetupContext(
"odd (wrapper)", 0);
11955 __pyx_r = __pyx_pf_8PyClical_22odd(__pyx_self, ((PyObject *)__pyx_v_obj));
11958 __Pyx_RefNannyFinishContext();
11962 static PyObject *__pyx_pf_8PyClical_22odd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11963 PyObject *__pyx_r = NULL;
11964 __Pyx_RefNannyDeclarations
11965 PyObject *__pyx_t_1 = NULL;
11966 __Pyx_RefNannySetupContext(
"odd", 0);
11967 __Pyx_XDECREF(__pyx_r);
11968 __pyx_t_1 = __pyx_f_8PyClical_odd(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1397, __pyx_L1_error)
11969 __Pyx_GOTREF(__pyx_t_1);
11970 __pyx_r = __pyx_t_1;
11976 __Pyx_XDECREF(__pyx_t_1);
11977 __Pyx_AddTraceback(
"PyClical.odd", __pyx_clineno, __pyx_lineno, __pyx_filename);
11980 __Pyx_XGIVEREF(__pyx_r);
11981 __Pyx_RefNannyFinishContext();
11993 static PyObject *__pyx_pw_8PyClical_25involute(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11994 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_involute(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11995 PyObject *__pyx_r = NULL;
11996 __Pyx_RefNannyDeclarations
11997 PyObject *__pyx_t_1 = NULL;
11998 PyObject *__pyx_t_2 = NULL;
11999 PyObject *__pyx_t_3 = NULL;
12000 __Pyx_RefNannySetupContext(
"involute", 0);
12009 __Pyx_XDECREF(__pyx_r);
12010 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1419, __pyx_L1_error)
12011 __Pyx_GOTREF(__pyx_t_2);
12012 __Pyx_INCREF(__pyx_v_obj);
12013 __Pyx_GIVEREF(__pyx_v_obj);
12014 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj);
12015 __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)
12016 __Pyx_GOTREF(__pyx_t_3);
12017 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12018 __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)
12019 __Pyx_GOTREF(__pyx_t_2);
12020 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12022 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
12023 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
12024 if (likely(__pyx_t_3)) {
12025 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
12026 __Pyx_INCREF(__pyx_t_3);
12027 __Pyx_INCREF(
function);
12028 __Pyx_DECREF_SET(__pyx_t_2,
function);
12032 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1419, __pyx_L1_error)
12033 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12035 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1419, __pyx_L1_error)
12037 __Pyx_GOTREF(__pyx_t_1);
12038 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12039 __pyx_r = __pyx_t_1;
12053 __Pyx_XDECREF(__pyx_t_1);
12054 __Pyx_XDECREF(__pyx_t_2);
12055 __Pyx_XDECREF(__pyx_t_3);
12056 __Pyx_AddTraceback(
"PyClical.involute", __pyx_clineno, __pyx_lineno, __pyx_filename);
12059 __Pyx_XGIVEREF(__pyx_r);
12060 __Pyx_RefNannyFinishContext();
12065 static PyObject *__pyx_pw_8PyClical_25involute(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12066 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 ";
12067 static PyObject *__pyx_pw_8PyClical_25involute(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12068 PyObject *__pyx_r = 0;
12069 __Pyx_RefNannyDeclarations
12070 __Pyx_RefNannySetupContext(
"involute (wrapper)", 0);
12071 __pyx_r = __pyx_pf_8PyClical_24involute(__pyx_self, ((PyObject *)__pyx_v_obj));
12074 __Pyx_RefNannyFinishContext();
12078 static PyObject *__pyx_pf_8PyClical_24involute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12079 PyObject *__pyx_r = NULL;
12080 __Pyx_RefNannyDeclarations
12081 PyObject *__pyx_t_1 = NULL;
12082 __Pyx_RefNannySetupContext(
"involute", 0);
12083 __Pyx_XDECREF(__pyx_r);
12084 __pyx_t_1 = __pyx_f_8PyClical_involute(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1406, __pyx_L1_error)
12085 __Pyx_GOTREF(__pyx_t_1);
12086 __pyx_r = __pyx_t_1;
12092 __Pyx_XDECREF(__pyx_t_1);
12093 __Pyx_AddTraceback(
"PyClical.involute", __pyx_clineno, __pyx_lineno, __pyx_filename);
12096 __Pyx_XGIVEREF(__pyx_r);
12097 __Pyx_RefNannyFinishContext();
12109 static PyObject *__pyx_pw_8PyClical_27reverse(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12110 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_reverse(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12111 PyObject *__pyx_r = NULL;
12112 __Pyx_RefNannyDeclarations
12113 PyObject *__pyx_t_1 = NULL;
12114 PyObject *__pyx_t_2 = NULL;
12115 PyObject *__pyx_t_3 = NULL;
12116 __Pyx_RefNannySetupContext(
"reverse", 0);
12125 __Pyx_XDECREF(__pyx_r);
12126 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1434, __pyx_L1_error)
12127 __Pyx_GOTREF(__pyx_t_2);
12128 __Pyx_INCREF(__pyx_v_obj);
12129 __Pyx_GIVEREF(__pyx_v_obj);
12130 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj);
12131 __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)
12132 __Pyx_GOTREF(__pyx_t_3);
12133 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12134 __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)
12135 __Pyx_GOTREF(__pyx_t_2);
12136 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12138 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
12139 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
12140 if (likely(__pyx_t_3)) {
12141 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
12142 __Pyx_INCREF(__pyx_t_3);
12143 __Pyx_INCREF(
function);
12144 __Pyx_DECREF_SET(__pyx_t_2,
function);
12148 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1434, __pyx_L1_error)
12149 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12151 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1434, __pyx_L1_error)
12153 __Pyx_GOTREF(__pyx_t_1);
12154 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12155 __pyx_r = __pyx_t_1;
12169 __Pyx_XDECREF(__pyx_t_1);
12170 __Pyx_XDECREF(__pyx_t_2);
12171 __Pyx_XDECREF(__pyx_t_3);
12172 __Pyx_AddTraceback(
"PyClical.reverse", __pyx_clineno, __pyx_lineno, __pyx_filename);
12175 __Pyx_XGIVEREF(__pyx_r);
12176 __Pyx_RefNannyFinishContext();
12181 static PyObject *__pyx_pw_8PyClical_27reverse(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12182 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 ";
12183 static PyObject *__pyx_pw_8PyClical_27reverse(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12184 PyObject *__pyx_r = 0;
12185 __Pyx_RefNannyDeclarations
12186 __Pyx_RefNannySetupContext(
"reverse (wrapper)", 0);
12187 __pyx_r = __pyx_pf_8PyClical_26reverse(__pyx_self, ((PyObject *)__pyx_v_obj));
12190 __Pyx_RefNannyFinishContext();
12194 static PyObject *__pyx_pf_8PyClical_26reverse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12195 PyObject *__pyx_r = NULL;
12196 __Pyx_RefNannyDeclarations
12197 PyObject *__pyx_t_1 = NULL;
12198 __Pyx_RefNannySetupContext(
"reverse", 0);
12199 __Pyx_XDECREF(__pyx_r);
12200 __pyx_t_1 = __pyx_f_8PyClical_reverse(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1421, __pyx_L1_error)
12201 __Pyx_GOTREF(__pyx_t_1);
12202 __pyx_r = __pyx_t_1;
12208 __Pyx_XDECREF(__pyx_t_1);
12209 __Pyx_AddTraceback(
"PyClical.reverse", __pyx_clineno, __pyx_lineno, __pyx_filename);
12212 __Pyx_XGIVEREF(__pyx_r);
12213 __Pyx_RefNannyFinishContext();
12225 static PyObject *__pyx_pw_8PyClical_29conj(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12226 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_conj(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12227 PyObject *__pyx_r = NULL;
12228 __Pyx_RefNannyDeclarations
12229 PyObject *__pyx_t_1 = NULL;
12230 PyObject *__pyx_t_2 = NULL;
12231 PyObject *__pyx_t_3 = NULL;
12232 __Pyx_RefNannySetupContext(
"conj", 0);
12241 __Pyx_XDECREF(__pyx_r);
12242 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1449, __pyx_L1_error)
12243 __Pyx_GOTREF(__pyx_t_2);
12244 __Pyx_INCREF(__pyx_v_obj);
12245 __Pyx_GIVEREF(__pyx_v_obj);
12246 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj);
12247 __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)
12248 __Pyx_GOTREF(__pyx_t_3);
12249 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12250 __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)
12251 __Pyx_GOTREF(__pyx_t_2);
12252 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12254 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
12255 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
12256 if (likely(__pyx_t_3)) {
12257 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
12258 __Pyx_INCREF(__pyx_t_3);
12259 __Pyx_INCREF(
function);
12260 __Pyx_DECREF_SET(__pyx_t_2,
function);
12264 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1449, __pyx_L1_error)
12265 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12267 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1449, __pyx_L1_error)
12269 __Pyx_GOTREF(__pyx_t_1);
12270 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12271 __pyx_r = __pyx_t_1;
12285 __Pyx_XDECREF(__pyx_t_1);
12286 __Pyx_XDECREF(__pyx_t_2);
12287 __Pyx_XDECREF(__pyx_t_3);
12288 __Pyx_AddTraceback(
"PyClical.conj", __pyx_clineno, __pyx_lineno, __pyx_filename);
12291 __Pyx_XGIVEREF(__pyx_r);
12292 __Pyx_RefNannyFinishContext();
12297 static PyObject *__pyx_pw_8PyClical_29conj(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12298 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 ";
12299 static PyObject *__pyx_pw_8PyClical_29conj(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12300 PyObject *__pyx_r = 0;
12301 __Pyx_RefNannyDeclarations
12302 __Pyx_RefNannySetupContext(
"conj (wrapper)", 0);
12303 __pyx_r = __pyx_pf_8PyClical_28conj(__pyx_self, ((PyObject *)__pyx_v_obj));
12306 __Pyx_RefNannyFinishContext();
12310 static PyObject *__pyx_pf_8PyClical_28conj(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12311 PyObject *__pyx_r = NULL;
12312 __Pyx_RefNannyDeclarations
12313 PyObject *__pyx_t_1 = NULL;
12314 __Pyx_RefNannySetupContext(
"conj", 0);
12315 __Pyx_XDECREF(__pyx_r);
12316 __pyx_t_1 = __pyx_f_8PyClical_conj(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1436, __pyx_L1_error)
12317 __Pyx_GOTREF(__pyx_t_1);
12318 __pyx_r = __pyx_t_1;
12324 __Pyx_XDECREF(__pyx_t_1);
12325 __Pyx_AddTraceback(
"PyClical.conj", __pyx_clineno, __pyx_lineno, __pyx_filename);
12328 __Pyx_XGIVEREF(__pyx_r);
12329 __Pyx_RefNannyFinishContext();
12341 static PyObject *__pyx_pw_8PyClical_31quad(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12342 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_quad(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12343 PyObject *__pyx_r = NULL;
12344 __Pyx_RefNannyDeclarations
12345 PyObject *__pyx_t_1 = NULL;
12346 PyObject *__pyx_t_2 = NULL;
12347 PyObject *__pyx_t_3 = NULL;
12348 __Pyx_RefNannySetupContext(
"quad", 0);
12357 __Pyx_XDECREF(__pyx_r);
12358 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1460, __pyx_L1_error)
12359 __Pyx_GOTREF(__pyx_t_2);
12360 __Pyx_INCREF(__pyx_v_obj);
12361 __Pyx_GIVEREF(__pyx_v_obj);
12362 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj);
12363 __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)
12364 __Pyx_GOTREF(__pyx_t_3);
12365 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12366 __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)
12367 __Pyx_GOTREF(__pyx_t_2);
12368 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12370 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
12371 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
12372 if (likely(__pyx_t_3)) {
12373 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
12374 __Pyx_INCREF(__pyx_t_3);
12375 __Pyx_INCREF(
function);
12376 __Pyx_DECREF_SET(__pyx_t_2,
function);
12380 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1460, __pyx_L1_error)
12381 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12383 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1460, __pyx_L1_error)
12385 __Pyx_GOTREF(__pyx_t_1);
12386 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12387 __pyx_r = __pyx_t_1;
12401 __Pyx_XDECREF(__pyx_t_1);
12402 __Pyx_XDECREF(__pyx_t_2);
12403 __Pyx_XDECREF(__pyx_t_3);
12404 __Pyx_AddTraceback(
"PyClical.quad", __pyx_clineno, __pyx_lineno, __pyx_filename);
12407 __Pyx_XGIVEREF(__pyx_r);
12408 __Pyx_RefNannyFinishContext();
12413 static PyObject *__pyx_pw_8PyClical_31quad(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12414 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 ";
12415 static PyObject *__pyx_pw_8PyClical_31quad(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12416 PyObject *__pyx_r = 0;
12417 __Pyx_RefNannyDeclarations
12418 __Pyx_RefNannySetupContext(
"quad (wrapper)", 0);
12419 __pyx_r = __pyx_pf_8PyClical_30quad(__pyx_self, ((PyObject *)__pyx_v_obj));
12422 __Pyx_RefNannyFinishContext();
12426 static PyObject *__pyx_pf_8PyClical_30quad(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12427 PyObject *__pyx_r = NULL;
12428 __Pyx_RefNannyDeclarations
12429 PyObject *__pyx_t_1 = NULL;
12430 __Pyx_RefNannySetupContext(
"quad", 0);
12431 __Pyx_XDECREF(__pyx_r);
12432 __pyx_t_1 = __pyx_f_8PyClical_quad(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1451, __pyx_L1_error)
12433 __Pyx_GOTREF(__pyx_t_1);
12434 __pyx_r = __pyx_t_1;
12440 __Pyx_XDECREF(__pyx_t_1);
12441 __Pyx_AddTraceback(
"PyClical.quad", __pyx_clineno, __pyx_lineno, __pyx_filename);
12444 __Pyx_XGIVEREF(__pyx_r);
12445 __Pyx_RefNannyFinishContext();
12457 static PyObject *__pyx_pw_8PyClical_33norm(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12458 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_norm(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12459 PyObject *__pyx_r = NULL;
12460 __Pyx_RefNannyDeclarations
12461 PyObject *__pyx_t_1 = NULL;
12462 PyObject *__pyx_t_2 = NULL;
12463 PyObject *__pyx_t_3 = NULL;
12464 __Pyx_RefNannySetupContext(
"norm", 0);
12473 __Pyx_XDECREF(__pyx_r);
12474 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1471, __pyx_L1_error)
12475 __Pyx_GOTREF(__pyx_t_2);
12476 __Pyx_INCREF(__pyx_v_obj);
12477 __Pyx_GIVEREF(__pyx_v_obj);
12478 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj);
12479 __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)
12480 __Pyx_GOTREF(__pyx_t_3);
12481 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12482 __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)
12483 __Pyx_GOTREF(__pyx_t_2);
12484 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12486 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
12487 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
12488 if (likely(__pyx_t_3)) {
12489 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
12490 __Pyx_INCREF(__pyx_t_3);
12491 __Pyx_INCREF(
function);
12492 __Pyx_DECREF_SET(__pyx_t_2,
function);
12496 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1471, __pyx_L1_error)
12497 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12499 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1471, __pyx_L1_error)
12501 __Pyx_GOTREF(__pyx_t_1);
12502 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12503 __pyx_r = __pyx_t_1;
12517 __Pyx_XDECREF(__pyx_t_1);
12518 __Pyx_XDECREF(__pyx_t_2);
12519 __Pyx_XDECREF(__pyx_t_3);
12520 __Pyx_AddTraceback(
"PyClical.norm", __pyx_clineno, __pyx_lineno, __pyx_filename);
12523 __Pyx_XGIVEREF(__pyx_r);
12524 __Pyx_RefNannyFinishContext();
12529 static PyObject *__pyx_pw_8PyClical_33norm(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12530 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 ";
12531 static PyObject *__pyx_pw_8PyClical_33norm(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12532 PyObject *__pyx_r = 0;
12533 __Pyx_RefNannyDeclarations
12534 __Pyx_RefNannySetupContext(
"norm (wrapper)", 0);
12535 __pyx_r = __pyx_pf_8PyClical_32norm(__pyx_self, ((PyObject *)__pyx_v_obj));
12538 __Pyx_RefNannyFinishContext();
12542 static PyObject *__pyx_pf_8PyClical_32norm(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12543 PyObject *__pyx_r = NULL;
12544 __Pyx_RefNannyDeclarations
12545 PyObject *__pyx_t_1 = NULL;
12546 __Pyx_RefNannySetupContext(
"norm", 0);
12547 __Pyx_XDECREF(__pyx_r);
12548 __pyx_t_1 = __pyx_f_8PyClical_norm(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1462, __pyx_L1_error)
12549 __Pyx_GOTREF(__pyx_t_1);
12550 __pyx_r = __pyx_t_1;
12556 __Pyx_XDECREF(__pyx_t_1);
12557 __Pyx_AddTraceback(
"PyClical.norm", __pyx_clineno, __pyx_lineno, __pyx_filename);
12560 __Pyx_XGIVEREF(__pyx_r);
12561 __Pyx_RefNannyFinishContext();
12573 static PyObject *__pyx_pw_8PyClical_35abs(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12574 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_abs(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12575 PyObject *__pyx_r = NULL;
12576 __Pyx_RefNannyDeclarations
12577 PyObject *__pyx_t_1 = NULL;
12578 __Pyx_RefNannySetupContext(
"abs", 0);
12587 __Pyx_XDECREF(__pyx_r);
12588 __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)
12589 __Pyx_GOTREF(__pyx_t_1);
12590 __pyx_r = __pyx_t_1;
12604 __Pyx_XDECREF(__pyx_t_1);
12605 __Pyx_AddTraceback(
"PyClical.abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
12608 __Pyx_XGIVEREF(__pyx_r);
12609 __Pyx_RefNannyFinishContext();
12614 static PyObject *__pyx_pw_8PyClical_35abs(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12615 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 ";
12616 static PyObject *__pyx_pw_8PyClical_35abs(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12617 PyObject *__pyx_r = 0;
12618 __Pyx_RefNannyDeclarations
12619 __Pyx_RefNannySetupContext(
"abs (wrapper)", 0);
12620 __pyx_r = __pyx_pf_8PyClical_34abs(__pyx_self, ((PyObject *)__pyx_v_obj));
12623 __Pyx_RefNannyFinishContext();
12627 static PyObject *__pyx_pf_8PyClical_34abs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12628 PyObject *__pyx_r = NULL;
12629 __Pyx_RefNannyDeclarations
12630 PyObject *__pyx_t_1 = NULL;
12631 __Pyx_RefNannySetupContext(
"abs", 0);
12632 __Pyx_XDECREF(__pyx_r);
12633 __pyx_t_1 = __pyx_f_8PyClical_abs(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1473, __pyx_L1_error)
12634 __Pyx_GOTREF(__pyx_t_1);
12635 __pyx_r = __pyx_t_1;
12641 __Pyx_XDECREF(__pyx_t_1);
12642 __Pyx_AddTraceback(
"PyClical.abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
12645 __Pyx_XGIVEREF(__pyx_r);
12646 __Pyx_RefNannyFinishContext();
12658 static PyObject *__pyx_pw_8PyClical_37max_abs(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12659 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_max_abs(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12660 PyObject *__pyx_r = NULL;
12661 __Pyx_RefNannyDeclarations
12662 PyObject *__pyx_t_1 = NULL;
12663 __Pyx_RefNannySetupContext(
"max_abs", 0);
12672 __Pyx_XDECREF(__pyx_r);
12673 __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)
12674 __Pyx_GOTREF(__pyx_t_1);
12675 __pyx_r = __pyx_t_1;
12689 __Pyx_XDECREF(__pyx_t_1);
12690 __Pyx_AddTraceback(
"PyClical.max_abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
12693 __Pyx_XGIVEREF(__pyx_r);
12694 __Pyx_RefNannyFinishContext();
12699 static PyObject *__pyx_pw_8PyClical_37max_abs(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12700 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 ";
12701 static PyObject *__pyx_pw_8PyClical_37max_abs(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12702 PyObject *__pyx_r = 0;
12703 __Pyx_RefNannyDeclarations
12704 __Pyx_RefNannySetupContext(
"max_abs (wrapper)", 0);
12705 __pyx_r = __pyx_pf_8PyClical_36max_abs(__pyx_self, ((PyObject *)__pyx_v_obj));
12708 __Pyx_RefNannyFinishContext();
12712 static PyObject *__pyx_pf_8PyClical_36max_abs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12713 PyObject *__pyx_r = NULL;
12714 __Pyx_RefNannyDeclarations
12715 PyObject *__pyx_t_1 = NULL;
12716 __Pyx_RefNannySetupContext(
"max_abs", 0);
12717 __Pyx_XDECREF(__pyx_r);
12718 __pyx_t_1 = __pyx_f_8PyClical_max_abs(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1482, __pyx_L1_error)
12719 __Pyx_GOTREF(__pyx_t_1);
12720 __pyx_r = __pyx_t_1;
12726 __Pyx_XDECREF(__pyx_t_1);
12727 __Pyx_AddTraceback(
"PyClical.max_abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
12730 __Pyx_XGIVEREF(__pyx_r);
12731 __Pyx_RefNannyFinishContext();
12743 static PyObject *__pyx_pw_8PyClical_39pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
12744 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_pow(PyObject *__pyx_v_obj, PyObject *__pyx_v_m, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12745 PyObject *__pyx_r = NULL;
12746 __Pyx_RefNannyDeclarations
12747 PyObject *__pyx_t_1 = NULL;
12748 PyObject *__pyx_t_2 = NULL;
12749 PyObject *__pyx_t_3 = NULL;
12750 PyObject *__pyx_t_4 = NULL;
12751 PyObject *__pyx_t_5 = NULL;
12752 PyObject *__pyx_t_6 = NULL;
12754 PyObject *__pyx_t_8 = NULL;
12755 PyObject *__pyx_t_9 = NULL;
12756 PyObject *__pyx_t_10 = NULL;
12757 PyObject *__pyx_t_11 = NULL;
12758 __Pyx_RefNannySetupContext(
"pow", 0);
12768 __Pyx_PyThreadState_declare
12769 __Pyx_PyThreadState_assign
12770 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
12771 __Pyx_XGOTREF(__pyx_t_1);
12772 __Pyx_XGOTREF(__pyx_t_2);
12773 __Pyx_XGOTREF(__pyx_t_3);
12783 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1514, __pyx_L3_error)
12784 __Pyx_GOTREF(__pyx_t_5);
12785 __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)
12786 __Pyx_GOTREF(__pyx_t_6);
12787 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12790 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
12791 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
12792 if (likely(__pyx_t_5)) {
12793 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
12794 __Pyx_INCREF(__pyx_t_5);
12795 __Pyx_INCREF(
function);
12796 __Pyx_DECREF_SET(__pyx_t_6,
function);
12800 #if CYTHON_FAST_PYCALL 12801 if (PyFunction_Check(__pyx_t_6)) {
12802 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_obj, __pyx_v_m};
12803 __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)
12804 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12805 __Pyx_GOTREF(__pyx_t_4);
12808 #if CYTHON_FAST_PYCCALL 12809 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
12810 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_obj, __pyx_v_m};
12811 __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)
12812 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12813 __Pyx_GOTREF(__pyx_t_4);
12817 __pyx_t_8 = PyTuple_New(2+__pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1514, __pyx_L3_error)
12818 __Pyx_GOTREF(__pyx_t_8);
12820 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
12822 __Pyx_INCREF(__pyx_v_obj);
12823 __Pyx_GIVEREF(__pyx_v_obj);
12824 PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_obj);
12825 __Pyx_INCREF(__pyx_v_m);
12826 __Pyx_GIVEREF(__pyx_v_m);
12827 PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_m);
12828 __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)
12829 __Pyx_GOTREF(__pyx_t_4);
12830 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12832 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12833 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12843 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12844 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12845 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12846 goto __pyx_L8_try_end;
12848 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12849 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
12850 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12851 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12861 __Pyx_AddTraceback(
"PyClical.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
12862 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_8) < 0) __PYX_ERR(0, 1515, __pyx_L5_except_error)
12863 __Pyx_GOTREF(__pyx_t_4);
12864 __Pyx_GOTREF(__pyx_t_6);
12865 __Pyx_GOTREF(__pyx_t_8);
12874 __Pyx_XDECREF(__pyx_r);
12875 __pyx_t_9 = PyTuple_New(1);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1516, __pyx_L5_except_error)
12876 __Pyx_GOTREF(__pyx_t_9);
12877 __Pyx_INCREF(__pyx_v_obj);
12878 __Pyx_GIVEREF(__pyx_v_obj);
12879 PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_obj);
12880 __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)
12881 __Pyx_GOTREF(__pyx_t_10);
12882 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12883 __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)
12884 __Pyx_GOTREF(__pyx_t_9);
12885 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12887 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
12888 __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
12889 if (likely(__pyx_t_10)) {
12890 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
12891 __Pyx_INCREF(__pyx_t_10);
12892 __Pyx_INCREF(
function);
12893 __Pyx_DECREF_SET(__pyx_t_9,
function);
12897 __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)
12898 __Pyx_GOTREF(__pyx_t_5);
12900 #if CYTHON_FAST_PYCALL 12901 if (PyFunction_Check(__pyx_t_9)) {
12902 PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_v_m};
12903 __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)
12904 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
12905 __Pyx_GOTREF(__pyx_t_5);
12908 #if CYTHON_FAST_PYCCALL 12909 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
12910 PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_v_m};
12911 __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)
12912 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
12913 __Pyx_GOTREF(__pyx_t_5);
12917 __pyx_t_11 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1516, __pyx_L5_except_error)
12918 __Pyx_GOTREF(__pyx_t_11);
12919 __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL;
12920 __Pyx_INCREF(__pyx_v_m);
12921 __Pyx_GIVEREF(__pyx_v_m);
12922 PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_v_m);
12923 __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)
12924 __Pyx_GOTREF(__pyx_t_5);
12925 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
12928 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12929 __pyx_r = __pyx_t_5;
12931 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12932 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12933 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12934 goto __pyx_L6_except_return;
12936 __pyx_L5_except_error:;
12945 __Pyx_XGIVEREF(__pyx_t_1);
12946 __Pyx_XGIVEREF(__pyx_t_2);
12947 __Pyx_XGIVEREF(__pyx_t_3);
12948 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
12949 goto __pyx_L1_error;
12950 __pyx_L6_except_return:;
12951 __Pyx_XGIVEREF(__pyx_t_1);
12952 __Pyx_XGIVEREF(__pyx_t_2);
12953 __Pyx_XGIVEREF(__pyx_t_3);
12954 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
12968 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12971 __Pyx_XDECREF(__pyx_t_4);
12972 __Pyx_XDECREF(__pyx_t_5);
12973 __Pyx_XDECREF(__pyx_t_6);
12974 __Pyx_XDECREF(__pyx_t_8);
12975 __Pyx_XDECREF(__pyx_t_9);
12976 __Pyx_XDECREF(__pyx_t_10);
12977 __Pyx_XDECREF(__pyx_t_11);
12978 __Pyx_AddTraceback(
"PyClical.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
12981 __Pyx_XGIVEREF(__pyx_r);
12982 __Pyx_RefNannyFinishContext();
12987 static PyObject *__pyx_pw_8PyClical_39pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
12988 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 ";
12989 static PyObject *__pyx_pw_8PyClical_39pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
12990 PyObject *__pyx_v_obj = 0;
12991 PyObject *__pyx_v_m = 0;
12992 PyObject *__pyx_r = 0;
12993 __Pyx_RefNannyDeclarations
12994 __Pyx_RefNannySetupContext(
"pow (wrapper)", 0);
12996 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_m,0};
12997 PyObject* values[2] = {0,0};
12998 if (unlikely(__pyx_kwds)) {
12999 Py_ssize_t kw_args;
13000 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13001 switch (pos_args) {
13002 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13003 CYTHON_FALLTHROUGH;
13004 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13005 CYTHON_FALLTHROUGH;
13007 default:
goto __pyx_L5_argtuple_error;
13009 kw_args = PyDict_Size(__pyx_kwds);
13010 switch (pos_args) {
13012 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
13013 else goto __pyx_L5_argtuple_error;
13014 CYTHON_FALLTHROUGH;
13016 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
13018 __Pyx_RaiseArgtupleInvalid(
"pow", 1, 2, 2, 1); __PYX_ERR(0, 1494, __pyx_L3_error)
13021 if (unlikely(kw_args > 0)) {
13022 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"pow") < 0)) __PYX_ERR(0, 1494, __pyx_L3_error)
13024 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
13025 goto __pyx_L5_argtuple_error;
13027 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13028 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13030 __pyx_v_obj = values[0];
13031 __pyx_v_m = values[1];
13033 goto __pyx_L4_argument_unpacking_done;
13034 __pyx_L5_argtuple_error:;
13035 __Pyx_RaiseArgtupleInvalid(
"pow", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1494, __pyx_L3_error)
13037 __Pyx_AddTraceback(
"PyClical.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
13038 __Pyx_RefNannyFinishContext();
13040 __pyx_L4_argument_unpacking_done:;
13041 __pyx_r = __pyx_pf_8PyClical_38pow(__pyx_self, __pyx_v_obj, __pyx_v_m);
13044 __Pyx_RefNannyFinishContext();
13048 static PyObject *__pyx_pf_8PyClical_38pow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_m) {
13049 PyObject *__pyx_r = NULL;
13050 __Pyx_RefNannyDeclarations
13051 PyObject *__pyx_t_1 = NULL;
13052 __Pyx_RefNannySetupContext(
"pow", 0);
13053 __Pyx_XDECREF(__pyx_r);
13054 __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)
13055 __Pyx_GOTREF(__pyx_t_1);
13056 __pyx_r = __pyx_t_1;
13062 __Pyx_XDECREF(__pyx_t_1);
13063 __Pyx_AddTraceback(
"PyClical.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
13066 __Pyx_XGIVEREF(__pyx_r);
13067 __Pyx_RefNannyFinishContext();
13079 static PyObject *__pyx_pw_8PyClical_41outer_pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13080 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_outer_pow(PyObject *__pyx_v_obj, PyObject *__pyx_v_m, CYTHON_UNUSED
int __pyx_skip_dispatch) {
13081 PyObject *__pyx_r = NULL;
13082 __Pyx_RefNannyDeclarations
13083 PyObject *__pyx_t_1 = NULL;
13084 PyObject *__pyx_t_2 = NULL;
13085 PyObject *__pyx_t_3 = NULL;
13086 PyObject *__pyx_t_4 = NULL;
13087 __Pyx_RefNannySetupContext(
"outer_pow", 0);
13096 __Pyx_XDECREF(__pyx_r);
13097 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1525, __pyx_L1_error)
13098 __Pyx_GOTREF(__pyx_t_2);
13099 __Pyx_INCREF(__pyx_v_obj);
13100 __Pyx_GIVEREF(__pyx_v_obj);
13101 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj);
13102 __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)
13103 __Pyx_GOTREF(__pyx_t_3);
13104 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13105 __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)
13106 __Pyx_GOTREF(__pyx_t_2);
13107 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13109 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
13110 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
13111 if (likely(__pyx_t_3)) {
13112 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
13113 __Pyx_INCREF(__pyx_t_3);
13114 __Pyx_INCREF(
function);
13115 __Pyx_DECREF_SET(__pyx_t_2,
function);
13119 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_m);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1525, __pyx_L1_error)
13120 __Pyx_GOTREF(__pyx_t_1);
13122 #if CYTHON_FAST_PYCALL 13123 if (PyFunction_Check(__pyx_t_2)) {
13124 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_m};
13125 __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)
13126 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13127 __Pyx_GOTREF(__pyx_t_1);
13130 #if CYTHON_FAST_PYCCALL 13131 if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
13132 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_m};
13133 __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)
13134 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13135 __Pyx_GOTREF(__pyx_t_1);
13139 __pyx_t_4 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1525, __pyx_L1_error)
13140 __Pyx_GOTREF(__pyx_t_4);
13141 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
13142 __Pyx_INCREF(__pyx_v_m);
13143 __Pyx_GIVEREF(__pyx_v_m);
13144 PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_m);
13145 __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)
13146 __Pyx_GOTREF(__pyx_t_1);
13147 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13150 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13151 __pyx_r = __pyx_t_1;
13165 __Pyx_XDECREF(__pyx_t_1);
13166 __Pyx_XDECREF(__pyx_t_2);
13167 __Pyx_XDECREF(__pyx_t_3);
13168 __Pyx_XDECREF(__pyx_t_4);
13169 __Pyx_AddTraceback(
"PyClical.outer_pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
13172 __Pyx_XGIVEREF(__pyx_r);
13173 __Pyx_RefNannyFinishContext();
13178 static PyObject *__pyx_pw_8PyClical_41outer_pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13179 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 ";
13180 static PyObject *__pyx_pw_8PyClical_41outer_pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13181 PyObject *__pyx_v_obj = 0;
13182 PyObject *__pyx_v_m = 0;
13183 PyObject *__pyx_r = 0;
13184 __Pyx_RefNannyDeclarations
13185 __Pyx_RefNannySetupContext(
"outer_pow (wrapper)", 0);
13187 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_m,0};
13188 PyObject* values[2] = {0,0};
13189 if (unlikely(__pyx_kwds)) {
13190 Py_ssize_t kw_args;
13191 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13192 switch (pos_args) {
13193 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13194 CYTHON_FALLTHROUGH;
13195 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13196 CYTHON_FALLTHROUGH;
13198 default:
goto __pyx_L5_argtuple_error;
13200 kw_args = PyDict_Size(__pyx_kwds);
13201 switch (pos_args) {
13203 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
13204 else goto __pyx_L5_argtuple_error;
13205 CYTHON_FALLTHROUGH;
13207 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
13209 __Pyx_RaiseArgtupleInvalid(
"outer_pow", 1, 2, 2, 1); __PYX_ERR(0, 1518, __pyx_L3_error)
13212 if (unlikely(kw_args > 0)) {
13213 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"outer_pow") < 0)) __PYX_ERR(0, 1518, __pyx_L3_error)
13215 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
13216 goto __pyx_L5_argtuple_error;
13218 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13219 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13221 __pyx_v_obj = values[0];
13222 __pyx_v_m = values[1];
13224 goto __pyx_L4_argument_unpacking_done;
13225 __pyx_L5_argtuple_error:;
13226 __Pyx_RaiseArgtupleInvalid(
"outer_pow", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1518, __pyx_L3_error)
13228 __Pyx_AddTraceback(
"PyClical.outer_pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
13229 __Pyx_RefNannyFinishContext();
13231 __pyx_L4_argument_unpacking_done:;
13232 __pyx_r = __pyx_pf_8PyClical_40outer_pow(__pyx_self, __pyx_v_obj, __pyx_v_m);
13235 __Pyx_RefNannyFinishContext();
13239 static PyObject *__pyx_pf_8PyClical_40outer_pow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_m) {
13240 PyObject *__pyx_r = NULL;
13241 __Pyx_RefNannyDeclarations
13242 PyObject *__pyx_t_1 = NULL;
13243 __Pyx_RefNannySetupContext(
"outer_pow", 0);
13244 __Pyx_XDECREF(__pyx_r);
13245 __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)
13246 __Pyx_GOTREF(__pyx_t_1);
13247 __pyx_r = __pyx_t_1;
13253 __Pyx_XDECREF(__pyx_t_1);
13254 __Pyx_AddTraceback(
"PyClical.outer_pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
13257 __Pyx_XGIVEREF(__pyx_r);
13258 __Pyx_RefNannyFinishContext();
13270 static PyObject *__pyx_pw_8PyClical_43complexifier(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13271 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_complexifier(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
13272 PyObject *__pyx_r = NULL;
13273 __Pyx_RefNannyDeclarations
13274 PyObject *__pyx_t_1 = NULL;
13275 PyObject *__pyx_t_2 = NULL;
13276 __Pyx_RefNannySetupContext(
"complexifier", 0);
13285 __Pyx_XDECREF(__pyx_r);
13286 __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)
13287 __Pyx_GOTREF(__pyx_t_1);
13288 __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)
13289 __Pyx_GOTREF(__pyx_t_2);
13290 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13291 __pyx_r = __pyx_t_2;
13305 __Pyx_XDECREF(__pyx_t_1);
13306 __Pyx_XDECREF(__pyx_t_2);
13307 __Pyx_AddTraceback(
"PyClical.complexifier", __pyx_clineno, __pyx_lineno, __pyx_filename);
13310 __Pyx_XGIVEREF(__pyx_r);
13311 __Pyx_RefNannyFinishContext();
13316 static PyObject *__pyx_pw_8PyClical_43complexifier(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13317 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 ";
13318 static PyObject *__pyx_pw_8PyClical_43complexifier(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13319 PyObject *__pyx_r = 0;
13320 __Pyx_RefNannyDeclarations
13321 __Pyx_RefNannySetupContext(
"complexifier (wrapper)", 0);
13322 __pyx_r = __pyx_pf_8PyClical_42complexifier(__pyx_self, ((PyObject *)__pyx_v_obj));
13325 __Pyx_RefNannyFinishContext();
13329 static PyObject *__pyx_pf_8PyClical_42complexifier(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13330 PyObject *__pyx_r = NULL;
13331 __Pyx_RefNannyDeclarations
13332 PyObject *__pyx_t_1 = NULL;
13333 __Pyx_RefNannySetupContext(
"complexifier", 0);
13334 __Pyx_XDECREF(__pyx_r);
13335 __pyx_t_1 = __pyx_f_8PyClical_complexifier(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1527, __pyx_L1_error)
13336 __Pyx_GOTREF(__pyx_t_1);
13337 __pyx_r = __pyx_t_1;
13343 __Pyx_XDECREF(__pyx_t_1);
13344 __Pyx_AddTraceback(
"PyClical.complexifier", __pyx_clineno, __pyx_lineno, __pyx_filename);
13347 __Pyx_XGIVEREF(__pyx_r);
13348 __Pyx_RefNannyFinishContext();
13360 static PyObject *__pyx_pw_8PyClical_45sqrt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13361 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) {
13362 PyObject *__pyx_v_i = ((PyObject *)Py_None);
13363 PyObject *__pyx_r = NULL;
13364 __Pyx_RefNannyDeclarations
13367 PyObject *__pyx_t_3 = NULL;
13369 PyObject *__pyx_t_5 = NULL;
13370 PyObject *__pyx_t_6 = NULL;
13371 PyObject *__pyx_t_7 = NULL;
13372 PyObject *__pyx_t_8 = NULL;
13373 PyObject *__pyx_t_9 = NULL;
13374 PyObject *__pyx_t_10 = NULL;
13375 PyObject *__pyx_t_11 = NULL;
13376 __Pyx_RefNannySetupContext(
"sqrt", 0);
13377 if (__pyx_optional_args) {
13378 if (__pyx_optional_args->__pyx_n > 0) {
13379 __pyx_v_i = __pyx_optional_args->i;
13390 __pyx_t_1 = (__pyx_v_i != Py_None);
13391 __pyx_t_2 = (__pyx_t_1 != 0);
13401 __Pyx_XDECREF(__pyx_r);
13402 __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)
13403 __Pyx_GOTREF(__pyx_t_3);
13405 __pyx_t_4 =
sqrt(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
13407 __Pyx_CppExn2PyErr();
13408 __PYX_ERR(0, 1558, __pyx_L1_error)
13410 __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)
13411 __Pyx_GOTREF(__pyx_t_5);
13412 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13413 __pyx_r = __pyx_t_5;
13435 __Pyx_PyThreadState_declare
13436 __Pyx_PyThreadState_assign
13437 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
13438 __Pyx_XGOTREF(__pyx_t_6);
13439 __Pyx_XGOTREF(__pyx_t_7);
13440 __Pyx_XGOTREF(__pyx_t_8);
13450 __Pyx_XDECREF(__pyx_r);
13451 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1561, __pyx_L4_error)
13452 __Pyx_GOTREF(__pyx_t_3);
13453 __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)
13454 __Pyx_GOTREF(__pyx_t_9);
13455 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13457 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
13458 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
13459 if (likely(__pyx_t_3)) {
13460 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
13461 __Pyx_INCREF(__pyx_t_3);
13462 __Pyx_INCREF(
function);
13463 __Pyx_DECREF_SET(__pyx_t_9,
function);
13467 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1561, __pyx_L4_error)
13468 __Pyx_GOTREF(__pyx_t_5);
13470 #if CYTHON_FAST_PYCALL 13471 if (PyFunction_Check(__pyx_t_9)) {
13472 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
13473 __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)
13474 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13475 __Pyx_GOTREF(__pyx_t_5);
13478 #if CYTHON_FAST_PYCCALL 13479 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
13480 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
13481 __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)
13482 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13483 __Pyx_GOTREF(__pyx_t_5);
13487 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1561, __pyx_L4_error)
13488 __Pyx_GOTREF(__pyx_t_10);
13489 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
13490 __Pyx_INCREF(__pyx_v_obj);
13491 __Pyx_GIVEREF(__pyx_v_obj);
13492 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
13493 __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)
13494 __Pyx_GOTREF(__pyx_t_5);
13495 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13498 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13499 __pyx_r = __pyx_t_5;
13501 goto __pyx_L8_try_return;
13512 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13513 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
13514 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
13515 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13525 __Pyx_AddTraceback(
"PyClical.sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename);
13526 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1562, __pyx_L6_except_error)
13527 __Pyx_GOTREF(__pyx_t_5);
13528 __Pyx_GOTREF(__pyx_t_9);
13529 __Pyx_GOTREF(__pyx_t_10);
13538 __Pyx_XDECREF(__pyx_r);
13539 __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)
13540 __Pyx_GOTREF(__pyx_t_3);
13541 __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)
13542 __Pyx_GOTREF(__pyx_t_11);
13543 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13544 __pyx_r = __pyx_t_11;
13546 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13547 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13548 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13549 goto __pyx_L7_except_return;
13551 __pyx_L6_except_error:;
13560 __Pyx_XGIVEREF(__pyx_t_6);
13561 __Pyx_XGIVEREF(__pyx_t_7);
13562 __Pyx_XGIVEREF(__pyx_t_8);
13563 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
13564 goto __pyx_L1_error;
13565 __pyx_L8_try_return:;
13566 __Pyx_XGIVEREF(__pyx_t_6);
13567 __Pyx_XGIVEREF(__pyx_t_7);
13568 __Pyx_XGIVEREF(__pyx_t_8);
13569 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
13571 __pyx_L7_except_return:;
13572 __Pyx_XGIVEREF(__pyx_t_6);
13573 __Pyx_XGIVEREF(__pyx_t_7);
13574 __Pyx_XGIVEREF(__pyx_t_8);
13575 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
13590 __Pyx_XDECREF(__pyx_t_3);
13591 __Pyx_XDECREF(__pyx_t_5);
13592 __Pyx_XDECREF(__pyx_t_9);
13593 __Pyx_XDECREF(__pyx_t_10);
13594 __Pyx_XDECREF(__pyx_t_11);
13595 __Pyx_AddTraceback(
"PyClical.sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename);
13598 __Pyx_XGIVEREF(__pyx_r);
13599 __Pyx_RefNannyFinishContext();
13604 static PyObject *__pyx_pw_8PyClical_45sqrt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13605 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 ";
13606 static PyObject *__pyx_pw_8PyClical_45sqrt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13607 PyObject *__pyx_v_obj = 0;
13608 PyObject *__pyx_v_i = 0;
13609 PyObject *__pyx_r = 0;
13610 __Pyx_RefNannyDeclarations
13611 __Pyx_RefNannySetupContext(
"sqrt (wrapper)", 0);
13613 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
13614 PyObject* values[2] = {0,0};
13615 values[1] = ((PyObject *)Py_None);
13616 if (unlikely(__pyx_kwds)) {
13617 Py_ssize_t kw_args;
13618 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13619 switch (pos_args) {
13620 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13621 CYTHON_FALLTHROUGH;
13622 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13623 CYTHON_FALLTHROUGH;
13625 default:
goto __pyx_L5_argtuple_error;
13627 kw_args = PyDict_Size(__pyx_kwds);
13628 switch (pos_args) {
13630 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
13631 else goto __pyx_L5_argtuple_error;
13632 CYTHON_FALLTHROUGH;
13635 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i);
13636 if (value) { values[1] = value; kw_args--; }
13639 if (unlikely(kw_args > 0)) {
13640 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"sqrt") < 0)) __PYX_ERR(0, 1542, __pyx_L3_error)
13643 switch (PyTuple_GET_SIZE(__pyx_args)) {
13644 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13645 CYTHON_FALLTHROUGH;
13646 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13648 default:
goto __pyx_L5_argtuple_error;
13651 __pyx_v_obj = values[0];
13652 __pyx_v_i = values[1];
13654 goto __pyx_L4_argument_unpacking_done;
13655 __pyx_L5_argtuple_error:;
13656 __Pyx_RaiseArgtupleInvalid(
"sqrt", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1542, __pyx_L3_error)
13658 __Pyx_AddTraceback(
"PyClical.sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename);
13659 __Pyx_RefNannyFinishContext();
13661 __pyx_L4_argument_unpacking_done:;
13662 __pyx_r = __pyx_pf_8PyClical_44sqrt(__pyx_self, __pyx_v_obj, __pyx_v_i);
13665 __Pyx_RefNannyFinishContext();
13669 static PyObject *__pyx_pf_8PyClical_44sqrt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
13670 PyObject *__pyx_r = NULL;
13671 __Pyx_RefNannyDeclarations
13672 PyObject *__pyx_t_1 = NULL;
13673 struct __pyx_opt_args_8PyClical_sqrt __pyx_t_2;
13674 __Pyx_RefNannySetupContext(
"sqrt", 0);
13675 __Pyx_XDECREF(__pyx_r);
13676 __pyx_t_2.__pyx_n = 1;
13677 __pyx_t_2.i = __pyx_v_i;
13678 __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)
13679 __Pyx_GOTREF(__pyx_t_1);
13680 __pyx_r = __pyx_t_1;
13686 __Pyx_XDECREF(__pyx_t_1);
13687 __Pyx_AddTraceback(
"PyClical.sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename);
13690 __Pyx_XGIVEREF(__pyx_r);
13691 __Pyx_RefNannyFinishContext();
13703 static PyObject *__pyx_pw_8PyClical_47exp(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13704 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_exp(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
13705 PyObject *__pyx_r = NULL;
13706 __Pyx_RefNannyDeclarations
13707 PyObject *__pyx_t_1 = NULL;
13708 PyObject *__pyx_t_2 = NULL;
13709 PyObject *__pyx_t_3 = NULL;
13710 PyObject *__pyx_t_4 = NULL;
13711 PyObject *__pyx_t_5 = NULL;
13712 PyObject *__pyx_t_6 = NULL;
13713 PyObject *__pyx_t_7 = NULL;
13714 PyObject *__pyx_t_8 = NULL;
13715 __Pyx_RefNannySetupContext(
"exp", 0);
13725 __Pyx_PyThreadState_declare
13726 __Pyx_PyThreadState_assign
13727 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
13728 __Pyx_XGOTREF(__pyx_t_1);
13729 __Pyx_XGOTREF(__pyx_t_2);
13730 __Pyx_XGOTREF(__pyx_t_3);
13740 __Pyx_XDECREF(__pyx_r);
13741 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1575, __pyx_L3_error)
13742 __Pyx_GOTREF(__pyx_t_5);
13743 __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)
13744 __Pyx_GOTREF(__pyx_t_6);
13745 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13747 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
13748 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
13749 if (likely(__pyx_t_5)) {
13750 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
13751 __Pyx_INCREF(__pyx_t_5);
13752 __Pyx_INCREF(
function);
13753 __Pyx_DECREF_SET(__pyx_t_6,
function);
13757 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_obj);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1575, __pyx_L3_error)
13758 __Pyx_GOTREF(__pyx_t_4);
13760 #if CYTHON_FAST_PYCALL 13761 if (PyFunction_Check(__pyx_t_6)) {
13762 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_obj};
13763 __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)
13764 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13765 __Pyx_GOTREF(__pyx_t_4);
13768 #if CYTHON_FAST_PYCCALL 13769 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
13770 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_obj};
13771 __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)
13772 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13773 __Pyx_GOTREF(__pyx_t_4);
13777 __pyx_t_7 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1575, __pyx_L3_error)
13778 __Pyx_GOTREF(__pyx_t_7);
13779 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
13780 __Pyx_INCREF(__pyx_v_obj);
13781 __Pyx_GIVEREF(__pyx_v_obj);
13782 PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_obj);
13783 __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)
13784 __Pyx_GOTREF(__pyx_t_4);
13785 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13788 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13789 __pyx_r = __pyx_t_4;
13791 goto __pyx_L7_try_return;
13802 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13803 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
13804 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
13805 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
13815 __Pyx_AddTraceback(
"PyClical.exp", __pyx_clineno, __pyx_lineno, __pyx_filename);
13816 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1576, __pyx_L5_except_error)
13817 __Pyx_GOTREF(__pyx_t_4);
13818 __Pyx_GOTREF(__pyx_t_6);
13819 __Pyx_GOTREF(__pyx_t_7);
13828 __Pyx_XDECREF(__pyx_r);
13829 __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)
13830 __Pyx_GOTREF(__pyx_t_5);
13831 __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)
13832 __Pyx_GOTREF(__pyx_t_8);
13833 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13834 __pyx_r = __pyx_t_8;
13836 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13837 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13838 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13839 goto __pyx_L6_except_return;
13841 __pyx_L5_except_error:;
13850 __Pyx_XGIVEREF(__pyx_t_1);
13851 __Pyx_XGIVEREF(__pyx_t_2);
13852 __Pyx_XGIVEREF(__pyx_t_3);
13853 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
13854 goto __pyx_L1_error;
13855 __pyx_L7_try_return:;
13856 __Pyx_XGIVEREF(__pyx_t_1);
13857 __Pyx_XGIVEREF(__pyx_t_2);
13858 __Pyx_XGIVEREF(__pyx_t_3);
13859 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
13861 __pyx_L6_except_return:;
13862 __Pyx_XGIVEREF(__pyx_t_1);
13863 __Pyx_XGIVEREF(__pyx_t_2);
13864 __Pyx_XGIVEREF(__pyx_t_3);
13865 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
13879 __Pyx_XDECREF(__pyx_t_4);
13880 __Pyx_XDECREF(__pyx_t_5);
13881 __Pyx_XDECREF(__pyx_t_6);
13882 __Pyx_XDECREF(__pyx_t_7);
13883 __Pyx_XDECREF(__pyx_t_8);
13884 __Pyx_AddTraceback(
"PyClical.exp", __pyx_clineno, __pyx_lineno, __pyx_filename);
13887 __Pyx_XGIVEREF(__pyx_r);
13888 __Pyx_RefNannyFinishContext();
13893 static PyObject *__pyx_pw_8PyClical_47exp(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13894 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 ";
13895 static PyObject *__pyx_pw_8PyClical_47exp(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13896 PyObject *__pyx_r = 0;
13897 __Pyx_RefNannyDeclarations
13898 __Pyx_RefNannySetupContext(
"exp (wrapper)", 0);
13899 __pyx_r = __pyx_pf_8PyClical_46exp(__pyx_self, ((PyObject *)__pyx_v_obj));
13902 __Pyx_RefNannyFinishContext();
13906 static PyObject *__pyx_pf_8PyClical_46exp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13907 PyObject *__pyx_r = NULL;
13908 __Pyx_RefNannyDeclarations
13909 PyObject *__pyx_t_1 = NULL;
13910 __Pyx_RefNannySetupContext(
"exp", 0);
13911 __Pyx_XDECREF(__pyx_r);
13912 __pyx_t_1 = __pyx_f_8PyClical_exp(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1565, __pyx_L1_error)
13913 __Pyx_GOTREF(__pyx_t_1);
13914 __pyx_r = __pyx_t_1;
13920 __Pyx_XDECREF(__pyx_t_1);
13921 __Pyx_AddTraceback(
"PyClical.exp", __pyx_clineno, __pyx_lineno, __pyx_filename);
13924 __Pyx_XGIVEREF(__pyx_r);
13925 __Pyx_RefNannyFinishContext();
13937 static PyObject *__pyx_pw_8PyClical_49log(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13938 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) {
13939 PyObject *__pyx_v_i = ((PyObject *)Py_None);
13940 PyObject *__pyx_r = NULL;
13941 __Pyx_RefNannyDeclarations
13944 PyObject *__pyx_t_3 = NULL;
13946 PyObject *__pyx_t_5 = NULL;
13947 PyObject *__pyx_t_6 = NULL;
13948 PyObject *__pyx_t_7 = NULL;
13949 PyObject *__pyx_t_8 = NULL;
13950 PyObject *__pyx_t_9 = NULL;
13951 PyObject *__pyx_t_10 = NULL;
13952 PyObject *__pyx_t_11 = NULL;
13953 __Pyx_RefNannySetupContext(
"log", 0);
13954 if (__pyx_optional_args) {
13955 if (__pyx_optional_args->__pyx_n > 0) {
13956 __pyx_v_i = __pyx_optional_args->i;
13967 __pyx_t_1 = (__pyx_v_i != Py_None);
13968 __pyx_t_2 = (__pyx_t_1 != 0);
13978 __Pyx_XDECREF(__pyx_r);
13979 __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)
13980 __Pyx_GOTREF(__pyx_t_3);
13982 __pyx_t_4 =
log(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
13984 __Pyx_CppExn2PyErr();
13985 __PYX_ERR(0, 1595, __pyx_L1_error)
13987 __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)
13988 __Pyx_GOTREF(__pyx_t_5);
13989 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13990 __pyx_r = __pyx_t_5;
14012 __Pyx_PyThreadState_declare
14013 __Pyx_PyThreadState_assign
14014 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
14015 __Pyx_XGOTREF(__pyx_t_6);
14016 __Pyx_XGOTREF(__pyx_t_7);
14017 __Pyx_XGOTREF(__pyx_t_8);
14027 __Pyx_XDECREF(__pyx_r);
14028 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1598, __pyx_L4_error)
14029 __Pyx_GOTREF(__pyx_t_3);
14030 __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)
14031 __Pyx_GOTREF(__pyx_t_9);
14032 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14034 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
14035 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
14036 if (likely(__pyx_t_3)) {
14037 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
14038 __Pyx_INCREF(__pyx_t_3);
14039 __Pyx_INCREF(
function);
14040 __Pyx_DECREF_SET(__pyx_t_9,
function);
14044 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1598, __pyx_L4_error)
14045 __Pyx_GOTREF(__pyx_t_5);
14047 #if CYTHON_FAST_PYCALL 14048 if (PyFunction_Check(__pyx_t_9)) {
14049 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
14050 __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)
14051 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14052 __Pyx_GOTREF(__pyx_t_5);
14055 #if CYTHON_FAST_PYCCALL 14056 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
14057 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
14058 __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)
14059 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14060 __Pyx_GOTREF(__pyx_t_5);
14064 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1598, __pyx_L4_error)
14065 __Pyx_GOTREF(__pyx_t_10);
14066 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
14067 __Pyx_INCREF(__pyx_v_obj);
14068 __Pyx_GIVEREF(__pyx_v_obj);
14069 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
14070 __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)
14071 __Pyx_GOTREF(__pyx_t_5);
14072 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14075 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14076 __pyx_r = __pyx_t_5;
14078 goto __pyx_L8_try_return;
14089 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14090 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
14091 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
14092 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14102 __Pyx_AddTraceback(
"PyClical.log", __pyx_clineno, __pyx_lineno, __pyx_filename);
14103 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1599, __pyx_L6_except_error)
14104 __Pyx_GOTREF(__pyx_t_5);
14105 __Pyx_GOTREF(__pyx_t_9);
14106 __Pyx_GOTREF(__pyx_t_10);
14115 __Pyx_XDECREF(__pyx_r);
14116 __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)
14117 __Pyx_GOTREF(__pyx_t_3);
14118 __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)
14119 __Pyx_GOTREF(__pyx_t_11);
14120 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14121 __pyx_r = __pyx_t_11;
14123 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14124 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14125 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14126 goto __pyx_L7_except_return;
14128 __pyx_L6_except_error:;
14137 __Pyx_XGIVEREF(__pyx_t_6);
14138 __Pyx_XGIVEREF(__pyx_t_7);
14139 __Pyx_XGIVEREF(__pyx_t_8);
14140 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14141 goto __pyx_L1_error;
14142 __pyx_L8_try_return:;
14143 __Pyx_XGIVEREF(__pyx_t_6);
14144 __Pyx_XGIVEREF(__pyx_t_7);
14145 __Pyx_XGIVEREF(__pyx_t_8);
14146 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14148 __pyx_L7_except_return:;
14149 __Pyx_XGIVEREF(__pyx_t_6);
14150 __Pyx_XGIVEREF(__pyx_t_7);
14151 __Pyx_XGIVEREF(__pyx_t_8);
14152 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14167 __Pyx_XDECREF(__pyx_t_3);
14168 __Pyx_XDECREF(__pyx_t_5);
14169 __Pyx_XDECREF(__pyx_t_9);
14170 __Pyx_XDECREF(__pyx_t_10);
14171 __Pyx_XDECREF(__pyx_t_11);
14172 __Pyx_AddTraceback(
"PyClical.log", __pyx_clineno, __pyx_lineno, __pyx_filename);
14175 __Pyx_XGIVEREF(__pyx_r);
14176 __Pyx_RefNannyFinishContext();
14181 static PyObject *__pyx_pw_8PyClical_49log(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14182 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 ";
14183 static PyObject *__pyx_pw_8PyClical_49log(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14184 PyObject *__pyx_v_obj = 0;
14185 PyObject *__pyx_v_i = 0;
14186 PyObject *__pyx_r = 0;
14187 __Pyx_RefNannyDeclarations
14188 __Pyx_RefNannySetupContext(
"log (wrapper)", 0);
14190 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
14191 PyObject* values[2] = {0,0};
14192 values[1] = ((PyObject *)Py_None);
14193 if (unlikely(__pyx_kwds)) {
14194 Py_ssize_t kw_args;
14195 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14196 switch (pos_args) {
14197 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14198 CYTHON_FALLTHROUGH;
14199 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14200 CYTHON_FALLTHROUGH;
14202 default:
goto __pyx_L5_argtuple_error;
14204 kw_args = PyDict_Size(__pyx_kwds);
14205 switch (pos_args) {
14207 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
14208 else goto __pyx_L5_argtuple_error;
14209 CYTHON_FALLTHROUGH;
14212 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i);
14213 if (value) { values[1] = value; kw_args--; }
14216 if (unlikely(kw_args > 0)) {
14217 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"log") < 0)) __PYX_ERR(0, 1579, __pyx_L3_error)
14220 switch (PyTuple_GET_SIZE(__pyx_args)) {
14221 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14222 CYTHON_FALLTHROUGH;
14223 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14225 default:
goto __pyx_L5_argtuple_error;
14228 __pyx_v_obj = values[0];
14229 __pyx_v_i = values[1];
14231 goto __pyx_L4_argument_unpacking_done;
14232 __pyx_L5_argtuple_error:;
14233 __Pyx_RaiseArgtupleInvalid(
"log", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1579, __pyx_L3_error)
14235 __Pyx_AddTraceback(
"PyClical.log", __pyx_clineno, __pyx_lineno, __pyx_filename);
14236 __Pyx_RefNannyFinishContext();
14238 __pyx_L4_argument_unpacking_done:;
14239 __pyx_r = __pyx_pf_8PyClical_48log(__pyx_self, __pyx_v_obj, __pyx_v_i);
14242 __Pyx_RefNannyFinishContext();
14246 static PyObject *__pyx_pf_8PyClical_48log(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
14247 PyObject *__pyx_r = NULL;
14248 __Pyx_RefNannyDeclarations
14249 PyObject *__pyx_t_1 = NULL;
14250 struct __pyx_opt_args_8PyClical_log __pyx_t_2;
14251 __Pyx_RefNannySetupContext(
"log", 0);
14252 __Pyx_XDECREF(__pyx_r);
14253 __pyx_t_2.__pyx_n = 1;
14254 __pyx_t_2.i = __pyx_v_i;
14255 __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)
14256 __Pyx_GOTREF(__pyx_t_1);
14257 __pyx_r = __pyx_t_1;
14263 __Pyx_XDECREF(__pyx_t_1);
14264 __Pyx_AddTraceback(
"PyClical.log", __pyx_clineno, __pyx_lineno, __pyx_filename);
14267 __Pyx_XGIVEREF(__pyx_r);
14268 __Pyx_RefNannyFinishContext();
14280 static PyObject *__pyx_pw_8PyClical_51cos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14281 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) {
14282 PyObject *__pyx_v_i = ((PyObject *)Py_None);
14283 PyObject *__pyx_r = NULL;
14284 __Pyx_RefNannyDeclarations
14287 PyObject *__pyx_t_3 = NULL;
14289 PyObject *__pyx_t_5 = NULL;
14290 PyObject *__pyx_t_6 = NULL;
14291 PyObject *__pyx_t_7 = NULL;
14292 PyObject *__pyx_t_8 = NULL;
14293 PyObject *__pyx_t_9 = NULL;
14294 PyObject *__pyx_t_10 = NULL;
14295 PyObject *__pyx_t_11 = NULL;
14296 __Pyx_RefNannySetupContext(
"cos", 0);
14297 if (__pyx_optional_args) {
14298 if (__pyx_optional_args->__pyx_n > 0) {
14299 __pyx_v_i = __pyx_optional_args->i;
14310 __pyx_t_1 = (__pyx_v_i != Py_None);
14311 __pyx_t_2 = (__pyx_t_1 != 0);
14321 __Pyx_XDECREF(__pyx_r);
14322 __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)
14323 __Pyx_GOTREF(__pyx_t_3);
14325 __pyx_t_4 =
cos(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
14327 __Pyx_CppExn2PyErr();
14328 __PYX_ERR(0, 1612, __pyx_L1_error)
14330 __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)
14331 __Pyx_GOTREF(__pyx_t_5);
14332 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14333 __pyx_r = __pyx_t_5;
14355 __Pyx_PyThreadState_declare
14356 __Pyx_PyThreadState_assign
14357 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
14358 __Pyx_XGOTREF(__pyx_t_6);
14359 __Pyx_XGOTREF(__pyx_t_7);
14360 __Pyx_XGOTREF(__pyx_t_8);
14370 __Pyx_XDECREF(__pyx_r);
14371 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1615, __pyx_L4_error)
14372 __Pyx_GOTREF(__pyx_t_3);
14373 __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)
14374 __Pyx_GOTREF(__pyx_t_9);
14375 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14377 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
14378 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
14379 if (likely(__pyx_t_3)) {
14380 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
14381 __Pyx_INCREF(__pyx_t_3);
14382 __Pyx_INCREF(
function);
14383 __Pyx_DECREF_SET(__pyx_t_9,
function);
14387 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1615, __pyx_L4_error)
14388 __Pyx_GOTREF(__pyx_t_5);
14390 #if CYTHON_FAST_PYCALL 14391 if (PyFunction_Check(__pyx_t_9)) {
14392 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
14393 __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)
14394 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14395 __Pyx_GOTREF(__pyx_t_5);
14398 #if CYTHON_FAST_PYCCALL 14399 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
14400 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
14401 __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)
14402 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14403 __Pyx_GOTREF(__pyx_t_5);
14407 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1615, __pyx_L4_error)
14408 __Pyx_GOTREF(__pyx_t_10);
14409 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
14410 __Pyx_INCREF(__pyx_v_obj);
14411 __Pyx_GIVEREF(__pyx_v_obj);
14412 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
14413 __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)
14414 __Pyx_GOTREF(__pyx_t_5);
14415 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14418 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14419 __pyx_r = __pyx_t_5;
14421 goto __pyx_L8_try_return;
14432 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14433 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
14434 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
14435 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14445 __Pyx_AddTraceback(
"PyClical.cos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14446 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1616, __pyx_L6_except_error)
14447 __Pyx_GOTREF(__pyx_t_5);
14448 __Pyx_GOTREF(__pyx_t_9);
14449 __Pyx_GOTREF(__pyx_t_10);
14458 __Pyx_XDECREF(__pyx_r);
14459 __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)
14460 __Pyx_GOTREF(__pyx_t_3);
14461 __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)
14462 __Pyx_GOTREF(__pyx_t_11);
14463 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14464 __pyx_r = __pyx_t_11;
14466 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14467 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14468 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14469 goto __pyx_L7_except_return;
14471 __pyx_L6_except_error:;
14480 __Pyx_XGIVEREF(__pyx_t_6);
14481 __Pyx_XGIVEREF(__pyx_t_7);
14482 __Pyx_XGIVEREF(__pyx_t_8);
14483 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14484 goto __pyx_L1_error;
14485 __pyx_L8_try_return:;
14486 __Pyx_XGIVEREF(__pyx_t_6);
14487 __Pyx_XGIVEREF(__pyx_t_7);
14488 __Pyx_XGIVEREF(__pyx_t_8);
14489 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14491 __pyx_L7_except_return:;
14492 __Pyx_XGIVEREF(__pyx_t_6);
14493 __Pyx_XGIVEREF(__pyx_t_7);
14494 __Pyx_XGIVEREF(__pyx_t_8);
14495 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14510 __Pyx_XDECREF(__pyx_t_3);
14511 __Pyx_XDECREF(__pyx_t_5);
14512 __Pyx_XDECREF(__pyx_t_9);
14513 __Pyx_XDECREF(__pyx_t_10);
14514 __Pyx_XDECREF(__pyx_t_11);
14515 __Pyx_AddTraceback(
"PyClical.cos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14518 __Pyx_XGIVEREF(__pyx_r);
14519 __Pyx_RefNannyFinishContext();
14524 static PyObject *__pyx_pw_8PyClical_51cos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14525 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 ";
14526 static PyObject *__pyx_pw_8PyClical_51cos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14527 PyObject *__pyx_v_obj = 0;
14528 PyObject *__pyx_v_i = 0;
14529 PyObject *__pyx_r = 0;
14530 __Pyx_RefNannyDeclarations
14531 __Pyx_RefNannySetupContext(
"cos (wrapper)", 0);
14533 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
14534 PyObject* values[2] = {0,0};
14535 values[1] = ((PyObject *)Py_None);
14536 if (unlikely(__pyx_kwds)) {
14537 Py_ssize_t kw_args;
14538 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14539 switch (pos_args) {
14540 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14541 CYTHON_FALLTHROUGH;
14542 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14543 CYTHON_FALLTHROUGH;
14545 default:
goto __pyx_L5_argtuple_error;
14547 kw_args = PyDict_Size(__pyx_kwds);
14548 switch (pos_args) {
14550 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
14551 else goto __pyx_L5_argtuple_error;
14552 CYTHON_FALLTHROUGH;
14555 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i);
14556 if (value) { values[1] = value; kw_args--; }
14559 if (unlikely(kw_args > 0)) {
14560 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"cos") < 0)) __PYX_ERR(0, 1602, __pyx_L3_error)
14563 switch (PyTuple_GET_SIZE(__pyx_args)) {
14564 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14565 CYTHON_FALLTHROUGH;
14566 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14568 default:
goto __pyx_L5_argtuple_error;
14571 __pyx_v_obj = values[0];
14572 __pyx_v_i = values[1];
14574 goto __pyx_L4_argument_unpacking_done;
14575 __pyx_L5_argtuple_error:;
14576 __Pyx_RaiseArgtupleInvalid(
"cos", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1602, __pyx_L3_error)
14578 __Pyx_AddTraceback(
"PyClical.cos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14579 __Pyx_RefNannyFinishContext();
14581 __pyx_L4_argument_unpacking_done:;
14582 __pyx_r = __pyx_pf_8PyClical_50cos(__pyx_self, __pyx_v_obj, __pyx_v_i);
14585 __Pyx_RefNannyFinishContext();
14589 static PyObject *__pyx_pf_8PyClical_50cos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
14590 PyObject *__pyx_r = NULL;
14591 __Pyx_RefNannyDeclarations
14592 PyObject *__pyx_t_1 = NULL;
14593 struct __pyx_opt_args_8PyClical_cos __pyx_t_2;
14594 __Pyx_RefNannySetupContext(
"cos", 0);
14595 __Pyx_XDECREF(__pyx_r);
14596 __pyx_t_2.__pyx_n = 1;
14597 __pyx_t_2.i = __pyx_v_i;
14598 __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)
14599 __Pyx_GOTREF(__pyx_t_1);
14600 __pyx_r = __pyx_t_1;
14606 __Pyx_XDECREF(__pyx_t_1);
14607 __Pyx_AddTraceback(
"PyClical.cos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14610 __Pyx_XGIVEREF(__pyx_r);
14611 __Pyx_RefNannyFinishContext();
14623 static PyObject *__pyx_pw_8PyClical_53acos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14624 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) {
14625 PyObject *__pyx_v_i = ((PyObject *)Py_None);
14626 PyObject *__pyx_r = NULL;
14627 __Pyx_RefNannyDeclarations
14630 PyObject *__pyx_t_3 = NULL;
14632 PyObject *__pyx_t_5 = NULL;
14633 PyObject *__pyx_t_6 = NULL;
14634 PyObject *__pyx_t_7 = NULL;
14635 PyObject *__pyx_t_8 = NULL;
14636 PyObject *__pyx_t_9 = NULL;
14637 PyObject *__pyx_t_10 = NULL;
14638 PyObject *__pyx_t_11 = NULL;
14639 __Pyx_RefNannySetupContext(
"acos", 0);
14640 if (__pyx_optional_args) {
14641 if (__pyx_optional_args->__pyx_n > 0) {
14642 __pyx_v_i = __pyx_optional_args->i;
14653 __pyx_t_1 = (__pyx_v_i != Py_None);
14654 __pyx_t_2 = (__pyx_t_1 != 0);
14664 __Pyx_XDECREF(__pyx_r);
14665 __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)
14666 __Pyx_GOTREF(__pyx_t_3);
14668 __pyx_t_4 =
acos(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
14670 __Pyx_CppExn2PyErr();
14671 __PYX_ERR(0, 1633, __pyx_L1_error)
14673 __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)
14674 __Pyx_GOTREF(__pyx_t_5);
14675 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14676 __pyx_r = __pyx_t_5;
14698 __Pyx_PyThreadState_declare
14699 __Pyx_PyThreadState_assign
14700 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
14701 __Pyx_XGOTREF(__pyx_t_6);
14702 __Pyx_XGOTREF(__pyx_t_7);
14703 __Pyx_XGOTREF(__pyx_t_8);
14713 __Pyx_XDECREF(__pyx_r);
14714 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1636, __pyx_L4_error)
14715 __Pyx_GOTREF(__pyx_t_3);
14716 __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)
14717 __Pyx_GOTREF(__pyx_t_9);
14718 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14720 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
14721 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
14722 if (likely(__pyx_t_3)) {
14723 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
14724 __Pyx_INCREF(__pyx_t_3);
14725 __Pyx_INCREF(
function);
14726 __Pyx_DECREF_SET(__pyx_t_9,
function);
14730 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1636, __pyx_L4_error)
14731 __Pyx_GOTREF(__pyx_t_5);
14733 #if CYTHON_FAST_PYCALL 14734 if (PyFunction_Check(__pyx_t_9)) {
14735 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
14736 __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)
14737 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14738 __Pyx_GOTREF(__pyx_t_5);
14741 #if CYTHON_FAST_PYCCALL 14742 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
14743 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
14744 __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)
14745 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14746 __Pyx_GOTREF(__pyx_t_5);
14750 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1636, __pyx_L4_error)
14751 __Pyx_GOTREF(__pyx_t_10);
14752 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
14753 __Pyx_INCREF(__pyx_v_obj);
14754 __Pyx_GIVEREF(__pyx_v_obj);
14755 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
14756 __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)
14757 __Pyx_GOTREF(__pyx_t_5);
14758 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14761 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14762 __pyx_r = __pyx_t_5;
14764 goto __pyx_L8_try_return;
14775 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14776 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
14777 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
14778 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14788 __Pyx_AddTraceback(
"PyClical.acos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14789 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1637, __pyx_L6_except_error)
14790 __Pyx_GOTREF(__pyx_t_5);
14791 __Pyx_GOTREF(__pyx_t_9);
14792 __Pyx_GOTREF(__pyx_t_10);
14801 __Pyx_XDECREF(__pyx_r);
14802 __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)
14803 __Pyx_GOTREF(__pyx_t_3);
14804 __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)
14805 __Pyx_GOTREF(__pyx_t_11);
14806 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14807 __pyx_r = __pyx_t_11;
14809 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14810 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14811 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14812 goto __pyx_L7_except_return;
14814 __pyx_L6_except_error:;
14823 __Pyx_XGIVEREF(__pyx_t_6);
14824 __Pyx_XGIVEREF(__pyx_t_7);
14825 __Pyx_XGIVEREF(__pyx_t_8);
14826 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14827 goto __pyx_L1_error;
14828 __pyx_L8_try_return:;
14829 __Pyx_XGIVEREF(__pyx_t_6);
14830 __Pyx_XGIVEREF(__pyx_t_7);
14831 __Pyx_XGIVEREF(__pyx_t_8);
14832 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14834 __pyx_L7_except_return:;
14835 __Pyx_XGIVEREF(__pyx_t_6);
14836 __Pyx_XGIVEREF(__pyx_t_7);
14837 __Pyx_XGIVEREF(__pyx_t_8);
14838 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14853 __Pyx_XDECREF(__pyx_t_3);
14854 __Pyx_XDECREF(__pyx_t_5);
14855 __Pyx_XDECREF(__pyx_t_9);
14856 __Pyx_XDECREF(__pyx_t_10);
14857 __Pyx_XDECREF(__pyx_t_11);
14858 __Pyx_AddTraceback(
"PyClical.acos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14861 __Pyx_XGIVEREF(__pyx_r);
14862 __Pyx_RefNannyFinishContext();
14867 static PyObject *__pyx_pw_8PyClical_53acos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14868 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 ";
14869 static PyObject *__pyx_pw_8PyClical_53acos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14870 PyObject *__pyx_v_obj = 0;
14871 PyObject *__pyx_v_i = 0;
14872 PyObject *__pyx_r = 0;
14873 __Pyx_RefNannyDeclarations
14874 __Pyx_RefNannySetupContext(
"acos (wrapper)", 0);
14876 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
14877 PyObject* values[2] = {0,0};
14878 values[1] = ((PyObject *)Py_None);
14879 if (unlikely(__pyx_kwds)) {
14880 Py_ssize_t kw_args;
14881 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14882 switch (pos_args) {
14883 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14884 CYTHON_FALLTHROUGH;
14885 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14886 CYTHON_FALLTHROUGH;
14888 default:
goto __pyx_L5_argtuple_error;
14890 kw_args = PyDict_Size(__pyx_kwds);
14891 switch (pos_args) {
14893 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
14894 else goto __pyx_L5_argtuple_error;
14895 CYTHON_FALLTHROUGH;
14898 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i);
14899 if (value) { values[1] = value; kw_args--; }
14902 if (unlikely(kw_args > 0)) {
14903 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"acos") < 0)) __PYX_ERR(0, 1619, __pyx_L3_error)
14906 switch (PyTuple_GET_SIZE(__pyx_args)) {
14907 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14908 CYTHON_FALLTHROUGH;
14909 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14911 default:
goto __pyx_L5_argtuple_error;
14914 __pyx_v_obj = values[0];
14915 __pyx_v_i = values[1];
14917 goto __pyx_L4_argument_unpacking_done;
14918 __pyx_L5_argtuple_error:;
14919 __Pyx_RaiseArgtupleInvalid(
"acos", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1619, __pyx_L3_error)
14921 __Pyx_AddTraceback(
"PyClical.acos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14922 __Pyx_RefNannyFinishContext();
14924 __pyx_L4_argument_unpacking_done:;
14925 __pyx_r = __pyx_pf_8PyClical_52acos(__pyx_self, __pyx_v_obj, __pyx_v_i);
14928 __Pyx_RefNannyFinishContext();
14932 static PyObject *__pyx_pf_8PyClical_52acos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
14933 PyObject *__pyx_r = NULL;
14934 __Pyx_RefNannyDeclarations
14935 PyObject *__pyx_t_1 = NULL;
14936 struct __pyx_opt_args_8PyClical_acos __pyx_t_2;
14937 __Pyx_RefNannySetupContext(
"acos", 0);
14938 __Pyx_XDECREF(__pyx_r);
14939 __pyx_t_2.__pyx_n = 1;
14940 __pyx_t_2.i = __pyx_v_i;
14941 __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)
14942 __Pyx_GOTREF(__pyx_t_1);
14943 __pyx_r = __pyx_t_1;
14949 __Pyx_XDECREF(__pyx_t_1);
14950 __Pyx_AddTraceback(
"PyClical.acos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14953 __Pyx_XGIVEREF(__pyx_r);
14954 __Pyx_RefNannyFinishContext();
14966 static PyObject *__pyx_pw_8PyClical_55cosh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
14967 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cosh(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
14968 PyObject *__pyx_r = NULL;
14969 __Pyx_RefNannyDeclarations
14970 PyObject *__pyx_t_1 = NULL;
14971 PyObject *__pyx_t_2 = NULL;
14972 PyObject *__pyx_t_3 = NULL;
14973 PyObject *__pyx_t_4 = NULL;
14974 PyObject *__pyx_t_5 = NULL;
14975 PyObject *__pyx_t_6 = NULL;
14976 PyObject *__pyx_t_7 = NULL;
14977 PyObject *__pyx_t_8 = NULL;
14978 __Pyx_RefNannySetupContext(
"cosh", 0);
14988 __Pyx_PyThreadState_declare
14989 __Pyx_PyThreadState_assign
14990 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
14991 __Pyx_XGOTREF(__pyx_t_1);
14992 __Pyx_XGOTREF(__pyx_t_2);
14993 __Pyx_XGOTREF(__pyx_t_3);
15003 __Pyx_XDECREF(__pyx_r);
15004 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1652, __pyx_L3_error)
15005 __Pyx_GOTREF(__pyx_t_5);
15006 __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)
15007 __Pyx_GOTREF(__pyx_t_6);
15008 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15010 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
15011 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
15012 if (likely(__pyx_t_5)) {
15013 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
15014 __Pyx_INCREF(__pyx_t_5);
15015 __Pyx_INCREF(
function);
15016 __Pyx_DECREF_SET(__pyx_t_6,
function);
15020 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_obj);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1652, __pyx_L3_error)
15021 __Pyx_GOTREF(__pyx_t_4);
15023 #if CYTHON_FAST_PYCALL 15024 if (PyFunction_Check(__pyx_t_6)) {
15025 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_obj};
15026 __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)
15027 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15028 __Pyx_GOTREF(__pyx_t_4);
15031 #if CYTHON_FAST_PYCCALL 15032 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
15033 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_obj};
15034 __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)
15035 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15036 __Pyx_GOTREF(__pyx_t_4);
15040 __pyx_t_7 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1652, __pyx_L3_error)
15041 __Pyx_GOTREF(__pyx_t_7);
15042 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
15043 __Pyx_INCREF(__pyx_v_obj);
15044 __Pyx_GIVEREF(__pyx_v_obj);
15045 PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_obj);
15046 __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)
15047 __Pyx_GOTREF(__pyx_t_4);
15048 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15051 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15052 __pyx_r = __pyx_t_4;
15054 goto __pyx_L7_try_return;
15065 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15066 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
15067 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
15068 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
15078 __Pyx_AddTraceback(
"PyClical.cosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15079 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1653, __pyx_L5_except_error)
15080 __Pyx_GOTREF(__pyx_t_4);
15081 __Pyx_GOTREF(__pyx_t_6);
15082 __Pyx_GOTREF(__pyx_t_7);
15091 __Pyx_XDECREF(__pyx_r);
15092 __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)
15093 __Pyx_GOTREF(__pyx_t_5);
15094 __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)
15095 __Pyx_GOTREF(__pyx_t_8);
15096 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15097 __pyx_r = __pyx_t_8;
15099 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15100 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15101 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15102 goto __pyx_L6_except_return;
15104 __pyx_L5_except_error:;
15113 __Pyx_XGIVEREF(__pyx_t_1);
15114 __Pyx_XGIVEREF(__pyx_t_2);
15115 __Pyx_XGIVEREF(__pyx_t_3);
15116 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
15117 goto __pyx_L1_error;
15118 __pyx_L7_try_return:;
15119 __Pyx_XGIVEREF(__pyx_t_1);
15120 __Pyx_XGIVEREF(__pyx_t_2);
15121 __Pyx_XGIVEREF(__pyx_t_3);
15122 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
15124 __pyx_L6_except_return:;
15125 __Pyx_XGIVEREF(__pyx_t_1);
15126 __Pyx_XGIVEREF(__pyx_t_2);
15127 __Pyx_XGIVEREF(__pyx_t_3);
15128 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
15142 __Pyx_XDECREF(__pyx_t_4);
15143 __Pyx_XDECREF(__pyx_t_5);
15144 __Pyx_XDECREF(__pyx_t_6);
15145 __Pyx_XDECREF(__pyx_t_7);
15146 __Pyx_XDECREF(__pyx_t_8);
15147 __Pyx_AddTraceback(
"PyClical.cosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15150 __Pyx_XGIVEREF(__pyx_r);
15151 __Pyx_RefNannyFinishContext();
15156 static PyObject *__pyx_pw_8PyClical_55cosh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
15157 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 ";
15158 static PyObject *__pyx_pw_8PyClical_55cosh(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
15159 PyObject *__pyx_r = 0;
15160 __Pyx_RefNannyDeclarations
15161 __Pyx_RefNannySetupContext(
"cosh (wrapper)", 0);
15162 __pyx_r = __pyx_pf_8PyClical_54cosh(__pyx_self, ((PyObject *)__pyx_v_obj));
15165 __Pyx_RefNannyFinishContext();
15169 static PyObject *__pyx_pf_8PyClical_54cosh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
15170 PyObject *__pyx_r = NULL;
15171 __Pyx_RefNannyDeclarations
15172 PyObject *__pyx_t_1 = NULL;
15173 __Pyx_RefNannySetupContext(
"cosh", 0);
15174 __Pyx_XDECREF(__pyx_r);
15175 __pyx_t_1 = __pyx_f_8PyClical_cosh(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1640, __pyx_L1_error)
15176 __Pyx_GOTREF(__pyx_t_1);
15177 __pyx_r = __pyx_t_1;
15183 __Pyx_XDECREF(__pyx_t_1);
15184 __Pyx_AddTraceback(
"PyClical.cosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15187 __Pyx_XGIVEREF(__pyx_r);
15188 __Pyx_RefNannyFinishContext();
15200 static PyObject *__pyx_pw_8PyClical_57acosh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15201 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) {
15202 PyObject *__pyx_v_i = ((PyObject *)Py_None);
15203 PyObject *__pyx_r = NULL;
15204 __Pyx_RefNannyDeclarations
15207 PyObject *__pyx_t_3 = NULL;
15209 PyObject *__pyx_t_5 = NULL;
15210 PyObject *__pyx_t_6 = NULL;
15211 PyObject *__pyx_t_7 = NULL;
15212 PyObject *__pyx_t_8 = NULL;
15213 PyObject *__pyx_t_9 = NULL;
15214 PyObject *__pyx_t_10 = NULL;
15215 PyObject *__pyx_t_11 = NULL;
15216 __Pyx_RefNannySetupContext(
"acosh", 0);
15217 if (__pyx_optional_args) {
15218 if (__pyx_optional_args->__pyx_n > 0) {
15219 __pyx_v_i = __pyx_optional_args->i;
15230 __pyx_t_1 = (__pyx_v_i != Py_None);
15231 __pyx_t_2 = (__pyx_t_1 != 0);
15241 __Pyx_XDECREF(__pyx_r);
15242 __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)
15243 __Pyx_GOTREF(__pyx_t_3);
15245 __pyx_t_4 =
acosh(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
15247 __Pyx_CppExn2PyErr();
15248 __PYX_ERR(0, 1672, __pyx_L1_error)
15250 __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)
15251 __Pyx_GOTREF(__pyx_t_5);
15252 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15253 __pyx_r = __pyx_t_5;
15275 __Pyx_PyThreadState_declare
15276 __Pyx_PyThreadState_assign
15277 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
15278 __Pyx_XGOTREF(__pyx_t_6);
15279 __Pyx_XGOTREF(__pyx_t_7);
15280 __Pyx_XGOTREF(__pyx_t_8);
15290 __Pyx_XDECREF(__pyx_r);
15291 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1675, __pyx_L4_error)
15292 __Pyx_GOTREF(__pyx_t_3);
15293 __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)
15294 __Pyx_GOTREF(__pyx_t_9);
15295 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15297 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
15298 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
15299 if (likely(__pyx_t_3)) {
15300 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
15301 __Pyx_INCREF(__pyx_t_3);
15302 __Pyx_INCREF(
function);
15303 __Pyx_DECREF_SET(__pyx_t_9,
function);
15307 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1675, __pyx_L4_error)
15308 __Pyx_GOTREF(__pyx_t_5);
15310 #if CYTHON_FAST_PYCALL 15311 if (PyFunction_Check(__pyx_t_9)) {
15312 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
15313 __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)
15314 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15315 __Pyx_GOTREF(__pyx_t_5);
15318 #if CYTHON_FAST_PYCCALL 15319 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
15320 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
15321 __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)
15322 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15323 __Pyx_GOTREF(__pyx_t_5);
15327 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1675, __pyx_L4_error)
15328 __Pyx_GOTREF(__pyx_t_10);
15329 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
15330 __Pyx_INCREF(__pyx_v_obj);
15331 __Pyx_GIVEREF(__pyx_v_obj);
15332 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
15333 __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)
15334 __Pyx_GOTREF(__pyx_t_5);
15335 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15338 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15339 __pyx_r = __pyx_t_5;
15341 goto __pyx_L8_try_return;
15352 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15353 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
15354 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
15355 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15365 __Pyx_AddTraceback(
"PyClical.acosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15366 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1676, __pyx_L6_except_error)
15367 __Pyx_GOTREF(__pyx_t_5);
15368 __Pyx_GOTREF(__pyx_t_9);
15369 __Pyx_GOTREF(__pyx_t_10);
15378 __Pyx_XDECREF(__pyx_r);
15379 __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)
15380 __Pyx_GOTREF(__pyx_t_3);
15381 __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)
15382 __Pyx_GOTREF(__pyx_t_11);
15383 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15384 __pyx_r = __pyx_t_11;
15386 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15387 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15388 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15389 goto __pyx_L7_except_return;
15391 __pyx_L6_except_error:;
15400 __Pyx_XGIVEREF(__pyx_t_6);
15401 __Pyx_XGIVEREF(__pyx_t_7);
15402 __Pyx_XGIVEREF(__pyx_t_8);
15403 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15404 goto __pyx_L1_error;
15405 __pyx_L8_try_return:;
15406 __Pyx_XGIVEREF(__pyx_t_6);
15407 __Pyx_XGIVEREF(__pyx_t_7);
15408 __Pyx_XGIVEREF(__pyx_t_8);
15409 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15411 __pyx_L7_except_return:;
15412 __Pyx_XGIVEREF(__pyx_t_6);
15413 __Pyx_XGIVEREF(__pyx_t_7);
15414 __Pyx_XGIVEREF(__pyx_t_8);
15415 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15430 __Pyx_XDECREF(__pyx_t_3);
15431 __Pyx_XDECREF(__pyx_t_5);
15432 __Pyx_XDECREF(__pyx_t_9);
15433 __Pyx_XDECREF(__pyx_t_10);
15434 __Pyx_XDECREF(__pyx_t_11);
15435 __Pyx_AddTraceback(
"PyClical.acosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15438 __Pyx_XGIVEREF(__pyx_r);
15439 __Pyx_RefNannyFinishContext();
15444 static PyObject *__pyx_pw_8PyClical_57acosh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15445 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 ";
15446 static PyObject *__pyx_pw_8PyClical_57acosh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15447 PyObject *__pyx_v_obj = 0;
15448 PyObject *__pyx_v_i = 0;
15449 PyObject *__pyx_r = 0;
15450 __Pyx_RefNannyDeclarations
15451 __Pyx_RefNannySetupContext(
"acosh (wrapper)", 0);
15453 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
15454 PyObject* values[2] = {0,0};
15455 values[1] = ((PyObject *)Py_None);
15456 if (unlikely(__pyx_kwds)) {
15457 Py_ssize_t kw_args;
15458 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15459 switch (pos_args) {
15460 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15461 CYTHON_FALLTHROUGH;
15462 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15463 CYTHON_FALLTHROUGH;
15465 default:
goto __pyx_L5_argtuple_error;
15467 kw_args = PyDict_Size(__pyx_kwds);
15468 switch (pos_args) {
15470 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
15471 else goto __pyx_L5_argtuple_error;
15472 CYTHON_FALLTHROUGH;
15475 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i);
15476 if (value) { values[1] = value; kw_args--; }
15479 if (unlikely(kw_args > 0)) {
15480 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"acosh") < 0)) __PYX_ERR(0, 1656, __pyx_L3_error)
15483 switch (PyTuple_GET_SIZE(__pyx_args)) {
15484 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15485 CYTHON_FALLTHROUGH;
15486 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15488 default:
goto __pyx_L5_argtuple_error;
15491 __pyx_v_obj = values[0];
15492 __pyx_v_i = values[1];
15494 goto __pyx_L4_argument_unpacking_done;
15495 __pyx_L5_argtuple_error:;
15496 __Pyx_RaiseArgtupleInvalid(
"acosh", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1656, __pyx_L3_error)
15498 __Pyx_AddTraceback(
"PyClical.acosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15499 __Pyx_RefNannyFinishContext();
15501 __pyx_L4_argument_unpacking_done:;
15502 __pyx_r = __pyx_pf_8PyClical_56acosh(__pyx_self, __pyx_v_obj, __pyx_v_i);
15505 __Pyx_RefNannyFinishContext();
15509 static PyObject *__pyx_pf_8PyClical_56acosh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
15510 PyObject *__pyx_r = NULL;
15511 __Pyx_RefNannyDeclarations
15512 PyObject *__pyx_t_1 = NULL;
15513 struct __pyx_opt_args_8PyClical_acosh __pyx_t_2;
15514 __Pyx_RefNannySetupContext(
"acosh", 0);
15515 __Pyx_XDECREF(__pyx_r);
15516 __pyx_t_2.__pyx_n = 1;
15517 __pyx_t_2.i = __pyx_v_i;
15518 __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)
15519 __Pyx_GOTREF(__pyx_t_1);
15520 __pyx_r = __pyx_t_1;
15526 __Pyx_XDECREF(__pyx_t_1);
15527 __Pyx_AddTraceback(
"PyClical.acosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15530 __Pyx_XGIVEREF(__pyx_r);
15531 __Pyx_RefNannyFinishContext();
15543 static PyObject *__pyx_pw_8PyClical_59sin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15544 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) {
15545 PyObject *__pyx_v_i = ((PyObject *)Py_None);
15546 PyObject *__pyx_r = NULL;
15547 __Pyx_RefNannyDeclarations
15550 PyObject *__pyx_t_3 = NULL;
15552 PyObject *__pyx_t_5 = NULL;
15553 PyObject *__pyx_t_6 = NULL;
15554 PyObject *__pyx_t_7 = NULL;
15555 PyObject *__pyx_t_8 = NULL;
15556 PyObject *__pyx_t_9 = NULL;
15557 PyObject *__pyx_t_10 = NULL;
15558 PyObject *__pyx_t_11 = NULL;
15559 __Pyx_RefNannySetupContext(
"sin", 0);
15560 if (__pyx_optional_args) {
15561 if (__pyx_optional_args->__pyx_n > 0) {
15562 __pyx_v_i = __pyx_optional_args->i;
15573 __pyx_t_1 = (__pyx_v_i != Py_None);
15574 __pyx_t_2 = (__pyx_t_1 != 0);
15584 __Pyx_XDECREF(__pyx_r);
15585 __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)
15586 __Pyx_GOTREF(__pyx_t_3);
15588 __pyx_t_4 =
sin(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
15590 __Pyx_CppExn2PyErr();
15591 __PYX_ERR(0, 1691, __pyx_L1_error)
15593 __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)
15594 __Pyx_GOTREF(__pyx_t_5);
15595 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15596 __pyx_r = __pyx_t_5;
15618 __Pyx_PyThreadState_declare
15619 __Pyx_PyThreadState_assign
15620 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
15621 __Pyx_XGOTREF(__pyx_t_6);
15622 __Pyx_XGOTREF(__pyx_t_7);
15623 __Pyx_XGOTREF(__pyx_t_8);
15633 __Pyx_XDECREF(__pyx_r);
15634 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1694, __pyx_L4_error)
15635 __Pyx_GOTREF(__pyx_t_3);
15636 __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)
15637 __Pyx_GOTREF(__pyx_t_9);
15638 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15640 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
15641 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
15642 if (likely(__pyx_t_3)) {
15643 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
15644 __Pyx_INCREF(__pyx_t_3);
15645 __Pyx_INCREF(
function);
15646 __Pyx_DECREF_SET(__pyx_t_9,
function);
15650 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1694, __pyx_L4_error)
15651 __Pyx_GOTREF(__pyx_t_5);
15653 #if CYTHON_FAST_PYCALL 15654 if (PyFunction_Check(__pyx_t_9)) {
15655 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
15656 __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)
15657 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15658 __Pyx_GOTREF(__pyx_t_5);
15661 #if CYTHON_FAST_PYCCALL 15662 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
15663 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
15664 __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)
15665 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15666 __Pyx_GOTREF(__pyx_t_5);
15670 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1694, __pyx_L4_error)
15671 __Pyx_GOTREF(__pyx_t_10);
15672 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
15673 __Pyx_INCREF(__pyx_v_obj);
15674 __Pyx_GIVEREF(__pyx_v_obj);
15675 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
15676 __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)
15677 __Pyx_GOTREF(__pyx_t_5);
15678 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15681 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15682 __pyx_r = __pyx_t_5;
15684 goto __pyx_L8_try_return;
15695 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15696 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
15697 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
15698 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15708 __Pyx_AddTraceback(
"PyClical.sin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15709 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1695, __pyx_L6_except_error)
15710 __Pyx_GOTREF(__pyx_t_5);
15711 __Pyx_GOTREF(__pyx_t_9);
15712 __Pyx_GOTREF(__pyx_t_10);
15721 __Pyx_XDECREF(__pyx_r);
15722 __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)
15723 __Pyx_GOTREF(__pyx_t_3);
15724 __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)
15725 __Pyx_GOTREF(__pyx_t_11);
15726 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15727 __pyx_r = __pyx_t_11;
15729 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15730 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15731 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15732 goto __pyx_L7_except_return;
15734 __pyx_L6_except_error:;
15743 __Pyx_XGIVEREF(__pyx_t_6);
15744 __Pyx_XGIVEREF(__pyx_t_7);
15745 __Pyx_XGIVEREF(__pyx_t_8);
15746 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15747 goto __pyx_L1_error;
15748 __pyx_L8_try_return:;
15749 __Pyx_XGIVEREF(__pyx_t_6);
15750 __Pyx_XGIVEREF(__pyx_t_7);
15751 __Pyx_XGIVEREF(__pyx_t_8);
15752 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15754 __pyx_L7_except_return:;
15755 __Pyx_XGIVEREF(__pyx_t_6);
15756 __Pyx_XGIVEREF(__pyx_t_7);
15757 __Pyx_XGIVEREF(__pyx_t_8);
15758 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15773 __Pyx_XDECREF(__pyx_t_3);
15774 __Pyx_XDECREF(__pyx_t_5);
15775 __Pyx_XDECREF(__pyx_t_9);
15776 __Pyx_XDECREF(__pyx_t_10);
15777 __Pyx_XDECREF(__pyx_t_11);
15778 __Pyx_AddTraceback(
"PyClical.sin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15781 __Pyx_XGIVEREF(__pyx_r);
15782 __Pyx_RefNannyFinishContext();
15787 static PyObject *__pyx_pw_8PyClical_59sin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15788 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 ";
15789 static PyObject *__pyx_pw_8PyClical_59sin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15790 PyObject *__pyx_v_obj = 0;
15791 PyObject *__pyx_v_i = 0;
15792 PyObject *__pyx_r = 0;
15793 __Pyx_RefNannyDeclarations
15794 __Pyx_RefNannySetupContext(
"sin (wrapper)", 0);
15796 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
15797 PyObject* values[2] = {0,0};
15798 values[1] = ((PyObject *)Py_None);
15799 if (unlikely(__pyx_kwds)) {
15800 Py_ssize_t kw_args;
15801 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15802 switch (pos_args) {
15803 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15804 CYTHON_FALLTHROUGH;
15805 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15806 CYTHON_FALLTHROUGH;
15808 default:
goto __pyx_L5_argtuple_error;
15810 kw_args = PyDict_Size(__pyx_kwds);
15811 switch (pos_args) {
15813 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
15814 else goto __pyx_L5_argtuple_error;
15815 CYTHON_FALLTHROUGH;
15818 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i);
15819 if (value) { values[1] = value; kw_args--; }
15822 if (unlikely(kw_args > 0)) {
15823 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"sin") < 0)) __PYX_ERR(0, 1679, __pyx_L3_error)
15826 switch (PyTuple_GET_SIZE(__pyx_args)) {
15827 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15828 CYTHON_FALLTHROUGH;
15829 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15831 default:
goto __pyx_L5_argtuple_error;
15834 __pyx_v_obj = values[0];
15835 __pyx_v_i = values[1];
15837 goto __pyx_L4_argument_unpacking_done;
15838 __pyx_L5_argtuple_error:;
15839 __Pyx_RaiseArgtupleInvalid(
"sin", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1679, __pyx_L3_error)
15841 __Pyx_AddTraceback(
"PyClical.sin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15842 __Pyx_RefNannyFinishContext();
15844 __pyx_L4_argument_unpacking_done:;
15845 __pyx_r = __pyx_pf_8PyClical_58sin(__pyx_self, __pyx_v_obj, __pyx_v_i);
15848 __Pyx_RefNannyFinishContext();
15852 static PyObject *__pyx_pf_8PyClical_58sin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
15853 PyObject *__pyx_r = NULL;
15854 __Pyx_RefNannyDeclarations
15855 PyObject *__pyx_t_1 = NULL;
15856 struct __pyx_opt_args_8PyClical_sin __pyx_t_2;
15857 __Pyx_RefNannySetupContext(
"sin", 0);
15858 __Pyx_XDECREF(__pyx_r);
15859 __pyx_t_2.__pyx_n = 1;
15860 __pyx_t_2.i = __pyx_v_i;
15861 __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)
15862 __Pyx_GOTREF(__pyx_t_1);
15863 __pyx_r = __pyx_t_1;
15869 __Pyx_XDECREF(__pyx_t_1);
15870 __Pyx_AddTraceback(
"PyClical.sin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15873 __Pyx_XGIVEREF(__pyx_r);
15874 __Pyx_RefNannyFinishContext();
15886 static PyObject *__pyx_pw_8PyClical_61asin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15887 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) {
15888 PyObject *__pyx_v_i = ((PyObject *)Py_None);
15889 PyObject *__pyx_r = NULL;
15890 __Pyx_RefNannyDeclarations
15893 PyObject *__pyx_t_3 = NULL;
15895 PyObject *__pyx_t_5 = NULL;
15896 PyObject *__pyx_t_6 = NULL;
15897 PyObject *__pyx_t_7 = NULL;
15898 PyObject *__pyx_t_8 = NULL;
15899 PyObject *__pyx_t_9 = NULL;
15900 PyObject *__pyx_t_10 = NULL;
15901 PyObject *__pyx_t_11 = NULL;
15902 __Pyx_RefNannySetupContext(
"asin", 0);
15903 if (__pyx_optional_args) {
15904 if (__pyx_optional_args->__pyx_n > 0) {
15905 __pyx_v_i = __pyx_optional_args->i;
15916 __pyx_t_1 = (__pyx_v_i != Py_None);
15917 __pyx_t_2 = (__pyx_t_1 != 0);
15927 __Pyx_XDECREF(__pyx_r);
15928 __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)
15929 __Pyx_GOTREF(__pyx_t_3);
15931 __pyx_t_4 =
asin(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
15933 __Pyx_CppExn2PyErr();
15934 __PYX_ERR(0, 1712, __pyx_L1_error)
15936 __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)
15937 __Pyx_GOTREF(__pyx_t_5);
15938 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15939 __pyx_r = __pyx_t_5;
15961 __Pyx_PyThreadState_declare
15962 __Pyx_PyThreadState_assign
15963 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
15964 __Pyx_XGOTREF(__pyx_t_6);
15965 __Pyx_XGOTREF(__pyx_t_7);
15966 __Pyx_XGOTREF(__pyx_t_8);
15976 __Pyx_XDECREF(__pyx_r);
15977 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1715, __pyx_L4_error)
15978 __Pyx_GOTREF(__pyx_t_3);
15979 __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)
15980 __Pyx_GOTREF(__pyx_t_9);
15981 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15983 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
15984 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
15985 if (likely(__pyx_t_3)) {
15986 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
15987 __Pyx_INCREF(__pyx_t_3);
15988 __Pyx_INCREF(
function);
15989 __Pyx_DECREF_SET(__pyx_t_9,
function);
15993 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1715, __pyx_L4_error)
15994 __Pyx_GOTREF(__pyx_t_5);
15996 #if CYTHON_FAST_PYCALL 15997 if (PyFunction_Check(__pyx_t_9)) {
15998 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
15999 __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)
16000 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16001 __Pyx_GOTREF(__pyx_t_5);
16004 #if CYTHON_FAST_PYCCALL 16005 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
16006 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
16007 __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)
16008 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16009 __Pyx_GOTREF(__pyx_t_5);
16013 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1715, __pyx_L4_error)
16014 __Pyx_GOTREF(__pyx_t_10);
16015 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
16016 __Pyx_INCREF(__pyx_v_obj);
16017 __Pyx_GIVEREF(__pyx_v_obj);
16018 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
16019 __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)
16020 __Pyx_GOTREF(__pyx_t_5);
16021 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16024 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16025 __pyx_r = __pyx_t_5;
16027 goto __pyx_L8_try_return;
16038 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16039 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
16040 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
16041 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16051 __Pyx_AddTraceback(
"PyClical.asin", __pyx_clineno, __pyx_lineno, __pyx_filename);
16052 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1716, __pyx_L6_except_error)
16053 __Pyx_GOTREF(__pyx_t_5);
16054 __Pyx_GOTREF(__pyx_t_9);
16055 __Pyx_GOTREF(__pyx_t_10);
16064 __Pyx_XDECREF(__pyx_r);
16065 __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)
16066 __Pyx_GOTREF(__pyx_t_3);
16067 __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)
16068 __Pyx_GOTREF(__pyx_t_11);
16069 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16070 __pyx_r = __pyx_t_11;
16072 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16073 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16074 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16075 goto __pyx_L7_except_return;
16077 __pyx_L6_except_error:;
16086 __Pyx_XGIVEREF(__pyx_t_6);
16087 __Pyx_XGIVEREF(__pyx_t_7);
16088 __Pyx_XGIVEREF(__pyx_t_8);
16089 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16090 goto __pyx_L1_error;
16091 __pyx_L8_try_return:;
16092 __Pyx_XGIVEREF(__pyx_t_6);
16093 __Pyx_XGIVEREF(__pyx_t_7);
16094 __Pyx_XGIVEREF(__pyx_t_8);
16095 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16097 __pyx_L7_except_return:;
16098 __Pyx_XGIVEREF(__pyx_t_6);
16099 __Pyx_XGIVEREF(__pyx_t_7);
16100 __Pyx_XGIVEREF(__pyx_t_8);
16101 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16116 __Pyx_XDECREF(__pyx_t_3);
16117 __Pyx_XDECREF(__pyx_t_5);
16118 __Pyx_XDECREF(__pyx_t_9);
16119 __Pyx_XDECREF(__pyx_t_10);
16120 __Pyx_XDECREF(__pyx_t_11);
16121 __Pyx_AddTraceback(
"PyClical.asin", __pyx_clineno, __pyx_lineno, __pyx_filename);
16124 __Pyx_XGIVEREF(__pyx_r);
16125 __Pyx_RefNannyFinishContext();
16130 static PyObject *__pyx_pw_8PyClical_61asin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16131 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 ";
16132 static PyObject *__pyx_pw_8PyClical_61asin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16133 PyObject *__pyx_v_obj = 0;
16134 PyObject *__pyx_v_i = 0;
16135 PyObject *__pyx_r = 0;
16136 __Pyx_RefNannyDeclarations
16137 __Pyx_RefNannySetupContext(
"asin (wrapper)", 0);
16139 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
16140 PyObject* values[2] = {0,0};
16141 values[1] = ((PyObject *)Py_None);
16142 if (unlikely(__pyx_kwds)) {
16143 Py_ssize_t kw_args;
16144 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16145 switch (pos_args) {
16146 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16147 CYTHON_FALLTHROUGH;
16148 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16149 CYTHON_FALLTHROUGH;
16151 default:
goto __pyx_L5_argtuple_error;
16153 kw_args = PyDict_Size(__pyx_kwds);
16154 switch (pos_args) {
16156 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
16157 else goto __pyx_L5_argtuple_error;
16158 CYTHON_FALLTHROUGH;
16161 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i);
16162 if (value) { values[1] = value; kw_args--; }
16165 if (unlikely(kw_args > 0)) {
16166 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"asin") < 0)) __PYX_ERR(0, 1698, __pyx_L3_error)
16169 switch (PyTuple_GET_SIZE(__pyx_args)) {
16170 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16171 CYTHON_FALLTHROUGH;
16172 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16174 default:
goto __pyx_L5_argtuple_error;
16177 __pyx_v_obj = values[0];
16178 __pyx_v_i = values[1];
16180 goto __pyx_L4_argument_unpacking_done;
16181 __pyx_L5_argtuple_error:;
16182 __Pyx_RaiseArgtupleInvalid(
"asin", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1698, __pyx_L3_error)
16184 __Pyx_AddTraceback(
"PyClical.asin", __pyx_clineno, __pyx_lineno, __pyx_filename);
16185 __Pyx_RefNannyFinishContext();
16187 __pyx_L4_argument_unpacking_done:;
16188 __pyx_r = __pyx_pf_8PyClical_60asin(__pyx_self, __pyx_v_obj, __pyx_v_i);
16191 __Pyx_RefNannyFinishContext();
16195 static PyObject *__pyx_pf_8PyClical_60asin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
16196 PyObject *__pyx_r = NULL;
16197 __Pyx_RefNannyDeclarations
16198 PyObject *__pyx_t_1 = NULL;
16199 struct __pyx_opt_args_8PyClical_asin __pyx_t_2;
16200 __Pyx_RefNannySetupContext(
"asin", 0);
16201 __Pyx_XDECREF(__pyx_r);
16202 __pyx_t_2.__pyx_n = 1;
16203 __pyx_t_2.i = __pyx_v_i;
16204 __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)
16205 __Pyx_GOTREF(__pyx_t_1);
16206 __pyx_r = __pyx_t_1;
16212 __Pyx_XDECREF(__pyx_t_1);
16213 __Pyx_AddTraceback(
"PyClical.asin", __pyx_clineno, __pyx_lineno, __pyx_filename);
16216 __Pyx_XGIVEREF(__pyx_r);
16217 __Pyx_RefNannyFinishContext();
16229 static PyObject *__pyx_pw_8PyClical_63sinh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
16230 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_sinh(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
16231 PyObject *__pyx_r = NULL;
16232 __Pyx_RefNannyDeclarations
16233 PyObject *__pyx_t_1 = NULL;
16234 PyObject *__pyx_t_2 = NULL;
16235 PyObject *__pyx_t_3 = NULL;
16236 PyObject *__pyx_t_4 = NULL;
16237 PyObject *__pyx_t_5 = NULL;
16238 PyObject *__pyx_t_6 = NULL;
16239 PyObject *__pyx_t_7 = NULL;
16240 PyObject *__pyx_t_8 = NULL;
16241 __Pyx_RefNannySetupContext(
"sinh", 0);
16251 __Pyx_PyThreadState_declare
16252 __Pyx_PyThreadState_assign
16253 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
16254 __Pyx_XGOTREF(__pyx_t_1);
16255 __Pyx_XGOTREF(__pyx_t_2);
16256 __Pyx_XGOTREF(__pyx_t_3);
16266 __Pyx_XDECREF(__pyx_r);
16267 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1729, __pyx_L3_error)
16268 __Pyx_GOTREF(__pyx_t_5);
16269 __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)
16270 __Pyx_GOTREF(__pyx_t_6);
16271 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16273 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
16274 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
16275 if (likely(__pyx_t_5)) {
16276 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
16277 __Pyx_INCREF(__pyx_t_5);
16278 __Pyx_INCREF(
function);
16279 __Pyx_DECREF_SET(__pyx_t_6,
function);
16283 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_obj);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1729, __pyx_L3_error)
16284 __Pyx_GOTREF(__pyx_t_4);
16286 #if CYTHON_FAST_PYCALL 16287 if (PyFunction_Check(__pyx_t_6)) {
16288 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_obj};
16289 __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)
16290 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16291 __Pyx_GOTREF(__pyx_t_4);
16294 #if CYTHON_FAST_PYCCALL 16295 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
16296 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_obj};
16297 __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)
16298 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16299 __Pyx_GOTREF(__pyx_t_4);
16303 __pyx_t_7 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1729, __pyx_L3_error)
16304 __Pyx_GOTREF(__pyx_t_7);
16305 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
16306 __Pyx_INCREF(__pyx_v_obj);
16307 __Pyx_GIVEREF(__pyx_v_obj);
16308 PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_obj);
16309 __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)
16310 __Pyx_GOTREF(__pyx_t_4);
16311 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16314 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16315 __pyx_r = __pyx_t_4;
16317 goto __pyx_L7_try_return;
16328 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16329 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
16330 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
16331 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
16341 __Pyx_AddTraceback(
"PyClical.sinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16342 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1730, __pyx_L5_except_error)
16343 __Pyx_GOTREF(__pyx_t_4);
16344 __Pyx_GOTREF(__pyx_t_6);
16345 __Pyx_GOTREF(__pyx_t_7);
16354 __Pyx_XDECREF(__pyx_r);
16355 __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)
16356 __Pyx_GOTREF(__pyx_t_5);
16357 __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)
16358 __Pyx_GOTREF(__pyx_t_8);
16359 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16360 __pyx_r = __pyx_t_8;
16362 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16363 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16364 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16365 goto __pyx_L6_except_return;
16367 __pyx_L5_except_error:;
16376 __Pyx_XGIVEREF(__pyx_t_1);
16377 __Pyx_XGIVEREF(__pyx_t_2);
16378 __Pyx_XGIVEREF(__pyx_t_3);
16379 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
16380 goto __pyx_L1_error;
16381 __pyx_L7_try_return:;
16382 __Pyx_XGIVEREF(__pyx_t_1);
16383 __Pyx_XGIVEREF(__pyx_t_2);
16384 __Pyx_XGIVEREF(__pyx_t_3);
16385 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
16387 __pyx_L6_except_return:;
16388 __Pyx_XGIVEREF(__pyx_t_1);
16389 __Pyx_XGIVEREF(__pyx_t_2);
16390 __Pyx_XGIVEREF(__pyx_t_3);
16391 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
16405 __Pyx_XDECREF(__pyx_t_4);
16406 __Pyx_XDECREF(__pyx_t_5);
16407 __Pyx_XDECREF(__pyx_t_6);
16408 __Pyx_XDECREF(__pyx_t_7);
16409 __Pyx_XDECREF(__pyx_t_8);
16410 __Pyx_AddTraceback(
"PyClical.sinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16413 __Pyx_XGIVEREF(__pyx_r);
16414 __Pyx_RefNannyFinishContext();
16419 static PyObject *__pyx_pw_8PyClical_63sinh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
16420 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 ";
16421 static PyObject *__pyx_pw_8PyClical_63sinh(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
16422 PyObject *__pyx_r = 0;
16423 __Pyx_RefNannyDeclarations
16424 __Pyx_RefNannySetupContext(
"sinh (wrapper)", 0);
16425 __pyx_r = __pyx_pf_8PyClical_62sinh(__pyx_self, ((PyObject *)__pyx_v_obj));
16428 __Pyx_RefNannyFinishContext();
16432 static PyObject *__pyx_pf_8PyClical_62sinh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
16433 PyObject *__pyx_r = NULL;
16434 __Pyx_RefNannyDeclarations
16435 PyObject *__pyx_t_1 = NULL;
16436 __Pyx_RefNannySetupContext(
"sinh", 0);
16437 __Pyx_XDECREF(__pyx_r);
16438 __pyx_t_1 = __pyx_f_8PyClical_sinh(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1719, __pyx_L1_error)
16439 __Pyx_GOTREF(__pyx_t_1);
16440 __pyx_r = __pyx_t_1;
16446 __Pyx_XDECREF(__pyx_t_1);
16447 __Pyx_AddTraceback(
"PyClical.sinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16450 __Pyx_XGIVEREF(__pyx_r);
16451 __Pyx_RefNannyFinishContext();
16463 static PyObject *__pyx_pw_8PyClical_65asinh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16464 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) {
16465 PyObject *__pyx_v_i = ((PyObject *)Py_None);
16466 PyObject *__pyx_r = NULL;
16467 __Pyx_RefNannyDeclarations
16470 PyObject *__pyx_t_3 = NULL;
16472 PyObject *__pyx_t_5 = NULL;
16473 PyObject *__pyx_t_6 = NULL;
16474 PyObject *__pyx_t_7 = NULL;
16475 PyObject *__pyx_t_8 = NULL;
16476 PyObject *__pyx_t_9 = NULL;
16477 PyObject *__pyx_t_10 = NULL;
16478 PyObject *__pyx_t_11 = NULL;
16479 __Pyx_RefNannySetupContext(
"asinh", 0);
16480 if (__pyx_optional_args) {
16481 if (__pyx_optional_args->__pyx_n > 0) {
16482 __pyx_v_i = __pyx_optional_args->i;
16493 __pyx_t_1 = (__pyx_v_i != Py_None);
16494 __pyx_t_2 = (__pyx_t_1 != 0);
16504 __Pyx_XDECREF(__pyx_r);
16505 __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)
16506 __Pyx_GOTREF(__pyx_t_3);
16508 __pyx_t_4 =
asinh(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
16510 __Pyx_CppExn2PyErr();
16511 __PYX_ERR(0, 1745, __pyx_L1_error)
16513 __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)
16514 __Pyx_GOTREF(__pyx_t_5);
16515 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16516 __pyx_r = __pyx_t_5;
16538 __Pyx_PyThreadState_declare
16539 __Pyx_PyThreadState_assign
16540 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
16541 __Pyx_XGOTREF(__pyx_t_6);
16542 __Pyx_XGOTREF(__pyx_t_7);
16543 __Pyx_XGOTREF(__pyx_t_8);
16553 __Pyx_XDECREF(__pyx_r);
16554 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1748, __pyx_L4_error)
16555 __Pyx_GOTREF(__pyx_t_3);
16556 __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)
16557 __Pyx_GOTREF(__pyx_t_9);
16558 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16560 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
16561 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
16562 if (likely(__pyx_t_3)) {
16563 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
16564 __Pyx_INCREF(__pyx_t_3);
16565 __Pyx_INCREF(
function);
16566 __Pyx_DECREF_SET(__pyx_t_9,
function);
16570 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1748, __pyx_L4_error)
16571 __Pyx_GOTREF(__pyx_t_5);
16573 #if CYTHON_FAST_PYCALL 16574 if (PyFunction_Check(__pyx_t_9)) {
16575 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
16576 __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)
16577 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16578 __Pyx_GOTREF(__pyx_t_5);
16581 #if CYTHON_FAST_PYCCALL 16582 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
16583 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
16584 __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)
16585 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16586 __Pyx_GOTREF(__pyx_t_5);
16590 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1748, __pyx_L4_error)
16591 __Pyx_GOTREF(__pyx_t_10);
16592 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
16593 __Pyx_INCREF(__pyx_v_obj);
16594 __Pyx_GIVEREF(__pyx_v_obj);
16595 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
16596 __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)
16597 __Pyx_GOTREF(__pyx_t_5);
16598 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16601 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16602 __pyx_r = __pyx_t_5;
16604 goto __pyx_L8_try_return;
16615 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16616 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
16617 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
16618 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16628 __Pyx_AddTraceback(
"PyClical.asinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16629 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1749, __pyx_L6_except_error)
16630 __Pyx_GOTREF(__pyx_t_5);
16631 __Pyx_GOTREF(__pyx_t_9);
16632 __Pyx_GOTREF(__pyx_t_10);
16641 __Pyx_XDECREF(__pyx_r);
16642 __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)
16643 __Pyx_GOTREF(__pyx_t_3);
16644 __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)
16645 __Pyx_GOTREF(__pyx_t_11);
16646 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16647 __pyx_r = __pyx_t_11;
16649 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16650 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16651 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16652 goto __pyx_L7_except_return;
16654 __pyx_L6_except_error:;
16663 __Pyx_XGIVEREF(__pyx_t_6);
16664 __Pyx_XGIVEREF(__pyx_t_7);
16665 __Pyx_XGIVEREF(__pyx_t_8);
16666 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16667 goto __pyx_L1_error;
16668 __pyx_L8_try_return:;
16669 __Pyx_XGIVEREF(__pyx_t_6);
16670 __Pyx_XGIVEREF(__pyx_t_7);
16671 __Pyx_XGIVEREF(__pyx_t_8);
16672 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16674 __pyx_L7_except_return:;
16675 __Pyx_XGIVEREF(__pyx_t_6);
16676 __Pyx_XGIVEREF(__pyx_t_7);
16677 __Pyx_XGIVEREF(__pyx_t_8);
16678 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16693 __Pyx_XDECREF(__pyx_t_3);
16694 __Pyx_XDECREF(__pyx_t_5);
16695 __Pyx_XDECREF(__pyx_t_9);
16696 __Pyx_XDECREF(__pyx_t_10);
16697 __Pyx_XDECREF(__pyx_t_11);
16698 __Pyx_AddTraceback(
"PyClical.asinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16701 __Pyx_XGIVEREF(__pyx_r);
16702 __Pyx_RefNannyFinishContext();
16707 static PyObject *__pyx_pw_8PyClical_65asinh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16708 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 ";
16709 static PyObject *__pyx_pw_8PyClical_65asinh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16710 PyObject *__pyx_v_obj = 0;
16711 PyObject *__pyx_v_i = 0;
16712 PyObject *__pyx_r = 0;
16713 __Pyx_RefNannyDeclarations
16714 __Pyx_RefNannySetupContext(
"asinh (wrapper)", 0);
16716 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
16717 PyObject* values[2] = {0,0};
16718 values[1] = ((PyObject *)Py_None);
16719 if (unlikely(__pyx_kwds)) {
16720 Py_ssize_t kw_args;
16721 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16722 switch (pos_args) {
16723 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16724 CYTHON_FALLTHROUGH;
16725 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16726 CYTHON_FALLTHROUGH;
16728 default:
goto __pyx_L5_argtuple_error;
16730 kw_args = PyDict_Size(__pyx_kwds);
16731 switch (pos_args) {
16733 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
16734 else goto __pyx_L5_argtuple_error;
16735 CYTHON_FALLTHROUGH;
16738 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i);
16739 if (value) { values[1] = value; kw_args--; }
16742 if (unlikely(kw_args > 0)) {
16743 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"asinh") < 0)) __PYX_ERR(0, 1733, __pyx_L3_error)
16746 switch (PyTuple_GET_SIZE(__pyx_args)) {
16747 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16748 CYTHON_FALLTHROUGH;
16749 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16751 default:
goto __pyx_L5_argtuple_error;
16754 __pyx_v_obj = values[0];
16755 __pyx_v_i = values[1];
16757 goto __pyx_L4_argument_unpacking_done;
16758 __pyx_L5_argtuple_error:;
16759 __Pyx_RaiseArgtupleInvalid(
"asinh", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1733, __pyx_L3_error)
16761 __Pyx_AddTraceback(
"PyClical.asinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16762 __Pyx_RefNannyFinishContext();
16764 __pyx_L4_argument_unpacking_done:;
16765 __pyx_r = __pyx_pf_8PyClical_64asinh(__pyx_self, __pyx_v_obj, __pyx_v_i);
16768 __Pyx_RefNannyFinishContext();
16772 static PyObject *__pyx_pf_8PyClical_64asinh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
16773 PyObject *__pyx_r = NULL;
16774 __Pyx_RefNannyDeclarations
16775 PyObject *__pyx_t_1 = NULL;
16776 struct __pyx_opt_args_8PyClical_asinh __pyx_t_2;
16777 __Pyx_RefNannySetupContext(
"asinh", 0);
16778 __Pyx_XDECREF(__pyx_r);
16779 __pyx_t_2.__pyx_n = 1;
16780 __pyx_t_2.i = __pyx_v_i;
16781 __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)
16782 __Pyx_GOTREF(__pyx_t_1);
16783 __pyx_r = __pyx_t_1;
16789 __Pyx_XDECREF(__pyx_t_1);
16790 __Pyx_AddTraceback(
"PyClical.asinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16793 __Pyx_XGIVEREF(__pyx_r);
16794 __Pyx_RefNannyFinishContext();
16806 static PyObject *__pyx_pw_8PyClical_67tan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16807 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) {
16808 PyObject *__pyx_v_i = ((PyObject *)Py_None);
16809 PyObject *__pyx_r = NULL;
16810 __Pyx_RefNannyDeclarations
16813 PyObject *__pyx_t_3 = NULL;
16815 PyObject *__pyx_t_5 = NULL;
16816 PyObject *__pyx_t_6 = NULL;
16817 PyObject *__pyx_t_7 = NULL;
16818 PyObject *__pyx_t_8 = NULL;
16819 PyObject *__pyx_t_9 = NULL;
16820 PyObject *__pyx_t_10 = NULL;
16821 PyObject *__pyx_t_11 = NULL;
16822 __Pyx_RefNannySetupContext(
"tan", 0);
16823 if (__pyx_optional_args) {
16824 if (__pyx_optional_args->__pyx_n > 0) {
16825 __pyx_v_i = __pyx_optional_args->i;
16836 __pyx_t_1 = (__pyx_v_i != Py_None);
16837 __pyx_t_2 = (__pyx_t_1 != 0);
16847 __Pyx_XDECREF(__pyx_r);
16848 __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)
16849 __Pyx_GOTREF(__pyx_t_3);
16851 __pyx_t_4 =
tan(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
16853 __Pyx_CppExn2PyErr();
16854 __PYX_ERR(0, 1762, __pyx_L1_error)
16856 __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)
16857 __Pyx_GOTREF(__pyx_t_5);
16858 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16859 __pyx_r = __pyx_t_5;
16881 __Pyx_PyThreadState_declare
16882 __Pyx_PyThreadState_assign
16883 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
16884 __Pyx_XGOTREF(__pyx_t_6);
16885 __Pyx_XGOTREF(__pyx_t_7);
16886 __Pyx_XGOTREF(__pyx_t_8);
16896 __Pyx_XDECREF(__pyx_r);
16897 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1765, __pyx_L4_error)
16898 __Pyx_GOTREF(__pyx_t_3);
16899 __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)
16900 __Pyx_GOTREF(__pyx_t_9);
16901 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16903 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
16904 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
16905 if (likely(__pyx_t_3)) {
16906 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
16907 __Pyx_INCREF(__pyx_t_3);
16908 __Pyx_INCREF(
function);
16909 __Pyx_DECREF_SET(__pyx_t_9,
function);
16913 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1765, __pyx_L4_error)
16914 __Pyx_GOTREF(__pyx_t_5);
16916 #if CYTHON_FAST_PYCALL 16917 if (PyFunction_Check(__pyx_t_9)) {
16918 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
16919 __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)
16920 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16921 __Pyx_GOTREF(__pyx_t_5);
16924 #if CYTHON_FAST_PYCCALL 16925 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
16926 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
16927 __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)
16928 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16929 __Pyx_GOTREF(__pyx_t_5);
16933 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1765, __pyx_L4_error)
16934 __Pyx_GOTREF(__pyx_t_10);
16935 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
16936 __Pyx_INCREF(__pyx_v_obj);
16937 __Pyx_GIVEREF(__pyx_v_obj);
16938 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
16939 __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)
16940 __Pyx_GOTREF(__pyx_t_5);
16941 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16944 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16945 __pyx_r = __pyx_t_5;
16947 goto __pyx_L8_try_return;
16958 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16959 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
16960 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
16961 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16971 __Pyx_AddTraceback(
"PyClical.tan", __pyx_clineno, __pyx_lineno, __pyx_filename);
16972 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1766, __pyx_L6_except_error)
16973 __Pyx_GOTREF(__pyx_t_5);
16974 __Pyx_GOTREF(__pyx_t_9);
16975 __Pyx_GOTREF(__pyx_t_10);
16984 __Pyx_XDECREF(__pyx_r);
16985 __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)
16986 __Pyx_GOTREF(__pyx_t_3);
16987 __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)
16988 __Pyx_GOTREF(__pyx_t_11);
16989 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16990 __pyx_r = __pyx_t_11;
16992 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16993 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16994 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16995 goto __pyx_L7_except_return;
16997 __pyx_L6_except_error:;
17006 __Pyx_XGIVEREF(__pyx_t_6);
17007 __Pyx_XGIVEREF(__pyx_t_7);
17008 __Pyx_XGIVEREF(__pyx_t_8);
17009 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17010 goto __pyx_L1_error;
17011 __pyx_L8_try_return:;
17012 __Pyx_XGIVEREF(__pyx_t_6);
17013 __Pyx_XGIVEREF(__pyx_t_7);
17014 __Pyx_XGIVEREF(__pyx_t_8);
17015 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17017 __pyx_L7_except_return:;
17018 __Pyx_XGIVEREF(__pyx_t_6);
17019 __Pyx_XGIVEREF(__pyx_t_7);
17020 __Pyx_XGIVEREF(__pyx_t_8);
17021 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17036 __Pyx_XDECREF(__pyx_t_3);
17037 __Pyx_XDECREF(__pyx_t_5);
17038 __Pyx_XDECREF(__pyx_t_9);
17039 __Pyx_XDECREF(__pyx_t_10);
17040 __Pyx_XDECREF(__pyx_t_11);
17041 __Pyx_AddTraceback(
"PyClical.tan", __pyx_clineno, __pyx_lineno, __pyx_filename);
17044 __Pyx_XGIVEREF(__pyx_r);
17045 __Pyx_RefNannyFinishContext();
17050 static PyObject *__pyx_pw_8PyClical_67tan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17051 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 ";
17052 static PyObject *__pyx_pw_8PyClical_67tan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17053 PyObject *__pyx_v_obj = 0;
17054 PyObject *__pyx_v_i = 0;
17055 PyObject *__pyx_r = 0;
17056 __Pyx_RefNannyDeclarations
17057 __Pyx_RefNannySetupContext(
"tan (wrapper)", 0);
17059 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
17060 PyObject* values[2] = {0,0};
17061 values[1] = ((PyObject *)Py_None);
17062 if (unlikely(__pyx_kwds)) {
17063 Py_ssize_t kw_args;
17064 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17065 switch (pos_args) {
17066 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17067 CYTHON_FALLTHROUGH;
17068 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17069 CYTHON_FALLTHROUGH;
17071 default:
goto __pyx_L5_argtuple_error;
17073 kw_args = PyDict_Size(__pyx_kwds);
17074 switch (pos_args) {
17076 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
17077 else goto __pyx_L5_argtuple_error;
17078 CYTHON_FALLTHROUGH;
17081 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i);
17082 if (value) { values[1] = value; kw_args--; }
17085 if (unlikely(kw_args > 0)) {
17086 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"tan") < 0)) __PYX_ERR(0, 1752, __pyx_L3_error)
17089 switch (PyTuple_GET_SIZE(__pyx_args)) {
17090 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17091 CYTHON_FALLTHROUGH;
17092 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17094 default:
goto __pyx_L5_argtuple_error;
17097 __pyx_v_obj = values[0];
17098 __pyx_v_i = values[1];
17100 goto __pyx_L4_argument_unpacking_done;
17101 __pyx_L5_argtuple_error:;
17102 __Pyx_RaiseArgtupleInvalid(
"tan", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1752, __pyx_L3_error)
17104 __Pyx_AddTraceback(
"PyClical.tan", __pyx_clineno, __pyx_lineno, __pyx_filename);
17105 __Pyx_RefNannyFinishContext();
17107 __pyx_L4_argument_unpacking_done:;
17108 __pyx_r = __pyx_pf_8PyClical_66tan(__pyx_self, __pyx_v_obj, __pyx_v_i);
17111 __Pyx_RefNannyFinishContext();
17115 static PyObject *__pyx_pf_8PyClical_66tan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
17116 PyObject *__pyx_r = NULL;
17117 __Pyx_RefNannyDeclarations
17118 PyObject *__pyx_t_1 = NULL;
17119 struct __pyx_opt_args_8PyClical_tan __pyx_t_2;
17120 __Pyx_RefNannySetupContext(
"tan", 0);
17121 __Pyx_XDECREF(__pyx_r);
17122 __pyx_t_2.__pyx_n = 1;
17123 __pyx_t_2.i = __pyx_v_i;
17124 __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)
17125 __Pyx_GOTREF(__pyx_t_1);
17126 __pyx_r = __pyx_t_1;
17132 __Pyx_XDECREF(__pyx_t_1);
17133 __Pyx_AddTraceback(
"PyClical.tan", __pyx_clineno, __pyx_lineno, __pyx_filename);
17136 __Pyx_XGIVEREF(__pyx_r);
17137 __Pyx_RefNannyFinishContext();
17149 static PyObject *__pyx_pw_8PyClical_69atan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17150 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) {
17151 PyObject *__pyx_v_i = ((PyObject *)Py_None);
17152 PyObject *__pyx_r = NULL;
17153 __Pyx_RefNannyDeclarations
17156 PyObject *__pyx_t_3 = NULL;
17158 PyObject *__pyx_t_5 = NULL;
17159 PyObject *__pyx_t_6 = NULL;
17160 PyObject *__pyx_t_7 = NULL;
17161 PyObject *__pyx_t_8 = NULL;
17162 PyObject *__pyx_t_9 = NULL;
17163 PyObject *__pyx_t_10 = NULL;
17164 PyObject *__pyx_t_11 = NULL;
17165 __Pyx_RefNannySetupContext(
"atan", 0);
17166 if (__pyx_optional_args) {
17167 if (__pyx_optional_args->__pyx_n > 0) {
17168 __pyx_v_i = __pyx_optional_args->i;
17179 __pyx_t_1 = (__pyx_v_i != Py_None);
17180 __pyx_t_2 = (__pyx_t_1 != 0);
17190 __Pyx_XDECREF(__pyx_r);
17191 __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)
17192 __Pyx_GOTREF(__pyx_t_3);
17194 __pyx_t_4 =
atan(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
17196 __Pyx_CppExn2PyErr();
17197 __PYX_ERR(0, 1779, __pyx_L1_error)
17199 __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)
17200 __Pyx_GOTREF(__pyx_t_5);
17201 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17202 __pyx_r = __pyx_t_5;
17224 __Pyx_PyThreadState_declare
17225 __Pyx_PyThreadState_assign
17226 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
17227 __Pyx_XGOTREF(__pyx_t_6);
17228 __Pyx_XGOTREF(__pyx_t_7);
17229 __Pyx_XGOTREF(__pyx_t_8);
17239 __Pyx_XDECREF(__pyx_r);
17240 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1782, __pyx_L4_error)
17241 __Pyx_GOTREF(__pyx_t_3);
17242 __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)
17243 __Pyx_GOTREF(__pyx_t_9);
17244 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17246 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
17247 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
17248 if (likely(__pyx_t_3)) {
17249 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
17250 __Pyx_INCREF(__pyx_t_3);
17251 __Pyx_INCREF(
function);
17252 __Pyx_DECREF_SET(__pyx_t_9,
function);
17256 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1782, __pyx_L4_error)
17257 __Pyx_GOTREF(__pyx_t_5);
17259 #if CYTHON_FAST_PYCALL 17260 if (PyFunction_Check(__pyx_t_9)) {
17261 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
17262 __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)
17263 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17264 __Pyx_GOTREF(__pyx_t_5);
17267 #if CYTHON_FAST_PYCCALL 17268 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
17269 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
17270 __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)
17271 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17272 __Pyx_GOTREF(__pyx_t_5);
17276 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1782, __pyx_L4_error)
17277 __Pyx_GOTREF(__pyx_t_10);
17278 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
17279 __Pyx_INCREF(__pyx_v_obj);
17280 __Pyx_GIVEREF(__pyx_v_obj);
17281 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
17282 __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)
17283 __Pyx_GOTREF(__pyx_t_5);
17284 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
17287 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17288 __pyx_r = __pyx_t_5;
17290 goto __pyx_L8_try_return;
17301 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17302 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
17303 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
17304 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17314 __Pyx_AddTraceback(
"PyClical.atan", __pyx_clineno, __pyx_lineno, __pyx_filename);
17315 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1783, __pyx_L6_except_error)
17316 __Pyx_GOTREF(__pyx_t_5);
17317 __Pyx_GOTREF(__pyx_t_9);
17318 __Pyx_GOTREF(__pyx_t_10);
17327 __Pyx_XDECREF(__pyx_r);
17328 __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)
17329 __Pyx_GOTREF(__pyx_t_3);
17330 __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)
17331 __Pyx_GOTREF(__pyx_t_11);
17332 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17333 __pyx_r = __pyx_t_11;
17335 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17336 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17337 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
17338 goto __pyx_L7_except_return;
17340 __pyx_L6_except_error:;
17349 __Pyx_XGIVEREF(__pyx_t_6);
17350 __Pyx_XGIVEREF(__pyx_t_7);
17351 __Pyx_XGIVEREF(__pyx_t_8);
17352 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17353 goto __pyx_L1_error;
17354 __pyx_L8_try_return:;
17355 __Pyx_XGIVEREF(__pyx_t_6);
17356 __Pyx_XGIVEREF(__pyx_t_7);
17357 __Pyx_XGIVEREF(__pyx_t_8);
17358 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17360 __pyx_L7_except_return:;
17361 __Pyx_XGIVEREF(__pyx_t_6);
17362 __Pyx_XGIVEREF(__pyx_t_7);
17363 __Pyx_XGIVEREF(__pyx_t_8);
17364 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17379 __Pyx_XDECREF(__pyx_t_3);
17380 __Pyx_XDECREF(__pyx_t_5);
17381 __Pyx_XDECREF(__pyx_t_9);
17382 __Pyx_XDECREF(__pyx_t_10);
17383 __Pyx_XDECREF(__pyx_t_11);
17384 __Pyx_AddTraceback(
"PyClical.atan", __pyx_clineno, __pyx_lineno, __pyx_filename);
17387 __Pyx_XGIVEREF(__pyx_r);
17388 __Pyx_RefNannyFinishContext();
17393 static PyObject *__pyx_pw_8PyClical_69atan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17394 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 ";
17395 static PyObject *__pyx_pw_8PyClical_69atan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17396 PyObject *__pyx_v_obj = 0;
17397 PyObject *__pyx_v_i = 0;
17398 PyObject *__pyx_r = 0;
17399 __Pyx_RefNannyDeclarations
17400 __Pyx_RefNannySetupContext(
"atan (wrapper)", 0);
17402 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
17403 PyObject* values[2] = {0,0};
17404 values[1] = ((PyObject *)Py_None);
17405 if (unlikely(__pyx_kwds)) {
17406 Py_ssize_t kw_args;
17407 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17408 switch (pos_args) {
17409 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17410 CYTHON_FALLTHROUGH;
17411 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17412 CYTHON_FALLTHROUGH;
17414 default:
goto __pyx_L5_argtuple_error;
17416 kw_args = PyDict_Size(__pyx_kwds);
17417 switch (pos_args) {
17419 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
17420 else goto __pyx_L5_argtuple_error;
17421 CYTHON_FALLTHROUGH;
17424 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i);
17425 if (value) { values[1] = value; kw_args--; }
17428 if (unlikely(kw_args > 0)) {
17429 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"atan") < 0)) __PYX_ERR(0, 1769, __pyx_L3_error)
17432 switch (PyTuple_GET_SIZE(__pyx_args)) {
17433 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17434 CYTHON_FALLTHROUGH;
17435 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17437 default:
goto __pyx_L5_argtuple_error;
17440 __pyx_v_obj = values[0];
17441 __pyx_v_i = values[1];
17443 goto __pyx_L4_argument_unpacking_done;
17444 __pyx_L5_argtuple_error:;
17445 __Pyx_RaiseArgtupleInvalid(
"atan", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1769, __pyx_L3_error)
17447 __Pyx_AddTraceback(
"PyClical.atan", __pyx_clineno, __pyx_lineno, __pyx_filename);
17448 __Pyx_RefNannyFinishContext();
17450 __pyx_L4_argument_unpacking_done:;
17451 __pyx_r = __pyx_pf_8PyClical_68atan(__pyx_self, __pyx_v_obj, __pyx_v_i);
17454 __Pyx_RefNannyFinishContext();
17458 static PyObject *__pyx_pf_8PyClical_68atan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
17459 PyObject *__pyx_r = NULL;
17460 __Pyx_RefNannyDeclarations
17461 PyObject *__pyx_t_1 = NULL;
17462 struct __pyx_opt_args_8PyClical_atan __pyx_t_2;
17463 __Pyx_RefNannySetupContext(
"atan", 0);
17464 __Pyx_XDECREF(__pyx_r);
17465 __pyx_t_2.__pyx_n = 1;
17466 __pyx_t_2.i = __pyx_v_i;
17467 __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)
17468 __Pyx_GOTREF(__pyx_t_1);
17469 __pyx_r = __pyx_t_1;
17475 __Pyx_XDECREF(__pyx_t_1);
17476 __Pyx_AddTraceback(
"PyClical.atan", __pyx_clineno, __pyx_lineno, __pyx_filename);
17479 __Pyx_XGIVEREF(__pyx_r);
17480 __Pyx_RefNannyFinishContext();
17492 static PyObject *__pyx_pw_8PyClical_71tanh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
17493 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_tanh(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
17494 PyObject *__pyx_r = NULL;
17495 __Pyx_RefNannyDeclarations
17496 PyObject *__pyx_t_1 = NULL;
17497 PyObject *__pyx_t_2 = NULL;
17498 PyObject *__pyx_t_3 = NULL;
17499 PyObject *__pyx_t_4 = NULL;
17500 PyObject *__pyx_t_5 = NULL;
17501 PyObject *__pyx_t_6 = NULL;
17502 PyObject *__pyx_t_7 = NULL;
17503 PyObject *__pyx_t_8 = NULL;
17504 __Pyx_RefNannySetupContext(
"tanh", 0);
17514 __Pyx_PyThreadState_declare
17515 __Pyx_PyThreadState_assign
17516 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
17517 __Pyx_XGOTREF(__pyx_t_1);
17518 __Pyx_XGOTREF(__pyx_t_2);
17519 __Pyx_XGOTREF(__pyx_t_3);
17529 __Pyx_XDECREF(__pyx_r);
17530 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1794, __pyx_L3_error)
17531 __Pyx_GOTREF(__pyx_t_5);
17532 __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)
17533 __Pyx_GOTREF(__pyx_t_6);
17534 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17536 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
17537 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
17538 if (likely(__pyx_t_5)) {
17539 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
17540 __Pyx_INCREF(__pyx_t_5);
17541 __Pyx_INCREF(
function);
17542 __Pyx_DECREF_SET(__pyx_t_6,
function);
17546 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_obj);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1794, __pyx_L3_error)
17547 __Pyx_GOTREF(__pyx_t_4);
17549 #if CYTHON_FAST_PYCALL 17550 if (PyFunction_Check(__pyx_t_6)) {
17551 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_obj};
17552 __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)
17553 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17554 __Pyx_GOTREF(__pyx_t_4);
17557 #if CYTHON_FAST_PYCCALL 17558 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
17559 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_obj};
17560 __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)
17561 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17562 __Pyx_GOTREF(__pyx_t_4);
17566 __pyx_t_7 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1794, __pyx_L3_error)
17567 __Pyx_GOTREF(__pyx_t_7);
17568 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
17569 __Pyx_INCREF(__pyx_v_obj);
17570 __Pyx_GIVEREF(__pyx_v_obj);
17571 PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_obj);
17572 __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)
17573 __Pyx_GOTREF(__pyx_t_4);
17574 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
17577 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17578 __pyx_r = __pyx_t_4;
17580 goto __pyx_L7_try_return;
17591 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17592 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
17593 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
17594 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
17604 __Pyx_AddTraceback(
"PyClical.tanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17605 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1795, __pyx_L5_except_error)
17606 __Pyx_GOTREF(__pyx_t_4);
17607 __Pyx_GOTREF(__pyx_t_6);
17608 __Pyx_GOTREF(__pyx_t_7);
17617 __Pyx_XDECREF(__pyx_r);
17618 __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)
17619 __Pyx_GOTREF(__pyx_t_5);
17620 __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)
17621 __Pyx_GOTREF(__pyx_t_8);
17622 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17623 __pyx_r = __pyx_t_8;
17625 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17626 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17627 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
17628 goto __pyx_L6_except_return;
17630 __pyx_L5_except_error:;
17639 __Pyx_XGIVEREF(__pyx_t_1);
17640 __Pyx_XGIVEREF(__pyx_t_2);
17641 __Pyx_XGIVEREF(__pyx_t_3);
17642 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
17643 goto __pyx_L1_error;
17644 __pyx_L7_try_return:;
17645 __Pyx_XGIVEREF(__pyx_t_1);
17646 __Pyx_XGIVEREF(__pyx_t_2);
17647 __Pyx_XGIVEREF(__pyx_t_3);
17648 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
17650 __pyx_L6_except_return:;
17651 __Pyx_XGIVEREF(__pyx_t_1);
17652 __Pyx_XGIVEREF(__pyx_t_2);
17653 __Pyx_XGIVEREF(__pyx_t_3);
17654 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
17668 __Pyx_XDECREF(__pyx_t_4);
17669 __Pyx_XDECREF(__pyx_t_5);
17670 __Pyx_XDECREF(__pyx_t_6);
17671 __Pyx_XDECREF(__pyx_t_7);
17672 __Pyx_XDECREF(__pyx_t_8);
17673 __Pyx_AddTraceback(
"PyClical.tanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17676 __Pyx_XGIVEREF(__pyx_r);
17677 __Pyx_RefNannyFinishContext();
17682 static PyObject *__pyx_pw_8PyClical_71tanh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
17683 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 ";
17684 static PyObject *__pyx_pw_8PyClical_71tanh(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
17685 PyObject *__pyx_r = 0;
17686 __Pyx_RefNannyDeclarations
17687 __Pyx_RefNannySetupContext(
"tanh (wrapper)", 0);
17688 __pyx_r = __pyx_pf_8PyClical_70tanh(__pyx_self, ((PyObject *)__pyx_v_obj));
17691 __Pyx_RefNannyFinishContext();
17695 static PyObject *__pyx_pf_8PyClical_70tanh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
17696 PyObject *__pyx_r = NULL;
17697 __Pyx_RefNannyDeclarations
17698 PyObject *__pyx_t_1 = NULL;
17699 __Pyx_RefNannySetupContext(
"tanh", 0);
17700 __Pyx_XDECREF(__pyx_r);
17701 __pyx_t_1 = __pyx_f_8PyClical_tanh(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1786, __pyx_L1_error)
17702 __Pyx_GOTREF(__pyx_t_1);
17703 __pyx_r = __pyx_t_1;
17709 __Pyx_XDECREF(__pyx_t_1);
17710 __Pyx_AddTraceback(
"PyClical.tanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17713 __Pyx_XGIVEREF(__pyx_r);
17714 __Pyx_RefNannyFinishContext();
17726 static PyObject *__pyx_pw_8PyClical_73atanh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17727 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) {
17728 PyObject *__pyx_v_i = ((PyObject *)Py_None);
17729 PyObject *__pyx_r = NULL;
17730 __Pyx_RefNannyDeclarations
17733 PyObject *__pyx_t_3 = NULL;
17735 PyObject *__pyx_t_5 = NULL;
17736 PyObject *__pyx_t_6 = NULL;
17737 PyObject *__pyx_t_7 = NULL;
17738 PyObject *__pyx_t_8 = NULL;
17739 PyObject *__pyx_t_9 = NULL;
17740 PyObject *__pyx_t_10 = NULL;
17741 PyObject *__pyx_t_11 = NULL;
17742 __Pyx_RefNannySetupContext(
"atanh", 0);
17743 if (__pyx_optional_args) {
17744 if (__pyx_optional_args->__pyx_n > 0) {
17745 __pyx_v_i = __pyx_optional_args->i;
17756 __pyx_t_1 = (__pyx_v_i != Py_None);
17757 __pyx_t_2 = (__pyx_t_1 != 0);
17767 __Pyx_XDECREF(__pyx_r);
17768 __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)
17769 __Pyx_GOTREF(__pyx_t_3);
17771 __pyx_t_4 =
atanh(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
17773 __Pyx_CppExn2PyErr();
17774 __PYX_ERR(0, 1808, __pyx_L1_error)
17776 __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)
17777 __Pyx_GOTREF(__pyx_t_5);
17778 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17779 __pyx_r = __pyx_t_5;
17801 __Pyx_PyThreadState_declare
17802 __Pyx_PyThreadState_assign
17803 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
17804 __Pyx_XGOTREF(__pyx_t_6);
17805 __Pyx_XGOTREF(__pyx_t_7);
17806 __Pyx_XGOTREF(__pyx_t_8);
17816 __Pyx_XDECREF(__pyx_r);
17817 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1811, __pyx_L4_error)
17818 __Pyx_GOTREF(__pyx_t_3);
17819 __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)
17820 __Pyx_GOTREF(__pyx_t_9);
17821 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17823 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
17824 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
17825 if (likely(__pyx_t_3)) {
17826 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
17827 __Pyx_INCREF(__pyx_t_3);
17828 __Pyx_INCREF(
function);
17829 __Pyx_DECREF_SET(__pyx_t_9,
function);
17833 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1811, __pyx_L4_error)
17834 __Pyx_GOTREF(__pyx_t_5);
17836 #if CYTHON_FAST_PYCALL 17837 if (PyFunction_Check(__pyx_t_9)) {
17838 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
17839 __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)
17840 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17841 __Pyx_GOTREF(__pyx_t_5);
17844 #if CYTHON_FAST_PYCCALL 17845 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
17846 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
17847 __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)
17848 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17849 __Pyx_GOTREF(__pyx_t_5);
17853 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1811, __pyx_L4_error)
17854 __Pyx_GOTREF(__pyx_t_10);
17855 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
17856 __Pyx_INCREF(__pyx_v_obj);
17857 __Pyx_GIVEREF(__pyx_v_obj);
17858 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
17859 __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)
17860 __Pyx_GOTREF(__pyx_t_5);
17861 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
17864 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17865 __pyx_r = __pyx_t_5;
17867 goto __pyx_L8_try_return;
17878 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17879 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
17880 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
17881 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17891 __Pyx_AddTraceback(
"PyClical.atanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17892 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1812, __pyx_L6_except_error)
17893 __Pyx_GOTREF(__pyx_t_5);
17894 __Pyx_GOTREF(__pyx_t_9);
17895 __Pyx_GOTREF(__pyx_t_10);
17904 __Pyx_XDECREF(__pyx_r);
17905 __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)
17906 __Pyx_GOTREF(__pyx_t_3);
17907 __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)
17908 __Pyx_GOTREF(__pyx_t_11);
17909 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17910 __pyx_r = __pyx_t_11;
17912 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17913 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17914 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
17915 goto __pyx_L7_except_return;
17917 __pyx_L6_except_error:;
17926 __Pyx_XGIVEREF(__pyx_t_6);
17927 __Pyx_XGIVEREF(__pyx_t_7);
17928 __Pyx_XGIVEREF(__pyx_t_8);
17929 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17930 goto __pyx_L1_error;
17931 __pyx_L8_try_return:;
17932 __Pyx_XGIVEREF(__pyx_t_6);
17933 __Pyx_XGIVEREF(__pyx_t_7);
17934 __Pyx_XGIVEREF(__pyx_t_8);
17935 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17937 __pyx_L7_except_return:;
17938 __Pyx_XGIVEREF(__pyx_t_6);
17939 __Pyx_XGIVEREF(__pyx_t_7);
17940 __Pyx_XGIVEREF(__pyx_t_8);
17941 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17956 __Pyx_XDECREF(__pyx_t_3);
17957 __Pyx_XDECREF(__pyx_t_5);
17958 __Pyx_XDECREF(__pyx_t_9);
17959 __Pyx_XDECREF(__pyx_t_10);
17960 __Pyx_XDECREF(__pyx_t_11);
17961 __Pyx_AddTraceback(
"PyClical.atanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17964 __Pyx_XGIVEREF(__pyx_r);
17965 __Pyx_RefNannyFinishContext();
17970 static PyObject *__pyx_pw_8PyClical_73atanh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17971 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 ";
17972 static PyObject *__pyx_pw_8PyClical_73atanh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17973 PyObject *__pyx_v_obj = 0;
17974 PyObject *__pyx_v_i = 0;
17975 PyObject *__pyx_r = 0;
17976 __Pyx_RefNannyDeclarations
17977 __Pyx_RefNannySetupContext(
"atanh (wrapper)", 0);
17979 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
17980 PyObject* values[2] = {0,0};
17981 values[1] = ((PyObject *)Py_None);
17982 if (unlikely(__pyx_kwds)) {
17983 Py_ssize_t kw_args;
17984 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17985 switch (pos_args) {
17986 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17987 CYTHON_FALLTHROUGH;
17988 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17989 CYTHON_FALLTHROUGH;
17991 default:
goto __pyx_L5_argtuple_error;
17993 kw_args = PyDict_Size(__pyx_kwds);
17994 switch (pos_args) {
17996 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
17997 else goto __pyx_L5_argtuple_error;
17998 CYTHON_FALLTHROUGH;
18001 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i);
18002 if (value) { values[1] = value; kw_args--; }
18005 if (unlikely(kw_args > 0)) {
18006 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"atanh") < 0)) __PYX_ERR(0, 1798, __pyx_L3_error)
18009 switch (PyTuple_GET_SIZE(__pyx_args)) {
18010 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18011 CYTHON_FALLTHROUGH;
18012 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18014 default:
goto __pyx_L5_argtuple_error;
18017 __pyx_v_obj = values[0];
18018 __pyx_v_i = values[1];
18020 goto __pyx_L4_argument_unpacking_done;
18021 __pyx_L5_argtuple_error:;
18022 __Pyx_RaiseArgtupleInvalid(
"atanh", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1798, __pyx_L3_error)
18024 __Pyx_AddTraceback(
"PyClical.atanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
18025 __Pyx_RefNannyFinishContext();
18027 __pyx_L4_argument_unpacking_done:;
18028 __pyx_r = __pyx_pf_8PyClical_72atanh(__pyx_self, __pyx_v_obj, __pyx_v_i);
18031 __Pyx_RefNannyFinishContext();
18035 static PyObject *__pyx_pf_8PyClical_72atanh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
18036 PyObject *__pyx_r = NULL;
18037 __Pyx_RefNannyDeclarations
18038 PyObject *__pyx_t_1 = NULL;
18039 struct __pyx_opt_args_8PyClical_atanh __pyx_t_2;
18040 __Pyx_RefNannySetupContext(
"atanh", 0);
18041 __Pyx_XDECREF(__pyx_r);
18042 __pyx_t_2.__pyx_n = 1;
18043 __pyx_t_2.i = __pyx_v_i;
18044 __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)
18045 __Pyx_GOTREF(__pyx_t_1);
18046 __pyx_r = __pyx_t_1;
18052 __Pyx_XDECREF(__pyx_t_1);
18053 __Pyx_AddTraceback(
"PyClical.atanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
18056 __Pyx_XGIVEREF(__pyx_r);
18057 __Pyx_RefNannyFinishContext();
18069 static PyObject *__pyx_pw_8PyClical_75random_clifford(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
18070 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) {
18071 PyObject *__pyx_v_fill = ((PyObject *)__pyx_float_1_0);
18072 PyObject *__pyx_r = NULL;
18073 __Pyx_RefNannyDeclarations
18074 PyObject *__pyx_t_1 = NULL;
18075 PyObject *__pyx_t_2 = NULL;
18077 PyObject *__pyx_t_4 = NULL;
18078 __Pyx_RefNannySetupContext(
"random_clifford", 0);
18079 if (__pyx_optional_args) {
18080 if (__pyx_optional_args->__pyx_n > 0) {
18081 __pyx_v_fill = __pyx_optional_args->fill;
18092 __Pyx_XDECREF(__pyx_r);
18093 __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)
18094 __Pyx_GOTREF(__pyx_t_1);
18095 __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)
18096 __Pyx_GOTREF(__pyx_t_2);
18097 __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)
18098 __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)
18099 __Pyx_GOTREF(__pyx_t_4);
18100 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18101 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18102 __pyx_r = __pyx_t_4;
18116 __Pyx_XDECREF(__pyx_t_1);
18117 __Pyx_XDECREF(__pyx_t_2);
18118 __Pyx_XDECREF(__pyx_t_4);
18119 __Pyx_AddTraceback(
"PyClical.random_clifford", __pyx_clineno, __pyx_lineno, __pyx_filename);
18122 __Pyx_XGIVEREF(__pyx_r);
18123 __Pyx_RefNannyFinishContext();
18128 static PyObject *__pyx_pw_8PyClical_75random_clifford(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
18129 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 ";
18130 static PyObject *__pyx_pw_8PyClical_75random_clifford(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18131 struct __pyx_obj_8PyClical_index_set *__pyx_v_ixt = 0;
18132 PyObject *__pyx_v_fill = 0;
18133 PyObject *__pyx_r = 0;
18134 __Pyx_RefNannyDeclarations
18135 __Pyx_RefNannySetupContext(
"random_clifford (wrapper)", 0);
18137 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ixt,&__pyx_n_s_fill,0};
18138 PyObject* values[2] = {0,0};
18139 values[1] = ((PyObject *)__pyx_float_1_0);
18140 if (unlikely(__pyx_kwds)) {
18141 Py_ssize_t kw_args;
18142 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
18143 switch (pos_args) {
18144 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18145 CYTHON_FALLTHROUGH;
18146 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18147 CYTHON_FALLTHROUGH;
18149 default:
goto __pyx_L5_argtuple_error;
18151 kw_args = PyDict_Size(__pyx_kwds);
18152 switch (pos_args) {
18154 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ixt)) != 0)) kw_args--;
18155 else goto __pyx_L5_argtuple_error;
18156 CYTHON_FALLTHROUGH;
18159 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill);
18160 if (value) { values[1] = value; kw_args--; }
18163 if (unlikely(kw_args > 0)) {
18164 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"random_clifford") < 0)) __PYX_ERR(0, 1815, __pyx_L3_error)
18167 switch (PyTuple_GET_SIZE(__pyx_args)) {
18168 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18169 CYTHON_FALLTHROUGH;
18170 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18172 default:
goto __pyx_L5_argtuple_error;
18175 __pyx_v_ixt = ((
struct __pyx_obj_8PyClical_index_set *)values[0]);
18176 __pyx_v_fill = values[1];
18178 goto __pyx_L4_argument_unpacking_done;
18179 __pyx_L5_argtuple_error:;
18180 __Pyx_RaiseArgtupleInvalid(
"random_clifford", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1815, __pyx_L3_error)
18182 __Pyx_AddTraceback(
"PyClical.random_clifford", __pyx_clineno, __pyx_lineno, __pyx_filename);
18183 __Pyx_RefNannyFinishContext();
18185 __pyx_L4_argument_unpacking_done:;
18186 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ixt), __pyx_ptype_8PyClical_index_set, 1,
"ixt", 0))) __PYX_ERR(0, 1815, __pyx_L1_error)
18187 __pyx_r = __pyx_pf_8PyClical_74random_clifford(__pyx_self, __pyx_v_ixt, __pyx_v_fill);
18194 __Pyx_RefNannyFinishContext();
18198 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) {
18199 PyObject *__pyx_r = NULL;
18200 __Pyx_RefNannyDeclarations
18201 PyObject *__pyx_t_1 = NULL;
18202 struct __pyx_opt_args_8PyClical_random_clifford __pyx_t_2;
18203 __Pyx_RefNannySetupContext(
"random_clifford", 0);
18204 __Pyx_XDECREF(__pyx_r);
18205 __pyx_t_2.__pyx_n = 1;
18206 __pyx_t_2.fill = __pyx_v_fill;
18207 __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)
18208 __Pyx_GOTREF(__pyx_t_1);
18209 __pyx_r = __pyx_t_1;
18215 __Pyx_XDECREF(__pyx_t_1);
18216 __Pyx_AddTraceback(
"PyClical.random_clifford", __pyx_clineno, __pyx_lineno, __pyx_filename);
18219 __Pyx_XGIVEREF(__pyx_r);
18220 __Pyx_RefNannyFinishContext();
18232 static PyObject *__pyx_pw_8PyClical_77cga3(PyObject *__pyx_self, PyObject *__pyx_v_obj);
18233 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cga3(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
18234 PyObject *__pyx_r = NULL;
18235 __Pyx_RefNannyDeclarations
18236 PyObject *__pyx_t_1 = NULL;
18237 PyObject *__pyx_t_2 = NULL;
18238 __Pyx_RefNannySetupContext(
"cga3", 0);
18247 __Pyx_XDECREF(__pyx_r);
18248 __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)
18249 __Pyx_GOTREF(__pyx_t_1);
18250 __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)
18251 __Pyx_GOTREF(__pyx_t_2);
18252 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18253 __pyx_r = __pyx_t_2;
18267 __Pyx_XDECREF(__pyx_t_1);
18268 __Pyx_XDECREF(__pyx_t_2);
18269 __Pyx_AddTraceback(
"PyClical.cga3", __pyx_clineno, __pyx_lineno, __pyx_filename);
18272 __Pyx_XGIVEREF(__pyx_r);
18273 __Pyx_RefNannyFinishContext();
18278 static PyObject *__pyx_pw_8PyClical_77cga3(PyObject *__pyx_self, PyObject *__pyx_v_obj);
18279 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 ";
18280 static PyObject *__pyx_pw_8PyClical_77cga3(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18281 PyObject *__pyx_r = 0;
18282 __Pyx_RefNannyDeclarations
18283 __Pyx_RefNannySetupContext(
"cga3 (wrapper)", 0);
18284 __pyx_r = __pyx_pf_8PyClical_76cga3(__pyx_self, ((PyObject *)__pyx_v_obj));
18287 __Pyx_RefNannyFinishContext();
18291 static PyObject *__pyx_pf_8PyClical_76cga3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18292 PyObject *__pyx_r = NULL;
18293 __Pyx_RefNannyDeclarations
18294 PyObject *__pyx_t_1 = NULL;
18295 __Pyx_RefNannySetupContext(
"cga3", 0);
18296 __Pyx_XDECREF(__pyx_r);
18297 __pyx_t_1 = __pyx_f_8PyClical_cga3(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1824, __pyx_L1_error)
18298 __Pyx_GOTREF(__pyx_t_1);
18299 __pyx_r = __pyx_t_1;
18305 __Pyx_XDECREF(__pyx_t_1);
18306 __Pyx_AddTraceback(
"PyClical.cga3", __pyx_clineno, __pyx_lineno, __pyx_filename);
18309 __Pyx_XGIVEREF(__pyx_r);
18310 __Pyx_RefNannyFinishContext();
18322 static PyObject *__pyx_pw_8PyClical_79cga3std(PyObject *__pyx_self, PyObject *__pyx_v_obj);
18323 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cga3std(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
18324 PyObject *__pyx_r = NULL;
18325 __Pyx_RefNannyDeclarations
18326 PyObject *__pyx_t_1 = NULL;
18327 PyObject *__pyx_t_2 = NULL;
18328 __Pyx_RefNannySetupContext(
"cga3std", 0);
18337 __Pyx_XDECREF(__pyx_r);
18338 __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)
18339 __Pyx_GOTREF(__pyx_t_1);
18340 __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)
18341 __Pyx_GOTREF(__pyx_t_2);
18342 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18343 __pyx_r = __pyx_t_2;
18357 __Pyx_XDECREF(__pyx_t_1);
18358 __Pyx_XDECREF(__pyx_t_2);
18359 __Pyx_AddTraceback(
"PyClical.cga3std", __pyx_clineno, __pyx_lineno, __pyx_filename);
18362 __Pyx_XGIVEREF(__pyx_r);
18363 __Pyx_RefNannyFinishContext();
18368 static PyObject *__pyx_pw_8PyClical_79cga3std(PyObject *__pyx_self, PyObject *__pyx_v_obj);
18369 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 ";
18370 static PyObject *__pyx_pw_8PyClical_79cga3std(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18371 PyObject *__pyx_r = 0;
18372 __Pyx_RefNannyDeclarations
18373 __Pyx_RefNannySetupContext(
"cga3std (wrapper)", 0);
18374 __pyx_r = __pyx_pf_8PyClical_78cga3std(__pyx_self, ((PyObject *)__pyx_v_obj));
18377 __Pyx_RefNannyFinishContext();
18381 static PyObject *__pyx_pf_8PyClical_78cga3std(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18382 PyObject *__pyx_r = NULL;
18383 __Pyx_RefNannyDeclarations
18384 PyObject *__pyx_t_1 = NULL;
18385 __Pyx_RefNannySetupContext(
"cga3std", 0);
18386 __Pyx_XDECREF(__pyx_r);
18387 __pyx_t_1 = __pyx_f_8PyClical_cga3std(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1833, __pyx_L1_error)
18388 __Pyx_GOTREF(__pyx_t_1);
18389 __pyx_r = __pyx_t_1;
18395 __Pyx_XDECREF(__pyx_t_1);
18396 __Pyx_AddTraceback(
"PyClical.cga3std", __pyx_clineno, __pyx_lineno, __pyx_filename);
18399 __Pyx_XGIVEREF(__pyx_r);
18400 __Pyx_RefNannyFinishContext();
18412 static PyObject *__pyx_pw_8PyClical_81agc3(PyObject *__pyx_self, PyObject *__pyx_v_obj);
18413 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_agc3(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
18414 PyObject *__pyx_r = NULL;
18415 __Pyx_RefNannyDeclarations
18416 PyObject *__pyx_t_1 = NULL;
18417 PyObject *__pyx_t_2 = NULL;
18418 __Pyx_RefNannySetupContext(
"agc3", 0);
18427 __Pyx_XDECREF(__pyx_r);
18428 __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)
18429 __Pyx_GOTREF(__pyx_t_1);
18430 __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)
18431 __Pyx_GOTREF(__pyx_t_2);
18432 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18433 __pyx_r = __pyx_t_2;
18447 __Pyx_XDECREF(__pyx_t_1);
18448 __Pyx_XDECREF(__pyx_t_2);
18449 __Pyx_AddTraceback(
"PyClical.agc3", __pyx_clineno, __pyx_lineno, __pyx_filename);
18452 __Pyx_XGIVEREF(__pyx_r);
18453 __Pyx_RefNannyFinishContext();
18458 static PyObject *__pyx_pw_8PyClical_81agc3(PyObject *__pyx_self, PyObject *__pyx_v_obj);
18459 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 ";
18460 static PyObject *__pyx_pw_8PyClical_81agc3(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18461 PyObject *__pyx_r = 0;
18462 __Pyx_RefNannyDeclarations
18463 __Pyx_RefNannySetupContext(
"agc3 (wrapper)", 0);
18464 __pyx_r = __pyx_pf_8PyClical_80agc3(__pyx_self, ((PyObject *)__pyx_v_obj));
18467 __Pyx_RefNannyFinishContext();
18471 static PyObject *__pyx_pf_8PyClical_80agc3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18472 PyObject *__pyx_r = NULL;
18473 __Pyx_RefNannyDeclarations
18474 PyObject *__pyx_t_1 = NULL;
18475 __Pyx_RefNannySetupContext(
"agc3", 0);
18476 __Pyx_XDECREF(__pyx_r);
18477 __pyx_t_1 = __pyx_f_8PyClical_agc3(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1844, __pyx_L1_error)
18478 __Pyx_GOTREF(__pyx_t_1);
18479 __pyx_r = __pyx_t_1;
18485 __Pyx_XDECREF(__pyx_t_1);
18486 __Pyx_AddTraceback(
"PyClical.agc3", __pyx_clineno, __pyx_lineno, __pyx_filename);
18489 __Pyx_XGIVEREF(__pyx_r);
18490 __Pyx_RefNannyFinishContext();
18503 static PyObject *__pyx_pw_8PyClical_83e(PyObject *__pyx_self, PyObject *__pyx_v_obj);
18504 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 ";
18505 static PyMethodDef __pyx_mdef_8PyClical_83e = {
"e", (PyCFunction)__pyx_pw_8PyClical_83e, METH_O, __pyx_doc_8PyClical_82e};
18506 static PyObject *__pyx_pw_8PyClical_83e(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18507 PyObject *__pyx_r = 0;
18508 __Pyx_RefNannyDeclarations
18509 __Pyx_RefNannySetupContext(
"e (wrapper)", 0);
18510 __pyx_r = __pyx_pf_8PyClical_82e(__pyx_self, ((PyObject *)__pyx_v_obj));
18513 __Pyx_RefNannyFinishContext();
18517 static PyObject *__pyx_pf_8PyClical_82e(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18518 PyObject *__pyx_r = NULL;
18519 __Pyx_RefNannyDeclarations
18520 PyObject *__pyx_t_1 = NULL;
18521 PyObject *__pyx_t_2 = NULL;
18522 __Pyx_RefNannySetupContext(
"e", 0);
18531 __Pyx_XDECREF(__pyx_r);
18532 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1898, __pyx_L1_error)
18533 __Pyx_GOTREF(__pyx_t_1);
18534 __Pyx_INCREF(__pyx_v_obj);
18535 __Pyx_GIVEREF(__pyx_v_obj);
18536 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_obj);
18537 __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)
18538 __Pyx_GOTREF(__pyx_t_2);
18539 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18540 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1898, __pyx_L1_error)
18541 __Pyx_GOTREF(__pyx_t_1);
18542 __Pyx_GIVEREF(__pyx_t_2);
18543 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
18545 __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)
18546 __Pyx_GOTREF(__pyx_t_2);
18547 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18548 __pyx_r = __pyx_t_2;
18562 __Pyx_XDECREF(__pyx_t_1);
18563 __Pyx_XDECREF(__pyx_t_2);
18564 __Pyx_AddTraceback(
"PyClical.e", __pyx_clineno, __pyx_lineno, __pyx_filename);
18567 __Pyx_XGIVEREF(__pyx_r);
18568 __Pyx_RefNannyFinishContext();
18581 static PyObject *__pyx_pw_8PyClical_85istpq(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
18582 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 ";
18583 static PyMethodDef __pyx_mdef_8PyClical_85istpq = {
"istpq", (PyCFunction)__pyx_pw_8PyClical_85istpq, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_84istpq};
18584 static PyObject *__pyx_pw_8PyClical_85istpq(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18585 PyObject *__pyx_v_p = 0;
18586 PyObject *__pyx_v_q = 0;
18587 PyObject *__pyx_r = 0;
18588 __Pyx_RefNannyDeclarations
18589 __Pyx_RefNannySetupContext(
"istpq (wrapper)", 0);
18591 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,&__pyx_n_s_q,0};
18592 PyObject* values[2] = {0,0};
18593 if (unlikely(__pyx_kwds)) {
18594 Py_ssize_t kw_args;
18595 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
18596 switch (pos_args) {
18597 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18598 CYTHON_FALLTHROUGH;
18599 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18600 CYTHON_FALLTHROUGH;
18602 default:
goto __pyx_L5_argtuple_error;
18604 kw_args = PyDict_Size(__pyx_kwds);
18605 switch (pos_args) {
18607 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_p)) != 0)) kw_args--;
18608 else goto __pyx_L5_argtuple_error;
18609 CYTHON_FALLTHROUGH;
18611 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q)) != 0)) kw_args--;
18613 __Pyx_RaiseArgtupleInvalid(
"istpq", 1, 2, 2, 1); __PYX_ERR(0, 1900, __pyx_L3_error)
18616 if (unlikely(kw_args > 0)) {
18617 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"istpq") < 0)) __PYX_ERR(0, 1900, __pyx_L3_error)
18619 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
18620 goto __pyx_L5_argtuple_error;
18622 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18623 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18625 __pyx_v_p = values[0];
18626 __pyx_v_q = values[1];
18628 goto __pyx_L4_argument_unpacking_done;
18629 __pyx_L5_argtuple_error:;
18630 __Pyx_RaiseArgtupleInvalid(
"istpq", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1900, __pyx_L3_error)
18632 __Pyx_AddTraceback(
"PyClical.istpq", __pyx_clineno, __pyx_lineno, __pyx_filename);
18633 __Pyx_RefNannyFinishContext();
18635 __pyx_L4_argument_unpacking_done:;
18636 __pyx_r = __pyx_pf_8PyClical_84istpq(__pyx_self, __pyx_v_p, __pyx_v_q);
18639 __Pyx_RefNannyFinishContext();
18643 static PyObject *__pyx_pf_8PyClical_84istpq(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_p, PyObject *__pyx_v_q) {
18644 PyObject *__pyx_r = NULL;
18645 __Pyx_RefNannyDeclarations
18646 PyObject *__pyx_t_1 = NULL;
18647 PyObject *__pyx_t_2 = NULL;
18648 PyObject *__pyx_t_3 = NULL;
18649 __Pyx_RefNannySetupContext(
"istpq", 0);
18658 __Pyx_XDECREF(__pyx_r);
18659 __pyx_t_1 = PyNumber_Negative(__pyx_v_q);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1907, __pyx_L1_error)
18660 __Pyx_GOTREF(__pyx_t_1);
18661 __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)
18662 __Pyx_GOTREF(__pyx_t_2);
18663 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1907, __pyx_L1_error)
18664 __Pyx_GOTREF(__pyx_t_3);
18665 __Pyx_GIVEREF(__pyx_t_1);
18666 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
18667 __Pyx_GIVEREF(__pyx_t_2);
18668 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
18671 __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)
18672 __Pyx_GOTREF(__pyx_t_2);
18673 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18674 __pyx_t_3 = PySet_New(__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1907, __pyx_L1_error)
18675 __Pyx_GOTREF(__pyx_t_3);
18676 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18677 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1907, __pyx_L1_error)
18678 __Pyx_GOTREF(__pyx_t_2);
18679 __Pyx_GIVEREF(__pyx_t_3);
18680 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
18682 __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)
18683 __Pyx_GOTREF(__pyx_t_3);
18684 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18685 __pyx_r = __pyx_t_3;
18699 __Pyx_XDECREF(__pyx_t_1);
18700 __Pyx_XDECREF(__pyx_t_2);
18701 __Pyx_XDECREF(__pyx_t_3);
18702 __Pyx_AddTraceback(
"PyClical.istpq", __pyx_clineno, __pyx_lineno, __pyx_filename);
18705 __Pyx_XGIVEREF(__pyx_r);
18706 __Pyx_RefNannyFinishContext();
18719 static PyObject *__pyx_pw_8PyClical_87_test(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused);
18720 static PyMethodDef __pyx_mdef_8PyClical_87_test = {
"_test", (PyCFunction)__pyx_pw_8PyClical_87_test, METH_NOARGS, 0};
18721 static PyObject *__pyx_pw_8PyClical_87_test(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
18722 PyObject *__pyx_r = 0;
18723 __Pyx_RefNannyDeclarations
18724 __Pyx_RefNannySetupContext(
"_test (wrapper)", 0);
18725 __pyx_r = __pyx_pf_8PyClical_86_test(__pyx_self);
18728 __Pyx_RefNannyFinishContext();
18732 static PyObject *__pyx_pf_8PyClical_86_test(CYTHON_UNUSED PyObject *__pyx_self) {
18733 PyObject *__pyx_v_PyClical = NULL;
18734 PyObject *__pyx_v_doctest = NULL;
18735 PyObject *__pyx_r = NULL;
18736 __Pyx_RefNannyDeclarations
18737 PyObject *__pyx_t_1 = NULL;
18738 PyObject *__pyx_t_2 = NULL;
18739 PyObject *__pyx_t_3 = NULL;
18740 PyObject *__pyx_t_4 = NULL;
18741 __Pyx_RefNannySetupContext(
"_test", 0);
18750 __pyx_t_1 = __Pyx_Import(__pyx_n_s_PyClical, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1914, __pyx_L1_error)
18751 __Pyx_GOTREF(__pyx_t_1);
18752 __pyx_v_PyClical = __pyx_t_1;
18754 __pyx_t_1 = __Pyx_Import(__pyx_n_s_doctest, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1914, __pyx_L1_error)
18755 __Pyx_GOTREF(__pyx_t_1);
18756 __pyx_v_doctest = __pyx_t_1;
18766 __Pyx_XDECREF(__pyx_r);
18767 __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)
18768 __Pyx_GOTREF(__pyx_t_2);
18770 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
18771 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
18772 if (likely(__pyx_t_3)) {
18773 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
18774 __Pyx_INCREF(__pyx_t_3);
18775 __Pyx_INCREF(
function);
18776 __Pyx_DECREF_SET(__pyx_t_2,
function);
18780 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_PyClical);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1915, __pyx_L1_error)
18781 __Pyx_GOTREF(__pyx_t_1);
18783 #if CYTHON_FAST_PYCALL 18784 if (PyFunction_Check(__pyx_t_2)) {
18785 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_PyClical};
18786 __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)
18787 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18788 __Pyx_GOTREF(__pyx_t_1);
18791 #if CYTHON_FAST_PYCCALL 18792 if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
18793 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_PyClical};
18794 __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)
18795 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18796 __Pyx_GOTREF(__pyx_t_1);
18800 __pyx_t_4 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1915, __pyx_L1_error)
18801 __Pyx_GOTREF(__pyx_t_4);
18802 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
18803 __Pyx_INCREF(__pyx_v_PyClical);
18804 __Pyx_GIVEREF(__pyx_v_PyClical);
18805 PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_PyClical);
18806 __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)
18807 __Pyx_GOTREF(__pyx_t_1);
18808 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18811 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18812 __pyx_r = __pyx_t_1;
18826 __Pyx_XDECREF(__pyx_t_1);
18827 __Pyx_XDECREF(__pyx_t_2);
18828 __Pyx_XDECREF(__pyx_t_3);
18829 __Pyx_XDECREF(__pyx_t_4);
18830 __Pyx_AddTraceback(
"PyClical._test", __pyx_clineno, __pyx_lineno, __pyx_filename);
18833 __Pyx_XDECREF(__pyx_v_PyClical);
18834 __Pyx_XDECREF(__pyx_v_doctest);
18835 __Pyx_XGIVEREF(__pyx_r);
18836 __Pyx_RefNannyFinishContext();
18839 static struct __pyx_vtabstruct_8PyClical_index_set __pyx_vtable_8PyClical_index_set;
18841 static PyObject *__pyx_tp_new_8PyClical_index_set(PyTypeObject *t, PyObject *a, PyObject *k) {
18842 struct __pyx_obj_8PyClical_index_set *p;
18844 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
18845 o = (*t->tp_alloc)(t, 0);
18847 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
18849 if (unlikely(!o))
return 0;
18850 p = ((
struct __pyx_obj_8PyClical_index_set *)o);
18851 p->__pyx_vtab = __pyx_vtabptr_8PyClical_index_set;
18852 if (unlikely(__pyx_pw_8PyClical_9index_set_3__cinit__(o, a, k) < 0))
goto bad;
18855 Py_DECREF(o); o = 0;
18859 static void __pyx_tp_dealloc_8PyClical_index_set(PyObject *o) {
18860 #if CYTHON_USE_TP_FINALIZE 18861 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))) {
18862 if (PyObject_CallFinalizerFromDealloc(o))
return;
18866 PyObject *etype, *eval, *etb;
18867 PyErr_Fetch(&etype, &eval, &etb);
18869 __pyx_pw_8PyClical_9index_set_5__dealloc__(o);
18871 PyErr_Restore(etype, eval, etb);
18873 (*Py_TYPE(o)->tp_free)(o);
18875 static PyObject *__pyx_sq_item_8PyClical_index_set(PyObject *o, Py_ssize_t
i) {
18877 PyObject *x = PyInt_FromSsize_t(
i);
if(!x)
return 0;
18878 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
18883 static int __pyx_mp_ass_subscript_8PyClical_index_set(PyObject *o, PyObject *
i, PyObject *v) {
18885 return __pyx_pw_8PyClical_9index_set_9__setitem__(o,
i, v);
18888 PyErr_Format(PyExc_NotImplementedError,
18889 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
18894 static PyMethodDef __pyx_methods_8PyClical_index_set[] = {
18895 {
"copy", (PyCFunction)__pyx_pw_8PyClical_9index_set_1copy, METH_NOARGS, __pyx_doc_8PyClical_9index_set_copy},
18896 {
"count", (PyCFunction)__pyx_pw_8PyClical_9index_set_32count, METH_NOARGS, __pyx_doc_8PyClical_9index_set_31count},
18897 {
"count_neg", (PyCFunction)__pyx_pw_8PyClical_9index_set_34count_neg, METH_NOARGS, __pyx_doc_8PyClical_9index_set_33count_neg},
18898 {
"count_pos", (PyCFunction)__pyx_pw_8PyClical_9index_set_36count_pos, METH_NOARGS, __pyx_doc_8PyClical_9index_set_35count_pos},
18899 {
"min", (PyCFunction)__pyx_pw_8PyClical_9index_set_38min, METH_NOARGS, __pyx_doc_8PyClical_9index_set_37min},
18900 {
"max", (PyCFunction)__pyx_pw_8PyClical_9index_set_40max, METH_NOARGS, __pyx_doc_8PyClical_9index_set_39max},
18901 {
"hash_fn", (PyCFunction)__pyx_pw_8PyClical_9index_set_42hash_fn, METH_NOARGS, __pyx_doc_8PyClical_9index_set_41hash_fn},
18902 {
"sign_of_mult", (PyCFunction)__pyx_pw_8PyClical_9index_set_44sign_of_mult, METH_O, __pyx_doc_8PyClical_9index_set_43sign_of_mult},
18903 {
"sign_of_square", (PyCFunction)__pyx_pw_8PyClical_9index_set_46sign_of_square, METH_NOARGS, __pyx_doc_8PyClical_9index_set_45sign_of_square},
18904 {
"__reduce_cython__", (PyCFunction)__pyx_pw_8PyClical_9index_set_52__reduce_cython__, METH_NOARGS, 0},
18905 {
"__setstate_cython__", (PyCFunction)__pyx_pw_8PyClical_9index_set_54__setstate_cython__, METH_O, 0},
18909 static PyNumberMethods __pyx_tp_as_number_index_set = {
18913 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18923 __pyx_pw_8PyClical_9index_set_18__invert__,
18926 __pyx_pw_8PyClical_9index_set_24__and__,
18927 __pyx_pw_8PyClical_9index_set_20__xor__,
18928 __pyx_pw_8PyClical_9index_set_28__or__,
18929 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18933 #if PY_MAJOR_VERSION < 3 18939 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18942 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18948 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18955 __pyx_pw_8PyClical_9index_set_26__iand__,
18956 __pyx_pw_8PyClical_9index_set_22__ixor__,
18957 __pyx_pw_8PyClical_9index_set_30__ior__,
18963 #if PY_VERSION_HEX >= 0x03050000 18966 #if PY_VERSION_HEX >= 0x03050000 18971 static PySequenceMethods __pyx_tp_as_sequence_index_set = {
18975 __pyx_sq_item_8PyClical_index_set,
18979 __pyx_pw_8PyClical_9index_set_13__contains__,
18984 static PyMappingMethods __pyx_tp_as_mapping_index_set = {
18986 __pyx_pw_8PyClical_9index_set_11__getitem__,
18987 __pyx_mp_ass_subscript_8PyClical_index_set,
18990 static PyTypeObject __pyx_type_8PyClical_index_set = {
18991 PyVarObject_HEAD_INIT(0, 0)
18992 "PyClical.index_set",
18993 sizeof(
struct __pyx_obj_8PyClical_index_set),
18995 __pyx_tp_dealloc_8PyClical_index_set,
18999 #if PY_MAJOR_VERSION < 3
19002 #if PY_MAJOR_VERSION >= 3
19005 __pyx_pw_8PyClical_9index_set_48__repr__,
19006 &__pyx_tp_as_number_index_set,
19007 &__pyx_tp_as_sequence_index_set,
19008 &__pyx_tp_as_mapping_index_set,
19011 __pyx_pw_8PyClical_9index_set_50__str__,
19015 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
19016 "\n Python class index_set wraps C++ class IndexSet.\n ",
19019 __pyx_pw_8PyClical_9index_set_7__richcmp__,
19021 __pyx_pw_8PyClical_9index_set_15__iter__,
19023 __pyx_methods_8PyClical_index_set,
19033 __pyx_tp_new_8PyClical_index_set,
19043 #if PY_VERSION_HEX >= 0x030400a1 19047 static struct __pyx_vtabstruct_8PyClical_clifford __pyx_vtable_8PyClical_clifford;
19049 static PyObject *__pyx_tp_new_8PyClical_clifford(PyTypeObject *t, PyObject *a, PyObject *k) {
19050 struct __pyx_obj_8PyClical_clifford *p;
19052 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
19053 o = (*t->tp_alloc)(t, 0);
19055 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
19057 if (unlikely(!o))
return 0;
19058 p = ((
struct __pyx_obj_8PyClical_clifford *)o);
19059 p->__pyx_vtab = __pyx_vtabptr_8PyClical_clifford;
19060 if (unlikely(__pyx_pw_8PyClical_8clifford_3__cinit__(o, a, k) < 0))
goto bad;
19063 Py_DECREF(o); o = 0;
19067 static void __pyx_tp_dealloc_8PyClical_clifford(PyObject *o) {
19068 #if CYTHON_USE_TP_FINALIZE 19069 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))) {
19070 if (PyObject_CallFinalizerFromDealloc(o))
return;
19074 PyObject *etype, *eval, *etb;
19075 PyErr_Fetch(&etype, &eval, &etb);
19077 __pyx_pw_8PyClical_8clifford_5__dealloc__(o);
19079 PyErr_Restore(etype, eval, etb);
19081 (*Py_TYPE(o)->tp_free)(o);
19083 static PyObject *__pyx_sq_item_8PyClical_clifford(PyObject *o, Py_ssize_t
i) {
19085 PyObject *x = PyInt_FromSsize_t(
i);
if(!x)
return 0;
19086 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
19091 static PyMethodDef __pyx_methods_8PyClical_clifford[] = {
19092 {
"copy", (PyCFunction)__pyx_pw_8PyClical_8clifford_1copy, METH_NOARGS, __pyx_doc_8PyClical_8clifford_copy},
19093 {
"reframe", (PyCFunction)__pyx_pw_8PyClical_8clifford_11reframe, METH_O, __pyx_doc_8PyClical_8clifford_10reframe},
19094 {
"inv", (PyCFunction)__pyx_pw_8PyClical_8clifford_49inv, METH_NOARGS, __pyx_doc_8PyClical_8clifford_48inv},
19095 {
"pow", (PyCFunction)__pyx_pw_8PyClical_8clifford_57pow, METH_O, __pyx_doc_8PyClical_8clifford_56pow},
19096 {
"outer_pow", (PyCFunction)__pyx_pw_8PyClical_8clifford_59outer_pow, METH_O, __pyx_doc_8PyClical_8clifford_58outer_pow},
19097 {
"scalar", (PyCFunction)__pyx_pw_8PyClical_8clifford_63scalar, METH_NOARGS, __pyx_doc_8PyClical_8clifford_62scalar},
19098 {
"pure", (PyCFunction)__pyx_pw_8PyClical_8clifford_65pure, METH_NOARGS, __pyx_doc_8PyClical_8clifford_64pure},
19099 {
"even", (PyCFunction)__pyx_pw_8PyClical_8clifford_67even, METH_NOARGS, __pyx_doc_8PyClical_8clifford_66even},
19100 {
"odd", (PyCFunction)__pyx_pw_8PyClical_8clifford_69odd, METH_NOARGS, __pyx_doc_8PyClical_8clifford_68odd},
19101 {
"vector_part", (PyCFunction)__pyx_pw_8PyClical_8clifford_71vector_part, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_8clifford_70vector_part},
19102 {
"involute", (PyCFunction)__pyx_pw_8PyClical_8clifford_73involute, METH_NOARGS, __pyx_doc_8PyClical_8clifford_72involute},
19103 {
"reverse", (PyCFunction)__pyx_pw_8PyClical_8clifford_75reverse, METH_NOARGS, __pyx_doc_8PyClical_8clifford_74reverse},
19104 {
"conj", (PyCFunction)__pyx_pw_8PyClical_8clifford_77conj, METH_NOARGS, __pyx_doc_8PyClical_8clifford_76conj},
19105 {
"quad", (PyCFunction)__pyx_pw_8PyClical_8clifford_79quad, METH_NOARGS, __pyx_doc_8PyClical_8clifford_78quad},
19106 {
"norm", (PyCFunction)__pyx_pw_8PyClical_8clifford_81norm, METH_NOARGS, __pyx_doc_8PyClical_8clifford_80norm},
19107 {
"abs", (PyCFunction)__pyx_pw_8PyClical_8clifford_83abs, METH_NOARGS, __pyx_doc_8PyClical_8clifford_82abs},
19108 {
"max_abs", (PyCFunction)__pyx_pw_8PyClical_8clifford_85max_abs, METH_NOARGS, __pyx_doc_8PyClical_8clifford_84max_abs},
19109 {
"truncated", (PyCFunction)__pyx_pw_8PyClical_8clifford_87truncated, METH_O, __pyx_doc_8PyClical_8clifford_86truncated},
19110 {
"isnan", (PyCFunction)__pyx_pw_8PyClical_8clifford_89isnan, METH_NOARGS, __pyx_doc_8PyClical_8clifford_88isnan},
19111 {
"frame", (PyCFunction)__pyx_pw_8PyClical_8clifford_91frame, METH_NOARGS, __pyx_doc_8PyClical_8clifford_90frame},
19112 {
"__reduce_cython__", (PyCFunction)__pyx_pw_8PyClical_8clifford_97__reduce_cython__, METH_NOARGS, 0},
19113 {
"__setstate_cython__", (PyCFunction)__pyx_pw_8PyClical_8clifford_99__setstate_cython__, METH_O, 0},
19117 static PyNumberMethods __pyx_tp_as_number_clifford = {
19118 __pyx_pw_8PyClical_8clifford_21__add__,
19119 __pyx_pw_8PyClical_8clifford_25__sub__,
19120 __pyx_pw_8PyClical_8clifford_29__mul__,
19121 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 19122 __pyx_pw_8PyClical_8clifford_45__div__,
19124 __pyx_pw_8PyClical_8clifford_33__mod__,
19126 __pyx_pw_8PyClical_8clifford_55__pow__,
19127 __pyx_pw_8PyClical_8clifford_17__neg__,
19128 __pyx_pw_8PyClical_8clifford_19__pos__,
19134 __pyx_pw_8PyClical_8clifford_37__and__,
19135 __pyx_pw_8PyClical_8clifford_41__xor__,
19136 __pyx_pw_8PyClical_8clifford_51__or__,
19137 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 19141 #if PY_MAJOR_VERSION < 3 19147 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 19150 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 19153 __pyx_pw_8PyClical_8clifford_23__iadd__,
19154 __pyx_pw_8PyClical_8clifford_27__isub__,
19155 __pyx_pw_8PyClical_8clifford_31__imul__,
19156 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 19157 __pyx_pw_8PyClical_8clifford_47__idiv__,
19159 __pyx_pw_8PyClical_8clifford_35__imod__,
19163 __pyx_pw_8PyClical_8clifford_39__iand__,
19164 __pyx_pw_8PyClical_8clifford_43__ixor__,
19165 __pyx_pw_8PyClical_8clifford_53__ior__,
19171 #if PY_VERSION_HEX >= 0x03050000 19174 #if PY_VERSION_HEX >= 0x03050000 19179 static PySequenceMethods __pyx_tp_as_sequence_clifford = {
19183 __pyx_sq_item_8PyClical_clifford,
19187 __pyx_pw_8PyClical_8clifford_7__contains__,
19192 static PyMappingMethods __pyx_tp_as_mapping_clifford = {
19194 __pyx_pw_8PyClical_8clifford_15__getitem__,
19198 static PyTypeObject __pyx_type_8PyClical_clifford = {
19199 PyVarObject_HEAD_INIT(0, 0)
19200 "PyClical.clifford",
19201 sizeof(
struct __pyx_obj_8PyClical_clifford),
19203 __pyx_tp_dealloc_8PyClical_clifford,
19207 #if PY_MAJOR_VERSION < 3
19210 #if PY_MAJOR_VERSION >= 3
19213 __pyx_pw_8PyClical_8clifford_93__repr__,
19214 &__pyx_tp_as_number_clifford,
19215 &__pyx_tp_as_sequence_clifford,
19216 &__pyx_tp_as_mapping_clifford,
19218 __pyx_pw_8PyClical_8clifford_61__call__,
19219 __pyx_pw_8PyClical_8clifford_95__str__,
19223 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
19224 "\n Python class clifford wraps C++ class Clifford.\n ",
19227 __pyx_pw_8PyClical_8clifford_13__richcmp__,
19229 __pyx_pw_8PyClical_8clifford_9__iter__,
19231 __pyx_methods_8PyClical_clifford,
19241 __pyx_tp_new_8PyClical_clifford,
19251 #if PY_VERSION_HEX >= 0x030400a1 19256 static struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *__pyx_freelist_8PyClical___pyx_scope_struct____iter__[8];
19257 static int __pyx_freecount_8PyClical___pyx_scope_struct____iter__ = 0;
19259 static PyObject *__pyx_tp_new_8PyClical___pyx_scope_struct____iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
19261 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__)))) {
19262 o = (PyObject*)__pyx_freelist_8PyClical___pyx_scope_struct____iter__[--__pyx_freecount_8PyClical___pyx_scope_struct____iter__];
19263 memset(o, 0,
sizeof(
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__));
19264 (void) PyObject_INIT(o, t);
19265 PyObject_GC_Track(o);
19267 o = (*t->tp_alloc)(t, 0);
19268 if (unlikely(!o))
return 0;
19273 static void __pyx_tp_dealloc_8PyClical___pyx_scope_struct____iter__(PyObject *o) {
19274 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *p = (
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)o;
19275 PyObject_GC_UnTrack(o);
19276 Py_CLEAR(p->__pyx_v_idx);
19277 Py_CLEAR(p->__pyx_v_self);
19278 Py_CLEAR(p->__pyx_t_0);
19279 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__)))) {
19280 __pyx_freelist_8PyClical___pyx_scope_struct____iter__[__pyx_freecount_8PyClical___pyx_scope_struct____iter__++] = ((
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)o);
19282 (*Py_TYPE(o)->tp_free)(o);
19286 static int __pyx_tp_traverse_8PyClical___pyx_scope_struct____iter__(PyObject *o, visitproc v,
void *a) {
19288 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *p = (
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)o;
19289 if (p->__pyx_v_idx) {
19290 e = (*v)(p->__pyx_v_idx, a);
if (
e)
return e;
19292 if (p->__pyx_v_self) {
19293 e = (*v)(((PyObject *)p->__pyx_v_self), a);
if (
e)
return e;
19295 if (p->__pyx_t_0) {
19296 e = (*v)(p->__pyx_t_0, a);
if (
e)
return e;
19301 static PyTypeObject __pyx_type_8PyClical___pyx_scope_struct____iter__ = {
19302 PyVarObject_HEAD_INIT(0, 0)
19303 "PyClical.__pyx_scope_struct____iter__",
19304 sizeof(
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__),
19306 __pyx_tp_dealloc_8PyClical___pyx_scope_struct____iter__,
19310 #if PY_MAJOR_VERSION < 3
19313 #if PY_MAJOR_VERSION >= 3
19326 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
19328 __pyx_tp_traverse_8PyClical___pyx_scope_struct____iter__,
19344 __pyx_tp_new_8PyClical___pyx_scope_struct____iter__,
19354 #if PY_VERSION_HEX >= 0x030400a1 19359 static PyMethodDef __pyx_methods[] = {
19360 {
"compare", (PyCFunction)__pyx_pw_8PyClical_3compare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_2compare},
19361 {
"min_neg", (PyCFunction)__pyx_pw_8PyClical_5min_neg, METH_O, __pyx_doc_8PyClical_4min_neg},
19362 {
"max_pos", (PyCFunction)__pyx_pw_8PyClical_7max_pos, METH_O, __pyx_doc_8PyClical_6max_pos},
19363 {
"inv", (PyCFunction)__pyx_pw_8PyClical_11inv, METH_O, __pyx_doc_8PyClical_10inv},
19364 {
"scalar", (PyCFunction)__pyx_pw_8PyClical_13scalar, METH_O, __pyx_doc_8PyClical_12scalar},
19365 {
"real", (PyCFunction)__pyx_pw_8PyClical_15real, METH_O, __pyx_doc_8PyClical_14real},
19366 {
"imag", (PyCFunction)__pyx_pw_8PyClical_17imag, METH_O, __pyx_doc_8PyClical_16imag},
19367 {
"pure", (PyCFunction)__pyx_pw_8PyClical_19pure, METH_O, __pyx_doc_8PyClical_18pure},
19368 {
"even", (PyCFunction)__pyx_pw_8PyClical_21even, METH_O, __pyx_doc_8PyClical_20even},
19369 {
"odd", (PyCFunction)__pyx_pw_8PyClical_23odd, METH_O, __pyx_doc_8PyClical_22odd},
19370 {
"involute", (PyCFunction)__pyx_pw_8PyClical_25involute, METH_O, __pyx_doc_8PyClical_24involute},
19371 {
"reverse", (PyCFunction)__pyx_pw_8PyClical_27reverse, METH_O, __pyx_doc_8PyClical_26reverse},
19372 {
"conj", (PyCFunction)__pyx_pw_8PyClical_29conj, METH_O, __pyx_doc_8PyClical_28conj},
19373 {
"quad", (PyCFunction)__pyx_pw_8PyClical_31quad, METH_O, __pyx_doc_8PyClical_30quad},
19374 {
"norm", (PyCFunction)__pyx_pw_8PyClical_33norm, METH_O, __pyx_doc_8PyClical_32norm},
19375 {
"abs", (PyCFunction)__pyx_pw_8PyClical_35abs, METH_O, __pyx_doc_8PyClical_34abs},
19376 {
"max_abs", (PyCFunction)__pyx_pw_8PyClical_37max_abs, METH_O, __pyx_doc_8PyClical_36max_abs},
19377 {
"pow", (PyCFunction)__pyx_pw_8PyClical_39pow, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_38pow},
19378 {
"outer_pow", (PyCFunction)__pyx_pw_8PyClical_41outer_pow, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_40outer_pow},
19379 {
"complexifier", (PyCFunction)__pyx_pw_8PyClical_43complexifier, METH_O, __pyx_doc_8PyClical_42complexifier},
19380 {
"sqrt", (PyCFunction)__pyx_pw_8PyClical_45sqrt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_44sqrt},
19381 {
"exp", (PyCFunction)__pyx_pw_8PyClical_47exp, METH_O, __pyx_doc_8PyClical_46exp},
19382 {
"log", (PyCFunction)__pyx_pw_8PyClical_49log, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_48log},
19383 {
"cos", (PyCFunction)__pyx_pw_8PyClical_51cos, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_50cos},
19384 {
"acos", (PyCFunction)__pyx_pw_8PyClical_53acos, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_52acos},
19385 {
"cosh", (PyCFunction)__pyx_pw_8PyClical_55cosh, METH_O, __pyx_doc_8PyClical_54cosh},
19386 {
"acosh", (PyCFunction)__pyx_pw_8PyClical_57acosh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_56acosh},
19387 {
"sin", (PyCFunction)__pyx_pw_8PyClical_59sin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_58sin},
19388 {
"asin", (PyCFunction)__pyx_pw_8PyClical_61asin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_60asin},
19389 {
"sinh", (PyCFunction)__pyx_pw_8PyClical_63sinh, METH_O, __pyx_doc_8PyClical_62sinh},
19390 {
"asinh", (PyCFunction)__pyx_pw_8PyClical_65asinh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_64asinh},
19391 {
"tan", (PyCFunction)__pyx_pw_8PyClical_67tan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_66tan},
19392 {
"atan", (PyCFunction)__pyx_pw_8PyClical_69atan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_68atan},
19393 {
"tanh", (PyCFunction)__pyx_pw_8PyClical_71tanh, METH_O, __pyx_doc_8PyClical_70tanh},
19394 {
"atanh", (PyCFunction)__pyx_pw_8PyClical_73atanh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_72atanh},
19395 {
"random_clifford", (PyCFunction)__pyx_pw_8PyClical_75random_clifford, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_74random_clifford},
19396 {
"cga3", (PyCFunction)__pyx_pw_8PyClical_77cga3, METH_O, __pyx_doc_8PyClical_76cga3},
19397 {
"cga3std", (PyCFunction)__pyx_pw_8PyClical_79cga3std, METH_O, __pyx_doc_8PyClical_78cga3std},
19398 {
"agc3", (PyCFunction)__pyx_pw_8PyClical_81agc3, METH_O, __pyx_doc_8PyClical_80agc3},
19402 #if PY_MAJOR_VERSION >= 3 19403 #if CYTHON_PEP489_MULTI_PHASE_INIT 19404 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
19405 static int __pyx_pymod_exec_PyClical(PyObject* module);
19406 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
19407 {Py_mod_create, (
void*)__pyx_pymod_create},
19408 {Py_mod_exec, (
void*)__pyx_pymod_exec_PyClical},
19413 static struct PyModuleDef __pyx_moduledef = {
19414 PyModuleDef_HEAD_INIT,
19417 #if CYTHON_PEP489_MULTI_PHASE_INIT 19423 #if CYTHON_PEP489_MULTI_PHASE_INIT 19424 __pyx_moduledef_slots,
19434 static __Pyx_StringTabEntry __pyx_string_tab[] = {
19435 {&__pyx_kp_s_, __pyx_k_,
sizeof(__pyx_k_), 0, 0, 1, 0},
19436 {&__pyx_kp_s_0_8_2, __pyx_k_0_8_2,
sizeof(__pyx_k_0_8_2), 0, 0, 1, 0},
19437 {&__pyx_kp_u_Abbreviation_for_clifford_index, __pyx_k_Abbreviation_for_clifford_index,
sizeof(__pyx_k_Abbreviation_for_clifford_index), 0, 1, 0, 0},
19438 {&__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},
19439 {&__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},
19440 {&__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},
19441 {&__pyx_kp_s_Cannot_initialize_clifford_objec, __pyx_k_Cannot_initialize_clifford_objec,
sizeof(__pyx_k_Cannot_initialize_clifford_objec), 0, 0, 1, 0},
19442 {&__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},
19443 {&__pyx_kp_s_Cannot_reframe, __pyx_k_Cannot_reframe,
sizeof(__pyx_k_Cannot_reframe), 0, 0, 1, 0},
19444 {&__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},
19445 {&__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},
19446 {&__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},
19447 {&__pyx_kp_u_Conjugation_reverse_o_involute, __pyx_k_Conjugation_reverse_o_involute,
sizeof(__pyx_k_Conjugation_reverse_o_involute), 0, 1, 0, 0},
19448 {&__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},
19449 {&__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},
19450 {&__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},
19451 {&__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},
19452 {&__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},
19453 {&__pyx_kp_u_Convert_Euclidean_3D_multivecto, __pyx_k_Convert_Euclidean_3D_multivecto,
sizeof(__pyx_k_Convert_Euclidean_3D_multivecto), 0, 1, 0, 0},
19454 {&__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},
19455 {&__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},
19456 {&__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},
19457 {&__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},
19458 {&__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},
19459 {&__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},
19460 {&__pyx_kp_u_Geometric_difference_print_clif, __pyx_k_Geometric_difference_print_clif,
sizeof(__pyx_k_Geometric_difference_print_clif), 0, 1, 0, 0},
19461 {&__pyx_kp_u_Geometric_difference_x_clifford, __pyx_k_Geometric_difference_x_clifford,
sizeof(__pyx_k_Geometric_difference_x_clifford), 0, 1, 0, 0},
19462 {&__pyx_kp_u_Geometric_multiplicative_invers, __pyx_k_Geometric_multiplicative_invers,
sizeof(__pyx_k_Geometric_multiplicative_invers), 0, 1, 0, 0},
19463 {&__pyx_kp_u_Geometric_multiplicative_invers_2, __pyx_k_Geometric_multiplicative_invers_2,
sizeof(__pyx_k_Geometric_multiplicative_invers_2), 0, 1, 0, 0},
19464 {&__pyx_kp_u_Geometric_product_print_cliffor, __pyx_k_Geometric_product_print_cliffor,
sizeof(__pyx_k_Geometric_product_print_cliffor), 0, 1, 0, 0},
19465 {&__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},
19466 {&__pyx_kp_u_Geometric_quotient_print_cliffo, __pyx_k_Geometric_quotient_print_cliffo,
sizeof(__pyx_k_Geometric_quotient_print_cliffo), 0, 1, 0, 0},
19467 {&__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},
19468 {&__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},
19469 {&__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},
19470 {&__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},
19471 {&__pyx_kp_u_Hyperbolic_cosine_of_multivecto, __pyx_k_Hyperbolic_cosine_of_multivecto,
sizeof(__pyx_k_Hyperbolic_cosine_of_multivecto), 0, 1, 0, 0},
19472 {&__pyx_kp_u_Hyperbolic_sine_of_multivector, __pyx_k_Hyperbolic_sine_of_multivector,
sizeof(__pyx_k_Hyperbolic_sine_of_multivector), 0, 1, 0, 0},
19473 {&__pyx_kp_u_Hyperbolic_tangent_of_multivect, __pyx_k_Hyperbolic_tangent_of_multivect,
sizeof(__pyx_k_Hyperbolic_tangent_of_multivect), 0, 1, 0, 0},
19474 {&__pyx_kp_u_Imaginary_part_deprecated_alway, __pyx_k_Imaginary_part_deprecated_alway,
sizeof(__pyx_k_Imaginary_part_deprecated_alway), 0, 1, 0, 0},
19475 {&__pyx_n_s_IndexError, __pyx_k_IndexError,
sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
19476 {&__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},
19477 {&__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},
19478 {&__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},
19479 {&__pyx_n_s_Integral, __pyx_k_Integral,
sizeof(__pyx_k_Integral), 0, 0, 1, 1},
19480 {&__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},
19481 {&__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},
19482 {&__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},
19483 {&__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},
19484 {&__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},
19485 {&__pyx_kp_u_Inverse_tangent_of_multivector, __pyx_k_Inverse_tangent_of_multivector,
sizeof(__pyx_k_Inverse_tangent_of_multivector), 0, 1, 0, 0},
19486 {&__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},
19487 {&__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},
19488 {&__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},
19489 {&__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},
19490 {&__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},
19491 {&__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},
19492 {&__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},
19493 {&__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},
19494 {&__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},
19495 {&__pyx_kp_u_Natural_logarithm_of_multivecto, __pyx_k_Natural_logarithm_of_multivecto,
sizeof(__pyx_k_Natural_logarithm_of_multivecto), 0, 1, 0, 0},
19496 {&__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},
19497 {&__pyx_n_s_NotImplemented, __pyx_k_NotImplemented,
sizeof(__pyx_k_NotImplemented), 0, 0, 1, 1},
19498 {&__pyx_kp_s_Not_applicable, __pyx_k_Not_applicable,
sizeof(__pyx_k_Not_applicable), 0, 0, 1, 0},
19499 {&__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},
19500 {&__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},
19501 {&__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},
19502 {&__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},
19503 {&__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},
19504 {&__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},
19505 {&__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},
19506 {&__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},
19507 {&__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},
19508 {&__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},
19509 {&__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},
19510 {&__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},
19511 {&__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},
19512 {&__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},
19513 {&__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},
19514 {&__pyx_n_s_PyClical, __pyx_k_PyClical,
sizeof(__pyx_k_PyClical), 0, 0, 1, 1},
19515 {&__pyx_kp_s_PyClical_pyx, __pyx_k_PyClical_pyx,
sizeof(__pyx_k_PyClical_pyx), 0, 0, 1, 0},
19516 {&__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},
19517 {&__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},
19518 {&__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},
19519 {&__pyx_n_s_Real, __pyx_k_Real,
sizeof(__pyx_k_Real), 0, 0, 1, 1},
19520 {&__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},
19521 {&__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},
19522 {&__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},
19523 {&__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},
19524 {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError,
sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
19525 {&__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},
19526 {&__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},
19527 {&__pyx_n_s_Sequence, __pyx_k_Sequence,
sizeof(__pyx_k_Sequence), 0, 0, 1, 1},
19528 {&__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},
19529 {&__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},
19530 {&__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},
19531 {&__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},
19532 {&__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},
19533 {&__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},
19534 {&__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},
19535 {&__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},
19536 {&__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},
19537 {&__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},
19538 {&__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},
19539 {&__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},
19540 {&__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},
19541 {&__pyx_kp_u_Symmetric_set_difference_exclus, __pyx_k_Symmetric_set_difference_exclus,
sizeof(__pyx_k_Symmetric_set_difference_exclus), 0, 1, 0, 0},
19542 {&__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},
19543 {&__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},
19544 {&__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},
19545 {&__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},
19546 {&__pyx_kp_u_The_informal_string_representat, __pyx_k_The_informal_string_representat,
sizeof(__pyx_k_The_informal_string_representat), 0, 1, 0, 0},
19547 {&__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},
19548 {&__pyx_kp_u_The_official_string_representat, __pyx_k_The_official_string_representat,
sizeof(__pyx_k_The_official_string_representat), 0, 1, 0, 0},
19549 {&__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},
19550 {&__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},
19551 {&__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},
19552 {&__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},
19553 {&__pyx_n_s_TypeError, __pyx_k_TypeError,
sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
19554 {&__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},
19555 {&__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},
19556 {&__pyx_n_s_ValueError, __pyx_k_ValueError,
sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
19557 {&__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},
19558 {&__pyx_kp_s__2, __pyx_k__2,
sizeof(__pyx_k__2), 0, 0, 1, 0},
19559 {&__pyx_kp_s__5, __pyx_k__5,
sizeof(__pyx_k__5), 0, 0, 1, 0},
19560 {&__pyx_kp_s__6, __pyx_k__6,
sizeof(__pyx_k__6), 0, 0, 1, 0},
19561 {&__pyx_kp_s__7, __pyx_k__7,
sizeof(__pyx_k__7), 0, 0, 1, 0},
19562 {&__pyx_kp_s__8, __pyx_k__8,
sizeof(__pyx_k__8), 0, 0, 1, 0},
19563 {&__pyx_kp_s__9, __pyx_k__9,
sizeof(__pyx_k__9), 0, 0, 1, 0},
19564 {&__pyx_kp_u_abs_line_1473, __pyx_k_abs_line_1473,
sizeof(__pyx_k_abs_line_1473), 0, 1, 0, 0},
19565 {&__pyx_n_s_acos, __pyx_k_acos,
sizeof(__pyx_k_acos), 0, 0, 1, 1},
19566 {&__pyx_kp_u_acos_line_1619, __pyx_k_acos_line_1619,
sizeof(__pyx_k_acos_line_1619), 0, 1, 0, 0},
19567 {&__pyx_n_s_acosh, __pyx_k_acosh,
sizeof(__pyx_k_acosh), 0, 0, 1, 1},
19568 {&__pyx_kp_u_acosh_line_1656, __pyx_k_acosh_line_1656,
sizeof(__pyx_k_acosh_line_1656), 0, 1, 0, 0},
19569 {&__pyx_kp_u_agc3_line_1844, __pyx_k_agc3_line_1844,
sizeof(__pyx_k_agc3_line_1844), 0, 1, 0, 0},
19570 {&__pyx_n_s_args, __pyx_k_args,
sizeof(__pyx_k_args), 0, 0, 1, 1},
19571 {&__pyx_kp_s_as_frame, __pyx_k_as_frame,
sizeof(__pyx_k_as_frame), 0, 0, 1, 0},
19572 {&__pyx_n_s_asin, __pyx_k_asin,
sizeof(__pyx_k_asin), 0, 0, 1, 1},
19573 {&__pyx_kp_u_asin_line_1698, __pyx_k_asin_line_1698,
sizeof(__pyx_k_asin_line_1698), 0, 1, 0, 0},
19574 {&__pyx_n_s_asinh, __pyx_k_asinh,
sizeof(__pyx_k_asinh), 0, 0, 1, 1},
19575 {&__pyx_kp_u_asinh_line_1733, __pyx_k_asinh_line_1733,
sizeof(__pyx_k_asinh_line_1733), 0, 1, 0, 0},
19576 {&__pyx_n_s_atan, __pyx_k_atan,
sizeof(__pyx_k_atan), 0, 0, 1, 1},
19577 {&__pyx_kp_u_atan_line_1769, __pyx_k_atan_line_1769,
sizeof(__pyx_k_atan_line_1769), 0, 1, 0, 0},
19578 {&__pyx_n_s_atanh, __pyx_k_atanh,
sizeof(__pyx_k_atanh), 0, 0, 1, 1},
19579 {&__pyx_kp_u_atanh_line_1798, __pyx_k_atanh_line_1798,
sizeof(__pyx_k_atanh_line_1798), 0, 1, 0, 0},
19580 {&__pyx_kp_u_cga3_line_1824, __pyx_k_cga3_line_1824,
sizeof(__pyx_k_cga3_line_1824), 0, 1, 0, 0},
19581 {&__pyx_kp_u_cga3std_line_1833, __pyx_k_cga3std_line_1833,
sizeof(__pyx_k_cga3std_line_1833), 0, 1, 0, 0},
19582 {&__pyx_n_s_cl, __pyx_k_cl,
sizeof(__pyx_k_cl), 0, 0, 1, 1},
19583 {&__pyx_kp_u_clifford___add___line_739, __pyx_k_clifford___add___line_739,
sizeof(__pyx_k_clifford___add___line_739), 0, 1, 0, 0},
19584 {&__pyx_kp_u_clifford___and___line_835, __pyx_k_clifford___and___line_835,
sizeof(__pyx_k_clifford___and___line_835), 0, 1, 0, 0},
19585 {&__pyx_kp_u_clifford___call___line_1019, __pyx_k_clifford___call___line_1019,
sizeof(__pyx_k_clifford___call___line_1019), 0, 1, 0, 0},
19586 {&__pyx_kp_u_clifford___div___line_895, __pyx_k_clifford___div___line_895,
sizeof(__pyx_k_clifford___div___line_895), 0, 1, 0, 0},
19587 {&__pyx_kp_u_clifford___getitem___line_706, __pyx_k_clifford___getitem___line_706,
sizeof(__pyx_k_clifford___getitem___line_706), 0, 1, 0, 0},
19588 {&__pyx_kp_u_clifford___iadd___line_750, __pyx_k_clifford___iadd___line_750,
sizeof(__pyx_k_clifford___iadd___line_750), 0, 1, 0, 0},
19589 {&__pyx_kp_u_clifford___iand___line_850, __pyx_k_clifford___iand___line_850,
sizeof(__pyx_k_clifford___iand___line_850), 0, 1, 0, 0},
19590 {&__pyx_kp_u_clifford___idiv___line_910, __pyx_k_clifford___idiv___line_910,
sizeof(__pyx_k_clifford___idiv___line_910), 0, 1, 0, 0},
19591 {&__pyx_kp_u_clifford___imod___line_820, __pyx_k_clifford___imod___line_820,
sizeof(__pyx_k_clifford___imod___line_820), 0, 1, 0, 0},
19592 {&__pyx_kp_u_clifford___imul___line_792, __pyx_k_clifford___imul___line_792,
sizeof(__pyx_k_clifford___imul___line_792), 0, 1, 0, 0},
19593 {&__pyx_kp_u_clifford___ior___line_949, __pyx_k_clifford___ior___line_949,
sizeof(__pyx_k_clifford___ior___line_949), 0, 1, 0, 0},
19594 {&__pyx_kp_u_clifford___isub___line_770, __pyx_k_clifford___isub___line_770,
sizeof(__pyx_k_clifford___isub___line_770), 0, 1, 0, 0},
19595 {&__pyx_kp_u_clifford___iter___line_637, __pyx_k_clifford___iter___line_637,
sizeof(__pyx_k_clifford___iter___line_637), 0, 1, 0, 0},
19596 {&__pyx_kp_u_clifford___ixor___line_880, __pyx_k_clifford___ixor___line_880,
sizeof(__pyx_k_clifford___ixor___line_880), 0, 1, 0, 0},
19597 {&__pyx_kp_u_clifford___mod___line_805, __pyx_k_clifford___mod___line_805,
sizeof(__pyx_k_clifford___mod___line_805), 0, 1, 0, 0},
19598 {&__pyx_kp_u_clifford___mul___line_779, __pyx_k_clifford___mul___line_779,
sizeof(__pyx_k_clifford___mul___line_779), 0, 1, 0, 0},
19599 {&__pyx_kp_u_clifford___neg___line_721, __pyx_k_clifford___neg___line_721,
sizeof(__pyx_k_clifford___neg___line_721), 0, 1, 0, 0},
19600 {&__pyx_kp_u_clifford___or___line_938, __pyx_k_clifford___or___line_938,
sizeof(__pyx_k_clifford___or___line_938), 0, 1, 0, 0},
19601 {&__pyx_kp_u_clifford___pos___line_730, __pyx_k_clifford___pos___line_730,
sizeof(__pyx_k_clifford___pos___line_730), 0, 1, 0, 0},
19602 {&__pyx_kp_u_clifford___pow___line_960, __pyx_k_clifford___pow___line_960,
sizeof(__pyx_k_clifford___pow___line_960), 0, 1, 0, 0},
19603 {&__pyx_kp_u_clifford___repr___line_1225, __pyx_k_clifford___repr___line_1225,
sizeof(__pyx_k_clifford___repr___line_1225), 0, 1, 0, 0},
19604 {&__pyx_kp_u_clifford___str___line_1234, __pyx_k_clifford___str___line_1234,
sizeof(__pyx_k_clifford___str___line_1234), 0, 1, 0, 0},
19605 {&__pyx_kp_u_clifford___sub___line_759, __pyx_k_clifford___sub___line_759,
sizeof(__pyx_k_clifford___sub___line_759), 0, 1, 0, 0},
19606 {&__pyx_kp_u_clifford___xor___line_865, __pyx_k_clifford___xor___line_865,
sizeof(__pyx_k_clifford___xor___line_865), 0, 1, 0, 0},
19607 {&__pyx_kp_u_clifford_abs_line_1174, __pyx_k_clifford_abs_line_1174,
sizeof(__pyx_k_clifford_abs_line_1174), 0, 1, 0, 0},
19608 {&__pyx_kp_u_clifford_conj_line_1137, __pyx_k_clifford_conj_line_1137,
sizeof(__pyx_k_clifford_conj_line_1137), 0, 1, 0, 0},
19609 {&__pyx_kp_u_clifford_copy_line_554, __pyx_k_clifford_copy_line_554,
sizeof(__pyx_k_clifford_copy_line_554), 0, 1, 0, 0},
19610 {&__pyx_kp_u_clifford_even_line_1060, __pyx_k_clifford_even_line_1060,
sizeof(__pyx_k_clifford_even_line_1060), 0, 1, 0, 0},
19611 {&__pyx_kp_u_clifford_frame_line_1214, __pyx_k_clifford_frame_line_1214,
sizeof(__pyx_k_clifford_frame_line_1214), 0, 1, 0, 0},
19612 {&__pyx_n_s_clifford_hidden_doctests, __pyx_k_clifford_hidden_doctests,
sizeof(__pyx_k_clifford_hidden_doctests), 0, 0, 1, 1},
19613 {&__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},
19614 {&__pyx_kp_u_clifford_inv_line_925, __pyx_k_clifford_inv_line_925,
sizeof(__pyx_k_clifford_inv_line_925), 0, 1, 0, 0},
19615 {&__pyx_kp_u_clifford_involute_line_1106, __pyx_k_clifford_involute_line_1106,
sizeof(__pyx_k_clifford_involute_line_1106), 0, 1, 0, 0},
19616 {&__pyx_kp_u_clifford_isnan_line_1205, __pyx_k_clifford_isnan_line_1205,
sizeof(__pyx_k_clifford_isnan_line_1205), 0, 1, 0, 0},
19617 {&__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},
19618 {&__pyx_kp_u_clifford_norm_line_1163, __pyx_k_clifford_norm_line_1163,
sizeof(__pyx_k_clifford_norm_line_1163), 0, 1, 0, 0},
19619 {&__pyx_kp_u_clifford_odd_line_1069, __pyx_k_clifford_odd_line_1069,
sizeof(__pyx_k_clifford_odd_line_1069), 0, 1, 0, 0},
19620 {&__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},
19621 {&__pyx_kp_u_clifford_pow_line_979, __pyx_k_clifford_pow_line_979,
sizeof(__pyx_k_clifford_pow_line_979), 0, 1, 0, 0},
19622 {&__pyx_kp_u_clifford_pure_line_1049, __pyx_k_clifford_pure_line_1049,
sizeof(__pyx_k_clifford_pure_line_1049), 0, 1, 0, 0},
19623 {&__pyx_kp_u_clifford_quad_line_1152, __pyx_k_clifford_quad_line_1152,
sizeof(__pyx_k_clifford_quad_line_1152), 0, 1, 0, 0},
19624 {&__pyx_kp_u_clifford_reframe_line_648, __pyx_k_clifford_reframe_line_648,
sizeof(__pyx_k_clifford_reframe_line_648), 0, 1, 0, 0},
19625 {&__pyx_kp_u_clifford_reverse_line_1122, __pyx_k_clifford_reverse_line_1122,
sizeof(__pyx_k_clifford_reverse_line_1122), 0, 1, 0, 0},
19626 {&__pyx_kp_u_clifford_scalar_line_1038, __pyx_k_clifford_scalar_line_1038,
sizeof(__pyx_k_clifford_scalar_line_1038), 0, 1, 0, 0},
19627 {&__pyx_kp_u_clifford_truncated_line_1194, __pyx_k_clifford_truncated_line_1194,
sizeof(__pyx_k_clifford_truncated_line_1194), 0, 1, 0, 0},
19628 {&__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},
19629 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback,
sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
19630 {&__pyx_n_s_close, __pyx_k_close,
sizeof(__pyx_k_close), 0, 0, 1, 1},
19631 {&__pyx_n_s_collections, __pyx_k_collections,
sizeof(__pyx_k_collections), 0, 0, 1, 1},
19632 {&__pyx_kp_u_compare_line_490, __pyx_k_compare_line_490,
sizeof(__pyx_k_compare_line_490), 0, 1, 0, 0},
19633 {&__pyx_kp_u_complexifier_line_1527, __pyx_k_complexifier_line_1527,
sizeof(__pyx_k_complexifier_line_1527), 0, 1, 0, 0},
19634 {&__pyx_n_s_conj, __pyx_k_conj,
sizeof(__pyx_k_conj), 0, 0, 1, 1},
19635 {&__pyx_kp_u_conj_line_1436, __pyx_k_conj_line_1436,
sizeof(__pyx_k_conj_line_1436), 0, 1, 0, 0},
19636 {&__pyx_n_s_copy, __pyx_k_copy,
sizeof(__pyx_k_copy), 0, 0, 1, 1},
19637 {&__pyx_n_s_cos, __pyx_k_cos,
sizeof(__pyx_k_cos), 0, 0, 1, 1},
19638 {&__pyx_kp_u_cos_line_1602, __pyx_k_cos_line_1602,
sizeof(__pyx_k_cos_line_1602), 0, 1, 0, 0},
19639 {&__pyx_n_s_cosh, __pyx_k_cosh,
sizeof(__pyx_k_cosh), 0, 0, 1, 1},
19640 {&__pyx_kp_u_cosh_line_1640, __pyx_k_cosh_line_1640,
sizeof(__pyx_k_cosh_line_1640), 0, 1, 0, 0},
19641 {&__pyx_n_s_doctest, __pyx_k_doctest,
sizeof(__pyx_k_doctest), 0, 0, 1, 1},
19642 {&__pyx_n_s_e, __pyx_k_e,
sizeof(__pyx_k_e), 0, 0, 1, 1},
19643 {&__pyx_kp_u_e_line_1887, __pyx_k_e_line_1887,
sizeof(__pyx_k_e_line_1887), 0, 1, 0, 0},
19644 {&__pyx_n_s_even, __pyx_k_even,
sizeof(__pyx_k_even), 0, 0, 1, 1},
19645 {&__pyx_kp_u_even_line_1388, __pyx_k_even_line_1388,
sizeof(__pyx_k_even_line_1388), 0, 1, 0, 0},
19646 {&__pyx_n_s_exp, __pyx_k_exp,
sizeof(__pyx_k_exp), 0, 0, 1, 1},
19647 {&__pyx_kp_u_exp_line_1565, __pyx_k_exp_line_1565,
sizeof(__pyx_k_exp_line_1565), 0, 1, 0, 0},
19648 {&__pyx_n_s_fill, __pyx_k_fill,
sizeof(__pyx_k_fill), 0, 0, 1, 1},
19649 {&__pyx_n_s_frm, __pyx_k_frm,
sizeof(__pyx_k_frm), 0, 0, 1, 1},
19650 {&__pyx_kp_s_from, __pyx_k_from,
sizeof(__pyx_k_from), 0, 0, 1, 0},
19651 {&__pyx_n_s_getstate, __pyx_k_getstate,
sizeof(__pyx_k_getstate), 0, 0, 1, 1},
19652 {&__pyx_n_s_grade, __pyx_k_grade,
sizeof(__pyx_k_grade), 0, 0, 1, 1},
19653 {&__pyx_n_s_i, __pyx_k_i,
sizeof(__pyx_k_i), 0, 0, 1, 1},
19654 {&__pyx_kp_u_imag_line_1366, __pyx_k_imag_line_1366,
sizeof(__pyx_k_imag_line_1366), 0, 1, 0, 0},
19655 {&__pyx_n_s_import, __pyx_k_import,
sizeof(__pyx_k_import), 0, 0, 1, 1},
19656 {&__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},
19657 {&__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},
19658 {&__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},
19659 {&__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},
19660 {&__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},
19661 {&__pyx_n_s_index_set___iter, __pyx_k_index_set___iter,
sizeof(__pyx_k_index_set___iter), 0, 0, 1, 1},
19662 {&__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},
19663 {&__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},
19664 {&__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},
19665 {&__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},
19666 {&__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},
19667 {&__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},
19668 {&__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},
19669 {&__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},
19670 {&__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},
19671 {&__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},
19672 {&__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},
19673 {&__pyx_n_s_index_set_hidden_doctests, __pyx_k_index_set_hidden_doctests,
sizeof(__pyx_k_index_set_hidden_doctests), 0, 0, 1, 1},
19674 {&__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},
19675 {&__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},
19676 {&__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},
19677 {&__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},
19678 {&__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},
19679 {&__pyx_n_s_inv, __pyx_k_inv,
sizeof(__pyx_k_inv), 0, 0, 1, 1},
19680 {&__pyx_kp_u_inv_line_1329, __pyx_k_inv_line_1329,
sizeof(__pyx_k_inv_line_1329), 0, 1, 0, 0},
19681 {&__pyx_kp_s_invalid, __pyx_k_invalid,
sizeof(__pyx_k_invalid), 0, 0, 1, 0},
19682 {&__pyx_kp_s_invalid_string, __pyx_k_invalid_string,
sizeof(__pyx_k_invalid_string), 0, 0, 1, 0},
19683 {&__pyx_n_s_involute, __pyx_k_involute,
sizeof(__pyx_k_involute), 0, 0, 1, 1},
19684 {&__pyx_kp_u_involute_line_1406, __pyx_k_involute_line_1406,
sizeof(__pyx_k_involute_line_1406), 0, 1, 0, 0},
19685 {&__pyx_n_s_ist, __pyx_k_ist,
sizeof(__pyx_k_ist), 0, 0, 1, 1},
19686 {&__pyx_n_s_istpq, __pyx_k_istpq,
sizeof(__pyx_k_istpq), 0, 0, 1, 1},
19687 {&__pyx_kp_u_istpq_line_1900, __pyx_k_istpq_line_1900,
sizeof(__pyx_k_istpq_line_1900), 0, 1, 0, 0},
19688 {&__pyx_n_s_iter, __pyx_k_iter,
sizeof(__pyx_k_iter), 0, 0, 1, 1},
19689 {&__pyx_n_s_ixt, __pyx_k_ixt,
sizeof(__pyx_k_ixt), 0, 0, 1, 1},
19690 {&__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},
19691 {&__pyx_n_s_lhs, __pyx_k_lhs,
sizeof(__pyx_k_lhs), 0, 0, 1, 1},
19692 {&__pyx_n_s_log, __pyx_k_log,
sizeof(__pyx_k_log), 0, 0, 1, 1},
19693 {&__pyx_kp_u_log_line_1579, __pyx_k_log_line_1579,
sizeof(__pyx_k_log_line_1579), 0, 1, 0, 0},
19694 {&__pyx_n_s_m, __pyx_k_m,
sizeof(__pyx_k_m), 0, 0, 1, 1},
19695 {&__pyx_n_s_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 0, 1, 1},
19696 {&__pyx_n_s_math, __pyx_k_math,
sizeof(__pyx_k_math), 0, 0, 1, 1},
19697 {&__pyx_n_s_max, __pyx_k_max,
sizeof(__pyx_k_max), 0, 0, 1, 1},
19698 {&__pyx_kp_u_max_abs_line_1482, __pyx_k_max_abs_line_1482,
sizeof(__pyx_k_max_abs_line_1482), 0, 1, 0, 0},
19699 {&__pyx_kp_u_max_pos_line_511, __pyx_k_max_pos_line_511,
sizeof(__pyx_k_max_pos_line_511), 0, 1, 0, 0},
19700 {&__pyx_n_s_min, __pyx_k_min,
sizeof(__pyx_k_min), 0, 0, 1, 1},
19701 {&__pyx_kp_u_min_neg_line_502, __pyx_k_min_neg_line_502,
sizeof(__pyx_k_min_neg_line_502), 0, 1, 0, 0},
19702 {&__pyx_n_s_name, __pyx_k_name,
sizeof(__pyx_k_name), 0, 0, 1, 1},
19703 {&__pyx_n_s_nbar3, __pyx_k_nbar3,
sizeof(__pyx_k_nbar3), 0, 0, 1, 1},
19704 {&__pyx_n_s_ninf3, __pyx_k_ninf3,
sizeof(__pyx_k_ninf3), 0, 0, 1, 1},
19705 {&__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},
19706 {&__pyx_n_s_norm, __pyx_k_norm,
sizeof(__pyx_k_norm), 0, 0, 1, 1},
19707 {&__pyx_kp_u_norm_line_1462, __pyx_k_norm_line_1462,
sizeof(__pyx_k_norm_line_1462), 0, 1, 0, 0},
19708 {&__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},
19709 {&__pyx_n_s_numbers, __pyx_k_numbers,
sizeof(__pyx_k_numbers), 0, 0, 1, 1},
19710 {&__pyx_n_s_obj, __pyx_k_obj,
sizeof(__pyx_k_obj), 0, 0, 1, 1},
19711 {&__pyx_n_s_odd, __pyx_k_odd,
sizeof(__pyx_k_odd), 0, 0, 1, 1},
19712 {&__pyx_kp_u_odd_line_1397, __pyx_k_odd_line_1397,
sizeof(__pyx_k_odd_line_1397), 0, 1, 0, 0},
19713 {&__pyx_n_s_other, __pyx_k_other,
sizeof(__pyx_k_other), 0, 0, 1, 1},
19714 {&__pyx_n_s_outer_pow, __pyx_k_outer_pow,
sizeof(__pyx_k_outer_pow), 0, 0, 1, 1},
19715 {&__pyx_kp_u_outer_pow_line_1518, __pyx_k_outer_pow_line_1518,
sizeof(__pyx_k_outer_pow_line_1518), 0, 1, 0, 0},
19716 {&__pyx_n_s_p, __pyx_k_p,
sizeof(__pyx_k_p), 0, 0, 1, 1},
19717 {&__pyx_n_s_pi, __pyx_k_pi,
sizeof(__pyx_k_pi), 0, 0, 1, 1},
19718 {&__pyx_n_s_pow, __pyx_k_pow,
sizeof(__pyx_k_pow), 0, 0, 1, 1},
19719 {&__pyx_kp_u_pow_line_1494, __pyx_k_pow_line_1494,
sizeof(__pyx_k_pow_line_1494), 0, 1, 0, 0},
19720 {&__pyx_n_s_pure, __pyx_k_pure,
sizeof(__pyx_k_pure), 0, 0, 1, 1},
19721 {&__pyx_kp_u_pure_line_1377, __pyx_k_pure_line_1377,
sizeof(__pyx_k_pure_line_1377), 0, 1, 0, 0},
19722 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable,
sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
19723 {&__pyx_n_s_q, __pyx_k_q,
sizeof(__pyx_k_q), 0, 0, 1, 1},
19724 {&__pyx_n_s_quad, __pyx_k_quad,
sizeof(__pyx_k_quad), 0, 0, 1, 1},
19725 {&__pyx_kp_u_quad_line_1451, __pyx_k_quad_line_1451,
sizeof(__pyx_k_quad_line_1451), 0, 1, 0, 0},
19726 {&__pyx_kp_u_random_clifford_line_1815, __pyx_k_random_clifford_line_1815,
sizeof(__pyx_k_random_clifford_line_1815), 0, 1, 0, 0},
19727 {&__pyx_n_s_range, __pyx_k_range,
sizeof(__pyx_k_range), 0, 0, 1, 1},
19728 {&__pyx_kp_u_real_line_1355, __pyx_k_real_line_1355,
sizeof(__pyx_k_real_line_1355), 0, 1, 0, 0},
19729 {&__pyx_n_s_reduce, __pyx_k_reduce,
sizeof(__pyx_k_reduce), 0, 0, 1, 1},
19730 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython,
sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
19731 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex,
sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
19732 {&__pyx_n_s_reverse, __pyx_k_reverse,
sizeof(__pyx_k_reverse), 0, 0, 1, 1},
19733 {&__pyx_kp_u_reverse_line_1421, __pyx_k_reverse_line_1421,
sizeof(__pyx_k_reverse_line_1421), 0, 1, 0, 0},
19734 {&__pyx_n_s_rhs, __pyx_k_rhs,
sizeof(__pyx_k_rhs), 0, 0, 1, 1},
19735 {&__pyx_n_s_scalar, __pyx_k_scalar,
sizeof(__pyx_k_scalar), 0, 0, 1, 1},
19736 {&__pyx_kp_u_scalar_line_1344, __pyx_k_scalar_line_1344,
sizeof(__pyx_k_scalar_line_1344), 0, 1, 0, 0},
19737 {&__pyx_n_s_send, __pyx_k_send,
sizeof(__pyx_k_send), 0, 0, 1, 1},
19738 {&__pyx_n_s_setstate, __pyx_k_setstate,
sizeof(__pyx_k_setstate), 0, 0, 1, 1},
19739 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython,
sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
19740 {&__pyx_n_s_sin, __pyx_k_sin,
sizeof(__pyx_k_sin), 0, 0, 1, 1},
19741 {&__pyx_kp_u_sin_line_1679, __pyx_k_sin_line_1679,
sizeof(__pyx_k_sin_line_1679), 0, 1, 0, 0},
19742 {&__pyx_n_s_sinh, __pyx_k_sinh,
sizeof(__pyx_k_sinh), 0, 0, 1, 1},
19743 {&__pyx_kp_u_sinh_line_1719, __pyx_k_sinh_line_1719,
sizeof(__pyx_k_sinh_line_1719), 0, 1, 0, 0},
19744 {&__pyx_n_s_sqrt, __pyx_k_sqrt,
sizeof(__pyx_k_sqrt), 0, 0, 1, 1},
19745 {&__pyx_kp_u_sqrt_line_1542, __pyx_k_sqrt_line_1542,
sizeof(__pyx_k_sqrt_line_1542), 0, 1, 0, 0},
19746 {&__pyx_n_s_tan, __pyx_k_tan,
sizeof(__pyx_k_tan), 0, 0, 1, 1},
19747 {&__pyx_kp_u_tan_line_1752, __pyx_k_tan_line_1752,
sizeof(__pyx_k_tan_line_1752), 0, 1, 0, 0},
19748 {&__pyx_n_s_tanh, __pyx_k_tanh,
sizeof(__pyx_k_tanh), 0, 0, 1, 1},
19749 {&__pyx_kp_u_tanh_line_1786, __pyx_k_tanh_line_1786,
sizeof(__pyx_k_tanh_line_1786), 0, 1, 0, 0},
19750 {&__pyx_n_s_tau, __pyx_k_tau,
sizeof(__pyx_k_tau), 0, 0, 1, 1},
19751 {&__pyx_n_s_test, __pyx_k_test,
sizeof(__pyx_k_test), 0, 0, 1, 1},
19752 {&__pyx_n_s_test_2, __pyx_k_test_2,
sizeof(__pyx_k_test_2), 0, 0, 1, 1},
19753 {&__pyx_n_s_testmod, __pyx_k_testmod,
sizeof(__pyx_k_testmod), 0, 0, 1, 1},
19754 {&__pyx_n_s_throw, __pyx_k_throw,
sizeof(__pyx_k_throw), 0, 0, 1, 1},
19755 {&__pyx_kp_s_to_frame, __pyx_k_to_frame,
sizeof(__pyx_k_to_frame), 0, 0, 1, 0},
19756 {&__pyx_kp_s_using, __pyx_k_using,
sizeof(__pyx_k_using), 0, 0, 1, 0},
19757 {&__pyx_kp_s_using_invalid, __pyx_k_using_invalid,
sizeof(__pyx_k_using_invalid), 0, 0, 1, 0},
19758 {&__pyx_kp_s_value, __pyx_k_value,
sizeof(__pyx_k_value), 0, 0, 1, 0},
19759 {&__pyx_n_s_version, __pyx_k_version,
sizeof(__pyx_k_version), 0, 0, 1, 1},
19760 {&__pyx_n_s_xrange, __pyx_k_xrange,
sizeof(__pyx_k_xrange), 0, 0, 1, 1},
19761 {0, 0, 0, 0, 0, 0, 0}
19763 static int __Pyx_InitCachedBuiltins(
void) {
19764 __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError);
if (!__pyx_builtin_IndexError) __PYX_ERR(0, 102, __pyx_L1_error)
19765 __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError);
if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 104, __pyx_L1_error)
19766 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError);
if (!__pyx_builtin_TypeError) __PYX_ERR(0, 104, __pyx_L1_error)
19767 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError);
if (!__pyx_builtin_ValueError) __PYX_ERR(0, 105, __pyx_L1_error)
19768 __pyx_builtin_NotImplemented = __Pyx_GetBuiltinName(__pyx_n_s_NotImplemented);
if (!__pyx_builtin_NotImplemented) __PYX_ERR(0, 157, __pyx_L1_error)
19769 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_range) __PYX_ERR(0, 234, __pyx_L1_error)
19770 #if PY_MAJOR_VERSION >= 3 19771 __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_xrange) __PYX_ERR(0, 1098, __pyx_L1_error)
19773 __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange);
if (!__pyx_builtin_xrange) __PYX_ERR(0, 1098, __pyx_L1_error)
19780 static int __Pyx_InitCachedConstants(
void) {
19781 __Pyx_RefNannyDeclarations
19782 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
19790 __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)
19791 __Pyx_GOTREF(__pyx_tuple__3);
19792 __Pyx_GIVEREF(__pyx_tuple__3);
19799 __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)
19800 __Pyx_GOTREF(__pyx_tuple__4);
19801 __Pyx_GIVEREF(__pyx_tuple__4);
19810 __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Not_applicable);
if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 635, __pyx_L1_error)
19811 __Pyx_GOTREF(__pyx_tuple__10);
19812 __Pyx_GIVEREF(__pyx_tuple__10);
19821 __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Not_applicable);
if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 646, __pyx_L1_error)
19822 __Pyx_GOTREF(__pyx_tuple__11);
19823 __Pyx_GIVEREF(__pyx_tuple__11);
19831 __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)
19832 __Pyx_GOTREF(__pyx_tuple__12);
19833 __Pyx_GIVEREF(__pyx_tuple__12);
19840 __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)
19841 __Pyx_GOTREF(__pyx_tuple__13);
19842 __Pyx_GIVEREF(__pyx_tuple__13);
19851 __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)
19860 __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)
19869 __pyx_tuple__16 = PyTuple_Pack(1, __pyx_float_1_0);
if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 1856, __pyx_L1_error)
19870 __Pyx_GOTREF(__pyx_tuple__16);
19871 __Pyx_GIVEREF(__pyx_tuple__16);
19880 __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_obj);
if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 1887, __pyx_L1_error)
19881 __Pyx_GOTREF(__pyx_tuple__17);
19882 __Pyx_GIVEREF(__pyx_tuple__17);
19883 __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)
19892 __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)
19893 __Pyx_GOTREF(__pyx_tuple__19);
19894 __Pyx_GIVEREF(__pyx_tuple__19);
19895 __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)
19904 __pyx_tuple__21 = PyTuple_Pack(1, __pyx_int_4);
if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 1909, __pyx_L1_error)
19905 __Pyx_GOTREF(__pyx_tuple__21);
19906 __Pyx_GIVEREF(__pyx_tuple__21);
19907 __pyx_tuple__22 = PyTuple_Pack(1, __pyx_int_neg_1);
if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 1909, __pyx_L1_error)
19908 __Pyx_GOTREF(__pyx_tuple__22);
19909 __Pyx_GIVEREF(__pyx_tuple__22);
19918 __pyx_tuple__23 = PyTuple_Pack(1, __pyx_int_4);
if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 1910, __pyx_L1_error)
19919 __Pyx_GOTREF(__pyx_tuple__23);
19920 __Pyx_GIVEREF(__pyx_tuple__23);
19921 __pyx_tuple__24 = PyTuple_Pack(1, __pyx_int_neg_1);
if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 1910, __pyx_L1_error)
19922 __Pyx_GOTREF(__pyx_tuple__24);
19923 __Pyx_GIVEREF(__pyx_tuple__24);
19932 __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)
19933 __Pyx_GOTREF(__pyx_tuple__25);
19934 __Pyx_GIVEREF(__pyx_tuple__25);
19935 __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)
19936 __Pyx_RefNannyFinishContext();
19939 __Pyx_RefNannyFinishContext();
19943 static int __Pyx_InitGlobals(
void) {
19944 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
19945 __pyx_float_0_0 =
PyFloat_FromDouble(0.0);
if (unlikely(!__pyx_float_0_0)) __PYX_ERR(0, 1, __pyx_L1_error)
19946 __pyx_float_1_0 =
PyFloat_FromDouble(1.0);
if (unlikely(!__pyx_float_1_0)) __PYX_ERR(0, 1, __pyx_L1_error)
19947 __pyx_float_2_0 =
PyFloat_FromDouble(2.0);
if (unlikely(!__pyx_float_2_0)) __PYX_ERR(0, 1, __pyx_L1_error)
19948 __pyx_float_8_0 =
PyFloat_FromDouble(8.0);
if (unlikely(!__pyx_float_8_0)) __PYX_ERR(0, 1, __pyx_L1_error)
19949 __pyx_int_0 = PyInt_FromLong(0);
if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
19950 __pyx_int_1 = PyInt_FromLong(1);
if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
19951 __pyx_int_4 = PyInt_FromLong(4);
if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error)
19952 __pyx_int_neg_1 = PyInt_FromLong(-1);
if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
19958 #if PY_MAJOR_VERSION < 3 19959 PyMODINIT_FUNC initPyClical(
void);
19960 PyMODINIT_FUNC initPyClical(
void)
19962 PyMODINIT_FUNC PyInit_PyClical(
void);
19963 PyMODINIT_FUNC PyInit_PyClical(
void)
19964 #if CYTHON_PEP489_MULTI_PHASE_INIT 19966 return PyModuleDef_Init(&__pyx_moduledef);
19968 static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict,
const char* from_name,
const char* to_name) {
19969 PyObject *value = PyObject_GetAttrString(spec, from_name);
19971 if (likely(value)) {
19972 result = PyDict_SetItemString(moddict, to_name, value);
19974 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
19981 static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
19982 PyObject *module = NULL, *moddict, *modname;
19984 return __Pyx_NewRef(__pyx_m);
19985 modname = PyObject_GetAttrString(spec,
"name");
19986 if (unlikely(!modname))
goto bad;
19987 module = PyModule_NewObject(modname);
19988 Py_DECREF(modname);
19989 if (unlikely(!module))
goto bad;
19990 moddict = PyModule_GetDict(module);
19991 if (unlikely(!moddict))
goto bad;
19992 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__") < 0))
goto bad;
19993 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__") < 0))
goto bad;
19994 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__") < 0))
goto bad;
19995 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__") < 0))
goto bad;
19998 Py_XDECREF(module);
20003 static int __pyx_pymod_exec_PyClical(PyObject *__pyx_pyinit_module)
20007 PyObject *__pyx_t_1 = NULL;
20008 PyObject *__pyx_t_2 = NULL;
20009 PyObject *__pyx_t_3 = NULL;
20011 __Pyx_RefNannyDeclarations
20012 #if CYTHON_PEP489_MULTI_PHASE_INIT 20013 if (__pyx_m && __pyx_m == __pyx_pyinit_module)
return 0;
20015 #if CYTHON_REFNANNY 20016 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
20017 if (!__Pyx_RefNanny) {
20019 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
20020 if (!__Pyx_RefNanny)
20021 Py_FatalError(
"failed to import 'refnanny' module");
20024 __Pyx_RefNannySetupContext(
"PyMODINIT_FUNC PyInit_PyClical(void)", 0);
20025 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20026 __pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
20027 __pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
20028 __pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
20029 #ifdef __Pyx_CyFunction_USED 20030 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20032 #ifdef __Pyx_FusedFunction_USED 20033 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20035 #ifdef __Pyx_Coroutine_USED 20036 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20038 #ifdef __Pyx_Generator_USED 20039 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20041 #ifdef __Pyx_AsyncGen_USED 20042 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20044 #ifdef __Pyx_StopAsyncIteration_USED 20045 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20049 #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS 20051 PyEval_InitThreads();
20055 #if CYTHON_PEP489_MULTI_PHASE_INIT 20056 __pyx_m = __pyx_pyinit_module;
20057 Py_INCREF(__pyx_m);
20059 #if PY_MAJOR_VERSION < 3 20060 __pyx_m = Py_InitModule4(
"PyClical", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
20062 __pyx_m = PyModule_Create(&__pyx_moduledef);
20064 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
20066 __pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
20067 Py_INCREF(__pyx_d);
20068 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
20069 __pyx_cython_runtime = PyImport_AddModule((
char *)
"cython_runtime");
if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
20070 #if CYTHON_COMPILING_IN_PYPY 20071 Py_INCREF(__pyx_b);
20073 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
20075 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20076 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) 20077 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20079 if (__pyx_module_is_main_PyClical) {
20080 if (PyObject_SetAttrString(__pyx_m,
"__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20082 #if PY_MAJOR_VERSION >= 3 20084 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
20085 if (!PyDict_GetItemString(modules,
"PyClical")) {
20086 if (unlikely(PyDict_SetItemString(modules,
"PyClical", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
20091 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20093 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20098 __pyx_vtabptr_8PyClical_index_set = &__pyx_vtable_8PyClical_index_set;
20099 __pyx_vtable_8PyClical_index_set.wrap = (PyObject *(*)(
struct __pyx_obj_8PyClical_index_set *,
IndexSet))__pyx_f_8PyClical_9index_set_wrap;
20100 __pyx_vtable_8PyClical_index_set.unwrap = (
IndexSet (*)(
struct __pyx_obj_8PyClical_index_set *))__pyx_f_8PyClical_9index_set_unwrap;
20101 __pyx_vtable_8PyClical_index_set.copy = (PyObject *(*)(
struct __pyx_obj_8PyClical_index_set *,
int __pyx_skip_dispatch))__pyx_f_8PyClical_9index_set_copy;
20102 if (PyType_Ready(&__pyx_type_8PyClical_index_set) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
20103 __pyx_type_8PyClical_index_set.tp_print = 0;
20104 #if CYTHON_COMPILING_IN_CPYTHON 20106 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__setitem__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
20107 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20108 __pyx_wrapperbase_8PyClical_9index_set_8__setitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20109 __pyx_wrapperbase_8PyClical_9index_set_8__setitem__.doc = __pyx_doc_8PyClical_9index_set_8__setitem__;
20110 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_8__setitem__;
20114 #if CYTHON_COMPILING_IN_CPYTHON 20116 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__getitem__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
20117 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20118 __pyx_wrapperbase_8PyClical_9index_set_10__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20119 __pyx_wrapperbase_8PyClical_9index_set_10__getitem__.doc = __pyx_doc_8PyClical_9index_set_10__getitem__;
20120 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_10__getitem__;
20124 #if CYTHON_COMPILING_IN_CPYTHON 20126 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__contains__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
20127 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20128 __pyx_wrapperbase_8PyClical_9index_set_12__contains__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20129 __pyx_wrapperbase_8PyClical_9index_set_12__contains__.doc = __pyx_doc_8PyClical_9index_set_12__contains__;
20130 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_12__contains__;
20134 #if CYTHON_COMPILING_IN_CPYTHON 20136 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__iter__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
20137 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20138 __pyx_wrapperbase_8PyClical_9index_set_14__iter__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20139 __pyx_wrapperbase_8PyClical_9index_set_14__iter__.doc = __pyx_doc_8PyClical_9index_set_14__iter__;
20140 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_14__iter__;
20144 #if CYTHON_COMPILING_IN_CPYTHON 20146 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__invert__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
20147 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20148 __pyx_wrapperbase_8PyClical_9index_set_17__invert__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20149 __pyx_wrapperbase_8PyClical_9index_set_17__invert__.doc = __pyx_doc_8PyClical_9index_set_17__invert__;
20150 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_17__invert__;
20154 #if CYTHON_COMPILING_IN_CPYTHON 20156 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__xor__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
20157 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20158 __pyx_wrapperbase_8PyClical_9index_set_19__xor__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20159 __pyx_wrapperbase_8PyClical_9index_set_19__xor__.doc = __pyx_doc_8PyClical_9index_set_19__xor__;
20160 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_19__xor__;
20164 #if CYTHON_COMPILING_IN_CPYTHON 20166 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__ixor__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
20167 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20168 __pyx_wrapperbase_8PyClical_9index_set_21__ixor__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20169 __pyx_wrapperbase_8PyClical_9index_set_21__ixor__.doc = __pyx_doc_8PyClical_9index_set_21__ixor__;
20170 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_21__ixor__;
20174 #if CYTHON_COMPILING_IN_CPYTHON 20176 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__and__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
20177 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20178 __pyx_wrapperbase_8PyClical_9index_set_23__and__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20179 __pyx_wrapperbase_8PyClical_9index_set_23__and__.doc = __pyx_doc_8PyClical_9index_set_23__and__;
20180 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_23__and__;
20184 #if CYTHON_COMPILING_IN_CPYTHON 20186 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__iand__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
20187 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20188 __pyx_wrapperbase_8PyClical_9index_set_25__iand__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20189 __pyx_wrapperbase_8PyClical_9index_set_25__iand__.doc = __pyx_doc_8PyClical_9index_set_25__iand__;
20190 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_25__iand__;
20194 #if CYTHON_COMPILING_IN_CPYTHON 20196 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__or__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
20197 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20198 __pyx_wrapperbase_8PyClical_9index_set_27__or__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20199 __pyx_wrapperbase_8PyClical_9index_set_27__or__.doc = __pyx_doc_8PyClical_9index_set_27__or__;
20200 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_27__or__;
20204 #if CYTHON_COMPILING_IN_CPYTHON 20206 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__ior__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
20207 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20208 __pyx_wrapperbase_8PyClical_9index_set_29__ior__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20209 __pyx_wrapperbase_8PyClical_9index_set_29__ior__.doc = __pyx_doc_8PyClical_9index_set_29__ior__;
20210 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_29__ior__;
20214 #if CYTHON_COMPILING_IN_CPYTHON 20216 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__repr__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
20217 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20218 __pyx_wrapperbase_8PyClical_9index_set_47__repr__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20219 __pyx_wrapperbase_8PyClical_9index_set_47__repr__.doc = __pyx_doc_8PyClical_9index_set_47__repr__;
20220 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_47__repr__;
20224 #if CYTHON_COMPILING_IN_CPYTHON 20226 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__str__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
20227 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20228 __pyx_wrapperbase_8PyClical_9index_set_49__str__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20229 __pyx_wrapperbase_8PyClical_9index_set_49__str__.doc = __pyx_doc_8PyClical_9index_set_49__str__;
20230 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_49__str__;
20234 if (__Pyx_SetVtable(__pyx_type_8PyClical_index_set.tp_dict, __pyx_vtabptr_8PyClical_index_set) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
20235 if (PyObject_SetAttrString(__pyx_m,
"index_set", (PyObject *)&__pyx_type_8PyClical_index_set) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
20236 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8PyClical_index_set) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
20237 __pyx_ptype_8PyClical_index_set = &__pyx_type_8PyClical_index_set;
20238 __pyx_vtabptr_8PyClical_clifford = &__pyx_vtable_8PyClical_clifford;
20239 __pyx_vtable_8PyClical_clifford.wrap = (PyObject *(*)(
struct __pyx_obj_8PyClical_clifford *,
Clifford))__pyx_f_8PyClical_8clifford_wrap;
20240 __pyx_vtable_8PyClical_clifford.unwrap = (
Clifford (*)(
struct __pyx_obj_8PyClical_clifford *))__pyx_f_8PyClical_8clifford_unwrap;
20241 __pyx_vtable_8PyClical_clifford.copy = (PyObject *(*)(
struct __pyx_obj_8PyClical_clifford *,
int __pyx_skip_dispatch))__pyx_f_8PyClical_8clifford_copy;
20242 if (PyType_Ready(&__pyx_type_8PyClical_clifford) < 0) __PYX_ERR(0, 535, __pyx_L1_error)
20243 __pyx_type_8PyClical_clifford.tp_print = 0;
20244 #if CYTHON_COMPILING_IN_CPYTHON 20246 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__contains__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20247 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20248 __pyx_wrapperbase_8PyClical_8clifford_6__contains__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20249 __pyx_wrapperbase_8PyClical_8clifford_6__contains__.doc = __pyx_doc_8PyClical_8clifford_6__contains__;
20250 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_6__contains__;
20254 #if CYTHON_COMPILING_IN_CPYTHON 20256 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__iter__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20257 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20258 __pyx_wrapperbase_8PyClical_8clifford_8__iter__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20259 __pyx_wrapperbase_8PyClical_8clifford_8__iter__.doc = __pyx_doc_8PyClical_8clifford_8__iter__;
20260 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_8__iter__;
20264 #if CYTHON_COMPILING_IN_CPYTHON 20266 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__getitem__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20267 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20268 __pyx_wrapperbase_8PyClical_8clifford_14__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20269 __pyx_wrapperbase_8PyClical_8clifford_14__getitem__.doc = __pyx_doc_8PyClical_8clifford_14__getitem__;
20270 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_14__getitem__;
20274 #if CYTHON_COMPILING_IN_CPYTHON 20276 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__neg__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20277 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20278 __pyx_wrapperbase_8PyClical_8clifford_16__neg__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20279 __pyx_wrapperbase_8PyClical_8clifford_16__neg__.doc = __pyx_doc_8PyClical_8clifford_16__neg__;
20280 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_16__neg__;
20284 #if CYTHON_COMPILING_IN_CPYTHON 20286 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__pos__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20287 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20288 __pyx_wrapperbase_8PyClical_8clifford_18__pos__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20289 __pyx_wrapperbase_8PyClical_8clifford_18__pos__.doc = __pyx_doc_8PyClical_8clifford_18__pos__;
20290 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_18__pos__;
20294 #if CYTHON_COMPILING_IN_CPYTHON 20296 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__add__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20297 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20298 __pyx_wrapperbase_8PyClical_8clifford_20__add__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20299 __pyx_wrapperbase_8PyClical_8clifford_20__add__.doc = __pyx_doc_8PyClical_8clifford_20__add__;
20300 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_20__add__;
20304 #if CYTHON_COMPILING_IN_CPYTHON 20306 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__iadd__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20307 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20308 __pyx_wrapperbase_8PyClical_8clifford_22__iadd__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20309 __pyx_wrapperbase_8PyClical_8clifford_22__iadd__.doc = __pyx_doc_8PyClical_8clifford_22__iadd__;
20310 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_22__iadd__;
20314 #if CYTHON_COMPILING_IN_CPYTHON 20316 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__sub__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20317 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20318 __pyx_wrapperbase_8PyClical_8clifford_24__sub__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20319 __pyx_wrapperbase_8PyClical_8clifford_24__sub__.doc = __pyx_doc_8PyClical_8clifford_24__sub__;
20320 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_24__sub__;
20324 #if CYTHON_COMPILING_IN_CPYTHON 20326 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__isub__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20327 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20328 __pyx_wrapperbase_8PyClical_8clifford_26__isub__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20329 __pyx_wrapperbase_8PyClical_8clifford_26__isub__.doc = __pyx_doc_8PyClical_8clifford_26__isub__;
20330 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_26__isub__;
20334 #if CYTHON_COMPILING_IN_CPYTHON 20336 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__mul__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20337 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20338 __pyx_wrapperbase_8PyClical_8clifford_28__mul__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20339 __pyx_wrapperbase_8PyClical_8clifford_28__mul__.doc = __pyx_doc_8PyClical_8clifford_28__mul__;
20340 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_28__mul__;
20344 #if CYTHON_COMPILING_IN_CPYTHON 20346 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__imul__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20347 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20348 __pyx_wrapperbase_8PyClical_8clifford_30__imul__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20349 __pyx_wrapperbase_8PyClical_8clifford_30__imul__.doc = __pyx_doc_8PyClical_8clifford_30__imul__;
20350 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_30__imul__;
20354 #if CYTHON_COMPILING_IN_CPYTHON 20356 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__mod__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20357 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20358 __pyx_wrapperbase_8PyClical_8clifford_32__mod__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20359 __pyx_wrapperbase_8PyClical_8clifford_32__mod__.doc = __pyx_doc_8PyClical_8clifford_32__mod__;
20360 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_32__mod__;
20364 #if CYTHON_COMPILING_IN_CPYTHON 20366 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__imod__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20367 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20368 __pyx_wrapperbase_8PyClical_8clifford_34__imod__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20369 __pyx_wrapperbase_8PyClical_8clifford_34__imod__.doc = __pyx_doc_8PyClical_8clifford_34__imod__;
20370 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_34__imod__;
20374 #if CYTHON_COMPILING_IN_CPYTHON 20376 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__and__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20377 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20378 __pyx_wrapperbase_8PyClical_8clifford_36__and__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20379 __pyx_wrapperbase_8PyClical_8clifford_36__and__.doc = __pyx_doc_8PyClical_8clifford_36__and__;
20380 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_36__and__;
20384 #if CYTHON_COMPILING_IN_CPYTHON 20386 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__iand__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20387 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20388 __pyx_wrapperbase_8PyClical_8clifford_38__iand__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20389 __pyx_wrapperbase_8PyClical_8clifford_38__iand__.doc = __pyx_doc_8PyClical_8clifford_38__iand__;
20390 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_38__iand__;
20394 #if CYTHON_COMPILING_IN_CPYTHON 20396 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__xor__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20397 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20398 __pyx_wrapperbase_8PyClical_8clifford_40__xor__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20399 __pyx_wrapperbase_8PyClical_8clifford_40__xor__.doc = __pyx_doc_8PyClical_8clifford_40__xor__;
20400 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_40__xor__;
20404 #if CYTHON_COMPILING_IN_CPYTHON 20406 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__ixor__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20407 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20408 __pyx_wrapperbase_8PyClical_8clifford_42__ixor__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20409 __pyx_wrapperbase_8PyClical_8clifford_42__ixor__.doc = __pyx_doc_8PyClical_8clifford_42__ixor__;
20410 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_42__ixor__;
20414 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 20415 #if CYTHON_COMPILING_IN_CPYTHON 20417 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__div__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20418 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20419 __pyx_wrapperbase_8PyClical_8clifford_44__div__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20420 __pyx_wrapperbase_8PyClical_8clifford_44__div__.doc = __pyx_doc_8PyClical_8clifford_44__div__;
20421 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_44__div__;
20426 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 20427 #if CYTHON_COMPILING_IN_CPYTHON 20429 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__idiv__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20430 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20431 __pyx_wrapperbase_8PyClical_8clifford_46__idiv__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20432 __pyx_wrapperbase_8PyClical_8clifford_46__idiv__.doc = __pyx_doc_8PyClical_8clifford_46__idiv__;
20433 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_46__idiv__;
20438 #if CYTHON_COMPILING_IN_CPYTHON 20440 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__or__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20441 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20442 __pyx_wrapperbase_8PyClical_8clifford_50__or__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20443 __pyx_wrapperbase_8PyClical_8clifford_50__or__.doc = __pyx_doc_8PyClical_8clifford_50__or__;
20444 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_50__or__;
20448 #if CYTHON_COMPILING_IN_CPYTHON 20450 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__ior__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20451 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20452 __pyx_wrapperbase_8PyClical_8clifford_52__ior__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20453 __pyx_wrapperbase_8PyClical_8clifford_52__ior__.doc = __pyx_doc_8PyClical_8clifford_52__ior__;
20454 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_52__ior__;
20458 #if CYTHON_COMPILING_IN_CPYTHON 20460 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__pow__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20461 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20462 __pyx_wrapperbase_8PyClical_8clifford_54__pow__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20463 __pyx_wrapperbase_8PyClical_8clifford_54__pow__.doc = __pyx_doc_8PyClical_8clifford_54__pow__;
20464 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_54__pow__;
20468 #if CYTHON_COMPILING_IN_CPYTHON 20470 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__call__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20471 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20472 __pyx_wrapperbase_8PyClical_8clifford_60__call__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20473 __pyx_wrapperbase_8PyClical_8clifford_60__call__.doc = __pyx_doc_8PyClical_8clifford_60__call__;
20474 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_60__call__;
20478 #if CYTHON_COMPILING_IN_CPYTHON 20480 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__repr__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20481 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20482 __pyx_wrapperbase_8PyClical_8clifford_92__repr__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20483 __pyx_wrapperbase_8PyClical_8clifford_92__repr__.doc = __pyx_doc_8PyClical_8clifford_92__repr__;
20484 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_92__repr__;
20488 #if CYTHON_COMPILING_IN_CPYTHON 20490 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__str__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20491 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20492 __pyx_wrapperbase_8PyClical_8clifford_94__str__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20493 __pyx_wrapperbase_8PyClical_8clifford_94__str__.doc = __pyx_doc_8PyClical_8clifford_94__str__;
20494 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_94__str__;
20498 if (__Pyx_SetVtable(__pyx_type_8PyClical_clifford.tp_dict, __pyx_vtabptr_8PyClical_clifford) < 0) __PYX_ERR(0, 535, __pyx_L1_error)
20499 if (PyObject_SetAttrString(__pyx_m,
"clifford", (PyObject *)&__pyx_type_8PyClical_clifford) < 0) __PYX_ERR(0, 535, __pyx_L1_error)
20500 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8PyClical_clifford) < 0) __PYX_ERR(0, 535, __pyx_L1_error)
20501 __pyx_ptype_8PyClical_clifford = &__pyx_type_8PyClical_clifford;
20502 if (PyType_Ready(&__pyx_type_8PyClical___pyx_scope_struct____iter__) < 0) __PYX_ERR(0, 227, __pyx_L1_error)
20503 __pyx_type_8PyClical___pyx_scope_struct____iter__.tp_print = 0;
20504 __pyx_ptype_8PyClical___pyx_scope_struct____iter__ = &__pyx_type_8PyClical___pyx_scope_struct____iter__;
20509 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) 20510 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20520 __pyx_t_1 = __Pyx_Import(__pyx_n_s_math, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
20521 __Pyx_GOTREF(__pyx_t_1);
20522 if (PyDict_SetItem(__pyx_d, __pyx_n_s_math, __pyx_t_1) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
20523 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20532 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numbers, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
20533 __Pyx_GOTREF(__pyx_t_1);
20534 if (PyDict_SetItem(__pyx_d, __pyx_n_s_numbers, __pyx_t_1) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
20535 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20544 __pyx_t_1 = __Pyx_Import(__pyx_n_s_collections, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error)
20545 __Pyx_GOTREF(__pyx_t_1);
20546 if (PyDict_SetItem(__pyx_d, __pyx_n_s_collections, __pyx_t_1) < 0) __PYX_ERR(0, 30, __pyx_L1_error)
20547 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20556 if (PyDict_SetItem(__pyx_d, __pyx_n_s_version, __pyx_kp_s_0_8_2) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
20565 __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)
20566 __Pyx_GOTREF(__pyx_t_1);
20567 if (PyDict_SetItem(__pyx_d, __pyx_n_s_index_set_hidden_doctests, __pyx_t_1) < 0) __PYX_ERR(0, 404, __pyx_L1_error)
20568 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20577 __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)
20578 __Pyx_GOTREF(__pyx_t_1);
20579 if (PyDict_SetItem(__pyx_d, __pyx_n_s_clifford_hidden_doctests, __pyx_t_1) < 0) __PYX_ERR(0, 1243, __pyx_L1_error)
20580 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20589 __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)
20590 __Pyx_GOTREF(__pyx_t_1);
20591 __pyx_t_2 = __pyx_f_8PyClical_atan(__pyx_t_1, 0, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1856, __pyx_L1_error)
20592 __Pyx_GOTREF(__pyx_t_2);
20593 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20594 __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_float_8_0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1856, __pyx_L1_error)
20595 __Pyx_GOTREF(__pyx_t_1);
20596 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20597 if (PyDict_SetItem(__pyx_d, __pyx_n_s_tau, __pyx_t_1) < 0) __PYX_ERR(0, 1856, __pyx_L1_error)
20598 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20607 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_tau);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1857, __pyx_L1_error)
20608 __Pyx_GOTREF(__pyx_t_1);
20609 __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)
20610 __Pyx_GOTREF(__pyx_t_2);
20611 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20612 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pi, __pyx_t_2) < 0) __PYX_ERR(0, 1857, __pyx_L1_error)
20613 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20622 if (PyDict_SetItem(__pyx_d, __pyx_n_s_cl, ((PyObject *)__pyx_ptype_8PyClical_clifford)) < 0) __PYX_ERR(0, 1859, __pyx_L1_error)
20631 if (PyDict_SetItem(__pyx_d, __pyx_n_s_ist, ((PyObject *)__pyx_ptype_8PyClical_index_set)) < 0) __PYX_ERR(0, 1879, __pyx_L1_error)
20640 __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)
20641 __Pyx_GOTREF(__pyx_t_2);
20642 if (PyDict_SetItem(__pyx_d, __pyx_n_s_e, __pyx_t_2) < 0) __PYX_ERR(0, 1887, __pyx_L1_error)
20643 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20652 __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)
20653 __Pyx_GOTREF(__pyx_t_2);
20654 if (PyDict_SetItem(__pyx_d, __pyx_n_s_istpq, __pyx_t_2) < 0) __PYX_ERR(0, 1900, __pyx_L1_error)
20655 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20664 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_e);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1909, __pyx_L1_error)
20665 __Pyx_GOTREF(__pyx_t_2);
20666 __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)
20667 __Pyx_GOTREF(__pyx_t_1);
20668 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20669 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_e);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1909, __pyx_L1_error)
20670 __Pyx_GOTREF(__pyx_t_2);
20671 __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)
20672 __Pyx_GOTREF(__pyx_t_3);
20673 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20674 __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1909, __pyx_L1_error)
20675 __Pyx_GOTREF(__pyx_t_2);
20676 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20677 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20678 if (PyDict_SetItem(__pyx_d, __pyx_n_s_ninf3, __pyx_t_2) < 0) __PYX_ERR(0, 1909, __pyx_L1_error)
20679 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20688 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_e);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1910, __pyx_L1_error)
20689 __Pyx_GOTREF(__pyx_t_2);
20690 __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)
20691 __Pyx_GOTREF(__pyx_t_3);
20692 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20693 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_e);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1910, __pyx_L1_error)
20694 __Pyx_GOTREF(__pyx_t_2);
20695 __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)
20696 __Pyx_GOTREF(__pyx_t_1);
20697 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20698 __pyx_t_2 = PyNumber_Subtract(__pyx_t_3, __pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1910, __pyx_L1_error)
20699 __Pyx_GOTREF(__pyx_t_2);
20700 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20701 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20702 if (PyDict_SetItem(__pyx_d, __pyx_n_s_nbar3, __pyx_t_2) < 0) __PYX_ERR(0, 1910, __pyx_L1_error)
20703 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20712 __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)
20713 __Pyx_GOTREF(__pyx_t_2);
20714 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1913, __pyx_L1_error)
20715 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20723 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1917, __pyx_L1_error)
20724 __Pyx_GOTREF(__pyx_t_2);
20725 __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)
20726 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20734 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_test);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1918, __pyx_L1_error)
20735 __Pyx_GOTREF(__pyx_t_1);
20737 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
20738 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
20739 if (likely(__pyx_t_3)) {
20740 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
20741 __Pyx_INCREF(__pyx_t_3);
20742 __Pyx_INCREF(
function);
20743 __Pyx_DECREF_SET(__pyx_t_1,
function);
20747 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1918, __pyx_L1_error)
20748 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20750 __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1918, __pyx_L1_error)
20752 __Pyx_GOTREF(__pyx_t_2);
20753 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20754 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20769 __pyx_t_2 = __Pyx_PyDict_NewPresized(107);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
20770 __Pyx_GOTREF(__pyx_t_2);
20771 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)
20772 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)
20773 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)
20774 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)
20775 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)
20776 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)
20777 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)
20778 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)
20779 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)
20780 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)
20781 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)
20782 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)
20783 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)
20784 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)
20785 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)
20786 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)
20787 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)
20788 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)
20789 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)
20790 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)
20791 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)
20792 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)
20793 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)
20794 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)
20795 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)
20796 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)
20797 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)
20798 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)
20799 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)
20800 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)
20801 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)
20802 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)
20803 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)
20804 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)
20805 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)
20806 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)
20807 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)
20808 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)
20809 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)
20810 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)
20811 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)
20812 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)
20813 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)
20814 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)
20815 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)
20816 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)
20817 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)
20818 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)
20819 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)
20820 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)
20821 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)
20822 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)
20823 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)
20824 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)
20825 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)
20826 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)
20827 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)
20828 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)
20829 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)
20830 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)
20831 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)
20832 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)
20833 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)
20834 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)
20835 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)
20836 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)
20837 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)
20838 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)
20839 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)
20840 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)
20841 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)
20842 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)
20843 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)
20844 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)
20845 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)
20846 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)
20847 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)
20848 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)
20849 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)
20850 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)
20851 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)
20852 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)
20853 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)
20854 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)
20855 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)
20856 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)
20857 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)
20858 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)
20859 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)
20860 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)
20861 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)
20862 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)
20863 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)
20864 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)
20865 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)
20866 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)
20867 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)
20868 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)
20869 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)
20870 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)
20871 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)
20872 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)
20873 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)
20874 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)
20875 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)
20876 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)
20877 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)
20878 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_2, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20879 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20885 __Pyx_XDECREF(__pyx_t_1);
20886 __Pyx_XDECREF(__pyx_t_2);
20887 __Pyx_XDECREF(__pyx_t_3);
20890 __Pyx_AddTraceback(
"init PyClical", 0, __pyx_lineno, __pyx_filename);
20892 Py_DECREF(__pyx_m); __pyx_m = 0;
20893 }
else if (!PyErr_Occurred()) {
20894 PyErr_SetString(PyExc_ImportError,
"init PyClical");
20897 __Pyx_RefNannyFinishContext();
20898 #if CYTHON_PEP489_MULTI_PHASE_INIT 20899 return (__pyx_m != NULL) ? 0 : -1;
20900 #elif PY_MAJOR_VERSION >= 3 20909 #if CYTHON_REFNANNY 20910 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
20911 PyObject *m = NULL, *p = NULL;
20913 m = PyImport_ImportModule((
char *)modname);
20915 p = PyObject_GetAttrString(m, (
char *)
"RefNannyAPI");
20917 r = PyLong_AsVoidPtr(p);
20921 return (__Pyx_RefNannyAPIStruct *)r;
20926 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
20927 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
20928 if (unlikely(!result)) {
20929 PyErr_Format(PyExc_NameError,
20930 #
if PY_MAJOR_VERSION >= 3
20931 "name '%U' is not defined", name);
20933 "name '%.200s' is not defined", PyString_AS_STRING(name));
20940 #if CYTHON_COMPILING_IN_CPYTHON 20941 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
20943 ternaryfunc call = func->ob_type->tp_call;
20944 if (unlikely(!call))
20945 return PyObject_Call(func, arg, kw);
20946 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
20948 result = (*call)(func, arg, kw);
20949 Py_LeaveRecursiveCall();
20950 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
20953 "NULL result without error in PyObject_Call");
20960 #if CYTHON_FAST_THREAD_STATE 20961 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
20962 PyObject *tmp_type, *tmp_value, *tmp_tb;
20963 tmp_type = tstate->curexc_type;
20964 tmp_value = tstate->curexc_value;
20965 tmp_tb = tstate->curexc_traceback;
20966 tstate->curexc_type = type;
20967 tstate->curexc_value = value;
20968 tstate->curexc_traceback = tb;
20969 Py_XDECREF(tmp_type);
20970 Py_XDECREF(tmp_value);
20971 Py_XDECREF(tmp_tb);
20973 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
20974 *type = tstate->curexc_type;
20975 *value = tstate->curexc_value;
20976 *tb = tstate->curexc_traceback;
20977 tstate->curexc_type = 0;
20978 tstate->curexc_value = 0;
20979 tstate->curexc_traceback = 0;
20984 static void __Pyx_WriteUnraisable(
const char *name, CYTHON_UNUSED
int clineno,
20985 CYTHON_UNUSED
int lineno, CYTHON_UNUSED
const char *filename,
20986 int full_traceback, CYTHON_UNUSED
int nogil) {
20987 PyObject *old_exc, *old_val, *old_tb;
20989 __Pyx_PyThreadState_declare
20991 PyGILState_STATE state;
20993 state = PyGILState_Ensure();
20995 else state = (PyGILState_STATE)-1;
20998 __Pyx_PyThreadState_assign
20999 __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
21000 if (full_traceback) {
21001 Py_XINCREF(old_exc);
21002 Py_XINCREF(old_val);
21003 Py_XINCREF(old_tb);
21004 __Pyx_ErrRestore(old_exc, old_val, old_tb);
21007 #if PY_MAJOR_VERSION < 3 21008 ctx = PyString_FromString(name);
21010 ctx = PyUnicode_FromString(name);
21012 __Pyx_ErrRestore(old_exc, old_val, old_tb);
21014 PyErr_WriteUnraisable(Py_None);
21016 PyErr_WriteUnraisable(ctx);
21021 PyGILState_Release(state);
21026 #if CYTHON_FAST_PYCCALL 21027 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
21028 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
21029 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
21030 PyObject *
self = PyCFunction_GET_SELF(func);
21031 int flags = PyCFunction_GET_FLAGS(func);
21032 assert(PyCFunction_Check(func));
21033 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)));
21034 assert(nargs >= 0);
21035 assert(nargs == 0 || args != NULL);
21039 assert(!PyErr_Occurred());
21040 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
21041 return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (
self, args, nargs, NULL);
21043 return (*((__Pyx_PyCFunctionFast)meth)) (
self, args, nargs);
21049 #if CYTHON_FAST_PYCALL 21050 #include "frameobject.h" 21051 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
21052 PyObject *globals) {
21054 PyThreadState *tstate = __Pyx_PyThreadState_Current;
21055 PyObject **fastlocals;
21058 assert(globals != NULL);
21063 assert(tstate != NULL);
21064 f = PyFrame_New(tstate, co, globals, NULL);
21068 fastlocals = f->f_localsplus;
21069 for (
i = 0;
i < na;
i++) {
21071 fastlocals[
i] = *args++;
21073 result = PyEval_EvalFrameEx(f,0);
21074 ++tstate->recursion_depth;
21076 --tstate->recursion_depth;
21079 #if 1 || PY_VERSION_HEX < 0x030600B1 21080 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
int nargs, PyObject *kwargs) {
21081 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
21082 PyObject *globals = PyFunction_GET_GLOBALS(func);
21083 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
21085 #if PY_MAJOR_VERSION >= 3 21088 PyObject *kwtuple, **k;
21093 assert(kwargs == NULL || PyDict_Check(kwargs));
21094 nk = kwargs ? PyDict_Size(kwargs) : 0;
21095 if (Py_EnterRecursiveCall((
char*)
" while calling a Python object")) {
21099 #
if PY_MAJOR_VERSION >= 3
21100 co->co_kwonlyargcount == 0 &&
21102 likely(kwargs == NULL || nk == 0) &&
21103 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
21104 if (argdefs == NULL && co->co_argcount == nargs) {
21105 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
21108 else if (nargs == 0 && argdefs != NULL
21109 && co->co_argcount == Py_SIZE(argdefs)) {
21112 args = &PyTuple_GET_ITEM(argdefs, 0);
21113 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
21117 if (kwargs != NULL) {
21119 kwtuple = PyTuple_New(2 * nk);
21120 if (kwtuple == NULL) {
21124 k = &PyTuple_GET_ITEM(kwtuple, 0);
21126 while (PyDict_Next(kwargs, &pos, &k[
i], &k[
i+1])) {
21137 closure = PyFunction_GET_CLOSURE(func);
21138 #if PY_MAJOR_VERSION >= 3 21139 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
21141 if (argdefs != NULL) {
21142 d = &PyTuple_GET_ITEM(argdefs, 0);
21143 nd = Py_SIZE(argdefs);
21149 #if PY_MAJOR_VERSION >= 3 21150 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
21153 d, (
int)nd, kwdefs, closure);
21155 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
21158 d, (
int)nd, closure);
21160 Py_XDECREF(kwtuple);
21162 Py_LeaveRecursiveCall();
21169 #if CYTHON_COMPILING_IN_CPYTHON 21170 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
21171 PyObject *
self, *result;
21173 cfunc = PyCFunction_GET_FUNCTION(func);
21174 self = PyCFunction_GET_SELF(func);
21175 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
21177 result = cfunc(
self, arg);
21178 Py_LeaveRecursiveCall();
21179 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
21182 "NULL result without error in PyObject_Call");
21189 #if CYTHON_COMPILING_IN_CPYTHON 21190 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
21192 PyObject *args = PyTuple_New(1);
21193 if (unlikely(!args))
return NULL;
21195 PyTuple_SET_ITEM(args, 0, arg);
21196 result = __Pyx_PyObject_Call(func, args, NULL);
21200 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
21201 #if CYTHON_FAST_PYCALL 21202 if (PyFunction_Check(func)) {
21203 return __Pyx_PyFunction_FastCall(func, &arg, 1);
21206 if (likely(PyCFunction_Check(func))) {
21207 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
21208 return __Pyx_PyObject_CallMethO(func, arg);
21209 #if CYTHON_FAST_PYCCALL 21210 }
else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
21211 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
21215 return __Pyx__PyObject_CallOneArg(func, arg);
21218 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
21220 PyObject *args = PyTuple_Pack(1, arg);
21221 if (unlikely(!args))
return NULL;
21222 result = __Pyx_PyObject_Call(func, args, NULL);
21229 #if CYTHON_COMPILING_IN_CPYTHON 21230 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
21231 #if CYTHON_FAST_PYCALL 21232 if (PyFunction_Check(func)) {
21233 return __Pyx_PyFunction_FastCall(func, NULL, 0);
21236 #ifdef __Pyx_CyFunction_USED 21237 if (likely(PyCFunction_Check(func) || __Pyx_TypeCheck(func, __pyx_CyFunctionType))) {
21239 if (likely(PyCFunction_Check(func))) {
21241 if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
21242 return __Pyx_PyObject_CallMethO(func, NULL);
21245 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
21250 static void __Pyx_RaiseDoubleKeywordsError(
21251 const char* func_name,
21254 PyErr_Format(PyExc_TypeError,
21255 #
if PY_MAJOR_VERSION >= 3
21256 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
21258 "%s() got multiple values for keyword argument '%s'", func_name,
21259 PyString_AsString(kw_name));
21264 static int __Pyx_ParseOptionalKeywords(
21266 PyObject **argnames[],
21268 PyObject *values[],
21269 Py_ssize_t num_pos_args,
21270 const char* function_name)
21272 PyObject *key = 0, *value = 0;
21273 Py_ssize_t pos = 0;
21275 PyObject*** first_kw_arg = argnames + num_pos_args;
21276 while (PyDict_Next(kwds, &pos, &key, &value)) {
21277 name = first_kw_arg;
21278 while (*name && (**name != key)) name++;
21280 values[name-argnames] = value;
21283 name = first_kw_arg;
21284 #if PY_MAJOR_VERSION < 3 21285 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
21287 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
21288 && _PyString_Eq(**name, key)) {
21289 values[name-argnames] = value;
21294 if (*name)
continue;
21296 PyObject*** argname = argnames;
21297 while (argname != first_kw_arg) {
21298 if ((**argname == key) || (
21299 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
21300 && _PyString_Eq(**argname, key))) {
21301 goto arg_passed_twice;
21308 if (likely(PyUnicode_Check(key))) {
21310 int cmp = (**name == key) ? 0 :
21311 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
21312 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
21314 PyUnicode_Compare(**name, key);
21315 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
21317 values[name-argnames] = value;
21322 if (*name)
continue;
21324 PyObject*** argname = argnames;
21325 while (argname != first_kw_arg) {
21326 int cmp = (**argname == key) ? 0 :
21327 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
21328 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
21330 PyUnicode_Compare(**argname, key);
21331 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
21332 if (cmp == 0)
goto arg_passed_twice;
21337 goto invalid_keyword_type;
21339 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
21341 goto invalid_keyword;
21346 __Pyx_RaiseDoubleKeywordsError(function_name, key);
21348 invalid_keyword_type:
21349 PyErr_Format(PyExc_TypeError,
21350 "%.200s() keywords must be strings", function_name);
21353 PyErr_Format(PyExc_TypeError,
21354 #
if PY_MAJOR_VERSION < 3
21355 "%.200s() got an unexpected keyword argument '%.200s'",
21356 function_name, PyString_AsString(key));
21358 "%s() got an unexpected keyword argument '%U'",
21359 function_name, key);
21366 static void __Pyx_RaiseArgtupleInvalid(
21367 const char* func_name,
21369 Py_ssize_t num_min,
21370 Py_ssize_t num_max,
21371 Py_ssize_t num_found)
21373 Py_ssize_t num_expected;
21374 const char *more_or_less;
21375 if (num_found < num_min) {
21376 num_expected = num_min;
21377 more_or_less =
"at least";
21379 num_expected = num_max;
21380 more_or_less =
"at most";
21383 more_or_less =
"exactly";
21385 PyErr_Format(PyExc_TypeError,
21386 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
21387 func_name, more_or_less, num_expected,
21388 (num_expected == 1) ?
"" :
"s", num_found);
21392 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
21394 #if !CYTHON_AVOID_BORROWED_REFS 21395 result = PyDict_GetItem(__pyx_d, name);
21396 if (likely(result)) {
21400 result = PyObject_GetItem(__pyx_d, name);
21404 result = __Pyx_GetBuiltinName(name);
21410 #if CYTHON_FAST_THREAD_STATE 21411 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
21412 #if PY_VERSION_HEX >= 0x030700A2 21413 *type = tstate->exc_state.exc_type;
21414 *value = tstate->exc_state.exc_value;
21415 *tb = tstate->exc_state.exc_traceback;
21417 *type = tstate->exc_type;
21418 *value = tstate->exc_value;
21419 *tb = tstate->exc_traceback;
21422 Py_XINCREF(*value);
21425 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
21426 PyObject *tmp_type, *tmp_value, *tmp_tb;
21427 #if PY_VERSION_HEX >= 0x030700A2 21428 tmp_type = tstate->exc_state.exc_type;
21429 tmp_value = tstate->exc_state.exc_value;
21430 tmp_tb = tstate->exc_state.exc_traceback;
21431 tstate->exc_state.exc_type = type;
21432 tstate->exc_state.exc_value = value;
21433 tstate->exc_state.exc_traceback = tb;
21435 tmp_type = tstate->exc_type;
21436 tmp_value = tstate->exc_value;
21437 tmp_tb = tstate->exc_traceback;
21438 tstate->exc_type = type;
21439 tstate->exc_value = value;
21440 tstate->exc_traceback = tb;
21442 Py_XDECREF(tmp_type);
21443 Py_XDECREF(tmp_value);
21444 Py_XDECREF(tmp_tb);
21449 #if CYTHON_FAST_THREAD_STATE 21450 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
21452 n = PyTuple_GET_SIZE(tuple);
21453 #if PY_MAJOR_VERSION >= 3 21454 for (
i=0;
i<n;
i++) {
21455 if (exc_type == PyTuple_GET_ITEM(tuple,
i))
return 1;
21458 for (
i=0;
i<n;
i++) {
21459 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple,
i)))
return 1;
21463 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
21464 PyObject *exc_type = tstate->curexc_type;
21465 if (exc_type == err)
return 1;
21466 if (unlikely(!exc_type))
return 0;
21467 if (unlikely(PyTuple_Check(err)))
21468 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
21469 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
21474 #if CYTHON_FAST_THREAD_STATE 21475 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
21477 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
21479 PyObject *local_type, *local_value, *local_tb;
21480 #if CYTHON_FAST_THREAD_STATE 21481 PyObject *tmp_type, *tmp_value, *tmp_tb;
21482 local_type = tstate->curexc_type;
21483 local_value = tstate->curexc_value;
21484 local_tb = tstate->curexc_traceback;
21485 tstate->curexc_type = 0;
21486 tstate->curexc_value = 0;
21487 tstate->curexc_traceback = 0;
21489 PyErr_Fetch(&local_type, &local_value, &local_tb);
21491 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
21492 #if CYTHON_FAST_THREAD_STATE 21493 if (unlikely(tstate->curexc_type))
21495 if (unlikely(PyErr_Occurred()))
21498 #if PY_MAJOR_VERSION >= 3 21500 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
21504 Py_XINCREF(local_tb);
21505 Py_XINCREF(local_type);
21506 Py_XINCREF(local_value);
21507 *type = local_type;
21508 *value = local_value;
21510 #if CYTHON_FAST_THREAD_STATE 21511 #if PY_VERSION_HEX >= 0x030700A2 21512 tmp_type = tstate->exc_state.exc_type;
21513 tmp_value = tstate->exc_state.exc_value;
21514 tmp_tb = tstate->exc_state.exc_traceback;
21515 tstate->exc_state.exc_type = local_type;
21516 tstate->exc_state.exc_value = local_value;
21517 tstate->exc_state.exc_traceback = local_tb;
21519 tmp_type = tstate->exc_type;
21520 tmp_value = tstate->exc_value;
21521 tmp_tb = tstate->exc_traceback;
21522 tstate->exc_type = local_type;
21523 tstate->exc_value = local_value;
21524 tstate->exc_traceback = local_tb;
21526 Py_XDECREF(tmp_type);
21527 Py_XDECREF(tmp_value);
21528 Py_XDECREF(tmp_tb);
21530 PyErr_SetExcInfo(local_type, local_value, local_tb);
21537 Py_XDECREF(local_type);
21538 Py_XDECREF(local_value);
21539 Py_XDECREF(local_tb);
21544 #if PY_MAJOR_VERSION < 3 21545 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
21546 CYTHON_UNUSED PyObject *cause) {
21547 __Pyx_PyThreadState_declare
21549 if (!value || value == Py_None)
21553 if (!tb || tb == Py_None)
21557 if (!PyTraceBack_Check(tb)) {
21558 PyErr_SetString(PyExc_TypeError,
21559 "raise: arg 3 must be a traceback or None");
21563 if (PyType_Check(type)) {
21564 #if CYTHON_COMPILING_IN_PYPY 21566 Py_INCREF(Py_None);
21570 PyErr_NormalizeException(&type, &value, &tb);
21573 PyErr_SetString(PyExc_TypeError,
21574 "instance exception may not have a separate value");
21578 type = (PyObject*) Py_TYPE(type);
21580 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
21581 PyErr_SetString(PyExc_TypeError,
21582 "raise: exception class must be a subclass of BaseException");
21586 __Pyx_PyThreadState_assign
21587 __Pyx_ErrRestore(type, value, tb);
21596 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
21597 PyObject* owned_instance = NULL;
21598 if (tb == Py_None) {
21600 }
else if (tb && !PyTraceBack_Check(tb)) {
21601 PyErr_SetString(PyExc_TypeError,
21602 "raise: arg 3 must be a traceback or None");
21605 if (value == Py_None)
21607 if (PyExceptionInstance_Check(type)) {
21609 PyErr_SetString(PyExc_TypeError,
21610 "instance exception may not have a separate value");
21614 type = (PyObject*) Py_TYPE(value);
21615 }
else if (PyExceptionClass_Check(type)) {
21616 PyObject *instance_class = NULL;
21617 if (value && PyExceptionInstance_Check(value)) {
21618 instance_class = (PyObject*) Py_TYPE(value);
21619 if (instance_class != type) {
21620 int is_subclass = PyObject_IsSubclass(instance_class, type);
21621 if (!is_subclass) {
21622 instance_class = NULL;
21623 }
else if (unlikely(is_subclass == -1)) {
21626 type = instance_class;
21630 if (!instance_class) {
21633 args = PyTuple_New(0);
21634 else if (PyTuple_Check(value)) {
21638 args = PyTuple_Pack(1, value);
21641 owned_instance = PyObject_Call(type, args, NULL);
21643 if (!owned_instance)
21645 value = owned_instance;
21646 if (!PyExceptionInstance_Check(value)) {
21647 PyErr_Format(PyExc_TypeError,
21648 "calling %R should have returned an instance of " 21649 "BaseException, not %R",
21650 type, Py_TYPE(value));
21655 PyErr_SetString(PyExc_TypeError,
21656 "raise: exception class must be a subclass of BaseException");
21660 PyObject *fixed_cause;
21661 if (cause == Py_None) {
21662 fixed_cause = NULL;
21663 }
else if (PyExceptionClass_Check(cause)) {
21664 fixed_cause = PyObject_CallObject(cause, NULL);
21665 if (fixed_cause == NULL)
21667 }
else if (PyExceptionInstance_Check(cause)) {
21668 fixed_cause = cause;
21669 Py_INCREF(fixed_cause);
21671 PyErr_SetString(PyExc_TypeError,
21672 "exception causes must derive from " 21676 PyException_SetCause(value, fixed_cause);
21678 PyErr_SetObject(type, value);
21680 #if CYTHON_COMPILING_IN_PYPY 21681 PyObject *tmp_type, *tmp_value, *tmp_tb;
21682 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
21684 PyErr_Restore(tmp_type, tmp_value, tb);
21685 Py_XDECREF(tmp_tb);
21687 PyThreadState *tstate = __Pyx_PyThreadState_Current;
21688 PyObject* tmp_tb = tstate->curexc_traceback;
21689 if (tb != tmp_tb) {
21691 tstate->curexc_traceback = tb;
21692 Py_XDECREF(tmp_tb);
21697 Py_XDECREF(owned_instance);
21703 #if !CYTHON_COMPILING_IN_PYPY 21704 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
long intval, CYTHON_UNUSED
int inplace) {
21705 #if PY_MAJOR_VERSION < 3 21706 if (likely(PyInt_CheckExact(op1))) {
21707 const long b = intval;
21709 long a = PyInt_AS_LONG(op1);
21710 x = (long)((
unsigned long)a + b);
21711 if (likely((x^a) >= 0 || (x^b) >= 0))
21712 return PyInt_FromLong(x);
21713 return PyLong_Type.tp_as_number->nb_add(op1, op2);
21716 #if CYTHON_USE_PYLONG_INTERNALS 21717 if (likely(PyLong_CheckExact(op1))) {
21718 const long b = intval;
21720 #ifdef HAVE_LONG_LONG 21721 const PY_LONG_LONG llb = intval;
21722 PY_LONG_LONG lla, llx;
21724 const digit* digits = ((PyLongObject*)op1)->ob_digit;
21725 const Py_ssize_t size = Py_SIZE(op1);
21726 if (likely(__Pyx_sst_abs(size) <= 1)) {
21727 a = likely(size) ? digits[0] : 0;
21728 if (size == -1) a = -a;
21732 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
21733 a = -(long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21735 #ifdef HAVE_LONG_LONG 21736 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
21737 lla = -(PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
21742 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
21743 a = (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21745 #ifdef HAVE_LONG_LONG 21746 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
21747 lla = (PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
21752 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
21753 a = -(long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21755 #ifdef HAVE_LONG_LONG 21756 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
21757 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]));
21762 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
21763 a = (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21765 #ifdef HAVE_LONG_LONG 21766 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
21767 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]));
21772 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
21773 a = -(long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21775 #ifdef HAVE_LONG_LONG 21776 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
21777 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]));
21782 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
21783 a = (long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21785 #ifdef HAVE_LONG_LONG 21786 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
21787 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]));
21791 default:
return PyLong_Type.tp_as_number->nb_add(op1, op2);
21795 return PyLong_FromLong(x);
21796 #ifdef HAVE_LONG_LONG 21799 return PyLong_FromLongLong(llx);
21805 if (PyFloat_CheckExact(op1)) {
21806 const long b = intval;
21807 double a = PyFloat_AS_DOUBLE(op1);
21809 PyFPE_START_PROTECT(
"add",
return NULL)
21810 result = ((double)a) + (double)b;
21811 PyFPE_END_PROTECT(result)
21814 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
21819 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
21822 r = PyObject_SetItem(o, j, v);
21826 static CYTHON_INLINE
int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t
i, PyObject *v,
int is_list,
21827 CYTHON_NCP_UNUSED
int wraparound, CYTHON_NCP_UNUSED
int boundscheck) {
21828 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS 21829 if (is_list || PyList_CheckExact(o)) {
21830 Py_ssize_t n = (!wraparound) ?
i : ((likely(
i >= 0)) ?
i :
i + PyList_GET_SIZE(o));
21831 if ((!boundscheck) || likely((n >= 0) & (n < PyList_GET_SIZE(o)))) {
21832 PyObject* old = PyList_GET_ITEM(o, n);
21834 PyList_SET_ITEM(o, n, v);
21839 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
21840 if (likely(m && m->sq_ass_item)) {
21841 if (wraparound && unlikely(
i < 0) && likely(m->sq_length)) {
21842 Py_ssize_t l = m->sq_length(o);
21843 if (likely(l >= 0)) {
21846 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
21851 return m->sq_ass_item(o,
i, v);
21855 #if CYTHON_COMPILING_IN_PYPY 21856 if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) {
21858 if (is_list || PySequence_Check(o)) {
21860 return PySequence_SetItem(o,
i, v);
21863 return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(
i), v);
21867 static int __Pyx__ArgTypeTest(PyObject *
obj, PyTypeObject *type,
const char *name,
int exact)
21869 if (unlikely(!type)) {
21870 PyErr_SetString(PyExc_SystemError,
"Missing type object");
21874 #if PY_MAJOR_VERSION == 2 21875 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(
obj)))
return 1;
21879 if (likely(__Pyx_TypeCheck(
obj, type)))
return 1;
21881 PyErr_Format(PyExc_TypeError,
21882 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
21883 name, type->tp_name, Py_TYPE(
obj)->tp_name);
21888 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level) {
21889 PyObject *empty_list = 0;
21890 PyObject *module = 0;
21891 PyObject *global_dict = 0;
21892 PyObject *empty_dict = 0;
21894 #if PY_MAJOR_VERSION < 3 21895 PyObject *py_import;
21896 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
21903 empty_list = PyList_New(0);
21908 global_dict = PyModule_GetDict(__pyx_m);
21911 empty_dict = PyDict_New();
21915 #if PY_MAJOR_VERSION >= 3 21917 if (strchr(__Pyx_MODULE_NAME,
'.')) {
21918 module = PyImport_ImportModuleLevelObject(
21919 name, global_dict, empty_dict, list, 1);
21921 if (!PyErr_ExceptionMatches(PyExc_ImportError))
21930 #if PY_MAJOR_VERSION < 3 21931 PyObject *py_level = PyInt_FromLong(level);
21934 module = PyObject_CallFunctionObjArgs(py_import,
21935 name, global_dict, empty_dict, list, py_level, NULL);
21936 Py_DECREF(py_level);
21938 module = PyImport_ImportModuleLevelObject(
21939 name, global_dict, empty_dict, list, level);
21944 #if PY_MAJOR_VERSION < 3 21945 Py_XDECREF(py_import);
21947 Py_XDECREF(empty_list);
21948 Py_XDECREF(empty_dict);
21953 static int __Pyx_SetVtable(PyObject *dict,
void *vtable) {
21954 #if PY_VERSION_HEX >= 0x02070000 21955 PyObject *ob = PyCapsule_New(vtable, 0, 0);
21957 PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
21961 if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
21971 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
21973 PyObject *name_attr;
21974 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name);
21975 if (likely(name_attr)) {
21976 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
21980 if (unlikely(ret < 0)) {
21984 Py_XDECREF(name_attr);
21987 static int __Pyx_setup_reduce(PyObject* type_obj) {
21989 PyObject *object_reduce = NULL;
21990 PyObject *object_reduce_ex = NULL;
21991 PyObject *reduce = NULL;
21992 PyObject *reduce_ex = NULL;
21993 PyObject *reduce_cython = NULL;
21994 PyObject *setstate = NULL;
21995 PyObject *setstate_cython = NULL;
21996 #if CYTHON_USE_PYTYPE_LOOKUP 21997 if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate))
goto GOOD;
21999 if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate))
goto GOOD;
22001 #if CYTHON_USE_PYTYPE_LOOKUP 22002 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto BAD;
22004 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto BAD;
22006 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex);
if (unlikely(!reduce_ex))
goto BAD;
22007 if (reduce_ex == object_reduce_ex) {
22008 #if CYTHON_USE_PYTYPE_LOOKUP 22009 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto BAD;
22011 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto BAD;
22013 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce);
if (unlikely(!reduce))
goto BAD;
22014 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
22015 reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython);
if (unlikely(!reduce_cython))
goto BAD;
22016 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython);
if (unlikely(ret < 0))
goto BAD;
22017 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython);
if (unlikely(ret < 0))
goto BAD;
22018 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
22019 if (!setstate) PyErr_Clear();
22020 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
22021 setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython);
if (unlikely(!setstate_cython))
goto BAD;
22022 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython);
if (unlikely(ret < 0))
goto BAD;
22023 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython);
if (unlikely(ret < 0))
goto BAD;
22025 PyType_Modified((PyTypeObject*)type_obj);
22030 if (!PyErr_Occurred())
22031 PyErr_Format(PyExc_RuntimeError,
"Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
22034 #if !CYTHON_USE_PYTYPE_LOOKUP 22035 Py_XDECREF(object_reduce);
22036 Py_XDECREF(object_reduce_ex);
22038 Py_XDECREF(reduce);
22039 Py_XDECREF(reduce_ex);
22040 Py_XDECREF(reduce_cython);
22041 Py_XDECREF(setstate);
22042 Py_XDECREF(setstate_cython);
22047 #if !CYTHON_COMPILING_IN_PYPY 22048 static PyObject* __Pyx_PyFloat_DivideObjC(PyObject *op1, PyObject *op2,
double floatval, CYTHON_UNUSED
int inplace) {
22049 const double b = floatval;
22051 if (likely(PyFloat_CheckExact(op1))) {
22052 a = PyFloat_AS_DOUBLE(op1);
22054 #if PY_MAJOR_VERSION < 3 22055 if (likely(PyInt_CheckExact(op1))) {
22056 a = (double) PyInt_AS_LONG(op1);
22059 if (likely(PyLong_CheckExact(op1))) {
22060 #if CYTHON_USE_PYLONG_INTERNALS 22061 const digit* digits = ((PyLongObject*)op1)->ob_digit;
22062 const Py_ssize_t size = Py_SIZE(op1);
22064 case 0: a = 0.0;
break;
22065 case -1: a = -(double) digits[0];
break;
22066 case 1: a = (double) digits[0];
break;
22069 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
22070 a = (double) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
22071 if ((8 *
sizeof(
unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
22079 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
22080 a = (double) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
22081 if ((8 *
sizeof(
unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
22089 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
22090 a = (double) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
22091 if ((8 *
sizeof(
unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
22101 a = PyLong_AsDouble(op1);
22102 if (unlikely(a == -1.0 && PyErr_Occurred()))
return NULL;
22105 return (inplace ? __Pyx_PyNumber_InPlaceDivide(op1, op2) : __Pyx_PyNumber_Divide(op1, op2));
22107 PyFPE_START_PROTECT(
"divide",
return NULL)
22109 PyFPE_END_PROTECT(result)
22115 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals) {
22116 #if CYTHON_COMPILING_IN_PYPY 22117 return PyObject_RichCompareBool(s1, s2, equals);
22120 return (equals == Py_EQ);
22121 }
else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
22122 const char *ps1, *ps2;
22123 Py_ssize_t length = PyBytes_GET_SIZE(s1);
22124 if (length != PyBytes_GET_SIZE(s2))
22125 return (equals == Py_NE);
22126 ps1 = PyBytes_AS_STRING(s1);
22127 ps2 = PyBytes_AS_STRING(s2);
22128 if (ps1[0] != ps2[0]) {
22129 return (equals == Py_NE);
22130 }
else if (length == 1) {
22131 return (equals == Py_EQ);
22134 #if CYTHON_USE_UNICODE_INTERNALS 22135 Py_hash_t hash1, hash2;
22136 hash1 = ((PyBytesObject*)s1)->ob_shash;
22137 hash2 = ((PyBytesObject*)s2)->ob_shash;
22138 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
22139 return (equals == Py_NE);
22142 result = memcmp(ps1, ps2, (
size_t)length);
22143 return (equals == Py_EQ) ? (result == 0) : (result != 0);
22145 }
else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
22146 return (equals == Py_NE);
22147 }
else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
22148 return (equals == Py_NE);
22151 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
22154 result = __Pyx_PyObject_IsTrue(py_result);
22155 Py_DECREF(py_result);
22162 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals) {
22163 #if CYTHON_COMPILING_IN_PYPY 22164 return PyObject_RichCompareBool(s1, s2, equals);
22166 #if PY_MAJOR_VERSION < 3 22167 PyObject* owned_ref = NULL;
22169 int s1_is_unicode, s2_is_unicode;
22173 s1_is_unicode = PyUnicode_CheckExact(s1);
22174 s2_is_unicode = PyUnicode_CheckExact(s2);
22175 #if PY_MAJOR_VERSION < 3 22176 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
22177 owned_ref = PyUnicode_FromObject(s2);
22178 if (unlikely(!owned_ref))
22182 }
else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
22183 owned_ref = PyUnicode_FromObject(s1);
22184 if (unlikely(!owned_ref))
22188 }
else if (((!s2_is_unicode) & (!s1_is_unicode))) {
22189 return __Pyx_PyBytes_Equals(s1, s2, equals);
22192 if (s1_is_unicode & s2_is_unicode) {
22195 void *data1, *data2;
22196 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
22198 length = __Pyx_PyUnicode_GET_LENGTH(s1);
22199 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
22202 #if CYTHON_USE_UNICODE_INTERNALS 22204 Py_hash_t hash1, hash2;
22205 #if CYTHON_PEP393_ENABLED 22206 hash1 = ((PyASCIIObject*)s1)->hash;
22207 hash2 = ((PyASCIIObject*)s2)->hash;
22209 hash1 = ((PyUnicodeObject*)s1)->hash;
22210 hash2 = ((PyUnicodeObject*)s2)->hash;
22212 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
22217 kind = __Pyx_PyUnicode_KIND(s1);
22218 if (kind != __Pyx_PyUnicode_KIND(s2)) {
22221 data1 = __Pyx_PyUnicode_DATA(s1);
22222 data2 = __Pyx_PyUnicode_DATA(s2);
22223 if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
22225 }
else if (length == 1) {
22228 int result = memcmp(data1, data2, (
size_t)(length * kind));
22229 #if PY_MAJOR_VERSION < 3 22230 Py_XDECREF(owned_ref);
22232 return (equals == Py_EQ) ? (result == 0) : (result != 0);
22234 }
else if ((s1 == Py_None) & s2_is_unicode) {
22236 }
else if ((s2 == Py_None) & s1_is_unicode) {
22240 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
22243 result = __Pyx_PyObject_IsTrue(py_result);
22244 Py_DECREF(py_result);
22248 #if PY_MAJOR_VERSION < 3 22249 Py_XDECREF(owned_ref);
22251 return (equals == Py_EQ);
22253 #if PY_MAJOR_VERSION < 3 22254 Py_XDECREF(owned_ref);
22256 return (equals == Py_NE);
22261 #ifndef CYTHON_CLINE_IN_TRACEBACK 22262 static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate,
int c_line) {
22263 PyObject *use_cline;
22264 PyObject *ptype, *pvalue, *ptraceback;
22265 #if CYTHON_COMPILING_IN_CPYTHON 22266 PyObject **cython_runtime_dict;
22268 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
22269 #if CYTHON_COMPILING_IN_CPYTHON 22270 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
22271 if (likely(cython_runtime_dict)) {
22272 use_cline = PyDict_GetItem(*cython_runtime_dict, __pyx_n_s_cline_in_traceback);
22276 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
22277 if (use_cline_obj) {
22278 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
22279 Py_DECREF(use_cline_obj);
22287 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
22289 else if (PyObject_Not(use_cline) != 0) {
22292 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
22298 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
22299 int start = 0, mid = 0, end = count - 1;
22300 if (end >= 0 && code_line > entries[end].code_line) {
22303 while (start < end) {
22304 mid = start + (end - start) / 2;
22305 if (code_line < entries[mid].code_line) {
22307 }
else if (code_line > entries[mid].code_line) {
22313 if (code_line <= entries[mid].code_line) {
22319 static PyCodeObject *__pyx_find_code_object(
int code_line) {
22320 PyCodeObject* code_object;
22322 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
22325 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
22326 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
22329 code_object = __pyx_code_cache.entries[pos].code_object;
22330 Py_INCREF(code_object);
22331 return code_object;
22333 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
22335 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
22336 if (unlikely(!code_line)) {
22339 if (unlikely(!entries)) {
22340 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
22341 if (likely(entries)) {
22342 __pyx_code_cache.entries = entries;
22343 __pyx_code_cache.max_count = 64;
22344 __pyx_code_cache.count = 1;
22345 entries[0].code_line = code_line;
22346 entries[0].code_object = code_object;
22347 Py_INCREF(code_object);
22351 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
22352 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
22353 PyCodeObject* tmp = entries[pos].code_object;
22354 entries[pos].code_object = code_object;
22358 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
22359 int new_max = __pyx_code_cache.max_count + 64;
22360 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
22361 __pyx_code_cache.entries, (
size_t)new_max*
sizeof(__Pyx_CodeObjectCacheEntry));
22362 if (unlikely(!entries)) {
22365 __pyx_code_cache.entries = entries;
22366 __pyx_code_cache.max_count = new_max;
22368 for (
i=__pyx_code_cache.count;
i>pos;
i--) {
22369 entries[
i] = entries[
i-1];
22371 entries[pos].code_line = code_line;
22372 entries[pos].code_object = code_object;
22373 __pyx_code_cache.count++;
22374 Py_INCREF(code_object);
22378 #include "compile.h" 22379 #include "frameobject.h" 22380 #include "traceback.h" 22381 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
22382 const char *funcname,
int c_line,
22383 int py_line,
const char *filename) {
22384 PyCodeObject *py_code = 0;
22385 PyObject *py_srcfile = 0;
22386 PyObject *py_funcname = 0;
22387 #if PY_MAJOR_VERSION < 3 22388 py_srcfile = PyString_FromString(filename);
22390 py_srcfile = PyUnicode_FromString(filename);
22392 if (!py_srcfile)
goto bad;
22394 #if PY_MAJOR_VERSION < 3 22395 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
22397 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
22401 #if PY_MAJOR_VERSION < 3 22402 py_funcname = PyString_FromString(funcname);
22404 py_funcname = PyUnicode_FromString(funcname);
22407 if (!py_funcname)
goto bad;
22408 py_code = __Pyx_PyCode_New(
22425 Py_DECREF(py_srcfile);
22426 Py_DECREF(py_funcname);
22429 Py_XDECREF(py_srcfile);
22430 Py_XDECREF(py_funcname);
22433 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
22434 int py_line,
const char *filename) {
22435 PyCodeObject *py_code = 0;
22436 PyFrameObject *py_frame = 0;
22437 PyThreadState *tstate = __Pyx_PyThreadState_Current;
22439 c_line = __Pyx_CLineForTraceback(tstate, c_line);
22441 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
22443 py_code = __Pyx_CreateCodeObjectForTraceback(
22444 funcname, c_line, py_line, filename);
22445 if (!py_code)
goto bad;
22446 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
22448 py_frame = PyFrame_New(
22454 if (!py_frame)
goto bad;
22455 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
22456 PyTraceBack_Here(py_frame);
22458 Py_XDECREF(py_code);
22459 Py_XDECREF(py_frame);
22463 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ 22464 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) 22465 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ 22466 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) 22467 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ 22469 func_type value = func_value;\ 22470 if (sizeof(target_type) < sizeof(func_type)) {\ 22471 if (unlikely(value != (func_type) (target_type) value)) {\ 22472 func_type zero = 0;\ 22473 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ 22474 return (target_type) -1;\ 22475 if (is_unsigned && unlikely(value < zero))\ 22476 goto raise_neg_overflow;\ 22478 goto raise_overflow;\ 22481 return (target_type) value;\ 22485 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value) {
22486 const int neg_one = (int) -1, const_zero = (
int) 0;
22487 const int is_unsigned = neg_one > const_zero;
22489 if (
sizeof(
int) <
sizeof(long)) {
22490 return PyInt_FromLong((
long) value);
22491 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
22492 return PyLong_FromUnsignedLong((
unsigned long) value);
22493 #ifdef HAVE_LONG_LONG 22494 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
22495 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
22499 if (
sizeof(
int) <=
sizeof(
long)) {
22500 return PyInt_FromLong((
long) value);
22501 #ifdef HAVE_LONG_LONG 22502 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
22503 return PyLong_FromLongLong((PY_LONG_LONG) value);
22508 int one = 1;
int little = (int)*(
unsigned char *)&one;
22509 unsigned char *bytes = (
unsigned char *)&value;
22510 return _PyLong_FromByteArray(bytes,
sizeof(
int),
22511 little, !is_unsigned);
22516 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *x) {
22517 const int neg_one = (int) -1, const_zero = (
int) 0;
22518 const int is_unsigned = neg_one > const_zero;
22519 #if PY_MAJOR_VERSION < 3 22520 if (likely(PyInt_Check(x))) {
22521 if (
sizeof(
int) <
sizeof(long)) {
22522 __PYX_VERIFY_RETURN_INT(
int,
long, PyInt_AS_LONG(x))
22524 long val = PyInt_AS_LONG(x);
22525 if (is_unsigned && unlikely(val < 0)) {
22526 goto raise_neg_overflow;
22532 if (likely(PyLong_Check(x))) {
22534 #if CYTHON_USE_PYLONG_INTERNALS 22535 const digit* digits = ((PyLongObject*)x)->ob_digit;
22536 switch (Py_SIZE(x)) {
22537 case 0:
return (
int) 0;
22538 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, digits[0])
22540 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
22541 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22542 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22543 }
else if (8 *
sizeof(
int) >= 2 * PyLong_SHIFT) {
22544 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
22549 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
22550 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22551 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22552 }
else if (8 *
sizeof(
int) >= 3 * PyLong_SHIFT) {
22553 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
22558 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
22559 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22560 __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])))
22561 }
else if (8 *
sizeof(
int) >= 4 * PyLong_SHIFT) {
22562 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
22568 #if CYTHON_COMPILING_IN_CPYTHON 22569 if (unlikely(Py_SIZE(x) < 0)) {
22570 goto raise_neg_overflow;
22574 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
22575 if (unlikely(result < 0))
22577 if (unlikely(result == 1))
22578 goto raise_neg_overflow;
22581 if (
sizeof(
int) <=
sizeof(
unsigned long)) {
22582 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
22583 #ifdef HAVE_LONG_LONG 22584 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
22585 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
22589 #if CYTHON_USE_PYLONG_INTERNALS 22590 const digit* digits = ((PyLongObject*)x)->ob_digit;
22591 switch (Py_SIZE(x)) {
22592 case 0:
return (
int) 0;
22593 case -1: __PYX_VERIFY_RETURN_INT(
int, sdigit, (sdigit) (-(sdigit)digits[0]))
22594 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, +digits[0])
22596 if (8 *
sizeof(
int) - 1 > 1 * PyLong_SHIFT) {
22597 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22598 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22599 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
22600 return (
int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
22605 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
22606 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22607 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22608 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
22609 return (
int) ((((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
22614 if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
22615 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22616 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22617 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
22618 return (
int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
22623 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
22624 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22625 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22626 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
22627 return (
int) ((((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
22632 if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
22633 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22634 __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])))
22635 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
22636 return (
int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
22641 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
22642 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22643 __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])))
22644 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
22645 return (
int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
22651 if (
sizeof(
int) <=
sizeof(long)) {
22652 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
22653 #ifdef HAVE_LONG_LONG 22654 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
22655 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
22660 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) 22661 PyErr_SetString(PyExc_RuntimeError,
22662 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
22665 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
22666 #if PY_MAJOR_VERSION < 3 22667 if (likely(v) && !PyLong_Check(v)) {
22669 v = PyNumber_Long(tmp);
22674 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
22675 unsigned char *bytes = (
unsigned char *)&val;
22676 int ret = _PyLong_AsByteArray((PyLongObject *)v,
22677 bytes,
sizeof(val),
22678 is_little, !is_unsigned);
22688 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
22689 if (!tmp)
return (
int) -1;
22690 val = __Pyx_PyInt_As_int(tmp);
22695 PyErr_SetString(PyExc_OverflowError,
22696 "value too large to convert to int");
22698 raise_neg_overflow:
22699 PyErr_SetString(PyExc_OverflowError,
22700 "can't convert negative value to int");
22705 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value) {
22706 const long neg_one = (long) -1, const_zero = (
long) 0;
22707 const int is_unsigned = neg_one > const_zero;
22709 if (
sizeof(
long) <
sizeof(long)) {
22710 return PyInt_FromLong((
long) value);
22711 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
22712 return PyLong_FromUnsignedLong((
unsigned long) value);
22713 #ifdef HAVE_LONG_LONG 22714 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
22715 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
22719 if (
sizeof(
long) <=
sizeof(
long)) {
22720 return PyInt_FromLong((
long) value);
22721 #ifdef HAVE_LONG_LONG 22722 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
22723 return PyLong_FromLongLong((PY_LONG_LONG) value);
22728 int one = 1;
int little = (int)*(
unsigned char *)&one;
22729 unsigned char *bytes = (
unsigned char *)&value;
22730 return _PyLong_FromByteArray(bytes,
sizeof(
long),
22731 little, !is_unsigned);
22736 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *x) {
22737 const long neg_one = (long) -1, const_zero = (
long) 0;
22738 const int is_unsigned = neg_one > const_zero;
22739 #if PY_MAJOR_VERSION < 3 22740 if (likely(PyInt_Check(x))) {
22741 if (
sizeof(
long) <
sizeof(long)) {
22742 __PYX_VERIFY_RETURN_INT(
long,
long, PyInt_AS_LONG(x))
22744 long val = PyInt_AS_LONG(x);
22745 if (is_unsigned && unlikely(val < 0)) {
22746 goto raise_neg_overflow;
22752 if (likely(PyLong_Check(x))) {
22754 #if CYTHON_USE_PYLONG_INTERNALS 22755 const digit* digits = ((PyLongObject*)x)->ob_digit;
22756 switch (Py_SIZE(x)) {
22757 case 0:
return (
long) 0;
22758 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, digits[0])
22760 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
22761 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22762 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22763 }
else if (8 *
sizeof(
long) >= 2 * PyLong_SHIFT) {
22764 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
22769 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
22770 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22771 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22772 }
else if (8 *
sizeof(
long) >= 3 * PyLong_SHIFT) {
22773 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
22778 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
22779 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22780 __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])))
22781 }
else if (8 *
sizeof(
long) >= 4 * PyLong_SHIFT) {
22782 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
22788 #if CYTHON_COMPILING_IN_CPYTHON 22789 if (unlikely(Py_SIZE(x) < 0)) {
22790 goto raise_neg_overflow;
22794 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
22795 if (unlikely(result < 0))
22797 if (unlikely(result == 1))
22798 goto raise_neg_overflow;
22801 if (
sizeof(
long) <=
sizeof(
unsigned long)) {
22802 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
22803 #ifdef HAVE_LONG_LONG 22804 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
22805 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
22809 #if CYTHON_USE_PYLONG_INTERNALS 22810 const digit* digits = ((PyLongObject*)x)->ob_digit;
22811 switch (Py_SIZE(x)) {
22812 case 0:
return (
long) 0;
22813 case -1: __PYX_VERIFY_RETURN_INT(
long, sdigit, (sdigit) (-(sdigit)digits[0]))
22814 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, +digits[0])
22816 if (8 *
sizeof(
long) - 1 > 1 * PyLong_SHIFT) {
22817 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22818 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22819 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
22820 return (
long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
22825 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
22826 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22827 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22828 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
22829 return (
long) ((((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
22834 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
22835 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22836 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22837 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
22838 return (
long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
22843 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
22844 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22845 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22846 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
22847 return (
long) ((((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
22852 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
22853 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22854 __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])))
22855 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
22856 return (
long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
22861 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
22862 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22863 __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])))
22864 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
22865 return (
long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
22871 if (
sizeof(
long) <=
sizeof(long)) {
22872 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
22873 #ifdef HAVE_LONG_LONG 22874 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
22875 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
22880 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) 22881 PyErr_SetString(PyExc_RuntimeError,
22882 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
22885 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
22886 #if PY_MAJOR_VERSION < 3 22887 if (likely(v) && !PyLong_Check(v)) {
22889 v = PyNumber_Long(tmp);
22894 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
22895 unsigned char *bytes = (
unsigned char *)&val;
22896 int ret = _PyLong_AsByteArray((PyLongObject *)v,
22897 bytes,
sizeof(val),
22898 is_little, !is_unsigned);
22908 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
22909 if (!tmp)
return (
long) -1;
22910 val = __Pyx_PyInt_As_long(tmp);
22915 PyErr_SetString(PyExc_OverflowError,
22916 "value too large to convert to long");
22918 raise_neg_overflow:
22919 PyErr_SetString(PyExc_OverflowError,
22920 "can't convert negative value to long");
22925 #if CYTHON_COMPILING_IN_CPYTHON 22926 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
22932 return b == &PyBaseObject_Type;
22934 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
22936 if (a == b)
return 1;
22940 n = PyTuple_GET_SIZE(mro);
22941 for (
i = 0;
i < n;
i++) {
22942 if (PyTuple_GET_ITEM(mro,
i) == (PyObject *)b)
22947 return __Pyx_InBases(a, b);
22949 #if PY_MAJOR_VERSION == 2 22950 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
22951 PyObject *exception, *value, *tb;
22953 __Pyx_PyThreadState_declare
22954 __Pyx_PyThreadState_assign
22955 __Pyx_ErrFetch(&exception, &value, &tb);
22956 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
22957 if (unlikely(res == -1)) {
22958 PyErr_WriteUnraisable(err);
22962 res = PyObject_IsSubclass(err, exc_type2);
22963 if (unlikely(res == -1)) {
22964 PyErr_WriteUnraisable(err);
22968 __Pyx_ErrRestore(exception, value, tb);
22972 static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
22973 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
22975 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
22980 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
22981 if (likely(err == exc_type))
return 1;
22982 if (likely(PyExceptionClass_Check(err))) {
22983 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
22985 return PyErr_GivenExceptionMatches(err, exc_type);
22987 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
22988 if (likely(err == exc_type1 || err == exc_type2))
return 1;
22989 if (likely(PyExceptionClass_Check(err))) {
22990 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
22992 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
22997 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
22998 PyObject* fake_module;
22999 PyTypeObject* cached_type = NULL;
23000 fake_module = PyImport_AddModule((
char*)
"_cython_" CYTHON_ABI);
23001 if (!fake_module)
return NULL;
23002 Py_INCREF(fake_module);
23003 cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
23005 if (!PyType_Check((PyObject*)cached_type)) {
23006 PyErr_Format(PyExc_TypeError,
23007 "Shared Cython type %.200s is not a type object",
23011 if (cached_type->tp_basicsize != type->tp_basicsize) {
23012 PyErr_Format(PyExc_TypeError,
23013 "Shared Cython type %.200s has the wrong size, try recompiling",
23018 if (!PyErr_ExceptionMatches(PyExc_AttributeError))
goto bad;
23020 if (PyType_Ready(type) < 0)
goto bad;
23021 if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
23024 cached_type = type;
23027 Py_DECREF(fake_module);
23028 return cached_type;
23030 Py_XDECREF(cached_type);
23031 cached_type = NULL;
23036 #if CYTHON_FAST_THREAD_STATE 23037 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
23038 PyObject *tmp_type, *tmp_value, *tmp_tb;
23039 #if PY_VERSION_HEX >= 0x030700A2 23040 tmp_type = tstate->exc_state.exc_type;
23041 tmp_value = tstate->exc_state.exc_value;
23042 tmp_tb = tstate->exc_state.exc_traceback;
23043 tstate->exc_state.exc_type = *type;
23044 tstate->exc_state.exc_value = *value;
23045 tstate->exc_state.exc_traceback = *tb;
23047 tmp_type = tstate->exc_type;
23048 tmp_value = tstate->exc_value;
23049 tmp_tb = tstate->exc_traceback;
23050 tstate->exc_type = *type;
23051 tstate->exc_value = *value;
23052 tstate->exc_traceback = *tb;
23055 *value = tmp_value;
23059 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
23060 PyObject *tmp_type, *tmp_value, *tmp_tb;
23061 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
23062 PyErr_SetExcInfo(*type, *value, *tb);
23064 *value = tmp_value;
23070 static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
23071 PyObject *result = NULL;
23072 #if CYTHON_UNPACK_METHODS 23073 if (likely(PyMethod_Check(method))) {
23074 PyObject *
self = PyMethod_GET_SELF(method);
23075 if (likely(
self)) {
23077 PyObject *
function = PyMethod_GET_FUNCTION(method);
23078 #if CYTHON_FAST_PYCALL 23079 if (PyFunction_Check(
function)) {
23080 PyObject *args[2] = {
self, arg};
23081 result = __Pyx_PyFunction_FastCall(
function, args, 2);
23085 #if CYTHON_FAST_PYCCALL 23086 if (__Pyx_PyFastCFunction_Check(
function)) {
23087 PyObject *args[2] = {
self, arg};
23088 result = __Pyx_PyCFunction_FastCall(
function, args, 2);
23092 args = PyTuple_New(2);
23093 if (unlikely(!args))
goto done;
23095 PyTuple_SET_ITEM(args, 0,
self);
23097 PyTuple_SET_ITEM(args, 1, arg);
23098 Py_INCREF(
function);
23099 result = __Pyx_PyObject_Call(
function, args, NULL);
23101 Py_DECREF(
function);
23106 result = __Pyx_PyObject_CallOneArg(method, arg);
23111 static PyObject* __Pyx_PyObject_CallMethod1(PyObject*
obj, PyObject* method_name, PyObject* arg) {
23112 PyObject *method, *result = NULL;
23113 method = __Pyx_PyObject_GetAttrStr(
obj, method_name);
23114 if (unlikely(!method))
goto done;
23115 result = __Pyx__PyObject_CallMethod1(method, arg);
23117 Py_XDECREF(method);
23122 #include <structmember.h> 23123 #include <frameobject.h> 23124 #define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom) 23125 static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) {
23126 PyObject *et, *ev, *tb;
23127 PyObject *value = NULL;
23128 __Pyx_ErrFetch(&et, &ev, &tb);
23132 Py_INCREF(Py_None);
23136 if (likely(et == PyExc_StopIteration)) {
23138 Py_INCREF(Py_None);
23141 #if PY_VERSION_HEX >= 0x030300A0 23142 else if (Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) {
23143 value = ((PyStopIterationObject *)ev)->value;
23148 else if (unlikely(PyTuple_Check(ev))) {
23149 if (PyTuple_GET_SIZE(ev) >= 1) {
23150 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 23151 value = PyTuple_GET_ITEM(ev, 0);
23154 value = PySequence_ITEM(ev, 0);
23157 Py_INCREF(Py_None);
23162 else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
23165 if (likely(value)) {
23171 }
else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
23172 __Pyx_ErrRestore(et, ev, tb);
23175 PyErr_NormalizeException(&et, &ev, &tb);
23176 if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
23177 __Pyx_ErrRestore(et, ev, tb);
23182 #if PY_VERSION_HEX >= 0x030300A0 23183 value = ((PyStopIterationObject *)ev)->value;
23188 PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args);
23190 if (likely(args)) {
23191 value = PySequence_GetItem(args, 0);
23194 if (unlikely(!value)) {
23195 __Pyx_ErrRestore(NULL, NULL, NULL);
23196 Py_INCREF(Py_None);
23204 static CYTHON_INLINE
23205 void __Pyx_Coroutine_ExceptionClear(__pyx_CoroutineObject *
self) {
23206 PyObject *exc_type =
self->exc_type;
23207 PyObject *exc_value =
self->exc_value;
23208 PyObject *exc_traceback =
self->exc_traceback;
23209 self->exc_type = NULL;
23210 self->exc_value = NULL;
23211 self->exc_traceback = NULL;
23212 Py_XDECREF(exc_type);
23213 Py_XDECREF(exc_value);
23214 Py_XDECREF(exc_traceback);
23216 #define __Pyx_Coroutine_AlreadyRunningError(gen) (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL) 23217 static void __Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject *gen) {
23220 #ifdef __Pyx_Coroutine_USED 23221 }
else if (__Pyx_Coroutine_CheckExact((PyObject*)gen)) {
23222 msg =
"coroutine already executing";
23224 #ifdef __Pyx_AsyncGen_USED 23225 }
else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
23226 msg =
"async generator already executing";
23229 msg =
"generator already executing";
23231 PyErr_SetString(PyExc_ValueError, msg);
23233 #define __Pyx_Coroutine_NotStartedError(gen) (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL) 23234 static void __Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject *gen) {
23237 #ifdef __Pyx_Coroutine_USED 23238 }
else if (__Pyx_Coroutine_CheckExact(gen)) {
23239 msg =
"can't send non-None value to a just-started coroutine";
23241 #ifdef __Pyx_AsyncGen_USED 23242 }
else if (__Pyx_AsyncGen_CheckExact(gen)) {
23243 msg =
"can't send non-None value to a just-started async generator";
23246 msg =
"can't send non-None value to a just-started generator";
23248 PyErr_SetString(PyExc_TypeError, msg);
23250 #define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing) (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL) 23251 static void __Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject *gen, PyObject *value, CYTHON_UNUSED
int closing) {
23252 #ifdef __Pyx_Coroutine_USED 23253 if (!closing && __Pyx_Coroutine_CheckExact(gen)) {
23254 PyErr_SetString(PyExc_RuntimeError,
"cannot reuse already awaited coroutine");
23258 #ifdef __Pyx_AsyncGen_USED 23259 if (__Pyx_AsyncGen_CheckExact(gen))
23260 PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration);
23263 PyErr_SetNone(PyExc_StopIteration);
23267 PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *
self, PyObject *value,
int closing) {
23268 __Pyx_PyThreadState_declare
23269 PyThreadState *tstate;
23271 assert(!self->is_running);
23272 if (unlikely(self->resume_label == 0)) {
23273 if (unlikely(value && value != Py_None)) {
23274 return __Pyx_Coroutine_NotStartedError((PyObject*)
self);
23277 if (unlikely(self->resume_label == -1)) {
23278 return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)
self, value, closing);
23280 #if CYTHON_FAST_THREAD_STATE 23281 __Pyx_PyThreadState_assign
23282 tstate = __pyx_tstate;
23284 tstate = __Pyx_PyThreadState_Current;
23286 if (self->exc_type) {
23287 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON 23289 if (self->exc_traceback) {
23290 PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
23291 PyFrameObject *f = tb->tb_frame;
23292 Py_XINCREF(tstate->frame);
23293 assert(f->f_back == NULL);
23294 f->f_back = tstate->frame;
23297 __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value,
23298 &self->exc_traceback);
23300 __Pyx_Coroutine_ExceptionClear(
self);
23301 __Pyx_ExceptionSave(&self->exc_type, &self->exc_value, &self->exc_traceback);
23303 self->is_running = 1;
23304 retval =
self->body((PyObject *)
self, tstate, value);
23305 self->is_running = 0;
23308 static CYTHON_INLINE
void __Pyx_Coroutine_ResetFrameBackpointer(__pyx_CoroutineObject *
self) {
23309 if (likely(self->exc_traceback)) {
23310 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON 23312 PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
23313 PyFrameObject *f = tb->tb_frame;
23314 Py_CLEAR(f->f_back);
23318 static CYTHON_INLINE
23319 PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *retval) {
23320 if (unlikely(!retval)) {
23321 __Pyx_PyThreadState_declare
23322 __Pyx_PyThreadState_assign
23323 if (!__Pyx_PyErr_Occurred()) {
23324 PyObject *exc = PyExc_StopIteration;
23325 #ifdef __Pyx_AsyncGen_USED 23326 if (__Pyx_AsyncGen_CheckExact(gen))
23327 exc = __Pyx_PyExc_StopAsyncIteration;
23329 __Pyx_PyErr_SetNone(exc);
23334 static CYTHON_INLINE
23335 PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
23337 PyObject *val = NULL;
23338 __Pyx_Coroutine_Undelegate(gen);
23339 __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
23340 ret = __Pyx_Coroutine_SendEx(gen, val, 0);
23344 static PyObject *__Pyx_Coroutine_Send(PyObject *
self, PyObject *value) {
23346 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*)
self;
23347 PyObject *yf = gen->yieldfrom;
23348 if (unlikely(gen->is_running))
23349 return __Pyx_Coroutine_AlreadyRunningError(gen);
23352 gen->is_running = 1;
23353 #ifdef __Pyx_Generator_USED 23354 if (__Pyx_Generator_CheckExact(yf)) {
23355 ret = __Pyx_Coroutine_Send(yf, value);
23358 #ifdef __Pyx_Coroutine_USED 23359 if (__Pyx_Coroutine_CheckExact(yf)) {
23360 ret = __Pyx_Coroutine_Send(yf, value);
23363 #ifdef __Pyx_AsyncGen_USED 23364 if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
23365 ret = __Pyx_async_gen_asend_send(yf, value);
23368 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) 23369 if (PyGen_CheckExact(yf)) {
23370 ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
23373 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) 23374 if (PyCoro_CheckExact(yf)) {
23375 ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
23379 if (value == Py_None)
23380 ret = Py_TYPE(yf)->tp_iternext(yf);
23382 ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
23384 gen->is_running = 0;
23388 retval = __Pyx_Coroutine_FinishDelegation(gen);
23390 retval = __Pyx_Coroutine_SendEx(gen, value, 0);
23392 return __Pyx_Coroutine_MethodReturn(
self, retval);
23394 static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
23395 PyObject *retval = NULL;
23397 #ifdef __Pyx_Generator_USED 23398 if (__Pyx_Generator_CheckExact(yf)) {
23399 retval = __Pyx_Coroutine_Close(yf);
23404 #ifdef __Pyx_Coroutine_USED 23405 if (__Pyx_Coroutine_CheckExact(yf)) {
23406 retval = __Pyx_Coroutine_Close(yf);
23410 if (__Pyx_CoroutineAwait_CheckExact(yf)) {
23411 retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf);
23416 #ifdef __Pyx_AsyncGen_USED 23417 if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
23418 retval = __Pyx_async_gen_asend_close(yf, NULL);
23420 if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
23421 retval = __Pyx_async_gen_athrow_close(yf, NULL);
23426 gen->is_running = 1;
23427 meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close);
23428 if (unlikely(!meth)) {
23429 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
23430 PyErr_WriteUnraisable(yf);
23434 retval = PyObject_CallFunction(meth, NULL);
23439 gen->is_running = 0;
23441 Py_XDECREF(retval);
23444 static PyObject *__Pyx_Generator_Next(PyObject *
self) {
23445 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*)
self;
23446 PyObject *yf = gen->yieldfrom;
23447 if (unlikely(gen->is_running))
23448 return __Pyx_Coroutine_AlreadyRunningError(gen);
23451 gen->is_running = 1;
23452 #ifdef __Pyx_Generator_USED 23453 if (__Pyx_Generator_CheckExact(yf)) {
23454 ret = __Pyx_Generator_Next(yf);
23457 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) 23458 if (PyGen_CheckExact(yf)) {
23459 ret = _PyGen_Send((PyGenObject*)yf, NULL);
23462 ret = Py_TYPE(yf)->tp_iternext(yf);
23463 gen->is_running = 0;
23467 return __Pyx_Coroutine_FinishDelegation(gen);
23469 return __Pyx_Coroutine_SendEx(gen, Py_None, 0);
23471 static PyObject *__Pyx_Coroutine_Close(PyObject *
self) {
23472 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
23473 PyObject *retval, *raised_exception;
23474 PyObject *yf = gen->yieldfrom;
23476 if (unlikely(gen->is_running))
23477 return __Pyx_Coroutine_AlreadyRunningError(gen);
23480 err = __Pyx_Coroutine_CloseIter(gen, yf);
23481 __Pyx_Coroutine_Undelegate(gen);
23485 PyErr_SetNone(PyExc_GeneratorExit);
23486 retval = __Pyx_Coroutine_SendEx(gen, NULL, 1);
23487 if (unlikely(retval)) {
23491 #ifdef __Pyx_Coroutine_USED 23492 }
else if (__Pyx_Coroutine_CheckExact(
self)) {
23493 msg =
"coroutine ignored GeneratorExit";
23495 #ifdef __Pyx_AsyncGen_USED 23496 }
else if (__Pyx_AsyncGen_CheckExact(
self)) {
23497 #if PY_VERSION_HEX < 0x03060000 23498 msg =
"async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)";
23500 msg =
"async generator ignored GeneratorExit";
23504 msg =
"generator ignored GeneratorExit";
23506 PyErr_SetString(PyExc_RuntimeError, msg);
23509 raised_exception = PyErr_Occurred();
23510 if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) {
23511 if (raised_exception) PyErr_Clear();
23512 Py_INCREF(Py_None);
23517 static PyObject *__Pyx__Coroutine_Throw(PyObject *
self, PyObject *typ, PyObject *val, PyObject *tb,
23518 PyObject *args,
int close_on_genexit) {
23519 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
23520 PyObject *yf = gen->yieldfrom;
23521 if (unlikely(gen->is_running))
23522 return __Pyx_Coroutine_AlreadyRunningError(gen);
23526 if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
23527 int err = __Pyx_Coroutine_CloseIter(gen, yf);
23529 __Pyx_Coroutine_Undelegate(gen);
23531 return __Pyx_Coroutine_MethodReturn(
self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
23534 gen->is_running = 1;
23536 #ifdef __Pyx_Generator_USED
23537 || __Pyx_Generator_CheckExact(yf)
23539 #ifdef __Pyx_Coroutine_USED
23540 || __Pyx_Coroutine_CheckExact(yf)
23543 ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
23544 #ifdef __Pyx_Coroutine_USED 23545 }
else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
23546 ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
23549 PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw);
23550 if (unlikely(!meth)) {
23552 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
23553 gen->is_running = 0;
23557 __Pyx_Coroutine_Undelegate(gen);
23558 gen->is_running = 0;
23561 if (likely(args)) {
23562 ret = PyObject_CallObject(meth, args);
23564 ret = PyObject_CallFunctionObjArgs(meth, typ, val, tb, NULL);
23568 gen->is_running = 0;
23571 ret = __Pyx_Coroutine_FinishDelegation(gen);
23573 return __Pyx_Coroutine_MethodReturn(
self, ret);
23576 __Pyx_Raise(typ, val, tb, NULL);
23577 return __Pyx_Coroutine_MethodReturn(
self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
23579 static PyObject *__Pyx_Coroutine_Throw(PyObject *
self, PyObject *args) {
23581 PyObject *val = NULL;
23582 PyObject *tb = NULL;
23583 if (!PyArg_UnpackTuple(args, (
char *)
"throw", 1, 3, &typ, &val, &tb))
23585 return __Pyx__Coroutine_Throw(
self, typ, val, tb, args, 1);
23587 static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit,
void *arg) {
23588 Py_VISIT(gen->closure);
23589 Py_VISIT(gen->classobj);
23590 Py_VISIT(gen->yieldfrom);
23591 Py_VISIT(gen->exc_type);
23592 Py_VISIT(gen->exc_value);
23593 Py_VISIT(gen->exc_traceback);
23596 static int __Pyx_Coroutine_clear(PyObject *
self) {
23597 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
23598 Py_CLEAR(gen->closure);
23599 Py_CLEAR(gen->classobj);
23600 Py_CLEAR(gen->yieldfrom);
23601 Py_CLEAR(gen->exc_type);
23602 Py_CLEAR(gen->exc_value);
23603 Py_CLEAR(gen->exc_traceback);
23604 #ifdef __Pyx_AsyncGen_USED 23605 if (__Pyx_AsyncGen_CheckExact(
self)) {
23606 Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
23609 Py_CLEAR(gen->gi_name);
23610 Py_CLEAR(gen->gi_qualname);
23611 Py_CLEAR(gen->gi_modulename);
23614 static void __Pyx_Coroutine_dealloc(PyObject *
self) {
23615 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
23616 PyObject_GC_UnTrack(gen);
23617 if (gen->gi_weakreflist != NULL)
23618 PyObject_ClearWeakRefs(
self);
23619 if (gen->resume_label >= 0) {
23620 PyObject_GC_Track(
self);
23621 #if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE 23622 if (PyObject_CallFinalizerFromDealloc(
self))
23624 Py_TYPE(gen)->tp_del(
self);
23625 if (self->ob_refcnt > 0)
23630 PyObject_GC_UnTrack(
self);
23632 #ifdef __Pyx_AsyncGen_USED 23633 if (__Pyx_AsyncGen_CheckExact(
self)) {
23637 Py_CLEAR(((__pyx_PyAsyncGenObject*)
self)->ag_finalizer);
23640 __Pyx_Coroutine_clear(
self);
23641 PyObject_GC_Del(gen);
23643 static void __Pyx_Coroutine_del(PyObject *
self) {
23644 PyObject *error_type, *error_value, *error_traceback;
23645 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
23646 __Pyx_PyThreadState_declare
23647 if (gen->resume_label < 0) {
23650 #if !CYTHON_USE_TP_FINALIZE 23651 assert(self->ob_refcnt == 0);
23652 self->ob_refcnt = 1;
23654 __Pyx_PyThreadState_assign
23655 __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
23656 #ifdef __Pyx_AsyncGen_USED 23657 if (__Pyx_AsyncGen_CheckExact(
self)) {
23658 __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)
self;
23659 PyObject *finalizer = agen->ag_finalizer;
23660 if (finalizer && !agen->ag_closed) {
23661 PyObject *res = __Pyx_PyObject_CallOneArg(finalizer,
self);
23662 if (unlikely(!res)) {
23663 PyErr_WriteUnraisable(
self);
23667 __Pyx_ErrRestore(error_type, error_value, error_traceback);
23672 if (unlikely(gen->resume_label == 0 && !error_value)) {
23673 #ifdef __Pyx_Coroutine_USED 23674 #ifdef __Pyx_Generator_USED 23675 if (!__Pyx_Generator_CheckExact(
self))
23678 PyObject_GC_UnTrack(
self);
23679 #if PY_MAJOR_VERSION >= 3 || defined(PyErr_WarnFormat) 23680 if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1,
"coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
23681 PyErr_WriteUnraisable(
self);
23685 #if CYTHON_COMPILING_IN_PYPY 23687 cmsg = (
char*)
"coroutine was never awaited";
23690 PyObject *qualname;
23691 qualname = gen->gi_qualname;
23692 cname = PyString_AS_STRING(qualname);
23693 msg = PyString_FromFormat(
"coroutine '%.50s' was never awaited", cname);
23694 if (unlikely(!msg)) {
23696 cmsg = (
char*)
"coroutine was never awaited";
23698 cmsg = PyString_AS_STRING(msg);
23701 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0))
23702 PyErr_WriteUnraisable(
self);
23705 PyObject_GC_Track(
self);
23709 PyObject *res = __Pyx_Coroutine_Close(
self);
23710 if (unlikely(!res)) {
23711 if (PyErr_Occurred())
23712 PyErr_WriteUnraisable(
self);
23717 __Pyx_ErrRestore(error_type, error_value, error_traceback);
23718 #if !CYTHON_USE_TP_FINALIZE 23719 assert(self->ob_refcnt > 0);
23720 if (--self->ob_refcnt == 0) {
23724 Py_ssize_t refcnt =
self->ob_refcnt;
23725 _Py_NewReference(
self);
23726 self->ob_refcnt = refcnt;
23728 #if CYTHON_COMPILING_IN_CPYTHON 23729 assert(PyType_IS_GC(self->ob_type) &&
23730 _Py_AS_GC(
self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
23733 #ifdef COUNT_ALLOCS 23734 --Py_TYPE(
self)->tp_frees;
23735 --Py_TYPE(
self)->tp_allocs;
23740 __Pyx_Coroutine_get_name(__pyx_CoroutineObject *
self)
23742 PyObject *name =
self->gi_name;
23743 if (unlikely(!name)) name = Py_None;
23748 __Pyx_Coroutine_set_name(__pyx_CoroutineObject *
self, PyObject *value)
23751 #if PY_MAJOR_VERSION >= 3 23752 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
23754 if (unlikely(value == NULL || !PyString_Check(value))) {
23756 PyErr_SetString(PyExc_TypeError,
23757 "__name__ must be set to a string object");
23760 tmp =
self->gi_name;
23762 self->gi_name = value;
23767 __Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *
self)
23769 PyObject *name =
self->gi_qualname;
23770 if (unlikely(!name)) name = Py_None;
23775 __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *
self, PyObject *value)
23778 #if PY_MAJOR_VERSION >= 3 23779 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
23781 if (unlikely(value == NULL || !PyString_Check(value))) {
23783 PyErr_SetString(PyExc_TypeError,
23784 "__qualname__ must be set to a string object");
23787 tmp =
self->gi_qualname;
23789 self->gi_qualname = value;
23793 static __pyx_CoroutineObject *__Pyx__Coroutine_New(
23794 PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *closure,
23795 PyObject *name, PyObject *qualname, PyObject *module_name) {
23796 __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
23797 if (unlikely(!gen))
23799 return __Pyx__Coroutine_NewInit(gen, body, closure, name, qualname, module_name);
23801 static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
23802 __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *closure,
23803 PyObject *name, PyObject *qualname, PyObject *module_name) {
23805 gen->closure = closure;
23806 Py_XINCREF(closure);
23807 gen->is_running = 0;
23808 gen->resume_label = 0;
23809 gen->classobj = NULL;
23810 gen->yieldfrom = NULL;
23811 gen->exc_type = NULL;
23812 gen->exc_value = NULL;
23813 gen->exc_traceback = NULL;
23814 gen->gi_weakreflist = NULL;
23815 Py_XINCREF(qualname);
23816 gen->gi_qualname = qualname;
23818 gen->gi_name = name;
23819 Py_XINCREF(module_name);
23820 gen->gi_modulename = module_name;
23821 PyObject_GC_Track(gen);
23826 static PyObject* __Pyx_Coroutine_patch_module(PyObject* module,
const char* py_code) {
23827 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) 23829 PyObject *globals, *result_obj;
23830 globals = PyDict_New();
if (unlikely(!globals))
goto ignore;
23831 result = PyDict_SetItemString(globals,
"_cython_coroutine_type",
23832 #ifdef __Pyx_Coroutine_USED
23833 (PyObject*)__pyx_CoroutineType);
23837 if (unlikely(result < 0))
goto ignore;
23838 result = PyDict_SetItemString(globals,
"_cython_generator_type",
23839 #ifdef __Pyx_Generator_USED
23840 (PyObject*)__pyx_GeneratorType);
23844 if (unlikely(result < 0))
goto ignore;
23845 if (unlikely(PyDict_SetItemString(globals,
"_module", module) < 0))
goto ignore;
23846 if (unlikely(PyDict_SetItemString(globals,
"__builtins__", __pyx_b) < 0))
goto ignore;
23847 result_obj = PyRun_String(py_code, Py_file_input, globals, globals);
23848 if (unlikely(!result_obj))
goto ignore;
23849 Py_DECREF(result_obj);
23850 Py_DECREF(globals);
23853 Py_XDECREF(globals);
23854 PyErr_WriteUnraisable(module);
23855 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
"Cython module failed to patch module with custom type", 1) < 0)) {
23866 #ifndef CYTHON_REGISTER_ABCS 23867 #define CYTHON_REGISTER_ABCS 1 23869 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) 23870 static PyObject* __Pyx_patch_abc_module(PyObject *module);
23871 static PyObject* __Pyx_patch_abc_module(PyObject *module) {
23872 module = __Pyx_Coroutine_patch_module(
23874 "if _cython_generator_type is not None:\n" 23875 " try: Generator = _module.Generator\n" 23876 " except AttributeError: pass\n" 23877 " else: Generator.register(_cython_generator_type)\n" 23878 "if _cython_coroutine_type is not None:\n" 23879 " try: Coroutine = _module.Coroutine\n" 23880 " except AttributeError: pass\n" 23881 " else: Coroutine.register(_cython_coroutine_type)\n" 23886 static int __Pyx_patch_abc(
void) {
23887 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) 23888 static int abc_patched = 0;
23889 if (CYTHON_REGISTER_ABCS && !abc_patched) {
23891 module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ?
"collections.abc" :
"collections");
23893 PyErr_WriteUnraisable(NULL);
23894 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
23895 ((PY_MAJOR_VERSION >= 3) ?
23896 "Cython module failed to register with collections.abc module" :
23897 "Cython module failed to register with collections module"), 1) < 0)) {
23901 module = __Pyx_patch_abc_module(module);
23903 if (unlikely(!module))
23907 module = PyImport_ImportModule(
"backports_abc");
23909 module = __Pyx_patch_abc_module(module);
23910 Py_XDECREF(module);
23917 if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL);
23923 static PyMethodDef __pyx_Generator_methods[] = {
23924 {
"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
23925 (
char*) PyDoc_STR(
"send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
23926 {
"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
23927 (
char*) PyDoc_STR(
"throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
23928 {
"close", (PyCFunction) __Pyx_Coroutine_Close, METH_NOARGS,
23929 (
char*) PyDoc_STR(
"close() -> raise GeneratorExit inside generator.")},
23932 static PyMemberDef __pyx_Generator_memberlist[] = {
23933 {(
char *)
"gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL},
23934 {(
char*)
"gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
23935 (
char*) PyDoc_STR(
"object being iterated by 'yield from', or None")},
23938 static PyGetSetDef __pyx_Generator_getsets[] = {
23939 {(
char *)
"__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
23940 (
char*) PyDoc_STR(
"name of the generator"), 0},
23941 {(
char *)
"__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
23942 (
char*) PyDoc_STR(
"qualified name of the generator"), 0},
23945 static PyTypeObject __pyx_GeneratorType_type = {
23946 PyVarObject_HEAD_INIT(0, 0)
23948 sizeof(__pyx_CoroutineObject),
23950 (destructor) __Pyx_Coroutine_dealloc,
23965 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
23967 (traverseproc) __Pyx_Coroutine_traverse,
23970 offsetof(__pyx_CoroutineObject, gi_weakreflist),
23972 (iternextfunc) __Pyx_Generator_Next,
23973 __pyx_Generator_methods,
23974 __pyx_Generator_memberlist,
23975 __pyx_Generator_getsets,
23991 #
if CYTHON_USE_TP_FINALIZE
23994 __Pyx_Coroutine_del,
23997 #
if CYTHON_USE_TP_FINALIZE
23998 __Pyx_Coroutine_del,
23999 #elif PY_VERSION_HEX >= 0x030400a1
24003 static int __pyx_Generator_init(
void) {
24004 __pyx_GeneratorType_type.tp_getattro = PyObject_GenericGetAttr;
24005 __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
24006 __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
24007 if (unlikely(!__pyx_GeneratorType)) {
24014 static int __Pyx_check_binary_version(
void) {
24015 char ctversion[4], rtversion[4];
24016 PyOS_snprintf(ctversion, 4,
"%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
24017 PyOS_snprintf(rtversion, 4,
"%s", Py_GetVersion());
24018 if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
24020 PyOS_snprintf(message,
sizeof(message),
24021 "compiletime version %s of module '%.100s' " 24022 "does not match runtime version %s",
24023 ctversion, __Pyx_MODULE_NAME, rtversion);
24024 return PyErr_WarnEx(NULL, message, 1);
24030 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
24032 #if PY_MAJOR_VERSION < 3 24033 if (t->is_unicode) {
24034 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
24035 }
else if (t->intern) {
24036 *t->p = PyString_InternFromString(t->s);
24038 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
24041 if (t->is_unicode | t->is_str) {
24043 *t->p = PyUnicode_InternFromString(t->s);
24044 }
else if (t->encoding) {
24045 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
24047 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
24050 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
24055 if (PyObject_Hash(*t->p) == -1)
24062 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
24063 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
24065 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
24067 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
24069 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 24070 #if !CYTHON_PEP393_ENABLED 24071 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
24073 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
24074 if (!defenc)
return NULL;
24075 defenc_c = PyBytes_AS_STRING(defenc);
24076 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 24078 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
24080 for (c = defenc_c; c < end; c++) {
24081 if ((
unsigned char) (*c) >= 128) {
24082 PyUnicode_AsASCIIString(o);
24088 *length = PyBytes_GET_SIZE(defenc);
24092 static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
24093 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
24094 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 24095 if (likely(PyUnicode_IS_ASCII(o))) {
24096 *length = PyUnicode_GET_LENGTH(o);
24097 return PyUnicode_AsUTF8(o);
24099 PyUnicode_AsASCIIString(o);
24103 return PyUnicode_AsUTF8AndSize(o, length);
24108 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
24109 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 24111 #
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
24112 __Pyx_sys_getdefaultencoding_not_ascii &&
24114 PyUnicode_Check(o)) {
24115 return __Pyx_PyUnicode_AsStringAndSize(o, length);
24118 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) 24119 if (PyByteArray_Check(o)) {
24120 *length = PyByteArray_GET_SIZE(o);
24121 return PyByteArray_AS_STRING(o);
24126 int r = PyBytes_AsStringAndSize(o, &result, length);
24127 if (unlikely(r < 0)) {
24134 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
24135 int is_true = x == Py_True;
24136 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
24137 else return PyObject_IsTrue(x);
24139 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result,
const char* type_name) {
24140 #if PY_MAJOR_VERSION >= 3 24141 if (PyLong_Check(result)) {
24142 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
24143 "__int__ returned non-int (type %.200s). " 24144 "The ability to return an instance of a strict subclass of int " 24145 "is deprecated, and may be removed in a future version of Python.",
24146 Py_TYPE(result)->tp_name)) {
24153 PyErr_Format(PyExc_TypeError,
24154 "__%.4s__ returned non-%.4s (type %.200s)",
24155 type_name, type_name, Py_TYPE(result)->tp_name);
24159 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
24160 #if CYTHON_USE_TYPE_SLOTS 24161 PyNumberMethods *m;
24163 const char *name = NULL;
24164 PyObject *res = NULL;
24165 #if PY_MAJOR_VERSION < 3 24166 if (likely(PyInt_Check(x) || PyLong_Check(x)))
24168 if (likely(PyLong_Check(x)))
24170 return __Pyx_NewRef(x);
24171 #if CYTHON_USE_TYPE_SLOTS 24172 m = Py_TYPE(x)->tp_as_number;
24173 #if PY_MAJOR_VERSION < 3 24174 if (m && m->nb_int) {
24176 res = m->nb_int(x);
24178 else if (m && m->nb_long) {
24180 res = m->nb_long(x);
24183 if (likely(m && m->nb_int)) {
24185 res = m->nb_int(x);
24189 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
24190 res = PyNumber_Int(x);
24194 #if PY_MAJOR_VERSION < 3 24195 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
24197 if (unlikely(!PyLong_CheckExact(res))) {
24199 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
24202 else if (!PyErr_Occurred()) {
24203 PyErr_SetString(PyExc_TypeError,
24204 "an integer is required");
24208 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
24211 #if PY_MAJOR_VERSION < 3 24212 if (likely(PyInt_CheckExact(b))) {
24213 if (
sizeof(Py_ssize_t) >=
sizeof(
long))
24214 return PyInt_AS_LONG(b);
24216 return PyInt_AsSsize_t(x);
24219 if (likely(PyLong_CheckExact(b))) {
24220 #if CYTHON_USE_PYLONG_INTERNALS 24221 const digit* digits = ((PyLongObject*)b)->ob_digit;
24222 const Py_ssize_t size = Py_SIZE(b);
24223 if (likely(__Pyx_sst_abs(size) <= 1)) {
24224 ival = likely(size) ? digits[0] : 0;
24225 if (size == -1) ival = -ival;
24230 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
24231 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
24235 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
24236 return -(Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
24240 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
24241 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
24245 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
24246 return -(Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
24250 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
24251 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]));
24255 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
24256 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]));
24262 return PyLong_AsSsize_t(b);
24264 x = PyNumber_Index(b);
24266 ival = PyInt_AsSsize_t(x);
24270 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
24271 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)].