57 #define PY_SSIZE_T_CLEAN 60 #error Python headers needed to compile C extensions, please install development version of Python. 61 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) 62 #error Cython requires Python 2.6+ or Python 3.3+. 64 #define CYTHON_ABI "0_27_3" 65 #define CYTHON_FUTURE_DIVISION 0 68 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) 70 #if !defined(WIN32) && !defined(MS_WINDOWS) 82 #define DL_IMPORT(t) t 85 #define DL_EXPORT(t) t 88 #ifndef HAVE_LONG_LONG 89 #if PY_VERSION_HEX >= 0x02070000 90 #define HAVE_LONG_LONG 94 #define PY_LONG_LONG LONG_LONG 97 #define Py_HUGE_VAL HUGE_VAL 100 #define CYTHON_COMPILING_IN_PYPY 1 101 #define CYTHON_COMPILING_IN_PYSTON 0 102 #define CYTHON_COMPILING_IN_CPYTHON 0 103 #undef CYTHON_USE_TYPE_SLOTS 104 #define CYTHON_USE_TYPE_SLOTS 0 105 #undef CYTHON_USE_PYTYPE_LOOKUP 106 #define CYTHON_USE_PYTYPE_LOOKUP 0 107 #if PY_VERSION_HEX < 0x03050000 108 #undef CYTHON_USE_ASYNC_SLOTS 109 #define CYTHON_USE_ASYNC_SLOTS 0 110 #elif !defined(CYTHON_USE_ASYNC_SLOTS) 111 #define CYTHON_USE_ASYNC_SLOTS 1 113 #undef CYTHON_USE_PYLIST_INTERNALS 114 #define CYTHON_USE_PYLIST_INTERNALS 0 115 #undef CYTHON_USE_UNICODE_INTERNALS 116 #define CYTHON_USE_UNICODE_INTERNALS 0 117 #undef CYTHON_USE_UNICODE_WRITER 118 #define CYTHON_USE_UNICODE_WRITER 0 119 #undef CYTHON_USE_PYLONG_INTERNALS 120 #define CYTHON_USE_PYLONG_INTERNALS 0 121 #undef CYTHON_AVOID_BORROWED_REFS 122 #define CYTHON_AVOID_BORROWED_REFS 1 123 #undef CYTHON_ASSUME_SAFE_MACROS 124 #define CYTHON_ASSUME_SAFE_MACROS 0 125 #undef CYTHON_UNPACK_METHODS 126 #define CYTHON_UNPACK_METHODS 0 127 #undef CYTHON_FAST_THREAD_STATE 128 #define CYTHON_FAST_THREAD_STATE 0 129 #undef CYTHON_FAST_PYCALL 130 #define CYTHON_FAST_PYCALL 0 131 #undef CYTHON_PEP489_MULTI_PHASE_INIT 132 #define CYTHON_PEP489_MULTI_PHASE_INIT 0 133 #undef CYTHON_USE_TP_FINALIZE 134 #define CYTHON_USE_TP_FINALIZE 0 135 #elif defined(PYSTON_VERSION) 136 #define CYTHON_COMPILING_IN_PYPY 0 137 #define CYTHON_COMPILING_IN_PYSTON 1 138 #define CYTHON_COMPILING_IN_CPYTHON 0 139 #ifndef CYTHON_USE_TYPE_SLOTS 140 #define CYTHON_USE_TYPE_SLOTS 1 142 #undef CYTHON_USE_PYTYPE_LOOKUP 143 #define CYTHON_USE_PYTYPE_LOOKUP 0 144 #undef CYTHON_USE_ASYNC_SLOTS 145 #define CYTHON_USE_ASYNC_SLOTS 0 146 #undef CYTHON_USE_PYLIST_INTERNALS 147 #define CYTHON_USE_PYLIST_INTERNALS 0 148 #ifndef CYTHON_USE_UNICODE_INTERNALS 149 #define CYTHON_USE_UNICODE_INTERNALS 1 151 #undef CYTHON_USE_UNICODE_WRITER 152 #define CYTHON_USE_UNICODE_WRITER 0 153 #undef CYTHON_USE_PYLONG_INTERNALS 154 #define CYTHON_USE_PYLONG_INTERNALS 0 155 #ifndef CYTHON_AVOID_BORROWED_REFS 156 #define CYTHON_AVOID_BORROWED_REFS 0 158 #ifndef CYTHON_ASSUME_SAFE_MACROS 159 #define CYTHON_ASSUME_SAFE_MACROS 1 161 #ifndef CYTHON_UNPACK_METHODS 162 #define CYTHON_UNPACK_METHODS 1 164 #undef CYTHON_FAST_THREAD_STATE 165 #define CYTHON_FAST_THREAD_STATE 0 166 #undef CYTHON_FAST_PYCALL 167 #define CYTHON_FAST_PYCALL 0 168 #undef CYTHON_PEP489_MULTI_PHASE_INIT 169 #define CYTHON_PEP489_MULTI_PHASE_INIT 0 170 #undef CYTHON_USE_TP_FINALIZE 171 #define CYTHON_USE_TP_FINALIZE 0 173 #define CYTHON_COMPILING_IN_PYPY 0 174 #define CYTHON_COMPILING_IN_PYSTON 0 175 #define CYTHON_COMPILING_IN_CPYTHON 1 176 #ifndef CYTHON_USE_TYPE_SLOTS 177 #define CYTHON_USE_TYPE_SLOTS 1 179 #if PY_VERSION_HEX < 0x02070000 180 #undef CYTHON_USE_PYTYPE_LOOKUP 181 #define CYTHON_USE_PYTYPE_LOOKUP 0 182 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) 183 #define CYTHON_USE_PYTYPE_LOOKUP 1 185 #if PY_MAJOR_VERSION < 3 186 #undef CYTHON_USE_ASYNC_SLOTS 187 #define CYTHON_USE_ASYNC_SLOTS 0 188 #elif !defined(CYTHON_USE_ASYNC_SLOTS) 189 #define CYTHON_USE_ASYNC_SLOTS 1 191 #if PY_VERSION_HEX < 0x02070000 192 #undef CYTHON_USE_PYLONG_INTERNALS 193 #define CYTHON_USE_PYLONG_INTERNALS 0 194 #elif !defined(CYTHON_USE_PYLONG_INTERNALS) 195 #define CYTHON_USE_PYLONG_INTERNALS 1 197 #ifndef CYTHON_USE_PYLIST_INTERNALS 198 #define CYTHON_USE_PYLIST_INTERNALS 1 200 #ifndef CYTHON_USE_UNICODE_INTERNALS 201 #define CYTHON_USE_UNICODE_INTERNALS 1 203 #if PY_VERSION_HEX < 0x030300F0 204 #undef CYTHON_USE_UNICODE_WRITER 205 #define CYTHON_USE_UNICODE_WRITER 0 206 #elif !defined(CYTHON_USE_UNICODE_WRITER) 207 #define CYTHON_USE_UNICODE_WRITER 1 209 #ifndef CYTHON_AVOID_BORROWED_REFS 210 #define CYTHON_AVOID_BORROWED_REFS 0 212 #ifndef CYTHON_ASSUME_SAFE_MACROS 213 #define CYTHON_ASSUME_SAFE_MACROS 1 215 #ifndef CYTHON_UNPACK_METHODS 216 #define CYTHON_UNPACK_METHODS 1 218 #ifndef CYTHON_FAST_THREAD_STATE 219 #define CYTHON_FAST_THREAD_STATE 1 221 #ifndef CYTHON_FAST_PYCALL 222 #define CYTHON_FAST_PYCALL 1 224 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT 225 #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000) 227 #ifndef CYTHON_USE_TP_FINALIZE 228 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) 231 #if !defined(CYTHON_FAST_PYCCALL) 232 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) 234 #if CYTHON_USE_PYLONG_INTERNALS 235 #include "longintrepr.h" 240 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) 241 #define Py_OptimizeFlag 0 243 #define __PYX_BUILD_PY_SSIZE_T "n" 244 #define CYTHON_FORMAT_SSIZE_T "z" 245 #if PY_MAJOR_VERSION < 3 246 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" 247 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ 248 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) 249 #define __Pyx_DefaultClassType PyClass_Type 251 #define __Pyx_BUILTIN_MODULE_NAME "builtins" 252 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ 253 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) 254 #define __Pyx_DefaultClassType PyType_Type 256 #ifndef Py_TPFLAGS_CHECKTYPES 257 #define Py_TPFLAGS_CHECKTYPES 0 259 #ifndef Py_TPFLAGS_HAVE_INDEX 260 #define Py_TPFLAGS_HAVE_INDEX 0 262 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER 263 #define Py_TPFLAGS_HAVE_NEWBUFFER 0 265 #ifndef Py_TPFLAGS_HAVE_FINALIZE 266 #define Py_TPFLAGS_HAVE_FINALIZE 0 268 #if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) 269 #ifndef METH_FASTCALL 270 #define METH_FASTCALL 0x80 272 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *
self, PyObject **args, Py_ssize_t nargs);
273 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *
self, PyObject **args,
274 Py_ssize_t nargs, PyObject *kwnames);
276 #define __Pyx_PyCFunctionFast _PyCFunctionFast 277 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords 279 #if CYTHON_FAST_PYCCALL 280 #define __Pyx_PyFastCFunction_Check(func)\ 281 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS))))) 283 #define __Pyx_PyFastCFunction_Check(func) 0 285 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 286 #define __Pyx_PyThreadState_Current PyThreadState_GET() 287 #elif PY_VERSION_HEX >= 0x03060000 288 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() 289 #elif PY_VERSION_HEX >= 0x03000000 290 #define __Pyx_PyThreadState_Current PyThreadState_GET() 292 #define __Pyx_PyThreadState_Current _PyThreadState_Current 294 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) 295 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) 297 #define __Pyx_PyDict_NewPresized(n) PyDict_New() 299 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION 300 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) 301 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) 303 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) 304 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) 306 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) 307 #define CYTHON_PEP393_ENABLED 1 308 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 309 0 : _PyUnicode_Ready((PyObject *)(op))) 310 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) 311 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) 312 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) 313 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) 314 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) 315 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) 316 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) 317 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) 319 #define CYTHON_PEP393_ENABLED 0 320 #define PyUnicode_1BYTE_KIND 1 321 #define PyUnicode_2BYTE_KIND 2 322 #define PyUnicode_4BYTE_KIND 4 323 #define __Pyx_PyUnicode_READY(op) (0) 324 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) 325 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) 326 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) 327 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) 328 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) 329 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) 330 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) 331 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) 333 #if CYTHON_COMPILING_IN_PYPY 334 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) 335 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) 337 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) 338 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ 339 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) 341 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) 342 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) 344 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) 345 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) 347 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) 348 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) 350 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) 351 #define PyObject_Malloc(s) PyMem_Malloc(s) 352 #define PyObject_Free(p) PyMem_Free(p) 353 #define PyObject_Realloc(p) PyMem_Realloc(p) 355 #if CYTHON_COMPILING_IN_PYSTON 356 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) 357 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) 359 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) 360 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) 362 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) 363 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) 364 #if PY_MAJOR_VERSION >= 3 365 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) 367 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) 369 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) 370 #define PyObject_ASCII(o) PyObject_Repr(o) 372 #if PY_MAJOR_VERSION >= 3 373 #define PyBaseString_Type PyUnicode_Type 374 #define PyStringObject PyUnicodeObject 375 #define PyString_Type PyUnicode_Type 376 #define PyString_Check PyUnicode_Check 377 #define PyString_CheckExact PyUnicode_CheckExact 379 #if PY_MAJOR_VERSION >= 3 380 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) 381 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) 383 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) 384 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) 386 #ifndef PySet_CheckExact 387 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) 389 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) 390 #if PY_MAJOR_VERSION >= 3 391 #define PyIntObject PyLongObject 392 #define PyInt_Type PyLong_Type 393 #define PyInt_Check(op) PyLong_Check(op) 394 #define PyInt_CheckExact(op) PyLong_CheckExact(op) 395 #define PyInt_FromString PyLong_FromString 396 #define PyInt_FromUnicode PyLong_FromUnicode 397 #define PyInt_FromLong PyLong_FromLong 398 #define PyInt_FromSize_t PyLong_FromSize_t 399 #define PyInt_FromSsize_t PyLong_FromSsize_t 400 #define PyInt_AsLong PyLong_AsLong 401 #define PyInt_AS_LONG PyLong_AS_LONG 402 #define PyInt_AsSsize_t PyLong_AsSsize_t 403 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask 404 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask 405 #define PyNumber_Int PyNumber_Long 407 #if PY_MAJOR_VERSION >= 3 408 #define PyBoolObject PyLongObject 410 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY 411 #ifndef PyUnicode_InternFromString 412 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) 415 #if PY_VERSION_HEX < 0x030200A4 416 typedef long Py_hash_t;
417 #define __Pyx_PyInt_FromHash_t PyInt_FromLong 418 #define __Pyx_PyInt_AsHash_t PyInt_AsLong 420 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t 421 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t 423 #if PY_MAJOR_VERSION >= 3 424 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) 426 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) 428 #ifndef __has_attribute 429 #define __has_attribute(x) 0 431 #ifndef __has_cpp_attribute 432 #define __has_cpp_attribute(x) 0 434 #if CYTHON_USE_ASYNC_SLOTS 435 #if PY_VERSION_HEX >= 0x030500B1 436 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods 437 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) 439 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) 442 #define __Pyx_PyType_AsAsync(obj) NULL 444 #ifndef __Pyx_PyAsyncMethodsStruct 449 } __Pyx_PyAsyncMethodsStruct;
451 #ifndef CYTHON_RESTRICT 452 #if defined(__GNUC__) 453 #define CYTHON_RESTRICT __restrict__ 454 #elif defined(_MSC_VER) && _MSC_VER >= 1400 455 #define CYTHON_RESTRICT __restrict 456 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 457 #define CYTHON_RESTRICT restrict 459 #define CYTHON_RESTRICT 462 #ifndef CYTHON_UNUSED 463 # if defined(__GNUC__) 464 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) 465 # define CYTHON_UNUSED __attribute__ ((__unused__)) 467 # define CYTHON_UNUSED 469 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) 470 # define CYTHON_UNUSED __attribute__ ((__unused__)) 472 # define CYTHON_UNUSED 475 #ifndef CYTHON_MAYBE_UNUSED_VAR 476 # if defined(__cplusplus) 477 template<
class T>
void CYTHON_MAYBE_UNUSED_VAR(
const T& ) { }
479 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) 482 #ifndef CYTHON_NCP_UNUSED 483 # if CYTHON_COMPILING_IN_CPYTHON 484 # define CYTHON_NCP_UNUSED 486 # define CYTHON_NCP_UNUSED CYTHON_UNUSED 489 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) 491 #ifndef _MSC_STDINT_H_ 493 typedef unsigned char uint8_t;
494 typedef unsigned int uint32_t;
496 typedef unsigned __int8 uint8_t;
497 typedef unsigned __int32 uint32_t;
503 #ifndef CYTHON_FALLTHROUGH 504 #if defined(__cplusplus) && __cplusplus >= 201103L 505 #if __has_cpp_attribute(fallthrough) 506 #define CYTHON_FALLTHROUGH [[fallthrough]] 507 #elif __has_cpp_attribute(clang::fallthrough) 508 #define CYTHON_FALLTHROUGH [[clang::fallthrough]] 509 #elif __has_cpp_attribute(gnu::fallthrough) 510 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] 513 #ifndef CYTHON_FALLTHROUGH 514 #if __has_attribute(fallthrough) 515 #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) 517 #define CYTHON_FALLTHROUGH 520 #if defined(__clang__ ) && defined(__apple_build_version__) 521 #if __apple_build_version__ < 7000000 522 #undef CYTHON_FALLTHROUGH 523 #define CYTHON_FALLTHROUGH 529 #error "Cython files generated with the C++ option must be compiled with a C++ compiler." 531 #ifndef CYTHON_INLINE 532 #if defined(__clang__) 533 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) 535 #define CYTHON_INLINE inline 539 void __Pyx_call_destructor(T& x) {
543 class __Pyx_FakeReference {
545 __Pyx_FakeReference() : ptr(NULL) { }
546 __Pyx_FakeReference(
const T& ref) : ptr(const_cast<T*>(&ref)) { }
547 T *operator->() {
return ptr; }
549 operator T&() {
return *ptr; }
550 template<
typename U>
bool operator ==(U other) {
return *ptr == other; }
551 template<
typename U>
bool operator !=(U other) {
return *ptr != other; }
556 #if defined(WIN32) || defined(MS_WINDOWS) 557 #define _USE_MATH_DEFINES 561 #define __PYX_NAN() ((float) NAN) 563 static CYTHON_INLINE
float __PYX_NAN() {
565 memset(&value, 0xFF,
sizeof(value));
569 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) 570 #define __Pyx_truncl trunc 572 #define __Pyx_truncl truncl 576 #define __PYX_ERR(f_index, lineno, Ln_error) \ 578 __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ 581 #ifndef __PYX_EXTERN_C 583 #define __PYX_EXTERN_C extern "C" 585 #define __PYX_EXTERN_C extern 589 #define __PYX_HAVE__PyClical 590 #define __PYX_HAVE_API__PyClical 601 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) 602 #define CYTHON_WITHOUT_ASSERTIONS 605 typedef struct {PyObject **p;
const char *s;
const Py_ssize_t n;
const char* encoding;
606 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
608 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 609 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 610 #define __PYX_DEFAULT_STRING_ENCODING "" 611 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString 612 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize 613 #define __Pyx_uchar_cast(c) ((unsigned char)c) 614 #define __Pyx_long_cast(x) ((long)x) 615 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ 616 (sizeof(type) < sizeof(Py_ssize_t)) ||\ 617 (sizeof(type) > sizeof(Py_ssize_t) &&\ 618 likely(v < (type)PY_SSIZE_T_MAX ||\ 619 v == (type)PY_SSIZE_T_MAX) &&\ 620 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ 621 v == (type)PY_SSIZE_T_MIN))) ||\ 622 (sizeof(type) == sizeof(Py_ssize_t) &&\ 623 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ 624 v == (type)PY_SSIZE_T_MAX))) ) 625 #if defined (__cplusplus) && __cplusplus >= 201103L 627 #define __Pyx_sst_abs(value) std::abs(value) 628 #elif SIZEOF_INT >= SIZEOF_SIZE_T 629 #define __Pyx_sst_abs(value) abs(value) 630 #elif SIZEOF_LONG >= SIZEOF_SIZE_T 631 #define __Pyx_sst_abs(value) labs(value) 632 #elif defined (_MSC_VER) 633 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) 634 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 635 #define __Pyx_sst_abs(value) llabs(value) 636 #elif defined (__GNUC__) 637 #define __Pyx_sst_abs(value) __builtin_llabs(value) 639 #define __Pyx_sst_abs(value) ((value<0) ? -value : value) 641 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
642 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
643 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) 644 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) 645 #define __Pyx_PyBytes_FromString PyBytes_FromString 646 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize 647 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
648 #if PY_MAJOR_VERSION < 3 649 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString 650 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize 652 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString 653 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize 655 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) 656 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) 657 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) 658 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) 659 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) 660 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) 661 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) 662 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) 663 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) 664 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) 665 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) 666 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) 667 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) 668 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) 669 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) 670 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) 671 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *u) {
672 const Py_UNICODE *u_end = u;
674 return (
size_t)(u_end - u - 1);
676 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) 677 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode 678 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode 679 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) 680 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) 681 #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) 682 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
683 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
684 #define __Pyx_PySequence_Tuple(obj)\ 685 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) 686 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
687 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
688 #if CYTHON_ASSUME_SAFE_MACROS 689 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) 691 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) 693 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) 694 #if PY_MAJOR_VERSION >= 3 695 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) 697 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) 699 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) 700 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 701 static int __Pyx_sys_getdefaultencoding_not_ascii;
702 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
704 PyObject* default_encoding = NULL;
705 PyObject* ascii_chars_u = NULL;
706 PyObject* ascii_chars_b = NULL;
707 const char* default_encoding_c;
708 sys = PyImport_ImportModule(
"sys");
710 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
712 if (!default_encoding)
goto bad;
713 default_encoding_c = PyBytes_AsString(default_encoding);
714 if (!default_encoding_c)
goto bad;
715 if (strcmp(default_encoding_c,
"ascii") == 0) {
716 __Pyx_sys_getdefaultencoding_not_ascii = 0;
718 char ascii_chars[128];
720 for (c = 0; c < 128; c++) {
723 __Pyx_sys_getdefaultencoding_not_ascii = 1;
724 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
725 if (!ascii_chars_u)
goto bad;
726 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
727 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
730 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
734 Py_DECREF(ascii_chars_u);
735 Py_DECREF(ascii_chars_b);
737 Py_DECREF(default_encoding);
740 Py_XDECREF(default_encoding);
741 Py_XDECREF(ascii_chars_u);
742 Py_XDECREF(ascii_chars_b);
746 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 747 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) 749 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) 750 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 751 static char* __PYX_DEFAULT_STRING_ENCODING;
752 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
754 PyObject* default_encoding = NULL;
755 char* default_encoding_c;
756 sys = PyImport_ImportModule(
"sys");
758 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
760 if (!default_encoding)
goto bad;
761 default_encoding_c = PyBytes_AsString(default_encoding);
762 if (!default_encoding_c)
goto bad;
763 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c));
764 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
765 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
766 Py_DECREF(default_encoding);
769 Py_XDECREF(default_encoding);
777 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) 778 #define likely(x) __builtin_expect(!!(x), 1) 779 #define unlikely(x) __builtin_expect(!!(x), 0) 781 #define likely(x) (x) 782 #define unlikely(x) (x) 784 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
786 static PyObject *__pyx_m = NULL;
787 static PyObject *__pyx_d;
788 static PyObject *__pyx_b;
789 static PyObject *__pyx_cython_runtime;
790 static PyObject *__pyx_empty_tuple;
791 static PyObject *__pyx_empty_bytes;
792 static PyObject *__pyx_empty_unicode;
793 static int __pyx_lineno;
794 static int __pyx_clineno = 0;
795 static const char * __pyx_cfilenm= __FILE__;
796 static const char *__pyx_filename;
799 static const char *__pyx_f[] = {
805 struct __pyx_obj_8PyClical_index_set;
806 struct __pyx_obj_8PyClical_clifford;
807 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__;
808 struct __pyx_opt_args_8PyClical_sqrt;
809 struct __pyx_opt_args_8PyClical_log;
810 struct __pyx_opt_args_8PyClical_cos;
811 struct __pyx_opt_args_8PyClical_acos;
812 struct __pyx_opt_args_8PyClical_acosh;
813 struct __pyx_opt_args_8PyClical_sin;
814 struct __pyx_opt_args_8PyClical_asin;
815 struct __pyx_opt_args_8PyClical_asinh;
816 struct __pyx_opt_args_8PyClical_tan;
817 struct __pyx_opt_args_8PyClical_atan;
818 struct __pyx_opt_args_8PyClical_atanh;
819 struct __pyx_opt_args_8PyClical_random_clifford;
828 struct __pyx_opt_args_8PyClical_sqrt {
840 struct __pyx_opt_args_8PyClical_log {
852 struct __pyx_opt_args_8PyClical_cos {
864 struct __pyx_opt_args_8PyClical_acos {
876 struct __pyx_opt_args_8PyClical_acosh {
888 struct __pyx_opt_args_8PyClical_sin {
900 struct __pyx_opt_args_8PyClical_asin {
912 struct __pyx_opt_args_8PyClical_asinh {
924 struct __pyx_opt_args_8PyClical_tan {
936 struct __pyx_opt_args_8PyClical_atan {
948 struct __pyx_opt_args_8PyClical_atanh {
960 struct __pyx_opt_args_8PyClical_random_clifford {
972 struct __pyx_obj_8PyClical_index_set {
974 struct __pyx_vtabstruct_8PyClical_index_set *__pyx_vtab;
986 struct __pyx_obj_8PyClical_clifford {
988 struct __pyx_vtabstruct_8PyClical_clifford *__pyx_vtab;
1000 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ {
1002 PyObject *__pyx_v_idx;
1003 struct __pyx_obj_8PyClical_index_set *__pyx_v_self;
1004 PyObject *__pyx_t_0;
1005 Py_ssize_t __pyx_t_1;
1006 PyObject *(*__pyx_t_2)(PyObject *);
1019 struct __pyx_vtabstruct_8PyClical_index_set {
1020 PyObject *(*wrap)(
struct __pyx_obj_8PyClical_index_set *,
IndexSet);
1021 IndexSet (*unwrap)(
struct __pyx_obj_8PyClical_index_set *);
1022 PyObject *(*copy)(
struct __pyx_obj_8PyClical_index_set *,
int __pyx_skip_dispatch);
1024 static struct __pyx_vtabstruct_8PyClical_index_set *__pyx_vtabptr_8PyClical_index_set;
1025 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_9index_set_wrap(
struct __pyx_obj_8PyClical_index_set *,
IndexSet);
1026 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_9index_set_unwrap(
struct __pyx_obj_8PyClical_index_set *);
1037 struct __pyx_vtabstruct_8PyClical_clifford {
1038 PyObject *(*wrap)(
struct __pyx_obj_8PyClical_clifford *,
Clifford);
1039 Clifford (*unwrap)(
struct __pyx_obj_8PyClical_clifford *);
1040 PyObject *(*copy)(
struct __pyx_obj_8PyClical_clifford *,
int __pyx_skip_dispatch);
1042 static struct __pyx_vtabstruct_8PyClical_clifford *__pyx_vtabptr_8PyClical_clifford;
1043 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_8clifford_wrap(
struct __pyx_obj_8PyClical_clifford *,
Clifford);
1044 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_8clifford_unwrap(
struct __pyx_obj_8PyClical_clifford *);
1048 #ifndef CYTHON_REFNANNY 1049 #define CYTHON_REFNANNY 0 1053 void (*INCREF)(
void*, PyObject*, int);
1054 void (*DECREF)(
void*, PyObject*, int);
1055 void (*GOTREF)(
void*, PyObject*, int);
1056 void (*GIVEREF)(
void*, PyObject*, int);
1057 void* (*SetupContext)(
const char*, int,
const char*);
1058 void (*FinishContext)(
void**);
1059 } __Pyx_RefNannyAPIStruct;
1060 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1061 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1062 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; 1064 #define __Pyx_RefNannySetupContext(name, acquire_gil)\ 1066 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ 1067 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ 1068 PyGILState_Release(__pyx_gilstate_save);\ 1070 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ 1073 #define __Pyx_RefNannySetupContext(name, acquire_gil)\ 1074 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) 1076 #define __Pyx_RefNannyFinishContext()\ 1077 __Pyx_RefNanny->FinishContext(&__pyx_refnanny) 1078 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1079 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1080 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1081 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1082 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) 1083 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) 1084 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) 1085 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) 1087 #define __Pyx_RefNannyDeclarations 1088 #define __Pyx_RefNannySetupContext(name, acquire_gil) 1089 #define __Pyx_RefNannyFinishContext() 1090 #define __Pyx_INCREF(r) Py_INCREF(r) 1091 #define __Pyx_DECREF(r) Py_DECREF(r) 1092 #define __Pyx_GOTREF(r) 1093 #define __Pyx_GIVEREF(r) 1094 #define __Pyx_XINCREF(r) Py_XINCREF(r) 1095 #define __Pyx_XDECREF(r) Py_XDECREF(r) 1096 #define __Pyx_XGOTREF(r) 1097 #define __Pyx_XGIVEREF(r) 1099 #define __Pyx_XDECREF_SET(r, v) do {\ 1100 PyObject *tmp = (PyObject *) r;\ 1101 r = v; __Pyx_XDECREF(tmp);\ 1103 #define __Pyx_DECREF_SET(r, v) do {\ 1104 PyObject *tmp = (PyObject *) r;\ 1105 r = v; __Pyx_DECREF(tmp);\ 1107 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) 1108 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) 1111 #if CYTHON_USE_TYPE_SLOTS 1112 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject*
obj, PyObject* attr_name) {
1113 PyTypeObject* tp = Py_TYPE(
obj);
1114 if (likely(tp->tp_getattro))
1115 return tp->tp_getattro(
obj, attr_name);
1116 #if PY_MAJOR_VERSION < 3 1117 if (likely(tp->tp_getattr))
1118 return tp->tp_getattr(
obj, PyString_AS_STRING(attr_name));
1120 return PyObject_GetAttr(
obj, attr_name);
1123 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) 1127 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1130 #if CYTHON_COMPILING_IN_CPYTHON 1131 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1133 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) 1137 #if CYTHON_FAST_THREAD_STATE 1138 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; 1139 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; 1140 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type 1142 #define __Pyx_PyThreadState_declare 1143 #define __Pyx_PyThreadState_assign 1144 #define __Pyx_PyErr_Occurred() PyErr_Occurred() 1148 #if CYTHON_FAST_THREAD_STATE 1149 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) 1150 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) 1151 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) 1152 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) 1153 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) 1154 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1155 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1156 #if CYTHON_COMPILING_IN_CPYTHON 1157 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) 1159 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) 1162 #define __Pyx_PyErr_Clear() PyErr_Clear() 1163 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) 1164 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) 1165 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) 1166 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) 1167 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) 1168 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) 1169 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) 1173 static void __Pyx_WriteUnraisable(
const char *name,
int clineno,
1174 int lineno,
const char *filename,
1175 int full_traceback,
int nogil);
1178 #if CYTHON_FAST_PYCCALL 1179 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1181 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) 1185 #if CYTHON_FAST_PYCALL 1186 #define __Pyx_PyFunction_FastCall(func, args, nargs)\ 1187 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) 1188 #if 1 || PY_VERSION_HEX < 0x030600B1 1189 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
int nargs, PyObject *kwargs);
1191 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) 1196 #if CYTHON_COMPILING_IN_CPYTHON 1197 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1201 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1204 #if CYTHON_COMPILING_IN_CPYTHON 1205 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1207 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) 1211 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
1214 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1215 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1216 const char* function_name);
1219 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1220 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1223 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
1226 #if CYTHON_FAST_THREAD_STATE 1227 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) 1228 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1229 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) 1230 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1232 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) 1233 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) 1237 #if CYTHON_FAST_THREAD_STATE 1238 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) 1239 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1241 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) 1245 #if CYTHON_FAST_THREAD_STATE 1246 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) 1247 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1249 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1253 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1256 #if !CYTHON_COMPILING_IN_PYPY 1257 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2,
long intval,
int inplace);
1259 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\ 1260 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) 1264 static CYTHON_INLINE
int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq,
int eq) {
1265 int result = PySequence_Contains(seq, item);
1266 return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
1270 #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ 1271 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ 1272 __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\ 1273 (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\ 1274 __Pyx_SetItemInt_Generic(o, to_py_func(i), v))) 1275 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
1276 static CYTHON_INLINE
int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t
i, PyObject *v,
1277 int is_list,
int wraparound,
int boundscheck);
1280 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ 1281 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\ 1282 __Pyx__ArgTypeTest(obj, type, name, exact)) 1283 static int __Pyx__ArgTypeTest(PyObject *
obj, PyTypeObject *type,
const char *name,
int exact);
1286 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
1292 static int __Pyx_SetVtable(PyObject *dict,
void *vtable);
1295 static int __Pyx_setup_reduce(PyObject* type_obj);
1298 #if !CYTHON_COMPILING_IN_PYPY 1299 static PyObject* __Pyx_PyFloat_DivideObjC(PyObject *op1, PyObject *op2,
double floatval,
int inplace);
1301 #define __Pyx_PyFloat_DivideObjC(op1, op2, floatval, inplace)\ 1302 ((inplace ? __Pyx_PyNumber_InPlaceDivide(op1, op2) : __Pyx_PyNumber_Divide(op1, op2))) 1306 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals);
1309 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals);
1312 #if PY_MAJOR_VERSION >= 3 1313 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals 1315 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals 1319 #ifdef CYTHON_CLINE_IN_TRACEBACK 1320 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) 1322 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
1327 PyCodeObject* code_object;
1329 } __Pyx_CodeObjectCacheEntry;
1330 struct __Pyx_CodeObjectCache {
1333 __Pyx_CodeObjectCacheEntry* entries;
1335 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1336 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
1337 static PyCodeObject *__pyx_find_code_object(
int code_line);
1338 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
1341 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
1342 int py_line,
const char *filename);
1345 #ifndef __Pyx_CppExn2PyErr 1348 #include <stdexcept> 1350 static void __Pyx_CppExn2PyErr() {
1352 if (PyErr_Occurred())
1356 }
catch (
const std::bad_alloc& exn) {
1357 PyErr_SetString(PyExc_MemoryError, exn.what());
1358 }
catch (
const std::bad_cast& exn) {
1359 PyErr_SetString(PyExc_TypeError, exn.what());
1360 }
catch (
const std::bad_typeid& exn) {
1361 PyErr_SetString(PyExc_TypeError, exn.what());
1362 }
catch (
const std::domain_error& exn) {
1363 PyErr_SetString(PyExc_ValueError, exn.what());
1364 }
catch (
const std::invalid_argument& exn) {
1365 PyErr_SetString(PyExc_ValueError, exn.what());
1366 }
catch (
const std::ios_base::failure& exn) {
1367 PyErr_SetString(PyExc_IOError, exn.what());
1368 }
catch (
const std::out_of_range& exn) {
1369 PyErr_SetString(PyExc_IndexError, exn.what());
1370 }
catch (
const std::overflow_error& exn) {
1371 PyErr_SetString(PyExc_OverflowError, exn.what());
1372 }
catch (
const std::range_error& exn) {
1373 PyErr_SetString(PyExc_ArithmeticError, exn.what());
1374 }
catch (
const std::underflow_error& exn) {
1375 PyErr_SetString(PyExc_ArithmeticError, exn.what());
1376 }
catch (
const std::exception& exn) {
1377 PyErr_SetString(PyExc_RuntimeError, exn.what());
1381 PyErr_SetString(PyExc_RuntimeError,
"Unknown exception");
1387 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
1390 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
1393 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
1396 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
1399 #if CYTHON_COMPILING_IN_CPYTHON 1400 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) 1401 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1402 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1403 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1405 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) 1406 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) 1407 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) 1411 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
1414 #if CYTHON_FAST_THREAD_STATE 1415 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) 1416 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1418 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
1422 static PyObject* __Pyx_PyObject_CallMethod1(PyObject*
obj, PyObject* method_name, PyObject* arg);
1423 static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg);
1426 typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyThreadState *, PyObject *);
1429 __pyx_coroutine_body_t body;
1432 PyObject *exc_value;
1433 PyObject *exc_traceback;
1434 PyObject *gi_weakreflist;
1436 PyObject *yieldfrom;
1438 PyObject *gi_qualname;
1439 PyObject *gi_modulename;
1442 } __pyx_CoroutineObject;
1443 static __pyx_CoroutineObject *__Pyx__Coroutine_New(
1444 PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *closure,
1445 PyObject *name, PyObject *qualname, PyObject *module_name);
1446 static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
1447 __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *closure,
1448 PyObject *name, PyObject *qualname, PyObject *module_name);
1449 static int __Pyx_Coroutine_clear(PyObject *
self);
1450 static PyObject *__Pyx_Coroutine_Send(PyObject *
self, PyObject *value);
1451 static PyObject *__Pyx_Coroutine_Close(PyObject *
self);
1452 static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
1453 #define __Pyx_Coroutine_SwapException(self) {\ 1454 __Pyx_ExceptionSwap(&(self)->exc_type, &(self)->exc_value, &(self)->exc_traceback);\ 1455 __Pyx_Coroutine_ResetFrameBackpointer(self);\ 1457 #define __Pyx_Coroutine_ResetAndClearException(self) {\ 1458 __Pyx_ExceptionReset((self)->exc_type, (self)->exc_value, (self)->exc_traceback);\ 1459 (self)->exc_type = (self)->exc_value = (self)->exc_traceback = NULL;\ 1461 #if CYTHON_FAST_THREAD_STATE 1462 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ 1463 __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue) 1465 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ 1466 __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue) 1468 static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue);
1469 static CYTHON_INLINE
void __Pyx_Coroutine_ResetFrameBackpointer(__pyx_CoroutineObject *
self);
1472 static PyObject* __Pyx_Coroutine_patch_module(PyObject* module,
const char* py_code);
1475 static int __Pyx_patch_abc(
void);
1478 #define __Pyx_Generator_USED 1479 static PyTypeObject *__pyx_GeneratorType = 0;
1480 #define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType) 1481 #define __Pyx_Generator_New(body, closure, name, qualname, module_name)\ 1482 __Pyx__Coroutine_New(__pyx_GeneratorType, body, closure, name, qualname, module_name) 1483 static PyObject *__Pyx_Generator_Next(PyObject *
self);
1484 static int __pyx_Generator_init(
void);
1487 static int __Pyx_check_binary_version(
void);
1490 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1492 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_9index_set_wrap(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self,
IndexSet __pyx_v_other);
1493 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_9index_set_unwrap(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
1494 static PyObject *__pyx_f_8PyClical_9index_set_copy(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self,
int __pyx_skip_dispatch);
1495 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_8clifford_wrap(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self,
Clifford __pyx_v_other);
1496 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_8clifford_unwrap(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
1497 static PyObject *__pyx_f_8PyClical_8clifford_copy(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self,
int __pyx_skip_dispatch);
1504 static PyTypeObject *__pyx_ptype_8PyClical_index_set = 0;
1505 static PyTypeObject *__pyx_ptype_8PyClical_clifford = 0;
1506 static PyTypeObject *__pyx_ptype_8PyClical___pyx_scope_struct____iter__ = 0;
1507 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_toIndexSet(PyObject *);
1508 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_compare(PyObject *, PyObject *,
int __pyx_skip_dispatch);
1509 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_min_neg(PyObject *,
int __pyx_skip_dispatch);
1510 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_max_pos(PyObject *,
int __pyx_skip_dispatch);
1511 static CYTHON_INLINE std::vector<scalar_t> __pyx_f_8PyClical_list_to_vector(PyObject *);
1512 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_toClifford(PyObject *);
1513 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_inv(PyObject *,
int __pyx_skip_dispatch);
1514 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_scalar(PyObject *,
int __pyx_skip_dispatch);
1515 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_real(PyObject *,
int __pyx_skip_dispatch);
1516 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_imag(PyObject *,
int __pyx_skip_dispatch);
1517 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_pure(PyObject *,
int __pyx_skip_dispatch);
1518 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_even(PyObject *,
int __pyx_skip_dispatch);
1519 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_odd(PyObject *,
int __pyx_skip_dispatch);
1520 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_involute(PyObject *,
int __pyx_skip_dispatch);
1521 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_reverse(PyObject *,
int __pyx_skip_dispatch);
1522 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_conj(PyObject *,
int __pyx_skip_dispatch);
1523 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_quad(PyObject *,
int __pyx_skip_dispatch);
1524 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_norm(PyObject *,
int __pyx_skip_dispatch);
1525 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_abs(PyObject *,
int __pyx_skip_dispatch);
1526 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_max_abs(PyObject *,
int __pyx_skip_dispatch);
1527 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_pow(PyObject *, PyObject *,
int __pyx_skip_dispatch);
1528 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_outer_pow(PyObject *, PyObject *,
int __pyx_skip_dispatch);
1529 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_complexifier(PyObject *,
int __pyx_skip_dispatch);
1530 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_sqrt(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_sqrt *__pyx_optional_args);
1531 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_exp(PyObject *,
int __pyx_skip_dispatch);
1532 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_log(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_log *__pyx_optional_args);
1533 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cos(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_cos *__pyx_optional_args);
1534 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_acos(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_acos *__pyx_optional_args);
1535 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cosh(PyObject *,
int __pyx_skip_dispatch);
1536 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_acosh(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_acosh *__pyx_optional_args);
1537 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_sin(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_sin *__pyx_optional_args);
1538 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_asin(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_asin *__pyx_optional_args);
1539 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_sinh(PyObject *,
int __pyx_skip_dispatch);
1540 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_asinh(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_asinh *__pyx_optional_args);
1541 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_tan(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_tan *__pyx_optional_args);
1542 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_atan(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_atan *__pyx_optional_args);
1543 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_tanh(PyObject *,
int __pyx_skip_dispatch);
1544 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_atanh(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_atanh *__pyx_optional_args);
1545 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);
1546 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cga3(PyObject *,
int __pyx_skip_dispatch);
1547 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cga3std(PyObject *,
int __pyx_skip_dispatch);
1548 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_agc3(PyObject *,
int __pyx_skip_dispatch);
1549 #define __Pyx_MODULE_NAME "PyClical" 1550 extern int __pyx_module_is_main_PyClical;
1551 int __pyx_module_is_main_PyClical = 0;
1554 static PyObject *__pyx_builtin_IndexError;
1555 static PyObject *__pyx_builtin_RuntimeError;
1556 static PyObject *__pyx_builtin_TypeError;
1557 static PyObject *__pyx_builtin_ValueError;
1558 static PyObject *__pyx_builtin_NotImplemented;
1559 static PyObject *__pyx_builtin_range;
1560 static PyObject *__pyx_builtin_xrange;
1561 static const char __pyx_k_[] =
".";
1562 static const char __pyx_k_e[] =
"e";
1563 static const char __pyx_k_i[] =
"i";
1564 static const char __pyx_k_m[] =
"m";
1565 static const char __pyx_k_p[] =
"p";
1566 static const char __pyx_k_q[] =
"q";
1567 static const char __pyx_k__2[] =
" ";
1568 static const char __pyx_k__5[] =
":";
1569 static const char __pyx_k__6[] =
"\n\t";
1570 static const char __pyx_k__7[] =
" (";
1571 static const char __pyx_k__8[] =
", ";
1572 static const char __pyx_k__9[] =
").";
1573 static const char __pyx_k_cl[] =
"cl";
1574 static const char __pyx_k_pi[] =
"pi";
1575 static const char __pyx_k_cos[] =
"cos";
1576 static const char __pyx_k_exp[] =
"exp";
1577 static const char __pyx_k_frm[] =
"frm";
1578 static const char __pyx_k_inv[] =
"inv";
1579 static const char __pyx_k_ist[] =
"ist";
1580 static const char __pyx_k_ixt[] =
"ixt";
1581 static const char __pyx_k_lhs[] =
"lhs";
1582 static const char __pyx_k_log[] =
"log";
1583 static const char __pyx_k_max[] =
"max";
1584 static const char __pyx_k_min[] =
"min";
1585 static const char __pyx_k_obj[] =
"obj";
1586 static const char __pyx_k_odd[] =
"odd";
1587 static const char __pyx_k_pow[] =
"pow";
1588 static const char __pyx_k_rhs[] =
"rhs";
1589 static const char __pyx_k_sin[] =
"sin";
1590 static const char __pyx_k_tan[] =
"tan";
1591 static const char __pyx_k_tau[] =
"tau";
1592 static const char __pyx_k_Real[] =
"Real";
1593 static const char __pyx_k_acos[] =
"acos";
1594 static const char __pyx_k_args[] =
"args";
1595 static const char __pyx_k_asin[] =
"asin";
1596 static const char __pyx_k_atan[] =
"atan";
1597 static const char __pyx_k_conj[] =
"conj";
1598 static const char __pyx_k_copy[] =
"copy";
1599 static const char __pyx_k_cosh[] =
"cosh";
1600 static const char __pyx_k_even[] =
"even";
1601 static const char __pyx_k_fill[] =
"fill";
1602 static const char __pyx_k_from[] =
" from ";
1603 static const char __pyx_k_iter[] =
"__iter__";
1604 static const char __pyx_k_main[] =
"__main__";
1605 static const char __pyx_k_math[] =
"math";
1606 static const char __pyx_k_name[] =
"__name__";
1607 static const char __pyx_k_norm[] =
"norm";
1608 static const char __pyx_k_pure[] =
"pure";
1609 static const char __pyx_k_quad[] =
"quad";
1610 static const char __pyx_k_send[] =
"send";
1611 static const char __pyx_k_sinh[] =
"sinh";
1612 static const char __pyx_k_sqrt[] =
"sqrt";
1613 static const char __pyx_k_tanh[] =
"tanh";
1614 static const char __pyx_k_test[] =
"_test";
1615 static const char __pyx_k_0_8_2[] =
"0.8.2";
1616 static const char __pyx_k_acosh[] =
"acosh";
1617 static const char __pyx_k_asinh[] =
"asinh";
1618 static const char __pyx_k_atanh[] =
"atanh";
1619 static const char __pyx_k_close[] =
"close";
1620 static const char __pyx_k_grade[] =
"grade";
1621 static const char __pyx_k_istpq[] =
"istpq";
1622 static const char __pyx_k_nbar3[] =
"nbar3";
1623 static const char __pyx_k_ninf3[] =
"ninf3";
1624 static const char __pyx_k_other[] =
"other";
1625 static const char __pyx_k_range[] =
"range";
1626 static const char __pyx_k_throw[] =
"throw";
1627 static const char __pyx_k_using[] =
" using (";
1628 static const char __pyx_k_value[] =
" value ";
1629 static const char __pyx_k_import[] =
"__import__";
1630 static const char __pyx_k_reduce[] =
"__reduce__";
1631 static const char __pyx_k_scalar[] =
"scalar";
1632 static const char __pyx_k_test_2[] =
"__test__";
1633 static const char __pyx_k_xrange[] =
"xrange";
1634 static const char __pyx_k_doctest[] =
"doctest";
1635 static const char __pyx_k_invalid[] =
" invalid ";
1636 static const char __pyx_k_numbers[] =
"numbers";
1637 static const char __pyx_k_reverse[] =
"reverse";
1638 static const char __pyx_k_testmod[] =
"testmod";
1639 static const char __pyx_k_version[] =
"__version__";
1640 static const char __pyx_k_Integral[] =
"Integral";
1641 static const char __pyx_k_PyClical[] =
"PyClical";
1642 static const char __pyx_k_Sequence[] =
"Sequence";
1643 static const char __pyx_k_as_frame[] =
" as frame:\n\t";
1644 static const char __pyx_k_getstate[] =
"__getstate__";
1645 static const char __pyx_k_involute[] =
"involute";
1646 static const char __pyx_k_setstate[] =
"__setstate__";
1647 static const char __pyx_k_to_frame[] =
" to frame ";
1648 static const char __pyx_k_TypeError[] =
"TypeError";
1649 static const char __pyx_k_outer_pow[] =
"outer_pow";
1650 static const char __pyx_k_reduce_ex[] =
"__reduce_ex__";
1651 static const char __pyx_k_IndexError[] =
"IndexError";
1652 static const char __pyx_k_ValueError[] =
"ValueError";
1653 static const char __pyx_k_pyx_vtable[] =
"__pyx_vtable__";
1654 static const char __pyx_k_collections[] =
"collections";
1655 static const char __pyx_k_e_line_1887[] =
"e (line 1887)";
1656 static const char __pyx_k_PyClical_pyx[] =
"PyClical.pyx";
1657 static const char __pyx_k_RuntimeError[] =
"RuntimeError";
1658 static const char __pyx_k_abs_line_1473[] =
"abs (line 1473)";
1659 static const char __pyx_k_cos_line_1602[] =
"cos (line 1602)";
1660 static const char __pyx_k_exp_line_1565[] =
"exp (line 1565)";
1661 static const char __pyx_k_inv_line_1329[] =
"inv (line 1329)";
1662 static const char __pyx_k_log_line_1579[] =
"log (line 1579)";
1663 static const char __pyx_k_odd_line_1397[] =
"odd (line 1397)";
1664 static const char __pyx_k_pow_line_1494[] =
"pow (line 1494)";
1665 static const char __pyx_k_reduce_cython[] =
"__reduce_cython__";
1666 static const char __pyx_k_sin_line_1679[] =
"sin (line 1679)";
1667 static const char __pyx_k_tan_line_1752[] =
"tan (line 1752)";
1668 static const char __pyx_k_using_invalid[] =
" using invalid ";
1669 static const char __pyx_k_Cannot_reframe[] =
"Cannot reframe";
1670 static const char __pyx_k_NotImplemented[] =
"NotImplemented";
1671 static const char __pyx_k_Not_applicable[] =
"Not applicable.";
1672 static const char __pyx_k_acos_line_1619[] =
"acos (line 1619)";
1673 static const char __pyx_k_agc3_line_1844[] =
"agc3 (line 1844)";
1674 static const char __pyx_k_asin_line_1698[] =
"asin (line 1698)";
1675 static const char __pyx_k_atan_line_1769[] =
"atan (line 1769)";
1676 static const char __pyx_k_cga3_line_1824[] =
"cga3 (line 1824)";
1677 static const char __pyx_k_conj_line_1436[] =
"conj (line 1436)";
1678 static const char __pyx_k_cosh_line_1640[] =
"cosh (line 1640)";
1679 static const char __pyx_k_even_line_1388[] =
"even (line 1388)";
1680 static const char __pyx_k_imag_line_1366[] =
"imag (line 1366)";
1681 static const char __pyx_k_invalid_string[] =
" invalid string ";
1682 static const char __pyx_k_norm_line_1462[] =
"norm (line 1462)";
1683 static const char __pyx_k_pure_line_1377[] =
"pure (line 1377)";
1684 static const char __pyx_k_quad_line_1451[] =
"quad (line 1451)";
1685 static const char __pyx_k_real_line_1355[] =
"real (line 1355)";
1686 static const char __pyx_k_sinh_line_1719[] =
"sinh (line 1719)";
1687 static const char __pyx_k_sqrt_line_1542[] =
"sqrt (line 1542)";
1688 static const char __pyx_k_tanh_line_1786[] =
"tanh (line 1786)";
1689 static const char __pyx_k_acosh_line_1656[] =
"acosh (line 1656)";
1690 static const char __pyx_k_asinh_line_1733[] =
"asinh (line 1733)";
1691 static const char __pyx_k_atanh_line_1798[] =
"atanh (line 1798)";
1692 static const char __pyx_k_istpq_line_1900[] =
"istpq (line 1900)";
1693 static const char __pyx_k_setstate_cython[] =
"__setstate_cython__";
1694 static const char __pyx_k_compare_line_490[] =
"compare (line 490)";
1695 static const char __pyx_k_index_set___iter[] =
"index_set.__iter__";
1696 static const char __pyx_k_max_pos_line_511[] =
"max_pos (line 511)";
1697 static const char __pyx_k_min_neg_line_502[] =
"min_neg (line 502)";
1698 static const char __pyx_k_scalar_line_1344[] =
"scalar (line 1344)";
1699 static const char __pyx_k_cga3std_line_1833[] =
"cga3std (line 1833)";
1700 static const char __pyx_k_max_abs_line_1482[] =
"max_abs (line 1482)";
1701 static const char __pyx_k_reverse_line_1421[] =
"reverse (line 1421)";
1702 static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
1703 static const char __pyx_k_involute_line_1406[] =
"involute (line 1406)";
1704 static const char __pyx_k_outer_pow_line_1518[] =
"outer_pow (line 1518)";
1705 static const char __pyx_k_clifford_inv_line_925[] =
"clifford.inv (line 925)";
1706 static const char __pyx_k_clifford_pow_line_979[] =
"clifford.pow (line 979)";
1707 static const char __pyx_k_clifford_abs_line_1174[] =
"clifford.abs (line 1174)";
1708 static const char __pyx_k_clifford_copy_line_554[] =
"clifford.copy (line 554)";
1709 static const char __pyx_k_clifford_odd_line_1069[] =
"clifford.odd (line 1069)";
1710 static const char __pyx_k_complexifier_line_1527[] =
"complexifier (line 1527)";
1711 static const char __pyx_k_index_set_copy_line_64[] =
"index_set.copy (line 64)";
1712 static const char __pyx_k_index_set_max_line_349[] =
"index_set.max (line 349)";
1713 static const char __pyx_k_index_set_min_line_340[] =
"index_set.min (line 340)";
1714 static const char __pyx_k_clifford_conj_line_1137[] =
"clifford.conj (line 1137)";
1715 static const char __pyx_k_clifford_even_line_1060[] =
"clifford.even (line 1060)";
1716 static const char __pyx_k_clifford_norm_line_1163[] =
"clifford.norm (line 1163)";
1717 static const char __pyx_k_clifford_pure_line_1049[] =
"clifford.pure (line 1049)";
1718 static const char __pyx_k_clifford_quad_line_1152[] =
"clifford.quad (line 1152)";
1719 static const char __pyx_k_Unary_print_clifford_1_1[] =
"\n Unary -.\n\n >>> print -clifford(\"{1}\")\n -{1}\n ";
1720 static const char __pyx_k_clifford___or___line_938[] =
"clifford.__or__ (line 938)";
1721 static const char __pyx_k_clifford_frame_line_1214[] =
"clifford.frame (line 1214)";
1722 static const char __pyx_k_clifford_hidden_doctests[] =
"clifford_hidden_doctests";
1723 static const char __pyx_k_clifford_isnan_line_1205[] =
"clifford.isnan (line 1205)";
1724 static const char __pyx_k_index_set_count_line_313[] =
"index_set.count (line 313)";
1725 static const char __pyx_k_clifford___add___line_739[] =
"clifford.__add__ (line 739)";
1726 static const char __pyx_k_clifford___and___line_835[] =
"clifford.__and__ (line 835)";
1727 static const char __pyx_k_clifford___div___line_895[] =
"clifford.__div__ (line 895)";
1728 static const char __pyx_k_clifford___ior___line_949[] =
"clifford.__ior__ (line 949)";
1729 static const char __pyx_k_clifford___mod___line_805[] =
"clifford.__mod__ (line 805)";
1730 static const char __pyx_k_clifford___mul___line_779[] =
"clifford.__mul__ (line 779)";
1731 static const char __pyx_k_clifford___neg___line_721[] =
"clifford.__neg__ (line 721)";
1732 static const char __pyx_k_clifford___pos___line_730[] =
"clifford.__pos__ (line 730)";
1733 static const char __pyx_k_clifford___pow___line_960[] =
"clifford.__pow__ (line 960)";
1734 static const char __pyx_k_clifford___sub___line_759[] =
"clifford.__sub__ (line 759)";
1735 static const char __pyx_k_clifford___xor___line_865[] =
"clifford.__xor__ (line 865)";
1736 static const char __pyx_k_clifford_reframe_line_648[] =
"clifford.reframe (line 648)";
1737 static const char __pyx_k_clifford_scalar_line_1038[] =
"clifford.scalar (line 1038)";
1738 static const char __pyx_k_index_set___or___line_291[] =
"index_set.__or__ (line 291)";
1739 static const char __pyx_k_index_set_hidden_doctests[] =
"index_set_hidden_doctests";
1740 static const char __pyx_k_random_clifford_line_1815[] =
"random_clifford (line 1815)";
1741 static const char __pyx_k_Cannot_take_vector_part_of[] =
"Cannot take vector part of ";
1742 static const char __pyx_k_Unary_print_clifford_1_1_2[] =
"\n Unary +.\n\n >>> print +clifford(\"{1}\")\n {1}\n ";
1743 static const char __pyx_k_clifford___iadd___line_750[] =
"clifford.__iadd__ (line 750)";
1744 static const char __pyx_k_clifford___iand___line_850[] =
"clifford.__iand__ (line 850)";
1745 static const char __pyx_k_clifford___idiv___line_910[] =
"clifford.__idiv__ (line 910)";
1746 static const char __pyx_k_clifford___imod___line_820[] =
"clifford.__imod__ (line 820)";
1747 static const char __pyx_k_clifford___imul___line_792[] =
"clifford.__imul__ (line 792)";
1748 static const char __pyx_k_clifford___isub___line_770[] =
"clifford.__isub__ (line 770)";
1749 static const char __pyx_k_clifford___iter___line_637[] =
"clifford.__iter__ (line 637)";
1750 static const char __pyx_k_clifford___ixor___line_880[] =
"clifford.__ixor__ (line 880)";
1751 static const char __pyx_k_clifford___str___line_1234[] =
"clifford.__str__ (line 1234)";
1752 static const char __pyx_k_clifford_max_abs_line_1183[] =
"clifford.max_abs (line 1183)";
1753 static const char __pyx_k_clifford_reverse_line_1122[] =
"clifford.reverse (line 1122)";
1754 static const char __pyx_k_index_set___and___line_269[] =
"index_set.__and__ (line 269)";
1755 static const char __pyx_k_index_set___ior___line_302[] =
"index_set.__ior__ (line 302)";
1756 static const char __pyx_k_index_set___str___line_393[] =
"index_set.__str__ (line 393)";
1757 static const char __pyx_k_index_set___xor___line_247[] =
"index_set.__xor__ (line 247)";
1758 static const char __pyx_k_clifford___call___line_1019[] =
"clifford.__call__ (line 1019)";
1759 static const char __pyx_k_clifford___repr___line_1225[] =
"clifford.__repr__ (line 1225)";
1760 static const char __pyx_k_clifford_involute_line_1106[] =
"clifford.involute (line 1106)";
1761 static const char __pyx_k_index_set___iand___line_280[] =
"index_set.__iand__ (line 280)";
1762 static const char __pyx_k_index_set___iter___line_227[] =
"index_set.__iter__ (line 227)";
1763 static const char __pyx_k_index_set___ixor___line_258[] =
"index_set.__ixor__ (line 258)";
1764 static const char __pyx_k_index_set___repr___line_382[] =
"index_set.__repr__ (line 382)";
1765 static const char __pyx_k_clifford_outer_pow_line_1003[] =
"clifford.outer_pow (line 1003)";
1766 static const char __pyx_k_clifford_truncated_line_1194[] =
"clifford.truncated (line 1194)";
1767 static const char __pyx_k_index_set_count_neg_line_322[] =
"index_set.count_neg (line 322)";
1768 static const char __pyx_k_index_set_count_pos_line_331[] =
"index_set.count_pos (line 331)";
1769 static const char __pyx_k_clifford___getitem___line_706[] =
"clifford.__getitem__ (line 706)";
1770 static const char __pyx_k_index_set___invert___line_238[] =
"index_set.__invert__ (line 238)";
1771 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 ";
1772 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 ";
1773 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 ";
1774 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 ";
1775 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 ";
1776 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 ";
1777 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 ";
1778 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 ";
1779 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 ";
1780 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 ";
1781 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 ";
1782 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 ";
1783 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 ";
1784 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 ";
1785 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 ";
1786 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 ";
1787 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 ";
1788 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 ";
1789 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 ";
1790 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 ";
1791 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 ";
1792 static const char __pyx_k_clifford_vector_part_line_1078[] =
"clifford.vector_part (line 1078)";
1793 static const char __pyx_k_index_set___getitem___line_189[] =
"index_set.__getitem__ (line 189)";
1794 static const char __pyx_k_index_set___setitem___line_177[] =
"index_set.__setitem__ (line 177)";
1795 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 ";
1796 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 ";
1797 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 ";
1798 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 ";
1799 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 ";
1800 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 ";
1801 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 ";
1802 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 ";
1803 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 ";
1804 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 ";
1805 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 ";
1806 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 ";
1807 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 ";
1808 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 ";
1809 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 ";
1810 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 ";
1811 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 ";
1812 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 ";
1813 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 ";
1814 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 ";
1815 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 ";
1816 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 ";
1817 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 ";
1818 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 ";
1819 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 ";
1820 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 ";
1821 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 ";
1822 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 ";
1823 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 ";
1824 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 ";
1825 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 ";
1826 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 ";
1827 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 ";
1828 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 ";
1829 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 ";
1830 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 ";
1831 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 ";
1832 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 ";
1833 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 ";
1834 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 ";
1835 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 ";
1836 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 ";
1837 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 ";
1838 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 ";
1839 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 ";
1840 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 ";
1841 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 ";
1842 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 ";
1843 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 ";
1844 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 ";
1845 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 ";
1846 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 ";
1847 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 ";
1848 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 ";
1849 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 ";
1850 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 ";
1851 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 ";
1852 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 ";
1853 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 ";
1854 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 ";
1855 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 ";
1856 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 ";
1857 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 ";
1858 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 ";
1859 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 ";
1860 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 ";
1861 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 ";
1862 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 ";
1863 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 ";
1864 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 ";
1865 static const char __pyx_k_This_comparison_operator_is_not[] =
"This comparison operator is not implemented for ";
1866 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 ";
1867 static const char __pyx_k_index_set_sign_of_mult_line_364[] =
"index_set.sign_of_mult (line 364)";
1868 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 ";
1869 static const char __pyx_k_Cannot_initialize_clifford_objec[] =
"Cannot initialize clifford object from";
1870 static const char __pyx_k_Cannot_initialize_index_set_obje[] =
"Cannot initialize index_set object from";
1871 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 ";
1872 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 ";
1873 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 ";
1874 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 ";
1875 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 ";
1876 static const char __pyx_k_clifford_hidden_doctests_line_12[] =
"clifford_hidden_doctests (line 1243)";
1877 static const char __pyx_k_index_set_hidden_doctests_line_4[] =
"index_set_hidden_doctests (line 404)";
1878 static const char __pyx_k_index_set_sign_of_square_line_37[] =
"index_set.sign_of_square (line 373)";
1879 static const char __pyx_k_no_default___reduce___due_to_non[] =
"no default __reduce__ due to non-trivial __cinit__";
1880 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 ";
1881 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 ";
1882 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 ";
1883 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 ";
1884 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 ";
1885 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 ";
1886 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 ";
1887 static PyObject *__pyx_kp_s_;
1888 static PyObject *__pyx_kp_s_0_8_2;
1889 static PyObject *__pyx_kp_u_Abbreviation_for_clifford_index;
1890 static PyObject *__pyx_kp_u_Abbreviation_for_index_set_q_p;
1891 static PyObject *__pyx_kp_u_Absolute_value_of_multivector_m;
1892 static PyObject *__pyx_kp_u_Absolute_value_square_root_of_n;
1893 static PyObject *__pyx_kp_s_Cannot_initialize_clifford_objec;
1894 static PyObject *__pyx_kp_s_Cannot_initialize_index_set_obje;
1895 static PyObject *__pyx_kp_s_Cannot_reframe;
1896 static PyObject *__pyx_kp_s_Cannot_take_vector_part_of;
1897 static PyObject *__pyx_kp_u_Cardinality_Number_of_indices_i;
1898 static PyObject *__pyx_kp_u_Check_if_a_multivector_contains;
1899 static PyObject *__pyx_kp_u_Conjugation_reverse_o_involute;
1900 static PyObject *__pyx_kp_u_Conjugation_reverse_o_involute_2;
1901 static PyObject *__pyx_kp_u_Contraction_print_clifford_1_cl;
1902 static PyObject *__pyx_kp_u_Contraction_x_clifford_1_x_clif;
1903 static PyObject *__pyx_kp_u_Convert_CGA3_null_vector_to_Euc;
1904 static PyObject *__pyx_kp_u_Convert_CGA3_null_vector_to_sta;
1905 static PyObject *__pyx_kp_u_Convert_Euclidean_3D_multivecto;
1906 static PyObject *__pyx_kp_u_Copy_this_clifford_object_x_cli;
1907 static PyObject *__pyx_kp_u_Copy_this_index_set_object_s_in;
1908 static PyObject *__pyx_kp_u_Cosine_of_multivector_with_opti;
1909 static PyObject *__pyx_kp_u_Even_part_of_multivector_sum_of;
1910 static PyObject *__pyx_kp_u_Even_part_of_multivector_sum_of_2;
1911 static PyObject *__pyx_kp_u_Exponential_of_multivector_x_cl;
1912 static PyObject *__pyx_kp_u_Geometric_difference_print_clif;
1913 static PyObject *__pyx_kp_u_Geometric_difference_x_clifford;
1914 static PyObject *__pyx_kp_u_Geometric_multiplicative_invers;
1915 static PyObject *__pyx_kp_u_Geometric_multiplicative_invers_2;
1916 static PyObject *__pyx_kp_u_Geometric_product_print_cliffor;
1917 static PyObject *__pyx_kp_u_Geometric_product_x_clifford_2;
1918 static PyObject *__pyx_kp_u_Geometric_quotient_print_cliffo;
1919 static PyObject *__pyx_kp_u_Geometric_quotient_x_clifford_1;
1920 static PyObject *__pyx_kp_u_Geometric_sum_print_clifford_1;
1921 static PyObject *__pyx_kp_u_Geometric_sum_x_clifford_1_x_cl;
1922 static PyObject *__pyx_kp_u_Get_the_value_of_an_index_set_o;
1923 static PyObject *__pyx_kp_u_Hyperbolic_cosine_of_multivecto;
1924 static PyObject *__pyx_kp_u_Hyperbolic_sine_of_multivector;
1925 static PyObject *__pyx_kp_u_Hyperbolic_tangent_of_multivect;
1926 static PyObject *__pyx_kp_u_Imaginary_part_deprecated_alway;
1927 static PyObject *__pyx_n_s_IndexError;
1928 static PyObject *__pyx_kp_u_Inner_product_print_clifford_1;
1929 static PyObject *__pyx_kp_u_Inner_product_x_clifford_1_x_cl;
1930 static PyObject *__pyx_kp_u_Integer_power_of_multivector_ob;
1931 static PyObject *__pyx_n_s_Integral;
1932 static PyObject *__pyx_kp_u_Inverse_cosine_of_multivector_w;
1933 static PyObject *__pyx_kp_u_Inverse_hyperbolic_cosine_of_mu;
1934 static PyObject *__pyx_kp_u_Inverse_hyperbolic_sine_of_mult;
1935 static PyObject *__pyx_kp_u_Inverse_hyperbolic_tangent_of_m;
1936 static PyObject *__pyx_kp_u_Inverse_sine_of_multivector_wit;
1937 static PyObject *__pyx_kp_u_Inverse_tangent_of_multivector;
1938 static PyObject *__pyx_kp_u_Iterate_over_the_indices_of_an;
1939 static PyObject *__pyx_kp_u_Main_involution_each_i_is_repla;
1940 static PyObject *__pyx_kp_u_Main_involution_each_i_is_repla_2;
1941 static PyObject *__pyx_kp_u_Maximum_absolute_value_of_coord;
1942 static PyObject *__pyx_kp_u_Maximum_member_index_set_1_1_2;
1943 static PyObject *__pyx_kp_u_Maximum_of_absolute_values_of_c;
1944 static PyObject *__pyx_kp_u_Maximum_positive_index_or_0_if;
1945 static PyObject *__pyx_kp_u_Minimum_member_index_set_1_1_2;
1946 static PyObject *__pyx_kp_u_Minimum_negative_index_or_0_if;
1947 static PyObject *__pyx_kp_u_Natural_logarithm_of_multivecto;
1948 static PyObject *__pyx_kp_u_Norm_sum_of_squares_of_coordina;
1949 static PyObject *__pyx_n_s_NotImplemented;
1950 static PyObject *__pyx_kp_s_Not_applicable;
1951 static PyObject *__pyx_kp_u_Not_applicable_for_a_in_cliffor;
1952 static PyObject *__pyx_kp_u_Number_of_negative_indices_incl;
1953 static PyObject *__pyx_kp_u_Number_of_positive_indices_incl;
1954 static PyObject *__pyx_kp_u_Odd_part_of_multivector_sum_of;
1955 static PyObject *__pyx_kp_u_Odd_part_of_multivector_sum_of_2;
1956 static PyObject *__pyx_kp_u_Outer_product_power_of_multivec;
1957 static PyObject *__pyx_kp_u_Outer_product_power_x_clifford;
1958 static PyObject *__pyx_kp_u_Outer_product_print_clifford_1;
1959 static PyObject *__pyx_kp_u_Outer_product_x_clifford_1_x_cl;
1960 static PyObject *__pyx_kp_u_Power_self_to_the_m_x_clifford;
1961 static PyObject *__pyx_kp_u_Power_self_to_the_m_x_clifford_2;
1962 static PyObject *__pyx_kp_u_Pure_grade_vector_part_print_cl;
1963 static PyObject *__pyx_kp_u_Pure_part_print_clifford_1_1_1;
1964 static PyObject *__pyx_kp_u_Pure_part_print_pure_clifford_1;
1965 static PyObject *__pyx_kp_u_Put_self_into_a_larger_frame_co;
1966 static PyObject *__pyx_n_s_PyClical;
1967 static PyObject *__pyx_kp_s_PyClical_pyx;
1968 static PyObject *__pyx_kp_u_Quadratic_form_rev_x_x_0_print;
1969 static PyObject *__pyx_kp_u_Quadratic_form_rev_x_x_0_print_2;
1970 static PyObject *__pyx_kp_u_Random_multivector_within_a_fra;
1971 static PyObject *__pyx_n_s_Real;
1972 static PyObject *__pyx_kp_u_Real_part_synonym_for_scalar_pa;
1973 static PyObject *__pyx_kp_u_Remove_all_terms_of_self_with_r;
1974 static PyObject *__pyx_kp_u_Reversion_eg_1_2_2_1_print_reve;
1975 static PyObject *__pyx_kp_u_Reversion_eg_clifford_1_cliffor;
1976 static PyObject *__pyx_n_s_RuntimeError;
1977 static PyObject *__pyx_kp_u_Scalar_part_clifford_1_1_1_2_sc;
1978 static PyObject *__pyx_kp_u_Scalar_part_scalar_clifford_1_1;
1979 static PyObject *__pyx_n_s_Sequence;
1980 static PyObject *__pyx_kp_u_Set_complement_not_print_index;
1981 static PyObject *__pyx_kp_u_Set_intersection_and_print_inde;
1982 static PyObject *__pyx_kp_u_Set_intersection_and_x_index_se;
1983 static PyObject *__pyx_kp_u_Set_the_value_of_an_index_set_o;
1984 static PyObject *__pyx_kp_u_Set_union_or_print_index_set_1;
1985 static PyObject *__pyx_kp_u_Set_union_or_x_index_set_1_x_in;
1986 static PyObject *__pyx_kp_u_Sign_of_geometric_product_of_tw;
1987 static PyObject *__pyx_kp_u_Sign_of_geometric_square_of_a_C;
1988 static PyObject *__pyx_kp_u_Sine_of_multivector_with_option;
1989 static PyObject *__pyx_kp_u_Square_root_of_1_which_commutes;
1990 static PyObject *__pyx_kp_u_Square_root_of_multivector_with;
1991 static PyObject *__pyx_kp_u_Subalgebra_generated_by_all_gen;
1992 static PyObject *__pyx_kp_u_Subscripting_map_from_index_set;
1993 static PyObject *__pyx_kp_u_Symmetric_set_difference_exclus;
1994 static PyObject *__pyx_kp_u_Symmetric_set_difference_exclus_2;
1995 static PyObject *__pyx_kp_u_Tangent_of_multivector_with_opt;
1996 static PyObject *__pyx_kp_u_Tests_for_functions_that_Doctes;
1997 static PyObject *__pyx_kp_u_Tests_for_functions_that_Doctes_2;
1998 static PyObject *__pyx_kp_u_The_informal_string_representat;
1999 static PyObject *__pyx_kp_u_The_informal_string_representat_2;
2000 static PyObject *__pyx_kp_u_The_official_string_representat;
2001 static PyObject *__pyx_kp_u_The_official_string_representat_2;
2002 static PyObject *__pyx_kp_s_This_comparison_operator_is_not;
2003 static PyObject *__pyx_kp_u_Transform_left_hand_side_using;
2004 static PyObject *__pyx_kp_u_Transform_left_hand_side_using_2;
2005 static PyObject *__pyx_n_s_TypeError;
2006 static PyObject *__pyx_kp_u_Unary_print_clifford_1_1;
2007 static PyObject *__pyx_kp_u_Unary_print_clifford_1_1_2;
2008 static PyObject *__pyx_n_s_ValueError;
2009 static PyObject *__pyx_kp_u_Vector_part_of_multivector_as_a;
2010 static PyObject *__pyx_kp_s__2;
2011 static PyObject *__pyx_kp_s__5;
2012 static PyObject *__pyx_kp_s__6;
2013 static PyObject *__pyx_kp_s__7;
2014 static PyObject *__pyx_kp_s__8;
2015 static PyObject *__pyx_kp_s__9;
2016 static PyObject *__pyx_kp_u_abs_line_1473;
2017 static PyObject *__pyx_n_s_acos;
2018 static PyObject *__pyx_kp_u_acos_line_1619;
2019 static PyObject *__pyx_n_s_acosh;
2020 static PyObject *__pyx_kp_u_acosh_line_1656;
2021 static PyObject *__pyx_kp_u_agc3_line_1844;
2022 static PyObject *__pyx_n_s_args;
2023 static PyObject *__pyx_kp_s_as_frame;
2024 static PyObject *__pyx_n_s_asin;
2025 static PyObject *__pyx_kp_u_asin_line_1698;
2026 static PyObject *__pyx_n_s_asinh;
2027 static PyObject *__pyx_kp_u_asinh_line_1733;
2028 static PyObject *__pyx_n_s_atan;
2029 static PyObject *__pyx_kp_u_atan_line_1769;
2030 static PyObject *__pyx_n_s_atanh;
2031 static PyObject *__pyx_kp_u_atanh_line_1798;
2032 static PyObject *__pyx_kp_u_cga3_line_1824;
2033 static PyObject *__pyx_kp_u_cga3std_line_1833;
2034 static PyObject *__pyx_n_s_cl;
2035 static PyObject *__pyx_kp_u_clifford___add___line_739;
2036 static PyObject *__pyx_kp_u_clifford___and___line_835;
2037 static PyObject *__pyx_kp_u_clifford___call___line_1019;
2038 static PyObject *__pyx_kp_u_clifford___div___line_895;
2039 static PyObject *__pyx_kp_u_clifford___getitem___line_706;
2040 static PyObject *__pyx_kp_u_clifford___iadd___line_750;
2041 static PyObject *__pyx_kp_u_clifford___iand___line_850;
2042 static PyObject *__pyx_kp_u_clifford___idiv___line_910;
2043 static PyObject *__pyx_kp_u_clifford___imod___line_820;
2044 static PyObject *__pyx_kp_u_clifford___imul___line_792;
2045 static PyObject *__pyx_kp_u_clifford___ior___line_949;
2046 static PyObject *__pyx_kp_u_clifford___isub___line_770;
2047 static PyObject *__pyx_kp_u_clifford___iter___line_637;
2048 static PyObject *__pyx_kp_u_clifford___ixor___line_880;
2049 static PyObject *__pyx_kp_u_clifford___mod___line_805;
2050 static PyObject *__pyx_kp_u_clifford___mul___line_779;
2051 static PyObject *__pyx_kp_u_clifford___neg___line_721;
2052 static PyObject *__pyx_kp_u_clifford___or___line_938;
2053 static PyObject *__pyx_kp_u_clifford___pos___line_730;
2054 static PyObject *__pyx_kp_u_clifford___pow___line_960;
2055 static PyObject *__pyx_kp_u_clifford___repr___line_1225;
2056 static PyObject *__pyx_kp_u_clifford___str___line_1234;
2057 static PyObject *__pyx_kp_u_clifford___sub___line_759;
2058 static PyObject *__pyx_kp_u_clifford___xor___line_865;
2059 static PyObject *__pyx_kp_u_clifford_abs_line_1174;
2060 static PyObject *__pyx_kp_u_clifford_conj_line_1137;
2061 static PyObject *__pyx_kp_u_clifford_copy_line_554;
2062 static PyObject *__pyx_kp_u_clifford_even_line_1060;
2063 static PyObject *__pyx_kp_u_clifford_frame_line_1214;
2064 static PyObject *__pyx_n_s_clifford_hidden_doctests;
2065 static PyObject *__pyx_kp_u_clifford_hidden_doctests_line_12;
2066 static PyObject *__pyx_kp_u_clifford_inv_line_925;
2067 static PyObject *__pyx_kp_u_clifford_involute_line_1106;
2068 static PyObject *__pyx_kp_u_clifford_isnan_line_1205;
2069 static PyObject *__pyx_kp_u_clifford_max_abs_line_1183;
2070 static PyObject *__pyx_kp_u_clifford_norm_line_1163;
2071 static PyObject *__pyx_kp_u_clifford_odd_line_1069;
2072 static PyObject *__pyx_kp_u_clifford_outer_pow_line_1003;
2073 static PyObject *__pyx_kp_u_clifford_pow_line_979;
2074 static PyObject *__pyx_kp_u_clifford_pure_line_1049;
2075 static PyObject *__pyx_kp_u_clifford_quad_line_1152;
2076 static PyObject *__pyx_kp_u_clifford_reframe_line_648;
2077 static PyObject *__pyx_kp_u_clifford_reverse_line_1122;
2078 static PyObject *__pyx_kp_u_clifford_scalar_line_1038;
2079 static PyObject *__pyx_kp_u_clifford_truncated_line_1194;
2080 static PyObject *__pyx_kp_u_clifford_vector_part_line_1078;
2081 static PyObject *__pyx_n_s_cline_in_traceback;
2082 static PyObject *__pyx_n_s_close;
2083 static PyObject *__pyx_n_s_collections;
2084 static PyObject *__pyx_kp_u_compare_line_490;
2085 static PyObject *__pyx_kp_u_complexifier_line_1527;
2086 static PyObject *__pyx_n_s_conj;
2087 static PyObject *__pyx_kp_u_conj_line_1436;
2088 static PyObject *__pyx_n_s_copy;
2089 static PyObject *__pyx_n_s_cos;
2090 static PyObject *__pyx_kp_u_cos_line_1602;
2091 static PyObject *__pyx_n_s_cosh;
2092 static PyObject *__pyx_kp_u_cosh_line_1640;
2093 static PyObject *__pyx_n_s_doctest;
2094 static PyObject *__pyx_n_s_e;
2095 static PyObject *__pyx_kp_u_e_line_1887;
2096 static PyObject *__pyx_n_s_even;
2097 static PyObject *__pyx_kp_u_even_line_1388;
2098 static PyObject *__pyx_n_s_exp;
2099 static PyObject *__pyx_kp_u_exp_line_1565;
2100 static PyObject *__pyx_n_s_fill;
2101 static PyObject *__pyx_n_s_frm;
2102 static PyObject *__pyx_kp_s_from;
2103 static PyObject *__pyx_n_s_getstate;
2104 static PyObject *__pyx_n_s_grade;
2105 static PyObject *__pyx_n_s_i;
2106 static PyObject *__pyx_kp_u_imag_line_1366;
2107 static PyObject *__pyx_n_s_import;
2108 static PyObject *__pyx_kp_u_index_set___and___line_269;
2109 static PyObject *__pyx_kp_u_index_set___getitem___line_189;
2110 static PyObject *__pyx_kp_u_index_set___iand___line_280;
2111 static PyObject *__pyx_kp_u_index_set___invert___line_238;
2112 static PyObject *__pyx_kp_u_index_set___ior___line_302;
2113 static PyObject *__pyx_n_s_index_set___iter;
2114 static PyObject *__pyx_kp_u_index_set___iter___line_227;
2115 static PyObject *__pyx_kp_u_index_set___ixor___line_258;
2116 static PyObject *__pyx_kp_u_index_set___or___line_291;
2117 static PyObject *__pyx_kp_u_index_set___repr___line_382;
2118 static PyObject *__pyx_kp_u_index_set___setitem___line_177;
2119 static PyObject *__pyx_kp_u_index_set___str___line_393;
2120 static PyObject *__pyx_kp_u_index_set___xor___line_247;
2121 static PyObject *__pyx_kp_u_index_set_copy_line_64;
2122 static PyObject *__pyx_kp_u_index_set_count_line_313;
2123 static PyObject *__pyx_kp_u_index_set_count_neg_line_322;
2124 static PyObject *__pyx_kp_u_index_set_count_pos_line_331;
2125 static PyObject *__pyx_n_s_index_set_hidden_doctests;
2126 static PyObject *__pyx_kp_u_index_set_hidden_doctests_line_4;
2127 static PyObject *__pyx_kp_u_index_set_max_line_349;
2128 static PyObject *__pyx_kp_u_index_set_min_line_340;
2129 static PyObject *__pyx_kp_u_index_set_sign_of_mult_line_364;
2130 static PyObject *__pyx_kp_u_index_set_sign_of_square_line_37;
2131 static PyObject *__pyx_n_s_inv;
2132 static PyObject *__pyx_kp_u_inv_line_1329;
2133 static PyObject *__pyx_kp_s_invalid;
2134 static PyObject *__pyx_kp_s_invalid_string;
2135 static PyObject *__pyx_n_s_involute;
2136 static PyObject *__pyx_kp_u_involute_line_1406;
2137 static PyObject *__pyx_n_s_ist;
2138 static PyObject *__pyx_n_s_istpq;
2139 static PyObject *__pyx_kp_u_istpq_line_1900;
2140 static PyObject *__pyx_n_s_iter;
2141 static PyObject *__pyx_n_s_ixt;
2142 static PyObject *__pyx_kp_u_lexicographic_compare_eg_3_4_5;
2143 static PyObject *__pyx_n_s_lhs;
2144 static PyObject *__pyx_n_s_log;
2145 static PyObject *__pyx_kp_u_log_line_1579;
2146 static PyObject *__pyx_n_s_m;
2147 static PyObject *__pyx_n_s_main;
2148 static PyObject *__pyx_n_s_math;
2149 static PyObject *__pyx_n_s_max;
2150 static PyObject *__pyx_kp_u_max_abs_line_1482;
2151 static PyObject *__pyx_kp_u_max_pos_line_511;
2152 static PyObject *__pyx_n_s_min;
2153 static PyObject *__pyx_kp_u_min_neg_line_502;
2154 static PyObject *__pyx_n_s_name;
2155 static PyObject *__pyx_n_s_nbar3;
2156 static PyObject *__pyx_n_s_ninf3;
2157 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2158 static PyObject *__pyx_n_s_norm;
2159 static PyObject *__pyx_kp_u_norm_line_1462;
2160 static PyObject *__pyx_kp_u_norm_sum_of_squares_of_coordina;
2161 static PyObject *__pyx_n_s_numbers;
2162 static PyObject *__pyx_n_s_obj;
2163 static PyObject *__pyx_n_s_odd;
2164 static PyObject *__pyx_kp_u_odd_line_1397;
2165 static PyObject *__pyx_n_s_other;
2166 static PyObject *__pyx_n_s_outer_pow;
2167 static PyObject *__pyx_kp_u_outer_pow_line_1518;
2168 static PyObject *__pyx_n_s_p;
2169 static PyObject *__pyx_n_s_pi;
2170 static PyObject *__pyx_n_s_pow;
2171 static PyObject *__pyx_kp_u_pow_line_1494;
2172 static PyObject *__pyx_n_s_pure;
2173 static PyObject *__pyx_kp_u_pure_line_1377;
2174 static PyObject *__pyx_n_s_pyx_vtable;
2175 static PyObject *__pyx_n_s_q;
2176 static PyObject *__pyx_n_s_quad;
2177 static PyObject *__pyx_kp_u_quad_line_1451;
2178 static PyObject *__pyx_kp_u_random_clifford_line_1815;
2179 static PyObject *__pyx_n_s_range;
2180 static PyObject *__pyx_kp_u_real_line_1355;
2181 static PyObject *__pyx_n_s_reduce;
2182 static PyObject *__pyx_n_s_reduce_cython;
2183 static PyObject *__pyx_n_s_reduce_ex;
2184 static PyObject *__pyx_n_s_reverse;
2185 static PyObject *__pyx_kp_u_reverse_line_1421;
2186 static PyObject *__pyx_n_s_rhs;
2187 static PyObject *__pyx_n_s_scalar;
2188 static PyObject *__pyx_kp_u_scalar_line_1344;
2189 static PyObject *__pyx_n_s_send;
2190 static PyObject *__pyx_n_s_setstate;
2191 static PyObject *__pyx_n_s_setstate_cython;
2192 static PyObject *__pyx_n_s_sin;
2193 static PyObject *__pyx_kp_u_sin_line_1679;
2194 static PyObject *__pyx_n_s_sinh;
2195 static PyObject *__pyx_kp_u_sinh_line_1719;
2196 static PyObject *__pyx_n_s_sqrt;
2197 static PyObject *__pyx_kp_u_sqrt_line_1542;
2198 static PyObject *__pyx_n_s_tan;
2199 static PyObject *__pyx_kp_u_tan_line_1752;
2200 static PyObject *__pyx_n_s_tanh;
2201 static PyObject *__pyx_kp_u_tanh_line_1786;
2202 static PyObject *__pyx_n_s_tau;
2203 static PyObject *__pyx_n_s_test;
2204 static PyObject *__pyx_n_s_test_2;
2205 static PyObject *__pyx_n_s_testmod;
2206 static PyObject *__pyx_n_s_throw;
2207 static PyObject *__pyx_kp_s_to_frame;
2208 static PyObject *__pyx_kp_s_using;
2209 static PyObject *__pyx_kp_s_using_invalid;
2210 static PyObject *__pyx_kp_s_value;
2211 static PyObject *__pyx_n_s_version;
2212 static PyObject *__pyx_n_s_xrange;
2213 static PyObject *__pyx_pf_8PyClical_9index_set_copy(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2214 static int __pyx_pf_8PyClical_9index_set_2__cinit__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_other);
2215 static void __pyx_pf_8PyClical_9index_set_4__dealloc__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2216 static PyObject *__pyx_pf_8PyClical_9index_set_6__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op);
2217 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);
2218 static PyObject *__pyx_pf_8PyClical_9index_set_10__getitem__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_idx);
2219 static int __pyx_pf_8PyClical_9index_set_12__contains__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_idx);
2220 static PyObject *__pyx_pf_8PyClical_9index_set_14__iter__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2221 static PyObject *__pyx_pf_8PyClical_9index_set_17__invert__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2222 static PyObject *__pyx_pf_8PyClical_9index_set_19__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2223 static PyObject *__pyx_pf_8PyClical_9index_set_21__ixor__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs);
2224 static PyObject *__pyx_pf_8PyClical_9index_set_23__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2225 static PyObject *__pyx_pf_8PyClical_9index_set_25__iand__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs);
2226 static PyObject *__pyx_pf_8PyClical_9index_set_27__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2227 static PyObject *__pyx_pf_8PyClical_9index_set_29__ior__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs);
2228 static PyObject *__pyx_pf_8PyClical_9index_set_31count(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2229 static PyObject *__pyx_pf_8PyClical_9index_set_33count_neg(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2230 static PyObject *__pyx_pf_8PyClical_9index_set_35count_pos(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2231 static PyObject *__pyx_pf_8PyClical_9index_set_37min(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2232 static PyObject *__pyx_pf_8PyClical_9index_set_39max(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2233 static PyObject *__pyx_pf_8PyClical_9index_set_41hash_fn(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2234 static PyObject *__pyx_pf_8PyClical_9index_set_43sign_of_mult(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs);
2235 static PyObject *__pyx_pf_8PyClical_9index_set_45sign_of_square(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2236 static PyObject *__pyx_pf_8PyClical_9index_set_47__repr__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2237 static PyObject *__pyx_pf_8PyClical_9index_set_49__str__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2238 static PyObject *__pyx_pf_8PyClical_9index_set_51__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2239 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);
2240 static PyObject *__pyx_pf_8PyClical_index_set_hidden_doctests(CYTHON_UNUSED PyObject *__pyx_self);
2241 static PyObject *__pyx_pf_8PyClical_2compare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2242 static PyObject *__pyx_pf_8PyClical_4min_neg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2243 static PyObject *__pyx_pf_8PyClical_6max_pos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2244 static PyObject *__pyx_pf_8PyClical_8clifford_copy(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2245 static int __pyx_pf_8PyClical_8clifford_2__cinit__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_ixt);
2246 static void __pyx_pf_8PyClical_8clifford_4__dealloc__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2247 static int __pyx_pf_8PyClical_8clifford_6__contains__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_x);
2248 static PyObject *__pyx_pf_8PyClical_8clifford_8__iter__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2249 static PyObject *__pyx_pf_8PyClical_8clifford_10reframe(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_ixt);
2250 static PyObject *__pyx_pf_8PyClical_8clifford_12__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op);
2251 static PyObject *__pyx_pf_8PyClical_8clifford_14__getitem__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_ixt);
2252 static PyObject *__pyx_pf_8PyClical_8clifford_16__neg__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2253 static PyObject *__pyx_pf_8PyClical_8clifford_18__pos__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2254 static PyObject *__pyx_pf_8PyClical_8clifford_20__add__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2255 static PyObject *__pyx_pf_8PyClical_8clifford_22__iadd__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2256 static PyObject *__pyx_pf_8PyClical_8clifford_24__sub__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2257 static PyObject *__pyx_pf_8PyClical_8clifford_26__isub__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2258 static PyObject *__pyx_pf_8PyClical_8clifford_28__mul__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2259 static PyObject *__pyx_pf_8PyClical_8clifford_30__imul__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2260 static PyObject *__pyx_pf_8PyClical_8clifford_32__mod__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2261 static PyObject *__pyx_pf_8PyClical_8clifford_34__imod__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2262 static PyObject *__pyx_pf_8PyClical_8clifford_36__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2263 static PyObject *__pyx_pf_8PyClical_8clifford_38__iand__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2264 static PyObject *__pyx_pf_8PyClical_8clifford_40__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2265 static PyObject *__pyx_pf_8PyClical_8clifford_42__ixor__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2266 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 2267 static PyObject *__pyx_pf_8PyClical_8clifford_44__div__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2269 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 2270 static PyObject *__pyx_pf_8PyClical_8clifford_46__idiv__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2272 static PyObject *__pyx_pf_8PyClical_8clifford_48inv(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2273 static PyObject *__pyx_pf_8PyClical_8clifford_50__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2274 static PyObject *__pyx_pf_8PyClical_8clifford_52__ior__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2275 static PyObject *__pyx_pf_8PyClical_8clifford_54__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_m, CYTHON_UNUSED PyObject *__pyx_v_dummy);
2276 static PyObject *__pyx_pf_8PyClical_8clifford_56pow(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_m);
2277 static PyObject *__pyx_pf_8PyClical_8clifford_58outer_pow(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_m);
2278 static PyObject *__pyx_pf_8PyClical_8clifford_60__call__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_grade);
2279 static PyObject *__pyx_pf_8PyClical_8clifford_62scalar(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2280 static PyObject *__pyx_pf_8PyClical_8clifford_64pure(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2281 static PyObject *__pyx_pf_8PyClical_8clifford_66even(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2282 static PyObject *__pyx_pf_8PyClical_8clifford_68odd(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2283 static PyObject *__pyx_pf_8PyClical_8clifford_70vector_part(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_frm);
2284 static PyObject *__pyx_pf_8PyClical_8clifford_72involute(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2285 static PyObject *__pyx_pf_8PyClical_8clifford_74reverse(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2286 static PyObject *__pyx_pf_8PyClical_8clifford_76conj(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2287 static PyObject *__pyx_pf_8PyClical_8clifford_78quad(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2288 static PyObject *__pyx_pf_8PyClical_8clifford_80norm(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2289 static PyObject *__pyx_pf_8PyClical_8clifford_82abs(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2290 static PyObject *__pyx_pf_8PyClical_8clifford_84max_abs(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2291 static PyObject *__pyx_pf_8PyClical_8clifford_86truncated(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_limit);
2292 static PyObject *__pyx_pf_8PyClical_8clifford_88isnan(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2293 static PyObject *__pyx_pf_8PyClical_8clifford_90frame(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2294 static PyObject *__pyx_pf_8PyClical_8clifford_92__repr__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2295 static PyObject *__pyx_pf_8PyClical_8clifford_94__str__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2296 static PyObject *__pyx_pf_8PyClical_8clifford_96__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2297 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);
2298 static PyObject *__pyx_pf_8PyClical_8clifford_hidden_doctests(CYTHON_UNUSED PyObject *__pyx_self);
2299 static PyObject *__pyx_pf_8PyClical_10inv(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2300 static PyObject *__pyx_pf_8PyClical_12scalar(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2301 static PyObject *__pyx_pf_8PyClical_14real(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2302 static PyObject *__pyx_pf_8PyClical_16imag(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2303 static PyObject *__pyx_pf_8PyClical_18pure(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2304 static PyObject *__pyx_pf_8PyClical_20even(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2305 static PyObject *__pyx_pf_8PyClical_22odd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2306 static PyObject *__pyx_pf_8PyClical_24involute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2307 static PyObject *__pyx_pf_8PyClical_26reverse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2308 static PyObject *__pyx_pf_8PyClical_28conj(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2309 static PyObject *__pyx_pf_8PyClical_30quad(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2310 static PyObject *__pyx_pf_8PyClical_32norm(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2311 static PyObject *__pyx_pf_8PyClical_34abs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2312 static PyObject *__pyx_pf_8PyClical_36max_abs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2313 static PyObject *__pyx_pf_8PyClical_38pow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_m);
2314 static PyObject *__pyx_pf_8PyClical_40outer_pow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_m);
2315 static PyObject *__pyx_pf_8PyClical_42complexifier(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2316 static PyObject *__pyx_pf_8PyClical_44sqrt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2317 static PyObject *__pyx_pf_8PyClical_46exp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2318 static PyObject *__pyx_pf_8PyClical_48log(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2319 static PyObject *__pyx_pf_8PyClical_50cos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2320 static PyObject *__pyx_pf_8PyClical_52acos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2321 static PyObject *__pyx_pf_8PyClical_54cosh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2322 static PyObject *__pyx_pf_8PyClical_56acosh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2323 static PyObject *__pyx_pf_8PyClical_58sin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2324 static PyObject *__pyx_pf_8PyClical_60asin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2325 static PyObject *__pyx_pf_8PyClical_62sinh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2326 static PyObject *__pyx_pf_8PyClical_64asinh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2327 static PyObject *__pyx_pf_8PyClical_66tan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2328 static PyObject *__pyx_pf_8PyClical_68atan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2329 static PyObject *__pyx_pf_8PyClical_70tanh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2330 static PyObject *__pyx_pf_8PyClical_72atanh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2331 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);
2332 static PyObject *__pyx_pf_8PyClical_76cga3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2333 static PyObject *__pyx_pf_8PyClical_78cga3std(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2334 static PyObject *__pyx_pf_8PyClical_80agc3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2335 static PyObject *__pyx_pf_8PyClical_82e(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2336 static PyObject *__pyx_pf_8PyClical_84istpq(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_p, PyObject *__pyx_v_q);
2337 static PyObject *__pyx_pf_8PyClical_86_test(CYTHON_UNUSED PyObject *__pyx_self);
2338 static PyObject *__pyx_tp_new_8PyClical_index_set(PyTypeObject *t, PyObject *a, PyObject *k);
2339 static PyObject *__pyx_tp_new_8PyClical_clifford(PyTypeObject *t, PyObject *a, PyObject *k);
2340 static PyObject *__pyx_tp_new_8PyClical___pyx_scope_struct____iter__(PyTypeObject *t, PyObject *a, PyObject *k);
2341 static PyObject *__pyx_float_0_0;
2342 static PyObject *__pyx_float_1_0;
2343 static PyObject *__pyx_float_2_0;
2344 static PyObject *__pyx_float_8_0;
2345 static PyObject *__pyx_int_0;
2346 static PyObject *__pyx_int_1;
2347 static PyObject *__pyx_int_4;
2348 static PyObject *__pyx_int_neg_1;
2349 static PyObject *__pyx_tuple__3;
2350 static PyObject *__pyx_tuple__4;
2351 static PyObject *__pyx_tuple__10;
2352 static PyObject *__pyx_tuple__11;
2353 static PyObject *__pyx_tuple__12;
2354 static PyObject *__pyx_tuple__13;
2355 static PyObject *__pyx_tuple__16;
2356 static PyObject *__pyx_tuple__17;
2357 static PyObject *__pyx_tuple__19;
2358 static PyObject *__pyx_tuple__21;
2359 static PyObject *__pyx_tuple__22;
2360 static PyObject *__pyx_tuple__23;
2361 static PyObject *__pyx_tuple__24;
2362 static PyObject *__pyx_tuple__25;
2363 static PyObject *__pyx_codeobj__14;
2364 static PyObject *__pyx_codeobj__15;
2365 static PyObject *__pyx_codeobj__18;
2366 static PyObject *__pyx_codeobj__20;
2367 static PyObject *__pyx_codeobj__26;
2377 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_toIndexSet(PyObject *__pyx_v_obj) {
2379 __Pyx_RefNannyDeclarations
2380 PyObject *__pyx_t_1 = NULL;
2381 PyObject *__pyx_t_2 = NULL;
2382 __Pyx_RefNannySetupContext(
"toIndexSet", 0);
2391 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
2392 __Pyx_GOTREF(__pyx_t_1);
2393 __Pyx_INCREF(__pyx_v_obj);
2394 __Pyx_GIVEREF(__pyx_v_obj);
2395 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_obj);
2396 __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)
2397 __Pyx_GOTREF(__pyx_t_2);
2398 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2399 __pyx_r = (((
struct __pyx_obj_8PyClical_index_set *)__pyx_t_2)->instance[0]);
2400 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2413 __Pyx_XDECREF(__pyx_t_1);
2414 __Pyx_XDECREF(__pyx_t_2);
2415 __Pyx_WriteUnraisable(
"PyClical.toIndexSet", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
2416 __Pyx_pretend_to_initialize(&__pyx_r);
2418 __Pyx_RefNannyFinishContext();
2430 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_9index_set_wrap(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self,
IndexSet __pyx_v_other) {
2431 PyObject *__pyx_r = NULL;
2432 __Pyx_RefNannyDeclarations
2433 __Pyx_RefNannySetupContext(
"wrap", 0);
2442 (__pyx_v_self->instance[0]) = __pyx_v_other;
2451 __Pyx_XDECREF(__pyx_r);
2452 __Pyx_INCREF(((PyObject *)__pyx_v_self));
2453 __pyx_r = ((PyObject *)__pyx_v_self);
2466 __Pyx_XGIVEREF(__pyx_r);
2467 __Pyx_RefNannyFinishContext();
2479 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_9index_set_unwrap(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
2481 __Pyx_RefNannyDeclarations
2482 __Pyx_RefNannySetupContext(
"unwrap", 0);
2491 __pyx_r = (__pyx_v_self->instance[0]);
2504 __Pyx_RefNannyFinishContext();
2516 static PyObject *__pyx_pw_8PyClical_9index_set_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
2517 static PyObject *__pyx_f_8PyClical_9index_set_copy(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self,
int __pyx_skip_dispatch) {
2518 PyObject *__pyx_r = NULL;
2519 __Pyx_RefNannyDeclarations
2520 PyObject *__pyx_t_1 = NULL;
2521 PyObject *__pyx_t_2 = NULL;
2522 PyObject *__pyx_t_3 = NULL;
2523 PyObject *__pyx_t_4 = NULL;
2524 __Pyx_RefNannySetupContext(
"copy", 0);
2526 if (unlikely(__pyx_skip_dispatch)) ;
2528 else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
2529 __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)
2530 __Pyx_GOTREF(__pyx_t_1);
2531 if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_8PyClical_9index_set_1copy)) {
2532 __Pyx_XDECREF(__pyx_r);
2533 __Pyx_INCREF(__pyx_t_1);
2534 __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
2535 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
2536 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
2537 if (likely(__pyx_t_4)) {
2538 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
2539 __Pyx_INCREF(__pyx_t_4);
2540 __Pyx_INCREF(
function);
2541 __Pyx_DECREF_SET(__pyx_t_3,
function);
2545 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error)
2546 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2548 __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error)
2550 __Pyx_GOTREF(__pyx_t_2);
2551 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2552 __pyx_r = __pyx_t_2;
2554 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2557 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2567 __Pyx_XDECREF(__pyx_r);
2568 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error)
2569 __Pyx_GOTREF(__pyx_t_1);
2570 __Pyx_INCREF(((PyObject *)__pyx_v_self));
2571 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
2572 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
2573 __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)
2574 __Pyx_GOTREF(__pyx_t_2);
2575 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2576 __pyx_r = __pyx_t_2;
2590 __Pyx_XDECREF(__pyx_t_1);
2591 __Pyx_XDECREF(__pyx_t_2);
2592 __Pyx_XDECREF(__pyx_t_3);
2593 __Pyx_XDECREF(__pyx_t_4);
2594 __Pyx_AddTraceback(
"PyClical.index_set.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
2597 __Pyx_XGIVEREF(__pyx_r);
2598 __Pyx_RefNannyFinishContext();
2603 static PyObject *__pyx_pw_8PyClical_9index_set_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
2604 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 ";
2605 static PyObject *__pyx_pw_8PyClical_9index_set_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
2606 PyObject *__pyx_r = 0;
2607 __Pyx_RefNannyDeclarations
2608 __Pyx_RefNannySetupContext(
"copy (wrapper)", 0);
2609 __pyx_r = __pyx_pf_8PyClical_9index_set_copy(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
2612 __Pyx_RefNannyFinishContext();
2616 static PyObject *__pyx_pf_8PyClical_9index_set_copy(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
2617 PyObject *__pyx_r = NULL;
2618 __Pyx_RefNannyDeclarations
2619 PyObject *__pyx_t_1 = NULL;
2620 __Pyx_RefNannySetupContext(
"copy", 0);
2621 __Pyx_XDECREF(__pyx_r);
2622 __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)
2623 __Pyx_GOTREF(__pyx_t_1);
2624 __pyx_r = __pyx_t_1;
2630 __Pyx_XDECREF(__pyx_t_1);
2631 __Pyx_AddTraceback(
"PyClical.index_set.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
2634 __Pyx_XGIVEREF(__pyx_r);
2635 __Pyx_RefNannyFinishContext();
2648 static int __pyx_pw_8PyClical_9index_set_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2649 static int __pyx_pw_8PyClical_9index_set_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2650 PyObject *__pyx_v_other = 0;
2652 __Pyx_RefNannyDeclarations
2653 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
2655 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,0};
2656 PyObject* values[1] = {0};
2657 values[0] = ((PyObject *)__pyx_int_0);
2658 if (unlikely(__pyx_kwds)) {
2660 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2662 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2665 default:
goto __pyx_L5_argtuple_error;
2667 kw_args = PyDict_Size(__pyx_kwds);
2671 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other);
2672 if (value) { values[0] = value; kw_args--; }
2675 if (unlikely(kw_args > 0)) {
2676 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(0, 73, __pyx_L3_error)
2679 switch (PyTuple_GET_SIZE(__pyx_args)) {
2680 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2683 default:
goto __pyx_L5_argtuple_error;
2686 __pyx_v_other = values[0];
2688 goto __pyx_L4_argument_unpacking_done;
2689 __pyx_L5_argtuple_error:;
2690 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 73, __pyx_L3_error)
2692 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2693 __Pyx_RefNannyFinishContext();
2695 __pyx_L4_argument_unpacking_done:;
2696 __pyx_r = __pyx_pf_8PyClical_9index_set_2__cinit__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), __pyx_v_other);
2699 __Pyx_RefNannyFinishContext();
2703 static int __pyx_pf_8PyClical_9index_set_2__cinit__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_other) {
2704 PyObject *__pyx_v_error_msg_prefix = NULL;
2705 PyObject *__pyx_v_idx = NULL;
2707 __Pyx_RefNannyDeclarations
2711 PyObject *__pyx_t_4 = NULL;
2712 PyObject *__pyx_t_5 = NULL;
2715 PyObject *__pyx_t_8 = NULL;
2716 PyObject *__pyx_t_9 = NULL;
2717 PyObject *__pyx_t_10 = NULL;
2718 Py_ssize_t __pyx_t_11;
2719 PyObject *(*__pyx_t_12)(PyObject *);
2720 PyObject *__pyx_t_13 = NULL;
2721 PyObject *__pyx_t_14 = NULL;
2722 PyObject *__pyx_t_15 = NULL;
2723 PyObject *__pyx_t_16 = NULL;
2725 __Pyx_RefNannySetupContext(
"__cinit__", 0);
2734 __Pyx_INCREF(__pyx_kp_s_Cannot_initialize_index_set_obje);
2735 __pyx_v_error_msg_prefix = __pyx_kp_s_Cannot_initialize_index_set_obje;
2744 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8PyClical_index_set);
2745 __pyx_t_2 = (__pyx_t_1 != 0);
2756 __pyx_t_3 =
new IndexSet(__pyx_f_8PyClical_9index_set_unwrap(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_other)));
2758 __Pyx_CppExn2PyErr();
2759 __PYX_ERR(0, 94, __pyx_L1_error)
2761 __pyx_v_self->instance = __pyx_t_3;
2780 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numbers);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 95, __pyx_L1_error)
2781 __Pyx_GOTREF(__pyx_t_4);
2782 __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)
2783 __Pyx_GOTREF(__pyx_t_5);
2784 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2785 __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)
2786 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2787 __pyx_t_1 = (__pyx_t_2 != 0);
2797 __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)
2799 __pyx_t_3 =
new IndexSet(((
int)__pyx_t_6));
2801 __Pyx_CppExn2PyErr();
2802 __PYX_ERR(0, 96, __pyx_L1_error)
2804 __pyx_v_self->instance = __pyx_t_3;
2823 __pyx_t_2 = PySet_Check(__pyx_v_other);
2824 __pyx_t_7 = (__pyx_t_2 != 0);
2827 __pyx_t_1 = __pyx_t_7;
2828 goto __pyx_L4_bool_binop_done;
2830 __pyx_t_7 = PyFrozenSet_Check(__pyx_v_other);
2831 __pyx_t_2 = (__pyx_t_7 != 0);
2832 __pyx_t_1 = __pyx_t_2;
2833 __pyx_L4_bool_binop_done:;
2834 __pyx_t_2 = (__pyx_t_1 != 0);
2845 __Pyx_PyThreadState_declare
2846 __Pyx_PyThreadState_assign
2847 __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
2848 __Pyx_XGOTREF(__pyx_t_8);
2849 __Pyx_XGOTREF(__pyx_t_9);
2850 __Pyx_XGOTREF(__pyx_t_10);
2861 __pyx_v_self->instance = __pyx_t_3;
2870 if (likely(PyList_CheckExact(__pyx_v_other)) || PyTuple_CheckExact(__pyx_v_other)) {
2871 __pyx_t_5 = __pyx_v_other; __Pyx_INCREF(__pyx_t_5); __pyx_t_11 = 0;
2874 __pyx_t_11 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_other);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 100, __pyx_L6_error)
2875 __Pyx_GOTREF(__pyx_t_5);
2876 __pyx_t_12 = Py_TYPE(__pyx_t_5)->tp_iternext;
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 100, __pyx_L6_error)
2879 if (likely(!__pyx_t_12)) {
2880 if (likely(PyList_CheckExact(__pyx_t_5))) {
2881 if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_5))
break;
2882 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 2883 __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)
2885 __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)
2886 __Pyx_GOTREF(__pyx_t_4);
2889 if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_5))
break;
2890 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 2891 __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)
2893 __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)
2894 __Pyx_GOTREF(__pyx_t_4);
2898 __pyx_t_4 = __pyx_t_12(__pyx_t_5);
2899 if (unlikely(!__pyx_t_4)) {
2900 PyObject* exc_type = PyErr_Occurred();
2902 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
2903 else __PYX_ERR(0, 100, __pyx_L6_error)
2907 __Pyx_GOTREF(__pyx_t_4);
2909 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_4);
2919 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self), __pyx_v_idx, Py_True) < 0)) __PYX_ERR(0, 101, __pyx_L6_error)
2929 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2939 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
2940 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
2941 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
2942 goto __pyx_L11_try_end;
2944 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
2945 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
2954 __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_IndexError);
2956 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2957 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_13) < 0) __PYX_ERR(0, 102, __pyx_L8_except_error)
2958 __Pyx_GOTREF(__pyx_t_5);
2959 __Pyx_GOTREF(__pyx_t_4);
2960 __Pyx_GOTREF(__pyx_t_13);
2969 __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)
2970 __Pyx_GOTREF(__pyx_t_14);
2971 __pyx_t_15 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 103, __pyx_L8_except_error)
2972 __Pyx_GOTREF(__pyx_t_15);
2973 __pyx_t_16 = PyNumber_Add(__pyx_t_14, __pyx_t_15);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 103, __pyx_L8_except_error)
2974 __Pyx_GOTREF(__pyx_t_16);
2975 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
2976 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
2977 __pyx_t_15 = PyNumber_Add(__pyx_t_16, __pyx_kp_s_);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 103, __pyx_L8_except_error)
2978 __Pyx_GOTREF(__pyx_t_15);
2979 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
2980 __pyx_t_16 = PyTuple_New(1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 103, __pyx_L8_except_error)
2981 __Pyx_GOTREF(__pyx_t_16);
2982 __Pyx_GIVEREF(__pyx_t_15);
2983 PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_15);
2985 __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)
2986 __Pyx_GOTREF(__pyx_t_15);
2987 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
2988 __Pyx_Raise(__pyx_t_15, 0, 0, 0);
2989 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
2990 __PYX_ERR(0, 103, __pyx_L8_except_error)
3000 __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
3002 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3003 if (__Pyx_GetException(&__pyx_t_13, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(0, 104, __pyx_L8_except_error)
3004 __Pyx_GOTREF(__pyx_t_13);
3005 __Pyx_GOTREF(__pyx_t_4);
3006 __Pyx_GOTREF(__pyx_t_5);
3015 __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)
3016 __Pyx_GOTREF(__pyx_t_15);
3017 __pyx_t_16 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 105, __pyx_L8_except_error)
3018 __Pyx_GOTREF(__pyx_t_16);
3019 __pyx_t_14 = PyNumber_Add(__pyx_t_15, __pyx_t_16);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 105, __pyx_L8_except_error)
3020 __Pyx_GOTREF(__pyx_t_14);
3021 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3022 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3023 __pyx_t_16 = PyNumber_Add(__pyx_t_14, __pyx_kp_s_);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 105, __pyx_L8_except_error)
3024 __Pyx_GOTREF(__pyx_t_16);
3025 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3026 __pyx_t_14 = PyTuple_New(1);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 105, __pyx_L8_except_error)
3027 __Pyx_GOTREF(__pyx_t_14);
3028 __Pyx_GIVEREF(__pyx_t_16);
3029 PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_16);
3031 __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)
3032 __Pyx_GOTREF(__pyx_t_16);
3033 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3034 __Pyx_Raise(__pyx_t_16, 0, 0, 0);
3035 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3036 __PYX_ERR(0, 105, __pyx_L8_except_error)
3038 goto __pyx_L8_except_error;
3039 __pyx_L8_except_error:;
3048 __Pyx_XGIVEREF(__pyx_t_8);
3049 __Pyx_XGIVEREF(__pyx_t_9);
3050 __Pyx_XGIVEREF(__pyx_t_10);
3051 __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
3052 goto __pyx_L1_error;
3073 __pyx_t_2 = PyString_Check(__pyx_v_other);
3074 __pyx_t_1 = (__pyx_t_2 != 0);
3085 __Pyx_PyThreadState_declare
3086 __Pyx_PyThreadState_assign
3087 __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
3088 __Pyx_XGOTREF(__pyx_t_10);
3089 __Pyx_XGOTREF(__pyx_t_9);
3090 __Pyx_XGOTREF(__pyx_t_8);
3100 __pyx_t_17 = __Pyx_PyObject_AsWritableString(__pyx_v_other);
if (unlikely((!__pyx_t_17) && PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L18_error)
3102 __pyx_t_3 =
new IndexSet(((
char *)__pyx_t_17));
3104 __Pyx_CppExn2PyErr();
3105 __PYX_ERR(0, 108, __pyx_L18_error)
3107 __pyx_v_self->instance = __pyx_t_3;
3117 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3118 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
3119 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3120 goto __pyx_L23_try_end;
3122 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
3123 __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
3124 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
3125 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
3126 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3127 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3136 __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
3138 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3139 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_13) < 0) __PYX_ERR(0, 109, __pyx_L20_except_error)
3140 __Pyx_GOTREF(__pyx_t_5);
3141 __Pyx_GOTREF(__pyx_t_4);
3142 __Pyx_GOTREF(__pyx_t_13);
3151 __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)
3152 __Pyx_GOTREF(__pyx_t_16);
3153 __pyx_t_14 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 110, __pyx_L20_except_error)
3154 __Pyx_GOTREF(__pyx_t_14);
3155 __pyx_t_15 = PyNumber_Add(__pyx_t_16, __pyx_t_14);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 110, __pyx_L20_except_error)
3156 __Pyx_GOTREF(__pyx_t_15);
3157 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3158 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3159 __pyx_t_14 = PyNumber_Add(__pyx_t_15, __pyx_kp_s_);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 110, __pyx_L20_except_error)
3160 __Pyx_GOTREF(__pyx_t_14);
3161 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3162 __pyx_t_15 = PyTuple_New(1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 110, __pyx_L20_except_error)
3163 __Pyx_GOTREF(__pyx_t_15);
3164 __Pyx_GIVEREF(__pyx_t_14);
3165 PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_14);
3167 __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)
3168 __Pyx_GOTREF(__pyx_t_14);
3169 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3170 __Pyx_Raise(__pyx_t_14, 0, 0, 0);
3171 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3172 __PYX_ERR(0, 110, __pyx_L20_except_error)
3174 goto __pyx_L20_except_error;
3175 __pyx_L20_except_error:;
3184 __Pyx_XGIVEREF(__pyx_t_10);
3185 __Pyx_XGIVEREF(__pyx_t_9);
3186 __Pyx_XGIVEREF(__pyx_t_8);
3187 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8);
3188 goto __pyx_L1_error;
3210 __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)
3211 __Pyx_GOTREF(__pyx_t_13);
3212 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 112, __pyx_L1_error)
3213 __Pyx_GOTREF(__pyx_t_4);
3214 __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_other)));
3215 __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_other)));
3216 PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)Py_TYPE(__pyx_v_other)));
3217 __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)
3218 __Pyx_GOTREF(__pyx_t_5);
3219 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3220 __pyx_t_4 = PyNumber_Add(__pyx_t_13, __pyx_t_5);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 112, __pyx_L1_error)
3221 __Pyx_GOTREF(__pyx_t_4);
3222 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
3223 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3224 __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_kp_s_);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 112, __pyx_L1_error)
3225 __Pyx_GOTREF(__pyx_t_5);
3226 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3227 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 112, __pyx_L1_error)
3228 __Pyx_GOTREF(__pyx_t_4);
3229 __Pyx_GIVEREF(__pyx_t_5);
3230 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
3232 __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)
3233 __Pyx_GOTREF(__pyx_t_5);
3234 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3235 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
3236 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3237 __PYX_ERR(0, 112, __pyx_L1_error)
3253 __Pyx_XDECREF(__pyx_t_4);
3254 __Pyx_XDECREF(__pyx_t_5);
3255 __Pyx_XDECREF(__pyx_t_13);
3256 __Pyx_XDECREF(__pyx_t_14);
3257 __Pyx_XDECREF(__pyx_t_15);
3258 __Pyx_XDECREF(__pyx_t_16);
3259 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3262 __Pyx_XDECREF(__pyx_v_error_msg_prefix);
3263 __Pyx_XDECREF(__pyx_v_idx);
3264 __Pyx_RefNannyFinishContext();
3277 static void __pyx_pw_8PyClical_9index_set_5__dealloc__(PyObject *__pyx_v_self);
3278 static void __pyx_pw_8PyClical_9index_set_5__dealloc__(PyObject *__pyx_v_self) {
3279 __Pyx_RefNannyDeclarations
3280 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
3281 __pyx_pf_8PyClical_9index_set_4__dealloc__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
3284 __Pyx_RefNannyFinishContext();
3287 static void __pyx_pf_8PyClical_9index_set_4__dealloc__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
3288 __Pyx_RefNannyDeclarations
3289 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
3298 delete __pyx_v_self->instance;
3309 __Pyx_RefNannyFinishContext();
3321 static PyObject *__pyx_pw_8PyClical_9index_set_7__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op);
3322 static PyObject *__pyx_pw_8PyClical_9index_set_7__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op) {
3323 PyObject *__pyx_r = 0;
3324 __Pyx_RefNannyDeclarations
3325 __Pyx_RefNannySetupContext(
"__richcmp__ (wrapper)", 0);
3326 __pyx_r = __pyx_pf_8PyClical_9index_set_6__richcmp__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs), ((
int)__pyx_v_op));
3329 __Pyx_RefNannyFinishContext();
3333 static PyObject *__pyx_pf_8PyClical_9index_set_6__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op) {
3334 PyObject *__pyx_v_eq = NULL;
3335 PyObject *__pyx_v_lt = NULL;
3336 PyObject *__pyx_r = NULL;
3337 __Pyx_RefNannyDeclarations
3341 PyObject *__pyx_t_4 = NULL;
3342 __Pyx_RefNannySetupContext(
"__richcmp__", 0);
3351 __pyx_t_2 = (__pyx_v_lhs == Py_None);
3352 __pyx_t_3 = (__pyx_t_2 != 0);
3355 __pyx_t_1 = __pyx_t_3;
3356 goto __pyx_L4_bool_binop_done;
3358 __pyx_t_3 = (__pyx_v_rhs == Py_None);
3359 __pyx_t_2 = (__pyx_t_3 != 0);
3360 __pyx_t_1 = __pyx_t_2;
3361 __pyx_L4_bool_binop_done:;
3371 __pyx_t_1 = (__pyx_v_lhs == __pyx_v_rhs);
3372 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 142, __pyx_L1_error)
3373 __Pyx_GOTREF(__pyx_t_4);
3374 __pyx_v_eq = __pyx_t_4;
3384 switch (__pyx_v_op) {
3394 __Pyx_XDECREF(__pyx_r);
3395 __Pyx_INCREF(__pyx_v_eq);
3396 __pyx_r = __pyx_v_eq;
3424 __Pyx_XDECREF(__pyx_r);
3425 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_eq);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 146, __pyx_L1_error)
3426 __pyx_t_4 = __Pyx_PyBool_FromLong((!__pyx_t_1));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error)
3427 __Pyx_GOTREF(__pyx_t_4);
3428 __pyx_r = __pyx_t_4;
3449 __pyx_t_1 = ((__pyx_v_op == 0) != 0);
3459 __Pyx_XDECREF(__pyx_r);
3460 __Pyx_INCREF(Py_False);
3480 __pyx_t_1 = ((__pyx_v_op == 1) != 0);
3490 __Pyx_XDECREF(__pyx_r);
3491 __Pyx_INCREF(__pyx_v_eq);
3492 __pyx_r = __pyx_v_eq;
3511 __pyx_t_1 = ((__pyx_v_op == 4) != 0);
3521 __Pyx_XDECREF(__pyx_r);
3522 __Pyx_INCREF(Py_False);
3542 __pyx_t_1 = ((__pyx_v_op == 5) != 0);
3552 __Pyx_XDECREF(__pyx_r);
3553 __Pyx_INCREF(__pyx_v_eq);
3554 __pyx_r = __pyx_v_eq;
3574 __Pyx_XDECREF(__pyx_r);
3575 __Pyx_INCREF(__pyx_builtin_NotImplemented);
3576 __pyx_r = __pyx_builtin_NotImplemented;
3599 __pyx_t_1 = (__pyx_f_8PyClical_toIndexSet(__pyx_v_lhs) == __pyx_f_8PyClical_toIndexSet(__pyx_v_rhs));
3600 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error)
3601 __Pyx_GOTREF(__pyx_t_4);
3602 __pyx_v_eq = __pyx_t_4;
3612 switch (__pyx_v_op) {
3622 __Pyx_XDECREF(__pyx_r);
3623 __Pyx_INCREF(__pyx_v_eq);
3624 __pyx_r = __pyx_v_eq;
3652 __Pyx_XDECREF(__pyx_r);
3653 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_eq);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 163, __pyx_L1_error)
3654 __pyx_t_4 = __Pyx_PyBool_FromLong((!__pyx_t_1));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error)
3655 __Pyx_GOTREF(__pyx_t_4);
3656 __pyx_r = __pyx_t_4;
3677 __pyx_t_1 = (__pyx_f_8PyClical_toIndexSet(__pyx_v_lhs) < __pyx_f_8PyClical_toIndexSet(__pyx_v_rhs));
3678 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error)
3679 __Pyx_GOTREF(__pyx_t_4);
3680 __pyx_v_lt = __pyx_t_4;
3690 __pyx_t_1 = ((__pyx_v_op == 0) != 0);
3700 __Pyx_XDECREF(__pyx_r);
3701 __Pyx_INCREF(__pyx_v_lt);
3702 __pyx_r = __pyx_v_lt;
3721 __pyx_t_1 = ((__pyx_v_op == 1) != 0);
3731 __Pyx_XDECREF(__pyx_r);
3732 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_lt);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 169, __pyx_L1_error)
3735 __Pyx_INCREF(__pyx_v_lt);
3736 __pyx_t_4 = __pyx_v_lt;
3737 goto __pyx_L8_bool_binop_done;
3739 __Pyx_INCREF(__pyx_v_eq);
3740 __pyx_t_4 = __pyx_v_eq;
3741 __pyx_L8_bool_binop_done:;
3742 __pyx_r = __pyx_t_4;
3762 __pyx_t_1 = ((__pyx_v_op == 4) != 0);
3772 __Pyx_XDECREF(__pyx_r);
3773 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_lt);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 171, __pyx_L1_error)
3776 __pyx_t_1 = __pyx_t_2;
3777 goto __pyx_L10_bool_binop_done;
3779 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_eq);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 171, __pyx_L1_error)
3780 __pyx_t_1 = __pyx_t_2;
3781 __pyx_L10_bool_binop_done:;
3782 __pyx_t_4 = __Pyx_PyBool_FromLong((!__pyx_t_1));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error)
3783 __Pyx_GOTREF(__pyx_t_4);
3784 __pyx_r = __pyx_t_4;
3804 __pyx_t_1 = ((__pyx_v_op == 5) != 0);
3814 __Pyx_XDECREF(__pyx_r);
3815 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_lt);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 173, __pyx_L1_error)
3816 __pyx_t_4 = __Pyx_PyBool_FromLong((!__pyx_t_1));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 173, __pyx_L1_error)
3817 __Pyx_GOTREF(__pyx_t_4);
3818 __pyx_r = __pyx_t_4;
3839 __Pyx_XDECREF(__pyx_r);
3840 __Pyx_INCREF(__pyx_builtin_NotImplemented);
3841 __pyx_r = __pyx_builtin_NotImplemented;
3858 __Pyx_XDECREF(__pyx_t_4);
3859 __Pyx_AddTraceback(
"PyClical.index_set.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3862 __Pyx_XDECREF(__pyx_v_eq);
3863 __Pyx_XDECREF(__pyx_v_lt);
3864 __Pyx_XGIVEREF(__pyx_r);
3865 __Pyx_RefNannyFinishContext();
3878 static int __pyx_pw_8PyClical_9index_set_9__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx, PyObject *__pyx_v_val);
3879 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 ";
3880 #if CYTHON_COMPILING_IN_CPYTHON 3881 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_8__setitem__;
3883 static int __pyx_pw_8PyClical_9index_set_9__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx, PyObject *__pyx_v_val) {
3885 __Pyx_RefNannyDeclarations
3886 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
3887 __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));
3890 __Pyx_RefNannyFinishContext();
3894 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) {
3896 __Pyx_RefNannyDeclarations
3899 __Pyx_RefNannySetupContext(
"__setitem__", 0);
3908 __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)
3909 __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)
3911 __pyx_v_self->instance->set(__pyx_t_1, __pyx_t_2);
3913 __Pyx_CppExn2PyErr();
3914 __PYX_ERR(0, 186, __pyx_L1_error)
3937 __Pyx_AddTraceback(
"PyClical.index_set.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3940 __Pyx_RefNannyFinishContext();
3953 static PyObject *__pyx_pw_8PyClical_9index_set_11__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx);
3954 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 ";
3955 #if CYTHON_COMPILING_IN_CPYTHON 3956 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_10__getitem__;
3958 static PyObject *__pyx_pw_8PyClical_9index_set_11__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx) {
3959 PyObject *__pyx_r = 0;
3960 __Pyx_RefNannyDeclarations
3961 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
3962 __pyx_r = __pyx_pf_8PyClical_9index_set_10__getitem__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_idx));
3965 __Pyx_RefNannyFinishContext();
3969 static PyObject *__pyx_pf_8PyClical_9index_set_10__getitem__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_idx) {
3970 PyObject *__pyx_r = NULL;
3971 __Pyx_RefNannyDeclarations
3973 PyObject *__pyx_t_2 = NULL;
3974 __Pyx_RefNannySetupContext(
"__getitem__", 0);
3983 __Pyx_XDECREF(__pyx_r);
3984 __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)
3985 __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)
3986 __Pyx_GOTREF(__pyx_t_2);
3987 __pyx_r = __pyx_t_2;
4001 __Pyx_XDECREF(__pyx_t_2);
4002 __Pyx_AddTraceback(
"PyClical.index_set.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4005 __Pyx_XGIVEREF(__pyx_r);
4006 __Pyx_RefNannyFinishContext();
4019 static int __pyx_pw_8PyClical_9index_set_13__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx);
4020 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 ";
4021 #if CYTHON_COMPILING_IN_CPYTHON 4022 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_12__contains__;
4024 static int __pyx_pw_8PyClical_9index_set_13__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx) {
4026 __Pyx_RefNannyDeclarations
4027 __Pyx_RefNannySetupContext(
"__contains__ (wrapper)", 0);
4028 __pyx_r = __pyx_pf_8PyClical_9index_set_12__contains__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_idx));
4031 __Pyx_RefNannyFinishContext();
4035 static int __pyx_pf_8PyClical_9index_set_12__contains__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_idx) {
4037 __Pyx_RefNannyDeclarations
4039 __Pyx_RefNannySetupContext(
"__contains__", 0);
4048 __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)
4049 __pyx_r = __pyx_v_self->instance->operator[](__pyx_t_1);
4062 __Pyx_AddTraceback(
"PyClical.index_set.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4065 __Pyx_RefNannyFinishContext();
4068 static PyObject *__pyx_gb_8PyClical_9index_set_16generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value);
4079 static PyObject *__pyx_pw_8PyClical_9index_set_15__iter__(PyObject *__pyx_v_self);
4080 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 ";
4081 #if CYTHON_COMPILING_IN_CPYTHON 4082 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_14__iter__;
4084 static PyObject *__pyx_pw_8PyClical_9index_set_15__iter__(PyObject *__pyx_v_self) {
4085 PyObject *__pyx_r = 0;
4086 __Pyx_RefNannyDeclarations
4087 __Pyx_RefNannySetupContext(
"__iter__ (wrapper)", 0);
4088 __pyx_r = __pyx_pf_8PyClical_9index_set_14__iter__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
4091 __Pyx_RefNannyFinishContext();
4095 static PyObject *__pyx_pf_8PyClical_9index_set_14__iter__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
4096 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *__pyx_cur_scope;
4097 PyObject *__pyx_r = NULL;
4098 __Pyx_RefNannyDeclarations
4099 __Pyx_RefNannySetupContext(
"__iter__", 0);
4100 __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);
4101 if (unlikely(!__pyx_cur_scope)) {
4102 __pyx_cur_scope = ((
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)Py_None);
4103 __Pyx_INCREF(Py_None);
4104 __PYX_ERR(0, 227, __pyx_L1_error)
4106 __Pyx_GOTREF(__pyx_cur_scope);
4108 __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
4109 __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
4110 __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
4112 __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)
4113 __Pyx_DECREF(__pyx_cur_scope);
4114 __Pyx_RefNannyFinishContext();
4115 return (PyObject *) gen;
4120 __Pyx_AddTraceback(
"PyClical.index_set.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4122 __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
4123 __Pyx_XGIVEREF(__pyx_r);
4124 __Pyx_RefNannyFinishContext();
4128 static PyObject *__pyx_gb_8PyClical_9index_set_16generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value)
4130 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *__pyx_cur_scope = ((
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)__pyx_generator->closure);
4131 PyObject *__pyx_r = NULL;
4132 PyObject *__pyx_t_1 = NULL;
4133 PyObject *__pyx_t_2 = NULL;
4134 PyObject *__pyx_t_3 = NULL;
4135 PyObject *__pyx_t_4 = NULL;
4136 Py_ssize_t __pyx_t_5;
4137 PyObject *(*__pyx_t_6)(PyObject *);
4140 __Pyx_RefNannyDeclarations
4141 __Pyx_RefNannySetupContext(
"__iter__", 0);
4142 switch (__pyx_generator->resume_label) {
4143 case 0:
goto __pyx_L3_first_run;
4144 case 1:
goto __pyx_L7_resume_from_yield;
4146 __Pyx_RefNannyFinishContext();
4149 __pyx_L3_first_run:;
4150 if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 227, __pyx_L1_error)
4159 __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)
4160 __Pyx_GOTREF(__pyx_t_2);
4162 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
4163 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
4164 if (likely(__pyx_t_3)) {
4165 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
4166 __Pyx_INCREF(__pyx_t_3);
4167 __Pyx_INCREF(
function);
4168 __Pyx_DECREF_SET(__pyx_t_2,
function);
4172 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error)
4173 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4175 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error)
4177 __Pyx_GOTREF(__pyx_t_1);
4178 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4179 __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)
4180 __Pyx_GOTREF(__pyx_t_3);
4182 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4183 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
4184 if (likely(__pyx_t_4)) {
4185 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4186 __Pyx_INCREF(__pyx_t_4);
4187 __Pyx_INCREF(
function);
4188 __Pyx_DECREF_SET(__pyx_t_3,
function);
4192 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error)
4193 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4195 __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error)
4197 __Pyx_GOTREF(__pyx_t_2);
4198 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4199 __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)
4200 __Pyx_GOTREF(__pyx_t_3);
4201 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4202 __pyx_t_2 = PyTuple_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error)
4203 __Pyx_GOTREF(__pyx_t_2);
4204 __Pyx_GIVEREF(__pyx_t_1);
4205 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
4206 __Pyx_GIVEREF(__pyx_t_3);
4207 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
4210 __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)
4211 __Pyx_GOTREF(__pyx_t_3);
4212 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4213 if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
4214 __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
4217 __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error)
4218 __Pyx_GOTREF(__pyx_t_2);
4219 __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext;
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error)
4221 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4223 if (likely(!__pyx_t_6)) {
4224 if (likely(PyList_CheckExact(__pyx_t_2))) {
4225 if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2))
break;
4226 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 4227 __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)
4229 __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)
4230 __Pyx_GOTREF(__pyx_t_3);
4233 if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2))
break;
4234 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 4235 __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)
4237 __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)
4238 __Pyx_GOTREF(__pyx_t_3);
4242 __pyx_t_3 = __pyx_t_6(__pyx_t_2);
4243 if (unlikely(!__pyx_t_3)) {
4244 PyObject* exc_type = PyErr_Occurred();
4246 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
4247 else __PYX_ERR(0, 234, __pyx_L1_error)
4251 __Pyx_GOTREF(__pyx_t_3);
4253 __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_idx);
4254 __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_idx, __pyx_t_3);
4255 __Pyx_GIVEREF(__pyx_t_3);
4265 __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)
4266 __pyx_t_8 = (__pyx_t_7 != 0);
4276 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_idx);
4277 __pyx_r = __pyx_cur_scope->__pyx_v_idx;
4278 __Pyx_XGIVEREF(__pyx_t_2);
4279 __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
4280 __pyx_cur_scope->__pyx_t_1 = __pyx_t_5;
4281 __pyx_cur_scope->__pyx_t_2 = __pyx_t_6;
4282 __Pyx_XGIVEREF(__pyx_r);
4283 __Pyx_RefNannyFinishContext();
4284 __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
4286 __pyx_generator->resume_label = 1;
4288 __pyx_L7_resume_from_yield:;
4289 __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
4290 __pyx_cur_scope->__pyx_t_0 = 0;
4291 __Pyx_XGOTREF(__pyx_t_2);
4292 __pyx_t_5 = __pyx_cur_scope->__pyx_t_1;
4293 __pyx_t_6 = __pyx_cur_scope->__pyx_t_2;
4294 if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 236, __pyx_L1_error)
4313 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4314 CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
4325 PyErr_SetNone(PyExc_StopIteration);
4328 __Pyx_XDECREF(__pyx_t_1);
4329 __Pyx_XDECREF(__pyx_t_2);
4330 __Pyx_XDECREF(__pyx_t_3);
4331 __Pyx_XDECREF(__pyx_t_4);
4332 __Pyx_AddTraceback(
"__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4334 __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
4335 __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
4336 __pyx_generator->resume_label = -1;
4337 __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
4338 __Pyx_RefNannyFinishContext();
4351 static PyObject *__pyx_pw_8PyClical_9index_set_18__invert__(PyObject *__pyx_v_self);
4352 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 ";
4353 #if CYTHON_COMPILING_IN_CPYTHON 4354 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_17__invert__;
4356 static PyObject *__pyx_pw_8PyClical_9index_set_18__invert__(PyObject *__pyx_v_self) {
4357 PyObject *__pyx_r = 0;
4358 __Pyx_RefNannyDeclarations
4359 __Pyx_RefNannySetupContext(
"__invert__ (wrapper)", 0);
4360 __pyx_r = __pyx_pf_8PyClical_9index_set_17__invert__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
4363 __Pyx_RefNannyFinishContext();
4367 static PyObject *__pyx_pf_8PyClical_9index_set_17__invert__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
4368 PyObject *__pyx_r = NULL;
4369 __Pyx_RefNannyDeclarations
4370 PyObject *__pyx_t_1 = NULL;
4371 PyObject *__pyx_t_2 = NULL;
4372 __Pyx_RefNannySetupContext(
"__invert__", 0);
4381 __Pyx_XDECREF(__pyx_r);
4382 __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)
4383 __Pyx_GOTREF(__pyx_t_1);
4384 __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)
4385 __Pyx_GOTREF(__pyx_t_2);
4386 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4387 __pyx_r = __pyx_t_2;
4401 __Pyx_XDECREF(__pyx_t_1);
4402 __Pyx_XDECREF(__pyx_t_2);
4403 __Pyx_AddTraceback(
"PyClical.index_set.__invert__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4406 __Pyx_XGIVEREF(__pyx_r);
4407 __Pyx_RefNannyFinishContext();
4420 static PyObject *__pyx_pw_8PyClical_9index_set_20__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
4421 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 ";
4422 #if CYTHON_COMPILING_IN_CPYTHON 4423 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_19__xor__;
4425 static PyObject *__pyx_pw_8PyClical_9index_set_20__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4426 PyObject *__pyx_r = 0;
4427 __Pyx_RefNannyDeclarations
4428 __Pyx_RefNannySetupContext(
"__xor__ (wrapper)", 0);
4429 __pyx_r = __pyx_pf_8PyClical_9index_set_19__xor__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
4432 __Pyx_RefNannyFinishContext();
4436 static PyObject *__pyx_pf_8PyClical_9index_set_19__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4437 PyObject *__pyx_r = NULL;
4438 __Pyx_RefNannyDeclarations
4439 PyObject *__pyx_t_1 = NULL;
4440 PyObject *__pyx_t_2 = NULL;
4441 __Pyx_RefNannySetupContext(
"__xor__", 0);
4450 __Pyx_XDECREF(__pyx_r);
4451 __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)
4452 __Pyx_GOTREF(__pyx_t_1);
4453 __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)
4454 __Pyx_GOTREF(__pyx_t_2);
4455 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4456 __pyx_r = __pyx_t_2;
4470 __Pyx_XDECREF(__pyx_t_1);
4471 __Pyx_XDECREF(__pyx_t_2);
4472 __Pyx_AddTraceback(
"PyClical.index_set.__xor__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4475 __Pyx_XGIVEREF(__pyx_r);
4476 __Pyx_RefNannyFinishContext();
4489 static PyObject *__pyx_pw_8PyClical_9index_set_22__ixor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
4490 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 ";
4491 #if CYTHON_COMPILING_IN_CPYTHON 4492 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_21__ixor__;
4494 static PyObject *__pyx_pw_8PyClical_9index_set_22__ixor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
4495 PyObject *__pyx_r = 0;
4496 __Pyx_RefNannyDeclarations
4497 __Pyx_RefNannySetupContext(
"__ixor__ (wrapper)", 0);
4498 __pyx_r = __pyx_pf_8PyClical_9index_set_21__ixor__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
4501 __Pyx_RefNannyFinishContext();
4505 static PyObject *__pyx_pf_8PyClical_9index_set_21__ixor__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs) {
4506 PyObject *__pyx_r = NULL;
4507 __Pyx_RefNannyDeclarations
4508 PyObject *__pyx_t_1 = NULL;
4509 __Pyx_RefNannySetupContext(
"__ixor__", 0);
4518 __Pyx_XDECREF(__pyx_r);
4519 __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)
4520 __Pyx_GOTREF(__pyx_t_1);
4521 __pyx_r = __pyx_t_1;
4535 __Pyx_XDECREF(__pyx_t_1);
4536 __Pyx_AddTraceback(
"PyClical.index_set.__ixor__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4539 __Pyx_XGIVEREF(__pyx_r);
4540 __Pyx_RefNannyFinishContext();
4553 static PyObject *__pyx_pw_8PyClical_9index_set_24__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
4554 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 ";
4555 #if CYTHON_COMPILING_IN_CPYTHON 4556 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_23__and__;
4558 static PyObject *__pyx_pw_8PyClical_9index_set_24__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4559 PyObject *__pyx_r = 0;
4560 __Pyx_RefNannyDeclarations
4561 __Pyx_RefNannySetupContext(
"__and__ (wrapper)", 0);
4562 __pyx_r = __pyx_pf_8PyClical_9index_set_23__and__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
4565 __Pyx_RefNannyFinishContext();
4569 static PyObject *__pyx_pf_8PyClical_9index_set_23__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4570 PyObject *__pyx_r = NULL;
4571 __Pyx_RefNannyDeclarations
4572 PyObject *__pyx_t_1 = NULL;
4573 PyObject *__pyx_t_2 = NULL;
4574 __Pyx_RefNannySetupContext(
"__and__", 0);
4583 __Pyx_XDECREF(__pyx_r);
4584 __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)
4585 __Pyx_GOTREF(__pyx_t_1);
4586 __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)
4587 __Pyx_GOTREF(__pyx_t_2);
4588 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4589 __pyx_r = __pyx_t_2;
4603 __Pyx_XDECREF(__pyx_t_1);
4604 __Pyx_XDECREF(__pyx_t_2);
4605 __Pyx_AddTraceback(
"PyClical.index_set.__and__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4608 __Pyx_XGIVEREF(__pyx_r);
4609 __Pyx_RefNannyFinishContext();
4622 static PyObject *__pyx_pw_8PyClical_9index_set_26__iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
4623 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 ";
4624 #if CYTHON_COMPILING_IN_CPYTHON 4625 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_25__iand__;
4627 static PyObject *__pyx_pw_8PyClical_9index_set_26__iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
4628 PyObject *__pyx_r = 0;
4629 __Pyx_RefNannyDeclarations
4630 __Pyx_RefNannySetupContext(
"__iand__ (wrapper)", 0);
4631 __pyx_r = __pyx_pf_8PyClical_9index_set_25__iand__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
4634 __Pyx_RefNannyFinishContext();
4638 static PyObject *__pyx_pf_8PyClical_9index_set_25__iand__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs) {
4639 PyObject *__pyx_r = NULL;
4640 __Pyx_RefNannyDeclarations
4641 PyObject *__pyx_t_1 = NULL;
4642 __Pyx_RefNannySetupContext(
"__iand__", 0);
4651 __Pyx_XDECREF(__pyx_r);
4652 __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)
4653 __Pyx_GOTREF(__pyx_t_1);
4654 __pyx_r = __pyx_t_1;
4668 __Pyx_XDECREF(__pyx_t_1);
4669 __Pyx_AddTraceback(
"PyClical.index_set.__iand__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4672 __Pyx_XGIVEREF(__pyx_r);
4673 __Pyx_RefNannyFinishContext();
4686 static PyObject *__pyx_pw_8PyClical_9index_set_28__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
4687 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 ";
4688 #if CYTHON_COMPILING_IN_CPYTHON 4689 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_27__or__;
4691 static PyObject *__pyx_pw_8PyClical_9index_set_28__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4692 PyObject *__pyx_r = 0;
4693 __Pyx_RefNannyDeclarations
4694 __Pyx_RefNannySetupContext(
"__or__ (wrapper)", 0);
4695 __pyx_r = __pyx_pf_8PyClical_9index_set_27__or__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
4698 __Pyx_RefNannyFinishContext();
4702 static PyObject *__pyx_pf_8PyClical_9index_set_27__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4703 PyObject *__pyx_r = NULL;
4704 __Pyx_RefNannyDeclarations
4705 PyObject *__pyx_t_1 = NULL;
4706 PyObject *__pyx_t_2 = NULL;
4707 __Pyx_RefNannySetupContext(
"__or__", 0);
4716 __Pyx_XDECREF(__pyx_r);
4717 __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)
4718 __Pyx_GOTREF(__pyx_t_1);
4719 __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)
4720 __Pyx_GOTREF(__pyx_t_2);
4721 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4722 __pyx_r = __pyx_t_2;
4736 __Pyx_XDECREF(__pyx_t_1);
4737 __Pyx_XDECREF(__pyx_t_2);
4738 __Pyx_AddTraceback(
"PyClical.index_set.__or__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4741 __Pyx_XGIVEREF(__pyx_r);
4742 __Pyx_RefNannyFinishContext();
4755 static PyObject *__pyx_pw_8PyClical_9index_set_30__ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
4756 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 ";
4757 #if CYTHON_COMPILING_IN_CPYTHON 4758 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_29__ior__;
4760 static PyObject *__pyx_pw_8PyClical_9index_set_30__ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
4761 PyObject *__pyx_r = 0;
4762 __Pyx_RefNannyDeclarations
4763 __Pyx_RefNannySetupContext(
"__ior__ (wrapper)", 0);
4764 __pyx_r = __pyx_pf_8PyClical_9index_set_29__ior__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
4767 __Pyx_RefNannyFinishContext();
4771 static PyObject *__pyx_pf_8PyClical_9index_set_29__ior__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs) {
4772 PyObject *__pyx_r = NULL;
4773 __Pyx_RefNannyDeclarations
4774 PyObject *__pyx_t_1 = NULL;
4775 __Pyx_RefNannySetupContext(
"__ior__", 0);
4784 __Pyx_XDECREF(__pyx_r);
4785 __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)
4786 __Pyx_GOTREF(__pyx_t_1);
4787 __pyx_r = __pyx_t_1;
4801 __Pyx_XDECREF(__pyx_t_1);
4802 __Pyx_AddTraceback(
"PyClical.index_set.__ior__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4805 __Pyx_XGIVEREF(__pyx_r);
4806 __Pyx_RefNannyFinishContext();
4819 static PyObject *__pyx_pw_8PyClical_9index_set_32count(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4820 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 ";
4821 static PyObject *__pyx_pw_8PyClical_9index_set_32count(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4822 PyObject *__pyx_r = 0;
4823 __Pyx_RefNannyDeclarations
4824 __Pyx_RefNannySetupContext(
"count (wrapper)", 0);
4825 __pyx_r = __pyx_pf_8PyClical_9index_set_31count(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
4828 __Pyx_RefNannyFinishContext();
4832 static PyObject *__pyx_pf_8PyClical_9index_set_31count(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
4833 PyObject *__pyx_r = NULL;
4834 __Pyx_RefNannyDeclarations
4835 PyObject *__pyx_t_1 = NULL;
4836 __Pyx_RefNannySetupContext(
"count", 0);
4845 __Pyx_XDECREF(__pyx_r);
4846 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->instance->count());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error)
4847 __Pyx_GOTREF(__pyx_t_1);
4848 __pyx_r = __pyx_t_1;
4862 __Pyx_XDECREF(__pyx_t_1);
4863 __Pyx_AddTraceback(
"PyClical.index_set.count", __pyx_clineno, __pyx_lineno, __pyx_filename);
4866 __Pyx_XGIVEREF(__pyx_r);
4867 __Pyx_RefNannyFinishContext();
4880 static PyObject *__pyx_pw_8PyClical_9index_set_34count_neg(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4881 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 ";
4882 static PyObject *__pyx_pw_8PyClical_9index_set_34count_neg(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4883 PyObject *__pyx_r = 0;
4884 __Pyx_RefNannyDeclarations
4885 __Pyx_RefNannySetupContext(
"count_neg (wrapper)", 0);
4886 __pyx_r = __pyx_pf_8PyClical_9index_set_33count_neg(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
4889 __Pyx_RefNannyFinishContext();
4893 static PyObject *__pyx_pf_8PyClical_9index_set_33count_neg(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
4894 PyObject *__pyx_r = NULL;
4895 __Pyx_RefNannyDeclarations
4896 PyObject *__pyx_t_1 = NULL;
4897 __Pyx_RefNannySetupContext(
"count_neg", 0);
4906 __Pyx_XDECREF(__pyx_r);
4907 __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)
4908 __Pyx_GOTREF(__pyx_t_1);
4909 __pyx_r = __pyx_t_1;
4923 __Pyx_XDECREF(__pyx_t_1);
4924 __Pyx_AddTraceback(
"PyClical.index_set.count_neg", __pyx_clineno, __pyx_lineno, __pyx_filename);
4927 __Pyx_XGIVEREF(__pyx_r);
4928 __Pyx_RefNannyFinishContext();
4941 static PyObject *__pyx_pw_8PyClical_9index_set_36count_pos(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4942 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 ";
4943 static PyObject *__pyx_pw_8PyClical_9index_set_36count_pos(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4944 PyObject *__pyx_r = 0;
4945 __Pyx_RefNannyDeclarations
4946 __Pyx_RefNannySetupContext(
"count_pos (wrapper)", 0);
4947 __pyx_r = __pyx_pf_8PyClical_9index_set_35count_pos(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
4950 __Pyx_RefNannyFinishContext();
4954 static PyObject *__pyx_pf_8PyClical_9index_set_35count_pos(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
4955 PyObject *__pyx_r = NULL;
4956 __Pyx_RefNannyDeclarations
4957 PyObject *__pyx_t_1 = NULL;
4958 __Pyx_RefNannySetupContext(
"count_pos", 0);
4967 __Pyx_XDECREF(__pyx_r);
4968 __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)
4969 __Pyx_GOTREF(__pyx_t_1);
4970 __pyx_r = __pyx_t_1;
4984 __Pyx_XDECREF(__pyx_t_1);
4985 __Pyx_AddTraceback(
"PyClical.index_set.count_pos", __pyx_clineno, __pyx_lineno, __pyx_filename);
4988 __Pyx_XGIVEREF(__pyx_r);
4989 __Pyx_RefNannyFinishContext();
5002 static PyObject *__pyx_pw_8PyClical_9index_set_38min(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5003 static char __pyx_doc_8PyClical_9index_set_37min[] =
"\n Minimum member.\n\n >>> index_set({-1,1,2}).min()\n -1\n ";
5004 static PyObject *__pyx_pw_8PyClical_9index_set_38min(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5005 PyObject *__pyx_r = 0;
5006 __Pyx_RefNannyDeclarations
5007 __Pyx_RefNannySetupContext(
"min (wrapper)", 0);
5008 __pyx_r = __pyx_pf_8PyClical_9index_set_37min(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5011 __Pyx_RefNannyFinishContext();
5015 static PyObject *__pyx_pf_8PyClical_9index_set_37min(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5016 PyObject *__pyx_r = NULL;
5017 __Pyx_RefNannyDeclarations
5018 PyObject *__pyx_t_1 = NULL;
5019 __Pyx_RefNannySetupContext(
"min", 0);
5028 __Pyx_XDECREF(__pyx_r);
5029 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->instance->min());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 347, __pyx_L1_error)
5030 __Pyx_GOTREF(__pyx_t_1);
5031 __pyx_r = __pyx_t_1;
5045 __Pyx_XDECREF(__pyx_t_1);
5046 __Pyx_AddTraceback(
"PyClical.index_set.min", __pyx_clineno, __pyx_lineno, __pyx_filename);
5049 __Pyx_XGIVEREF(__pyx_r);
5050 __Pyx_RefNannyFinishContext();
5063 static PyObject *__pyx_pw_8PyClical_9index_set_40max(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5064 static char __pyx_doc_8PyClical_9index_set_39max[] =
"\n Maximum member.\n\n >>> index_set({-1,1,2}).max()\n 2\n ";
5065 static PyObject *__pyx_pw_8PyClical_9index_set_40max(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5066 PyObject *__pyx_r = 0;
5067 __Pyx_RefNannyDeclarations
5068 __Pyx_RefNannySetupContext(
"max (wrapper)", 0);
5069 __pyx_r = __pyx_pf_8PyClical_9index_set_39max(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5072 __Pyx_RefNannyFinishContext();
5076 static PyObject *__pyx_pf_8PyClical_9index_set_39max(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5077 PyObject *__pyx_r = NULL;
5078 __Pyx_RefNannyDeclarations
5079 PyObject *__pyx_t_1 = NULL;
5080 __Pyx_RefNannySetupContext(
"max", 0);
5089 __Pyx_XDECREF(__pyx_r);
5090 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->instance->max());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error)
5091 __Pyx_GOTREF(__pyx_t_1);
5092 __pyx_r = __pyx_t_1;
5106 __Pyx_XDECREF(__pyx_t_1);
5107 __Pyx_AddTraceback(
"PyClical.index_set.max", __pyx_clineno, __pyx_lineno, __pyx_filename);
5110 __Pyx_XGIVEREF(__pyx_r);
5111 __Pyx_RefNannyFinishContext();
5124 static PyObject *__pyx_pw_8PyClical_9index_set_42hash_fn(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5125 static char __pyx_doc_8PyClical_9index_set_41hash_fn[] =
"\n Hash function.\n ";
5126 static PyObject *__pyx_pw_8PyClical_9index_set_42hash_fn(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5127 PyObject *__pyx_r = 0;
5128 __Pyx_RefNannyDeclarations
5129 __Pyx_RefNannySetupContext(
"hash_fn (wrapper)", 0);
5130 __pyx_r = __pyx_pf_8PyClical_9index_set_41hash_fn(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5133 __Pyx_RefNannyFinishContext();
5137 static PyObject *__pyx_pf_8PyClical_9index_set_41hash_fn(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5138 PyObject *__pyx_r = NULL;
5139 __Pyx_RefNannyDeclarations
5140 PyObject *__pyx_t_1 = NULL;
5141 __Pyx_RefNannySetupContext(
"hash_fn", 0);
5150 __Pyx_XDECREF(__pyx_r);
5151 __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)
5152 __Pyx_GOTREF(__pyx_t_1);
5153 __pyx_r = __pyx_t_1;
5167 __Pyx_XDECREF(__pyx_t_1);
5168 __Pyx_AddTraceback(
"PyClical.index_set.hash_fn", __pyx_clineno, __pyx_lineno, __pyx_filename);
5171 __Pyx_XGIVEREF(__pyx_r);
5172 __Pyx_RefNannyFinishContext();
5185 static PyObject *__pyx_pw_8PyClical_9index_set_44sign_of_mult(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
5186 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 ";
5187 static PyObject *__pyx_pw_8PyClical_9index_set_44sign_of_mult(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
5188 PyObject *__pyx_r = 0;
5189 __Pyx_RefNannyDeclarations
5190 __Pyx_RefNannySetupContext(
"sign_of_mult (wrapper)", 0);
5191 __pyx_r = __pyx_pf_8PyClical_9index_set_43sign_of_mult(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
5194 __Pyx_RefNannyFinishContext();
5198 static PyObject *__pyx_pf_8PyClical_9index_set_43sign_of_mult(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs) {
5199 PyObject *__pyx_r = NULL;
5200 __Pyx_RefNannyDeclarations
5201 PyObject *__pyx_t_1 = NULL;
5202 __Pyx_RefNannySetupContext(
"sign_of_mult", 0);
5211 __Pyx_XDECREF(__pyx_r);
5212 __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)
5213 __Pyx_GOTREF(__pyx_t_1);
5214 __pyx_r = __pyx_t_1;
5228 __Pyx_XDECREF(__pyx_t_1);
5229 __Pyx_AddTraceback(
"PyClical.index_set.sign_of_mult", __pyx_clineno, __pyx_lineno, __pyx_filename);
5232 __Pyx_XGIVEREF(__pyx_r);
5233 __Pyx_RefNannyFinishContext();
5246 static PyObject *__pyx_pw_8PyClical_9index_set_46sign_of_square(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5247 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 ";
5248 static PyObject *__pyx_pw_8PyClical_9index_set_46sign_of_square(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5249 PyObject *__pyx_r = 0;
5250 __Pyx_RefNannyDeclarations
5251 __Pyx_RefNannySetupContext(
"sign_of_square (wrapper)", 0);
5252 __pyx_r = __pyx_pf_8PyClical_9index_set_45sign_of_square(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5255 __Pyx_RefNannyFinishContext();
5259 static PyObject *__pyx_pf_8PyClical_9index_set_45sign_of_square(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5260 PyObject *__pyx_r = NULL;
5261 __Pyx_RefNannyDeclarations
5262 PyObject *__pyx_t_1 = NULL;
5263 __Pyx_RefNannySetupContext(
"sign_of_square", 0);
5272 __Pyx_XDECREF(__pyx_r);
5273 __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)
5274 __Pyx_GOTREF(__pyx_t_1);
5275 __pyx_r = __pyx_t_1;
5289 __Pyx_XDECREF(__pyx_t_1);
5290 __Pyx_AddTraceback(
"PyClical.index_set.sign_of_square", __pyx_clineno, __pyx_lineno, __pyx_filename);
5293 __Pyx_XGIVEREF(__pyx_r);
5294 __Pyx_RefNannyFinishContext();
5307 static PyObject *__pyx_pw_8PyClical_9index_set_48__repr__(PyObject *__pyx_v_self);
5308 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 ";
5309 #if CYTHON_COMPILING_IN_CPYTHON 5310 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_47__repr__;
5312 static PyObject *__pyx_pw_8PyClical_9index_set_48__repr__(PyObject *__pyx_v_self) {
5313 PyObject *__pyx_r = 0;
5314 __Pyx_RefNannyDeclarations
5315 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
5316 __pyx_r = __pyx_pf_8PyClical_9index_set_47__repr__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5319 __Pyx_RefNannyFinishContext();
5323 static PyObject *__pyx_pf_8PyClical_9index_set_47__repr__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5324 PyObject *__pyx_r = NULL;
5325 __Pyx_RefNannyDeclarations
5326 PyObject *__pyx_t_1 = NULL;
5327 __Pyx_RefNannySetupContext(
"__repr__", 0);
5336 __Pyx_XDECREF(__pyx_r);
5337 __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)
5338 __Pyx_GOTREF(__pyx_t_1);
5339 __pyx_r = __pyx_t_1;
5353 __Pyx_XDECREF(__pyx_t_1);
5354 __Pyx_AddTraceback(
"PyClical.index_set.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5357 __Pyx_XGIVEREF(__pyx_r);
5358 __Pyx_RefNannyFinishContext();
5371 static PyObject *__pyx_pw_8PyClical_9index_set_50__str__(PyObject *__pyx_v_self);
5372 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 ";
5373 #if CYTHON_COMPILING_IN_CPYTHON 5374 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_49__str__;
5376 static PyObject *__pyx_pw_8PyClical_9index_set_50__str__(PyObject *__pyx_v_self) {
5377 PyObject *__pyx_r = 0;
5378 __Pyx_RefNannyDeclarations
5379 __Pyx_RefNannySetupContext(
"__str__ (wrapper)", 0);
5380 __pyx_r = __pyx_pf_8PyClical_9index_set_49__str__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5383 __Pyx_RefNannyFinishContext();
5387 static PyObject *__pyx_pf_8PyClical_9index_set_49__str__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5388 PyObject *__pyx_r = NULL;
5389 __Pyx_RefNannyDeclarations
5390 PyObject *__pyx_t_1 = NULL;
5391 __Pyx_RefNannySetupContext(
"__str__", 0);
5400 __Pyx_XDECREF(__pyx_r);
5401 __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)
5402 __Pyx_GOTREF(__pyx_t_1);
5403 __pyx_r = __pyx_t_1;
5417 __Pyx_XDECREF(__pyx_t_1);
5418 __Pyx_AddTraceback(
"PyClical.index_set.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5421 __Pyx_XGIVEREF(__pyx_r);
5422 __Pyx_RefNannyFinishContext();
5433 static PyObject *__pyx_pw_8PyClical_9index_set_52__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5434 static PyObject *__pyx_pw_8PyClical_9index_set_52__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5435 PyObject *__pyx_r = 0;
5436 __Pyx_RefNannyDeclarations
5437 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
5438 __pyx_r = __pyx_pf_8PyClical_9index_set_51__reduce_cython__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5441 __Pyx_RefNannyFinishContext();
5445 static PyObject *__pyx_pf_8PyClical_9index_set_51__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5446 PyObject *__pyx_r = NULL;
5447 __Pyx_RefNannyDeclarations
5448 PyObject *__pyx_t_1 = NULL;
5449 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
5457 __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)
5458 __Pyx_GOTREF(__pyx_t_1);
5459 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5460 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5461 __PYX_ERR(1, 2, __pyx_L1_error)
5471 __Pyx_XDECREF(__pyx_t_1);
5472 __Pyx_AddTraceback(
"PyClical.index_set.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5474 __Pyx_XGIVEREF(__pyx_r);
5475 __Pyx_RefNannyFinishContext();
5487 static PyObject *__pyx_pw_8PyClical_9index_set_54__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
5488 static PyObject *__pyx_pw_8PyClical_9index_set_54__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
5489 PyObject *__pyx_r = 0;
5490 __Pyx_RefNannyDeclarations
5491 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
5492 __pyx_r = __pyx_pf_8PyClical_9index_set_53__setstate_cython__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
5495 __Pyx_RefNannyFinishContext();
5499 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) {
5500 PyObject *__pyx_r = NULL;
5501 __Pyx_RefNannyDeclarations
5502 PyObject *__pyx_t_1 = NULL;
5503 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
5510 __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)
5511 __Pyx_GOTREF(__pyx_t_1);
5512 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5513 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5514 __PYX_ERR(1, 4, __pyx_L1_error)
5525 __Pyx_XDECREF(__pyx_t_1);
5526 __Pyx_AddTraceback(
"PyClical.index_set.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5528 __Pyx_XGIVEREF(__pyx_r);
5529 __Pyx_RefNannyFinishContext();
5542 static PyObject *__pyx_pw_8PyClical_1index_set_hidden_doctests(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused);
5543 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 ";
5544 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};
5545 static PyObject *__pyx_pw_8PyClical_1index_set_hidden_doctests(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
5546 PyObject *__pyx_r = 0;
5547 __Pyx_RefNannyDeclarations
5548 __Pyx_RefNannySetupContext(
"index_set_hidden_doctests (wrapper)", 0);
5549 __pyx_r = __pyx_pf_8PyClical_index_set_hidden_doctests(__pyx_self);
5552 __Pyx_RefNannyFinishContext();
5556 static PyObject *__pyx_pf_8PyClical_index_set_hidden_doctests(CYTHON_UNUSED PyObject *__pyx_self) {
5557 PyObject *__pyx_r = NULL;
5558 __Pyx_RefNannyDeclarations
5559 __Pyx_RefNannySetupContext(
"index_set_hidden_doctests", 0);
5568 __Pyx_XDECREF(__pyx_r);
5569 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5582 __Pyx_XGIVEREF(__pyx_r);
5583 __Pyx_RefNannyFinishContext();
5595 static PyObject *__pyx_pw_8PyClical_3compare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5596 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_compare(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs, CYTHON_UNUSED
int __pyx_skip_dispatch) {
5597 PyObject *__pyx_r = NULL;
5598 __Pyx_RefNannyDeclarations
5599 PyObject *__pyx_t_1 = NULL;
5600 __Pyx_RefNannySetupContext(
"compare", 0);
5609 __Pyx_XDECREF(__pyx_r);
5610 __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)
5611 __Pyx_GOTREF(__pyx_t_1);
5612 __pyx_r = __pyx_t_1;
5626 __Pyx_XDECREF(__pyx_t_1);
5627 __Pyx_AddTraceback(
"PyClical.compare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5630 __Pyx_XGIVEREF(__pyx_r);
5631 __Pyx_RefNannyFinishContext();
5636 static PyObject *__pyx_pw_8PyClical_3compare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5637 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 ";
5638 static PyObject *__pyx_pw_8PyClical_3compare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5639 PyObject *__pyx_v_lhs = 0;
5640 PyObject *__pyx_v_rhs = 0;
5641 PyObject *__pyx_r = 0;
5642 __Pyx_RefNannyDeclarations
5643 __Pyx_RefNannySetupContext(
"compare (wrapper)", 0);
5645 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lhs,&__pyx_n_s_rhs,0};
5646 PyObject* values[2] = {0,0};
5647 if (unlikely(__pyx_kwds)) {
5649 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5651 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5653 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5656 default:
goto __pyx_L5_argtuple_error;
5658 kw_args = PyDict_Size(__pyx_kwds);
5661 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_lhs)) != 0)) kw_args--;
5662 else goto __pyx_L5_argtuple_error;
5665 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rhs)) != 0)) kw_args--;
5667 __Pyx_RaiseArgtupleInvalid(
"compare", 1, 2, 2, 1); __PYX_ERR(0, 490, __pyx_L3_error)
5670 if (unlikely(kw_args > 0)) {
5671 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"compare") < 0)) __PYX_ERR(0, 490, __pyx_L3_error)
5673 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5674 goto __pyx_L5_argtuple_error;
5676 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5677 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5679 __pyx_v_lhs = values[0];
5680 __pyx_v_rhs = values[1];
5682 goto __pyx_L4_argument_unpacking_done;
5683 __pyx_L5_argtuple_error:;
5684 __Pyx_RaiseArgtupleInvalid(
"compare", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 490, __pyx_L3_error)
5686 __Pyx_AddTraceback(
"PyClical.compare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5687 __Pyx_RefNannyFinishContext();
5689 __pyx_L4_argument_unpacking_done:;
5690 __pyx_r = __pyx_pf_8PyClical_2compare(__pyx_self, __pyx_v_lhs, __pyx_v_rhs);
5693 __Pyx_RefNannyFinishContext();
5697 static PyObject *__pyx_pf_8PyClical_2compare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
5698 PyObject *__pyx_r = NULL;
5699 __Pyx_RefNannyDeclarations
5700 PyObject *__pyx_t_1 = NULL;
5701 __Pyx_RefNannySetupContext(
"compare", 0);
5702 __Pyx_XDECREF(__pyx_r);
5703 __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)
5704 __Pyx_GOTREF(__pyx_t_1);
5705 __pyx_r = __pyx_t_1;
5711 __Pyx_XDECREF(__pyx_t_1);
5712 __Pyx_AddTraceback(
"PyClical.compare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5715 __Pyx_XGIVEREF(__pyx_r);
5716 __Pyx_RefNannyFinishContext();
5728 static PyObject *__pyx_pw_8PyClical_5min_neg(PyObject *__pyx_self, PyObject *__pyx_v_obj);
5729 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_min_neg(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
5730 PyObject *__pyx_r = NULL;
5731 __Pyx_RefNannyDeclarations
5732 PyObject *__pyx_t_1 = NULL;
5733 __Pyx_RefNannySetupContext(
"min_neg", 0);
5742 __Pyx_XDECREF(__pyx_r);
5743 __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)
5744 __Pyx_GOTREF(__pyx_t_1);
5745 __pyx_r = __pyx_t_1;
5759 __Pyx_XDECREF(__pyx_t_1);
5760 __Pyx_AddTraceback(
"PyClical.min_neg", __pyx_clineno, __pyx_lineno, __pyx_filename);
5763 __Pyx_XGIVEREF(__pyx_r);
5764 __Pyx_RefNannyFinishContext();
5769 static PyObject *__pyx_pw_8PyClical_5min_neg(PyObject *__pyx_self, PyObject *__pyx_v_obj);
5770 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 ";
5771 static PyObject *__pyx_pw_8PyClical_5min_neg(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
5772 PyObject *__pyx_r = 0;
5773 __Pyx_RefNannyDeclarations
5774 __Pyx_RefNannySetupContext(
"min_neg (wrapper)", 0);
5775 __pyx_r = __pyx_pf_8PyClical_4min_neg(__pyx_self, ((PyObject *)__pyx_v_obj));
5778 __Pyx_RefNannyFinishContext();
5782 static PyObject *__pyx_pf_8PyClical_4min_neg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
5783 PyObject *__pyx_r = NULL;
5784 __Pyx_RefNannyDeclarations
5785 PyObject *__pyx_t_1 = NULL;
5786 __Pyx_RefNannySetupContext(
"min_neg", 0);
5787 __Pyx_XDECREF(__pyx_r);
5788 __pyx_t_1 = __pyx_f_8PyClical_min_neg(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 502, __pyx_L1_error)
5789 __Pyx_GOTREF(__pyx_t_1);
5790 __pyx_r = __pyx_t_1;
5796 __Pyx_XDECREF(__pyx_t_1);
5797 __Pyx_AddTraceback(
"PyClical.min_neg", __pyx_clineno, __pyx_lineno, __pyx_filename);
5800 __Pyx_XGIVEREF(__pyx_r);
5801 __Pyx_RefNannyFinishContext();
5813 static PyObject *__pyx_pw_8PyClical_7max_pos(PyObject *__pyx_self, PyObject *__pyx_v_obj);
5814 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_max_pos(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
5815 PyObject *__pyx_r = NULL;
5816 __Pyx_RefNannyDeclarations
5817 PyObject *__pyx_t_1 = NULL;
5818 __Pyx_RefNannySetupContext(
"max_pos", 0);
5827 __Pyx_XDECREF(__pyx_r);
5828 __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)
5829 __Pyx_GOTREF(__pyx_t_1);
5830 __pyx_r = __pyx_t_1;
5844 __Pyx_XDECREF(__pyx_t_1);
5845 __Pyx_AddTraceback(
"PyClical.max_pos", __pyx_clineno, __pyx_lineno, __pyx_filename);
5848 __Pyx_XGIVEREF(__pyx_r);
5849 __Pyx_RefNannyFinishContext();
5854 static PyObject *__pyx_pw_8PyClical_7max_pos(PyObject *__pyx_self, PyObject *__pyx_v_obj);
5855 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 ";
5856 static PyObject *__pyx_pw_8PyClical_7max_pos(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
5857 PyObject *__pyx_r = 0;
5858 __Pyx_RefNannyDeclarations
5859 __Pyx_RefNannySetupContext(
"max_pos (wrapper)", 0);
5860 __pyx_r = __pyx_pf_8PyClical_6max_pos(__pyx_self, ((PyObject *)__pyx_v_obj));
5863 __Pyx_RefNannyFinishContext();
5867 static PyObject *__pyx_pf_8PyClical_6max_pos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
5868 PyObject *__pyx_r = NULL;
5869 __Pyx_RefNannyDeclarations
5870 PyObject *__pyx_t_1 = NULL;
5871 __Pyx_RefNannySetupContext(
"max_pos", 0);
5872 __Pyx_XDECREF(__pyx_r);
5873 __pyx_t_1 = __pyx_f_8PyClical_max_pos(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 511, __pyx_L1_error)
5874 __Pyx_GOTREF(__pyx_t_1);
5875 __pyx_r = __pyx_t_1;
5881 __Pyx_XDECREF(__pyx_t_1);
5882 __Pyx_AddTraceback(
"PyClical.max_pos", __pyx_clineno, __pyx_lineno, __pyx_filename);
5885 __Pyx_XGIVEREF(__pyx_r);
5886 __Pyx_RefNannyFinishContext();
5898 static CYTHON_INLINE std::vector<scalar_t> __pyx_f_8PyClical_list_to_vector(PyObject *__pyx_v_lst) {
5899 std::vector<scalar_t> __pyx_v_v;
5900 PyObject *__pyx_v_s = NULL;
5901 std::vector<scalar_t> __pyx_r;
5902 __Pyx_RefNannyDeclarations
5903 PyObject *__pyx_t_1 = NULL;
5904 Py_ssize_t __pyx_t_2;
5905 PyObject *(*__pyx_t_3)(PyObject *);
5906 PyObject *__pyx_t_4 = NULL;
5908 __Pyx_RefNannySetupContext(
"list_to_vector", 0);
5917 if (likely(PyList_CheckExact(__pyx_v_lst)) || PyTuple_CheckExact(__pyx_v_lst)) {
5918 __pyx_t_1 = __pyx_v_lst; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
5921 __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_lst);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error)
5922 __Pyx_GOTREF(__pyx_t_1);
5923 __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 525, __pyx_L1_error)
5926 if (likely(!__pyx_t_3)) {
5927 if (likely(PyList_CheckExact(__pyx_t_1))) {
5928 if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1))
break;
5929 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 5930 __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)
5932 __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)
5933 __Pyx_GOTREF(__pyx_t_4);
5936 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1))
break;
5937 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 5938 __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)
5940 __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)
5941 __Pyx_GOTREF(__pyx_t_4);
5945 __pyx_t_4 = __pyx_t_3(__pyx_t_1);
5946 if (unlikely(!__pyx_t_4)) {
5947 PyObject* exc_type = PyErr_Occurred();
5949 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
5950 else __PYX_ERR(0, 525, __pyx_L1_error)
5954 __Pyx_GOTREF(__pyx_t_4);
5956 __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_4);
5966 __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)
5968 __pyx_v_v.push_back(((
scalar_t)__pyx_t_5));
5970 __Pyx_CppExn2PyErr();
5971 __PYX_ERR(0, 526, __pyx_L1_error)
5982 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5991 __pyx_r = __pyx_v_v;
6004 __Pyx_XDECREF(__pyx_t_1);
6005 __Pyx_XDECREF(__pyx_t_4);
6006 __Pyx_WriteUnraisable(
"PyClical.list_to_vector", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6007 __Pyx_pretend_to_initialize(&__pyx_r);
6009 __Pyx_XDECREF(__pyx_v_s);
6010 __Pyx_RefNannyFinishContext();
6022 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_toClifford(PyObject *__pyx_v_obj) {
6024 __Pyx_RefNannyDeclarations
6025 PyObject *__pyx_t_1 = NULL;
6026 PyObject *__pyx_t_2 = NULL;
6027 __Pyx_RefNannySetupContext(
"toClifford", 0);
6036 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 533, __pyx_L1_error)
6037 __Pyx_GOTREF(__pyx_t_1);
6038 __Pyx_INCREF(__pyx_v_obj);
6039 __Pyx_GIVEREF(__pyx_v_obj);
6040 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_obj);
6041 __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)
6042 __Pyx_GOTREF(__pyx_t_2);
6043 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6044 __pyx_r = (((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_2)->instance[0]);
6045 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6058 __Pyx_XDECREF(__pyx_t_1);
6059 __Pyx_XDECREF(__pyx_t_2);
6060 __Pyx_WriteUnraisable(
"PyClical.toClifford", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6061 __Pyx_pretend_to_initialize(&__pyx_r);
6063 __Pyx_RefNannyFinishContext();
6075 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_8clifford_wrap(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self,
Clifford __pyx_v_other) {
6076 PyObject *__pyx_r = NULL;
6077 __Pyx_RefNannyDeclarations
6078 __Pyx_RefNannySetupContext(
"wrap", 0);
6087 (__pyx_v_self->instance[0]) = __pyx_v_other;
6096 __Pyx_XDECREF(__pyx_r);
6097 __Pyx_INCREF(((PyObject *)__pyx_v_self));
6098 __pyx_r = ((PyObject *)__pyx_v_self);
6111 __Pyx_XGIVEREF(__pyx_r);
6112 __Pyx_RefNannyFinishContext();
6124 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_8clifford_unwrap(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
6126 __Pyx_RefNannyDeclarations
6127 __Pyx_RefNannySetupContext(
"unwrap", 0);
6136 __pyx_r = (__pyx_v_self->instance[0]);
6149 __Pyx_RefNannyFinishContext();
6161 static PyObject *__pyx_pw_8PyClical_8clifford_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
6162 static PyObject *__pyx_f_8PyClical_8clifford_copy(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self,
int __pyx_skip_dispatch) {
6163 PyObject *__pyx_r = NULL;
6164 __Pyx_RefNannyDeclarations
6165 PyObject *__pyx_t_1 = NULL;
6166 PyObject *__pyx_t_2 = NULL;
6167 PyObject *__pyx_t_3 = NULL;
6168 PyObject *__pyx_t_4 = NULL;
6169 __Pyx_RefNannySetupContext(
"copy", 0);
6171 if (unlikely(__pyx_skip_dispatch)) ;
6173 else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
6174 __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)
6175 __Pyx_GOTREF(__pyx_t_1);
6176 if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_8PyClical_8clifford_1copy)) {
6177 __Pyx_XDECREF(__pyx_r);
6178 __Pyx_INCREF(__pyx_t_1);
6179 __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
6180 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
6181 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
6182 if (likely(__pyx_t_4)) {
6183 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
6184 __Pyx_INCREF(__pyx_t_4);
6185 __Pyx_INCREF(
function);
6186 __Pyx_DECREF_SET(__pyx_t_3,
function);
6190 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 554, __pyx_L1_error)
6191 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6193 __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 554, __pyx_L1_error)
6195 __Pyx_GOTREF(__pyx_t_2);
6196 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6197 __pyx_r = __pyx_t_2;
6199 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6202 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6212 __Pyx_XDECREF(__pyx_r);
6213 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 561, __pyx_L1_error)
6214 __Pyx_GOTREF(__pyx_t_1);
6215 __Pyx_INCREF(((PyObject *)__pyx_v_self));
6216 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
6217 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
6218 __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)
6219 __Pyx_GOTREF(__pyx_t_2);
6220 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6221 __pyx_r = __pyx_t_2;
6235 __Pyx_XDECREF(__pyx_t_1);
6236 __Pyx_XDECREF(__pyx_t_2);
6237 __Pyx_XDECREF(__pyx_t_3);
6238 __Pyx_XDECREF(__pyx_t_4);
6239 __Pyx_AddTraceback(
"PyClical.clifford.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
6242 __Pyx_XGIVEREF(__pyx_r);
6243 __Pyx_RefNannyFinishContext();
6248 static PyObject *__pyx_pw_8PyClical_8clifford_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
6249 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 ";
6250 static PyObject *__pyx_pw_8PyClical_8clifford_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
6251 PyObject *__pyx_r = 0;
6252 __Pyx_RefNannyDeclarations
6253 __Pyx_RefNannySetupContext(
"copy (wrapper)", 0);
6254 __pyx_r = __pyx_pf_8PyClical_8clifford_copy(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
6257 __Pyx_RefNannyFinishContext();
6261 static PyObject *__pyx_pf_8PyClical_8clifford_copy(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
6262 PyObject *__pyx_r = NULL;
6263 __Pyx_RefNannyDeclarations
6264 PyObject *__pyx_t_1 = NULL;
6265 __Pyx_RefNannySetupContext(
"copy", 0);
6266 __Pyx_XDECREF(__pyx_r);
6267 __pyx_t_1 = __pyx_f_8PyClical_8clifford_copy(__pyx_v_self, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 554, __pyx_L1_error)
6268 __Pyx_GOTREF(__pyx_t_1);
6269 __pyx_r = __pyx_t_1;
6275 __Pyx_XDECREF(__pyx_t_1);
6276 __Pyx_AddTraceback(
"PyClical.clifford.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
6279 __Pyx_XGIVEREF(__pyx_r);
6280 __Pyx_RefNannyFinishContext();
6293 static int __pyx_pw_8PyClical_8clifford_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6294 static int __pyx_pw_8PyClical_8clifford_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6295 PyObject *__pyx_v_other = 0;
6296 PyObject *__pyx_v_ixt = 0;
6298 __Pyx_RefNannyDeclarations
6299 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
6301 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_ixt,0};
6302 PyObject* values[2] = {0,0};
6303 values[0] = ((PyObject *)__pyx_int_0);
6304 values[1] = ((PyObject *)Py_None);
6305 if (unlikely(__pyx_kwds)) {
6307 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6309 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6311 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6314 default:
goto __pyx_L5_argtuple_error;
6316 kw_args = PyDict_Size(__pyx_kwds);
6320 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other);
6321 if (value) { values[0] = value; kw_args--; }
6326 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ixt);
6327 if (value) { values[1] = value; kw_args--; }
6330 if (unlikely(kw_args > 0)) {
6331 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(0, 563, __pyx_L3_error)
6334 switch (PyTuple_GET_SIZE(__pyx_args)) {
6335 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6337 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6340 default:
goto __pyx_L5_argtuple_error;
6343 __pyx_v_other = values[0];
6344 __pyx_v_ixt = values[1];
6346 goto __pyx_L4_argument_unpacking_done;
6347 __pyx_L5_argtuple_error:;
6348 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 563, __pyx_L3_error)
6350 __Pyx_AddTraceback(
"PyClical.clifford.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6351 __Pyx_RefNannyFinishContext();
6353 __pyx_L4_argument_unpacking_done:;
6354 __pyx_r = __pyx_pf_8PyClical_8clifford_2__cinit__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), __pyx_v_other, __pyx_v_ixt);
6357 __Pyx_RefNannyFinishContext();
6361 static int __pyx_pf_8PyClical_8clifford_2__cinit__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_ixt) {
6362 PyObject *__pyx_v_error_msg_prefix = NULL;
6363 PyObject *__pyx_v_err = NULL;
6365 __Pyx_RefNannyDeclarations
6368 PyObject *__pyx_t_3 = NULL;
6369 PyObject *__pyx_t_4 = NULL;
6370 PyObject *__pyx_t_5 = NULL;
6372 PyObject *__pyx_t_7 = NULL;
6373 PyObject *__pyx_t_8 = NULL;
6375 PyObject *__pyx_t_10 = NULL;
6376 PyObject *__pyx_t_11 = NULL;
6377 PyObject *__pyx_t_12 = NULL;
6380 PyObject *__pyx_t_15 = NULL;
6381 PyObject *__pyx_t_16 = NULL;
6382 PyObject *__pyx_t_17 = NULL;
6383 PyObject *__pyx_t_18 = NULL;
6384 __Pyx_RefNannySetupContext(
"__cinit__", 0);
6393 __Pyx_INCREF(__pyx_kp_s_Cannot_initialize_clifford_objec);
6394 __pyx_v_error_msg_prefix = __pyx_kp_s_Cannot_initialize_clifford_objec;
6403 __pyx_t_1 = (__pyx_v_ixt == Py_None);
6404 __pyx_t_2 = (__pyx_t_1 != 0);
6415 __Pyx_PyThreadState_declare
6416 __Pyx_PyThreadState_assign
6417 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
6418 __Pyx_XGOTREF(__pyx_t_3);
6419 __Pyx_XGOTREF(__pyx_t_4);
6420 __Pyx_XGOTREF(__pyx_t_5);
6430 __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8PyClical_clifford);
6431 __pyx_t_1 = (__pyx_t_2 != 0);
6442 __pyx_t_6 =
new Clifford(__pyx_f_8PyClical_8clifford_unwrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_other)));
6444 __Pyx_CppExn2PyErr();
6445 __PYX_ERR(0, 592, __pyx_L4_error)
6447 __pyx_v_self->instance = __pyx_t_6;
6466 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8PyClical_index_set);
6467 __pyx_t_2 = (__pyx_t_1 != 0);
6478 __pyx_t_6 =
new Clifford(__pyx_f_8PyClical_9index_set_unwrap(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_other)), ((
scalar_t)1.0));
6480 __Pyx_CppExn2PyErr();
6481 __PYX_ERR(0, 594, __pyx_L4_error)
6483 __pyx_v_self->instance = __pyx_t_6;
6502 __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numbers);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 595, __pyx_L4_error)
6503 __Pyx_GOTREF(__pyx_t_7);
6504 __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)
6505 __Pyx_GOTREF(__pyx_t_8);
6506 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6507 __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)
6508 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6509 __pyx_t_1 = (__pyx_t_2 != 0);
6519 __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)
6523 __Pyx_CppExn2PyErr();
6524 __PYX_ERR(0, 596, __pyx_L4_error)
6526 __pyx_v_self->instance = __pyx_t_6;
6545 __pyx_t_1 = PyString_Check(__pyx_v_other);
6546 __pyx_t_2 = (__pyx_t_1 != 0);
6557 __Pyx_PyThreadState_declare
6558 __Pyx_PyThreadState_assign
6559 __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
6560 __Pyx_XGOTREF(__pyx_t_10);
6561 __Pyx_XGOTREF(__pyx_t_11);
6562 __Pyx_XGOTREF(__pyx_t_12);
6572 __pyx_t_13 = __Pyx_PyObject_AsWritableString(__pyx_v_other);
if (unlikely((!__pyx_t_13) && PyErr_Occurred())) __PYX_ERR(0, 599, __pyx_L11_error)
6574 __pyx_t_6 =
new Clifford(((
char *)__pyx_t_13));
6576 __Pyx_CppExn2PyErr();
6577 __PYX_ERR(0, 599, __pyx_L11_error)
6579 __pyx_v_self->instance = __pyx_t_6;
6589 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
6590 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
6591 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
6592 goto __pyx_L16_try_end;
6594 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6595 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
6604 __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
6606 __Pyx_AddTraceback(
"PyClical.clifford.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6607 if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_15) < 0) __PYX_ERR(0, 600, __pyx_L13_except_error)
6608 __Pyx_GOTREF(__pyx_t_8);
6609 __Pyx_GOTREF(__pyx_t_7);
6610 __Pyx_GOTREF(__pyx_t_15);
6619 __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)
6620 __Pyx_GOTREF(__pyx_t_16);
6621 __pyx_t_17 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 601, __pyx_L13_except_error)
6622 __Pyx_GOTREF(__pyx_t_17);
6623 __pyx_t_18 = PyNumber_Add(__pyx_t_16, __pyx_t_17);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 601, __pyx_L13_except_error)
6624 __Pyx_GOTREF(__pyx_t_18);
6625 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6626 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6627 __pyx_t_17 = PyNumber_Add(__pyx_t_18, __pyx_kp_s_);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 601, __pyx_L13_except_error)
6628 __Pyx_GOTREF(__pyx_t_17);
6629 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6630 __pyx_t_18 = PyTuple_New(1);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 601, __pyx_L13_except_error)
6631 __Pyx_GOTREF(__pyx_t_18);
6632 __Pyx_GIVEREF(__pyx_t_17);
6633 PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_17);
6635 __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)
6636 __Pyx_GOTREF(__pyx_t_17);
6637 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6638 __Pyx_Raise(__pyx_t_17, 0, 0, 0);
6639 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6640 __PYX_ERR(0, 601, __pyx_L13_except_error)
6642 goto __pyx_L13_except_error;
6643 __pyx_L13_except_error:;
6652 __Pyx_XGIVEREF(__pyx_t_10);
6653 __Pyx_XGIVEREF(__pyx_t_11);
6654 __Pyx_XGIVEREF(__pyx_t_12);
6655 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
6656 goto __pyx_L4_error;
6678 __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)
6679 __Pyx_GOTREF(__pyx_t_15);
6680 __pyx_t_7 = PyTuple_New(1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 603, __pyx_L4_error)
6681 __Pyx_GOTREF(__pyx_t_7);
6682 __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_other)));
6683 __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_other)));
6684 PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)Py_TYPE(__pyx_v_other)));
6685 __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)
6686 __Pyx_GOTREF(__pyx_t_8);
6687 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6688 __pyx_t_7 = PyNumber_Add(__pyx_t_15, __pyx_t_8);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 603, __pyx_L4_error)
6689 __Pyx_GOTREF(__pyx_t_7);
6690 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6691 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6692 __pyx_t_8 = PyNumber_Add(__pyx_t_7, __pyx_kp_s_);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 603, __pyx_L4_error)
6693 __Pyx_GOTREF(__pyx_t_8);
6694 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6695 __pyx_t_7 = PyTuple_New(1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 603, __pyx_L4_error)
6696 __Pyx_GOTREF(__pyx_t_7);
6697 __Pyx_GIVEREF(__pyx_t_8);
6698 PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8);
6700 __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)
6701 __Pyx_GOTREF(__pyx_t_8);
6702 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6703 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
6704 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6705 __PYX_ERR(0, 603, __pyx_L4_error)
6717 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6718 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6719 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
6720 goto __pyx_L9_try_end;
6722 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
6723 __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
6724 __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
6725 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
6726 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6727 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
6736 __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
6738 __Pyx_AddTraceback(
"PyClical.clifford.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6739 if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_15) < 0) __PYX_ERR(0, 604, __pyx_L6_except_error)
6740 __Pyx_GOTREF(__pyx_t_8);
6741 __Pyx_GOTREF(__pyx_t_7);
6742 __Pyx_GOTREF(__pyx_t_15);
6743 __Pyx_INCREF(__pyx_t_7);
6744 __pyx_v_err = __pyx_t_7;
6753 __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)
6754 __Pyx_GOTREF(__pyx_t_17);
6755 __pyx_t_18 = PyTuple_New(1);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 605, __pyx_L6_except_error)
6756 __Pyx_GOTREF(__pyx_t_18);
6757 __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_other)));
6758 __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_other)));
6759 PyTuple_SET_ITEM(__pyx_t_18, 0, ((PyObject *)Py_TYPE(__pyx_v_other)));
6760 __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)
6761 __Pyx_GOTREF(__pyx_t_16);
6762 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6763 __pyx_t_18 = PyNumber_Add(__pyx_t_17, __pyx_t_16);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 605, __pyx_L6_except_error)
6764 __Pyx_GOTREF(__pyx_t_18);
6765 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6766 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6775 __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)
6776 __Pyx_GOTREF(__pyx_t_16);
6777 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6778 __pyx_t_18 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 606, __pyx_L6_except_error)
6779 __Pyx_GOTREF(__pyx_t_18);
6780 __pyx_t_17 = PyNumber_Add(__pyx_t_16, __pyx_t_18);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 606, __pyx_L6_except_error)
6781 __Pyx_GOTREF(__pyx_t_17);
6782 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6783 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6784 __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)
6785 __Pyx_GOTREF(__pyx_t_18);
6786 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6795 __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)
6796 __Pyx_GOTREF(__pyx_t_17);
6797 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6798 __pyx_t_18 = PyTuple_New(1);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 607, __pyx_L6_except_error)
6799 __Pyx_GOTREF(__pyx_t_18);
6800 __Pyx_INCREF(__pyx_v_err);
6801 __Pyx_GIVEREF(__pyx_v_err);
6802 PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_v_err);
6803 __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)
6804 __Pyx_GOTREF(__pyx_t_16);
6805 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6806 __pyx_t_18 = PyNumber_Add(__pyx_t_17, __pyx_t_16);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 607, __pyx_L6_except_error)
6807 __Pyx_GOTREF(__pyx_t_18);
6808 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6809 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6818 __pyx_t_16 = PyTuple_New(1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 605, __pyx_L6_except_error)
6819 __Pyx_GOTREF(__pyx_t_16);
6820 __Pyx_GIVEREF(__pyx_t_18);
6821 PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_18);
6823 __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)
6824 __Pyx_GOTREF(__pyx_t_18);
6825 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6826 __Pyx_Raise(__pyx_t_18, 0, 0, 0);
6827 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6828 __PYX_ERR(0, 605, __pyx_L6_except_error)
6830 goto __pyx_L6_except_error;
6831 __pyx_L6_except_error:;
6840 __Pyx_XGIVEREF(__pyx_t_3);
6841 __Pyx_XGIVEREF(__pyx_t_4);
6842 __Pyx_XGIVEREF(__pyx_t_5);
6843 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
6844 goto __pyx_L1_error;
6865 __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_ixt, __pyx_ptype_8PyClical_index_set);
6866 __pyx_t_1 = (__pyx_t_2 != 0);
6876 __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_numbers);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 609, __pyx_L1_error)
6877 __Pyx_GOTREF(__pyx_t_15);
6878 __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)
6879 __Pyx_GOTREF(__pyx_t_7);
6880 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6881 __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)
6882 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6883 __pyx_t_2 = (__pyx_t_1 != 0);
6893 __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)
6895 __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));
6897 __Pyx_CppExn2PyErr();
6898 __PYX_ERR(0, 610, __pyx_L1_error)
6900 __pyx_v_self->instance = __pyx_t_6;
6919 __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_collections);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 611, __pyx_L1_error)
6920 __Pyx_GOTREF(__pyx_t_7);
6921 __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)
6922 __Pyx_GOTREF(__pyx_t_15);
6923 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6924 __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)
6925 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6926 __pyx_t_1 = (__pyx_t_2 != 0);
6937 __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)));
6939 __Pyx_CppExn2PyErr();
6940 __PYX_ERR(0, 612, __pyx_L1_error)
6942 __pyx_v_self->instance = __pyx_t_6;
6962 __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)
6963 __Pyx_GOTREF(__pyx_t_15);
6964 __pyx_t_7 = PyTuple_New(1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 614, __pyx_L1_error)
6965 __Pyx_GOTREF(__pyx_t_7);
6966 __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_other)));
6967 __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_other)));
6968 PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)Py_TYPE(__pyx_v_other)));
6969 __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)
6970 __Pyx_GOTREF(__pyx_t_8);
6971 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6972 __pyx_t_7 = PyNumber_Add(__pyx_t_15, __pyx_t_8);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 614, __pyx_L1_error)
6973 __Pyx_GOTREF(__pyx_t_7);
6974 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6975 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6984 __pyx_t_8 = PyNumber_Add(__pyx_t_7, __pyx_kp_s__8);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 615, __pyx_L1_error)
6985 __Pyx_GOTREF(__pyx_t_8);
6986 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6987 __pyx_t_7 = PyObject_Repr(__pyx_v_ixt);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 615, __pyx_L1_error)
6988 __Pyx_GOTREF(__pyx_t_7);
6989 __pyx_t_15 = PyNumber_Add(__pyx_t_8, __pyx_t_7);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 615, __pyx_L1_error)
6990 __Pyx_GOTREF(__pyx_t_15);
6991 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6992 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6993 __pyx_t_7 = PyNumber_Add(__pyx_t_15, __pyx_kp_s__9);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 615, __pyx_L1_error)
6994 __Pyx_GOTREF(__pyx_t_7);
6995 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7004 __pyx_t_15 = PyTuple_New(1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 614, __pyx_L1_error)
7005 __Pyx_GOTREF(__pyx_t_15);
7006 __Pyx_GIVEREF(__pyx_t_7);
7007 PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_7);
7009 __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)
7010 __Pyx_GOTREF(__pyx_t_7);
7011 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7012 __Pyx_Raise(__pyx_t_7, 0, 0, 0);
7013 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7014 __PYX_ERR(0, 614, __pyx_L1_error)
7036 __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)
7037 __Pyx_GOTREF(__pyx_t_7);
7038 __pyx_t_15 = PyTuple_New(1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 617, __pyx_L1_error)
7039 __Pyx_GOTREF(__pyx_t_15);
7040 __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_other)));
7041 __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_other)));
7042 PyTuple_SET_ITEM(__pyx_t_15, 0, ((PyObject *)Py_TYPE(__pyx_v_other)));
7043 __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)
7044 __Pyx_GOTREF(__pyx_t_8);
7045 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7046 __pyx_t_15 = PyNumber_Add(__pyx_t_7, __pyx_t_8);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 617, __pyx_L1_error)
7047 __Pyx_GOTREF(__pyx_t_15);
7048 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7049 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7058 __pyx_t_8 = PyNumber_Add(__pyx_t_15, __pyx_kp_s__8);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 618, __pyx_L1_error)
7059 __Pyx_GOTREF(__pyx_t_8);
7060 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7061 __pyx_t_15 = PyTuple_New(1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 618, __pyx_L1_error)
7062 __Pyx_GOTREF(__pyx_t_15);
7063 __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_ixt)));
7064 __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_ixt)));
7065 PyTuple_SET_ITEM(__pyx_t_15, 0, ((PyObject *)Py_TYPE(__pyx_v_ixt)));
7066 __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)
7067 __Pyx_GOTREF(__pyx_t_7);
7068 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7069 __pyx_t_15 = PyNumber_Add(__pyx_t_8, __pyx_t_7);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 618, __pyx_L1_error)
7070 __Pyx_GOTREF(__pyx_t_15);
7071 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7072 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7073 __pyx_t_7 = PyNumber_Add(__pyx_t_15, __pyx_kp_s__9);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 618, __pyx_L1_error)
7074 __Pyx_GOTREF(__pyx_t_7);
7075 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7084 __pyx_t_15 = PyTuple_New(1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 617, __pyx_L1_error)
7085 __Pyx_GOTREF(__pyx_t_15);
7086 __Pyx_GIVEREF(__pyx_t_7);
7087 PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_7);
7089 __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)
7090 __Pyx_GOTREF(__pyx_t_7);
7091 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7092 __Pyx_Raise(__pyx_t_7, 0, 0, 0);
7093 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7094 __PYX_ERR(0, 617, __pyx_L1_error)
7110 __Pyx_XDECREF(__pyx_t_7);
7111 __Pyx_XDECREF(__pyx_t_8);
7112 __Pyx_XDECREF(__pyx_t_15);
7113 __Pyx_XDECREF(__pyx_t_16);
7114 __Pyx_XDECREF(__pyx_t_17);
7115 __Pyx_XDECREF(__pyx_t_18);
7116 __Pyx_AddTraceback(
"PyClical.clifford.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7119 __Pyx_XDECREF(__pyx_v_error_msg_prefix);
7120 __Pyx_XDECREF(__pyx_v_err);
7121 __Pyx_RefNannyFinishContext();
7134 static void __pyx_pw_8PyClical_8clifford_5__dealloc__(PyObject *__pyx_v_self);
7135 static void __pyx_pw_8PyClical_8clifford_5__dealloc__(PyObject *__pyx_v_self) {
7136 __Pyx_RefNannyDeclarations
7137 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
7138 __pyx_pf_8PyClical_8clifford_4__dealloc__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
7141 __Pyx_RefNannyFinishContext();
7144 static void __pyx_pf_8PyClical_8clifford_4__dealloc__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
7145 __Pyx_RefNannyDeclarations
7146 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
7155 delete __pyx_v_self->instance;
7166 __Pyx_RefNannyFinishContext();
7178 static int __pyx_pw_8PyClical_8clifford_7__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_x);
7179 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 ";
7180 #if CYTHON_COMPILING_IN_CPYTHON 7181 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_6__contains__;
7183 static int __pyx_pw_8PyClical_8clifford_7__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_x) {
7185 __Pyx_RefNannyDeclarations
7186 __Pyx_RefNannySetupContext(
"__contains__ (wrapper)", 0);
7187 __pyx_r = __pyx_pf_8PyClical_8clifford_6__contains__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_x));
7190 __Pyx_RefNannyFinishContext();
7194 static int __pyx_pf_8PyClical_8clifford_6__contains__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_x) {
7196 __Pyx_RefNannyDeclarations
7197 PyObject *__pyx_t_1 = NULL;
7198 __Pyx_RefNannySetupContext(
"__contains__", 0);
7207 __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)
7208 __Pyx_GOTREF(__pyx_t_1);
7209 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
7210 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7211 __PYX_ERR(0, 635, __pyx_L1_error)
7223 __Pyx_XDECREF(__pyx_t_1);
7224 __Pyx_AddTraceback(
"PyClical.clifford.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7226 __Pyx_RefNannyFinishContext();
7239 static PyObject *__pyx_pw_8PyClical_8clifford_9__iter__(PyObject *__pyx_v_self);
7240 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 ";
7241 #if CYTHON_COMPILING_IN_CPYTHON 7242 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_8__iter__;
7244 static PyObject *__pyx_pw_8PyClical_8clifford_9__iter__(PyObject *__pyx_v_self) {
7245 PyObject *__pyx_r = 0;
7246 __Pyx_RefNannyDeclarations
7247 __Pyx_RefNannySetupContext(
"__iter__ (wrapper)", 0);
7248 __pyx_r = __pyx_pf_8PyClical_8clifford_8__iter__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
7251 __Pyx_RefNannyFinishContext();
7255 static PyObject *__pyx_pf_8PyClical_8clifford_8__iter__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
7256 PyObject *__pyx_r = NULL;
7257 __Pyx_RefNannyDeclarations
7258 PyObject *__pyx_t_1 = NULL;
7259 __Pyx_RefNannySetupContext(
"__iter__", 0);
7268 __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)
7269 __Pyx_GOTREF(__pyx_t_1);
7270 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
7271 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7272 __PYX_ERR(0, 646, __pyx_L1_error)
7284 __Pyx_XDECREF(__pyx_t_1);
7285 __Pyx_AddTraceback(
"PyClical.clifford.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7287 __Pyx_XGIVEREF(__pyx_r);
7288 __Pyx_RefNannyFinishContext();
7301 static PyObject *__pyx_pw_8PyClical_8clifford_11reframe(PyObject *__pyx_v_self, PyObject *__pyx_v_ixt);
7302 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 ";
7303 static PyObject *__pyx_pw_8PyClical_8clifford_11reframe(PyObject *__pyx_v_self, PyObject *__pyx_v_ixt) {
7304 PyObject *__pyx_r = 0;
7305 __Pyx_RefNannyDeclarations
7306 __Pyx_RefNannySetupContext(
"reframe (wrapper)", 0);
7307 __pyx_r = __pyx_pf_8PyClical_8clifford_10reframe(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_ixt));
7310 __Pyx_RefNannyFinishContext();
7314 static PyObject *__pyx_pf_8PyClical_8clifford_10reframe(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_ixt) {
7315 PyObject *__pyx_v_error_msg_prefix = NULL;
7316 struct __pyx_obj_8PyClical_clifford *__pyx_v_result = NULL;
7317 PyObject *__pyx_v_err = NULL;
7318 PyObject *__pyx_r = NULL;
7319 __Pyx_RefNannyDeclarations
7322 PyObject *__pyx_t_3 = NULL;
7323 PyObject *__pyx_t_4 = NULL;
7324 PyObject *__pyx_t_5 = NULL;
7325 PyObject *__pyx_t_6 = NULL;
7328 PyObject *__pyx_t_9 = NULL;
7329 PyObject *__pyx_t_10 = NULL;
7330 PyObject *__pyx_t_11 = NULL;
7331 PyObject *__pyx_t_12 = NULL;
7332 PyObject *__pyx_t_13 = NULL;
7333 __Pyx_RefNannySetupContext(
"reframe", 0);
7342 __Pyx_INCREF(__pyx_kp_s_Cannot_reframe);
7343 __pyx_v_error_msg_prefix = __pyx_kp_s_Cannot_reframe;
7352 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_ixt, __pyx_ptype_8PyClical_index_set);
7353 __pyx_t_2 = (__pyx_t_1 != 0);
7364 __Pyx_PyThreadState_declare
7365 __Pyx_PyThreadState_assign
7366 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
7367 __Pyx_XGOTREF(__pyx_t_3);
7368 __Pyx_XGOTREF(__pyx_t_4);
7369 __Pyx_XGOTREF(__pyx_t_5);
7379 __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)
7380 __Pyx_GOTREF(__pyx_t_6);
7381 __pyx_v_result = ((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_6);
7392 __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)));
7394 __Pyx_CppExn2PyErr();
7395 __PYX_ERR(0, 662, __pyx_L4_error)
7397 __pyx_v_result->instance = __pyx_t_7;
7407 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7408 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7409 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
7410 goto __pyx_L9_try_end;
7412 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
7421 __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
7423 __Pyx_AddTraceback(
"PyClical.clifford.reframe", __pyx_clineno, __pyx_lineno, __pyx_filename);
7424 if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 663, __pyx_L6_except_error)
7425 __Pyx_GOTREF(__pyx_t_6);
7426 __Pyx_GOTREF(__pyx_t_9);
7427 __Pyx_GOTREF(__pyx_t_10);
7428 __Pyx_INCREF(__pyx_t_9);
7429 __pyx_v_err = __pyx_t_9;
7438 __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)
7439 __Pyx_GOTREF(__pyx_t_11);
7440 __pyx_t_12 = PyTuple_New(1);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 664, __pyx_L6_except_error)
7441 __Pyx_GOTREF(__pyx_t_12);
7442 __Pyx_INCREF(((PyObject *)__pyx_v_self));
7443 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
7444 PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)__pyx_v_self));
7445 __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)
7446 __Pyx_GOTREF(__pyx_t_13);
7447 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7448 __pyx_t_12 = PyNumber_Add(__pyx_t_11, __pyx_t_13);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 664, __pyx_L6_except_error)
7449 __Pyx_GOTREF(__pyx_t_12);
7450 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7451 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7452 __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)
7453 __Pyx_GOTREF(__pyx_t_13);
7454 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7463 __pyx_t_12 = PyTuple_New(1);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 665, __pyx_L6_except_error)
7464 __Pyx_GOTREF(__pyx_t_12);
7465 __Pyx_INCREF(__pyx_v_ixt);
7466 __Pyx_GIVEREF(__pyx_v_ixt);
7467 PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_ixt);
7468 __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)
7469 __Pyx_GOTREF(__pyx_t_11);
7470 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7471 __pyx_t_12 = PyNumber_Add(__pyx_t_13, __pyx_t_11);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 665, __pyx_L6_except_error)
7472 __Pyx_GOTREF(__pyx_t_12);
7473 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7474 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7475 __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)
7476 __Pyx_GOTREF(__pyx_t_11);
7477 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7486 __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)
7487 __Pyx_GOTREF(__pyx_t_12);
7488 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7489 __pyx_t_11 = PyTuple_New(1);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 666, __pyx_L6_except_error)
7490 __Pyx_GOTREF(__pyx_t_11);
7491 __Pyx_INCREF(__pyx_v_err);
7492 __Pyx_GIVEREF(__pyx_v_err);
7493 PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_err);
7494 __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)
7495 __Pyx_GOTREF(__pyx_t_13);
7496 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7497 __pyx_t_11 = PyNumber_Add(__pyx_t_12, __pyx_t_13);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 666, __pyx_L6_except_error)
7498 __Pyx_GOTREF(__pyx_t_11);
7499 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7500 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7509 __pyx_t_13 = PyTuple_New(1);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 664, __pyx_L6_except_error)
7510 __Pyx_GOTREF(__pyx_t_13);
7511 __Pyx_GIVEREF(__pyx_t_11);
7512 PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11);
7514 __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)
7515 __Pyx_GOTREF(__pyx_t_11);
7516 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7517 __Pyx_Raise(__pyx_t_11, 0, 0, 0);
7518 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7519 __PYX_ERR(0, 664, __pyx_L6_except_error)
7521 goto __pyx_L6_except_error;
7522 __pyx_L6_except_error:;
7531 __Pyx_XGIVEREF(__pyx_t_3);
7532 __Pyx_XGIVEREF(__pyx_t_4);
7533 __Pyx_XGIVEREF(__pyx_t_5);
7534 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
7535 goto __pyx_L1_error;
7557 __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)
7558 __Pyx_GOTREF(__pyx_t_10);
7559 __pyx_t_9 = PyTuple_New(1);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 668, __pyx_L1_error)
7560 __Pyx_GOTREF(__pyx_t_9);
7561 __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_ixt)));
7562 __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_ixt)));
7563 PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)Py_TYPE(__pyx_v_ixt)));
7564 __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)
7565 __Pyx_GOTREF(__pyx_t_6);
7566 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7567 __pyx_t_9 = PyNumber_Add(__pyx_t_10, __pyx_t_6);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 668, __pyx_L1_error)
7568 __Pyx_GOTREF(__pyx_t_9);
7569 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7570 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7571 __pyx_t_6 = PyNumber_Add(__pyx_t_9, __pyx_kp_s__9);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 668, __pyx_L1_error)
7572 __Pyx_GOTREF(__pyx_t_6);
7573 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7574 __pyx_t_9 = PyTuple_New(1);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 668, __pyx_L1_error)
7575 __Pyx_GOTREF(__pyx_t_9);
7576 __Pyx_GIVEREF(__pyx_t_6);
7577 PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6);
7579 __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)
7580 __Pyx_GOTREF(__pyx_t_6);
7581 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7582 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
7583 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7584 __PYX_ERR(0, 668, __pyx_L1_error)
7595 __Pyx_XDECREF(__pyx_r);
7596 __Pyx_INCREF(((PyObject *)__pyx_v_result));
7597 __pyx_r = ((PyObject *)__pyx_v_result);
7610 __Pyx_XDECREF(__pyx_t_6);
7611 __Pyx_XDECREF(__pyx_t_9);
7612 __Pyx_XDECREF(__pyx_t_10);
7613 __Pyx_XDECREF(__pyx_t_11);
7614 __Pyx_XDECREF(__pyx_t_12);
7615 __Pyx_XDECREF(__pyx_t_13);
7616 __Pyx_AddTraceback(
"PyClical.clifford.reframe", __pyx_clineno, __pyx_lineno, __pyx_filename);
7619 __Pyx_XDECREF(__pyx_v_error_msg_prefix);
7620 __Pyx_XDECREF((PyObject *)__pyx_v_result);
7621 __Pyx_XDECREF(__pyx_v_err);
7622 __Pyx_XGIVEREF(__pyx_r);
7623 __Pyx_RefNannyFinishContext();
7636 static PyObject *__pyx_pw_8PyClical_8clifford_13__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op);
7637 static PyObject *__pyx_pw_8PyClical_8clifford_13__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op) {
7638 PyObject *__pyx_r = 0;
7639 __Pyx_RefNannyDeclarations
7640 __Pyx_RefNannySetupContext(
"__richcmp__ (wrapper)", 0);
7641 __pyx_r = __pyx_pf_8PyClical_8clifford_12__richcmp__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs), ((
int)__pyx_v_op));
7644 __Pyx_RefNannyFinishContext();
7648 static PyObject *__pyx_pf_8PyClical_8clifford_12__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op) {
7649 PyObject *__pyx_r = NULL;
7650 __Pyx_RefNannyDeclarations
7654 PyObject *__pyx_t_4 = NULL;
7655 PyObject *__pyx_t_5 = NULL;
7656 PyObject *__pyx_t_6 = NULL;
7657 __Pyx_RefNannySetupContext(
"__richcmp__", 0);
7666 __pyx_t_1 = ((__pyx_v_op == 2) != 0);
7676 __pyx_t_2 = (__pyx_v_lhs == Py_None);
7677 __pyx_t_3 = (__pyx_t_2 != 0);
7680 __pyx_t_1 = __pyx_t_3;
7681 goto __pyx_L5_bool_binop_done;
7683 __pyx_t_3 = (__pyx_v_rhs == Py_None);
7684 __pyx_t_2 = (__pyx_t_3 != 0);
7685 __pyx_t_1 = __pyx_t_2;
7686 __pyx_L5_bool_binop_done:;
7696 __Pyx_XDECREF(__pyx_r);
7697 __pyx_t_1 = (__pyx_v_lhs == __pyx_v_rhs);
7698 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error)
7699 __Pyx_GOTREF(__pyx_t_4);
7700 __pyx_r = __pyx_t_4;
7721 __Pyx_XDECREF(__pyx_r);
7722 __pyx_t_1 = (__pyx_f_8PyClical_toClifford(__pyx_v_lhs) == __pyx_f_8PyClical_toClifford(__pyx_v_rhs));
7723 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 694, __pyx_L1_error)
7724 __Pyx_GOTREF(__pyx_t_4);
7725 __pyx_r = __pyx_t_4;
7746 __pyx_t_1 = ((__pyx_v_op == 3) != 0);
7756 __pyx_t_2 = (__pyx_v_lhs == Py_None);
7757 __pyx_t_3 = (__pyx_t_2 != 0);
7760 __pyx_t_1 = __pyx_t_3;
7761 goto __pyx_L8_bool_binop_done;
7763 __pyx_t_3 = (__pyx_v_rhs == Py_None);
7764 __pyx_t_2 = (__pyx_t_3 != 0);
7765 __pyx_t_1 = __pyx_t_2;
7766 __pyx_L8_bool_binop_done:;
7776 __Pyx_XDECREF(__pyx_r);
7777 __pyx_t_1 = (__pyx_v_lhs == __pyx_v_rhs);
7778 __pyx_t_4 = __Pyx_PyBool_FromLong((!((!(!__pyx_t_1)) != 0)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 697, __pyx_L1_error)
7779 __Pyx_GOTREF(__pyx_t_4);
7780 __pyx_r = __pyx_t_4;
7801 __Pyx_XDECREF(__pyx_r);
7802 __pyx_t_1 = (__pyx_f_8PyClical_toClifford(__pyx_v_lhs) != __pyx_f_8PyClical_toClifford(__pyx_v_rhs));
7803 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 699, __pyx_L1_error)
7804 __Pyx_GOTREF(__pyx_t_4);
7805 __pyx_r = __pyx_t_4;
7826 __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_lhs, __pyx_ptype_8PyClical_clifford);
7827 __pyx_t_3 = (__pyx_t_2 != 0);
7830 __pyx_t_1 = __pyx_t_3;
7831 goto __pyx_L10_bool_binop_done;
7833 __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_rhs, __pyx_ptype_8PyClical_clifford);
7834 __pyx_t_2 = (__pyx_t_3 != 0);
7835 __pyx_t_1 = __pyx_t_2;
7836 __pyx_L10_bool_binop_done:;
7846 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 702, __pyx_L1_error)
7847 __Pyx_GOTREF(__pyx_t_4);
7848 __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_lhs)));
7849 __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_lhs)));
7850 PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)Py_TYPE(__pyx_v_lhs)));
7851 __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)
7852 __Pyx_GOTREF(__pyx_t_5);
7853 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7854 __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)
7855 __Pyx_GOTREF(__pyx_t_4);
7856 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7857 __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_kp_s__8);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 702, __pyx_L1_error)
7858 __Pyx_GOTREF(__pyx_t_5);
7859 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7860 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 702, __pyx_L1_error)
7861 __Pyx_GOTREF(__pyx_t_4);
7862 __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_rhs)));
7863 __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_rhs)));
7864 PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)Py_TYPE(__pyx_v_rhs)));
7865 __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)
7866 __Pyx_GOTREF(__pyx_t_6);
7867 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7868 __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_t_6);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 702, __pyx_L1_error)
7869 __Pyx_GOTREF(__pyx_t_4);
7870 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7871 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7872 __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_kp_s_);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 702, __pyx_L1_error)
7873 __Pyx_GOTREF(__pyx_t_6);
7874 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7883 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 701, __pyx_L1_error)
7884 __Pyx_GOTREF(__pyx_t_4);
7885 __Pyx_GIVEREF(__pyx_t_6);
7886 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
7888 __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)
7889 __Pyx_GOTREF(__pyx_t_6);
7890 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7891 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
7892 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7893 __PYX_ERR(0, 701, __pyx_L1_error)
7912 __Pyx_XDECREF(__pyx_r);
7913 __Pyx_INCREF(__pyx_builtin_NotImplemented);
7914 __pyx_r = __pyx_builtin_NotImplemented;
7928 __Pyx_XDECREF(__pyx_t_4);
7929 __Pyx_XDECREF(__pyx_t_5);
7930 __Pyx_XDECREF(__pyx_t_6);
7931 __Pyx_AddTraceback(
"PyClical.clifford.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7934 __Pyx_XGIVEREF(__pyx_r);
7935 __Pyx_RefNannyFinishContext();
7948 static PyObject *__pyx_pw_8PyClical_8clifford_15__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ixt);
7949 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 ";
7950 #if CYTHON_COMPILING_IN_CPYTHON 7951 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_14__getitem__;
7953 static PyObject *__pyx_pw_8PyClical_8clifford_15__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ixt) {
7954 PyObject *__pyx_r = 0;
7955 __Pyx_RefNannyDeclarations
7956 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
7957 __pyx_r = __pyx_pf_8PyClical_8clifford_14__getitem__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_ixt));
7960 __Pyx_RefNannyFinishContext();
7964 static PyObject *__pyx_pf_8PyClical_8clifford_14__getitem__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_ixt) {
7965 PyObject *__pyx_r = NULL;
7966 __Pyx_RefNannyDeclarations
7967 PyObject *__pyx_t_1 = NULL;
7968 __Pyx_RefNannySetupContext(
"__getitem__", 0);
7977 __Pyx_XDECREF(__pyx_r);
7978 __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)
7979 __Pyx_GOTREF(__pyx_t_1);
7980 __pyx_r = __pyx_t_1;
7994 __Pyx_XDECREF(__pyx_t_1);
7995 __Pyx_AddTraceback(
"PyClical.clifford.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7998 __Pyx_XGIVEREF(__pyx_r);
7999 __Pyx_RefNannyFinishContext();
8012 static PyObject *__pyx_pw_8PyClical_8clifford_17__neg__(PyObject *__pyx_v_self);
8013 static char __pyx_doc_8PyClical_8clifford_16__neg__[] =
"\n Unary -.\n\n >>> print -clifford(\"{1}\")\n -{1}\n ";
8014 #if CYTHON_COMPILING_IN_CPYTHON 8015 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_16__neg__;
8017 static PyObject *__pyx_pw_8PyClical_8clifford_17__neg__(PyObject *__pyx_v_self) {
8018 PyObject *__pyx_r = 0;
8019 __Pyx_RefNannyDeclarations
8020 __Pyx_RefNannySetupContext(
"__neg__ (wrapper)", 0);
8021 __pyx_r = __pyx_pf_8PyClical_8clifford_16__neg__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
8024 __Pyx_RefNannyFinishContext();
8028 static PyObject *__pyx_pf_8PyClical_8clifford_16__neg__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
8029 PyObject *__pyx_r = NULL;
8030 __Pyx_RefNannyDeclarations
8031 PyObject *__pyx_t_1 = NULL;
8032 PyObject *__pyx_t_2 = NULL;
8033 __Pyx_RefNannySetupContext(
"__neg__", 0);
8042 __Pyx_XDECREF(__pyx_r);
8043 __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)
8044 __Pyx_GOTREF(__pyx_t_1);
8045 __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)
8046 __Pyx_GOTREF(__pyx_t_2);
8047 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8048 __pyx_r = __pyx_t_2;
8062 __Pyx_XDECREF(__pyx_t_1);
8063 __Pyx_XDECREF(__pyx_t_2);
8064 __Pyx_AddTraceback(
"PyClical.clifford.__neg__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8067 __Pyx_XGIVEREF(__pyx_r);
8068 __Pyx_RefNannyFinishContext();
8081 static PyObject *__pyx_pw_8PyClical_8clifford_19__pos__(PyObject *__pyx_v_self);
8082 static char __pyx_doc_8PyClical_8clifford_18__pos__[] =
"\n Unary +.\n\n >>> print +clifford(\"{1}\")\n {1}\n ";
8083 #if CYTHON_COMPILING_IN_CPYTHON 8084 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_18__pos__;
8086 static PyObject *__pyx_pw_8PyClical_8clifford_19__pos__(PyObject *__pyx_v_self) {
8087 PyObject *__pyx_r = 0;
8088 __Pyx_RefNannyDeclarations
8089 __Pyx_RefNannySetupContext(
"__pos__ (wrapper)", 0);
8090 __pyx_r = __pyx_pf_8PyClical_8clifford_18__pos__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
8093 __Pyx_RefNannyFinishContext();
8097 static PyObject *__pyx_pf_8PyClical_8clifford_18__pos__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
8098 PyObject *__pyx_r = NULL;
8099 __Pyx_RefNannyDeclarations
8100 PyObject *__pyx_t_1 = NULL;
8101 PyObject *__pyx_t_2 = NULL;
8102 __Pyx_RefNannySetupContext(
"__pos__", 0);
8111 __Pyx_XDECREF(__pyx_r);
8112 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 737, __pyx_L1_error)
8113 __Pyx_GOTREF(__pyx_t_1);
8114 __Pyx_INCREF(((PyObject *)__pyx_v_self));
8115 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
8116 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
8117 __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)
8118 __Pyx_GOTREF(__pyx_t_2);
8119 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8120 __pyx_r = __pyx_t_2;
8134 __Pyx_XDECREF(__pyx_t_1);
8135 __Pyx_XDECREF(__pyx_t_2);
8136 __Pyx_AddTraceback(
"PyClical.clifford.__pos__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8139 __Pyx_XGIVEREF(__pyx_r);
8140 __Pyx_RefNannyFinishContext();
8153 static PyObject *__pyx_pw_8PyClical_8clifford_21__add__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8154 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 ";
8155 #if CYTHON_COMPILING_IN_CPYTHON 8156 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_20__add__;
8158 static PyObject *__pyx_pw_8PyClical_8clifford_21__add__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8159 PyObject *__pyx_r = 0;
8160 __Pyx_RefNannyDeclarations
8161 __Pyx_RefNannySetupContext(
"__add__ (wrapper)", 0);
8162 __pyx_r = __pyx_pf_8PyClical_8clifford_20__add__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8165 __Pyx_RefNannyFinishContext();
8169 static PyObject *__pyx_pf_8PyClical_8clifford_20__add__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8170 PyObject *__pyx_r = NULL;
8171 __Pyx_RefNannyDeclarations
8172 PyObject *__pyx_t_1 = NULL;
8173 PyObject *__pyx_t_2 = NULL;
8174 __Pyx_RefNannySetupContext(
"__add__", 0);
8183 __Pyx_XDECREF(__pyx_r);
8184 __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)
8185 __Pyx_GOTREF(__pyx_t_1);
8186 __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)
8187 __Pyx_GOTREF(__pyx_t_2);
8188 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8189 __pyx_r = __pyx_t_2;
8203 __Pyx_XDECREF(__pyx_t_1);
8204 __Pyx_XDECREF(__pyx_t_2);
8205 __Pyx_AddTraceback(
"PyClical.clifford.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8208 __Pyx_XGIVEREF(__pyx_r);
8209 __Pyx_RefNannyFinishContext();
8222 static PyObject *__pyx_pw_8PyClical_8clifford_23__iadd__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8223 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 ";
8224 #if CYTHON_COMPILING_IN_CPYTHON 8225 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_22__iadd__;
8227 static PyObject *__pyx_pw_8PyClical_8clifford_23__iadd__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8228 PyObject *__pyx_r = 0;
8229 __Pyx_RefNannyDeclarations
8230 __Pyx_RefNannySetupContext(
"__iadd__ (wrapper)", 0);
8231 __pyx_r = __pyx_pf_8PyClical_8clifford_22__iadd__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8234 __Pyx_RefNannyFinishContext();
8238 static PyObject *__pyx_pf_8PyClical_8clifford_22__iadd__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8239 PyObject *__pyx_r = NULL;
8240 __Pyx_RefNannyDeclarations
8241 PyObject *__pyx_t_1 = NULL;
8242 __Pyx_RefNannySetupContext(
"__iadd__", 0);
8251 __Pyx_XDECREF(__pyx_r);
8252 __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)
8253 __Pyx_GOTREF(__pyx_t_1);
8254 __pyx_r = __pyx_t_1;
8268 __Pyx_XDECREF(__pyx_t_1);
8269 __Pyx_AddTraceback(
"PyClical.clifford.__iadd__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8272 __Pyx_XGIVEREF(__pyx_r);
8273 __Pyx_RefNannyFinishContext();
8286 static PyObject *__pyx_pw_8PyClical_8clifford_25__sub__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8287 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 ";
8288 #if CYTHON_COMPILING_IN_CPYTHON 8289 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_24__sub__;
8291 static PyObject *__pyx_pw_8PyClical_8clifford_25__sub__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8292 PyObject *__pyx_r = 0;
8293 __Pyx_RefNannyDeclarations
8294 __Pyx_RefNannySetupContext(
"__sub__ (wrapper)", 0);
8295 __pyx_r = __pyx_pf_8PyClical_8clifford_24__sub__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8298 __Pyx_RefNannyFinishContext();
8302 static PyObject *__pyx_pf_8PyClical_8clifford_24__sub__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8303 PyObject *__pyx_r = NULL;
8304 __Pyx_RefNannyDeclarations
8305 PyObject *__pyx_t_1 = NULL;
8306 PyObject *__pyx_t_2 = NULL;
8307 __Pyx_RefNannySetupContext(
"__sub__", 0);
8316 __Pyx_XDECREF(__pyx_r);
8317 __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)
8318 __Pyx_GOTREF(__pyx_t_1);
8319 __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)
8320 __Pyx_GOTREF(__pyx_t_2);
8321 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8322 __pyx_r = __pyx_t_2;
8336 __Pyx_XDECREF(__pyx_t_1);
8337 __Pyx_XDECREF(__pyx_t_2);
8338 __Pyx_AddTraceback(
"PyClical.clifford.__sub__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8341 __Pyx_XGIVEREF(__pyx_r);
8342 __Pyx_RefNannyFinishContext();
8355 static PyObject *__pyx_pw_8PyClical_8clifford_27__isub__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8356 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 ";
8357 #if CYTHON_COMPILING_IN_CPYTHON 8358 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_26__isub__;
8360 static PyObject *__pyx_pw_8PyClical_8clifford_27__isub__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8361 PyObject *__pyx_r = 0;
8362 __Pyx_RefNannyDeclarations
8363 __Pyx_RefNannySetupContext(
"__isub__ (wrapper)", 0);
8364 __pyx_r = __pyx_pf_8PyClical_8clifford_26__isub__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8367 __Pyx_RefNannyFinishContext();
8371 static PyObject *__pyx_pf_8PyClical_8clifford_26__isub__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8372 PyObject *__pyx_r = NULL;
8373 __Pyx_RefNannyDeclarations
8374 PyObject *__pyx_t_1 = NULL;
8375 __Pyx_RefNannySetupContext(
"__isub__", 0);
8384 __Pyx_XDECREF(__pyx_r);
8385 __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)
8386 __Pyx_GOTREF(__pyx_t_1);
8387 __pyx_r = __pyx_t_1;
8401 __Pyx_XDECREF(__pyx_t_1);
8402 __Pyx_AddTraceback(
"PyClical.clifford.__isub__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8405 __Pyx_XGIVEREF(__pyx_r);
8406 __Pyx_RefNannyFinishContext();
8419 static PyObject *__pyx_pw_8PyClical_8clifford_29__mul__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8420 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 ";
8421 #if CYTHON_COMPILING_IN_CPYTHON 8422 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_28__mul__;
8424 static PyObject *__pyx_pw_8PyClical_8clifford_29__mul__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8425 PyObject *__pyx_r = 0;
8426 __Pyx_RefNannyDeclarations
8427 __Pyx_RefNannySetupContext(
"__mul__ (wrapper)", 0);
8428 __pyx_r = __pyx_pf_8PyClical_8clifford_28__mul__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8431 __Pyx_RefNannyFinishContext();
8435 static PyObject *__pyx_pf_8PyClical_8clifford_28__mul__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8436 PyObject *__pyx_r = NULL;
8437 __Pyx_RefNannyDeclarations
8438 PyObject *__pyx_t_1 = NULL;
8439 PyObject *__pyx_t_2 = NULL;
8440 __Pyx_RefNannySetupContext(
"__mul__", 0);
8449 __Pyx_XDECREF(__pyx_r);
8450 __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)
8451 __Pyx_GOTREF(__pyx_t_1);
8452 __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)
8453 __Pyx_GOTREF(__pyx_t_2);
8454 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8455 __pyx_r = __pyx_t_2;
8469 __Pyx_XDECREF(__pyx_t_1);
8470 __Pyx_XDECREF(__pyx_t_2);
8471 __Pyx_AddTraceback(
"PyClical.clifford.__mul__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8474 __Pyx_XGIVEREF(__pyx_r);
8475 __Pyx_RefNannyFinishContext();
8488 static PyObject *__pyx_pw_8PyClical_8clifford_31__imul__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8489 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 ";
8490 #if CYTHON_COMPILING_IN_CPYTHON 8491 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_30__imul__;
8493 static PyObject *__pyx_pw_8PyClical_8clifford_31__imul__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8494 PyObject *__pyx_r = 0;
8495 __Pyx_RefNannyDeclarations
8496 __Pyx_RefNannySetupContext(
"__imul__ (wrapper)", 0);
8497 __pyx_r = __pyx_pf_8PyClical_8clifford_30__imul__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8500 __Pyx_RefNannyFinishContext();
8504 static PyObject *__pyx_pf_8PyClical_8clifford_30__imul__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8505 PyObject *__pyx_r = NULL;
8506 __Pyx_RefNannyDeclarations
8507 PyObject *__pyx_t_1 = NULL;
8508 __Pyx_RefNannySetupContext(
"__imul__", 0);
8517 __Pyx_XDECREF(__pyx_r);
8518 __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)
8519 __Pyx_GOTREF(__pyx_t_1);
8520 __pyx_r = __pyx_t_1;
8534 __Pyx_XDECREF(__pyx_t_1);
8535 __Pyx_AddTraceback(
"PyClical.clifford.__imul__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8538 __Pyx_XGIVEREF(__pyx_r);
8539 __Pyx_RefNannyFinishContext();
8552 static PyObject *__pyx_pw_8PyClical_8clifford_33__mod__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8553 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 ";
8554 #if CYTHON_COMPILING_IN_CPYTHON 8555 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_32__mod__;
8557 static PyObject *__pyx_pw_8PyClical_8clifford_33__mod__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8558 PyObject *__pyx_r = 0;
8559 __Pyx_RefNannyDeclarations
8560 __Pyx_RefNannySetupContext(
"__mod__ (wrapper)", 0);
8561 __pyx_r = __pyx_pf_8PyClical_8clifford_32__mod__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8564 __Pyx_RefNannyFinishContext();
8568 static PyObject *__pyx_pf_8PyClical_8clifford_32__mod__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8569 PyObject *__pyx_r = NULL;
8570 __Pyx_RefNannyDeclarations
8571 PyObject *__pyx_t_1 = NULL;
8572 PyObject *__pyx_t_2 = NULL;
8573 __Pyx_RefNannySetupContext(
"__mod__", 0);
8582 __Pyx_XDECREF(__pyx_r);
8583 __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)
8584 __Pyx_GOTREF(__pyx_t_1);
8585 __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)
8586 __Pyx_GOTREF(__pyx_t_2);
8587 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8588 __pyx_r = __pyx_t_2;
8602 __Pyx_XDECREF(__pyx_t_1);
8603 __Pyx_XDECREF(__pyx_t_2);
8604 __Pyx_AddTraceback(
"PyClical.clifford.__mod__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8607 __Pyx_XGIVEREF(__pyx_r);
8608 __Pyx_RefNannyFinishContext();
8621 static PyObject *__pyx_pw_8PyClical_8clifford_35__imod__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8622 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 ";
8623 #if CYTHON_COMPILING_IN_CPYTHON 8624 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_34__imod__;
8626 static PyObject *__pyx_pw_8PyClical_8clifford_35__imod__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8627 PyObject *__pyx_r = 0;
8628 __Pyx_RefNannyDeclarations
8629 __Pyx_RefNannySetupContext(
"__imod__ (wrapper)", 0);
8630 __pyx_r = __pyx_pf_8PyClical_8clifford_34__imod__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8633 __Pyx_RefNannyFinishContext();
8637 static PyObject *__pyx_pf_8PyClical_8clifford_34__imod__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8638 PyObject *__pyx_r = NULL;
8639 __Pyx_RefNannyDeclarations
8640 PyObject *__pyx_t_1 = NULL;
8641 __Pyx_RefNannySetupContext(
"__imod__", 0);
8650 __Pyx_XDECREF(__pyx_r);
8651 __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)
8652 __Pyx_GOTREF(__pyx_t_1);
8653 __pyx_r = __pyx_t_1;
8667 __Pyx_XDECREF(__pyx_t_1);
8668 __Pyx_AddTraceback(
"PyClical.clifford.__imod__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8671 __Pyx_XGIVEREF(__pyx_r);
8672 __Pyx_RefNannyFinishContext();
8685 static PyObject *__pyx_pw_8PyClical_8clifford_37__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8686 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 ";
8687 #if CYTHON_COMPILING_IN_CPYTHON 8688 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_36__and__;
8690 static PyObject *__pyx_pw_8PyClical_8clifford_37__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8691 PyObject *__pyx_r = 0;
8692 __Pyx_RefNannyDeclarations
8693 __Pyx_RefNannySetupContext(
"__and__ (wrapper)", 0);
8694 __pyx_r = __pyx_pf_8PyClical_8clifford_36__and__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8697 __Pyx_RefNannyFinishContext();
8701 static PyObject *__pyx_pf_8PyClical_8clifford_36__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8702 PyObject *__pyx_r = NULL;
8703 __Pyx_RefNannyDeclarations
8704 PyObject *__pyx_t_1 = NULL;
8705 PyObject *__pyx_t_2 = NULL;
8706 __Pyx_RefNannySetupContext(
"__and__", 0);
8715 __Pyx_XDECREF(__pyx_r);
8716 __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)
8717 __Pyx_GOTREF(__pyx_t_1);
8718 __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)
8719 __Pyx_GOTREF(__pyx_t_2);
8720 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8721 __pyx_r = __pyx_t_2;
8735 __Pyx_XDECREF(__pyx_t_1);
8736 __Pyx_XDECREF(__pyx_t_2);
8737 __Pyx_AddTraceback(
"PyClical.clifford.__and__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8740 __Pyx_XGIVEREF(__pyx_r);
8741 __Pyx_RefNannyFinishContext();
8754 static PyObject *__pyx_pw_8PyClical_8clifford_39__iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8755 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 ";
8756 #if CYTHON_COMPILING_IN_CPYTHON 8757 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_38__iand__;
8759 static PyObject *__pyx_pw_8PyClical_8clifford_39__iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8760 PyObject *__pyx_r = 0;
8761 __Pyx_RefNannyDeclarations
8762 __Pyx_RefNannySetupContext(
"__iand__ (wrapper)", 0);
8763 __pyx_r = __pyx_pf_8PyClical_8clifford_38__iand__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8766 __Pyx_RefNannyFinishContext();
8770 static PyObject *__pyx_pf_8PyClical_8clifford_38__iand__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8771 PyObject *__pyx_r = NULL;
8772 __Pyx_RefNannyDeclarations
8773 PyObject *__pyx_t_1 = NULL;
8774 __Pyx_RefNannySetupContext(
"__iand__", 0);
8783 __Pyx_XDECREF(__pyx_r);
8784 __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)
8785 __Pyx_GOTREF(__pyx_t_1);
8786 __pyx_r = __pyx_t_1;
8800 __Pyx_XDECREF(__pyx_t_1);
8801 __Pyx_AddTraceback(
"PyClical.clifford.__iand__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8804 __Pyx_XGIVEREF(__pyx_r);
8805 __Pyx_RefNannyFinishContext();
8818 static PyObject *__pyx_pw_8PyClical_8clifford_41__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8819 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 ";
8820 #if CYTHON_COMPILING_IN_CPYTHON 8821 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_40__xor__;
8823 static PyObject *__pyx_pw_8PyClical_8clifford_41__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8824 PyObject *__pyx_r = 0;
8825 __Pyx_RefNannyDeclarations
8826 __Pyx_RefNannySetupContext(
"__xor__ (wrapper)", 0);
8827 __pyx_r = __pyx_pf_8PyClical_8clifford_40__xor__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8830 __Pyx_RefNannyFinishContext();
8834 static PyObject *__pyx_pf_8PyClical_8clifford_40__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8835 PyObject *__pyx_r = NULL;
8836 __Pyx_RefNannyDeclarations
8837 PyObject *__pyx_t_1 = NULL;
8838 PyObject *__pyx_t_2 = NULL;
8839 __Pyx_RefNannySetupContext(
"__xor__", 0);
8848 __Pyx_XDECREF(__pyx_r);
8849 __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)
8850 __Pyx_GOTREF(__pyx_t_1);
8851 __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)
8852 __Pyx_GOTREF(__pyx_t_2);
8853 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8854 __pyx_r = __pyx_t_2;
8868 __Pyx_XDECREF(__pyx_t_1);
8869 __Pyx_XDECREF(__pyx_t_2);
8870 __Pyx_AddTraceback(
"PyClical.clifford.__xor__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8873 __Pyx_XGIVEREF(__pyx_r);
8874 __Pyx_RefNannyFinishContext();
8887 static PyObject *__pyx_pw_8PyClical_8clifford_43__ixor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8888 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 ";
8889 #if CYTHON_COMPILING_IN_CPYTHON 8890 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_42__ixor__;
8892 static PyObject *__pyx_pw_8PyClical_8clifford_43__ixor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8893 PyObject *__pyx_r = 0;
8894 __Pyx_RefNannyDeclarations
8895 __Pyx_RefNannySetupContext(
"__ixor__ (wrapper)", 0);
8896 __pyx_r = __pyx_pf_8PyClical_8clifford_42__ixor__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8899 __Pyx_RefNannyFinishContext();
8903 static PyObject *__pyx_pf_8PyClical_8clifford_42__ixor__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8904 PyObject *__pyx_r = NULL;
8905 __Pyx_RefNannyDeclarations
8906 PyObject *__pyx_t_1 = NULL;
8907 __Pyx_RefNannySetupContext(
"__ixor__", 0);
8916 __Pyx_XDECREF(__pyx_r);
8917 __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)
8918 __Pyx_GOTREF(__pyx_t_1);
8919 __pyx_r = __pyx_t_1;
8933 __Pyx_XDECREF(__pyx_t_1);
8934 __Pyx_AddTraceback(
"PyClical.clifford.__ixor__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8937 __Pyx_XGIVEREF(__pyx_r);
8938 __Pyx_RefNannyFinishContext();
8951 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 8952 static PyObject *__pyx_pw_8PyClical_8clifford_45__div__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8953 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 ";
8954 #if CYTHON_COMPILING_IN_CPYTHON 8955 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_44__div__;
8957 static PyObject *__pyx_pw_8PyClical_8clifford_45__div__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8958 PyObject *__pyx_r = 0;
8959 __Pyx_RefNannyDeclarations
8960 __Pyx_RefNannySetupContext(
"__div__ (wrapper)", 0);
8961 __pyx_r = __pyx_pf_8PyClical_8clifford_44__div__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8964 __Pyx_RefNannyFinishContext();
8969 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 8970 static PyObject *__pyx_pf_8PyClical_8clifford_44__div__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8971 PyObject *__pyx_r = NULL;
8972 __Pyx_RefNannyDeclarations
8973 PyObject *__pyx_t_1 = NULL;
8974 PyObject *__pyx_t_2 = NULL;
8975 __Pyx_RefNannySetupContext(
"__div__", 0);
8984 __Pyx_XDECREF(__pyx_r);
8985 __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)
8986 __Pyx_GOTREF(__pyx_t_1);
8987 __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)
8988 __Pyx_GOTREF(__pyx_t_2);
8989 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8990 __pyx_r = __pyx_t_2;
9004 __Pyx_XDECREF(__pyx_t_1);
9005 __Pyx_XDECREF(__pyx_t_2);
9006 __Pyx_AddTraceback(
"PyClical.clifford.__div__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9009 __Pyx_XGIVEREF(__pyx_r);
9010 __Pyx_RefNannyFinishContext();
9024 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 9025 static PyObject *__pyx_pw_8PyClical_8clifford_47__idiv__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
9026 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 ";
9027 #if CYTHON_COMPILING_IN_CPYTHON 9028 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_46__idiv__;
9030 static PyObject *__pyx_pw_8PyClical_8clifford_47__idiv__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
9031 PyObject *__pyx_r = 0;
9032 __Pyx_RefNannyDeclarations
9033 __Pyx_RefNannySetupContext(
"__idiv__ (wrapper)", 0);
9034 __pyx_r = __pyx_pf_8PyClical_8clifford_46__idiv__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
9037 __Pyx_RefNannyFinishContext();
9042 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 9043 static PyObject *__pyx_pf_8PyClical_8clifford_46__idiv__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
9044 PyObject *__pyx_r = NULL;
9045 __Pyx_RefNannyDeclarations
9046 PyObject *__pyx_t_1 = NULL;
9047 __Pyx_RefNannySetupContext(
"__idiv__", 0);
9056 __Pyx_XDECREF(__pyx_r);
9057 __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)
9058 __Pyx_GOTREF(__pyx_t_1);
9059 __pyx_r = __pyx_t_1;
9073 __Pyx_XDECREF(__pyx_t_1);
9074 __Pyx_AddTraceback(
"PyClical.clifford.__idiv__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9077 __Pyx_XGIVEREF(__pyx_r);
9078 __Pyx_RefNannyFinishContext();
9092 static PyObject *__pyx_pw_8PyClical_8clifford_49inv(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9093 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 ";
9094 static PyObject *__pyx_pw_8PyClical_8clifford_49inv(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9095 PyObject *__pyx_r = 0;
9096 __Pyx_RefNannyDeclarations
9097 __Pyx_RefNannySetupContext(
"inv (wrapper)", 0);
9098 __pyx_r = __pyx_pf_8PyClical_8clifford_48inv(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
9101 __Pyx_RefNannyFinishContext();
9105 static PyObject *__pyx_pf_8PyClical_8clifford_48inv(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
9106 PyObject *__pyx_r = NULL;
9107 __Pyx_RefNannyDeclarations
9108 PyObject *__pyx_t_1 = NULL;
9109 PyObject *__pyx_t_2 = NULL;
9110 __Pyx_RefNannySetupContext(
"inv", 0);
9119 __Pyx_XDECREF(__pyx_r);
9120 __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)
9121 __Pyx_GOTREF(__pyx_t_1);
9122 __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)
9123 __Pyx_GOTREF(__pyx_t_2);
9124 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9125 __pyx_r = __pyx_t_2;
9139 __Pyx_XDECREF(__pyx_t_1);
9140 __Pyx_XDECREF(__pyx_t_2);
9141 __Pyx_AddTraceback(
"PyClical.clifford.inv", __pyx_clineno, __pyx_lineno, __pyx_filename);
9144 __Pyx_XGIVEREF(__pyx_r);
9145 __Pyx_RefNannyFinishContext();
9158 static PyObject *__pyx_pw_8PyClical_8clifford_51__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
9159 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 ";
9160 #if CYTHON_COMPILING_IN_CPYTHON 9161 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_50__or__;
9163 static PyObject *__pyx_pw_8PyClical_8clifford_51__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
9164 PyObject *__pyx_r = 0;
9165 __Pyx_RefNannyDeclarations
9166 __Pyx_RefNannySetupContext(
"__or__ (wrapper)", 0);
9167 __pyx_r = __pyx_pf_8PyClical_8clifford_50__or__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
9170 __Pyx_RefNannyFinishContext();
9174 static PyObject *__pyx_pf_8PyClical_8clifford_50__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
9175 PyObject *__pyx_r = NULL;
9176 __Pyx_RefNannyDeclarations
9177 PyObject *__pyx_t_1 = NULL;
9178 PyObject *__pyx_t_2 = NULL;
9179 __Pyx_RefNannySetupContext(
"__or__", 0);
9188 __Pyx_XDECREF(__pyx_r);
9189 __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)
9190 __Pyx_GOTREF(__pyx_t_1);
9191 __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)
9192 __Pyx_GOTREF(__pyx_t_2);
9193 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9194 __pyx_r = __pyx_t_2;
9208 __Pyx_XDECREF(__pyx_t_1);
9209 __Pyx_XDECREF(__pyx_t_2);
9210 __Pyx_AddTraceback(
"PyClical.clifford.__or__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9213 __Pyx_XGIVEREF(__pyx_r);
9214 __Pyx_RefNannyFinishContext();
9227 static PyObject *__pyx_pw_8PyClical_8clifford_53__ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
9228 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 ";
9229 #if CYTHON_COMPILING_IN_CPYTHON 9230 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_52__ior__;
9232 static PyObject *__pyx_pw_8PyClical_8clifford_53__ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
9233 PyObject *__pyx_r = 0;
9234 __Pyx_RefNannyDeclarations
9235 __Pyx_RefNannySetupContext(
"__ior__ (wrapper)", 0);
9236 __pyx_r = __pyx_pf_8PyClical_8clifford_52__ior__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
9239 __Pyx_RefNannyFinishContext();
9243 static PyObject *__pyx_pf_8PyClical_8clifford_52__ior__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
9244 PyObject *__pyx_r = NULL;
9245 __Pyx_RefNannyDeclarations
9246 PyObject *__pyx_t_1 = NULL;
9247 __Pyx_RefNannySetupContext(
"__ior__", 0);
9256 __Pyx_XDECREF(__pyx_r);
9257 __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)
9258 __Pyx_GOTREF(__pyx_t_1);
9259 __pyx_r = __pyx_t_1;
9273 __Pyx_XDECREF(__pyx_t_1);
9274 __Pyx_AddTraceback(
"PyClical.clifford.__ior__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9277 __Pyx_XGIVEREF(__pyx_r);
9278 __Pyx_RefNannyFinishContext();
9291 static PyObject *__pyx_pw_8PyClical_8clifford_55__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_m, PyObject *__pyx_v_dummy);
9292 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 ";
9293 #if CYTHON_COMPILING_IN_CPYTHON 9294 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_54__pow__;
9296 static PyObject *__pyx_pw_8PyClical_8clifford_55__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_m, PyObject *__pyx_v_dummy) {
9297 PyObject *__pyx_r = 0;
9298 __Pyx_RefNannyDeclarations
9299 __Pyx_RefNannySetupContext(
"__pow__ (wrapper)", 0);
9300 __pyx_r = __pyx_pf_8PyClical_8clifford_54__pow__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_m), ((PyObject *)__pyx_v_dummy));
9303 __Pyx_RefNannyFinishContext();
9307 static PyObject *__pyx_pf_8PyClical_8clifford_54__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_m, CYTHON_UNUSED PyObject *__pyx_v_dummy) {
9308 PyObject *__pyx_r = NULL;
9309 __Pyx_RefNannyDeclarations
9310 PyObject *__pyx_t_1 = NULL;
9311 __Pyx_RefNannySetupContext(
"__pow__", 0);
9320 __Pyx_XDECREF(__pyx_r);
9321 __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)
9322 __Pyx_GOTREF(__pyx_t_1);
9323 __pyx_r = __pyx_t_1;
9337 __Pyx_XDECREF(__pyx_t_1);
9338 __Pyx_AddTraceback(
"PyClical.clifford.__pow__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9341 __Pyx_XGIVEREF(__pyx_r);
9342 __Pyx_RefNannyFinishContext();
9355 static PyObject *__pyx_pw_8PyClical_8clifford_57pow(PyObject *__pyx_v_self, PyObject *__pyx_v_m);
9356 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 ";
9357 static PyObject *__pyx_pw_8PyClical_8clifford_57pow(PyObject *__pyx_v_self, PyObject *__pyx_v_m) {
9358 PyObject *__pyx_r = 0;
9359 __Pyx_RefNannyDeclarations
9360 __Pyx_RefNannySetupContext(
"pow (wrapper)", 0);
9361 __pyx_r = __pyx_pf_8PyClical_8clifford_56pow(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_m));
9364 __Pyx_RefNannyFinishContext();
9368 static PyObject *__pyx_pf_8PyClical_8clifford_56pow(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_m) {
9369 PyObject *__pyx_r = NULL;
9370 __Pyx_RefNannyDeclarations
9371 PyObject *__pyx_t_1 = NULL;
9372 PyObject *__pyx_t_2 = NULL;
9376 __Pyx_RefNannySetupContext(
"pow", 0);
9385 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numbers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __pyx_L1_error)
9386 __Pyx_GOTREF(__pyx_t_1);
9387 __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)
9388 __Pyx_GOTREF(__pyx_t_2);
9389 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9390 __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)
9391 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9392 __pyx_t_4 = (__pyx_t_3 != 0);
9402 __Pyx_XDECREF(__pyx_r);
9403 __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)
9404 __Pyx_GOTREF(__pyx_t_2);
9405 __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)
9406 __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)
9407 __Pyx_GOTREF(__pyx_t_1);
9408 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9409 __pyx_r = __pyx_t_1;
9430 __Pyx_XDECREF(__pyx_r);
9431 __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)
9432 __Pyx_GOTREF(__pyx_t_1);
9433 __pyx_t_2 = PyNumber_Multiply(__pyx_v_m, __pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1001, __pyx_L1_error)
9434 __Pyx_GOTREF(__pyx_t_2);
9435 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9436 __pyx_t_1 = __pyx_f_8PyClical_exp(__pyx_t_2, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1001, __pyx_L1_error)
9437 __Pyx_GOTREF(__pyx_t_1);
9438 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9439 __pyx_r = __pyx_t_1;
9454 __Pyx_XDECREF(__pyx_t_1);
9455 __Pyx_XDECREF(__pyx_t_2);
9456 __Pyx_AddTraceback(
"PyClical.clifford.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
9459 __Pyx_XGIVEREF(__pyx_r);
9460 __Pyx_RefNannyFinishContext();
9473 static PyObject *__pyx_pw_8PyClical_8clifford_59outer_pow(PyObject *__pyx_v_self, PyObject *__pyx_v_m);
9474 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 ";
9475 static PyObject *__pyx_pw_8PyClical_8clifford_59outer_pow(PyObject *__pyx_v_self, PyObject *__pyx_v_m) {
9476 PyObject *__pyx_r = 0;
9477 __Pyx_RefNannyDeclarations
9478 __Pyx_RefNannySetupContext(
"outer_pow (wrapper)", 0);
9479 __pyx_r = __pyx_pf_8PyClical_8clifford_58outer_pow(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_m));
9482 __Pyx_RefNannyFinishContext();
9486 static PyObject *__pyx_pf_8PyClical_8clifford_58outer_pow(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_m) {
9487 PyObject *__pyx_r = NULL;
9488 __Pyx_RefNannyDeclarations
9489 PyObject *__pyx_t_1 = NULL;
9491 PyObject *__pyx_t_3 = NULL;
9492 __Pyx_RefNannySetupContext(
"outer_pow", 0);
9501 __Pyx_XDECREF(__pyx_r);
9502 __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)
9503 __Pyx_GOTREF(__pyx_t_1);
9504 __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)
9505 __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)
9506 __Pyx_GOTREF(__pyx_t_3);
9507 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9508 __pyx_r = __pyx_t_3;
9522 __Pyx_XDECREF(__pyx_t_1);
9523 __Pyx_XDECREF(__pyx_t_3);
9524 __Pyx_AddTraceback(
"PyClical.clifford.outer_pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
9527 __Pyx_XGIVEREF(__pyx_r);
9528 __Pyx_RefNannyFinishContext();
9541 static PyObject *__pyx_pw_8PyClical_8clifford_61__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
9542 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 ";
9543 #if CYTHON_COMPILING_IN_CPYTHON 9544 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_60__call__;
9546 static PyObject *__pyx_pw_8PyClical_8clifford_61__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9547 PyObject *__pyx_v_grade = 0;
9548 PyObject *__pyx_r = 0;
9549 __Pyx_RefNannyDeclarations
9550 __Pyx_RefNannySetupContext(
"__call__ (wrapper)", 0);
9552 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_grade,0};
9553 PyObject* values[1] = {0};
9554 if (unlikely(__pyx_kwds)) {
9556 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9558 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9561 default:
goto __pyx_L5_argtuple_error;
9563 kw_args = PyDict_Size(__pyx_kwds);
9566 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_grade)) != 0)) kw_args--;
9567 else goto __pyx_L5_argtuple_error;
9569 if (unlikely(kw_args > 0)) {
9570 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__call__") < 0)) __PYX_ERR(0, 1019, __pyx_L3_error)
9572 }
else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
9573 goto __pyx_L5_argtuple_error;
9575 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9577 __pyx_v_grade = values[0];
9579 goto __pyx_L4_argument_unpacking_done;
9580 __pyx_L5_argtuple_error:;
9581 __Pyx_RaiseArgtupleInvalid(
"__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1019, __pyx_L3_error)
9583 __Pyx_AddTraceback(
"PyClical.clifford.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9584 __Pyx_RefNannyFinishContext();
9586 __pyx_L4_argument_unpacking_done:;
9587 __pyx_r = __pyx_pf_8PyClical_8clifford_60__call__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), __pyx_v_grade);
9590 __Pyx_RefNannyFinishContext();
9594 static PyObject *__pyx_pf_8PyClical_8clifford_60__call__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_grade) {
9595 PyObject *__pyx_r = NULL;
9596 __Pyx_RefNannyDeclarations
9597 PyObject *__pyx_t_1 = NULL;
9599 PyObject *__pyx_t_3 = NULL;
9600 __Pyx_RefNannySetupContext(
"__call__", 0);
9609 __Pyx_XDECREF(__pyx_r);
9610 __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)
9611 __Pyx_GOTREF(__pyx_t_1);
9612 __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)
9613 __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)
9614 __Pyx_GOTREF(__pyx_t_3);
9615 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9616 __pyx_r = __pyx_t_3;
9630 __Pyx_XDECREF(__pyx_t_1);
9631 __Pyx_XDECREF(__pyx_t_3);
9632 __Pyx_AddTraceback(
"PyClical.clifford.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9635 __Pyx_XGIVEREF(__pyx_r);
9636 __Pyx_RefNannyFinishContext();
9649 static PyObject *__pyx_pw_8PyClical_8clifford_63scalar(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9650 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 ";
9651 static PyObject *__pyx_pw_8PyClical_8clifford_63scalar(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9652 PyObject *__pyx_r = 0;
9653 __Pyx_RefNannyDeclarations
9654 __Pyx_RefNannySetupContext(
"scalar (wrapper)", 0);
9655 __pyx_r = __pyx_pf_8PyClical_8clifford_62scalar(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
9658 __Pyx_RefNannyFinishContext();
9662 static PyObject *__pyx_pf_8PyClical_8clifford_62scalar(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
9663 PyObject *__pyx_r = NULL;
9664 __Pyx_RefNannyDeclarations
9665 PyObject *__pyx_t_1 = NULL;
9666 __Pyx_RefNannySetupContext(
"scalar", 0);
9675 __Pyx_XDECREF(__pyx_r);
9676 __pyx_t_1 =
PyFloat_FromDouble(__pyx_v_self->instance->scalar());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1047, __pyx_L1_error)
9677 __Pyx_GOTREF(__pyx_t_1);
9678 __pyx_r = __pyx_t_1;
9692 __Pyx_XDECREF(__pyx_t_1);
9693 __Pyx_AddTraceback(
"PyClical.clifford.scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
9696 __Pyx_XGIVEREF(__pyx_r);
9697 __Pyx_RefNannyFinishContext();
9710 static PyObject *__pyx_pw_8PyClical_8clifford_65pure(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9711 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 ";
9712 static PyObject *__pyx_pw_8PyClical_8clifford_65pure(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9713 PyObject *__pyx_r = 0;
9714 __Pyx_RefNannyDeclarations
9715 __Pyx_RefNannySetupContext(
"pure (wrapper)", 0);
9716 __pyx_r = __pyx_pf_8PyClical_8clifford_64pure(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
9719 __Pyx_RefNannyFinishContext();
9723 static PyObject *__pyx_pf_8PyClical_8clifford_64pure(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
9724 PyObject *__pyx_r = NULL;
9725 __Pyx_RefNannyDeclarations
9726 PyObject *__pyx_t_1 = NULL;
9727 PyObject *__pyx_t_2 = NULL;
9728 __Pyx_RefNannySetupContext(
"pure", 0);
9737 __Pyx_XDECREF(__pyx_r);
9738 __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)
9739 __Pyx_GOTREF(__pyx_t_1);
9740 __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)
9741 __Pyx_GOTREF(__pyx_t_2);
9742 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9743 __pyx_r = __pyx_t_2;
9757 __Pyx_XDECREF(__pyx_t_1);
9758 __Pyx_XDECREF(__pyx_t_2);
9759 __Pyx_AddTraceback(
"PyClical.clifford.pure", __pyx_clineno, __pyx_lineno, __pyx_filename);
9762 __Pyx_XGIVEREF(__pyx_r);
9763 __Pyx_RefNannyFinishContext();
9776 static PyObject *__pyx_pw_8PyClical_8clifford_67even(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9777 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 ";
9778 static PyObject *__pyx_pw_8PyClical_8clifford_67even(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9779 PyObject *__pyx_r = 0;
9780 __Pyx_RefNannyDeclarations
9781 __Pyx_RefNannySetupContext(
"even (wrapper)", 0);
9782 __pyx_r = __pyx_pf_8PyClical_8clifford_66even(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
9785 __Pyx_RefNannyFinishContext();
9789 static PyObject *__pyx_pf_8PyClical_8clifford_66even(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
9790 PyObject *__pyx_r = NULL;
9791 __Pyx_RefNannyDeclarations
9792 PyObject *__pyx_t_1 = NULL;
9793 PyObject *__pyx_t_2 = NULL;
9794 __Pyx_RefNannySetupContext(
"even", 0);
9803 __Pyx_XDECREF(__pyx_r);
9804 __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)
9805 __Pyx_GOTREF(__pyx_t_1);
9806 __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)
9807 __Pyx_GOTREF(__pyx_t_2);
9808 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9809 __pyx_r = __pyx_t_2;
9823 __Pyx_XDECREF(__pyx_t_1);
9824 __Pyx_XDECREF(__pyx_t_2);
9825 __Pyx_AddTraceback(
"PyClical.clifford.even", __pyx_clineno, __pyx_lineno, __pyx_filename);
9828 __Pyx_XGIVEREF(__pyx_r);
9829 __Pyx_RefNannyFinishContext();
9842 static PyObject *__pyx_pw_8PyClical_8clifford_69odd(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9843 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 ";
9844 static PyObject *__pyx_pw_8PyClical_8clifford_69odd(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9845 PyObject *__pyx_r = 0;
9846 __Pyx_RefNannyDeclarations
9847 __Pyx_RefNannySetupContext(
"odd (wrapper)", 0);
9848 __pyx_r = __pyx_pf_8PyClical_8clifford_68odd(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
9851 __Pyx_RefNannyFinishContext();
9855 static PyObject *__pyx_pf_8PyClical_8clifford_68odd(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
9856 PyObject *__pyx_r = NULL;
9857 __Pyx_RefNannyDeclarations
9858 PyObject *__pyx_t_1 = NULL;
9859 PyObject *__pyx_t_2 = NULL;
9860 __Pyx_RefNannySetupContext(
"odd", 0);
9869 __Pyx_XDECREF(__pyx_r);
9870 __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)
9871 __Pyx_GOTREF(__pyx_t_1);
9872 __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)
9873 __Pyx_GOTREF(__pyx_t_2);
9874 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9875 __pyx_r = __pyx_t_2;
9889 __Pyx_XDECREF(__pyx_t_1);
9890 __Pyx_XDECREF(__pyx_t_2);
9891 __Pyx_AddTraceback(
"PyClical.clifford.odd", __pyx_clineno, __pyx_lineno, __pyx_filename);
9894 __Pyx_XGIVEREF(__pyx_r);
9895 __Pyx_RefNannyFinishContext();
9908 static PyObject *__pyx_pw_8PyClical_8clifford_71vector_part(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
9909 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 ";
9910 static PyObject *__pyx_pw_8PyClical_8clifford_71vector_part(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9911 PyObject *__pyx_v_frm = 0;
9912 PyObject *__pyx_r = 0;
9913 __Pyx_RefNannyDeclarations
9914 __Pyx_RefNannySetupContext(
"vector_part (wrapper)", 0);
9916 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frm,0};
9917 PyObject* values[1] = {0};
9918 values[0] = ((PyObject *)Py_None);
9919 if (unlikely(__pyx_kwds)) {
9921 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9923 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9926 default:
goto __pyx_L5_argtuple_error;
9928 kw_args = PyDict_Size(__pyx_kwds);
9932 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_frm);
9933 if (value) { values[0] = value; kw_args--; }
9936 if (unlikely(kw_args > 0)) {
9937 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"vector_part") < 0)) __PYX_ERR(0, 1078, __pyx_L3_error)
9940 switch (PyTuple_GET_SIZE(__pyx_args)) {
9941 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9944 default:
goto __pyx_L5_argtuple_error;
9947 __pyx_v_frm = values[0];
9949 goto __pyx_L4_argument_unpacking_done;
9950 __pyx_L5_argtuple_error:;
9951 __Pyx_RaiseArgtupleInvalid(
"vector_part", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1078, __pyx_L3_error)
9953 __Pyx_AddTraceback(
"PyClical.clifford.vector_part", __pyx_clineno, __pyx_lineno, __pyx_filename);
9954 __Pyx_RefNannyFinishContext();
9956 __pyx_L4_argument_unpacking_done:;
9957 __pyx_r = __pyx_pf_8PyClical_8clifford_70vector_part(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), __pyx_v_frm);
9960 __Pyx_RefNannyFinishContext();
9964 static PyObject *__pyx_pf_8PyClical_8clifford_70vector_part(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_frm) {
9965 PyObject *__pyx_v_error_msg_prefix = NULL;
9966 std::vector<scalar_t> __pyx_v_vec;
9969 PyObject *__pyx_v_lst = NULL;
9970 PyObject *__pyx_v_err = NULL;
9971 PyObject *__pyx_r = NULL;
9972 __Pyx_RefNannyDeclarations
9973 PyObject *__pyx_t_1 = NULL;
9974 PyObject *__pyx_t_2 = NULL;
9975 PyObject *__pyx_t_3 = NULL;
9978 std::vector<scalar_t> __pyx_t_6;
9979 PyObject *__pyx_t_7 = NULL;
9982 PyObject *__pyx_t_10 = NULL;
9983 PyObject *__pyx_t_11 = NULL;
9984 PyObject *__pyx_t_12 = NULL;
9985 PyObject *__pyx_t_13 = NULL;
9986 PyObject *__pyx_t_14 = NULL;
9987 __Pyx_RefNannySetupContext(
"vector_part", 0);
9996 __Pyx_INCREF(__pyx_kp_s_Cannot_take_vector_part_of);
9997 __pyx_v_error_msg_prefix = __pyx_kp_s_Cannot_take_vector_part_of;
10007 __Pyx_PyThreadState_declare
10008 __Pyx_PyThreadState_assign
10009 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
10010 __Pyx_XGOTREF(__pyx_t_1);
10011 __Pyx_XGOTREF(__pyx_t_2);
10012 __Pyx_XGOTREF(__pyx_t_3);
10022 __pyx_t_4 = (__pyx_v_frm == Py_None);
10023 __pyx_t_5 = (__pyx_t_4 != 0);
10033 __pyx_t_6 = __pyx_v_self->instance->vector_part();
10034 __pyx_v_vec = __pyx_t_6;
10055 __pyx_t_6 = __pyx_v_self->instance->vector_part(__pyx_f_8PyClical_9index_set_unwrap(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_frm)));
10057 __Pyx_CppExn2PyErr();
10058 __PYX_ERR(0, 1095, __pyx_L3_error)
10060 __pyx_v_vec = __pyx_t_6;
10071 __pyx_v_n = __pyx_v_vec.size();
10080 __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)
10081 __Pyx_GOTREF(__pyx_t_7);
10082 { Py_ssize_t __pyx_temp;
10083 for (__pyx_temp=0; __pyx_temp < __pyx_v_n; __pyx_temp++) {
10084 __Pyx_INCREF(__pyx_float_0_0);
10085 __Pyx_GIVEREF(__pyx_float_0_0);
10086 PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_float_0_0);
10089 __pyx_v_lst = ((PyObject*)__pyx_t_7);
10099 __pyx_t_8 = __pyx_v_n;
10100 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
10101 __pyx_v_i = __pyx_t_9;
10110 __pyx_t_7 =
PyFloat_FromDouble((__pyx_v_vec[__pyx_v_i]));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1099, __pyx_L3_error)
10111 __Pyx_GOTREF(__pyx_t_7);
10112 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)
10113 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10123 __Pyx_XDECREF(__pyx_r);
10124 __Pyx_INCREF(__pyx_v_lst);
10125 __pyx_r = __pyx_v_lst;
10126 goto __pyx_L7_try_return;
10137 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10146 __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
10148 __Pyx_AddTraceback(
"PyClical.clifford.vector_part", __pyx_clineno, __pyx_lineno, __pyx_filename);
10149 if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_10, &__pyx_t_11) < 0) __PYX_ERR(0, 1101, __pyx_L5_except_error)
10150 __Pyx_GOTREF(__pyx_t_7);
10151 __Pyx_GOTREF(__pyx_t_10);
10152 __Pyx_GOTREF(__pyx_t_11);
10153 __Pyx_INCREF(__pyx_t_10);
10154 __pyx_v_err = __pyx_t_10;
10163 __pyx_t_12 = PyTuple_New(1);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1102, __pyx_L5_except_error)
10164 __Pyx_GOTREF(__pyx_t_12);
10165 __Pyx_INCREF(((PyObject *)__pyx_v_self));
10166 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
10167 PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)__pyx_v_self));
10168 __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)
10169 __Pyx_GOTREF(__pyx_t_13);
10170 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
10171 __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)
10172 __Pyx_GOTREF(__pyx_t_12);
10173 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
10174 __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)
10175 __Pyx_GOTREF(__pyx_t_13);
10176 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
10185 __pyx_t_12 = PyObject_Repr(__pyx_v_frm);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1103, __pyx_L5_except_error)
10186 __Pyx_GOTREF(__pyx_t_12);
10187 __pyx_t_14 = PyNumber_Add(__pyx_t_13, __pyx_t_12);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1103, __pyx_L5_except_error)
10188 __Pyx_GOTREF(__pyx_t_14);
10189 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
10190 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
10191 __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)
10192 __Pyx_GOTREF(__pyx_t_12);
10193 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
10202 __pyx_t_14 = PyTuple_New(1);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1104, __pyx_L5_except_error)
10203 __Pyx_GOTREF(__pyx_t_14);
10204 __Pyx_INCREF(__pyx_v_err);
10205 __Pyx_GIVEREF(__pyx_v_err);
10206 PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_err);
10207 __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)
10208 __Pyx_GOTREF(__pyx_t_13);
10209 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
10210 __pyx_t_14 = PyNumber_Add(__pyx_t_12, __pyx_t_13);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1104, __pyx_L5_except_error)
10211 __Pyx_GOTREF(__pyx_t_14);
10212 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
10213 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
10222 __pyx_t_13 = PyTuple_New(1);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1102, __pyx_L5_except_error)
10223 __Pyx_GOTREF(__pyx_t_13);
10224 __Pyx_GIVEREF(__pyx_t_14);
10225 PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_14);
10227 __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)
10228 __Pyx_GOTREF(__pyx_t_14);
10229 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
10230 __Pyx_Raise(__pyx_t_14, 0, 0, 0);
10231 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
10232 __PYX_ERR(0, 1102, __pyx_L5_except_error)
10234 goto __pyx_L5_except_error;
10235 __pyx_L5_except_error:;
10244 __Pyx_XGIVEREF(__pyx_t_1);
10245 __Pyx_XGIVEREF(__pyx_t_2);
10246 __Pyx_XGIVEREF(__pyx_t_3);
10247 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
10248 goto __pyx_L1_error;
10249 __pyx_L7_try_return:;
10250 __Pyx_XGIVEREF(__pyx_t_1);
10251 __Pyx_XGIVEREF(__pyx_t_2);
10252 __Pyx_XGIVEREF(__pyx_t_3);
10253 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
10267 __Pyx_XDECREF(__pyx_t_7);
10268 __Pyx_XDECREF(__pyx_t_10);
10269 __Pyx_XDECREF(__pyx_t_11);
10270 __Pyx_XDECREF(__pyx_t_12);
10271 __Pyx_XDECREF(__pyx_t_13);
10272 __Pyx_XDECREF(__pyx_t_14);
10273 __Pyx_AddTraceback(
"PyClical.clifford.vector_part", __pyx_clineno, __pyx_lineno, __pyx_filename);
10276 __Pyx_XDECREF(__pyx_v_error_msg_prefix);
10277 __Pyx_XDECREF(__pyx_v_lst);
10278 __Pyx_XDECREF(__pyx_v_err);
10279 __Pyx_XGIVEREF(__pyx_r);
10280 __Pyx_RefNannyFinishContext();
10293 static PyObject *__pyx_pw_8PyClical_8clifford_73involute(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10294 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 ";
10295 static PyObject *__pyx_pw_8PyClical_8clifford_73involute(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10296 PyObject *__pyx_r = 0;
10297 __Pyx_RefNannyDeclarations
10298 __Pyx_RefNannySetupContext(
"involute (wrapper)", 0);
10299 __pyx_r = __pyx_pf_8PyClical_8clifford_72involute(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10302 __Pyx_RefNannyFinishContext();
10306 static PyObject *__pyx_pf_8PyClical_8clifford_72involute(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10307 PyObject *__pyx_r = NULL;
10308 __Pyx_RefNannyDeclarations
10309 PyObject *__pyx_t_1 = NULL;
10310 PyObject *__pyx_t_2 = NULL;
10311 __Pyx_RefNannySetupContext(
"involute", 0);
10320 __Pyx_XDECREF(__pyx_r);
10321 __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)
10322 __Pyx_GOTREF(__pyx_t_1);
10323 __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)
10324 __Pyx_GOTREF(__pyx_t_2);
10325 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10326 __pyx_r = __pyx_t_2;
10340 __Pyx_XDECREF(__pyx_t_1);
10341 __Pyx_XDECREF(__pyx_t_2);
10342 __Pyx_AddTraceback(
"PyClical.clifford.involute", __pyx_clineno, __pyx_lineno, __pyx_filename);
10345 __Pyx_XGIVEREF(__pyx_r);
10346 __Pyx_RefNannyFinishContext();
10359 static PyObject *__pyx_pw_8PyClical_8clifford_75reverse(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10360 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 ";
10361 static PyObject *__pyx_pw_8PyClical_8clifford_75reverse(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10362 PyObject *__pyx_r = 0;
10363 __Pyx_RefNannyDeclarations
10364 __Pyx_RefNannySetupContext(
"reverse (wrapper)", 0);
10365 __pyx_r = __pyx_pf_8PyClical_8clifford_74reverse(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10368 __Pyx_RefNannyFinishContext();
10372 static PyObject *__pyx_pf_8PyClical_8clifford_74reverse(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10373 PyObject *__pyx_r = NULL;
10374 __Pyx_RefNannyDeclarations
10375 PyObject *__pyx_t_1 = NULL;
10376 PyObject *__pyx_t_2 = NULL;
10377 __Pyx_RefNannySetupContext(
"reverse", 0);
10386 __Pyx_XDECREF(__pyx_r);
10387 __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)
10388 __Pyx_GOTREF(__pyx_t_1);
10389 __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)
10390 __Pyx_GOTREF(__pyx_t_2);
10391 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10392 __pyx_r = __pyx_t_2;
10406 __Pyx_XDECREF(__pyx_t_1);
10407 __Pyx_XDECREF(__pyx_t_2);
10408 __Pyx_AddTraceback(
"PyClical.clifford.reverse", __pyx_clineno, __pyx_lineno, __pyx_filename);
10411 __Pyx_XGIVEREF(__pyx_r);
10412 __Pyx_RefNannyFinishContext();
10425 static PyObject *__pyx_pw_8PyClical_8clifford_77conj(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10426 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 ";
10427 static PyObject *__pyx_pw_8PyClical_8clifford_77conj(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10428 PyObject *__pyx_r = 0;
10429 __Pyx_RefNannyDeclarations
10430 __Pyx_RefNannySetupContext(
"conj (wrapper)", 0);
10431 __pyx_r = __pyx_pf_8PyClical_8clifford_76conj(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10434 __Pyx_RefNannyFinishContext();
10438 static PyObject *__pyx_pf_8PyClical_8clifford_76conj(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10439 PyObject *__pyx_r = NULL;
10440 __Pyx_RefNannyDeclarations
10441 PyObject *__pyx_t_1 = NULL;
10442 PyObject *__pyx_t_2 = NULL;
10443 __Pyx_RefNannySetupContext(
"conj", 0);
10452 __Pyx_XDECREF(__pyx_r);
10453 __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)
10454 __Pyx_GOTREF(__pyx_t_1);
10455 __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)
10456 __Pyx_GOTREF(__pyx_t_2);
10457 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10458 __pyx_r = __pyx_t_2;
10472 __Pyx_XDECREF(__pyx_t_1);
10473 __Pyx_XDECREF(__pyx_t_2);
10474 __Pyx_AddTraceback(
"PyClical.clifford.conj", __pyx_clineno, __pyx_lineno, __pyx_filename);
10477 __Pyx_XGIVEREF(__pyx_r);
10478 __Pyx_RefNannyFinishContext();
10491 static PyObject *__pyx_pw_8PyClical_8clifford_79quad(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10492 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 ";
10493 static PyObject *__pyx_pw_8PyClical_8clifford_79quad(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10494 PyObject *__pyx_r = 0;
10495 __Pyx_RefNannyDeclarations
10496 __Pyx_RefNannySetupContext(
"quad (wrapper)", 0);
10497 __pyx_r = __pyx_pf_8PyClical_8clifford_78quad(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10500 __Pyx_RefNannyFinishContext();
10504 static PyObject *__pyx_pf_8PyClical_8clifford_78quad(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10505 PyObject *__pyx_r = NULL;
10506 __Pyx_RefNannyDeclarations
10507 PyObject *__pyx_t_1 = NULL;
10508 __Pyx_RefNannySetupContext(
"quad", 0);
10517 __Pyx_XDECREF(__pyx_r);
10518 __pyx_t_1 =
PyFloat_FromDouble(__pyx_v_self->instance->quad());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1161, __pyx_L1_error)
10519 __Pyx_GOTREF(__pyx_t_1);
10520 __pyx_r = __pyx_t_1;
10534 __Pyx_XDECREF(__pyx_t_1);
10535 __Pyx_AddTraceback(
"PyClical.clifford.quad", __pyx_clineno, __pyx_lineno, __pyx_filename);
10538 __Pyx_XGIVEREF(__pyx_r);
10539 __Pyx_RefNannyFinishContext();
10552 static PyObject *__pyx_pw_8PyClical_8clifford_81norm(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10553 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 ";
10554 static PyObject *__pyx_pw_8PyClical_8clifford_81norm(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10555 PyObject *__pyx_r = 0;
10556 __Pyx_RefNannyDeclarations
10557 __Pyx_RefNannySetupContext(
"norm (wrapper)", 0);
10558 __pyx_r = __pyx_pf_8PyClical_8clifford_80norm(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10561 __Pyx_RefNannyFinishContext();
10565 static PyObject *__pyx_pf_8PyClical_8clifford_80norm(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10566 PyObject *__pyx_r = NULL;
10567 __Pyx_RefNannyDeclarations
10568 PyObject *__pyx_t_1 = NULL;
10569 __Pyx_RefNannySetupContext(
"norm", 0);
10578 __Pyx_XDECREF(__pyx_r);
10579 __pyx_t_1 =
PyFloat_FromDouble(__pyx_v_self->instance->norm());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1172, __pyx_L1_error)
10580 __Pyx_GOTREF(__pyx_t_1);
10581 __pyx_r = __pyx_t_1;
10595 __Pyx_XDECREF(__pyx_t_1);
10596 __Pyx_AddTraceback(
"PyClical.clifford.norm", __pyx_clineno, __pyx_lineno, __pyx_filename);
10599 __Pyx_XGIVEREF(__pyx_r);
10600 __Pyx_RefNannyFinishContext();
10613 static PyObject *__pyx_pw_8PyClical_8clifford_83abs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10614 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 ";
10615 static PyObject *__pyx_pw_8PyClical_8clifford_83abs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10616 PyObject *__pyx_r = 0;
10617 __Pyx_RefNannyDeclarations
10618 __Pyx_RefNannySetupContext(
"abs (wrapper)", 0);
10619 __pyx_r = __pyx_pf_8PyClical_8clifford_82abs(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10622 __Pyx_RefNannyFinishContext();
10626 static PyObject *__pyx_pf_8PyClical_8clifford_82abs(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10627 PyObject *__pyx_r = NULL;
10628 __Pyx_RefNannyDeclarations
10629 PyObject *__pyx_t_1 = NULL;
10630 __Pyx_RefNannySetupContext(
"abs", 0);
10639 __Pyx_XDECREF(__pyx_r);
10640 __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)
10641 __Pyx_GOTREF(__pyx_t_1);
10642 __pyx_r = __pyx_t_1;
10656 __Pyx_XDECREF(__pyx_t_1);
10657 __Pyx_AddTraceback(
"PyClical.clifford.abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
10660 __Pyx_XGIVEREF(__pyx_r);
10661 __Pyx_RefNannyFinishContext();
10674 static PyObject *__pyx_pw_8PyClical_8clifford_85max_abs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10675 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 ";
10676 static PyObject *__pyx_pw_8PyClical_8clifford_85max_abs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10677 PyObject *__pyx_r = 0;
10678 __Pyx_RefNannyDeclarations
10679 __Pyx_RefNannySetupContext(
"max_abs (wrapper)", 0);
10680 __pyx_r = __pyx_pf_8PyClical_8clifford_84max_abs(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10683 __Pyx_RefNannyFinishContext();
10687 static PyObject *__pyx_pf_8PyClical_8clifford_84max_abs(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10688 PyObject *__pyx_r = NULL;
10689 __Pyx_RefNannyDeclarations
10690 PyObject *__pyx_t_1 = NULL;
10691 __Pyx_RefNannySetupContext(
"max_abs", 0);
10700 __Pyx_XDECREF(__pyx_r);
10701 __pyx_t_1 =
PyFloat_FromDouble(__pyx_v_self->instance->max_abs());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1192, __pyx_L1_error)
10702 __Pyx_GOTREF(__pyx_t_1);
10703 __pyx_r = __pyx_t_1;
10717 __Pyx_XDECREF(__pyx_t_1);
10718 __Pyx_AddTraceback(
"PyClical.clifford.max_abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
10721 __Pyx_XGIVEREF(__pyx_r);
10722 __Pyx_RefNannyFinishContext();
10735 static PyObject *__pyx_pw_8PyClical_8clifford_87truncated(PyObject *__pyx_v_self, PyObject *__pyx_v_limit);
10736 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 ";
10737 static PyObject *__pyx_pw_8PyClical_8clifford_87truncated(PyObject *__pyx_v_self, PyObject *__pyx_v_limit) {
10738 PyObject *__pyx_r = 0;
10739 __Pyx_RefNannyDeclarations
10740 __Pyx_RefNannySetupContext(
"truncated (wrapper)", 0);
10741 __pyx_r = __pyx_pf_8PyClical_8clifford_86truncated(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_limit));
10744 __Pyx_RefNannyFinishContext();
10748 static PyObject *__pyx_pf_8PyClical_8clifford_86truncated(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_limit) {
10749 PyObject *__pyx_r = NULL;
10750 __Pyx_RefNannyDeclarations
10751 PyObject *__pyx_t_1 = NULL;
10753 PyObject *__pyx_t_3 = NULL;
10754 __Pyx_RefNannySetupContext(
"truncated", 0);
10763 __Pyx_XDECREF(__pyx_r);
10764 __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)
10765 __Pyx_GOTREF(__pyx_t_1);
10766 __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)
10767 __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)
10768 __Pyx_GOTREF(__pyx_t_3);
10769 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10770 __pyx_r = __pyx_t_3;
10784 __Pyx_XDECREF(__pyx_t_1);
10785 __Pyx_XDECREF(__pyx_t_3);
10786 __Pyx_AddTraceback(
"PyClical.clifford.truncated", __pyx_clineno, __pyx_lineno, __pyx_filename);
10789 __Pyx_XGIVEREF(__pyx_r);
10790 __Pyx_RefNannyFinishContext();
10803 static PyObject *__pyx_pw_8PyClical_8clifford_89isnan(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10804 static char __pyx_doc_8PyClical_8clifford_88isnan[] =
"\n Check if a multivector contains any IEEE NaN values.\n\n >>> clifford().isnan()\n False\n ";
10805 static PyObject *__pyx_pw_8PyClical_8clifford_89isnan(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10806 PyObject *__pyx_r = 0;
10807 __Pyx_RefNannyDeclarations
10808 __Pyx_RefNannySetupContext(
"isnan (wrapper)", 0);
10809 __pyx_r = __pyx_pf_8PyClical_8clifford_88isnan(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10812 __Pyx_RefNannyFinishContext();
10816 static PyObject *__pyx_pf_8PyClical_8clifford_88isnan(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10817 PyObject *__pyx_r = NULL;
10818 __Pyx_RefNannyDeclarations
10819 PyObject *__pyx_t_1 = NULL;
10820 __Pyx_RefNannySetupContext(
"isnan", 0);
10829 __Pyx_XDECREF(__pyx_r);
10830 __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->instance->isnan());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1212, __pyx_L1_error)
10831 __Pyx_GOTREF(__pyx_t_1);
10832 __pyx_r = __pyx_t_1;
10846 __Pyx_XDECREF(__pyx_t_1);
10847 __Pyx_AddTraceback(
"PyClical.clifford.isnan", __pyx_clineno, __pyx_lineno, __pyx_filename);
10850 __Pyx_XGIVEREF(__pyx_r);
10851 __Pyx_RefNannyFinishContext();
10864 static PyObject *__pyx_pw_8PyClical_8clifford_91frame(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10865 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 ";
10866 static PyObject *__pyx_pw_8PyClical_8clifford_91frame(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10867 PyObject *__pyx_r = 0;
10868 __Pyx_RefNannyDeclarations
10869 __Pyx_RefNannySetupContext(
"frame (wrapper)", 0);
10870 __pyx_r = __pyx_pf_8PyClical_8clifford_90frame(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10873 __Pyx_RefNannyFinishContext();
10877 static PyObject *__pyx_pf_8PyClical_8clifford_90frame(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10878 PyObject *__pyx_r = NULL;
10879 __Pyx_RefNannyDeclarations
10880 PyObject *__pyx_t_1 = NULL;
10881 PyObject *__pyx_t_2 = NULL;
10882 __Pyx_RefNannySetupContext(
"frame", 0);
10891 __Pyx_XDECREF(__pyx_r);
10892 __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)
10893 __Pyx_GOTREF(__pyx_t_1);
10894 __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)
10895 __Pyx_GOTREF(__pyx_t_2);
10896 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10897 __pyx_r = __pyx_t_2;
10911 __Pyx_XDECREF(__pyx_t_1);
10912 __Pyx_XDECREF(__pyx_t_2);
10913 __Pyx_AddTraceback(
"PyClical.clifford.frame", __pyx_clineno, __pyx_lineno, __pyx_filename);
10916 __Pyx_XGIVEREF(__pyx_r);
10917 __Pyx_RefNannyFinishContext();
10930 static PyObject *__pyx_pw_8PyClical_8clifford_93__repr__(PyObject *__pyx_v_self);
10931 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 ";
10932 #if CYTHON_COMPILING_IN_CPYTHON 10933 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_92__repr__;
10935 static PyObject *__pyx_pw_8PyClical_8clifford_93__repr__(PyObject *__pyx_v_self) {
10936 PyObject *__pyx_r = 0;
10937 __Pyx_RefNannyDeclarations
10938 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
10939 __pyx_r = __pyx_pf_8PyClical_8clifford_92__repr__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10942 __Pyx_RefNannyFinishContext();
10946 static PyObject *__pyx_pf_8PyClical_8clifford_92__repr__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10947 PyObject *__pyx_r = NULL;
10948 __Pyx_RefNannyDeclarations
10949 PyObject *__pyx_t_1 = NULL;
10950 __Pyx_RefNannySetupContext(
"__repr__", 0);
10959 __Pyx_XDECREF(__pyx_r);
10960 __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)
10961 __Pyx_GOTREF(__pyx_t_1);
10962 __pyx_r = __pyx_t_1;
10976 __Pyx_XDECREF(__pyx_t_1);
10977 __Pyx_AddTraceback(
"PyClical.clifford.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10980 __Pyx_XGIVEREF(__pyx_r);
10981 __Pyx_RefNannyFinishContext();
10994 static PyObject *__pyx_pw_8PyClical_8clifford_95__str__(PyObject *__pyx_v_self);
10995 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 ";
10996 #if CYTHON_COMPILING_IN_CPYTHON 10997 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_94__str__;
10999 static PyObject *__pyx_pw_8PyClical_8clifford_95__str__(PyObject *__pyx_v_self) {
11000 PyObject *__pyx_r = 0;
11001 __Pyx_RefNannyDeclarations
11002 __Pyx_RefNannySetupContext(
"__str__ (wrapper)", 0);
11003 __pyx_r = __pyx_pf_8PyClical_8clifford_94__str__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
11006 __Pyx_RefNannyFinishContext();
11010 static PyObject *__pyx_pf_8PyClical_8clifford_94__str__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
11011 PyObject *__pyx_r = NULL;
11012 __Pyx_RefNannyDeclarations
11013 PyObject *__pyx_t_1 = NULL;
11014 __Pyx_RefNannySetupContext(
"__str__", 0);
11023 __Pyx_XDECREF(__pyx_r);
11024 __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)
11025 __Pyx_GOTREF(__pyx_t_1);
11026 __pyx_r = __pyx_t_1;
11040 __Pyx_XDECREF(__pyx_t_1);
11041 __Pyx_AddTraceback(
"PyClical.clifford.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11044 __Pyx_XGIVEREF(__pyx_r);
11045 __Pyx_RefNannyFinishContext();
11056 static PyObject *__pyx_pw_8PyClical_8clifford_97__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
11057 static PyObject *__pyx_pw_8PyClical_8clifford_97__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11058 PyObject *__pyx_r = 0;
11059 __Pyx_RefNannyDeclarations
11060 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
11061 __pyx_r = __pyx_pf_8PyClical_8clifford_96__reduce_cython__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
11064 __Pyx_RefNannyFinishContext();
11068 static PyObject *__pyx_pf_8PyClical_8clifford_96__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
11069 PyObject *__pyx_r = NULL;
11070 __Pyx_RefNannyDeclarations
11071 PyObject *__pyx_t_1 = NULL;
11072 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
11080 __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)
11081 __Pyx_GOTREF(__pyx_t_1);
11082 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
11083 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11084 __PYX_ERR(1, 2, __pyx_L1_error)
11094 __Pyx_XDECREF(__pyx_t_1);
11095 __Pyx_AddTraceback(
"PyClical.clifford.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11097 __Pyx_XGIVEREF(__pyx_r);
11098 __Pyx_RefNannyFinishContext();
11110 static PyObject *__pyx_pw_8PyClical_8clifford_99__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
11111 static PyObject *__pyx_pw_8PyClical_8clifford_99__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
11112 PyObject *__pyx_r = 0;
11113 __Pyx_RefNannyDeclarations
11114 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
11115 __pyx_r = __pyx_pf_8PyClical_8clifford_98__setstate_cython__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
11118 __Pyx_RefNannyFinishContext();
11122 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) {
11123 PyObject *__pyx_r = NULL;
11124 __Pyx_RefNannyDeclarations
11125 PyObject *__pyx_t_1 = NULL;
11126 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
11133 __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)
11134 __Pyx_GOTREF(__pyx_t_1);
11135 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
11136 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11137 __PYX_ERR(1, 4, __pyx_L1_error)
11148 __Pyx_XDECREF(__pyx_t_1);
11149 __Pyx_AddTraceback(
"PyClical.clifford.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11151 __Pyx_XGIVEREF(__pyx_r);
11152 __Pyx_RefNannyFinishContext();
11165 static PyObject *__pyx_pw_8PyClical_9clifford_hidden_doctests(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused);
11166 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 ";
11167 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};
11168 static PyObject *__pyx_pw_8PyClical_9clifford_hidden_doctests(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
11169 PyObject *__pyx_r = 0;
11170 __Pyx_RefNannyDeclarations
11171 __Pyx_RefNannySetupContext(
"clifford_hidden_doctests (wrapper)", 0);
11172 __pyx_r = __pyx_pf_8PyClical_8clifford_hidden_doctests(__pyx_self);
11175 __Pyx_RefNannyFinishContext();
11179 static PyObject *__pyx_pf_8PyClical_8clifford_hidden_doctests(CYTHON_UNUSED PyObject *__pyx_self) {
11180 PyObject *__pyx_r = NULL;
11181 __Pyx_RefNannyDeclarations
11182 __Pyx_RefNannySetupContext(
"clifford_hidden_doctests", 0);
11191 __Pyx_XDECREF(__pyx_r);
11192 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11205 __Pyx_XGIVEREF(__pyx_r);
11206 __Pyx_RefNannyFinishContext();
11218 static PyObject *__pyx_pw_8PyClical_11inv(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11219 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_inv(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11220 PyObject *__pyx_r = NULL;
11221 __Pyx_RefNannyDeclarations
11222 PyObject *__pyx_t_1 = NULL;
11223 PyObject *__pyx_t_2 = NULL;
11224 PyObject *__pyx_t_3 = NULL;
11225 __Pyx_RefNannySetupContext(
"inv", 0);
11234 __Pyx_XDECREF(__pyx_r);
11235 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1342, __pyx_L1_error)
11236 __Pyx_GOTREF(__pyx_t_2);
11237 __Pyx_INCREF(__pyx_v_obj);
11238 __Pyx_GIVEREF(__pyx_v_obj);
11239 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj);
11240 __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)
11241 __Pyx_GOTREF(__pyx_t_3);
11242 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11243 __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)
11244 __Pyx_GOTREF(__pyx_t_2);
11245 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11247 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
11248 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
11249 if (likely(__pyx_t_3)) {
11250 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
11251 __Pyx_INCREF(__pyx_t_3);
11252 __Pyx_INCREF(
function);
11253 __Pyx_DECREF_SET(__pyx_t_2,
function);
11257 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1342, __pyx_L1_error)
11258 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11260 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1342, __pyx_L1_error)
11262 __Pyx_GOTREF(__pyx_t_1);
11263 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11264 __pyx_r = __pyx_t_1;
11278 __Pyx_XDECREF(__pyx_t_1);
11279 __Pyx_XDECREF(__pyx_t_2);
11280 __Pyx_XDECREF(__pyx_t_3);
11281 __Pyx_AddTraceback(
"PyClical.inv", __pyx_clineno, __pyx_lineno, __pyx_filename);
11284 __Pyx_XGIVEREF(__pyx_r);
11285 __Pyx_RefNannyFinishContext();
11290 static PyObject *__pyx_pw_8PyClical_11inv(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11291 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 ";
11292 static PyObject *__pyx_pw_8PyClical_11inv(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11293 PyObject *__pyx_r = 0;
11294 __Pyx_RefNannyDeclarations
11295 __Pyx_RefNannySetupContext(
"inv (wrapper)", 0);
11296 __pyx_r = __pyx_pf_8PyClical_10inv(__pyx_self, ((PyObject *)__pyx_v_obj));
11299 __Pyx_RefNannyFinishContext();
11303 static PyObject *__pyx_pf_8PyClical_10inv(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11304 PyObject *__pyx_r = NULL;
11305 __Pyx_RefNannyDeclarations
11306 PyObject *__pyx_t_1 = NULL;
11307 __Pyx_RefNannySetupContext(
"inv", 0);
11308 __Pyx_XDECREF(__pyx_r);
11309 __pyx_t_1 = __pyx_f_8PyClical_inv(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1329, __pyx_L1_error)
11310 __Pyx_GOTREF(__pyx_t_1);
11311 __pyx_r = __pyx_t_1;
11317 __Pyx_XDECREF(__pyx_t_1);
11318 __Pyx_AddTraceback(
"PyClical.inv", __pyx_clineno, __pyx_lineno, __pyx_filename);
11321 __Pyx_XGIVEREF(__pyx_r);
11322 __Pyx_RefNannyFinishContext();
11334 static PyObject *__pyx_pw_8PyClical_13scalar(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11335 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_scalar(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11336 PyObject *__pyx_r = NULL;
11337 __Pyx_RefNannyDeclarations
11338 PyObject *__pyx_t_1 = NULL;
11339 PyObject *__pyx_t_2 = NULL;
11340 PyObject *__pyx_t_3 = NULL;
11341 __Pyx_RefNannySetupContext(
"scalar", 0);
11350 __Pyx_XDECREF(__pyx_r);
11351 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1353, __pyx_L1_error)
11352 __Pyx_GOTREF(__pyx_t_2);
11353 __Pyx_INCREF(__pyx_v_obj);
11354 __Pyx_GIVEREF(__pyx_v_obj);
11355 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj);
11356 __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)
11357 __Pyx_GOTREF(__pyx_t_3);
11358 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11359 __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)
11360 __Pyx_GOTREF(__pyx_t_2);
11361 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11363 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
11364 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
11365 if (likely(__pyx_t_3)) {
11366 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
11367 __Pyx_INCREF(__pyx_t_3);
11368 __Pyx_INCREF(
function);
11369 __Pyx_DECREF_SET(__pyx_t_2,
function);
11373 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1353, __pyx_L1_error)
11374 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11376 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1353, __pyx_L1_error)
11378 __Pyx_GOTREF(__pyx_t_1);
11379 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11380 __pyx_r = __pyx_t_1;
11394 __Pyx_XDECREF(__pyx_t_1);
11395 __Pyx_XDECREF(__pyx_t_2);
11396 __Pyx_XDECREF(__pyx_t_3);
11397 __Pyx_AddTraceback(
"PyClical.scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
11400 __Pyx_XGIVEREF(__pyx_r);
11401 __Pyx_RefNannyFinishContext();
11406 static PyObject *__pyx_pw_8PyClical_13scalar(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11407 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 ";
11408 static PyObject *__pyx_pw_8PyClical_13scalar(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11409 PyObject *__pyx_r = 0;
11410 __Pyx_RefNannyDeclarations
11411 __Pyx_RefNannySetupContext(
"scalar (wrapper)", 0);
11412 __pyx_r = __pyx_pf_8PyClical_12scalar(__pyx_self, ((PyObject *)__pyx_v_obj));
11415 __Pyx_RefNannyFinishContext();
11419 static PyObject *__pyx_pf_8PyClical_12scalar(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11420 PyObject *__pyx_r = NULL;
11421 __Pyx_RefNannyDeclarations
11422 PyObject *__pyx_t_1 = NULL;
11423 __Pyx_RefNannySetupContext(
"scalar", 0);
11424 __Pyx_XDECREF(__pyx_r);
11425 __pyx_t_1 = __pyx_f_8PyClical_scalar(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1344, __pyx_L1_error)
11426 __Pyx_GOTREF(__pyx_t_1);
11427 __pyx_r = __pyx_t_1;
11433 __Pyx_XDECREF(__pyx_t_1);
11434 __Pyx_AddTraceback(
"PyClical.scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
11437 __Pyx_XGIVEREF(__pyx_r);
11438 __Pyx_RefNannyFinishContext();
11450 static PyObject *__pyx_pw_8PyClical_15real(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11451 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_real(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11452 PyObject *__pyx_r = NULL;
11453 __Pyx_RefNannyDeclarations
11454 PyObject *__pyx_t_1 = NULL;
11455 PyObject *__pyx_t_2 = NULL;
11456 PyObject *__pyx_t_3 = NULL;
11457 __Pyx_RefNannySetupContext(
"real", 0);
11466 __Pyx_XDECREF(__pyx_r);
11467 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1364, __pyx_L1_error)
11468 __Pyx_GOTREF(__pyx_t_2);
11469 __Pyx_INCREF(__pyx_v_obj);
11470 __Pyx_GIVEREF(__pyx_v_obj);
11471 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj);
11472 __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)
11473 __Pyx_GOTREF(__pyx_t_3);
11474 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11475 __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)
11476 __Pyx_GOTREF(__pyx_t_2);
11477 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11479 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
11480 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
11481 if (likely(__pyx_t_3)) {
11482 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
11483 __Pyx_INCREF(__pyx_t_3);
11484 __Pyx_INCREF(
function);
11485 __Pyx_DECREF_SET(__pyx_t_2,
function);
11489 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1364, __pyx_L1_error)
11490 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11492 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1364, __pyx_L1_error)
11494 __Pyx_GOTREF(__pyx_t_1);
11495 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11496 __pyx_r = __pyx_t_1;
11510 __Pyx_XDECREF(__pyx_t_1);
11511 __Pyx_XDECREF(__pyx_t_2);
11512 __Pyx_XDECREF(__pyx_t_3);
11513 __Pyx_AddTraceback(
"PyClical.real", __pyx_clineno, __pyx_lineno, __pyx_filename);
11516 __Pyx_XGIVEREF(__pyx_r);
11517 __Pyx_RefNannyFinishContext();
11522 static PyObject *__pyx_pw_8PyClical_15real(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11523 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 ";
11524 static PyObject *__pyx_pw_8PyClical_15real(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11525 PyObject *__pyx_r = 0;
11526 __Pyx_RefNannyDeclarations
11527 __Pyx_RefNannySetupContext(
"real (wrapper)", 0);
11528 __pyx_r = __pyx_pf_8PyClical_14real(__pyx_self, ((PyObject *)__pyx_v_obj));
11531 __Pyx_RefNannyFinishContext();
11535 static PyObject *__pyx_pf_8PyClical_14real(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11536 PyObject *__pyx_r = NULL;
11537 __Pyx_RefNannyDeclarations
11538 PyObject *__pyx_t_1 = NULL;
11539 __Pyx_RefNannySetupContext(
"real", 0);
11540 __Pyx_XDECREF(__pyx_r);
11541 __pyx_t_1 = __pyx_f_8PyClical_real(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1355, __pyx_L1_error)
11542 __Pyx_GOTREF(__pyx_t_1);
11543 __pyx_r = __pyx_t_1;
11549 __Pyx_XDECREF(__pyx_t_1);
11550 __Pyx_AddTraceback(
"PyClical.real", __pyx_clineno, __pyx_lineno, __pyx_filename);
11553 __Pyx_XGIVEREF(__pyx_r);
11554 __Pyx_RefNannyFinishContext();
11566 static PyObject *__pyx_pw_8PyClical_17imag(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11567 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_imag(CYTHON_UNUSED PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11568 PyObject *__pyx_r = NULL;
11569 __Pyx_RefNannyDeclarations
11570 __Pyx_RefNannySetupContext(
"imag", 0);
11579 __Pyx_XDECREF(__pyx_r);
11580 __Pyx_INCREF(__pyx_float_0_0);
11581 __pyx_r = __pyx_float_0_0;
11594 __Pyx_XGIVEREF(__pyx_r);
11595 __Pyx_RefNannyFinishContext();
11600 static PyObject *__pyx_pw_8PyClical_17imag(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11601 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 ";
11602 static PyObject *__pyx_pw_8PyClical_17imag(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11603 PyObject *__pyx_r = 0;
11604 __Pyx_RefNannyDeclarations
11605 __Pyx_RefNannySetupContext(
"imag (wrapper)", 0);
11606 __pyx_r = __pyx_pf_8PyClical_16imag(__pyx_self, ((PyObject *)__pyx_v_obj));
11609 __Pyx_RefNannyFinishContext();
11613 static PyObject *__pyx_pf_8PyClical_16imag(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11614 PyObject *__pyx_r = NULL;
11615 __Pyx_RefNannyDeclarations
11616 PyObject *__pyx_t_1 = NULL;
11617 __Pyx_RefNannySetupContext(
"imag", 0);
11618 __Pyx_XDECREF(__pyx_r);
11619 __pyx_t_1 = __pyx_f_8PyClical_imag(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1366, __pyx_L1_error)
11620 __Pyx_GOTREF(__pyx_t_1);
11621 __pyx_r = __pyx_t_1;
11627 __Pyx_XDECREF(__pyx_t_1);
11628 __Pyx_AddTraceback(
"PyClical.imag", __pyx_clineno, __pyx_lineno, __pyx_filename);
11631 __Pyx_XGIVEREF(__pyx_r);
11632 __Pyx_RefNannyFinishContext();
11644 static PyObject *__pyx_pw_8PyClical_19pure(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11645 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_pure(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11646 PyObject *__pyx_r = NULL;
11647 __Pyx_RefNannyDeclarations
11648 PyObject *__pyx_t_1 = NULL;
11649 PyObject *__pyx_t_2 = NULL;
11650 PyObject *__pyx_t_3 = NULL;
11651 __Pyx_RefNannySetupContext(
"pure", 0);
11660 __Pyx_XDECREF(__pyx_r);
11661 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1386, __pyx_L1_error)
11662 __Pyx_GOTREF(__pyx_t_2);
11663 __Pyx_INCREF(__pyx_v_obj);
11664 __Pyx_GIVEREF(__pyx_v_obj);
11665 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj);
11666 __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)
11667 __Pyx_GOTREF(__pyx_t_3);
11668 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11669 __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)
11670 __Pyx_GOTREF(__pyx_t_2);
11671 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11673 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
11674 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
11675 if (likely(__pyx_t_3)) {
11676 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
11677 __Pyx_INCREF(__pyx_t_3);
11678 __Pyx_INCREF(
function);
11679 __Pyx_DECREF_SET(__pyx_t_2,
function);
11683 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1386, __pyx_L1_error)
11684 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11686 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1386, __pyx_L1_error)
11688 __Pyx_GOTREF(__pyx_t_1);
11689 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11690 __pyx_r = __pyx_t_1;
11704 __Pyx_XDECREF(__pyx_t_1);
11705 __Pyx_XDECREF(__pyx_t_2);
11706 __Pyx_XDECREF(__pyx_t_3);
11707 __Pyx_AddTraceback(
"PyClical.pure", __pyx_clineno, __pyx_lineno, __pyx_filename);
11710 __Pyx_XGIVEREF(__pyx_r);
11711 __Pyx_RefNannyFinishContext();
11716 static PyObject *__pyx_pw_8PyClical_19pure(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11717 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 ";
11718 static PyObject *__pyx_pw_8PyClical_19pure(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11719 PyObject *__pyx_r = 0;
11720 __Pyx_RefNannyDeclarations
11721 __Pyx_RefNannySetupContext(
"pure (wrapper)", 0);
11722 __pyx_r = __pyx_pf_8PyClical_18pure(__pyx_self, ((PyObject *)__pyx_v_obj));
11725 __Pyx_RefNannyFinishContext();
11729 static PyObject *__pyx_pf_8PyClical_18pure(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11730 PyObject *__pyx_r = NULL;
11731 __Pyx_RefNannyDeclarations
11732 PyObject *__pyx_t_1 = NULL;
11733 __Pyx_RefNannySetupContext(
"pure", 0);
11734 __Pyx_XDECREF(__pyx_r);
11735 __pyx_t_1 = __pyx_f_8PyClical_pure(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1377, __pyx_L1_error)
11736 __Pyx_GOTREF(__pyx_t_1);
11737 __pyx_r = __pyx_t_1;
11743 __Pyx_XDECREF(__pyx_t_1);
11744 __Pyx_AddTraceback(
"PyClical.pure", __pyx_clineno, __pyx_lineno, __pyx_filename);
11747 __Pyx_XGIVEREF(__pyx_r);
11748 __Pyx_RefNannyFinishContext();
11760 static PyObject *__pyx_pw_8PyClical_21even(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11761 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_even(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11762 PyObject *__pyx_r = NULL;
11763 __Pyx_RefNannyDeclarations
11764 PyObject *__pyx_t_1 = NULL;
11765 PyObject *__pyx_t_2 = NULL;
11766 PyObject *__pyx_t_3 = NULL;
11767 __Pyx_RefNannySetupContext(
"even", 0);
11776 __Pyx_XDECREF(__pyx_r);
11777 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1395, __pyx_L1_error)
11778 __Pyx_GOTREF(__pyx_t_2);
11779 __Pyx_INCREF(__pyx_v_obj);
11780 __Pyx_GIVEREF(__pyx_v_obj);
11781 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj);
11782 __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)
11783 __Pyx_GOTREF(__pyx_t_3);
11784 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11785 __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)
11786 __Pyx_GOTREF(__pyx_t_2);
11787 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11789 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
11790 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
11791 if (likely(__pyx_t_3)) {
11792 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
11793 __Pyx_INCREF(__pyx_t_3);
11794 __Pyx_INCREF(
function);
11795 __Pyx_DECREF_SET(__pyx_t_2,
function);
11799 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1395, __pyx_L1_error)
11800 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11802 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1395, __pyx_L1_error)
11804 __Pyx_GOTREF(__pyx_t_1);
11805 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11806 __pyx_r = __pyx_t_1;
11820 __Pyx_XDECREF(__pyx_t_1);
11821 __Pyx_XDECREF(__pyx_t_2);
11822 __Pyx_XDECREF(__pyx_t_3);
11823 __Pyx_AddTraceback(
"PyClical.even", __pyx_clineno, __pyx_lineno, __pyx_filename);
11826 __Pyx_XGIVEREF(__pyx_r);
11827 __Pyx_RefNannyFinishContext();
11832 static PyObject *__pyx_pw_8PyClical_21even(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11833 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 ";
11834 static PyObject *__pyx_pw_8PyClical_21even(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11835 PyObject *__pyx_r = 0;
11836 __Pyx_RefNannyDeclarations
11837 __Pyx_RefNannySetupContext(
"even (wrapper)", 0);
11838 __pyx_r = __pyx_pf_8PyClical_20even(__pyx_self, ((PyObject *)__pyx_v_obj));
11841 __Pyx_RefNannyFinishContext();
11845 static PyObject *__pyx_pf_8PyClical_20even(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11846 PyObject *__pyx_r = NULL;
11847 __Pyx_RefNannyDeclarations
11848 PyObject *__pyx_t_1 = NULL;
11849 __Pyx_RefNannySetupContext(
"even", 0);
11850 __Pyx_XDECREF(__pyx_r);
11851 __pyx_t_1 = __pyx_f_8PyClical_even(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1388, __pyx_L1_error)
11852 __Pyx_GOTREF(__pyx_t_1);
11853 __pyx_r = __pyx_t_1;
11859 __Pyx_XDECREF(__pyx_t_1);
11860 __Pyx_AddTraceback(
"PyClical.even", __pyx_clineno, __pyx_lineno, __pyx_filename);
11863 __Pyx_XGIVEREF(__pyx_r);
11864 __Pyx_RefNannyFinishContext();
11876 static PyObject *__pyx_pw_8PyClical_23odd(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11877 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_odd(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11878 PyObject *__pyx_r = NULL;
11879 __Pyx_RefNannyDeclarations
11880 PyObject *__pyx_t_1 = NULL;
11881 PyObject *__pyx_t_2 = NULL;
11882 PyObject *__pyx_t_3 = NULL;
11883 __Pyx_RefNannySetupContext(
"odd", 0);
11892 __Pyx_XDECREF(__pyx_r);
11893 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1404, __pyx_L1_error)
11894 __Pyx_GOTREF(__pyx_t_2);
11895 __Pyx_INCREF(__pyx_v_obj);
11896 __Pyx_GIVEREF(__pyx_v_obj);
11897 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj);
11898 __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)
11899 __Pyx_GOTREF(__pyx_t_3);
11900 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11901 __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)
11902 __Pyx_GOTREF(__pyx_t_2);
11903 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11905 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
11906 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
11907 if (likely(__pyx_t_3)) {
11908 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
11909 __Pyx_INCREF(__pyx_t_3);
11910 __Pyx_INCREF(
function);
11911 __Pyx_DECREF_SET(__pyx_t_2,
function);
11915 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1404, __pyx_L1_error)
11916 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11918 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1404, __pyx_L1_error)
11920 __Pyx_GOTREF(__pyx_t_1);
11921 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11922 __pyx_r = __pyx_t_1;
11936 __Pyx_XDECREF(__pyx_t_1);
11937 __Pyx_XDECREF(__pyx_t_2);
11938 __Pyx_XDECREF(__pyx_t_3);
11939 __Pyx_AddTraceback(
"PyClical.odd", __pyx_clineno, __pyx_lineno, __pyx_filename);
11942 __Pyx_XGIVEREF(__pyx_r);
11943 __Pyx_RefNannyFinishContext();
11948 static PyObject *__pyx_pw_8PyClical_23odd(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11949 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 ";
11950 static PyObject *__pyx_pw_8PyClical_23odd(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11951 PyObject *__pyx_r = 0;
11952 __Pyx_RefNannyDeclarations
11953 __Pyx_RefNannySetupContext(
"odd (wrapper)", 0);
11954 __pyx_r = __pyx_pf_8PyClical_22odd(__pyx_self, ((PyObject *)__pyx_v_obj));
11957 __Pyx_RefNannyFinishContext();
11961 static PyObject *__pyx_pf_8PyClical_22odd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11962 PyObject *__pyx_r = NULL;
11963 __Pyx_RefNannyDeclarations
11964 PyObject *__pyx_t_1 = NULL;
11965 __Pyx_RefNannySetupContext(
"odd", 0);
11966 __Pyx_XDECREF(__pyx_r);
11967 __pyx_t_1 = __pyx_f_8PyClical_odd(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1397, __pyx_L1_error)
11968 __Pyx_GOTREF(__pyx_t_1);
11969 __pyx_r = __pyx_t_1;
11975 __Pyx_XDECREF(__pyx_t_1);
11976 __Pyx_AddTraceback(
"PyClical.odd", __pyx_clineno, __pyx_lineno, __pyx_filename);
11979 __Pyx_XGIVEREF(__pyx_r);
11980 __Pyx_RefNannyFinishContext();
11992 static PyObject *__pyx_pw_8PyClical_25involute(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11993 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_involute(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11994 PyObject *__pyx_r = NULL;
11995 __Pyx_RefNannyDeclarations
11996 PyObject *__pyx_t_1 = NULL;
11997 PyObject *__pyx_t_2 = NULL;
11998 PyObject *__pyx_t_3 = NULL;
11999 __Pyx_RefNannySetupContext(
"involute", 0);
12008 __Pyx_XDECREF(__pyx_r);
12009 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1419, __pyx_L1_error)
12010 __Pyx_GOTREF(__pyx_t_2);
12011 __Pyx_INCREF(__pyx_v_obj);
12012 __Pyx_GIVEREF(__pyx_v_obj);
12013 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj);
12014 __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)
12015 __Pyx_GOTREF(__pyx_t_3);
12016 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12017 __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)
12018 __Pyx_GOTREF(__pyx_t_2);
12019 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12021 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
12022 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
12023 if (likely(__pyx_t_3)) {
12024 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
12025 __Pyx_INCREF(__pyx_t_3);
12026 __Pyx_INCREF(
function);
12027 __Pyx_DECREF_SET(__pyx_t_2,
function);
12031 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1419, __pyx_L1_error)
12032 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12034 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1419, __pyx_L1_error)
12036 __Pyx_GOTREF(__pyx_t_1);
12037 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12038 __pyx_r = __pyx_t_1;
12052 __Pyx_XDECREF(__pyx_t_1);
12053 __Pyx_XDECREF(__pyx_t_2);
12054 __Pyx_XDECREF(__pyx_t_3);
12055 __Pyx_AddTraceback(
"PyClical.involute", __pyx_clineno, __pyx_lineno, __pyx_filename);
12058 __Pyx_XGIVEREF(__pyx_r);
12059 __Pyx_RefNannyFinishContext();
12064 static PyObject *__pyx_pw_8PyClical_25involute(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12065 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 ";
12066 static PyObject *__pyx_pw_8PyClical_25involute(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12067 PyObject *__pyx_r = 0;
12068 __Pyx_RefNannyDeclarations
12069 __Pyx_RefNannySetupContext(
"involute (wrapper)", 0);
12070 __pyx_r = __pyx_pf_8PyClical_24involute(__pyx_self, ((PyObject *)__pyx_v_obj));
12073 __Pyx_RefNannyFinishContext();
12077 static PyObject *__pyx_pf_8PyClical_24involute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12078 PyObject *__pyx_r = NULL;
12079 __Pyx_RefNannyDeclarations
12080 PyObject *__pyx_t_1 = NULL;
12081 __Pyx_RefNannySetupContext(
"involute", 0);
12082 __Pyx_XDECREF(__pyx_r);
12083 __pyx_t_1 = __pyx_f_8PyClical_involute(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1406, __pyx_L1_error)
12084 __Pyx_GOTREF(__pyx_t_1);
12085 __pyx_r = __pyx_t_1;
12091 __Pyx_XDECREF(__pyx_t_1);
12092 __Pyx_AddTraceback(
"PyClical.involute", __pyx_clineno, __pyx_lineno, __pyx_filename);
12095 __Pyx_XGIVEREF(__pyx_r);
12096 __Pyx_RefNannyFinishContext();
12108 static PyObject *__pyx_pw_8PyClical_27reverse(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12109 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_reverse(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12110 PyObject *__pyx_r = NULL;
12111 __Pyx_RefNannyDeclarations
12112 PyObject *__pyx_t_1 = NULL;
12113 PyObject *__pyx_t_2 = NULL;
12114 PyObject *__pyx_t_3 = NULL;
12115 __Pyx_RefNannySetupContext(
"reverse", 0);
12124 __Pyx_XDECREF(__pyx_r);
12125 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1434, __pyx_L1_error)
12126 __Pyx_GOTREF(__pyx_t_2);
12127 __Pyx_INCREF(__pyx_v_obj);
12128 __Pyx_GIVEREF(__pyx_v_obj);
12129 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj);
12130 __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)
12131 __Pyx_GOTREF(__pyx_t_3);
12132 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12133 __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)
12134 __Pyx_GOTREF(__pyx_t_2);
12135 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12137 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
12138 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
12139 if (likely(__pyx_t_3)) {
12140 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
12141 __Pyx_INCREF(__pyx_t_3);
12142 __Pyx_INCREF(
function);
12143 __Pyx_DECREF_SET(__pyx_t_2,
function);
12147 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1434, __pyx_L1_error)
12148 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12150 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1434, __pyx_L1_error)
12152 __Pyx_GOTREF(__pyx_t_1);
12153 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12154 __pyx_r = __pyx_t_1;
12168 __Pyx_XDECREF(__pyx_t_1);
12169 __Pyx_XDECREF(__pyx_t_2);
12170 __Pyx_XDECREF(__pyx_t_3);
12171 __Pyx_AddTraceback(
"PyClical.reverse", __pyx_clineno, __pyx_lineno, __pyx_filename);
12174 __Pyx_XGIVEREF(__pyx_r);
12175 __Pyx_RefNannyFinishContext();
12180 static PyObject *__pyx_pw_8PyClical_27reverse(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12181 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 ";
12182 static PyObject *__pyx_pw_8PyClical_27reverse(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12183 PyObject *__pyx_r = 0;
12184 __Pyx_RefNannyDeclarations
12185 __Pyx_RefNannySetupContext(
"reverse (wrapper)", 0);
12186 __pyx_r = __pyx_pf_8PyClical_26reverse(__pyx_self, ((PyObject *)__pyx_v_obj));
12189 __Pyx_RefNannyFinishContext();
12193 static PyObject *__pyx_pf_8PyClical_26reverse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12194 PyObject *__pyx_r = NULL;
12195 __Pyx_RefNannyDeclarations
12196 PyObject *__pyx_t_1 = NULL;
12197 __Pyx_RefNannySetupContext(
"reverse", 0);
12198 __Pyx_XDECREF(__pyx_r);
12199 __pyx_t_1 = __pyx_f_8PyClical_reverse(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1421, __pyx_L1_error)
12200 __Pyx_GOTREF(__pyx_t_1);
12201 __pyx_r = __pyx_t_1;
12207 __Pyx_XDECREF(__pyx_t_1);
12208 __Pyx_AddTraceback(
"PyClical.reverse", __pyx_clineno, __pyx_lineno, __pyx_filename);
12211 __Pyx_XGIVEREF(__pyx_r);
12212 __Pyx_RefNannyFinishContext();
12224 static PyObject *__pyx_pw_8PyClical_29conj(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12225 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_conj(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12226 PyObject *__pyx_r = NULL;
12227 __Pyx_RefNannyDeclarations
12228 PyObject *__pyx_t_1 = NULL;
12229 PyObject *__pyx_t_2 = NULL;
12230 PyObject *__pyx_t_3 = NULL;
12231 __Pyx_RefNannySetupContext(
"conj", 0);
12240 __Pyx_XDECREF(__pyx_r);
12241 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1449, __pyx_L1_error)
12242 __Pyx_GOTREF(__pyx_t_2);
12243 __Pyx_INCREF(__pyx_v_obj);
12244 __Pyx_GIVEREF(__pyx_v_obj);
12245 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj);
12246 __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)
12247 __Pyx_GOTREF(__pyx_t_3);
12248 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12249 __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)
12250 __Pyx_GOTREF(__pyx_t_2);
12251 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12253 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
12254 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
12255 if (likely(__pyx_t_3)) {
12256 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
12257 __Pyx_INCREF(__pyx_t_3);
12258 __Pyx_INCREF(
function);
12259 __Pyx_DECREF_SET(__pyx_t_2,
function);
12263 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1449, __pyx_L1_error)
12264 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12266 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1449, __pyx_L1_error)
12268 __Pyx_GOTREF(__pyx_t_1);
12269 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12270 __pyx_r = __pyx_t_1;
12284 __Pyx_XDECREF(__pyx_t_1);
12285 __Pyx_XDECREF(__pyx_t_2);
12286 __Pyx_XDECREF(__pyx_t_3);
12287 __Pyx_AddTraceback(
"PyClical.conj", __pyx_clineno, __pyx_lineno, __pyx_filename);
12290 __Pyx_XGIVEREF(__pyx_r);
12291 __Pyx_RefNannyFinishContext();
12296 static PyObject *__pyx_pw_8PyClical_29conj(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12297 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 ";
12298 static PyObject *__pyx_pw_8PyClical_29conj(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12299 PyObject *__pyx_r = 0;
12300 __Pyx_RefNannyDeclarations
12301 __Pyx_RefNannySetupContext(
"conj (wrapper)", 0);
12302 __pyx_r = __pyx_pf_8PyClical_28conj(__pyx_self, ((PyObject *)__pyx_v_obj));
12305 __Pyx_RefNannyFinishContext();
12309 static PyObject *__pyx_pf_8PyClical_28conj(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12310 PyObject *__pyx_r = NULL;
12311 __Pyx_RefNannyDeclarations
12312 PyObject *__pyx_t_1 = NULL;
12313 __Pyx_RefNannySetupContext(
"conj", 0);
12314 __Pyx_XDECREF(__pyx_r);
12315 __pyx_t_1 = __pyx_f_8PyClical_conj(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1436, __pyx_L1_error)
12316 __Pyx_GOTREF(__pyx_t_1);
12317 __pyx_r = __pyx_t_1;
12323 __Pyx_XDECREF(__pyx_t_1);
12324 __Pyx_AddTraceback(
"PyClical.conj", __pyx_clineno, __pyx_lineno, __pyx_filename);
12327 __Pyx_XGIVEREF(__pyx_r);
12328 __Pyx_RefNannyFinishContext();
12340 static PyObject *__pyx_pw_8PyClical_31quad(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12341 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_quad(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12342 PyObject *__pyx_r = NULL;
12343 __Pyx_RefNannyDeclarations
12344 PyObject *__pyx_t_1 = NULL;
12345 PyObject *__pyx_t_2 = NULL;
12346 PyObject *__pyx_t_3 = NULL;
12347 __Pyx_RefNannySetupContext(
"quad", 0);
12356 __Pyx_XDECREF(__pyx_r);
12357 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1460, __pyx_L1_error)
12358 __Pyx_GOTREF(__pyx_t_2);
12359 __Pyx_INCREF(__pyx_v_obj);
12360 __Pyx_GIVEREF(__pyx_v_obj);
12361 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj);
12362 __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)
12363 __Pyx_GOTREF(__pyx_t_3);
12364 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12365 __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)
12366 __Pyx_GOTREF(__pyx_t_2);
12367 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12369 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
12370 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
12371 if (likely(__pyx_t_3)) {
12372 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
12373 __Pyx_INCREF(__pyx_t_3);
12374 __Pyx_INCREF(
function);
12375 __Pyx_DECREF_SET(__pyx_t_2,
function);
12379 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1460, __pyx_L1_error)
12380 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12382 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1460, __pyx_L1_error)
12384 __Pyx_GOTREF(__pyx_t_1);
12385 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12386 __pyx_r = __pyx_t_1;
12400 __Pyx_XDECREF(__pyx_t_1);
12401 __Pyx_XDECREF(__pyx_t_2);
12402 __Pyx_XDECREF(__pyx_t_3);
12403 __Pyx_AddTraceback(
"PyClical.quad", __pyx_clineno, __pyx_lineno, __pyx_filename);
12406 __Pyx_XGIVEREF(__pyx_r);
12407 __Pyx_RefNannyFinishContext();
12412 static PyObject *__pyx_pw_8PyClical_31quad(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12413 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 ";
12414 static PyObject *__pyx_pw_8PyClical_31quad(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12415 PyObject *__pyx_r = 0;
12416 __Pyx_RefNannyDeclarations
12417 __Pyx_RefNannySetupContext(
"quad (wrapper)", 0);
12418 __pyx_r = __pyx_pf_8PyClical_30quad(__pyx_self, ((PyObject *)__pyx_v_obj));
12421 __Pyx_RefNannyFinishContext();
12425 static PyObject *__pyx_pf_8PyClical_30quad(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12426 PyObject *__pyx_r = NULL;
12427 __Pyx_RefNannyDeclarations
12428 PyObject *__pyx_t_1 = NULL;
12429 __Pyx_RefNannySetupContext(
"quad", 0);
12430 __Pyx_XDECREF(__pyx_r);
12431 __pyx_t_1 = __pyx_f_8PyClical_quad(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1451, __pyx_L1_error)
12432 __Pyx_GOTREF(__pyx_t_1);
12433 __pyx_r = __pyx_t_1;
12439 __Pyx_XDECREF(__pyx_t_1);
12440 __Pyx_AddTraceback(
"PyClical.quad", __pyx_clineno, __pyx_lineno, __pyx_filename);
12443 __Pyx_XGIVEREF(__pyx_r);
12444 __Pyx_RefNannyFinishContext();
12456 static PyObject *__pyx_pw_8PyClical_33norm(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12457 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_norm(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12458 PyObject *__pyx_r = NULL;
12459 __Pyx_RefNannyDeclarations
12460 PyObject *__pyx_t_1 = NULL;
12461 PyObject *__pyx_t_2 = NULL;
12462 PyObject *__pyx_t_3 = NULL;
12463 __Pyx_RefNannySetupContext(
"norm", 0);
12472 __Pyx_XDECREF(__pyx_r);
12473 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1471, __pyx_L1_error)
12474 __Pyx_GOTREF(__pyx_t_2);
12475 __Pyx_INCREF(__pyx_v_obj);
12476 __Pyx_GIVEREF(__pyx_v_obj);
12477 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj);
12478 __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)
12479 __Pyx_GOTREF(__pyx_t_3);
12480 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12481 __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)
12482 __Pyx_GOTREF(__pyx_t_2);
12483 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12485 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
12486 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
12487 if (likely(__pyx_t_3)) {
12488 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
12489 __Pyx_INCREF(__pyx_t_3);
12490 __Pyx_INCREF(
function);
12491 __Pyx_DECREF_SET(__pyx_t_2,
function);
12495 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1471, __pyx_L1_error)
12496 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12498 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1471, __pyx_L1_error)
12500 __Pyx_GOTREF(__pyx_t_1);
12501 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12502 __pyx_r = __pyx_t_1;
12516 __Pyx_XDECREF(__pyx_t_1);
12517 __Pyx_XDECREF(__pyx_t_2);
12518 __Pyx_XDECREF(__pyx_t_3);
12519 __Pyx_AddTraceback(
"PyClical.norm", __pyx_clineno, __pyx_lineno, __pyx_filename);
12522 __Pyx_XGIVEREF(__pyx_r);
12523 __Pyx_RefNannyFinishContext();
12528 static PyObject *__pyx_pw_8PyClical_33norm(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12529 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 ";
12530 static PyObject *__pyx_pw_8PyClical_33norm(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12531 PyObject *__pyx_r = 0;
12532 __Pyx_RefNannyDeclarations
12533 __Pyx_RefNannySetupContext(
"norm (wrapper)", 0);
12534 __pyx_r = __pyx_pf_8PyClical_32norm(__pyx_self, ((PyObject *)__pyx_v_obj));
12537 __Pyx_RefNannyFinishContext();
12541 static PyObject *__pyx_pf_8PyClical_32norm(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12542 PyObject *__pyx_r = NULL;
12543 __Pyx_RefNannyDeclarations
12544 PyObject *__pyx_t_1 = NULL;
12545 __Pyx_RefNannySetupContext(
"norm", 0);
12546 __Pyx_XDECREF(__pyx_r);
12547 __pyx_t_1 = __pyx_f_8PyClical_norm(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1462, __pyx_L1_error)
12548 __Pyx_GOTREF(__pyx_t_1);
12549 __pyx_r = __pyx_t_1;
12555 __Pyx_XDECREF(__pyx_t_1);
12556 __Pyx_AddTraceback(
"PyClical.norm", __pyx_clineno, __pyx_lineno, __pyx_filename);
12559 __Pyx_XGIVEREF(__pyx_r);
12560 __Pyx_RefNannyFinishContext();
12572 static PyObject *__pyx_pw_8PyClical_35abs(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12573 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_abs(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12574 PyObject *__pyx_r = NULL;
12575 __Pyx_RefNannyDeclarations
12576 PyObject *__pyx_t_1 = NULL;
12577 __Pyx_RefNannySetupContext(
"abs", 0);
12586 __Pyx_XDECREF(__pyx_r);
12587 __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)
12588 __Pyx_GOTREF(__pyx_t_1);
12589 __pyx_r = __pyx_t_1;
12603 __Pyx_XDECREF(__pyx_t_1);
12604 __Pyx_AddTraceback(
"PyClical.abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
12607 __Pyx_XGIVEREF(__pyx_r);
12608 __Pyx_RefNannyFinishContext();
12613 static PyObject *__pyx_pw_8PyClical_35abs(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12614 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 ";
12615 static PyObject *__pyx_pw_8PyClical_35abs(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12616 PyObject *__pyx_r = 0;
12617 __Pyx_RefNannyDeclarations
12618 __Pyx_RefNannySetupContext(
"abs (wrapper)", 0);
12619 __pyx_r = __pyx_pf_8PyClical_34abs(__pyx_self, ((PyObject *)__pyx_v_obj));
12622 __Pyx_RefNannyFinishContext();
12626 static PyObject *__pyx_pf_8PyClical_34abs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12627 PyObject *__pyx_r = NULL;
12628 __Pyx_RefNannyDeclarations
12629 PyObject *__pyx_t_1 = NULL;
12630 __Pyx_RefNannySetupContext(
"abs", 0);
12631 __Pyx_XDECREF(__pyx_r);
12632 __pyx_t_1 = __pyx_f_8PyClical_abs(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1473, __pyx_L1_error)
12633 __Pyx_GOTREF(__pyx_t_1);
12634 __pyx_r = __pyx_t_1;
12640 __Pyx_XDECREF(__pyx_t_1);
12641 __Pyx_AddTraceback(
"PyClical.abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
12644 __Pyx_XGIVEREF(__pyx_r);
12645 __Pyx_RefNannyFinishContext();
12657 static PyObject *__pyx_pw_8PyClical_37max_abs(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12658 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_max_abs(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12659 PyObject *__pyx_r = NULL;
12660 __Pyx_RefNannyDeclarations
12661 PyObject *__pyx_t_1 = NULL;
12662 __Pyx_RefNannySetupContext(
"max_abs", 0);
12671 __Pyx_XDECREF(__pyx_r);
12672 __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)
12673 __Pyx_GOTREF(__pyx_t_1);
12674 __pyx_r = __pyx_t_1;
12688 __Pyx_XDECREF(__pyx_t_1);
12689 __Pyx_AddTraceback(
"PyClical.max_abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
12692 __Pyx_XGIVEREF(__pyx_r);
12693 __Pyx_RefNannyFinishContext();
12698 static PyObject *__pyx_pw_8PyClical_37max_abs(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12699 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 ";
12700 static PyObject *__pyx_pw_8PyClical_37max_abs(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12701 PyObject *__pyx_r = 0;
12702 __Pyx_RefNannyDeclarations
12703 __Pyx_RefNannySetupContext(
"max_abs (wrapper)", 0);
12704 __pyx_r = __pyx_pf_8PyClical_36max_abs(__pyx_self, ((PyObject *)__pyx_v_obj));
12707 __Pyx_RefNannyFinishContext();
12711 static PyObject *__pyx_pf_8PyClical_36max_abs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12712 PyObject *__pyx_r = NULL;
12713 __Pyx_RefNannyDeclarations
12714 PyObject *__pyx_t_1 = NULL;
12715 __Pyx_RefNannySetupContext(
"max_abs", 0);
12716 __Pyx_XDECREF(__pyx_r);
12717 __pyx_t_1 = __pyx_f_8PyClical_max_abs(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1482, __pyx_L1_error)
12718 __Pyx_GOTREF(__pyx_t_1);
12719 __pyx_r = __pyx_t_1;
12725 __Pyx_XDECREF(__pyx_t_1);
12726 __Pyx_AddTraceback(
"PyClical.max_abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
12729 __Pyx_XGIVEREF(__pyx_r);
12730 __Pyx_RefNannyFinishContext();
12742 static PyObject *__pyx_pw_8PyClical_39pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
12743 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_pow(PyObject *__pyx_v_obj, PyObject *__pyx_v_m, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12744 PyObject *__pyx_r = NULL;
12745 __Pyx_RefNannyDeclarations
12746 PyObject *__pyx_t_1 = NULL;
12747 PyObject *__pyx_t_2 = NULL;
12748 PyObject *__pyx_t_3 = NULL;
12749 PyObject *__pyx_t_4 = NULL;
12750 PyObject *__pyx_t_5 = NULL;
12751 PyObject *__pyx_t_6 = NULL;
12753 PyObject *__pyx_t_8 = NULL;
12754 PyObject *__pyx_t_9 = NULL;
12755 PyObject *__pyx_t_10 = NULL;
12756 PyObject *__pyx_t_11 = NULL;
12757 __Pyx_RefNannySetupContext(
"pow", 0);
12767 __Pyx_PyThreadState_declare
12768 __Pyx_PyThreadState_assign
12769 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
12770 __Pyx_XGOTREF(__pyx_t_1);
12771 __Pyx_XGOTREF(__pyx_t_2);
12772 __Pyx_XGOTREF(__pyx_t_3);
12782 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1514, __pyx_L3_error)
12783 __Pyx_GOTREF(__pyx_t_5);
12784 __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)
12785 __Pyx_GOTREF(__pyx_t_6);
12786 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12789 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
12790 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
12791 if (likely(__pyx_t_5)) {
12792 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
12793 __Pyx_INCREF(__pyx_t_5);
12794 __Pyx_INCREF(
function);
12795 __Pyx_DECREF_SET(__pyx_t_6,
function);
12799 #if CYTHON_FAST_PYCALL 12800 if (PyFunction_Check(__pyx_t_6)) {
12801 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_obj, __pyx_v_m};
12802 __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)
12803 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12804 __Pyx_GOTREF(__pyx_t_4);
12807 #if CYTHON_FAST_PYCCALL 12808 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
12809 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_obj, __pyx_v_m};
12810 __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)
12811 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12812 __Pyx_GOTREF(__pyx_t_4);
12816 __pyx_t_8 = PyTuple_New(2+__pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1514, __pyx_L3_error)
12817 __Pyx_GOTREF(__pyx_t_8);
12819 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
12821 __Pyx_INCREF(__pyx_v_obj);
12822 __Pyx_GIVEREF(__pyx_v_obj);
12823 PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_obj);
12824 __Pyx_INCREF(__pyx_v_m);
12825 __Pyx_GIVEREF(__pyx_v_m);
12826 PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_m);
12827 __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)
12828 __Pyx_GOTREF(__pyx_t_4);
12829 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12831 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12832 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12842 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12843 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12844 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12845 goto __pyx_L8_try_end;
12847 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12848 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
12849 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12850 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12860 __Pyx_AddTraceback(
"PyClical.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
12861 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_8) < 0) __PYX_ERR(0, 1515, __pyx_L5_except_error)
12862 __Pyx_GOTREF(__pyx_t_4);
12863 __Pyx_GOTREF(__pyx_t_6);
12864 __Pyx_GOTREF(__pyx_t_8);
12873 __Pyx_XDECREF(__pyx_r);
12874 __pyx_t_9 = PyTuple_New(1);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1516, __pyx_L5_except_error)
12875 __Pyx_GOTREF(__pyx_t_9);
12876 __Pyx_INCREF(__pyx_v_obj);
12877 __Pyx_GIVEREF(__pyx_v_obj);
12878 PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_obj);
12879 __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)
12880 __Pyx_GOTREF(__pyx_t_10);
12881 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12882 __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)
12883 __Pyx_GOTREF(__pyx_t_9);
12884 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12886 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
12887 __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
12888 if (likely(__pyx_t_10)) {
12889 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
12890 __Pyx_INCREF(__pyx_t_10);
12891 __Pyx_INCREF(
function);
12892 __Pyx_DECREF_SET(__pyx_t_9,
function);
12896 __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)
12897 __Pyx_GOTREF(__pyx_t_5);
12899 #if CYTHON_FAST_PYCALL 12900 if (PyFunction_Check(__pyx_t_9)) {
12901 PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_v_m};
12902 __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)
12903 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
12904 __Pyx_GOTREF(__pyx_t_5);
12907 #if CYTHON_FAST_PYCCALL 12908 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
12909 PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_v_m};
12910 __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)
12911 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
12912 __Pyx_GOTREF(__pyx_t_5);
12916 __pyx_t_11 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1516, __pyx_L5_except_error)
12917 __Pyx_GOTREF(__pyx_t_11);
12918 __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL;
12919 __Pyx_INCREF(__pyx_v_m);
12920 __Pyx_GIVEREF(__pyx_v_m);
12921 PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_v_m);
12922 __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)
12923 __Pyx_GOTREF(__pyx_t_5);
12924 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
12927 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12928 __pyx_r = __pyx_t_5;
12930 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12931 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12932 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12933 goto __pyx_L6_except_return;
12935 __pyx_L5_except_error:;
12944 __Pyx_XGIVEREF(__pyx_t_1);
12945 __Pyx_XGIVEREF(__pyx_t_2);
12946 __Pyx_XGIVEREF(__pyx_t_3);
12947 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
12948 goto __pyx_L1_error;
12949 __pyx_L6_except_return:;
12950 __Pyx_XGIVEREF(__pyx_t_1);
12951 __Pyx_XGIVEREF(__pyx_t_2);
12952 __Pyx_XGIVEREF(__pyx_t_3);
12953 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
12967 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12970 __Pyx_XDECREF(__pyx_t_4);
12971 __Pyx_XDECREF(__pyx_t_5);
12972 __Pyx_XDECREF(__pyx_t_6);
12973 __Pyx_XDECREF(__pyx_t_8);
12974 __Pyx_XDECREF(__pyx_t_9);
12975 __Pyx_XDECREF(__pyx_t_10);
12976 __Pyx_XDECREF(__pyx_t_11);
12977 __Pyx_AddTraceback(
"PyClical.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
12980 __Pyx_XGIVEREF(__pyx_r);
12981 __Pyx_RefNannyFinishContext();
12986 static PyObject *__pyx_pw_8PyClical_39pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
12987 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 ";
12988 static PyObject *__pyx_pw_8PyClical_39pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
12989 PyObject *__pyx_v_obj = 0;
12990 PyObject *__pyx_v_m = 0;
12991 PyObject *__pyx_r = 0;
12992 __Pyx_RefNannyDeclarations
12993 __Pyx_RefNannySetupContext(
"pow (wrapper)", 0);
12995 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_m,0};
12996 PyObject* values[2] = {0,0};
12997 if (unlikely(__pyx_kwds)) {
12998 Py_ssize_t kw_args;
12999 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13000 switch (pos_args) {
13001 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13002 CYTHON_FALLTHROUGH;
13003 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13004 CYTHON_FALLTHROUGH;
13006 default:
goto __pyx_L5_argtuple_error;
13008 kw_args = PyDict_Size(__pyx_kwds);
13009 switch (pos_args) {
13011 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
13012 else goto __pyx_L5_argtuple_error;
13013 CYTHON_FALLTHROUGH;
13015 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
13017 __Pyx_RaiseArgtupleInvalid(
"pow", 1, 2, 2, 1); __PYX_ERR(0, 1494, __pyx_L3_error)
13020 if (unlikely(kw_args > 0)) {
13021 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"pow") < 0)) __PYX_ERR(0, 1494, __pyx_L3_error)
13023 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
13024 goto __pyx_L5_argtuple_error;
13026 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13027 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13029 __pyx_v_obj = values[0];
13030 __pyx_v_m = values[1];
13032 goto __pyx_L4_argument_unpacking_done;
13033 __pyx_L5_argtuple_error:;
13034 __Pyx_RaiseArgtupleInvalid(
"pow", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1494, __pyx_L3_error)
13036 __Pyx_AddTraceback(
"PyClical.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
13037 __Pyx_RefNannyFinishContext();
13039 __pyx_L4_argument_unpacking_done:;
13040 __pyx_r = __pyx_pf_8PyClical_38pow(__pyx_self, __pyx_v_obj, __pyx_v_m);
13043 __Pyx_RefNannyFinishContext();
13047 static PyObject *__pyx_pf_8PyClical_38pow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_m) {
13048 PyObject *__pyx_r = NULL;
13049 __Pyx_RefNannyDeclarations
13050 PyObject *__pyx_t_1 = NULL;
13051 __Pyx_RefNannySetupContext(
"pow", 0);
13052 __Pyx_XDECREF(__pyx_r);
13053 __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)
13054 __Pyx_GOTREF(__pyx_t_1);
13055 __pyx_r = __pyx_t_1;
13061 __Pyx_XDECREF(__pyx_t_1);
13062 __Pyx_AddTraceback(
"PyClical.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
13065 __Pyx_XGIVEREF(__pyx_r);
13066 __Pyx_RefNannyFinishContext();
13078 static PyObject *__pyx_pw_8PyClical_41outer_pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13079 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_outer_pow(PyObject *__pyx_v_obj, PyObject *__pyx_v_m, CYTHON_UNUSED
int __pyx_skip_dispatch) {
13080 PyObject *__pyx_r = NULL;
13081 __Pyx_RefNannyDeclarations
13082 PyObject *__pyx_t_1 = NULL;
13083 PyObject *__pyx_t_2 = NULL;
13084 PyObject *__pyx_t_3 = NULL;
13085 PyObject *__pyx_t_4 = NULL;
13086 __Pyx_RefNannySetupContext(
"outer_pow", 0);
13095 __Pyx_XDECREF(__pyx_r);
13096 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1525, __pyx_L1_error)
13097 __Pyx_GOTREF(__pyx_t_2);
13098 __Pyx_INCREF(__pyx_v_obj);
13099 __Pyx_GIVEREF(__pyx_v_obj);
13100 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj);
13101 __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)
13102 __Pyx_GOTREF(__pyx_t_3);
13103 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13104 __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)
13105 __Pyx_GOTREF(__pyx_t_2);
13106 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13108 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
13109 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
13110 if (likely(__pyx_t_3)) {
13111 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
13112 __Pyx_INCREF(__pyx_t_3);
13113 __Pyx_INCREF(
function);
13114 __Pyx_DECREF_SET(__pyx_t_2,
function);
13118 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_m);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1525, __pyx_L1_error)
13119 __Pyx_GOTREF(__pyx_t_1);
13121 #if CYTHON_FAST_PYCALL 13122 if (PyFunction_Check(__pyx_t_2)) {
13123 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_m};
13124 __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)
13125 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13126 __Pyx_GOTREF(__pyx_t_1);
13129 #if CYTHON_FAST_PYCCALL 13130 if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
13131 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_m};
13132 __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)
13133 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13134 __Pyx_GOTREF(__pyx_t_1);
13138 __pyx_t_4 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1525, __pyx_L1_error)
13139 __Pyx_GOTREF(__pyx_t_4);
13140 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
13141 __Pyx_INCREF(__pyx_v_m);
13142 __Pyx_GIVEREF(__pyx_v_m);
13143 PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_m);
13144 __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)
13145 __Pyx_GOTREF(__pyx_t_1);
13146 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13149 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13150 __pyx_r = __pyx_t_1;
13164 __Pyx_XDECREF(__pyx_t_1);
13165 __Pyx_XDECREF(__pyx_t_2);
13166 __Pyx_XDECREF(__pyx_t_3);
13167 __Pyx_XDECREF(__pyx_t_4);
13168 __Pyx_AddTraceback(
"PyClical.outer_pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
13171 __Pyx_XGIVEREF(__pyx_r);
13172 __Pyx_RefNannyFinishContext();
13177 static PyObject *__pyx_pw_8PyClical_41outer_pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13178 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 ";
13179 static PyObject *__pyx_pw_8PyClical_41outer_pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13180 PyObject *__pyx_v_obj = 0;
13181 PyObject *__pyx_v_m = 0;
13182 PyObject *__pyx_r = 0;
13183 __Pyx_RefNannyDeclarations
13184 __Pyx_RefNannySetupContext(
"outer_pow (wrapper)", 0);
13186 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_m,0};
13187 PyObject* values[2] = {0,0};
13188 if (unlikely(__pyx_kwds)) {
13189 Py_ssize_t kw_args;
13190 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13191 switch (pos_args) {
13192 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13193 CYTHON_FALLTHROUGH;
13194 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13195 CYTHON_FALLTHROUGH;
13197 default:
goto __pyx_L5_argtuple_error;
13199 kw_args = PyDict_Size(__pyx_kwds);
13200 switch (pos_args) {
13202 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
13203 else goto __pyx_L5_argtuple_error;
13204 CYTHON_FALLTHROUGH;
13206 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
13208 __Pyx_RaiseArgtupleInvalid(
"outer_pow", 1, 2, 2, 1); __PYX_ERR(0, 1518, __pyx_L3_error)
13211 if (unlikely(kw_args > 0)) {
13212 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"outer_pow") < 0)) __PYX_ERR(0, 1518, __pyx_L3_error)
13214 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
13215 goto __pyx_L5_argtuple_error;
13217 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13218 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13220 __pyx_v_obj = values[0];
13221 __pyx_v_m = values[1];
13223 goto __pyx_L4_argument_unpacking_done;
13224 __pyx_L5_argtuple_error:;
13225 __Pyx_RaiseArgtupleInvalid(
"outer_pow", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1518, __pyx_L3_error)
13227 __Pyx_AddTraceback(
"PyClical.outer_pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
13228 __Pyx_RefNannyFinishContext();
13230 __pyx_L4_argument_unpacking_done:;
13231 __pyx_r = __pyx_pf_8PyClical_40outer_pow(__pyx_self, __pyx_v_obj, __pyx_v_m);
13234 __Pyx_RefNannyFinishContext();
13238 static PyObject *__pyx_pf_8PyClical_40outer_pow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_m) {
13239 PyObject *__pyx_r = NULL;
13240 __Pyx_RefNannyDeclarations
13241 PyObject *__pyx_t_1 = NULL;
13242 __Pyx_RefNannySetupContext(
"outer_pow", 0);
13243 __Pyx_XDECREF(__pyx_r);
13244 __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)
13245 __Pyx_GOTREF(__pyx_t_1);
13246 __pyx_r = __pyx_t_1;
13252 __Pyx_XDECREF(__pyx_t_1);
13253 __Pyx_AddTraceback(
"PyClical.outer_pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
13256 __Pyx_XGIVEREF(__pyx_r);
13257 __Pyx_RefNannyFinishContext();
13269 static PyObject *__pyx_pw_8PyClical_43complexifier(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13270 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_complexifier(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
13271 PyObject *__pyx_r = NULL;
13272 __Pyx_RefNannyDeclarations
13273 PyObject *__pyx_t_1 = NULL;
13274 PyObject *__pyx_t_2 = NULL;
13275 __Pyx_RefNannySetupContext(
"complexifier", 0);
13284 __Pyx_XDECREF(__pyx_r);
13285 __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)
13286 __Pyx_GOTREF(__pyx_t_1);
13287 __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)
13288 __Pyx_GOTREF(__pyx_t_2);
13289 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13290 __pyx_r = __pyx_t_2;
13304 __Pyx_XDECREF(__pyx_t_1);
13305 __Pyx_XDECREF(__pyx_t_2);
13306 __Pyx_AddTraceback(
"PyClical.complexifier", __pyx_clineno, __pyx_lineno, __pyx_filename);
13309 __Pyx_XGIVEREF(__pyx_r);
13310 __Pyx_RefNannyFinishContext();
13315 static PyObject *__pyx_pw_8PyClical_43complexifier(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13316 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 ";
13317 static PyObject *__pyx_pw_8PyClical_43complexifier(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13318 PyObject *__pyx_r = 0;
13319 __Pyx_RefNannyDeclarations
13320 __Pyx_RefNannySetupContext(
"complexifier (wrapper)", 0);
13321 __pyx_r = __pyx_pf_8PyClical_42complexifier(__pyx_self, ((PyObject *)__pyx_v_obj));
13324 __Pyx_RefNannyFinishContext();
13328 static PyObject *__pyx_pf_8PyClical_42complexifier(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13329 PyObject *__pyx_r = NULL;
13330 __Pyx_RefNannyDeclarations
13331 PyObject *__pyx_t_1 = NULL;
13332 __Pyx_RefNannySetupContext(
"complexifier", 0);
13333 __Pyx_XDECREF(__pyx_r);
13334 __pyx_t_1 = __pyx_f_8PyClical_complexifier(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1527, __pyx_L1_error)
13335 __Pyx_GOTREF(__pyx_t_1);
13336 __pyx_r = __pyx_t_1;
13342 __Pyx_XDECREF(__pyx_t_1);
13343 __Pyx_AddTraceback(
"PyClical.complexifier", __pyx_clineno, __pyx_lineno, __pyx_filename);
13346 __Pyx_XGIVEREF(__pyx_r);
13347 __Pyx_RefNannyFinishContext();
13359 static PyObject *__pyx_pw_8PyClical_45sqrt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13360 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) {
13361 PyObject *__pyx_v_i = ((PyObject *)Py_None);
13362 PyObject *__pyx_r = NULL;
13363 __Pyx_RefNannyDeclarations
13366 PyObject *__pyx_t_3 = NULL;
13368 PyObject *__pyx_t_5 = NULL;
13369 PyObject *__pyx_t_6 = NULL;
13370 PyObject *__pyx_t_7 = NULL;
13371 PyObject *__pyx_t_8 = NULL;
13372 PyObject *__pyx_t_9 = NULL;
13373 PyObject *__pyx_t_10 = NULL;
13374 PyObject *__pyx_t_11 = NULL;
13375 __Pyx_RefNannySetupContext(
"sqrt", 0);
13376 if (__pyx_optional_args) {
13377 if (__pyx_optional_args->__pyx_n > 0) {
13378 __pyx_v_i = __pyx_optional_args->i;
13389 __pyx_t_1 = (__pyx_v_i != Py_None);
13390 __pyx_t_2 = (__pyx_t_1 != 0);
13400 __Pyx_XDECREF(__pyx_r);
13401 __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)
13402 __Pyx_GOTREF(__pyx_t_3);
13404 __pyx_t_4 =
sqrt(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
13406 __Pyx_CppExn2PyErr();
13407 __PYX_ERR(0, 1558, __pyx_L1_error)
13409 __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)
13410 __Pyx_GOTREF(__pyx_t_5);
13411 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13412 __pyx_r = __pyx_t_5;
13434 __Pyx_PyThreadState_declare
13435 __Pyx_PyThreadState_assign
13436 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
13437 __Pyx_XGOTREF(__pyx_t_6);
13438 __Pyx_XGOTREF(__pyx_t_7);
13439 __Pyx_XGOTREF(__pyx_t_8);
13449 __Pyx_XDECREF(__pyx_r);
13450 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1561, __pyx_L4_error)
13451 __Pyx_GOTREF(__pyx_t_3);
13452 __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)
13453 __Pyx_GOTREF(__pyx_t_9);
13454 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13456 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
13457 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
13458 if (likely(__pyx_t_3)) {
13459 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
13460 __Pyx_INCREF(__pyx_t_3);
13461 __Pyx_INCREF(
function);
13462 __Pyx_DECREF_SET(__pyx_t_9,
function);
13466 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1561, __pyx_L4_error)
13467 __Pyx_GOTREF(__pyx_t_5);
13469 #if CYTHON_FAST_PYCALL 13470 if (PyFunction_Check(__pyx_t_9)) {
13471 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
13472 __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)
13473 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13474 __Pyx_GOTREF(__pyx_t_5);
13477 #if CYTHON_FAST_PYCCALL 13478 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
13479 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
13480 __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)
13481 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13482 __Pyx_GOTREF(__pyx_t_5);
13486 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1561, __pyx_L4_error)
13487 __Pyx_GOTREF(__pyx_t_10);
13488 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
13489 __Pyx_INCREF(__pyx_v_obj);
13490 __Pyx_GIVEREF(__pyx_v_obj);
13491 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
13492 __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)
13493 __Pyx_GOTREF(__pyx_t_5);
13494 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13497 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13498 __pyx_r = __pyx_t_5;
13500 goto __pyx_L8_try_return;
13511 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13512 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
13513 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
13514 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13524 __Pyx_AddTraceback(
"PyClical.sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename);
13525 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1562, __pyx_L6_except_error)
13526 __Pyx_GOTREF(__pyx_t_5);
13527 __Pyx_GOTREF(__pyx_t_9);
13528 __Pyx_GOTREF(__pyx_t_10);
13537 __Pyx_XDECREF(__pyx_r);
13538 __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)
13539 __Pyx_GOTREF(__pyx_t_3);
13540 __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)
13541 __Pyx_GOTREF(__pyx_t_11);
13542 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13543 __pyx_r = __pyx_t_11;
13545 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13546 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13547 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13548 goto __pyx_L7_except_return;
13550 __pyx_L6_except_error:;
13559 __Pyx_XGIVEREF(__pyx_t_6);
13560 __Pyx_XGIVEREF(__pyx_t_7);
13561 __Pyx_XGIVEREF(__pyx_t_8);
13562 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
13563 goto __pyx_L1_error;
13564 __pyx_L8_try_return:;
13565 __Pyx_XGIVEREF(__pyx_t_6);
13566 __Pyx_XGIVEREF(__pyx_t_7);
13567 __Pyx_XGIVEREF(__pyx_t_8);
13568 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
13570 __pyx_L7_except_return:;
13571 __Pyx_XGIVEREF(__pyx_t_6);
13572 __Pyx_XGIVEREF(__pyx_t_7);
13573 __Pyx_XGIVEREF(__pyx_t_8);
13574 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
13589 __Pyx_XDECREF(__pyx_t_3);
13590 __Pyx_XDECREF(__pyx_t_5);
13591 __Pyx_XDECREF(__pyx_t_9);
13592 __Pyx_XDECREF(__pyx_t_10);
13593 __Pyx_XDECREF(__pyx_t_11);
13594 __Pyx_AddTraceback(
"PyClical.sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename);
13597 __Pyx_XGIVEREF(__pyx_r);
13598 __Pyx_RefNannyFinishContext();
13603 static PyObject *__pyx_pw_8PyClical_45sqrt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13604 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 ";
13605 static PyObject *__pyx_pw_8PyClical_45sqrt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13606 PyObject *__pyx_v_obj = 0;
13607 PyObject *__pyx_v_i = 0;
13608 PyObject *__pyx_r = 0;
13609 __Pyx_RefNannyDeclarations
13610 __Pyx_RefNannySetupContext(
"sqrt (wrapper)", 0);
13612 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
13613 PyObject* values[2] = {0,0};
13614 values[1] = ((PyObject *)Py_None);
13615 if (unlikely(__pyx_kwds)) {
13616 Py_ssize_t kw_args;
13617 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13618 switch (pos_args) {
13619 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13620 CYTHON_FALLTHROUGH;
13621 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13622 CYTHON_FALLTHROUGH;
13624 default:
goto __pyx_L5_argtuple_error;
13626 kw_args = PyDict_Size(__pyx_kwds);
13627 switch (pos_args) {
13629 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
13630 else goto __pyx_L5_argtuple_error;
13631 CYTHON_FALLTHROUGH;
13634 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i);
13635 if (value) { values[1] = value; kw_args--; }
13638 if (unlikely(kw_args > 0)) {
13639 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"sqrt") < 0)) __PYX_ERR(0, 1542, __pyx_L3_error)
13642 switch (PyTuple_GET_SIZE(__pyx_args)) {
13643 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13644 CYTHON_FALLTHROUGH;
13645 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13647 default:
goto __pyx_L5_argtuple_error;
13650 __pyx_v_obj = values[0];
13651 __pyx_v_i = values[1];
13653 goto __pyx_L4_argument_unpacking_done;
13654 __pyx_L5_argtuple_error:;
13655 __Pyx_RaiseArgtupleInvalid(
"sqrt", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1542, __pyx_L3_error)
13657 __Pyx_AddTraceback(
"PyClical.sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename);
13658 __Pyx_RefNannyFinishContext();
13660 __pyx_L4_argument_unpacking_done:;
13661 __pyx_r = __pyx_pf_8PyClical_44sqrt(__pyx_self, __pyx_v_obj, __pyx_v_i);
13664 __Pyx_RefNannyFinishContext();
13668 static PyObject *__pyx_pf_8PyClical_44sqrt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
13669 PyObject *__pyx_r = NULL;
13670 __Pyx_RefNannyDeclarations
13671 PyObject *__pyx_t_1 = NULL;
13672 struct __pyx_opt_args_8PyClical_sqrt __pyx_t_2;
13673 __Pyx_RefNannySetupContext(
"sqrt", 0);
13674 __Pyx_XDECREF(__pyx_r);
13675 __pyx_t_2.__pyx_n = 1;
13676 __pyx_t_2.i = __pyx_v_i;
13677 __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)
13678 __Pyx_GOTREF(__pyx_t_1);
13679 __pyx_r = __pyx_t_1;
13685 __Pyx_XDECREF(__pyx_t_1);
13686 __Pyx_AddTraceback(
"PyClical.sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename);
13689 __Pyx_XGIVEREF(__pyx_r);
13690 __Pyx_RefNannyFinishContext();
13702 static PyObject *__pyx_pw_8PyClical_47exp(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13703 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_exp(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
13704 PyObject *__pyx_r = NULL;
13705 __Pyx_RefNannyDeclarations
13706 PyObject *__pyx_t_1 = NULL;
13707 PyObject *__pyx_t_2 = NULL;
13708 PyObject *__pyx_t_3 = NULL;
13709 PyObject *__pyx_t_4 = NULL;
13710 PyObject *__pyx_t_5 = NULL;
13711 PyObject *__pyx_t_6 = NULL;
13712 PyObject *__pyx_t_7 = NULL;
13713 PyObject *__pyx_t_8 = NULL;
13714 __Pyx_RefNannySetupContext(
"exp", 0);
13724 __Pyx_PyThreadState_declare
13725 __Pyx_PyThreadState_assign
13726 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
13727 __Pyx_XGOTREF(__pyx_t_1);
13728 __Pyx_XGOTREF(__pyx_t_2);
13729 __Pyx_XGOTREF(__pyx_t_3);
13739 __Pyx_XDECREF(__pyx_r);
13740 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1575, __pyx_L3_error)
13741 __Pyx_GOTREF(__pyx_t_5);
13742 __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)
13743 __Pyx_GOTREF(__pyx_t_6);
13744 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13746 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
13747 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
13748 if (likely(__pyx_t_5)) {
13749 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
13750 __Pyx_INCREF(__pyx_t_5);
13751 __Pyx_INCREF(
function);
13752 __Pyx_DECREF_SET(__pyx_t_6,
function);
13756 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_obj);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1575, __pyx_L3_error)
13757 __Pyx_GOTREF(__pyx_t_4);
13759 #if CYTHON_FAST_PYCALL 13760 if (PyFunction_Check(__pyx_t_6)) {
13761 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_obj};
13762 __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)
13763 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13764 __Pyx_GOTREF(__pyx_t_4);
13767 #if CYTHON_FAST_PYCCALL 13768 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
13769 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_obj};
13770 __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)
13771 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13772 __Pyx_GOTREF(__pyx_t_4);
13776 __pyx_t_7 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1575, __pyx_L3_error)
13777 __Pyx_GOTREF(__pyx_t_7);
13778 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
13779 __Pyx_INCREF(__pyx_v_obj);
13780 __Pyx_GIVEREF(__pyx_v_obj);
13781 PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_obj);
13782 __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)
13783 __Pyx_GOTREF(__pyx_t_4);
13784 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13787 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13788 __pyx_r = __pyx_t_4;
13790 goto __pyx_L7_try_return;
13801 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13802 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
13803 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
13804 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
13814 __Pyx_AddTraceback(
"PyClical.exp", __pyx_clineno, __pyx_lineno, __pyx_filename);
13815 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1576, __pyx_L5_except_error)
13816 __Pyx_GOTREF(__pyx_t_4);
13817 __Pyx_GOTREF(__pyx_t_6);
13818 __Pyx_GOTREF(__pyx_t_7);
13827 __Pyx_XDECREF(__pyx_r);
13828 __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)
13829 __Pyx_GOTREF(__pyx_t_5);
13830 __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)
13831 __Pyx_GOTREF(__pyx_t_8);
13832 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13833 __pyx_r = __pyx_t_8;
13835 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13836 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13837 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13838 goto __pyx_L6_except_return;
13840 __pyx_L5_except_error:;
13849 __Pyx_XGIVEREF(__pyx_t_1);
13850 __Pyx_XGIVEREF(__pyx_t_2);
13851 __Pyx_XGIVEREF(__pyx_t_3);
13852 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
13853 goto __pyx_L1_error;
13854 __pyx_L7_try_return:;
13855 __Pyx_XGIVEREF(__pyx_t_1);
13856 __Pyx_XGIVEREF(__pyx_t_2);
13857 __Pyx_XGIVEREF(__pyx_t_3);
13858 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
13860 __pyx_L6_except_return:;
13861 __Pyx_XGIVEREF(__pyx_t_1);
13862 __Pyx_XGIVEREF(__pyx_t_2);
13863 __Pyx_XGIVEREF(__pyx_t_3);
13864 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
13878 __Pyx_XDECREF(__pyx_t_4);
13879 __Pyx_XDECREF(__pyx_t_5);
13880 __Pyx_XDECREF(__pyx_t_6);
13881 __Pyx_XDECREF(__pyx_t_7);
13882 __Pyx_XDECREF(__pyx_t_8);
13883 __Pyx_AddTraceback(
"PyClical.exp", __pyx_clineno, __pyx_lineno, __pyx_filename);
13886 __Pyx_XGIVEREF(__pyx_r);
13887 __Pyx_RefNannyFinishContext();
13892 static PyObject *__pyx_pw_8PyClical_47exp(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13893 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 ";
13894 static PyObject *__pyx_pw_8PyClical_47exp(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13895 PyObject *__pyx_r = 0;
13896 __Pyx_RefNannyDeclarations
13897 __Pyx_RefNannySetupContext(
"exp (wrapper)", 0);
13898 __pyx_r = __pyx_pf_8PyClical_46exp(__pyx_self, ((PyObject *)__pyx_v_obj));
13901 __Pyx_RefNannyFinishContext();
13905 static PyObject *__pyx_pf_8PyClical_46exp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13906 PyObject *__pyx_r = NULL;
13907 __Pyx_RefNannyDeclarations
13908 PyObject *__pyx_t_1 = NULL;
13909 __Pyx_RefNannySetupContext(
"exp", 0);
13910 __Pyx_XDECREF(__pyx_r);
13911 __pyx_t_1 = __pyx_f_8PyClical_exp(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1565, __pyx_L1_error)
13912 __Pyx_GOTREF(__pyx_t_1);
13913 __pyx_r = __pyx_t_1;
13919 __Pyx_XDECREF(__pyx_t_1);
13920 __Pyx_AddTraceback(
"PyClical.exp", __pyx_clineno, __pyx_lineno, __pyx_filename);
13923 __Pyx_XGIVEREF(__pyx_r);
13924 __Pyx_RefNannyFinishContext();
13936 static PyObject *__pyx_pw_8PyClical_49log(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13937 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) {
13938 PyObject *__pyx_v_i = ((PyObject *)Py_None);
13939 PyObject *__pyx_r = NULL;
13940 __Pyx_RefNannyDeclarations
13943 PyObject *__pyx_t_3 = NULL;
13945 PyObject *__pyx_t_5 = NULL;
13946 PyObject *__pyx_t_6 = NULL;
13947 PyObject *__pyx_t_7 = NULL;
13948 PyObject *__pyx_t_8 = NULL;
13949 PyObject *__pyx_t_9 = NULL;
13950 PyObject *__pyx_t_10 = NULL;
13951 PyObject *__pyx_t_11 = NULL;
13952 __Pyx_RefNannySetupContext(
"log", 0);
13953 if (__pyx_optional_args) {
13954 if (__pyx_optional_args->__pyx_n > 0) {
13955 __pyx_v_i = __pyx_optional_args->i;
13966 __pyx_t_1 = (__pyx_v_i != Py_None);
13967 __pyx_t_2 = (__pyx_t_1 != 0);
13977 __Pyx_XDECREF(__pyx_r);
13978 __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)
13979 __Pyx_GOTREF(__pyx_t_3);
13981 __pyx_t_4 =
log(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
13983 __Pyx_CppExn2PyErr();
13984 __PYX_ERR(0, 1595, __pyx_L1_error)
13986 __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)
13987 __Pyx_GOTREF(__pyx_t_5);
13988 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13989 __pyx_r = __pyx_t_5;
14011 __Pyx_PyThreadState_declare
14012 __Pyx_PyThreadState_assign
14013 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
14014 __Pyx_XGOTREF(__pyx_t_6);
14015 __Pyx_XGOTREF(__pyx_t_7);
14016 __Pyx_XGOTREF(__pyx_t_8);
14026 __Pyx_XDECREF(__pyx_r);
14027 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1598, __pyx_L4_error)
14028 __Pyx_GOTREF(__pyx_t_3);
14029 __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)
14030 __Pyx_GOTREF(__pyx_t_9);
14031 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14033 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
14034 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
14035 if (likely(__pyx_t_3)) {
14036 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
14037 __Pyx_INCREF(__pyx_t_3);
14038 __Pyx_INCREF(
function);
14039 __Pyx_DECREF_SET(__pyx_t_9,
function);
14043 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1598, __pyx_L4_error)
14044 __Pyx_GOTREF(__pyx_t_5);
14046 #if CYTHON_FAST_PYCALL 14047 if (PyFunction_Check(__pyx_t_9)) {
14048 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
14049 __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)
14050 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14051 __Pyx_GOTREF(__pyx_t_5);
14054 #if CYTHON_FAST_PYCCALL 14055 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
14056 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
14057 __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)
14058 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14059 __Pyx_GOTREF(__pyx_t_5);
14063 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1598, __pyx_L4_error)
14064 __Pyx_GOTREF(__pyx_t_10);
14065 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
14066 __Pyx_INCREF(__pyx_v_obj);
14067 __Pyx_GIVEREF(__pyx_v_obj);
14068 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
14069 __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)
14070 __Pyx_GOTREF(__pyx_t_5);
14071 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14074 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14075 __pyx_r = __pyx_t_5;
14077 goto __pyx_L8_try_return;
14088 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14089 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
14090 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
14091 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14101 __Pyx_AddTraceback(
"PyClical.log", __pyx_clineno, __pyx_lineno, __pyx_filename);
14102 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1599, __pyx_L6_except_error)
14103 __Pyx_GOTREF(__pyx_t_5);
14104 __Pyx_GOTREF(__pyx_t_9);
14105 __Pyx_GOTREF(__pyx_t_10);
14114 __Pyx_XDECREF(__pyx_r);
14115 __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)
14116 __Pyx_GOTREF(__pyx_t_3);
14117 __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)
14118 __Pyx_GOTREF(__pyx_t_11);
14119 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14120 __pyx_r = __pyx_t_11;
14122 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14123 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14124 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14125 goto __pyx_L7_except_return;
14127 __pyx_L6_except_error:;
14136 __Pyx_XGIVEREF(__pyx_t_6);
14137 __Pyx_XGIVEREF(__pyx_t_7);
14138 __Pyx_XGIVEREF(__pyx_t_8);
14139 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14140 goto __pyx_L1_error;
14141 __pyx_L8_try_return:;
14142 __Pyx_XGIVEREF(__pyx_t_6);
14143 __Pyx_XGIVEREF(__pyx_t_7);
14144 __Pyx_XGIVEREF(__pyx_t_8);
14145 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14147 __pyx_L7_except_return:;
14148 __Pyx_XGIVEREF(__pyx_t_6);
14149 __Pyx_XGIVEREF(__pyx_t_7);
14150 __Pyx_XGIVEREF(__pyx_t_8);
14151 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14166 __Pyx_XDECREF(__pyx_t_3);
14167 __Pyx_XDECREF(__pyx_t_5);
14168 __Pyx_XDECREF(__pyx_t_9);
14169 __Pyx_XDECREF(__pyx_t_10);
14170 __Pyx_XDECREF(__pyx_t_11);
14171 __Pyx_AddTraceback(
"PyClical.log", __pyx_clineno, __pyx_lineno, __pyx_filename);
14174 __Pyx_XGIVEREF(__pyx_r);
14175 __Pyx_RefNannyFinishContext();
14180 static PyObject *__pyx_pw_8PyClical_49log(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14181 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 ";
14182 static PyObject *__pyx_pw_8PyClical_49log(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14183 PyObject *__pyx_v_obj = 0;
14184 PyObject *__pyx_v_i = 0;
14185 PyObject *__pyx_r = 0;
14186 __Pyx_RefNannyDeclarations
14187 __Pyx_RefNannySetupContext(
"log (wrapper)", 0);
14189 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
14190 PyObject* values[2] = {0,0};
14191 values[1] = ((PyObject *)Py_None);
14192 if (unlikely(__pyx_kwds)) {
14193 Py_ssize_t kw_args;
14194 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14195 switch (pos_args) {
14196 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14197 CYTHON_FALLTHROUGH;
14198 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14199 CYTHON_FALLTHROUGH;
14201 default:
goto __pyx_L5_argtuple_error;
14203 kw_args = PyDict_Size(__pyx_kwds);
14204 switch (pos_args) {
14206 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
14207 else goto __pyx_L5_argtuple_error;
14208 CYTHON_FALLTHROUGH;
14211 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i);
14212 if (value) { values[1] = value; kw_args--; }
14215 if (unlikely(kw_args > 0)) {
14216 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"log") < 0)) __PYX_ERR(0, 1579, __pyx_L3_error)
14219 switch (PyTuple_GET_SIZE(__pyx_args)) {
14220 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14221 CYTHON_FALLTHROUGH;
14222 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14224 default:
goto __pyx_L5_argtuple_error;
14227 __pyx_v_obj = values[0];
14228 __pyx_v_i = values[1];
14230 goto __pyx_L4_argument_unpacking_done;
14231 __pyx_L5_argtuple_error:;
14232 __Pyx_RaiseArgtupleInvalid(
"log", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1579, __pyx_L3_error)
14234 __Pyx_AddTraceback(
"PyClical.log", __pyx_clineno, __pyx_lineno, __pyx_filename);
14235 __Pyx_RefNannyFinishContext();
14237 __pyx_L4_argument_unpacking_done:;
14238 __pyx_r = __pyx_pf_8PyClical_48log(__pyx_self, __pyx_v_obj, __pyx_v_i);
14241 __Pyx_RefNannyFinishContext();
14245 static PyObject *__pyx_pf_8PyClical_48log(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
14246 PyObject *__pyx_r = NULL;
14247 __Pyx_RefNannyDeclarations
14248 PyObject *__pyx_t_1 = NULL;
14249 struct __pyx_opt_args_8PyClical_log __pyx_t_2;
14250 __Pyx_RefNannySetupContext(
"log", 0);
14251 __Pyx_XDECREF(__pyx_r);
14252 __pyx_t_2.__pyx_n = 1;
14253 __pyx_t_2.i = __pyx_v_i;
14254 __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)
14255 __Pyx_GOTREF(__pyx_t_1);
14256 __pyx_r = __pyx_t_1;
14262 __Pyx_XDECREF(__pyx_t_1);
14263 __Pyx_AddTraceback(
"PyClical.log", __pyx_clineno, __pyx_lineno, __pyx_filename);
14266 __Pyx_XGIVEREF(__pyx_r);
14267 __Pyx_RefNannyFinishContext();
14279 static PyObject *__pyx_pw_8PyClical_51cos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14280 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) {
14281 PyObject *__pyx_v_i = ((PyObject *)Py_None);
14282 PyObject *__pyx_r = NULL;
14283 __Pyx_RefNannyDeclarations
14286 PyObject *__pyx_t_3 = NULL;
14288 PyObject *__pyx_t_5 = NULL;
14289 PyObject *__pyx_t_6 = NULL;
14290 PyObject *__pyx_t_7 = NULL;
14291 PyObject *__pyx_t_8 = NULL;
14292 PyObject *__pyx_t_9 = NULL;
14293 PyObject *__pyx_t_10 = NULL;
14294 PyObject *__pyx_t_11 = NULL;
14295 __Pyx_RefNannySetupContext(
"cos", 0);
14296 if (__pyx_optional_args) {
14297 if (__pyx_optional_args->__pyx_n > 0) {
14298 __pyx_v_i = __pyx_optional_args->i;
14309 __pyx_t_1 = (__pyx_v_i != Py_None);
14310 __pyx_t_2 = (__pyx_t_1 != 0);
14320 __Pyx_XDECREF(__pyx_r);
14321 __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)
14322 __Pyx_GOTREF(__pyx_t_3);
14324 __pyx_t_4 =
cos(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
14326 __Pyx_CppExn2PyErr();
14327 __PYX_ERR(0, 1612, __pyx_L1_error)
14329 __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)
14330 __Pyx_GOTREF(__pyx_t_5);
14331 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14332 __pyx_r = __pyx_t_5;
14354 __Pyx_PyThreadState_declare
14355 __Pyx_PyThreadState_assign
14356 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
14357 __Pyx_XGOTREF(__pyx_t_6);
14358 __Pyx_XGOTREF(__pyx_t_7);
14359 __Pyx_XGOTREF(__pyx_t_8);
14369 __Pyx_XDECREF(__pyx_r);
14370 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1615, __pyx_L4_error)
14371 __Pyx_GOTREF(__pyx_t_3);
14372 __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)
14373 __Pyx_GOTREF(__pyx_t_9);
14374 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14376 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
14377 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
14378 if (likely(__pyx_t_3)) {
14379 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
14380 __Pyx_INCREF(__pyx_t_3);
14381 __Pyx_INCREF(
function);
14382 __Pyx_DECREF_SET(__pyx_t_9,
function);
14386 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1615, __pyx_L4_error)
14387 __Pyx_GOTREF(__pyx_t_5);
14389 #if CYTHON_FAST_PYCALL 14390 if (PyFunction_Check(__pyx_t_9)) {
14391 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
14392 __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)
14393 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14394 __Pyx_GOTREF(__pyx_t_5);
14397 #if CYTHON_FAST_PYCCALL 14398 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
14399 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
14400 __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)
14401 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14402 __Pyx_GOTREF(__pyx_t_5);
14406 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1615, __pyx_L4_error)
14407 __Pyx_GOTREF(__pyx_t_10);
14408 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
14409 __Pyx_INCREF(__pyx_v_obj);
14410 __Pyx_GIVEREF(__pyx_v_obj);
14411 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
14412 __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)
14413 __Pyx_GOTREF(__pyx_t_5);
14414 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14417 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14418 __pyx_r = __pyx_t_5;
14420 goto __pyx_L8_try_return;
14431 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14432 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
14433 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
14434 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14444 __Pyx_AddTraceback(
"PyClical.cos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14445 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1616, __pyx_L6_except_error)
14446 __Pyx_GOTREF(__pyx_t_5);
14447 __Pyx_GOTREF(__pyx_t_9);
14448 __Pyx_GOTREF(__pyx_t_10);
14457 __Pyx_XDECREF(__pyx_r);
14458 __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)
14459 __Pyx_GOTREF(__pyx_t_3);
14460 __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)
14461 __Pyx_GOTREF(__pyx_t_11);
14462 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14463 __pyx_r = __pyx_t_11;
14465 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14466 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14467 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14468 goto __pyx_L7_except_return;
14470 __pyx_L6_except_error:;
14479 __Pyx_XGIVEREF(__pyx_t_6);
14480 __Pyx_XGIVEREF(__pyx_t_7);
14481 __Pyx_XGIVEREF(__pyx_t_8);
14482 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14483 goto __pyx_L1_error;
14484 __pyx_L8_try_return:;
14485 __Pyx_XGIVEREF(__pyx_t_6);
14486 __Pyx_XGIVEREF(__pyx_t_7);
14487 __Pyx_XGIVEREF(__pyx_t_8);
14488 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14490 __pyx_L7_except_return:;
14491 __Pyx_XGIVEREF(__pyx_t_6);
14492 __Pyx_XGIVEREF(__pyx_t_7);
14493 __Pyx_XGIVEREF(__pyx_t_8);
14494 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14509 __Pyx_XDECREF(__pyx_t_3);
14510 __Pyx_XDECREF(__pyx_t_5);
14511 __Pyx_XDECREF(__pyx_t_9);
14512 __Pyx_XDECREF(__pyx_t_10);
14513 __Pyx_XDECREF(__pyx_t_11);
14514 __Pyx_AddTraceback(
"PyClical.cos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14517 __Pyx_XGIVEREF(__pyx_r);
14518 __Pyx_RefNannyFinishContext();
14523 static PyObject *__pyx_pw_8PyClical_51cos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14524 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 ";
14525 static PyObject *__pyx_pw_8PyClical_51cos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14526 PyObject *__pyx_v_obj = 0;
14527 PyObject *__pyx_v_i = 0;
14528 PyObject *__pyx_r = 0;
14529 __Pyx_RefNannyDeclarations
14530 __Pyx_RefNannySetupContext(
"cos (wrapper)", 0);
14532 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
14533 PyObject* values[2] = {0,0};
14534 values[1] = ((PyObject *)Py_None);
14535 if (unlikely(__pyx_kwds)) {
14536 Py_ssize_t kw_args;
14537 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14538 switch (pos_args) {
14539 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14540 CYTHON_FALLTHROUGH;
14541 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14542 CYTHON_FALLTHROUGH;
14544 default:
goto __pyx_L5_argtuple_error;
14546 kw_args = PyDict_Size(__pyx_kwds);
14547 switch (pos_args) {
14549 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
14550 else goto __pyx_L5_argtuple_error;
14551 CYTHON_FALLTHROUGH;
14554 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i);
14555 if (value) { values[1] = value; kw_args--; }
14558 if (unlikely(kw_args > 0)) {
14559 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"cos") < 0)) __PYX_ERR(0, 1602, __pyx_L3_error)
14562 switch (PyTuple_GET_SIZE(__pyx_args)) {
14563 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14564 CYTHON_FALLTHROUGH;
14565 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14567 default:
goto __pyx_L5_argtuple_error;
14570 __pyx_v_obj = values[0];
14571 __pyx_v_i = values[1];
14573 goto __pyx_L4_argument_unpacking_done;
14574 __pyx_L5_argtuple_error:;
14575 __Pyx_RaiseArgtupleInvalid(
"cos", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1602, __pyx_L3_error)
14577 __Pyx_AddTraceback(
"PyClical.cos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14578 __Pyx_RefNannyFinishContext();
14580 __pyx_L4_argument_unpacking_done:;
14581 __pyx_r = __pyx_pf_8PyClical_50cos(__pyx_self, __pyx_v_obj, __pyx_v_i);
14584 __Pyx_RefNannyFinishContext();
14588 static PyObject *__pyx_pf_8PyClical_50cos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
14589 PyObject *__pyx_r = NULL;
14590 __Pyx_RefNannyDeclarations
14591 PyObject *__pyx_t_1 = NULL;
14592 struct __pyx_opt_args_8PyClical_cos __pyx_t_2;
14593 __Pyx_RefNannySetupContext(
"cos", 0);
14594 __Pyx_XDECREF(__pyx_r);
14595 __pyx_t_2.__pyx_n = 1;
14596 __pyx_t_2.i = __pyx_v_i;
14597 __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)
14598 __Pyx_GOTREF(__pyx_t_1);
14599 __pyx_r = __pyx_t_1;
14605 __Pyx_XDECREF(__pyx_t_1);
14606 __Pyx_AddTraceback(
"PyClical.cos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14609 __Pyx_XGIVEREF(__pyx_r);
14610 __Pyx_RefNannyFinishContext();
14622 static PyObject *__pyx_pw_8PyClical_53acos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14623 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) {
14624 PyObject *__pyx_v_i = ((PyObject *)Py_None);
14625 PyObject *__pyx_r = NULL;
14626 __Pyx_RefNannyDeclarations
14629 PyObject *__pyx_t_3 = NULL;
14631 PyObject *__pyx_t_5 = NULL;
14632 PyObject *__pyx_t_6 = NULL;
14633 PyObject *__pyx_t_7 = NULL;
14634 PyObject *__pyx_t_8 = NULL;
14635 PyObject *__pyx_t_9 = NULL;
14636 PyObject *__pyx_t_10 = NULL;
14637 PyObject *__pyx_t_11 = NULL;
14638 __Pyx_RefNannySetupContext(
"acos", 0);
14639 if (__pyx_optional_args) {
14640 if (__pyx_optional_args->__pyx_n > 0) {
14641 __pyx_v_i = __pyx_optional_args->i;
14652 __pyx_t_1 = (__pyx_v_i != Py_None);
14653 __pyx_t_2 = (__pyx_t_1 != 0);
14663 __Pyx_XDECREF(__pyx_r);
14664 __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)
14665 __Pyx_GOTREF(__pyx_t_3);
14667 __pyx_t_4 =
acos(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
14669 __Pyx_CppExn2PyErr();
14670 __PYX_ERR(0, 1633, __pyx_L1_error)
14672 __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)
14673 __Pyx_GOTREF(__pyx_t_5);
14674 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14675 __pyx_r = __pyx_t_5;
14697 __Pyx_PyThreadState_declare
14698 __Pyx_PyThreadState_assign
14699 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
14700 __Pyx_XGOTREF(__pyx_t_6);
14701 __Pyx_XGOTREF(__pyx_t_7);
14702 __Pyx_XGOTREF(__pyx_t_8);
14712 __Pyx_XDECREF(__pyx_r);
14713 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1636, __pyx_L4_error)
14714 __Pyx_GOTREF(__pyx_t_3);
14715 __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)
14716 __Pyx_GOTREF(__pyx_t_9);
14717 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14719 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
14720 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
14721 if (likely(__pyx_t_3)) {
14722 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
14723 __Pyx_INCREF(__pyx_t_3);
14724 __Pyx_INCREF(
function);
14725 __Pyx_DECREF_SET(__pyx_t_9,
function);
14729 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1636, __pyx_L4_error)
14730 __Pyx_GOTREF(__pyx_t_5);
14732 #if CYTHON_FAST_PYCALL 14733 if (PyFunction_Check(__pyx_t_9)) {
14734 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
14735 __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)
14736 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14737 __Pyx_GOTREF(__pyx_t_5);
14740 #if CYTHON_FAST_PYCCALL 14741 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
14742 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
14743 __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)
14744 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14745 __Pyx_GOTREF(__pyx_t_5);
14749 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1636, __pyx_L4_error)
14750 __Pyx_GOTREF(__pyx_t_10);
14751 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
14752 __Pyx_INCREF(__pyx_v_obj);
14753 __Pyx_GIVEREF(__pyx_v_obj);
14754 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
14755 __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)
14756 __Pyx_GOTREF(__pyx_t_5);
14757 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14760 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14761 __pyx_r = __pyx_t_5;
14763 goto __pyx_L8_try_return;
14774 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14775 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
14776 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
14777 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14787 __Pyx_AddTraceback(
"PyClical.acos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14788 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1637, __pyx_L6_except_error)
14789 __Pyx_GOTREF(__pyx_t_5);
14790 __Pyx_GOTREF(__pyx_t_9);
14791 __Pyx_GOTREF(__pyx_t_10);
14800 __Pyx_XDECREF(__pyx_r);
14801 __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)
14802 __Pyx_GOTREF(__pyx_t_3);
14803 __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)
14804 __Pyx_GOTREF(__pyx_t_11);
14805 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14806 __pyx_r = __pyx_t_11;
14808 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14809 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14810 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14811 goto __pyx_L7_except_return;
14813 __pyx_L6_except_error:;
14822 __Pyx_XGIVEREF(__pyx_t_6);
14823 __Pyx_XGIVEREF(__pyx_t_7);
14824 __Pyx_XGIVEREF(__pyx_t_8);
14825 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14826 goto __pyx_L1_error;
14827 __pyx_L8_try_return:;
14828 __Pyx_XGIVEREF(__pyx_t_6);
14829 __Pyx_XGIVEREF(__pyx_t_7);
14830 __Pyx_XGIVEREF(__pyx_t_8);
14831 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14833 __pyx_L7_except_return:;
14834 __Pyx_XGIVEREF(__pyx_t_6);
14835 __Pyx_XGIVEREF(__pyx_t_7);
14836 __Pyx_XGIVEREF(__pyx_t_8);
14837 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14852 __Pyx_XDECREF(__pyx_t_3);
14853 __Pyx_XDECREF(__pyx_t_5);
14854 __Pyx_XDECREF(__pyx_t_9);
14855 __Pyx_XDECREF(__pyx_t_10);
14856 __Pyx_XDECREF(__pyx_t_11);
14857 __Pyx_AddTraceback(
"PyClical.acos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14860 __Pyx_XGIVEREF(__pyx_r);
14861 __Pyx_RefNannyFinishContext();
14866 static PyObject *__pyx_pw_8PyClical_53acos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14867 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 ";
14868 static PyObject *__pyx_pw_8PyClical_53acos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14869 PyObject *__pyx_v_obj = 0;
14870 PyObject *__pyx_v_i = 0;
14871 PyObject *__pyx_r = 0;
14872 __Pyx_RefNannyDeclarations
14873 __Pyx_RefNannySetupContext(
"acos (wrapper)", 0);
14875 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
14876 PyObject* values[2] = {0,0};
14877 values[1] = ((PyObject *)Py_None);
14878 if (unlikely(__pyx_kwds)) {
14879 Py_ssize_t kw_args;
14880 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14881 switch (pos_args) {
14882 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14883 CYTHON_FALLTHROUGH;
14884 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14885 CYTHON_FALLTHROUGH;
14887 default:
goto __pyx_L5_argtuple_error;
14889 kw_args = PyDict_Size(__pyx_kwds);
14890 switch (pos_args) {
14892 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
14893 else goto __pyx_L5_argtuple_error;
14894 CYTHON_FALLTHROUGH;
14897 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i);
14898 if (value) { values[1] = value; kw_args--; }
14901 if (unlikely(kw_args > 0)) {
14902 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"acos") < 0)) __PYX_ERR(0, 1619, __pyx_L3_error)
14905 switch (PyTuple_GET_SIZE(__pyx_args)) {
14906 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14907 CYTHON_FALLTHROUGH;
14908 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14910 default:
goto __pyx_L5_argtuple_error;
14913 __pyx_v_obj = values[0];
14914 __pyx_v_i = values[1];
14916 goto __pyx_L4_argument_unpacking_done;
14917 __pyx_L5_argtuple_error:;
14918 __Pyx_RaiseArgtupleInvalid(
"acos", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1619, __pyx_L3_error)
14920 __Pyx_AddTraceback(
"PyClical.acos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14921 __Pyx_RefNannyFinishContext();
14923 __pyx_L4_argument_unpacking_done:;
14924 __pyx_r = __pyx_pf_8PyClical_52acos(__pyx_self, __pyx_v_obj, __pyx_v_i);
14927 __Pyx_RefNannyFinishContext();
14931 static PyObject *__pyx_pf_8PyClical_52acos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
14932 PyObject *__pyx_r = NULL;
14933 __Pyx_RefNannyDeclarations
14934 PyObject *__pyx_t_1 = NULL;
14935 struct __pyx_opt_args_8PyClical_acos __pyx_t_2;
14936 __Pyx_RefNannySetupContext(
"acos", 0);
14937 __Pyx_XDECREF(__pyx_r);
14938 __pyx_t_2.__pyx_n = 1;
14939 __pyx_t_2.i = __pyx_v_i;
14940 __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)
14941 __Pyx_GOTREF(__pyx_t_1);
14942 __pyx_r = __pyx_t_1;
14948 __Pyx_XDECREF(__pyx_t_1);
14949 __Pyx_AddTraceback(
"PyClical.acos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14952 __Pyx_XGIVEREF(__pyx_r);
14953 __Pyx_RefNannyFinishContext();
14965 static PyObject *__pyx_pw_8PyClical_55cosh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
14966 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cosh(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
14967 PyObject *__pyx_r = NULL;
14968 __Pyx_RefNannyDeclarations
14969 PyObject *__pyx_t_1 = NULL;
14970 PyObject *__pyx_t_2 = NULL;
14971 PyObject *__pyx_t_3 = NULL;
14972 PyObject *__pyx_t_4 = NULL;
14973 PyObject *__pyx_t_5 = NULL;
14974 PyObject *__pyx_t_6 = NULL;
14975 PyObject *__pyx_t_7 = NULL;
14976 PyObject *__pyx_t_8 = NULL;
14977 __Pyx_RefNannySetupContext(
"cosh", 0);
14987 __Pyx_PyThreadState_declare
14988 __Pyx_PyThreadState_assign
14989 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
14990 __Pyx_XGOTREF(__pyx_t_1);
14991 __Pyx_XGOTREF(__pyx_t_2);
14992 __Pyx_XGOTREF(__pyx_t_3);
15002 __Pyx_XDECREF(__pyx_r);
15003 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1652, __pyx_L3_error)
15004 __Pyx_GOTREF(__pyx_t_5);
15005 __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)
15006 __Pyx_GOTREF(__pyx_t_6);
15007 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15009 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
15010 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
15011 if (likely(__pyx_t_5)) {
15012 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
15013 __Pyx_INCREF(__pyx_t_5);
15014 __Pyx_INCREF(
function);
15015 __Pyx_DECREF_SET(__pyx_t_6,
function);
15019 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_obj);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1652, __pyx_L3_error)
15020 __Pyx_GOTREF(__pyx_t_4);
15022 #if CYTHON_FAST_PYCALL 15023 if (PyFunction_Check(__pyx_t_6)) {
15024 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_obj};
15025 __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)
15026 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15027 __Pyx_GOTREF(__pyx_t_4);
15030 #if CYTHON_FAST_PYCCALL 15031 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
15032 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_obj};
15033 __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)
15034 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15035 __Pyx_GOTREF(__pyx_t_4);
15039 __pyx_t_7 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1652, __pyx_L3_error)
15040 __Pyx_GOTREF(__pyx_t_7);
15041 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
15042 __Pyx_INCREF(__pyx_v_obj);
15043 __Pyx_GIVEREF(__pyx_v_obj);
15044 PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_obj);
15045 __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)
15046 __Pyx_GOTREF(__pyx_t_4);
15047 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15050 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15051 __pyx_r = __pyx_t_4;
15053 goto __pyx_L7_try_return;
15064 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15065 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
15066 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
15067 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
15077 __Pyx_AddTraceback(
"PyClical.cosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15078 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1653, __pyx_L5_except_error)
15079 __Pyx_GOTREF(__pyx_t_4);
15080 __Pyx_GOTREF(__pyx_t_6);
15081 __Pyx_GOTREF(__pyx_t_7);
15090 __Pyx_XDECREF(__pyx_r);
15091 __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)
15092 __Pyx_GOTREF(__pyx_t_5);
15093 __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)
15094 __Pyx_GOTREF(__pyx_t_8);
15095 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15096 __pyx_r = __pyx_t_8;
15098 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15099 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15100 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15101 goto __pyx_L6_except_return;
15103 __pyx_L5_except_error:;
15112 __Pyx_XGIVEREF(__pyx_t_1);
15113 __Pyx_XGIVEREF(__pyx_t_2);
15114 __Pyx_XGIVEREF(__pyx_t_3);
15115 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
15116 goto __pyx_L1_error;
15117 __pyx_L7_try_return:;
15118 __Pyx_XGIVEREF(__pyx_t_1);
15119 __Pyx_XGIVEREF(__pyx_t_2);
15120 __Pyx_XGIVEREF(__pyx_t_3);
15121 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
15123 __pyx_L6_except_return:;
15124 __Pyx_XGIVEREF(__pyx_t_1);
15125 __Pyx_XGIVEREF(__pyx_t_2);
15126 __Pyx_XGIVEREF(__pyx_t_3);
15127 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
15141 __Pyx_XDECREF(__pyx_t_4);
15142 __Pyx_XDECREF(__pyx_t_5);
15143 __Pyx_XDECREF(__pyx_t_6);
15144 __Pyx_XDECREF(__pyx_t_7);
15145 __Pyx_XDECREF(__pyx_t_8);
15146 __Pyx_AddTraceback(
"PyClical.cosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15149 __Pyx_XGIVEREF(__pyx_r);
15150 __Pyx_RefNannyFinishContext();
15155 static PyObject *__pyx_pw_8PyClical_55cosh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
15156 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 ";
15157 static PyObject *__pyx_pw_8PyClical_55cosh(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
15158 PyObject *__pyx_r = 0;
15159 __Pyx_RefNannyDeclarations
15160 __Pyx_RefNannySetupContext(
"cosh (wrapper)", 0);
15161 __pyx_r = __pyx_pf_8PyClical_54cosh(__pyx_self, ((PyObject *)__pyx_v_obj));
15164 __Pyx_RefNannyFinishContext();
15168 static PyObject *__pyx_pf_8PyClical_54cosh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
15169 PyObject *__pyx_r = NULL;
15170 __Pyx_RefNannyDeclarations
15171 PyObject *__pyx_t_1 = NULL;
15172 __Pyx_RefNannySetupContext(
"cosh", 0);
15173 __Pyx_XDECREF(__pyx_r);
15174 __pyx_t_1 = __pyx_f_8PyClical_cosh(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1640, __pyx_L1_error)
15175 __Pyx_GOTREF(__pyx_t_1);
15176 __pyx_r = __pyx_t_1;
15182 __Pyx_XDECREF(__pyx_t_1);
15183 __Pyx_AddTraceback(
"PyClical.cosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15186 __Pyx_XGIVEREF(__pyx_r);
15187 __Pyx_RefNannyFinishContext();
15199 static PyObject *__pyx_pw_8PyClical_57acosh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15200 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) {
15201 PyObject *__pyx_v_i = ((PyObject *)Py_None);
15202 PyObject *__pyx_r = NULL;
15203 __Pyx_RefNannyDeclarations
15206 PyObject *__pyx_t_3 = NULL;
15208 PyObject *__pyx_t_5 = NULL;
15209 PyObject *__pyx_t_6 = NULL;
15210 PyObject *__pyx_t_7 = NULL;
15211 PyObject *__pyx_t_8 = NULL;
15212 PyObject *__pyx_t_9 = NULL;
15213 PyObject *__pyx_t_10 = NULL;
15214 PyObject *__pyx_t_11 = NULL;
15215 __Pyx_RefNannySetupContext(
"acosh", 0);
15216 if (__pyx_optional_args) {
15217 if (__pyx_optional_args->__pyx_n > 0) {
15218 __pyx_v_i = __pyx_optional_args->i;
15229 __pyx_t_1 = (__pyx_v_i != Py_None);
15230 __pyx_t_2 = (__pyx_t_1 != 0);
15240 __Pyx_XDECREF(__pyx_r);
15241 __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)
15242 __Pyx_GOTREF(__pyx_t_3);
15244 __pyx_t_4 =
acosh(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
15246 __Pyx_CppExn2PyErr();
15247 __PYX_ERR(0, 1672, __pyx_L1_error)
15249 __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)
15250 __Pyx_GOTREF(__pyx_t_5);
15251 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15252 __pyx_r = __pyx_t_5;
15274 __Pyx_PyThreadState_declare
15275 __Pyx_PyThreadState_assign
15276 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
15277 __Pyx_XGOTREF(__pyx_t_6);
15278 __Pyx_XGOTREF(__pyx_t_7);
15279 __Pyx_XGOTREF(__pyx_t_8);
15289 __Pyx_XDECREF(__pyx_r);
15290 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1675, __pyx_L4_error)
15291 __Pyx_GOTREF(__pyx_t_3);
15292 __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)
15293 __Pyx_GOTREF(__pyx_t_9);
15294 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15296 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
15297 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
15298 if (likely(__pyx_t_3)) {
15299 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
15300 __Pyx_INCREF(__pyx_t_3);
15301 __Pyx_INCREF(
function);
15302 __Pyx_DECREF_SET(__pyx_t_9,
function);
15306 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1675, __pyx_L4_error)
15307 __Pyx_GOTREF(__pyx_t_5);
15309 #if CYTHON_FAST_PYCALL 15310 if (PyFunction_Check(__pyx_t_9)) {
15311 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
15312 __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)
15313 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15314 __Pyx_GOTREF(__pyx_t_5);
15317 #if CYTHON_FAST_PYCCALL 15318 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
15319 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
15320 __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)
15321 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15322 __Pyx_GOTREF(__pyx_t_5);
15326 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1675, __pyx_L4_error)
15327 __Pyx_GOTREF(__pyx_t_10);
15328 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
15329 __Pyx_INCREF(__pyx_v_obj);
15330 __Pyx_GIVEREF(__pyx_v_obj);
15331 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
15332 __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)
15333 __Pyx_GOTREF(__pyx_t_5);
15334 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15337 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15338 __pyx_r = __pyx_t_5;
15340 goto __pyx_L8_try_return;
15351 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15352 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
15353 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
15354 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15364 __Pyx_AddTraceback(
"PyClical.acosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15365 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1676, __pyx_L6_except_error)
15366 __Pyx_GOTREF(__pyx_t_5);
15367 __Pyx_GOTREF(__pyx_t_9);
15368 __Pyx_GOTREF(__pyx_t_10);
15377 __Pyx_XDECREF(__pyx_r);
15378 __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)
15379 __Pyx_GOTREF(__pyx_t_3);
15380 __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)
15381 __Pyx_GOTREF(__pyx_t_11);
15382 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15383 __pyx_r = __pyx_t_11;
15385 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15386 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15387 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15388 goto __pyx_L7_except_return;
15390 __pyx_L6_except_error:;
15399 __Pyx_XGIVEREF(__pyx_t_6);
15400 __Pyx_XGIVEREF(__pyx_t_7);
15401 __Pyx_XGIVEREF(__pyx_t_8);
15402 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15403 goto __pyx_L1_error;
15404 __pyx_L8_try_return:;
15405 __Pyx_XGIVEREF(__pyx_t_6);
15406 __Pyx_XGIVEREF(__pyx_t_7);
15407 __Pyx_XGIVEREF(__pyx_t_8);
15408 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15410 __pyx_L7_except_return:;
15411 __Pyx_XGIVEREF(__pyx_t_6);
15412 __Pyx_XGIVEREF(__pyx_t_7);
15413 __Pyx_XGIVEREF(__pyx_t_8);
15414 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15429 __Pyx_XDECREF(__pyx_t_3);
15430 __Pyx_XDECREF(__pyx_t_5);
15431 __Pyx_XDECREF(__pyx_t_9);
15432 __Pyx_XDECREF(__pyx_t_10);
15433 __Pyx_XDECREF(__pyx_t_11);
15434 __Pyx_AddTraceback(
"PyClical.acosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15437 __Pyx_XGIVEREF(__pyx_r);
15438 __Pyx_RefNannyFinishContext();
15443 static PyObject *__pyx_pw_8PyClical_57acosh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15444 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 ";
15445 static PyObject *__pyx_pw_8PyClical_57acosh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15446 PyObject *__pyx_v_obj = 0;
15447 PyObject *__pyx_v_i = 0;
15448 PyObject *__pyx_r = 0;
15449 __Pyx_RefNannyDeclarations
15450 __Pyx_RefNannySetupContext(
"acosh (wrapper)", 0);
15452 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
15453 PyObject* values[2] = {0,0};
15454 values[1] = ((PyObject *)Py_None);
15455 if (unlikely(__pyx_kwds)) {
15456 Py_ssize_t kw_args;
15457 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15458 switch (pos_args) {
15459 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15460 CYTHON_FALLTHROUGH;
15461 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15462 CYTHON_FALLTHROUGH;
15464 default:
goto __pyx_L5_argtuple_error;
15466 kw_args = PyDict_Size(__pyx_kwds);
15467 switch (pos_args) {
15469 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
15470 else goto __pyx_L5_argtuple_error;
15471 CYTHON_FALLTHROUGH;
15474 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i);
15475 if (value) { values[1] = value; kw_args--; }
15478 if (unlikely(kw_args > 0)) {
15479 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"acosh") < 0)) __PYX_ERR(0, 1656, __pyx_L3_error)
15482 switch (PyTuple_GET_SIZE(__pyx_args)) {
15483 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15484 CYTHON_FALLTHROUGH;
15485 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15487 default:
goto __pyx_L5_argtuple_error;
15490 __pyx_v_obj = values[0];
15491 __pyx_v_i = values[1];
15493 goto __pyx_L4_argument_unpacking_done;
15494 __pyx_L5_argtuple_error:;
15495 __Pyx_RaiseArgtupleInvalid(
"acosh", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1656, __pyx_L3_error)
15497 __Pyx_AddTraceback(
"PyClical.acosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15498 __Pyx_RefNannyFinishContext();
15500 __pyx_L4_argument_unpacking_done:;
15501 __pyx_r = __pyx_pf_8PyClical_56acosh(__pyx_self, __pyx_v_obj, __pyx_v_i);
15504 __Pyx_RefNannyFinishContext();
15508 static PyObject *__pyx_pf_8PyClical_56acosh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
15509 PyObject *__pyx_r = NULL;
15510 __Pyx_RefNannyDeclarations
15511 PyObject *__pyx_t_1 = NULL;
15512 struct __pyx_opt_args_8PyClical_acosh __pyx_t_2;
15513 __Pyx_RefNannySetupContext(
"acosh", 0);
15514 __Pyx_XDECREF(__pyx_r);
15515 __pyx_t_2.__pyx_n = 1;
15516 __pyx_t_2.i = __pyx_v_i;
15517 __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)
15518 __Pyx_GOTREF(__pyx_t_1);
15519 __pyx_r = __pyx_t_1;
15525 __Pyx_XDECREF(__pyx_t_1);
15526 __Pyx_AddTraceback(
"PyClical.acosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15529 __Pyx_XGIVEREF(__pyx_r);
15530 __Pyx_RefNannyFinishContext();
15542 static PyObject *__pyx_pw_8PyClical_59sin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15543 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) {
15544 PyObject *__pyx_v_i = ((PyObject *)Py_None);
15545 PyObject *__pyx_r = NULL;
15546 __Pyx_RefNannyDeclarations
15549 PyObject *__pyx_t_3 = NULL;
15551 PyObject *__pyx_t_5 = NULL;
15552 PyObject *__pyx_t_6 = NULL;
15553 PyObject *__pyx_t_7 = NULL;
15554 PyObject *__pyx_t_8 = NULL;
15555 PyObject *__pyx_t_9 = NULL;
15556 PyObject *__pyx_t_10 = NULL;
15557 PyObject *__pyx_t_11 = NULL;
15558 __Pyx_RefNannySetupContext(
"sin", 0);
15559 if (__pyx_optional_args) {
15560 if (__pyx_optional_args->__pyx_n > 0) {
15561 __pyx_v_i = __pyx_optional_args->i;
15572 __pyx_t_1 = (__pyx_v_i != Py_None);
15573 __pyx_t_2 = (__pyx_t_1 != 0);
15583 __Pyx_XDECREF(__pyx_r);
15584 __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)
15585 __Pyx_GOTREF(__pyx_t_3);
15587 __pyx_t_4 =
sin(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
15589 __Pyx_CppExn2PyErr();
15590 __PYX_ERR(0, 1691, __pyx_L1_error)
15592 __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)
15593 __Pyx_GOTREF(__pyx_t_5);
15594 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15595 __pyx_r = __pyx_t_5;
15617 __Pyx_PyThreadState_declare
15618 __Pyx_PyThreadState_assign
15619 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
15620 __Pyx_XGOTREF(__pyx_t_6);
15621 __Pyx_XGOTREF(__pyx_t_7);
15622 __Pyx_XGOTREF(__pyx_t_8);
15632 __Pyx_XDECREF(__pyx_r);
15633 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1694, __pyx_L4_error)
15634 __Pyx_GOTREF(__pyx_t_3);
15635 __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)
15636 __Pyx_GOTREF(__pyx_t_9);
15637 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15639 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
15640 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
15641 if (likely(__pyx_t_3)) {
15642 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
15643 __Pyx_INCREF(__pyx_t_3);
15644 __Pyx_INCREF(
function);
15645 __Pyx_DECREF_SET(__pyx_t_9,
function);
15649 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1694, __pyx_L4_error)
15650 __Pyx_GOTREF(__pyx_t_5);
15652 #if CYTHON_FAST_PYCALL 15653 if (PyFunction_Check(__pyx_t_9)) {
15654 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
15655 __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)
15656 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15657 __Pyx_GOTREF(__pyx_t_5);
15660 #if CYTHON_FAST_PYCCALL 15661 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
15662 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
15663 __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)
15664 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15665 __Pyx_GOTREF(__pyx_t_5);
15669 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1694, __pyx_L4_error)
15670 __Pyx_GOTREF(__pyx_t_10);
15671 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
15672 __Pyx_INCREF(__pyx_v_obj);
15673 __Pyx_GIVEREF(__pyx_v_obj);
15674 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
15675 __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)
15676 __Pyx_GOTREF(__pyx_t_5);
15677 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15680 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15681 __pyx_r = __pyx_t_5;
15683 goto __pyx_L8_try_return;
15694 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15695 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
15696 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
15697 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15707 __Pyx_AddTraceback(
"PyClical.sin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15708 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1695, __pyx_L6_except_error)
15709 __Pyx_GOTREF(__pyx_t_5);
15710 __Pyx_GOTREF(__pyx_t_9);
15711 __Pyx_GOTREF(__pyx_t_10);
15720 __Pyx_XDECREF(__pyx_r);
15721 __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)
15722 __Pyx_GOTREF(__pyx_t_3);
15723 __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)
15724 __Pyx_GOTREF(__pyx_t_11);
15725 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15726 __pyx_r = __pyx_t_11;
15728 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15729 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15730 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15731 goto __pyx_L7_except_return;
15733 __pyx_L6_except_error:;
15742 __Pyx_XGIVEREF(__pyx_t_6);
15743 __Pyx_XGIVEREF(__pyx_t_7);
15744 __Pyx_XGIVEREF(__pyx_t_8);
15745 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15746 goto __pyx_L1_error;
15747 __pyx_L8_try_return:;
15748 __Pyx_XGIVEREF(__pyx_t_6);
15749 __Pyx_XGIVEREF(__pyx_t_7);
15750 __Pyx_XGIVEREF(__pyx_t_8);
15751 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15753 __pyx_L7_except_return:;
15754 __Pyx_XGIVEREF(__pyx_t_6);
15755 __Pyx_XGIVEREF(__pyx_t_7);
15756 __Pyx_XGIVEREF(__pyx_t_8);
15757 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15772 __Pyx_XDECREF(__pyx_t_3);
15773 __Pyx_XDECREF(__pyx_t_5);
15774 __Pyx_XDECREF(__pyx_t_9);
15775 __Pyx_XDECREF(__pyx_t_10);
15776 __Pyx_XDECREF(__pyx_t_11);
15777 __Pyx_AddTraceback(
"PyClical.sin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15780 __Pyx_XGIVEREF(__pyx_r);
15781 __Pyx_RefNannyFinishContext();
15786 static PyObject *__pyx_pw_8PyClical_59sin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15787 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 ";
15788 static PyObject *__pyx_pw_8PyClical_59sin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15789 PyObject *__pyx_v_obj = 0;
15790 PyObject *__pyx_v_i = 0;
15791 PyObject *__pyx_r = 0;
15792 __Pyx_RefNannyDeclarations
15793 __Pyx_RefNannySetupContext(
"sin (wrapper)", 0);
15795 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
15796 PyObject* values[2] = {0,0};
15797 values[1] = ((PyObject *)Py_None);
15798 if (unlikely(__pyx_kwds)) {
15799 Py_ssize_t kw_args;
15800 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15801 switch (pos_args) {
15802 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15803 CYTHON_FALLTHROUGH;
15804 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15805 CYTHON_FALLTHROUGH;
15807 default:
goto __pyx_L5_argtuple_error;
15809 kw_args = PyDict_Size(__pyx_kwds);
15810 switch (pos_args) {
15812 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
15813 else goto __pyx_L5_argtuple_error;
15814 CYTHON_FALLTHROUGH;
15817 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i);
15818 if (value) { values[1] = value; kw_args--; }
15821 if (unlikely(kw_args > 0)) {
15822 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"sin") < 0)) __PYX_ERR(0, 1679, __pyx_L3_error)
15825 switch (PyTuple_GET_SIZE(__pyx_args)) {
15826 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15827 CYTHON_FALLTHROUGH;
15828 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15830 default:
goto __pyx_L5_argtuple_error;
15833 __pyx_v_obj = values[0];
15834 __pyx_v_i = values[1];
15836 goto __pyx_L4_argument_unpacking_done;
15837 __pyx_L5_argtuple_error:;
15838 __Pyx_RaiseArgtupleInvalid(
"sin", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1679, __pyx_L3_error)
15840 __Pyx_AddTraceback(
"PyClical.sin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15841 __Pyx_RefNannyFinishContext();
15843 __pyx_L4_argument_unpacking_done:;
15844 __pyx_r = __pyx_pf_8PyClical_58sin(__pyx_self, __pyx_v_obj, __pyx_v_i);
15847 __Pyx_RefNannyFinishContext();
15851 static PyObject *__pyx_pf_8PyClical_58sin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
15852 PyObject *__pyx_r = NULL;
15853 __Pyx_RefNannyDeclarations
15854 PyObject *__pyx_t_1 = NULL;
15855 struct __pyx_opt_args_8PyClical_sin __pyx_t_2;
15856 __Pyx_RefNannySetupContext(
"sin", 0);
15857 __Pyx_XDECREF(__pyx_r);
15858 __pyx_t_2.__pyx_n = 1;
15859 __pyx_t_2.i = __pyx_v_i;
15860 __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)
15861 __Pyx_GOTREF(__pyx_t_1);
15862 __pyx_r = __pyx_t_1;
15868 __Pyx_XDECREF(__pyx_t_1);
15869 __Pyx_AddTraceback(
"PyClical.sin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15872 __Pyx_XGIVEREF(__pyx_r);
15873 __Pyx_RefNannyFinishContext();
15885 static PyObject *__pyx_pw_8PyClical_61asin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15886 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) {
15887 PyObject *__pyx_v_i = ((PyObject *)Py_None);
15888 PyObject *__pyx_r = NULL;
15889 __Pyx_RefNannyDeclarations
15892 PyObject *__pyx_t_3 = NULL;
15894 PyObject *__pyx_t_5 = NULL;
15895 PyObject *__pyx_t_6 = NULL;
15896 PyObject *__pyx_t_7 = NULL;
15897 PyObject *__pyx_t_8 = NULL;
15898 PyObject *__pyx_t_9 = NULL;
15899 PyObject *__pyx_t_10 = NULL;
15900 PyObject *__pyx_t_11 = NULL;
15901 __Pyx_RefNannySetupContext(
"asin", 0);
15902 if (__pyx_optional_args) {
15903 if (__pyx_optional_args->__pyx_n > 0) {
15904 __pyx_v_i = __pyx_optional_args->i;
15915 __pyx_t_1 = (__pyx_v_i != Py_None);
15916 __pyx_t_2 = (__pyx_t_1 != 0);
15926 __Pyx_XDECREF(__pyx_r);
15927 __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)
15928 __Pyx_GOTREF(__pyx_t_3);
15930 __pyx_t_4 =
asin(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
15932 __Pyx_CppExn2PyErr();
15933 __PYX_ERR(0, 1712, __pyx_L1_error)
15935 __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)
15936 __Pyx_GOTREF(__pyx_t_5);
15937 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15938 __pyx_r = __pyx_t_5;
15960 __Pyx_PyThreadState_declare
15961 __Pyx_PyThreadState_assign
15962 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
15963 __Pyx_XGOTREF(__pyx_t_6);
15964 __Pyx_XGOTREF(__pyx_t_7);
15965 __Pyx_XGOTREF(__pyx_t_8);
15975 __Pyx_XDECREF(__pyx_r);
15976 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1715, __pyx_L4_error)
15977 __Pyx_GOTREF(__pyx_t_3);
15978 __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)
15979 __Pyx_GOTREF(__pyx_t_9);
15980 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15982 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
15983 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
15984 if (likely(__pyx_t_3)) {
15985 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
15986 __Pyx_INCREF(__pyx_t_3);
15987 __Pyx_INCREF(
function);
15988 __Pyx_DECREF_SET(__pyx_t_9,
function);
15992 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1715, __pyx_L4_error)
15993 __Pyx_GOTREF(__pyx_t_5);
15995 #if CYTHON_FAST_PYCALL 15996 if (PyFunction_Check(__pyx_t_9)) {
15997 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
15998 __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)
15999 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16000 __Pyx_GOTREF(__pyx_t_5);
16003 #if CYTHON_FAST_PYCCALL 16004 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
16005 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
16006 __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)
16007 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16008 __Pyx_GOTREF(__pyx_t_5);
16012 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1715, __pyx_L4_error)
16013 __Pyx_GOTREF(__pyx_t_10);
16014 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
16015 __Pyx_INCREF(__pyx_v_obj);
16016 __Pyx_GIVEREF(__pyx_v_obj);
16017 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
16018 __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)
16019 __Pyx_GOTREF(__pyx_t_5);
16020 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16023 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16024 __pyx_r = __pyx_t_5;
16026 goto __pyx_L8_try_return;
16037 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16038 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
16039 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
16040 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16050 __Pyx_AddTraceback(
"PyClical.asin", __pyx_clineno, __pyx_lineno, __pyx_filename);
16051 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1716, __pyx_L6_except_error)
16052 __Pyx_GOTREF(__pyx_t_5);
16053 __Pyx_GOTREF(__pyx_t_9);
16054 __Pyx_GOTREF(__pyx_t_10);
16063 __Pyx_XDECREF(__pyx_r);
16064 __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)
16065 __Pyx_GOTREF(__pyx_t_3);
16066 __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)
16067 __Pyx_GOTREF(__pyx_t_11);
16068 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16069 __pyx_r = __pyx_t_11;
16071 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16072 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16073 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16074 goto __pyx_L7_except_return;
16076 __pyx_L6_except_error:;
16085 __Pyx_XGIVEREF(__pyx_t_6);
16086 __Pyx_XGIVEREF(__pyx_t_7);
16087 __Pyx_XGIVEREF(__pyx_t_8);
16088 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16089 goto __pyx_L1_error;
16090 __pyx_L8_try_return:;
16091 __Pyx_XGIVEREF(__pyx_t_6);
16092 __Pyx_XGIVEREF(__pyx_t_7);
16093 __Pyx_XGIVEREF(__pyx_t_8);
16094 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16096 __pyx_L7_except_return:;
16097 __Pyx_XGIVEREF(__pyx_t_6);
16098 __Pyx_XGIVEREF(__pyx_t_7);
16099 __Pyx_XGIVEREF(__pyx_t_8);
16100 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16115 __Pyx_XDECREF(__pyx_t_3);
16116 __Pyx_XDECREF(__pyx_t_5);
16117 __Pyx_XDECREF(__pyx_t_9);
16118 __Pyx_XDECREF(__pyx_t_10);
16119 __Pyx_XDECREF(__pyx_t_11);
16120 __Pyx_AddTraceback(
"PyClical.asin", __pyx_clineno, __pyx_lineno, __pyx_filename);
16123 __Pyx_XGIVEREF(__pyx_r);
16124 __Pyx_RefNannyFinishContext();
16129 static PyObject *__pyx_pw_8PyClical_61asin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16130 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 ";
16131 static PyObject *__pyx_pw_8PyClical_61asin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16132 PyObject *__pyx_v_obj = 0;
16133 PyObject *__pyx_v_i = 0;
16134 PyObject *__pyx_r = 0;
16135 __Pyx_RefNannyDeclarations
16136 __Pyx_RefNannySetupContext(
"asin (wrapper)", 0);
16138 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
16139 PyObject* values[2] = {0,0};
16140 values[1] = ((PyObject *)Py_None);
16141 if (unlikely(__pyx_kwds)) {
16142 Py_ssize_t kw_args;
16143 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16144 switch (pos_args) {
16145 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16146 CYTHON_FALLTHROUGH;
16147 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16148 CYTHON_FALLTHROUGH;
16150 default:
goto __pyx_L5_argtuple_error;
16152 kw_args = PyDict_Size(__pyx_kwds);
16153 switch (pos_args) {
16155 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
16156 else goto __pyx_L5_argtuple_error;
16157 CYTHON_FALLTHROUGH;
16160 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i);
16161 if (value) { values[1] = value; kw_args--; }
16164 if (unlikely(kw_args > 0)) {
16165 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"asin") < 0)) __PYX_ERR(0, 1698, __pyx_L3_error)
16168 switch (PyTuple_GET_SIZE(__pyx_args)) {
16169 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16170 CYTHON_FALLTHROUGH;
16171 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16173 default:
goto __pyx_L5_argtuple_error;
16176 __pyx_v_obj = values[0];
16177 __pyx_v_i = values[1];
16179 goto __pyx_L4_argument_unpacking_done;
16180 __pyx_L5_argtuple_error:;
16181 __Pyx_RaiseArgtupleInvalid(
"asin", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1698, __pyx_L3_error)
16183 __Pyx_AddTraceback(
"PyClical.asin", __pyx_clineno, __pyx_lineno, __pyx_filename);
16184 __Pyx_RefNannyFinishContext();
16186 __pyx_L4_argument_unpacking_done:;
16187 __pyx_r = __pyx_pf_8PyClical_60asin(__pyx_self, __pyx_v_obj, __pyx_v_i);
16190 __Pyx_RefNannyFinishContext();
16194 static PyObject *__pyx_pf_8PyClical_60asin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
16195 PyObject *__pyx_r = NULL;
16196 __Pyx_RefNannyDeclarations
16197 PyObject *__pyx_t_1 = NULL;
16198 struct __pyx_opt_args_8PyClical_asin __pyx_t_2;
16199 __Pyx_RefNannySetupContext(
"asin", 0);
16200 __Pyx_XDECREF(__pyx_r);
16201 __pyx_t_2.__pyx_n = 1;
16202 __pyx_t_2.i = __pyx_v_i;
16203 __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)
16204 __Pyx_GOTREF(__pyx_t_1);
16205 __pyx_r = __pyx_t_1;
16211 __Pyx_XDECREF(__pyx_t_1);
16212 __Pyx_AddTraceback(
"PyClical.asin", __pyx_clineno, __pyx_lineno, __pyx_filename);
16215 __Pyx_XGIVEREF(__pyx_r);
16216 __Pyx_RefNannyFinishContext();
16228 static PyObject *__pyx_pw_8PyClical_63sinh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
16229 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_sinh(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
16230 PyObject *__pyx_r = NULL;
16231 __Pyx_RefNannyDeclarations
16232 PyObject *__pyx_t_1 = NULL;
16233 PyObject *__pyx_t_2 = NULL;
16234 PyObject *__pyx_t_3 = NULL;
16235 PyObject *__pyx_t_4 = NULL;
16236 PyObject *__pyx_t_5 = NULL;
16237 PyObject *__pyx_t_6 = NULL;
16238 PyObject *__pyx_t_7 = NULL;
16239 PyObject *__pyx_t_8 = NULL;
16240 __Pyx_RefNannySetupContext(
"sinh", 0);
16250 __Pyx_PyThreadState_declare
16251 __Pyx_PyThreadState_assign
16252 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
16253 __Pyx_XGOTREF(__pyx_t_1);
16254 __Pyx_XGOTREF(__pyx_t_2);
16255 __Pyx_XGOTREF(__pyx_t_3);
16265 __Pyx_XDECREF(__pyx_r);
16266 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1729, __pyx_L3_error)
16267 __Pyx_GOTREF(__pyx_t_5);
16268 __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)
16269 __Pyx_GOTREF(__pyx_t_6);
16270 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16272 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
16273 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
16274 if (likely(__pyx_t_5)) {
16275 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
16276 __Pyx_INCREF(__pyx_t_5);
16277 __Pyx_INCREF(
function);
16278 __Pyx_DECREF_SET(__pyx_t_6,
function);
16282 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_obj);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1729, __pyx_L3_error)
16283 __Pyx_GOTREF(__pyx_t_4);
16285 #if CYTHON_FAST_PYCALL 16286 if (PyFunction_Check(__pyx_t_6)) {
16287 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_obj};
16288 __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)
16289 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16290 __Pyx_GOTREF(__pyx_t_4);
16293 #if CYTHON_FAST_PYCCALL 16294 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
16295 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_obj};
16296 __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)
16297 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16298 __Pyx_GOTREF(__pyx_t_4);
16302 __pyx_t_7 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1729, __pyx_L3_error)
16303 __Pyx_GOTREF(__pyx_t_7);
16304 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
16305 __Pyx_INCREF(__pyx_v_obj);
16306 __Pyx_GIVEREF(__pyx_v_obj);
16307 PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_obj);
16308 __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)
16309 __Pyx_GOTREF(__pyx_t_4);
16310 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16313 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16314 __pyx_r = __pyx_t_4;
16316 goto __pyx_L7_try_return;
16327 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16328 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
16329 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
16330 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
16340 __Pyx_AddTraceback(
"PyClical.sinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16341 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1730, __pyx_L5_except_error)
16342 __Pyx_GOTREF(__pyx_t_4);
16343 __Pyx_GOTREF(__pyx_t_6);
16344 __Pyx_GOTREF(__pyx_t_7);
16353 __Pyx_XDECREF(__pyx_r);
16354 __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)
16355 __Pyx_GOTREF(__pyx_t_5);
16356 __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)
16357 __Pyx_GOTREF(__pyx_t_8);
16358 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16359 __pyx_r = __pyx_t_8;
16361 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16362 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16363 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16364 goto __pyx_L6_except_return;
16366 __pyx_L5_except_error:;
16375 __Pyx_XGIVEREF(__pyx_t_1);
16376 __Pyx_XGIVEREF(__pyx_t_2);
16377 __Pyx_XGIVEREF(__pyx_t_3);
16378 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
16379 goto __pyx_L1_error;
16380 __pyx_L7_try_return:;
16381 __Pyx_XGIVEREF(__pyx_t_1);
16382 __Pyx_XGIVEREF(__pyx_t_2);
16383 __Pyx_XGIVEREF(__pyx_t_3);
16384 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
16386 __pyx_L6_except_return:;
16387 __Pyx_XGIVEREF(__pyx_t_1);
16388 __Pyx_XGIVEREF(__pyx_t_2);
16389 __Pyx_XGIVEREF(__pyx_t_3);
16390 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
16404 __Pyx_XDECREF(__pyx_t_4);
16405 __Pyx_XDECREF(__pyx_t_5);
16406 __Pyx_XDECREF(__pyx_t_6);
16407 __Pyx_XDECREF(__pyx_t_7);
16408 __Pyx_XDECREF(__pyx_t_8);
16409 __Pyx_AddTraceback(
"PyClical.sinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16412 __Pyx_XGIVEREF(__pyx_r);
16413 __Pyx_RefNannyFinishContext();
16418 static PyObject *__pyx_pw_8PyClical_63sinh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
16419 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 ";
16420 static PyObject *__pyx_pw_8PyClical_63sinh(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
16421 PyObject *__pyx_r = 0;
16422 __Pyx_RefNannyDeclarations
16423 __Pyx_RefNannySetupContext(
"sinh (wrapper)", 0);
16424 __pyx_r = __pyx_pf_8PyClical_62sinh(__pyx_self, ((PyObject *)__pyx_v_obj));
16427 __Pyx_RefNannyFinishContext();
16431 static PyObject *__pyx_pf_8PyClical_62sinh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
16432 PyObject *__pyx_r = NULL;
16433 __Pyx_RefNannyDeclarations
16434 PyObject *__pyx_t_1 = NULL;
16435 __Pyx_RefNannySetupContext(
"sinh", 0);
16436 __Pyx_XDECREF(__pyx_r);
16437 __pyx_t_1 = __pyx_f_8PyClical_sinh(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1719, __pyx_L1_error)
16438 __Pyx_GOTREF(__pyx_t_1);
16439 __pyx_r = __pyx_t_1;
16445 __Pyx_XDECREF(__pyx_t_1);
16446 __Pyx_AddTraceback(
"PyClical.sinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16449 __Pyx_XGIVEREF(__pyx_r);
16450 __Pyx_RefNannyFinishContext();
16462 static PyObject *__pyx_pw_8PyClical_65asinh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16463 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) {
16464 PyObject *__pyx_v_i = ((PyObject *)Py_None);
16465 PyObject *__pyx_r = NULL;
16466 __Pyx_RefNannyDeclarations
16469 PyObject *__pyx_t_3 = NULL;
16471 PyObject *__pyx_t_5 = NULL;
16472 PyObject *__pyx_t_6 = NULL;
16473 PyObject *__pyx_t_7 = NULL;
16474 PyObject *__pyx_t_8 = NULL;
16475 PyObject *__pyx_t_9 = NULL;
16476 PyObject *__pyx_t_10 = NULL;
16477 PyObject *__pyx_t_11 = NULL;
16478 __Pyx_RefNannySetupContext(
"asinh", 0);
16479 if (__pyx_optional_args) {
16480 if (__pyx_optional_args->__pyx_n > 0) {
16481 __pyx_v_i = __pyx_optional_args->i;
16492 __pyx_t_1 = (__pyx_v_i != Py_None);
16493 __pyx_t_2 = (__pyx_t_1 != 0);
16503 __Pyx_XDECREF(__pyx_r);
16504 __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)
16505 __Pyx_GOTREF(__pyx_t_3);
16507 __pyx_t_4 =
asinh(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
16509 __Pyx_CppExn2PyErr();
16510 __PYX_ERR(0, 1745, __pyx_L1_error)
16512 __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)
16513 __Pyx_GOTREF(__pyx_t_5);
16514 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16515 __pyx_r = __pyx_t_5;
16537 __Pyx_PyThreadState_declare
16538 __Pyx_PyThreadState_assign
16539 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
16540 __Pyx_XGOTREF(__pyx_t_6);
16541 __Pyx_XGOTREF(__pyx_t_7);
16542 __Pyx_XGOTREF(__pyx_t_8);
16552 __Pyx_XDECREF(__pyx_r);
16553 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1748, __pyx_L4_error)
16554 __Pyx_GOTREF(__pyx_t_3);
16555 __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)
16556 __Pyx_GOTREF(__pyx_t_9);
16557 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16559 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
16560 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
16561 if (likely(__pyx_t_3)) {
16562 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
16563 __Pyx_INCREF(__pyx_t_3);
16564 __Pyx_INCREF(
function);
16565 __Pyx_DECREF_SET(__pyx_t_9,
function);
16569 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1748, __pyx_L4_error)
16570 __Pyx_GOTREF(__pyx_t_5);
16572 #if CYTHON_FAST_PYCALL 16573 if (PyFunction_Check(__pyx_t_9)) {
16574 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
16575 __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)
16576 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16577 __Pyx_GOTREF(__pyx_t_5);
16580 #if CYTHON_FAST_PYCCALL 16581 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
16582 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
16583 __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)
16584 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16585 __Pyx_GOTREF(__pyx_t_5);
16589 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1748, __pyx_L4_error)
16590 __Pyx_GOTREF(__pyx_t_10);
16591 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
16592 __Pyx_INCREF(__pyx_v_obj);
16593 __Pyx_GIVEREF(__pyx_v_obj);
16594 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
16595 __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)
16596 __Pyx_GOTREF(__pyx_t_5);
16597 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16600 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16601 __pyx_r = __pyx_t_5;
16603 goto __pyx_L8_try_return;
16614 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16615 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
16616 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
16617 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16627 __Pyx_AddTraceback(
"PyClical.asinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16628 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1749, __pyx_L6_except_error)
16629 __Pyx_GOTREF(__pyx_t_5);
16630 __Pyx_GOTREF(__pyx_t_9);
16631 __Pyx_GOTREF(__pyx_t_10);
16640 __Pyx_XDECREF(__pyx_r);
16641 __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)
16642 __Pyx_GOTREF(__pyx_t_3);
16643 __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)
16644 __Pyx_GOTREF(__pyx_t_11);
16645 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16646 __pyx_r = __pyx_t_11;
16648 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16649 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16650 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16651 goto __pyx_L7_except_return;
16653 __pyx_L6_except_error:;
16662 __Pyx_XGIVEREF(__pyx_t_6);
16663 __Pyx_XGIVEREF(__pyx_t_7);
16664 __Pyx_XGIVEREF(__pyx_t_8);
16665 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16666 goto __pyx_L1_error;
16667 __pyx_L8_try_return:;
16668 __Pyx_XGIVEREF(__pyx_t_6);
16669 __Pyx_XGIVEREF(__pyx_t_7);
16670 __Pyx_XGIVEREF(__pyx_t_8);
16671 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16673 __pyx_L7_except_return:;
16674 __Pyx_XGIVEREF(__pyx_t_6);
16675 __Pyx_XGIVEREF(__pyx_t_7);
16676 __Pyx_XGIVEREF(__pyx_t_8);
16677 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16692 __Pyx_XDECREF(__pyx_t_3);
16693 __Pyx_XDECREF(__pyx_t_5);
16694 __Pyx_XDECREF(__pyx_t_9);
16695 __Pyx_XDECREF(__pyx_t_10);
16696 __Pyx_XDECREF(__pyx_t_11);
16697 __Pyx_AddTraceback(
"PyClical.asinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16700 __Pyx_XGIVEREF(__pyx_r);
16701 __Pyx_RefNannyFinishContext();
16706 static PyObject *__pyx_pw_8PyClical_65asinh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16707 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 ";
16708 static PyObject *__pyx_pw_8PyClical_65asinh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16709 PyObject *__pyx_v_obj = 0;
16710 PyObject *__pyx_v_i = 0;
16711 PyObject *__pyx_r = 0;
16712 __Pyx_RefNannyDeclarations
16713 __Pyx_RefNannySetupContext(
"asinh (wrapper)", 0);
16715 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
16716 PyObject* values[2] = {0,0};
16717 values[1] = ((PyObject *)Py_None);
16718 if (unlikely(__pyx_kwds)) {
16719 Py_ssize_t kw_args;
16720 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16721 switch (pos_args) {
16722 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16723 CYTHON_FALLTHROUGH;
16724 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16725 CYTHON_FALLTHROUGH;
16727 default:
goto __pyx_L5_argtuple_error;
16729 kw_args = PyDict_Size(__pyx_kwds);
16730 switch (pos_args) {
16732 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
16733 else goto __pyx_L5_argtuple_error;
16734 CYTHON_FALLTHROUGH;
16737 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i);
16738 if (value) { values[1] = value; kw_args--; }
16741 if (unlikely(kw_args > 0)) {
16742 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"asinh") < 0)) __PYX_ERR(0, 1733, __pyx_L3_error)
16745 switch (PyTuple_GET_SIZE(__pyx_args)) {
16746 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16747 CYTHON_FALLTHROUGH;
16748 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16750 default:
goto __pyx_L5_argtuple_error;
16753 __pyx_v_obj = values[0];
16754 __pyx_v_i = values[1];
16756 goto __pyx_L4_argument_unpacking_done;
16757 __pyx_L5_argtuple_error:;
16758 __Pyx_RaiseArgtupleInvalid(
"asinh", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1733, __pyx_L3_error)
16760 __Pyx_AddTraceback(
"PyClical.asinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16761 __Pyx_RefNannyFinishContext();
16763 __pyx_L4_argument_unpacking_done:;
16764 __pyx_r = __pyx_pf_8PyClical_64asinh(__pyx_self, __pyx_v_obj, __pyx_v_i);
16767 __Pyx_RefNannyFinishContext();
16771 static PyObject *__pyx_pf_8PyClical_64asinh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
16772 PyObject *__pyx_r = NULL;
16773 __Pyx_RefNannyDeclarations
16774 PyObject *__pyx_t_1 = NULL;
16775 struct __pyx_opt_args_8PyClical_asinh __pyx_t_2;
16776 __Pyx_RefNannySetupContext(
"asinh", 0);
16777 __Pyx_XDECREF(__pyx_r);
16778 __pyx_t_2.__pyx_n = 1;
16779 __pyx_t_2.i = __pyx_v_i;
16780 __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)
16781 __Pyx_GOTREF(__pyx_t_1);
16782 __pyx_r = __pyx_t_1;
16788 __Pyx_XDECREF(__pyx_t_1);
16789 __Pyx_AddTraceback(
"PyClical.asinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16792 __Pyx_XGIVEREF(__pyx_r);
16793 __Pyx_RefNannyFinishContext();
16805 static PyObject *__pyx_pw_8PyClical_67tan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16806 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) {
16807 PyObject *__pyx_v_i = ((PyObject *)Py_None);
16808 PyObject *__pyx_r = NULL;
16809 __Pyx_RefNannyDeclarations
16812 PyObject *__pyx_t_3 = NULL;
16814 PyObject *__pyx_t_5 = NULL;
16815 PyObject *__pyx_t_6 = NULL;
16816 PyObject *__pyx_t_7 = NULL;
16817 PyObject *__pyx_t_8 = NULL;
16818 PyObject *__pyx_t_9 = NULL;
16819 PyObject *__pyx_t_10 = NULL;
16820 PyObject *__pyx_t_11 = NULL;
16821 __Pyx_RefNannySetupContext(
"tan", 0);
16822 if (__pyx_optional_args) {
16823 if (__pyx_optional_args->__pyx_n > 0) {
16824 __pyx_v_i = __pyx_optional_args->i;
16835 __pyx_t_1 = (__pyx_v_i != Py_None);
16836 __pyx_t_2 = (__pyx_t_1 != 0);
16846 __Pyx_XDECREF(__pyx_r);
16847 __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)
16848 __Pyx_GOTREF(__pyx_t_3);
16850 __pyx_t_4 =
tan(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
16852 __Pyx_CppExn2PyErr();
16853 __PYX_ERR(0, 1762, __pyx_L1_error)
16855 __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)
16856 __Pyx_GOTREF(__pyx_t_5);
16857 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16858 __pyx_r = __pyx_t_5;
16880 __Pyx_PyThreadState_declare
16881 __Pyx_PyThreadState_assign
16882 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
16883 __Pyx_XGOTREF(__pyx_t_6);
16884 __Pyx_XGOTREF(__pyx_t_7);
16885 __Pyx_XGOTREF(__pyx_t_8);
16895 __Pyx_XDECREF(__pyx_r);
16896 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1765, __pyx_L4_error)
16897 __Pyx_GOTREF(__pyx_t_3);
16898 __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)
16899 __Pyx_GOTREF(__pyx_t_9);
16900 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16902 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
16903 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
16904 if (likely(__pyx_t_3)) {
16905 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
16906 __Pyx_INCREF(__pyx_t_3);
16907 __Pyx_INCREF(
function);
16908 __Pyx_DECREF_SET(__pyx_t_9,
function);
16912 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1765, __pyx_L4_error)
16913 __Pyx_GOTREF(__pyx_t_5);
16915 #if CYTHON_FAST_PYCALL 16916 if (PyFunction_Check(__pyx_t_9)) {
16917 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
16918 __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)
16919 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16920 __Pyx_GOTREF(__pyx_t_5);
16923 #if CYTHON_FAST_PYCCALL 16924 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
16925 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
16926 __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)
16927 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16928 __Pyx_GOTREF(__pyx_t_5);
16932 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1765, __pyx_L4_error)
16933 __Pyx_GOTREF(__pyx_t_10);
16934 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
16935 __Pyx_INCREF(__pyx_v_obj);
16936 __Pyx_GIVEREF(__pyx_v_obj);
16937 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
16938 __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)
16939 __Pyx_GOTREF(__pyx_t_5);
16940 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16943 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16944 __pyx_r = __pyx_t_5;
16946 goto __pyx_L8_try_return;
16957 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16958 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
16959 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
16960 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16970 __Pyx_AddTraceback(
"PyClical.tan", __pyx_clineno, __pyx_lineno, __pyx_filename);
16971 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1766, __pyx_L6_except_error)
16972 __Pyx_GOTREF(__pyx_t_5);
16973 __Pyx_GOTREF(__pyx_t_9);
16974 __Pyx_GOTREF(__pyx_t_10);
16983 __Pyx_XDECREF(__pyx_r);
16984 __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)
16985 __Pyx_GOTREF(__pyx_t_3);
16986 __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)
16987 __Pyx_GOTREF(__pyx_t_11);
16988 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16989 __pyx_r = __pyx_t_11;
16991 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16992 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16993 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16994 goto __pyx_L7_except_return;
16996 __pyx_L6_except_error:;
17005 __Pyx_XGIVEREF(__pyx_t_6);
17006 __Pyx_XGIVEREF(__pyx_t_7);
17007 __Pyx_XGIVEREF(__pyx_t_8);
17008 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17009 goto __pyx_L1_error;
17010 __pyx_L8_try_return:;
17011 __Pyx_XGIVEREF(__pyx_t_6);
17012 __Pyx_XGIVEREF(__pyx_t_7);
17013 __Pyx_XGIVEREF(__pyx_t_8);
17014 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17016 __pyx_L7_except_return:;
17017 __Pyx_XGIVEREF(__pyx_t_6);
17018 __Pyx_XGIVEREF(__pyx_t_7);
17019 __Pyx_XGIVEREF(__pyx_t_8);
17020 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17035 __Pyx_XDECREF(__pyx_t_3);
17036 __Pyx_XDECREF(__pyx_t_5);
17037 __Pyx_XDECREF(__pyx_t_9);
17038 __Pyx_XDECREF(__pyx_t_10);
17039 __Pyx_XDECREF(__pyx_t_11);
17040 __Pyx_AddTraceback(
"PyClical.tan", __pyx_clineno, __pyx_lineno, __pyx_filename);
17043 __Pyx_XGIVEREF(__pyx_r);
17044 __Pyx_RefNannyFinishContext();
17049 static PyObject *__pyx_pw_8PyClical_67tan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17050 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 ";
17051 static PyObject *__pyx_pw_8PyClical_67tan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17052 PyObject *__pyx_v_obj = 0;
17053 PyObject *__pyx_v_i = 0;
17054 PyObject *__pyx_r = 0;
17055 __Pyx_RefNannyDeclarations
17056 __Pyx_RefNannySetupContext(
"tan (wrapper)", 0);
17058 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
17059 PyObject* values[2] = {0,0};
17060 values[1] = ((PyObject *)Py_None);
17061 if (unlikely(__pyx_kwds)) {
17062 Py_ssize_t kw_args;
17063 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17064 switch (pos_args) {
17065 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17066 CYTHON_FALLTHROUGH;
17067 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17068 CYTHON_FALLTHROUGH;
17070 default:
goto __pyx_L5_argtuple_error;
17072 kw_args = PyDict_Size(__pyx_kwds);
17073 switch (pos_args) {
17075 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
17076 else goto __pyx_L5_argtuple_error;
17077 CYTHON_FALLTHROUGH;
17080 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i);
17081 if (value) { values[1] = value; kw_args--; }
17084 if (unlikely(kw_args > 0)) {
17085 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"tan") < 0)) __PYX_ERR(0, 1752, __pyx_L3_error)
17088 switch (PyTuple_GET_SIZE(__pyx_args)) {
17089 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17090 CYTHON_FALLTHROUGH;
17091 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17093 default:
goto __pyx_L5_argtuple_error;
17096 __pyx_v_obj = values[0];
17097 __pyx_v_i = values[1];
17099 goto __pyx_L4_argument_unpacking_done;
17100 __pyx_L5_argtuple_error:;
17101 __Pyx_RaiseArgtupleInvalid(
"tan", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1752, __pyx_L3_error)
17103 __Pyx_AddTraceback(
"PyClical.tan", __pyx_clineno, __pyx_lineno, __pyx_filename);
17104 __Pyx_RefNannyFinishContext();
17106 __pyx_L4_argument_unpacking_done:;
17107 __pyx_r = __pyx_pf_8PyClical_66tan(__pyx_self, __pyx_v_obj, __pyx_v_i);
17110 __Pyx_RefNannyFinishContext();
17114 static PyObject *__pyx_pf_8PyClical_66tan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
17115 PyObject *__pyx_r = NULL;
17116 __Pyx_RefNannyDeclarations
17117 PyObject *__pyx_t_1 = NULL;
17118 struct __pyx_opt_args_8PyClical_tan __pyx_t_2;
17119 __Pyx_RefNannySetupContext(
"tan", 0);
17120 __Pyx_XDECREF(__pyx_r);
17121 __pyx_t_2.__pyx_n = 1;
17122 __pyx_t_2.i = __pyx_v_i;
17123 __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)
17124 __Pyx_GOTREF(__pyx_t_1);
17125 __pyx_r = __pyx_t_1;
17131 __Pyx_XDECREF(__pyx_t_1);
17132 __Pyx_AddTraceback(
"PyClical.tan", __pyx_clineno, __pyx_lineno, __pyx_filename);
17135 __Pyx_XGIVEREF(__pyx_r);
17136 __Pyx_RefNannyFinishContext();
17148 static PyObject *__pyx_pw_8PyClical_69atan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17149 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) {
17150 PyObject *__pyx_v_i = ((PyObject *)Py_None);
17151 PyObject *__pyx_r = NULL;
17152 __Pyx_RefNannyDeclarations
17155 PyObject *__pyx_t_3 = NULL;
17157 PyObject *__pyx_t_5 = NULL;
17158 PyObject *__pyx_t_6 = NULL;
17159 PyObject *__pyx_t_7 = NULL;
17160 PyObject *__pyx_t_8 = NULL;
17161 PyObject *__pyx_t_9 = NULL;
17162 PyObject *__pyx_t_10 = NULL;
17163 PyObject *__pyx_t_11 = NULL;
17164 __Pyx_RefNannySetupContext(
"atan", 0);
17165 if (__pyx_optional_args) {
17166 if (__pyx_optional_args->__pyx_n > 0) {
17167 __pyx_v_i = __pyx_optional_args->i;
17178 __pyx_t_1 = (__pyx_v_i != Py_None);
17179 __pyx_t_2 = (__pyx_t_1 != 0);
17189 __Pyx_XDECREF(__pyx_r);
17190 __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)
17191 __Pyx_GOTREF(__pyx_t_3);
17193 __pyx_t_4 =
atan(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
17195 __Pyx_CppExn2PyErr();
17196 __PYX_ERR(0, 1779, __pyx_L1_error)
17198 __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)
17199 __Pyx_GOTREF(__pyx_t_5);
17200 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17201 __pyx_r = __pyx_t_5;
17223 __Pyx_PyThreadState_declare
17224 __Pyx_PyThreadState_assign
17225 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
17226 __Pyx_XGOTREF(__pyx_t_6);
17227 __Pyx_XGOTREF(__pyx_t_7);
17228 __Pyx_XGOTREF(__pyx_t_8);
17238 __Pyx_XDECREF(__pyx_r);
17239 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1782, __pyx_L4_error)
17240 __Pyx_GOTREF(__pyx_t_3);
17241 __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)
17242 __Pyx_GOTREF(__pyx_t_9);
17243 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17245 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
17246 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
17247 if (likely(__pyx_t_3)) {
17248 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
17249 __Pyx_INCREF(__pyx_t_3);
17250 __Pyx_INCREF(
function);
17251 __Pyx_DECREF_SET(__pyx_t_9,
function);
17255 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1782, __pyx_L4_error)
17256 __Pyx_GOTREF(__pyx_t_5);
17258 #if CYTHON_FAST_PYCALL 17259 if (PyFunction_Check(__pyx_t_9)) {
17260 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
17261 __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)
17262 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17263 __Pyx_GOTREF(__pyx_t_5);
17266 #if CYTHON_FAST_PYCCALL 17267 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
17268 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
17269 __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)
17270 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17271 __Pyx_GOTREF(__pyx_t_5);
17275 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1782, __pyx_L4_error)
17276 __Pyx_GOTREF(__pyx_t_10);
17277 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
17278 __Pyx_INCREF(__pyx_v_obj);
17279 __Pyx_GIVEREF(__pyx_v_obj);
17280 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
17281 __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)
17282 __Pyx_GOTREF(__pyx_t_5);
17283 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
17286 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17287 __pyx_r = __pyx_t_5;
17289 goto __pyx_L8_try_return;
17300 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17301 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
17302 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
17303 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17313 __Pyx_AddTraceback(
"PyClical.atan", __pyx_clineno, __pyx_lineno, __pyx_filename);
17314 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1783, __pyx_L6_except_error)
17315 __Pyx_GOTREF(__pyx_t_5);
17316 __Pyx_GOTREF(__pyx_t_9);
17317 __Pyx_GOTREF(__pyx_t_10);
17326 __Pyx_XDECREF(__pyx_r);
17327 __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)
17328 __Pyx_GOTREF(__pyx_t_3);
17329 __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)
17330 __Pyx_GOTREF(__pyx_t_11);
17331 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17332 __pyx_r = __pyx_t_11;
17334 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17335 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17336 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
17337 goto __pyx_L7_except_return;
17339 __pyx_L6_except_error:;
17348 __Pyx_XGIVEREF(__pyx_t_6);
17349 __Pyx_XGIVEREF(__pyx_t_7);
17350 __Pyx_XGIVEREF(__pyx_t_8);
17351 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17352 goto __pyx_L1_error;
17353 __pyx_L8_try_return:;
17354 __Pyx_XGIVEREF(__pyx_t_6);
17355 __Pyx_XGIVEREF(__pyx_t_7);
17356 __Pyx_XGIVEREF(__pyx_t_8);
17357 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17359 __pyx_L7_except_return:;
17360 __Pyx_XGIVEREF(__pyx_t_6);
17361 __Pyx_XGIVEREF(__pyx_t_7);
17362 __Pyx_XGIVEREF(__pyx_t_8);
17363 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17378 __Pyx_XDECREF(__pyx_t_3);
17379 __Pyx_XDECREF(__pyx_t_5);
17380 __Pyx_XDECREF(__pyx_t_9);
17381 __Pyx_XDECREF(__pyx_t_10);
17382 __Pyx_XDECREF(__pyx_t_11);
17383 __Pyx_AddTraceback(
"PyClical.atan", __pyx_clineno, __pyx_lineno, __pyx_filename);
17386 __Pyx_XGIVEREF(__pyx_r);
17387 __Pyx_RefNannyFinishContext();
17392 static PyObject *__pyx_pw_8PyClical_69atan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17393 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 ";
17394 static PyObject *__pyx_pw_8PyClical_69atan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17395 PyObject *__pyx_v_obj = 0;
17396 PyObject *__pyx_v_i = 0;
17397 PyObject *__pyx_r = 0;
17398 __Pyx_RefNannyDeclarations
17399 __Pyx_RefNannySetupContext(
"atan (wrapper)", 0);
17401 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
17402 PyObject* values[2] = {0,0};
17403 values[1] = ((PyObject *)Py_None);
17404 if (unlikely(__pyx_kwds)) {
17405 Py_ssize_t kw_args;
17406 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17407 switch (pos_args) {
17408 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17409 CYTHON_FALLTHROUGH;
17410 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17411 CYTHON_FALLTHROUGH;
17413 default:
goto __pyx_L5_argtuple_error;
17415 kw_args = PyDict_Size(__pyx_kwds);
17416 switch (pos_args) {
17418 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
17419 else goto __pyx_L5_argtuple_error;
17420 CYTHON_FALLTHROUGH;
17423 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i);
17424 if (value) { values[1] = value; kw_args--; }
17427 if (unlikely(kw_args > 0)) {
17428 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"atan") < 0)) __PYX_ERR(0, 1769, __pyx_L3_error)
17431 switch (PyTuple_GET_SIZE(__pyx_args)) {
17432 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17433 CYTHON_FALLTHROUGH;
17434 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17436 default:
goto __pyx_L5_argtuple_error;
17439 __pyx_v_obj = values[0];
17440 __pyx_v_i = values[1];
17442 goto __pyx_L4_argument_unpacking_done;
17443 __pyx_L5_argtuple_error:;
17444 __Pyx_RaiseArgtupleInvalid(
"atan", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1769, __pyx_L3_error)
17446 __Pyx_AddTraceback(
"PyClical.atan", __pyx_clineno, __pyx_lineno, __pyx_filename);
17447 __Pyx_RefNannyFinishContext();
17449 __pyx_L4_argument_unpacking_done:;
17450 __pyx_r = __pyx_pf_8PyClical_68atan(__pyx_self, __pyx_v_obj, __pyx_v_i);
17453 __Pyx_RefNannyFinishContext();
17457 static PyObject *__pyx_pf_8PyClical_68atan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
17458 PyObject *__pyx_r = NULL;
17459 __Pyx_RefNannyDeclarations
17460 PyObject *__pyx_t_1 = NULL;
17461 struct __pyx_opt_args_8PyClical_atan __pyx_t_2;
17462 __Pyx_RefNannySetupContext(
"atan", 0);
17463 __Pyx_XDECREF(__pyx_r);
17464 __pyx_t_2.__pyx_n = 1;
17465 __pyx_t_2.i = __pyx_v_i;
17466 __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)
17467 __Pyx_GOTREF(__pyx_t_1);
17468 __pyx_r = __pyx_t_1;
17474 __Pyx_XDECREF(__pyx_t_1);
17475 __Pyx_AddTraceback(
"PyClical.atan", __pyx_clineno, __pyx_lineno, __pyx_filename);
17478 __Pyx_XGIVEREF(__pyx_r);
17479 __Pyx_RefNannyFinishContext();
17491 static PyObject *__pyx_pw_8PyClical_71tanh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
17492 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_tanh(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
17493 PyObject *__pyx_r = NULL;
17494 __Pyx_RefNannyDeclarations
17495 PyObject *__pyx_t_1 = NULL;
17496 PyObject *__pyx_t_2 = NULL;
17497 PyObject *__pyx_t_3 = NULL;
17498 PyObject *__pyx_t_4 = NULL;
17499 PyObject *__pyx_t_5 = NULL;
17500 PyObject *__pyx_t_6 = NULL;
17501 PyObject *__pyx_t_7 = NULL;
17502 PyObject *__pyx_t_8 = NULL;
17503 __Pyx_RefNannySetupContext(
"tanh", 0);
17513 __Pyx_PyThreadState_declare
17514 __Pyx_PyThreadState_assign
17515 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
17516 __Pyx_XGOTREF(__pyx_t_1);
17517 __Pyx_XGOTREF(__pyx_t_2);
17518 __Pyx_XGOTREF(__pyx_t_3);
17528 __Pyx_XDECREF(__pyx_r);
17529 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1794, __pyx_L3_error)
17530 __Pyx_GOTREF(__pyx_t_5);
17531 __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)
17532 __Pyx_GOTREF(__pyx_t_6);
17533 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17535 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
17536 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
17537 if (likely(__pyx_t_5)) {
17538 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
17539 __Pyx_INCREF(__pyx_t_5);
17540 __Pyx_INCREF(
function);
17541 __Pyx_DECREF_SET(__pyx_t_6,
function);
17545 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_obj);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1794, __pyx_L3_error)
17546 __Pyx_GOTREF(__pyx_t_4);
17548 #if CYTHON_FAST_PYCALL 17549 if (PyFunction_Check(__pyx_t_6)) {
17550 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_obj};
17551 __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)
17552 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17553 __Pyx_GOTREF(__pyx_t_4);
17556 #if CYTHON_FAST_PYCCALL 17557 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
17558 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_obj};
17559 __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)
17560 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17561 __Pyx_GOTREF(__pyx_t_4);
17565 __pyx_t_7 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1794, __pyx_L3_error)
17566 __Pyx_GOTREF(__pyx_t_7);
17567 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
17568 __Pyx_INCREF(__pyx_v_obj);
17569 __Pyx_GIVEREF(__pyx_v_obj);
17570 PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_obj);
17571 __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)
17572 __Pyx_GOTREF(__pyx_t_4);
17573 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
17576 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17577 __pyx_r = __pyx_t_4;
17579 goto __pyx_L7_try_return;
17590 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17591 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
17592 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
17593 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
17603 __Pyx_AddTraceback(
"PyClical.tanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17604 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1795, __pyx_L5_except_error)
17605 __Pyx_GOTREF(__pyx_t_4);
17606 __Pyx_GOTREF(__pyx_t_6);
17607 __Pyx_GOTREF(__pyx_t_7);
17616 __Pyx_XDECREF(__pyx_r);
17617 __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)
17618 __Pyx_GOTREF(__pyx_t_5);
17619 __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)
17620 __Pyx_GOTREF(__pyx_t_8);
17621 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17622 __pyx_r = __pyx_t_8;
17624 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17625 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17626 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
17627 goto __pyx_L6_except_return;
17629 __pyx_L5_except_error:;
17638 __Pyx_XGIVEREF(__pyx_t_1);
17639 __Pyx_XGIVEREF(__pyx_t_2);
17640 __Pyx_XGIVEREF(__pyx_t_3);
17641 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
17642 goto __pyx_L1_error;
17643 __pyx_L7_try_return:;
17644 __Pyx_XGIVEREF(__pyx_t_1);
17645 __Pyx_XGIVEREF(__pyx_t_2);
17646 __Pyx_XGIVEREF(__pyx_t_3);
17647 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
17649 __pyx_L6_except_return:;
17650 __Pyx_XGIVEREF(__pyx_t_1);
17651 __Pyx_XGIVEREF(__pyx_t_2);
17652 __Pyx_XGIVEREF(__pyx_t_3);
17653 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
17667 __Pyx_XDECREF(__pyx_t_4);
17668 __Pyx_XDECREF(__pyx_t_5);
17669 __Pyx_XDECREF(__pyx_t_6);
17670 __Pyx_XDECREF(__pyx_t_7);
17671 __Pyx_XDECREF(__pyx_t_8);
17672 __Pyx_AddTraceback(
"PyClical.tanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17675 __Pyx_XGIVEREF(__pyx_r);
17676 __Pyx_RefNannyFinishContext();
17681 static PyObject *__pyx_pw_8PyClical_71tanh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
17682 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 ";
17683 static PyObject *__pyx_pw_8PyClical_71tanh(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
17684 PyObject *__pyx_r = 0;
17685 __Pyx_RefNannyDeclarations
17686 __Pyx_RefNannySetupContext(
"tanh (wrapper)", 0);
17687 __pyx_r = __pyx_pf_8PyClical_70tanh(__pyx_self, ((PyObject *)__pyx_v_obj));
17690 __Pyx_RefNannyFinishContext();
17694 static PyObject *__pyx_pf_8PyClical_70tanh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
17695 PyObject *__pyx_r = NULL;
17696 __Pyx_RefNannyDeclarations
17697 PyObject *__pyx_t_1 = NULL;
17698 __Pyx_RefNannySetupContext(
"tanh", 0);
17699 __Pyx_XDECREF(__pyx_r);
17700 __pyx_t_1 = __pyx_f_8PyClical_tanh(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1786, __pyx_L1_error)
17701 __Pyx_GOTREF(__pyx_t_1);
17702 __pyx_r = __pyx_t_1;
17708 __Pyx_XDECREF(__pyx_t_1);
17709 __Pyx_AddTraceback(
"PyClical.tanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17712 __Pyx_XGIVEREF(__pyx_r);
17713 __Pyx_RefNannyFinishContext();
17725 static PyObject *__pyx_pw_8PyClical_73atanh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17726 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) {
17727 PyObject *__pyx_v_i = ((PyObject *)Py_None);
17728 PyObject *__pyx_r = NULL;
17729 __Pyx_RefNannyDeclarations
17732 PyObject *__pyx_t_3 = NULL;
17734 PyObject *__pyx_t_5 = NULL;
17735 PyObject *__pyx_t_6 = NULL;
17736 PyObject *__pyx_t_7 = NULL;
17737 PyObject *__pyx_t_8 = NULL;
17738 PyObject *__pyx_t_9 = NULL;
17739 PyObject *__pyx_t_10 = NULL;
17740 PyObject *__pyx_t_11 = NULL;
17741 __Pyx_RefNannySetupContext(
"atanh", 0);
17742 if (__pyx_optional_args) {
17743 if (__pyx_optional_args->__pyx_n > 0) {
17744 __pyx_v_i = __pyx_optional_args->i;
17755 __pyx_t_1 = (__pyx_v_i != Py_None);
17756 __pyx_t_2 = (__pyx_t_1 != 0);
17766 __Pyx_XDECREF(__pyx_r);
17767 __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)
17768 __Pyx_GOTREF(__pyx_t_3);
17770 __pyx_t_4 =
atanh(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
17772 __Pyx_CppExn2PyErr();
17773 __PYX_ERR(0, 1808, __pyx_L1_error)
17775 __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)
17776 __Pyx_GOTREF(__pyx_t_5);
17777 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17778 __pyx_r = __pyx_t_5;
17800 __Pyx_PyThreadState_declare
17801 __Pyx_PyThreadState_assign
17802 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
17803 __Pyx_XGOTREF(__pyx_t_6);
17804 __Pyx_XGOTREF(__pyx_t_7);
17805 __Pyx_XGOTREF(__pyx_t_8);
17815 __Pyx_XDECREF(__pyx_r);
17816 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1811, __pyx_L4_error)
17817 __Pyx_GOTREF(__pyx_t_3);
17818 __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)
17819 __Pyx_GOTREF(__pyx_t_9);
17820 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17822 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
17823 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
17824 if (likely(__pyx_t_3)) {
17825 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
17826 __Pyx_INCREF(__pyx_t_3);
17827 __Pyx_INCREF(
function);
17828 __Pyx_DECREF_SET(__pyx_t_9,
function);
17832 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1811, __pyx_L4_error)
17833 __Pyx_GOTREF(__pyx_t_5);
17835 #if CYTHON_FAST_PYCALL 17836 if (PyFunction_Check(__pyx_t_9)) {
17837 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
17838 __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)
17839 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17840 __Pyx_GOTREF(__pyx_t_5);
17843 #if CYTHON_FAST_PYCCALL 17844 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
17845 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj};
17846 __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)
17847 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17848 __Pyx_GOTREF(__pyx_t_5);
17852 __pyx_t_10 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1811, __pyx_L4_error)
17853 __Pyx_GOTREF(__pyx_t_10);
17854 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
17855 __Pyx_INCREF(__pyx_v_obj);
17856 __Pyx_GIVEREF(__pyx_v_obj);
17857 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_obj);
17858 __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)
17859 __Pyx_GOTREF(__pyx_t_5);
17860 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
17863 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17864 __pyx_r = __pyx_t_5;
17866 goto __pyx_L8_try_return;
17877 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17878 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
17879 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
17880 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17890 __Pyx_AddTraceback(
"PyClical.atanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17891 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 1812, __pyx_L6_except_error)
17892 __Pyx_GOTREF(__pyx_t_5);
17893 __Pyx_GOTREF(__pyx_t_9);
17894 __Pyx_GOTREF(__pyx_t_10);
17903 __Pyx_XDECREF(__pyx_r);
17904 __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)
17905 __Pyx_GOTREF(__pyx_t_3);
17906 __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)
17907 __Pyx_GOTREF(__pyx_t_11);
17908 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17909 __pyx_r = __pyx_t_11;
17911 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17912 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17913 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
17914 goto __pyx_L7_except_return;
17916 __pyx_L6_except_error:;
17925 __Pyx_XGIVEREF(__pyx_t_6);
17926 __Pyx_XGIVEREF(__pyx_t_7);
17927 __Pyx_XGIVEREF(__pyx_t_8);
17928 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17929 goto __pyx_L1_error;
17930 __pyx_L8_try_return:;
17931 __Pyx_XGIVEREF(__pyx_t_6);
17932 __Pyx_XGIVEREF(__pyx_t_7);
17933 __Pyx_XGIVEREF(__pyx_t_8);
17934 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17936 __pyx_L7_except_return:;
17937 __Pyx_XGIVEREF(__pyx_t_6);
17938 __Pyx_XGIVEREF(__pyx_t_7);
17939 __Pyx_XGIVEREF(__pyx_t_8);
17940 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17955 __Pyx_XDECREF(__pyx_t_3);
17956 __Pyx_XDECREF(__pyx_t_5);
17957 __Pyx_XDECREF(__pyx_t_9);
17958 __Pyx_XDECREF(__pyx_t_10);
17959 __Pyx_XDECREF(__pyx_t_11);
17960 __Pyx_AddTraceback(
"PyClical.atanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17963 __Pyx_XGIVEREF(__pyx_r);
17964 __Pyx_RefNannyFinishContext();
17969 static PyObject *__pyx_pw_8PyClical_73atanh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17970 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 ";
17971 static PyObject *__pyx_pw_8PyClical_73atanh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17972 PyObject *__pyx_v_obj = 0;
17973 PyObject *__pyx_v_i = 0;
17974 PyObject *__pyx_r = 0;
17975 __Pyx_RefNannyDeclarations
17976 __Pyx_RefNannySetupContext(
"atanh (wrapper)", 0);
17978 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
17979 PyObject* values[2] = {0,0};
17980 values[1] = ((PyObject *)Py_None);
17981 if (unlikely(__pyx_kwds)) {
17982 Py_ssize_t kw_args;
17983 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17984 switch (pos_args) {
17985 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17986 CYTHON_FALLTHROUGH;
17987 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17988 CYTHON_FALLTHROUGH;
17990 default:
goto __pyx_L5_argtuple_error;
17992 kw_args = PyDict_Size(__pyx_kwds);
17993 switch (pos_args) {
17995 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
17996 else goto __pyx_L5_argtuple_error;
17997 CYTHON_FALLTHROUGH;
18000 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i);
18001 if (value) { values[1] = value; kw_args--; }
18004 if (unlikely(kw_args > 0)) {
18005 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"atanh") < 0)) __PYX_ERR(0, 1798, __pyx_L3_error)
18008 switch (PyTuple_GET_SIZE(__pyx_args)) {
18009 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18010 CYTHON_FALLTHROUGH;
18011 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18013 default:
goto __pyx_L5_argtuple_error;
18016 __pyx_v_obj = values[0];
18017 __pyx_v_i = values[1];
18019 goto __pyx_L4_argument_unpacking_done;
18020 __pyx_L5_argtuple_error:;
18021 __Pyx_RaiseArgtupleInvalid(
"atanh", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1798, __pyx_L3_error)
18023 __Pyx_AddTraceback(
"PyClical.atanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
18024 __Pyx_RefNannyFinishContext();
18026 __pyx_L4_argument_unpacking_done:;
18027 __pyx_r = __pyx_pf_8PyClical_72atanh(__pyx_self, __pyx_v_obj, __pyx_v_i);
18030 __Pyx_RefNannyFinishContext();
18034 static PyObject *__pyx_pf_8PyClical_72atanh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
18035 PyObject *__pyx_r = NULL;
18036 __Pyx_RefNannyDeclarations
18037 PyObject *__pyx_t_1 = NULL;
18038 struct __pyx_opt_args_8PyClical_atanh __pyx_t_2;
18039 __Pyx_RefNannySetupContext(
"atanh", 0);
18040 __Pyx_XDECREF(__pyx_r);
18041 __pyx_t_2.__pyx_n = 1;
18042 __pyx_t_2.i = __pyx_v_i;
18043 __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)
18044 __Pyx_GOTREF(__pyx_t_1);
18045 __pyx_r = __pyx_t_1;
18051 __Pyx_XDECREF(__pyx_t_1);
18052 __Pyx_AddTraceback(
"PyClical.atanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
18055 __Pyx_XGIVEREF(__pyx_r);
18056 __Pyx_RefNannyFinishContext();
18068 static PyObject *__pyx_pw_8PyClical_75random_clifford(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
18069 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) {
18070 PyObject *__pyx_v_fill = ((PyObject *)__pyx_float_1_0);
18071 PyObject *__pyx_r = NULL;
18072 __Pyx_RefNannyDeclarations
18073 PyObject *__pyx_t_1 = NULL;
18074 PyObject *__pyx_t_2 = NULL;
18076 PyObject *__pyx_t_4 = NULL;
18077 __Pyx_RefNannySetupContext(
"random_clifford", 0);
18078 if (__pyx_optional_args) {
18079 if (__pyx_optional_args->__pyx_n > 0) {
18080 __pyx_v_fill = __pyx_optional_args->fill;
18091 __Pyx_XDECREF(__pyx_r);
18092 __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)
18093 __Pyx_GOTREF(__pyx_t_1);
18094 __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)
18095 __Pyx_GOTREF(__pyx_t_2);
18096 __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)
18097 __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)
18098 __Pyx_GOTREF(__pyx_t_4);
18099 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18100 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18101 __pyx_r = __pyx_t_4;
18115 __Pyx_XDECREF(__pyx_t_1);
18116 __Pyx_XDECREF(__pyx_t_2);
18117 __Pyx_XDECREF(__pyx_t_4);
18118 __Pyx_AddTraceback(
"PyClical.random_clifford", __pyx_clineno, __pyx_lineno, __pyx_filename);
18121 __Pyx_XGIVEREF(__pyx_r);
18122 __Pyx_RefNannyFinishContext();
18127 static PyObject *__pyx_pw_8PyClical_75random_clifford(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
18128 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 ";
18129 static PyObject *__pyx_pw_8PyClical_75random_clifford(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18130 struct __pyx_obj_8PyClical_index_set *__pyx_v_ixt = 0;
18131 PyObject *__pyx_v_fill = 0;
18132 PyObject *__pyx_r = 0;
18133 __Pyx_RefNannyDeclarations
18134 __Pyx_RefNannySetupContext(
"random_clifford (wrapper)", 0);
18136 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ixt,&__pyx_n_s_fill,0};
18137 PyObject* values[2] = {0,0};
18138 values[1] = ((PyObject *)__pyx_float_1_0);
18139 if (unlikely(__pyx_kwds)) {
18140 Py_ssize_t kw_args;
18141 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
18142 switch (pos_args) {
18143 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18144 CYTHON_FALLTHROUGH;
18145 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18146 CYTHON_FALLTHROUGH;
18148 default:
goto __pyx_L5_argtuple_error;
18150 kw_args = PyDict_Size(__pyx_kwds);
18151 switch (pos_args) {
18153 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ixt)) != 0)) kw_args--;
18154 else goto __pyx_L5_argtuple_error;
18155 CYTHON_FALLTHROUGH;
18158 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill);
18159 if (value) { values[1] = value; kw_args--; }
18162 if (unlikely(kw_args > 0)) {
18163 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"random_clifford") < 0)) __PYX_ERR(0, 1815, __pyx_L3_error)
18166 switch (PyTuple_GET_SIZE(__pyx_args)) {
18167 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18168 CYTHON_FALLTHROUGH;
18169 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18171 default:
goto __pyx_L5_argtuple_error;
18174 __pyx_v_ixt = ((
struct __pyx_obj_8PyClical_index_set *)values[0]);
18175 __pyx_v_fill = values[1];
18177 goto __pyx_L4_argument_unpacking_done;
18178 __pyx_L5_argtuple_error:;
18179 __Pyx_RaiseArgtupleInvalid(
"random_clifford", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1815, __pyx_L3_error)
18181 __Pyx_AddTraceback(
"PyClical.random_clifford", __pyx_clineno, __pyx_lineno, __pyx_filename);
18182 __Pyx_RefNannyFinishContext();
18184 __pyx_L4_argument_unpacking_done:;
18185 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ixt), __pyx_ptype_8PyClical_index_set, 1,
"ixt", 0))) __PYX_ERR(0, 1815, __pyx_L1_error)
18186 __pyx_r = __pyx_pf_8PyClical_74random_clifford(__pyx_self, __pyx_v_ixt, __pyx_v_fill);
18193 __Pyx_RefNannyFinishContext();
18197 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) {
18198 PyObject *__pyx_r = NULL;
18199 __Pyx_RefNannyDeclarations
18200 PyObject *__pyx_t_1 = NULL;
18201 struct __pyx_opt_args_8PyClical_random_clifford __pyx_t_2;
18202 __Pyx_RefNannySetupContext(
"random_clifford", 0);
18203 __Pyx_XDECREF(__pyx_r);
18204 __pyx_t_2.__pyx_n = 1;
18205 __pyx_t_2.fill = __pyx_v_fill;
18206 __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)
18207 __Pyx_GOTREF(__pyx_t_1);
18208 __pyx_r = __pyx_t_1;
18214 __Pyx_XDECREF(__pyx_t_1);
18215 __Pyx_AddTraceback(
"PyClical.random_clifford", __pyx_clineno, __pyx_lineno, __pyx_filename);
18218 __Pyx_XGIVEREF(__pyx_r);
18219 __Pyx_RefNannyFinishContext();
18231 static PyObject *__pyx_pw_8PyClical_77cga3(PyObject *__pyx_self, PyObject *__pyx_v_obj);
18232 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cga3(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
18233 PyObject *__pyx_r = NULL;
18234 __Pyx_RefNannyDeclarations
18235 PyObject *__pyx_t_1 = NULL;
18236 PyObject *__pyx_t_2 = NULL;
18237 __Pyx_RefNannySetupContext(
"cga3", 0);
18246 __Pyx_XDECREF(__pyx_r);
18247 __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)
18248 __Pyx_GOTREF(__pyx_t_1);
18249 __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)
18250 __Pyx_GOTREF(__pyx_t_2);
18251 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18252 __pyx_r = __pyx_t_2;
18266 __Pyx_XDECREF(__pyx_t_1);
18267 __Pyx_XDECREF(__pyx_t_2);
18268 __Pyx_AddTraceback(
"PyClical.cga3", __pyx_clineno, __pyx_lineno, __pyx_filename);
18271 __Pyx_XGIVEREF(__pyx_r);
18272 __Pyx_RefNannyFinishContext();
18277 static PyObject *__pyx_pw_8PyClical_77cga3(PyObject *__pyx_self, PyObject *__pyx_v_obj);
18278 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 ";
18279 static PyObject *__pyx_pw_8PyClical_77cga3(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18280 PyObject *__pyx_r = 0;
18281 __Pyx_RefNannyDeclarations
18282 __Pyx_RefNannySetupContext(
"cga3 (wrapper)", 0);
18283 __pyx_r = __pyx_pf_8PyClical_76cga3(__pyx_self, ((PyObject *)__pyx_v_obj));
18286 __Pyx_RefNannyFinishContext();
18290 static PyObject *__pyx_pf_8PyClical_76cga3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18291 PyObject *__pyx_r = NULL;
18292 __Pyx_RefNannyDeclarations
18293 PyObject *__pyx_t_1 = NULL;
18294 __Pyx_RefNannySetupContext(
"cga3", 0);
18295 __Pyx_XDECREF(__pyx_r);
18296 __pyx_t_1 = __pyx_f_8PyClical_cga3(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1824, __pyx_L1_error)
18297 __Pyx_GOTREF(__pyx_t_1);
18298 __pyx_r = __pyx_t_1;
18304 __Pyx_XDECREF(__pyx_t_1);
18305 __Pyx_AddTraceback(
"PyClical.cga3", __pyx_clineno, __pyx_lineno, __pyx_filename);
18308 __Pyx_XGIVEREF(__pyx_r);
18309 __Pyx_RefNannyFinishContext();
18321 static PyObject *__pyx_pw_8PyClical_79cga3std(PyObject *__pyx_self, PyObject *__pyx_v_obj);
18322 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cga3std(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
18323 PyObject *__pyx_r = NULL;
18324 __Pyx_RefNannyDeclarations
18325 PyObject *__pyx_t_1 = NULL;
18326 PyObject *__pyx_t_2 = NULL;
18327 __Pyx_RefNannySetupContext(
"cga3std", 0);
18336 __Pyx_XDECREF(__pyx_r);
18337 __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)
18338 __Pyx_GOTREF(__pyx_t_1);
18339 __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)
18340 __Pyx_GOTREF(__pyx_t_2);
18341 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18342 __pyx_r = __pyx_t_2;
18356 __Pyx_XDECREF(__pyx_t_1);
18357 __Pyx_XDECREF(__pyx_t_2);
18358 __Pyx_AddTraceback(
"PyClical.cga3std", __pyx_clineno, __pyx_lineno, __pyx_filename);
18361 __Pyx_XGIVEREF(__pyx_r);
18362 __Pyx_RefNannyFinishContext();
18367 static PyObject *__pyx_pw_8PyClical_79cga3std(PyObject *__pyx_self, PyObject *__pyx_v_obj);
18368 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 ";
18369 static PyObject *__pyx_pw_8PyClical_79cga3std(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18370 PyObject *__pyx_r = 0;
18371 __Pyx_RefNannyDeclarations
18372 __Pyx_RefNannySetupContext(
"cga3std (wrapper)", 0);
18373 __pyx_r = __pyx_pf_8PyClical_78cga3std(__pyx_self, ((PyObject *)__pyx_v_obj));
18376 __Pyx_RefNannyFinishContext();
18380 static PyObject *__pyx_pf_8PyClical_78cga3std(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18381 PyObject *__pyx_r = NULL;
18382 __Pyx_RefNannyDeclarations
18383 PyObject *__pyx_t_1 = NULL;
18384 __Pyx_RefNannySetupContext(
"cga3std", 0);
18385 __Pyx_XDECREF(__pyx_r);
18386 __pyx_t_1 = __pyx_f_8PyClical_cga3std(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1833, __pyx_L1_error)
18387 __Pyx_GOTREF(__pyx_t_1);
18388 __pyx_r = __pyx_t_1;
18394 __Pyx_XDECREF(__pyx_t_1);
18395 __Pyx_AddTraceback(
"PyClical.cga3std", __pyx_clineno, __pyx_lineno, __pyx_filename);
18398 __Pyx_XGIVEREF(__pyx_r);
18399 __Pyx_RefNannyFinishContext();
18411 static PyObject *__pyx_pw_8PyClical_81agc3(PyObject *__pyx_self, PyObject *__pyx_v_obj);
18412 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_agc3(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
18413 PyObject *__pyx_r = NULL;
18414 __Pyx_RefNannyDeclarations
18415 PyObject *__pyx_t_1 = NULL;
18416 PyObject *__pyx_t_2 = NULL;
18417 __Pyx_RefNannySetupContext(
"agc3", 0);
18426 __Pyx_XDECREF(__pyx_r);
18427 __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)
18428 __Pyx_GOTREF(__pyx_t_1);
18429 __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)
18430 __Pyx_GOTREF(__pyx_t_2);
18431 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18432 __pyx_r = __pyx_t_2;
18446 __Pyx_XDECREF(__pyx_t_1);
18447 __Pyx_XDECREF(__pyx_t_2);
18448 __Pyx_AddTraceback(
"PyClical.agc3", __pyx_clineno, __pyx_lineno, __pyx_filename);
18451 __Pyx_XGIVEREF(__pyx_r);
18452 __Pyx_RefNannyFinishContext();
18457 static PyObject *__pyx_pw_8PyClical_81agc3(PyObject *__pyx_self, PyObject *__pyx_v_obj);
18458 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 ";
18459 static PyObject *__pyx_pw_8PyClical_81agc3(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18460 PyObject *__pyx_r = 0;
18461 __Pyx_RefNannyDeclarations
18462 __Pyx_RefNannySetupContext(
"agc3 (wrapper)", 0);
18463 __pyx_r = __pyx_pf_8PyClical_80agc3(__pyx_self, ((PyObject *)__pyx_v_obj));
18466 __Pyx_RefNannyFinishContext();
18470 static PyObject *__pyx_pf_8PyClical_80agc3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18471 PyObject *__pyx_r = NULL;
18472 __Pyx_RefNannyDeclarations
18473 PyObject *__pyx_t_1 = NULL;
18474 __Pyx_RefNannySetupContext(
"agc3", 0);
18475 __Pyx_XDECREF(__pyx_r);
18476 __pyx_t_1 = __pyx_f_8PyClical_agc3(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1844, __pyx_L1_error)
18477 __Pyx_GOTREF(__pyx_t_1);
18478 __pyx_r = __pyx_t_1;
18484 __Pyx_XDECREF(__pyx_t_1);
18485 __Pyx_AddTraceback(
"PyClical.agc3", __pyx_clineno, __pyx_lineno, __pyx_filename);
18488 __Pyx_XGIVEREF(__pyx_r);
18489 __Pyx_RefNannyFinishContext();
18502 static PyObject *__pyx_pw_8PyClical_83e(PyObject *__pyx_self, PyObject *__pyx_v_obj);
18503 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 ";
18504 static PyMethodDef __pyx_mdef_8PyClical_83e = {
"e", (PyCFunction)__pyx_pw_8PyClical_83e, METH_O, __pyx_doc_8PyClical_82e};
18505 static PyObject *__pyx_pw_8PyClical_83e(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18506 PyObject *__pyx_r = 0;
18507 __Pyx_RefNannyDeclarations
18508 __Pyx_RefNannySetupContext(
"e (wrapper)", 0);
18509 __pyx_r = __pyx_pf_8PyClical_82e(__pyx_self, ((PyObject *)__pyx_v_obj));
18512 __Pyx_RefNannyFinishContext();
18516 static PyObject *__pyx_pf_8PyClical_82e(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18517 PyObject *__pyx_r = NULL;
18518 __Pyx_RefNannyDeclarations
18519 PyObject *__pyx_t_1 = NULL;
18520 PyObject *__pyx_t_2 = NULL;
18521 __Pyx_RefNannySetupContext(
"e", 0);
18530 __Pyx_XDECREF(__pyx_r);
18531 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1898, __pyx_L1_error)
18532 __Pyx_GOTREF(__pyx_t_1);
18533 __Pyx_INCREF(__pyx_v_obj);
18534 __Pyx_GIVEREF(__pyx_v_obj);
18535 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_obj);
18536 __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)
18537 __Pyx_GOTREF(__pyx_t_2);
18538 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18539 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1898, __pyx_L1_error)
18540 __Pyx_GOTREF(__pyx_t_1);
18541 __Pyx_GIVEREF(__pyx_t_2);
18542 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
18544 __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)
18545 __Pyx_GOTREF(__pyx_t_2);
18546 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18547 __pyx_r = __pyx_t_2;
18561 __Pyx_XDECREF(__pyx_t_1);
18562 __Pyx_XDECREF(__pyx_t_2);
18563 __Pyx_AddTraceback(
"PyClical.e", __pyx_clineno, __pyx_lineno, __pyx_filename);
18566 __Pyx_XGIVEREF(__pyx_r);
18567 __Pyx_RefNannyFinishContext();
18580 static PyObject *__pyx_pw_8PyClical_85istpq(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
18581 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 ";
18582 static PyMethodDef __pyx_mdef_8PyClical_85istpq = {
"istpq", (PyCFunction)__pyx_pw_8PyClical_85istpq, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_84istpq};
18583 static PyObject *__pyx_pw_8PyClical_85istpq(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18584 PyObject *__pyx_v_p = 0;
18585 PyObject *__pyx_v_q = 0;
18586 PyObject *__pyx_r = 0;
18587 __Pyx_RefNannyDeclarations
18588 __Pyx_RefNannySetupContext(
"istpq (wrapper)", 0);
18590 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,&__pyx_n_s_q,0};
18591 PyObject* values[2] = {0,0};
18592 if (unlikely(__pyx_kwds)) {
18593 Py_ssize_t kw_args;
18594 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
18595 switch (pos_args) {
18596 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18597 CYTHON_FALLTHROUGH;
18598 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18599 CYTHON_FALLTHROUGH;
18601 default:
goto __pyx_L5_argtuple_error;
18603 kw_args = PyDict_Size(__pyx_kwds);
18604 switch (pos_args) {
18606 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_p)) != 0)) kw_args--;
18607 else goto __pyx_L5_argtuple_error;
18608 CYTHON_FALLTHROUGH;
18610 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q)) != 0)) kw_args--;
18612 __Pyx_RaiseArgtupleInvalid(
"istpq", 1, 2, 2, 1); __PYX_ERR(0, 1900, __pyx_L3_error)
18615 if (unlikely(kw_args > 0)) {
18616 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"istpq") < 0)) __PYX_ERR(0, 1900, __pyx_L3_error)
18618 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
18619 goto __pyx_L5_argtuple_error;
18621 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18622 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18624 __pyx_v_p = values[0];
18625 __pyx_v_q = values[1];
18627 goto __pyx_L4_argument_unpacking_done;
18628 __pyx_L5_argtuple_error:;
18629 __Pyx_RaiseArgtupleInvalid(
"istpq", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1900, __pyx_L3_error)
18631 __Pyx_AddTraceback(
"PyClical.istpq", __pyx_clineno, __pyx_lineno, __pyx_filename);
18632 __Pyx_RefNannyFinishContext();
18634 __pyx_L4_argument_unpacking_done:;
18635 __pyx_r = __pyx_pf_8PyClical_84istpq(__pyx_self, __pyx_v_p, __pyx_v_q);
18638 __Pyx_RefNannyFinishContext();
18642 static PyObject *__pyx_pf_8PyClical_84istpq(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_p, PyObject *__pyx_v_q) {
18643 PyObject *__pyx_r = NULL;
18644 __Pyx_RefNannyDeclarations
18645 PyObject *__pyx_t_1 = NULL;
18646 PyObject *__pyx_t_2 = NULL;
18647 PyObject *__pyx_t_3 = NULL;
18648 __Pyx_RefNannySetupContext(
"istpq", 0);
18657 __Pyx_XDECREF(__pyx_r);
18658 __pyx_t_1 = PyNumber_Negative(__pyx_v_q);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1907, __pyx_L1_error)
18659 __Pyx_GOTREF(__pyx_t_1);
18660 __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)
18661 __Pyx_GOTREF(__pyx_t_2);
18662 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1907, __pyx_L1_error)
18663 __Pyx_GOTREF(__pyx_t_3);
18664 __Pyx_GIVEREF(__pyx_t_1);
18665 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
18666 __Pyx_GIVEREF(__pyx_t_2);
18667 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
18670 __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)
18671 __Pyx_GOTREF(__pyx_t_2);
18672 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18673 __pyx_t_3 = PySet_New(__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1907, __pyx_L1_error)
18674 __Pyx_GOTREF(__pyx_t_3);
18675 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18676 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1907, __pyx_L1_error)
18677 __Pyx_GOTREF(__pyx_t_2);
18678 __Pyx_GIVEREF(__pyx_t_3);
18679 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
18681 __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)
18682 __Pyx_GOTREF(__pyx_t_3);
18683 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18684 __pyx_r = __pyx_t_3;
18698 __Pyx_XDECREF(__pyx_t_1);
18699 __Pyx_XDECREF(__pyx_t_2);
18700 __Pyx_XDECREF(__pyx_t_3);
18701 __Pyx_AddTraceback(
"PyClical.istpq", __pyx_clineno, __pyx_lineno, __pyx_filename);
18704 __Pyx_XGIVEREF(__pyx_r);
18705 __Pyx_RefNannyFinishContext();
18718 static PyObject *__pyx_pw_8PyClical_87_test(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused);
18719 static PyMethodDef __pyx_mdef_8PyClical_87_test = {
"_test", (PyCFunction)__pyx_pw_8PyClical_87_test, METH_NOARGS, 0};
18720 static PyObject *__pyx_pw_8PyClical_87_test(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
18721 PyObject *__pyx_r = 0;
18722 __Pyx_RefNannyDeclarations
18723 __Pyx_RefNannySetupContext(
"_test (wrapper)", 0);
18724 __pyx_r = __pyx_pf_8PyClical_86_test(__pyx_self);
18727 __Pyx_RefNannyFinishContext();
18731 static PyObject *__pyx_pf_8PyClical_86_test(CYTHON_UNUSED PyObject *__pyx_self) {
18732 PyObject *__pyx_v_PyClical = NULL;
18733 PyObject *__pyx_v_doctest = NULL;
18734 PyObject *__pyx_r = NULL;
18735 __Pyx_RefNannyDeclarations
18736 PyObject *__pyx_t_1 = NULL;
18737 PyObject *__pyx_t_2 = NULL;
18738 PyObject *__pyx_t_3 = NULL;
18739 PyObject *__pyx_t_4 = NULL;
18740 __Pyx_RefNannySetupContext(
"_test", 0);
18749 __pyx_t_1 = __Pyx_Import(__pyx_n_s_PyClical, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1914, __pyx_L1_error)
18750 __Pyx_GOTREF(__pyx_t_1);
18751 __pyx_v_PyClical = __pyx_t_1;
18753 __pyx_t_1 = __Pyx_Import(__pyx_n_s_doctest, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1914, __pyx_L1_error)
18754 __Pyx_GOTREF(__pyx_t_1);
18755 __pyx_v_doctest = __pyx_t_1;
18765 __Pyx_XDECREF(__pyx_r);
18766 __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)
18767 __Pyx_GOTREF(__pyx_t_2);
18769 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
18770 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
18771 if (likely(__pyx_t_3)) {
18772 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
18773 __Pyx_INCREF(__pyx_t_3);
18774 __Pyx_INCREF(
function);
18775 __Pyx_DECREF_SET(__pyx_t_2,
function);
18779 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_PyClical);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1915, __pyx_L1_error)
18780 __Pyx_GOTREF(__pyx_t_1);
18782 #if CYTHON_FAST_PYCALL 18783 if (PyFunction_Check(__pyx_t_2)) {
18784 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_PyClical};
18785 __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)
18786 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18787 __Pyx_GOTREF(__pyx_t_1);
18790 #if CYTHON_FAST_PYCCALL 18791 if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
18792 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_PyClical};
18793 __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)
18794 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18795 __Pyx_GOTREF(__pyx_t_1);
18799 __pyx_t_4 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1915, __pyx_L1_error)
18800 __Pyx_GOTREF(__pyx_t_4);
18801 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
18802 __Pyx_INCREF(__pyx_v_PyClical);
18803 __Pyx_GIVEREF(__pyx_v_PyClical);
18804 PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_PyClical);
18805 __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)
18806 __Pyx_GOTREF(__pyx_t_1);
18807 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18810 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18811 __pyx_r = __pyx_t_1;
18825 __Pyx_XDECREF(__pyx_t_1);
18826 __Pyx_XDECREF(__pyx_t_2);
18827 __Pyx_XDECREF(__pyx_t_3);
18828 __Pyx_XDECREF(__pyx_t_4);
18829 __Pyx_AddTraceback(
"PyClical._test", __pyx_clineno, __pyx_lineno, __pyx_filename);
18832 __Pyx_XDECREF(__pyx_v_PyClical);
18833 __Pyx_XDECREF(__pyx_v_doctest);
18834 __Pyx_XGIVEREF(__pyx_r);
18835 __Pyx_RefNannyFinishContext();
18838 static struct __pyx_vtabstruct_8PyClical_index_set __pyx_vtable_8PyClical_index_set;
18840 static PyObject *__pyx_tp_new_8PyClical_index_set(PyTypeObject *t, PyObject *a, PyObject *k) {
18841 struct __pyx_obj_8PyClical_index_set *p;
18843 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
18844 o = (*t->tp_alloc)(t, 0);
18846 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
18848 if (unlikely(!o))
return 0;
18849 p = ((
struct __pyx_obj_8PyClical_index_set *)o);
18850 p->__pyx_vtab = __pyx_vtabptr_8PyClical_index_set;
18851 if (unlikely(__pyx_pw_8PyClical_9index_set_3__cinit__(o, a, k) < 0))
goto bad;
18854 Py_DECREF(o); o = 0;
18858 static void __pyx_tp_dealloc_8PyClical_index_set(PyObject *o) {
18859 #if CYTHON_USE_TP_FINALIZE 18860 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))) {
18861 if (PyObject_CallFinalizerFromDealloc(o))
return;
18865 PyObject *etype, *eval, *etb;
18866 PyErr_Fetch(&etype, &eval, &etb);
18868 __pyx_pw_8PyClical_9index_set_5__dealloc__(o);
18870 PyErr_Restore(etype, eval, etb);
18872 (*Py_TYPE(o)->tp_free)(o);
18874 static PyObject *__pyx_sq_item_8PyClical_index_set(PyObject *o, Py_ssize_t
i) {
18876 PyObject *x = PyInt_FromSsize_t(
i);
if(!x)
return 0;
18877 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
18882 static int __pyx_mp_ass_subscript_8PyClical_index_set(PyObject *o, PyObject *
i, PyObject *v) {
18884 return __pyx_pw_8PyClical_9index_set_9__setitem__(o,
i, v);
18887 PyErr_Format(PyExc_NotImplementedError,
18888 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
18893 static PyMethodDef __pyx_methods_8PyClical_index_set[] = {
18894 {
"copy", (PyCFunction)__pyx_pw_8PyClical_9index_set_1copy, METH_NOARGS, __pyx_doc_8PyClical_9index_set_copy},
18895 {
"count", (PyCFunction)__pyx_pw_8PyClical_9index_set_32count, METH_NOARGS, __pyx_doc_8PyClical_9index_set_31count},
18896 {
"count_neg", (PyCFunction)__pyx_pw_8PyClical_9index_set_34count_neg, METH_NOARGS, __pyx_doc_8PyClical_9index_set_33count_neg},
18897 {
"count_pos", (PyCFunction)__pyx_pw_8PyClical_9index_set_36count_pos, METH_NOARGS, __pyx_doc_8PyClical_9index_set_35count_pos},
18898 {
"min", (PyCFunction)__pyx_pw_8PyClical_9index_set_38min, METH_NOARGS, __pyx_doc_8PyClical_9index_set_37min},
18899 {
"max", (PyCFunction)__pyx_pw_8PyClical_9index_set_40max, METH_NOARGS, __pyx_doc_8PyClical_9index_set_39max},
18900 {
"hash_fn", (PyCFunction)__pyx_pw_8PyClical_9index_set_42hash_fn, METH_NOARGS, __pyx_doc_8PyClical_9index_set_41hash_fn},
18901 {
"sign_of_mult", (PyCFunction)__pyx_pw_8PyClical_9index_set_44sign_of_mult, METH_O, __pyx_doc_8PyClical_9index_set_43sign_of_mult},
18902 {
"sign_of_square", (PyCFunction)__pyx_pw_8PyClical_9index_set_46sign_of_square, METH_NOARGS, __pyx_doc_8PyClical_9index_set_45sign_of_square},
18903 {
"__reduce_cython__", (PyCFunction)__pyx_pw_8PyClical_9index_set_52__reduce_cython__, METH_NOARGS, 0},
18904 {
"__setstate_cython__", (PyCFunction)__pyx_pw_8PyClical_9index_set_54__setstate_cython__, METH_O, 0},
18908 static PyNumberMethods __pyx_tp_as_number_index_set = {
18912 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18922 __pyx_pw_8PyClical_9index_set_18__invert__,
18925 __pyx_pw_8PyClical_9index_set_24__and__,
18926 __pyx_pw_8PyClical_9index_set_20__xor__,
18927 __pyx_pw_8PyClical_9index_set_28__or__,
18928 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18932 #if PY_MAJOR_VERSION < 3 18938 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18941 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18947 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 18954 __pyx_pw_8PyClical_9index_set_26__iand__,
18955 __pyx_pw_8PyClical_9index_set_22__ixor__,
18956 __pyx_pw_8PyClical_9index_set_30__ior__,
18962 #if PY_VERSION_HEX >= 0x03050000 18965 #if PY_VERSION_HEX >= 0x03050000 18970 static PySequenceMethods __pyx_tp_as_sequence_index_set = {
18974 __pyx_sq_item_8PyClical_index_set,
18978 __pyx_pw_8PyClical_9index_set_13__contains__,
18983 static PyMappingMethods __pyx_tp_as_mapping_index_set = {
18985 __pyx_pw_8PyClical_9index_set_11__getitem__,
18986 __pyx_mp_ass_subscript_8PyClical_index_set,
18989 static PyTypeObject __pyx_type_8PyClical_index_set = {
18990 PyVarObject_HEAD_INIT(0, 0)
18991 "PyClical.index_set",
18992 sizeof(
struct __pyx_obj_8PyClical_index_set),
18994 __pyx_tp_dealloc_8PyClical_index_set,
18998 #if PY_MAJOR_VERSION < 3
19001 #if PY_MAJOR_VERSION >= 3
19004 __pyx_pw_8PyClical_9index_set_48__repr__,
19005 &__pyx_tp_as_number_index_set,
19006 &__pyx_tp_as_sequence_index_set,
19007 &__pyx_tp_as_mapping_index_set,
19010 __pyx_pw_8PyClical_9index_set_50__str__,
19014 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
19015 "\n Python class index_set wraps C++ class IndexSet.\n ",
19018 __pyx_pw_8PyClical_9index_set_7__richcmp__,
19020 __pyx_pw_8PyClical_9index_set_15__iter__,
19022 __pyx_methods_8PyClical_index_set,
19032 __pyx_tp_new_8PyClical_index_set,
19042 #if PY_VERSION_HEX >= 0x030400a1 19046 static struct __pyx_vtabstruct_8PyClical_clifford __pyx_vtable_8PyClical_clifford;
19048 static PyObject *__pyx_tp_new_8PyClical_clifford(PyTypeObject *t, PyObject *a, PyObject *k) {
19049 struct __pyx_obj_8PyClical_clifford *p;
19051 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
19052 o = (*t->tp_alloc)(t, 0);
19054 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
19056 if (unlikely(!o))
return 0;
19057 p = ((
struct __pyx_obj_8PyClical_clifford *)o);
19058 p->__pyx_vtab = __pyx_vtabptr_8PyClical_clifford;
19059 if (unlikely(__pyx_pw_8PyClical_8clifford_3__cinit__(o, a, k) < 0))
goto bad;
19062 Py_DECREF(o); o = 0;
19066 static void __pyx_tp_dealloc_8PyClical_clifford(PyObject *o) {
19067 #if CYTHON_USE_TP_FINALIZE 19068 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))) {
19069 if (PyObject_CallFinalizerFromDealloc(o))
return;
19073 PyObject *etype, *eval, *etb;
19074 PyErr_Fetch(&etype, &eval, &etb);
19076 __pyx_pw_8PyClical_8clifford_5__dealloc__(o);
19078 PyErr_Restore(etype, eval, etb);
19080 (*Py_TYPE(o)->tp_free)(o);
19082 static PyObject *__pyx_sq_item_8PyClical_clifford(PyObject *o, Py_ssize_t
i) {
19084 PyObject *x = PyInt_FromSsize_t(
i);
if(!x)
return 0;
19085 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
19090 static PyMethodDef __pyx_methods_8PyClical_clifford[] = {
19091 {
"copy", (PyCFunction)__pyx_pw_8PyClical_8clifford_1copy, METH_NOARGS, __pyx_doc_8PyClical_8clifford_copy},
19092 {
"reframe", (PyCFunction)__pyx_pw_8PyClical_8clifford_11reframe, METH_O, __pyx_doc_8PyClical_8clifford_10reframe},
19093 {
"inv", (PyCFunction)__pyx_pw_8PyClical_8clifford_49inv, METH_NOARGS, __pyx_doc_8PyClical_8clifford_48inv},
19094 {
"pow", (PyCFunction)__pyx_pw_8PyClical_8clifford_57pow, METH_O, __pyx_doc_8PyClical_8clifford_56pow},
19095 {
"outer_pow", (PyCFunction)__pyx_pw_8PyClical_8clifford_59outer_pow, METH_O, __pyx_doc_8PyClical_8clifford_58outer_pow},
19096 {
"scalar", (PyCFunction)__pyx_pw_8PyClical_8clifford_63scalar, METH_NOARGS, __pyx_doc_8PyClical_8clifford_62scalar},
19097 {
"pure", (PyCFunction)__pyx_pw_8PyClical_8clifford_65pure, METH_NOARGS, __pyx_doc_8PyClical_8clifford_64pure},
19098 {
"even", (PyCFunction)__pyx_pw_8PyClical_8clifford_67even, METH_NOARGS, __pyx_doc_8PyClical_8clifford_66even},
19099 {
"odd", (PyCFunction)__pyx_pw_8PyClical_8clifford_69odd, METH_NOARGS, __pyx_doc_8PyClical_8clifford_68odd},
19100 {
"vector_part", (PyCFunction)__pyx_pw_8PyClical_8clifford_71vector_part, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_8clifford_70vector_part},
19101 {
"involute", (PyCFunction)__pyx_pw_8PyClical_8clifford_73involute, METH_NOARGS, __pyx_doc_8PyClical_8clifford_72involute},
19102 {
"reverse", (PyCFunction)__pyx_pw_8PyClical_8clifford_75reverse, METH_NOARGS, __pyx_doc_8PyClical_8clifford_74reverse},
19103 {
"conj", (PyCFunction)__pyx_pw_8PyClical_8clifford_77conj, METH_NOARGS, __pyx_doc_8PyClical_8clifford_76conj},
19104 {
"quad", (PyCFunction)__pyx_pw_8PyClical_8clifford_79quad, METH_NOARGS, __pyx_doc_8PyClical_8clifford_78quad},
19105 {
"norm", (PyCFunction)__pyx_pw_8PyClical_8clifford_81norm, METH_NOARGS, __pyx_doc_8PyClical_8clifford_80norm},
19106 {
"abs", (PyCFunction)__pyx_pw_8PyClical_8clifford_83abs, METH_NOARGS, __pyx_doc_8PyClical_8clifford_82abs},
19107 {
"max_abs", (PyCFunction)__pyx_pw_8PyClical_8clifford_85max_abs, METH_NOARGS, __pyx_doc_8PyClical_8clifford_84max_abs},
19108 {
"truncated", (PyCFunction)__pyx_pw_8PyClical_8clifford_87truncated, METH_O, __pyx_doc_8PyClical_8clifford_86truncated},
19109 {
"isnan", (PyCFunction)__pyx_pw_8PyClical_8clifford_89isnan, METH_NOARGS, __pyx_doc_8PyClical_8clifford_88isnan},
19110 {
"frame", (PyCFunction)__pyx_pw_8PyClical_8clifford_91frame, METH_NOARGS, __pyx_doc_8PyClical_8clifford_90frame},
19111 {
"__reduce_cython__", (PyCFunction)__pyx_pw_8PyClical_8clifford_97__reduce_cython__, METH_NOARGS, 0},
19112 {
"__setstate_cython__", (PyCFunction)__pyx_pw_8PyClical_8clifford_99__setstate_cython__, METH_O, 0},
19116 static PyNumberMethods __pyx_tp_as_number_clifford = {
19117 __pyx_pw_8PyClical_8clifford_21__add__,
19118 __pyx_pw_8PyClical_8clifford_25__sub__,
19119 __pyx_pw_8PyClical_8clifford_29__mul__,
19120 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 19121 __pyx_pw_8PyClical_8clifford_45__div__,
19123 __pyx_pw_8PyClical_8clifford_33__mod__,
19125 __pyx_pw_8PyClical_8clifford_55__pow__,
19126 __pyx_pw_8PyClical_8clifford_17__neg__,
19127 __pyx_pw_8PyClical_8clifford_19__pos__,
19133 __pyx_pw_8PyClical_8clifford_37__and__,
19134 __pyx_pw_8PyClical_8clifford_41__xor__,
19135 __pyx_pw_8PyClical_8clifford_51__or__,
19136 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 19140 #if PY_MAJOR_VERSION < 3 19146 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 19149 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 19152 __pyx_pw_8PyClical_8clifford_23__iadd__,
19153 __pyx_pw_8PyClical_8clifford_27__isub__,
19154 __pyx_pw_8PyClical_8clifford_31__imul__,
19155 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 19156 __pyx_pw_8PyClical_8clifford_47__idiv__,
19158 __pyx_pw_8PyClical_8clifford_35__imod__,
19162 __pyx_pw_8PyClical_8clifford_39__iand__,
19163 __pyx_pw_8PyClical_8clifford_43__ixor__,
19164 __pyx_pw_8PyClical_8clifford_53__ior__,
19170 #if PY_VERSION_HEX >= 0x03050000 19173 #if PY_VERSION_HEX >= 0x03050000 19178 static PySequenceMethods __pyx_tp_as_sequence_clifford = {
19182 __pyx_sq_item_8PyClical_clifford,
19186 __pyx_pw_8PyClical_8clifford_7__contains__,
19191 static PyMappingMethods __pyx_tp_as_mapping_clifford = {
19193 __pyx_pw_8PyClical_8clifford_15__getitem__,
19197 static PyTypeObject __pyx_type_8PyClical_clifford = {
19198 PyVarObject_HEAD_INIT(0, 0)
19199 "PyClical.clifford",
19200 sizeof(
struct __pyx_obj_8PyClical_clifford),
19202 __pyx_tp_dealloc_8PyClical_clifford,
19206 #if PY_MAJOR_VERSION < 3
19209 #if PY_MAJOR_VERSION >= 3
19212 __pyx_pw_8PyClical_8clifford_93__repr__,
19213 &__pyx_tp_as_number_clifford,
19214 &__pyx_tp_as_sequence_clifford,
19215 &__pyx_tp_as_mapping_clifford,
19217 __pyx_pw_8PyClical_8clifford_61__call__,
19218 __pyx_pw_8PyClical_8clifford_95__str__,
19222 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
19223 "\n Python class clifford wraps C++ class Clifford.\n ",
19226 __pyx_pw_8PyClical_8clifford_13__richcmp__,
19228 __pyx_pw_8PyClical_8clifford_9__iter__,
19230 __pyx_methods_8PyClical_clifford,
19240 __pyx_tp_new_8PyClical_clifford,
19250 #if PY_VERSION_HEX >= 0x030400a1 19255 static struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *__pyx_freelist_8PyClical___pyx_scope_struct____iter__[8];
19256 static int __pyx_freecount_8PyClical___pyx_scope_struct____iter__ = 0;
19258 static PyObject *__pyx_tp_new_8PyClical___pyx_scope_struct____iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
19260 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__)))) {
19261 o = (PyObject*)__pyx_freelist_8PyClical___pyx_scope_struct____iter__[--__pyx_freecount_8PyClical___pyx_scope_struct____iter__];
19262 memset(o, 0,
sizeof(
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__));
19263 (void) PyObject_INIT(o, t);
19264 PyObject_GC_Track(o);
19266 o = (*t->tp_alloc)(t, 0);
19267 if (unlikely(!o))
return 0;
19272 static void __pyx_tp_dealloc_8PyClical___pyx_scope_struct____iter__(PyObject *o) {
19273 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *p = (
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)o;
19274 PyObject_GC_UnTrack(o);
19275 Py_CLEAR(p->__pyx_v_idx);
19276 Py_CLEAR(p->__pyx_v_self);
19277 Py_CLEAR(p->__pyx_t_0);
19278 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__)))) {
19279 __pyx_freelist_8PyClical___pyx_scope_struct____iter__[__pyx_freecount_8PyClical___pyx_scope_struct____iter__++] = ((
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)o);
19281 (*Py_TYPE(o)->tp_free)(o);
19285 static int __pyx_tp_traverse_8PyClical___pyx_scope_struct____iter__(PyObject *o, visitproc v,
void *a) {
19287 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *p = (
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)o;
19288 if (p->__pyx_v_idx) {
19289 e = (*v)(p->__pyx_v_idx, a);
if (
e)
return e;
19291 if (p->__pyx_v_self) {
19292 e = (*v)(((PyObject *)p->__pyx_v_self), a);
if (
e)
return e;
19294 if (p->__pyx_t_0) {
19295 e = (*v)(p->__pyx_t_0, a);
if (
e)
return e;
19300 static PyTypeObject __pyx_type_8PyClical___pyx_scope_struct____iter__ = {
19301 PyVarObject_HEAD_INIT(0, 0)
19302 "PyClical.__pyx_scope_struct____iter__",
19303 sizeof(
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__),
19305 __pyx_tp_dealloc_8PyClical___pyx_scope_struct____iter__,
19309 #if PY_MAJOR_VERSION < 3
19312 #if PY_MAJOR_VERSION >= 3
19325 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
19327 __pyx_tp_traverse_8PyClical___pyx_scope_struct____iter__,
19343 __pyx_tp_new_8PyClical___pyx_scope_struct____iter__,
19353 #if PY_VERSION_HEX >= 0x030400a1 19358 static PyMethodDef __pyx_methods[] = {
19359 {
"compare", (PyCFunction)__pyx_pw_8PyClical_3compare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_2compare},
19360 {
"min_neg", (PyCFunction)__pyx_pw_8PyClical_5min_neg, METH_O, __pyx_doc_8PyClical_4min_neg},
19361 {
"max_pos", (PyCFunction)__pyx_pw_8PyClical_7max_pos, METH_O, __pyx_doc_8PyClical_6max_pos},
19362 {
"inv", (PyCFunction)__pyx_pw_8PyClical_11inv, METH_O, __pyx_doc_8PyClical_10inv},
19363 {
"scalar", (PyCFunction)__pyx_pw_8PyClical_13scalar, METH_O, __pyx_doc_8PyClical_12scalar},
19364 {
"real", (PyCFunction)__pyx_pw_8PyClical_15real, METH_O, __pyx_doc_8PyClical_14real},
19365 {
"imag", (PyCFunction)__pyx_pw_8PyClical_17imag, METH_O, __pyx_doc_8PyClical_16imag},
19366 {
"pure", (PyCFunction)__pyx_pw_8PyClical_19pure, METH_O, __pyx_doc_8PyClical_18pure},
19367 {
"even", (PyCFunction)__pyx_pw_8PyClical_21even, METH_O, __pyx_doc_8PyClical_20even},
19368 {
"odd", (PyCFunction)__pyx_pw_8PyClical_23odd, METH_O, __pyx_doc_8PyClical_22odd},
19369 {
"involute", (PyCFunction)__pyx_pw_8PyClical_25involute, METH_O, __pyx_doc_8PyClical_24involute},
19370 {
"reverse", (PyCFunction)__pyx_pw_8PyClical_27reverse, METH_O, __pyx_doc_8PyClical_26reverse},
19371 {
"conj", (PyCFunction)__pyx_pw_8PyClical_29conj, METH_O, __pyx_doc_8PyClical_28conj},
19372 {
"quad", (PyCFunction)__pyx_pw_8PyClical_31quad, METH_O, __pyx_doc_8PyClical_30quad},
19373 {
"norm", (PyCFunction)__pyx_pw_8PyClical_33norm, METH_O, __pyx_doc_8PyClical_32norm},
19374 {
"abs", (PyCFunction)__pyx_pw_8PyClical_35abs, METH_O, __pyx_doc_8PyClical_34abs},
19375 {
"max_abs", (PyCFunction)__pyx_pw_8PyClical_37max_abs, METH_O, __pyx_doc_8PyClical_36max_abs},
19376 {
"pow", (PyCFunction)__pyx_pw_8PyClical_39pow, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_38pow},
19377 {
"outer_pow", (PyCFunction)__pyx_pw_8PyClical_41outer_pow, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_40outer_pow},
19378 {
"complexifier", (PyCFunction)__pyx_pw_8PyClical_43complexifier, METH_O, __pyx_doc_8PyClical_42complexifier},
19379 {
"sqrt", (PyCFunction)__pyx_pw_8PyClical_45sqrt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_44sqrt},
19380 {
"exp", (PyCFunction)__pyx_pw_8PyClical_47exp, METH_O, __pyx_doc_8PyClical_46exp},
19381 {
"log", (PyCFunction)__pyx_pw_8PyClical_49log, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_48log},
19382 {
"cos", (PyCFunction)__pyx_pw_8PyClical_51cos, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_50cos},
19383 {
"acos", (PyCFunction)__pyx_pw_8PyClical_53acos, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_52acos},
19384 {
"cosh", (PyCFunction)__pyx_pw_8PyClical_55cosh, METH_O, __pyx_doc_8PyClical_54cosh},
19385 {
"acosh", (PyCFunction)__pyx_pw_8PyClical_57acosh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_56acosh},
19386 {
"sin", (PyCFunction)__pyx_pw_8PyClical_59sin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_58sin},
19387 {
"asin", (PyCFunction)__pyx_pw_8PyClical_61asin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_60asin},
19388 {
"sinh", (PyCFunction)__pyx_pw_8PyClical_63sinh, METH_O, __pyx_doc_8PyClical_62sinh},
19389 {
"asinh", (PyCFunction)__pyx_pw_8PyClical_65asinh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_64asinh},
19390 {
"tan", (PyCFunction)__pyx_pw_8PyClical_67tan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_66tan},
19391 {
"atan", (PyCFunction)__pyx_pw_8PyClical_69atan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_68atan},
19392 {
"tanh", (PyCFunction)__pyx_pw_8PyClical_71tanh, METH_O, __pyx_doc_8PyClical_70tanh},
19393 {
"atanh", (PyCFunction)__pyx_pw_8PyClical_73atanh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_72atanh},
19394 {
"random_clifford", (PyCFunction)__pyx_pw_8PyClical_75random_clifford, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_74random_clifford},
19395 {
"cga3", (PyCFunction)__pyx_pw_8PyClical_77cga3, METH_O, __pyx_doc_8PyClical_76cga3},
19396 {
"cga3std", (PyCFunction)__pyx_pw_8PyClical_79cga3std, METH_O, __pyx_doc_8PyClical_78cga3std},
19397 {
"agc3", (PyCFunction)__pyx_pw_8PyClical_81agc3, METH_O, __pyx_doc_8PyClical_80agc3},
19401 #if PY_MAJOR_VERSION >= 3 19402 #if CYTHON_PEP489_MULTI_PHASE_INIT 19403 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
19404 static int __pyx_pymod_exec_PyClical(PyObject* module);
19405 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
19406 {Py_mod_create, (
void*)__pyx_pymod_create},
19407 {Py_mod_exec, (
void*)__pyx_pymod_exec_PyClical},
19412 static struct PyModuleDef __pyx_moduledef = {
19413 PyModuleDef_HEAD_INIT,
19416 #if CYTHON_PEP489_MULTI_PHASE_INIT 19422 #if CYTHON_PEP489_MULTI_PHASE_INIT 19423 __pyx_moduledef_slots,
19433 static __Pyx_StringTabEntry __pyx_string_tab[] = {
19434 {&__pyx_kp_s_, __pyx_k_,
sizeof(__pyx_k_), 0, 0, 1, 0},
19435 {&__pyx_kp_s_0_8_2, __pyx_k_0_8_2,
sizeof(__pyx_k_0_8_2), 0, 0, 1, 0},
19436 {&__pyx_kp_u_Abbreviation_for_clifford_index, __pyx_k_Abbreviation_for_clifford_index,
sizeof(__pyx_k_Abbreviation_for_clifford_index), 0, 1, 0, 0},
19437 {&__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},
19438 {&__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},
19439 {&__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},
19440 {&__pyx_kp_s_Cannot_initialize_clifford_objec, __pyx_k_Cannot_initialize_clifford_objec,
sizeof(__pyx_k_Cannot_initialize_clifford_objec), 0, 0, 1, 0},
19441 {&__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},
19442 {&__pyx_kp_s_Cannot_reframe, __pyx_k_Cannot_reframe,
sizeof(__pyx_k_Cannot_reframe), 0, 0, 1, 0},
19443 {&__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},
19444 {&__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},
19445 {&__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},
19446 {&__pyx_kp_u_Conjugation_reverse_o_involute, __pyx_k_Conjugation_reverse_o_involute,
sizeof(__pyx_k_Conjugation_reverse_o_involute), 0, 1, 0, 0},
19447 {&__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},
19448 {&__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},
19449 {&__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},
19450 {&__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},
19451 {&__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},
19452 {&__pyx_kp_u_Convert_Euclidean_3D_multivecto, __pyx_k_Convert_Euclidean_3D_multivecto,
sizeof(__pyx_k_Convert_Euclidean_3D_multivecto), 0, 1, 0, 0},
19453 {&__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},
19454 {&__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},
19455 {&__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},
19456 {&__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},
19457 {&__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},
19458 {&__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},
19459 {&__pyx_kp_u_Geometric_difference_print_clif, __pyx_k_Geometric_difference_print_clif,
sizeof(__pyx_k_Geometric_difference_print_clif), 0, 1, 0, 0},
19460 {&__pyx_kp_u_Geometric_difference_x_clifford, __pyx_k_Geometric_difference_x_clifford,
sizeof(__pyx_k_Geometric_difference_x_clifford), 0, 1, 0, 0},
19461 {&__pyx_kp_u_Geometric_multiplicative_invers, __pyx_k_Geometric_multiplicative_invers,
sizeof(__pyx_k_Geometric_multiplicative_invers), 0, 1, 0, 0},
19462 {&__pyx_kp_u_Geometric_multiplicative_invers_2, __pyx_k_Geometric_multiplicative_invers_2,
sizeof(__pyx_k_Geometric_multiplicative_invers_2), 0, 1, 0, 0},
19463 {&__pyx_kp_u_Geometric_product_print_cliffor, __pyx_k_Geometric_product_print_cliffor,
sizeof(__pyx_k_Geometric_product_print_cliffor), 0, 1, 0, 0},
19464 {&__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},
19465 {&__pyx_kp_u_Geometric_quotient_print_cliffo, __pyx_k_Geometric_quotient_print_cliffo,
sizeof(__pyx_k_Geometric_quotient_print_cliffo), 0, 1, 0, 0},
19466 {&__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},
19467 {&__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},
19468 {&__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},
19469 {&__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},
19470 {&__pyx_kp_u_Hyperbolic_cosine_of_multivecto, __pyx_k_Hyperbolic_cosine_of_multivecto,
sizeof(__pyx_k_Hyperbolic_cosine_of_multivecto), 0, 1, 0, 0},
19471 {&__pyx_kp_u_Hyperbolic_sine_of_multivector, __pyx_k_Hyperbolic_sine_of_multivector,
sizeof(__pyx_k_Hyperbolic_sine_of_multivector), 0, 1, 0, 0},
19472 {&__pyx_kp_u_Hyperbolic_tangent_of_multivect, __pyx_k_Hyperbolic_tangent_of_multivect,
sizeof(__pyx_k_Hyperbolic_tangent_of_multivect), 0, 1, 0, 0},
19473 {&__pyx_kp_u_Imaginary_part_deprecated_alway, __pyx_k_Imaginary_part_deprecated_alway,
sizeof(__pyx_k_Imaginary_part_deprecated_alway), 0, 1, 0, 0},
19474 {&__pyx_n_s_IndexError, __pyx_k_IndexError,
sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
19475 {&__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},
19476 {&__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},
19477 {&__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},
19478 {&__pyx_n_s_Integral, __pyx_k_Integral,
sizeof(__pyx_k_Integral), 0, 0, 1, 1},
19479 {&__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},
19480 {&__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},
19481 {&__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},
19482 {&__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},
19483 {&__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},
19484 {&__pyx_kp_u_Inverse_tangent_of_multivector, __pyx_k_Inverse_tangent_of_multivector,
sizeof(__pyx_k_Inverse_tangent_of_multivector), 0, 1, 0, 0},
19485 {&__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},
19486 {&__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},
19487 {&__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},
19488 {&__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},
19489 {&__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},
19490 {&__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},
19491 {&__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},
19492 {&__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},
19493 {&__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},
19494 {&__pyx_kp_u_Natural_logarithm_of_multivecto, __pyx_k_Natural_logarithm_of_multivecto,
sizeof(__pyx_k_Natural_logarithm_of_multivecto), 0, 1, 0, 0},
19495 {&__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},
19496 {&__pyx_n_s_NotImplemented, __pyx_k_NotImplemented,
sizeof(__pyx_k_NotImplemented), 0, 0, 1, 1},
19497 {&__pyx_kp_s_Not_applicable, __pyx_k_Not_applicable,
sizeof(__pyx_k_Not_applicable), 0, 0, 1, 0},
19498 {&__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},
19499 {&__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},
19500 {&__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},
19501 {&__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},
19502 {&__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},
19503 {&__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},
19504 {&__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},
19505 {&__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},
19506 {&__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},
19507 {&__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},
19508 {&__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},
19509 {&__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},
19510 {&__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},
19511 {&__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},
19512 {&__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},
19513 {&__pyx_n_s_PyClical, __pyx_k_PyClical,
sizeof(__pyx_k_PyClical), 0, 0, 1, 1},
19514 {&__pyx_kp_s_PyClical_pyx, __pyx_k_PyClical_pyx,
sizeof(__pyx_k_PyClical_pyx), 0, 0, 1, 0},
19515 {&__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},
19516 {&__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},
19517 {&__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},
19518 {&__pyx_n_s_Real, __pyx_k_Real,
sizeof(__pyx_k_Real), 0, 0, 1, 1},
19519 {&__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},
19520 {&__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},
19521 {&__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},
19522 {&__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},
19523 {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError,
sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
19524 {&__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},
19525 {&__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},
19526 {&__pyx_n_s_Sequence, __pyx_k_Sequence,
sizeof(__pyx_k_Sequence), 0, 0, 1, 1},
19527 {&__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},
19528 {&__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},
19529 {&__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},
19530 {&__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},
19531 {&__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},
19532 {&__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},
19533 {&__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},
19534 {&__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},
19535 {&__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},
19536 {&__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},
19537 {&__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},
19538 {&__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},
19539 {&__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},
19540 {&__pyx_kp_u_Symmetric_set_difference_exclus, __pyx_k_Symmetric_set_difference_exclus,
sizeof(__pyx_k_Symmetric_set_difference_exclus), 0, 1, 0, 0},
19541 {&__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},
19542 {&__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},
19543 {&__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},
19544 {&__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},
19545 {&__pyx_kp_u_The_informal_string_representat, __pyx_k_The_informal_string_representat,
sizeof(__pyx_k_The_informal_string_representat), 0, 1, 0, 0},
19546 {&__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},
19547 {&__pyx_kp_u_The_official_string_representat, __pyx_k_The_official_string_representat,
sizeof(__pyx_k_The_official_string_representat), 0, 1, 0, 0},
19548 {&__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},
19549 {&__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},
19550 {&__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},
19551 {&__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},
19552 {&__pyx_n_s_TypeError, __pyx_k_TypeError,
sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
19553 {&__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},
19554 {&__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},
19555 {&__pyx_n_s_ValueError, __pyx_k_ValueError,
sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
19556 {&__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},
19557 {&__pyx_kp_s__2, __pyx_k__2,
sizeof(__pyx_k__2), 0, 0, 1, 0},
19558 {&__pyx_kp_s__5, __pyx_k__5,
sizeof(__pyx_k__5), 0, 0, 1, 0},
19559 {&__pyx_kp_s__6, __pyx_k__6,
sizeof(__pyx_k__6), 0, 0, 1, 0},
19560 {&__pyx_kp_s__7, __pyx_k__7,
sizeof(__pyx_k__7), 0, 0, 1, 0},
19561 {&__pyx_kp_s__8, __pyx_k__8,
sizeof(__pyx_k__8), 0, 0, 1, 0},
19562 {&__pyx_kp_s__9, __pyx_k__9,
sizeof(__pyx_k__9), 0, 0, 1, 0},
19563 {&__pyx_kp_u_abs_line_1473, __pyx_k_abs_line_1473,
sizeof(__pyx_k_abs_line_1473), 0, 1, 0, 0},
19564 {&__pyx_n_s_acos, __pyx_k_acos,
sizeof(__pyx_k_acos), 0, 0, 1, 1},
19565 {&__pyx_kp_u_acos_line_1619, __pyx_k_acos_line_1619,
sizeof(__pyx_k_acos_line_1619), 0, 1, 0, 0},
19566 {&__pyx_n_s_acosh, __pyx_k_acosh,
sizeof(__pyx_k_acosh), 0, 0, 1, 1},
19567 {&__pyx_kp_u_acosh_line_1656, __pyx_k_acosh_line_1656,
sizeof(__pyx_k_acosh_line_1656), 0, 1, 0, 0},
19568 {&__pyx_kp_u_agc3_line_1844, __pyx_k_agc3_line_1844,
sizeof(__pyx_k_agc3_line_1844), 0, 1, 0, 0},
19569 {&__pyx_n_s_args, __pyx_k_args,
sizeof(__pyx_k_args), 0, 0, 1, 1},
19570 {&__pyx_kp_s_as_frame, __pyx_k_as_frame,
sizeof(__pyx_k_as_frame), 0, 0, 1, 0},
19571 {&__pyx_n_s_asin, __pyx_k_asin,
sizeof(__pyx_k_asin), 0, 0, 1, 1},
19572 {&__pyx_kp_u_asin_line_1698, __pyx_k_asin_line_1698,
sizeof(__pyx_k_asin_line_1698), 0, 1, 0, 0},
19573 {&__pyx_n_s_asinh, __pyx_k_asinh,
sizeof(__pyx_k_asinh), 0, 0, 1, 1},
19574 {&__pyx_kp_u_asinh_line_1733, __pyx_k_asinh_line_1733,
sizeof(__pyx_k_asinh_line_1733), 0, 1, 0, 0},
19575 {&__pyx_n_s_atan, __pyx_k_atan,
sizeof(__pyx_k_atan), 0, 0, 1, 1},
19576 {&__pyx_kp_u_atan_line_1769, __pyx_k_atan_line_1769,
sizeof(__pyx_k_atan_line_1769), 0, 1, 0, 0},
19577 {&__pyx_n_s_atanh, __pyx_k_atanh,
sizeof(__pyx_k_atanh), 0, 0, 1, 1},
19578 {&__pyx_kp_u_atanh_line_1798, __pyx_k_atanh_line_1798,
sizeof(__pyx_k_atanh_line_1798), 0, 1, 0, 0},
19579 {&__pyx_kp_u_cga3_line_1824, __pyx_k_cga3_line_1824,
sizeof(__pyx_k_cga3_line_1824), 0, 1, 0, 0},
19580 {&__pyx_kp_u_cga3std_line_1833, __pyx_k_cga3std_line_1833,
sizeof(__pyx_k_cga3std_line_1833), 0, 1, 0, 0},
19581 {&__pyx_n_s_cl, __pyx_k_cl,
sizeof(__pyx_k_cl), 0, 0, 1, 1},
19582 {&__pyx_kp_u_clifford___add___line_739, __pyx_k_clifford___add___line_739,
sizeof(__pyx_k_clifford___add___line_739), 0, 1, 0, 0},
19583 {&__pyx_kp_u_clifford___and___line_835, __pyx_k_clifford___and___line_835,
sizeof(__pyx_k_clifford___and___line_835), 0, 1, 0, 0},
19584 {&__pyx_kp_u_clifford___call___line_1019, __pyx_k_clifford___call___line_1019,
sizeof(__pyx_k_clifford___call___line_1019), 0, 1, 0, 0},
19585 {&__pyx_kp_u_clifford___div___line_895, __pyx_k_clifford___div___line_895,
sizeof(__pyx_k_clifford___div___line_895), 0, 1, 0, 0},
19586 {&__pyx_kp_u_clifford___getitem___line_706, __pyx_k_clifford___getitem___line_706,
sizeof(__pyx_k_clifford___getitem___line_706), 0, 1, 0, 0},
19587 {&__pyx_kp_u_clifford___iadd___line_750, __pyx_k_clifford___iadd___line_750,
sizeof(__pyx_k_clifford___iadd___line_750), 0, 1, 0, 0},
19588 {&__pyx_kp_u_clifford___iand___line_850, __pyx_k_clifford___iand___line_850,
sizeof(__pyx_k_clifford___iand___line_850), 0, 1, 0, 0},
19589 {&__pyx_kp_u_clifford___idiv___line_910, __pyx_k_clifford___idiv___line_910,
sizeof(__pyx_k_clifford___idiv___line_910), 0, 1, 0, 0},
19590 {&__pyx_kp_u_clifford___imod___line_820, __pyx_k_clifford___imod___line_820,
sizeof(__pyx_k_clifford___imod___line_820), 0, 1, 0, 0},
19591 {&__pyx_kp_u_clifford___imul___line_792, __pyx_k_clifford___imul___line_792,
sizeof(__pyx_k_clifford___imul___line_792), 0, 1, 0, 0},
19592 {&__pyx_kp_u_clifford___ior___line_949, __pyx_k_clifford___ior___line_949,
sizeof(__pyx_k_clifford___ior___line_949), 0, 1, 0, 0},
19593 {&__pyx_kp_u_clifford___isub___line_770, __pyx_k_clifford___isub___line_770,
sizeof(__pyx_k_clifford___isub___line_770), 0, 1, 0, 0},
19594 {&__pyx_kp_u_clifford___iter___line_637, __pyx_k_clifford___iter___line_637,
sizeof(__pyx_k_clifford___iter___line_637), 0, 1, 0, 0},
19595 {&__pyx_kp_u_clifford___ixor___line_880, __pyx_k_clifford___ixor___line_880,
sizeof(__pyx_k_clifford___ixor___line_880), 0, 1, 0, 0},
19596 {&__pyx_kp_u_clifford___mod___line_805, __pyx_k_clifford___mod___line_805,
sizeof(__pyx_k_clifford___mod___line_805), 0, 1, 0, 0},
19597 {&__pyx_kp_u_clifford___mul___line_779, __pyx_k_clifford___mul___line_779,
sizeof(__pyx_k_clifford___mul___line_779), 0, 1, 0, 0},
19598 {&__pyx_kp_u_clifford___neg___line_721, __pyx_k_clifford___neg___line_721,
sizeof(__pyx_k_clifford___neg___line_721), 0, 1, 0, 0},
19599 {&__pyx_kp_u_clifford___or___line_938, __pyx_k_clifford___or___line_938,
sizeof(__pyx_k_clifford___or___line_938), 0, 1, 0, 0},
19600 {&__pyx_kp_u_clifford___pos___line_730, __pyx_k_clifford___pos___line_730,
sizeof(__pyx_k_clifford___pos___line_730), 0, 1, 0, 0},
19601 {&__pyx_kp_u_clifford___pow___line_960, __pyx_k_clifford___pow___line_960,
sizeof(__pyx_k_clifford___pow___line_960), 0, 1, 0, 0},
19602 {&__pyx_kp_u_clifford___repr___line_1225, __pyx_k_clifford___repr___line_1225,
sizeof(__pyx_k_clifford___repr___line_1225), 0, 1, 0, 0},
19603 {&__pyx_kp_u_clifford___str___line_1234, __pyx_k_clifford___str___line_1234,
sizeof(__pyx_k_clifford___str___line_1234), 0, 1, 0, 0},
19604 {&__pyx_kp_u_clifford___sub___line_759, __pyx_k_clifford___sub___line_759,
sizeof(__pyx_k_clifford___sub___line_759), 0, 1, 0, 0},
19605 {&__pyx_kp_u_clifford___xor___line_865, __pyx_k_clifford___xor___line_865,
sizeof(__pyx_k_clifford___xor___line_865), 0, 1, 0, 0},
19606 {&__pyx_kp_u_clifford_abs_line_1174, __pyx_k_clifford_abs_line_1174,
sizeof(__pyx_k_clifford_abs_line_1174), 0, 1, 0, 0},
19607 {&__pyx_kp_u_clifford_conj_line_1137, __pyx_k_clifford_conj_line_1137,
sizeof(__pyx_k_clifford_conj_line_1137), 0, 1, 0, 0},
19608 {&__pyx_kp_u_clifford_copy_line_554, __pyx_k_clifford_copy_line_554,
sizeof(__pyx_k_clifford_copy_line_554), 0, 1, 0, 0},
19609 {&__pyx_kp_u_clifford_even_line_1060, __pyx_k_clifford_even_line_1060,
sizeof(__pyx_k_clifford_even_line_1060), 0, 1, 0, 0},
19610 {&__pyx_kp_u_clifford_frame_line_1214, __pyx_k_clifford_frame_line_1214,
sizeof(__pyx_k_clifford_frame_line_1214), 0, 1, 0, 0},
19611 {&__pyx_n_s_clifford_hidden_doctests, __pyx_k_clifford_hidden_doctests,
sizeof(__pyx_k_clifford_hidden_doctests), 0, 0, 1, 1},
19612 {&__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},
19613 {&__pyx_kp_u_clifford_inv_line_925, __pyx_k_clifford_inv_line_925,
sizeof(__pyx_k_clifford_inv_line_925), 0, 1, 0, 0},
19614 {&__pyx_kp_u_clifford_involute_line_1106, __pyx_k_clifford_involute_line_1106,
sizeof(__pyx_k_clifford_involute_line_1106), 0, 1, 0, 0},
19615 {&__pyx_kp_u_clifford_isnan_line_1205, __pyx_k_clifford_isnan_line_1205,
sizeof(__pyx_k_clifford_isnan_line_1205), 0, 1, 0, 0},
19616 {&__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},
19617 {&__pyx_kp_u_clifford_norm_line_1163, __pyx_k_clifford_norm_line_1163,
sizeof(__pyx_k_clifford_norm_line_1163), 0, 1, 0, 0},
19618 {&__pyx_kp_u_clifford_odd_line_1069, __pyx_k_clifford_odd_line_1069,
sizeof(__pyx_k_clifford_odd_line_1069), 0, 1, 0, 0},
19619 {&__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},
19620 {&__pyx_kp_u_clifford_pow_line_979, __pyx_k_clifford_pow_line_979,
sizeof(__pyx_k_clifford_pow_line_979), 0, 1, 0, 0},
19621 {&__pyx_kp_u_clifford_pure_line_1049, __pyx_k_clifford_pure_line_1049,
sizeof(__pyx_k_clifford_pure_line_1049), 0, 1, 0, 0},
19622 {&__pyx_kp_u_clifford_quad_line_1152, __pyx_k_clifford_quad_line_1152,
sizeof(__pyx_k_clifford_quad_line_1152), 0, 1, 0, 0},
19623 {&__pyx_kp_u_clifford_reframe_line_648, __pyx_k_clifford_reframe_line_648,
sizeof(__pyx_k_clifford_reframe_line_648), 0, 1, 0, 0},
19624 {&__pyx_kp_u_clifford_reverse_line_1122, __pyx_k_clifford_reverse_line_1122,
sizeof(__pyx_k_clifford_reverse_line_1122), 0, 1, 0, 0},
19625 {&__pyx_kp_u_clifford_scalar_line_1038, __pyx_k_clifford_scalar_line_1038,
sizeof(__pyx_k_clifford_scalar_line_1038), 0, 1, 0, 0},
19626 {&__pyx_kp_u_clifford_truncated_line_1194, __pyx_k_clifford_truncated_line_1194,
sizeof(__pyx_k_clifford_truncated_line_1194), 0, 1, 0, 0},
19627 {&__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},
19628 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback,
sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
19629 {&__pyx_n_s_close, __pyx_k_close,
sizeof(__pyx_k_close), 0, 0, 1, 1},
19630 {&__pyx_n_s_collections, __pyx_k_collections,
sizeof(__pyx_k_collections), 0, 0, 1, 1},
19631 {&__pyx_kp_u_compare_line_490, __pyx_k_compare_line_490,
sizeof(__pyx_k_compare_line_490), 0, 1, 0, 0},
19632 {&__pyx_kp_u_complexifier_line_1527, __pyx_k_complexifier_line_1527,
sizeof(__pyx_k_complexifier_line_1527), 0, 1, 0, 0},
19633 {&__pyx_n_s_conj, __pyx_k_conj,
sizeof(__pyx_k_conj), 0, 0, 1, 1},
19634 {&__pyx_kp_u_conj_line_1436, __pyx_k_conj_line_1436,
sizeof(__pyx_k_conj_line_1436), 0, 1, 0, 0},
19635 {&__pyx_n_s_copy, __pyx_k_copy,
sizeof(__pyx_k_copy), 0, 0, 1, 1},
19636 {&__pyx_n_s_cos, __pyx_k_cos,
sizeof(__pyx_k_cos), 0, 0, 1, 1},
19637 {&__pyx_kp_u_cos_line_1602, __pyx_k_cos_line_1602,
sizeof(__pyx_k_cos_line_1602), 0, 1, 0, 0},
19638 {&__pyx_n_s_cosh, __pyx_k_cosh,
sizeof(__pyx_k_cosh), 0, 0, 1, 1},
19639 {&__pyx_kp_u_cosh_line_1640, __pyx_k_cosh_line_1640,
sizeof(__pyx_k_cosh_line_1640), 0, 1, 0, 0},
19640 {&__pyx_n_s_doctest, __pyx_k_doctest,
sizeof(__pyx_k_doctest), 0, 0, 1, 1},
19641 {&__pyx_n_s_e, __pyx_k_e,
sizeof(__pyx_k_e), 0, 0, 1, 1},
19642 {&__pyx_kp_u_e_line_1887, __pyx_k_e_line_1887,
sizeof(__pyx_k_e_line_1887), 0, 1, 0, 0},
19643 {&__pyx_n_s_even, __pyx_k_even,
sizeof(__pyx_k_even), 0, 0, 1, 1},
19644 {&__pyx_kp_u_even_line_1388, __pyx_k_even_line_1388,
sizeof(__pyx_k_even_line_1388), 0, 1, 0, 0},
19645 {&__pyx_n_s_exp, __pyx_k_exp,
sizeof(__pyx_k_exp), 0, 0, 1, 1},
19646 {&__pyx_kp_u_exp_line_1565, __pyx_k_exp_line_1565,
sizeof(__pyx_k_exp_line_1565), 0, 1, 0, 0},
19647 {&__pyx_n_s_fill, __pyx_k_fill,
sizeof(__pyx_k_fill), 0, 0, 1, 1},
19648 {&__pyx_n_s_frm, __pyx_k_frm,
sizeof(__pyx_k_frm), 0, 0, 1, 1},
19649 {&__pyx_kp_s_from, __pyx_k_from,
sizeof(__pyx_k_from), 0, 0, 1, 0},
19650 {&__pyx_n_s_getstate, __pyx_k_getstate,
sizeof(__pyx_k_getstate), 0, 0, 1, 1},
19651 {&__pyx_n_s_grade, __pyx_k_grade,
sizeof(__pyx_k_grade), 0, 0, 1, 1},
19652 {&__pyx_n_s_i, __pyx_k_i,
sizeof(__pyx_k_i), 0, 0, 1, 1},
19653 {&__pyx_kp_u_imag_line_1366, __pyx_k_imag_line_1366,
sizeof(__pyx_k_imag_line_1366), 0, 1, 0, 0},
19654 {&__pyx_n_s_import, __pyx_k_import,
sizeof(__pyx_k_import), 0, 0, 1, 1},
19655 {&__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},
19656 {&__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},
19657 {&__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},
19658 {&__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},
19659 {&__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},
19660 {&__pyx_n_s_index_set___iter, __pyx_k_index_set___iter,
sizeof(__pyx_k_index_set___iter), 0, 0, 1, 1},
19661 {&__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},
19662 {&__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},
19663 {&__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},
19664 {&__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},
19665 {&__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},
19666 {&__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},
19667 {&__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},
19668 {&__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},
19669 {&__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},
19670 {&__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},
19671 {&__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},
19672 {&__pyx_n_s_index_set_hidden_doctests, __pyx_k_index_set_hidden_doctests,
sizeof(__pyx_k_index_set_hidden_doctests), 0, 0, 1, 1},
19673 {&__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},
19674 {&__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},
19675 {&__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},
19676 {&__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},
19677 {&__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},
19678 {&__pyx_n_s_inv, __pyx_k_inv,
sizeof(__pyx_k_inv), 0, 0, 1, 1},
19679 {&__pyx_kp_u_inv_line_1329, __pyx_k_inv_line_1329,
sizeof(__pyx_k_inv_line_1329), 0, 1, 0, 0},
19680 {&__pyx_kp_s_invalid, __pyx_k_invalid,
sizeof(__pyx_k_invalid), 0, 0, 1, 0},
19681 {&__pyx_kp_s_invalid_string, __pyx_k_invalid_string,
sizeof(__pyx_k_invalid_string), 0, 0, 1, 0},
19682 {&__pyx_n_s_involute, __pyx_k_involute,
sizeof(__pyx_k_involute), 0, 0, 1, 1},
19683 {&__pyx_kp_u_involute_line_1406, __pyx_k_involute_line_1406,
sizeof(__pyx_k_involute_line_1406), 0, 1, 0, 0},
19684 {&__pyx_n_s_ist, __pyx_k_ist,
sizeof(__pyx_k_ist), 0, 0, 1, 1},
19685 {&__pyx_n_s_istpq, __pyx_k_istpq,
sizeof(__pyx_k_istpq), 0, 0, 1, 1},
19686 {&__pyx_kp_u_istpq_line_1900, __pyx_k_istpq_line_1900,
sizeof(__pyx_k_istpq_line_1900), 0, 1, 0, 0},
19687 {&__pyx_n_s_iter, __pyx_k_iter,
sizeof(__pyx_k_iter), 0, 0, 1, 1},
19688 {&__pyx_n_s_ixt, __pyx_k_ixt,
sizeof(__pyx_k_ixt), 0, 0, 1, 1},
19689 {&__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},
19690 {&__pyx_n_s_lhs, __pyx_k_lhs,
sizeof(__pyx_k_lhs), 0, 0, 1, 1},
19691 {&__pyx_n_s_log, __pyx_k_log,
sizeof(__pyx_k_log), 0, 0, 1, 1},
19692 {&__pyx_kp_u_log_line_1579, __pyx_k_log_line_1579,
sizeof(__pyx_k_log_line_1579), 0, 1, 0, 0},
19693 {&__pyx_n_s_m, __pyx_k_m,
sizeof(__pyx_k_m), 0, 0, 1, 1},
19694 {&__pyx_n_s_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 0, 1, 1},
19695 {&__pyx_n_s_math, __pyx_k_math,
sizeof(__pyx_k_math), 0, 0, 1, 1},
19696 {&__pyx_n_s_max, __pyx_k_max,
sizeof(__pyx_k_max), 0, 0, 1, 1},
19697 {&__pyx_kp_u_max_abs_line_1482, __pyx_k_max_abs_line_1482,
sizeof(__pyx_k_max_abs_line_1482), 0, 1, 0, 0},
19698 {&__pyx_kp_u_max_pos_line_511, __pyx_k_max_pos_line_511,
sizeof(__pyx_k_max_pos_line_511), 0, 1, 0, 0},
19699 {&__pyx_n_s_min, __pyx_k_min,
sizeof(__pyx_k_min), 0, 0, 1, 1},
19700 {&__pyx_kp_u_min_neg_line_502, __pyx_k_min_neg_line_502,
sizeof(__pyx_k_min_neg_line_502), 0, 1, 0, 0},
19701 {&__pyx_n_s_name, __pyx_k_name,
sizeof(__pyx_k_name), 0, 0, 1, 1},
19702 {&__pyx_n_s_nbar3, __pyx_k_nbar3,
sizeof(__pyx_k_nbar3), 0, 0, 1, 1},
19703 {&__pyx_n_s_ninf3, __pyx_k_ninf3,
sizeof(__pyx_k_ninf3), 0, 0, 1, 1},
19704 {&__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},
19705 {&__pyx_n_s_norm, __pyx_k_norm,
sizeof(__pyx_k_norm), 0, 0, 1, 1},
19706 {&__pyx_kp_u_norm_line_1462, __pyx_k_norm_line_1462,
sizeof(__pyx_k_norm_line_1462), 0, 1, 0, 0},
19707 {&__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},
19708 {&__pyx_n_s_numbers, __pyx_k_numbers,
sizeof(__pyx_k_numbers), 0, 0, 1, 1},
19709 {&__pyx_n_s_obj, __pyx_k_obj,
sizeof(__pyx_k_obj), 0, 0, 1, 1},
19710 {&__pyx_n_s_odd, __pyx_k_odd,
sizeof(__pyx_k_odd), 0, 0, 1, 1},
19711 {&__pyx_kp_u_odd_line_1397, __pyx_k_odd_line_1397,
sizeof(__pyx_k_odd_line_1397), 0, 1, 0, 0},
19712 {&__pyx_n_s_other, __pyx_k_other,
sizeof(__pyx_k_other), 0, 0, 1, 1},
19713 {&__pyx_n_s_outer_pow, __pyx_k_outer_pow,
sizeof(__pyx_k_outer_pow), 0, 0, 1, 1},
19714 {&__pyx_kp_u_outer_pow_line_1518, __pyx_k_outer_pow_line_1518,
sizeof(__pyx_k_outer_pow_line_1518), 0, 1, 0, 0},
19715 {&__pyx_n_s_p, __pyx_k_p,
sizeof(__pyx_k_p), 0, 0, 1, 1},
19716 {&__pyx_n_s_pi, __pyx_k_pi,
sizeof(__pyx_k_pi), 0, 0, 1, 1},
19717 {&__pyx_n_s_pow, __pyx_k_pow,
sizeof(__pyx_k_pow), 0, 0, 1, 1},
19718 {&__pyx_kp_u_pow_line_1494, __pyx_k_pow_line_1494,
sizeof(__pyx_k_pow_line_1494), 0, 1, 0, 0},
19719 {&__pyx_n_s_pure, __pyx_k_pure,
sizeof(__pyx_k_pure), 0, 0, 1, 1},
19720 {&__pyx_kp_u_pure_line_1377, __pyx_k_pure_line_1377,
sizeof(__pyx_k_pure_line_1377), 0, 1, 0, 0},
19721 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable,
sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
19722 {&__pyx_n_s_q, __pyx_k_q,
sizeof(__pyx_k_q), 0, 0, 1, 1},
19723 {&__pyx_n_s_quad, __pyx_k_quad,
sizeof(__pyx_k_quad), 0, 0, 1, 1},
19724 {&__pyx_kp_u_quad_line_1451, __pyx_k_quad_line_1451,
sizeof(__pyx_k_quad_line_1451), 0, 1, 0, 0},
19725 {&__pyx_kp_u_random_clifford_line_1815, __pyx_k_random_clifford_line_1815,
sizeof(__pyx_k_random_clifford_line_1815), 0, 1, 0, 0},
19726 {&__pyx_n_s_range, __pyx_k_range,
sizeof(__pyx_k_range), 0, 0, 1, 1},
19727 {&__pyx_kp_u_real_line_1355, __pyx_k_real_line_1355,
sizeof(__pyx_k_real_line_1355), 0, 1, 0, 0},
19728 {&__pyx_n_s_reduce, __pyx_k_reduce,
sizeof(__pyx_k_reduce), 0, 0, 1, 1},
19729 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython,
sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
19730 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex,
sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
19731 {&__pyx_n_s_reverse, __pyx_k_reverse,
sizeof(__pyx_k_reverse), 0, 0, 1, 1},
19732 {&__pyx_kp_u_reverse_line_1421, __pyx_k_reverse_line_1421,
sizeof(__pyx_k_reverse_line_1421), 0, 1, 0, 0},
19733 {&__pyx_n_s_rhs, __pyx_k_rhs,
sizeof(__pyx_k_rhs), 0, 0, 1, 1},
19734 {&__pyx_n_s_scalar, __pyx_k_scalar,
sizeof(__pyx_k_scalar), 0, 0, 1, 1},
19735 {&__pyx_kp_u_scalar_line_1344, __pyx_k_scalar_line_1344,
sizeof(__pyx_k_scalar_line_1344), 0, 1, 0, 0},
19736 {&__pyx_n_s_send, __pyx_k_send,
sizeof(__pyx_k_send), 0, 0, 1, 1},
19737 {&__pyx_n_s_setstate, __pyx_k_setstate,
sizeof(__pyx_k_setstate), 0, 0, 1, 1},
19738 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython,
sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
19739 {&__pyx_n_s_sin, __pyx_k_sin,
sizeof(__pyx_k_sin), 0, 0, 1, 1},
19740 {&__pyx_kp_u_sin_line_1679, __pyx_k_sin_line_1679,
sizeof(__pyx_k_sin_line_1679), 0, 1, 0, 0},
19741 {&__pyx_n_s_sinh, __pyx_k_sinh,
sizeof(__pyx_k_sinh), 0, 0, 1, 1},
19742 {&__pyx_kp_u_sinh_line_1719, __pyx_k_sinh_line_1719,
sizeof(__pyx_k_sinh_line_1719), 0, 1, 0, 0},
19743 {&__pyx_n_s_sqrt, __pyx_k_sqrt,
sizeof(__pyx_k_sqrt), 0, 0, 1, 1},
19744 {&__pyx_kp_u_sqrt_line_1542, __pyx_k_sqrt_line_1542,
sizeof(__pyx_k_sqrt_line_1542), 0, 1, 0, 0},
19745 {&__pyx_n_s_tan, __pyx_k_tan,
sizeof(__pyx_k_tan), 0, 0, 1, 1},
19746 {&__pyx_kp_u_tan_line_1752, __pyx_k_tan_line_1752,
sizeof(__pyx_k_tan_line_1752), 0, 1, 0, 0},
19747 {&__pyx_n_s_tanh, __pyx_k_tanh,
sizeof(__pyx_k_tanh), 0, 0, 1, 1},
19748 {&__pyx_kp_u_tanh_line_1786, __pyx_k_tanh_line_1786,
sizeof(__pyx_k_tanh_line_1786), 0, 1, 0, 0},
19749 {&__pyx_n_s_tau, __pyx_k_tau,
sizeof(__pyx_k_tau), 0, 0, 1, 1},
19750 {&__pyx_n_s_test, __pyx_k_test,
sizeof(__pyx_k_test), 0, 0, 1, 1},
19751 {&__pyx_n_s_test_2, __pyx_k_test_2,
sizeof(__pyx_k_test_2), 0, 0, 1, 1},
19752 {&__pyx_n_s_testmod, __pyx_k_testmod,
sizeof(__pyx_k_testmod), 0, 0, 1, 1},
19753 {&__pyx_n_s_throw, __pyx_k_throw,
sizeof(__pyx_k_throw), 0, 0, 1, 1},
19754 {&__pyx_kp_s_to_frame, __pyx_k_to_frame,
sizeof(__pyx_k_to_frame), 0, 0, 1, 0},
19755 {&__pyx_kp_s_using, __pyx_k_using,
sizeof(__pyx_k_using), 0, 0, 1, 0},
19756 {&__pyx_kp_s_using_invalid, __pyx_k_using_invalid,
sizeof(__pyx_k_using_invalid), 0, 0, 1, 0},
19757 {&__pyx_kp_s_value, __pyx_k_value,
sizeof(__pyx_k_value), 0, 0, 1, 0},
19758 {&__pyx_n_s_version, __pyx_k_version,
sizeof(__pyx_k_version), 0, 0, 1, 1},
19759 {&__pyx_n_s_xrange, __pyx_k_xrange,
sizeof(__pyx_k_xrange), 0, 0, 1, 1},
19760 {0, 0, 0, 0, 0, 0, 0}
19762 static int __Pyx_InitCachedBuiltins(
void) {
19763 __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError);
if (!__pyx_builtin_IndexError) __PYX_ERR(0, 102, __pyx_L1_error)
19764 __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError);
if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 104, __pyx_L1_error)
19765 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError);
if (!__pyx_builtin_TypeError) __PYX_ERR(0, 104, __pyx_L1_error)
19766 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError);
if (!__pyx_builtin_ValueError) __PYX_ERR(0, 105, __pyx_L1_error)
19767 __pyx_builtin_NotImplemented = __Pyx_GetBuiltinName(__pyx_n_s_NotImplemented);
if (!__pyx_builtin_NotImplemented) __PYX_ERR(0, 157, __pyx_L1_error)
19768 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_range) __PYX_ERR(0, 234, __pyx_L1_error)
19769 #if PY_MAJOR_VERSION >= 3 19770 __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_xrange) __PYX_ERR(0, 1098, __pyx_L1_error)
19772 __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange);
if (!__pyx_builtin_xrange) __PYX_ERR(0, 1098, __pyx_L1_error)
19779 static int __Pyx_InitCachedConstants(
void) {
19780 __Pyx_RefNannyDeclarations
19781 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
19789 __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)
19790 __Pyx_GOTREF(__pyx_tuple__3);
19791 __Pyx_GIVEREF(__pyx_tuple__3);
19798 __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)
19799 __Pyx_GOTREF(__pyx_tuple__4);
19800 __Pyx_GIVEREF(__pyx_tuple__4);
19809 __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Not_applicable);
if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 635, __pyx_L1_error)
19810 __Pyx_GOTREF(__pyx_tuple__10);
19811 __Pyx_GIVEREF(__pyx_tuple__10);
19820 __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Not_applicable);
if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 646, __pyx_L1_error)
19821 __Pyx_GOTREF(__pyx_tuple__11);
19822 __Pyx_GIVEREF(__pyx_tuple__11);
19830 __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)
19831 __Pyx_GOTREF(__pyx_tuple__12);
19832 __Pyx_GIVEREF(__pyx_tuple__12);
19839 __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)
19840 __Pyx_GOTREF(__pyx_tuple__13);
19841 __Pyx_GIVEREF(__pyx_tuple__13);
19850 __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)
19859 __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)
19868 __pyx_tuple__16 = PyTuple_Pack(1, __pyx_float_1_0);
if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 1856, __pyx_L1_error)
19869 __Pyx_GOTREF(__pyx_tuple__16);
19870 __Pyx_GIVEREF(__pyx_tuple__16);
19879 __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_obj);
if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 1887, __pyx_L1_error)
19880 __Pyx_GOTREF(__pyx_tuple__17);
19881 __Pyx_GIVEREF(__pyx_tuple__17);
19882 __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)
19891 __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)
19892 __Pyx_GOTREF(__pyx_tuple__19);
19893 __Pyx_GIVEREF(__pyx_tuple__19);
19894 __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)
19903 __pyx_tuple__21 = PyTuple_Pack(1, __pyx_int_4);
if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 1909, __pyx_L1_error)
19904 __Pyx_GOTREF(__pyx_tuple__21);
19905 __Pyx_GIVEREF(__pyx_tuple__21);
19906 __pyx_tuple__22 = PyTuple_Pack(1, __pyx_int_neg_1);
if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 1909, __pyx_L1_error)
19907 __Pyx_GOTREF(__pyx_tuple__22);
19908 __Pyx_GIVEREF(__pyx_tuple__22);
19917 __pyx_tuple__23 = PyTuple_Pack(1, __pyx_int_4);
if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 1910, __pyx_L1_error)
19918 __Pyx_GOTREF(__pyx_tuple__23);
19919 __Pyx_GIVEREF(__pyx_tuple__23);
19920 __pyx_tuple__24 = PyTuple_Pack(1, __pyx_int_neg_1);
if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 1910, __pyx_L1_error)
19921 __Pyx_GOTREF(__pyx_tuple__24);
19922 __Pyx_GIVEREF(__pyx_tuple__24);
19931 __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)
19932 __Pyx_GOTREF(__pyx_tuple__25);
19933 __Pyx_GIVEREF(__pyx_tuple__25);
19934 __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)
19935 __Pyx_RefNannyFinishContext();
19938 __Pyx_RefNannyFinishContext();
19942 static int __Pyx_InitGlobals(
void) {
19943 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
19944 __pyx_float_0_0 =
PyFloat_FromDouble(0.0);
if (unlikely(!__pyx_float_0_0)) __PYX_ERR(0, 1, __pyx_L1_error)
19945 __pyx_float_1_0 =
PyFloat_FromDouble(1.0);
if (unlikely(!__pyx_float_1_0)) __PYX_ERR(0, 1, __pyx_L1_error)
19946 __pyx_float_2_0 =
PyFloat_FromDouble(2.0);
if (unlikely(!__pyx_float_2_0)) __PYX_ERR(0, 1, __pyx_L1_error)
19947 __pyx_float_8_0 =
PyFloat_FromDouble(8.0);
if (unlikely(!__pyx_float_8_0)) __PYX_ERR(0, 1, __pyx_L1_error)
19948 __pyx_int_0 = PyInt_FromLong(0);
if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
19949 __pyx_int_1 = PyInt_FromLong(1);
if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
19950 __pyx_int_4 = PyInt_FromLong(4);
if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error)
19951 __pyx_int_neg_1 = PyInt_FromLong(-1);
if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
19957 #if PY_MAJOR_VERSION < 3 19958 PyMODINIT_FUNC initPyClical(
void);
19959 PyMODINIT_FUNC initPyClical(
void)
19961 PyMODINIT_FUNC PyInit_PyClical(
void);
19962 PyMODINIT_FUNC PyInit_PyClical(
void)
19963 #if CYTHON_PEP489_MULTI_PHASE_INIT 19965 return PyModuleDef_Init(&__pyx_moduledef);
19967 static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict,
const char* from_name,
const char* to_name) {
19968 PyObject *value = PyObject_GetAttrString(spec, from_name);
19970 if (likely(value)) {
19971 result = PyDict_SetItemString(moddict, to_name, value);
19973 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
19980 static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
19981 PyObject *module = NULL, *moddict, *modname;
19983 return __Pyx_NewRef(__pyx_m);
19984 modname = PyObject_GetAttrString(spec,
"name");
19985 if (unlikely(!modname))
goto bad;
19986 module = PyModule_NewObject(modname);
19987 Py_DECREF(modname);
19988 if (unlikely(!module))
goto bad;
19989 moddict = PyModule_GetDict(module);
19990 if (unlikely(!moddict))
goto bad;
19991 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__") < 0))
goto bad;
19992 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__") < 0))
goto bad;
19993 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__") < 0))
goto bad;
19994 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__") < 0))
goto bad;
19997 Py_XDECREF(module);
20002 static int __pyx_pymod_exec_PyClical(PyObject *__pyx_pyinit_module)
20006 PyObject *__pyx_t_1 = NULL;
20007 PyObject *__pyx_t_2 = NULL;
20008 PyObject *__pyx_t_3 = NULL;
20010 __Pyx_RefNannyDeclarations
20011 #if CYTHON_PEP489_MULTI_PHASE_INIT 20012 if (__pyx_m && __pyx_m == __pyx_pyinit_module)
return 0;
20014 #if CYTHON_REFNANNY 20015 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
20016 if (!__Pyx_RefNanny) {
20018 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
20019 if (!__Pyx_RefNanny)
20020 Py_FatalError(
"failed to import 'refnanny' module");
20023 __Pyx_RefNannySetupContext(
"PyMODINIT_FUNC PyInit_PyClical(void)", 0);
20024 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20025 __pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
20026 __pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
20027 __pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
20028 #ifdef __Pyx_CyFunction_USED 20029 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20031 #ifdef __Pyx_FusedFunction_USED 20032 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20034 #ifdef __Pyx_Coroutine_USED 20035 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20037 #ifdef __Pyx_Generator_USED 20038 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20040 #ifdef __Pyx_AsyncGen_USED 20041 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20043 #ifdef __Pyx_StopAsyncIteration_USED 20044 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20048 #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS 20050 PyEval_InitThreads();
20054 #if CYTHON_PEP489_MULTI_PHASE_INIT 20055 __pyx_m = __pyx_pyinit_module;
20056 Py_INCREF(__pyx_m);
20058 #if PY_MAJOR_VERSION < 3 20059 __pyx_m = Py_InitModule4(
"PyClical", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
20061 __pyx_m = PyModule_Create(&__pyx_moduledef);
20063 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
20065 __pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
20066 Py_INCREF(__pyx_d);
20067 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
20068 __pyx_cython_runtime = PyImport_AddModule((
char *)
"cython_runtime");
if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
20069 #if CYTHON_COMPILING_IN_PYPY 20070 Py_INCREF(__pyx_b);
20072 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
20074 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20075 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) 20076 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20078 if (__pyx_module_is_main_PyClical) {
20079 if (PyObject_SetAttrString(__pyx_m,
"__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20081 #if PY_MAJOR_VERSION >= 3 20083 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
20084 if (!PyDict_GetItemString(modules,
"PyClical")) {
20085 if (unlikely(PyDict_SetItemString(modules,
"PyClical", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
20090 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20092 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20097 __pyx_vtabptr_8PyClical_index_set = &__pyx_vtable_8PyClical_index_set;
20098 __pyx_vtable_8PyClical_index_set.wrap = (PyObject *(*)(
struct __pyx_obj_8PyClical_index_set *,
IndexSet))__pyx_f_8PyClical_9index_set_wrap;
20099 __pyx_vtable_8PyClical_index_set.unwrap = (
IndexSet (*)(
struct __pyx_obj_8PyClical_index_set *))__pyx_f_8PyClical_9index_set_unwrap;
20100 __pyx_vtable_8PyClical_index_set.copy = (PyObject *(*)(
struct __pyx_obj_8PyClical_index_set *,
int __pyx_skip_dispatch))__pyx_f_8PyClical_9index_set_copy;
20101 if (PyType_Ready(&__pyx_type_8PyClical_index_set) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
20102 __pyx_type_8PyClical_index_set.tp_print = 0;
20103 #if CYTHON_COMPILING_IN_CPYTHON 20105 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__setitem__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
20106 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20107 __pyx_wrapperbase_8PyClical_9index_set_8__setitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20108 __pyx_wrapperbase_8PyClical_9index_set_8__setitem__.doc = __pyx_doc_8PyClical_9index_set_8__setitem__;
20109 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_8__setitem__;
20113 #if CYTHON_COMPILING_IN_CPYTHON 20115 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__getitem__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
20116 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20117 __pyx_wrapperbase_8PyClical_9index_set_10__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20118 __pyx_wrapperbase_8PyClical_9index_set_10__getitem__.doc = __pyx_doc_8PyClical_9index_set_10__getitem__;
20119 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_10__getitem__;
20123 #if CYTHON_COMPILING_IN_CPYTHON 20125 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__contains__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
20126 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20127 __pyx_wrapperbase_8PyClical_9index_set_12__contains__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20128 __pyx_wrapperbase_8PyClical_9index_set_12__contains__.doc = __pyx_doc_8PyClical_9index_set_12__contains__;
20129 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_12__contains__;
20133 #if CYTHON_COMPILING_IN_CPYTHON 20135 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__iter__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
20136 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20137 __pyx_wrapperbase_8PyClical_9index_set_14__iter__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20138 __pyx_wrapperbase_8PyClical_9index_set_14__iter__.doc = __pyx_doc_8PyClical_9index_set_14__iter__;
20139 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_14__iter__;
20143 #if CYTHON_COMPILING_IN_CPYTHON 20145 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__invert__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
20146 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20147 __pyx_wrapperbase_8PyClical_9index_set_17__invert__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20148 __pyx_wrapperbase_8PyClical_9index_set_17__invert__.doc = __pyx_doc_8PyClical_9index_set_17__invert__;
20149 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_17__invert__;
20153 #if CYTHON_COMPILING_IN_CPYTHON 20155 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__xor__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
20156 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20157 __pyx_wrapperbase_8PyClical_9index_set_19__xor__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20158 __pyx_wrapperbase_8PyClical_9index_set_19__xor__.doc = __pyx_doc_8PyClical_9index_set_19__xor__;
20159 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_19__xor__;
20163 #if CYTHON_COMPILING_IN_CPYTHON 20165 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__ixor__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
20166 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20167 __pyx_wrapperbase_8PyClical_9index_set_21__ixor__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20168 __pyx_wrapperbase_8PyClical_9index_set_21__ixor__.doc = __pyx_doc_8PyClical_9index_set_21__ixor__;
20169 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_21__ixor__;
20173 #if CYTHON_COMPILING_IN_CPYTHON 20175 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__and__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
20176 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20177 __pyx_wrapperbase_8PyClical_9index_set_23__and__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20178 __pyx_wrapperbase_8PyClical_9index_set_23__and__.doc = __pyx_doc_8PyClical_9index_set_23__and__;
20179 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_23__and__;
20183 #if CYTHON_COMPILING_IN_CPYTHON 20185 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__iand__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
20186 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20187 __pyx_wrapperbase_8PyClical_9index_set_25__iand__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20188 __pyx_wrapperbase_8PyClical_9index_set_25__iand__.doc = __pyx_doc_8PyClical_9index_set_25__iand__;
20189 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_25__iand__;
20193 #if CYTHON_COMPILING_IN_CPYTHON 20195 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__or__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
20196 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20197 __pyx_wrapperbase_8PyClical_9index_set_27__or__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20198 __pyx_wrapperbase_8PyClical_9index_set_27__or__.doc = __pyx_doc_8PyClical_9index_set_27__or__;
20199 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_27__or__;
20203 #if CYTHON_COMPILING_IN_CPYTHON 20205 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__ior__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
20206 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20207 __pyx_wrapperbase_8PyClical_9index_set_29__ior__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20208 __pyx_wrapperbase_8PyClical_9index_set_29__ior__.doc = __pyx_doc_8PyClical_9index_set_29__ior__;
20209 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_29__ior__;
20213 #if CYTHON_COMPILING_IN_CPYTHON 20215 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__repr__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
20216 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20217 __pyx_wrapperbase_8PyClical_9index_set_47__repr__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20218 __pyx_wrapperbase_8PyClical_9index_set_47__repr__.doc = __pyx_doc_8PyClical_9index_set_47__repr__;
20219 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_47__repr__;
20223 #if CYTHON_COMPILING_IN_CPYTHON 20225 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__str__");
if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error)
20226 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20227 __pyx_wrapperbase_8PyClical_9index_set_49__str__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20228 __pyx_wrapperbase_8PyClical_9index_set_49__str__.doc = __pyx_doc_8PyClical_9index_set_49__str__;
20229 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_49__str__;
20233 if (__Pyx_SetVtable(__pyx_type_8PyClical_index_set.tp_dict, __pyx_vtabptr_8PyClical_index_set) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
20234 if (PyObject_SetAttrString(__pyx_m,
"index_set", (PyObject *)&__pyx_type_8PyClical_index_set) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
20235 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8PyClical_index_set) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
20236 __pyx_ptype_8PyClical_index_set = &__pyx_type_8PyClical_index_set;
20237 __pyx_vtabptr_8PyClical_clifford = &__pyx_vtable_8PyClical_clifford;
20238 __pyx_vtable_8PyClical_clifford.wrap = (PyObject *(*)(
struct __pyx_obj_8PyClical_clifford *,
Clifford))__pyx_f_8PyClical_8clifford_wrap;
20239 __pyx_vtable_8PyClical_clifford.unwrap = (
Clifford (*)(
struct __pyx_obj_8PyClical_clifford *))__pyx_f_8PyClical_8clifford_unwrap;
20240 __pyx_vtable_8PyClical_clifford.copy = (PyObject *(*)(
struct __pyx_obj_8PyClical_clifford *,
int __pyx_skip_dispatch))__pyx_f_8PyClical_8clifford_copy;
20241 if (PyType_Ready(&__pyx_type_8PyClical_clifford) < 0) __PYX_ERR(0, 535, __pyx_L1_error)
20242 __pyx_type_8PyClical_clifford.tp_print = 0;
20243 #if CYTHON_COMPILING_IN_CPYTHON 20245 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__contains__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20246 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20247 __pyx_wrapperbase_8PyClical_8clifford_6__contains__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20248 __pyx_wrapperbase_8PyClical_8clifford_6__contains__.doc = __pyx_doc_8PyClical_8clifford_6__contains__;
20249 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_6__contains__;
20253 #if CYTHON_COMPILING_IN_CPYTHON 20255 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__iter__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20256 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20257 __pyx_wrapperbase_8PyClical_8clifford_8__iter__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20258 __pyx_wrapperbase_8PyClical_8clifford_8__iter__.doc = __pyx_doc_8PyClical_8clifford_8__iter__;
20259 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_8__iter__;
20263 #if CYTHON_COMPILING_IN_CPYTHON 20265 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__getitem__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20266 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20267 __pyx_wrapperbase_8PyClical_8clifford_14__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20268 __pyx_wrapperbase_8PyClical_8clifford_14__getitem__.doc = __pyx_doc_8PyClical_8clifford_14__getitem__;
20269 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_14__getitem__;
20273 #if CYTHON_COMPILING_IN_CPYTHON 20275 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__neg__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20276 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20277 __pyx_wrapperbase_8PyClical_8clifford_16__neg__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20278 __pyx_wrapperbase_8PyClical_8clifford_16__neg__.doc = __pyx_doc_8PyClical_8clifford_16__neg__;
20279 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_16__neg__;
20283 #if CYTHON_COMPILING_IN_CPYTHON 20285 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__pos__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20286 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20287 __pyx_wrapperbase_8PyClical_8clifford_18__pos__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20288 __pyx_wrapperbase_8PyClical_8clifford_18__pos__.doc = __pyx_doc_8PyClical_8clifford_18__pos__;
20289 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_18__pos__;
20293 #if CYTHON_COMPILING_IN_CPYTHON 20295 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__add__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20296 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20297 __pyx_wrapperbase_8PyClical_8clifford_20__add__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20298 __pyx_wrapperbase_8PyClical_8clifford_20__add__.doc = __pyx_doc_8PyClical_8clifford_20__add__;
20299 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_20__add__;
20303 #if CYTHON_COMPILING_IN_CPYTHON 20305 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__iadd__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20306 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20307 __pyx_wrapperbase_8PyClical_8clifford_22__iadd__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20308 __pyx_wrapperbase_8PyClical_8clifford_22__iadd__.doc = __pyx_doc_8PyClical_8clifford_22__iadd__;
20309 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_22__iadd__;
20313 #if CYTHON_COMPILING_IN_CPYTHON 20315 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__sub__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20316 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20317 __pyx_wrapperbase_8PyClical_8clifford_24__sub__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20318 __pyx_wrapperbase_8PyClical_8clifford_24__sub__.doc = __pyx_doc_8PyClical_8clifford_24__sub__;
20319 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_24__sub__;
20323 #if CYTHON_COMPILING_IN_CPYTHON 20325 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__isub__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20326 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20327 __pyx_wrapperbase_8PyClical_8clifford_26__isub__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20328 __pyx_wrapperbase_8PyClical_8clifford_26__isub__.doc = __pyx_doc_8PyClical_8clifford_26__isub__;
20329 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_26__isub__;
20333 #if CYTHON_COMPILING_IN_CPYTHON 20335 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__mul__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20336 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20337 __pyx_wrapperbase_8PyClical_8clifford_28__mul__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20338 __pyx_wrapperbase_8PyClical_8clifford_28__mul__.doc = __pyx_doc_8PyClical_8clifford_28__mul__;
20339 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_28__mul__;
20343 #if CYTHON_COMPILING_IN_CPYTHON 20345 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__imul__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20346 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20347 __pyx_wrapperbase_8PyClical_8clifford_30__imul__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20348 __pyx_wrapperbase_8PyClical_8clifford_30__imul__.doc = __pyx_doc_8PyClical_8clifford_30__imul__;
20349 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_30__imul__;
20353 #if CYTHON_COMPILING_IN_CPYTHON 20355 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__mod__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20356 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20357 __pyx_wrapperbase_8PyClical_8clifford_32__mod__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20358 __pyx_wrapperbase_8PyClical_8clifford_32__mod__.doc = __pyx_doc_8PyClical_8clifford_32__mod__;
20359 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_32__mod__;
20363 #if CYTHON_COMPILING_IN_CPYTHON 20365 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__imod__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20366 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20367 __pyx_wrapperbase_8PyClical_8clifford_34__imod__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20368 __pyx_wrapperbase_8PyClical_8clifford_34__imod__.doc = __pyx_doc_8PyClical_8clifford_34__imod__;
20369 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_34__imod__;
20373 #if CYTHON_COMPILING_IN_CPYTHON 20375 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__and__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20376 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20377 __pyx_wrapperbase_8PyClical_8clifford_36__and__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20378 __pyx_wrapperbase_8PyClical_8clifford_36__and__.doc = __pyx_doc_8PyClical_8clifford_36__and__;
20379 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_36__and__;
20383 #if CYTHON_COMPILING_IN_CPYTHON 20385 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__iand__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20386 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20387 __pyx_wrapperbase_8PyClical_8clifford_38__iand__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20388 __pyx_wrapperbase_8PyClical_8clifford_38__iand__.doc = __pyx_doc_8PyClical_8clifford_38__iand__;
20389 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_38__iand__;
20393 #if CYTHON_COMPILING_IN_CPYTHON 20395 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__xor__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20396 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20397 __pyx_wrapperbase_8PyClical_8clifford_40__xor__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20398 __pyx_wrapperbase_8PyClical_8clifford_40__xor__.doc = __pyx_doc_8PyClical_8clifford_40__xor__;
20399 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_40__xor__;
20403 #if CYTHON_COMPILING_IN_CPYTHON 20405 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__ixor__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20406 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20407 __pyx_wrapperbase_8PyClical_8clifford_42__ixor__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20408 __pyx_wrapperbase_8PyClical_8clifford_42__ixor__.doc = __pyx_doc_8PyClical_8clifford_42__ixor__;
20409 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_42__ixor__;
20413 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 20414 #if CYTHON_COMPILING_IN_CPYTHON 20416 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__div__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20417 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20418 __pyx_wrapperbase_8PyClical_8clifford_44__div__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20419 __pyx_wrapperbase_8PyClical_8clifford_44__div__.doc = __pyx_doc_8PyClical_8clifford_44__div__;
20420 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_44__div__;
20425 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 20426 #if CYTHON_COMPILING_IN_CPYTHON 20428 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__idiv__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20429 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20430 __pyx_wrapperbase_8PyClical_8clifford_46__idiv__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20431 __pyx_wrapperbase_8PyClical_8clifford_46__idiv__.doc = __pyx_doc_8PyClical_8clifford_46__idiv__;
20432 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_46__idiv__;
20437 #if CYTHON_COMPILING_IN_CPYTHON 20439 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__or__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20440 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20441 __pyx_wrapperbase_8PyClical_8clifford_50__or__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20442 __pyx_wrapperbase_8PyClical_8clifford_50__or__.doc = __pyx_doc_8PyClical_8clifford_50__or__;
20443 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_50__or__;
20447 #if CYTHON_COMPILING_IN_CPYTHON 20449 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__ior__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20450 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20451 __pyx_wrapperbase_8PyClical_8clifford_52__ior__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20452 __pyx_wrapperbase_8PyClical_8clifford_52__ior__.doc = __pyx_doc_8PyClical_8clifford_52__ior__;
20453 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_52__ior__;
20457 #if CYTHON_COMPILING_IN_CPYTHON 20459 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__pow__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20460 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20461 __pyx_wrapperbase_8PyClical_8clifford_54__pow__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20462 __pyx_wrapperbase_8PyClical_8clifford_54__pow__.doc = __pyx_doc_8PyClical_8clifford_54__pow__;
20463 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_54__pow__;
20467 #if CYTHON_COMPILING_IN_CPYTHON 20469 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__call__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20470 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20471 __pyx_wrapperbase_8PyClical_8clifford_60__call__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20472 __pyx_wrapperbase_8PyClical_8clifford_60__call__.doc = __pyx_doc_8PyClical_8clifford_60__call__;
20473 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_60__call__;
20477 #if CYTHON_COMPILING_IN_CPYTHON 20479 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__repr__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20480 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20481 __pyx_wrapperbase_8PyClical_8clifford_92__repr__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20482 __pyx_wrapperbase_8PyClical_8clifford_92__repr__.doc = __pyx_doc_8PyClical_8clifford_92__repr__;
20483 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_92__repr__;
20487 #if CYTHON_COMPILING_IN_CPYTHON 20489 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__str__");
if (unlikely(!wrapper)) __PYX_ERR(0, 535, __pyx_L1_error)
20490 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20491 __pyx_wrapperbase_8PyClical_8clifford_94__str__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20492 __pyx_wrapperbase_8PyClical_8clifford_94__str__.doc = __pyx_doc_8PyClical_8clifford_94__str__;
20493 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_94__str__;
20497 if (__Pyx_SetVtable(__pyx_type_8PyClical_clifford.tp_dict, __pyx_vtabptr_8PyClical_clifford) < 0) __PYX_ERR(0, 535, __pyx_L1_error)
20498 if (PyObject_SetAttrString(__pyx_m,
"clifford", (PyObject *)&__pyx_type_8PyClical_clifford) < 0) __PYX_ERR(0, 535, __pyx_L1_error)
20499 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8PyClical_clifford) < 0) __PYX_ERR(0, 535, __pyx_L1_error)
20500 __pyx_ptype_8PyClical_clifford = &__pyx_type_8PyClical_clifford;
20501 if (PyType_Ready(&__pyx_type_8PyClical___pyx_scope_struct____iter__) < 0) __PYX_ERR(0, 227, __pyx_L1_error)
20502 __pyx_type_8PyClical___pyx_scope_struct____iter__.tp_print = 0;
20503 __pyx_ptype_8PyClical___pyx_scope_struct____iter__ = &__pyx_type_8PyClical___pyx_scope_struct____iter__;
20508 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) 20509 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20519 __pyx_t_1 = __Pyx_Import(__pyx_n_s_math, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
20520 __Pyx_GOTREF(__pyx_t_1);
20521 if (PyDict_SetItem(__pyx_d, __pyx_n_s_math, __pyx_t_1) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
20522 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20531 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numbers, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
20532 __Pyx_GOTREF(__pyx_t_1);
20533 if (PyDict_SetItem(__pyx_d, __pyx_n_s_numbers, __pyx_t_1) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
20534 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20543 __pyx_t_1 = __Pyx_Import(__pyx_n_s_collections, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error)
20544 __Pyx_GOTREF(__pyx_t_1);
20545 if (PyDict_SetItem(__pyx_d, __pyx_n_s_collections, __pyx_t_1) < 0) __PYX_ERR(0, 30, __pyx_L1_error)
20546 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20555 if (PyDict_SetItem(__pyx_d, __pyx_n_s_version, __pyx_kp_s_0_8_2) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
20564 __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)
20565 __Pyx_GOTREF(__pyx_t_1);
20566 if (PyDict_SetItem(__pyx_d, __pyx_n_s_index_set_hidden_doctests, __pyx_t_1) < 0) __PYX_ERR(0, 404, __pyx_L1_error)
20567 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20576 __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)
20577 __Pyx_GOTREF(__pyx_t_1);
20578 if (PyDict_SetItem(__pyx_d, __pyx_n_s_clifford_hidden_doctests, __pyx_t_1) < 0) __PYX_ERR(0, 1243, __pyx_L1_error)
20579 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20588 __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)
20589 __Pyx_GOTREF(__pyx_t_1);
20590 __pyx_t_2 = __pyx_f_8PyClical_atan(__pyx_t_1, 0, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1856, __pyx_L1_error)
20591 __Pyx_GOTREF(__pyx_t_2);
20592 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20593 __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_float_8_0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1856, __pyx_L1_error)
20594 __Pyx_GOTREF(__pyx_t_1);
20595 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20596 if (PyDict_SetItem(__pyx_d, __pyx_n_s_tau, __pyx_t_1) < 0) __PYX_ERR(0, 1856, __pyx_L1_error)
20597 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20606 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_tau);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1857, __pyx_L1_error)
20607 __Pyx_GOTREF(__pyx_t_1);
20608 __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)
20609 __Pyx_GOTREF(__pyx_t_2);
20610 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20611 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pi, __pyx_t_2) < 0) __PYX_ERR(0, 1857, __pyx_L1_error)
20612 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20621 if (PyDict_SetItem(__pyx_d, __pyx_n_s_cl, ((PyObject *)__pyx_ptype_8PyClical_clifford)) < 0) __PYX_ERR(0, 1859, __pyx_L1_error)
20630 if (PyDict_SetItem(__pyx_d, __pyx_n_s_ist, ((PyObject *)__pyx_ptype_8PyClical_index_set)) < 0) __PYX_ERR(0, 1879, __pyx_L1_error)
20639 __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)
20640 __Pyx_GOTREF(__pyx_t_2);
20641 if (PyDict_SetItem(__pyx_d, __pyx_n_s_e, __pyx_t_2) < 0) __PYX_ERR(0, 1887, __pyx_L1_error)
20642 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20651 __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)
20652 __Pyx_GOTREF(__pyx_t_2);
20653 if (PyDict_SetItem(__pyx_d, __pyx_n_s_istpq, __pyx_t_2) < 0) __PYX_ERR(0, 1900, __pyx_L1_error)
20654 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20663 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_e);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1909, __pyx_L1_error)
20664 __Pyx_GOTREF(__pyx_t_2);
20665 __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)
20666 __Pyx_GOTREF(__pyx_t_1);
20667 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20668 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_e);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1909, __pyx_L1_error)
20669 __Pyx_GOTREF(__pyx_t_2);
20670 __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)
20671 __Pyx_GOTREF(__pyx_t_3);
20672 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20673 __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1909, __pyx_L1_error)
20674 __Pyx_GOTREF(__pyx_t_2);
20675 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20676 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20677 if (PyDict_SetItem(__pyx_d, __pyx_n_s_ninf3, __pyx_t_2) < 0) __PYX_ERR(0, 1909, __pyx_L1_error)
20678 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20687 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_e);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1910, __pyx_L1_error)
20688 __Pyx_GOTREF(__pyx_t_2);
20689 __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)
20690 __Pyx_GOTREF(__pyx_t_3);
20691 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20692 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_e);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1910, __pyx_L1_error)
20693 __Pyx_GOTREF(__pyx_t_2);
20694 __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)
20695 __Pyx_GOTREF(__pyx_t_1);
20696 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20697 __pyx_t_2 = PyNumber_Subtract(__pyx_t_3, __pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1910, __pyx_L1_error)
20698 __Pyx_GOTREF(__pyx_t_2);
20699 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20700 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20701 if (PyDict_SetItem(__pyx_d, __pyx_n_s_nbar3, __pyx_t_2) < 0) __PYX_ERR(0, 1910, __pyx_L1_error)
20702 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20711 __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)
20712 __Pyx_GOTREF(__pyx_t_2);
20713 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1913, __pyx_L1_error)
20714 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20722 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1917, __pyx_L1_error)
20723 __Pyx_GOTREF(__pyx_t_2);
20724 __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)
20725 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20733 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_test);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1918, __pyx_L1_error)
20734 __Pyx_GOTREF(__pyx_t_1);
20736 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
20737 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
20738 if (likely(__pyx_t_3)) {
20739 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
20740 __Pyx_INCREF(__pyx_t_3);
20741 __Pyx_INCREF(
function);
20742 __Pyx_DECREF_SET(__pyx_t_1,
function);
20746 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1918, __pyx_L1_error)
20747 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20749 __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1918, __pyx_L1_error)
20751 __Pyx_GOTREF(__pyx_t_2);
20752 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20753 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20768 __pyx_t_2 = __Pyx_PyDict_NewPresized(107);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
20769 __Pyx_GOTREF(__pyx_t_2);
20770 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)
20771 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)
20772 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)
20773 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)
20774 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)
20775 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)
20776 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)
20777 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)
20778 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)
20779 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)
20780 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)
20781 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)
20782 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)
20783 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)
20784 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)
20785 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)
20786 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)
20787 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)
20788 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)
20789 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)
20790 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)
20791 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)
20792 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)
20793 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)
20794 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)
20795 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)
20796 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)
20797 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)
20798 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)
20799 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)
20800 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)
20801 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)
20802 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)
20803 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)
20804 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)
20805 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)
20806 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)
20807 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)
20808 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)
20809 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)
20810 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)
20811 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)
20812 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)
20813 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)
20814 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)
20815 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)
20816 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)
20817 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)
20818 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)
20819 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)
20820 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)
20821 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)
20822 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)
20823 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)
20824 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)
20825 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)
20826 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)
20827 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)
20828 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)
20829 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)
20830 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)
20831 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)
20832 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)
20833 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)
20834 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)
20835 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)
20836 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)
20837 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)
20838 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)
20839 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)
20840 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)
20841 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)
20842 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)
20843 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)
20844 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)
20845 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)
20846 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)
20847 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)
20848 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)
20849 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)
20850 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)
20851 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)
20852 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)
20853 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)
20854 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)
20855 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)
20856 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)
20857 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)
20858 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)
20859 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)
20860 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)
20861 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)
20862 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)
20863 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)
20864 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)
20865 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)
20866 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)
20867 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)
20868 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)
20869 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)
20870 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)
20871 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)
20872 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)
20873 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)
20874 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)
20875 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)
20876 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)
20877 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_2, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20878 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20884 __Pyx_XDECREF(__pyx_t_1);
20885 __Pyx_XDECREF(__pyx_t_2);
20886 __Pyx_XDECREF(__pyx_t_3);
20889 __Pyx_AddTraceback(
"init PyClical", 0, __pyx_lineno, __pyx_filename);
20891 Py_DECREF(__pyx_m); __pyx_m = 0;
20892 }
else if (!PyErr_Occurred()) {
20893 PyErr_SetString(PyExc_ImportError,
"init PyClical");
20896 __Pyx_RefNannyFinishContext();
20897 #if CYTHON_PEP489_MULTI_PHASE_INIT 20898 return (__pyx_m != NULL) ? 0 : -1;
20899 #elif PY_MAJOR_VERSION >= 3 20908 #if CYTHON_REFNANNY 20909 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
20910 PyObject *m = NULL, *p = NULL;
20912 m = PyImport_ImportModule((
char *)modname);
20914 p = PyObject_GetAttrString(m, (
char *)
"RefNannyAPI");
20916 r = PyLong_AsVoidPtr(p);
20920 return (__Pyx_RefNannyAPIStruct *)r;
20925 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
20926 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
20927 if (unlikely(!result)) {
20928 PyErr_Format(PyExc_NameError,
20929 #
if PY_MAJOR_VERSION >= 3
20930 "name '%U' is not defined", name);
20932 "name '%.200s' is not defined", PyString_AS_STRING(name));
20939 #if CYTHON_COMPILING_IN_CPYTHON 20940 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
20942 ternaryfunc call = func->ob_type->tp_call;
20943 if (unlikely(!call))
20944 return PyObject_Call(func, arg, kw);
20945 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
20947 result = (*call)(func, arg, kw);
20948 Py_LeaveRecursiveCall();
20949 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
20952 "NULL result without error in PyObject_Call");
20959 #if CYTHON_FAST_THREAD_STATE 20960 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
20961 PyObject *tmp_type, *tmp_value, *tmp_tb;
20962 tmp_type = tstate->curexc_type;
20963 tmp_value = tstate->curexc_value;
20964 tmp_tb = tstate->curexc_traceback;
20965 tstate->curexc_type = type;
20966 tstate->curexc_value = value;
20967 tstate->curexc_traceback = tb;
20968 Py_XDECREF(tmp_type);
20969 Py_XDECREF(tmp_value);
20970 Py_XDECREF(tmp_tb);
20972 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
20973 *type = tstate->curexc_type;
20974 *value = tstate->curexc_value;
20975 *tb = tstate->curexc_traceback;
20976 tstate->curexc_type = 0;
20977 tstate->curexc_value = 0;
20978 tstate->curexc_traceback = 0;
20983 static void __Pyx_WriteUnraisable(
const char *name, CYTHON_UNUSED
int clineno,
20984 CYTHON_UNUSED
int lineno, CYTHON_UNUSED
const char *filename,
20985 int full_traceback, CYTHON_UNUSED
int nogil) {
20986 PyObject *old_exc, *old_val, *old_tb;
20988 __Pyx_PyThreadState_declare
20990 PyGILState_STATE state;
20992 state = PyGILState_Ensure();
20994 else state = (PyGILState_STATE)-1;
20997 __Pyx_PyThreadState_assign
20998 __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
20999 if (full_traceback) {
21000 Py_XINCREF(old_exc);
21001 Py_XINCREF(old_val);
21002 Py_XINCREF(old_tb);
21003 __Pyx_ErrRestore(old_exc, old_val, old_tb);
21006 #if PY_MAJOR_VERSION < 3 21007 ctx = PyString_FromString(name);
21009 ctx = PyUnicode_FromString(name);
21011 __Pyx_ErrRestore(old_exc, old_val, old_tb);
21013 PyErr_WriteUnraisable(Py_None);
21015 PyErr_WriteUnraisable(ctx);
21020 PyGILState_Release(state);
21025 #if CYTHON_FAST_PYCCALL 21026 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
21027 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
21028 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
21029 PyObject *
self = PyCFunction_GET_SELF(func);
21030 int flags = PyCFunction_GET_FLAGS(func);
21031 assert(PyCFunction_Check(func));
21032 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)));
21033 assert(nargs >= 0);
21034 assert(nargs == 0 || args != NULL);
21038 assert(!PyErr_Occurred());
21039 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
21040 return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (
self, args, nargs, NULL);
21042 return (*((__Pyx_PyCFunctionFast)meth)) (
self, args, nargs);
21048 #if CYTHON_FAST_PYCALL 21049 #include "frameobject.h" 21050 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
21051 PyObject *globals) {
21053 PyThreadState *tstate = __Pyx_PyThreadState_Current;
21054 PyObject **fastlocals;
21057 assert(globals != NULL);
21062 assert(tstate != NULL);
21063 f = PyFrame_New(tstate, co, globals, NULL);
21067 fastlocals = f->f_localsplus;
21068 for (
i = 0;
i < na;
i++) {
21070 fastlocals[
i] = *args++;
21072 result = PyEval_EvalFrameEx(f,0);
21073 ++tstate->recursion_depth;
21075 --tstate->recursion_depth;
21078 #if 1 || PY_VERSION_HEX < 0x030600B1 21079 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
int nargs, PyObject *kwargs) {
21080 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
21081 PyObject *globals = PyFunction_GET_GLOBALS(func);
21082 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
21084 #if PY_MAJOR_VERSION >= 3 21087 PyObject *kwtuple, **k;
21092 assert(kwargs == NULL || PyDict_Check(kwargs));
21093 nk = kwargs ? PyDict_Size(kwargs) : 0;
21094 if (Py_EnterRecursiveCall((
char*)
" while calling a Python object")) {
21098 #
if PY_MAJOR_VERSION >= 3
21099 co->co_kwonlyargcount == 0 &&
21101 likely(kwargs == NULL || nk == 0) &&
21102 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
21103 if (argdefs == NULL && co->co_argcount == nargs) {
21104 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
21107 else if (nargs == 0 && argdefs != NULL
21108 && co->co_argcount == Py_SIZE(argdefs)) {
21111 args = &PyTuple_GET_ITEM(argdefs, 0);
21112 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
21116 if (kwargs != NULL) {
21118 kwtuple = PyTuple_New(2 * nk);
21119 if (kwtuple == NULL) {
21123 k = &PyTuple_GET_ITEM(kwtuple, 0);
21125 while (PyDict_Next(kwargs, &pos, &k[
i], &k[
i+1])) {
21136 closure = PyFunction_GET_CLOSURE(func);
21137 #if PY_MAJOR_VERSION >= 3 21138 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
21140 if (argdefs != NULL) {
21141 d = &PyTuple_GET_ITEM(argdefs, 0);
21142 nd = Py_SIZE(argdefs);
21148 #if PY_MAJOR_VERSION >= 3 21149 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
21152 d, (
int)nd, kwdefs, closure);
21154 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
21157 d, (
int)nd, closure);
21159 Py_XDECREF(kwtuple);
21161 Py_LeaveRecursiveCall();
21168 #if CYTHON_COMPILING_IN_CPYTHON 21169 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
21170 PyObject *
self, *result;
21172 cfunc = PyCFunction_GET_FUNCTION(func);
21173 self = PyCFunction_GET_SELF(func);
21174 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
21176 result = cfunc(
self, arg);
21177 Py_LeaveRecursiveCall();
21178 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
21181 "NULL result without error in PyObject_Call");
21188 #if CYTHON_COMPILING_IN_CPYTHON 21189 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
21191 PyObject *args = PyTuple_New(1);
21192 if (unlikely(!args))
return NULL;
21194 PyTuple_SET_ITEM(args, 0, arg);
21195 result = __Pyx_PyObject_Call(func, args, NULL);
21199 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
21200 #if CYTHON_FAST_PYCALL 21201 if (PyFunction_Check(func)) {
21202 return __Pyx_PyFunction_FastCall(func, &arg, 1);
21205 if (likely(PyCFunction_Check(func))) {
21206 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
21207 return __Pyx_PyObject_CallMethO(func, arg);
21208 #if CYTHON_FAST_PYCCALL 21209 }
else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
21210 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
21214 return __Pyx__PyObject_CallOneArg(func, arg);
21217 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
21219 PyObject *args = PyTuple_Pack(1, arg);
21220 if (unlikely(!args))
return NULL;
21221 result = __Pyx_PyObject_Call(func, args, NULL);
21228 #if CYTHON_COMPILING_IN_CPYTHON 21229 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
21230 #if CYTHON_FAST_PYCALL 21231 if (PyFunction_Check(func)) {
21232 return __Pyx_PyFunction_FastCall(func, NULL, 0);
21235 #ifdef __Pyx_CyFunction_USED 21236 if (likely(PyCFunction_Check(func) || __Pyx_TypeCheck(func, __pyx_CyFunctionType))) {
21238 if (likely(PyCFunction_Check(func))) {
21240 if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
21241 return __Pyx_PyObject_CallMethO(func, NULL);
21244 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
21249 static void __Pyx_RaiseDoubleKeywordsError(
21250 const char* func_name,
21253 PyErr_Format(PyExc_TypeError,
21254 #
if PY_MAJOR_VERSION >= 3
21255 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
21257 "%s() got multiple values for keyword argument '%s'", func_name,
21258 PyString_AsString(kw_name));
21263 static int __Pyx_ParseOptionalKeywords(
21265 PyObject **argnames[],
21267 PyObject *values[],
21268 Py_ssize_t num_pos_args,
21269 const char* function_name)
21271 PyObject *key = 0, *value = 0;
21272 Py_ssize_t pos = 0;
21274 PyObject*** first_kw_arg = argnames + num_pos_args;
21275 while (PyDict_Next(kwds, &pos, &key, &value)) {
21276 name = first_kw_arg;
21277 while (*name && (**name != key)) name++;
21279 values[name-argnames] = value;
21282 name = first_kw_arg;
21283 #if PY_MAJOR_VERSION < 3 21284 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
21286 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
21287 && _PyString_Eq(**name, key)) {
21288 values[name-argnames] = value;
21293 if (*name)
continue;
21295 PyObject*** argname = argnames;
21296 while (argname != first_kw_arg) {
21297 if ((**argname == key) || (
21298 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
21299 && _PyString_Eq(**argname, key))) {
21300 goto arg_passed_twice;
21307 if (likely(PyUnicode_Check(key))) {
21309 int cmp = (**name == key) ? 0 :
21310 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
21311 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
21313 PyUnicode_Compare(**name, key);
21314 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
21316 values[name-argnames] = value;
21321 if (*name)
continue;
21323 PyObject*** argname = argnames;
21324 while (argname != first_kw_arg) {
21325 int cmp = (**argname == key) ? 0 :
21326 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
21327 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
21329 PyUnicode_Compare(**argname, key);
21330 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
21331 if (cmp == 0)
goto arg_passed_twice;
21336 goto invalid_keyword_type;
21338 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
21340 goto invalid_keyword;
21345 __Pyx_RaiseDoubleKeywordsError(function_name, key);
21347 invalid_keyword_type:
21348 PyErr_Format(PyExc_TypeError,
21349 "%.200s() keywords must be strings", function_name);
21352 PyErr_Format(PyExc_TypeError,
21353 #
if PY_MAJOR_VERSION < 3
21354 "%.200s() got an unexpected keyword argument '%.200s'",
21355 function_name, PyString_AsString(key));
21357 "%s() got an unexpected keyword argument '%U'",
21358 function_name, key);
21365 static void __Pyx_RaiseArgtupleInvalid(
21366 const char* func_name,
21368 Py_ssize_t num_min,
21369 Py_ssize_t num_max,
21370 Py_ssize_t num_found)
21372 Py_ssize_t num_expected;
21373 const char *more_or_less;
21374 if (num_found < num_min) {
21375 num_expected = num_min;
21376 more_or_less =
"at least";
21378 num_expected = num_max;
21379 more_or_less =
"at most";
21382 more_or_less =
"exactly";
21384 PyErr_Format(PyExc_TypeError,
21385 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
21386 func_name, more_or_less, num_expected,
21387 (num_expected == 1) ?
"" :
"s", num_found);
21391 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
21393 #if !CYTHON_AVOID_BORROWED_REFS 21394 result = PyDict_GetItem(__pyx_d, name);
21395 if (likely(result)) {
21399 result = PyObject_GetItem(__pyx_d, name);
21403 result = __Pyx_GetBuiltinName(name);
21409 #if CYTHON_FAST_THREAD_STATE 21410 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
21411 #if PY_VERSION_HEX >= 0x030700A2 21412 *type = tstate->exc_state.exc_type;
21413 *value = tstate->exc_state.exc_value;
21414 *tb = tstate->exc_state.exc_traceback;
21416 *type = tstate->exc_type;
21417 *value = tstate->exc_value;
21418 *tb = tstate->exc_traceback;
21421 Py_XINCREF(*value);
21424 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
21425 PyObject *tmp_type, *tmp_value, *tmp_tb;
21426 #if PY_VERSION_HEX >= 0x030700A2 21427 tmp_type = tstate->exc_state.exc_type;
21428 tmp_value = tstate->exc_state.exc_value;
21429 tmp_tb = tstate->exc_state.exc_traceback;
21430 tstate->exc_state.exc_type = type;
21431 tstate->exc_state.exc_value = value;
21432 tstate->exc_state.exc_traceback = tb;
21434 tmp_type = tstate->exc_type;
21435 tmp_value = tstate->exc_value;
21436 tmp_tb = tstate->exc_traceback;
21437 tstate->exc_type = type;
21438 tstate->exc_value = value;
21439 tstate->exc_traceback = tb;
21441 Py_XDECREF(tmp_type);
21442 Py_XDECREF(tmp_value);
21443 Py_XDECREF(tmp_tb);
21448 #if CYTHON_FAST_THREAD_STATE 21449 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
21451 n = PyTuple_GET_SIZE(tuple);
21452 #if PY_MAJOR_VERSION >= 3 21453 for (
i=0;
i<n;
i++) {
21454 if (exc_type == PyTuple_GET_ITEM(tuple,
i))
return 1;
21457 for (
i=0;
i<n;
i++) {
21458 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple,
i)))
return 1;
21462 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
21463 PyObject *exc_type = tstate->curexc_type;
21464 if (exc_type == err)
return 1;
21465 if (unlikely(!exc_type))
return 0;
21466 if (unlikely(PyTuple_Check(err)))
21467 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
21468 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
21473 #if CYTHON_FAST_THREAD_STATE 21474 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
21476 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
21478 PyObject *local_type, *local_value, *local_tb;
21479 #if CYTHON_FAST_THREAD_STATE 21480 PyObject *tmp_type, *tmp_value, *tmp_tb;
21481 local_type = tstate->curexc_type;
21482 local_value = tstate->curexc_value;
21483 local_tb = tstate->curexc_traceback;
21484 tstate->curexc_type = 0;
21485 tstate->curexc_value = 0;
21486 tstate->curexc_traceback = 0;
21488 PyErr_Fetch(&local_type, &local_value, &local_tb);
21490 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
21491 #if CYTHON_FAST_THREAD_STATE 21492 if (unlikely(tstate->curexc_type))
21494 if (unlikely(PyErr_Occurred()))
21497 #if PY_MAJOR_VERSION >= 3 21499 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
21503 Py_XINCREF(local_tb);
21504 Py_XINCREF(local_type);
21505 Py_XINCREF(local_value);
21506 *type = local_type;
21507 *value = local_value;
21509 #if CYTHON_FAST_THREAD_STATE 21510 #if PY_VERSION_HEX >= 0x030700A2 21511 tmp_type = tstate->exc_state.exc_type;
21512 tmp_value = tstate->exc_state.exc_value;
21513 tmp_tb = tstate->exc_state.exc_traceback;
21514 tstate->exc_state.exc_type = local_type;
21515 tstate->exc_state.exc_value = local_value;
21516 tstate->exc_state.exc_traceback = local_tb;
21518 tmp_type = tstate->exc_type;
21519 tmp_value = tstate->exc_value;
21520 tmp_tb = tstate->exc_traceback;
21521 tstate->exc_type = local_type;
21522 tstate->exc_value = local_value;
21523 tstate->exc_traceback = local_tb;
21525 Py_XDECREF(tmp_type);
21526 Py_XDECREF(tmp_value);
21527 Py_XDECREF(tmp_tb);
21529 PyErr_SetExcInfo(local_type, local_value, local_tb);
21536 Py_XDECREF(local_type);
21537 Py_XDECREF(local_value);
21538 Py_XDECREF(local_tb);
21543 #if PY_MAJOR_VERSION < 3 21544 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
21545 CYTHON_UNUSED PyObject *cause) {
21546 __Pyx_PyThreadState_declare
21548 if (!value || value == Py_None)
21552 if (!tb || tb == Py_None)
21556 if (!PyTraceBack_Check(tb)) {
21557 PyErr_SetString(PyExc_TypeError,
21558 "raise: arg 3 must be a traceback or None");
21562 if (PyType_Check(type)) {
21563 #if CYTHON_COMPILING_IN_PYPY 21565 Py_INCREF(Py_None);
21569 PyErr_NormalizeException(&type, &value, &tb);
21572 PyErr_SetString(PyExc_TypeError,
21573 "instance exception may not have a separate value");
21577 type = (PyObject*) Py_TYPE(type);
21579 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
21580 PyErr_SetString(PyExc_TypeError,
21581 "raise: exception class must be a subclass of BaseException");
21585 __Pyx_PyThreadState_assign
21586 __Pyx_ErrRestore(type, value, tb);
21595 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
21596 PyObject* owned_instance = NULL;
21597 if (tb == Py_None) {
21599 }
else if (tb && !PyTraceBack_Check(tb)) {
21600 PyErr_SetString(PyExc_TypeError,
21601 "raise: arg 3 must be a traceback or None");
21604 if (value == Py_None)
21606 if (PyExceptionInstance_Check(type)) {
21608 PyErr_SetString(PyExc_TypeError,
21609 "instance exception may not have a separate value");
21613 type = (PyObject*) Py_TYPE(value);
21614 }
else if (PyExceptionClass_Check(type)) {
21615 PyObject *instance_class = NULL;
21616 if (value && PyExceptionInstance_Check(value)) {
21617 instance_class = (PyObject*) Py_TYPE(value);
21618 if (instance_class != type) {
21619 int is_subclass = PyObject_IsSubclass(instance_class, type);
21620 if (!is_subclass) {
21621 instance_class = NULL;
21622 }
else if (unlikely(is_subclass == -1)) {
21625 type = instance_class;
21629 if (!instance_class) {
21632 args = PyTuple_New(0);
21633 else if (PyTuple_Check(value)) {
21637 args = PyTuple_Pack(1, value);
21640 owned_instance = PyObject_Call(type, args, NULL);
21642 if (!owned_instance)
21644 value = owned_instance;
21645 if (!PyExceptionInstance_Check(value)) {
21646 PyErr_Format(PyExc_TypeError,
21647 "calling %R should have returned an instance of " 21648 "BaseException, not %R",
21649 type, Py_TYPE(value));
21654 PyErr_SetString(PyExc_TypeError,
21655 "raise: exception class must be a subclass of BaseException");
21659 PyObject *fixed_cause;
21660 if (cause == Py_None) {
21661 fixed_cause = NULL;
21662 }
else if (PyExceptionClass_Check(cause)) {
21663 fixed_cause = PyObject_CallObject(cause, NULL);
21664 if (fixed_cause == NULL)
21666 }
else if (PyExceptionInstance_Check(cause)) {
21667 fixed_cause = cause;
21668 Py_INCREF(fixed_cause);
21670 PyErr_SetString(PyExc_TypeError,
21671 "exception causes must derive from " 21675 PyException_SetCause(value, fixed_cause);
21677 PyErr_SetObject(type, value);
21679 #if CYTHON_COMPILING_IN_PYPY 21680 PyObject *tmp_type, *tmp_value, *tmp_tb;
21681 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
21683 PyErr_Restore(tmp_type, tmp_value, tb);
21684 Py_XDECREF(tmp_tb);
21686 PyThreadState *tstate = __Pyx_PyThreadState_Current;
21687 PyObject* tmp_tb = tstate->curexc_traceback;
21688 if (tb != tmp_tb) {
21690 tstate->curexc_traceback = tb;
21691 Py_XDECREF(tmp_tb);
21696 Py_XDECREF(owned_instance);
21702 #if !CYTHON_COMPILING_IN_PYPY 21703 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
long intval, CYTHON_UNUSED
int inplace) {
21704 #if PY_MAJOR_VERSION < 3 21705 if (likely(PyInt_CheckExact(op1))) {
21706 const long b = intval;
21708 long a = PyInt_AS_LONG(op1);
21709 x = (long)((
unsigned long)a + b);
21710 if (likely((x^a) >= 0 || (x^b) >= 0))
21711 return PyInt_FromLong(x);
21712 return PyLong_Type.tp_as_number->nb_add(op1, op2);
21715 #if CYTHON_USE_PYLONG_INTERNALS 21716 if (likely(PyLong_CheckExact(op1))) {
21717 const long b = intval;
21719 #ifdef HAVE_LONG_LONG 21720 const PY_LONG_LONG llb = intval;
21721 PY_LONG_LONG lla, llx;
21723 const digit* digits = ((PyLongObject*)op1)->ob_digit;
21724 const Py_ssize_t size = Py_SIZE(op1);
21725 if (likely(__Pyx_sst_abs(size) <= 1)) {
21726 a = likely(size) ? digits[0] : 0;
21727 if (size == -1) a = -a;
21731 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
21732 a = -(long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21734 #ifdef HAVE_LONG_LONG 21735 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
21736 lla = -(PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
21741 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
21742 a = (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21744 #ifdef HAVE_LONG_LONG 21745 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
21746 lla = (PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
21751 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
21752 a = -(long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21754 #ifdef HAVE_LONG_LONG 21755 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
21756 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]));
21761 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
21762 a = (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21764 #ifdef HAVE_LONG_LONG 21765 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
21766 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]));
21771 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
21772 a = -(long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21774 #ifdef HAVE_LONG_LONG 21775 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
21776 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]));
21781 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
21782 a = (long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21784 #ifdef HAVE_LONG_LONG 21785 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
21786 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]));
21790 default:
return PyLong_Type.tp_as_number->nb_add(op1, op2);
21794 return PyLong_FromLong(x);
21795 #ifdef HAVE_LONG_LONG 21798 return PyLong_FromLongLong(llx);
21804 if (PyFloat_CheckExact(op1)) {
21805 const long b = intval;
21806 double a = PyFloat_AS_DOUBLE(op1);
21808 PyFPE_START_PROTECT(
"add",
return NULL)
21809 result = ((double)a) + (double)b;
21810 PyFPE_END_PROTECT(result)
21813 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
21818 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
21821 r = PyObject_SetItem(o, j, v);
21825 static CYTHON_INLINE
int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t
i, PyObject *v,
int is_list,
21826 CYTHON_NCP_UNUSED
int wraparound, CYTHON_NCP_UNUSED
int boundscheck) {
21827 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS 21828 if (is_list || PyList_CheckExact(o)) {
21829 Py_ssize_t n = (!wraparound) ?
i : ((likely(
i >= 0)) ?
i :
i + PyList_GET_SIZE(o));
21830 if ((!boundscheck) || likely((n >= 0) & (n < PyList_GET_SIZE(o)))) {
21831 PyObject* old = PyList_GET_ITEM(o, n);
21833 PyList_SET_ITEM(o, n, v);
21838 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
21839 if (likely(m && m->sq_ass_item)) {
21840 if (wraparound && unlikely(
i < 0) && likely(m->sq_length)) {
21841 Py_ssize_t l = m->sq_length(o);
21842 if (likely(l >= 0)) {
21845 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
21850 return m->sq_ass_item(o,
i, v);
21854 #if CYTHON_COMPILING_IN_PYPY 21855 if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) {
21857 if (is_list || PySequence_Check(o)) {
21859 return PySequence_SetItem(o,
i, v);
21862 return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(
i), v);
21866 static int __Pyx__ArgTypeTest(PyObject *
obj, PyTypeObject *type,
const char *name,
int exact)
21868 if (unlikely(!type)) {
21869 PyErr_SetString(PyExc_SystemError,
"Missing type object");
21873 #if PY_MAJOR_VERSION == 2 21874 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(
obj)))
return 1;
21878 if (likely(__Pyx_TypeCheck(
obj, type)))
return 1;
21880 PyErr_Format(PyExc_TypeError,
21881 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
21882 name, type->tp_name, Py_TYPE(
obj)->tp_name);
21887 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level) {
21888 PyObject *empty_list = 0;
21889 PyObject *module = 0;
21890 PyObject *global_dict = 0;
21891 PyObject *empty_dict = 0;
21893 #if PY_MAJOR_VERSION < 3 21894 PyObject *py_import;
21895 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
21902 empty_list = PyList_New(0);
21907 global_dict = PyModule_GetDict(__pyx_m);
21910 empty_dict = PyDict_New();
21914 #if PY_MAJOR_VERSION >= 3 21916 if (strchr(__Pyx_MODULE_NAME,
'.')) {
21917 module = PyImport_ImportModuleLevelObject(
21918 name, global_dict, empty_dict, list, 1);
21920 if (!PyErr_ExceptionMatches(PyExc_ImportError))
21929 #if PY_MAJOR_VERSION < 3 21930 PyObject *py_level = PyInt_FromLong(level);
21933 module = PyObject_CallFunctionObjArgs(py_import,
21934 name, global_dict, empty_dict, list, py_level, NULL);
21935 Py_DECREF(py_level);
21937 module = PyImport_ImportModuleLevelObject(
21938 name, global_dict, empty_dict, list, level);
21943 #if PY_MAJOR_VERSION < 3 21944 Py_XDECREF(py_import);
21946 Py_XDECREF(empty_list);
21947 Py_XDECREF(empty_dict);
21952 static int __Pyx_SetVtable(PyObject *dict,
void *vtable) {
21953 #if PY_VERSION_HEX >= 0x02070000 21954 PyObject *ob = PyCapsule_New(vtable, 0, 0);
21956 PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
21960 if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
21970 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
21972 PyObject *name_attr;
21973 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name);
21974 if (likely(name_attr)) {
21975 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
21979 if (unlikely(ret < 0)) {
21983 Py_XDECREF(name_attr);
21986 static int __Pyx_setup_reduce(PyObject* type_obj) {
21988 PyObject *object_reduce = NULL;
21989 PyObject *object_reduce_ex = NULL;
21990 PyObject *reduce = NULL;
21991 PyObject *reduce_ex = NULL;
21992 PyObject *reduce_cython = NULL;
21993 PyObject *setstate = NULL;
21994 PyObject *setstate_cython = NULL;
21995 #if CYTHON_USE_PYTYPE_LOOKUP 21996 if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate))
goto GOOD;
21998 if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate))
goto GOOD;
22000 #if CYTHON_USE_PYTYPE_LOOKUP 22001 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto BAD;
22003 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto BAD;
22005 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex);
if (unlikely(!reduce_ex))
goto BAD;
22006 if (reduce_ex == object_reduce_ex) {
22007 #if CYTHON_USE_PYTYPE_LOOKUP 22008 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto BAD;
22010 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto BAD;
22012 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce);
if (unlikely(!reduce))
goto BAD;
22013 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
22014 reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython);
if (unlikely(!reduce_cython))
goto BAD;
22015 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython);
if (unlikely(ret < 0))
goto BAD;
22016 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython);
if (unlikely(ret < 0))
goto BAD;
22017 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
22018 if (!setstate) PyErr_Clear();
22019 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
22020 setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython);
if (unlikely(!setstate_cython))
goto BAD;
22021 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython);
if (unlikely(ret < 0))
goto BAD;
22022 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython);
if (unlikely(ret < 0))
goto BAD;
22024 PyType_Modified((PyTypeObject*)type_obj);
22029 if (!PyErr_Occurred())
22030 PyErr_Format(PyExc_RuntimeError,
"Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
22033 #if !CYTHON_USE_PYTYPE_LOOKUP 22034 Py_XDECREF(object_reduce);
22035 Py_XDECREF(object_reduce_ex);
22037 Py_XDECREF(reduce);
22038 Py_XDECREF(reduce_ex);
22039 Py_XDECREF(reduce_cython);
22040 Py_XDECREF(setstate);
22041 Py_XDECREF(setstate_cython);
22046 #if !CYTHON_COMPILING_IN_PYPY 22047 static PyObject* __Pyx_PyFloat_DivideObjC(PyObject *op1, PyObject *op2,
double floatval, CYTHON_UNUSED
int inplace) {
22048 const double b = floatval;
22050 if (likely(PyFloat_CheckExact(op1))) {
22051 a = PyFloat_AS_DOUBLE(op1);
22053 #if PY_MAJOR_VERSION < 3 22054 if (likely(PyInt_CheckExact(op1))) {
22055 a = (double) PyInt_AS_LONG(op1);
22058 if (likely(PyLong_CheckExact(op1))) {
22059 #if CYTHON_USE_PYLONG_INTERNALS 22060 const digit* digits = ((PyLongObject*)op1)->ob_digit;
22061 const Py_ssize_t size = Py_SIZE(op1);
22063 case 0: a = 0.0;
break;
22064 case -1: a = -(double) digits[0];
break;
22065 case 1: a = (double) digits[0];
break;
22068 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
22069 a = (double) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
22070 if ((8 *
sizeof(
unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
22078 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
22079 a = (double) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
22080 if ((8 *
sizeof(
unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
22088 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
22089 a = (double) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
22090 if ((8 *
sizeof(
unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
22100 a = PyLong_AsDouble(op1);
22101 if (unlikely(a == -1.0 && PyErr_Occurred()))
return NULL;
22104 return (inplace ? __Pyx_PyNumber_InPlaceDivide(op1, op2) : __Pyx_PyNumber_Divide(op1, op2));
22106 PyFPE_START_PROTECT(
"divide",
return NULL)
22108 PyFPE_END_PROTECT(result)
22114 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals) {
22115 #if CYTHON_COMPILING_IN_PYPY 22116 return PyObject_RichCompareBool(s1, s2, equals);
22119 return (equals == Py_EQ);
22120 }
else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
22121 const char *ps1, *ps2;
22122 Py_ssize_t length = PyBytes_GET_SIZE(s1);
22123 if (length != PyBytes_GET_SIZE(s2))
22124 return (equals == Py_NE);
22125 ps1 = PyBytes_AS_STRING(s1);
22126 ps2 = PyBytes_AS_STRING(s2);
22127 if (ps1[0] != ps2[0]) {
22128 return (equals == Py_NE);
22129 }
else if (length == 1) {
22130 return (equals == Py_EQ);
22133 #if CYTHON_USE_UNICODE_INTERNALS 22134 Py_hash_t hash1, hash2;
22135 hash1 = ((PyBytesObject*)s1)->ob_shash;
22136 hash2 = ((PyBytesObject*)s2)->ob_shash;
22137 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
22138 return (equals == Py_NE);
22141 result = memcmp(ps1, ps2, (
size_t)length);
22142 return (equals == Py_EQ) ? (result == 0) : (result != 0);
22144 }
else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
22145 return (equals == Py_NE);
22146 }
else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
22147 return (equals == Py_NE);
22150 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
22153 result = __Pyx_PyObject_IsTrue(py_result);
22154 Py_DECREF(py_result);
22161 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals) {
22162 #if CYTHON_COMPILING_IN_PYPY 22163 return PyObject_RichCompareBool(s1, s2, equals);
22165 #if PY_MAJOR_VERSION < 3 22166 PyObject* owned_ref = NULL;
22168 int s1_is_unicode, s2_is_unicode;
22172 s1_is_unicode = PyUnicode_CheckExact(s1);
22173 s2_is_unicode = PyUnicode_CheckExact(s2);
22174 #if PY_MAJOR_VERSION < 3 22175 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
22176 owned_ref = PyUnicode_FromObject(s2);
22177 if (unlikely(!owned_ref))
22181 }
else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
22182 owned_ref = PyUnicode_FromObject(s1);
22183 if (unlikely(!owned_ref))
22187 }
else if (((!s2_is_unicode) & (!s1_is_unicode))) {
22188 return __Pyx_PyBytes_Equals(s1, s2, equals);
22191 if (s1_is_unicode & s2_is_unicode) {
22194 void *data1, *data2;
22195 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
22197 length = __Pyx_PyUnicode_GET_LENGTH(s1);
22198 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
22201 #if CYTHON_USE_UNICODE_INTERNALS 22203 Py_hash_t hash1, hash2;
22204 #if CYTHON_PEP393_ENABLED 22205 hash1 = ((PyASCIIObject*)s1)->hash;
22206 hash2 = ((PyASCIIObject*)s2)->hash;
22208 hash1 = ((PyUnicodeObject*)s1)->hash;
22209 hash2 = ((PyUnicodeObject*)s2)->hash;
22211 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
22216 kind = __Pyx_PyUnicode_KIND(s1);
22217 if (kind != __Pyx_PyUnicode_KIND(s2)) {
22220 data1 = __Pyx_PyUnicode_DATA(s1);
22221 data2 = __Pyx_PyUnicode_DATA(s2);
22222 if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
22224 }
else if (length == 1) {
22227 int result = memcmp(data1, data2, (
size_t)(length * kind));
22228 #if PY_MAJOR_VERSION < 3 22229 Py_XDECREF(owned_ref);
22231 return (equals == Py_EQ) ? (result == 0) : (result != 0);
22233 }
else if ((s1 == Py_None) & s2_is_unicode) {
22235 }
else if ((s2 == Py_None) & s1_is_unicode) {
22239 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
22242 result = __Pyx_PyObject_IsTrue(py_result);
22243 Py_DECREF(py_result);
22247 #if PY_MAJOR_VERSION < 3 22248 Py_XDECREF(owned_ref);
22250 return (equals == Py_EQ);
22252 #if PY_MAJOR_VERSION < 3 22253 Py_XDECREF(owned_ref);
22255 return (equals == Py_NE);
22260 #ifndef CYTHON_CLINE_IN_TRACEBACK 22261 static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate,
int c_line) {
22262 PyObject *use_cline;
22263 PyObject *ptype, *pvalue, *ptraceback;
22264 #if CYTHON_COMPILING_IN_CPYTHON 22265 PyObject **cython_runtime_dict;
22267 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
22268 #if CYTHON_COMPILING_IN_CPYTHON 22269 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
22270 if (likely(cython_runtime_dict)) {
22271 use_cline = PyDict_GetItem(*cython_runtime_dict, __pyx_n_s_cline_in_traceback);
22275 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
22276 if (use_cline_obj) {
22277 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
22278 Py_DECREF(use_cline_obj);
22286 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
22288 else if (PyObject_Not(use_cline) != 0) {
22291 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
22297 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
22298 int start = 0, mid = 0, end = count - 1;
22299 if (end >= 0 && code_line > entries[end].code_line) {
22302 while (start < end) {
22303 mid = start + (end - start) / 2;
22304 if (code_line < entries[mid].code_line) {
22306 }
else if (code_line > entries[mid].code_line) {
22312 if (code_line <= entries[mid].code_line) {
22318 static PyCodeObject *__pyx_find_code_object(
int code_line) {
22319 PyCodeObject* code_object;
22321 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
22324 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
22325 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
22328 code_object = __pyx_code_cache.entries[pos].code_object;
22329 Py_INCREF(code_object);
22330 return code_object;
22332 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
22334 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
22335 if (unlikely(!code_line)) {
22338 if (unlikely(!entries)) {
22339 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
22340 if (likely(entries)) {
22341 __pyx_code_cache.entries = entries;
22342 __pyx_code_cache.max_count = 64;
22343 __pyx_code_cache.count = 1;
22344 entries[0].code_line = code_line;
22345 entries[0].code_object = code_object;
22346 Py_INCREF(code_object);
22350 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
22351 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
22352 PyCodeObject* tmp = entries[pos].code_object;
22353 entries[pos].code_object = code_object;
22357 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
22358 int new_max = __pyx_code_cache.max_count + 64;
22359 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
22360 __pyx_code_cache.entries, (
size_t)new_max*
sizeof(__Pyx_CodeObjectCacheEntry));
22361 if (unlikely(!entries)) {
22364 __pyx_code_cache.entries = entries;
22365 __pyx_code_cache.max_count = new_max;
22367 for (
i=__pyx_code_cache.count;
i>pos;
i--) {
22368 entries[
i] = entries[
i-1];
22370 entries[pos].code_line = code_line;
22371 entries[pos].code_object = code_object;
22372 __pyx_code_cache.count++;
22373 Py_INCREF(code_object);
22377 #include "compile.h" 22378 #include "frameobject.h" 22379 #include "traceback.h" 22380 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
22381 const char *funcname,
int c_line,
22382 int py_line,
const char *filename) {
22383 PyCodeObject *py_code = 0;
22384 PyObject *py_srcfile = 0;
22385 PyObject *py_funcname = 0;
22386 #if PY_MAJOR_VERSION < 3 22387 py_srcfile = PyString_FromString(filename);
22389 py_srcfile = PyUnicode_FromString(filename);
22391 if (!py_srcfile)
goto bad;
22393 #if PY_MAJOR_VERSION < 3 22394 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
22396 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
22400 #if PY_MAJOR_VERSION < 3 22401 py_funcname = PyString_FromString(funcname);
22403 py_funcname = PyUnicode_FromString(funcname);
22406 if (!py_funcname)
goto bad;
22407 py_code = __Pyx_PyCode_New(
22424 Py_DECREF(py_srcfile);
22425 Py_DECREF(py_funcname);
22428 Py_XDECREF(py_srcfile);
22429 Py_XDECREF(py_funcname);
22432 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
22433 int py_line,
const char *filename) {
22434 PyCodeObject *py_code = 0;
22435 PyFrameObject *py_frame = 0;
22436 PyThreadState *tstate = __Pyx_PyThreadState_Current;
22438 c_line = __Pyx_CLineForTraceback(tstate, c_line);
22440 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
22442 py_code = __Pyx_CreateCodeObjectForTraceback(
22443 funcname, c_line, py_line, filename);
22444 if (!py_code)
goto bad;
22445 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
22447 py_frame = PyFrame_New(
22453 if (!py_frame)
goto bad;
22454 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
22455 PyTraceBack_Here(py_frame);
22457 Py_XDECREF(py_code);
22458 Py_XDECREF(py_frame);
22462 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ 22463 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) 22464 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ 22465 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) 22466 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ 22468 func_type value = func_value;\ 22469 if (sizeof(target_type) < sizeof(func_type)) {\ 22470 if (unlikely(value != (func_type) (target_type) value)) {\ 22471 func_type zero = 0;\ 22472 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ 22473 return (target_type) -1;\ 22474 if (is_unsigned && unlikely(value < zero))\ 22475 goto raise_neg_overflow;\ 22477 goto raise_overflow;\ 22480 return (target_type) value;\ 22484 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value) {
22485 const int neg_one = (int) -1, const_zero = (
int) 0;
22486 const int is_unsigned = neg_one > const_zero;
22488 if (
sizeof(
int) <
sizeof(long)) {
22489 return PyInt_FromLong((
long) value);
22490 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
22491 return PyLong_FromUnsignedLong((
unsigned long) value);
22492 #ifdef HAVE_LONG_LONG 22493 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
22494 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
22498 if (
sizeof(
int) <=
sizeof(
long)) {
22499 return PyInt_FromLong((
long) value);
22500 #ifdef HAVE_LONG_LONG 22501 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
22502 return PyLong_FromLongLong((PY_LONG_LONG) value);
22507 int one = 1;
int little = (int)*(
unsigned char *)&one;
22508 unsigned char *bytes = (
unsigned char *)&value;
22509 return _PyLong_FromByteArray(bytes,
sizeof(
int),
22510 little, !is_unsigned);
22515 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *x) {
22516 const int neg_one = (int) -1, const_zero = (
int) 0;
22517 const int is_unsigned = neg_one > const_zero;
22518 #if PY_MAJOR_VERSION < 3 22519 if (likely(PyInt_Check(x))) {
22520 if (
sizeof(
int) <
sizeof(long)) {
22521 __PYX_VERIFY_RETURN_INT(
int,
long, PyInt_AS_LONG(x))
22523 long val = PyInt_AS_LONG(x);
22524 if (is_unsigned && unlikely(val < 0)) {
22525 goto raise_neg_overflow;
22531 if (likely(PyLong_Check(x))) {
22533 #if CYTHON_USE_PYLONG_INTERNALS 22534 const digit* digits = ((PyLongObject*)x)->ob_digit;
22535 switch (Py_SIZE(x)) {
22536 case 0:
return (
int) 0;
22537 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, digits[0])
22539 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
22540 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22541 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22542 }
else if (8 *
sizeof(
int) >= 2 * PyLong_SHIFT) {
22543 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
22548 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
22549 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22550 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22551 }
else if (8 *
sizeof(
int) >= 3 * PyLong_SHIFT) {
22552 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
22557 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
22558 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22559 __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])))
22560 }
else if (8 *
sizeof(
int) >= 4 * PyLong_SHIFT) {
22561 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
22567 #if CYTHON_COMPILING_IN_CPYTHON 22568 if (unlikely(Py_SIZE(x) < 0)) {
22569 goto raise_neg_overflow;
22573 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
22574 if (unlikely(result < 0))
22576 if (unlikely(result == 1))
22577 goto raise_neg_overflow;
22580 if (
sizeof(
int) <=
sizeof(
unsigned long)) {
22581 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
22582 #ifdef HAVE_LONG_LONG 22583 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
22584 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
22588 #if CYTHON_USE_PYLONG_INTERNALS 22589 const digit* digits = ((PyLongObject*)x)->ob_digit;
22590 switch (Py_SIZE(x)) {
22591 case 0:
return (
int) 0;
22592 case -1: __PYX_VERIFY_RETURN_INT(
int, sdigit, (sdigit) (-(sdigit)digits[0]))
22593 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, +digits[0])
22595 if (8 *
sizeof(
int) - 1 > 1 * PyLong_SHIFT) {
22596 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22597 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22598 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
22599 return (
int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
22604 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
22605 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22606 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22607 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
22608 return (
int) ((((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
22613 if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
22614 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22615 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22616 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
22617 return (
int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
22622 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
22623 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22624 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22625 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
22626 return (
int) ((((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
22631 if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
22632 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22633 __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])))
22634 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
22635 return (
int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
22640 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
22641 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22642 __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])))
22643 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
22644 return (
int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
22650 if (
sizeof(
int) <=
sizeof(long)) {
22651 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
22652 #ifdef HAVE_LONG_LONG 22653 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
22654 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
22659 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) 22660 PyErr_SetString(PyExc_RuntimeError,
22661 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
22664 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
22665 #if PY_MAJOR_VERSION < 3 22666 if (likely(v) && !PyLong_Check(v)) {
22668 v = PyNumber_Long(tmp);
22673 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
22674 unsigned char *bytes = (
unsigned char *)&val;
22675 int ret = _PyLong_AsByteArray((PyLongObject *)v,
22676 bytes,
sizeof(val),
22677 is_little, !is_unsigned);
22687 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
22688 if (!tmp)
return (
int) -1;
22689 val = __Pyx_PyInt_As_int(tmp);
22694 PyErr_SetString(PyExc_OverflowError,
22695 "value too large to convert to int");
22697 raise_neg_overflow:
22698 PyErr_SetString(PyExc_OverflowError,
22699 "can't convert negative value to int");
22704 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value) {
22705 const long neg_one = (long) -1, const_zero = (
long) 0;
22706 const int is_unsigned = neg_one > const_zero;
22708 if (
sizeof(
long) <
sizeof(long)) {
22709 return PyInt_FromLong((
long) value);
22710 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
22711 return PyLong_FromUnsignedLong((
unsigned long) value);
22712 #ifdef HAVE_LONG_LONG 22713 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
22714 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
22718 if (
sizeof(
long) <=
sizeof(
long)) {
22719 return PyInt_FromLong((
long) value);
22720 #ifdef HAVE_LONG_LONG 22721 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
22722 return PyLong_FromLongLong((PY_LONG_LONG) value);
22727 int one = 1;
int little = (int)*(
unsigned char *)&one;
22728 unsigned char *bytes = (
unsigned char *)&value;
22729 return _PyLong_FromByteArray(bytes,
sizeof(
long),
22730 little, !is_unsigned);
22735 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *x) {
22736 const long neg_one = (long) -1, const_zero = (
long) 0;
22737 const int is_unsigned = neg_one > const_zero;
22738 #if PY_MAJOR_VERSION < 3 22739 if (likely(PyInt_Check(x))) {
22740 if (
sizeof(
long) <
sizeof(long)) {
22741 __PYX_VERIFY_RETURN_INT(
long,
long, PyInt_AS_LONG(x))
22743 long val = PyInt_AS_LONG(x);
22744 if (is_unsigned && unlikely(val < 0)) {
22745 goto raise_neg_overflow;
22751 if (likely(PyLong_Check(x))) {
22753 #if CYTHON_USE_PYLONG_INTERNALS 22754 const digit* digits = ((PyLongObject*)x)->ob_digit;
22755 switch (Py_SIZE(x)) {
22756 case 0:
return (
long) 0;
22757 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, digits[0])
22759 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
22760 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22761 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22762 }
else if (8 *
sizeof(
long) >= 2 * PyLong_SHIFT) {
22763 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
22768 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
22769 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22770 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22771 }
else if (8 *
sizeof(
long) >= 3 * PyLong_SHIFT) {
22772 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
22777 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
22778 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22779 __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])))
22780 }
else if (8 *
sizeof(
long) >= 4 * PyLong_SHIFT) {
22781 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
22787 #if CYTHON_COMPILING_IN_CPYTHON 22788 if (unlikely(Py_SIZE(x) < 0)) {
22789 goto raise_neg_overflow;
22793 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
22794 if (unlikely(result < 0))
22796 if (unlikely(result == 1))
22797 goto raise_neg_overflow;
22800 if (
sizeof(
long) <=
sizeof(
unsigned long)) {
22801 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
22802 #ifdef HAVE_LONG_LONG 22803 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
22804 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
22808 #if CYTHON_USE_PYLONG_INTERNALS 22809 const digit* digits = ((PyLongObject*)x)->ob_digit;
22810 switch (Py_SIZE(x)) {
22811 case 0:
return (
long) 0;
22812 case -1: __PYX_VERIFY_RETURN_INT(
long, sdigit, (sdigit) (-(sdigit)digits[0]))
22813 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, +digits[0])
22815 if (8 *
sizeof(
long) - 1 > 1 * PyLong_SHIFT) {
22816 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22817 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22818 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
22819 return (
long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
22824 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
22825 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22826 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22827 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
22828 return (
long) ((((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
22833 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
22834 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22835 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22836 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
22837 return (
long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
22842 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
22843 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22844 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22845 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
22846 return (
long) ((((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
22851 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
22852 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22853 __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])))
22854 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
22855 return (
long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
22860 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
22861 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22862 __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])))
22863 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
22864 return (
long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
22870 if (
sizeof(
long) <=
sizeof(long)) {
22871 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
22872 #ifdef HAVE_LONG_LONG 22873 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
22874 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
22879 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) 22880 PyErr_SetString(PyExc_RuntimeError,
22881 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
22884 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
22885 #if PY_MAJOR_VERSION < 3 22886 if (likely(v) && !PyLong_Check(v)) {
22888 v = PyNumber_Long(tmp);
22893 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
22894 unsigned char *bytes = (
unsigned char *)&val;
22895 int ret = _PyLong_AsByteArray((PyLongObject *)v,
22896 bytes,
sizeof(val),
22897 is_little, !is_unsigned);
22907 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
22908 if (!tmp)
return (
long) -1;
22909 val = __Pyx_PyInt_As_long(tmp);
22914 PyErr_SetString(PyExc_OverflowError,
22915 "value too large to convert to long");
22917 raise_neg_overflow:
22918 PyErr_SetString(PyExc_OverflowError,
22919 "can't convert negative value to long");
22924 #if CYTHON_COMPILING_IN_CPYTHON 22925 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
22931 return b == &PyBaseObject_Type;
22933 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
22935 if (a == b)
return 1;
22939 n = PyTuple_GET_SIZE(mro);
22940 for (
i = 0;
i < n;
i++) {
22941 if (PyTuple_GET_ITEM(mro,
i) == (PyObject *)b)
22946 return __Pyx_InBases(a, b);
22948 #if PY_MAJOR_VERSION == 2 22949 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
22950 PyObject *exception, *value, *tb;
22952 __Pyx_PyThreadState_declare
22953 __Pyx_PyThreadState_assign
22954 __Pyx_ErrFetch(&exception, &value, &tb);
22955 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
22956 if (unlikely(res == -1)) {
22957 PyErr_WriteUnraisable(err);
22961 res = PyObject_IsSubclass(err, exc_type2);
22962 if (unlikely(res == -1)) {
22963 PyErr_WriteUnraisable(err);
22967 __Pyx_ErrRestore(exception, value, tb);
22971 static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
22972 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
22974 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
22979 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
22980 if (likely(err == exc_type))
return 1;
22981 if (likely(PyExceptionClass_Check(err))) {
22982 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
22984 return PyErr_GivenExceptionMatches(err, exc_type);
22986 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
22987 if (likely(err == exc_type1 || err == exc_type2))
return 1;
22988 if (likely(PyExceptionClass_Check(err))) {
22989 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
22991 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
22996 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
22997 PyObject* fake_module;
22998 PyTypeObject* cached_type = NULL;
22999 fake_module = PyImport_AddModule((
char*)
"_cython_" CYTHON_ABI);
23000 if (!fake_module)
return NULL;
23001 Py_INCREF(fake_module);
23002 cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
23004 if (!PyType_Check((PyObject*)cached_type)) {
23005 PyErr_Format(PyExc_TypeError,
23006 "Shared Cython type %.200s is not a type object",
23010 if (cached_type->tp_basicsize != type->tp_basicsize) {
23011 PyErr_Format(PyExc_TypeError,
23012 "Shared Cython type %.200s has the wrong size, try recompiling",
23017 if (!PyErr_ExceptionMatches(PyExc_AttributeError))
goto bad;
23019 if (PyType_Ready(type) < 0)
goto bad;
23020 if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
23023 cached_type = type;
23026 Py_DECREF(fake_module);
23027 return cached_type;
23029 Py_XDECREF(cached_type);
23030 cached_type = NULL;
23035 #if CYTHON_FAST_THREAD_STATE 23036 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
23037 PyObject *tmp_type, *tmp_value, *tmp_tb;
23038 #if PY_VERSION_HEX >= 0x030700A2 23039 tmp_type = tstate->exc_state.exc_type;
23040 tmp_value = tstate->exc_state.exc_value;
23041 tmp_tb = tstate->exc_state.exc_traceback;
23042 tstate->exc_state.exc_type = *type;
23043 tstate->exc_state.exc_value = *value;
23044 tstate->exc_state.exc_traceback = *tb;
23046 tmp_type = tstate->exc_type;
23047 tmp_value = tstate->exc_value;
23048 tmp_tb = tstate->exc_traceback;
23049 tstate->exc_type = *type;
23050 tstate->exc_value = *value;
23051 tstate->exc_traceback = *tb;
23054 *value = tmp_value;
23058 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
23059 PyObject *tmp_type, *tmp_value, *tmp_tb;
23060 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
23061 PyErr_SetExcInfo(*type, *value, *tb);
23063 *value = tmp_value;
23069 static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
23070 PyObject *result = NULL;
23071 #if CYTHON_UNPACK_METHODS 23072 if (likely(PyMethod_Check(method))) {
23073 PyObject *
self = PyMethod_GET_SELF(method);
23074 if (likely(
self)) {
23076 PyObject *
function = PyMethod_GET_FUNCTION(method);
23077 #if CYTHON_FAST_PYCALL 23078 if (PyFunction_Check(
function)) {
23079 PyObject *args[2] = {
self, arg};
23080 result = __Pyx_PyFunction_FastCall(
function, args, 2);
23084 #if CYTHON_FAST_PYCCALL 23085 if (__Pyx_PyFastCFunction_Check(
function)) {
23086 PyObject *args[2] = {
self, arg};
23087 result = __Pyx_PyCFunction_FastCall(
function, args, 2);
23091 args = PyTuple_New(2);
23092 if (unlikely(!args))
goto done;
23094 PyTuple_SET_ITEM(args, 0,
self);
23096 PyTuple_SET_ITEM(args, 1, arg);
23097 Py_INCREF(
function);
23098 result = __Pyx_PyObject_Call(
function, args, NULL);
23100 Py_DECREF(
function);
23105 result = __Pyx_PyObject_CallOneArg(method, arg);
23110 static PyObject* __Pyx_PyObject_CallMethod1(PyObject*
obj, PyObject* method_name, PyObject* arg) {
23111 PyObject *method, *result = NULL;
23112 method = __Pyx_PyObject_GetAttrStr(
obj, method_name);
23113 if (unlikely(!method))
goto done;
23114 result = __Pyx__PyObject_CallMethod1(method, arg);
23116 Py_XDECREF(method);
23121 #include <structmember.h> 23122 #include <frameobject.h> 23123 #define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom) 23124 static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) {
23125 PyObject *et, *ev, *tb;
23126 PyObject *value = NULL;
23127 __Pyx_ErrFetch(&et, &ev, &tb);
23131 Py_INCREF(Py_None);
23135 if (likely(et == PyExc_StopIteration)) {
23137 Py_INCREF(Py_None);
23140 #if PY_VERSION_HEX >= 0x030300A0 23141 else if (Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) {
23142 value = ((PyStopIterationObject *)ev)->value;
23147 else if (unlikely(PyTuple_Check(ev))) {
23148 if (PyTuple_GET_SIZE(ev) >= 1) {
23149 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 23150 value = PyTuple_GET_ITEM(ev, 0);
23153 value = PySequence_ITEM(ev, 0);
23156 Py_INCREF(Py_None);
23161 else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
23164 if (likely(value)) {
23170 }
else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
23171 __Pyx_ErrRestore(et, ev, tb);
23174 PyErr_NormalizeException(&et, &ev, &tb);
23175 if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
23176 __Pyx_ErrRestore(et, ev, tb);
23181 #if PY_VERSION_HEX >= 0x030300A0 23182 value = ((PyStopIterationObject *)ev)->value;
23187 PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args);
23189 if (likely(args)) {
23190 value = PySequence_GetItem(args, 0);
23193 if (unlikely(!value)) {
23194 __Pyx_ErrRestore(NULL, NULL, NULL);
23195 Py_INCREF(Py_None);
23203 static CYTHON_INLINE
23204 void __Pyx_Coroutine_ExceptionClear(__pyx_CoroutineObject *
self) {
23205 PyObject *exc_type =
self->exc_type;
23206 PyObject *exc_value =
self->exc_value;
23207 PyObject *exc_traceback =
self->exc_traceback;
23208 self->exc_type = NULL;
23209 self->exc_value = NULL;
23210 self->exc_traceback = NULL;
23211 Py_XDECREF(exc_type);
23212 Py_XDECREF(exc_value);
23213 Py_XDECREF(exc_traceback);
23215 #define __Pyx_Coroutine_AlreadyRunningError(gen) (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL) 23216 static void __Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject *gen) {
23219 #ifdef __Pyx_Coroutine_USED 23220 }
else if (__Pyx_Coroutine_CheckExact((PyObject*)gen)) {
23221 msg =
"coroutine already executing";
23223 #ifdef __Pyx_AsyncGen_USED 23224 }
else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
23225 msg =
"async generator already executing";
23228 msg =
"generator already executing";
23230 PyErr_SetString(PyExc_ValueError, msg);
23232 #define __Pyx_Coroutine_NotStartedError(gen) (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL) 23233 static void __Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject *gen) {
23236 #ifdef __Pyx_Coroutine_USED 23237 }
else if (__Pyx_Coroutine_CheckExact(gen)) {
23238 msg =
"can't send non-None value to a just-started coroutine";
23240 #ifdef __Pyx_AsyncGen_USED 23241 }
else if (__Pyx_AsyncGen_CheckExact(gen)) {
23242 msg =
"can't send non-None value to a just-started async generator";
23245 msg =
"can't send non-None value to a just-started generator";
23247 PyErr_SetString(PyExc_TypeError, msg);
23249 #define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing) (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL) 23250 static void __Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject *gen, PyObject *value, CYTHON_UNUSED
int closing) {
23251 #ifdef __Pyx_Coroutine_USED 23252 if (!closing && __Pyx_Coroutine_CheckExact(gen)) {
23253 PyErr_SetString(PyExc_RuntimeError,
"cannot reuse already awaited coroutine");
23257 #ifdef __Pyx_AsyncGen_USED 23258 if (__Pyx_AsyncGen_CheckExact(gen))
23259 PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration);
23262 PyErr_SetNone(PyExc_StopIteration);
23266 PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *
self, PyObject *value,
int closing) {
23267 __Pyx_PyThreadState_declare
23268 PyThreadState *tstate;
23270 assert(!self->is_running);
23271 if (unlikely(self->resume_label == 0)) {
23272 if (unlikely(value && value != Py_None)) {
23273 return __Pyx_Coroutine_NotStartedError((PyObject*)
self);
23276 if (unlikely(self->resume_label == -1)) {
23277 return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)
self, value, closing);
23279 #if CYTHON_FAST_THREAD_STATE 23280 __Pyx_PyThreadState_assign
23281 tstate = __pyx_tstate;
23283 tstate = __Pyx_PyThreadState_Current;
23285 if (self->exc_type) {
23286 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON 23288 if (self->exc_traceback) {
23289 PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
23290 PyFrameObject *f = tb->tb_frame;
23291 Py_XINCREF(tstate->frame);
23292 assert(f->f_back == NULL);
23293 f->f_back = tstate->frame;
23296 __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value,
23297 &self->exc_traceback);
23299 __Pyx_Coroutine_ExceptionClear(
self);
23300 __Pyx_ExceptionSave(&self->exc_type, &self->exc_value, &self->exc_traceback);
23302 self->is_running = 1;
23303 retval =
self->body((PyObject *)
self, tstate, value);
23304 self->is_running = 0;
23307 static CYTHON_INLINE
void __Pyx_Coroutine_ResetFrameBackpointer(__pyx_CoroutineObject *
self) {
23308 if (likely(self->exc_traceback)) {
23309 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON 23311 PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
23312 PyFrameObject *f = tb->tb_frame;
23313 Py_CLEAR(f->f_back);
23317 static CYTHON_INLINE
23318 PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *retval) {
23319 if (unlikely(!retval)) {
23320 __Pyx_PyThreadState_declare
23321 __Pyx_PyThreadState_assign
23322 if (!__Pyx_PyErr_Occurred()) {
23323 PyObject *exc = PyExc_StopIteration;
23324 #ifdef __Pyx_AsyncGen_USED 23325 if (__Pyx_AsyncGen_CheckExact(gen))
23326 exc = __Pyx_PyExc_StopAsyncIteration;
23328 __Pyx_PyErr_SetNone(exc);
23333 static CYTHON_INLINE
23334 PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
23336 PyObject *val = NULL;
23337 __Pyx_Coroutine_Undelegate(gen);
23338 __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
23339 ret = __Pyx_Coroutine_SendEx(gen, val, 0);
23343 static PyObject *__Pyx_Coroutine_Send(PyObject *
self, PyObject *value) {
23345 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*)
self;
23346 PyObject *yf = gen->yieldfrom;
23347 if (unlikely(gen->is_running))
23348 return __Pyx_Coroutine_AlreadyRunningError(gen);
23351 gen->is_running = 1;
23352 #ifdef __Pyx_Generator_USED 23353 if (__Pyx_Generator_CheckExact(yf)) {
23354 ret = __Pyx_Coroutine_Send(yf, value);
23357 #ifdef __Pyx_Coroutine_USED 23358 if (__Pyx_Coroutine_CheckExact(yf)) {
23359 ret = __Pyx_Coroutine_Send(yf, value);
23362 #ifdef __Pyx_AsyncGen_USED 23363 if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
23364 ret = __Pyx_async_gen_asend_send(yf, value);
23367 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) 23368 if (PyGen_CheckExact(yf)) {
23369 ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
23372 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) 23373 if (PyCoro_CheckExact(yf)) {
23374 ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
23378 if (value == Py_None)
23379 ret = Py_TYPE(yf)->tp_iternext(yf);
23381 ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
23383 gen->is_running = 0;
23387 retval = __Pyx_Coroutine_FinishDelegation(gen);
23389 retval = __Pyx_Coroutine_SendEx(gen, value, 0);
23391 return __Pyx_Coroutine_MethodReturn(
self, retval);
23393 static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
23394 PyObject *retval = NULL;
23396 #ifdef __Pyx_Generator_USED 23397 if (__Pyx_Generator_CheckExact(yf)) {
23398 retval = __Pyx_Coroutine_Close(yf);
23403 #ifdef __Pyx_Coroutine_USED 23404 if (__Pyx_Coroutine_CheckExact(yf)) {
23405 retval = __Pyx_Coroutine_Close(yf);
23409 if (__Pyx_CoroutineAwait_CheckExact(yf)) {
23410 retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf);
23415 #ifdef __Pyx_AsyncGen_USED 23416 if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
23417 retval = __Pyx_async_gen_asend_close(yf, NULL);
23419 if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
23420 retval = __Pyx_async_gen_athrow_close(yf, NULL);
23425 gen->is_running = 1;
23426 meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close);
23427 if (unlikely(!meth)) {
23428 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
23429 PyErr_WriteUnraisable(yf);
23433 retval = PyObject_CallFunction(meth, NULL);
23438 gen->is_running = 0;
23440 Py_XDECREF(retval);
23443 static PyObject *__Pyx_Generator_Next(PyObject *
self) {
23444 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*)
self;
23445 PyObject *yf = gen->yieldfrom;
23446 if (unlikely(gen->is_running))
23447 return __Pyx_Coroutine_AlreadyRunningError(gen);
23450 gen->is_running = 1;
23451 #ifdef __Pyx_Generator_USED 23452 if (__Pyx_Generator_CheckExact(yf)) {
23453 ret = __Pyx_Generator_Next(yf);
23456 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) 23457 if (PyGen_CheckExact(yf)) {
23458 ret = _PyGen_Send((PyGenObject*)yf, NULL);
23461 ret = Py_TYPE(yf)->tp_iternext(yf);
23462 gen->is_running = 0;
23466 return __Pyx_Coroutine_FinishDelegation(gen);
23468 return __Pyx_Coroutine_SendEx(gen, Py_None, 0);
23470 static PyObject *__Pyx_Coroutine_Close(PyObject *
self) {
23471 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
23472 PyObject *retval, *raised_exception;
23473 PyObject *yf = gen->yieldfrom;
23475 if (unlikely(gen->is_running))
23476 return __Pyx_Coroutine_AlreadyRunningError(gen);
23479 err = __Pyx_Coroutine_CloseIter(gen, yf);
23480 __Pyx_Coroutine_Undelegate(gen);
23484 PyErr_SetNone(PyExc_GeneratorExit);
23485 retval = __Pyx_Coroutine_SendEx(gen, NULL, 1);
23486 if (unlikely(retval)) {
23490 #ifdef __Pyx_Coroutine_USED 23491 }
else if (__Pyx_Coroutine_CheckExact(
self)) {
23492 msg =
"coroutine ignored GeneratorExit";
23494 #ifdef __Pyx_AsyncGen_USED 23495 }
else if (__Pyx_AsyncGen_CheckExact(
self)) {
23496 #if PY_VERSION_HEX < 0x03060000 23497 msg =
"async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)";
23499 msg =
"async generator ignored GeneratorExit";
23503 msg =
"generator ignored GeneratorExit";
23505 PyErr_SetString(PyExc_RuntimeError, msg);
23508 raised_exception = PyErr_Occurred();
23509 if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) {
23510 if (raised_exception) PyErr_Clear();
23511 Py_INCREF(Py_None);
23516 static PyObject *__Pyx__Coroutine_Throw(PyObject *
self, PyObject *typ, PyObject *val, PyObject *tb,
23517 PyObject *args,
int close_on_genexit) {
23518 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
23519 PyObject *yf = gen->yieldfrom;
23520 if (unlikely(gen->is_running))
23521 return __Pyx_Coroutine_AlreadyRunningError(gen);
23525 if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
23526 int err = __Pyx_Coroutine_CloseIter(gen, yf);
23528 __Pyx_Coroutine_Undelegate(gen);
23530 return __Pyx_Coroutine_MethodReturn(
self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
23533 gen->is_running = 1;
23535 #ifdef __Pyx_Generator_USED
23536 || __Pyx_Generator_CheckExact(yf)
23538 #ifdef __Pyx_Coroutine_USED
23539 || __Pyx_Coroutine_CheckExact(yf)
23542 ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
23543 #ifdef __Pyx_Coroutine_USED 23544 }
else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
23545 ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
23548 PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw);
23549 if (unlikely(!meth)) {
23551 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
23552 gen->is_running = 0;
23556 __Pyx_Coroutine_Undelegate(gen);
23557 gen->is_running = 0;
23560 if (likely(args)) {
23561 ret = PyObject_CallObject(meth, args);
23563 ret = PyObject_CallFunctionObjArgs(meth, typ, val, tb, NULL);
23567 gen->is_running = 0;
23570 ret = __Pyx_Coroutine_FinishDelegation(gen);
23572 return __Pyx_Coroutine_MethodReturn(
self, ret);
23575 __Pyx_Raise(typ, val, tb, NULL);
23576 return __Pyx_Coroutine_MethodReturn(
self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
23578 static PyObject *__Pyx_Coroutine_Throw(PyObject *
self, PyObject *args) {
23580 PyObject *val = NULL;
23581 PyObject *tb = NULL;
23582 if (!PyArg_UnpackTuple(args, (
char *)
"throw", 1, 3, &typ, &val, &tb))
23584 return __Pyx__Coroutine_Throw(
self, typ, val, tb, args, 1);
23586 static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit,
void *arg) {
23587 Py_VISIT(gen->closure);
23588 Py_VISIT(gen->classobj);
23589 Py_VISIT(gen->yieldfrom);
23590 Py_VISIT(gen->exc_type);
23591 Py_VISIT(gen->exc_value);
23592 Py_VISIT(gen->exc_traceback);
23595 static int __Pyx_Coroutine_clear(PyObject *
self) {
23596 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
23597 Py_CLEAR(gen->closure);
23598 Py_CLEAR(gen->classobj);
23599 Py_CLEAR(gen->yieldfrom);
23600 Py_CLEAR(gen->exc_type);
23601 Py_CLEAR(gen->exc_value);
23602 Py_CLEAR(gen->exc_traceback);
23603 #ifdef __Pyx_AsyncGen_USED 23604 if (__Pyx_AsyncGen_CheckExact(
self)) {
23605 Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
23608 Py_CLEAR(gen->gi_name);
23609 Py_CLEAR(gen->gi_qualname);
23610 Py_CLEAR(gen->gi_modulename);
23613 static void __Pyx_Coroutine_dealloc(PyObject *
self) {
23614 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
23615 PyObject_GC_UnTrack(gen);
23616 if (gen->gi_weakreflist != NULL)
23617 PyObject_ClearWeakRefs(
self);
23618 if (gen->resume_label >= 0) {
23619 PyObject_GC_Track(
self);
23620 #if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE 23621 if (PyObject_CallFinalizerFromDealloc(
self))
23623 Py_TYPE(gen)->tp_del(
self);
23624 if (self->ob_refcnt > 0)
23629 PyObject_GC_UnTrack(
self);
23631 #ifdef __Pyx_AsyncGen_USED 23632 if (__Pyx_AsyncGen_CheckExact(
self)) {
23636 Py_CLEAR(((__pyx_PyAsyncGenObject*)
self)->ag_finalizer);
23639 __Pyx_Coroutine_clear(
self);
23640 PyObject_GC_Del(gen);
23642 static void __Pyx_Coroutine_del(PyObject *
self) {
23643 PyObject *error_type, *error_value, *error_traceback;
23644 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
23645 __Pyx_PyThreadState_declare
23646 if (gen->resume_label < 0) {
23649 #if !CYTHON_USE_TP_FINALIZE 23650 assert(self->ob_refcnt == 0);
23651 self->ob_refcnt = 1;
23653 __Pyx_PyThreadState_assign
23654 __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
23655 #ifdef __Pyx_AsyncGen_USED 23656 if (__Pyx_AsyncGen_CheckExact(
self)) {
23657 __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)
self;
23658 PyObject *finalizer = agen->ag_finalizer;
23659 if (finalizer && !agen->ag_closed) {
23660 PyObject *res = __Pyx_PyObject_CallOneArg(finalizer,
self);
23661 if (unlikely(!res)) {
23662 PyErr_WriteUnraisable(
self);
23666 __Pyx_ErrRestore(error_type, error_value, error_traceback);
23671 if (unlikely(gen->resume_label == 0 && !error_value)) {
23672 #ifdef __Pyx_Coroutine_USED 23673 #ifdef __Pyx_Generator_USED 23674 if (!__Pyx_Generator_CheckExact(
self))
23677 PyObject_GC_UnTrack(
self);
23678 #if PY_MAJOR_VERSION >= 3 || defined(PyErr_WarnFormat) 23679 if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1,
"coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
23680 PyErr_WriteUnraisable(
self);
23684 #if CYTHON_COMPILING_IN_PYPY 23686 cmsg = (
char*)
"coroutine was never awaited";
23689 PyObject *qualname;
23690 qualname = gen->gi_qualname;
23691 cname = PyString_AS_STRING(qualname);
23692 msg = PyString_FromFormat(
"coroutine '%.50s' was never awaited", cname);
23693 if (unlikely(!msg)) {
23695 cmsg = (
char*)
"coroutine was never awaited";
23697 cmsg = PyString_AS_STRING(msg);
23700 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0))
23701 PyErr_WriteUnraisable(
self);
23704 PyObject_GC_Track(
self);
23708 PyObject *res = __Pyx_Coroutine_Close(
self);
23709 if (unlikely(!res)) {
23710 if (PyErr_Occurred())
23711 PyErr_WriteUnraisable(
self);
23716 __Pyx_ErrRestore(error_type, error_value, error_traceback);
23717 #if !CYTHON_USE_TP_FINALIZE 23718 assert(self->ob_refcnt > 0);
23719 if (--self->ob_refcnt == 0) {
23723 Py_ssize_t refcnt =
self->ob_refcnt;
23724 _Py_NewReference(
self);
23725 self->ob_refcnt = refcnt;
23727 #if CYTHON_COMPILING_IN_CPYTHON 23728 assert(PyType_IS_GC(self->ob_type) &&
23729 _Py_AS_GC(
self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
23732 #ifdef COUNT_ALLOCS 23733 --Py_TYPE(
self)->tp_frees;
23734 --Py_TYPE(
self)->tp_allocs;
23739 __Pyx_Coroutine_get_name(__pyx_CoroutineObject *
self)
23741 PyObject *name =
self->gi_name;
23742 if (unlikely(!name)) name = Py_None;
23747 __Pyx_Coroutine_set_name(__pyx_CoroutineObject *
self, PyObject *value)
23750 #if PY_MAJOR_VERSION >= 3 23751 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
23753 if (unlikely(value == NULL || !PyString_Check(value))) {
23755 PyErr_SetString(PyExc_TypeError,
23756 "__name__ must be set to a string object");
23759 tmp =
self->gi_name;
23761 self->gi_name = value;
23766 __Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *
self)
23768 PyObject *name =
self->gi_qualname;
23769 if (unlikely(!name)) name = Py_None;
23774 __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *
self, PyObject *value)
23777 #if PY_MAJOR_VERSION >= 3 23778 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
23780 if (unlikely(value == NULL || !PyString_Check(value))) {
23782 PyErr_SetString(PyExc_TypeError,
23783 "__qualname__ must be set to a string object");
23786 tmp =
self->gi_qualname;
23788 self->gi_qualname = value;
23792 static __pyx_CoroutineObject *__Pyx__Coroutine_New(
23793 PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *closure,
23794 PyObject *name, PyObject *qualname, PyObject *module_name) {
23795 __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
23796 if (unlikely(!gen))
23798 return __Pyx__Coroutine_NewInit(gen, body, closure, name, qualname, module_name);
23800 static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
23801 __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *closure,
23802 PyObject *name, PyObject *qualname, PyObject *module_name) {
23804 gen->closure = closure;
23805 Py_XINCREF(closure);
23806 gen->is_running = 0;
23807 gen->resume_label = 0;
23808 gen->classobj = NULL;
23809 gen->yieldfrom = NULL;
23810 gen->exc_type = NULL;
23811 gen->exc_value = NULL;
23812 gen->exc_traceback = NULL;
23813 gen->gi_weakreflist = NULL;
23814 Py_XINCREF(qualname);
23815 gen->gi_qualname = qualname;
23817 gen->gi_name = name;
23818 Py_XINCREF(module_name);
23819 gen->gi_modulename = module_name;
23820 PyObject_GC_Track(gen);
23825 static PyObject* __Pyx_Coroutine_patch_module(PyObject* module,
const char* py_code) {
23826 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) 23828 PyObject *globals, *result_obj;
23829 globals = PyDict_New();
if (unlikely(!globals))
goto ignore;
23830 result = PyDict_SetItemString(globals,
"_cython_coroutine_type",
23831 #ifdef __Pyx_Coroutine_USED
23832 (PyObject*)__pyx_CoroutineType);
23836 if (unlikely(result < 0))
goto ignore;
23837 result = PyDict_SetItemString(globals,
"_cython_generator_type",
23838 #ifdef __Pyx_Generator_USED
23839 (PyObject*)__pyx_GeneratorType);
23843 if (unlikely(result < 0))
goto ignore;
23844 if (unlikely(PyDict_SetItemString(globals,
"_module", module) < 0))
goto ignore;
23845 if (unlikely(PyDict_SetItemString(globals,
"__builtins__", __pyx_b) < 0))
goto ignore;
23846 result_obj = PyRun_String(py_code, Py_file_input, globals, globals);
23847 if (unlikely(!result_obj))
goto ignore;
23848 Py_DECREF(result_obj);
23849 Py_DECREF(globals);
23852 Py_XDECREF(globals);
23853 PyErr_WriteUnraisable(module);
23854 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
"Cython module failed to patch module with custom type", 1) < 0)) {
23865 #ifndef CYTHON_REGISTER_ABCS 23866 #define CYTHON_REGISTER_ABCS 1 23868 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) 23869 static PyObject* __Pyx_patch_abc_module(PyObject *module);
23870 static PyObject* __Pyx_patch_abc_module(PyObject *module) {
23871 module = __Pyx_Coroutine_patch_module(
23873 "if _cython_generator_type is not None:\n" 23874 " try: Generator = _module.Generator\n" 23875 " except AttributeError: pass\n" 23876 " else: Generator.register(_cython_generator_type)\n" 23877 "if _cython_coroutine_type is not None:\n" 23878 " try: Coroutine = _module.Coroutine\n" 23879 " except AttributeError: pass\n" 23880 " else: Coroutine.register(_cython_coroutine_type)\n" 23885 static int __Pyx_patch_abc(
void) {
23886 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) 23887 static int abc_patched = 0;
23888 if (CYTHON_REGISTER_ABCS && !abc_patched) {
23890 module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ?
"collections.abc" :
"collections");
23892 PyErr_WriteUnraisable(NULL);
23893 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
23894 ((PY_MAJOR_VERSION >= 3) ?
23895 "Cython module failed to register with collections.abc module" :
23896 "Cython module failed to register with collections module"), 1) < 0)) {
23900 module = __Pyx_patch_abc_module(module);
23902 if (unlikely(!module))
23906 module = PyImport_ImportModule(
"backports_abc");
23908 module = __Pyx_patch_abc_module(module);
23909 Py_XDECREF(module);
23916 if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL);
23922 static PyMethodDef __pyx_Generator_methods[] = {
23923 {
"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
23924 (
char*) PyDoc_STR(
"send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
23925 {
"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
23926 (
char*) PyDoc_STR(
"throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
23927 {
"close", (PyCFunction) __Pyx_Coroutine_Close, METH_NOARGS,
23928 (
char*) PyDoc_STR(
"close() -> raise GeneratorExit inside generator.")},
23931 static PyMemberDef __pyx_Generator_memberlist[] = {
23932 {(
char *)
"gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL},
23933 {(
char*)
"gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
23934 (
char*) PyDoc_STR(
"object being iterated by 'yield from', or None")},
23937 static PyGetSetDef __pyx_Generator_getsets[] = {
23938 {(
char *)
"__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
23939 (
char*) PyDoc_STR(
"name of the generator"), 0},
23940 {(
char *)
"__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
23941 (
char*) PyDoc_STR(
"qualified name of the generator"), 0},
23944 static PyTypeObject __pyx_GeneratorType_type = {
23945 PyVarObject_HEAD_INIT(0, 0)
23947 sizeof(__pyx_CoroutineObject),
23949 (destructor) __Pyx_Coroutine_dealloc,
23964 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
23966 (traverseproc) __Pyx_Coroutine_traverse,
23969 offsetof(__pyx_CoroutineObject, gi_weakreflist),
23971 (iternextfunc) __Pyx_Generator_Next,
23972 __pyx_Generator_methods,
23973 __pyx_Generator_memberlist,
23974 __pyx_Generator_getsets,
23990 #
if CYTHON_USE_TP_FINALIZE
23993 __Pyx_Coroutine_del,
23996 #
if CYTHON_USE_TP_FINALIZE
23997 __Pyx_Coroutine_del,
23998 #elif PY_VERSION_HEX >= 0x030400a1
24002 static int __pyx_Generator_init(
void) {
24003 __pyx_GeneratorType_type.tp_getattro = PyObject_GenericGetAttr;
24004 __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
24005 __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
24006 if (unlikely(!__pyx_GeneratorType)) {
24013 static int __Pyx_check_binary_version(
void) {
24014 char ctversion[4], rtversion[4];
24015 PyOS_snprintf(ctversion, 4,
"%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
24016 PyOS_snprintf(rtversion, 4,
"%s", Py_GetVersion());
24017 if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
24019 PyOS_snprintf(message,
sizeof(message),
24020 "compiletime version %s of module '%.100s' " 24021 "does not match runtime version %s",
24022 ctversion, __Pyx_MODULE_NAME, rtversion);
24023 return PyErr_WarnEx(NULL, message, 1);
24029 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
24031 #if PY_MAJOR_VERSION < 3 24032 if (t->is_unicode) {
24033 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
24034 }
else if (t->intern) {
24035 *t->p = PyString_InternFromString(t->s);
24037 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
24040 if (t->is_unicode | t->is_str) {
24042 *t->p = PyUnicode_InternFromString(t->s);
24043 }
else if (t->encoding) {
24044 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
24046 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
24049 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
24054 if (PyObject_Hash(*t->p) == -1)
24061 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
24062 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
24064 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
24066 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
24068 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 24069 #if !CYTHON_PEP393_ENABLED 24070 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
24072 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
24073 if (!defenc)
return NULL;
24074 defenc_c = PyBytes_AS_STRING(defenc);
24075 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 24077 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
24079 for (c = defenc_c; c < end; c++) {
24080 if ((
unsigned char) (*c) >= 128) {
24081 PyUnicode_AsASCIIString(o);
24087 *length = PyBytes_GET_SIZE(defenc);
24091 static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
24092 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
24093 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 24094 if (likely(PyUnicode_IS_ASCII(o))) {
24095 *length = PyUnicode_GET_LENGTH(o);
24096 return PyUnicode_AsUTF8(o);
24098 PyUnicode_AsASCIIString(o);
24102 return PyUnicode_AsUTF8AndSize(o, length);
24107 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
24108 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 24110 #
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
24111 __Pyx_sys_getdefaultencoding_not_ascii &&
24113 PyUnicode_Check(o)) {
24114 return __Pyx_PyUnicode_AsStringAndSize(o, length);
24117 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) 24118 if (PyByteArray_Check(o)) {
24119 *length = PyByteArray_GET_SIZE(o);
24120 return PyByteArray_AS_STRING(o);
24125 int r = PyBytes_AsStringAndSize(o, &result, length);
24126 if (unlikely(r < 0)) {
24133 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
24134 int is_true = x == Py_True;
24135 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
24136 else return PyObject_IsTrue(x);
24138 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result,
const char* type_name) {
24139 #if PY_MAJOR_VERSION >= 3 24140 if (PyLong_Check(result)) {
24141 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
24142 "__int__ returned non-int (type %.200s). " 24143 "The ability to return an instance of a strict subclass of int " 24144 "is deprecated, and may be removed in a future version of Python.",
24145 Py_TYPE(result)->tp_name)) {
24152 PyErr_Format(PyExc_TypeError,
24153 "__%.4s__ returned non-%.4s (type %.200s)",
24154 type_name, type_name, Py_TYPE(result)->tp_name);
24158 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
24159 #if CYTHON_USE_TYPE_SLOTS 24160 PyNumberMethods *m;
24162 const char *name = NULL;
24163 PyObject *res = NULL;
24164 #if PY_MAJOR_VERSION < 3 24165 if (likely(PyInt_Check(x) || PyLong_Check(x)))
24167 if (likely(PyLong_Check(x)))
24169 return __Pyx_NewRef(x);
24170 #if CYTHON_USE_TYPE_SLOTS 24171 m = Py_TYPE(x)->tp_as_number;
24172 #if PY_MAJOR_VERSION < 3 24173 if (m && m->nb_int) {
24175 res = m->nb_int(x);
24177 else if (m && m->nb_long) {
24179 res = m->nb_long(x);
24182 if (likely(m && m->nb_int)) {
24184 res = m->nb_int(x);
24188 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
24189 res = PyNumber_Int(x);
24193 #if PY_MAJOR_VERSION < 3 24194 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
24196 if (unlikely(!PyLong_CheckExact(res))) {
24198 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
24201 else if (!PyErr_Occurred()) {
24202 PyErr_SetString(PyExc_TypeError,
24203 "an integer is required");
24207 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
24210 #if PY_MAJOR_VERSION < 3 24211 if (likely(PyInt_CheckExact(b))) {
24212 if (
sizeof(Py_ssize_t) >=
sizeof(
long))
24213 return PyInt_AS_LONG(b);
24215 return PyInt_AsSsize_t(x);
24218 if (likely(PyLong_CheckExact(b))) {
24219 #if CYTHON_USE_PYLONG_INTERNALS 24220 const digit* digits = ((PyLongObject*)b)->ob_digit;
24221 const Py_ssize_t size = Py_SIZE(b);
24222 if (likely(__Pyx_sst_abs(size) <= 1)) {
24223 ival = likely(size) ? digits[0] : 0;
24224 if (size == -1) ival = -ival;
24229 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
24230 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
24234 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
24235 return -(Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
24239 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
24240 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
24244 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
24245 return -(Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
24249 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
24250 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]));
24254 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
24255 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]));
24261 return PyLong_AsSsize_t(b);
24263 x = PyNumber_Index(b);
24265 ival = PyInt_AsSsize_t(x);
24269 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
24270 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)].