22 #ifndef PY_SSIZE_T_CLEAN 23 #define PY_SSIZE_T_CLEAN 27 #error Python headers needed to compile C extensions, please install development version of Python. 28 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) 29 #error Cython requires Python 2.6+ or Python 3.3+. 31 #define CYTHON_ABI "0_29_28" 32 #define CYTHON_HEX_VERSION 0x001D1CF0 33 #define CYTHON_FUTURE_DIVISION 1 36 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) 38 #if !defined(WIN32) && !defined(MS_WINDOWS) 50 #define DL_IMPORT(t) t 53 #define DL_EXPORT(t) t 56 #ifndef HAVE_LONG_LONG 57 #if PY_VERSION_HEX >= 0x02070000 58 #define HAVE_LONG_LONG 62 #define PY_LONG_LONG LONG_LONG 65 #define Py_HUGE_VAL HUGE_VAL 68 #define CYTHON_COMPILING_IN_PYPY 1 69 #define CYTHON_COMPILING_IN_PYSTON 0 70 #define CYTHON_COMPILING_IN_CPYTHON 0 71 #undef CYTHON_USE_TYPE_SLOTS 72 #define CYTHON_USE_TYPE_SLOTS 0 73 #undef CYTHON_USE_PYTYPE_LOOKUP 74 #define CYTHON_USE_PYTYPE_LOOKUP 0 75 #if PY_VERSION_HEX < 0x03050000 76 #undef CYTHON_USE_ASYNC_SLOTS 77 #define CYTHON_USE_ASYNC_SLOTS 0 78 #elif !defined(CYTHON_USE_ASYNC_SLOTS) 79 #define CYTHON_USE_ASYNC_SLOTS 1 81 #undef CYTHON_USE_PYLIST_INTERNALS 82 #define CYTHON_USE_PYLIST_INTERNALS 0 83 #undef CYTHON_USE_UNICODE_INTERNALS 84 #define CYTHON_USE_UNICODE_INTERNALS 0 85 #undef CYTHON_USE_UNICODE_WRITER 86 #define CYTHON_USE_UNICODE_WRITER 0 87 #undef CYTHON_USE_PYLONG_INTERNALS 88 #define CYTHON_USE_PYLONG_INTERNALS 0 89 #undef CYTHON_AVOID_BORROWED_REFS 90 #define CYTHON_AVOID_BORROWED_REFS 1 91 #undef CYTHON_ASSUME_SAFE_MACROS 92 #define CYTHON_ASSUME_SAFE_MACROS 0 93 #undef CYTHON_UNPACK_METHODS 94 #define CYTHON_UNPACK_METHODS 0 95 #undef CYTHON_FAST_THREAD_STATE 96 #define CYTHON_FAST_THREAD_STATE 0 97 #undef CYTHON_FAST_PYCALL 98 #define CYTHON_FAST_PYCALL 0 99 #undef CYTHON_PEP489_MULTI_PHASE_INIT 100 #define CYTHON_PEP489_MULTI_PHASE_INIT 0 101 #undef CYTHON_USE_TP_FINALIZE 102 #define CYTHON_USE_TP_FINALIZE 0 103 #undef CYTHON_USE_DICT_VERSIONS 104 #define CYTHON_USE_DICT_VERSIONS 0 105 #undef CYTHON_USE_EXC_INFO_STACK 106 #define CYTHON_USE_EXC_INFO_STACK 0 107 #elif defined(PYSTON_VERSION) 108 #define CYTHON_COMPILING_IN_PYPY 0 109 #define CYTHON_COMPILING_IN_PYSTON 1 110 #define CYTHON_COMPILING_IN_CPYTHON 0 111 #ifndef CYTHON_USE_TYPE_SLOTS 112 #define CYTHON_USE_TYPE_SLOTS 1 114 #undef CYTHON_USE_PYTYPE_LOOKUP 115 #define CYTHON_USE_PYTYPE_LOOKUP 0 116 #undef CYTHON_USE_ASYNC_SLOTS 117 #define CYTHON_USE_ASYNC_SLOTS 0 118 #undef CYTHON_USE_PYLIST_INTERNALS 119 #define CYTHON_USE_PYLIST_INTERNALS 0 120 #ifndef CYTHON_USE_UNICODE_INTERNALS 121 #define CYTHON_USE_UNICODE_INTERNALS 1 123 #undef CYTHON_USE_UNICODE_WRITER 124 #define CYTHON_USE_UNICODE_WRITER 0 125 #undef CYTHON_USE_PYLONG_INTERNALS 126 #define CYTHON_USE_PYLONG_INTERNALS 0 127 #ifndef CYTHON_AVOID_BORROWED_REFS 128 #define CYTHON_AVOID_BORROWED_REFS 0 130 #ifndef CYTHON_ASSUME_SAFE_MACROS 131 #define CYTHON_ASSUME_SAFE_MACROS 1 133 #ifndef CYTHON_UNPACK_METHODS 134 #define CYTHON_UNPACK_METHODS 1 136 #undef CYTHON_FAST_THREAD_STATE 137 #define CYTHON_FAST_THREAD_STATE 0 138 #undef CYTHON_FAST_PYCALL 139 #define CYTHON_FAST_PYCALL 0 140 #undef CYTHON_PEP489_MULTI_PHASE_INIT 141 #define CYTHON_PEP489_MULTI_PHASE_INIT 0 142 #undef CYTHON_USE_TP_FINALIZE 143 #define CYTHON_USE_TP_FINALIZE 0 144 #undef CYTHON_USE_DICT_VERSIONS 145 #define CYTHON_USE_DICT_VERSIONS 0 146 #undef CYTHON_USE_EXC_INFO_STACK 147 #define CYTHON_USE_EXC_INFO_STACK 0 149 #define CYTHON_COMPILING_IN_PYPY 0 150 #define CYTHON_COMPILING_IN_PYSTON 0 151 #define CYTHON_COMPILING_IN_CPYTHON 1 152 #ifndef CYTHON_USE_TYPE_SLOTS 153 #define CYTHON_USE_TYPE_SLOTS 1 155 #if PY_VERSION_HEX < 0x02070000 156 #undef CYTHON_USE_PYTYPE_LOOKUP 157 #define CYTHON_USE_PYTYPE_LOOKUP 0 158 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) 159 #define CYTHON_USE_PYTYPE_LOOKUP 1 161 #if PY_MAJOR_VERSION < 3 162 #undef CYTHON_USE_ASYNC_SLOTS 163 #define CYTHON_USE_ASYNC_SLOTS 0 164 #elif !defined(CYTHON_USE_ASYNC_SLOTS) 165 #define CYTHON_USE_ASYNC_SLOTS 1 167 #if PY_VERSION_HEX < 0x02070000 168 #undef CYTHON_USE_PYLONG_INTERNALS 169 #define CYTHON_USE_PYLONG_INTERNALS 0 170 #elif !defined(CYTHON_USE_PYLONG_INTERNALS) 171 #define CYTHON_USE_PYLONG_INTERNALS 1 173 #ifndef CYTHON_USE_PYLIST_INTERNALS 174 #define CYTHON_USE_PYLIST_INTERNALS 1 176 #ifndef CYTHON_USE_UNICODE_INTERNALS 177 #define CYTHON_USE_UNICODE_INTERNALS 1 179 #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 180 #undef CYTHON_USE_UNICODE_WRITER 181 #define CYTHON_USE_UNICODE_WRITER 0 182 #elif !defined(CYTHON_USE_UNICODE_WRITER) 183 #define CYTHON_USE_UNICODE_WRITER 1 185 #ifndef CYTHON_AVOID_BORROWED_REFS 186 #define CYTHON_AVOID_BORROWED_REFS 0 188 #ifndef CYTHON_ASSUME_SAFE_MACROS 189 #define CYTHON_ASSUME_SAFE_MACROS 1 191 #ifndef CYTHON_UNPACK_METHODS 192 #define CYTHON_UNPACK_METHODS 1 194 #if PY_VERSION_HEX >= 0x030B00A4 195 #undef CYTHON_FAST_THREAD_STATE 196 #define CYTHON_FAST_THREAD_STATE 0 197 #elif !defined(CYTHON_FAST_THREAD_STATE) 198 #define CYTHON_FAST_THREAD_STATE 1 200 #ifndef CYTHON_FAST_PYCALL 201 #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030B00A1) 203 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT 204 #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) 206 #ifndef CYTHON_USE_TP_FINALIZE 207 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) 209 #ifndef CYTHON_USE_DICT_VERSIONS 210 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) 212 #if PY_VERSION_HEX >= 0x030B00A4 213 #undef CYTHON_USE_EXC_INFO_STACK 214 #define CYTHON_USE_EXC_INFO_STACK 0 215 #elif !defined(CYTHON_USE_EXC_INFO_STACK) 216 #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) 219 #if !defined(CYTHON_FAST_PYCCALL) 220 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) 222 #if CYTHON_USE_PYLONG_INTERNALS 223 #if PY_MAJOR_VERSION < 3 224 #include "longintrepr.h" 230 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P ==
sizeof(
void*)) };
233 #ifndef __has_attribute 234 #define __has_attribute(x) 0 236 #ifndef __has_cpp_attribute 237 #define __has_cpp_attribute(x) 0 239 #ifndef CYTHON_RESTRICT 240 #if defined(__GNUC__) 241 #define CYTHON_RESTRICT __restrict__ 242 #elif defined(_MSC_VER) && _MSC_VER >= 1400 243 #define CYTHON_RESTRICT __restrict 244 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 245 #define CYTHON_RESTRICT restrict 247 #define CYTHON_RESTRICT 250 #ifndef CYTHON_UNUSED 251 # if defined(__GNUC__) 252 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) 253 # define CYTHON_UNUSED __attribute__ ((__unused__)) 255 # define CYTHON_UNUSED 257 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) 258 # define CYTHON_UNUSED __attribute__ ((__unused__)) 260 # define CYTHON_UNUSED 263 #ifndef CYTHON_MAYBE_UNUSED_VAR 264 # if defined(__cplusplus) 265 template<
class T>
void CYTHON_MAYBE_UNUSED_VAR(
const T& ) { }
267 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) 270 #ifndef CYTHON_NCP_UNUSED 271 # if CYTHON_COMPILING_IN_CPYTHON 272 # define CYTHON_NCP_UNUSED 274 # define CYTHON_NCP_UNUSED CYTHON_UNUSED 277 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) 279 #ifndef _MSC_STDINT_H_ 281 typedef unsigned char uint8_t;
282 typedef unsigned int uint32_t;
284 typedef unsigned __int8 uint8_t;
285 typedef unsigned __int32 uint32_t;
291 #ifndef CYTHON_FALLTHROUGH 292 #if defined(__cplusplus) && __cplusplus >= 201103L 293 #if __has_cpp_attribute(fallthrough) 294 #define CYTHON_FALLTHROUGH [[fallthrough]] 295 #elif __has_cpp_attribute(clang::fallthrough) 296 #define CYTHON_FALLTHROUGH [[clang::fallthrough]] 297 #elif __has_cpp_attribute(gnu::fallthrough) 298 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] 301 #ifndef CYTHON_FALLTHROUGH 302 #if __has_attribute(fallthrough) 303 #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) 305 #define CYTHON_FALLTHROUGH 308 #if defined(__clang__ ) && defined(__apple_build_version__) 309 #if __apple_build_version__ < 7000000 310 #undef CYTHON_FALLTHROUGH 311 #define CYTHON_FALLTHROUGH 317 #error "Cython files generated with the C++ option must be compiled with a C++ compiler." 319 #ifndef CYTHON_INLINE 320 #if defined(__clang__) 321 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) 323 #define CYTHON_INLINE inline 327 void __Pyx_call_destructor(T& x) {
331 class __Pyx_FakeReference {
333 __Pyx_FakeReference() : ptr(NULL) { }
334 __Pyx_FakeReference(
const T& ref) : ptr(const_cast<T*>(&ref)) { }
335 T *operator->() {
return ptr; }
337 operator T&() {
return *ptr; }
338 template<
typename U>
bool operator ==(U other) {
return *ptr == other; }
339 template<
typename U>
bool operator !=(U other) {
return *ptr != other; }
344 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) 345 #define Py_OptimizeFlag 0 347 #define __PYX_BUILD_PY_SSIZE_T "n" 348 #define CYTHON_FORMAT_SSIZE_T "z" 349 #if PY_MAJOR_VERSION < 3 350 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" 351 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ 352 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) 353 #define __Pyx_DefaultClassType PyClass_Type 355 #define __Pyx_BUILTIN_MODULE_NAME "builtins" 356 #define __Pyx_DefaultClassType PyType_Type 357 #if PY_VERSION_HEX >= 0x030B00A1 358 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(
int a,
int k,
int l,
int s,
int f,
359 PyObject *code, PyObject *c, PyObject* n, PyObject *v,
360 PyObject *fv, PyObject *cell, PyObject* fn,
361 PyObject *name,
int fline, PyObject *lnos) {
362 PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
363 PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
364 const char *fn_cstr=NULL;
365 const char *name_cstr=NULL;
366 PyCodeObject* co=NULL;
367 PyObject *type, *value, *traceback;
368 PyErr_Fetch(&type, &value, &traceback);
369 if (!(kwds=PyDict_New()))
goto end;
370 if (!(argcount=PyLong_FromLong(a)))
goto end;
371 if (PyDict_SetItemString(kwds,
"co_argcount", argcount) != 0)
goto end;
372 if (!(posonlyargcount=PyLong_FromLong(0)))
goto end;
373 if (PyDict_SetItemString(kwds,
"co_posonlyargcount", posonlyargcount) != 0)
goto end;
374 if (!(kwonlyargcount=PyLong_FromLong(k)))
goto end;
375 if (PyDict_SetItemString(kwds,
"co_kwonlyargcount", kwonlyargcount) != 0)
goto end;
376 if (!(nlocals=PyLong_FromLong(l)))
goto end;
377 if (PyDict_SetItemString(kwds,
"co_nlocals", nlocals) != 0)
goto end;
378 if (!(stacksize=PyLong_FromLong(s)))
goto end;
379 if (PyDict_SetItemString(kwds,
"co_stacksize", stacksize) != 0)
goto end;
380 if (!(flags=PyLong_FromLong(f)))
goto end;
381 if (PyDict_SetItemString(kwds,
"co_flags", flags) != 0)
goto end;
382 if (PyDict_SetItemString(kwds,
"co_code", code) != 0)
goto end;
383 if (PyDict_SetItemString(kwds,
"co_consts", c) != 0)
goto end;
384 if (PyDict_SetItemString(kwds,
"co_names", n) != 0)
goto end;
385 if (PyDict_SetItemString(kwds,
"co_varnames", v) != 0)
goto end;
386 if (PyDict_SetItemString(kwds,
"co_freevars", fv) != 0)
goto end;
387 if (PyDict_SetItemString(kwds,
"co_cellvars", cell) != 0)
goto end;
388 if (PyDict_SetItemString(kwds,
"co_linetable", lnos) != 0)
goto end;
389 if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL)))
goto end;
390 if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL)))
goto end;
391 if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline)))
goto end;
392 if (!(replace = PyObject_GetAttrString((PyObject*)co,
"replace")))
goto cleanup_code_too;
393 if (!(empty = PyTuple_New(0)))
goto cleanup_code_too;
394 if (!(call_result = PyObject_Call(replace, empty, kwds)))
goto cleanup_code_too;
395 Py_XDECREF((PyObject*)co);
396 co = (PyCodeObject*)call_result;
400 Py_XDECREF((PyObject*)co);
405 Py_XDECREF(argcount);
406 Py_XDECREF(posonlyargcount);
407 Py_XDECREF(kwonlyargcount);
409 Py_XDECREF(stacksize);
411 Py_XDECREF(call_result);
414 PyErr_Restore(type, value, traceback);
419 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ 420 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) 422 #define __Pyx_DefaultClassType PyType_Type 424 #ifndef Py_TPFLAGS_CHECKTYPES 425 #define Py_TPFLAGS_CHECKTYPES 0 427 #ifndef Py_TPFLAGS_HAVE_INDEX 428 #define Py_TPFLAGS_HAVE_INDEX 0 430 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER 431 #define Py_TPFLAGS_HAVE_NEWBUFFER 0 433 #ifndef Py_TPFLAGS_HAVE_FINALIZE 434 #define Py_TPFLAGS_HAVE_FINALIZE 0 436 #ifndef METH_STACKLESS 437 #define METH_STACKLESS 0 439 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) 440 #ifndef METH_FASTCALL 441 #define METH_FASTCALL 0x80 443 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *
self, PyObject *
const *args, Py_ssize_t nargs);
444 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *
self, PyObject *
const *args,
445 Py_ssize_t nargs, PyObject *kwnames);
447 #define __Pyx_PyCFunctionFast _PyCFunctionFast 448 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords 450 #if CYTHON_FAST_PYCCALL 451 #define __Pyx_PyFastCFunction_Check(func)\ 452 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) 454 #define __Pyx_PyFastCFunction_Check(func) 0 456 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) 457 #define PyObject_Malloc(s) PyMem_Malloc(s) 458 #define PyObject_Free(p) PyMem_Free(p) 459 #define PyObject_Realloc(p) PyMem_Realloc(p) 461 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 462 #define PyMem_RawMalloc(n) PyMem_Malloc(n) 463 #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) 464 #define PyMem_RawFree(p) PyMem_Free(p) 466 #if CYTHON_COMPILING_IN_PYSTON 467 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) 468 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) 470 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) 471 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) 473 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 474 #define __Pyx_PyThreadState_Current PyThreadState_GET() 475 #elif PY_VERSION_HEX >= 0x03060000 476 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() 477 #elif PY_VERSION_HEX >= 0x03000000 478 #define __Pyx_PyThreadState_Current PyThreadState_GET() 480 #define __Pyx_PyThreadState_Current _PyThreadState_Current 482 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) 483 #include "pythread.h" 484 #define Py_tss_NEEDS_INIT 0 485 typedef int Py_tss_t;
486 static CYTHON_INLINE
int PyThread_tss_create(Py_tss_t *key) {
487 *key = PyThread_create_key();
490 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(
void) {
491 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(
sizeof(Py_tss_t));
492 *key = Py_tss_NEEDS_INIT;
495 static CYTHON_INLINE
void PyThread_tss_free(Py_tss_t *key) {
498 static CYTHON_INLINE
int PyThread_tss_is_created(Py_tss_t *key) {
499 return *key != Py_tss_NEEDS_INIT;
501 static CYTHON_INLINE
void PyThread_tss_delete(Py_tss_t *key) {
502 PyThread_delete_key(*key);
503 *key = Py_tss_NEEDS_INIT;
505 static CYTHON_INLINE
int PyThread_tss_set(Py_tss_t *key,
void *value) {
506 return PyThread_set_key_value(*key, value);
508 static CYTHON_INLINE
void * PyThread_tss_get(Py_tss_t *key) {
509 return PyThread_get_key_value(*key);
512 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) 513 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) 515 #define __Pyx_PyDict_NewPresized(n) PyDict_New() 517 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION 518 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) 519 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) 521 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) 522 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) 524 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS 525 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) 527 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) 529 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) 530 #define CYTHON_PEP393_ENABLED 1 531 #if defined(PyUnicode_IS_READY) 532 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 533 0 : _PyUnicode_Ready((PyObject *)(op))) 535 #define __Pyx_PyUnicode_READY(op) (0) 537 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) 538 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) 539 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) 540 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) 541 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) 542 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) 543 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) 544 #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE) 545 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 546 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) 548 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) 551 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) 554 #define CYTHON_PEP393_ENABLED 0 555 #define PyUnicode_1BYTE_KIND 1 556 #define PyUnicode_2BYTE_KIND 2 557 #define PyUnicode_4BYTE_KIND 4 558 #define __Pyx_PyUnicode_READY(op) (0) 559 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) 560 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) 561 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) 562 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) 563 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) 564 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) 565 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) 566 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) 568 #if CYTHON_COMPILING_IN_PYPY 569 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) 570 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) 572 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) 573 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ 574 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) 576 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) 577 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) 579 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) 580 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) 582 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) 583 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) 585 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) 586 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) 587 #if PY_MAJOR_VERSION >= 3 588 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) 590 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) 592 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) 593 #define PyObject_ASCII(o) PyObject_Repr(o) 595 #if PY_MAJOR_VERSION >= 3 596 #define PyBaseString_Type PyUnicode_Type 597 #define PyStringObject PyUnicodeObject 598 #define PyString_Type PyUnicode_Type 599 #define PyString_Check PyUnicode_Check 600 #define PyString_CheckExact PyUnicode_CheckExact 601 #ifndef PyObject_Unicode 602 #define PyObject_Unicode PyObject_Str 605 #if PY_MAJOR_VERSION >= 3 606 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) 607 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) 609 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) 610 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) 612 #ifndef PySet_CheckExact 613 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) 615 #if PY_VERSION_HEX >= 0x030900A4 616 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) 617 #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) 619 #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) 620 #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) 622 #if CYTHON_ASSUME_SAFE_MACROS 623 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) 625 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) 627 #if PY_MAJOR_VERSION >= 3 628 #define PyIntObject PyLongObject 629 #define PyInt_Type PyLong_Type 630 #define PyInt_Check(op) PyLong_Check(op) 631 #define PyInt_CheckExact(op) PyLong_CheckExact(op) 632 #define PyInt_FromString PyLong_FromString 633 #define PyInt_FromUnicode PyLong_FromUnicode 634 #define PyInt_FromLong PyLong_FromLong 635 #define PyInt_FromSize_t PyLong_FromSize_t 636 #define PyInt_FromSsize_t PyLong_FromSsize_t 637 #define PyInt_AsLong PyLong_AsLong 638 #define PyInt_AS_LONG PyLong_AS_LONG 639 #define PyInt_AsSsize_t PyLong_AsSsize_t 640 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask 641 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask 642 #define PyNumber_Int PyNumber_Long 644 #if PY_MAJOR_VERSION >= 3 645 #define PyBoolObject PyLongObject 647 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY 648 #ifndef PyUnicode_InternFromString 649 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) 652 #if PY_VERSION_HEX < 0x030200A4 653 typedef long Py_hash_t;
654 #define __Pyx_PyInt_FromHash_t PyInt_FromLong 655 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t 657 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t 658 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t 660 #if PY_MAJOR_VERSION >= 3 661 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func)) 663 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) 665 #if CYTHON_USE_ASYNC_SLOTS 666 #if PY_VERSION_HEX >= 0x030500B1 667 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods 668 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) 670 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) 673 #define __Pyx_PyType_AsAsync(obj) NULL 675 #ifndef __Pyx_PyAsyncMethodsStruct 680 } __Pyx_PyAsyncMethodsStruct;
683 #if defined(WIN32) || defined(MS_WINDOWS) 684 #define _USE_MATH_DEFINES 688 #define __PYX_NAN() ((float) NAN) 690 static CYTHON_INLINE
float __PYX_NAN() {
692 memset(&value, 0xFF,
sizeof(value));
696 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) 697 #define __Pyx_truncl trunc 699 #define __Pyx_truncl truncl 702 #define __PYX_MARK_ERR_POS(f_index, lineno) \ 703 { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } 704 #define __PYX_ERR(f_index, lineno, Ln_error) \ 705 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } 707 #ifndef __PYX_EXTERN_C 709 #define __PYX_EXTERN_C extern "C" 711 #define __PYX_EXTERN_C extern 715 #define __PYX_HAVE__PyClical 716 #define __PYX_HAVE_API__PyClical 730 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) 731 #define CYTHON_WITHOUT_ASSERTIONS 734 typedef struct {PyObject **p;
const char *s;
const Py_ssize_t n;
const char* encoding;
735 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
737 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 738 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 739 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) 740 #define __PYX_DEFAULT_STRING_ENCODING "" 741 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString 742 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize 743 #define __Pyx_uchar_cast(c) ((unsigned char)c) 744 #define __Pyx_long_cast(x) ((long)x) 745 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ 746 (sizeof(type) < sizeof(Py_ssize_t)) ||\ 747 (sizeof(type) > sizeof(Py_ssize_t) &&\ 748 likely(v < (type)PY_SSIZE_T_MAX ||\ 749 v == (type)PY_SSIZE_T_MAX) &&\ 750 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ 751 v == (type)PY_SSIZE_T_MIN))) ||\ 752 (sizeof(type) == sizeof(Py_ssize_t) &&\ 753 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ 754 v == (type)PY_SSIZE_T_MAX))) ) 755 static CYTHON_INLINE
int __Pyx_is_valid_index(Py_ssize_t
i, Py_ssize_t limit) {
756 return (
size_t)
i < (size_t) limit;
758 #if defined (__cplusplus) && __cplusplus >= 201103L 760 #define __Pyx_sst_abs(value) std::abs(value) 761 #elif SIZEOF_INT >= SIZEOF_SIZE_T 762 #define __Pyx_sst_abs(value) abs(value) 763 #elif SIZEOF_LONG >= SIZEOF_SIZE_T 764 #define __Pyx_sst_abs(value) labs(value) 765 #elif defined (_MSC_VER) 766 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) 767 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 768 #define __Pyx_sst_abs(value) llabs(value) 769 #elif defined (__GNUC__) 770 #define __Pyx_sst_abs(value) __builtin_llabs(value) 772 #define __Pyx_sst_abs(value) ((value<0) ? -value : value) 774 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
775 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
776 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) 777 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) 778 #define __Pyx_PyBytes_FromString PyBytes_FromString 779 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize 780 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
781 #if PY_MAJOR_VERSION < 3 782 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString 783 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize 785 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString 786 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize 788 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) 789 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) 790 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) 791 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) 792 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) 793 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) 794 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) 795 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) 796 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) 797 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) 798 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) 799 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) 800 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) 801 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) 802 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) 803 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) 804 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *u) {
805 const Py_UNICODE *u_end = u;
807 return (
size_t)(u_end - u - 1);
809 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) 810 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode 811 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode 812 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) 813 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) 814 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
815 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
816 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
817 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
818 #define __Pyx_PySequence_Tuple(obj)\ 819 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) 820 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
821 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
822 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
823 #if CYTHON_ASSUME_SAFE_MACROS 824 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) 826 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) 828 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) 829 #if PY_MAJOR_VERSION >= 3 830 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) 832 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) 834 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) 835 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 836 static int __Pyx_sys_getdefaultencoding_not_ascii;
837 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
839 PyObject* default_encoding = NULL;
840 PyObject* ascii_chars_u = NULL;
841 PyObject* ascii_chars_b = NULL;
842 const char* default_encoding_c;
843 sys = PyImport_ImportModule(
"sys");
845 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
847 if (!default_encoding)
goto bad;
848 default_encoding_c = PyBytes_AsString(default_encoding);
849 if (!default_encoding_c)
goto bad;
850 if (strcmp(default_encoding_c,
"ascii") == 0) {
851 __Pyx_sys_getdefaultencoding_not_ascii = 0;
853 char ascii_chars[128];
855 for (c = 0; c < 128; c++) {
858 __Pyx_sys_getdefaultencoding_not_ascii = 1;
859 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
860 if (!ascii_chars_u)
goto bad;
861 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
862 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
865 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
869 Py_DECREF(ascii_chars_u);
870 Py_DECREF(ascii_chars_b);
872 Py_DECREF(default_encoding);
875 Py_XDECREF(default_encoding);
876 Py_XDECREF(ascii_chars_u);
877 Py_XDECREF(ascii_chars_b);
881 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 882 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) 884 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) 885 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 886 static char* __PYX_DEFAULT_STRING_ENCODING;
887 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
889 PyObject* default_encoding = NULL;
890 char* default_encoding_c;
891 sys = PyImport_ImportModule(
"sys");
893 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
895 if (!default_encoding)
goto bad;
896 default_encoding_c = PyBytes_AsString(default_encoding);
897 if (!default_encoding_c)
goto bad;
898 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c) + 1);
899 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
900 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
901 Py_DECREF(default_encoding);
904 Py_XDECREF(default_encoding);
912 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) 913 #define likely(x) __builtin_expect(!!(x), 1) 914 #define unlikely(x) __builtin_expect(!!(x), 0) 916 #define likely(x) (x) 917 #define unlikely(x) (x) 919 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
921 static PyObject *__pyx_m = NULL;
922 static PyObject *__pyx_d;
923 static PyObject *__pyx_b;
924 static PyObject *__pyx_cython_runtime = NULL;
925 static PyObject *__pyx_empty_tuple;
926 static PyObject *__pyx_empty_bytes;
927 static PyObject *__pyx_empty_unicode;
928 static int __pyx_lineno;
929 static int __pyx_clineno = 0;
930 static const char * __pyx_cfilenm= __FILE__;
931 static const char *__pyx_filename;
934 static const char *__pyx_f[] = {
940 struct __pyx_obj_8PyClical_index_set;
941 struct __pyx_obj_8PyClical_clifford;
942 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__;
943 struct __pyx_opt_args_8PyClical_approx_equal;
944 struct __pyx_opt_args_8PyClical_sqrt;
945 struct __pyx_opt_args_8PyClical_log;
946 struct __pyx_opt_args_8PyClical_cos;
947 struct __pyx_opt_args_8PyClical_acos;
948 struct __pyx_opt_args_8PyClical_acosh;
949 struct __pyx_opt_args_8PyClical_sin;
950 struct __pyx_opt_args_8PyClical_asin;
951 struct __pyx_opt_args_8PyClical_asinh;
952 struct __pyx_opt_args_8PyClical_tan;
953 struct __pyx_opt_args_8PyClical_atan;
954 struct __pyx_opt_args_8PyClical_atanh;
955 struct __pyx_opt_args_8PyClical_random_clifford;
964 struct __pyx_opt_args_8PyClical_approx_equal {
977 struct __pyx_opt_args_8PyClical_sqrt {
989 struct __pyx_opt_args_8PyClical_log {
1001 struct __pyx_opt_args_8PyClical_cos {
1013 struct __pyx_opt_args_8PyClical_acos {
1025 struct __pyx_opt_args_8PyClical_acosh {
1037 struct __pyx_opt_args_8PyClical_sin {
1049 struct __pyx_opt_args_8PyClical_asin {
1061 struct __pyx_opt_args_8PyClical_asinh {
1073 struct __pyx_opt_args_8PyClical_tan {
1085 struct __pyx_opt_args_8PyClical_atan {
1097 struct __pyx_opt_args_8PyClical_atanh {
1109 struct __pyx_opt_args_8PyClical_random_clifford {
1121 struct __pyx_obj_8PyClical_index_set {
1123 struct __pyx_vtabstruct_8PyClical_index_set *__pyx_vtab;
1135 struct __pyx_obj_8PyClical_clifford {
1137 struct __pyx_vtabstruct_8PyClical_clifford *__pyx_vtab;
1149 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ {
1151 PyObject *__pyx_v_idx;
1152 struct __pyx_obj_8PyClical_index_set *__pyx_v_self;
1153 PyObject *__pyx_t_0;
1154 Py_ssize_t __pyx_t_1;
1155 PyObject *(*__pyx_t_2)(PyObject *);
1168 struct __pyx_vtabstruct_8PyClical_index_set {
1169 PyObject *(*wrap)(
struct __pyx_obj_8PyClical_index_set *,
IndexSet);
1170 IndexSet (*unwrap)(
struct __pyx_obj_8PyClical_index_set *);
1171 PyObject *(*copy)(
struct __pyx_obj_8PyClical_index_set *,
int __pyx_skip_dispatch);
1173 static struct __pyx_vtabstruct_8PyClical_index_set *__pyx_vtabptr_8PyClical_index_set;
1174 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_9index_set_wrap(
struct __pyx_obj_8PyClical_index_set *,
IndexSet);
1175 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_9index_set_unwrap(
struct __pyx_obj_8PyClical_index_set *);
1186 struct __pyx_vtabstruct_8PyClical_clifford {
1187 PyObject *(*wrap)(
struct __pyx_obj_8PyClical_clifford *,
Clifford);
1188 Clifford (*unwrap)(
struct __pyx_obj_8PyClical_clifford *);
1189 PyObject *(*copy)(
struct __pyx_obj_8PyClical_clifford *,
int __pyx_skip_dispatch);
1191 static struct __pyx_vtabstruct_8PyClical_clifford *__pyx_vtabptr_8PyClical_clifford;
1192 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_8clifford_wrap(
struct __pyx_obj_8PyClical_clifford *,
Clifford);
1193 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_8clifford_unwrap(
struct __pyx_obj_8PyClical_clifford *);
1197 #ifndef CYTHON_REFNANNY 1198 #define CYTHON_REFNANNY 0 1202 void (*INCREF)(
void*, PyObject*, int);
1203 void (*DECREF)(
void*, PyObject*, int);
1204 void (*GOTREF)(
void*, PyObject*, int);
1205 void (*GIVEREF)(
void*, PyObject*, int);
1206 void* (*SetupContext)(
const char*, int,
const char*);
1207 void (*FinishContext)(
void**);
1208 } __Pyx_RefNannyAPIStruct;
1209 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1210 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1211 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; 1213 #define __Pyx_RefNannySetupContext(name, acquire_gil)\ 1215 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ 1216 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ 1217 PyGILState_Release(__pyx_gilstate_save);\ 1219 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ 1222 #define __Pyx_RefNannySetupContext(name, acquire_gil)\ 1223 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) 1225 #define __Pyx_RefNannyFinishContext()\ 1226 __Pyx_RefNanny->FinishContext(&__pyx_refnanny) 1227 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1228 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1229 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1230 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1231 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) 1232 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) 1233 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) 1234 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) 1236 #define __Pyx_RefNannyDeclarations 1237 #define __Pyx_RefNannySetupContext(name, acquire_gil) 1238 #define __Pyx_RefNannyFinishContext() 1239 #define __Pyx_INCREF(r) Py_INCREF(r) 1240 #define __Pyx_DECREF(r) Py_DECREF(r) 1241 #define __Pyx_GOTREF(r) 1242 #define __Pyx_GIVEREF(r) 1243 #define __Pyx_XINCREF(r) Py_XINCREF(r) 1244 #define __Pyx_XDECREF(r) Py_XDECREF(r) 1245 #define __Pyx_XGOTREF(r) 1246 #define __Pyx_XGIVEREF(r) 1248 #define __Pyx_XDECREF_SET(r, v) do {\ 1249 PyObject *tmp = (PyObject *) r;\ 1250 r = v; __Pyx_XDECREF(tmp);\ 1252 #define __Pyx_DECREF_SET(r, v) do {\ 1253 PyObject *tmp = (PyObject *) r;\ 1254 r = v; __Pyx_DECREF(tmp);\ 1256 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) 1257 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) 1260 #if CYTHON_USE_TYPE_SLOTS 1261 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject*
obj, PyObject* attr_name);
1263 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) 1267 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1270 #if CYTHON_FAST_PYCCALL 1271 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1273 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) 1277 #if CYTHON_FAST_PYCALL 1278 #define __Pyx_PyFunction_FastCall(func, args, nargs)\ 1279 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) 1280 #if 1 || PY_VERSION_HEX < 0x030600B1 1281 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1283 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) 1285 #define __Pyx_BUILD_ASSERT_EXPR(cond)\ 1286 (sizeof(char [1 - 2*!(cond)]) - 1) 1287 #ifndef Py_MEMBER_SIZE 1288 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) 1290 #if CYTHON_FAST_PYCALL 1291 static size_t __pyx_pyframe_localsplus_offset = 0;
1292 #include "frameobject.h" 1293 #define __Pxy_PyFrame_Initialize_Offsets()\ 1294 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ 1295 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) 1296 #define __Pyx_PyFrame_GetLocalsplus(frame)\ 1297 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) 1298 #endif // CYTHON_FAST_PYCALL 1302 #if CYTHON_COMPILING_IN_CPYTHON 1303 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1305 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) 1309 #if CYTHON_COMPILING_IN_CPYTHON 1310 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1314 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1317 #if CYTHON_FAST_THREAD_STATE 1318 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; 1319 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; 1320 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type 1322 #define __Pyx_PyThreadState_declare 1323 #define __Pyx_PyThreadState_assign 1324 #define __Pyx_PyErr_Occurred() PyErr_Occurred() 1328 #if CYTHON_FAST_THREAD_STATE 1329 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) 1330 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) 1331 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) 1332 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) 1333 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) 1334 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1335 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1336 #if CYTHON_COMPILING_IN_CPYTHON 1337 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) 1339 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) 1342 #define __Pyx_PyErr_Clear() PyErr_Clear() 1343 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) 1344 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) 1345 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) 1346 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) 1347 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) 1348 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) 1349 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) 1353 static void __Pyx_WriteUnraisable(
const char *name,
int clineno,
1354 int lineno,
const char *filename,
1355 int full_traceback,
int nogil);
1358 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS 1359 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) 1360 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) 1361 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ 1362 (version_var) = __PYX_GET_DICT_VERSION(dict);\ 1363 (cache_var) = (value); 1364 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ 1365 static PY_UINT64_T __pyx_dict_version = 0;\ 1366 static PyObject *__pyx_dict_cached_value = NULL;\ 1367 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ 1368 (VAR) = __pyx_dict_cached_value;\ 1370 (VAR) = __pyx_dict_cached_value = (LOOKUP);\ 1371 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ 1374 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *
obj);
1375 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *
obj);
1376 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject*
obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1378 #define __PYX_GET_DICT_VERSION(dict) (0) 1379 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) 1380 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); 1384 #if CYTHON_COMPILING_IN_CPYTHON 1385 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1387 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) 1391 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
1394 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1395 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1396 const char* function_name);
1399 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1400 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1403 #if CYTHON_USE_DICT_VERSIONS 1404 #define __Pyx_GetModuleGlobalName(var, name) {\ 1405 static PY_UINT64_T __pyx_dict_version = 0;\ 1406 static PyObject *__pyx_dict_cached_value = NULL;\ 1407 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ 1408 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ 1409 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ 1411 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\ 1412 PY_UINT64_T __pyx_dict_version;\ 1413 PyObject *__pyx_dict_cached_value;\ 1414 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ 1416 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1418 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) 1419 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) 1420 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1424 #if CYTHON_USE_EXC_INFO_STACK 1425 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1429 #if CYTHON_FAST_THREAD_STATE 1430 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) 1431 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1432 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) 1433 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1435 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) 1436 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) 1440 #if CYTHON_FAST_THREAD_STATE 1441 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) 1442 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1444 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) 1448 #if CYTHON_FAST_THREAD_STATE 1449 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) 1450 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1452 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1456 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1459 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2);
1462 #if !CYTHON_COMPILING_IN_PYPY 1463 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2,
long intval,
int inplace,
int zerodivision_check);
1465 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\ 1466 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) 1470 static CYTHON_INLINE
int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq,
int eq) {
1471 int result = PySequence_Contains(seq, item);
1472 return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
1479 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(
const char *s, Py_ssize_t size,
const char *errors) {
1481 return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1483 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(
const char *s, Py_ssize_t size,
const char *errors) {
1485 return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1487 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(
const char *s, Py_ssize_t size,
const char *errors) {
1489 return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1493 static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
1494 const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop,
1495 const char* encoding,
const char* errors,
1496 PyObject* (*decode_func)(
const char *s, Py_ssize_t size,
const char *errors));
1499 static CYTHON_INLINE PyObject* __Pyx_decode_cpp_string(
1500 std::string cppstring, Py_ssize_t start, Py_ssize_t stop,
1501 const char* encoding,
const char* errors,
1502 PyObject* (*decode_func)(
const char *s, Py_ssize_t size,
const char *errors)) {
1503 return __Pyx_decode_c_bytes(
1504 cppstring.data(), cppstring.size(), start, stop, encoding, errors, decode_func);
1508 #if CYTHON_FAST_THREAD_STATE 1509 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) 1510 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1512 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
1516 #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ 1517 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ 1518 __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\ 1519 (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\ 1520 __Pyx_SetItemInt_Generic(o, to_py_func(i), v))) 1521 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
1522 static CYTHON_INLINE
int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t
i, PyObject *v,
1523 int is_list,
int wraparound,
int boundscheck);
1526 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ 1527 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\ 1528 __Pyx__ArgTypeTest(obj, type, name, exact)) 1529 static int __Pyx__ArgTypeTest(PyObject *
obj, PyTypeObject *type,
const char *name,
int exact);
1532 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
1538 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 1539 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject*
obj, PyObject* attr_name);
1541 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr 1545 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 1546 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject*
obj, PyObject* attr_name);
1548 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr 1552 static int __Pyx_SetVtable(PyObject *dict,
void *vtable);
1555 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject*
obj, PyObject* attr_name);
1558 static int __Pyx_setup_reduce(PyObject* type_obj);
1561 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals);
1564 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals);
1567 #ifdef CYTHON_CLINE_IN_TRACEBACK 1568 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) 1570 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
1575 PyCodeObject* code_object;
1577 } __Pyx_CodeObjectCacheEntry;
1578 struct __Pyx_CodeObjectCache {
1581 __Pyx_CodeObjectCacheEntry* entries;
1583 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1584 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
1585 static PyCodeObject *__pyx_find_code_object(
int code_line);
1586 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
1589 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
1590 int py_line,
const char *filename);
1593 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) 1594 #define __Pyx_HAS_GCC_DIAGNOSTIC 1598 #ifndef __Pyx_CppExn2PyErr 1601 #include <stdexcept> 1603 static void __Pyx_CppExn2PyErr() {
1605 if (PyErr_Occurred())
1609 }
catch (
const std::bad_alloc& exn) {
1610 PyErr_SetString(PyExc_MemoryError, exn.what());
1611 }
catch (
const std::bad_cast& exn) {
1612 PyErr_SetString(PyExc_TypeError, exn.what());
1613 }
catch (
const std::bad_typeid& exn) {
1614 PyErr_SetString(PyExc_TypeError, exn.what());
1615 }
catch (
const std::domain_error& exn) {
1616 PyErr_SetString(PyExc_ValueError, exn.what());
1617 }
catch (
const std::invalid_argument& exn) {
1618 PyErr_SetString(PyExc_ValueError, exn.what());
1619 }
catch (
const std::ios_base::failure& exn) {
1620 PyErr_SetString(PyExc_IOError, exn.what());
1621 }
catch (
const std::out_of_range& exn) {
1622 PyErr_SetString(PyExc_IndexError, exn.what());
1623 }
catch (
const std::overflow_error& exn) {
1624 PyErr_SetString(PyExc_OverflowError, exn.what());
1625 }
catch (
const std::range_error& exn) {
1626 PyErr_SetString(PyExc_ArithmeticError, exn.what());
1627 }
catch (
const std::underflow_error& exn) {
1628 PyErr_SetString(PyExc_ArithmeticError, exn.what());
1629 }
catch (
const std::exception& exn) {
1630 PyErr_SetString(PyExc_RuntimeError, exn.what());
1634 PyErr_SetString(PyExc_RuntimeError,
"Unknown exception");
1640 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
1643 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
1646 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
1649 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
1652 #if CYTHON_COMPILING_IN_CPYTHON 1653 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) 1654 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1655 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1656 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1658 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) 1659 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) 1660 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) 1662 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) 1665 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
1668 static int __Pyx_PyObject_GetMethod(PyObject *
obj, PyObject *name, PyObject **method);
1671 static PyObject* __Pyx_PyObject_CallMethod1(PyObject*
obj, PyObject* method_name, PyObject* arg);
1674 typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyThreadState *, PyObject *);
1675 #if CYTHON_USE_EXC_INFO_STACK 1676 #define __Pyx_ExcInfoStruct _PyErr_StackItem 1680 PyObject *exc_value;
1681 PyObject *exc_traceback;
1682 } __Pyx_ExcInfoStruct;
1686 __pyx_coroutine_body_t body;
1688 __Pyx_ExcInfoStruct gi_exc_state;
1689 PyObject *gi_weakreflist;
1691 PyObject *yieldfrom;
1693 PyObject *gi_qualname;
1694 PyObject *gi_modulename;
1699 } __pyx_CoroutineObject;
1700 static __pyx_CoroutineObject *__Pyx__Coroutine_New(
1701 PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
1702 PyObject *name, PyObject *qualname, PyObject *module_name);
1703 static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
1704 __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
1705 PyObject *name, PyObject *qualname, PyObject *module_name);
1706 static CYTHON_INLINE
void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *
self);
1707 static int __Pyx_Coroutine_clear(PyObject *
self);
1708 static PyObject *__Pyx_Coroutine_Send(PyObject *
self, PyObject *value);
1709 static PyObject *__Pyx_Coroutine_Close(PyObject *
self);
1710 static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
1711 #if CYTHON_USE_EXC_INFO_STACK 1712 #define __Pyx_Coroutine_SwapException(self) 1713 #define __Pyx_Coroutine_ResetAndClearException(self) __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state) 1715 #define __Pyx_Coroutine_SwapException(self) {\ 1716 __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\ 1717 __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\ 1719 #define __Pyx_Coroutine_ResetAndClearException(self) {\ 1720 __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\ 1721 (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\ 1724 #if CYTHON_FAST_THREAD_STATE 1725 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ 1726 __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue) 1728 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ 1729 __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue) 1731 static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue);
1732 static CYTHON_INLINE
void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state);
1735 static PyObject* __Pyx_Coroutine_patch_module(PyObject* module,
const char* py_code);
1738 static int __Pyx_patch_abc(
void);
1741 #define __Pyx_Generator_USED 1742 static PyTypeObject *__pyx_GeneratorType = 0;
1743 #define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType) 1744 #define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\ 1745 __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name) 1746 static PyObject *__Pyx_Generator_Next(PyObject *
self);
1747 static int __pyx_Generator_init(
void);
1750 static int __Pyx_check_binary_version(
void);
1753 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1755 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_9index_set_wrap(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self,
IndexSet __pyx_v_other);
1756 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_9index_set_unwrap(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
1757 static PyObject *__pyx_f_8PyClical_9index_set_copy(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self,
int __pyx_skip_dispatch);
1758 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_8clifford_wrap(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self,
Clifford __pyx_v_other);
1759 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_8clifford_unwrap(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
1760 static PyObject *__pyx_f_8PyClical_8clifford_copy(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self,
int __pyx_skip_dispatch);
1771 static PyTypeObject *__pyx_ptype_8PyClical_index_set = 0;
1772 static PyTypeObject *__pyx_ptype_8PyClical_clifford = 0;
1773 static PyTypeObject *__pyx_ptype_8PyClical___pyx_scope_struct____iter__ = 0;
1774 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_toIndexSet(PyObject *);
1775 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_compare(PyObject *, PyObject *,
int __pyx_skip_dispatch);
1776 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_min_neg(PyObject *,
int __pyx_skip_dispatch);
1777 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_max_pos(PyObject *,
int __pyx_skip_dispatch);
1778 static CYTHON_INLINE std::vector<scalar_t> __pyx_f_8PyClical_list_to_vector(PyObject *);
1779 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_toClifford(PyObject *);
1780 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_error_squared_tol(PyObject *,
int __pyx_skip_dispatch);
1781 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_error_squared(PyObject *, PyObject *, PyObject *,
int __pyx_skip_dispatch);
1782 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_approx_equal(PyObject *, PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_approx_equal *__pyx_optional_args);
1783 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_inv(PyObject *,
int __pyx_skip_dispatch);
1784 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_scalar(PyObject *,
int __pyx_skip_dispatch);
1785 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_real(PyObject *,
int __pyx_skip_dispatch);
1786 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_imag(PyObject *,
int __pyx_skip_dispatch);
1787 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_pure(PyObject *,
int __pyx_skip_dispatch);
1788 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_even(PyObject *,
int __pyx_skip_dispatch);
1789 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_odd(PyObject *,
int __pyx_skip_dispatch);
1790 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_involute(PyObject *,
int __pyx_skip_dispatch);
1791 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_reverse(PyObject *,
int __pyx_skip_dispatch);
1792 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_conj(PyObject *,
int __pyx_skip_dispatch);
1793 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_quad(PyObject *,
int __pyx_skip_dispatch);
1794 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_norm(PyObject *,
int __pyx_skip_dispatch);
1795 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_abs(PyObject *,
int __pyx_skip_dispatch);
1796 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_max_abs(PyObject *,
int __pyx_skip_dispatch);
1797 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_pow(PyObject *, PyObject *,
int __pyx_skip_dispatch);
1798 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_outer_pow(PyObject *, PyObject *,
int __pyx_skip_dispatch);
1799 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_complexifier(PyObject *,
int __pyx_skip_dispatch);
1800 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_sqrt(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_sqrt *__pyx_optional_args);
1801 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_exp(PyObject *,
int __pyx_skip_dispatch);
1802 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_log(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_log *__pyx_optional_args);
1803 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cos(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_cos *__pyx_optional_args);
1804 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_acos(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_acos *__pyx_optional_args);
1805 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cosh(PyObject *,
int __pyx_skip_dispatch);
1806 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_acosh(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_acosh *__pyx_optional_args);
1807 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_sin(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_sin *__pyx_optional_args);
1808 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_asin(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_asin *__pyx_optional_args);
1809 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_sinh(PyObject *,
int __pyx_skip_dispatch);
1810 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_asinh(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_asinh *__pyx_optional_args);
1811 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_tan(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_tan *__pyx_optional_args);
1812 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_atan(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_atan *__pyx_optional_args);
1813 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_tanh(PyObject *,
int __pyx_skip_dispatch);
1814 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_atanh(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_atanh *__pyx_optional_args);
1815 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);
1816 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cga3(PyObject *,
int __pyx_skip_dispatch);
1817 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cga3std(PyObject *,
int __pyx_skip_dispatch);
1818 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_agc3(PyObject *,
int __pyx_skip_dispatch);
1819 static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_string(std::string
const &);
1820 static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_string(std::string
const &);
1821 static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(std::string
const &);
1822 static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string(std::string
const &);
1823 static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_string(std::string
const &);
1824 #define __Pyx_MODULE_NAME "PyClical" 1825 extern int __pyx_module_is_main_PyClical;
1826 int __pyx_module_is_main_PyClical = 0;
1829 static PyObject *__pyx_builtin_IndexError;
1830 static PyObject *__pyx_builtin_RuntimeError;
1831 static PyObject *__pyx_builtin_TypeError;
1832 static PyObject *__pyx_builtin_ValueError;
1833 static PyObject *__pyx_builtin_NotImplemented;
1834 static PyObject *__pyx_builtin_range;
1835 static PyObject *__pyx_builtin_xrange;
1836 static const char __pyx_k_[] =
".";
1837 static const char __pyx_k_e[] =
"e";
1838 static const char __pyx_k_i[] =
"i";
1839 static const char __pyx_k_m[] =
"m";
1840 static const char __pyx_k_p[] =
"p";
1841 static const char __pyx_k_q[] =
"q";
1842 static const char __pyx_k__2[] =
" ";
1843 static const char __pyx_k__5[] =
":";
1844 static const char __pyx_k__6[] =
"\n\t";
1845 static const char __pyx_k__7[] =
" (";
1846 static const char __pyx_k__8[] =
", ";
1847 static const char __pyx_k__9[] =
").";
1848 static const char __pyx_k_cl[] =
"cl";
1849 static const char __pyx_k_pi[] =
"pi";
1850 static const char __pyx_k_abc[] =
"abc";
1851 static const char __pyx_k_cos[] =
"cos";
1852 static const char __pyx_k_exp[] =
"exp";
1853 static const char __pyx_k_frm[] =
"frm";
1854 static const char __pyx_k_inv[] =
"inv";
1855 static const char __pyx_k_ist[] =
"ist";
1856 static const char __pyx_k_ixt[] =
"ixt";
1857 static const char __pyx_k_lhs[] =
"lhs";
1858 static const char __pyx_k_log[] =
"log";
1859 static const char __pyx_k_max[] =
"max";
1860 static const char __pyx_k_min[] =
"min";
1861 static const char __pyx_k_obj[] =
"obj";
1862 static const char __pyx_k_odd[] =
"odd";
1863 static const char __pyx_k_pow[] =
"pow";
1864 static const char __pyx_k_rhs[] =
"rhs";
1865 static const char __pyx_k_sin[] =
"sin";
1866 static const char __pyx_k_tan[] =
"tan";
1867 static const char __pyx_k_tau[] =
"tau";
1868 static const char __pyx_k_tol[] =
"tol";
1869 static const char __pyx_k_Real[] =
"Real";
1870 static const char __pyx_k_acos[] =
"acos";
1871 static const char __pyx_k_args[] =
"args";
1872 static const char __pyx_k_asin[] =
"asin";
1873 static const char __pyx_k_atan[] =
"atan";
1874 static const char __pyx_k_conj[] =
"conj";
1875 static const char __pyx_k_copy[] =
"copy";
1876 static const char __pyx_k_cosh[] =
"cosh";
1877 static const char __pyx_k_even[] =
"even";
1878 static const char __pyx_k_fill[] =
"fill";
1879 static const char __pyx_k_from[] =
" from ";
1880 static const char __pyx_k_iter[] =
"__iter__";
1881 static const char __pyx_k_main[] =
"__main__";
1882 static const char __pyx_k_math[] =
"math";
1883 static const char __pyx_k_name[] =
"__name__";
1884 static const char __pyx_k_norm[] =
"norm";
1885 static const char __pyx_k_pure[] =
"pure";
1886 static const char __pyx_k_quad[] =
"quad";
1887 static const char __pyx_k_send[] =
"send";
1888 static const char __pyx_k_sinh[] =
"sinh";
1889 static const char __pyx_k_sqrt[] =
"sqrt";
1890 static const char __pyx_k_tanh[] =
"tanh";
1891 static const char __pyx_k_test[] =
"_test";
1892 static const char __pyx_k_UTF_8[] =
"UTF-8";
1893 static const char __pyx_k_acosh[] =
"acosh";
1894 static const char __pyx_k_asinh[] =
"asinh";
1895 static const char __pyx_k_atanh[] =
"atanh";
1896 static const char __pyx_k_close[] =
"close";
1897 static const char __pyx_k_grade[] =
"grade";
1898 static const char __pyx_k_istpq[] =
"istpq";
1899 static const char __pyx_k_nbar3[] =
"nbar3";
1900 static const char __pyx_k_ninf3[] =
"ninf3";
1901 static const char __pyx_k_other[] =
"other";
1902 static const char __pyx_k_range[] =
"range";
1903 static const char __pyx_k_throw[] =
"throw";
1904 static const char __pyx_k_using[] =
" using (";
1905 static const char __pyx_k_utf_8[] =
"utf-8";
1906 static const char __pyx_k_value[] =
" value ";
1907 static const char __pyx_k_encode[] =
"encode";
1908 static const char __pyx_k_import[] =
"__import__";
1909 static const char __pyx_k_reduce[] =
"__reduce__";
1910 static const char __pyx_k_scalar[] =
"scalar";
1911 static const char __pyx_k_test_2[] =
"__test__";
1912 static const char __pyx_k_xrange[] =
"xrange";
1913 static const char __pyx_k_doctest[] =
"doctest";
1914 static const char __pyx_k_invalid[] =
" invalid ";
1915 static const char __pyx_k_numbers[] =
"numbers";
1916 static const char __pyx_k_reverse[] =
"reverse";
1917 static const char __pyx_k_testmod[] =
"testmod";
1918 static const char __pyx_k_version[] =
"__version__";
1919 static const char __pyx_k_Integral[] =
"Integral";
1920 static const char __pyx_k_PyClical[] =
"PyClical";
1921 static const char __pyx_k_Sequence[] =
"Sequence";
1922 static const char __pyx_k_as_frame[] =
" as frame:\n\t";
1923 static const char __pyx_k_clifford[] =
"clifford";
1924 static const char __pyx_k_getstate[] =
"__getstate__";
1925 static const char __pyx_k_involute[] =
"involute";
1926 static const char __pyx_k_setstate[] =
"__setstate__";
1927 static const char __pyx_k_to_frame[] =
" to frame ";
1928 static const char __pyx_k_TypeError[] =
"TypeError";
1929 static const char __pyx_k_index_set[] =
"index_set";
1930 static const char __pyx_k_outer_pow[] =
"outer_pow";
1931 static const char __pyx_k_reduce_ex[] =
"__reduce_ex__";
1932 static const char __pyx_k_threshold[] =
"threshold";
1933 static const char __pyx_k_IndexError[] =
"IndexError";
1934 static const char __pyx_k_ValueError[] =
"ValueError";
1935 static const char __pyx_k_pyx_vtable[] =
"__pyx_vtable__";
1936 static const char __pyx_k_collections[] =
"collections";
1937 static const char __pyx_k_e_line_1936[] =
"e (line 1936)";
1938 static const char __pyx_k_PyClical_pyx[] =
"PyClical.pyx";
1939 static const char __pyx_k_RuntimeError[] =
"RuntimeError";
1940 static const char __pyx_k_abs_line_1522[] =
"abs (line 1522)";
1941 static const char __pyx_k_cos_line_1651[] =
"cos (line 1651)";
1942 static const char __pyx_k_exp_line_1614[] =
"exp (line 1614)";
1943 static const char __pyx_k_inv_line_1378[] =
"inv (line 1378)";
1944 static const char __pyx_k_log_line_1628[] =
"log (line 1628)";
1945 static const char __pyx_k_odd_line_1446[] =
"odd (line 1446)";
1946 static const char __pyx_k_pow_line_1543[] =
"pow (line 1543)";
1947 static const char __pyx_k_reduce_cython[] =
"__reduce_cython__";
1948 static const char __pyx_k_sin_line_1728[] =
"sin (line 1728)";
1949 static const char __pyx_k_tan_line_1801[] =
"tan (line 1801)";
1950 static const char __pyx_k_using_invalid[] =
" using invalid ";
1951 static const char __pyx_k_Cannot_reframe[] =
"Cannot reframe";
1952 static const char __pyx_k_NotImplemented[] =
"NotImplemented";
1953 static const char __pyx_k_Not_applicable[] =
"Not applicable.";
1954 static const char __pyx_k_acos_line_1668[] =
"acos (line 1668)";
1955 static const char __pyx_k_agc3_line_1893[] =
"agc3 (line 1893)";
1956 static const char __pyx_k_asin_line_1747[] =
"asin (line 1747)";
1957 static const char __pyx_k_atan_line_1818[] =
"atan (line 1818)";
1958 static const char __pyx_k_cga3_line_1873[] =
"cga3 (line 1873)";
1959 static const char __pyx_k_conj_line_1485[] =
"conj (line 1485)";
1960 static const char __pyx_k_cosh_line_1689[] =
"cosh (line 1689)";
1961 static const char __pyx_k_even_line_1437[] =
"even (line 1437)";
1962 static const char __pyx_k_imag_line_1415[] =
"imag (line 1415)";
1963 static const char __pyx_k_invalid_string[] =
" invalid string ";
1964 static const char __pyx_k_norm_line_1511[] =
"norm (line 1511)";
1965 static const char __pyx_k_pure_line_1426[] =
"pure (line 1426)";
1966 static const char __pyx_k_quad_line_1500[] =
"quad (line 1500)";
1967 static const char __pyx_k_real_line_1404[] =
"real (line 1404)";
1968 static const char __pyx_k_scalar_epsilon[] =
"scalar_epsilon";
1969 static const char __pyx_k_sinh_line_1768[] =
"sinh (line 1768)";
1970 static const char __pyx_k_sqrt_line_1591[] =
"sqrt (line 1591)";
1971 static const char __pyx_k_tanh_line_1835[] =
"tanh (line 1835)";
1972 static const char __pyx_k_acosh_line_1705[] =
"acosh (line 1705)";
1973 static const char __pyx_k_asinh_line_1782[] =
"asinh (line 1782)";
1974 static const char __pyx_k_atanh_line_1847[] =
"atanh (line 1847)";
1975 static const char __pyx_k_istpq_line_1949[] =
"istpq (line 1949)";
1976 static const char __pyx_k_setstate_cython[] =
"__setstate_cython__";
1977 static const char __pyx_k_compare_line_492[] =
"compare (line 492)";
1978 static const char __pyx_k_index_set___iter[] =
"index_set.__iter__";
1979 static const char __pyx_k_max_pos_line_513[] =
"max_pos (line 513)";
1980 static const char __pyx_k_min_neg_line_504[] =
"min_neg (line 504)";
1981 static const char __pyx_k_scalar_line_1393[] =
"scalar (line 1393)";
1982 static const char __pyx_k_cga3std_line_1882[] =
"cga3std (line 1882)";
1983 static const char __pyx_k_max_abs_line_1531[] =
"max_abs (line 1531)";
1984 static const char __pyx_k_reverse_line_1470[] =
"reverse (line 1470)";
1985 static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
1986 static const char __pyx_k_involute_line_1455[] =
"involute (line 1455)";
1987 static const char __pyx_k_outer_pow_line_1567[] =
"outer_pow (line 1567)";
1988 static const char __pyx_k_clifford_inv_line_926[] =
"clifford.inv (line 926)";
1989 static const char __pyx_k_clifford_pow_line_980[] =
"clifford.pow (line 980)";
1990 static const char __pyx_k_approx_equal_line_1359[] =
"approx_equal (line 1359)";
1991 static const char __pyx_k_clifford_abs_line_1175[] =
"clifford.abs (line 1175)";
1992 static const char __pyx_k_clifford_copy_line_556[] =
"clifford.copy (line 556)";
1993 static const char __pyx_k_clifford_odd_line_1070[] =
"clifford.odd (line 1070)";
1994 static const char __pyx_k_complexifier_line_1576[] =
"complexifier (line 1576)";
1995 static const char __pyx_k_index_set_copy_line_65[] =
"index_set.copy (line 65)";
1996 static const char __pyx_k_index_set_max_line_351[] =
"index_set.max (line 351)";
1997 static const char __pyx_k_index_set_min_line_342[] =
"index_set.min (line 342)";
1998 static const char __pyx_k_clifford_conj_line_1138[] =
"clifford.conj (line 1138)";
1999 static const char __pyx_k_clifford_even_line_1061[] =
"clifford.even (line 1061)";
2000 static const char __pyx_k_clifford_norm_line_1164[] =
"clifford.norm (line 1164)";
2001 static const char __pyx_k_clifford_pure_line_1050[] =
"clifford.pure (line 1050)";
2002 static const char __pyx_k_clifford_quad_line_1153[] =
"clifford.quad (line 1153)";
2003 static const char __pyx_k_error_squared_line_1346[] =
"error_squared (line 1346)";
2004 static const char __pyx_k_Unary_print_clifford_1_1[] =
"\n Unary -.\n\n >>> print(-clifford(\"{1}\"))\n -{1}\n ";
2005 static const char __pyx_k_clifford___or___line_939[] =
"clifford.__or__ (line 939)";
2006 static const char __pyx_k_clifford_frame_line_1224[] =
"clifford.frame (line 1224)";
2007 static const char __pyx_k_clifford_hidden_doctests[] =
"clifford_hidden_doctests";
2008 static const char __pyx_k_clifford_isinf_line_1206[] =
"clifford.isinf (line 1206)";
2009 static const char __pyx_k_clifford_isnan_line_1215[] =
"clifford.isnan (line 1215)";
2010 static const char __pyx_k_index_set_count_line_315[] =
"index_set.count (line 315)";
2011 static const char __pyx_k_clifford___add___line_740[] =
"clifford.__add__ (line 740)";
2012 static const char __pyx_k_clifford___and___line_836[] =
"clifford.__and__ (line 836)";
2013 static const char __pyx_k_clifford___ior___line_950[] =
"clifford.__ior__ (line 950)";
2014 static const char __pyx_k_clifford___mod___line_806[] =
"clifford.__mod__ (line 806)";
2015 static const char __pyx_k_clifford___mul___line_780[] =
"clifford.__mul__ (line 780)";
2016 static const char __pyx_k_clifford___neg___line_722[] =
"clifford.__neg__ (line 722)";
2017 static const char __pyx_k_clifford___pos___line_731[] =
"clifford.__pos__ (line 731)";
2018 static const char __pyx_k_clifford___pow___line_961[] =
"clifford.__pow__ (line 961)";
2019 static const char __pyx_k_clifford___sub___line_760[] =
"clifford.__sub__ (line 760)";
2020 static const char __pyx_k_clifford___xor___line_866[] =
"clifford.__xor__ (line 866)";
2021 static const char __pyx_k_clifford_reframe_line_649[] =
"clifford.reframe (line 649)";
2022 static const char __pyx_k_clifford_scalar_line_1039[] =
"clifford.scalar (line 1039)";
2023 static const char __pyx_k_index_set___or___line_293[] =
"index_set.__or__ (line 293)";
2024 static const char __pyx_k_index_set_hidden_doctests[] =
"index_set_hidden_doctests";
2025 static const char __pyx_k_random_clifford_line_1864[] =
"random_clifford (line 1864)";
2026 static const char __pyx_k_Cannot_take_vector_part_of[] =
"Cannot take vector part of ";
2027 static const char __pyx_k_Unary_print_clifford_1_1_2[] =
"\n Unary +.\n\n >>> print(+clifford(\"{1}\"))\n {1}\n ";
2028 static const char __pyx_k_clifford___iadd___line_751[] =
"clifford.__iadd__ (line 751)";
2029 static const char __pyx_k_clifford___iand___line_851[] =
"clifford.__iand__ (line 851)";
2030 static const char __pyx_k_clifford___idiv___line_911[] =
"clifford.__idiv__ (line 911)";
2031 static const char __pyx_k_clifford___imod___line_821[] =
"clifford.__imod__ (line 821)";
2032 static const char __pyx_k_clifford___imul___line_793[] =
"clifford.__imul__ (line 793)";
2033 static const char __pyx_k_clifford___isub___line_771[] =
"clifford.__isub__ (line 771)";
2034 static const char __pyx_k_clifford___iter___line_638[] =
"clifford.__iter__ (line 638)";
2035 static const char __pyx_k_clifford___ixor___line_881[] =
"clifford.__ixor__ (line 881)";
2036 static const char __pyx_k_clifford___str___line_1244[] =
"clifford.__str__ (line 1244)";
2037 static const char __pyx_k_clifford_max_abs_line_1184[] =
"clifford.max_abs (line 1184)";
2038 static const char __pyx_k_clifford_reverse_line_1123[] =
"clifford.reverse (line 1123)";
2039 static const char __pyx_k_index_set___and___line_271[] =
"index_set.__and__ (line 271)";
2040 static const char __pyx_k_index_set___ior___line_304[] =
"index_set.__ior__ (line 304)";
2041 static const char __pyx_k_index_set___str___line_395[] =
"index_set.__str__ (line 395)";
2042 static const char __pyx_k_index_set___xor___line_249[] =
"index_set.__xor__ (line 249)";
2043 static const char __pyx_k_clifford___call___line_1020[] =
"clifford.__call__ (line 1020)";
2044 static const char __pyx_k_clifford___repr___line_1235[] =
"clifford.__repr__ (line 1235)";
2045 static const char __pyx_k_clifford_involute_line_1107[] =
"clifford.involute (line 1107)";
2046 static const char __pyx_k_error_squared_tol_line_1337[] =
"error_squared_tol (line 1337)";
2047 static const char __pyx_k_index_set___iand___line_282[] =
"index_set.__iand__ (line 282)";
2048 static const char __pyx_k_index_set___iter___line_229[] =
"index_set.__iter__ (line 229)";
2049 static const char __pyx_k_index_set___ixor___line_260[] =
"index_set.__ixor__ (line 260)";
2050 static const char __pyx_k_index_set___repr___line_384[] =
"index_set.__repr__ (line 384)";
2051 static const char __pyx_k_clifford_outer_pow_line_1004[] =
"clifford.outer_pow (line 1004)";
2052 static const char __pyx_k_clifford_truncated_line_1195[] =
"clifford.truncated (line 1195)";
2053 static const char __pyx_k_index_set_count_neg_line_324[] =
"index_set.count_neg (line 324)";
2054 static const char __pyx_k_index_set_count_pos_line_333[] =
"index_set.count_pos (line 333)";
2055 static const char __pyx_k_clifford___getitem___line_707[] =
"clifford.__getitem__ (line 707)";
2056 static const char __pyx_k_clifford___truediv___line_896[] =
"clifford.__truediv__ (line 896)";
2057 static const char __pyx_k_index_set___invert___line_240[] =
"index_set.__invert__ (line 240)";
2058 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 ";
2059 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 ";
2060 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 ";
2061 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 ";
2062 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 ";
2063 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 ";
2064 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 ";
2065 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, end=\",\")\n -3,4,7,\n ";
2066 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 ";
2067 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 ";
2068 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 ";
2069 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 ";
2070 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 ";
2071 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 ";
2072 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 ";
2073 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 ";
2074 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 ";
2075 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 ";
2076 static const char __pyx_k_Quadratic_norm_error_tolerance[] =
"\n Quadratic norm error tolerance relative to a specific multivector.\n\n >>> print(error_squared_tol(clifford(\"{1}\")) * 3.0 - error_squared_tol(clifford(\"1{1}-2{2}+3{3}\")))\n 0.0\n ";
2077 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 ";
2078 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 ";
2079 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 ";
2080 static const char __pyx_k_clifford_vector_part_line_1079[] =
"clifford.vector_part (line 1079)";
2081 static const char __pyx_k_index_set___getitem___line_191[] =
"index_set.__getitem__ (line 191)";
2082 static const char __pyx_k_index_set___setitem___line_179[] =
"index_set.__setitem__ (line 179)";
2083 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 ";
2084 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 ";
2085 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 ";
2086 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 ";
2087 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 ";
2088 static const char __pyx_k_Check_if_a_multivector_contains[] =
"\n Check if a multivector contains any infinite values.\n\n >>> clifford().isinf()\n False\n ";
2089 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 ";
2090 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 ";
2091 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 ";
2092 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 ";
2093 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 ";
2094 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 ";
2095 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 ";
2096 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 ";
2097 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 ";
2098 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 ";
2099 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 ";
2100 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 ";
2101 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 ";
2102 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 ";
2103 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 ";
2104 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 ";
2105 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 ";
2106 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 ";
2107 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 ";
2108 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 ";
2109 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 ";
2110 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 ";
2111 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 ";
2112 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 ";
2113 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 ";
2114 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 ";
2115 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 ";
2116 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 ";
2117 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 ";
2118 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 ";
2119 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 ";
2120 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 ";
2121 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 ";
2122 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, end=\",\")\n Traceback (most recent call last):\n ...\n TypeError: Not applicable.\n ";
2123 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 ";
2124 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 ";
2125 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 ";
2126 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 ";
2127 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 ";
2128 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 ";
2129 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 ";
2130 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 ";
2131 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 ";
2132 static const char __pyx_k_Relative_or_absolute_error_usin[] =
"\n Relative or absolute error using the quadratic norm.\n\n >>> err2=scalar_epsilon*scalar_epsilon\n\n >>> print(error_squared(clifford(\"{1}\"), clifford(\"1{1}\"), err2))\n 0.0\n >>> print(error_squared(clifford(\"1{1}-3{2}+4{3}\"), clifford(\"{1}\"), err2))\n 25.0\n ";
2133 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 ";
2134 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 ";
2135 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 ";
2136 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 ";
2137 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 ";
2138 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 ";
2139 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 ";
2140 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 ";
2141 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 ";
2142 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 ";
2143 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 ";
2144 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 ";
2145 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 ";
2146 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 ";
2147 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 <class 'PyClical.index_set'>\n ";
2148 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 ";
2149 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 ";
2150 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 ";
2151 static const char __pyx_k_Test_for_approximate_equality_o[] =
"\n Test for approximate equality of multivectors.\n\n >>> err2=scalar_epsilon*scalar_epsilon\n\n >>> print(approx_equal(clifford(\"{1}\"), clifford(\"1{1}\")))\n True\n >>> print(approx_equal(clifford(\"1{1}-3{2}+4{3}\"), clifford(\"{1}\")))\n False\n >>> print(approx_equal(clifford(\"1{1}-3{2}+4{3}+0.001\"), clifford(\"1{1}-3{2}+4{3}\"), err2, err2))\n False\n >>> print(approx_equal(clifford(\"1{1}-3{2}+4{3}+1.0e-30\"), clifford(\"1{1}-3{2}+4{3}\"), err2, err2))\n True\n ";
2152 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 {1, 2, 100}.\n >>> print(index_set([1,2]))\n Traceback (most recent call last):\n ...\n TypeError: Cannot initialize index_set object from <class '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_set({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 ";
2153 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 ";
2154 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 ";
2155 static const char __pyx_k_This_comparison_operator_is_not[] =
"This comparison operator is not implemented for ";
2156 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 ";
2157 static const char __pyx_k_index_set_sign_of_mult_line_366[] =
"index_set.sign_of_mult (line 366)";
2158 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 ";
2159 static const char __pyx_k_Cannot_initialize_clifford_objec[] =
"Cannot initialize clifford object from";
2160 static const char __pyx_k_Cannot_initialize_index_set_obje[] =
"Cannot initialize index_set object from";
2161 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 ";
2162 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 ";
2163 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 ";
2164 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 ";
2165 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 ";
2166 static const char __pyx_k_clifford_hidden_doctests_line_12[] =
"clifford_hidden_doctests (line 1253)";
2167 static const char __pyx_k_index_set_hidden_doctests_line_4[] =
"index_set_hidden_doctests (line 406)";
2168 static const char __pyx_k_index_set_sign_of_square_line_37[] =
"index_set.sign_of_square (line 375)";
2169 static const char __pyx_k_no_default___reduce___due_to_non[] =
"no default __reduce__ due to non-trivial __cinit__";
2170 static const char __pyx_k_Check_if_a_multivector_contains_2[] =
"\n Check if a multivector contains any IEEE NaN values.\n\n >>> clifford().isnan()\n False\n ";
2171 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 ";
2172 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 ";
2173 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 ";
2174 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 ";
2175 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(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 <class 'list'>.\n >>> print(clifford(None))\n Traceback (most recent call last):\n ...\n TypeError: Cannot initialize clifford object from <class 'NoneType'>.\n >>> print(clifford(None,[1,2]))\n Traceback (most recent call last):\n ...\n TypeError: Cannot initialize clifford object from (<class 'NoneType'>, <class 'list'>).\n >>> print(clifford([1,2],[1,2]))\n Traceback (most recent call last):\n ...\n TypeError: Cannot initialize clifford object from (<class 'list'>, <class '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 fro""m 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 ";
2176 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 ";
2177 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 ";
2178 static PyObject *__pyx_kp_u_;
2179 static PyObject *__pyx_kp_u_Abbreviation_for_clifford_index;
2180 static PyObject *__pyx_kp_u_Abbreviation_for_index_set_q_p;
2181 static PyObject *__pyx_kp_u_Absolute_value_of_multivector_m;
2182 static PyObject *__pyx_kp_u_Absolute_value_square_root_of_n;
2183 static PyObject *__pyx_kp_u_Cannot_initialize_clifford_objec;
2184 static PyObject *__pyx_kp_u_Cannot_initialize_index_set_obje;
2185 static PyObject *__pyx_kp_u_Cannot_reframe;
2186 static PyObject *__pyx_kp_u_Cannot_take_vector_part_of;
2187 static PyObject *__pyx_kp_u_Cardinality_Number_of_indices_i;
2188 static PyObject *__pyx_kp_u_Check_if_a_multivector_contains;
2189 static PyObject *__pyx_kp_u_Check_if_a_multivector_contains_2;
2190 static PyObject *__pyx_kp_u_Conjugation_reverse_o_involute;
2191 static PyObject *__pyx_kp_u_Conjugation_reverse_o_involute_2;
2192 static PyObject *__pyx_kp_u_Contraction_print_clifford_1_cl;
2193 static PyObject *__pyx_kp_u_Contraction_x_clifford_1_x_clif;
2194 static PyObject *__pyx_kp_u_Convert_CGA3_null_vector_to_Euc;
2195 static PyObject *__pyx_kp_u_Convert_CGA3_null_vector_to_sta;
2196 static PyObject *__pyx_kp_u_Convert_Euclidean_3D_multivecto;
2197 static PyObject *__pyx_kp_u_Copy_this_clifford_object_x_cli;
2198 static PyObject *__pyx_kp_u_Copy_this_index_set_object_s_in;
2199 static PyObject *__pyx_kp_u_Cosine_of_multivector_with_opti;
2200 static PyObject *__pyx_kp_u_Even_part_of_multivector_sum_of;
2201 static PyObject *__pyx_kp_u_Even_part_of_multivector_sum_of_2;
2202 static PyObject *__pyx_kp_u_Exponential_of_multivector_x_cl;
2203 static PyObject *__pyx_kp_u_Geometric_difference_print_clif;
2204 static PyObject *__pyx_kp_u_Geometric_difference_x_clifford;
2205 static PyObject *__pyx_kp_u_Geometric_multiplicative_invers;
2206 static PyObject *__pyx_kp_u_Geometric_multiplicative_invers_2;
2207 static PyObject *__pyx_kp_u_Geometric_product_print_cliffor;
2208 static PyObject *__pyx_kp_u_Geometric_product_x_clifford_2;
2209 static PyObject *__pyx_kp_u_Geometric_quotient_print_cliffo;
2210 static PyObject *__pyx_kp_u_Geometric_quotient_x_clifford_1;
2211 static PyObject *__pyx_kp_u_Geometric_sum_print_clifford_1;
2212 static PyObject *__pyx_kp_u_Geometric_sum_x_clifford_1_x_cl;
2213 static PyObject *__pyx_kp_u_Get_the_value_of_an_index_set_o;
2214 static PyObject *__pyx_kp_u_Hyperbolic_cosine_of_multivecto;
2215 static PyObject *__pyx_kp_u_Hyperbolic_sine_of_multivector;
2216 static PyObject *__pyx_kp_u_Hyperbolic_tangent_of_multivect;
2217 static PyObject *__pyx_kp_u_Imaginary_part_deprecated_alway;
2218 static PyObject *__pyx_n_s_IndexError;
2219 static PyObject *__pyx_kp_u_Inner_product_print_clifford_1;
2220 static PyObject *__pyx_kp_u_Inner_product_x_clifford_1_x_cl;
2221 static PyObject *__pyx_kp_u_Integer_power_of_multivector_ob;
2222 static PyObject *__pyx_n_s_Integral;
2223 static PyObject *__pyx_kp_u_Inverse_cosine_of_multivector_w;
2224 static PyObject *__pyx_kp_u_Inverse_hyperbolic_cosine_of_mu;
2225 static PyObject *__pyx_kp_u_Inverse_hyperbolic_sine_of_mult;
2226 static PyObject *__pyx_kp_u_Inverse_hyperbolic_tangent_of_m;
2227 static PyObject *__pyx_kp_u_Inverse_sine_of_multivector_wit;
2228 static PyObject *__pyx_kp_u_Inverse_tangent_of_multivector;
2229 static PyObject *__pyx_kp_u_Iterate_over_the_indices_of_an;
2230 static PyObject *__pyx_kp_u_Main_involution_each_i_is_repla;
2231 static PyObject *__pyx_kp_u_Main_involution_each_i_is_repla_2;
2232 static PyObject *__pyx_kp_u_Maximum_absolute_value_of_coord;
2233 static PyObject *__pyx_kp_u_Maximum_member_index_set_1_1_2;
2234 static PyObject *__pyx_kp_u_Maximum_of_absolute_values_of_c;
2235 static PyObject *__pyx_kp_u_Maximum_positive_index_or_0_if;
2236 static PyObject *__pyx_kp_u_Minimum_member_index_set_1_1_2;
2237 static PyObject *__pyx_kp_u_Minimum_negative_index_or_0_if;
2238 static PyObject *__pyx_kp_u_Natural_logarithm_of_multivecto;
2239 static PyObject *__pyx_kp_u_Norm_sum_of_squares_of_coordina;
2240 static PyObject *__pyx_n_s_NotImplemented;
2241 static PyObject *__pyx_kp_u_Not_applicable;
2242 static PyObject *__pyx_kp_u_Not_applicable_for_a_in_cliffor;
2243 static PyObject *__pyx_kp_u_Number_of_negative_indices_incl;
2244 static PyObject *__pyx_kp_u_Number_of_positive_indices_incl;
2245 static PyObject *__pyx_kp_u_Odd_part_of_multivector_sum_of;
2246 static PyObject *__pyx_kp_u_Odd_part_of_multivector_sum_of_2;
2247 static PyObject *__pyx_kp_u_Outer_product_power_of_multivec;
2248 static PyObject *__pyx_kp_u_Outer_product_power_x_clifford;
2249 static PyObject *__pyx_kp_u_Outer_product_print_clifford_1;
2250 static PyObject *__pyx_kp_u_Outer_product_x_clifford_1_x_cl;
2251 static PyObject *__pyx_kp_u_Power_self_to_the_m_x_clifford;
2252 static PyObject *__pyx_kp_u_Power_self_to_the_m_x_clifford_2;
2253 static PyObject *__pyx_kp_u_Pure_grade_vector_part_print_cl;
2254 static PyObject *__pyx_kp_u_Pure_part_print_clifford_1_1_1;
2255 static PyObject *__pyx_kp_u_Pure_part_print_pure_clifford_1;
2256 static PyObject *__pyx_kp_u_Put_self_into_a_larger_frame_co;
2257 static PyObject *__pyx_n_s_PyClical;
2258 static PyObject *__pyx_kp_s_PyClical_pyx;
2259 static PyObject *__pyx_kp_u_Quadratic_form_rev_x_x_0_print;
2260 static PyObject *__pyx_kp_u_Quadratic_form_rev_x_x_0_print_2;
2261 static PyObject *__pyx_kp_u_Quadratic_norm_error_tolerance;
2262 static PyObject *__pyx_kp_u_Random_multivector_within_a_fra;
2263 static PyObject *__pyx_n_s_Real;
2264 static PyObject *__pyx_kp_u_Real_part_synonym_for_scalar_pa;
2265 static PyObject *__pyx_kp_u_Relative_or_absolute_error_usin;
2266 static PyObject *__pyx_kp_u_Remove_all_terms_of_self_with_r;
2267 static PyObject *__pyx_kp_u_Reversion_eg_1_2_2_1_print_reve;
2268 static PyObject *__pyx_kp_u_Reversion_eg_clifford_1_cliffor;
2269 static PyObject *__pyx_n_s_RuntimeError;
2270 static PyObject *__pyx_kp_u_Scalar_part_clifford_1_1_1_2_sc;
2271 static PyObject *__pyx_kp_u_Scalar_part_scalar_clifford_1_1;
2272 static PyObject *__pyx_n_s_Sequence;
2273 static PyObject *__pyx_kp_u_Set_complement_not_print_index;
2274 static PyObject *__pyx_kp_u_Set_intersection_and_print_inde;
2275 static PyObject *__pyx_kp_u_Set_intersection_and_x_index_se;
2276 static PyObject *__pyx_kp_u_Set_the_value_of_an_index_set_o;
2277 static PyObject *__pyx_kp_u_Set_union_or_print_index_set_1;
2278 static PyObject *__pyx_kp_u_Set_union_or_x_index_set_1_x_in;
2279 static PyObject *__pyx_kp_u_Sign_of_geometric_product_of_tw;
2280 static PyObject *__pyx_kp_u_Sign_of_geometric_square_of_a_C;
2281 static PyObject *__pyx_kp_u_Sine_of_multivector_with_option;
2282 static PyObject *__pyx_kp_u_Square_root_of_1_which_commutes;
2283 static PyObject *__pyx_kp_u_Square_root_of_multivector_with;
2284 static PyObject *__pyx_kp_u_Subalgebra_generated_by_all_gen;
2285 static PyObject *__pyx_kp_u_Subscripting_map_from_index_set;
2286 static PyObject *__pyx_kp_u_Symmetric_set_difference_exclus;
2287 static PyObject *__pyx_kp_u_Symmetric_set_difference_exclus_2;
2288 static PyObject *__pyx_kp_u_Tangent_of_multivector_with_opt;
2289 static PyObject *__pyx_kp_u_Test_for_approximate_equality_o;
2290 static PyObject *__pyx_kp_u_Tests_for_functions_that_Doctes;
2291 static PyObject *__pyx_kp_u_Tests_for_functions_that_Doctes_2;
2292 static PyObject *__pyx_kp_u_The_informal_string_representat;
2293 static PyObject *__pyx_kp_u_The_informal_string_representat_2;
2294 static PyObject *__pyx_kp_u_The_official_string_representat;
2295 static PyObject *__pyx_kp_u_The_official_string_representat_2;
2296 static PyObject *__pyx_kp_u_This_comparison_operator_is_not;
2297 static PyObject *__pyx_kp_u_Transform_left_hand_side_using;
2298 static PyObject *__pyx_kp_u_Transform_left_hand_side_using_2;
2299 static PyObject *__pyx_n_s_TypeError;
2300 static PyObject *__pyx_kp_u_UTF_8;
2301 static PyObject *__pyx_kp_u_Unary_print_clifford_1_1;
2302 static PyObject *__pyx_kp_u_Unary_print_clifford_1_1_2;
2303 static PyObject *__pyx_n_s_ValueError;
2304 static PyObject *__pyx_kp_u_Vector_part_of_multivector_as_a;
2305 static PyObject *__pyx_kp_u__2;
2306 static PyObject *__pyx_kp_u__5;
2307 static PyObject *__pyx_kp_u__6;
2308 static PyObject *__pyx_kp_u__7;
2309 static PyObject *__pyx_kp_u__8;
2310 static PyObject *__pyx_kp_u__9;
2311 static PyObject *__pyx_n_s_abc;
2312 static PyObject *__pyx_kp_u_abs_line_1522;
2313 static PyObject *__pyx_n_s_acos;
2314 static PyObject *__pyx_kp_u_acos_line_1668;
2315 static PyObject *__pyx_n_s_acosh;
2316 static PyObject *__pyx_kp_u_acosh_line_1705;
2317 static PyObject *__pyx_kp_u_agc3_line_1893;
2318 static PyObject *__pyx_kp_u_approx_equal_line_1359;
2319 static PyObject *__pyx_n_s_args;
2320 static PyObject *__pyx_kp_u_as_frame;
2321 static PyObject *__pyx_n_s_asin;
2322 static PyObject *__pyx_kp_u_asin_line_1747;
2323 static PyObject *__pyx_n_s_asinh;
2324 static PyObject *__pyx_kp_u_asinh_line_1782;
2325 static PyObject *__pyx_n_s_atan;
2326 static PyObject *__pyx_kp_u_atan_line_1818;
2327 static PyObject *__pyx_n_s_atanh;
2328 static PyObject *__pyx_kp_u_atanh_line_1847;
2329 static PyObject *__pyx_kp_u_cga3_line_1873;
2330 static PyObject *__pyx_kp_u_cga3std_line_1882;
2331 static PyObject *__pyx_n_s_cl;
2332 static PyObject *__pyx_n_s_clifford;
2333 static PyObject *__pyx_kp_u_clifford___add___line_740;
2334 static PyObject *__pyx_kp_u_clifford___and___line_836;
2335 static PyObject *__pyx_kp_u_clifford___call___line_1020;
2336 static PyObject *__pyx_kp_u_clifford___getitem___line_707;
2337 static PyObject *__pyx_kp_u_clifford___iadd___line_751;
2338 static PyObject *__pyx_kp_u_clifford___iand___line_851;
2339 static PyObject *__pyx_kp_u_clifford___idiv___line_911;
2340 static PyObject *__pyx_kp_u_clifford___imod___line_821;
2341 static PyObject *__pyx_kp_u_clifford___imul___line_793;
2342 static PyObject *__pyx_kp_u_clifford___ior___line_950;
2343 static PyObject *__pyx_kp_u_clifford___isub___line_771;
2344 static PyObject *__pyx_kp_u_clifford___iter___line_638;
2345 static PyObject *__pyx_kp_u_clifford___ixor___line_881;
2346 static PyObject *__pyx_kp_u_clifford___mod___line_806;
2347 static PyObject *__pyx_kp_u_clifford___mul___line_780;
2348 static PyObject *__pyx_kp_u_clifford___neg___line_722;
2349 static PyObject *__pyx_kp_u_clifford___or___line_939;
2350 static PyObject *__pyx_kp_u_clifford___pos___line_731;
2351 static PyObject *__pyx_kp_u_clifford___pow___line_961;
2352 static PyObject *__pyx_kp_u_clifford___repr___line_1235;
2353 static PyObject *__pyx_kp_u_clifford___str___line_1244;
2354 static PyObject *__pyx_kp_u_clifford___sub___line_760;
2355 static PyObject *__pyx_kp_u_clifford___truediv___line_896;
2356 static PyObject *__pyx_kp_u_clifford___xor___line_866;
2357 static PyObject *__pyx_kp_u_clifford_abs_line_1175;
2358 static PyObject *__pyx_kp_u_clifford_conj_line_1138;
2359 static PyObject *__pyx_kp_u_clifford_copy_line_556;
2360 static PyObject *__pyx_kp_u_clifford_even_line_1061;
2361 static PyObject *__pyx_kp_u_clifford_frame_line_1224;
2362 static PyObject *__pyx_n_s_clifford_hidden_doctests;
2363 static PyObject *__pyx_kp_u_clifford_hidden_doctests_line_12;
2364 static PyObject *__pyx_kp_u_clifford_inv_line_926;
2365 static PyObject *__pyx_kp_u_clifford_involute_line_1107;
2366 static PyObject *__pyx_kp_u_clifford_isinf_line_1206;
2367 static PyObject *__pyx_kp_u_clifford_isnan_line_1215;
2368 static PyObject *__pyx_kp_u_clifford_max_abs_line_1184;
2369 static PyObject *__pyx_kp_u_clifford_norm_line_1164;
2370 static PyObject *__pyx_kp_u_clifford_odd_line_1070;
2371 static PyObject *__pyx_kp_u_clifford_outer_pow_line_1004;
2372 static PyObject *__pyx_kp_u_clifford_pow_line_980;
2373 static PyObject *__pyx_kp_u_clifford_pure_line_1050;
2374 static PyObject *__pyx_kp_u_clifford_quad_line_1153;
2375 static PyObject *__pyx_kp_u_clifford_reframe_line_649;
2376 static PyObject *__pyx_kp_u_clifford_reverse_line_1123;
2377 static PyObject *__pyx_kp_u_clifford_scalar_line_1039;
2378 static PyObject *__pyx_kp_u_clifford_truncated_line_1195;
2379 static PyObject *__pyx_kp_u_clifford_vector_part_line_1079;
2380 static PyObject *__pyx_n_s_cline_in_traceback;
2381 static PyObject *__pyx_n_s_close;
2382 static PyObject *__pyx_n_s_collections;
2383 static PyObject *__pyx_kp_u_compare_line_492;
2384 static PyObject *__pyx_kp_u_complexifier_line_1576;
2385 static PyObject *__pyx_n_s_conj;
2386 static PyObject *__pyx_kp_u_conj_line_1485;
2387 static PyObject *__pyx_n_s_copy;
2388 static PyObject *__pyx_n_s_cos;
2389 static PyObject *__pyx_kp_u_cos_line_1651;
2390 static PyObject *__pyx_n_s_cosh;
2391 static PyObject *__pyx_kp_u_cosh_line_1689;
2392 static PyObject *__pyx_n_s_doctest;
2393 static PyObject *__pyx_n_s_e;
2394 static PyObject *__pyx_kp_u_e_line_1936;
2395 static PyObject *__pyx_n_s_encode;
2396 static PyObject *__pyx_kp_u_error_squared_line_1346;
2397 static PyObject *__pyx_kp_u_error_squared_tol_line_1337;
2398 static PyObject *__pyx_n_s_even;
2399 static PyObject *__pyx_kp_u_even_line_1437;
2400 static PyObject *__pyx_n_s_exp;
2401 static PyObject *__pyx_kp_u_exp_line_1614;
2402 static PyObject *__pyx_n_s_fill;
2403 static PyObject *__pyx_n_s_frm;
2404 static PyObject *__pyx_kp_u_from;
2405 static PyObject *__pyx_n_s_getstate;
2406 static PyObject *__pyx_n_s_grade;
2407 static PyObject *__pyx_n_s_i;
2408 static PyObject *__pyx_kp_u_imag_line_1415;
2409 static PyObject *__pyx_n_s_import;
2410 static PyObject *__pyx_n_s_index_set;
2411 static PyObject *__pyx_kp_u_index_set___and___line_271;
2412 static PyObject *__pyx_kp_u_index_set___getitem___line_191;
2413 static PyObject *__pyx_kp_u_index_set___iand___line_282;
2414 static PyObject *__pyx_kp_u_index_set___invert___line_240;
2415 static PyObject *__pyx_kp_u_index_set___ior___line_304;
2416 static PyObject *__pyx_n_s_index_set___iter;
2417 static PyObject *__pyx_kp_u_index_set___iter___line_229;
2418 static PyObject *__pyx_kp_u_index_set___ixor___line_260;
2419 static PyObject *__pyx_kp_u_index_set___or___line_293;
2420 static PyObject *__pyx_kp_u_index_set___repr___line_384;
2421 static PyObject *__pyx_kp_u_index_set___setitem___line_179;
2422 static PyObject *__pyx_kp_u_index_set___str___line_395;
2423 static PyObject *__pyx_kp_u_index_set___xor___line_249;
2424 static PyObject *__pyx_kp_u_index_set_copy_line_65;
2425 static PyObject *__pyx_kp_u_index_set_count_line_315;
2426 static PyObject *__pyx_kp_u_index_set_count_neg_line_324;
2427 static PyObject *__pyx_kp_u_index_set_count_pos_line_333;
2428 static PyObject *__pyx_n_s_index_set_hidden_doctests;
2429 static PyObject *__pyx_kp_u_index_set_hidden_doctests_line_4;
2430 static PyObject *__pyx_kp_u_index_set_max_line_351;
2431 static PyObject *__pyx_kp_u_index_set_min_line_342;
2432 static PyObject *__pyx_kp_u_index_set_sign_of_mult_line_366;
2433 static PyObject *__pyx_kp_u_index_set_sign_of_square_line_37;
2434 static PyObject *__pyx_n_s_inv;
2435 static PyObject *__pyx_kp_u_inv_line_1378;
2436 static PyObject *__pyx_kp_u_invalid;
2437 static PyObject *__pyx_kp_u_invalid_string;
2438 static PyObject *__pyx_n_s_involute;
2439 static PyObject *__pyx_kp_u_involute_line_1455;
2440 static PyObject *__pyx_n_s_ist;
2441 static PyObject *__pyx_n_s_istpq;
2442 static PyObject *__pyx_kp_u_istpq_line_1949;
2443 static PyObject *__pyx_n_s_iter;
2444 static PyObject *__pyx_n_s_ixt;
2445 static PyObject *__pyx_kp_u_lexicographic_compare_eg_3_4_5;
2446 static PyObject *__pyx_n_s_lhs;
2447 static PyObject *__pyx_n_s_log;
2448 static PyObject *__pyx_kp_u_log_line_1628;
2449 static PyObject *__pyx_n_s_m;
2450 static PyObject *__pyx_n_s_main;
2451 static PyObject *__pyx_n_u_main;
2452 static PyObject *__pyx_n_s_math;
2453 static PyObject *__pyx_n_s_max;
2454 static PyObject *__pyx_kp_u_max_abs_line_1531;
2455 static PyObject *__pyx_kp_u_max_pos_line_513;
2456 static PyObject *__pyx_n_s_min;
2457 static PyObject *__pyx_kp_u_min_neg_line_504;
2458 static PyObject *__pyx_n_s_name;
2459 static PyObject *__pyx_n_s_nbar3;
2460 static PyObject *__pyx_n_s_ninf3;
2461 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2462 static PyObject *__pyx_n_s_norm;
2463 static PyObject *__pyx_kp_u_norm_line_1511;
2464 static PyObject *__pyx_kp_u_norm_sum_of_squares_of_coordina;
2465 static PyObject *__pyx_n_s_numbers;
2466 static PyObject *__pyx_n_s_obj;
2467 static PyObject *__pyx_n_s_odd;
2468 static PyObject *__pyx_kp_u_odd_line_1446;
2469 static PyObject *__pyx_n_s_other;
2470 static PyObject *__pyx_n_s_outer_pow;
2471 static PyObject *__pyx_kp_u_outer_pow_line_1567;
2472 static PyObject *__pyx_n_s_p;
2473 static PyObject *__pyx_n_s_pi;
2474 static PyObject *__pyx_n_s_pow;
2475 static PyObject *__pyx_kp_u_pow_line_1543;
2476 static PyObject *__pyx_n_s_pure;
2477 static PyObject *__pyx_kp_u_pure_line_1426;
2478 static PyObject *__pyx_n_s_pyx_vtable;
2479 static PyObject *__pyx_n_s_q;
2480 static PyObject *__pyx_n_s_quad;
2481 static PyObject *__pyx_kp_u_quad_line_1500;
2482 static PyObject *__pyx_kp_u_random_clifford_line_1864;
2483 static PyObject *__pyx_n_s_range;
2484 static PyObject *__pyx_kp_u_real_line_1404;
2485 static PyObject *__pyx_n_s_reduce;
2486 static PyObject *__pyx_n_s_reduce_cython;
2487 static PyObject *__pyx_n_s_reduce_ex;
2488 static PyObject *__pyx_n_s_reverse;
2489 static PyObject *__pyx_kp_u_reverse_line_1470;
2490 static PyObject *__pyx_n_s_rhs;
2491 static PyObject *__pyx_n_s_scalar;
2492 static PyObject *__pyx_n_s_scalar_epsilon;
2493 static PyObject *__pyx_kp_u_scalar_line_1393;
2494 static PyObject *__pyx_n_s_send;
2495 static PyObject *__pyx_n_s_setstate;
2496 static PyObject *__pyx_n_s_setstate_cython;
2497 static PyObject *__pyx_n_s_sin;
2498 static PyObject *__pyx_kp_u_sin_line_1728;
2499 static PyObject *__pyx_n_s_sinh;
2500 static PyObject *__pyx_kp_u_sinh_line_1768;
2501 static PyObject *__pyx_n_s_sqrt;
2502 static PyObject *__pyx_kp_u_sqrt_line_1591;
2503 static PyObject *__pyx_n_s_tan;
2504 static PyObject *__pyx_kp_u_tan_line_1801;
2505 static PyObject *__pyx_n_s_tanh;
2506 static PyObject *__pyx_kp_u_tanh_line_1835;
2507 static PyObject *__pyx_n_s_tau;
2508 static PyObject *__pyx_n_s_test;
2509 static PyObject *__pyx_n_s_test_2;
2510 static PyObject *__pyx_n_s_testmod;
2511 static PyObject *__pyx_n_s_threshold;
2512 static PyObject *__pyx_n_s_throw;
2513 static PyObject *__pyx_kp_u_to_frame;
2514 static PyObject *__pyx_n_s_tol;
2515 static PyObject *__pyx_kp_u_using;
2516 static PyObject *__pyx_kp_u_using_invalid;
2517 static PyObject *__pyx_kp_u_utf_8;
2518 static PyObject *__pyx_kp_u_value;
2519 static PyObject *__pyx_n_s_version;
2520 static PyObject *__pyx_n_s_xrange;
2521 static PyObject *__pyx_pf_8PyClical_9index_set_copy(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2522 static int __pyx_pf_8PyClical_9index_set_2__cinit__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_other);
2523 static void __pyx_pf_8PyClical_9index_set_4__dealloc__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2524 static PyObject *__pyx_pf_8PyClical_9index_set_6__richcmp__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op);
2525 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);
2526 static PyObject *__pyx_pf_8PyClical_9index_set_10__getitem__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_idx);
2527 static int __pyx_pf_8PyClical_9index_set_12__contains__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_idx);
2528 static PyObject *__pyx_pf_8PyClical_9index_set_14__iter__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2529 static PyObject *__pyx_pf_8PyClical_9index_set_17__invert__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2530 static PyObject *__pyx_pf_8PyClical_9index_set_19__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2531 static PyObject *__pyx_pf_8PyClical_9index_set_21__ixor__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs);
2532 static PyObject *__pyx_pf_8PyClical_9index_set_23__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2533 static PyObject *__pyx_pf_8PyClical_9index_set_25__iand__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs);
2534 static PyObject *__pyx_pf_8PyClical_9index_set_27__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2535 static PyObject *__pyx_pf_8PyClical_9index_set_29__ior__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs);
2536 static PyObject *__pyx_pf_8PyClical_9index_set_31count(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2537 static PyObject *__pyx_pf_8PyClical_9index_set_33count_neg(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2538 static PyObject *__pyx_pf_8PyClical_9index_set_35count_pos(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2539 static PyObject *__pyx_pf_8PyClical_9index_set_37min(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2540 static PyObject *__pyx_pf_8PyClical_9index_set_39max(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2541 static PyObject *__pyx_pf_8PyClical_9index_set_41hash_fn(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2542 static PyObject *__pyx_pf_8PyClical_9index_set_43sign_of_mult(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs);
2543 static PyObject *__pyx_pf_8PyClical_9index_set_45sign_of_square(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2544 static PyObject *__pyx_pf_8PyClical_9index_set_47__repr__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2545 static PyObject *__pyx_pf_8PyClical_9index_set_49__str__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2546 static PyObject *__pyx_pf_8PyClical_9index_set_51__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2547 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);
2548 static PyObject *__pyx_pf_8PyClical_index_set_hidden_doctests(CYTHON_UNUSED PyObject *__pyx_self);
2549 static PyObject *__pyx_pf_8PyClical_2compare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2550 static PyObject *__pyx_pf_8PyClical_4min_neg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2551 static PyObject *__pyx_pf_8PyClical_6max_pos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2552 static PyObject *__pyx_pf_8PyClical_8clifford_copy(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2553 static int __pyx_pf_8PyClical_8clifford_2__cinit__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_ixt);
2554 static void __pyx_pf_8PyClical_8clifford_4__dealloc__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2555 static int __pyx_pf_8PyClical_8clifford_6__contains__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_x);
2556 static PyObject *__pyx_pf_8PyClical_8clifford_8__iter__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2557 static PyObject *__pyx_pf_8PyClical_8clifford_10reframe(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_ixt);
2558 static PyObject *__pyx_pf_8PyClical_8clifford_12__richcmp__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op);
2559 static PyObject *__pyx_pf_8PyClical_8clifford_14__getitem__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_ixt);
2560 static PyObject *__pyx_pf_8PyClical_8clifford_16__neg__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2561 static PyObject *__pyx_pf_8PyClical_8clifford_18__pos__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2562 static PyObject *__pyx_pf_8PyClical_8clifford_20__add__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2563 static PyObject *__pyx_pf_8PyClical_8clifford_22__iadd__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2564 static PyObject *__pyx_pf_8PyClical_8clifford_24__sub__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2565 static PyObject *__pyx_pf_8PyClical_8clifford_26__isub__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2566 static PyObject *__pyx_pf_8PyClical_8clifford_28__mul__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2567 static PyObject *__pyx_pf_8PyClical_8clifford_30__imul__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2568 static PyObject *__pyx_pf_8PyClical_8clifford_32__mod__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2569 static PyObject *__pyx_pf_8PyClical_8clifford_34__imod__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2570 static PyObject *__pyx_pf_8PyClical_8clifford_36__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2571 static PyObject *__pyx_pf_8PyClical_8clifford_38__iand__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2572 static PyObject *__pyx_pf_8PyClical_8clifford_40__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2573 static PyObject *__pyx_pf_8PyClical_8clifford_42__ixor__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2574 static PyObject *__pyx_pf_8PyClical_8clifford_44__truediv__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2575 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 2576 static PyObject *__pyx_pf_8PyClical_8clifford_46__idiv__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2578 static PyObject *__pyx_pf_8PyClical_8clifford_48inv(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2579 static PyObject *__pyx_pf_8PyClical_8clifford_50__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2580 static PyObject *__pyx_pf_8PyClical_8clifford_52__ior__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2581 static PyObject *__pyx_pf_8PyClical_8clifford_54__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_m, CYTHON_UNUSED PyObject *__pyx_v_dummy);
2582 static PyObject *__pyx_pf_8PyClical_8clifford_56pow(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_m);
2583 static PyObject *__pyx_pf_8PyClical_8clifford_58outer_pow(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_m);
2584 static PyObject *__pyx_pf_8PyClical_8clifford_60__call__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_grade);
2585 static PyObject *__pyx_pf_8PyClical_8clifford_62scalar(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2586 static PyObject *__pyx_pf_8PyClical_8clifford_64pure(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2587 static PyObject *__pyx_pf_8PyClical_8clifford_66even(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2588 static PyObject *__pyx_pf_8PyClical_8clifford_68odd(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2589 static PyObject *__pyx_pf_8PyClical_8clifford_70vector_part(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_frm);
2590 static PyObject *__pyx_pf_8PyClical_8clifford_72involute(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2591 static PyObject *__pyx_pf_8PyClical_8clifford_74reverse(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2592 static PyObject *__pyx_pf_8PyClical_8clifford_76conj(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2593 static PyObject *__pyx_pf_8PyClical_8clifford_78quad(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2594 static PyObject *__pyx_pf_8PyClical_8clifford_80norm(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2595 static PyObject *__pyx_pf_8PyClical_8clifford_82abs(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2596 static PyObject *__pyx_pf_8PyClical_8clifford_84max_abs(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2597 static PyObject *__pyx_pf_8PyClical_8clifford_86truncated(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_limit);
2598 static PyObject *__pyx_pf_8PyClical_8clifford_88isinf(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2599 static PyObject *__pyx_pf_8PyClical_8clifford_90isnan(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2600 static PyObject *__pyx_pf_8PyClical_8clifford_92frame(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2601 static PyObject *__pyx_pf_8PyClical_8clifford_94__repr__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2602 static PyObject *__pyx_pf_8PyClical_8clifford_96__str__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2603 static PyObject *__pyx_pf_8PyClical_8clifford_98__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2604 static PyObject *__pyx_pf_8PyClical_8clifford_100__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2605 static PyObject *__pyx_pf_8PyClical_8clifford_hidden_doctests(CYTHON_UNUSED PyObject *__pyx_self);
2606 static PyObject *__pyx_pf_8PyClical_10error_squared_tol(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2607 static PyObject *__pyx_pf_8PyClical_12error_squared(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs, PyObject *__pyx_v_threshold);
2608 static PyObject *__pyx_pf_8PyClical_14approx_equal(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs, PyObject *__pyx_v_threshold, PyObject *__pyx_v_tol);
2609 static PyObject *__pyx_pf_8PyClical_16inv(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2610 static PyObject *__pyx_pf_8PyClical_18scalar(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2611 static PyObject *__pyx_pf_8PyClical_20real(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2612 static PyObject *__pyx_pf_8PyClical_22imag(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2613 static PyObject *__pyx_pf_8PyClical_24pure(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2614 static PyObject *__pyx_pf_8PyClical_26even(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2615 static PyObject *__pyx_pf_8PyClical_28odd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2616 static PyObject *__pyx_pf_8PyClical_30involute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2617 static PyObject *__pyx_pf_8PyClical_32reverse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2618 static PyObject *__pyx_pf_8PyClical_34conj(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2619 static PyObject *__pyx_pf_8PyClical_36quad(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2620 static PyObject *__pyx_pf_8PyClical_38norm(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2621 static PyObject *__pyx_pf_8PyClical_40abs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2622 static PyObject *__pyx_pf_8PyClical_42max_abs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2623 static PyObject *__pyx_pf_8PyClical_44pow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_m);
2624 static PyObject *__pyx_pf_8PyClical_46outer_pow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_m);
2625 static PyObject *__pyx_pf_8PyClical_48complexifier(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2626 static PyObject *__pyx_pf_8PyClical_50sqrt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2627 static PyObject *__pyx_pf_8PyClical_52exp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2628 static PyObject *__pyx_pf_8PyClical_54log(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2629 static PyObject *__pyx_pf_8PyClical_56cos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2630 static PyObject *__pyx_pf_8PyClical_58acos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2631 static PyObject *__pyx_pf_8PyClical_60cosh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2632 static PyObject *__pyx_pf_8PyClical_62acosh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2633 static PyObject *__pyx_pf_8PyClical_64sin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2634 static PyObject *__pyx_pf_8PyClical_66asin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2635 static PyObject *__pyx_pf_8PyClical_68sinh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2636 static PyObject *__pyx_pf_8PyClical_70asinh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2637 static PyObject *__pyx_pf_8PyClical_72tan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2638 static PyObject *__pyx_pf_8PyClical_74atan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2639 static PyObject *__pyx_pf_8PyClical_76tanh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2640 static PyObject *__pyx_pf_8PyClical_78atanh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2641 static PyObject *__pyx_pf_8PyClical_80random_clifford(CYTHON_UNUSED PyObject *__pyx_self,
struct __pyx_obj_8PyClical_index_set *__pyx_v_ixt, PyObject *__pyx_v_fill);
2642 static PyObject *__pyx_pf_8PyClical_82cga3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2643 static PyObject *__pyx_pf_8PyClical_84cga3std(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2644 static PyObject *__pyx_pf_8PyClical_86agc3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2645 static PyObject *__pyx_pf_8PyClical_88e(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2646 static PyObject *__pyx_pf_8PyClical_90istpq(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_p, PyObject *__pyx_v_q);
2647 static PyObject *__pyx_pf_8PyClical_92_test(CYTHON_UNUSED PyObject *__pyx_self);
2648 static PyObject *__pyx_tp_new_8PyClical_index_set(PyTypeObject *t, PyObject *a, PyObject *k);
2649 static PyObject *__pyx_tp_new_8PyClical_clifford(PyTypeObject *t, PyObject *a, PyObject *k);
2650 static PyObject *__pyx_tp_new_8PyClical___pyx_scope_struct____iter__(PyTypeObject *t, PyObject *a, PyObject *k);
2651 static PyObject *__pyx_float_0_0;
2652 static PyObject *__pyx_float_1_0;
2653 static PyObject *__pyx_float_4_0;
2654 static PyObject *__pyx_float_8_0;
2655 static PyObject *__pyx_int_0;
2656 static PyObject *__pyx_int_1;
2657 static PyObject *__pyx_int_4;
2658 static PyObject *__pyx_int_neg_1;
2659 static PyObject *__pyx_tuple__3;
2660 static PyObject *__pyx_tuple__4;
2661 static PyObject *__pyx_tuple__10;
2662 static PyObject *__pyx_tuple__11;
2663 static PyObject *__pyx_tuple__12;
2664 static PyObject *__pyx_tuple__15;
2665 static PyObject *__pyx_tuple__16;
2666 static PyObject *__pyx_tuple__18;
2667 static PyObject *__pyx_tuple__20;
2668 static PyObject *__pyx_tuple__21;
2669 static PyObject *__pyx_tuple__22;
2670 static PyObject *__pyx_codeobj__13;
2671 static PyObject *__pyx_codeobj__14;
2672 static PyObject *__pyx_codeobj__17;
2673 static PyObject *__pyx_codeobj__19;
2674 static PyObject *__pyx_codeobj__23;
2685 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_toIndexSet(PyObject *__pyx_v_obj) {
2687 __Pyx_RefNannyDeclarations
2688 PyObject *__pyx_t_1 = NULL;
2689 int __pyx_lineno = 0;
2690 const char *__pyx_filename = NULL;
2691 int __pyx_clineno = 0;
2692 __Pyx_RefNannySetupContext(
"toIndexSet", 0);
2701 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_index_set), __pyx_v_obj);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error)
2702 __Pyx_GOTREF(__pyx_t_1);
2703 __pyx_r = (((
struct __pyx_obj_8PyClical_index_set *)__pyx_t_1)->instance[0]);
2704 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2717 __Pyx_XDECREF(__pyx_t_1);
2718 __Pyx_WriteUnraisable(
"PyClical.toIndexSet", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
2719 __Pyx_pretend_to_initialize(&__pyx_r);
2721 __Pyx_RefNannyFinishContext();
2733 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_9index_set_wrap(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self,
IndexSet __pyx_v_other) {
2734 PyObject *__pyx_r = NULL;
2735 __Pyx_RefNannyDeclarations
2736 __Pyx_RefNannySetupContext(
"wrap", 0);
2745 (__pyx_v_self->instance[0]) = __pyx_v_other;
2754 __Pyx_XDECREF(__pyx_r);
2755 __Pyx_INCREF(((PyObject *)__pyx_v_self));
2756 __pyx_r = ((PyObject *)__pyx_v_self);
2769 __Pyx_XGIVEREF(__pyx_r);
2770 __Pyx_RefNannyFinishContext();
2782 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_9index_set_unwrap(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
2784 __Pyx_RefNannyDeclarations
2785 __Pyx_RefNannySetupContext(
"unwrap", 0);
2794 __pyx_r = (__pyx_v_self->instance[0]);
2807 __Pyx_RefNannyFinishContext();
2819 static PyObject *__pyx_pw_8PyClical_9index_set_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
2820 static PyObject *__pyx_f_8PyClical_9index_set_copy(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self,
int __pyx_skip_dispatch) {
2821 PyObject *__pyx_r = NULL;
2822 __Pyx_RefNannyDeclarations
2823 PyObject *__pyx_t_1 = NULL;
2824 PyObject *__pyx_t_2 = NULL;
2825 PyObject *__pyx_t_3 = NULL;
2826 PyObject *__pyx_t_4 = NULL;
2827 int __pyx_lineno = 0;
2828 const char *__pyx_filename = NULL;
2829 int __pyx_clineno = 0;
2830 __Pyx_RefNannySetupContext(
"copy", 0);
2832 if (unlikely(__pyx_skip_dispatch)) ;
2834 else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
2835 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS 2836 static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
2837 if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
2838 PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
2840 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error)
2841 __Pyx_GOTREF(__pyx_t_1);
2842 if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(
void*)__pyx_pw_8PyClical_9index_set_1copy)) {
2843 __Pyx_XDECREF(__pyx_r);
2844 __Pyx_INCREF(__pyx_t_1);
2845 __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
2846 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
2847 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
2848 if (likely(__pyx_t_4)) {
2849 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
2850 __Pyx_INCREF(__pyx_t_4);
2851 __Pyx_INCREF(
function);
2852 __Pyx_DECREF_SET(__pyx_t_3,
function);
2855 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
2856 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
2857 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error)
2858 __Pyx_GOTREF(__pyx_t_2);
2859 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2860 __pyx_r = __pyx_t_2;
2862 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2865 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS 2866 __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
2867 __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
2868 if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
2869 __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
2872 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2873 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS 2885 __Pyx_XDECREF(__pyx_r);
2886 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_index_set), ((PyObject *)__pyx_v_self));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error)
2887 __Pyx_GOTREF(__pyx_t_1);
2888 __pyx_r = __pyx_t_1;
2902 __Pyx_XDECREF(__pyx_t_1);
2903 __Pyx_XDECREF(__pyx_t_2);
2904 __Pyx_XDECREF(__pyx_t_3);
2905 __Pyx_XDECREF(__pyx_t_4);
2906 __Pyx_AddTraceback(
"PyClical.index_set.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
2909 __Pyx_XGIVEREF(__pyx_r);
2910 __Pyx_RefNannyFinishContext();
2915 static PyObject *__pyx_pw_8PyClical_9index_set_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
2916 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 ";
2917 static PyObject *__pyx_pw_8PyClical_9index_set_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
2918 PyObject *__pyx_r = 0;
2919 __Pyx_RefNannyDeclarations
2920 __Pyx_RefNannySetupContext(
"copy (wrapper)", 0);
2921 __pyx_r = __pyx_pf_8PyClical_9index_set_copy(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
2924 __Pyx_RefNannyFinishContext();
2928 static PyObject *__pyx_pf_8PyClical_9index_set_copy(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
2929 PyObject *__pyx_r = NULL;
2930 __Pyx_RefNannyDeclarations
2931 PyObject *__pyx_t_1 = NULL;
2932 int __pyx_lineno = 0;
2933 const char *__pyx_filename = NULL;
2934 int __pyx_clineno = 0;
2935 __Pyx_RefNannySetupContext(
"copy", 0);
2936 __Pyx_XDECREF(__pyx_r);
2937 __pyx_t_1 = __pyx_f_8PyClical_9index_set_copy(__pyx_v_self, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error)
2938 __Pyx_GOTREF(__pyx_t_1);
2939 __pyx_r = __pyx_t_1;
2945 __Pyx_XDECREF(__pyx_t_1);
2946 __Pyx_AddTraceback(
"PyClical.index_set.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
2949 __Pyx_XGIVEREF(__pyx_r);
2950 __Pyx_RefNannyFinishContext();
2963 static int __pyx_pw_8PyClical_9index_set_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2964 static int __pyx_pw_8PyClical_9index_set_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2965 PyObject *__pyx_v_other = 0;
2966 int __pyx_lineno = 0;
2967 const char *__pyx_filename = NULL;
2968 int __pyx_clineno = 0;
2970 __Pyx_RefNannyDeclarations
2971 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
2973 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,0};
2974 PyObject* values[1] = {0};
2975 values[0] = ((PyObject *)__pyx_int_0);
2976 if (unlikely(__pyx_kwds)) {
2978 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2980 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2983 default:
goto __pyx_L5_argtuple_error;
2985 kw_args = PyDict_Size(__pyx_kwds);
2989 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other);
2990 if (value) { values[0] = value; kw_args--; }
2993 if (unlikely(kw_args > 0)) {
2994 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(0, 74, __pyx_L3_error)
2997 switch (PyTuple_GET_SIZE(__pyx_args)) {
2998 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3001 default:
goto __pyx_L5_argtuple_error;
3004 __pyx_v_other = values[0];
3006 goto __pyx_L4_argument_unpacking_done;
3007 __pyx_L5_argtuple_error:;
3008 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 74, __pyx_L3_error)
3010 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3011 __Pyx_RefNannyFinishContext();
3013 __pyx_L4_argument_unpacking_done:;
3014 __pyx_r = __pyx_pf_8PyClical_9index_set_2__cinit__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), __pyx_v_other);
3017 __Pyx_RefNannyFinishContext();
3021 static int __pyx_pf_8PyClical_9index_set_2__cinit__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_other) {
3022 PyObject *__pyx_v_error_msg_prefix = NULL;
3023 PyObject *__pyx_v_idx = NULL;
3024 PyObject *__pyx_v_bother = NULL;
3026 __Pyx_RefNannyDeclarations
3030 PyObject *__pyx_t_4 = NULL;
3031 PyObject *__pyx_t_5 = NULL;
3034 PyObject *__pyx_t_8 = NULL;
3035 PyObject *__pyx_t_9 = NULL;
3036 PyObject *__pyx_t_10 = NULL;
3037 Py_ssize_t __pyx_t_11;
3038 PyObject *(*__pyx_t_12)(PyObject *);
3039 PyObject *__pyx_t_13 = NULL;
3040 PyObject *__pyx_t_14 = NULL;
3041 PyObject *__pyx_t_15 = NULL;
3042 PyObject *__pyx_t_16 = NULL;
3044 int __pyx_lineno = 0;
3045 const char *__pyx_filename = NULL;
3046 int __pyx_clineno = 0;
3047 __Pyx_RefNannySetupContext(
"__cinit__", 0);
3056 __Pyx_INCREF(__pyx_kp_u_Cannot_initialize_index_set_obje);
3057 __pyx_v_error_msg_prefix = __pyx_kp_u_Cannot_initialize_index_set_obje;
3066 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8PyClical_index_set);
3067 __pyx_t_2 = (__pyx_t_1 != 0);
3078 __pyx_t_3 =
new IndexSet(__pyx_f_8PyClical_9index_set_unwrap(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_other)));
3080 __Pyx_CppExn2PyErr();
3081 __PYX_ERR(0, 95, __pyx_L1_error)
3083 __pyx_v_self->instance = __pyx_t_3;
3102 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_numbers);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error)
3103 __Pyx_GOTREF(__pyx_t_4);
3104 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Integral);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 96, __pyx_L1_error)
3105 __Pyx_GOTREF(__pyx_t_5);
3106 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3107 __pyx_t_2 = PyObject_IsInstance(__pyx_v_other, __pyx_t_5);
if (unlikely(__pyx_t_2 == ((
int)-1))) __PYX_ERR(0, 96, __pyx_L1_error)
3108 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3109 __pyx_t_1 = (__pyx_t_2 != 0);
3119 __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_other);
if (unlikely((__pyx_t_6 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 97, __pyx_L1_error)
3121 __pyx_t_3 =
new IndexSet(((
int)__pyx_t_6));
3123 __Pyx_CppExn2PyErr();
3124 __PYX_ERR(0, 97, __pyx_L1_error)
3126 __pyx_v_self->instance = __pyx_t_3;
3145 __pyx_t_2 = PySet_Check(__pyx_v_other);
3146 __pyx_t_7 = (__pyx_t_2 != 0);
3149 __pyx_t_1 = __pyx_t_7;
3150 goto __pyx_L4_bool_binop_done;
3152 __pyx_t_7 = PyFrozenSet_Check(__pyx_v_other);
3153 __pyx_t_2 = (__pyx_t_7 != 0);
3154 __pyx_t_1 = __pyx_t_2;
3155 __pyx_L4_bool_binop_done:;
3156 __pyx_t_2 = (__pyx_t_1 != 0);
3167 __Pyx_PyThreadState_declare
3168 __Pyx_PyThreadState_assign
3169 __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
3170 __Pyx_XGOTREF(__pyx_t_8);
3171 __Pyx_XGOTREF(__pyx_t_9);
3172 __Pyx_XGOTREF(__pyx_t_10);
3183 __pyx_v_self->instance = __pyx_t_3;
3192 if (likely(PyList_CheckExact(__pyx_v_other)) || PyTuple_CheckExact(__pyx_v_other)) {
3193 __pyx_t_5 = __pyx_v_other; __Pyx_INCREF(__pyx_t_5); __pyx_t_11 = 0;
3196 __pyx_t_11 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_other);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 101, __pyx_L6_error)
3197 __Pyx_GOTREF(__pyx_t_5);
3198 __pyx_t_12 = Py_TYPE(__pyx_t_5)->tp_iternext;
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 101, __pyx_L6_error)
3201 if (likely(!__pyx_t_12)) {
3202 if (likely(PyList_CheckExact(__pyx_t_5))) {
3203 if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_5))
break;
3204 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 3205 __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, 101, __pyx_L6_error)
3207 __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_11); __pyx_t_11++;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 101, __pyx_L6_error)
3208 __Pyx_GOTREF(__pyx_t_4);
3211 if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_5))
break;
3212 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 3213 __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, 101, __pyx_L6_error)
3215 __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_11); __pyx_t_11++;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 101, __pyx_L6_error)
3216 __Pyx_GOTREF(__pyx_t_4);
3220 __pyx_t_4 = __pyx_t_12(__pyx_t_5);
3221 if (unlikely(!__pyx_t_4)) {
3222 PyObject* exc_type = PyErr_Occurred();
3224 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
3225 else __PYX_ERR(0, 101, __pyx_L6_error)
3229 __Pyx_GOTREF(__pyx_t_4);
3231 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_4);
3241 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self), __pyx_v_idx, Py_True) < 0)) __PYX_ERR(0, 102, __pyx_L6_error)
3251 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3261 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3262 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
3263 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3264 goto __pyx_L11_try_end;
3266 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3267 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3276 __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_IndexError);
3278 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3279 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_13) < 0) __PYX_ERR(0, 103, __pyx_L8_except_error)
3280 __Pyx_GOTREF(__pyx_t_5);
3281 __Pyx_GOTREF(__pyx_t_4);
3282 __Pyx_GOTREF(__pyx_t_13);
3291 __pyx_t_14 = __Pyx_PyUnicode_Concat(__pyx_v_error_msg_prefix, __pyx_kp_u_invalid);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 104, __pyx_L8_except_error)
3292 __Pyx_GOTREF(__pyx_t_14);
3293 __pyx_t_15 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 104, __pyx_L8_except_error)
3294 __Pyx_GOTREF(__pyx_t_15);
3295 __pyx_t_16 = PyNumber_Add(__pyx_t_14, __pyx_t_15);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 104, __pyx_L8_except_error)
3296 __Pyx_GOTREF(__pyx_t_16);
3297 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3298 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3299 __pyx_t_15 = PyNumber_Add(__pyx_t_16, __pyx_kp_u_);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 104, __pyx_L8_except_error)
3300 __Pyx_GOTREF(__pyx_t_15);
3301 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3302 __pyx_t_16 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_15);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 104, __pyx_L8_except_error)
3303 __Pyx_GOTREF(__pyx_t_16);
3304 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3305 __Pyx_Raise(__pyx_t_16, 0, 0, 0);
3306 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3307 __PYX_ERR(0, 104, __pyx_L8_except_error)
3317 __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
3319 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3320 if (__Pyx_GetException(&__pyx_t_13, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(0, 105, __pyx_L8_except_error)
3321 __Pyx_GOTREF(__pyx_t_13);
3322 __Pyx_GOTREF(__pyx_t_4);
3323 __Pyx_GOTREF(__pyx_t_5);
3332 __pyx_t_16 = __Pyx_PyUnicode_Concat(__pyx_v_error_msg_prefix, __pyx_kp_u_invalid);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 106, __pyx_L8_except_error)
3333 __Pyx_GOTREF(__pyx_t_16);
3334 __pyx_t_15 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 106, __pyx_L8_except_error)
3335 __Pyx_GOTREF(__pyx_t_15);
3336 __pyx_t_14 = PyNumber_Add(__pyx_t_16, __pyx_t_15);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 106, __pyx_L8_except_error)
3337 __Pyx_GOTREF(__pyx_t_14);
3338 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3339 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3340 __pyx_t_15 = PyNumber_Add(__pyx_t_14, __pyx_kp_u_);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 106, __pyx_L8_except_error)
3341 __Pyx_GOTREF(__pyx_t_15);
3342 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3343 __pyx_t_14 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_15);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 106, __pyx_L8_except_error)
3344 __Pyx_GOTREF(__pyx_t_14);
3345 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3346 __Pyx_Raise(__pyx_t_14, 0, 0, 0);
3347 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3348 __PYX_ERR(0, 106, __pyx_L8_except_error)
3350 goto __pyx_L8_except_error;
3351 __pyx_L8_except_error:;
3360 __Pyx_XGIVEREF(__pyx_t_8);
3361 __Pyx_XGIVEREF(__pyx_t_9);
3362 __Pyx_XGIVEREF(__pyx_t_10);
3363 __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
3364 goto __pyx_L1_error;
3385 __pyx_t_2 = PyUnicode_Check(__pyx_v_other);
3386 __pyx_t_1 = (__pyx_t_2 != 0);
3387 if (likely(__pyx_t_1)) {
3397 __Pyx_PyThreadState_declare
3398 __Pyx_PyThreadState_assign
3399 __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
3400 __Pyx_XGOTREF(__pyx_t_10);
3401 __Pyx_XGOTREF(__pyx_t_9);
3402 __Pyx_XGOTREF(__pyx_t_8);
3412 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_encode);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 109, __pyx_L18_error)
3413 __Pyx_GOTREF(__pyx_t_4);
3415 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
3416 __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_4);
3417 if (likely(__pyx_t_13)) {
3418 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
3419 __Pyx_INCREF(__pyx_t_13);
3420 __Pyx_INCREF(
function);
3421 __Pyx_DECREF_SET(__pyx_t_4,
function);
3424 __pyx_t_5 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_13, __pyx_kp_u_UTF_8) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_UTF_8);
3425 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
3426 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 109, __pyx_L18_error)
3427 __Pyx_GOTREF(__pyx_t_5);
3428 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3429 __pyx_v_bother = __pyx_t_5;
3439 __pyx_t_17 = __Pyx_PyObject_AsWritableString(__pyx_v_bother);
if (unlikely((!__pyx_t_17) && PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L18_error)
3441 __pyx_t_3 =
new IndexSet(((
char *)__pyx_t_17));
3443 __Pyx_CppExn2PyErr();
3444 __PYX_ERR(0, 110, __pyx_L18_error)
3446 __pyx_v_self->instance = __pyx_t_3;
3456 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3457 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
3458 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3459 goto __pyx_L23_try_end;
3461 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
3462 __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
3463 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
3464 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
3465 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3466 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3475 __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
3477 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3478 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_13) < 0) __PYX_ERR(0, 111, __pyx_L20_except_error)
3479 __Pyx_GOTREF(__pyx_t_5);
3480 __Pyx_GOTREF(__pyx_t_4);
3481 __Pyx_GOTREF(__pyx_t_13);
3490 __pyx_t_14 = __Pyx_PyUnicode_Concat(__pyx_v_error_msg_prefix, __pyx_kp_u_invalid_string);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 112, __pyx_L20_except_error)
3491 __Pyx_GOTREF(__pyx_t_14);
3492 __pyx_t_15 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 112, __pyx_L20_except_error)
3493 __Pyx_GOTREF(__pyx_t_15);
3494 __pyx_t_16 = PyNumber_Add(__pyx_t_14, __pyx_t_15);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 112, __pyx_L20_except_error)
3495 __Pyx_GOTREF(__pyx_t_16);
3496 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3497 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3498 __pyx_t_15 = PyNumber_Add(__pyx_t_16, __pyx_kp_u_);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 112, __pyx_L20_except_error)
3499 __Pyx_GOTREF(__pyx_t_15);
3500 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3501 __pyx_t_16 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_15);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 112, __pyx_L20_except_error)
3502 __Pyx_GOTREF(__pyx_t_16);
3503 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3504 __Pyx_Raise(__pyx_t_16, 0, 0, 0);
3505 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3506 __PYX_ERR(0, 112, __pyx_L20_except_error)
3508 goto __pyx_L20_except_error;
3509 __pyx_L20_except_error:;
3518 __Pyx_XGIVEREF(__pyx_t_10);
3519 __Pyx_XGIVEREF(__pyx_t_9);
3520 __Pyx_XGIVEREF(__pyx_t_8);
3521 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8);
3522 goto __pyx_L1_error;
3544 __pyx_t_13 = __Pyx_PyUnicode_Concat(__pyx_v_error_msg_prefix, __pyx_kp_u__2);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 114, __pyx_L1_error)
3545 __Pyx_GOTREF(__pyx_t_13);
3546 __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)Py_TYPE(__pyx_v_other)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 114, __pyx_L1_error)
3547 __Pyx_GOTREF(__pyx_t_4);
3548 __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_t_13, __pyx_t_4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 114, __pyx_L1_error)
3549 __Pyx_GOTREF(__pyx_t_5);
3550 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
3551 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3552 __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_t_5, __pyx_kp_u_);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 114, __pyx_L1_error)
3553 __Pyx_GOTREF(__pyx_t_4);
3554 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3555 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 114, __pyx_L1_error)
3556 __Pyx_GOTREF(__pyx_t_5);
3557 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3558 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
3559 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3560 __PYX_ERR(0, 114, __pyx_L1_error)
3576 __Pyx_XDECREF(__pyx_t_4);
3577 __Pyx_XDECREF(__pyx_t_5);
3578 __Pyx_XDECREF(__pyx_t_13);
3579 __Pyx_XDECREF(__pyx_t_14);
3580 __Pyx_XDECREF(__pyx_t_15);
3581 __Pyx_XDECREF(__pyx_t_16);
3582 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3585 __Pyx_XDECREF(__pyx_v_error_msg_prefix);
3586 __Pyx_XDECREF(__pyx_v_idx);
3587 __Pyx_XDECREF(__pyx_v_bother);
3588 __Pyx_RefNannyFinishContext();
3601 static void __pyx_pw_8PyClical_9index_set_5__dealloc__(PyObject *__pyx_v_self);
3602 static void __pyx_pw_8PyClical_9index_set_5__dealloc__(PyObject *__pyx_v_self) {
3603 __Pyx_RefNannyDeclarations
3604 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
3605 __pyx_pf_8PyClical_9index_set_4__dealloc__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
3608 __Pyx_RefNannyFinishContext();
3611 static void __pyx_pf_8PyClical_9index_set_4__dealloc__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
3612 __Pyx_RefNannyDeclarations
3613 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
3622 delete __pyx_v_self->instance;
3633 __Pyx_RefNannyFinishContext();
3645 static PyObject *__pyx_pw_8PyClical_9index_set_7__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op);
3646 static PyObject *__pyx_pw_8PyClical_9index_set_7__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op) {
3647 PyObject *__pyx_r = 0;
3648 __Pyx_RefNannyDeclarations
3649 __Pyx_RefNannySetupContext(
"__richcmp__ (wrapper)", 0);
3650 __pyx_r = __pyx_pf_8PyClical_9index_set_6__richcmp__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs), ((
int)__pyx_v_op));
3653 __Pyx_RefNannyFinishContext();
3657 static PyObject *__pyx_pf_8PyClical_9index_set_6__richcmp__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op) {
3658 PyObject *__pyx_v_eq = NULL;
3659 PyObject *__pyx_v_lt = NULL;
3660 PyObject *__pyx_r = NULL;
3661 __Pyx_RefNannyDeclarations
3665 PyObject *__pyx_t_4 = NULL;
3666 int __pyx_lineno = 0;
3667 const char *__pyx_filename = NULL;
3668 int __pyx_clineno = 0;
3669 __Pyx_RefNannySetupContext(
"__richcmp__", 0);
3678 __pyx_t_2 = (((PyObject *)__pyx_v_lhs) == Py_None);
3679 __pyx_t_3 = (__pyx_t_2 != 0);
3682 __pyx_t_1 = __pyx_t_3;
3683 goto __pyx_L4_bool_binop_done;
3685 __pyx_t_3 = (__pyx_v_rhs == Py_None);
3686 __pyx_t_2 = (__pyx_t_3 != 0);
3687 __pyx_t_1 = __pyx_t_2;
3688 __pyx_L4_bool_binop_done:;
3698 __pyx_t_1 = (((PyObject *)__pyx_v_lhs) == __pyx_v_rhs);
3699 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 144, __pyx_L1_error)
3700 __Pyx_GOTREF(__pyx_t_4);
3701 __pyx_v_eq = __pyx_t_4;
3711 switch (__pyx_v_op) {
3721 __Pyx_XDECREF(__pyx_r);
3722 __Pyx_INCREF(__pyx_v_eq);
3723 __pyx_r = __pyx_v_eq;
3743 __Pyx_XDECREF(__pyx_r);
3744 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_eq);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 148, __pyx_L1_error)
3745 __pyx_t_4 = __Pyx_PyBool_FromLong((!__pyx_t_1));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error)
3746 __Pyx_GOTREF(__pyx_t_4);
3747 __pyx_r = __pyx_t_4;
3768 switch (__pyx_v_op) {
3778 __Pyx_XDECREF(__pyx_r);
3779 __Pyx_INCREF(Py_False);
3800 __Pyx_XDECREF(__pyx_r);
3801 __Pyx_INCREF(__pyx_v_eq);
3802 __pyx_r = __pyx_v_eq;
3822 __Pyx_XDECREF(__pyx_r);
3823 __Pyx_INCREF(Py_False);
3844 __Pyx_XDECREF(__pyx_r);
3845 __Pyx_INCREF(__pyx_v_eq);
3846 __pyx_r = __pyx_v_eq;
3866 __Pyx_XDECREF(__pyx_r);
3867 __Pyx_INCREF(__pyx_builtin_NotImplemented);
3868 __pyx_r = __pyx_builtin_NotImplemented;
3892 __pyx_t_1 = (__pyx_f_8PyClical_toIndexSet(((PyObject *)__pyx_v_lhs)) == __pyx_f_8PyClical_toIndexSet(__pyx_v_rhs));
3893 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 161, __pyx_L1_error)
3894 __Pyx_GOTREF(__pyx_t_4);
3895 __pyx_v_eq = __pyx_t_4;
3905 switch (__pyx_v_op) {
3915 __Pyx_XDECREF(__pyx_r);
3916 __Pyx_INCREF(__pyx_v_eq);
3917 __pyx_r = __pyx_v_eq;
3937 __Pyx_XDECREF(__pyx_r);
3938 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_eq);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 165, __pyx_L1_error)
3939 __pyx_t_4 = __Pyx_PyBool_FromLong((!__pyx_t_1));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error)
3940 __Pyx_GOTREF(__pyx_t_4);
3941 __pyx_r = __pyx_t_4;
3962 __pyx_t_1 = (__pyx_f_8PyClical_toIndexSet(((PyObject *)__pyx_v_lhs)) < __pyx_f_8PyClical_toIndexSet(__pyx_v_rhs));
3963 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error)
3964 __Pyx_GOTREF(__pyx_t_4);
3965 __pyx_v_lt = __pyx_t_4;
3975 switch (__pyx_v_op) {
3985 __Pyx_XDECREF(__pyx_r);
3986 __Pyx_INCREF(__pyx_v_lt);
3987 __pyx_r = __pyx_v_lt;
4007 __Pyx_XDECREF(__pyx_r);
4008 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_lt);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 171, __pyx_L1_error)
4011 __Pyx_INCREF(__pyx_v_lt);
4012 __pyx_t_4 = __pyx_v_lt;
4013 goto __pyx_L6_bool_binop_done;
4015 __Pyx_INCREF(__pyx_v_eq);
4016 __pyx_t_4 = __pyx_v_eq;
4017 __pyx_L6_bool_binop_done:;
4018 __pyx_r = __pyx_t_4;
4039 __Pyx_XDECREF(__pyx_r);
4040 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_lt);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 173, __pyx_L1_error)
4043 __pyx_t_1 = __pyx_t_2;
4044 goto __pyx_L8_bool_binop_done;
4046 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_eq);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 173, __pyx_L1_error)
4047 __pyx_t_1 = __pyx_t_2;
4048 __pyx_L8_bool_binop_done:;
4049 __pyx_t_4 = __Pyx_PyBool_FromLong((!__pyx_t_1));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 173, __pyx_L1_error)
4050 __Pyx_GOTREF(__pyx_t_4);
4051 __pyx_r = __pyx_t_4;
4072 __Pyx_XDECREF(__pyx_r);
4073 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_lt);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 175, __pyx_L1_error)
4074 __pyx_t_4 = __Pyx_PyBool_FromLong((!__pyx_t_1));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 175, __pyx_L1_error)
4075 __Pyx_GOTREF(__pyx_t_4);
4076 __pyx_r = __pyx_t_4;
4097 __Pyx_XDECREF(__pyx_r);
4098 __Pyx_INCREF(__pyx_builtin_NotImplemented);
4099 __pyx_r = __pyx_builtin_NotImplemented;
4117 __Pyx_XDECREF(__pyx_t_4);
4118 __Pyx_AddTraceback(
"PyClical.index_set.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4121 __Pyx_XDECREF(__pyx_v_eq);
4122 __Pyx_XDECREF(__pyx_v_lt);
4123 __Pyx_XGIVEREF(__pyx_r);
4124 __Pyx_RefNannyFinishContext();
4137 static int __pyx_pw_8PyClical_9index_set_9__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx, PyObject *__pyx_v_val);
4138 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 ";
4139 #if CYTHON_COMPILING_IN_CPYTHON 4140 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_8__setitem__;
4142 static int __pyx_pw_8PyClical_9index_set_9__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx, PyObject *__pyx_v_val) {
4144 __Pyx_RefNannyDeclarations
4145 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
4146 __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));
4149 __Pyx_RefNannyFinishContext();
4153 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) {
4155 __Pyx_RefNannyDeclarations
4158 int __pyx_lineno = 0;
4159 const char *__pyx_filename = NULL;
4160 int __pyx_clineno = 0;
4161 __Pyx_RefNannySetupContext(
"__setitem__", 0);
4170 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_idx);
if (unlikely((__pyx_t_1 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 188, __pyx_L1_error)
4171 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_val);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 188, __pyx_L1_error)
4173 __pyx_v_self->instance->set(__pyx_t_1, __pyx_t_2);
4175 __Pyx_CppExn2PyErr();
4176 __PYX_ERR(0, 188, __pyx_L1_error)
4199 __Pyx_AddTraceback(
"PyClical.index_set.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4202 __Pyx_RefNannyFinishContext();
4215 static PyObject *__pyx_pw_8PyClical_9index_set_11__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx);
4216 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 ";
4217 #if CYTHON_COMPILING_IN_CPYTHON 4218 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_10__getitem__;
4220 static PyObject *__pyx_pw_8PyClical_9index_set_11__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx) {
4221 PyObject *__pyx_r = 0;
4222 __Pyx_RefNannyDeclarations
4223 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
4224 __pyx_r = __pyx_pf_8PyClical_9index_set_10__getitem__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_idx));
4227 __Pyx_RefNannyFinishContext();
4231 static PyObject *__pyx_pf_8PyClical_9index_set_10__getitem__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_idx) {
4232 PyObject *__pyx_r = NULL;
4233 __Pyx_RefNannyDeclarations
4235 PyObject *__pyx_t_2 = NULL;
4236 int __pyx_lineno = 0;
4237 const char *__pyx_filename = NULL;
4238 int __pyx_clineno = 0;
4239 __Pyx_RefNannySetupContext(
"__getitem__", 0);
4248 __Pyx_XDECREF(__pyx_r);
4249 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_idx);
if (unlikely((__pyx_t_1 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 208, __pyx_L1_error)
4250 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->instance->operator[](__pyx_t_1));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 208, __pyx_L1_error)
4251 __Pyx_GOTREF(__pyx_t_2);
4252 __pyx_r = __pyx_t_2;
4266 __Pyx_XDECREF(__pyx_t_2);
4267 __Pyx_AddTraceback(
"PyClical.index_set.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4270 __Pyx_XGIVEREF(__pyx_r);
4271 __Pyx_RefNannyFinishContext();
4284 static int __pyx_pw_8PyClical_9index_set_13__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx);
4285 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 ";
4286 #if CYTHON_COMPILING_IN_CPYTHON 4287 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_12__contains__;
4289 static int __pyx_pw_8PyClical_9index_set_13__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx) {
4291 __Pyx_RefNannyDeclarations
4292 __Pyx_RefNannySetupContext(
"__contains__ (wrapper)", 0);
4293 __pyx_r = __pyx_pf_8PyClical_9index_set_12__contains__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_idx));
4296 __Pyx_RefNannyFinishContext();
4300 static int __pyx_pf_8PyClical_9index_set_12__contains__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_idx) {
4302 __Pyx_RefNannyDeclarations
4304 int __pyx_lineno = 0;
4305 const char *__pyx_filename = NULL;
4306 int __pyx_clineno = 0;
4307 __Pyx_RefNannySetupContext(
"__contains__", 0);
4316 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_idx);
if (unlikely((__pyx_t_1 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 227, __pyx_L1_error)
4317 __pyx_r = __pyx_v_self->instance->operator[](__pyx_t_1);
4330 __Pyx_AddTraceback(
"PyClical.index_set.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4333 __Pyx_RefNannyFinishContext();
4336 static PyObject *__pyx_gb_8PyClical_9index_set_16generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value);
4347 static PyObject *__pyx_pw_8PyClical_9index_set_15__iter__(PyObject *__pyx_v_self);
4348 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, end=\",\")\n -3,4,7,\n ";
4349 #if CYTHON_COMPILING_IN_CPYTHON 4350 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_14__iter__;
4352 static PyObject *__pyx_pw_8PyClical_9index_set_15__iter__(PyObject *__pyx_v_self) {
4353 PyObject *__pyx_r = 0;
4354 __Pyx_RefNannyDeclarations
4355 __Pyx_RefNannySetupContext(
"__iter__ (wrapper)", 0);
4356 __pyx_r = __pyx_pf_8PyClical_9index_set_14__iter__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
4359 __Pyx_RefNannyFinishContext();
4363 static PyObject *__pyx_pf_8PyClical_9index_set_14__iter__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
4364 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *__pyx_cur_scope;
4365 PyObject *__pyx_r = NULL;
4366 __Pyx_RefNannyDeclarations
4367 int __pyx_lineno = 0;
4368 const char *__pyx_filename = NULL;
4369 int __pyx_clineno = 0;
4370 __Pyx_RefNannySetupContext(
"__iter__", 0);
4371 __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);
4372 if (unlikely(!__pyx_cur_scope)) {
4373 __pyx_cur_scope = ((
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)Py_None);
4374 __Pyx_INCREF(Py_None);
4375 __PYX_ERR(0, 229, __pyx_L1_error)
4377 __Pyx_GOTREF(__pyx_cur_scope);
4379 __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
4380 __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
4381 __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
4383 __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_8PyClical_9index_set_16generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_index_set___iter, __pyx_n_s_PyClical);
if (unlikely(!gen)) __PYX_ERR(0, 229, __pyx_L1_error)
4384 __Pyx_DECREF(__pyx_cur_scope);
4385 __Pyx_RefNannyFinishContext();
4386 return (PyObject *) gen;
4391 __Pyx_AddTraceback(
"PyClical.index_set.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4393 __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
4394 __Pyx_XGIVEREF(__pyx_r);
4395 __Pyx_RefNannyFinishContext();
4399 static PyObject *__pyx_gb_8PyClical_9index_set_16generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value)
4401 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *__pyx_cur_scope = ((
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)__pyx_generator->closure);
4402 PyObject *__pyx_r = NULL;
4403 PyObject *__pyx_t_1 = NULL;
4404 PyObject *__pyx_t_2 = NULL;
4405 PyObject *__pyx_t_3 = NULL;
4406 PyObject *__pyx_t_4 = NULL;
4407 Py_ssize_t __pyx_t_5;
4408 PyObject *(*__pyx_t_6)(PyObject *);
4411 int __pyx_lineno = 0;
4412 const char *__pyx_filename = NULL;
4413 int __pyx_clineno = 0;
4414 __Pyx_RefNannyDeclarations
4415 __Pyx_RefNannySetupContext(
"__iter__", 0);
4416 switch (__pyx_generator->resume_label) {
4417 case 0:
goto __pyx_L3_first_run;
4418 case 1:
goto __pyx_L7_resume_from_yield;
4420 __Pyx_RefNannyFinishContext();
4423 __pyx_L3_first_run:;
4424 if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 229, __pyx_L1_error)
4433 __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, 236, __pyx_L1_error)
4434 __Pyx_GOTREF(__pyx_t_2);
4436 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
4437 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
4438 if (likely(__pyx_t_3)) {
4439 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
4440 __Pyx_INCREF(__pyx_t_3);
4441 __Pyx_INCREF(
function);
4442 __Pyx_DECREF_SET(__pyx_t_2,
function);
4445 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
4446 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4447 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error)
4448 __Pyx_GOTREF(__pyx_t_1);
4449 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4450 __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, 236, __pyx_L1_error)
4451 __Pyx_GOTREF(__pyx_t_3);
4453 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4454 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
4455 if (likely(__pyx_t_4)) {
4456 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4457 __Pyx_INCREF(__pyx_t_4);
4458 __Pyx_INCREF(
function);
4459 __Pyx_DECREF_SET(__pyx_t_3,
function);
4462 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
4463 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4464 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error)
4465 __Pyx_GOTREF(__pyx_t_2);
4466 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4467 __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 236, __pyx_L1_error)
4468 __Pyx_GOTREF(__pyx_t_3);
4469 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4470 __pyx_t_2 = PyTuple_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error)
4471 __Pyx_GOTREF(__pyx_t_2);
4472 __Pyx_GIVEREF(__pyx_t_1);
4473 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
4474 __Pyx_GIVEREF(__pyx_t_3);
4475 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
4478 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_2, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 236, __pyx_L1_error)
4479 __Pyx_GOTREF(__pyx_t_3);
4480 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4481 if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
4482 __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
4485 __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error)
4486 __Pyx_GOTREF(__pyx_t_2);
4487 __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext;
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 236, __pyx_L1_error)
4489 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4491 if (likely(!__pyx_t_6)) {
4492 if (likely(PyList_CheckExact(__pyx_t_2))) {
4493 if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2))
break;
4494 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 4495 __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, 236, __pyx_L1_error)
4497 __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 236, __pyx_L1_error)
4498 __Pyx_GOTREF(__pyx_t_3);
4501 if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2))
break;
4502 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 4503 __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, 236, __pyx_L1_error)
4505 __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 236, __pyx_L1_error)
4506 __Pyx_GOTREF(__pyx_t_3);
4510 __pyx_t_3 = __pyx_t_6(__pyx_t_2);
4511 if (unlikely(!__pyx_t_3)) {
4512 PyObject* exc_type = PyErr_Occurred();
4514 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
4515 else __PYX_ERR(0, 236, __pyx_L1_error)
4519 __Pyx_GOTREF(__pyx_t_3);
4521 __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_idx);
4522 __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_idx, __pyx_t_3);
4523 __Pyx_GIVEREF(__pyx_t_3);
4533 __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, 237, __pyx_L1_error)
4534 __pyx_t_8 = (__pyx_t_7 != 0);
4544 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_idx);
4545 __pyx_r = __pyx_cur_scope->__pyx_v_idx;
4546 __Pyx_XGIVEREF(__pyx_t_2);
4547 __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
4548 __pyx_cur_scope->__pyx_t_1 = __pyx_t_5;
4549 __pyx_cur_scope->__pyx_t_2 = __pyx_t_6;
4550 __Pyx_XGIVEREF(__pyx_r);
4551 __Pyx_RefNannyFinishContext();
4552 __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
4554 __pyx_generator->resume_label = 1;
4556 __pyx_L7_resume_from_yield:;
4557 __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
4558 __pyx_cur_scope->__pyx_t_0 = 0;
4559 __Pyx_XGOTREF(__pyx_t_2);
4560 __pyx_t_5 = __pyx_cur_scope->__pyx_t_1;
4561 __pyx_t_6 = __pyx_cur_scope->__pyx_t_2;
4562 if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 238, __pyx_L1_error)
4581 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4582 CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
4593 PyErr_SetNone(PyExc_StopIteration);
4596 __Pyx_XDECREF(__pyx_t_1);
4597 __Pyx_XDECREF(__pyx_t_2);
4598 __Pyx_XDECREF(__pyx_t_3);
4599 __Pyx_XDECREF(__pyx_t_4);
4600 __Pyx_AddTraceback(
"__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4602 __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
4603 #if !CYTHON_USE_EXC_INFO_STACK 4604 __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
4606 __pyx_generator->resume_label = -1;
4607 __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
4608 __Pyx_RefNannyFinishContext();
4621 static PyObject *__pyx_pw_8PyClical_9index_set_18__invert__(PyObject *__pyx_v_self);
4622 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 ";
4623 #if CYTHON_COMPILING_IN_CPYTHON 4624 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_17__invert__;
4626 static PyObject *__pyx_pw_8PyClical_9index_set_18__invert__(PyObject *__pyx_v_self) {
4627 PyObject *__pyx_r = 0;
4628 __Pyx_RefNannyDeclarations
4629 __Pyx_RefNannySetupContext(
"__invert__ (wrapper)", 0);
4630 __pyx_r = __pyx_pf_8PyClical_9index_set_17__invert__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
4633 __Pyx_RefNannyFinishContext();
4637 static PyObject *__pyx_pf_8PyClical_9index_set_17__invert__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
4638 PyObject *__pyx_r = NULL;
4639 __Pyx_RefNannyDeclarations
4640 PyObject *__pyx_t_1 = NULL;
4641 PyObject *__pyx_t_2 = NULL;
4642 int __pyx_lineno = 0;
4643 const char *__pyx_filename = NULL;
4644 int __pyx_clineno = 0;
4645 __Pyx_RefNannySetupContext(
"__invert__", 0);
4654 __Pyx_XDECREF(__pyx_r);
4655 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_index_set));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error)
4656 __Pyx_GOTREF(__pyx_t_1);
4657 __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, 247, __pyx_L1_error)
4658 __Pyx_GOTREF(__pyx_t_2);
4659 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4660 __pyx_r = __pyx_t_2;
4674 __Pyx_XDECREF(__pyx_t_1);
4675 __Pyx_XDECREF(__pyx_t_2);
4676 __Pyx_AddTraceback(
"PyClical.index_set.__invert__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4679 __Pyx_XGIVEREF(__pyx_r);
4680 __Pyx_RefNannyFinishContext();
4693 static PyObject *__pyx_pw_8PyClical_9index_set_20__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
4694 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 ";
4695 #if CYTHON_COMPILING_IN_CPYTHON 4696 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_19__xor__;
4698 static PyObject *__pyx_pw_8PyClical_9index_set_20__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4699 PyObject *__pyx_r = 0;
4700 __Pyx_RefNannyDeclarations
4701 __Pyx_RefNannySetupContext(
"__xor__ (wrapper)", 0);
4702 __pyx_r = __pyx_pf_8PyClical_9index_set_19__xor__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
4705 __Pyx_RefNannyFinishContext();
4709 static PyObject *__pyx_pf_8PyClical_9index_set_19__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4710 PyObject *__pyx_r = NULL;
4711 __Pyx_RefNannyDeclarations
4712 PyObject *__pyx_t_1 = NULL;
4713 PyObject *__pyx_t_2 = NULL;
4714 int __pyx_lineno = 0;
4715 const char *__pyx_filename = NULL;
4716 int __pyx_clineno = 0;
4717 __Pyx_RefNannySetupContext(
"__xor__", 0);
4726 __Pyx_XDECREF(__pyx_r);
4727 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_index_set));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 258, __pyx_L1_error)
4728 __Pyx_GOTREF(__pyx_t_1);
4729 __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, 258, __pyx_L1_error)
4730 __Pyx_GOTREF(__pyx_t_2);
4731 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4732 __pyx_r = __pyx_t_2;
4746 __Pyx_XDECREF(__pyx_t_1);
4747 __Pyx_XDECREF(__pyx_t_2);
4748 __Pyx_AddTraceback(
"PyClical.index_set.__xor__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4751 __Pyx_XGIVEREF(__pyx_r);
4752 __Pyx_RefNannyFinishContext();
4765 static PyObject *__pyx_pw_8PyClical_9index_set_22__ixor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
4766 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 ";
4767 #if CYTHON_COMPILING_IN_CPYTHON 4768 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_21__ixor__;
4770 static PyObject *__pyx_pw_8PyClical_9index_set_22__ixor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
4771 PyObject *__pyx_r = 0;
4772 __Pyx_RefNannyDeclarations
4773 __Pyx_RefNannySetupContext(
"__ixor__ (wrapper)", 0);
4774 __pyx_r = __pyx_pf_8PyClical_9index_set_21__ixor__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
4777 __Pyx_RefNannyFinishContext();
4781 static PyObject *__pyx_pf_8PyClical_9index_set_21__ixor__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs) {
4782 PyObject *__pyx_r = NULL;
4783 __Pyx_RefNannyDeclarations
4784 PyObject *__pyx_t_1 = NULL;
4785 int __pyx_lineno = 0;
4786 const char *__pyx_filename = NULL;
4787 int __pyx_clineno = 0;
4788 __Pyx_RefNannySetupContext(
"__ixor__", 0);
4797 __Pyx_XDECREF(__pyx_r);
4798 __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, 269, __pyx_L1_error)
4799 __Pyx_GOTREF(__pyx_t_1);
4800 __pyx_r = __pyx_t_1;
4814 __Pyx_XDECREF(__pyx_t_1);
4815 __Pyx_AddTraceback(
"PyClical.index_set.__ixor__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4818 __Pyx_XGIVEREF(__pyx_r);
4819 __Pyx_RefNannyFinishContext();
4832 static PyObject *__pyx_pw_8PyClical_9index_set_24__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
4833 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 ";
4834 #if CYTHON_COMPILING_IN_CPYTHON 4835 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_23__and__;
4837 static PyObject *__pyx_pw_8PyClical_9index_set_24__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4838 PyObject *__pyx_r = 0;
4839 __Pyx_RefNannyDeclarations
4840 __Pyx_RefNannySetupContext(
"__and__ (wrapper)", 0);
4841 __pyx_r = __pyx_pf_8PyClical_9index_set_23__and__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
4844 __Pyx_RefNannyFinishContext();
4848 static PyObject *__pyx_pf_8PyClical_9index_set_23__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4849 PyObject *__pyx_r = NULL;
4850 __Pyx_RefNannyDeclarations
4851 PyObject *__pyx_t_1 = NULL;
4852 PyObject *__pyx_t_2 = NULL;
4853 int __pyx_lineno = 0;
4854 const char *__pyx_filename = NULL;
4855 int __pyx_clineno = 0;
4856 __Pyx_RefNannySetupContext(
"__and__", 0);
4865 __Pyx_XDECREF(__pyx_r);
4866 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_index_set));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error)
4867 __Pyx_GOTREF(__pyx_t_1);
4868 __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, 280, __pyx_L1_error)
4869 __Pyx_GOTREF(__pyx_t_2);
4870 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4871 __pyx_r = __pyx_t_2;
4885 __Pyx_XDECREF(__pyx_t_1);
4886 __Pyx_XDECREF(__pyx_t_2);
4887 __Pyx_AddTraceback(
"PyClical.index_set.__and__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4890 __Pyx_XGIVEREF(__pyx_r);
4891 __Pyx_RefNannyFinishContext();
4904 static PyObject *__pyx_pw_8PyClical_9index_set_26__iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
4905 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 ";
4906 #if CYTHON_COMPILING_IN_CPYTHON 4907 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_25__iand__;
4909 static PyObject *__pyx_pw_8PyClical_9index_set_26__iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
4910 PyObject *__pyx_r = 0;
4911 __Pyx_RefNannyDeclarations
4912 __Pyx_RefNannySetupContext(
"__iand__ (wrapper)", 0);
4913 __pyx_r = __pyx_pf_8PyClical_9index_set_25__iand__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
4916 __Pyx_RefNannyFinishContext();
4920 static PyObject *__pyx_pf_8PyClical_9index_set_25__iand__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs) {
4921 PyObject *__pyx_r = NULL;
4922 __Pyx_RefNannyDeclarations
4923 PyObject *__pyx_t_1 = NULL;
4924 int __pyx_lineno = 0;
4925 const char *__pyx_filename = NULL;
4926 int __pyx_clineno = 0;
4927 __Pyx_RefNannySetupContext(
"__iand__", 0);
4936 __Pyx_XDECREF(__pyx_r);
4937 __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, 291, __pyx_L1_error)
4938 __Pyx_GOTREF(__pyx_t_1);
4939 __pyx_r = __pyx_t_1;
4953 __Pyx_XDECREF(__pyx_t_1);
4954 __Pyx_AddTraceback(
"PyClical.index_set.__iand__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4957 __Pyx_XGIVEREF(__pyx_r);
4958 __Pyx_RefNannyFinishContext();
4971 static PyObject *__pyx_pw_8PyClical_9index_set_28__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
4972 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 ";
4973 #if CYTHON_COMPILING_IN_CPYTHON 4974 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_27__or__;
4976 static PyObject *__pyx_pw_8PyClical_9index_set_28__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4977 PyObject *__pyx_r = 0;
4978 __Pyx_RefNannyDeclarations
4979 __Pyx_RefNannySetupContext(
"__or__ (wrapper)", 0);
4980 __pyx_r = __pyx_pf_8PyClical_9index_set_27__or__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
4983 __Pyx_RefNannyFinishContext();
4987 static PyObject *__pyx_pf_8PyClical_9index_set_27__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4988 PyObject *__pyx_r = NULL;
4989 __Pyx_RefNannyDeclarations
4990 PyObject *__pyx_t_1 = NULL;
4991 PyObject *__pyx_t_2 = NULL;
4992 int __pyx_lineno = 0;
4993 const char *__pyx_filename = NULL;
4994 int __pyx_clineno = 0;
4995 __Pyx_RefNannySetupContext(
"__or__", 0);
5004 __Pyx_XDECREF(__pyx_r);
5005 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_index_set));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error)
5006 __Pyx_GOTREF(__pyx_t_1);
5007 __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, 302, __pyx_L1_error)
5008 __Pyx_GOTREF(__pyx_t_2);
5009 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5010 __pyx_r = __pyx_t_2;
5024 __Pyx_XDECREF(__pyx_t_1);
5025 __Pyx_XDECREF(__pyx_t_2);
5026 __Pyx_AddTraceback(
"PyClical.index_set.__or__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5029 __Pyx_XGIVEREF(__pyx_r);
5030 __Pyx_RefNannyFinishContext();
5043 static PyObject *__pyx_pw_8PyClical_9index_set_30__ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
5044 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 ";
5045 #if CYTHON_COMPILING_IN_CPYTHON 5046 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_29__ior__;
5048 static PyObject *__pyx_pw_8PyClical_9index_set_30__ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
5049 PyObject *__pyx_r = 0;
5050 __Pyx_RefNannyDeclarations
5051 __Pyx_RefNannySetupContext(
"__ior__ (wrapper)", 0);
5052 __pyx_r = __pyx_pf_8PyClical_9index_set_29__ior__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
5055 __Pyx_RefNannyFinishContext();
5059 static PyObject *__pyx_pf_8PyClical_9index_set_29__ior__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs) {
5060 PyObject *__pyx_r = NULL;
5061 __Pyx_RefNannyDeclarations
5062 PyObject *__pyx_t_1 = NULL;
5063 int __pyx_lineno = 0;
5064 const char *__pyx_filename = NULL;
5065 int __pyx_clineno = 0;
5066 __Pyx_RefNannySetupContext(
"__ior__", 0);
5075 __Pyx_XDECREF(__pyx_r);
5076 __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, 313, __pyx_L1_error)
5077 __Pyx_GOTREF(__pyx_t_1);
5078 __pyx_r = __pyx_t_1;
5092 __Pyx_XDECREF(__pyx_t_1);
5093 __Pyx_AddTraceback(
"PyClical.index_set.__ior__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5096 __Pyx_XGIVEREF(__pyx_r);
5097 __Pyx_RefNannyFinishContext();
5110 static PyObject *__pyx_pw_8PyClical_9index_set_32count(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5111 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 ";
5112 static PyObject *__pyx_pw_8PyClical_9index_set_32count(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5113 PyObject *__pyx_r = 0;
5114 __Pyx_RefNannyDeclarations
5115 __Pyx_RefNannySetupContext(
"count (wrapper)", 0);
5116 __pyx_r = __pyx_pf_8PyClical_9index_set_31count(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5119 __Pyx_RefNannyFinishContext();
5123 static PyObject *__pyx_pf_8PyClical_9index_set_31count(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5124 PyObject *__pyx_r = NULL;
5125 __Pyx_RefNannyDeclarations
5126 PyObject *__pyx_t_1 = NULL;
5127 int __pyx_lineno = 0;
5128 const char *__pyx_filename = NULL;
5129 int __pyx_clineno = 0;
5130 __Pyx_RefNannySetupContext(
"count", 0);
5139 __Pyx_XDECREF(__pyx_r);
5140 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->instance->count());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error)
5141 __Pyx_GOTREF(__pyx_t_1);
5142 __pyx_r = __pyx_t_1;
5156 __Pyx_XDECREF(__pyx_t_1);
5157 __Pyx_AddTraceback(
"PyClical.index_set.count", __pyx_clineno, __pyx_lineno, __pyx_filename);
5160 __Pyx_XGIVEREF(__pyx_r);
5161 __Pyx_RefNannyFinishContext();
5174 static PyObject *__pyx_pw_8PyClical_9index_set_34count_neg(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5175 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 ";
5176 static PyObject *__pyx_pw_8PyClical_9index_set_34count_neg(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5177 PyObject *__pyx_r = 0;
5178 __Pyx_RefNannyDeclarations
5179 __Pyx_RefNannySetupContext(
"count_neg (wrapper)", 0);
5180 __pyx_r = __pyx_pf_8PyClical_9index_set_33count_neg(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5183 __Pyx_RefNannyFinishContext();
5187 static PyObject *__pyx_pf_8PyClical_9index_set_33count_neg(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5188 PyObject *__pyx_r = NULL;
5189 __Pyx_RefNannyDeclarations
5190 PyObject *__pyx_t_1 = NULL;
5191 int __pyx_lineno = 0;
5192 const char *__pyx_filename = NULL;
5193 int __pyx_clineno = 0;
5194 __Pyx_RefNannySetupContext(
"count_neg", 0);
5203 __Pyx_XDECREF(__pyx_r);
5204 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->instance->count_neg());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 331, __pyx_L1_error)
5205 __Pyx_GOTREF(__pyx_t_1);
5206 __pyx_r = __pyx_t_1;
5220 __Pyx_XDECREF(__pyx_t_1);
5221 __Pyx_AddTraceback(
"PyClical.index_set.count_neg", __pyx_clineno, __pyx_lineno, __pyx_filename);
5224 __Pyx_XGIVEREF(__pyx_r);
5225 __Pyx_RefNannyFinishContext();
5238 static PyObject *__pyx_pw_8PyClical_9index_set_36count_pos(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5239 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 ";
5240 static PyObject *__pyx_pw_8PyClical_9index_set_36count_pos(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5241 PyObject *__pyx_r = 0;
5242 __Pyx_RefNannyDeclarations
5243 __Pyx_RefNannySetupContext(
"count_pos (wrapper)", 0);
5244 __pyx_r = __pyx_pf_8PyClical_9index_set_35count_pos(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5247 __Pyx_RefNannyFinishContext();
5251 static PyObject *__pyx_pf_8PyClical_9index_set_35count_pos(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5252 PyObject *__pyx_r = NULL;
5253 __Pyx_RefNannyDeclarations
5254 PyObject *__pyx_t_1 = NULL;
5255 int __pyx_lineno = 0;
5256 const char *__pyx_filename = NULL;
5257 int __pyx_clineno = 0;
5258 __Pyx_RefNannySetupContext(
"count_pos", 0);
5267 __Pyx_XDECREF(__pyx_r);
5268 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->instance->count_pos());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 340, __pyx_L1_error)
5269 __Pyx_GOTREF(__pyx_t_1);
5270 __pyx_r = __pyx_t_1;
5284 __Pyx_XDECREF(__pyx_t_1);
5285 __Pyx_AddTraceback(
"PyClical.index_set.count_pos", __pyx_clineno, __pyx_lineno, __pyx_filename);
5288 __Pyx_XGIVEREF(__pyx_r);
5289 __Pyx_RefNannyFinishContext();
5302 static PyObject *__pyx_pw_8PyClical_9index_set_38min(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5303 static char __pyx_doc_8PyClical_9index_set_37min[] =
"\n Minimum member.\n\n >>> index_set({-1,1,2}).min()\n -1\n ";
5304 static PyObject *__pyx_pw_8PyClical_9index_set_38min(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5305 PyObject *__pyx_r = 0;
5306 __Pyx_RefNannyDeclarations
5307 __Pyx_RefNannySetupContext(
"min (wrapper)", 0);
5308 __pyx_r = __pyx_pf_8PyClical_9index_set_37min(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5311 __Pyx_RefNannyFinishContext();
5315 static PyObject *__pyx_pf_8PyClical_9index_set_37min(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5316 PyObject *__pyx_r = NULL;
5317 __Pyx_RefNannyDeclarations
5318 PyObject *__pyx_t_1 = NULL;
5319 int __pyx_lineno = 0;
5320 const char *__pyx_filename = NULL;
5321 int __pyx_clineno = 0;
5322 __Pyx_RefNannySetupContext(
"min", 0);
5331 __Pyx_XDECREF(__pyx_r);
5332 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->instance->min());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 349, __pyx_L1_error)
5333 __Pyx_GOTREF(__pyx_t_1);
5334 __pyx_r = __pyx_t_1;
5348 __Pyx_XDECREF(__pyx_t_1);
5349 __Pyx_AddTraceback(
"PyClical.index_set.min", __pyx_clineno, __pyx_lineno, __pyx_filename);
5352 __Pyx_XGIVEREF(__pyx_r);
5353 __Pyx_RefNannyFinishContext();
5366 static PyObject *__pyx_pw_8PyClical_9index_set_40max(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5367 static char __pyx_doc_8PyClical_9index_set_39max[] =
"\n Maximum member.\n\n >>> index_set({-1,1,2}).max()\n 2\n ";
5368 static PyObject *__pyx_pw_8PyClical_9index_set_40max(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5369 PyObject *__pyx_r = 0;
5370 __Pyx_RefNannyDeclarations
5371 __Pyx_RefNannySetupContext(
"max (wrapper)", 0);
5372 __pyx_r = __pyx_pf_8PyClical_9index_set_39max(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5375 __Pyx_RefNannyFinishContext();
5379 static PyObject *__pyx_pf_8PyClical_9index_set_39max(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5380 PyObject *__pyx_r = NULL;
5381 __Pyx_RefNannyDeclarations
5382 PyObject *__pyx_t_1 = NULL;
5383 int __pyx_lineno = 0;
5384 const char *__pyx_filename = NULL;
5385 int __pyx_clineno = 0;
5386 __Pyx_RefNannySetupContext(
"max", 0);
5395 __Pyx_XDECREF(__pyx_r);
5396 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->instance->max());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 358, __pyx_L1_error)
5397 __Pyx_GOTREF(__pyx_t_1);
5398 __pyx_r = __pyx_t_1;
5412 __Pyx_XDECREF(__pyx_t_1);
5413 __Pyx_AddTraceback(
"PyClical.index_set.max", __pyx_clineno, __pyx_lineno, __pyx_filename);
5416 __Pyx_XGIVEREF(__pyx_r);
5417 __Pyx_RefNannyFinishContext();
5430 static PyObject *__pyx_pw_8PyClical_9index_set_42hash_fn(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5431 static char __pyx_doc_8PyClical_9index_set_41hash_fn[] =
"\n Hash function.\n ";
5432 static PyObject *__pyx_pw_8PyClical_9index_set_42hash_fn(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5433 PyObject *__pyx_r = 0;
5434 __Pyx_RefNannyDeclarations
5435 __Pyx_RefNannySetupContext(
"hash_fn (wrapper)", 0);
5436 __pyx_r = __pyx_pf_8PyClical_9index_set_41hash_fn(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5439 __Pyx_RefNannyFinishContext();
5443 static PyObject *__pyx_pf_8PyClical_9index_set_41hash_fn(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5444 PyObject *__pyx_r = NULL;
5445 __Pyx_RefNannyDeclarations
5446 PyObject *__pyx_t_1 = NULL;
5447 int __pyx_lineno = 0;
5448 const char *__pyx_filename = NULL;
5449 int __pyx_clineno = 0;
5450 __Pyx_RefNannySetupContext(
"hash_fn", 0);
5459 __Pyx_XDECREF(__pyx_r);
5460 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->instance->hash_fn());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 364, __pyx_L1_error)
5461 __Pyx_GOTREF(__pyx_t_1);
5462 __pyx_r = __pyx_t_1;
5476 __Pyx_XDECREF(__pyx_t_1);
5477 __Pyx_AddTraceback(
"PyClical.index_set.hash_fn", __pyx_clineno, __pyx_lineno, __pyx_filename);
5480 __Pyx_XGIVEREF(__pyx_r);
5481 __Pyx_RefNannyFinishContext();
5494 static PyObject *__pyx_pw_8PyClical_9index_set_44sign_of_mult(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
5495 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 ";
5496 static PyObject *__pyx_pw_8PyClical_9index_set_44sign_of_mult(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
5497 PyObject *__pyx_r = 0;
5498 __Pyx_RefNannyDeclarations
5499 __Pyx_RefNannySetupContext(
"sign_of_mult (wrapper)", 0);
5500 __pyx_r = __pyx_pf_8PyClical_9index_set_43sign_of_mult(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
5503 __Pyx_RefNannyFinishContext();
5507 static PyObject *__pyx_pf_8PyClical_9index_set_43sign_of_mult(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs) {
5508 PyObject *__pyx_r = NULL;
5509 __Pyx_RefNannyDeclarations
5510 PyObject *__pyx_t_1 = NULL;
5511 int __pyx_lineno = 0;
5512 const char *__pyx_filename = NULL;
5513 int __pyx_clineno = 0;
5514 __Pyx_RefNannySetupContext(
"sign_of_mult", 0);
5523 __Pyx_XDECREF(__pyx_r);
5524 __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, 373, __pyx_L1_error)
5525 __Pyx_GOTREF(__pyx_t_1);
5526 __pyx_r = __pyx_t_1;
5540 __Pyx_XDECREF(__pyx_t_1);
5541 __Pyx_AddTraceback(
"PyClical.index_set.sign_of_mult", __pyx_clineno, __pyx_lineno, __pyx_filename);
5544 __Pyx_XGIVEREF(__pyx_r);
5545 __Pyx_RefNannyFinishContext();
5558 static PyObject *__pyx_pw_8PyClical_9index_set_46sign_of_square(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5559 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 ";
5560 static PyObject *__pyx_pw_8PyClical_9index_set_46sign_of_square(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5561 PyObject *__pyx_r = 0;
5562 __Pyx_RefNannyDeclarations
5563 __Pyx_RefNannySetupContext(
"sign_of_square (wrapper)", 0);
5564 __pyx_r = __pyx_pf_8PyClical_9index_set_45sign_of_square(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5567 __Pyx_RefNannyFinishContext();
5571 static PyObject *__pyx_pf_8PyClical_9index_set_45sign_of_square(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5572 PyObject *__pyx_r = NULL;
5573 __Pyx_RefNannyDeclarations
5574 PyObject *__pyx_t_1 = NULL;
5575 int __pyx_lineno = 0;
5576 const char *__pyx_filename = NULL;
5577 int __pyx_clineno = 0;
5578 __Pyx_RefNannySetupContext(
"sign_of_square", 0);
5587 __Pyx_XDECREF(__pyx_r);
5588 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->instance->sign_of_square());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error)
5589 __Pyx_GOTREF(__pyx_t_1);
5590 __pyx_r = __pyx_t_1;
5604 __Pyx_XDECREF(__pyx_t_1);
5605 __Pyx_AddTraceback(
"PyClical.index_set.sign_of_square", __pyx_clineno, __pyx_lineno, __pyx_filename);
5608 __Pyx_XGIVEREF(__pyx_r);
5609 __Pyx_RefNannyFinishContext();
5622 static PyObject *__pyx_pw_8PyClical_9index_set_48__repr__(PyObject *__pyx_v_self);
5623 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 ";
5624 #if CYTHON_COMPILING_IN_CPYTHON 5625 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_47__repr__;
5627 static PyObject *__pyx_pw_8PyClical_9index_set_48__repr__(PyObject *__pyx_v_self) {
5628 PyObject *__pyx_r = 0;
5629 __Pyx_RefNannyDeclarations
5630 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
5631 __pyx_r = __pyx_pf_8PyClical_9index_set_47__repr__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5634 __Pyx_RefNannyFinishContext();
5638 static PyObject *__pyx_pf_8PyClical_9index_set_47__repr__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5639 PyObject *__pyx_r = NULL;
5640 __Pyx_RefNannyDeclarations
5641 PyObject *__pyx_t_1 = NULL;
5642 int __pyx_lineno = 0;
5643 const char *__pyx_filename = NULL;
5644 int __pyx_clineno = 0;
5645 __Pyx_RefNannySetupContext(
"__repr__", 0);
5654 __Pyx_XDECREF(__pyx_r);
5655 __pyx_t_1 = __Pyx_decode_cpp_string(
index_set_to_repr(__pyx_f_8PyClical_9index_set_unwrap(__pyx_v_self)), 0, PY_SSIZE_T_MAX, NULL, NULL, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 393, __pyx_L1_error)
5656 __Pyx_GOTREF(__pyx_t_1);
5657 __pyx_r = __pyx_t_1;
5671 __Pyx_XDECREF(__pyx_t_1);
5672 __Pyx_AddTraceback(
"PyClical.index_set.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5675 __Pyx_XGIVEREF(__pyx_r);
5676 __Pyx_RefNannyFinishContext();
5689 static PyObject *__pyx_pw_8PyClical_9index_set_50__str__(PyObject *__pyx_v_self);
5690 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 ";
5691 #if CYTHON_COMPILING_IN_CPYTHON 5692 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_49__str__;
5694 static PyObject *__pyx_pw_8PyClical_9index_set_50__str__(PyObject *__pyx_v_self) {
5695 PyObject *__pyx_r = 0;
5696 __Pyx_RefNannyDeclarations
5697 __Pyx_RefNannySetupContext(
"__str__ (wrapper)", 0);
5698 __pyx_r = __pyx_pf_8PyClical_9index_set_49__str__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5701 __Pyx_RefNannyFinishContext();
5705 static PyObject *__pyx_pf_8PyClical_9index_set_49__str__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5706 PyObject *__pyx_r = NULL;
5707 __Pyx_RefNannyDeclarations
5708 PyObject *__pyx_t_1 = NULL;
5709 int __pyx_lineno = 0;
5710 const char *__pyx_filename = NULL;
5711 int __pyx_clineno = 0;
5712 __Pyx_RefNannySetupContext(
"__str__", 0);
5721 __Pyx_XDECREF(__pyx_r);
5722 __pyx_t_1 = __Pyx_decode_cpp_string(
index_set_to_str(__pyx_f_8PyClical_9index_set_unwrap(__pyx_v_self)), 0, PY_SSIZE_T_MAX, NULL, NULL, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 404, __pyx_L1_error)
5723 __Pyx_GOTREF(__pyx_t_1);
5724 __pyx_r = __pyx_t_1;
5738 __Pyx_XDECREF(__pyx_t_1);
5739 __Pyx_AddTraceback(
"PyClical.index_set.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5742 __Pyx_XGIVEREF(__pyx_r);
5743 __Pyx_RefNannyFinishContext();
5754 static PyObject *__pyx_pw_8PyClical_9index_set_52__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5755 static PyObject *__pyx_pw_8PyClical_9index_set_52__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5756 PyObject *__pyx_r = 0;
5757 __Pyx_RefNannyDeclarations
5758 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
5759 __pyx_r = __pyx_pf_8PyClical_9index_set_51__reduce_cython__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5762 __Pyx_RefNannyFinishContext();
5766 static PyObject *__pyx_pf_8PyClical_9index_set_51__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5767 PyObject *__pyx_r = NULL;
5768 __Pyx_RefNannyDeclarations
5769 PyObject *__pyx_t_1 = NULL;
5770 int __pyx_lineno = 0;
5771 const char *__pyx_filename = NULL;
5772 int __pyx_clineno = 0;
5773 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
5781 __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)
5782 __Pyx_GOTREF(__pyx_t_1);
5783 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5784 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5785 __PYX_ERR(1, 2, __pyx_L1_error)
5795 __Pyx_XDECREF(__pyx_t_1);
5796 __Pyx_AddTraceback(
"PyClical.index_set.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5798 __Pyx_XGIVEREF(__pyx_r);
5799 __Pyx_RefNannyFinishContext();
5811 static PyObject *__pyx_pw_8PyClical_9index_set_54__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
5812 static PyObject *__pyx_pw_8PyClical_9index_set_54__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
5813 PyObject *__pyx_r = 0;
5814 __Pyx_RefNannyDeclarations
5815 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
5816 __pyx_r = __pyx_pf_8PyClical_9index_set_53__setstate_cython__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
5819 __Pyx_RefNannyFinishContext();
5823 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) {
5824 PyObject *__pyx_r = NULL;
5825 __Pyx_RefNannyDeclarations
5826 PyObject *__pyx_t_1 = NULL;
5827 int __pyx_lineno = 0;
5828 const char *__pyx_filename = NULL;
5829 int __pyx_clineno = 0;
5830 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
5837 __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)
5838 __Pyx_GOTREF(__pyx_t_1);
5839 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5840 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5841 __PYX_ERR(1, 4, __pyx_L1_error)
5852 __Pyx_XDECREF(__pyx_t_1);
5853 __Pyx_AddTraceback(
"PyClical.index_set.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5855 __Pyx_XGIVEREF(__pyx_r);
5856 __Pyx_RefNannyFinishContext();
5869 static PyObject *__pyx_pw_8PyClical_1index_set_hidden_doctests(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused);
5870 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 {1, 2, 100}.\n >>> print(index_set([1,2]))\n Traceback (most recent call last):\n ...\n TypeError: Cannot initialize index_set object from <class '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_set({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 ";
5871 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};
5872 static PyObject *__pyx_pw_8PyClical_1index_set_hidden_doctests(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
5873 PyObject *__pyx_r = 0;
5874 __Pyx_RefNannyDeclarations
5875 __Pyx_RefNannySetupContext(
"index_set_hidden_doctests (wrapper)", 0);
5876 __pyx_r = __pyx_pf_8PyClical_index_set_hidden_doctests(__pyx_self);
5879 __Pyx_RefNannyFinishContext();
5883 static PyObject *__pyx_pf_8PyClical_index_set_hidden_doctests(CYTHON_UNUSED PyObject *__pyx_self) {
5884 PyObject *__pyx_r = NULL;
5885 __Pyx_RefNannyDeclarations
5886 __Pyx_RefNannySetupContext(
"index_set_hidden_doctests", 0);
5895 __Pyx_XDECREF(__pyx_r);
5896 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5909 __Pyx_XGIVEREF(__pyx_r);
5910 __Pyx_RefNannyFinishContext();
5922 static PyObject *__pyx_pw_8PyClical_3compare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5923 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_compare(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs, CYTHON_UNUSED
int __pyx_skip_dispatch) {
5924 PyObject *__pyx_r = NULL;
5925 __Pyx_RefNannyDeclarations
5926 PyObject *__pyx_t_1 = NULL;
5927 int __pyx_lineno = 0;
5928 const char *__pyx_filename = NULL;
5929 int __pyx_clineno = 0;
5930 __Pyx_RefNannySetupContext(
"compare", 0);
5939 __Pyx_XDECREF(__pyx_r);
5940 __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, 502, __pyx_L1_error)
5941 __Pyx_GOTREF(__pyx_t_1);
5942 __pyx_r = __pyx_t_1;
5956 __Pyx_XDECREF(__pyx_t_1);
5957 __Pyx_AddTraceback(
"PyClical.compare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5960 __Pyx_XGIVEREF(__pyx_r);
5961 __Pyx_RefNannyFinishContext();
5966 static PyObject *__pyx_pw_8PyClical_3compare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5967 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 ";
5968 static PyObject *__pyx_pw_8PyClical_3compare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5969 PyObject *__pyx_v_lhs = 0;
5970 PyObject *__pyx_v_rhs = 0;
5971 int __pyx_lineno = 0;
5972 const char *__pyx_filename = NULL;
5973 int __pyx_clineno = 0;
5974 PyObject *__pyx_r = 0;
5975 __Pyx_RefNannyDeclarations
5976 __Pyx_RefNannySetupContext(
"compare (wrapper)", 0);
5978 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lhs,&__pyx_n_s_rhs,0};
5979 PyObject* values[2] = {0,0};
5980 if (unlikely(__pyx_kwds)) {
5982 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5984 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5986 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5989 default:
goto __pyx_L5_argtuple_error;
5991 kw_args = PyDict_Size(__pyx_kwds);
5994 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lhs)) != 0)) kw_args--;
5995 else goto __pyx_L5_argtuple_error;
5998 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rhs)) != 0)) kw_args--;
6000 __Pyx_RaiseArgtupleInvalid(
"compare", 1, 2, 2, 1); __PYX_ERR(0, 492, __pyx_L3_error)
6003 if (unlikely(kw_args > 0)) {
6004 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"compare") < 0)) __PYX_ERR(0, 492, __pyx_L3_error)
6006 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
6007 goto __pyx_L5_argtuple_error;
6009 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6010 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6012 __pyx_v_lhs = values[0];
6013 __pyx_v_rhs = values[1];
6015 goto __pyx_L4_argument_unpacking_done;
6016 __pyx_L5_argtuple_error:;
6017 __Pyx_RaiseArgtupleInvalid(
"compare", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 492, __pyx_L3_error)
6019 __Pyx_AddTraceback(
"PyClical.compare", __pyx_clineno, __pyx_lineno, __pyx_filename);
6020 __Pyx_RefNannyFinishContext();
6022 __pyx_L4_argument_unpacking_done:;
6023 __pyx_r = __pyx_pf_8PyClical_2compare(__pyx_self, __pyx_v_lhs, __pyx_v_rhs);
6026 __Pyx_RefNannyFinishContext();
6030 static PyObject *__pyx_pf_8PyClical_2compare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
6031 PyObject *__pyx_r = NULL;
6032 __Pyx_RefNannyDeclarations
6033 PyObject *__pyx_t_1 = NULL;
6034 int __pyx_lineno = 0;
6035 const char *__pyx_filename = NULL;
6036 int __pyx_clineno = 0;
6037 __Pyx_RefNannySetupContext(
"compare", 0);
6038 __Pyx_XDECREF(__pyx_r);
6039 __pyx_t_1 = __pyx_f_8PyClical_compare(__pyx_v_lhs, __pyx_v_rhs, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 492, __pyx_L1_error)
6040 __Pyx_GOTREF(__pyx_t_1);
6041 __pyx_r = __pyx_t_1;
6047 __Pyx_XDECREF(__pyx_t_1);
6048 __Pyx_AddTraceback(
"PyClical.compare", __pyx_clineno, __pyx_lineno, __pyx_filename);
6051 __Pyx_XGIVEREF(__pyx_r);
6052 __Pyx_RefNannyFinishContext();
6064 static PyObject *__pyx_pw_8PyClical_5min_neg(PyObject *__pyx_self, PyObject *__pyx_v_obj);
6065 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_min_neg(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
6066 PyObject *__pyx_r = NULL;
6067 __Pyx_RefNannyDeclarations
6068 PyObject *__pyx_t_1 = NULL;
6069 int __pyx_lineno = 0;
6070 const char *__pyx_filename = NULL;
6071 int __pyx_clineno = 0;
6072 __Pyx_RefNannySetupContext(
"min_neg", 0);
6081 __Pyx_XDECREF(__pyx_r);
6082 __pyx_t_1 = __Pyx_PyInt_From_int(
min_neg(__pyx_f_8PyClical_toIndexSet(__pyx_v_obj)));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 511, __pyx_L1_error)
6083 __Pyx_GOTREF(__pyx_t_1);
6084 __pyx_r = __pyx_t_1;
6098 __Pyx_XDECREF(__pyx_t_1);
6099 __Pyx_AddTraceback(
"PyClical.min_neg", __pyx_clineno, __pyx_lineno, __pyx_filename);
6102 __Pyx_XGIVEREF(__pyx_r);
6103 __Pyx_RefNannyFinishContext();
6108 static PyObject *__pyx_pw_8PyClical_5min_neg(PyObject *__pyx_self, PyObject *__pyx_v_obj);
6109 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 ";
6110 static PyObject *__pyx_pw_8PyClical_5min_neg(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
6111 PyObject *__pyx_r = 0;
6112 __Pyx_RefNannyDeclarations
6113 __Pyx_RefNannySetupContext(
"min_neg (wrapper)", 0);
6114 __pyx_r = __pyx_pf_8PyClical_4min_neg(__pyx_self, ((PyObject *)__pyx_v_obj));
6117 __Pyx_RefNannyFinishContext();
6121 static PyObject *__pyx_pf_8PyClical_4min_neg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
6122 PyObject *__pyx_r = NULL;
6123 __Pyx_RefNannyDeclarations
6124 PyObject *__pyx_t_1 = NULL;
6125 int __pyx_lineno = 0;
6126 const char *__pyx_filename = NULL;
6127 int __pyx_clineno = 0;
6128 __Pyx_RefNannySetupContext(
"min_neg", 0);
6129 __Pyx_XDECREF(__pyx_r);
6130 __pyx_t_1 = __pyx_f_8PyClical_min_neg(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error)
6131 __Pyx_GOTREF(__pyx_t_1);
6132 __pyx_r = __pyx_t_1;
6138 __Pyx_XDECREF(__pyx_t_1);
6139 __Pyx_AddTraceback(
"PyClical.min_neg", __pyx_clineno, __pyx_lineno, __pyx_filename);
6142 __Pyx_XGIVEREF(__pyx_r);
6143 __Pyx_RefNannyFinishContext();
6155 static PyObject *__pyx_pw_8PyClical_7max_pos(PyObject *__pyx_self, PyObject *__pyx_v_obj);
6156 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_max_pos(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
6157 PyObject *__pyx_r = NULL;
6158 __Pyx_RefNannyDeclarations
6159 PyObject *__pyx_t_1 = NULL;
6160 int __pyx_lineno = 0;
6161 const char *__pyx_filename = NULL;
6162 int __pyx_clineno = 0;
6163 __Pyx_RefNannySetupContext(
"max_pos", 0);
6172 __Pyx_XDECREF(__pyx_r);
6173 __pyx_t_1 = __Pyx_PyInt_From_int(
max_pos(__pyx_f_8PyClical_toIndexSet(__pyx_v_obj)));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error)
6174 __Pyx_GOTREF(__pyx_t_1);
6175 __pyx_r = __pyx_t_1;
6189 __Pyx_XDECREF(__pyx_t_1);
6190 __Pyx_AddTraceback(
"PyClical.max_pos", __pyx_clineno, __pyx_lineno, __pyx_filename);
6193 __Pyx_XGIVEREF(__pyx_r);
6194 __Pyx_RefNannyFinishContext();
6199 static PyObject *__pyx_pw_8PyClical_7max_pos(PyObject *__pyx_self, PyObject *__pyx_v_obj);
6200 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 ";
6201 static PyObject *__pyx_pw_8PyClical_7max_pos(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
6202 PyObject *__pyx_r = 0;
6203 __Pyx_RefNannyDeclarations
6204 __Pyx_RefNannySetupContext(
"max_pos (wrapper)", 0);
6205 __pyx_r = __pyx_pf_8PyClical_6max_pos(__pyx_self, ((PyObject *)__pyx_v_obj));
6208 __Pyx_RefNannyFinishContext();
6212 static PyObject *__pyx_pf_8PyClical_6max_pos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
6213 PyObject *__pyx_r = NULL;
6214 __Pyx_RefNannyDeclarations
6215 PyObject *__pyx_t_1 = NULL;
6216 int __pyx_lineno = 0;
6217 const char *__pyx_filename = NULL;
6218 int __pyx_clineno = 0;
6219 __Pyx_RefNannySetupContext(
"max_pos", 0);
6220 __Pyx_XDECREF(__pyx_r);
6221 __pyx_t_1 = __pyx_f_8PyClical_max_pos(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 513, __pyx_L1_error)
6222 __Pyx_GOTREF(__pyx_t_1);
6223 __pyx_r = __pyx_t_1;
6229 __Pyx_XDECREF(__pyx_t_1);
6230 __Pyx_AddTraceback(
"PyClical.max_pos", __pyx_clineno, __pyx_lineno, __pyx_filename);
6233 __Pyx_XGIVEREF(__pyx_r);
6234 __Pyx_RefNannyFinishContext();
6246 static CYTHON_INLINE std::vector<scalar_t> __pyx_f_8PyClical_list_to_vector(PyObject *__pyx_v_lst) {
6247 std::vector<scalar_t> __pyx_v_v;
6248 PyObject *__pyx_v_s = NULL;
6249 std::vector<scalar_t> __pyx_r;
6250 __Pyx_RefNannyDeclarations
6251 PyObject *__pyx_t_1 = NULL;
6252 Py_ssize_t __pyx_t_2;
6253 PyObject *(*__pyx_t_3)(PyObject *);
6254 PyObject *__pyx_t_4 = NULL;
6256 int __pyx_lineno = 0;
6257 const char *__pyx_filename = NULL;
6258 int __pyx_clineno = 0;
6259 __Pyx_RefNannySetupContext(
"list_to_vector", 0);
6268 if (likely(PyList_CheckExact(__pyx_v_lst)) || PyTuple_CheckExact(__pyx_v_lst)) {
6269 __pyx_t_1 = __pyx_v_lst; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
6272 __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_lst);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error)
6273 __Pyx_GOTREF(__pyx_t_1);
6274 __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 527, __pyx_L1_error)
6277 if (likely(!__pyx_t_3)) {
6278 if (likely(PyList_CheckExact(__pyx_t_1))) {
6279 if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1))
break;
6280 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 6281 __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, 527, __pyx_L1_error)
6283 __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error)
6284 __Pyx_GOTREF(__pyx_t_4);
6287 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1))
break;
6288 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 6289 __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, 527, __pyx_L1_error)
6291 __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error)
6292 __Pyx_GOTREF(__pyx_t_4);
6296 __pyx_t_4 = __pyx_t_3(__pyx_t_1);
6297 if (unlikely(!__pyx_t_4)) {
6298 PyObject* exc_type = PyErr_Occurred();
6300 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
6301 else __PYX_ERR(0, 527, __pyx_L1_error)
6305 __Pyx_GOTREF(__pyx_t_4);
6307 __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_4);
6317 __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_s);
if (unlikely((__pyx_t_5 == ((
scalar_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 528, __pyx_L1_error)
6319 __pyx_v_v.push_back(((
scalar_t)__pyx_t_5));
6321 __Pyx_CppExn2PyErr();
6322 __PYX_ERR(0, 528, __pyx_L1_error)
6333 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6342 __pyx_r = __pyx_v_v;
6355 __Pyx_XDECREF(__pyx_t_1);
6356 __Pyx_XDECREF(__pyx_t_4);
6357 __Pyx_WriteUnraisable(
"PyClical.list_to_vector", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6358 __Pyx_pretend_to_initialize(&__pyx_r);
6360 __Pyx_XDECREF(__pyx_v_s);
6361 __Pyx_RefNannyFinishContext();
6373 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_toClifford(PyObject *__pyx_v_obj) {
6375 __Pyx_RefNannyDeclarations
6376 PyObject *__pyx_t_1 = NULL;
6377 int __pyx_lineno = 0;
6378 const char *__pyx_filename = NULL;
6379 int __pyx_clineno = 0;
6380 __Pyx_RefNannySetupContext(
"toClifford", 0);
6389 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_v_obj);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 535, __pyx_L1_error)
6390 __Pyx_GOTREF(__pyx_t_1);
6391 __pyx_r = (((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_1)->instance[0]);
6392 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6405 __Pyx_XDECREF(__pyx_t_1);
6406 __Pyx_WriteUnraisable(
"PyClical.toClifford", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6407 __Pyx_pretend_to_initialize(&__pyx_r);
6409 __Pyx_RefNannyFinishContext();
6421 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_8clifford_wrap(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self,
Clifford __pyx_v_other) {
6422 PyObject *__pyx_r = NULL;
6423 __Pyx_RefNannyDeclarations
6424 __Pyx_RefNannySetupContext(
"wrap", 0);
6433 (__pyx_v_self->instance[0]) = __pyx_v_other;
6442 __Pyx_XDECREF(__pyx_r);
6443 __Pyx_INCREF(((PyObject *)__pyx_v_self));
6444 __pyx_r = ((PyObject *)__pyx_v_self);
6457 __Pyx_XGIVEREF(__pyx_r);
6458 __Pyx_RefNannyFinishContext();
6470 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_8clifford_unwrap(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
6472 __Pyx_RefNannyDeclarations
6473 __Pyx_RefNannySetupContext(
"unwrap", 0);
6482 __pyx_r = (__pyx_v_self->instance[0]);
6495 __Pyx_RefNannyFinishContext();
6507 static PyObject *__pyx_pw_8PyClical_8clifford_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
6508 static PyObject *__pyx_f_8PyClical_8clifford_copy(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self,
int __pyx_skip_dispatch) {
6509 PyObject *__pyx_r = NULL;
6510 __Pyx_RefNannyDeclarations
6511 PyObject *__pyx_t_1 = NULL;
6512 PyObject *__pyx_t_2 = NULL;
6513 PyObject *__pyx_t_3 = NULL;
6514 PyObject *__pyx_t_4 = NULL;
6515 int __pyx_lineno = 0;
6516 const char *__pyx_filename = NULL;
6517 int __pyx_clineno = 0;
6518 __Pyx_RefNannySetupContext(
"copy", 0);
6520 if (unlikely(__pyx_skip_dispatch)) ;
6522 else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
6523 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS 6524 static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
6525 if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
6526 PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
6528 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 556, __pyx_L1_error)
6529 __Pyx_GOTREF(__pyx_t_1);
6530 if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(
void*)__pyx_pw_8PyClical_8clifford_1copy)) {
6531 __Pyx_XDECREF(__pyx_r);
6532 __Pyx_INCREF(__pyx_t_1);
6533 __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
6534 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
6535 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
6536 if (likely(__pyx_t_4)) {
6537 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
6538 __Pyx_INCREF(__pyx_t_4);
6539 __Pyx_INCREF(
function);
6540 __Pyx_DECREF_SET(__pyx_t_3,
function);
6543 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
6544 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6545 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 556, __pyx_L1_error)
6546 __Pyx_GOTREF(__pyx_t_2);
6547 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6548 __pyx_r = __pyx_t_2;
6550 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6553 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS 6554 __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
6555 __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
6556 if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
6557 __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
6560 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6561 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS 6573 __Pyx_XDECREF(__pyx_r);
6574 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_clifford), ((PyObject *)__pyx_v_self));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 563, __pyx_L1_error)
6575 __Pyx_GOTREF(__pyx_t_1);
6576 __pyx_r = __pyx_t_1;
6590 __Pyx_XDECREF(__pyx_t_1);
6591 __Pyx_XDECREF(__pyx_t_2);
6592 __Pyx_XDECREF(__pyx_t_3);
6593 __Pyx_XDECREF(__pyx_t_4);
6594 __Pyx_AddTraceback(
"PyClical.clifford.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
6597 __Pyx_XGIVEREF(__pyx_r);
6598 __Pyx_RefNannyFinishContext();
6603 static PyObject *__pyx_pw_8PyClical_8clifford_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
6604 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 ";
6605 static PyObject *__pyx_pw_8PyClical_8clifford_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
6606 PyObject *__pyx_r = 0;
6607 __Pyx_RefNannyDeclarations
6608 __Pyx_RefNannySetupContext(
"copy (wrapper)", 0);
6609 __pyx_r = __pyx_pf_8PyClical_8clifford_copy(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
6612 __Pyx_RefNannyFinishContext();
6616 static PyObject *__pyx_pf_8PyClical_8clifford_copy(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
6617 PyObject *__pyx_r = NULL;
6618 __Pyx_RefNannyDeclarations
6619 PyObject *__pyx_t_1 = NULL;
6620 int __pyx_lineno = 0;
6621 const char *__pyx_filename = NULL;
6622 int __pyx_clineno = 0;
6623 __Pyx_RefNannySetupContext(
"copy", 0);
6624 __Pyx_XDECREF(__pyx_r);
6625 __pyx_t_1 = __pyx_f_8PyClical_8clifford_copy(__pyx_v_self, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 556, __pyx_L1_error)
6626 __Pyx_GOTREF(__pyx_t_1);
6627 __pyx_r = __pyx_t_1;
6633 __Pyx_XDECREF(__pyx_t_1);
6634 __Pyx_AddTraceback(
"PyClical.clifford.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
6637 __Pyx_XGIVEREF(__pyx_r);
6638 __Pyx_RefNannyFinishContext();
6651 static int __pyx_pw_8PyClical_8clifford_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6652 static int __pyx_pw_8PyClical_8clifford_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6653 PyObject *__pyx_v_other = 0;
6654 PyObject *__pyx_v_ixt = 0;
6655 int __pyx_lineno = 0;
6656 const char *__pyx_filename = NULL;
6657 int __pyx_clineno = 0;
6659 __Pyx_RefNannyDeclarations
6660 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
6662 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_ixt,0};
6663 PyObject* values[2] = {0,0};
6664 values[0] = ((PyObject *)__pyx_int_0);
6665 values[1] = ((PyObject *)Py_None);
6666 if (unlikely(__pyx_kwds)) {
6668 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6670 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6672 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6675 default:
goto __pyx_L5_argtuple_error;
6677 kw_args = PyDict_Size(__pyx_kwds);
6681 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other);
6682 if (value) { values[0] = value; kw_args--; }
6687 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ixt);
6688 if (value) { values[1] = value; kw_args--; }
6691 if (unlikely(kw_args > 0)) {
6692 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(0, 565, __pyx_L3_error)
6695 switch (PyTuple_GET_SIZE(__pyx_args)) {
6696 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6698 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6701 default:
goto __pyx_L5_argtuple_error;
6704 __pyx_v_other = values[0];
6705 __pyx_v_ixt = values[1];
6707 goto __pyx_L4_argument_unpacking_done;
6708 __pyx_L5_argtuple_error:;
6709 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 565, __pyx_L3_error)
6711 __Pyx_AddTraceback(
"PyClical.clifford.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6712 __Pyx_RefNannyFinishContext();
6714 __pyx_L4_argument_unpacking_done:;
6715 __pyx_r = __pyx_pf_8PyClical_8clifford_2__cinit__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), __pyx_v_other, __pyx_v_ixt);
6718 __Pyx_RefNannyFinishContext();
6722 static int __pyx_pf_8PyClical_8clifford_2__cinit__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_ixt) {
6723 PyObject *__pyx_v_error_msg_prefix = NULL;
6724 PyObject *__pyx_v_bother = NULL;
6725 PyObject *__pyx_v_err = NULL;
6727 __Pyx_RefNannyDeclarations
6730 PyObject *__pyx_t_3 = NULL;
6731 PyObject *__pyx_t_4 = NULL;
6732 PyObject *__pyx_t_5 = NULL;
6734 PyObject *__pyx_t_7 = NULL;
6735 PyObject *__pyx_t_8 = NULL;
6737 PyObject *__pyx_t_10 = NULL;
6738 PyObject *__pyx_t_11 = NULL;
6739 PyObject *__pyx_t_12 = NULL;
6740 PyObject *__pyx_t_13 = NULL;
6743 PyObject *__pyx_t_16 = NULL;
6744 PyObject *__pyx_t_17 = NULL;
6745 PyObject *__pyx_t_18 = NULL;
6747 char const *__pyx_t_20;
6748 PyObject *__pyx_t_21 = NULL;
6749 PyObject *__pyx_t_22 = NULL;
6750 PyObject *__pyx_t_23 = NULL;
6751 int __pyx_lineno = 0;
6752 const char *__pyx_filename = NULL;
6753 int __pyx_clineno = 0;
6754 __Pyx_RefNannySetupContext(
"__cinit__", 0);
6763 __Pyx_INCREF(__pyx_kp_u_Cannot_initialize_clifford_objec);
6764 __pyx_v_error_msg_prefix = __pyx_kp_u_Cannot_initialize_clifford_objec;
6773 __pyx_t_1 = (__pyx_v_ixt == Py_None);
6774 __pyx_t_2 = (__pyx_t_1 != 0);
6785 __Pyx_PyThreadState_declare
6786 __Pyx_PyThreadState_assign
6787 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
6788 __Pyx_XGOTREF(__pyx_t_3);
6789 __Pyx_XGOTREF(__pyx_t_4);
6790 __Pyx_XGOTREF(__pyx_t_5);
6800 __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8PyClical_clifford);
6801 __pyx_t_1 = (__pyx_t_2 != 0);
6812 __pyx_t_6 =
new Clifford(__pyx_f_8PyClical_8clifford_unwrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_other)));
6814 __Pyx_CppExn2PyErr();
6815 __PYX_ERR(0, 592, __pyx_L4_error)
6817 __pyx_v_self->instance = __pyx_t_6;
6836 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8PyClical_index_set);
6837 __pyx_t_2 = (__pyx_t_1 != 0);
6848 __pyx_t_6 =
new Clifford(__pyx_f_8PyClical_9index_set_unwrap(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_other)), ((
scalar_t)1.0));
6850 __Pyx_CppExn2PyErr();
6851 __PYX_ERR(0, 594, __pyx_L4_error)
6853 __pyx_v_self->instance = __pyx_t_6;
6872 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_numbers);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 595, __pyx_L4_error)
6873 __Pyx_GOTREF(__pyx_t_7);
6874 __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)
6875 __Pyx_GOTREF(__pyx_t_8);
6876 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6877 __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)
6878 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6879 __pyx_t_1 = (__pyx_t_2 != 0);
6889 __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)
6893 __Pyx_CppExn2PyErr();
6894 __PYX_ERR(0, 596, __pyx_L4_error)
6896 __pyx_v_self->instance = __pyx_t_6;
6915 __pyx_t_1 = PyUnicode_Check(__pyx_v_other);
6916 __pyx_t_2 = (__pyx_t_1 != 0);
6917 if (likely(__pyx_t_2)) {
6927 __Pyx_PyThreadState_declare
6928 __Pyx_PyThreadState_assign
6929 __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
6930 __Pyx_XGOTREF(__pyx_t_10);
6931 __Pyx_XGOTREF(__pyx_t_11);
6932 __Pyx_XGOTREF(__pyx_t_12);
6942 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_encode);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 599, __pyx_L11_error)
6943 __Pyx_GOTREF(__pyx_t_7);
6945 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
6946 __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_7);
6947 if (likely(__pyx_t_13)) {
6948 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
6949 __Pyx_INCREF(__pyx_t_13);
6950 __Pyx_INCREF(
function);
6951 __Pyx_DECREF_SET(__pyx_t_7,
function);
6954 __pyx_t_8 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_13, __pyx_kp_u_UTF_8) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_kp_u_UTF_8);
6955 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
6956 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 599, __pyx_L11_error)
6957 __Pyx_GOTREF(__pyx_t_8);
6958 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6959 __pyx_v_bother = __pyx_t_8;
6969 __pyx_t_14 = __Pyx_PyObject_AsWritableString(__pyx_v_bother);
if (unlikely((!__pyx_t_14) && PyErr_Occurred())) __PYX_ERR(0, 600, __pyx_L11_error)
6971 __pyx_t_6 =
new Clifford(((
char *)__pyx_t_14));
6973 __Pyx_CppExn2PyErr();
6974 __PYX_ERR(0, 600, __pyx_L11_error)
6976 __pyx_v_self->instance = __pyx_t_6;
6986 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
6987 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
6988 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
6989 goto __pyx_L16_try_end;
6991 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
6992 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6993 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
7002 __pyx_t_15 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
7004 __Pyx_AddTraceback(
"PyClical.clifford.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7005 if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_13) < 0) __PYX_ERR(0, 601, __pyx_L13_except_error)
7006 __Pyx_GOTREF(__pyx_t_8);
7007 __Pyx_GOTREF(__pyx_t_7);
7008 __Pyx_GOTREF(__pyx_t_13);
7017 __pyx_t_16 = __Pyx_PyUnicode_Concat(__pyx_v_error_msg_prefix, __pyx_kp_u_invalid_string);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 602, __pyx_L13_except_error)
7018 __Pyx_GOTREF(__pyx_t_16);
7019 __pyx_t_17 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 602, __pyx_L13_except_error)
7020 __Pyx_GOTREF(__pyx_t_17);
7021 __pyx_t_18 = PyNumber_Add(__pyx_t_16, __pyx_t_17);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 602, __pyx_L13_except_error)
7022 __Pyx_GOTREF(__pyx_t_18);
7023 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7024 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
7025 __pyx_t_17 = PyNumber_Add(__pyx_t_18, __pyx_kp_u_);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 602, __pyx_L13_except_error)
7026 __Pyx_GOTREF(__pyx_t_17);
7027 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
7028 __pyx_t_18 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_17);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 602, __pyx_L13_except_error)
7029 __Pyx_GOTREF(__pyx_t_18);
7030 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
7031 __Pyx_Raise(__pyx_t_18, 0, 0, 0);
7032 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
7033 __PYX_ERR(0, 602, __pyx_L13_except_error)
7035 goto __pyx_L13_except_error;
7036 __pyx_L13_except_error:;
7045 __Pyx_XGIVEREF(__pyx_t_10);
7046 __Pyx_XGIVEREF(__pyx_t_11);
7047 __Pyx_XGIVEREF(__pyx_t_12);
7048 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
7049 goto __pyx_L4_error;
7071 __pyx_t_13 = __Pyx_PyUnicode_Concat(__pyx_v_error_msg_prefix, __pyx_kp_u__2);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 604, __pyx_L4_error)
7072 __Pyx_GOTREF(__pyx_t_13);
7073 __pyx_t_7 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)Py_TYPE(__pyx_v_other)));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 604, __pyx_L4_error)
7074 __Pyx_GOTREF(__pyx_t_7);
7075 __pyx_t_8 = __Pyx_PyUnicode_Concat(__pyx_t_13, __pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 604, __pyx_L4_error)
7076 __Pyx_GOTREF(__pyx_t_8);
7077 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7078 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7079 __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_t_8, __pyx_kp_u_);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 604, __pyx_L4_error)
7080 __Pyx_GOTREF(__pyx_t_7);
7081 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7082 __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 604, __pyx_L4_error)
7083 __Pyx_GOTREF(__pyx_t_8);
7084 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7085 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7086 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7087 __PYX_ERR(0, 604, __pyx_L4_error)
7099 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7100 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7101 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
7102 goto __pyx_L9_try_end;
7104 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
7105 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
7106 __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
7107 __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
7108 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
7109 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
7118 __pyx_t_15 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
7120 __Pyx_AddTraceback(
"PyClical.clifford.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7121 if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_13) < 0) __PYX_ERR(0, 605, __pyx_L6_except_error)
7122 __Pyx_GOTREF(__pyx_t_8);
7123 __Pyx_GOTREF(__pyx_t_7);
7124 __Pyx_GOTREF(__pyx_t_13);
7125 __Pyx_INCREF(__pyx_t_7);
7126 __pyx_v_err = __pyx_t_7;
7136 __pyx_t_18 = __Pyx_PyUnicode_Concat(__pyx_v_error_msg_prefix, __pyx_kp_u__2);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 606, __pyx_L24_error)
7137 __Pyx_GOTREF(__pyx_t_18);
7138 __pyx_t_17 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)Py_TYPE(__pyx_v_other)));
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 606, __pyx_L24_error)
7139 __Pyx_GOTREF(__pyx_t_17);
7140 __pyx_t_16 = __Pyx_PyUnicode_Concat(__pyx_t_18, __pyx_t_17);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 606, __pyx_L24_error)
7141 __Pyx_GOTREF(__pyx_t_16);
7142 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
7143 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
7152 __pyx_t_17 = __Pyx_PyUnicode_Concat(__pyx_t_16, __pyx_kp_u_value);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 607, __pyx_L24_error)
7153 __Pyx_GOTREF(__pyx_t_17);
7154 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7155 __pyx_t_16 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 607, __pyx_L24_error)
7156 __Pyx_GOTREF(__pyx_t_16);
7157 __pyx_t_18 = PyNumber_Add(__pyx_t_17, __pyx_t_16);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 607, __pyx_L24_error)
7158 __Pyx_GOTREF(__pyx_t_18);
7159 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
7160 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7161 __pyx_t_16 = PyNumber_Add(__pyx_t_18, __pyx_kp_u__5);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 607, __pyx_L24_error)
7162 __Pyx_GOTREF(__pyx_t_16);
7163 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
7172 __pyx_t_18 = PyNumber_Add(__pyx_t_16, __pyx_kp_u__6);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 608, __pyx_L24_error)
7173 __Pyx_GOTREF(__pyx_t_18);
7174 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7175 __pyx_t_16 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_err);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 608, __pyx_L24_error)
7176 __Pyx_GOTREF(__pyx_t_16);
7177 __pyx_t_17 = PyNumber_Add(__pyx_t_18, __pyx_t_16);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 608, __pyx_L24_error)
7178 __Pyx_GOTREF(__pyx_t_17);
7179 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
7180 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7189 __pyx_t_16 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_17);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 606, __pyx_L24_error)
7190 __Pyx_GOTREF(__pyx_t_16);
7191 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
7192 __Pyx_Raise(__pyx_t_16, 0, 0, 0);
7193 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7194 __PYX_ERR(0, 606, __pyx_L24_error)
7207 __Pyx_PyThreadState_declare
7208 __Pyx_PyThreadState_assign
7209 __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0;
7210 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
7211 __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
7212 __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
7213 if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23);
7214 if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
7215 __Pyx_XGOTREF(__pyx_t_12);
7216 __Pyx_XGOTREF(__pyx_t_11);
7217 __Pyx_XGOTREF(__pyx_t_10);
7218 __Pyx_XGOTREF(__pyx_t_21);
7219 __Pyx_XGOTREF(__pyx_t_22);
7220 __Pyx_XGOTREF(__pyx_t_23);
7221 __pyx_t_15 = __pyx_lineno; __pyx_t_19 = __pyx_clineno; __pyx_t_20 = __pyx_filename;
7223 __Pyx_DECREF(__pyx_v_err);
7226 if (PY_MAJOR_VERSION >= 3) {
7227 __Pyx_XGIVEREF(__pyx_t_21);
7228 __Pyx_XGIVEREF(__pyx_t_22);
7229 __Pyx_XGIVEREF(__pyx_t_23);
7230 __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_23);
7232 __Pyx_XGIVEREF(__pyx_t_12);
7233 __Pyx_XGIVEREF(__pyx_t_11);
7234 __Pyx_XGIVEREF(__pyx_t_10);
7235 __Pyx_ErrRestore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
7236 __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0;
7237 __pyx_lineno = __pyx_t_15; __pyx_clineno = __pyx_t_19; __pyx_filename = __pyx_t_20;
7238 goto __pyx_L6_except_error;
7242 goto __pyx_L6_except_error;
7243 __pyx_L6_except_error:;
7252 __Pyx_XGIVEREF(__pyx_t_3);
7253 __Pyx_XGIVEREF(__pyx_t_4);
7254 __Pyx_XGIVEREF(__pyx_t_5);
7255 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
7256 goto __pyx_L1_error;
7277 __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_ixt, __pyx_ptype_8PyClical_index_set);
7278 __pyx_t_1 = (__pyx_t_2 != 0);
7279 if (likely(__pyx_t_1)) {
7288 __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_numbers);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 610, __pyx_L1_error)
7289 __Pyx_GOTREF(__pyx_t_13);
7290 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_Real);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 610, __pyx_L1_error)
7291 __Pyx_GOTREF(__pyx_t_7);
7292 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7293 __pyx_t_1 = PyObject_IsInstance(__pyx_v_other, __pyx_t_7);
if (unlikely(__pyx_t_1 == ((
int)-1))) __PYX_ERR(0, 610, __pyx_L1_error)
7294 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7295 __pyx_t_2 = (__pyx_t_1 != 0);
7305 __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_other);
if (unlikely((__pyx_t_9 == ((
scalar_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 611, __pyx_L1_error)
7307 __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));
7309 __Pyx_CppExn2PyErr();
7310 __PYX_ERR(0, 611, __pyx_L1_error)
7312 __pyx_v_self->instance = __pyx_t_6;
7331 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_collections);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 612, __pyx_L1_error)
7332 __Pyx_GOTREF(__pyx_t_7);
7333 __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_abc);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 612, __pyx_L1_error)
7334 __Pyx_GOTREF(__pyx_t_13);
7335 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7336 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_Sequence);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 612, __pyx_L1_error)
7337 __Pyx_GOTREF(__pyx_t_7);
7338 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7339 __pyx_t_2 = PyObject_IsInstance(__pyx_v_other, __pyx_t_7);
if (unlikely(__pyx_t_2 == ((
int)-1))) __PYX_ERR(0, 612, __pyx_L1_error)
7340 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7341 __pyx_t_1 = (__pyx_t_2 != 0);
7342 if (likely(__pyx_t_1)) {
7352 __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)));
7354 __Pyx_CppExn2PyErr();
7355 __PYX_ERR(0, 613, __pyx_L1_error)
7357 __pyx_v_self->instance = __pyx_t_6;
7377 __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_v_error_msg_prefix, __pyx_kp_u__7);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 615, __pyx_L1_error)
7378 __Pyx_GOTREF(__pyx_t_7);
7379 __pyx_t_13 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)Py_TYPE(__pyx_v_other)));
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 615, __pyx_L1_error)
7380 __Pyx_GOTREF(__pyx_t_13);
7381 __pyx_t_8 = __Pyx_PyUnicode_Concat(__pyx_t_7, __pyx_t_13);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 615, __pyx_L1_error)
7382 __Pyx_GOTREF(__pyx_t_8);
7383 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7384 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7393 __pyx_t_13 = __Pyx_PyUnicode_Concat(__pyx_t_8, __pyx_kp_u__8);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 616, __pyx_L1_error)
7394 __Pyx_GOTREF(__pyx_t_13);
7395 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7396 __pyx_t_8 = PyObject_Repr(__pyx_v_ixt);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 616, __pyx_L1_error)
7397 __Pyx_GOTREF(__pyx_t_8);
7398 __pyx_t_7 = PyNumber_Add(__pyx_t_13, __pyx_t_8);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 616, __pyx_L1_error)
7399 __Pyx_GOTREF(__pyx_t_7);
7400 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7401 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7402 __pyx_t_8 = PyNumber_Add(__pyx_t_7, __pyx_kp_u__9);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 616, __pyx_L1_error)
7403 __Pyx_GOTREF(__pyx_t_8);
7404 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7413 __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_8);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 615, __pyx_L1_error)
7414 __Pyx_GOTREF(__pyx_t_7);
7415 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7416 __Pyx_Raise(__pyx_t_7, 0, 0, 0);
7417 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7418 __PYX_ERR(0, 615, __pyx_L1_error)
7440 __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_v_error_msg_prefix, __pyx_kp_u__7);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 618, __pyx_L1_error)
7441 __Pyx_GOTREF(__pyx_t_7);
7442 __pyx_t_8 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)Py_TYPE(__pyx_v_other)));
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 618, __pyx_L1_error)
7443 __Pyx_GOTREF(__pyx_t_8);
7444 __pyx_t_13 = __Pyx_PyUnicode_Concat(__pyx_t_7, __pyx_t_8);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 618, __pyx_L1_error)
7445 __Pyx_GOTREF(__pyx_t_13);
7446 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7447 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7456 __pyx_t_8 = __Pyx_PyUnicode_Concat(__pyx_t_13, __pyx_kp_u__8);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 619, __pyx_L1_error)
7457 __Pyx_GOTREF(__pyx_t_8);
7458 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7459 __pyx_t_13 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)Py_TYPE(__pyx_v_ixt)));
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 619, __pyx_L1_error)
7460 __Pyx_GOTREF(__pyx_t_13);
7461 __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_t_8, __pyx_t_13);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 619, __pyx_L1_error)
7462 __Pyx_GOTREF(__pyx_t_7);
7463 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7464 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7465 __pyx_t_13 = __Pyx_PyUnicode_Concat(__pyx_t_7, __pyx_kp_u__9);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 619, __pyx_L1_error)
7466 __Pyx_GOTREF(__pyx_t_13);
7467 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7476 __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_13);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 618, __pyx_L1_error)
7477 __Pyx_GOTREF(__pyx_t_7);
7478 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7479 __Pyx_Raise(__pyx_t_7, 0, 0, 0);
7480 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7481 __PYX_ERR(0, 618, __pyx_L1_error)
7497 __Pyx_XDECREF(__pyx_t_7);
7498 __Pyx_XDECREF(__pyx_t_8);
7499 __Pyx_XDECREF(__pyx_t_13);
7500 __Pyx_XDECREF(__pyx_t_16);
7501 __Pyx_XDECREF(__pyx_t_17);
7502 __Pyx_XDECREF(__pyx_t_18);
7503 __Pyx_AddTraceback(
"PyClical.clifford.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7506 __Pyx_XDECREF(__pyx_v_error_msg_prefix);
7507 __Pyx_XDECREF(__pyx_v_bother);
7508 __Pyx_XDECREF(__pyx_v_err);
7509 __Pyx_RefNannyFinishContext();
7522 static void __pyx_pw_8PyClical_8clifford_5__dealloc__(PyObject *__pyx_v_self);
7523 static void __pyx_pw_8PyClical_8clifford_5__dealloc__(PyObject *__pyx_v_self) {
7524 __Pyx_RefNannyDeclarations
7525 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
7526 __pyx_pf_8PyClical_8clifford_4__dealloc__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
7529 __Pyx_RefNannyFinishContext();
7532 static void __pyx_pf_8PyClical_8clifford_4__dealloc__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
7533 __Pyx_RefNannyDeclarations
7534 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
7543 delete __pyx_v_self->instance;
7554 __Pyx_RefNannyFinishContext();
7566 static int __pyx_pw_8PyClical_8clifford_7__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_x);
7567 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 ";
7568 #if CYTHON_COMPILING_IN_CPYTHON 7569 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_6__contains__;
7571 static int __pyx_pw_8PyClical_8clifford_7__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_x) {
7573 __Pyx_RefNannyDeclarations
7574 __Pyx_RefNannySetupContext(
"__contains__ (wrapper)", 0);
7575 __pyx_r = __pyx_pf_8PyClical_8clifford_6__contains__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_x));
7578 __Pyx_RefNannyFinishContext();
7582 static int __pyx_pf_8PyClical_8clifford_6__contains__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_x) {
7584 __Pyx_RefNannyDeclarations
7585 PyObject *__pyx_t_1 = NULL;
7586 int __pyx_lineno = 0;
7587 const char *__pyx_filename = NULL;
7588 int __pyx_clineno = 0;
7589 __Pyx_RefNannySetupContext(
"__contains__", 0);
7598 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__10, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 636, __pyx_L1_error)
7599 __Pyx_GOTREF(__pyx_t_1);
7600 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
7601 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7602 __PYX_ERR(0, 636, __pyx_L1_error)
7614 __Pyx_XDECREF(__pyx_t_1);
7615 __Pyx_AddTraceback(
"PyClical.clifford.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7617 __Pyx_RefNannyFinishContext();
7630 static PyObject *__pyx_pw_8PyClical_8clifford_9__iter__(PyObject *__pyx_v_self);
7631 static char __pyx_doc_8PyClical_8clifford_8__iter__[] =
"\n Not applicable.\n\n >>> for a in clifford(index_set({-3,4,7})):print(a, end=\",\")\n Traceback (most recent call last):\n ...\n TypeError: Not applicable.\n ";
7632 #if CYTHON_COMPILING_IN_CPYTHON 7633 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_8__iter__;
7635 static PyObject *__pyx_pw_8PyClical_8clifford_9__iter__(PyObject *__pyx_v_self) {
7636 PyObject *__pyx_r = 0;
7637 __Pyx_RefNannyDeclarations
7638 __Pyx_RefNannySetupContext(
"__iter__ (wrapper)", 0);
7639 __pyx_r = __pyx_pf_8PyClical_8clifford_8__iter__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
7642 __Pyx_RefNannyFinishContext();
7646 static PyObject *__pyx_pf_8PyClical_8clifford_8__iter__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
7647 PyObject *__pyx_r = NULL;
7648 __Pyx_RefNannyDeclarations
7649 PyObject *__pyx_t_1 = NULL;
7650 int __pyx_lineno = 0;
7651 const char *__pyx_filename = NULL;
7652 int __pyx_clineno = 0;
7653 __Pyx_RefNannySetupContext(
"__iter__", 0);
7662 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__10, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 647, __pyx_L1_error)
7663 __Pyx_GOTREF(__pyx_t_1);
7664 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
7665 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7666 __PYX_ERR(0, 647, __pyx_L1_error)
7678 __Pyx_XDECREF(__pyx_t_1);
7679 __Pyx_AddTraceback(
"PyClical.clifford.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7681 __Pyx_XGIVEREF(__pyx_r);
7682 __Pyx_RefNannyFinishContext();
7695 static PyObject *__pyx_pw_8PyClical_8clifford_11reframe(PyObject *__pyx_v_self, PyObject *__pyx_v_ixt);
7696 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 ";
7697 static PyObject *__pyx_pw_8PyClical_8clifford_11reframe(PyObject *__pyx_v_self, PyObject *__pyx_v_ixt) {
7698 PyObject *__pyx_r = 0;
7699 __Pyx_RefNannyDeclarations
7700 __Pyx_RefNannySetupContext(
"reframe (wrapper)", 0);
7701 __pyx_r = __pyx_pf_8PyClical_8clifford_10reframe(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_ixt));
7704 __Pyx_RefNannyFinishContext();
7708 static PyObject *__pyx_pf_8PyClical_8clifford_10reframe(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_ixt) {
7709 PyObject *__pyx_v_error_msg_prefix = NULL;
7710 struct __pyx_obj_8PyClical_clifford *__pyx_v_result = NULL;
7711 PyObject *__pyx_v_err = NULL;
7712 PyObject *__pyx_r = NULL;
7713 __Pyx_RefNannyDeclarations
7716 PyObject *__pyx_t_3 = NULL;
7717 PyObject *__pyx_t_4 = NULL;
7718 PyObject *__pyx_t_5 = NULL;
7719 PyObject *__pyx_t_6 = NULL;
7722 PyObject *__pyx_t_9 = NULL;
7723 PyObject *__pyx_t_10 = NULL;
7724 PyObject *__pyx_t_11 = NULL;
7725 PyObject *__pyx_t_12 = NULL;
7726 PyObject *__pyx_t_13 = NULL;
7728 char const *__pyx_t_15;
7729 PyObject *__pyx_t_16 = NULL;
7730 PyObject *__pyx_t_17 = NULL;
7731 PyObject *__pyx_t_18 = NULL;
7732 PyObject *__pyx_t_19 = NULL;
7733 PyObject *__pyx_t_20 = NULL;
7734 PyObject *__pyx_t_21 = NULL;
7735 int __pyx_lineno = 0;
7736 const char *__pyx_filename = NULL;
7737 int __pyx_clineno = 0;
7738 __Pyx_RefNannySetupContext(
"reframe", 0);
7747 __Pyx_INCREF(__pyx_kp_u_Cannot_reframe);
7748 __pyx_v_error_msg_prefix = __pyx_kp_u_Cannot_reframe;
7757 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_ixt, __pyx_ptype_8PyClical_index_set);
7758 __pyx_t_2 = (__pyx_t_1 != 0);
7759 if (likely(__pyx_t_2)) {
7769 __Pyx_PyThreadState_declare
7770 __Pyx_PyThreadState_assign
7771 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
7772 __Pyx_XGOTREF(__pyx_t_3);
7773 __Pyx_XGOTREF(__pyx_t_4);
7774 __Pyx_XGOTREF(__pyx_t_5);
7784 __pyx_t_6 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 662, __pyx_L4_error)
7785 __Pyx_GOTREF(__pyx_t_6);
7786 __pyx_v_result = ((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_6);
7797 __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)));
7799 __Pyx_CppExn2PyErr();
7800 __PYX_ERR(0, 663, __pyx_L4_error)
7802 __pyx_v_result->instance = __pyx_t_7;
7812 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7813 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7814 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
7815 goto __pyx_L9_try_end;
7817 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
7826 __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
7828 __Pyx_AddTraceback(
"PyClical.clifford.reframe", __pyx_clineno, __pyx_lineno, __pyx_filename);
7829 if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 664, __pyx_L6_except_error)
7830 __Pyx_GOTREF(__pyx_t_6);
7831 __Pyx_GOTREF(__pyx_t_9);
7832 __Pyx_GOTREF(__pyx_t_10);
7833 __Pyx_INCREF(__pyx_t_9);
7834 __pyx_v_err = __pyx_t_9;
7844 __pyx_t_11 = __Pyx_PyUnicode_Concat(__pyx_v_error_msg_prefix, __pyx_kp_u_from);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 665, __pyx_L15_error)
7845 __Pyx_GOTREF(__pyx_t_11);
7846 __pyx_t_12 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)__pyx_v_self));
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 665, __pyx_L15_error)
7847 __Pyx_GOTREF(__pyx_t_12);
7848 __pyx_t_13 = __Pyx_PyUnicode_Concat(__pyx_t_11, __pyx_t_12);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 665, __pyx_L15_error)
7849 __Pyx_GOTREF(__pyx_t_13);
7850 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7851 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7852 __pyx_t_12 = __Pyx_PyUnicode_Concat(__pyx_t_13, __pyx_kp_u_to_frame);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 665, __pyx_L15_error)
7853 __Pyx_GOTREF(__pyx_t_12);
7854 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7863 __pyx_t_13 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_ixt);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 666, __pyx_L15_error)
7864 __Pyx_GOTREF(__pyx_t_13);
7865 __pyx_t_11 = __Pyx_PyUnicode_Concat(__pyx_t_12, __pyx_t_13);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 666, __pyx_L15_error)
7866 __Pyx_GOTREF(__pyx_t_11);
7867 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7868 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7869 __pyx_t_13 = __Pyx_PyUnicode_Concat(__pyx_t_11, __pyx_kp_u__5);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 666, __pyx_L15_error)
7870 __Pyx_GOTREF(__pyx_t_13);
7871 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7880 __pyx_t_11 = __Pyx_PyUnicode_Concat(__pyx_t_13, __pyx_kp_u__6);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 667, __pyx_L15_error)
7881 __Pyx_GOTREF(__pyx_t_11);
7882 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7883 __pyx_t_13 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_err);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 667, __pyx_L15_error)
7884 __Pyx_GOTREF(__pyx_t_13);
7885 __pyx_t_12 = __Pyx_PyUnicode_Concat(__pyx_t_11, __pyx_t_13);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 667, __pyx_L15_error)
7886 __Pyx_GOTREF(__pyx_t_12);
7887 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7888 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7897 __pyx_t_13 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_12);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 665, __pyx_L15_error)
7898 __Pyx_GOTREF(__pyx_t_13);
7899 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7900 __Pyx_Raise(__pyx_t_13, 0, 0, 0);
7901 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7902 __PYX_ERR(0, 665, __pyx_L15_error)
7915 __Pyx_PyThreadState_declare
7916 __Pyx_PyThreadState_assign
7917 __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
7918 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
7919 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
7920 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
7921 if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
7922 if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
7923 __Pyx_XGOTREF(__pyx_t_16);
7924 __Pyx_XGOTREF(__pyx_t_17);
7925 __Pyx_XGOTREF(__pyx_t_18);
7926 __Pyx_XGOTREF(__pyx_t_19);
7927 __Pyx_XGOTREF(__pyx_t_20);
7928 __Pyx_XGOTREF(__pyx_t_21);
7929 __pyx_t_8 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
7931 __Pyx_DECREF(__pyx_v_err);
7934 if (PY_MAJOR_VERSION >= 3) {
7935 __Pyx_XGIVEREF(__pyx_t_19);
7936 __Pyx_XGIVEREF(__pyx_t_20);
7937 __Pyx_XGIVEREF(__pyx_t_21);
7938 __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
7940 __Pyx_XGIVEREF(__pyx_t_16);
7941 __Pyx_XGIVEREF(__pyx_t_17);
7942 __Pyx_XGIVEREF(__pyx_t_18);
7943 __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
7944 __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
7945 __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
7946 goto __pyx_L6_except_error;
7950 goto __pyx_L6_except_error;
7951 __pyx_L6_except_error:;
7960 __Pyx_XGIVEREF(__pyx_t_3);
7961 __Pyx_XGIVEREF(__pyx_t_4);
7962 __Pyx_XGIVEREF(__pyx_t_5);
7963 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
7964 goto __pyx_L1_error;
7986 __pyx_t_10 = __Pyx_PyUnicode_Concat(__pyx_v_error_msg_prefix, __pyx_kp_u_using);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 669, __pyx_L1_error)
7987 __Pyx_GOTREF(__pyx_t_10);
7988 __pyx_t_9 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)Py_TYPE(__pyx_v_ixt)));
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 669, __pyx_L1_error)
7989 __Pyx_GOTREF(__pyx_t_9);
7990 __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_t_10, __pyx_t_9);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 669, __pyx_L1_error)
7991 __Pyx_GOTREF(__pyx_t_6);
7992 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7993 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7994 __pyx_t_9 = __Pyx_PyUnicode_Concat(__pyx_t_6, __pyx_kp_u__9);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 669, __pyx_L1_error)
7995 __Pyx_GOTREF(__pyx_t_9);
7996 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7997 __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_9);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 669, __pyx_L1_error)
7998 __Pyx_GOTREF(__pyx_t_6);
7999 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8000 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
8001 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8002 __PYX_ERR(0, 669, __pyx_L1_error)
8013 __Pyx_XDECREF(__pyx_r);
8014 __Pyx_INCREF(((PyObject *)__pyx_v_result));
8015 __pyx_r = ((PyObject *)__pyx_v_result);
8028 __Pyx_XDECREF(__pyx_t_6);
8029 __Pyx_XDECREF(__pyx_t_9);
8030 __Pyx_XDECREF(__pyx_t_10);
8031 __Pyx_XDECREF(__pyx_t_11);
8032 __Pyx_XDECREF(__pyx_t_12);
8033 __Pyx_XDECREF(__pyx_t_13);
8034 __Pyx_AddTraceback(
"PyClical.clifford.reframe", __pyx_clineno, __pyx_lineno, __pyx_filename);
8037 __Pyx_XDECREF(__pyx_v_error_msg_prefix);
8038 __Pyx_XDECREF((PyObject *)__pyx_v_result);
8039 __Pyx_XDECREF(__pyx_v_err);
8040 __Pyx_XGIVEREF(__pyx_r);
8041 __Pyx_RefNannyFinishContext();
8054 static PyObject *__pyx_pw_8PyClical_8clifford_13__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op);
8055 static PyObject *__pyx_pw_8PyClical_8clifford_13__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op) {
8056 PyObject *__pyx_r = 0;
8057 __Pyx_RefNannyDeclarations
8058 __Pyx_RefNannySetupContext(
"__richcmp__ (wrapper)", 0);
8059 __pyx_r = __pyx_pf_8PyClical_8clifford_12__richcmp__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs), ((
int)__pyx_v_op));
8062 __Pyx_RefNannyFinishContext();
8066 static PyObject *__pyx_pf_8PyClical_8clifford_12__richcmp__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op) {
8067 PyObject *__pyx_r = NULL;
8068 __Pyx_RefNannyDeclarations
8072 PyObject *__pyx_t_4 = NULL;
8073 PyObject *__pyx_t_5 = NULL;
8074 PyObject *__pyx_t_6 = NULL;
8075 int __pyx_lineno = 0;
8076 const char *__pyx_filename = NULL;
8077 int __pyx_clineno = 0;
8078 __Pyx_RefNannySetupContext(
"__richcmp__", 0);
8087 __pyx_t_1 = ((__pyx_v_op == 2) != 0);
8097 __pyx_t_2 = (((PyObject *)__pyx_v_lhs) == Py_None);
8098 __pyx_t_3 = (__pyx_t_2 != 0);
8101 __pyx_t_1 = __pyx_t_3;
8102 goto __pyx_L5_bool_binop_done;
8104 __pyx_t_3 = (__pyx_v_rhs == Py_None);
8105 __pyx_t_2 = (__pyx_t_3 != 0);
8106 __pyx_t_1 = __pyx_t_2;
8107 __pyx_L5_bool_binop_done:;
8117 __Pyx_XDECREF(__pyx_r);
8118 __pyx_t_1 = (((PyObject *)__pyx_v_lhs) == __pyx_v_rhs);
8119 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 693, __pyx_L1_error)
8120 __Pyx_GOTREF(__pyx_t_4);
8121 __pyx_r = __pyx_t_4;
8142 __Pyx_XDECREF(__pyx_r);
8143 __pyx_t_1 = (__pyx_f_8PyClical_toClifford(((PyObject *)__pyx_v_lhs)) == __pyx_f_8PyClical_toClifford(__pyx_v_rhs));
8144 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 695, __pyx_L1_error)
8145 __Pyx_GOTREF(__pyx_t_4);
8146 __pyx_r = __pyx_t_4;
8167 __pyx_t_1 = ((__pyx_v_op == 3) != 0);
8177 __pyx_t_2 = (((PyObject *)__pyx_v_lhs) == Py_None);
8178 __pyx_t_3 = (__pyx_t_2 != 0);
8181 __pyx_t_1 = __pyx_t_3;
8182 goto __pyx_L8_bool_binop_done;
8184 __pyx_t_3 = (__pyx_v_rhs == Py_None);
8185 __pyx_t_2 = (__pyx_t_3 != 0);
8186 __pyx_t_1 = __pyx_t_2;
8187 __pyx_L8_bool_binop_done:;
8197 __Pyx_XDECREF(__pyx_r);
8198 __pyx_t_1 = (((PyObject *)__pyx_v_lhs) == __pyx_v_rhs);
8199 __pyx_t_4 = __Pyx_PyBool_FromLong((!((!(!__pyx_t_1)) != 0)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 698, __pyx_L1_error)
8200 __Pyx_GOTREF(__pyx_t_4);
8201 __pyx_r = __pyx_t_4;
8222 __Pyx_XDECREF(__pyx_r);
8223 __pyx_t_1 = (__pyx_f_8PyClical_toClifford(((PyObject *)__pyx_v_lhs)) != __pyx_f_8PyClical_toClifford(__pyx_v_rhs));
8224 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 700, __pyx_L1_error)
8225 __Pyx_GOTREF(__pyx_t_4);
8226 __pyx_r = __pyx_t_4;
8247 __pyx_t_2 = __Pyx_TypeCheck(((PyObject *)__pyx_v_lhs), __pyx_ptype_8PyClical_clifford);
8248 __pyx_t_3 = (__pyx_t_2 != 0);
8251 __pyx_t_1 = __pyx_t_3;
8252 goto __pyx_L10_bool_binop_done;
8254 __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_rhs, __pyx_ptype_8PyClical_clifford);
8255 __pyx_t_2 = (__pyx_t_3 != 0);
8256 __pyx_t_1 = __pyx_t_2;
8257 __pyx_L10_bool_binop_done:;
8258 if (unlikely(__pyx_t_1)) {
8267 __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_lhs))));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 703, __pyx_L1_error)
8268 __Pyx_GOTREF(__pyx_t_4);
8269 __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u_This_comparison_operator_is_not, __pyx_t_4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 703, __pyx_L1_error)
8270 __Pyx_GOTREF(__pyx_t_5);
8271 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8272 __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_t_5, __pyx_kp_u__8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 703, __pyx_L1_error)
8273 __Pyx_GOTREF(__pyx_t_4);
8274 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8275 __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)Py_TYPE(__pyx_v_rhs)));
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 703, __pyx_L1_error)
8276 __Pyx_GOTREF(__pyx_t_5);
8277 __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_t_4, __pyx_t_5);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 703, __pyx_L1_error)
8278 __Pyx_GOTREF(__pyx_t_6);
8279 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8280 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8281 __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_t_6, __pyx_kp_u_);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 703, __pyx_L1_error)
8282 __Pyx_GOTREF(__pyx_t_5);
8283 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8292 __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_5);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 702, __pyx_L1_error)
8293 __Pyx_GOTREF(__pyx_t_6);
8294 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8295 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
8296 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8297 __PYX_ERR(0, 702, __pyx_L1_error)
8316 __Pyx_XDECREF(__pyx_r);
8317 __Pyx_INCREF(__pyx_builtin_NotImplemented);
8318 __pyx_r = __pyx_builtin_NotImplemented;
8332 __Pyx_XDECREF(__pyx_t_4);
8333 __Pyx_XDECREF(__pyx_t_5);
8334 __Pyx_XDECREF(__pyx_t_6);
8335 __Pyx_AddTraceback(
"PyClical.clifford.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8338 __Pyx_XGIVEREF(__pyx_r);
8339 __Pyx_RefNannyFinishContext();
8352 static PyObject *__pyx_pw_8PyClical_8clifford_15__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ixt);
8353 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 ";
8354 #if CYTHON_COMPILING_IN_CPYTHON 8355 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_14__getitem__;
8357 static PyObject *__pyx_pw_8PyClical_8clifford_15__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ixt) {
8358 PyObject *__pyx_r = 0;
8359 __Pyx_RefNannyDeclarations
8360 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
8361 __pyx_r = __pyx_pf_8PyClical_8clifford_14__getitem__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_ixt));
8364 __Pyx_RefNannyFinishContext();
8368 static PyObject *__pyx_pf_8PyClical_8clifford_14__getitem__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_ixt) {
8369 PyObject *__pyx_r = NULL;
8370 __Pyx_RefNannyDeclarations
8371 PyObject *__pyx_t_1 = NULL;
8372 int __pyx_lineno = 0;
8373 const char *__pyx_filename = NULL;
8374 int __pyx_clineno = 0;
8375 __Pyx_RefNannySetupContext(
"__getitem__", 0);
8384 __Pyx_XDECREF(__pyx_r);
8385 __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, 720, __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.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8405 __Pyx_XGIVEREF(__pyx_r);
8406 __Pyx_RefNannyFinishContext();
8419 static PyObject *__pyx_pw_8PyClical_8clifford_17__neg__(PyObject *__pyx_v_self);
8420 static char __pyx_doc_8PyClical_8clifford_16__neg__[] =
"\n Unary -.\n\n >>> print(-clifford(\"{1}\"))\n -{1}\n ";
8421 #if CYTHON_COMPILING_IN_CPYTHON 8422 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_16__neg__;
8424 static PyObject *__pyx_pw_8PyClical_8clifford_17__neg__(PyObject *__pyx_v_self) {
8425 PyObject *__pyx_r = 0;
8426 __Pyx_RefNannyDeclarations
8427 __Pyx_RefNannySetupContext(
"__neg__ (wrapper)", 0);
8428 __pyx_r = __pyx_pf_8PyClical_8clifford_16__neg__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
8431 __Pyx_RefNannyFinishContext();
8435 static PyObject *__pyx_pf_8PyClical_8clifford_16__neg__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
8436 PyObject *__pyx_r = NULL;
8437 __Pyx_RefNannyDeclarations
8438 PyObject *__pyx_t_1 = NULL;
8439 PyObject *__pyx_t_2 = NULL;
8440 int __pyx_lineno = 0;
8441 const char *__pyx_filename = NULL;
8442 int __pyx_clineno = 0;
8443 __Pyx_RefNannySetupContext(
"__neg__", 0);
8452 __Pyx_XDECREF(__pyx_r);
8453 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 729, __pyx_L1_error)
8454 __Pyx_GOTREF(__pyx_t_1);
8455 __pyx_t_2 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_1), __pyx_v_self->instance->operator-());
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 729, __pyx_L1_error)
8456 __Pyx_GOTREF(__pyx_t_2);
8457 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8458 __pyx_r = __pyx_t_2;
8472 __Pyx_XDECREF(__pyx_t_1);
8473 __Pyx_XDECREF(__pyx_t_2);
8474 __Pyx_AddTraceback(
"PyClical.clifford.__neg__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8477 __Pyx_XGIVEREF(__pyx_r);
8478 __Pyx_RefNannyFinishContext();
8491 static PyObject *__pyx_pw_8PyClical_8clifford_19__pos__(PyObject *__pyx_v_self);
8492 static char __pyx_doc_8PyClical_8clifford_18__pos__[] =
"\n Unary +.\n\n >>> print(+clifford(\"{1}\"))\n {1}\n ";
8493 #if CYTHON_COMPILING_IN_CPYTHON 8494 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_18__pos__;
8496 static PyObject *__pyx_pw_8PyClical_8clifford_19__pos__(PyObject *__pyx_v_self) {
8497 PyObject *__pyx_r = 0;
8498 __Pyx_RefNannyDeclarations
8499 __Pyx_RefNannySetupContext(
"__pos__ (wrapper)", 0);
8500 __pyx_r = __pyx_pf_8PyClical_8clifford_18__pos__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
8503 __Pyx_RefNannyFinishContext();
8507 static PyObject *__pyx_pf_8PyClical_8clifford_18__pos__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
8508 PyObject *__pyx_r = NULL;
8509 __Pyx_RefNannyDeclarations
8510 PyObject *__pyx_t_1 = NULL;
8511 int __pyx_lineno = 0;
8512 const char *__pyx_filename = NULL;
8513 int __pyx_clineno = 0;
8514 __Pyx_RefNannySetupContext(
"__pos__", 0);
8523 __Pyx_XDECREF(__pyx_r);
8524 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_clifford), ((PyObject *)__pyx_v_self));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 738, __pyx_L1_error)
8525 __Pyx_GOTREF(__pyx_t_1);
8526 __pyx_r = __pyx_t_1;
8540 __Pyx_XDECREF(__pyx_t_1);
8541 __Pyx_AddTraceback(
"PyClical.clifford.__pos__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8544 __Pyx_XGIVEREF(__pyx_r);
8545 __Pyx_RefNannyFinishContext();
8558 static PyObject *__pyx_pw_8PyClical_8clifford_21__add__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8559 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 ";
8560 #if CYTHON_COMPILING_IN_CPYTHON 8561 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_20__add__;
8563 static PyObject *__pyx_pw_8PyClical_8clifford_21__add__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8564 PyObject *__pyx_r = 0;
8565 __Pyx_RefNannyDeclarations
8566 __Pyx_RefNannySetupContext(
"__add__ (wrapper)", 0);
8567 __pyx_r = __pyx_pf_8PyClical_8clifford_20__add__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8570 __Pyx_RefNannyFinishContext();
8574 static PyObject *__pyx_pf_8PyClical_8clifford_20__add__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8575 PyObject *__pyx_r = NULL;
8576 __Pyx_RefNannyDeclarations
8577 PyObject *__pyx_t_1 = NULL;
8578 PyObject *__pyx_t_2 = NULL;
8579 int __pyx_lineno = 0;
8580 const char *__pyx_filename = NULL;
8581 int __pyx_clineno = 0;
8582 __Pyx_RefNannySetupContext(
"__add__", 0);
8591 __Pyx_XDECREF(__pyx_r);
8592 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 749, __pyx_L1_error)
8593 __Pyx_GOTREF(__pyx_t_1);
8594 __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, 749, __pyx_L1_error)
8595 __Pyx_GOTREF(__pyx_t_2);
8596 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8597 __pyx_r = __pyx_t_2;
8611 __Pyx_XDECREF(__pyx_t_1);
8612 __Pyx_XDECREF(__pyx_t_2);
8613 __Pyx_AddTraceback(
"PyClical.clifford.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8616 __Pyx_XGIVEREF(__pyx_r);
8617 __Pyx_RefNannyFinishContext();
8630 static PyObject *__pyx_pw_8PyClical_8clifford_23__iadd__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8631 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 ";
8632 #if CYTHON_COMPILING_IN_CPYTHON 8633 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_22__iadd__;
8635 static PyObject *__pyx_pw_8PyClical_8clifford_23__iadd__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8636 PyObject *__pyx_r = 0;
8637 __Pyx_RefNannyDeclarations
8638 __Pyx_RefNannySetupContext(
"__iadd__ (wrapper)", 0);
8639 __pyx_r = __pyx_pf_8PyClical_8clifford_22__iadd__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8642 __Pyx_RefNannyFinishContext();
8646 static PyObject *__pyx_pf_8PyClical_8clifford_22__iadd__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8647 PyObject *__pyx_r = NULL;
8648 __Pyx_RefNannyDeclarations
8649 PyObject *__pyx_t_1 = NULL;
8650 int __pyx_lineno = 0;
8651 const char *__pyx_filename = NULL;
8652 int __pyx_clineno = 0;
8653 __Pyx_RefNannySetupContext(
"__iadd__", 0);
8662 __Pyx_XDECREF(__pyx_r);
8663 __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, 758, __pyx_L1_error)
8664 __Pyx_GOTREF(__pyx_t_1);
8665 __pyx_r = __pyx_t_1;
8679 __Pyx_XDECREF(__pyx_t_1);
8680 __Pyx_AddTraceback(
"PyClical.clifford.__iadd__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8683 __Pyx_XGIVEREF(__pyx_r);
8684 __Pyx_RefNannyFinishContext();
8697 static PyObject *__pyx_pw_8PyClical_8clifford_25__sub__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8698 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 ";
8699 #if CYTHON_COMPILING_IN_CPYTHON 8700 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_24__sub__;
8702 static PyObject *__pyx_pw_8PyClical_8clifford_25__sub__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8703 PyObject *__pyx_r = 0;
8704 __Pyx_RefNannyDeclarations
8705 __Pyx_RefNannySetupContext(
"__sub__ (wrapper)", 0);
8706 __pyx_r = __pyx_pf_8PyClical_8clifford_24__sub__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8709 __Pyx_RefNannyFinishContext();
8713 static PyObject *__pyx_pf_8PyClical_8clifford_24__sub__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8714 PyObject *__pyx_r = NULL;
8715 __Pyx_RefNannyDeclarations
8716 PyObject *__pyx_t_1 = NULL;
8717 PyObject *__pyx_t_2 = NULL;
8718 int __pyx_lineno = 0;
8719 const char *__pyx_filename = NULL;
8720 int __pyx_clineno = 0;
8721 __Pyx_RefNannySetupContext(
"__sub__", 0);
8730 __Pyx_XDECREF(__pyx_r);
8731 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 769, __pyx_L1_error)
8732 __Pyx_GOTREF(__pyx_t_1);
8733 __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, 769, __pyx_L1_error)
8734 __Pyx_GOTREF(__pyx_t_2);
8735 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8736 __pyx_r = __pyx_t_2;
8750 __Pyx_XDECREF(__pyx_t_1);
8751 __Pyx_XDECREF(__pyx_t_2);
8752 __Pyx_AddTraceback(
"PyClical.clifford.__sub__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8755 __Pyx_XGIVEREF(__pyx_r);
8756 __Pyx_RefNannyFinishContext();
8769 static PyObject *__pyx_pw_8PyClical_8clifford_27__isub__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8770 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 ";
8771 #if CYTHON_COMPILING_IN_CPYTHON 8772 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_26__isub__;
8774 static PyObject *__pyx_pw_8PyClical_8clifford_27__isub__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8775 PyObject *__pyx_r = 0;
8776 __Pyx_RefNannyDeclarations
8777 __Pyx_RefNannySetupContext(
"__isub__ (wrapper)", 0);
8778 __pyx_r = __pyx_pf_8PyClical_8clifford_26__isub__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8781 __Pyx_RefNannyFinishContext();
8785 static PyObject *__pyx_pf_8PyClical_8clifford_26__isub__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8786 PyObject *__pyx_r = NULL;
8787 __Pyx_RefNannyDeclarations
8788 PyObject *__pyx_t_1 = NULL;
8789 int __pyx_lineno = 0;
8790 const char *__pyx_filename = NULL;
8791 int __pyx_clineno = 0;
8792 __Pyx_RefNannySetupContext(
"__isub__", 0);
8801 __Pyx_XDECREF(__pyx_r);
8802 __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, 778, __pyx_L1_error)
8803 __Pyx_GOTREF(__pyx_t_1);
8804 __pyx_r = __pyx_t_1;
8818 __Pyx_XDECREF(__pyx_t_1);
8819 __Pyx_AddTraceback(
"PyClical.clifford.__isub__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8822 __Pyx_XGIVEREF(__pyx_r);
8823 __Pyx_RefNannyFinishContext();
8836 static PyObject *__pyx_pw_8PyClical_8clifford_29__mul__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8837 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 ";
8838 #if CYTHON_COMPILING_IN_CPYTHON 8839 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_28__mul__;
8841 static PyObject *__pyx_pw_8PyClical_8clifford_29__mul__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8842 PyObject *__pyx_r = 0;
8843 __Pyx_RefNannyDeclarations
8844 __Pyx_RefNannySetupContext(
"__mul__ (wrapper)", 0);
8845 __pyx_r = __pyx_pf_8PyClical_8clifford_28__mul__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8848 __Pyx_RefNannyFinishContext();
8852 static PyObject *__pyx_pf_8PyClical_8clifford_28__mul__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8853 PyObject *__pyx_r = NULL;
8854 __Pyx_RefNannyDeclarations
8855 PyObject *__pyx_t_1 = NULL;
8856 PyObject *__pyx_t_2 = NULL;
8857 int __pyx_lineno = 0;
8858 const char *__pyx_filename = NULL;
8859 int __pyx_clineno = 0;
8860 __Pyx_RefNannySetupContext(
"__mul__", 0);
8869 __Pyx_XDECREF(__pyx_r);
8870 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 791, __pyx_L1_error)
8871 __Pyx_GOTREF(__pyx_t_1);
8872 __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, 791, __pyx_L1_error)
8873 __Pyx_GOTREF(__pyx_t_2);
8874 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8875 __pyx_r = __pyx_t_2;
8889 __Pyx_XDECREF(__pyx_t_1);
8890 __Pyx_XDECREF(__pyx_t_2);
8891 __Pyx_AddTraceback(
"PyClical.clifford.__mul__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8894 __Pyx_XGIVEREF(__pyx_r);
8895 __Pyx_RefNannyFinishContext();
8908 static PyObject *__pyx_pw_8PyClical_8clifford_31__imul__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8909 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 ";
8910 #if CYTHON_COMPILING_IN_CPYTHON 8911 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_30__imul__;
8913 static PyObject *__pyx_pw_8PyClical_8clifford_31__imul__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8914 PyObject *__pyx_r = 0;
8915 __Pyx_RefNannyDeclarations
8916 __Pyx_RefNannySetupContext(
"__imul__ (wrapper)", 0);
8917 __pyx_r = __pyx_pf_8PyClical_8clifford_30__imul__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8920 __Pyx_RefNannyFinishContext();
8924 static PyObject *__pyx_pf_8PyClical_8clifford_30__imul__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8925 PyObject *__pyx_r = NULL;
8926 __Pyx_RefNannyDeclarations
8927 PyObject *__pyx_t_1 = NULL;
8928 int __pyx_lineno = 0;
8929 const char *__pyx_filename = NULL;
8930 int __pyx_clineno = 0;
8931 __Pyx_RefNannySetupContext(
"__imul__", 0);
8940 __Pyx_XDECREF(__pyx_r);
8941 __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, 804, __pyx_L1_error)
8942 __Pyx_GOTREF(__pyx_t_1);
8943 __pyx_r = __pyx_t_1;
8957 __Pyx_XDECREF(__pyx_t_1);
8958 __Pyx_AddTraceback(
"PyClical.clifford.__imul__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8961 __Pyx_XGIVEREF(__pyx_r);
8962 __Pyx_RefNannyFinishContext();
8975 static PyObject *__pyx_pw_8PyClical_8clifford_33__mod__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8976 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 ";
8977 #if CYTHON_COMPILING_IN_CPYTHON 8978 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_32__mod__;
8980 static PyObject *__pyx_pw_8PyClical_8clifford_33__mod__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8981 PyObject *__pyx_r = 0;
8982 __Pyx_RefNannyDeclarations
8983 __Pyx_RefNannySetupContext(
"__mod__ (wrapper)", 0);
8984 __pyx_r = __pyx_pf_8PyClical_8clifford_32__mod__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8987 __Pyx_RefNannyFinishContext();
8991 static PyObject *__pyx_pf_8PyClical_8clifford_32__mod__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8992 PyObject *__pyx_r = NULL;
8993 __Pyx_RefNannyDeclarations
8994 PyObject *__pyx_t_1 = NULL;
8995 PyObject *__pyx_t_2 = NULL;
8996 int __pyx_lineno = 0;
8997 const char *__pyx_filename = NULL;
8998 int __pyx_clineno = 0;
8999 __Pyx_RefNannySetupContext(
"__mod__", 0);
9008 __Pyx_XDECREF(__pyx_r);
9009 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 819, __pyx_L1_error)
9010 __Pyx_GOTREF(__pyx_t_1);
9011 __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, 819, __pyx_L1_error)
9012 __Pyx_GOTREF(__pyx_t_2);
9013 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9014 __pyx_r = __pyx_t_2;
9028 __Pyx_XDECREF(__pyx_t_1);
9029 __Pyx_XDECREF(__pyx_t_2);
9030 __Pyx_AddTraceback(
"PyClical.clifford.__mod__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9033 __Pyx_XGIVEREF(__pyx_r);
9034 __Pyx_RefNannyFinishContext();
9047 static PyObject *__pyx_pw_8PyClical_8clifford_35__imod__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
9048 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 ";
9049 #if CYTHON_COMPILING_IN_CPYTHON 9050 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_34__imod__;
9052 static PyObject *__pyx_pw_8PyClical_8clifford_35__imod__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
9053 PyObject *__pyx_r = 0;
9054 __Pyx_RefNannyDeclarations
9055 __Pyx_RefNannySetupContext(
"__imod__ (wrapper)", 0);
9056 __pyx_r = __pyx_pf_8PyClical_8clifford_34__imod__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
9059 __Pyx_RefNannyFinishContext();
9063 static PyObject *__pyx_pf_8PyClical_8clifford_34__imod__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
9064 PyObject *__pyx_r = NULL;
9065 __Pyx_RefNannyDeclarations
9066 PyObject *__pyx_t_1 = NULL;
9067 int __pyx_lineno = 0;
9068 const char *__pyx_filename = NULL;
9069 int __pyx_clineno = 0;
9070 __Pyx_RefNannySetupContext(
"__imod__", 0);
9079 __Pyx_XDECREF(__pyx_r);
9080 __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, 834, __pyx_L1_error)
9081 __Pyx_GOTREF(__pyx_t_1);
9082 __pyx_r = __pyx_t_1;
9096 __Pyx_XDECREF(__pyx_t_1);
9097 __Pyx_AddTraceback(
"PyClical.clifford.__imod__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9100 __Pyx_XGIVEREF(__pyx_r);
9101 __Pyx_RefNannyFinishContext();
9114 static PyObject *__pyx_pw_8PyClical_8clifford_37__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
9115 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 ";
9116 #if CYTHON_COMPILING_IN_CPYTHON 9117 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_36__and__;
9119 static PyObject *__pyx_pw_8PyClical_8clifford_37__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
9120 PyObject *__pyx_r = 0;
9121 __Pyx_RefNannyDeclarations
9122 __Pyx_RefNannySetupContext(
"__and__ (wrapper)", 0);
9123 __pyx_r = __pyx_pf_8PyClical_8clifford_36__and__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
9126 __Pyx_RefNannyFinishContext();
9130 static PyObject *__pyx_pf_8PyClical_8clifford_36__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
9131 PyObject *__pyx_r = NULL;
9132 __Pyx_RefNannyDeclarations
9133 PyObject *__pyx_t_1 = NULL;
9134 PyObject *__pyx_t_2 = NULL;
9135 int __pyx_lineno = 0;
9136 const char *__pyx_filename = NULL;
9137 int __pyx_clineno = 0;
9138 __Pyx_RefNannySetupContext(
"__and__", 0);
9147 __Pyx_XDECREF(__pyx_r);
9148 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 849, __pyx_L1_error)
9149 __Pyx_GOTREF(__pyx_t_1);
9150 __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, 849, __pyx_L1_error)
9151 __Pyx_GOTREF(__pyx_t_2);
9152 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9153 __pyx_r = __pyx_t_2;
9167 __Pyx_XDECREF(__pyx_t_1);
9168 __Pyx_XDECREF(__pyx_t_2);
9169 __Pyx_AddTraceback(
"PyClical.clifford.__and__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9172 __Pyx_XGIVEREF(__pyx_r);
9173 __Pyx_RefNannyFinishContext();
9186 static PyObject *__pyx_pw_8PyClical_8clifford_39__iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
9187 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 ";
9188 #if CYTHON_COMPILING_IN_CPYTHON 9189 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_38__iand__;
9191 static PyObject *__pyx_pw_8PyClical_8clifford_39__iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
9192 PyObject *__pyx_r = 0;
9193 __Pyx_RefNannyDeclarations
9194 __Pyx_RefNannySetupContext(
"__iand__ (wrapper)", 0);
9195 __pyx_r = __pyx_pf_8PyClical_8clifford_38__iand__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
9198 __Pyx_RefNannyFinishContext();
9202 static PyObject *__pyx_pf_8PyClical_8clifford_38__iand__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
9203 PyObject *__pyx_r = NULL;
9204 __Pyx_RefNannyDeclarations
9205 PyObject *__pyx_t_1 = NULL;
9206 int __pyx_lineno = 0;
9207 const char *__pyx_filename = NULL;
9208 int __pyx_clineno = 0;
9209 __Pyx_RefNannySetupContext(
"__iand__", 0);
9218 __Pyx_XDECREF(__pyx_r);
9219 __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, 864, __pyx_L1_error)
9220 __Pyx_GOTREF(__pyx_t_1);
9221 __pyx_r = __pyx_t_1;
9235 __Pyx_XDECREF(__pyx_t_1);
9236 __Pyx_AddTraceback(
"PyClical.clifford.__iand__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9239 __Pyx_XGIVEREF(__pyx_r);
9240 __Pyx_RefNannyFinishContext();
9253 static PyObject *__pyx_pw_8PyClical_8clifford_41__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
9254 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 ";
9255 #if CYTHON_COMPILING_IN_CPYTHON 9256 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_40__xor__;
9258 static PyObject *__pyx_pw_8PyClical_8clifford_41__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
9259 PyObject *__pyx_r = 0;
9260 __Pyx_RefNannyDeclarations
9261 __Pyx_RefNannySetupContext(
"__xor__ (wrapper)", 0);
9262 __pyx_r = __pyx_pf_8PyClical_8clifford_40__xor__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
9265 __Pyx_RefNannyFinishContext();
9269 static PyObject *__pyx_pf_8PyClical_8clifford_40__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
9270 PyObject *__pyx_r = NULL;
9271 __Pyx_RefNannyDeclarations
9272 PyObject *__pyx_t_1 = NULL;
9273 PyObject *__pyx_t_2 = NULL;
9274 int __pyx_lineno = 0;
9275 const char *__pyx_filename = NULL;
9276 int __pyx_clineno = 0;
9277 __Pyx_RefNannySetupContext(
"__xor__", 0);
9286 __Pyx_XDECREF(__pyx_r);
9287 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 879, __pyx_L1_error)
9288 __Pyx_GOTREF(__pyx_t_1);
9289 __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, 879, __pyx_L1_error)
9290 __Pyx_GOTREF(__pyx_t_2);
9291 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9292 __pyx_r = __pyx_t_2;
9306 __Pyx_XDECREF(__pyx_t_1);
9307 __Pyx_XDECREF(__pyx_t_2);
9308 __Pyx_AddTraceback(
"PyClical.clifford.__xor__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9311 __Pyx_XGIVEREF(__pyx_r);
9312 __Pyx_RefNannyFinishContext();
9325 static PyObject *__pyx_pw_8PyClical_8clifford_43__ixor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
9326 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 ";
9327 #if CYTHON_COMPILING_IN_CPYTHON 9328 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_42__ixor__;
9330 static PyObject *__pyx_pw_8PyClical_8clifford_43__ixor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
9331 PyObject *__pyx_r = 0;
9332 __Pyx_RefNannyDeclarations
9333 __Pyx_RefNannySetupContext(
"__ixor__ (wrapper)", 0);
9334 __pyx_r = __pyx_pf_8PyClical_8clifford_42__ixor__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
9337 __Pyx_RefNannyFinishContext();
9341 static PyObject *__pyx_pf_8PyClical_8clifford_42__ixor__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
9342 PyObject *__pyx_r = NULL;
9343 __Pyx_RefNannyDeclarations
9344 PyObject *__pyx_t_1 = NULL;
9345 int __pyx_lineno = 0;
9346 const char *__pyx_filename = NULL;
9347 int __pyx_clineno = 0;
9348 __Pyx_RefNannySetupContext(
"__ixor__", 0);
9357 __Pyx_XDECREF(__pyx_r);
9358 __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, 894, __pyx_L1_error)
9359 __Pyx_GOTREF(__pyx_t_1);
9360 __pyx_r = __pyx_t_1;
9374 __Pyx_XDECREF(__pyx_t_1);
9375 __Pyx_AddTraceback(
"PyClical.clifford.__ixor__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9378 __Pyx_XGIVEREF(__pyx_r);
9379 __Pyx_RefNannyFinishContext();
9392 static PyObject *__pyx_pw_8PyClical_8clifford_45__truediv__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
9393 static char __pyx_doc_8PyClical_8clifford_44__truediv__[] =
"\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 ";
9394 #if CYTHON_COMPILING_IN_CPYTHON 9395 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_44__truediv__;
9397 static PyObject *__pyx_pw_8PyClical_8clifford_45__truediv__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
9398 PyObject *__pyx_r = 0;
9399 __Pyx_RefNannyDeclarations
9400 __Pyx_RefNannySetupContext(
"__truediv__ (wrapper)", 0);
9401 __pyx_r = __pyx_pf_8PyClical_8clifford_44__truediv__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
9404 __Pyx_RefNannyFinishContext();
9408 static PyObject *__pyx_pf_8PyClical_8clifford_44__truediv__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
9409 PyObject *__pyx_r = NULL;
9410 __Pyx_RefNannyDeclarations
9411 PyObject *__pyx_t_1 = NULL;
9412 PyObject *__pyx_t_2 = NULL;
9413 int __pyx_lineno = 0;
9414 const char *__pyx_filename = NULL;
9415 int __pyx_clineno = 0;
9416 __Pyx_RefNannySetupContext(
"__truediv__", 0);
9425 __Pyx_XDECREF(__pyx_r);
9426 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 909, __pyx_L1_error)
9427 __Pyx_GOTREF(__pyx_t_1);
9428 __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, 909, __pyx_L1_error)
9429 __Pyx_GOTREF(__pyx_t_2);
9430 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9431 __pyx_r = __pyx_t_2;
9445 __Pyx_XDECREF(__pyx_t_1);
9446 __Pyx_XDECREF(__pyx_t_2);
9447 __Pyx_AddTraceback(
"PyClical.clifford.__truediv__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9450 __Pyx_XGIVEREF(__pyx_r);
9451 __Pyx_RefNannyFinishContext();
9464 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 9465 static PyObject *__pyx_pw_8PyClical_8clifford_47__idiv__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
9466 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 ";
9467 #if CYTHON_COMPILING_IN_CPYTHON 9468 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_46__idiv__;
9470 static PyObject *__pyx_pw_8PyClical_8clifford_47__idiv__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
9471 PyObject *__pyx_r = 0;
9472 __Pyx_RefNannyDeclarations
9473 __Pyx_RefNannySetupContext(
"__idiv__ (wrapper)", 0);
9474 __pyx_r = __pyx_pf_8PyClical_8clifford_46__idiv__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
9477 __Pyx_RefNannyFinishContext();
9482 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 9483 static PyObject *__pyx_pf_8PyClical_8clifford_46__idiv__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
9484 PyObject *__pyx_r = NULL;
9485 __Pyx_RefNannyDeclarations
9486 PyObject *__pyx_t_1 = NULL;
9487 int __pyx_lineno = 0;
9488 const char *__pyx_filename = NULL;
9489 int __pyx_clineno = 0;
9490 __Pyx_RefNannySetupContext(
"__idiv__", 0);
9499 __Pyx_XDECREF(__pyx_r);
9500 __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, 924, __pyx_L1_error)
9501 __Pyx_GOTREF(__pyx_t_1);
9502 __pyx_r = __pyx_t_1;
9516 __Pyx_XDECREF(__pyx_t_1);
9517 __Pyx_AddTraceback(
"PyClical.clifford.__idiv__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9520 __Pyx_XGIVEREF(__pyx_r);
9521 __Pyx_RefNannyFinishContext();
9535 static PyObject *__pyx_pw_8PyClical_8clifford_49inv(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9536 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 ";
9537 static PyObject *__pyx_pw_8PyClical_8clifford_49inv(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9538 PyObject *__pyx_r = 0;
9539 __Pyx_RefNannyDeclarations
9540 __Pyx_RefNannySetupContext(
"inv (wrapper)", 0);
9541 __pyx_r = __pyx_pf_8PyClical_8clifford_48inv(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
9544 __Pyx_RefNannyFinishContext();
9548 static PyObject *__pyx_pf_8PyClical_8clifford_48inv(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
9549 PyObject *__pyx_r = NULL;
9550 __Pyx_RefNannyDeclarations
9551 PyObject *__pyx_t_1 = NULL;
9552 PyObject *__pyx_t_2 = NULL;
9553 int __pyx_lineno = 0;
9554 const char *__pyx_filename = NULL;
9555 int __pyx_clineno = 0;
9556 __Pyx_RefNannySetupContext(
"inv", 0);
9565 __Pyx_XDECREF(__pyx_r);
9566 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 937, __pyx_L1_error)
9567 __Pyx_GOTREF(__pyx_t_1);
9568 __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, 937, __pyx_L1_error)
9569 __Pyx_GOTREF(__pyx_t_2);
9570 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9571 __pyx_r = __pyx_t_2;
9585 __Pyx_XDECREF(__pyx_t_1);
9586 __Pyx_XDECREF(__pyx_t_2);
9587 __Pyx_AddTraceback(
"PyClical.clifford.inv", __pyx_clineno, __pyx_lineno, __pyx_filename);
9590 __Pyx_XGIVEREF(__pyx_r);
9591 __Pyx_RefNannyFinishContext();
9604 static PyObject *__pyx_pw_8PyClical_8clifford_51__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
9605 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 ";
9606 #if CYTHON_COMPILING_IN_CPYTHON 9607 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_50__or__;
9609 static PyObject *__pyx_pw_8PyClical_8clifford_51__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
9610 PyObject *__pyx_r = 0;
9611 __Pyx_RefNannyDeclarations
9612 __Pyx_RefNannySetupContext(
"__or__ (wrapper)", 0);
9613 __pyx_r = __pyx_pf_8PyClical_8clifford_50__or__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
9616 __Pyx_RefNannyFinishContext();
9620 static PyObject *__pyx_pf_8PyClical_8clifford_50__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
9621 PyObject *__pyx_r = NULL;
9622 __Pyx_RefNannyDeclarations
9623 PyObject *__pyx_t_1 = NULL;
9624 PyObject *__pyx_t_2 = NULL;
9625 int __pyx_lineno = 0;
9626 const char *__pyx_filename = NULL;
9627 int __pyx_clineno = 0;
9628 __Pyx_RefNannySetupContext(
"__or__", 0);
9637 __Pyx_XDECREF(__pyx_r);
9638 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 948, __pyx_L1_error)
9639 __Pyx_GOTREF(__pyx_t_1);
9640 __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, 948, __pyx_L1_error)
9641 __Pyx_GOTREF(__pyx_t_2);
9642 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9643 __pyx_r = __pyx_t_2;
9657 __Pyx_XDECREF(__pyx_t_1);
9658 __Pyx_XDECREF(__pyx_t_2);
9659 __Pyx_AddTraceback(
"PyClical.clifford.__or__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9662 __Pyx_XGIVEREF(__pyx_r);
9663 __Pyx_RefNannyFinishContext();
9676 static PyObject *__pyx_pw_8PyClical_8clifford_53__ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
9677 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 ";
9678 #if CYTHON_COMPILING_IN_CPYTHON 9679 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_52__ior__;
9681 static PyObject *__pyx_pw_8PyClical_8clifford_53__ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
9682 PyObject *__pyx_r = 0;
9683 __Pyx_RefNannyDeclarations
9684 __Pyx_RefNannySetupContext(
"__ior__ (wrapper)", 0);
9685 __pyx_r = __pyx_pf_8PyClical_8clifford_52__ior__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
9688 __Pyx_RefNannyFinishContext();
9692 static PyObject *__pyx_pf_8PyClical_8clifford_52__ior__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
9693 PyObject *__pyx_r = NULL;
9694 __Pyx_RefNannyDeclarations
9695 PyObject *__pyx_t_1 = NULL;
9696 int __pyx_lineno = 0;
9697 const char *__pyx_filename = NULL;
9698 int __pyx_clineno = 0;
9699 __Pyx_RefNannySetupContext(
"__ior__", 0);
9708 __Pyx_XDECREF(__pyx_r);
9709 __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, 959, __pyx_L1_error)
9710 __Pyx_GOTREF(__pyx_t_1);
9711 __pyx_r = __pyx_t_1;
9725 __Pyx_XDECREF(__pyx_t_1);
9726 __Pyx_AddTraceback(
"PyClical.clifford.__ior__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9729 __Pyx_XGIVEREF(__pyx_r);
9730 __Pyx_RefNannyFinishContext();
9743 static PyObject *__pyx_pw_8PyClical_8clifford_55__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_m, PyObject *__pyx_v_dummy);
9744 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 ";
9745 #if CYTHON_COMPILING_IN_CPYTHON 9746 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_54__pow__;
9748 static PyObject *__pyx_pw_8PyClical_8clifford_55__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_m, PyObject *__pyx_v_dummy) {
9749 PyObject *__pyx_r = 0;
9750 __Pyx_RefNannyDeclarations
9751 __Pyx_RefNannySetupContext(
"__pow__ (wrapper)", 0);
9752 __pyx_r = __pyx_pf_8PyClical_8clifford_54__pow__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_m), ((PyObject *)__pyx_v_dummy));
9755 __Pyx_RefNannyFinishContext();
9759 static PyObject *__pyx_pf_8PyClical_8clifford_54__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_m, CYTHON_UNUSED PyObject *__pyx_v_dummy) {
9760 PyObject *__pyx_r = NULL;
9761 __Pyx_RefNannyDeclarations
9762 PyObject *__pyx_t_1 = NULL;
9763 int __pyx_lineno = 0;
9764 const char *__pyx_filename = NULL;
9765 int __pyx_clineno = 0;
9766 __Pyx_RefNannySetupContext(
"__pow__", 0);
9775 __Pyx_XDECREF(__pyx_r);
9776 __pyx_t_1 = __pyx_f_8PyClical_pow(__pyx_v_self, __pyx_v_m, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 978, __pyx_L1_error)
9777 __Pyx_GOTREF(__pyx_t_1);
9778 __pyx_r = __pyx_t_1;
9792 __Pyx_XDECREF(__pyx_t_1);
9793 __Pyx_AddTraceback(
"PyClical.clifford.__pow__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9796 __Pyx_XGIVEREF(__pyx_r);
9797 __Pyx_RefNannyFinishContext();
9810 static PyObject *__pyx_pw_8PyClical_8clifford_57pow(PyObject *__pyx_v_self, PyObject *__pyx_v_m);
9811 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 ";
9812 static PyObject *__pyx_pw_8PyClical_8clifford_57pow(PyObject *__pyx_v_self, PyObject *__pyx_v_m) {
9813 PyObject *__pyx_r = 0;
9814 __Pyx_RefNannyDeclarations
9815 __Pyx_RefNannySetupContext(
"pow (wrapper)", 0);
9816 __pyx_r = __pyx_pf_8PyClical_8clifford_56pow(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_m));
9819 __Pyx_RefNannyFinishContext();
9823 static PyObject *__pyx_pf_8PyClical_8clifford_56pow(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_m) {
9824 PyObject *__pyx_r = NULL;
9825 __Pyx_RefNannyDeclarations
9826 PyObject *__pyx_t_1 = NULL;
9827 PyObject *__pyx_t_2 = NULL;
9831 int __pyx_lineno = 0;
9832 const char *__pyx_filename = NULL;
9833 int __pyx_clineno = 0;
9834 __Pyx_RefNannySetupContext(
"pow", 0);
9843 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_numbers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 999, __pyx_L1_error)
9844 __Pyx_GOTREF(__pyx_t_1);
9845 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Integral);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 999, __pyx_L1_error)
9846 __Pyx_GOTREF(__pyx_t_2);
9847 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9848 __pyx_t_3 = PyObject_IsInstance(__pyx_v_m, __pyx_t_2);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(0, 999, __pyx_L1_error)
9849 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9850 __pyx_t_4 = (__pyx_t_3 != 0);
9860 __Pyx_XDECREF(__pyx_r);
9861 __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1000, __pyx_L1_error)
9862 __Pyx_GOTREF(__pyx_t_2);
9863 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_m);
if (unlikely((__pyx_t_5 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1000, __pyx_L1_error)
9864 __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, 1000, __pyx_L1_error)
9865 __Pyx_GOTREF(__pyx_t_1);
9866 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9867 __pyx_r = __pyx_t_1;
9888 __Pyx_XDECREF(__pyx_r);
9889 __pyx_t_1 = __pyx_f_8PyClical_log(((PyObject *)__pyx_v_self), 0, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1002, __pyx_L1_error)
9890 __Pyx_GOTREF(__pyx_t_1);
9891 __pyx_t_2 = PyNumber_Multiply(__pyx_v_m, __pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1002, __pyx_L1_error)
9892 __Pyx_GOTREF(__pyx_t_2);
9893 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9894 __pyx_t_1 = __pyx_f_8PyClical_exp(__pyx_t_2, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1002, __pyx_L1_error)
9895 __Pyx_GOTREF(__pyx_t_1);
9896 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9897 __pyx_r = __pyx_t_1;
9912 __Pyx_XDECREF(__pyx_t_1);
9913 __Pyx_XDECREF(__pyx_t_2);
9914 __Pyx_AddTraceback(
"PyClical.clifford.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
9917 __Pyx_XGIVEREF(__pyx_r);
9918 __Pyx_RefNannyFinishContext();
9931 static PyObject *__pyx_pw_8PyClical_8clifford_59outer_pow(PyObject *__pyx_v_self, PyObject *__pyx_v_m);
9932 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 ";
9933 static PyObject *__pyx_pw_8PyClical_8clifford_59outer_pow(PyObject *__pyx_v_self, PyObject *__pyx_v_m) {
9934 PyObject *__pyx_r = 0;
9935 __Pyx_RefNannyDeclarations
9936 __Pyx_RefNannySetupContext(
"outer_pow (wrapper)", 0);
9937 __pyx_r = __pyx_pf_8PyClical_8clifford_58outer_pow(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_m));
9940 __Pyx_RefNannyFinishContext();
9944 static PyObject *__pyx_pf_8PyClical_8clifford_58outer_pow(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_m) {
9945 PyObject *__pyx_r = NULL;
9946 __Pyx_RefNannyDeclarations
9947 PyObject *__pyx_t_1 = NULL;
9949 PyObject *__pyx_t_3 = NULL;
9950 int __pyx_lineno = 0;
9951 const char *__pyx_filename = NULL;
9952 int __pyx_clineno = 0;
9953 __Pyx_RefNannySetupContext(
"outer_pow", 0);
9962 __Pyx_XDECREF(__pyx_r);
9963 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1018, __pyx_L1_error)
9964 __Pyx_GOTREF(__pyx_t_1);
9965 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_m);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1018, __pyx_L1_error)
9966 __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, 1018, __pyx_L1_error)
9967 __Pyx_GOTREF(__pyx_t_3);
9968 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9969 __pyx_r = __pyx_t_3;
9983 __Pyx_XDECREF(__pyx_t_1);
9984 __Pyx_XDECREF(__pyx_t_3);
9985 __Pyx_AddTraceback(
"PyClical.clifford.outer_pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
9988 __Pyx_XGIVEREF(__pyx_r);
9989 __Pyx_RefNannyFinishContext();
10002 static PyObject *__pyx_pw_8PyClical_8clifford_61__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
10003 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 ";
10004 #if CYTHON_COMPILING_IN_CPYTHON 10005 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_60__call__;
10007 static PyObject *__pyx_pw_8PyClical_8clifford_61__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10008 PyObject *__pyx_v_grade = 0;
10009 int __pyx_lineno = 0;
10010 const char *__pyx_filename = NULL;
10011 int __pyx_clineno = 0;
10012 PyObject *__pyx_r = 0;
10013 __Pyx_RefNannyDeclarations
10014 __Pyx_RefNannySetupContext(
"__call__ (wrapper)", 0);
10016 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_grade,0};
10017 PyObject* values[1] = {0};
10018 if (unlikely(__pyx_kwds)) {
10019 Py_ssize_t kw_args;
10020 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10021 switch (pos_args) {
10022 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10023 CYTHON_FALLTHROUGH;
10025 default:
goto __pyx_L5_argtuple_error;
10027 kw_args = PyDict_Size(__pyx_kwds);
10028 switch (pos_args) {
10030 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_grade)) != 0)) kw_args--;
10031 else goto __pyx_L5_argtuple_error;
10033 if (unlikely(kw_args > 0)) {
10034 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__call__") < 0)) __PYX_ERR(0, 1020, __pyx_L3_error)
10036 }
else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
10037 goto __pyx_L5_argtuple_error;
10039 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10041 __pyx_v_grade = values[0];
10043 goto __pyx_L4_argument_unpacking_done;
10044 __pyx_L5_argtuple_error:;
10045 __Pyx_RaiseArgtupleInvalid(
"__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1020, __pyx_L3_error)
10047 __Pyx_AddTraceback(
"PyClical.clifford.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10048 __Pyx_RefNannyFinishContext();
10050 __pyx_L4_argument_unpacking_done:;
10051 __pyx_r = __pyx_pf_8PyClical_8clifford_60__call__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), __pyx_v_grade);
10054 __Pyx_RefNannyFinishContext();
10058 static PyObject *__pyx_pf_8PyClical_8clifford_60__call__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_grade) {
10059 PyObject *__pyx_r = NULL;
10060 __Pyx_RefNannyDeclarations
10061 PyObject *__pyx_t_1 = NULL;
10063 PyObject *__pyx_t_3 = NULL;
10064 int __pyx_lineno = 0;
10065 const char *__pyx_filename = NULL;
10066 int __pyx_clineno = 0;
10067 __Pyx_RefNannySetupContext(
"__call__", 0);
10076 __Pyx_XDECREF(__pyx_r);
10077 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1037, __pyx_L1_error)
10078 __Pyx_GOTREF(__pyx_t_1);
10079 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_grade);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1037, __pyx_L1_error)
10080 __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, 1037, __pyx_L1_error)
10081 __Pyx_GOTREF(__pyx_t_3);
10082 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10083 __pyx_r = __pyx_t_3;
10097 __Pyx_XDECREF(__pyx_t_1);
10098 __Pyx_XDECREF(__pyx_t_3);
10099 __Pyx_AddTraceback(
"PyClical.clifford.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10102 __Pyx_XGIVEREF(__pyx_r);
10103 __Pyx_RefNannyFinishContext();
10116 static PyObject *__pyx_pw_8PyClical_8clifford_63scalar(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10117 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 ";
10118 static PyObject *__pyx_pw_8PyClical_8clifford_63scalar(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10119 PyObject *__pyx_r = 0;
10120 __Pyx_RefNannyDeclarations
10121 __Pyx_RefNannySetupContext(
"scalar (wrapper)", 0);
10122 __pyx_r = __pyx_pf_8PyClical_8clifford_62scalar(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10125 __Pyx_RefNannyFinishContext();
10129 static PyObject *__pyx_pf_8PyClical_8clifford_62scalar(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10130 PyObject *__pyx_r = NULL;
10131 __Pyx_RefNannyDeclarations
10132 PyObject *__pyx_t_1 = NULL;
10133 int __pyx_lineno = 0;
10134 const char *__pyx_filename = NULL;
10135 int __pyx_clineno = 0;
10136 __Pyx_RefNannySetupContext(
"scalar", 0);
10145 __Pyx_XDECREF(__pyx_r);
10146 __pyx_t_1 =
PyFloat_FromDouble(__pyx_v_self->instance->scalar());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1048, __pyx_L1_error)
10147 __Pyx_GOTREF(__pyx_t_1);
10148 __pyx_r = __pyx_t_1;
10162 __Pyx_XDECREF(__pyx_t_1);
10163 __Pyx_AddTraceback(
"PyClical.clifford.scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
10166 __Pyx_XGIVEREF(__pyx_r);
10167 __Pyx_RefNannyFinishContext();
10180 static PyObject *__pyx_pw_8PyClical_8clifford_65pure(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10181 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 ";
10182 static PyObject *__pyx_pw_8PyClical_8clifford_65pure(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10183 PyObject *__pyx_r = 0;
10184 __Pyx_RefNannyDeclarations
10185 __Pyx_RefNannySetupContext(
"pure (wrapper)", 0);
10186 __pyx_r = __pyx_pf_8PyClical_8clifford_64pure(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10189 __Pyx_RefNannyFinishContext();
10193 static PyObject *__pyx_pf_8PyClical_8clifford_64pure(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10194 PyObject *__pyx_r = NULL;
10195 __Pyx_RefNannyDeclarations
10196 PyObject *__pyx_t_1 = NULL;
10197 PyObject *__pyx_t_2 = NULL;
10198 int __pyx_lineno = 0;
10199 const char *__pyx_filename = NULL;
10200 int __pyx_clineno = 0;
10201 __Pyx_RefNannySetupContext(
"pure", 0);
10210 __Pyx_XDECREF(__pyx_r);
10211 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1059, __pyx_L1_error)
10212 __Pyx_GOTREF(__pyx_t_1);
10213 __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, 1059, __pyx_L1_error)
10214 __Pyx_GOTREF(__pyx_t_2);
10215 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10216 __pyx_r = __pyx_t_2;
10230 __Pyx_XDECREF(__pyx_t_1);
10231 __Pyx_XDECREF(__pyx_t_2);
10232 __Pyx_AddTraceback(
"PyClical.clifford.pure", __pyx_clineno, __pyx_lineno, __pyx_filename);
10235 __Pyx_XGIVEREF(__pyx_r);
10236 __Pyx_RefNannyFinishContext();
10249 static PyObject *__pyx_pw_8PyClical_8clifford_67even(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10250 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 ";
10251 static PyObject *__pyx_pw_8PyClical_8clifford_67even(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10252 PyObject *__pyx_r = 0;
10253 __Pyx_RefNannyDeclarations
10254 __Pyx_RefNannySetupContext(
"even (wrapper)", 0);
10255 __pyx_r = __pyx_pf_8PyClical_8clifford_66even(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10258 __Pyx_RefNannyFinishContext();
10262 static PyObject *__pyx_pf_8PyClical_8clifford_66even(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10263 PyObject *__pyx_r = NULL;
10264 __Pyx_RefNannyDeclarations
10265 PyObject *__pyx_t_1 = NULL;
10266 PyObject *__pyx_t_2 = NULL;
10267 int __pyx_lineno = 0;
10268 const char *__pyx_filename = NULL;
10269 int __pyx_clineno = 0;
10270 __Pyx_RefNannySetupContext(
"even", 0);
10279 __Pyx_XDECREF(__pyx_r);
10280 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1068, __pyx_L1_error)
10281 __Pyx_GOTREF(__pyx_t_1);
10282 __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, 1068, __pyx_L1_error)
10283 __Pyx_GOTREF(__pyx_t_2);
10284 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10285 __pyx_r = __pyx_t_2;
10299 __Pyx_XDECREF(__pyx_t_1);
10300 __Pyx_XDECREF(__pyx_t_2);
10301 __Pyx_AddTraceback(
"PyClical.clifford.even", __pyx_clineno, __pyx_lineno, __pyx_filename);
10304 __Pyx_XGIVEREF(__pyx_r);
10305 __Pyx_RefNannyFinishContext();
10318 static PyObject *__pyx_pw_8PyClical_8clifford_69odd(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10319 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 ";
10320 static PyObject *__pyx_pw_8PyClical_8clifford_69odd(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10321 PyObject *__pyx_r = 0;
10322 __Pyx_RefNannyDeclarations
10323 __Pyx_RefNannySetupContext(
"odd (wrapper)", 0);
10324 __pyx_r = __pyx_pf_8PyClical_8clifford_68odd(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10327 __Pyx_RefNannyFinishContext();
10331 static PyObject *__pyx_pf_8PyClical_8clifford_68odd(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10332 PyObject *__pyx_r = NULL;
10333 __Pyx_RefNannyDeclarations
10334 PyObject *__pyx_t_1 = NULL;
10335 PyObject *__pyx_t_2 = NULL;
10336 int __pyx_lineno = 0;
10337 const char *__pyx_filename = NULL;
10338 int __pyx_clineno = 0;
10339 __Pyx_RefNannySetupContext(
"odd", 0);
10348 __Pyx_XDECREF(__pyx_r);
10349 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1077, __pyx_L1_error)
10350 __Pyx_GOTREF(__pyx_t_1);
10351 __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, 1077, __pyx_L1_error)
10352 __Pyx_GOTREF(__pyx_t_2);
10353 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10354 __pyx_r = __pyx_t_2;
10368 __Pyx_XDECREF(__pyx_t_1);
10369 __Pyx_XDECREF(__pyx_t_2);
10370 __Pyx_AddTraceback(
"PyClical.clifford.odd", __pyx_clineno, __pyx_lineno, __pyx_filename);
10373 __Pyx_XGIVEREF(__pyx_r);
10374 __Pyx_RefNannyFinishContext();
10387 static PyObject *__pyx_pw_8PyClical_8clifford_71vector_part(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
10388 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 ";
10389 static PyObject *__pyx_pw_8PyClical_8clifford_71vector_part(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10390 PyObject *__pyx_v_frm = 0;
10391 int __pyx_lineno = 0;
10392 const char *__pyx_filename = NULL;
10393 int __pyx_clineno = 0;
10394 PyObject *__pyx_r = 0;
10395 __Pyx_RefNannyDeclarations
10396 __Pyx_RefNannySetupContext(
"vector_part (wrapper)", 0);
10398 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frm,0};
10399 PyObject* values[1] = {0};
10400 values[0] = ((PyObject *)Py_None);
10401 if (unlikely(__pyx_kwds)) {
10402 Py_ssize_t kw_args;
10403 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10404 switch (pos_args) {
10405 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10406 CYTHON_FALLTHROUGH;
10408 default:
goto __pyx_L5_argtuple_error;
10410 kw_args = PyDict_Size(__pyx_kwds);
10411 switch (pos_args) {
10414 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_frm);
10415 if (value) { values[0] = value; kw_args--; }
10418 if (unlikely(kw_args > 0)) {
10419 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"vector_part") < 0)) __PYX_ERR(0, 1079, __pyx_L3_error)
10422 switch (PyTuple_GET_SIZE(__pyx_args)) {
10423 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10424 CYTHON_FALLTHROUGH;
10426 default:
goto __pyx_L5_argtuple_error;
10429 __pyx_v_frm = values[0];
10431 goto __pyx_L4_argument_unpacking_done;
10432 __pyx_L5_argtuple_error:;
10433 __Pyx_RaiseArgtupleInvalid(
"vector_part", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1079, __pyx_L3_error)
10435 __Pyx_AddTraceback(
"PyClical.clifford.vector_part", __pyx_clineno, __pyx_lineno, __pyx_filename);
10436 __Pyx_RefNannyFinishContext();
10438 __pyx_L4_argument_unpacking_done:;
10439 __pyx_r = __pyx_pf_8PyClical_8clifford_70vector_part(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), __pyx_v_frm);
10442 __Pyx_RefNannyFinishContext();
10446 static PyObject *__pyx_pf_8PyClical_8clifford_70vector_part(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_frm) {
10447 PyObject *__pyx_v_error_msg_prefix = NULL;
10448 std::vector<scalar_t> __pyx_v_vec;
10451 PyObject *__pyx_v_lst = NULL;
10452 PyObject *__pyx_v_err = NULL;
10453 PyObject *__pyx_r = NULL;
10454 __Pyx_RefNannyDeclarations
10455 PyObject *__pyx_t_1 = NULL;
10456 PyObject *__pyx_t_2 = NULL;
10457 PyObject *__pyx_t_3 = NULL;
10460 std::vector<scalar_t> __pyx_t_6;
10461 PyObject *__pyx_t_7 = NULL;
10465 PyObject *__pyx_t_11 = NULL;
10466 PyObject *__pyx_t_12 = NULL;
10467 PyObject *__pyx_t_13 = NULL;
10468 PyObject *__pyx_t_14 = NULL;
10469 PyObject *__pyx_t_15 = NULL;
10470 char const *__pyx_t_16;
10471 PyObject *__pyx_t_17 = NULL;
10472 PyObject *__pyx_t_18 = NULL;
10473 PyObject *__pyx_t_19 = NULL;
10474 PyObject *__pyx_t_20 = NULL;
10475 PyObject *__pyx_t_21 = NULL;
10476 PyObject *__pyx_t_22 = NULL;
10477 int __pyx_lineno = 0;
10478 const char *__pyx_filename = NULL;
10479 int __pyx_clineno = 0;
10480 __Pyx_RefNannySetupContext(
"vector_part", 0);
10489 __Pyx_INCREF(__pyx_kp_u_Cannot_take_vector_part_of);
10490 __pyx_v_error_msg_prefix = __pyx_kp_u_Cannot_take_vector_part_of;
10500 __Pyx_PyThreadState_declare
10501 __Pyx_PyThreadState_assign
10502 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
10503 __Pyx_XGOTREF(__pyx_t_1);
10504 __Pyx_XGOTREF(__pyx_t_2);
10505 __Pyx_XGOTREF(__pyx_t_3);
10515 __pyx_t_4 = (__pyx_v_frm == Py_None);
10516 __pyx_t_5 = (__pyx_t_4 != 0);
10526 __pyx_t_6 = __pyx_v_self->instance->vector_part();
10527 __pyx_v_vec = __pyx_t_6;
10548 __pyx_t_6 = __pyx_v_self->instance->vector_part(__pyx_f_8PyClical_9index_set_unwrap(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_frm)));
10550 __Pyx_CppExn2PyErr();
10551 __PYX_ERR(0, 1096, __pyx_L3_error)
10553 __pyx_v_vec = __pyx_t_6;
10564 __pyx_v_n = __pyx_v_vec.size();
10573 __pyx_t_7 = PyList_New(1 * ((__pyx_v_n<0) ? 0:__pyx_v_n));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1098, __pyx_L3_error)
10574 __Pyx_GOTREF(__pyx_t_7);
10575 { Py_ssize_t __pyx_temp;
10576 for (__pyx_temp=0; __pyx_temp < __pyx_v_n; __pyx_temp++) {
10577 __Pyx_INCREF(__pyx_float_0_0);
10578 __Pyx_GIVEREF(__pyx_float_0_0);
10579 PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_float_0_0);
10582 __pyx_v_lst = ((PyObject*)__pyx_t_7);
10592 __pyx_t_8 = __pyx_v_n;
10593 __pyx_t_9 = __pyx_t_8;
10594 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
10595 __pyx_v_i = __pyx_t_10;
10604 __pyx_t_7 =
PyFloat_FromDouble((__pyx_v_vec[__pyx_v_i]));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1100, __pyx_L3_error)
10605 __Pyx_GOTREF(__pyx_t_7);
10606 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, 1100, __pyx_L3_error)
10607 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10617 __Pyx_XDECREF(__pyx_r);
10618 __Pyx_INCREF(__pyx_v_lst);
10619 __pyx_r = __pyx_v_lst;
10620 goto __pyx_L7_try_return;
10631 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10640 __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
10642 __Pyx_AddTraceback(
"PyClical.clifford.vector_part", __pyx_clineno, __pyx_lineno, __pyx_filename);
10643 if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_11, &__pyx_t_12) < 0) __PYX_ERR(0, 1102, __pyx_L5_except_error)
10644 __Pyx_GOTREF(__pyx_t_7);
10645 __Pyx_GOTREF(__pyx_t_11);
10646 __Pyx_GOTREF(__pyx_t_12);
10647 __Pyx_INCREF(__pyx_t_11);
10648 __pyx_v_err = __pyx_t_11;
10658 __pyx_t_13 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)__pyx_v_self));
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1103, __pyx_L17_error)
10659 __Pyx_GOTREF(__pyx_t_13);
10660 __pyx_t_14 = __Pyx_PyUnicode_Concat(__pyx_v_error_msg_prefix, __pyx_t_13);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1103, __pyx_L17_error)
10661 __Pyx_GOTREF(__pyx_t_14);
10662 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
10663 __pyx_t_13 = __Pyx_PyUnicode_Concat(__pyx_t_14, __pyx_kp_u_using_invalid);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1103, __pyx_L17_error)
10664 __Pyx_GOTREF(__pyx_t_13);
10665 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
10674 __pyx_t_14 = PyObject_Repr(__pyx_v_frm);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1104, __pyx_L17_error)
10675 __Pyx_GOTREF(__pyx_t_14);
10676 __pyx_t_15 = PyNumber_Add(__pyx_t_13, __pyx_t_14);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1104, __pyx_L17_error)
10677 __Pyx_GOTREF(__pyx_t_15);
10678 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
10679 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
10680 __pyx_t_14 = PyNumber_Add(__pyx_t_15, __pyx_kp_u_as_frame);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1104, __pyx_L17_error)
10681 __Pyx_GOTREF(__pyx_t_14);
10682 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
10691 __pyx_t_15 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_err);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1105, __pyx_L17_error)
10692 __Pyx_GOTREF(__pyx_t_15);
10693 __pyx_t_13 = PyNumber_Add(__pyx_t_14, __pyx_t_15);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1105, __pyx_L17_error)
10694 __Pyx_GOTREF(__pyx_t_13);
10695 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
10696 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
10705 __pyx_t_15 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_13);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1103, __pyx_L17_error)
10706 __Pyx_GOTREF(__pyx_t_15);
10707 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
10708 __Pyx_Raise(__pyx_t_15, 0, 0, 0);
10709 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
10710 __PYX_ERR(0, 1103, __pyx_L17_error)
10723 __Pyx_PyThreadState_declare
10724 __Pyx_PyThreadState_assign
10725 __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
10726 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
10727 __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
10728 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
10729 if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
10730 if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
10731 __Pyx_XGOTREF(__pyx_t_17);
10732 __Pyx_XGOTREF(__pyx_t_18);
10733 __Pyx_XGOTREF(__pyx_t_19);
10734 __Pyx_XGOTREF(__pyx_t_20);
10735 __Pyx_XGOTREF(__pyx_t_21);
10736 __Pyx_XGOTREF(__pyx_t_22);
10737 __pyx_t_8 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
10739 __Pyx_DECREF(__pyx_v_err);
10740 __pyx_v_err = NULL;
10742 if (PY_MAJOR_VERSION >= 3) {
10743 __Pyx_XGIVEREF(__pyx_t_20);
10744 __Pyx_XGIVEREF(__pyx_t_21);
10745 __Pyx_XGIVEREF(__pyx_t_22);
10746 __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
10748 __Pyx_XGIVEREF(__pyx_t_17);
10749 __Pyx_XGIVEREF(__pyx_t_18);
10750 __Pyx_XGIVEREF(__pyx_t_19);
10751 __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
10752 __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
10753 __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_16;
10754 goto __pyx_L5_except_error;
10758 goto __pyx_L5_except_error;
10759 __pyx_L5_except_error:;
10768 __Pyx_XGIVEREF(__pyx_t_1);
10769 __Pyx_XGIVEREF(__pyx_t_2);
10770 __Pyx_XGIVEREF(__pyx_t_3);
10771 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
10772 goto __pyx_L1_error;
10773 __pyx_L7_try_return:;
10774 __Pyx_XGIVEREF(__pyx_t_1);
10775 __Pyx_XGIVEREF(__pyx_t_2);
10776 __Pyx_XGIVEREF(__pyx_t_3);
10777 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
10791 __Pyx_XDECREF(__pyx_t_7);
10792 __Pyx_XDECREF(__pyx_t_11);
10793 __Pyx_XDECREF(__pyx_t_12);
10794 __Pyx_XDECREF(__pyx_t_13);
10795 __Pyx_XDECREF(__pyx_t_14);
10796 __Pyx_XDECREF(__pyx_t_15);
10797 __Pyx_AddTraceback(
"PyClical.clifford.vector_part", __pyx_clineno, __pyx_lineno, __pyx_filename);
10800 __Pyx_XDECREF(__pyx_v_error_msg_prefix);
10801 __Pyx_XDECREF(__pyx_v_lst);
10802 __Pyx_XDECREF(__pyx_v_err);
10803 __Pyx_XGIVEREF(__pyx_r);
10804 __Pyx_RefNannyFinishContext();
10817 static PyObject *__pyx_pw_8PyClical_8clifford_73involute(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10818 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 ";
10819 static PyObject *__pyx_pw_8PyClical_8clifford_73involute(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10820 PyObject *__pyx_r = 0;
10821 __Pyx_RefNannyDeclarations
10822 __Pyx_RefNannySetupContext(
"involute (wrapper)", 0);
10823 __pyx_r = __pyx_pf_8PyClical_8clifford_72involute(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10826 __Pyx_RefNannyFinishContext();
10830 static PyObject *__pyx_pf_8PyClical_8clifford_72involute(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10831 PyObject *__pyx_r = NULL;
10832 __Pyx_RefNannyDeclarations
10833 PyObject *__pyx_t_1 = NULL;
10834 PyObject *__pyx_t_2 = NULL;
10835 int __pyx_lineno = 0;
10836 const char *__pyx_filename = NULL;
10837 int __pyx_clineno = 0;
10838 __Pyx_RefNannySetupContext(
"involute", 0);
10847 __Pyx_XDECREF(__pyx_r);
10848 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1121, __pyx_L1_error)
10849 __Pyx_GOTREF(__pyx_t_1);
10850 __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, 1121, __pyx_L1_error)
10851 __Pyx_GOTREF(__pyx_t_2);
10852 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10853 __pyx_r = __pyx_t_2;
10867 __Pyx_XDECREF(__pyx_t_1);
10868 __Pyx_XDECREF(__pyx_t_2);
10869 __Pyx_AddTraceback(
"PyClical.clifford.involute", __pyx_clineno, __pyx_lineno, __pyx_filename);
10872 __Pyx_XGIVEREF(__pyx_r);
10873 __Pyx_RefNannyFinishContext();
10886 static PyObject *__pyx_pw_8PyClical_8clifford_75reverse(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10887 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 ";
10888 static PyObject *__pyx_pw_8PyClical_8clifford_75reverse(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10889 PyObject *__pyx_r = 0;
10890 __Pyx_RefNannyDeclarations
10891 __Pyx_RefNannySetupContext(
"reverse (wrapper)", 0);
10892 __pyx_r = __pyx_pf_8PyClical_8clifford_74reverse(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10895 __Pyx_RefNannyFinishContext();
10899 static PyObject *__pyx_pf_8PyClical_8clifford_74reverse(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10900 PyObject *__pyx_r = NULL;
10901 __Pyx_RefNannyDeclarations
10902 PyObject *__pyx_t_1 = NULL;
10903 PyObject *__pyx_t_2 = NULL;
10904 int __pyx_lineno = 0;
10905 const char *__pyx_filename = NULL;
10906 int __pyx_clineno = 0;
10907 __Pyx_RefNannySetupContext(
"reverse", 0);
10916 __Pyx_XDECREF(__pyx_r);
10917 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1136, __pyx_L1_error)
10918 __Pyx_GOTREF(__pyx_t_1);
10919 __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, 1136, __pyx_L1_error)
10920 __Pyx_GOTREF(__pyx_t_2);
10921 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10922 __pyx_r = __pyx_t_2;
10936 __Pyx_XDECREF(__pyx_t_1);
10937 __Pyx_XDECREF(__pyx_t_2);
10938 __Pyx_AddTraceback(
"PyClical.clifford.reverse", __pyx_clineno, __pyx_lineno, __pyx_filename);
10941 __Pyx_XGIVEREF(__pyx_r);
10942 __Pyx_RefNannyFinishContext();
10955 static PyObject *__pyx_pw_8PyClical_8clifford_77conj(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10956 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 ";
10957 static PyObject *__pyx_pw_8PyClical_8clifford_77conj(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10958 PyObject *__pyx_r = 0;
10959 __Pyx_RefNannyDeclarations
10960 __Pyx_RefNannySetupContext(
"conj (wrapper)", 0);
10961 __pyx_r = __pyx_pf_8PyClical_8clifford_76conj(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10964 __Pyx_RefNannyFinishContext();
10968 static PyObject *__pyx_pf_8PyClical_8clifford_76conj(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10969 PyObject *__pyx_r = NULL;
10970 __Pyx_RefNannyDeclarations
10971 PyObject *__pyx_t_1 = NULL;
10972 PyObject *__pyx_t_2 = NULL;
10973 int __pyx_lineno = 0;
10974 const char *__pyx_filename = NULL;
10975 int __pyx_clineno = 0;
10976 __Pyx_RefNannySetupContext(
"conj", 0);
10985 __Pyx_XDECREF(__pyx_r);
10986 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1151, __pyx_L1_error)
10987 __Pyx_GOTREF(__pyx_t_1);
10988 __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, 1151, __pyx_L1_error)
10989 __Pyx_GOTREF(__pyx_t_2);
10990 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10991 __pyx_r = __pyx_t_2;
11005 __Pyx_XDECREF(__pyx_t_1);
11006 __Pyx_XDECREF(__pyx_t_2);
11007 __Pyx_AddTraceback(
"PyClical.clifford.conj", __pyx_clineno, __pyx_lineno, __pyx_filename);
11010 __Pyx_XGIVEREF(__pyx_r);
11011 __Pyx_RefNannyFinishContext();
11024 static PyObject *__pyx_pw_8PyClical_8clifford_79quad(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
11025 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 ";
11026 static PyObject *__pyx_pw_8PyClical_8clifford_79quad(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11027 PyObject *__pyx_r = 0;
11028 __Pyx_RefNannyDeclarations
11029 __Pyx_RefNannySetupContext(
"quad (wrapper)", 0);
11030 __pyx_r = __pyx_pf_8PyClical_8clifford_78quad(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
11033 __Pyx_RefNannyFinishContext();
11037 static PyObject *__pyx_pf_8PyClical_8clifford_78quad(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
11038 PyObject *__pyx_r = NULL;
11039 __Pyx_RefNannyDeclarations
11040 PyObject *__pyx_t_1 = NULL;
11041 int __pyx_lineno = 0;
11042 const char *__pyx_filename = NULL;
11043 int __pyx_clineno = 0;
11044 __Pyx_RefNannySetupContext(
"quad", 0);
11053 __Pyx_XDECREF(__pyx_r);
11054 __pyx_t_1 =
PyFloat_FromDouble(__pyx_v_self->instance->quad());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1162, __pyx_L1_error)
11055 __Pyx_GOTREF(__pyx_t_1);
11056 __pyx_r = __pyx_t_1;
11070 __Pyx_XDECREF(__pyx_t_1);
11071 __Pyx_AddTraceback(
"PyClical.clifford.quad", __pyx_clineno, __pyx_lineno, __pyx_filename);
11074 __Pyx_XGIVEREF(__pyx_r);
11075 __Pyx_RefNannyFinishContext();
11088 static PyObject *__pyx_pw_8PyClical_8clifford_81norm(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
11089 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 ";
11090 static PyObject *__pyx_pw_8PyClical_8clifford_81norm(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11091 PyObject *__pyx_r = 0;
11092 __Pyx_RefNannyDeclarations
11093 __Pyx_RefNannySetupContext(
"norm (wrapper)", 0);
11094 __pyx_r = __pyx_pf_8PyClical_8clifford_80norm(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
11097 __Pyx_RefNannyFinishContext();
11101 static PyObject *__pyx_pf_8PyClical_8clifford_80norm(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
11102 PyObject *__pyx_r = NULL;
11103 __Pyx_RefNannyDeclarations
11104 PyObject *__pyx_t_1 = NULL;
11105 int __pyx_lineno = 0;
11106 const char *__pyx_filename = NULL;
11107 int __pyx_clineno = 0;
11108 __Pyx_RefNannySetupContext(
"norm", 0);
11117 __Pyx_XDECREF(__pyx_r);
11118 __pyx_t_1 =
PyFloat_FromDouble(__pyx_v_self->instance->norm());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1173, __pyx_L1_error)
11119 __Pyx_GOTREF(__pyx_t_1);
11120 __pyx_r = __pyx_t_1;
11134 __Pyx_XDECREF(__pyx_t_1);
11135 __Pyx_AddTraceback(
"PyClical.clifford.norm", __pyx_clineno, __pyx_lineno, __pyx_filename);
11138 __Pyx_XGIVEREF(__pyx_r);
11139 __Pyx_RefNannyFinishContext();
11152 static PyObject *__pyx_pw_8PyClical_8clifford_83abs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
11153 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 ";
11154 static PyObject *__pyx_pw_8PyClical_8clifford_83abs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11155 PyObject *__pyx_r = 0;
11156 __Pyx_RefNannyDeclarations
11157 __Pyx_RefNannySetupContext(
"abs (wrapper)", 0);
11158 __pyx_r = __pyx_pf_8PyClical_8clifford_82abs(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
11161 __Pyx_RefNannyFinishContext();
11165 static PyObject *__pyx_pf_8PyClical_8clifford_82abs(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
11166 PyObject *__pyx_r = NULL;
11167 __Pyx_RefNannyDeclarations
11168 PyObject *__pyx_t_1 = NULL;
11169 int __pyx_lineno = 0;
11170 const char *__pyx_filename = NULL;
11171 int __pyx_clineno = 0;
11172 __Pyx_RefNannySetupContext(
"abs", 0);
11181 __Pyx_XDECREF(__pyx_r);
11182 __pyx_t_1 =
PyFloat_FromDouble(
abs(__pyx_f_8PyClical_8clifford_unwrap(__pyx_v_self)));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1182, __pyx_L1_error)
11183 __Pyx_GOTREF(__pyx_t_1);
11184 __pyx_r = __pyx_t_1;
11198 __Pyx_XDECREF(__pyx_t_1);
11199 __Pyx_AddTraceback(
"PyClical.clifford.abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
11202 __Pyx_XGIVEREF(__pyx_r);
11203 __Pyx_RefNannyFinishContext();
11216 static PyObject *__pyx_pw_8PyClical_8clifford_85max_abs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
11217 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 ";
11218 static PyObject *__pyx_pw_8PyClical_8clifford_85max_abs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11219 PyObject *__pyx_r = 0;
11220 __Pyx_RefNannyDeclarations
11221 __Pyx_RefNannySetupContext(
"max_abs (wrapper)", 0);
11222 __pyx_r = __pyx_pf_8PyClical_8clifford_84max_abs(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
11225 __Pyx_RefNannyFinishContext();
11229 static PyObject *__pyx_pf_8PyClical_8clifford_84max_abs(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
11230 PyObject *__pyx_r = NULL;
11231 __Pyx_RefNannyDeclarations
11232 PyObject *__pyx_t_1 = NULL;
11233 int __pyx_lineno = 0;
11234 const char *__pyx_filename = NULL;
11235 int __pyx_clineno = 0;
11236 __Pyx_RefNannySetupContext(
"max_abs", 0);
11245 __Pyx_XDECREF(__pyx_r);
11246 __pyx_t_1 =
PyFloat_FromDouble(__pyx_v_self->instance->max_abs());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1193, __pyx_L1_error)
11247 __Pyx_GOTREF(__pyx_t_1);
11248 __pyx_r = __pyx_t_1;
11262 __Pyx_XDECREF(__pyx_t_1);
11263 __Pyx_AddTraceback(
"PyClical.clifford.max_abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
11266 __Pyx_XGIVEREF(__pyx_r);
11267 __Pyx_RefNannyFinishContext();
11280 static PyObject *__pyx_pw_8PyClical_8clifford_87truncated(PyObject *__pyx_v_self, PyObject *__pyx_v_limit);
11281 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 ";
11282 static PyObject *__pyx_pw_8PyClical_8clifford_87truncated(PyObject *__pyx_v_self, PyObject *__pyx_v_limit) {
11283 PyObject *__pyx_r = 0;
11284 __Pyx_RefNannyDeclarations
11285 __Pyx_RefNannySetupContext(
"truncated (wrapper)", 0);
11286 __pyx_r = __pyx_pf_8PyClical_8clifford_86truncated(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_limit));
11289 __Pyx_RefNannyFinishContext();
11293 static PyObject *__pyx_pf_8PyClical_8clifford_86truncated(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_limit) {
11294 PyObject *__pyx_r = NULL;
11295 __Pyx_RefNannyDeclarations
11296 PyObject *__pyx_t_1 = NULL;
11298 PyObject *__pyx_t_3 = NULL;
11299 int __pyx_lineno = 0;
11300 const char *__pyx_filename = NULL;
11301 int __pyx_clineno = 0;
11302 __Pyx_RefNannySetupContext(
"truncated", 0);
11311 __Pyx_XDECREF(__pyx_r);
11312 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1204, __pyx_L1_error)
11313 __Pyx_GOTREF(__pyx_t_1);
11314 __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_limit);
if (unlikely((__pyx_t_2 == ((
scalar_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1204, __pyx_L1_error)
11315 __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, 1204, __pyx_L1_error)
11316 __Pyx_GOTREF(__pyx_t_3);
11317 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11318 __pyx_r = __pyx_t_3;
11332 __Pyx_XDECREF(__pyx_t_1);
11333 __Pyx_XDECREF(__pyx_t_3);
11334 __Pyx_AddTraceback(
"PyClical.clifford.truncated", __pyx_clineno, __pyx_lineno, __pyx_filename);
11337 __Pyx_XGIVEREF(__pyx_r);
11338 __Pyx_RefNannyFinishContext();
11351 static PyObject *__pyx_pw_8PyClical_8clifford_89isinf(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
11352 static char __pyx_doc_8PyClical_8clifford_88isinf[] =
"\n Check if a multivector contains any infinite values.\n\n >>> clifford().isinf()\n False\n ";
11353 static PyObject *__pyx_pw_8PyClical_8clifford_89isinf(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11354 PyObject *__pyx_r = 0;
11355 __Pyx_RefNannyDeclarations
11356 __Pyx_RefNannySetupContext(
"isinf (wrapper)", 0);
11357 __pyx_r = __pyx_pf_8PyClical_8clifford_88isinf(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
11360 __Pyx_RefNannyFinishContext();
11364 static PyObject *__pyx_pf_8PyClical_8clifford_88isinf(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
11365 PyObject *__pyx_r = NULL;
11366 __Pyx_RefNannyDeclarations
11367 PyObject *__pyx_t_1 = NULL;
11368 int __pyx_lineno = 0;
11369 const char *__pyx_filename = NULL;
11370 int __pyx_clineno = 0;
11371 __Pyx_RefNannySetupContext(
"isinf", 0);
11380 __Pyx_XDECREF(__pyx_r);
11381 __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->instance->isnan());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1213, __pyx_L1_error)
11382 __Pyx_GOTREF(__pyx_t_1);
11383 __pyx_r = __pyx_t_1;
11397 __Pyx_XDECREF(__pyx_t_1);
11398 __Pyx_AddTraceback(
"PyClical.clifford.isinf", __pyx_clineno, __pyx_lineno, __pyx_filename);
11401 __Pyx_XGIVEREF(__pyx_r);
11402 __Pyx_RefNannyFinishContext();
11415 static PyObject *__pyx_pw_8PyClical_8clifford_91isnan(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
11416 static char __pyx_doc_8PyClical_8clifford_90isnan[] =
"\n Check if a multivector contains any IEEE NaN values.\n\n >>> clifford().isnan()\n False\n ";
11417 static PyObject *__pyx_pw_8PyClical_8clifford_91isnan(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11418 PyObject *__pyx_r = 0;
11419 __Pyx_RefNannyDeclarations
11420 __Pyx_RefNannySetupContext(
"isnan (wrapper)", 0);
11421 __pyx_r = __pyx_pf_8PyClical_8clifford_90isnan(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
11424 __Pyx_RefNannyFinishContext();
11428 static PyObject *__pyx_pf_8PyClical_8clifford_90isnan(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
11429 PyObject *__pyx_r = NULL;
11430 __Pyx_RefNannyDeclarations
11431 PyObject *__pyx_t_1 = NULL;
11432 int __pyx_lineno = 0;
11433 const char *__pyx_filename = NULL;
11434 int __pyx_clineno = 0;
11435 __Pyx_RefNannySetupContext(
"isnan", 0);
11444 __Pyx_XDECREF(__pyx_r);
11445 __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->instance->isnan());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1222, __pyx_L1_error)
11446 __Pyx_GOTREF(__pyx_t_1);
11447 __pyx_r = __pyx_t_1;
11461 __Pyx_XDECREF(__pyx_t_1);
11462 __Pyx_AddTraceback(
"PyClical.clifford.isnan", __pyx_clineno, __pyx_lineno, __pyx_filename);
11465 __Pyx_XGIVEREF(__pyx_r);
11466 __Pyx_RefNannyFinishContext();
11479 static PyObject *__pyx_pw_8PyClical_8clifford_93frame(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
11480 static char __pyx_doc_8PyClical_8clifford_92frame[] =
"\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 <class 'PyClical.index_set'>\n ";
11481 static PyObject *__pyx_pw_8PyClical_8clifford_93frame(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11482 PyObject *__pyx_r = 0;
11483 __Pyx_RefNannyDeclarations
11484 __Pyx_RefNannySetupContext(
"frame (wrapper)", 0);
11485 __pyx_r = __pyx_pf_8PyClical_8clifford_92frame(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
11488 __Pyx_RefNannyFinishContext();
11492 static PyObject *__pyx_pf_8PyClical_8clifford_92frame(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
11493 PyObject *__pyx_r = NULL;
11494 __Pyx_RefNannyDeclarations
11495 PyObject *__pyx_t_1 = NULL;
11496 PyObject *__pyx_t_2 = NULL;
11497 int __pyx_lineno = 0;
11498 const char *__pyx_filename = NULL;
11499 int __pyx_clineno = 0;
11500 __Pyx_RefNannySetupContext(
"frame", 0);
11509 __Pyx_XDECREF(__pyx_r);
11510 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_index_set));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1233, __pyx_L1_error)
11511 __Pyx_GOTREF(__pyx_t_1);
11512 __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, 1233, __pyx_L1_error)
11513 __Pyx_GOTREF(__pyx_t_2);
11514 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11515 __pyx_r = __pyx_t_2;
11529 __Pyx_XDECREF(__pyx_t_1);
11530 __Pyx_XDECREF(__pyx_t_2);
11531 __Pyx_AddTraceback(
"PyClical.clifford.frame", __pyx_clineno, __pyx_lineno, __pyx_filename);
11534 __Pyx_XGIVEREF(__pyx_r);
11535 __Pyx_RefNannyFinishContext();
11548 static PyObject *__pyx_pw_8PyClical_8clifford_95__repr__(PyObject *__pyx_v_self);
11549 static char __pyx_doc_8PyClical_8clifford_94__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 ";
11550 #if CYTHON_COMPILING_IN_CPYTHON 11551 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_94__repr__;
11553 static PyObject *__pyx_pw_8PyClical_8clifford_95__repr__(PyObject *__pyx_v_self) {
11554 PyObject *__pyx_r = 0;
11555 __Pyx_RefNannyDeclarations
11556 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
11557 __pyx_r = __pyx_pf_8PyClical_8clifford_94__repr__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
11560 __Pyx_RefNannyFinishContext();
11564 static PyObject *__pyx_pf_8PyClical_8clifford_94__repr__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
11565 PyObject *__pyx_r = NULL;
11566 __Pyx_RefNannyDeclarations
11567 PyObject *__pyx_t_1 = NULL;
11568 int __pyx_lineno = 0;
11569 const char *__pyx_filename = NULL;
11570 int __pyx_clineno = 0;
11571 __Pyx_RefNannySetupContext(
"__repr__", 0);
11580 __Pyx_XDECREF(__pyx_r);
11581 __pyx_t_1 = __Pyx_decode_cpp_string(
clifford_to_repr(__pyx_f_8PyClical_8clifford_unwrap(__pyx_v_self)), 0, PY_SSIZE_T_MAX, NULL, NULL, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1242, __pyx_L1_error)
11582 __Pyx_GOTREF(__pyx_t_1);
11583 __pyx_r = __pyx_t_1;
11597 __Pyx_XDECREF(__pyx_t_1);
11598 __Pyx_AddTraceback(
"PyClical.clifford.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11601 __Pyx_XGIVEREF(__pyx_r);
11602 __Pyx_RefNannyFinishContext();
11615 static PyObject *__pyx_pw_8PyClical_8clifford_97__str__(PyObject *__pyx_v_self);
11616 static char __pyx_doc_8PyClical_8clifford_96__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 ";
11617 #if CYTHON_COMPILING_IN_CPYTHON 11618 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_96__str__;
11620 static PyObject *__pyx_pw_8PyClical_8clifford_97__str__(PyObject *__pyx_v_self) {
11621 PyObject *__pyx_r = 0;
11622 __Pyx_RefNannyDeclarations
11623 __Pyx_RefNannySetupContext(
"__str__ (wrapper)", 0);
11624 __pyx_r = __pyx_pf_8PyClical_8clifford_96__str__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
11627 __Pyx_RefNannyFinishContext();
11631 static PyObject *__pyx_pf_8PyClical_8clifford_96__str__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
11632 PyObject *__pyx_r = NULL;
11633 __Pyx_RefNannyDeclarations
11634 PyObject *__pyx_t_1 = NULL;
11635 int __pyx_lineno = 0;
11636 const char *__pyx_filename = NULL;
11637 int __pyx_clineno = 0;
11638 __Pyx_RefNannySetupContext(
"__str__", 0);
11647 __Pyx_XDECREF(__pyx_r);
11648 __pyx_t_1 = __Pyx_decode_cpp_string(
clifford_to_str(__pyx_f_8PyClical_8clifford_unwrap(__pyx_v_self)), 0, PY_SSIZE_T_MAX, NULL, NULL, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1251, __pyx_L1_error)
11649 __Pyx_GOTREF(__pyx_t_1);
11650 __pyx_r = __pyx_t_1;
11664 __Pyx_XDECREF(__pyx_t_1);
11665 __Pyx_AddTraceback(
"PyClical.clifford.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11668 __Pyx_XGIVEREF(__pyx_r);
11669 __Pyx_RefNannyFinishContext();
11680 static PyObject *__pyx_pw_8PyClical_8clifford_99__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
11681 static PyObject *__pyx_pw_8PyClical_8clifford_99__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11682 PyObject *__pyx_r = 0;
11683 __Pyx_RefNannyDeclarations
11684 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
11685 __pyx_r = __pyx_pf_8PyClical_8clifford_98__reduce_cython__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
11688 __Pyx_RefNannyFinishContext();
11692 static PyObject *__pyx_pf_8PyClical_8clifford_98__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
11693 PyObject *__pyx_r = NULL;
11694 __Pyx_RefNannyDeclarations
11695 PyObject *__pyx_t_1 = NULL;
11696 int __pyx_lineno = 0;
11697 const char *__pyx_filename = NULL;
11698 int __pyx_clineno = 0;
11699 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
11707 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
11708 __Pyx_GOTREF(__pyx_t_1);
11709 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
11710 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11711 __PYX_ERR(1, 2, __pyx_L1_error)
11721 __Pyx_XDECREF(__pyx_t_1);
11722 __Pyx_AddTraceback(
"PyClical.clifford.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11724 __Pyx_XGIVEREF(__pyx_r);
11725 __Pyx_RefNannyFinishContext();
11737 static PyObject *__pyx_pw_8PyClical_8clifford_101__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
11738 static PyObject *__pyx_pw_8PyClical_8clifford_101__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
11739 PyObject *__pyx_r = 0;
11740 __Pyx_RefNannyDeclarations
11741 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
11742 __pyx_r = __pyx_pf_8PyClical_8clifford_100__setstate_cython__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
11745 __Pyx_RefNannyFinishContext();
11749 static PyObject *__pyx_pf_8PyClical_8clifford_100__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
11750 PyObject *__pyx_r = NULL;
11751 __Pyx_RefNannyDeclarations
11752 PyObject *__pyx_t_1 = NULL;
11753 int __pyx_lineno = 0;
11754 const char *__pyx_filename = NULL;
11755 int __pyx_clineno = 0;
11756 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
11763 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__12, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
11764 __Pyx_GOTREF(__pyx_t_1);
11765 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
11766 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11767 __PYX_ERR(1, 4, __pyx_L1_error)
11778 __Pyx_XDECREF(__pyx_t_1);
11779 __Pyx_AddTraceback(
"PyClical.clifford.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11781 __Pyx_XGIVEREF(__pyx_r);
11782 __Pyx_RefNannyFinishContext();
11795 static PyObject *__pyx_pw_8PyClical_9clifford_hidden_doctests(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused);
11796 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(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 <class 'list'>.\n >>> print(clifford(None))\n Traceback (most recent call last):\n ...\n TypeError: Cannot initialize clifford object from <class 'NoneType'>.\n >>> print(clifford(None,[1,2]))\n Traceback (most recent call last):\n ...\n TypeError: Cannot initialize clifford object from (<class 'NoneType'>, <class 'list'>).\n >>> print(clifford([1,2],[1,2]))\n Traceback (most recent call last):\n ...\n TypeError: Cannot initialize clifford object from (<class 'list'>, <class '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 fro""m 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 ";
11797 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};
11798 static PyObject *__pyx_pw_8PyClical_9clifford_hidden_doctests(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
11799 PyObject *__pyx_r = 0;
11800 __Pyx_RefNannyDeclarations
11801 __Pyx_RefNannySetupContext(
"clifford_hidden_doctests (wrapper)", 0);
11802 __pyx_r = __pyx_pf_8PyClical_8clifford_hidden_doctests(__pyx_self);
11805 __Pyx_RefNannyFinishContext();
11809 static PyObject *__pyx_pf_8PyClical_8clifford_hidden_doctests(CYTHON_UNUSED PyObject *__pyx_self) {
11810 PyObject *__pyx_r = NULL;
11811 __Pyx_RefNannyDeclarations
11812 __Pyx_RefNannySetupContext(
"clifford_hidden_doctests", 0);
11821 __Pyx_XDECREF(__pyx_r);
11822 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11835 __Pyx_XGIVEREF(__pyx_r);
11836 __Pyx_RefNannyFinishContext();
11848 static PyObject *__pyx_pw_8PyClical_11error_squared_tol(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11849 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_error_squared_tol(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11850 PyObject *__pyx_r = NULL;
11851 __Pyx_RefNannyDeclarations
11852 PyObject *__pyx_t_1 = NULL;
11853 int __pyx_lineno = 0;
11854 const char *__pyx_filename = NULL;
11855 int __pyx_clineno = 0;
11856 __Pyx_RefNannySetupContext(
"error_squared_tol", 0);
11865 __Pyx_XDECREF(__pyx_r);
11867 __Pyx_GOTREF(__pyx_t_1);
11868 __pyx_r = __pyx_t_1;
11882 __Pyx_XDECREF(__pyx_t_1);
11883 __Pyx_AddTraceback(
"PyClical.error_squared_tol", __pyx_clineno, __pyx_lineno, __pyx_filename);
11886 __Pyx_XGIVEREF(__pyx_r);
11887 __Pyx_RefNannyFinishContext();
11892 static PyObject *__pyx_pw_8PyClical_11error_squared_tol(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11893 static char __pyx_doc_8PyClical_10error_squared_tol[] =
"\n Quadratic norm error tolerance relative to a specific multivector.\n\n >>> print(error_squared_tol(clifford(\"{1}\")) * 3.0 - error_squared_tol(clifford(\"1{1}-2{2}+3{3}\")))\n 0.0\n ";
11894 static PyObject *__pyx_pw_8PyClical_11error_squared_tol(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11895 PyObject *__pyx_r = 0;
11896 __Pyx_RefNannyDeclarations
11897 __Pyx_RefNannySetupContext(
"error_squared_tol (wrapper)", 0);
11898 __pyx_r = __pyx_pf_8PyClical_10error_squared_tol(__pyx_self, ((PyObject *)__pyx_v_obj));
11901 __Pyx_RefNannyFinishContext();
11905 static PyObject *__pyx_pf_8PyClical_10error_squared_tol(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11906 PyObject *__pyx_r = NULL;
11907 __Pyx_RefNannyDeclarations
11908 PyObject *__pyx_t_1 = NULL;
11909 int __pyx_lineno = 0;
11910 const char *__pyx_filename = NULL;
11911 int __pyx_clineno = 0;
11912 __Pyx_RefNannySetupContext(
"error_squared_tol", 0);
11913 __Pyx_XDECREF(__pyx_r);
11914 __pyx_t_1 = __pyx_f_8PyClical_error_squared_tol(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1337, __pyx_L1_error)
11915 __Pyx_GOTREF(__pyx_t_1);
11916 __pyx_r = __pyx_t_1;
11922 __Pyx_XDECREF(__pyx_t_1);
11923 __Pyx_AddTraceback(
"PyClical.error_squared_tol", __pyx_clineno, __pyx_lineno, __pyx_filename);
11926 __Pyx_XGIVEREF(__pyx_r);
11927 __Pyx_RefNannyFinishContext();
11939 static PyObject *__pyx_pw_8PyClical_13error_squared(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
11940 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_error_squared(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs, PyObject *__pyx_v_threshold, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11941 PyObject *__pyx_r = NULL;
11942 __Pyx_RefNannyDeclarations
11944 PyObject *__pyx_t_2 = NULL;
11945 int __pyx_lineno = 0;
11946 const char *__pyx_filename = NULL;
11947 int __pyx_clineno = 0;
11948 __Pyx_RefNannySetupContext(
"error_squared", 0);
11957 __Pyx_XDECREF(__pyx_r);
11958 __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_threshold);
if (unlikely((__pyx_t_1 == ((
scalar_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1357, __pyx_L1_error)
11959 __pyx_t_2 =
PyFloat_FromDouble(
error_squared(__pyx_f_8PyClical_toClifford(__pyx_v_lhs), __pyx_f_8PyClical_toClifford(__pyx_v_rhs), ((
scalar_t)__pyx_t_1)));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1357, __pyx_L1_error)
11960 __Pyx_GOTREF(__pyx_t_2);
11961 __pyx_r = __pyx_t_2;
11975 __Pyx_XDECREF(__pyx_t_2);
11976 __Pyx_AddTraceback(
"PyClical.error_squared", __pyx_clineno, __pyx_lineno, __pyx_filename);
11979 __Pyx_XGIVEREF(__pyx_r);
11980 __Pyx_RefNannyFinishContext();
11985 static PyObject *__pyx_pw_8PyClical_13error_squared(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
11986 static char __pyx_doc_8PyClical_12error_squared[] =
"\n Relative or absolute error using the quadratic norm.\n\n >>> err2=scalar_epsilon*scalar_epsilon\n\n >>> print(error_squared(clifford(\"{1}\"), clifford(\"1{1}\"), err2))\n 0.0\n >>> print(error_squared(clifford(\"1{1}-3{2}+4{3}\"), clifford(\"{1}\"), err2))\n 25.0\n ";
11987 static PyObject *__pyx_pw_8PyClical_13error_squared(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11988 PyObject *__pyx_v_lhs = 0;
11989 PyObject *__pyx_v_rhs = 0;
11990 PyObject *__pyx_v_threshold = 0;
11991 int __pyx_lineno = 0;
11992 const char *__pyx_filename = NULL;
11993 int __pyx_clineno = 0;
11994 PyObject *__pyx_r = 0;
11995 __Pyx_RefNannyDeclarations
11996 __Pyx_RefNannySetupContext(
"error_squared (wrapper)", 0);
11998 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lhs,&__pyx_n_s_rhs,&__pyx_n_s_threshold,0};
11999 PyObject* values[3] = {0,0,0};
12000 if (unlikely(__pyx_kwds)) {
12001 Py_ssize_t kw_args;
12002 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
12003 switch (pos_args) {
12004 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
12005 CYTHON_FALLTHROUGH;
12006 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12007 CYTHON_FALLTHROUGH;
12008 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12009 CYTHON_FALLTHROUGH;
12011 default:
goto __pyx_L5_argtuple_error;
12013 kw_args = PyDict_Size(__pyx_kwds);
12014 switch (pos_args) {
12016 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lhs)) != 0)) kw_args--;
12017 else goto __pyx_L5_argtuple_error;
12018 CYTHON_FALLTHROUGH;
12020 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rhs)) != 0)) kw_args--;
12022 __Pyx_RaiseArgtupleInvalid(
"error_squared", 1, 3, 3, 1); __PYX_ERR(0, 1346, __pyx_L3_error)
12024 CYTHON_FALLTHROUGH;
12026 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_threshold)) != 0)) kw_args--;
12028 __Pyx_RaiseArgtupleInvalid(
"error_squared", 1, 3, 3, 2); __PYX_ERR(0, 1346, __pyx_L3_error)
12031 if (unlikely(kw_args > 0)) {
12032 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"error_squared") < 0)) __PYX_ERR(0, 1346, __pyx_L3_error)
12034 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
12035 goto __pyx_L5_argtuple_error;
12037 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12038 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12039 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
12041 __pyx_v_lhs = values[0];
12042 __pyx_v_rhs = values[1];
12043 __pyx_v_threshold = values[2];
12045 goto __pyx_L4_argument_unpacking_done;
12046 __pyx_L5_argtuple_error:;
12047 __Pyx_RaiseArgtupleInvalid(
"error_squared", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1346, __pyx_L3_error)
12049 __Pyx_AddTraceback(
"PyClical.error_squared", __pyx_clineno, __pyx_lineno, __pyx_filename);
12050 __Pyx_RefNannyFinishContext();
12052 __pyx_L4_argument_unpacking_done:;
12053 __pyx_r = __pyx_pf_8PyClical_12error_squared(__pyx_self, __pyx_v_lhs, __pyx_v_rhs, __pyx_v_threshold);
12056 __Pyx_RefNannyFinishContext();
12060 static PyObject *__pyx_pf_8PyClical_12error_squared(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs, PyObject *__pyx_v_threshold) {
12061 PyObject *__pyx_r = NULL;
12062 __Pyx_RefNannyDeclarations
12063 PyObject *__pyx_t_1 = NULL;
12064 int __pyx_lineno = 0;
12065 const char *__pyx_filename = NULL;
12066 int __pyx_clineno = 0;
12067 __Pyx_RefNannySetupContext(
"error_squared", 0);
12068 __Pyx_XDECREF(__pyx_r);
12069 __pyx_t_1 = __pyx_f_8PyClical_error_squared(__pyx_v_lhs, __pyx_v_rhs, __pyx_v_threshold, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1346, __pyx_L1_error)
12070 __Pyx_GOTREF(__pyx_t_1);
12071 __pyx_r = __pyx_t_1;
12077 __Pyx_XDECREF(__pyx_t_1);
12078 __Pyx_AddTraceback(
"PyClical.error_squared", __pyx_clineno, __pyx_lineno, __pyx_filename);
12081 __Pyx_XGIVEREF(__pyx_r);
12082 __Pyx_RefNannyFinishContext();
12094 static PyObject *__pyx_pw_8PyClical_15approx_equal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
12095 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_approx_equal(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs, CYTHON_UNUSED
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_approx_equal *__pyx_optional_args) {
12096 PyObject *__pyx_v_threshold = ((PyObject *)Py_None);
12097 PyObject *__pyx_v_tol = ((PyObject *)Py_None);
12098 PyObject *__pyx_r = NULL;
12099 __Pyx_RefNannyDeclarations
12100 PyObject *__pyx_t_1 = NULL;
12102 PyObject *__pyx_t_3 = NULL;
12105 int __pyx_lineno = 0;
12106 const char *__pyx_filename = NULL;
12107 int __pyx_clineno = 0;
12108 __Pyx_RefNannySetupContext(
"approx_equal", 0);
12109 if (__pyx_optional_args) {
12110 if (__pyx_optional_args->__pyx_n > 0) {
12111 __pyx_v_threshold = __pyx_optional_args->threshold;
12112 if (__pyx_optional_args->__pyx_n > 1) {
12113 __pyx_v_tol = __pyx_optional_args->tol;
12117 __Pyx_INCREF(__pyx_v_threshold);
12118 __Pyx_INCREF(__pyx_v_tol);
12127 __pyx_t_2 = (__pyx_v_threshold == Py_None);
12128 if ((__pyx_t_2 != 0)) {
12129 __pyx_t_3 = __pyx_f_8PyClical_error_squared_tol(__pyx_v_rhs, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1374, __pyx_L1_error)
12130 __Pyx_GOTREF(__pyx_t_3);
12131 __pyx_t_1 = __pyx_t_3;
12134 __Pyx_INCREF(__pyx_v_threshold);
12135 __pyx_t_1 = __pyx_v_threshold;
12137 __Pyx_DECREF_SET(__pyx_v_threshold, __pyx_t_1);
12147 __pyx_t_2 = (__pyx_v_tol == Py_None);
12148 if ((__pyx_t_2 != 0)) {
12149 __pyx_t_3 = __pyx_f_8PyClical_error_squared_tol(__pyx_v_rhs, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1375, __pyx_L1_error)
12150 __Pyx_GOTREF(__pyx_t_3);
12151 __pyx_t_1 = __pyx_t_3;
12154 __Pyx_INCREF(__pyx_v_tol);
12155 __pyx_t_1 = __pyx_v_tol;
12157 __Pyx_DECREF_SET(__pyx_v_tol, __pyx_t_1);
12167 __Pyx_XDECREF(__pyx_r);
12168 __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_threshold);
if (unlikely((__pyx_t_4 == ((
scalar_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1376, __pyx_L1_error)
12169 __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_tol);
if (unlikely((__pyx_t_5 == ((
scalar_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1376, __pyx_L1_error)
12170 __pyx_t_1 = __Pyx_PyBool_FromLong(
approx_equal(__pyx_f_8PyClical_toClifford(__pyx_v_lhs), __pyx_f_8PyClical_toClifford(__pyx_v_rhs), ((
scalar_t)__pyx_t_4), ((
scalar_t)__pyx_t_5)));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1376, __pyx_L1_error)
12171 __Pyx_GOTREF(__pyx_t_1);
12172 __pyx_r = __pyx_t_1;
12186 __Pyx_XDECREF(__pyx_t_1);
12187 __Pyx_XDECREF(__pyx_t_3);
12188 __Pyx_AddTraceback(
"PyClical.approx_equal", __pyx_clineno, __pyx_lineno, __pyx_filename);
12191 __Pyx_XDECREF(__pyx_v_threshold);
12192 __Pyx_XDECREF(__pyx_v_tol);
12193 __Pyx_XGIVEREF(__pyx_r);
12194 __Pyx_RefNannyFinishContext();
12199 static PyObject *__pyx_pw_8PyClical_15approx_equal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
12200 static char __pyx_doc_8PyClical_14approx_equal[] =
"\n Test for approximate equality of multivectors.\n\n >>> err2=scalar_epsilon*scalar_epsilon\n\n >>> print(approx_equal(clifford(\"{1}\"), clifford(\"1{1}\")))\n True\n >>> print(approx_equal(clifford(\"1{1}-3{2}+4{3}\"), clifford(\"{1}\")))\n False\n >>> print(approx_equal(clifford(\"1{1}-3{2}+4{3}+0.001\"), clifford(\"1{1}-3{2}+4{3}\"), err2, err2))\n False\n >>> print(approx_equal(clifford(\"1{1}-3{2}+4{3}+1.0e-30\"), clifford(\"1{1}-3{2}+4{3}\"), err2, err2))\n True\n ";
12201 static PyObject *__pyx_pw_8PyClical_15approx_equal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
12202 PyObject *__pyx_v_lhs = 0;
12203 PyObject *__pyx_v_rhs = 0;
12204 PyObject *__pyx_v_threshold = 0;
12205 PyObject *__pyx_v_tol = 0;
12206 int __pyx_lineno = 0;
12207 const char *__pyx_filename = NULL;
12208 int __pyx_clineno = 0;
12209 PyObject *__pyx_r = 0;
12210 __Pyx_RefNannyDeclarations
12211 __Pyx_RefNannySetupContext(
"approx_equal (wrapper)", 0);
12213 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lhs,&__pyx_n_s_rhs,&__pyx_n_s_threshold,&__pyx_n_s_tol,0};
12214 PyObject* values[4] = {0,0,0,0};
12215 values[2] = ((PyObject *)Py_None);
12216 values[3] = ((PyObject *)Py_None);
12217 if (unlikely(__pyx_kwds)) {
12218 Py_ssize_t kw_args;
12219 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
12220 switch (pos_args) {
12221 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
12222 CYTHON_FALLTHROUGH;
12223 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
12224 CYTHON_FALLTHROUGH;
12225 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12226 CYTHON_FALLTHROUGH;
12227 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12228 CYTHON_FALLTHROUGH;
12230 default:
goto __pyx_L5_argtuple_error;
12232 kw_args = PyDict_Size(__pyx_kwds);
12233 switch (pos_args) {
12235 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lhs)) != 0)) kw_args--;
12236 else goto __pyx_L5_argtuple_error;
12237 CYTHON_FALLTHROUGH;
12239 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rhs)) != 0)) kw_args--;
12241 __Pyx_RaiseArgtupleInvalid(
"approx_equal", 0, 2, 4, 1); __PYX_ERR(0, 1359, __pyx_L3_error)
12243 CYTHON_FALLTHROUGH;
12246 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_threshold);
12247 if (value) { values[2] = value; kw_args--; }
12249 CYTHON_FALLTHROUGH;
12252 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol);
12253 if (value) { values[3] = value; kw_args--; }
12256 if (unlikely(kw_args > 0)) {
12257 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"approx_equal") < 0)) __PYX_ERR(0, 1359, __pyx_L3_error)
12260 switch (PyTuple_GET_SIZE(__pyx_args)) {
12261 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
12262 CYTHON_FALLTHROUGH;
12263 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
12264 CYTHON_FALLTHROUGH;
12265 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12266 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12268 default:
goto __pyx_L5_argtuple_error;
12271 __pyx_v_lhs = values[0];
12272 __pyx_v_rhs = values[1];
12273 __pyx_v_threshold = values[2];
12274 __pyx_v_tol = values[3];
12276 goto __pyx_L4_argument_unpacking_done;
12277 __pyx_L5_argtuple_error:;
12278 __Pyx_RaiseArgtupleInvalid(
"approx_equal", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1359, __pyx_L3_error)
12280 __Pyx_AddTraceback(
"PyClical.approx_equal", __pyx_clineno, __pyx_lineno, __pyx_filename);
12281 __Pyx_RefNannyFinishContext();
12283 __pyx_L4_argument_unpacking_done:;
12284 __pyx_r = __pyx_pf_8PyClical_14approx_equal(__pyx_self, __pyx_v_lhs, __pyx_v_rhs, __pyx_v_threshold, __pyx_v_tol);
12287 __Pyx_RefNannyFinishContext();
12291 static PyObject *__pyx_pf_8PyClical_14approx_equal(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs, PyObject *__pyx_v_threshold, PyObject *__pyx_v_tol) {
12292 PyObject *__pyx_r = NULL;
12293 __Pyx_RefNannyDeclarations
12294 PyObject *__pyx_t_1 = NULL;
12295 struct __pyx_opt_args_8PyClical_approx_equal __pyx_t_2;
12296 int __pyx_lineno = 0;
12297 const char *__pyx_filename = NULL;
12298 int __pyx_clineno = 0;
12299 __Pyx_RefNannySetupContext(
"approx_equal", 0);
12300 __Pyx_XDECREF(__pyx_r);
12301 __pyx_t_2.__pyx_n = 2;
12302 __pyx_t_2.threshold = __pyx_v_threshold;
12303 __pyx_t_2.tol = __pyx_v_tol;
12304 __pyx_t_1 = __pyx_f_8PyClical_approx_equal(__pyx_v_lhs, __pyx_v_rhs, 0, &__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1359, __pyx_L1_error)
12305 __Pyx_GOTREF(__pyx_t_1);
12306 __pyx_r = __pyx_t_1;
12312 __Pyx_XDECREF(__pyx_t_1);
12313 __Pyx_AddTraceback(
"PyClical.approx_equal", __pyx_clineno, __pyx_lineno, __pyx_filename);
12316 __Pyx_XGIVEREF(__pyx_r);
12317 __Pyx_RefNannyFinishContext();
12329 static PyObject *__pyx_pw_8PyClical_17inv(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12330 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_inv(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12331 PyObject *__pyx_r = NULL;
12332 __Pyx_RefNannyDeclarations
12333 PyObject *__pyx_t_1 = NULL;
12334 PyObject *__pyx_t_2 = NULL;
12335 PyObject *__pyx_t_3 = NULL;
12336 int __pyx_lineno = 0;
12337 const char *__pyx_filename = NULL;
12338 int __pyx_clineno = 0;
12339 __Pyx_RefNannySetupContext(
"inv", 0);
12348 __Pyx_XDECREF(__pyx_r);
12349 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_v_obj);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1391, __pyx_L1_error)
12350 __Pyx_GOTREF(__pyx_t_2);
12351 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inv);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1391, __pyx_L1_error)
12352 __Pyx_GOTREF(__pyx_t_3);
12353 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12355 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
12356 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
12357 if (likely(__pyx_t_2)) {
12358 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
12359 __Pyx_INCREF(__pyx_t_2);
12360 __Pyx_INCREF(
function);
12361 __Pyx_DECREF_SET(__pyx_t_3,
function);
12364 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
12365 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12366 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1391, __pyx_L1_error)
12367 __Pyx_GOTREF(__pyx_t_1);
12368 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12369 __pyx_r = __pyx_t_1;
12383 __Pyx_XDECREF(__pyx_t_1);
12384 __Pyx_XDECREF(__pyx_t_2);
12385 __Pyx_XDECREF(__pyx_t_3);
12386 __Pyx_AddTraceback(
"PyClical.inv", __pyx_clineno, __pyx_lineno, __pyx_filename);
12389 __Pyx_XGIVEREF(__pyx_r);
12390 __Pyx_RefNannyFinishContext();
12395 static PyObject *__pyx_pw_8PyClical_17inv(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12396 static char __pyx_doc_8PyClical_16inv[] =
"\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 ";
12397 static PyObject *__pyx_pw_8PyClical_17inv(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12398 PyObject *__pyx_r = 0;
12399 __Pyx_RefNannyDeclarations
12400 __Pyx_RefNannySetupContext(
"inv (wrapper)", 0);
12401 __pyx_r = __pyx_pf_8PyClical_16inv(__pyx_self, ((PyObject *)__pyx_v_obj));
12404 __Pyx_RefNannyFinishContext();
12408 static PyObject *__pyx_pf_8PyClical_16inv(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12409 PyObject *__pyx_r = NULL;
12410 __Pyx_RefNannyDeclarations
12411 PyObject *__pyx_t_1 = NULL;
12412 int __pyx_lineno = 0;
12413 const char *__pyx_filename = NULL;
12414 int __pyx_clineno = 0;
12415 __Pyx_RefNannySetupContext(
"inv", 0);
12416 __Pyx_XDECREF(__pyx_r);
12417 __pyx_t_1 = __pyx_f_8PyClical_inv(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1378, __pyx_L1_error)
12418 __Pyx_GOTREF(__pyx_t_1);
12419 __pyx_r = __pyx_t_1;
12425 __Pyx_XDECREF(__pyx_t_1);
12426 __Pyx_AddTraceback(
"PyClical.inv", __pyx_clineno, __pyx_lineno, __pyx_filename);
12429 __Pyx_XGIVEREF(__pyx_r);
12430 __Pyx_RefNannyFinishContext();
12442 static PyObject *__pyx_pw_8PyClical_19scalar(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12443 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_scalar(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12444 PyObject *__pyx_r = NULL;
12445 __Pyx_RefNannyDeclarations
12446 PyObject *__pyx_t_1 = NULL;
12447 PyObject *__pyx_t_2 = NULL;
12448 PyObject *__pyx_t_3 = NULL;
12449 int __pyx_lineno = 0;
12450 const char *__pyx_filename = NULL;
12451 int __pyx_clineno = 0;
12452 __Pyx_RefNannySetupContext(
"scalar", 0);
12461 __Pyx_XDECREF(__pyx_r);
12462 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_v_obj);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1402, __pyx_L1_error)
12463 __Pyx_GOTREF(__pyx_t_2);
12464 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_scalar);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1402, __pyx_L1_error)
12465 __Pyx_GOTREF(__pyx_t_3);
12466 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12468 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
12469 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
12470 if (likely(__pyx_t_2)) {
12471 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
12472 __Pyx_INCREF(__pyx_t_2);
12473 __Pyx_INCREF(
function);
12474 __Pyx_DECREF_SET(__pyx_t_3,
function);
12477 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
12478 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12479 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1402, __pyx_L1_error)
12480 __Pyx_GOTREF(__pyx_t_1);
12481 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12482 __pyx_r = __pyx_t_1;
12496 __Pyx_XDECREF(__pyx_t_1);
12497 __Pyx_XDECREF(__pyx_t_2);
12498 __Pyx_XDECREF(__pyx_t_3);
12499 __Pyx_AddTraceback(
"PyClical.scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
12502 __Pyx_XGIVEREF(__pyx_r);
12503 __Pyx_RefNannyFinishContext();
12508 static PyObject *__pyx_pw_8PyClical_19scalar(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12509 static char __pyx_doc_8PyClical_18scalar[] =
"\n Scalar part.\n\n >>> scalar(clifford(\"1+{1}+{1,2}\"))\n 1.0\n >>> scalar(clifford(\"{1,2}\"))\n 0.0\n ";
12510 static PyObject *__pyx_pw_8PyClical_19scalar(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12511 PyObject *__pyx_r = 0;
12512 __Pyx_RefNannyDeclarations
12513 __Pyx_RefNannySetupContext(
"scalar (wrapper)", 0);
12514 __pyx_r = __pyx_pf_8PyClical_18scalar(__pyx_self, ((PyObject *)__pyx_v_obj));
12517 __Pyx_RefNannyFinishContext();
12521 static PyObject *__pyx_pf_8PyClical_18scalar(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12522 PyObject *__pyx_r = NULL;
12523 __Pyx_RefNannyDeclarations
12524 PyObject *__pyx_t_1 = NULL;
12525 int __pyx_lineno = 0;
12526 const char *__pyx_filename = NULL;
12527 int __pyx_clineno = 0;
12528 __Pyx_RefNannySetupContext(
"scalar", 0);
12529 __Pyx_XDECREF(__pyx_r);
12530 __pyx_t_1 = __pyx_f_8PyClical_scalar(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1393, __pyx_L1_error)
12531 __Pyx_GOTREF(__pyx_t_1);
12532 __pyx_r = __pyx_t_1;
12538 __Pyx_XDECREF(__pyx_t_1);
12539 __Pyx_AddTraceback(
"PyClical.scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
12542 __Pyx_XGIVEREF(__pyx_r);
12543 __Pyx_RefNannyFinishContext();
12555 static PyObject *__pyx_pw_8PyClical_21real(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12556 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_real(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12557 PyObject *__pyx_r = NULL;
12558 __Pyx_RefNannyDeclarations
12559 PyObject *__pyx_t_1 = NULL;
12560 PyObject *__pyx_t_2 = NULL;
12561 PyObject *__pyx_t_3 = NULL;
12562 int __pyx_lineno = 0;
12563 const char *__pyx_filename = NULL;
12564 int __pyx_clineno = 0;
12565 __Pyx_RefNannySetupContext(
"real", 0);
12574 __Pyx_XDECREF(__pyx_r);
12575 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_v_obj);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1413, __pyx_L1_error)
12576 __Pyx_GOTREF(__pyx_t_2);
12577 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_scalar);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1413, __pyx_L1_error)
12578 __Pyx_GOTREF(__pyx_t_3);
12579 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12581 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
12582 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
12583 if (likely(__pyx_t_2)) {
12584 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
12585 __Pyx_INCREF(__pyx_t_2);
12586 __Pyx_INCREF(
function);
12587 __Pyx_DECREF_SET(__pyx_t_3,
function);
12590 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
12591 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12592 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1413, __pyx_L1_error)
12593 __Pyx_GOTREF(__pyx_t_1);
12594 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12595 __pyx_r = __pyx_t_1;
12609 __Pyx_XDECREF(__pyx_t_1);
12610 __Pyx_XDECREF(__pyx_t_2);
12611 __Pyx_XDECREF(__pyx_t_3);
12612 __Pyx_AddTraceback(
"PyClical.real", __pyx_clineno, __pyx_lineno, __pyx_filename);
12615 __Pyx_XGIVEREF(__pyx_r);
12616 __Pyx_RefNannyFinishContext();
12621 static PyObject *__pyx_pw_8PyClical_21real(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12622 static char __pyx_doc_8PyClical_20real[] =
"\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 ";
12623 static PyObject *__pyx_pw_8PyClical_21real(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12624 PyObject *__pyx_r = 0;
12625 __Pyx_RefNannyDeclarations
12626 __Pyx_RefNannySetupContext(
"real (wrapper)", 0);
12627 __pyx_r = __pyx_pf_8PyClical_20real(__pyx_self, ((PyObject *)__pyx_v_obj));
12630 __Pyx_RefNannyFinishContext();
12634 static PyObject *__pyx_pf_8PyClical_20real(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12635 PyObject *__pyx_r = NULL;
12636 __Pyx_RefNannyDeclarations
12637 PyObject *__pyx_t_1 = NULL;
12638 int __pyx_lineno = 0;
12639 const char *__pyx_filename = NULL;
12640 int __pyx_clineno = 0;
12641 __Pyx_RefNannySetupContext(
"real", 0);
12642 __Pyx_XDECREF(__pyx_r);
12643 __pyx_t_1 = __pyx_f_8PyClical_real(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1404, __pyx_L1_error)
12644 __Pyx_GOTREF(__pyx_t_1);
12645 __pyx_r = __pyx_t_1;
12651 __Pyx_XDECREF(__pyx_t_1);
12652 __Pyx_AddTraceback(
"PyClical.real", __pyx_clineno, __pyx_lineno, __pyx_filename);
12655 __Pyx_XGIVEREF(__pyx_r);
12656 __Pyx_RefNannyFinishContext();
12668 static PyObject *__pyx_pw_8PyClical_23imag(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12669 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_imag(CYTHON_UNUSED PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12670 PyObject *__pyx_r = NULL;
12671 __Pyx_RefNannyDeclarations
12672 __Pyx_RefNannySetupContext(
"imag", 0);
12681 __Pyx_XDECREF(__pyx_r);
12682 __Pyx_INCREF(__pyx_float_0_0);
12683 __pyx_r = __pyx_float_0_0;
12696 __Pyx_XGIVEREF(__pyx_r);
12697 __Pyx_RefNannyFinishContext();
12702 static PyObject *__pyx_pw_8PyClical_23imag(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12703 static char __pyx_doc_8PyClical_22imag[] =
"\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 ";
12704 static PyObject *__pyx_pw_8PyClical_23imag(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12705 PyObject *__pyx_r = 0;
12706 __Pyx_RefNannyDeclarations
12707 __Pyx_RefNannySetupContext(
"imag (wrapper)", 0);
12708 __pyx_r = __pyx_pf_8PyClical_22imag(__pyx_self, ((PyObject *)__pyx_v_obj));
12711 __Pyx_RefNannyFinishContext();
12715 static PyObject *__pyx_pf_8PyClical_22imag(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12716 PyObject *__pyx_r = NULL;
12717 __Pyx_RefNannyDeclarations
12718 PyObject *__pyx_t_1 = NULL;
12719 int __pyx_lineno = 0;
12720 const char *__pyx_filename = NULL;
12721 int __pyx_clineno = 0;
12722 __Pyx_RefNannySetupContext(
"imag", 0);
12723 __Pyx_XDECREF(__pyx_r);
12724 __pyx_t_1 = __pyx_f_8PyClical_imag(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1415, __pyx_L1_error)
12725 __Pyx_GOTREF(__pyx_t_1);
12726 __pyx_r = __pyx_t_1;
12732 __Pyx_XDECREF(__pyx_t_1);
12733 __Pyx_AddTraceback(
"PyClical.imag", __pyx_clineno, __pyx_lineno, __pyx_filename);
12736 __Pyx_XGIVEREF(__pyx_r);
12737 __Pyx_RefNannyFinishContext();
12749 static PyObject *__pyx_pw_8PyClical_25pure(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12750 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_pure(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12751 PyObject *__pyx_r = NULL;
12752 __Pyx_RefNannyDeclarations
12753 PyObject *__pyx_t_1 = NULL;
12754 PyObject *__pyx_t_2 = NULL;
12755 PyObject *__pyx_t_3 = NULL;
12756 int __pyx_lineno = 0;
12757 const char *__pyx_filename = NULL;
12758 int __pyx_clineno = 0;
12759 __Pyx_RefNannySetupContext(
"pure", 0);
12768 __Pyx_XDECREF(__pyx_r);
12769 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_v_obj);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1435, __pyx_L1_error)
12770 __Pyx_GOTREF(__pyx_t_2);
12771 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pure);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1435, __pyx_L1_error)
12772 __Pyx_GOTREF(__pyx_t_3);
12773 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12775 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
12776 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
12777 if (likely(__pyx_t_2)) {
12778 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
12779 __Pyx_INCREF(__pyx_t_2);
12780 __Pyx_INCREF(
function);
12781 __Pyx_DECREF_SET(__pyx_t_3,
function);
12784 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
12785 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12786 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1435, __pyx_L1_error)
12787 __Pyx_GOTREF(__pyx_t_1);
12788 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12789 __pyx_r = __pyx_t_1;
12803 __Pyx_XDECREF(__pyx_t_1);
12804 __Pyx_XDECREF(__pyx_t_2);
12805 __Pyx_XDECREF(__pyx_t_3);
12806 __Pyx_AddTraceback(
"PyClical.pure", __pyx_clineno, __pyx_lineno, __pyx_filename);
12809 __Pyx_XGIVEREF(__pyx_r);
12810 __Pyx_RefNannyFinishContext();
12815 static PyObject *__pyx_pw_8PyClical_25pure(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12816 static char __pyx_doc_8PyClical_24pure[] =
"\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 ";
12817 static PyObject *__pyx_pw_8PyClical_25pure(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12818 PyObject *__pyx_r = 0;
12819 __Pyx_RefNannyDeclarations
12820 __Pyx_RefNannySetupContext(
"pure (wrapper)", 0);
12821 __pyx_r = __pyx_pf_8PyClical_24pure(__pyx_self, ((PyObject *)__pyx_v_obj));
12824 __Pyx_RefNannyFinishContext();
12828 static PyObject *__pyx_pf_8PyClical_24pure(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12829 PyObject *__pyx_r = NULL;
12830 __Pyx_RefNannyDeclarations
12831 PyObject *__pyx_t_1 = NULL;
12832 int __pyx_lineno = 0;
12833 const char *__pyx_filename = NULL;
12834 int __pyx_clineno = 0;
12835 __Pyx_RefNannySetupContext(
"pure", 0);
12836 __Pyx_XDECREF(__pyx_r);
12837 __pyx_t_1 = __pyx_f_8PyClical_pure(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1426, __pyx_L1_error)
12838 __Pyx_GOTREF(__pyx_t_1);
12839 __pyx_r = __pyx_t_1;
12845 __Pyx_XDECREF(__pyx_t_1);
12846 __Pyx_AddTraceback(
"PyClical.pure", __pyx_clineno, __pyx_lineno, __pyx_filename);
12849 __Pyx_XGIVEREF(__pyx_r);
12850 __Pyx_RefNannyFinishContext();
12862 static PyObject *__pyx_pw_8PyClical_27even(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12863 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_even(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12864 PyObject *__pyx_r = NULL;
12865 __Pyx_RefNannyDeclarations
12866 PyObject *__pyx_t_1 = NULL;
12867 PyObject *__pyx_t_2 = NULL;
12868 PyObject *__pyx_t_3 = NULL;
12869 int __pyx_lineno = 0;
12870 const char *__pyx_filename = NULL;
12871 int __pyx_clineno = 0;
12872 __Pyx_RefNannySetupContext(
"even", 0);
12881 __Pyx_XDECREF(__pyx_r);
12882 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_v_obj);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1444, __pyx_L1_error)
12883 __Pyx_GOTREF(__pyx_t_2);
12884 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_even);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1444, __pyx_L1_error)
12885 __Pyx_GOTREF(__pyx_t_3);
12886 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12888 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
12889 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
12890 if (likely(__pyx_t_2)) {
12891 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
12892 __Pyx_INCREF(__pyx_t_2);
12893 __Pyx_INCREF(
function);
12894 __Pyx_DECREF_SET(__pyx_t_3,
function);
12897 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
12898 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12899 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1444, __pyx_L1_error)
12900 __Pyx_GOTREF(__pyx_t_1);
12901 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12902 __pyx_r = __pyx_t_1;
12916 __Pyx_XDECREF(__pyx_t_1);
12917 __Pyx_XDECREF(__pyx_t_2);
12918 __Pyx_XDECREF(__pyx_t_3);
12919 __Pyx_AddTraceback(
"PyClical.even", __pyx_clineno, __pyx_lineno, __pyx_filename);
12922 __Pyx_XGIVEREF(__pyx_r);
12923 __Pyx_RefNannyFinishContext();
12928 static PyObject *__pyx_pw_8PyClical_27even(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12929 static char __pyx_doc_8PyClical_26even[] =
"\n Even part of multivector, sum of even grade terms.\n\n >>> print(even(clifford(\"1+{1}+{1,2}\")))\n 1+{1,2}\n ";
12930 static PyObject *__pyx_pw_8PyClical_27even(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12931 PyObject *__pyx_r = 0;
12932 __Pyx_RefNannyDeclarations
12933 __Pyx_RefNannySetupContext(
"even (wrapper)", 0);
12934 __pyx_r = __pyx_pf_8PyClical_26even(__pyx_self, ((PyObject *)__pyx_v_obj));
12937 __Pyx_RefNannyFinishContext();
12941 static PyObject *__pyx_pf_8PyClical_26even(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12942 PyObject *__pyx_r = NULL;
12943 __Pyx_RefNannyDeclarations
12944 PyObject *__pyx_t_1 = NULL;
12945 int __pyx_lineno = 0;
12946 const char *__pyx_filename = NULL;
12947 int __pyx_clineno = 0;
12948 __Pyx_RefNannySetupContext(
"even", 0);
12949 __Pyx_XDECREF(__pyx_r);
12950 __pyx_t_1 = __pyx_f_8PyClical_even(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1437, __pyx_L1_error)
12951 __Pyx_GOTREF(__pyx_t_1);
12952 __pyx_r = __pyx_t_1;
12958 __Pyx_XDECREF(__pyx_t_1);
12959 __Pyx_AddTraceback(
"PyClical.even", __pyx_clineno, __pyx_lineno, __pyx_filename);
12962 __Pyx_XGIVEREF(__pyx_r);
12963 __Pyx_RefNannyFinishContext();
12975 static PyObject *__pyx_pw_8PyClical_29odd(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12976 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_odd(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12977 PyObject *__pyx_r = NULL;
12978 __Pyx_RefNannyDeclarations
12979 PyObject *__pyx_t_1 = NULL;
12980 PyObject *__pyx_t_2 = NULL;
12981 PyObject *__pyx_t_3 = NULL;
12982 int __pyx_lineno = 0;
12983 const char *__pyx_filename = NULL;
12984 int __pyx_clineno = 0;
12985 __Pyx_RefNannySetupContext(
"odd", 0);
12994 __Pyx_XDECREF(__pyx_r);
12995 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_v_obj);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1453, __pyx_L1_error)
12996 __Pyx_GOTREF(__pyx_t_2);
12997 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_odd);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1453, __pyx_L1_error)
12998 __Pyx_GOTREF(__pyx_t_3);
12999 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13001 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
13002 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
13003 if (likely(__pyx_t_2)) {
13004 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
13005 __Pyx_INCREF(__pyx_t_2);
13006 __Pyx_INCREF(
function);
13007 __Pyx_DECREF_SET(__pyx_t_3,
function);
13010 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
13011 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
13012 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1453, __pyx_L1_error)
13013 __Pyx_GOTREF(__pyx_t_1);
13014 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13015 __pyx_r = __pyx_t_1;
13029 __Pyx_XDECREF(__pyx_t_1);
13030 __Pyx_XDECREF(__pyx_t_2);
13031 __Pyx_XDECREF(__pyx_t_3);
13032 __Pyx_AddTraceback(
"PyClical.odd", __pyx_clineno, __pyx_lineno, __pyx_filename);
13035 __Pyx_XGIVEREF(__pyx_r);
13036 __Pyx_RefNannyFinishContext();
13041 static PyObject *__pyx_pw_8PyClical_29odd(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13042 static char __pyx_doc_8PyClical_28odd[] =
"\n Odd part of multivector, sum of odd grade terms.\n\n >>> print(odd(clifford(\"1+{1}+{1,2}\")))\n {1}\n ";
13043 static PyObject *__pyx_pw_8PyClical_29odd(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13044 PyObject *__pyx_r = 0;
13045 __Pyx_RefNannyDeclarations
13046 __Pyx_RefNannySetupContext(
"odd (wrapper)", 0);
13047 __pyx_r = __pyx_pf_8PyClical_28odd(__pyx_self, ((PyObject *)__pyx_v_obj));
13050 __Pyx_RefNannyFinishContext();
13054 static PyObject *__pyx_pf_8PyClical_28odd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13055 PyObject *__pyx_r = NULL;
13056 __Pyx_RefNannyDeclarations
13057 PyObject *__pyx_t_1 = NULL;
13058 int __pyx_lineno = 0;
13059 const char *__pyx_filename = NULL;
13060 int __pyx_clineno = 0;
13061 __Pyx_RefNannySetupContext(
"odd", 0);
13062 __Pyx_XDECREF(__pyx_r);
13063 __pyx_t_1 = __pyx_f_8PyClical_odd(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1446, __pyx_L1_error)
13064 __Pyx_GOTREF(__pyx_t_1);
13065 __pyx_r = __pyx_t_1;
13071 __Pyx_XDECREF(__pyx_t_1);
13072 __Pyx_AddTraceback(
"PyClical.odd", __pyx_clineno, __pyx_lineno, __pyx_filename);
13075 __Pyx_XGIVEREF(__pyx_r);
13076 __Pyx_RefNannyFinishContext();
13088 static PyObject *__pyx_pw_8PyClical_31involute(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13089 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_involute(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
13090 PyObject *__pyx_r = NULL;
13091 __Pyx_RefNannyDeclarations
13092 PyObject *__pyx_t_1 = NULL;
13093 PyObject *__pyx_t_2 = NULL;
13094 PyObject *__pyx_t_3 = NULL;
13095 int __pyx_lineno = 0;
13096 const char *__pyx_filename = NULL;
13097 int __pyx_clineno = 0;
13098 __Pyx_RefNannySetupContext(
"involute", 0);
13107 __Pyx_XDECREF(__pyx_r);
13108 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_v_obj);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1468, __pyx_L1_error)
13109 __Pyx_GOTREF(__pyx_t_2);
13110 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_involute);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1468, __pyx_L1_error)
13111 __Pyx_GOTREF(__pyx_t_3);
13112 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13114 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
13115 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
13116 if (likely(__pyx_t_2)) {
13117 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
13118 __Pyx_INCREF(__pyx_t_2);
13119 __Pyx_INCREF(
function);
13120 __Pyx_DECREF_SET(__pyx_t_3,
function);
13123 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
13124 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
13125 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1468, __pyx_L1_error)
13126 __Pyx_GOTREF(__pyx_t_1);
13127 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13128 __pyx_r = __pyx_t_1;
13142 __Pyx_XDECREF(__pyx_t_1);
13143 __Pyx_XDECREF(__pyx_t_2);
13144 __Pyx_XDECREF(__pyx_t_3);
13145 __Pyx_AddTraceback(
"PyClical.involute", __pyx_clineno, __pyx_lineno, __pyx_filename);
13148 __Pyx_XGIVEREF(__pyx_r);
13149 __Pyx_RefNannyFinishContext();
13154 static PyObject *__pyx_pw_8PyClical_31involute(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13155 static char __pyx_doc_8PyClical_30involute[] =
"\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 ";
13156 static PyObject *__pyx_pw_8PyClical_31involute(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13157 PyObject *__pyx_r = 0;
13158 __Pyx_RefNannyDeclarations
13159 __Pyx_RefNannySetupContext(
"involute (wrapper)", 0);
13160 __pyx_r = __pyx_pf_8PyClical_30involute(__pyx_self, ((PyObject *)__pyx_v_obj));
13163 __Pyx_RefNannyFinishContext();
13167 static PyObject *__pyx_pf_8PyClical_30involute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13168 PyObject *__pyx_r = NULL;
13169 __Pyx_RefNannyDeclarations
13170 PyObject *__pyx_t_1 = NULL;
13171 int __pyx_lineno = 0;
13172 const char *__pyx_filename = NULL;
13173 int __pyx_clineno = 0;
13174 __Pyx_RefNannySetupContext(
"involute", 0);
13175 __Pyx_XDECREF(__pyx_r);
13176 __pyx_t_1 = __pyx_f_8PyClical_involute(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1455, __pyx_L1_error)
13177 __Pyx_GOTREF(__pyx_t_1);
13178 __pyx_r = __pyx_t_1;
13184 __Pyx_XDECREF(__pyx_t_1);
13185 __Pyx_AddTraceback(
"PyClical.involute", __pyx_clineno, __pyx_lineno, __pyx_filename);
13188 __Pyx_XGIVEREF(__pyx_r);
13189 __Pyx_RefNannyFinishContext();
13201 static PyObject *__pyx_pw_8PyClical_33reverse(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13202 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_reverse(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
13203 PyObject *__pyx_r = NULL;
13204 __Pyx_RefNannyDeclarations
13205 PyObject *__pyx_t_1 = NULL;
13206 PyObject *__pyx_t_2 = NULL;
13207 PyObject *__pyx_t_3 = NULL;
13208 int __pyx_lineno = 0;
13209 const char *__pyx_filename = NULL;
13210 int __pyx_clineno = 0;
13211 __Pyx_RefNannySetupContext(
"reverse", 0);
13220 __Pyx_XDECREF(__pyx_r);
13221 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_v_obj);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1483, __pyx_L1_error)
13222 __Pyx_GOTREF(__pyx_t_2);
13223 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_reverse);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1483, __pyx_L1_error)
13224 __Pyx_GOTREF(__pyx_t_3);
13225 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13227 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
13228 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
13229 if (likely(__pyx_t_2)) {
13230 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
13231 __Pyx_INCREF(__pyx_t_2);
13232 __Pyx_INCREF(
function);
13233 __Pyx_DECREF_SET(__pyx_t_3,
function);
13236 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
13237 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
13238 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1483, __pyx_L1_error)
13239 __Pyx_GOTREF(__pyx_t_1);
13240 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13241 __pyx_r = __pyx_t_1;
13255 __Pyx_XDECREF(__pyx_t_1);
13256 __Pyx_XDECREF(__pyx_t_2);
13257 __Pyx_XDECREF(__pyx_t_3);
13258 __Pyx_AddTraceback(
"PyClical.reverse", __pyx_clineno, __pyx_lineno, __pyx_filename);
13261 __Pyx_XGIVEREF(__pyx_r);
13262 __Pyx_RefNannyFinishContext();
13267 static PyObject *__pyx_pw_8PyClical_33reverse(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13268 static char __pyx_doc_8PyClical_32reverse[] =
"\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 ";
13269 static PyObject *__pyx_pw_8PyClical_33reverse(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13270 PyObject *__pyx_r = 0;
13271 __Pyx_RefNannyDeclarations
13272 __Pyx_RefNannySetupContext(
"reverse (wrapper)", 0);
13273 __pyx_r = __pyx_pf_8PyClical_32reverse(__pyx_self, ((PyObject *)__pyx_v_obj));
13276 __Pyx_RefNannyFinishContext();
13280 static PyObject *__pyx_pf_8PyClical_32reverse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13281 PyObject *__pyx_r = NULL;
13282 __Pyx_RefNannyDeclarations
13283 PyObject *__pyx_t_1 = NULL;
13284 int __pyx_lineno = 0;
13285 const char *__pyx_filename = NULL;
13286 int __pyx_clineno = 0;
13287 __Pyx_RefNannySetupContext(
"reverse", 0);
13288 __Pyx_XDECREF(__pyx_r);
13289 __pyx_t_1 = __pyx_f_8PyClical_reverse(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1470, __pyx_L1_error)
13290 __Pyx_GOTREF(__pyx_t_1);
13291 __pyx_r = __pyx_t_1;
13297 __Pyx_XDECREF(__pyx_t_1);
13298 __Pyx_AddTraceback(
"PyClical.reverse", __pyx_clineno, __pyx_lineno, __pyx_filename);
13301 __Pyx_XGIVEREF(__pyx_r);
13302 __Pyx_RefNannyFinishContext();
13314 static PyObject *__pyx_pw_8PyClical_35conj(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13315 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_conj(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
13316 PyObject *__pyx_r = NULL;
13317 __Pyx_RefNannyDeclarations
13318 PyObject *__pyx_t_1 = NULL;
13319 PyObject *__pyx_t_2 = NULL;
13320 PyObject *__pyx_t_3 = NULL;
13321 int __pyx_lineno = 0;
13322 const char *__pyx_filename = NULL;
13323 int __pyx_clineno = 0;
13324 __Pyx_RefNannySetupContext(
"conj", 0);
13333 __Pyx_XDECREF(__pyx_r);
13334 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_v_obj);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1498, __pyx_L1_error)
13335 __Pyx_GOTREF(__pyx_t_2);
13336 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_conj);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1498, __pyx_L1_error)
13337 __Pyx_GOTREF(__pyx_t_3);
13338 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13340 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
13341 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
13342 if (likely(__pyx_t_2)) {
13343 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
13344 __Pyx_INCREF(__pyx_t_2);
13345 __Pyx_INCREF(
function);
13346 __Pyx_DECREF_SET(__pyx_t_3,
function);
13349 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
13350 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
13351 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1498, __pyx_L1_error)
13352 __Pyx_GOTREF(__pyx_t_1);
13353 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13354 __pyx_r = __pyx_t_1;
13368 __Pyx_XDECREF(__pyx_t_1);
13369 __Pyx_XDECREF(__pyx_t_2);
13370 __Pyx_XDECREF(__pyx_t_3);
13371 __Pyx_AddTraceback(
"PyClical.conj", __pyx_clineno, __pyx_lineno, __pyx_filename);
13374 __Pyx_XGIVEREF(__pyx_r);
13375 __Pyx_RefNannyFinishContext();
13380 static PyObject *__pyx_pw_8PyClical_35conj(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13381 static char __pyx_doc_8PyClical_34conj[] =
"\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 ";
13382 static PyObject *__pyx_pw_8PyClical_35conj(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13383 PyObject *__pyx_r = 0;
13384 __Pyx_RefNannyDeclarations
13385 __Pyx_RefNannySetupContext(
"conj (wrapper)", 0);
13386 __pyx_r = __pyx_pf_8PyClical_34conj(__pyx_self, ((PyObject *)__pyx_v_obj));
13389 __Pyx_RefNannyFinishContext();
13393 static PyObject *__pyx_pf_8PyClical_34conj(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13394 PyObject *__pyx_r = NULL;
13395 __Pyx_RefNannyDeclarations
13396 PyObject *__pyx_t_1 = NULL;
13397 int __pyx_lineno = 0;
13398 const char *__pyx_filename = NULL;
13399 int __pyx_clineno = 0;
13400 __Pyx_RefNannySetupContext(
"conj", 0);
13401 __Pyx_XDECREF(__pyx_r);
13402 __pyx_t_1 = __pyx_f_8PyClical_conj(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1485, __pyx_L1_error)
13403 __Pyx_GOTREF(__pyx_t_1);
13404 __pyx_r = __pyx_t_1;
13410 __Pyx_XDECREF(__pyx_t_1);
13411 __Pyx_AddTraceback(
"PyClical.conj", __pyx_clineno, __pyx_lineno, __pyx_filename);
13414 __Pyx_XGIVEREF(__pyx_r);
13415 __Pyx_RefNannyFinishContext();
13427 static PyObject *__pyx_pw_8PyClical_37quad(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13428 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_quad(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
13429 PyObject *__pyx_r = NULL;
13430 __Pyx_RefNannyDeclarations
13431 PyObject *__pyx_t_1 = NULL;
13432 PyObject *__pyx_t_2 = NULL;
13433 PyObject *__pyx_t_3 = NULL;
13434 int __pyx_lineno = 0;
13435 const char *__pyx_filename = NULL;
13436 int __pyx_clineno = 0;
13437 __Pyx_RefNannySetupContext(
"quad", 0);
13446 __Pyx_XDECREF(__pyx_r);
13447 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_v_obj);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1509, __pyx_L1_error)
13448 __Pyx_GOTREF(__pyx_t_2);
13449 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_quad);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1509, __pyx_L1_error)
13450 __Pyx_GOTREF(__pyx_t_3);
13451 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13453 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
13454 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
13455 if (likely(__pyx_t_2)) {
13456 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
13457 __Pyx_INCREF(__pyx_t_2);
13458 __Pyx_INCREF(
function);
13459 __Pyx_DECREF_SET(__pyx_t_3,
function);
13462 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
13463 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
13464 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1509, __pyx_L1_error)
13465 __Pyx_GOTREF(__pyx_t_1);
13466 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13467 __pyx_r = __pyx_t_1;
13481 __Pyx_XDECREF(__pyx_t_1);
13482 __Pyx_XDECREF(__pyx_t_2);
13483 __Pyx_XDECREF(__pyx_t_3);
13484 __Pyx_AddTraceback(
"PyClical.quad", __pyx_clineno, __pyx_lineno, __pyx_filename);
13487 __Pyx_XGIVEREF(__pyx_r);
13488 __Pyx_RefNannyFinishContext();
13493 static PyObject *__pyx_pw_8PyClical_37quad(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13494 static char __pyx_doc_8PyClical_36quad[] =
"\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 ";
13495 static PyObject *__pyx_pw_8PyClical_37quad(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13496 PyObject *__pyx_r = 0;
13497 __Pyx_RefNannyDeclarations
13498 __Pyx_RefNannySetupContext(
"quad (wrapper)", 0);
13499 __pyx_r = __pyx_pf_8PyClical_36quad(__pyx_self, ((PyObject *)__pyx_v_obj));
13502 __Pyx_RefNannyFinishContext();
13506 static PyObject *__pyx_pf_8PyClical_36quad(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13507 PyObject *__pyx_r = NULL;
13508 __Pyx_RefNannyDeclarations
13509 PyObject *__pyx_t_1 = NULL;
13510 int __pyx_lineno = 0;
13511 const char *__pyx_filename = NULL;
13512 int __pyx_clineno = 0;
13513 __Pyx_RefNannySetupContext(
"quad", 0);
13514 __Pyx_XDECREF(__pyx_r);
13515 __pyx_t_1 = __pyx_f_8PyClical_quad(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1500, __pyx_L1_error)
13516 __Pyx_GOTREF(__pyx_t_1);
13517 __pyx_r = __pyx_t_1;
13523 __Pyx_XDECREF(__pyx_t_1);
13524 __Pyx_AddTraceback(
"PyClical.quad", __pyx_clineno, __pyx_lineno, __pyx_filename);
13527 __Pyx_XGIVEREF(__pyx_r);
13528 __Pyx_RefNannyFinishContext();
13540 static PyObject *__pyx_pw_8PyClical_39norm(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13541 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_norm(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
13542 PyObject *__pyx_r = NULL;
13543 __Pyx_RefNannyDeclarations
13544 PyObject *__pyx_t_1 = NULL;
13545 PyObject *__pyx_t_2 = NULL;
13546 PyObject *__pyx_t_3 = NULL;
13547 int __pyx_lineno = 0;
13548 const char *__pyx_filename = NULL;
13549 int __pyx_clineno = 0;
13550 __Pyx_RefNannySetupContext(
"norm", 0);
13559 __Pyx_XDECREF(__pyx_r);
13560 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_v_obj);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1520, __pyx_L1_error)
13561 __Pyx_GOTREF(__pyx_t_2);
13562 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_norm);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1520, __pyx_L1_error)
13563 __Pyx_GOTREF(__pyx_t_3);
13564 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13566 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
13567 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
13568 if (likely(__pyx_t_2)) {
13569 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
13570 __Pyx_INCREF(__pyx_t_2);
13571 __Pyx_INCREF(
function);
13572 __Pyx_DECREF_SET(__pyx_t_3,
function);
13575 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
13576 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
13577 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1520, __pyx_L1_error)
13578 __Pyx_GOTREF(__pyx_t_1);
13579 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13580 __pyx_r = __pyx_t_1;
13594 __Pyx_XDECREF(__pyx_t_1);
13595 __Pyx_XDECREF(__pyx_t_2);
13596 __Pyx_XDECREF(__pyx_t_3);
13597 __Pyx_AddTraceback(
"PyClical.norm", __pyx_clineno, __pyx_lineno, __pyx_filename);
13600 __Pyx_XGIVEREF(__pyx_r);
13601 __Pyx_RefNannyFinishContext();
13606 static PyObject *__pyx_pw_8PyClical_39norm(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13607 static char __pyx_doc_8PyClical_38norm[] =
"\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 ";
13608 static PyObject *__pyx_pw_8PyClical_39norm(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13609 PyObject *__pyx_r = 0;
13610 __Pyx_RefNannyDeclarations
13611 __Pyx_RefNannySetupContext(
"norm (wrapper)", 0);
13612 __pyx_r = __pyx_pf_8PyClical_38norm(__pyx_self, ((PyObject *)__pyx_v_obj));
13615 __Pyx_RefNannyFinishContext();
13619 static PyObject *__pyx_pf_8PyClical_38norm(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13620 PyObject *__pyx_r = NULL;
13621 __Pyx_RefNannyDeclarations
13622 PyObject *__pyx_t_1 = NULL;
13623 int __pyx_lineno = 0;
13624 const char *__pyx_filename = NULL;
13625 int __pyx_clineno = 0;
13626 __Pyx_RefNannySetupContext(
"norm", 0);
13627 __Pyx_XDECREF(__pyx_r);
13628 __pyx_t_1 = __pyx_f_8PyClical_norm(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1511, __pyx_L1_error)
13629 __Pyx_GOTREF(__pyx_t_1);
13630 __pyx_r = __pyx_t_1;
13636 __Pyx_XDECREF(__pyx_t_1);
13637 __Pyx_AddTraceback(
"PyClical.norm", __pyx_clineno, __pyx_lineno, __pyx_filename);
13640 __Pyx_XGIVEREF(__pyx_r);
13641 __Pyx_RefNannyFinishContext();
13653 static PyObject *__pyx_pw_8PyClical_41abs(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13654 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_abs(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
13655 PyObject *__pyx_r = NULL;
13656 __Pyx_RefNannyDeclarations
13657 PyObject *__pyx_t_1 = NULL;
13658 int __pyx_lineno = 0;
13659 const char *__pyx_filename = NULL;
13660 int __pyx_clineno = 0;
13661 __Pyx_RefNannySetupContext(
"abs", 0);
13670 __Pyx_XDECREF(__pyx_r);
13671 __pyx_t_1 =
PyFloat_FromDouble(
abs(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1529, __pyx_L1_error)
13672 __Pyx_GOTREF(__pyx_t_1);
13673 __pyx_r = __pyx_t_1;
13687 __Pyx_XDECREF(__pyx_t_1);
13688 __Pyx_AddTraceback(
"PyClical.abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
13691 __Pyx_XGIVEREF(__pyx_r);
13692 __Pyx_RefNannyFinishContext();
13697 static PyObject *__pyx_pw_8PyClical_41abs(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13698 static char __pyx_doc_8PyClical_40abs[] =
"\n Absolute value of multivector: multivector 2-norm.\n\n >>> abs(clifford(\"1+{-1}+{1,2}+{1,2,3}\"))\n 2.0\n ";
13699 static PyObject *__pyx_pw_8PyClical_41abs(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13700 PyObject *__pyx_r = 0;
13701 __Pyx_RefNannyDeclarations
13702 __Pyx_RefNannySetupContext(
"abs (wrapper)", 0);
13703 __pyx_r = __pyx_pf_8PyClical_40abs(__pyx_self, ((PyObject *)__pyx_v_obj));
13706 __Pyx_RefNannyFinishContext();
13710 static PyObject *__pyx_pf_8PyClical_40abs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13711 PyObject *__pyx_r = NULL;
13712 __Pyx_RefNannyDeclarations
13713 PyObject *__pyx_t_1 = NULL;
13714 int __pyx_lineno = 0;
13715 const char *__pyx_filename = NULL;
13716 int __pyx_clineno = 0;
13717 __Pyx_RefNannySetupContext(
"abs", 0);
13718 __Pyx_XDECREF(__pyx_r);
13719 __pyx_t_1 = __pyx_f_8PyClical_abs(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1522, __pyx_L1_error)
13720 __Pyx_GOTREF(__pyx_t_1);
13721 __pyx_r = __pyx_t_1;
13727 __Pyx_XDECREF(__pyx_t_1);
13728 __Pyx_AddTraceback(
"PyClical.abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
13731 __Pyx_XGIVEREF(__pyx_r);
13732 __Pyx_RefNannyFinishContext();
13744 static PyObject *__pyx_pw_8PyClical_43max_abs(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13745 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_max_abs(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
13746 PyObject *__pyx_r = NULL;
13747 __Pyx_RefNannyDeclarations
13748 PyObject *__pyx_t_1 = NULL;
13749 int __pyx_lineno = 0;
13750 const char *__pyx_filename = NULL;
13751 int __pyx_clineno = 0;
13752 __Pyx_RefNannySetupContext(
"max_abs", 0);
13761 __Pyx_XDECREF(__pyx_r);
13762 __pyx_t_1 =
PyFloat_FromDouble(
max_abs(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1541, __pyx_L1_error)
13763 __Pyx_GOTREF(__pyx_t_1);
13764 __pyx_r = __pyx_t_1;
13778 __Pyx_XDECREF(__pyx_t_1);
13779 __Pyx_AddTraceback(
"PyClical.max_abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
13782 __Pyx_XGIVEREF(__pyx_r);
13783 __Pyx_RefNannyFinishContext();
13788 static PyObject *__pyx_pw_8PyClical_43max_abs(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13789 static char __pyx_doc_8PyClical_42max_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 ";
13790 static PyObject *__pyx_pw_8PyClical_43max_abs(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13791 PyObject *__pyx_r = 0;
13792 __Pyx_RefNannyDeclarations
13793 __Pyx_RefNannySetupContext(
"max_abs (wrapper)", 0);
13794 __pyx_r = __pyx_pf_8PyClical_42max_abs(__pyx_self, ((PyObject *)__pyx_v_obj));
13797 __Pyx_RefNannyFinishContext();
13801 static PyObject *__pyx_pf_8PyClical_42max_abs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13802 PyObject *__pyx_r = NULL;
13803 __Pyx_RefNannyDeclarations
13804 PyObject *__pyx_t_1 = NULL;
13805 int __pyx_lineno = 0;
13806 const char *__pyx_filename = NULL;
13807 int __pyx_clineno = 0;
13808 __Pyx_RefNannySetupContext(
"max_abs", 0);
13809 __Pyx_XDECREF(__pyx_r);
13810 __pyx_t_1 = __pyx_f_8PyClical_max_abs(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1531, __pyx_L1_error)
13811 __Pyx_GOTREF(__pyx_t_1);
13812 __pyx_r = __pyx_t_1;
13818 __Pyx_XDECREF(__pyx_t_1);
13819 __Pyx_AddTraceback(
"PyClical.max_abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
13822 __Pyx_XGIVEREF(__pyx_r);
13823 __Pyx_RefNannyFinishContext();
13835 static PyObject *__pyx_pw_8PyClical_45pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13836 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_pow(PyObject *__pyx_v_obj, PyObject *__pyx_v_m, CYTHON_UNUSED
int __pyx_skip_dispatch) {
13837 PyObject *__pyx_r = NULL;
13838 __Pyx_RefNannyDeclarations
13839 PyObject *__pyx_t_1 = NULL;
13840 PyObject *__pyx_t_2 = NULL;
13841 PyObject *__pyx_t_3 = NULL;
13842 PyObject *__pyx_t_4 = NULL;
13843 PyObject *__pyx_t_5 = NULL;
13844 PyObject *__pyx_t_6 = NULL;
13846 PyObject *__pyx_t_8 = NULL;
13847 PyObject *__pyx_t_9 = NULL;
13848 PyObject *__pyx_t_10 = NULL;
13849 int __pyx_lineno = 0;
13850 const char *__pyx_filename = NULL;
13851 int __pyx_clineno = 0;
13852 __Pyx_RefNannySetupContext(
"pow", 0);
13862 __Pyx_PyThreadState_declare
13863 __Pyx_PyThreadState_assign
13864 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
13865 __Pyx_XGOTREF(__pyx_t_1);
13866 __Pyx_XGOTREF(__pyx_t_2);
13867 __Pyx_XGOTREF(__pyx_t_3);
13877 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1563, __pyx_L3_error)
13878 __Pyx_GOTREF(__pyx_t_5);
13879 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_pow);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1563, __pyx_L3_error)
13880 __Pyx_GOTREF(__pyx_t_6);
13881 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13884 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
13885 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
13886 if (likely(__pyx_t_5)) {
13887 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
13888 __Pyx_INCREF(__pyx_t_5);
13889 __Pyx_INCREF(
function);
13890 __Pyx_DECREF_SET(__pyx_t_6,
function);
13894 #if CYTHON_FAST_PYCALL 13895 if (PyFunction_Check(__pyx_t_6)) {
13896 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_obj, __pyx_v_m};
13897 __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, 1563, __pyx_L3_error)
13898 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13899 __Pyx_GOTREF(__pyx_t_4);
13902 #if CYTHON_FAST_PYCCALL 13903 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
13904 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_obj, __pyx_v_m};
13905 __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, 1563, __pyx_L3_error)
13906 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13907 __Pyx_GOTREF(__pyx_t_4);
13911 __pyx_t_8 = PyTuple_New(2+__pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1563, __pyx_L3_error)
13912 __Pyx_GOTREF(__pyx_t_8);
13914 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
13916 __Pyx_INCREF(__pyx_v_obj);
13917 __Pyx_GIVEREF(__pyx_v_obj);
13918 PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_obj);
13919 __Pyx_INCREF(__pyx_v_m);
13920 __Pyx_GIVEREF(__pyx_v_m);
13921 PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_m);
13922 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1563, __pyx_L3_error)
13923 __Pyx_GOTREF(__pyx_t_4);
13924 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13926 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13927 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13937 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
13938 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
13939 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13940 goto __pyx_L8_try_end;
13942 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
13943 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13944 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
13945 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
13955 __Pyx_AddTraceback(
"PyClical.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
13956 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_8) < 0) __PYX_ERR(0, 1564, __pyx_L5_except_error)
13957 __Pyx_GOTREF(__pyx_t_4);
13958 __Pyx_GOTREF(__pyx_t_6);
13959 __Pyx_GOTREF(__pyx_t_8);
13968 __Pyx_XDECREF(__pyx_r);
13969 __pyx_t_9 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_v_obj);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1565, __pyx_L5_except_error)
13970 __Pyx_GOTREF(__pyx_t_9);
13971 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_pow);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1565, __pyx_L5_except_error)
13972 __Pyx_GOTREF(__pyx_t_10);
13973 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13975 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
13976 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
13977 if (likely(__pyx_t_9)) {
13978 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_10);
13979 __Pyx_INCREF(__pyx_t_9);
13980 __Pyx_INCREF(
function);
13981 __Pyx_DECREF_SET(__pyx_t_10,
function);
13984 __pyx_t_5 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_9, __pyx_v_m) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_m);
13985 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
13986 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1565, __pyx_L5_except_error)
13987 __Pyx_GOTREF(__pyx_t_5);
13988 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13989 __pyx_r = __pyx_t_5;
13991 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13992 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13993 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13994 goto __pyx_L6_except_return;
13996 __pyx_L5_except_error:;
14005 __Pyx_XGIVEREF(__pyx_t_1);
14006 __Pyx_XGIVEREF(__pyx_t_2);
14007 __Pyx_XGIVEREF(__pyx_t_3);
14008 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
14009 goto __pyx_L1_error;
14010 __pyx_L6_except_return:;
14011 __Pyx_XGIVEREF(__pyx_t_1);
14012 __Pyx_XGIVEREF(__pyx_t_2);
14013 __Pyx_XGIVEREF(__pyx_t_3);
14014 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
14028 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14031 __Pyx_XDECREF(__pyx_t_4);
14032 __Pyx_XDECREF(__pyx_t_5);
14033 __Pyx_XDECREF(__pyx_t_6);
14034 __Pyx_XDECREF(__pyx_t_8);
14035 __Pyx_XDECREF(__pyx_t_9);
14036 __Pyx_XDECREF(__pyx_t_10);
14037 __Pyx_AddTraceback(
"PyClical.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
14040 __Pyx_XGIVEREF(__pyx_r);
14041 __Pyx_RefNannyFinishContext();
14046 static PyObject *__pyx_pw_8PyClical_45pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14047 static char __pyx_doc_8PyClical_44pow[] =
"\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 ";
14048 static PyObject *__pyx_pw_8PyClical_45pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14049 PyObject *__pyx_v_obj = 0;
14050 PyObject *__pyx_v_m = 0;
14051 int __pyx_lineno = 0;
14052 const char *__pyx_filename = NULL;
14053 int __pyx_clineno = 0;
14054 PyObject *__pyx_r = 0;
14055 __Pyx_RefNannyDeclarations
14056 __Pyx_RefNannySetupContext(
"pow (wrapper)", 0);
14058 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_m,0};
14059 PyObject* values[2] = {0,0};
14060 if (unlikely(__pyx_kwds)) {
14061 Py_ssize_t kw_args;
14062 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14063 switch (pos_args) {
14064 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14065 CYTHON_FALLTHROUGH;
14066 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14067 CYTHON_FALLTHROUGH;
14069 default:
goto __pyx_L5_argtuple_error;
14071 kw_args = PyDict_Size(__pyx_kwds);
14072 switch (pos_args) {
14074 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
14075 else goto __pyx_L5_argtuple_error;
14076 CYTHON_FALLTHROUGH;
14078 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
14080 __Pyx_RaiseArgtupleInvalid(
"pow", 1, 2, 2, 1); __PYX_ERR(0, 1543, __pyx_L3_error)
14083 if (unlikely(kw_args > 0)) {
14084 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"pow") < 0)) __PYX_ERR(0, 1543, __pyx_L3_error)
14086 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
14087 goto __pyx_L5_argtuple_error;
14089 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14090 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14092 __pyx_v_obj = values[0];
14093 __pyx_v_m = values[1];
14095 goto __pyx_L4_argument_unpacking_done;
14096 __pyx_L5_argtuple_error:;
14097 __Pyx_RaiseArgtupleInvalid(
"pow", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1543, __pyx_L3_error)
14099 __Pyx_AddTraceback(
"PyClical.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
14100 __Pyx_RefNannyFinishContext();
14102 __pyx_L4_argument_unpacking_done:;
14103 __pyx_r = __pyx_pf_8PyClical_44pow(__pyx_self, __pyx_v_obj, __pyx_v_m);
14106 __Pyx_RefNannyFinishContext();
14110 static PyObject *__pyx_pf_8PyClical_44pow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_m) {
14111 PyObject *__pyx_r = NULL;
14112 __Pyx_RefNannyDeclarations
14113 PyObject *__pyx_t_1 = NULL;
14114 int __pyx_lineno = 0;
14115 const char *__pyx_filename = NULL;
14116 int __pyx_clineno = 0;
14117 __Pyx_RefNannySetupContext(
"pow", 0);
14118 __Pyx_XDECREF(__pyx_r);
14119 __pyx_t_1 = __pyx_f_8PyClical_pow(__pyx_v_obj, __pyx_v_m, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1543, __pyx_L1_error)
14120 __Pyx_GOTREF(__pyx_t_1);
14121 __pyx_r = __pyx_t_1;
14127 __Pyx_XDECREF(__pyx_t_1);
14128 __Pyx_AddTraceback(
"PyClical.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
14131 __Pyx_XGIVEREF(__pyx_r);
14132 __Pyx_RefNannyFinishContext();
14144 static PyObject *__pyx_pw_8PyClical_47outer_pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14145 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_outer_pow(PyObject *__pyx_v_obj, PyObject *__pyx_v_m, CYTHON_UNUSED
int __pyx_skip_dispatch) {
14146 PyObject *__pyx_r = NULL;
14147 __Pyx_RefNannyDeclarations
14148 PyObject *__pyx_t_1 = NULL;
14149 PyObject *__pyx_t_2 = NULL;
14150 PyObject *__pyx_t_3 = NULL;
14151 int __pyx_lineno = 0;
14152 const char *__pyx_filename = NULL;
14153 int __pyx_clineno = 0;
14154 __Pyx_RefNannySetupContext(
"outer_pow", 0);
14163 __Pyx_XDECREF(__pyx_r);
14164 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_v_obj);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1574, __pyx_L1_error)
14165 __Pyx_GOTREF(__pyx_t_2);
14166 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_outer_pow);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1574, __pyx_L1_error)
14167 __Pyx_GOTREF(__pyx_t_3);
14168 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14170 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
14171 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
14172 if (likely(__pyx_t_2)) {
14173 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
14174 __Pyx_INCREF(__pyx_t_2);
14175 __Pyx_INCREF(
function);
14176 __Pyx_DECREF_SET(__pyx_t_3,
function);
14179 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_m) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_m);
14180 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
14181 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1574, __pyx_L1_error)
14182 __Pyx_GOTREF(__pyx_t_1);
14183 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14184 __pyx_r = __pyx_t_1;
14198 __Pyx_XDECREF(__pyx_t_1);
14199 __Pyx_XDECREF(__pyx_t_2);
14200 __Pyx_XDECREF(__pyx_t_3);
14201 __Pyx_AddTraceback(
"PyClical.outer_pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
14204 __Pyx_XGIVEREF(__pyx_r);
14205 __Pyx_RefNannyFinishContext();
14210 static PyObject *__pyx_pw_8PyClical_47outer_pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14211 static char __pyx_doc_8PyClical_46outer_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 ";
14212 static PyObject *__pyx_pw_8PyClical_47outer_pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14213 PyObject *__pyx_v_obj = 0;
14214 PyObject *__pyx_v_m = 0;
14215 int __pyx_lineno = 0;
14216 const char *__pyx_filename = NULL;
14217 int __pyx_clineno = 0;
14218 PyObject *__pyx_r = 0;
14219 __Pyx_RefNannyDeclarations
14220 __Pyx_RefNannySetupContext(
"outer_pow (wrapper)", 0);
14222 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_m,0};
14223 PyObject* values[2] = {0,0};
14224 if (unlikely(__pyx_kwds)) {
14225 Py_ssize_t kw_args;
14226 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14227 switch (pos_args) {
14228 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14229 CYTHON_FALLTHROUGH;
14230 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14231 CYTHON_FALLTHROUGH;
14233 default:
goto __pyx_L5_argtuple_error;
14235 kw_args = PyDict_Size(__pyx_kwds);
14236 switch (pos_args) {
14238 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
14239 else goto __pyx_L5_argtuple_error;
14240 CYTHON_FALLTHROUGH;
14242 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
14244 __Pyx_RaiseArgtupleInvalid(
"outer_pow", 1, 2, 2, 1); __PYX_ERR(0, 1567, __pyx_L3_error)
14247 if (unlikely(kw_args > 0)) {
14248 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"outer_pow") < 0)) __PYX_ERR(0, 1567, __pyx_L3_error)
14250 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
14251 goto __pyx_L5_argtuple_error;
14253 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14254 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14256 __pyx_v_obj = values[0];
14257 __pyx_v_m = values[1];
14259 goto __pyx_L4_argument_unpacking_done;
14260 __pyx_L5_argtuple_error:;
14261 __Pyx_RaiseArgtupleInvalid(
"outer_pow", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1567, __pyx_L3_error)
14263 __Pyx_AddTraceback(
"PyClical.outer_pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
14264 __Pyx_RefNannyFinishContext();
14266 __pyx_L4_argument_unpacking_done:;
14267 __pyx_r = __pyx_pf_8PyClical_46outer_pow(__pyx_self, __pyx_v_obj, __pyx_v_m);
14270 __Pyx_RefNannyFinishContext();
14274 static PyObject *__pyx_pf_8PyClical_46outer_pow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_m) {
14275 PyObject *__pyx_r = NULL;
14276 __Pyx_RefNannyDeclarations
14277 PyObject *__pyx_t_1 = NULL;
14278 int __pyx_lineno = 0;
14279 const char *__pyx_filename = NULL;
14280 int __pyx_clineno = 0;
14281 __Pyx_RefNannySetupContext(
"outer_pow", 0);
14282 __Pyx_XDECREF(__pyx_r);
14283 __pyx_t_1 = __pyx_f_8PyClical_outer_pow(__pyx_v_obj, __pyx_v_m, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1567, __pyx_L1_error)
14284 __Pyx_GOTREF(__pyx_t_1);
14285 __pyx_r = __pyx_t_1;
14291 __Pyx_XDECREF(__pyx_t_1);
14292 __Pyx_AddTraceback(
"PyClical.outer_pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
14295 __Pyx_XGIVEREF(__pyx_r);
14296 __Pyx_RefNannyFinishContext();
14308 static PyObject *__pyx_pw_8PyClical_49complexifier(PyObject *__pyx_self, PyObject *__pyx_v_obj);
14309 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_complexifier(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
14310 PyObject *__pyx_r = NULL;
14311 __Pyx_RefNannyDeclarations
14312 PyObject *__pyx_t_1 = NULL;
14313 PyObject *__pyx_t_2 = NULL;
14314 int __pyx_lineno = 0;
14315 const char *__pyx_filename = NULL;
14316 int __pyx_clineno = 0;
14317 __Pyx_RefNannySetupContext(
"complexifier", 0);
14326 __Pyx_XDECREF(__pyx_r);
14327 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1589, __pyx_L1_error)
14328 __Pyx_GOTREF(__pyx_t_1);
14329 __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, 1589, __pyx_L1_error)
14330 __Pyx_GOTREF(__pyx_t_2);
14331 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14332 __pyx_r = __pyx_t_2;
14346 __Pyx_XDECREF(__pyx_t_1);
14347 __Pyx_XDECREF(__pyx_t_2);
14348 __Pyx_AddTraceback(
"PyClical.complexifier", __pyx_clineno, __pyx_lineno, __pyx_filename);
14351 __Pyx_XGIVEREF(__pyx_r);
14352 __Pyx_RefNannyFinishContext();
14357 static PyObject *__pyx_pw_8PyClical_49complexifier(PyObject *__pyx_self, PyObject *__pyx_v_obj);
14358 static char __pyx_doc_8PyClical_48complexifier[] =
"\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 ";
14359 static PyObject *__pyx_pw_8PyClical_49complexifier(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
14360 PyObject *__pyx_r = 0;
14361 __Pyx_RefNannyDeclarations
14362 __Pyx_RefNannySetupContext(
"complexifier (wrapper)", 0);
14363 __pyx_r = __pyx_pf_8PyClical_48complexifier(__pyx_self, ((PyObject *)__pyx_v_obj));
14366 __Pyx_RefNannyFinishContext();
14370 static PyObject *__pyx_pf_8PyClical_48complexifier(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
14371 PyObject *__pyx_r = NULL;
14372 __Pyx_RefNannyDeclarations
14373 PyObject *__pyx_t_1 = NULL;
14374 int __pyx_lineno = 0;
14375 const char *__pyx_filename = NULL;
14376 int __pyx_clineno = 0;
14377 __Pyx_RefNannySetupContext(
"complexifier", 0);
14378 __Pyx_XDECREF(__pyx_r);
14379 __pyx_t_1 = __pyx_f_8PyClical_complexifier(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1576, __pyx_L1_error)
14380 __Pyx_GOTREF(__pyx_t_1);
14381 __pyx_r = __pyx_t_1;
14387 __Pyx_XDECREF(__pyx_t_1);
14388 __Pyx_AddTraceback(
"PyClical.complexifier", __pyx_clineno, __pyx_lineno, __pyx_filename);
14391 __Pyx_XGIVEREF(__pyx_r);
14392 __Pyx_RefNannyFinishContext();
14404 static PyObject *__pyx_pw_8PyClical_51sqrt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14405 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) {
14406 PyObject *__pyx_v_i = ((PyObject *)Py_None);
14407 PyObject *__pyx_r = NULL;
14408 __Pyx_RefNannyDeclarations
14411 PyObject *__pyx_t_3 = NULL;
14413 PyObject *__pyx_t_5 = NULL;
14414 PyObject *__pyx_t_6 = NULL;
14415 PyObject *__pyx_t_7 = NULL;
14416 PyObject *__pyx_t_8 = NULL;
14417 PyObject *__pyx_t_9 = NULL;
14418 PyObject *__pyx_t_10 = NULL;
14419 PyObject *__pyx_t_11 = NULL;
14420 int __pyx_lineno = 0;
14421 const char *__pyx_filename = NULL;
14422 int __pyx_clineno = 0;
14423 __Pyx_RefNannySetupContext(
"sqrt", 0);
14424 if (__pyx_optional_args) {
14425 if (__pyx_optional_args->__pyx_n > 0) {
14426 __pyx_v_i = __pyx_optional_args->i;
14437 __pyx_t_1 = (__pyx_v_i != Py_None);
14438 __pyx_t_2 = (__pyx_t_1 != 0);
14448 __Pyx_XDECREF(__pyx_r);
14449 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1607, __pyx_L1_error)
14450 __Pyx_GOTREF(__pyx_t_3);
14452 __pyx_t_4 =
sqrt(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
14454 __Pyx_CppExn2PyErr();
14455 __PYX_ERR(0, 1607, __pyx_L1_error)
14457 __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, 1607, __pyx_L1_error)
14458 __Pyx_GOTREF(__pyx_t_5);
14459 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14460 __pyx_r = __pyx_t_5;
14482 __Pyx_PyThreadState_declare
14483 __Pyx_PyThreadState_assign
14484 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
14485 __Pyx_XGOTREF(__pyx_t_6);
14486 __Pyx_XGOTREF(__pyx_t_7);
14487 __Pyx_XGOTREF(__pyx_t_8);
14497 __Pyx_XDECREF(__pyx_r);
14498 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1610, __pyx_L4_error)
14499 __Pyx_GOTREF(__pyx_t_3);
14500 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sqrt);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1610, __pyx_L4_error)
14501 __Pyx_GOTREF(__pyx_t_9);
14502 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14504 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
14505 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
14506 if (likely(__pyx_t_3)) {
14507 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
14508 __Pyx_INCREF(__pyx_t_3);
14509 __Pyx_INCREF(
function);
14510 __Pyx_DECREF_SET(__pyx_t_9,
function);
14513 __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_3, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
14514 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14515 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1610, __pyx_L4_error)
14516 __Pyx_GOTREF(__pyx_t_5);
14517 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14518 __pyx_r = __pyx_t_5;
14520 goto __pyx_L8_try_return;
14531 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14532 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14533 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
14543 __Pyx_AddTraceback(
"PyClical.sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename);
14544 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1611, __pyx_L6_except_error)
14545 __Pyx_GOTREF(__pyx_t_5);
14546 __Pyx_GOTREF(__pyx_t_9);
14547 __Pyx_GOTREF(__pyx_t_3);
14556 __Pyx_XDECREF(__pyx_r);
14557 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1612, __pyx_L6_except_error)
14558 __Pyx_GOTREF(__pyx_t_10);
14559 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_10),
sqrt(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1612, __pyx_L6_except_error)
14560 __Pyx_GOTREF(__pyx_t_11);
14561 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14562 __pyx_r = __pyx_t_11;
14564 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14565 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14566 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14567 goto __pyx_L7_except_return;
14569 __pyx_L6_except_error:;
14578 __Pyx_XGIVEREF(__pyx_t_6);
14579 __Pyx_XGIVEREF(__pyx_t_7);
14580 __Pyx_XGIVEREF(__pyx_t_8);
14581 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14582 goto __pyx_L1_error;
14583 __pyx_L8_try_return:;
14584 __Pyx_XGIVEREF(__pyx_t_6);
14585 __Pyx_XGIVEREF(__pyx_t_7);
14586 __Pyx_XGIVEREF(__pyx_t_8);
14587 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14589 __pyx_L7_except_return:;
14590 __Pyx_XGIVEREF(__pyx_t_6);
14591 __Pyx_XGIVEREF(__pyx_t_7);
14592 __Pyx_XGIVEREF(__pyx_t_8);
14593 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14608 __Pyx_XDECREF(__pyx_t_3);
14609 __Pyx_XDECREF(__pyx_t_5);
14610 __Pyx_XDECREF(__pyx_t_9);
14611 __Pyx_XDECREF(__pyx_t_10);
14612 __Pyx_XDECREF(__pyx_t_11);
14613 __Pyx_AddTraceback(
"PyClical.sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename);
14616 __Pyx_XGIVEREF(__pyx_r);
14617 __Pyx_RefNannyFinishContext();
14622 static PyObject *__pyx_pw_8PyClical_51sqrt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14623 static char __pyx_doc_8PyClical_50sqrt[] =
"\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 ";
14624 static PyObject *__pyx_pw_8PyClical_51sqrt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14625 PyObject *__pyx_v_obj = 0;
14626 PyObject *__pyx_v_i = 0;
14627 int __pyx_lineno = 0;
14628 const char *__pyx_filename = NULL;
14629 int __pyx_clineno = 0;
14630 PyObject *__pyx_r = 0;
14631 __Pyx_RefNannyDeclarations
14632 __Pyx_RefNannySetupContext(
"sqrt (wrapper)", 0);
14634 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
14635 PyObject* values[2] = {0,0};
14636 values[1] = ((PyObject *)Py_None);
14637 if (unlikely(__pyx_kwds)) {
14638 Py_ssize_t kw_args;
14639 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14640 switch (pos_args) {
14641 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14642 CYTHON_FALLTHROUGH;
14643 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14644 CYTHON_FALLTHROUGH;
14646 default:
goto __pyx_L5_argtuple_error;
14648 kw_args = PyDict_Size(__pyx_kwds);
14649 switch (pos_args) {
14651 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
14652 else goto __pyx_L5_argtuple_error;
14653 CYTHON_FALLTHROUGH;
14656 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
14657 if (value) { values[1] = value; kw_args--; }
14660 if (unlikely(kw_args > 0)) {
14661 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"sqrt") < 0)) __PYX_ERR(0, 1591, __pyx_L3_error)
14664 switch (PyTuple_GET_SIZE(__pyx_args)) {
14665 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14666 CYTHON_FALLTHROUGH;
14667 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14669 default:
goto __pyx_L5_argtuple_error;
14672 __pyx_v_obj = values[0];
14673 __pyx_v_i = values[1];
14675 goto __pyx_L4_argument_unpacking_done;
14676 __pyx_L5_argtuple_error:;
14677 __Pyx_RaiseArgtupleInvalid(
"sqrt", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1591, __pyx_L3_error)
14679 __Pyx_AddTraceback(
"PyClical.sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename);
14680 __Pyx_RefNannyFinishContext();
14682 __pyx_L4_argument_unpacking_done:;
14683 __pyx_r = __pyx_pf_8PyClical_50sqrt(__pyx_self, __pyx_v_obj, __pyx_v_i);
14686 __Pyx_RefNannyFinishContext();
14690 static PyObject *__pyx_pf_8PyClical_50sqrt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
14691 PyObject *__pyx_r = NULL;
14692 __Pyx_RefNannyDeclarations
14693 PyObject *__pyx_t_1 = NULL;
14694 struct __pyx_opt_args_8PyClical_sqrt __pyx_t_2;
14695 int __pyx_lineno = 0;
14696 const char *__pyx_filename = NULL;
14697 int __pyx_clineno = 0;
14698 __Pyx_RefNannySetupContext(
"sqrt", 0);
14699 __Pyx_XDECREF(__pyx_r);
14700 __pyx_t_2.__pyx_n = 1;
14701 __pyx_t_2.i = __pyx_v_i;
14702 __pyx_t_1 = __pyx_f_8PyClical_sqrt(__pyx_v_obj, 0, &__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1591, __pyx_L1_error)
14703 __Pyx_GOTREF(__pyx_t_1);
14704 __pyx_r = __pyx_t_1;
14710 __Pyx_XDECREF(__pyx_t_1);
14711 __Pyx_AddTraceback(
"PyClical.sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename);
14714 __Pyx_XGIVEREF(__pyx_r);
14715 __Pyx_RefNannyFinishContext();
14727 static PyObject *__pyx_pw_8PyClical_53exp(PyObject *__pyx_self, PyObject *__pyx_v_obj);
14728 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_exp(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
14729 PyObject *__pyx_r = NULL;
14730 __Pyx_RefNannyDeclarations
14731 PyObject *__pyx_t_1 = NULL;
14732 PyObject *__pyx_t_2 = NULL;
14733 PyObject *__pyx_t_3 = NULL;
14734 PyObject *__pyx_t_4 = NULL;
14735 PyObject *__pyx_t_5 = NULL;
14736 PyObject *__pyx_t_6 = NULL;
14737 PyObject *__pyx_t_7 = NULL;
14738 PyObject *__pyx_t_8 = NULL;
14739 int __pyx_lineno = 0;
14740 const char *__pyx_filename = NULL;
14741 int __pyx_clineno = 0;
14742 __Pyx_RefNannySetupContext(
"exp", 0);
14752 __Pyx_PyThreadState_declare
14753 __Pyx_PyThreadState_assign
14754 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
14755 __Pyx_XGOTREF(__pyx_t_1);
14756 __Pyx_XGOTREF(__pyx_t_2);
14757 __Pyx_XGOTREF(__pyx_t_3);
14767 __Pyx_XDECREF(__pyx_r);
14768 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1624, __pyx_L3_error)
14769 __Pyx_GOTREF(__pyx_t_5);
14770 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_exp);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1624, __pyx_L3_error)
14771 __Pyx_GOTREF(__pyx_t_6);
14772 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14774 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
14775 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
14776 if (likely(__pyx_t_5)) {
14777 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
14778 __Pyx_INCREF(__pyx_t_5);
14779 __Pyx_INCREF(
function);
14780 __Pyx_DECREF_SET(__pyx_t_6,
function);
14783 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_obj);
14784 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14785 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1624, __pyx_L3_error)
14786 __Pyx_GOTREF(__pyx_t_4);
14787 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14788 __pyx_r = __pyx_t_4;
14790 goto __pyx_L7_try_return;
14801 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
14802 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14803 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
14813 __Pyx_AddTraceback(
"PyClical.exp", __pyx_clineno, __pyx_lineno, __pyx_filename);
14814 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(0, 1625, __pyx_L5_except_error)
14815 __Pyx_GOTREF(__pyx_t_4);
14816 __Pyx_GOTREF(__pyx_t_6);
14817 __Pyx_GOTREF(__pyx_t_5);
14826 __Pyx_XDECREF(__pyx_r);
14827 __pyx_t_7 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1626, __pyx_L5_except_error)
14828 __Pyx_GOTREF(__pyx_t_7);
14829 __pyx_t_8 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_7),
exp(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1626, __pyx_L5_except_error)
14830 __Pyx_GOTREF(__pyx_t_8);
14831 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14832 __pyx_r = __pyx_t_8;
14834 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14835 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14836 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14837 goto __pyx_L6_except_return;
14839 __pyx_L5_except_error:;
14848 __Pyx_XGIVEREF(__pyx_t_1);
14849 __Pyx_XGIVEREF(__pyx_t_2);
14850 __Pyx_XGIVEREF(__pyx_t_3);
14851 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
14852 goto __pyx_L1_error;
14853 __pyx_L7_try_return:;
14854 __Pyx_XGIVEREF(__pyx_t_1);
14855 __Pyx_XGIVEREF(__pyx_t_2);
14856 __Pyx_XGIVEREF(__pyx_t_3);
14857 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
14859 __pyx_L6_except_return:;
14860 __Pyx_XGIVEREF(__pyx_t_1);
14861 __Pyx_XGIVEREF(__pyx_t_2);
14862 __Pyx_XGIVEREF(__pyx_t_3);
14863 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
14877 __Pyx_XDECREF(__pyx_t_4);
14878 __Pyx_XDECREF(__pyx_t_5);
14879 __Pyx_XDECREF(__pyx_t_6);
14880 __Pyx_XDECREF(__pyx_t_7);
14881 __Pyx_XDECREF(__pyx_t_8);
14882 __Pyx_AddTraceback(
"PyClical.exp", __pyx_clineno, __pyx_lineno, __pyx_filename);
14885 __Pyx_XGIVEREF(__pyx_r);
14886 __Pyx_RefNannyFinishContext();
14891 static PyObject *__pyx_pw_8PyClical_53exp(PyObject *__pyx_self, PyObject *__pyx_v_obj);
14892 static char __pyx_doc_8PyClical_52exp[] =
"\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 ";
14893 static PyObject *__pyx_pw_8PyClical_53exp(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
14894 PyObject *__pyx_r = 0;
14895 __Pyx_RefNannyDeclarations
14896 __Pyx_RefNannySetupContext(
"exp (wrapper)", 0);
14897 __pyx_r = __pyx_pf_8PyClical_52exp(__pyx_self, ((PyObject *)__pyx_v_obj));
14900 __Pyx_RefNannyFinishContext();
14904 static PyObject *__pyx_pf_8PyClical_52exp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
14905 PyObject *__pyx_r = NULL;
14906 __Pyx_RefNannyDeclarations
14907 PyObject *__pyx_t_1 = NULL;
14908 int __pyx_lineno = 0;
14909 const char *__pyx_filename = NULL;
14910 int __pyx_clineno = 0;
14911 __Pyx_RefNannySetupContext(
"exp", 0);
14912 __Pyx_XDECREF(__pyx_r);
14913 __pyx_t_1 = __pyx_f_8PyClical_exp(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1614, __pyx_L1_error)
14914 __Pyx_GOTREF(__pyx_t_1);
14915 __pyx_r = __pyx_t_1;
14921 __Pyx_XDECREF(__pyx_t_1);
14922 __Pyx_AddTraceback(
"PyClical.exp", __pyx_clineno, __pyx_lineno, __pyx_filename);
14925 __Pyx_XGIVEREF(__pyx_r);
14926 __Pyx_RefNannyFinishContext();
14938 static PyObject *__pyx_pw_8PyClical_55log(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14939 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) {
14940 PyObject *__pyx_v_i = ((PyObject *)Py_None);
14941 PyObject *__pyx_r = NULL;
14942 __Pyx_RefNannyDeclarations
14945 PyObject *__pyx_t_3 = NULL;
14947 PyObject *__pyx_t_5 = NULL;
14948 PyObject *__pyx_t_6 = NULL;
14949 PyObject *__pyx_t_7 = NULL;
14950 PyObject *__pyx_t_8 = NULL;
14951 PyObject *__pyx_t_9 = NULL;
14952 PyObject *__pyx_t_10 = NULL;
14953 PyObject *__pyx_t_11 = NULL;
14954 int __pyx_lineno = 0;
14955 const char *__pyx_filename = NULL;
14956 int __pyx_clineno = 0;
14957 __Pyx_RefNannySetupContext(
"log", 0);
14958 if (__pyx_optional_args) {
14959 if (__pyx_optional_args->__pyx_n > 0) {
14960 __pyx_v_i = __pyx_optional_args->i;
14971 __pyx_t_1 = (__pyx_v_i != Py_None);
14972 __pyx_t_2 = (__pyx_t_1 != 0);
14982 __Pyx_XDECREF(__pyx_r);
14983 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1644, __pyx_L1_error)
14984 __Pyx_GOTREF(__pyx_t_3);
14986 __pyx_t_4 =
log(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
14988 __Pyx_CppExn2PyErr();
14989 __PYX_ERR(0, 1644, __pyx_L1_error)
14991 __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, 1644, __pyx_L1_error)
14992 __Pyx_GOTREF(__pyx_t_5);
14993 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14994 __pyx_r = __pyx_t_5;
15016 __Pyx_PyThreadState_declare
15017 __Pyx_PyThreadState_assign
15018 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
15019 __Pyx_XGOTREF(__pyx_t_6);
15020 __Pyx_XGOTREF(__pyx_t_7);
15021 __Pyx_XGOTREF(__pyx_t_8);
15031 __Pyx_XDECREF(__pyx_r);
15032 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1647, __pyx_L4_error)
15033 __Pyx_GOTREF(__pyx_t_3);
15034 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_log);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1647, __pyx_L4_error)
15035 __Pyx_GOTREF(__pyx_t_9);
15036 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15038 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
15039 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
15040 if (likely(__pyx_t_3)) {
15041 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
15042 __Pyx_INCREF(__pyx_t_3);
15043 __Pyx_INCREF(
function);
15044 __Pyx_DECREF_SET(__pyx_t_9,
function);
15047 __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_3, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
15048 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15049 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1647, __pyx_L4_error)
15050 __Pyx_GOTREF(__pyx_t_5);
15051 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15052 __pyx_r = __pyx_t_5;
15054 goto __pyx_L8_try_return;
15065 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15066 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15067 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
15077 __Pyx_AddTraceback(
"PyClical.log", __pyx_clineno, __pyx_lineno, __pyx_filename);
15078 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1648, __pyx_L6_except_error)
15079 __Pyx_GOTREF(__pyx_t_5);
15080 __Pyx_GOTREF(__pyx_t_9);
15081 __Pyx_GOTREF(__pyx_t_3);
15090 __Pyx_XDECREF(__pyx_r);
15091 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1649, __pyx_L6_except_error)
15092 __Pyx_GOTREF(__pyx_t_10);
15093 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_10),
log(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1649, __pyx_L6_except_error)
15094 __Pyx_GOTREF(__pyx_t_11);
15095 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15096 __pyx_r = __pyx_t_11;
15098 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15099 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15100 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15101 goto __pyx_L7_except_return;
15103 __pyx_L6_except_error:;
15112 __Pyx_XGIVEREF(__pyx_t_6);
15113 __Pyx_XGIVEREF(__pyx_t_7);
15114 __Pyx_XGIVEREF(__pyx_t_8);
15115 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15116 goto __pyx_L1_error;
15117 __pyx_L8_try_return:;
15118 __Pyx_XGIVEREF(__pyx_t_6);
15119 __Pyx_XGIVEREF(__pyx_t_7);
15120 __Pyx_XGIVEREF(__pyx_t_8);
15121 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15123 __pyx_L7_except_return:;
15124 __Pyx_XGIVEREF(__pyx_t_6);
15125 __Pyx_XGIVEREF(__pyx_t_7);
15126 __Pyx_XGIVEREF(__pyx_t_8);
15127 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15142 __Pyx_XDECREF(__pyx_t_3);
15143 __Pyx_XDECREF(__pyx_t_5);
15144 __Pyx_XDECREF(__pyx_t_9);
15145 __Pyx_XDECREF(__pyx_t_10);
15146 __Pyx_XDECREF(__pyx_t_11);
15147 __Pyx_AddTraceback(
"PyClical.log", __pyx_clineno, __pyx_lineno, __pyx_filename);
15150 __Pyx_XGIVEREF(__pyx_r);
15151 __Pyx_RefNannyFinishContext();
15156 static PyObject *__pyx_pw_8PyClical_55log(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15157 static char __pyx_doc_8PyClical_54log[] =
"\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 ";
15158 static PyObject *__pyx_pw_8PyClical_55log(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15159 PyObject *__pyx_v_obj = 0;
15160 PyObject *__pyx_v_i = 0;
15161 int __pyx_lineno = 0;
15162 const char *__pyx_filename = NULL;
15163 int __pyx_clineno = 0;
15164 PyObject *__pyx_r = 0;
15165 __Pyx_RefNannyDeclarations
15166 __Pyx_RefNannySetupContext(
"log (wrapper)", 0);
15168 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
15169 PyObject* values[2] = {0,0};
15170 values[1] = ((PyObject *)Py_None);
15171 if (unlikely(__pyx_kwds)) {
15172 Py_ssize_t kw_args;
15173 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15174 switch (pos_args) {
15175 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15176 CYTHON_FALLTHROUGH;
15177 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15178 CYTHON_FALLTHROUGH;
15180 default:
goto __pyx_L5_argtuple_error;
15182 kw_args = PyDict_Size(__pyx_kwds);
15183 switch (pos_args) {
15185 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
15186 else goto __pyx_L5_argtuple_error;
15187 CYTHON_FALLTHROUGH;
15190 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
15191 if (value) { values[1] = value; kw_args--; }
15194 if (unlikely(kw_args > 0)) {
15195 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"log") < 0)) __PYX_ERR(0, 1628, __pyx_L3_error)
15198 switch (PyTuple_GET_SIZE(__pyx_args)) {
15199 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15200 CYTHON_FALLTHROUGH;
15201 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15203 default:
goto __pyx_L5_argtuple_error;
15206 __pyx_v_obj = values[0];
15207 __pyx_v_i = values[1];
15209 goto __pyx_L4_argument_unpacking_done;
15210 __pyx_L5_argtuple_error:;
15211 __Pyx_RaiseArgtupleInvalid(
"log", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1628, __pyx_L3_error)
15213 __Pyx_AddTraceback(
"PyClical.log", __pyx_clineno, __pyx_lineno, __pyx_filename);
15214 __Pyx_RefNannyFinishContext();
15216 __pyx_L4_argument_unpacking_done:;
15217 __pyx_r = __pyx_pf_8PyClical_54log(__pyx_self, __pyx_v_obj, __pyx_v_i);
15220 __Pyx_RefNannyFinishContext();
15224 static PyObject *__pyx_pf_8PyClical_54log(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
15225 PyObject *__pyx_r = NULL;
15226 __Pyx_RefNannyDeclarations
15227 PyObject *__pyx_t_1 = NULL;
15228 struct __pyx_opt_args_8PyClical_log __pyx_t_2;
15229 int __pyx_lineno = 0;
15230 const char *__pyx_filename = NULL;
15231 int __pyx_clineno = 0;
15232 __Pyx_RefNannySetupContext(
"log", 0);
15233 __Pyx_XDECREF(__pyx_r);
15234 __pyx_t_2.__pyx_n = 1;
15235 __pyx_t_2.i = __pyx_v_i;
15236 __pyx_t_1 = __pyx_f_8PyClical_log(__pyx_v_obj, 0, &__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1628, __pyx_L1_error)
15237 __Pyx_GOTREF(__pyx_t_1);
15238 __pyx_r = __pyx_t_1;
15244 __Pyx_XDECREF(__pyx_t_1);
15245 __Pyx_AddTraceback(
"PyClical.log", __pyx_clineno, __pyx_lineno, __pyx_filename);
15248 __Pyx_XGIVEREF(__pyx_r);
15249 __Pyx_RefNannyFinishContext();
15261 static PyObject *__pyx_pw_8PyClical_57cos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15262 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) {
15263 PyObject *__pyx_v_i = ((PyObject *)Py_None);
15264 PyObject *__pyx_r = NULL;
15265 __Pyx_RefNannyDeclarations
15268 PyObject *__pyx_t_3 = NULL;
15270 PyObject *__pyx_t_5 = NULL;
15271 PyObject *__pyx_t_6 = NULL;
15272 PyObject *__pyx_t_7 = NULL;
15273 PyObject *__pyx_t_8 = NULL;
15274 PyObject *__pyx_t_9 = NULL;
15275 PyObject *__pyx_t_10 = NULL;
15276 PyObject *__pyx_t_11 = NULL;
15277 int __pyx_lineno = 0;
15278 const char *__pyx_filename = NULL;
15279 int __pyx_clineno = 0;
15280 __Pyx_RefNannySetupContext(
"cos", 0);
15281 if (__pyx_optional_args) {
15282 if (__pyx_optional_args->__pyx_n > 0) {
15283 __pyx_v_i = __pyx_optional_args->i;
15294 __pyx_t_1 = (__pyx_v_i != Py_None);
15295 __pyx_t_2 = (__pyx_t_1 != 0);
15305 __Pyx_XDECREF(__pyx_r);
15306 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1661, __pyx_L1_error)
15307 __Pyx_GOTREF(__pyx_t_3);
15309 __pyx_t_4 =
cos(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
15311 __Pyx_CppExn2PyErr();
15312 __PYX_ERR(0, 1661, __pyx_L1_error)
15314 __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, 1661, __pyx_L1_error)
15315 __Pyx_GOTREF(__pyx_t_5);
15316 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15317 __pyx_r = __pyx_t_5;
15339 __Pyx_PyThreadState_declare
15340 __Pyx_PyThreadState_assign
15341 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
15342 __Pyx_XGOTREF(__pyx_t_6);
15343 __Pyx_XGOTREF(__pyx_t_7);
15344 __Pyx_XGOTREF(__pyx_t_8);
15354 __Pyx_XDECREF(__pyx_r);
15355 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1664, __pyx_L4_error)
15356 __Pyx_GOTREF(__pyx_t_3);
15357 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_cos);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1664, __pyx_L4_error)
15358 __Pyx_GOTREF(__pyx_t_9);
15359 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15361 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
15362 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
15363 if (likely(__pyx_t_3)) {
15364 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
15365 __Pyx_INCREF(__pyx_t_3);
15366 __Pyx_INCREF(
function);
15367 __Pyx_DECREF_SET(__pyx_t_9,
function);
15370 __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_3, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
15371 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15372 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1664, __pyx_L4_error)
15373 __Pyx_GOTREF(__pyx_t_5);
15374 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15375 __pyx_r = __pyx_t_5;
15377 goto __pyx_L8_try_return;
15388 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15389 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15390 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
15400 __Pyx_AddTraceback(
"PyClical.cos", __pyx_clineno, __pyx_lineno, __pyx_filename);
15401 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1665, __pyx_L6_except_error)
15402 __Pyx_GOTREF(__pyx_t_5);
15403 __Pyx_GOTREF(__pyx_t_9);
15404 __Pyx_GOTREF(__pyx_t_3);
15413 __Pyx_XDECREF(__pyx_r);
15414 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1666, __pyx_L6_except_error)
15415 __Pyx_GOTREF(__pyx_t_10);
15416 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_10),
cos(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1666, __pyx_L6_except_error)
15417 __Pyx_GOTREF(__pyx_t_11);
15418 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15419 __pyx_r = __pyx_t_11;
15421 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15422 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15423 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15424 goto __pyx_L7_except_return;
15426 __pyx_L6_except_error:;
15435 __Pyx_XGIVEREF(__pyx_t_6);
15436 __Pyx_XGIVEREF(__pyx_t_7);
15437 __Pyx_XGIVEREF(__pyx_t_8);
15438 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15439 goto __pyx_L1_error;
15440 __pyx_L8_try_return:;
15441 __Pyx_XGIVEREF(__pyx_t_6);
15442 __Pyx_XGIVEREF(__pyx_t_7);
15443 __Pyx_XGIVEREF(__pyx_t_8);
15444 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15446 __pyx_L7_except_return:;
15447 __Pyx_XGIVEREF(__pyx_t_6);
15448 __Pyx_XGIVEREF(__pyx_t_7);
15449 __Pyx_XGIVEREF(__pyx_t_8);
15450 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15465 __Pyx_XDECREF(__pyx_t_3);
15466 __Pyx_XDECREF(__pyx_t_5);
15467 __Pyx_XDECREF(__pyx_t_9);
15468 __Pyx_XDECREF(__pyx_t_10);
15469 __Pyx_XDECREF(__pyx_t_11);
15470 __Pyx_AddTraceback(
"PyClical.cos", __pyx_clineno, __pyx_lineno, __pyx_filename);
15473 __Pyx_XGIVEREF(__pyx_r);
15474 __Pyx_RefNannyFinishContext();
15479 static PyObject *__pyx_pw_8PyClical_57cos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15480 static char __pyx_doc_8PyClical_56cos[] =
"\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 ";
15481 static PyObject *__pyx_pw_8PyClical_57cos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15482 PyObject *__pyx_v_obj = 0;
15483 PyObject *__pyx_v_i = 0;
15484 int __pyx_lineno = 0;
15485 const char *__pyx_filename = NULL;
15486 int __pyx_clineno = 0;
15487 PyObject *__pyx_r = 0;
15488 __Pyx_RefNannyDeclarations
15489 __Pyx_RefNannySetupContext(
"cos (wrapper)", 0);
15491 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
15492 PyObject* values[2] = {0,0};
15493 values[1] = ((PyObject *)Py_None);
15494 if (unlikely(__pyx_kwds)) {
15495 Py_ssize_t kw_args;
15496 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15497 switch (pos_args) {
15498 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15499 CYTHON_FALLTHROUGH;
15500 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15501 CYTHON_FALLTHROUGH;
15503 default:
goto __pyx_L5_argtuple_error;
15505 kw_args = PyDict_Size(__pyx_kwds);
15506 switch (pos_args) {
15508 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
15509 else goto __pyx_L5_argtuple_error;
15510 CYTHON_FALLTHROUGH;
15513 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
15514 if (value) { values[1] = value; kw_args--; }
15517 if (unlikely(kw_args > 0)) {
15518 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"cos") < 0)) __PYX_ERR(0, 1651, __pyx_L3_error)
15521 switch (PyTuple_GET_SIZE(__pyx_args)) {
15522 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15523 CYTHON_FALLTHROUGH;
15524 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15526 default:
goto __pyx_L5_argtuple_error;
15529 __pyx_v_obj = values[0];
15530 __pyx_v_i = values[1];
15532 goto __pyx_L4_argument_unpacking_done;
15533 __pyx_L5_argtuple_error:;
15534 __Pyx_RaiseArgtupleInvalid(
"cos", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1651, __pyx_L3_error)
15536 __Pyx_AddTraceback(
"PyClical.cos", __pyx_clineno, __pyx_lineno, __pyx_filename);
15537 __Pyx_RefNannyFinishContext();
15539 __pyx_L4_argument_unpacking_done:;
15540 __pyx_r = __pyx_pf_8PyClical_56cos(__pyx_self, __pyx_v_obj, __pyx_v_i);
15543 __Pyx_RefNannyFinishContext();
15547 static PyObject *__pyx_pf_8PyClical_56cos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
15548 PyObject *__pyx_r = NULL;
15549 __Pyx_RefNannyDeclarations
15550 PyObject *__pyx_t_1 = NULL;
15551 struct __pyx_opt_args_8PyClical_cos __pyx_t_2;
15552 int __pyx_lineno = 0;
15553 const char *__pyx_filename = NULL;
15554 int __pyx_clineno = 0;
15555 __Pyx_RefNannySetupContext(
"cos", 0);
15556 __Pyx_XDECREF(__pyx_r);
15557 __pyx_t_2.__pyx_n = 1;
15558 __pyx_t_2.i = __pyx_v_i;
15559 __pyx_t_1 = __pyx_f_8PyClical_cos(__pyx_v_obj, 0, &__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1651, __pyx_L1_error)
15560 __Pyx_GOTREF(__pyx_t_1);
15561 __pyx_r = __pyx_t_1;
15567 __Pyx_XDECREF(__pyx_t_1);
15568 __Pyx_AddTraceback(
"PyClical.cos", __pyx_clineno, __pyx_lineno, __pyx_filename);
15571 __Pyx_XGIVEREF(__pyx_r);
15572 __Pyx_RefNannyFinishContext();
15584 static PyObject *__pyx_pw_8PyClical_59acos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15585 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) {
15586 PyObject *__pyx_v_i = ((PyObject *)Py_None);
15587 PyObject *__pyx_r = NULL;
15588 __Pyx_RefNannyDeclarations
15591 PyObject *__pyx_t_3 = NULL;
15593 PyObject *__pyx_t_5 = NULL;
15594 PyObject *__pyx_t_6 = NULL;
15595 PyObject *__pyx_t_7 = NULL;
15596 PyObject *__pyx_t_8 = NULL;
15597 PyObject *__pyx_t_9 = NULL;
15598 PyObject *__pyx_t_10 = NULL;
15599 PyObject *__pyx_t_11 = NULL;
15600 int __pyx_lineno = 0;
15601 const char *__pyx_filename = NULL;
15602 int __pyx_clineno = 0;
15603 __Pyx_RefNannySetupContext(
"acos", 0);
15604 if (__pyx_optional_args) {
15605 if (__pyx_optional_args->__pyx_n > 0) {
15606 __pyx_v_i = __pyx_optional_args->i;
15617 __pyx_t_1 = (__pyx_v_i != Py_None);
15618 __pyx_t_2 = (__pyx_t_1 != 0);
15628 __Pyx_XDECREF(__pyx_r);
15629 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1682, __pyx_L1_error)
15630 __Pyx_GOTREF(__pyx_t_3);
15632 __pyx_t_4 =
acos(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
15634 __Pyx_CppExn2PyErr();
15635 __PYX_ERR(0, 1682, __pyx_L1_error)
15637 __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, 1682, __pyx_L1_error)
15638 __Pyx_GOTREF(__pyx_t_5);
15639 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15640 __pyx_r = __pyx_t_5;
15662 __Pyx_PyThreadState_declare
15663 __Pyx_PyThreadState_assign
15664 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
15665 __Pyx_XGOTREF(__pyx_t_6);
15666 __Pyx_XGOTREF(__pyx_t_7);
15667 __Pyx_XGOTREF(__pyx_t_8);
15677 __Pyx_XDECREF(__pyx_r);
15678 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1685, __pyx_L4_error)
15679 __Pyx_GOTREF(__pyx_t_3);
15680 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_acos);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1685, __pyx_L4_error)
15681 __Pyx_GOTREF(__pyx_t_9);
15682 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15684 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
15685 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
15686 if (likely(__pyx_t_3)) {
15687 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
15688 __Pyx_INCREF(__pyx_t_3);
15689 __Pyx_INCREF(
function);
15690 __Pyx_DECREF_SET(__pyx_t_9,
function);
15693 __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_3, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
15694 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15695 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1685, __pyx_L4_error)
15696 __Pyx_GOTREF(__pyx_t_5);
15697 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15698 __pyx_r = __pyx_t_5;
15700 goto __pyx_L8_try_return;
15711 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15712 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15713 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
15723 __Pyx_AddTraceback(
"PyClical.acos", __pyx_clineno, __pyx_lineno, __pyx_filename);
15724 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1686, __pyx_L6_except_error)
15725 __Pyx_GOTREF(__pyx_t_5);
15726 __Pyx_GOTREF(__pyx_t_9);
15727 __Pyx_GOTREF(__pyx_t_3);
15736 __Pyx_XDECREF(__pyx_r);
15737 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1687, __pyx_L6_except_error)
15738 __Pyx_GOTREF(__pyx_t_10);
15739 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_10),
acos(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1687, __pyx_L6_except_error)
15740 __Pyx_GOTREF(__pyx_t_11);
15741 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15742 __pyx_r = __pyx_t_11;
15744 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15745 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15746 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15747 goto __pyx_L7_except_return;
15749 __pyx_L6_except_error:;
15758 __Pyx_XGIVEREF(__pyx_t_6);
15759 __Pyx_XGIVEREF(__pyx_t_7);
15760 __Pyx_XGIVEREF(__pyx_t_8);
15761 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15762 goto __pyx_L1_error;
15763 __pyx_L8_try_return:;
15764 __Pyx_XGIVEREF(__pyx_t_6);
15765 __Pyx_XGIVEREF(__pyx_t_7);
15766 __Pyx_XGIVEREF(__pyx_t_8);
15767 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15769 __pyx_L7_except_return:;
15770 __Pyx_XGIVEREF(__pyx_t_6);
15771 __Pyx_XGIVEREF(__pyx_t_7);
15772 __Pyx_XGIVEREF(__pyx_t_8);
15773 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15788 __Pyx_XDECREF(__pyx_t_3);
15789 __Pyx_XDECREF(__pyx_t_5);
15790 __Pyx_XDECREF(__pyx_t_9);
15791 __Pyx_XDECREF(__pyx_t_10);
15792 __Pyx_XDECREF(__pyx_t_11);
15793 __Pyx_AddTraceback(
"PyClical.acos", __pyx_clineno, __pyx_lineno, __pyx_filename);
15796 __Pyx_XGIVEREF(__pyx_r);
15797 __Pyx_RefNannyFinishContext();
15802 static PyObject *__pyx_pw_8PyClical_59acos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15803 static char __pyx_doc_8PyClical_58acos[] =
"\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 ";
15804 static PyObject *__pyx_pw_8PyClical_59acos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15805 PyObject *__pyx_v_obj = 0;
15806 PyObject *__pyx_v_i = 0;
15807 int __pyx_lineno = 0;
15808 const char *__pyx_filename = NULL;
15809 int __pyx_clineno = 0;
15810 PyObject *__pyx_r = 0;
15811 __Pyx_RefNannyDeclarations
15812 __Pyx_RefNannySetupContext(
"acos (wrapper)", 0);
15814 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
15815 PyObject* values[2] = {0,0};
15816 values[1] = ((PyObject *)Py_None);
15817 if (unlikely(__pyx_kwds)) {
15818 Py_ssize_t kw_args;
15819 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15820 switch (pos_args) {
15821 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15822 CYTHON_FALLTHROUGH;
15823 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15824 CYTHON_FALLTHROUGH;
15826 default:
goto __pyx_L5_argtuple_error;
15828 kw_args = PyDict_Size(__pyx_kwds);
15829 switch (pos_args) {
15831 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
15832 else goto __pyx_L5_argtuple_error;
15833 CYTHON_FALLTHROUGH;
15836 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
15837 if (value) { values[1] = value; kw_args--; }
15840 if (unlikely(kw_args > 0)) {
15841 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"acos") < 0)) __PYX_ERR(0, 1668, __pyx_L3_error)
15844 switch (PyTuple_GET_SIZE(__pyx_args)) {
15845 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15846 CYTHON_FALLTHROUGH;
15847 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15849 default:
goto __pyx_L5_argtuple_error;
15852 __pyx_v_obj = values[0];
15853 __pyx_v_i = values[1];
15855 goto __pyx_L4_argument_unpacking_done;
15856 __pyx_L5_argtuple_error:;
15857 __Pyx_RaiseArgtupleInvalid(
"acos", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1668, __pyx_L3_error)
15859 __Pyx_AddTraceback(
"PyClical.acos", __pyx_clineno, __pyx_lineno, __pyx_filename);
15860 __Pyx_RefNannyFinishContext();
15862 __pyx_L4_argument_unpacking_done:;
15863 __pyx_r = __pyx_pf_8PyClical_58acos(__pyx_self, __pyx_v_obj, __pyx_v_i);
15866 __Pyx_RefNannyFinishContext();
15870 static PyObject *__pyx_pf_8PyClical_58acos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
15871 PyObject *__pyx_r = NULL;
15872 __Pyx_RefNannyDeclarations
15873 PyObject *__pyx_t_1 = NULL;
15874 struct __pyx_opt_args_8PyClical_acos __pyx_t_2;
15875 int __pyx_lineno = 0;
15876 const char *__pyx_filename = NULL;
15877 int __pyx_clineno = 0;
15878 __Pyx_RefNannySetupContext(
"acos", 0);
15879 __Pyx_XDECREF(__pyx_r);
15880 __pyx_t_2.__pyx_n = 1;
15881 __pyx_t_2.i = __pyx_v_i;
15882 __pyx_t_1 = __pyx_f_8PyClical_acos(__pyx_v_obj, 0, &__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1668, __pyx_L1_error)
15883 __Pyx_GOTREF(__pyx_t_1);
15884 __pyx_r = __pyx_t_1;
15890 __Pyx_XDECREF(__pyx_t_1);
15891 __Pyx_AddTraceback(
"PyClical.acos", __pyx_clineno, __pyx_lineno, __pyx_filename);
15894 __Pyx_XGIVEREF(__pyx_r);
15895 __Pyx_RefNannyFinishContext();
15907 static PyObject *__pyx_pw_8PyClical_61cosh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
15908 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cosh(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
15909 PyObject *__pyx_r = NULL;
15910 __Pyx_RefNannyDeclarations
15911 PyObject *__pyx_t_1 = NULL;
15912 PyObject *__pyx_t_2 = NULL;
15913 PyObject *__pyx_t_3 = NULL;
15914 PyObject *__pyx_t_4 = NULL;
15915 PyObject *__pyx_t_5 = NULL;
15916 PyObject *__pyx_t_6 = NULL;
15917 PyObject *__pyx_t_7 = NULL;
15918 PyObject *__pyx_t_8 = NULL;
15919 int __pyx_lineno = 0;
15920 const char *__pyx_filename = NULL;
15921 int __pyx_clineno = 0;
15922 __Pyx_RefNannySetupContext(
"cosh", 0);
15932 __Pyx_PyThreadState_declare
15933 __Pyx_PyThreadState_assign
15934 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
15935 __Pyx_XGOTREF(__pyx_t_1);
15936 __Pyx_XGOTREF(__pyx_t_2);
15937 __Pyx_XGOTREF(__pyx_t_3);
15947 __Pyx_XDECREF(__pyx_r);
15948 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1701, __pyx_L3_error)
15949 __Pyx_GOTREF(__pyx_t_5);
15950 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_cosh);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1701, __pyx_L3_error)
15951 __Pyx_GOTREF(__pyx_t_6);
15952 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15954 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
15955 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
15956 if (likely(__pyx_t_5)) {
15957 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
15958 __Pyx_INCREF(__pyx_t_5);
15959 __Pyx_INCREF(
function);
15960 __Pyx_DECREF_SET(__pyx_t_6,
function);
15963 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_obj);
15964 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15965 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1701, __pyx_L3_error)
15966 __Pyx_GOTREF(__pyx_t_4);
15967 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15968 __pyx_r = __pyx_t_4;
15970 goto __pyx_L7_try_return;
15981 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
15982 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15983 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
15993 __Pyx_AddTraceback(
"PyClical.cosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15994 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(0, 1702, __pyx_L5_except_error)
15995 __Pyx_GOTREF(__pyx_t_4);
15996 __Pyx_GOTREF(__pyx_t_6);
15997 __Pyx_GOTREF(__pyx_t_5);
16006 __Pyx_XDECREF(__pyx_r);
16007 __pyx_t_7 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1703, __pyx_L5_except_error)
16008 __Pyx_GOTREF(__pyx_t_7);
16009 __pyx_t_8 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_7),
cosh(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1703, __pyx_L5_except_error)
16010 __Pyx_GOTREF(__pyx_t_8);
16011 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16012 __pyx_r = __pyx_t_8;
16014 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16015 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16016 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16017 goto __pyx_L6_except_return;
16019 __pyx_L5_except_error:;
16028 __Pyx_XGIVEREF(__pyx_t_1);
16029 __Pyx_XGIVEREF(__pyx_t_2);
16030 __Pyx_XGIVEREF(__pyx_t_3);
16031 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
16032 goto __pyx_L1_error;
16033 __pyx_L7_try_return:;
16034 __Pyx_XGIVEREF(__pyx_t_1);
16035 __Pyx_XGIVEREF(__pyx_t_2);
16036 __Pyx_XGIVEREF(__pyx_t_3);
16037 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
16039 __pyx_L6_except_return:;
16040 __Pyx_XGIVEREF(__pyx_t_1);
16041 __Pyx_XGIVEREF(__pyx_t_2);
16042 __Pyx_XGIVEREF(__pyx_t_3);
16043 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
16057 __Pyx_XDECREF(__pyx_t_4);
16058 __Pyx_XDECREF(__pyx_t_5);
16059 __Pyx_XDECREF(__pyx_t_6);
16060 __Pyx_XDECREF(__pyx_t_7);
16061 __Pyx_XDECREF(__pyx_t_8);
16062 __Pyx_AddTraceback(
"PyClical.cosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16065 __Pyx_XGIVEREF(__pyx_r);
16066 __Pyx_RefNannyFinishContext();
16071 static PyObject *__pyx_pw_8PyClical_61cosh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
16072 static char __pyx_doc_8PyClical_60cosh[] =
"\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 ";
16073 static PyObject *__pyx_pw_8PyClical_61cosh(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
16074 PyObject *__pyx_r = 0;
16075 __Pyx_RefNannyDeclarations
16076 __Pyx_RefNannySetupContext(
"cosh (wrapper)", 0);
16077 __pyx_r = __pyx_pf_8PyClical_60cosh(__pyx_self, ((PyObject *)__pyx_v_obj));
16080 __Pyx_RefNannyFinishContext();
16084 static PyObject *__pyx_pf_8PyClical_60cosh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
16085 PyObject *__pyx_r = NULL;
16086 __Pyx_RefNannyDeclarations
16087 PyObject *__pyx_t_1 = NULL;
16088 int __pyx_lineno = 0;
16089 const char *__pyx_filename = NULL;
16090 int __pyx_clineno = 0;
16091 __Pyx_RefNannySetupContext(
"cosh", 0);
16092 __Pyx_XDECREF(__pyx_r);
16093 __pyx_t_1 = __pyx_f_8PyClical_cosh(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1689, __pyx_L1_error)
16094 __Pyx_GOTREF(__pyx_t_1);
16095 __pyx_r = __pyx_t_1;
16101 __Pyx_XDECREF(__pyx_t_1);
16102 __Pyx_AddTraceback(
"PyClical.cosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16105 __Pyx_XGIVEREF(__pyx_r);
16106 __Pyx_RefNannyFinishContext();
16118 static PyObject *__pyx_pw_8PyClical_63acosh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16119 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) {
16120 PyObject *__pyx_v_i = ((PyObject *)Py_None);
16121 PyObject *__pyx_r = NULL;
16122 __Pyx_RefNannyDeclarations
16125 PyObject *__pyx_t_3 = NULL;
16127 PyObject *__pyx_t_5 = NULL;
16128 PyObject *__pyx_t_6 = NULL;
16129 PyObject *__pyx_t_7 = NULL;
16130 PyObject *__pyx_t_8 = NULL;
16131 PyObject *__pyx_t_9 = NULL;
16132 PyObject *__pyx_t_10 = NULL;
16133 PyObject *__pyx_t_11 = NULL;
16134 int __pyx_lineno = 0;
16135 const char *__pyx_filename = NULL;
16136 int __pyx_clineno = 0;
16137 __Pyx_RefNannySetupContext(
"acosh", 0);
16138 if (__pyx_optional_args) {
16139 if (__pyx_optional_args->__pyx_n > 0) {
16140 __pyx_v_i = __pyx_optional_args->i;
16151 __pyx_t_1 = (__pyx_v_i != Py_None);
16152 __pyx_t_2 = (__pyx_t_1 != 0);
16162 __Pyx_XDECREF(__pyx_r);
16163 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1721, __pyx_L1_error)
16164 __Pyx_GOTREF(__pyx_t_3);
16166 __pyx_t_4 =
acosh(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
16168 __Pyx_CppExn2PyErr();
16169 __PYX_ERR(0, 1721, __pyx_L1_error)
16171 __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, 1721, __pyx_L1_error)
16172 __Pyx_GOTREF(__pyx_t_5);
16173 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16174 __pyx_r = __pyx_t_5;
16196 __Pyx_PyThreadState_declare
16197 __Pyx_PyThreadState_assign
16198 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
16199 __Pyx_XGOTREF(__pyx_t_6);
16200 __Pyx_XGOTREF(__pyx_t_7);
16201 __Pyx_XGOTREF(__pyx_t_8);
16211 __Pyx_XDECREF(__pyx_r);
16212 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1724, __pyx_L4_error)
16213 __Pyx_GOTREF(__pyx_t_3);
16214 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_acosh);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1724, __pyx_L4_error)
16215 __Pyx_GOTREF(__pyx_t_9);
16216 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16218 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
16219 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
16220 if (likely(__pyx_t_3)) {
16221 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
16222 __Pyx_INCREF(__pyx_t_3);
16223 __Pyx_INCREF(
function);
16224 __Pyx_DECREF_SET(__pyx_t_9,
function);
16227 __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_3, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
16228 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16229 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1724, __pyx_L4_error)
16230 __Pyx_GOTREF(__pyx_t_5);
16231 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16232 __pyx_r = __pyx_t_5;
16234 goto __pyx_L8_try_return;
16245 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16246 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16247 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
16257 __Pyx_AddTraceback(
"PyClical.acosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16258 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1725, __pyx_L6_except_error)
16259 __Pyx_GOTREF(__pyx_t_5);
16260 __Pyx_GOTREF(__pyx_t_9);
16261 __Pyx_GOTREF(__pyx_t_3);
16270 __Pyx_XDECREF(__pyx_r);
16271 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1726, __pyx_L6_except_error)
16272 __Pyx_GOTREF(__pyx_t_10);
16273 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_10),
acosh(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1726, __pyx_L6_except_error)
16274 __Pyx_GOTREF(__pyx_t_11);
16275 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16276 __pyx_r = __pyx_t_11;
16278 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16279 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16280 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16281 goto __pyx_L7_except_return;
16283 __pyx_L6_except_error:;
16292 __Pyx_XGIVEREF(__pyx_t_6);
16293 __Pyx_XGIVEREF(__pyx_t_7);
16294 __Pyx_XGIVEREF(__pyx_t_8);
16295 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16296 goto __pyx_L1_error;
16297 __pyx_L8_try_return:;
16298 __Pyx_XGIVEREF(__pyx_t_6);
16299 __Pyx_XGIVEREF(__pyx_t_7);
16300 __Pyx_XGIVEREF(__pyx_t_8);
16301 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16303 __pyx_L7_except_return:;
16304 __Pyx_XGIVEREF(__pyx_t_6);
16305 __Pyx_XGIVEREF(__pyx_t_7);
16306 __Pyx_XGIVEREF(__pyx_t_8);
16307 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16322 __Pyx_XDECREF(__pyx_t_3);
16323 __Pyx_XDECREF(__pyx_t_5);
16324 __Pyx_XDECREF(__pyx_t_9);
16325 __Pyx_XDECREF(__pyx_t_10);
16326 __Pyx_XDECREF(__pyx_t_11);
16327 __Pyx_AddTraceback(
"PyClical.acosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16330 __Pyx_XGIVEREF(__pyx_r);
16331 __Pyx_RefNannyFinishContext();
16336 static PyObject *__pyx_pw_8PyClical_63acosh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16337 static char __pyx_doc_8PyClical_62acosh[] =
"\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 ";
16338 static PyObject *__pyx_pw_8PyClical_63acosh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16339 PyObject *__pyx_v_obj = 0;
16340 PyObject *__pyx_v_i = 0;
16341 int __pyx_lineno = 0;
16342 const char *__pyx_filename = NULL;
16343 int __pyx_clineno = 0;
16344 PyObject *__pyx_r = 0;
16345 __Pyx_RefNannyDeclarations
16346 __Pyx_RefNannySetupContext(
"acosh (wrapper)", 0);
16348 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
16349 PyObject* values[2] = {0,0};
16350 values[1] = ((PyObject *)Py_None);
16351 if (unlikely(__pyx_kwds)) {
16352 Py_ssize_t kw_args;
16353 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16354 switch (pos_args) {
16355 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16356 CYTHON_FALLTHROUGH;
16357 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16358 CYTHON_FALLTHROUGH;
16360 default:
goto __pyx_L5_argtuple_error;
16362 kw_args = PyDict_Size(__pyx_kwds);
16363 switch (pos_args) {
16365 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
16366 else goto __pyx_L5_argtuple_error;
16367 CYTHON_FALLTHROUGH;
16370 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
16371 if (value) { values[1] = value; kw_args--; }
16374 if (unlikely(kw_args > 0)) {
16375 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"acosh") < 0)) __PYX_ERR(0, 1705, __pyx_L3_error)
16378 switch (PyTuple_GET_SIZE(__pyx_args)) {
16379 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16380 CYTHON_FALLTHROUGH;
16381 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16383 default:
goto __pyx_L5_argtuple_error;
16386 __pyx_v_obj = values[0];
16387 __pyx_v_i = values[1];
16389 goto __pyx_L4_argument_unpacking_done;
16390 __pyx_L5_argtuple_error:;
16391 __Pyx_RaiseArgtupleInvalid(
"acosh", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1705, __pyx_L3_error)
16393 __Pyx_AddTraceback(
"PyClical.acosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16394 __Pyx_RefNannyFinishContext();
16396 __pyx_L4_argument_unpacking_done:;
16397 __pyx_r = __pyx_pf_8PyClical_62acosh(__pyx_self, __pyx_v_obj, __pyx_v_i);
16400 __Pyx_RefNannyFinishContext();
16404 static PyObject *__pyx_pf_8PyClical_62acosh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
16405 PyObject *__pyx_r = NULL;
16406 __Pyx_RefNannyDeclarations
16407 PyObject *__pyx_t_1 = NULL;
16408 struct __pyx_opt_args_8PyClical_acosh __pyx_t_2;
16409 int __pyx_lineno = 0;
16410 const char *__pyx_filename = NULL;
16411 int __pyx_clineno = 0;
16412 __Pyx_RefNannySetupContext(
"acosh", 0);
16413 __Pyx_XDECREF(__pyx_r);
16414 __pyx_t_2.__pyx_n = 1;
16415 __pyx_t_2.i = __pyx_v_i;
16416 __pyx_t_1 = __pyx_f_8PyClical_acosh(__pyx_v_obj, 0, &__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1705, __pyx_L1_error)
16417 __Pyx_GOTREF(__pyx_t_1);
16418 __pyx_r = __pyx_t_1;
16424 __Pyx_XDECREF(__pyx_t_1);
16425 __Pyx_AddTraceback(
"PyClical.acosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16428 __Pyx_XGIVEREF(__pyx_r);
16429 __Pyx_RefNannyFinishContext();
16441 static PyObject *__pyx_pw_8PyClical_65sin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16442 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) {
16443 PyObject *__pyx_v_i = ((PyObject *)Py_None);
16444 PyObject *__pyx_r = NULL;
16445 __Pyx_RefNannyDeclarations
16448 PyObject *__pyx_t_3 = NULL;
16450 PyObject *__pyx_t_5 = NULL;
16451 PyObject *__pyx_t_6 = NULL;
16452 PyObject *__pyx_t_7 = NULL;
16453 PyObject *__pyx_t_8 = NULL;
16454 PyObject *__pyx_t_9 = NULL;
16455 PyObject *__pyx_t_10 = NULL;
16456 PyObject *__pyx_t_11 = NULL;
16457 int __pyx_lineno = 0;
16458 const char *__pyx_filename = NULL;
16459 int __pyx_clineno = 0;
16460 __Pyx_RefNannySetupContext(
"sin", 0);
16461 if (__pyx_optional_args) {
16462 if (__pyx_optional_args->__pyx_n > 0) {
16463 __pyx_v_i = __pyx_optional_args->i;
16474 __pyx_t_1 = (__pyx_v_i != Py_None);
16475 __pyx_t_2 = (__pyx_t_1 != 0);
16485 __Pyx_XDECREF(__pyx_r);
16486 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1740, __pyx_L1_error)
16487 __Pyx_GOTREF(__pyx_t_3);
16489 __pyx_t_4 =
sin(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
16491 __Pyx_CppExn2PyErr();
16492 __PYX_ERR(0, 1740, __pyx_L1_error)
16494 __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, 1740, __pyx_L1_error)
16495 __Pyx_GOTREF(__pyx_t_5);
16496 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16497 __pyx_r = __pyx_t_5;
16519 __Pyx_PyThreadState_declare
16520 __Pyx_PyThreadState_assign
16521 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
16522 __Pyx_XGOTREF(__pyx_t_6);
16523 __Pyx_XGOTREF(__pyx_t_7);
16524 __Pyx_XGOTREF(__pyx_t_8);
16534 __Pyx_XDECREF(__pyx_r);
16535 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1743, __pyx_L4_error)
16536 __Pyx_GOTREF(__pyx_t_3);
16537 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sin);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1743, __pyx_L4_error)
16538 __Pyx_GOTREF(__pyx_t_9);
16539 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16541 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
16542 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
16543 if (likely(__pyx_t_3)) {
16544 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
16545 __Pyx_INCREF(__pyx_t_3);
16546 __Pyx_INCREF(
function);
16547 __Pyx_DECREF_SET(__pyx_t_9,
function);
16550 __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_3, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
16551 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16552 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1743, __pyx_L4_error)
16553 __Pyx_GOTREF(__pyx_t_5);
16554 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16555 __pyx_r = __pyx_t_5;
16557 goto __pyx_L8_try_return;
16568 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16569 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16570 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
16580 __Pyx_AddTraceback(
"PyClical.sin", __pyx_clineno, __pyx_lineno, __pyx_filename);
16581 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1744, __pyx_L6_except_error)
16582 __Pyx_GOTREF(__pyx_t_5);
16583 __Pyx_GOTREF(__pyx_t_9);
16584 __Pyx_GOTREF(__pyx_t_3);
16593 __Pyx_XDECREF(__pyx_r);
16594 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1745, __pyx_L6_except_error)
16595 __Pyx_GOTREF(__pyx_t_10);
16596 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_10),
sin(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1745, __pyx_L6_except_error)
16597 __Pyx_GOTREF(__pyx_t_11);
16598 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16599 __pyx_r = __pyx_t_11;
16601 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16602 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16603 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16604 goto __pyx_L7_except_return;
16606 __pyx_L6_except_error:;
16615 __Pyx_XGIVEREF(__pyx_t_6);
16616 __Pyx_XGIVEREF(__pyx_t_7);
16617 __Pyx_XGIVEREF(__pyx_t_8);
16618 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16619 goto __pyx_L1_error;
16620 __pyx_L8_try_return:;
16621 __Pyx_XGIVEREF(__pyx_t_6);
16622 __Pyx_XGIVEREF(__pyx_t_7);
16623 __Pyx_XGIVEREF(__pyx_t_8);
16624 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16626 __pyx_L7_except_return:;
16627 __Pyx_XGIVEREF(__pyx_t_6);
16628 __Pyx_XGIVEREF(__pyx_t_7);
16629 __Pyx_XGIVEREF(__pyx_t_8);
16630 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16645 __Pyx_XDECREF(__pyx_t_3);
16646 __Pyx_XDECREF(__pyx_t_5);
16647 __Pyx_XDECREF(__pyx_t_9);
16648 __Pyx_XDECREF(__pyx_t_10);
16649 __Pyx_XDECREF(__pyx_t_11);
16650 __Pyx_AddTraceback(
"PyClical.sin", __pyx_clineno, __pyx_lineno, __pyx_filename);
16653 __Pyx_XGIVEREF(__pyx_r);
16654 __Pyx_RefNannyFinishContext();
16659 static PyObject *__pyx_pw_8PyClical_65sin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16660 static char __pyx_doc_8PyClical_64sin[] =
"\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 ";
16661 static PyObject *__pyx_pw_8PyClical_65sin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16662 PyObject *__pyx_v_obj = 0;
16663 PyObject *__pyx_v_i = 0;
16664 int __pyx_lineno = 0;
16665 const char *__pyx_filename = NULL;
16666 int __pyx_clineno = 0;
16667 PyObject *__pyx_r = 0;
16668 __Pyx_RefNannyDeclarations
16669 __Pyx_RefNannySetupContext(
"sin (wrapper)", 0);
16671 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
16672 PyObject* values[2] = {0,0};
16673 values[1] = ((PyObject *)Py_None);
16674 if (unlikely(__pyx_kwds)) {
16675 Py_ssize_t kw_args;
16676 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16677 switch (pos_args) {
16678 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16679 CYTHON_FALLTHROUGH;
16680 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16681 CYTHON_FALLTHROUGH;
16683 default:
goto __pyx_L5_argtuple_error;
16685 kw_args = PyDict_Size(__pyx_kwds);
16686 switch (pos_args) {
16688 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
16689 else goto __pyx_L5_argtuple_error;
16690 CYTHON_FALLTHROUGH;
16693 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
16694 if (value) { values[1] = value; kw_args--; }
16697 if (unlikely(kw_args > 0)) {
16698 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"sin") < 0)) __PYX_ERR(0, 1728, __pyx_L3_error)
16701 switch (PyTuple_GET_SIZE(__pyx_args)) {
16702 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16703 CYTHON_FALLTHROUGH;
16704 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16706 default:
goto __pyx_L5_argtuple_error;
16709 __pyx_v_obj = values[0];
16710 __pyx_v_i = values[1];
16712 goto __pyx_L4_argument_unpacking_done;
16713 __pyx_L5_argtuple_error:;
16714 __Pyx_RaiseArgtupleInvalid(
"sin", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1728, __pyx_L3_error)
16716 __Pyx_AddTraceback(
"PyClical.sin", __pyx_clineno, __pyx_lineno, __pyx_filename);
16717 __Pyx_RefNannyFinishContext();
16719 __pyx_L4_argument_unpacking_done:;
16720 __pyx_r = __pyx_pf_8PyClical_64sin(__pyx_self, __pyx_v_obj, __pyx_v_i);
16723 __Pyx_RefNannyFinishContext();
16727 static PyObject *__pyx_pf_8PyClical_64sin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
16728 PyObject *__pyx_r = NULL;
16729 __Pyx_RefNannyDeclarations
16730 PyObject *__pyx_t_1 = NULL;
16731 struct __pyx_opt_args_8PyClical_sin __pyx_t_2;
16732 int __pyx_lineno = 0;
16733 const char *__pyx_filename = NULL;
16734 int __pyx_clineno = 0;
16735 __Pyx_RefNannySetupContext(
"sin", 0);
16736 __Pyx_XDECREF(__pyx_r);
16737 __pyx_t_2.__pyx_n = 1;
16738 __pyx_t_2.i = __pyx_v_i;
16739 __pyx_t_1 = __pyx_f_8PyClical_sin(__pyx_v_obj, 0, &__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1728, __pyx_L1_error)
16740 __Pyx_GOTREF(__pyx_t_1);
16741 __pyx_r = __pyx_t_1;
16747 __Pyx_XDECREF(__pyx_t_1);
16748 __Pyx_AddTraceback(
"PyClical.sin", __pyx_clineno, __pyx_lineno, __pyx_filename);
16751 __Pyx_XGIVEREF(__pyx_r);
16752 __Pyx_RefNannyFinishContext();
16764 static PyObject *__pyx_pw_8PyClical_67asin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16765 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) {
16766 PyObject *__pyx_v_i = ((PyObject *)Py_None);
16767 PyObject *__pyx_r = NULL;
16768 __Pyx_RefNannyDeclarations
16771 PyObject *__pyx_t_3 = NULL;
16773 PyObject *__pyx_t_5 = NULL;
16774 PyObject *__pyx_t_6 = NULL;
16775 PyObject *__pyx_t_7 = NULL;
16776 PyObject *__pyx_t_8 = NULL;
16777 PyObject *__pyx_t_9 = NULL;
16778 PyObject *__pyx_t_10 = NULL;
16779 PyObject *__pyx_t_11 = NULL;
16780 int __pyx_lineno = 0;
16781 const char *__pyx_filename = NULL;
16782 int __pyx_clineno = 0;
16783 __Pyx_RefNannySetupContext(
"asin", 0);
16784 if (__pyx_optional_args) {
16785 if (__pyx_optional_args->__pyx_n > 0) {
16786 __pyx_v_i = __pyx_optional_args->i;
16797 __pyx_t_1 = (__pyx_v_i != Py_None);
16798 __pyx_t_2 = (__pyx_t_1 != 0);
16808 __Pyx_XDECREF(__pyx_r);
16809 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1761, __pyx_L1_error)
16810 __Pyx_GOTREF(__pyx_t_3);
16812 __pyx_t_4 =
asin(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
16814 __Pyx_CppExn2PyErr();
16815 __PYX_ERR(0, 1761, __pyx_L1_error)
16817 __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, 1761, __pyx_L1_error)
16818 __Pyx_GOTREF(__pyx_t_5);
16819 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16820 __pyx_r = __pyx_t_5;
16842 __Pyx_PyThreadState_declare
16843 __Pyx_PyThreadState_assign
16844 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
16845 __Pyx_XGOTREF(__pyx_t_6);
16846 __Pyx_XGOTREF(__pyx_t_7);
16847 __Pyx_XGOTREF(__pyx_t_8);
16857 __Pyx_XDECREF(__pyx_r);
16858 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1764, __pyx_L4_error)
16859 __Pyx_GOTREF(__pyx_t_3);
16860 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asin);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1764, __pyx_L4_error)
16861 __Pyx_GOTREF(__pyx_t_9);
16862 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16864 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
16865 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
16866 if (likely(__pyx_t_3)) {
16867 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
16868 __Pyx_INCREF(__pyx_t_3);
16869 __Pyx_INCREF(
function);
16870 __Pyx_DECREF_SET(__pyx_t_9,
function);
16873 __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_3, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
16874 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16875 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1764, __pyx_L4_error)
16876 __Pyx_GOTREF(__pyx_t_5);
16877 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16878 __pyx_r = __pyx_t_5;
16880 goto __pyx_L8_try_return;
16891 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16892 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16893 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
16903 __Pyx_AddTraceback(
"PyClical.asin", __pyx_clineno, __pyx_lineno, __pyx_filename);
16904 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1765, __pyx_L6_except_error)
16905 __Pyx_GOTREF(__pyx_t_5);
16906 __Pyx_GOTREF(__pyx_t_9);
16907 __Pyx_GOTREF(__pyx_t_3);
16916 __Pyx_XDECREF(__pyx_r);
16917 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1766, __pyx_L6_except_error)
16918 __Pyx_GOTREF(__pyx_t_10);
16919 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_10),
asin(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1766, __pyx_L6_except_error)
16920 __Pyx_GOTREF(__pyx_t_11);
16921 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16922 __pyx_r = __pyx_t_11;
16924 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16925 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16926 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16927 goto __pyx_L7_except_return;
16929 __pyx_L6_except_error:;
16938 __Pyx_XGIVEREF(__pyx_t_6);
16939 __Pyx_XGIVEREF(__pyx_t_7);
16940 __Pyx_XGIVEREF(__pyx_t_8);
16941 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16942 goto __pyx_L1_error;
16943 __pyx_L8_try_return:;
16944 __Pyx_XGIVEREF(__pyx_t_6);
16945 __Pyx_XGIVEREF(__pyx_t_7);
16946 __Pyx_XGIVEREF(__pyx_t_8);
16947 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16949 __pyx_L7_except_return:;
16950 __Pyx_XGIVEREF(__pyx_t_6);
16951 __Pyx_XGIVEREF(__pyx_t_7);
16952 __Pyx_XGIVEREF(__pyx_t_8);
16953 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16968 __Pyx_XDECREF(__pyx_t_3);
16969 __Pyx_XDECREF(__pyx_t_5);
16970 __Pyx_XDECREF(__pyx_t_9);
16971 __Pyx_XDECREF(__pyx_t_10);
16972 __Pyx_XDECREF(__pyx_t_11);
16973 __Pyx_AddTraceback(
"PyClical.asin", __pyx_clineno, __pyx_lineno, __pyx_filename);
16976 __Pyx_XGIVEREF(__pyx_r);
16977 __Pyx_RefNannyFinishContext();
16982 static PyObject *__pyx_pw_8PyClical_67asin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16983 static char __pyx_doc_8PyClical_66asin[] =
"\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 ";
16984 static PyObject *__pyx_pw_8PyClical_67asin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16985 PyObject *__pyx_v_obj = 0;
16986 PyObject *__pyx_v_i = 0;
16987 int __pyx_lineno = 0;
16988 const char *__pyx_filename = NULL;
16989 int __pyx_clineno = 0;
16990 PyObject *__pyx_r = 0;
16991 __Pyx_RefNannyDeclarations
16992 __Pyx_RefNannySetupContext(
"asin (wrapper)", 0);
16994 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
16995 PyObject* values[2] = {0,0};
16996 values[1] = ((PyObject *)Py_None);
16997 if (unlikely(__pyx_kwds)) {
16998 Py_ssize_t kw_args;
16999 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17000 switch (pos_args) {
17001 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17002 CYTHON_FALLTHROUGH;
17003 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17004 CYTHON_FALLTHROUGH;
17006 default:
goto __pyx_L5_argtuple_error;
17008 kw_args = PyDict_Size(__pyx_kwds);
17009 switch (pos_args) {
17011 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
17012 else goto __pyx_L5_argtuple_error;
17013 CYTHON_FALLTHROUGH;
17016 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
17017 if (value) { values[1] = value; kw_args--; }
17020 if (unlikely(kw_args > 0)) {
17021 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"asin") < 0)) __PYX_ERR(0, 1747, __pyx_L3_error)
17024 switch (PyTuple_GET_SIZE(__pyx_args)) {
17025 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17026 CYTHON_FALLTHROUGH;
17027 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17029 default:
goto __pyx_L5_argtuple_error;
17032 __pyx_v_obj = values[0];
17033 __pyx_v_i = values[1];
17035 goto __pyx_L4_argument_unpacking_done;
17036 __pyx_L5_argtuple_error:;
17037 __Pyx_RaiseArgtupleInvalid(
"asin", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1747, __pyx_L3_error)
17039 __Pyx_AddTraceback(
"PyClical.asin", __pyx_clineno, __pyx_lineno, __pyx_filename);
17040 __Pyx_RefNannyFinishContext();
17042 __pyx_L4_argument_unpacking_done:;
17043 __pyx_r = __pyx_pf_8PyClical_66asin(__pyx_self, __pyx_v_obj, __pyx_v_i);
17046 __Pyx_RefNannyFinishContext();
17050 static PyObject *__pyx_pf_8PyClical_66asin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
17051 PyObject *__pyx_r = NULL;
17052 __Pyx_RefNannyDeclarations
17053 PyObject *__pyx_t_1 = NULL;
17054 struct __pyx_opt_args_8PyClical_asin __pyx_t_2;
17055 int __pyx_lineno = 0;
17056 const char *__pyx_filename = NULL;
17057 int __pyx_clineno = 0;
17058 __Pyx_RefNannySetupContext(
"asin", 0);
17059 __Pyx_XDECREF(__pyx_r);
17060 __pyx_t_2.__pyx_n = 1;
17061 __pyx_t_2.i = __pyx_v_i;
17062 __pyx_t_1 = __pyx_f_8PyClical_asin(__pyx_v_obj, 0, &__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1747, __pyx_L1_error)
17063 __Pyx_GOTREF(__pyx_t_1);
17064 __pyx_r = __pyx_t_1;
17070 __Pyx_XDECREF(__pyx_t_1);
17071 __Pyx_AddTraceback(
"PyClical.asin", __pyx_clineno, __pyx_lineno, __pyx_filename);
17074 __Pyx_XGIVEREF(__pyx_r);
17075 __Pyx_RefNannyFinishContext();
17087 static PyObject *__pyx_pw_8PyClical_69sinh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
17088 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_sinh(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
17089 PyObject *__pyx_r = NULL;
17090 __Pyx_RefNannyDeclarations
17091 PyObject *__pyx_t_1 = NULL;
17092 PyObject *__pyx_t_2 = NULL;
17093 PyObject *__pyx_t_3 = NULL;
17094 PyObject *__pyx_t_4 = NULL;
17095 PyObject *__pyx_t_5 = NULL;
17096 PyObject *__pyx_t_6 = NULL;
17097 PyObject *__pyx_t_7 = NULL;
17098 PyObject *__pyx_t_8 = NULL;
17099 int __pyx_lineno = 0;
17100 const char *__pyx_filename = NULL;
17101 int __pyx_clineno = 0;
17102 __Pyx_RefNannySetupContext(
"sinh", 0);
17112 __Pyx_PyThreadState_declare
17113 __Pyx_PyThreadState_assign
17114 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
17115 __Pyx_XGOTREF(__pyx_t_1);
17116 __Pyx_XGOTREF(__pyx_t_2);
17117 __Pyx_XGOTREF(__pyx_t_3);
17127 __Pyx_XDECREF(__pyx_r);
17128 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1778, __pyx_L3_error)
17129 __Pyx_GOTREF(__pyx_t_5);
17130 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_sinh);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1778, __pyx_L3_error)
17131 __Pyx_GOTREF(__pyx_t_6);
17132 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17134 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
17135 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
17136 if (likely(__pyx_t_5)) {
17137 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
17138 __Pyx_INCREF(__pyx_t_5);
17139 __Pyx_INCREF(
function);
17140 __Pyx_DECREF_SET(__pyx_t_6,
function);
17143 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_obj);
17144 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17145 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1778, __pyx_L3_error)
17146 __Pyx_GOTREF(__pyx_t_4);
17147 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17148 __pyx_r = __pyx_t_4;
17150 goto __pyx_L7_try_return;
17161 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
17162 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17163 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
17173 __Pyx_AddTraceback(
"PyClical.sinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17174 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(0, 1779, __pyx_L5_except_error)
17175 __Pyx_GOTREF(__pyx_t_4);
17176 __Pyx_GOTREF(__pyx_t_6);
17177 __Pyx_GOTREF(__pyx_t_5);
17186 __Pyx_XDECREF(__pyx_r);
17187 __pyx_t_7 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1780, __pyx_L5_except_error)
17188 __Pyx_GOTREF(__pyx_t_7);
17189 __pyx_t_8 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_7),
sinh(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1780, __pyx_L5_except_error)
17190 __Pyx_GOTREF(__pyx_t_8);
17191 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
17192 __pyx_r = __pyx_t_8;
17194 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17195 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17196 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17197 goto __pyx_L6_except_return;
17199 __pyx_L5_except_error:;
17208 __Pyx_XGIVEREF(__pyx_t_1);
17209 __Pyx_XGIVEREF(__pyx_t_2);
17210 __Pyx_XGIVEREF(__pyx_t_3);
17211 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
17212 goto __pyx_L1_error;
17213 __pyx_L7_try_return:;
17214 __Pyx_XGIVEREF(__pyx_t_1);
17215 __Pyx_XGIVEREF(__pyx_t_2);
17216 __Pyx_XGIVEREF(__pyx_t_3);
17217 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
17219 __pyx_L6_except_return:;
17220 __Pyx_XGIVEREF(__pyx_t_1);
17221 __Pyx_XGIVEREF(__pyx_t_2);
17222 __Pyx_XGIVEREF(__pyx_t_3);
17223 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
17237 __Pyx_XDECREF(__pyx_t_4);
17238 __Pyx_XDECREF(__pyx_t_5);
17239 __Pyx_XDECREF(__pyx_t_6);
17240 __Pyx_XDECREF(__pyx_t_7);
17241 __Pyx_XDECREF(__pyx_t_8);
17242 __Pyx_AddTraceback(
"PyClical.sinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17245 __Pyx_XGIVEREF(__pyx_r);
17246 __Pyx_RefNannyFinishContext();
17251 static PyObject *__pyx_pw_8PyClical_69sinh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
17252 static char __pyx_doc_8PyClical_68sinh[] =
"\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 ";
17253 static PyObject *__pyx_pw_8PyClical_69sinh(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
17254 PyObject *__pyx_r = 0;
17255 __Pyx_RefNannyDeclarations
17256 __Pyx_RefNannySetupContext(
"sinh (wrapper)", 0);
17257 __pyx_r = __pyx_pf_8PyClical_68sinh(__pyx_self, ((PyObject *)__pyx_v_obj));
17260 __Pyx_RefNannyFinishContext();
17264 static PyObject *__pyx_pf_8PyClical_68sinh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
17265 PyObject *__pyx_r = NULL;
17266 __Pyx_RefNannyDeclarations
17267 PyObject *__pyx_t_1 = NULL;
17268 int __pyx_lineno = 0;
17269 const char *__pyx_filename = NULL;
17270 int __pyx_clineno = 0;
17271 __Pyx_RefNannySetupContext(
"sinh", 0);
17272 __Pyx_XDECREF(__pyx_r);
17273 __pyx_t_1 = __pyx_f_8PyClical_sinh(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1768, __pyx_L1_error)
17274 __Pyx_GOTREF(__pyx_t_1);
17275 __pyx_r = __pyx_t_1;
17281 __Pyx_XDECREF(__pyx_t_1);
17282 __Pyx_AddTraceback(
"PyClical.sinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17285 __Pyx_XGIVEREF(__pyx_r);
17286 __Pyx_RefNannyFinishContext();
17298 static PyObject *__pyx_pw_8PyClical_71asinh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17299 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) {
17300 PyObject *__pyx_v_i = ((PyObject *)Py_None);
17301 PyObject *__pyx_r = NULL;
17302 __Pyx_RefNannyDeclarations
17305 PyObject *__pyx_t_3 = NULL;
17307 PyObject *__pyx_t_5 = NULL;
17308 PyObject *__pyx_t_6 = NULL;
17309 PyObject *__pyx_t_7 = NULL;
17310 PyObject *__pyx_t_8 = NULL;
17311 PyObject *__pyx_t_9 = NULL;
17312 PyObject *__pyx_t_10 = NULL;
17313 PyObject *__pyx_t_11 = NULL;
17314 int __pyx_lineno = 0;
17315 const char *__pyx_filename = NULL;
17316 int __pyx_clineno = 0;
17317 __Pyx_RefNannySetupContext(
"asinh", 0);
17318 if (__pyx_optional_args) {
17319 if (__pyx_optional_args->__pyx_n > 0) {
17320 __pyx_v_i = __pyx_optional_args->i;
17331 __pyx_t_1 = (__pyx_v_i != Py_None);
17332 __pyx_t_2 = (__pyx_t_1 != 0);
17342 __Pyx_XDECREF(__pyx_r);
17343 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1794, __pyx_L1_error)
17344 __Pyx_GOTREF(__pyx_t_3);
17346 __pyx_t_4 =
asinh(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
17348 __Pyx_CppExn2PyErr();
17349 __PYX_ERR(0, 1794, __pyx_L1_error)
17351 __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, 1794, __pyx_L1_error)
17352 __Pyx_GOTREF(__pyx_t_5);
17353 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17354 __pyx_r = __pyx_t_5;
17376 __Pyx_PyThreadState_declare
17377 __Pyx_PyThreadState_assign
17378 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
17379 __Pyx_XGOTREF(__pyx_t_6);
17380 __Pyx_XGOTREF(__pyx_t_7);
17381 __Pyx_XGOTREF(__pyx_t_8);
17391 __Pyx_XDECREF(__pyx_r);
17392 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1797, __pyx_L4_error)
17393 __Pyx_GOTREF(__pyx_t_3);
17394 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asinh);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1797, __pyx_L4_error)
17395 __Pyx_GOTREF(__pyx_t_9);
17396 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17398 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
17399 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
17400 if (likely(__pyx_t_3)) {
17401 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
17402 __Pyx_INCREF(__pyx_t_3);
17403 __Pyx_INCREF(
function);
17404 __Pyx_DECREF_SET(__pyx_t_9,
function);
17407 __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_3, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
17408 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17409 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1797, __pyx_L4_error)
17410 __Pyx_GOTREF(__pyx_t_5);
17411 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17412 __pyx_r = __pyx_t_5;
17414 goto __pyx_L8_try_return;
17425 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17426 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17427 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
17437 __Pyx_AddTraceback(
"PyClical.asinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17438 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1798, __pyx_L6_except_error)
17439 __Pyx_GOTREF(__pyx_t_5);
17440 __Pyx_GOTREF(__pyx_t_9);
17441 __Pyx_GOTREF(__pyx_t_3);
17450 __Pyx_XDECREF(__pyx_r);
17451 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1799, __pyx_L6_except_error)
17452 __Pyx_GOTREF(__pyx_t_10);
17453 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_10),
asinh(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1799, __pyx_L6_except_error)
17454 __Pyx_GOTREF(__pyx_t_11);
17455 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
17456 __pyx_r = __pyx_t_11;
17458 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17459 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17460 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17461 goto __pyx_L7_except_return;
17463 __pyx_L6_except_error:;
17472 __Pyx_XGIVEREF(__pyx_t_6);
17473 __Pyx_XGIVEREF(__pyx_t_7);
17474 __Pyx_XGIVEREF(__pyx_t_8);
17475 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17476 goto __pyx_L1_error;
17477 __pyx_L8_try_return:;
17478 __Pyx_XGIVEREF(__pyx_t_6);
17479 __Pyx_XGIVEREF(__pyx_t_7);
17480 __Pyx_XGIVEREF(__pyx_t_8);
17481 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17483 __pyx_L7_except_return:;
17484 __Pyx_XGIVEREF(__pyx_t_6);
17485 __Pyx_XGIVEREF(__pyx_t_7);
17486 __Pyx_XGIVEREF(__pyx_t_8);
17487 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17502 __Pyx_XDECREF(__pyx_t_3);
17503 __Pyx_XDECREF(__pyx_t_5);
17504 __Pyx_XDECREF(__pyx_t_9);
17505 __Pyx_XDECREF(__pyx_t_10);
17506 __Pyx_XDECREF(__pyx_t_11);
17507 __Pyx_AddTraceback(
"PyClical.asinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17510 __Pyx_XGIVEREF(__pyx_r);
17511 __Pyx_RefNannyFinishContext();
17516 static PyObject *__pyx_pw_8PyClical_71asinh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17517 static char __pyx_doc_8PyClical_70asinh[] =
"\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 ";
17518 static PyObject *__pyx_pw_8PyClical_71asinh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17519 PyObject *__pyx_v_obj = 0;
17520 PyObject *__pyx_v_i = 0;
17521 int __pyx_lineno = 0;
17522 const char *__pyx_filename = NULL;
17523 int __pyx_clineno = 0;
17524 PyObject *__pyx_r = 0;
17525 __Pyx_RefNannyDeclarations
17526 __Pyx_RefNannySetupContext(
"asinh (wrapper)", 0);
17528 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
17529 PyObject* values[2] = {0,0};
17530 values[1] = ((PyObject *)Py_None);
17531 if (unlikely(__pyx_kwds)) {
17532 Py_ssize_t kw_args;
17533 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17534 switch (pos_args) {
17535 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17536 CYTHON_FALLTHROUGH;
17537 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17538 CYTHON_FALLTHROUGH;
17540 default:
goto __pyx_L5_argtuple_error;
17542 kw_args = PyDict_Size(__pyx_kwds);
17543 switch (pos_args) {
17545 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
17546 else goto __pyx_L5_argtuple_error;
17547 CYTHON_FALLTHROUGH;
17550 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
17551 if (value) { values[1] = value; kw_args--; }
17554 if (unlikely(kw_args > 0)) {
17555 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"asinh") < 0)) __PYX_ERR(0, 1782, __pyx_L3_error)
17558 switch (PyTuple_GET_SIZE(__pyx_args)) {
17559 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17560 CYTHON_FALLTHROUGH;
17561 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17563 default:
goto __pyx_L5_argtuple_error;
17566 __pyx_v_obj = values[0];
17567 __pyx_v_i = values[1];
17569 goto __pyx_L4_argument_unpacking_done;
17570 __pyx_L5_argtuple_error:;
17571 __Pyx_RaiseArgtupleInvalid(
"asinh", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1782, __pyx_L3_error)
17573 __Pyx_AddTraceback(
"PyClical.asinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17574 __Pyx_RefNannyFinishContext();
17576 __pyx_L4_argument_unpacking_done:;
17577 __pyx_r = __pyx_pf_8PyClical_70asinh(__pyx_self, __pyx_v_obj, __pyx_v_i);
17580 __Pyx_RefNannyFinishContext();
17584 static PyObject *__pyx_pf_8PyClical_70asinh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
17585 PyObject *__pyx_r = NULL;
17586 __Pyx_RefNannyDeclarations
17587 PyObject *__pyx_t_1 = NULL;
17588 struct __pyx_opt_args_8PyClical_asinh __pyx_t_2;
17589 int __pyx_lineno = 0;
17590 const char *__pyx_filename = NULL;
17591 int __pyx_clineno = 0;
17592 __Pyx_RefNannySetupContext(
"asinh", 0);
17593 __Pyx_XDECREF(__pyx_r);
17594 __pyx_t_2.__pyx_n = 1;
17595 __pyx_t_2.i = __pyx_v_i;
17596 __pyx_t_1 = __pyx_f_8PyClical_asinh(__pyx_v_obj, 0, &__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1782, __pyx_L1_error)
17597 __Pyx_GOTREF(__pyx_t_1);
17598 __pyx_r = __pyx_t_1;
17604 __Pyx_XDECREF(__pyx_t_1);
17605 __Pyx_AddTraceback(
"PyClical.asinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17608 __Pyx_XGIVEREF(__pyx_r);
17609 __Pyx_RefNannyFinishContext();
17621 static PyObject *__pyx_pw_8PyClical_73tan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17622 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) {
17623 PyObject *__pyx_v_i = ((PyObject *)Py_None);
17624 PyObject *__pyx_r = NULL;
17625 __Pyx_RefNannyDeclarations
17628 PyObject *__pyx_t_3 = NULL;
17630 PyObject *__pyx_t_5 = NULL;
17631 PyObject *__pyx_t_6 = NULL;
17632 PyObject *__pyx_t_7 = NULL;
17633 PyObject *__pyx_t_8 = NULL;
17634 PyObject *__pyx_t_9 = NULL;
17635 PyObject *__pyx_t_10 = NULL;
17636 PyObject *__pyx_t_11 = NULL;
17637 int __pyx_lineno = 0;
17638 const char *__pyx_filename = NULL;
17639 int __pyx_clineno = 0;
17640 __Pyx_RefNannySetupContext(
"tan", 0);
17641 if (__pyx_optional_args) {
17642 if (__pyx_optional_args->__pyx_n > 0) {
17643 __pyx_v_i = __pyx_optional_args->i;
17654 __pyx_t_1 = (__pyx_v_i != Py_None);
17655 __pyx_t_2 = (__pyx_t_1 != 0);
17665 __Pyx_XDECREF(__pyx_r);
17666 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1811, __pyx_L1_error)
17667 __Pyx_GOTREF(__pyx_t_3);
17669 __pyx_t_4 =
tan(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
17671 __Pyx_CppExn2PyErr();
17672 __PYX_ERR(0, 1811, __pyx_L1_error)
17674 __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, 1811, __pyx_L1_error)
17675 __Pyx_GOTREF(__pyx_t_5);
17676 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17677 __pyx_r = __pyx_t_5;
17699 __Pyx_PyThreadState_declare
17700 __Pyx_PyThreadState_assign
17701 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
17702 __Pyx_XGOTREF(__pyx_t_6);
17703 __Pyx_XGOTREF(__pyx_t_7);
17704 __Pyx_XGOTREF(__pyx_t_8);
17714 __Pyx_XDECREF(__pyx_r);
17715 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1814, __pyx_L4_error)
17716 __Pyx_GOTREF(__pyx_t_3);
17717 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_tan);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1814, __pyx_L4_error)
17718 __Pyx_GOTREF(__pyx_t_9);
17719 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17721 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
17722 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
17723 if (likely(__pyx_t_3)) {
17724 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
17725 __Pyx_INCREF(__pyx_t_3);
17726 __Pyx_INCREF(
function);
17727 __Pyx_DECREF_SET(__pyx_t_9,
function);
17730 __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_3, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
17731 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17732 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1814, __pyx_L4_error)
17733 __Pyx_GOTREF(__pyx_t_5);
17734 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17735 __pyx_r = __pyx_t_5;
17737 goto __pyx_L8_try_return;
17748 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17749 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17750 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
17760 __Pyx_AddTraceback(
"PyClical.tan", __pyx_clineno, __pyx_lineno, __pyx_filename);
17761 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1815, __pyx_L6_except_error)
17762 __Pyx_GOTREF(__pyx_t_5);
17763 __Pyx_GOTREF(__pyx_t_9);
17764 __Pyx_GOTREF(__pyx_t_3);
17773 __Pyx_XDECREF(__pyx_r);
17774 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1816, __pyx_L6_except_error)
17775 __Pyx_GOTREF(__pyx_t_10);
17776 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_10),
tan(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1816, __pyx_L6_except_error)
17777 __Pyx_GOTREF(__pyx_t_11);
17778 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
17779 __pyx_r = __pyx_t_11;
17781 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17782 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17783 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17784 goto __pyx_L7_except_return;
17786 __pyx_L6_except_error:;
17795 __Pyx_XGIVEREF(__pyx_t_6);
17796 __Pyx_XGIVEREF(__pyx_t_7);
17797 __Pyx_XGIVEREF(__pyx_t_8);
17798 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17799 goto __pyx_L1_error;
17800 __pyx_L8_try_return:;
17801 __Pyx_XGIVEREF(__pyx_t_6);
17802 __Pyx_XGIVEREF(__pyx_t_7);
17803 __Pyx_XGIVEREF(__pyx_t_8);
17804 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17806 __pyx_L7_except_return:;
17807 __Pyx_XGIVEREF(__pyx_t_6);
17808 __Pyx_XGIVEREF(__pyx_t_7);
17809 __Pyx_XGIVEREF(__pyx_t_8);
17810 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17825 __Pyx_XDECREF(__pyx_t_3);
17826 __Pyx_XDECREF(__pyx_t_5);
17827 __Pyx_XDECREF(__pyx_t_9);
17828 __Pyx_XDECREF(__pyx_t_10);
17829 __Pyx_XDECREF(__pyx_t_11);
17830 __Pyx_AddTraceback(
"PyClical.tan", __pyx_clineno, __pyx_lineno, __pyx_filename);
17833 __Pyx_XGIVEREF(__pyx_r);
17834 __Pyx_RefNannyFinishContext();
17839 static PyObject *__pyx_pw_8PyClical_73tan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17840 static char __pyx_doc_8PyClical_72tan[] =
"\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 ";
17841 static PyObject *__pyx_pw_8PyClical_73tan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17842 PyObject *__pyx_v_obj = 0;
17843 PyObject *__pyx_v_i = 0;
17844 int __pyx_lineno = 0;
17845 const char *__pyx_filename = NULL;
17846 int __pyx_clineno = 0;
17847 PyObject *__pyx_r = 0;
17848 __Pyx_RefNannyDeclarations
17849 __Pyx_RefNannySetupContext(
"tan (wrapper)", 0);
17851 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
17852 PyObject* values[2] = {0,0};
17853 values[1] = ((PyObject *)Py_None);
17854 if (unlikely(__pyx_kwds)) {
17855 Py_ssize_t kw_args;
17856 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17857 switch (pos_args) {
17858 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17859 CYTHON_FALLTHROUGH;
17860 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17861 CYTHON_FALLTHROUGH;
17863 default:
goto __pyx_L5_argtuple_error;
17865 kw_args = PyDict_Size(__pyx_kwds);
17866 switch (pos_args) {
17868 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
17869 else goto __pyx_L5_argtuple_error;
17870 CYTHON_FALLTHROUGH;
17873 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
17874 if (value) { values[1] = value; kw_args--; }
17877 if (unlikely(kw_args > 0)) {
17878 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"tan") < 0)) __PYX_ERR(0, 1801, __pyx_L3_error)
17881 switch (PyTuple_GET_SIZE(__pyx_args)) {
17882 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17883 CYTHON_FALLTHROUGH;
17884 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17886 default:
goto __pyx_L5_argtuple_error;
17889 __pyx_v_obj = values[0];
17890 __pyx_v_i = values[1];
17892 goto __pyx_L4_argument_unpacking_done;
17893 __pyx_L5_argtuple_error:;
17894 __Pyx_RaiseArgtupleInvalid(
"tan", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1801, __pyx_L3_error)
17896 __Pyx_AddTraceback(
"PyClical.tan", __pyx_clineno, __pyx_lineno, __pyx_filename);
17897 __Pyx_RefNannyFinishContext();
17899 __pyx_L4_argument_unpacking_done:;
17900 __pyx_r = __pyx_pf_8PyClical_72tan(__pyx_self, __pyx_v_obj, __pyx_v_i);
17903 __Pyx_RefNannyFinishContext();
17907 static PyObject *__pyx_pf_8PyClical_72tan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
17908 PyObject *__pyx_r = NULL;
17909 __Pyx_RefNannyDeclarations
17910 PyObject *__pyx_t_1 = NULL;
17911 struct __pyx_opt_args_8PyClical_tan __pyx_t_2;
17912 int __pyx_lineno = 0;
17913 const char *__pyx_filename = NULL;
17914 int __pyx_clineno = 0;
17915 __Pyx_RefNannySetupContext(
"tan", 0);
17916 __Pyx_XDECREF(__pyx_r);
17917 __pyx_t_2.__pyx_n = 1;
17918 __pyx_t_2.i = __pyx_v_i;
17919 __pyx_t_1 = __pyx_f_8PyClical_tan(__pyx_v_obj, 0, &__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1801, __pyx_L1_error)
17920 __Pyx_GOTREF(__pyx_t_1);
17921 __pyx_r = __pyx_t_1;
17927 __Pyx_XDECREF(__pyx_t_1);
17928 __Pyx_AddTraceback(
"PyClical.tan", __pyx_clineno, __pyx_lineno, __pyx_filename);
17931 __Pyx_XGIVEREF(__pyx_r);
17932 __Pyx_RefNannyFinishContext();
17944 static PyObject *__pyx_pw_8PyClical_75atan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17945 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) {
17946 PyObject *__pyx_v_i = ((PyObject *)Py_None);
17947 PyObject *__pyx_r = NULL;
17948 __Pyx_RefNannyDeclarations
17951 PyObject *__pyx_t_3 = NULL;
17953 PyObject *__pyx_t_5 = NULL;
17954 PyObject *__pyx_t_6 = NULL;
17955 PyObject *__pyx_t_7 = NULL;
17956 PyObject *__pyx_t_8 = NULL;
17957 PyObject *__pyx_t_9 = NULL;
17958 PyObject *__pyx_t_10 = NULL;
17959 PyObject *__pyx_t_11 = NULL;
17960 int __pyx_lineno = 0;
17961 const char *__pyx_filename = NULL;
17962 int __pyx_clineno = 0;
17963 __Pyx_RefNannySetupContext(
"atan", 0);
17964 if (__pyx_optional_args) {
17965 if (__pyx_optional_args->__pyx_n > 0) {
17966 __pyx_v_i = __pyx_optional_args->i;
17977 __pyx_t_1 = (__pyx_v_i != Py_None);
17978 __pyx_t_2 = (__pyx_t_1 != 0);
17988 __Pyx_XDECREF(__pyx_r);
17989 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1828, __pyx_L1_error)
17990 __Pyx_GOTREF(__pyx_t_3);
17992 __pyx_t_4 =
atan(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
17994 __Pyx_CppExn2PyErr();
17995 __PYX_ERR(0, 1828, __pyx_L1_error)
17997 __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, 1828, __pyx_L1_error)
17998 __Pyx_GOTREF(__pyx_t_5);
17999 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18000 __pyx_r = __pyx_t_5;
18022 __Pyx_PyThreadState_declare
18023 __Pyx_PyThreadState_assign
18024 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
18025 __Pyx_XGOTREF(__pyx_t_6);
18026 __Pyx_XGOTREF(__pyx_t_7);
18027 __Pyx_XGOTREF(__pyx_t_8);
18037 __Pyx_XDECREF(__pyx_r);
18038 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1831, __pyx_L4_error)
18039 __Pyx_GOTREF(__pyx_t_3);
18040 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_atan);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1831, __pyx_L4_error)
18041 __Pyx_GOTREF(__pyx_t_9);
18042 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18044 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
18045 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
18046 if (likely(__pyx_t_3)) {
18047 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
18048 __Pyx_INCREF(__pyx_t_3);
18049 __Pyx_INCREF(
function);
18050 __Pyx_DECREF_SET(__pyx_t_9,
function);
18053 __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_3, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
18054 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18055 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1831, __pyx_L4_error)
18056 __Pyx_GOTREF(__pyx_t_5);
18057 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18058 __pyx_r = __pyx_t_5;
18060 goto __pyx_L8_try_return;
18071 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18072 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
18073 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
18083 __Pyx_AddTraceback(
"PyClical.atan", __pyx_clineno, __pyx_lineno, __pyx_filename);
18084 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1832, __pyx_L6_except_error)
18085 __Pyx_GOTREF(__pyx_t_5);
18086 __Pyx_GOTREF(__pyx_t_9);
18087 __Pyx_GOTREF(__pyx_t_3);
18096 __Pyx_XDECREF(__pyx_r);
18097 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1833, __pyx_L6_except_error)
18098 __Pyx_GOTREF(__pyx_t_10);
18099 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_10),
atan(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1833, __pyx_L6_except_error)
18100 __Pyx_GOTREF(__pyx_t_11);
18101 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
18102 __pyx_r = __pyx_t_11;
18104 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18105 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18106 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18107 goto __pyx_L7_except_return;
18109 __pyx_L6_except_error:;
18118 __Pyx_XGIVEREF(__pyx_t_6);
18119 __Pyx_XGIVEREF(__pyx_t_7);
18120 __Pyx_XGIVEREF(__pyx_t_8);
18121 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
18122 goto __pyx_L1_error;
18123 __pyx_L8_try_return:;
18124 __Pyx_XGIVEREF(__pyx_t_6);
18125 __Pyx_XGIVEREF(__pyx_t_7);
18126 __Pyx_XGIVEREF(__pyx_t_8);
18127 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
18129 __pyx_L7_except_return:;
18130 __Pyx_XGIVEREF(__pyx_t_6);
18131 __Pyx_XGIVEREF(__pyx_t_7);
18132 __Pyx_XGIVEREF(__pyx_t_8);
18133 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
18148 __Pyx_XDECREF(__pyx_t_3);
18149 __Pyx_XDECREF(__pyx_t_5);
18150 __Pyx_XDECREF(__pyx_t_9);
18151 __Pyx_XDECREF(__pyx_t_10);
18152 __Pyx_XDECREF(__pyx_t_11);
18153 __Pyx_AddTraceback(
"PyClical.atan", __pyx_clineno, __pyx_lineno, __pyx_filename);
18156 __Pyx_XGIVEREF(__pyx_r);
18157 __Pyx_RefNannyFinishContext();
18162 static PyObject *__pyx_pw_8PyClical_75atan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
18163 static char __pyx_doc_8PyClical_74atan[] =
"\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 ";
18164 static PyObject *__pyx_pw_8PyClical_75atan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18165 PyObject *__pyx_v_obj = 0;
18166 PyObject *__pyx_v_i = 0;
18167 int __pyx_lineno = 0;
18168 const char *__pyx_filename = NULL;
18169 int __pyx_clineno = 0;
18170 PyObject *__pyx_r = 0;
18171 __Pyx_RefNannyDeclarations
18172 __Pyx_RefNannySetupContext(
"atan (wrapper)", 0);
18174 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
18175 PyObject* values[2] = {0,0};
18176 values[1] = ((PyObject *)Py_None);
18177 if (unlikely(__pyx_kwds)) {
18178 Py_ssize_t kw_args;
18179 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
18180 switch (pos_args) {
18181 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18182 CYTHON_FALLTHROUGH;
18183 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18184 CYTHON_FALLTHROUGH;
18186 default:
goto __pyx_L5_argtuple_error;
18188 kw_args = PyDict_Size(__pyx_kwds);
18189 switch (pos_args) {
18191 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
18192 else goto __pyx_L5_argtuple_error;
18193 CYTHON_FALLTHROUGH;
18196 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
18197 if (value) { values[1] = value; kw_args--; }
18200 if (unlikely(kw_args > 0)) {
18201 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"atan") < 0)) __PYX_ERR(0, 1818, __pyx_L3_error)
18204 switch (PyTuple_GET_SIZE(__pyx_args)) {
18205 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18206 CYTHON_FALLTHROUGH;
18207 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18209 default:
goto __pyx_L5_argtuple_error;
18212 __pyx_v_obj = values[0];
18213 __pyx_v_i = values[1];
18215 goto __pyx_L4_argument_unpacking_done;
18216 __pyx_L5_argtuple_error:;
18217 __Pyx_RaiseArgtupleInvalid(
"atan", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1818, __pyx_L3_error)
18219 __Pyx_AddTraceback(
"PyClical.atan", __pyx_clineno, __pyx_lineno, __pyx_filename);
18220 __Pyx_RefNannyFinishContext();
18222 __pyx_L4_argument_unpacking_done:;
18223 __pyx_r = __pyx_pf_8PyClical_74atan(__pyx_self, __pyx_v_obj, __pyx_v_i);
18226 __Pyx_RefNannyFinishContext();
18230 static PyObject *__pyx_pf_8PyClical_74atan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
18231 PyObject *__pyx_r = NULL;
18232 __Pyx_RefNannyDeclarations
18233 PyObject *__pyx_t_1 = NULL;
18234 struct __pyx_opt_args_8PyClical_atan __pyx_t_2;
18235 int __pyx_lineno = 0;
18236 const char *__pyx_filename = NULL;
18237 int __pyx_clineno = 0;
18238 __Pyx_RefNannySetupContext(
"atan", 0);
18239 __Pyx_XDECREF(__pyx_r);
18240 __pyx_t_2.__pyx_n = 1;
18241 __pyx_t_2.i = __pyx_v_i;
18242 __pyx_t_1 = __pyx_f_8PyClical_atan(__pyx_v_obj, 0, &__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1818, __pyx_L1_error)
18243 __Pyx_GOTREF(__pyx_t_1);
18244 __pyx_r = __pyx_t_1;
18250 __Pyx_XDECREF(__pyx_t_1);
18251 __Pyx_AddTraceback(
"PyClical.atan", __pyx_clineno, __pyx_lineno, __pyx_filename);
18254 __Pyx_XGIVEREF(__pyx_r);
18255 __Pyx_RefNannyFinishContext();
18267 static PyObject *__pyx_pw_8PyClical_77tanh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
18268 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_tanh(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
18269 PyObject *__pyx_r = NULL;
18270 __Pyx_RefNannyDeclarations
18271 PyObject *__pyx_t_1 = NULL;
18272 PyObject *__pyx_t_2 = NULL;
18273 PyObject *__pyx_t_3 = NULL;
18274 PyObject *__pyx_t_4 = NULL;
18275 PyObject *__pyx_t_5 = NULL;
18276 PyObject *__pyx_t_6 = NULL;
18277 PyObject *__pyx_t_7 = NULL;
18278 PyObject *__pyx_t_8 = NULL;
18279 int __pyx_lineno = 0;
18280 const char *__pyx_filename = NULL;
18281 int __pyx_clineno = 0;
18282 __Pyx_RefNannySetupContext(
"tanh", 0);
18292 __Pyx_PyThreadState_declare
18293 __Pyx_PyThreadState_assign
18294 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
18295 __Pyx_XGOTREF(__pyx_t_1);
18296 __Pyx_XGOTREF(__pyx_t_2);
18297 __Pyx_XGOTREF(__pyx_t_3);
18307 __Pyx_XDECREF(__pyx_r);
18308 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1843, __pyx_L3_error)
18309 __Pyx_GOTREF(__pyx_t_5);
18310 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_tanh);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1843, __pyx_L3_error)
18311 __Pyx_GOTREF(__pyx_t_6);
18312 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18314 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
18315 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
18316 if (likely(__pyx_t_5)) {
18317 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
18318 __Pyx_INCREF(__pyx_t_5);
18319 __Pyx_INCREF(
function);
18320 __Pyx_DECREF_SET(__pyx_t_6,
function);
18323 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_obj);
18324 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
18325 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1843, __pyx_L3_error)
18326 __Pyx_GOTREF(__pyx_t_4);
18327 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
18328 __pyx_r = __pyx_t_4;
18330 goto __pyx_L7_try_return;
18341 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
18342 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
18343 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
18353 __Pyx_AddTraceback(
"PyClical.tanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
18354 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(0, 1844, __pyx_L5_except_error)
18355 __Pyx_GOTREF(__pyx_t_4);
18356 __Pyx_GOTREF(__pyx_t_6);
18357 __Pyx_GOTREF(__pyx_t_5);
18366 __Pyx_XDECREF(__pyx_r);
18367 __pyx_t_7 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1845, __pyx_L5_except_error)
18368 __Pyx_GOTREF(__pyx_t_7);
18369 __pyx_t_8 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_7),
tanh(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1845, __pyx_L5_except_error)
18370 __Pyx_GOTREF(__pyx_t_8);
18371 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
18372 __pyx_r = __pyx_t_8;
18374 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18375 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18376 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
18377 goto __pyx_L6_except_return;
18379 __pyx_L5_except_error:;
18388 __Pyx_XGIVEREF(__pyx_t_1);
18389 __Pyx_XGIVEREF(__pyx_t_2);
18390 __Pyx_XGIVEREF(__pyx_t_3);
18391 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
18392 goto __pyx_L1_error;
18393 __pyx_L7_try_return:;
18394 __Pyx_XGIVEREF(__pyx_t_1);
18395 __Pyx_XGIVEREF(__pyx_t_2);
18396 __Pyx_XGIVEREF(__pyx_t_3);
18397 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
18399 __pyx_L6_except_return:;
18400 __Pyx_XGIVEREF(__pyx_t_1);
18401 __Pyx_XGIVEREF(__pyx_t_2);
18402 __Pyx_XGIVEREF(__pyx_t_3);
18403 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
18417 __Pyx_XDECREF(__pyx_t_4);
18418 __Pyx_XDECREF(__pyx_t_5);
18419 __Pyx_XDECREF(__pyx_t_6);
18420 __Pyx_XDECREF(__pyx_t_7);
18421 __Pyx_XDECREF(__pyx_t_8);
18422 __Pyx_AddTraceback(
"PyClical.tanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
18425 __Pyx_XGIVEREF(__pyx_r);
18426 __Pyx_RefNannyFinishContext();
18431 static PyObject *__pyx_pw_8PyClical_77tanh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
18432 static char __pyx_doc_8PyClical_76tanh[] =
"\n Hyperbolic tangent of multivector.\n\n >>> x=clifford(\"{1,2}\") * pi/4; print(tanh(x))\n {1,2}\n ";
18433 static PyObject *__pyx_pw_8PyClical_77tanh(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18434 PyObject *__pyx_r = 0;
18435 __Pyx_RefNannyDeclarations
18436 __Pyx_RefNannySetupContext(
"tanh (wrapper)", 0);
18437 __pyx_r = __pyx_pf_8PyClical_76tanh(__pyx_self, ((PyObject *)__pyx_v_obj));
18440 __Pyx_RefNannyFinishContext();
18444 static PyObject *__pyx_pf_8PyClical_76tanh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18445 PyObject *__pyx_r = NULL;
18446 __Pyx_RefNannyDeclarations
18447 PyObject *__pyx_t_1 = NULL;
18448 int __pyx_lineno = 0;
18449 const char *__pyx_filename = NULL;
18450 int __pyx_clineno = 0;
18451 __Pyx_RefNannySetupContext(
"tanh", 0);
18452 __Pyx_XDECREF(__pyx_r);
18453 __pyx_t_1 = __pyx_f_8PyClical_tanh(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1835, __pyx_L1_error)
18454 __Pyx_GOTREF(__pyx_t_1);
18455 __pyx_r = __pyx_t_1;
18461 __Pyx_XDECREF(__pyx_t_1);
18462 __Pyx_AddTraceback(
"PyClical.tanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
18465 __Pyx_XGIVEREF(__pyx_r);
18466 __Pyx_RefNannyFinishContext();
18478 static PyObject *__pyx_pw_8PyClical_79atanh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
18479 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) {
18480 PyObject *__pyx_v_i = ((PyObject *)Py_None);
18481 PyObject *__pyx_r = NULL;
18482 __Pyx_RefNannyDeclarations
18485 PyObject *__pyx_t_3 = NULL;
18487 PyObject *__pyx_t_5 = NULL;
18488 PyObject *__pyx_t_6 = NULL;
18489 PyObject *__pyx_t_7 = NULL;
18490 PyObject *__pyx_t_8 = NULL;
18491 PyObject *__pyx_t_9 = NULL;
18492 PyObject *__pyx_t_10 = NULL;
18493 PyObject *__pyx_t_11 = NULL;
18494 int __pyx_lineno = 0;
18495 const char *__pyx_filename = NULL;
18496 int __pyx_clineno = 0;
18497 __Pyx_RefNannySetupContext(
"atanh", 0);
18498 if (__pyx_optional_args) {
18499 if (__pyx_optional_args->__pyx_n > 0) {
18500 __pyx_v_i = __pyx_optional_args->i;
18511 __pyx_t_1 = (__pyx_v_i != Py_None);
18512 __pyx_t_2 = (__pyx_t_1 != 0);
18522 __Pyx_XDECREF(__pyx_r);
18523 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1857, __pyx_L1_error)
18524 __Pyx_GOTREF(__pyx_t_3);
18526 __pyx_t_4 =
atanh(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
18528 __Pyx_CppExn2PyErr();
18529 __PYX_ERR(0, 1857, __pyx_L1_error)
18531 __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, 1857, __pyx_L1_error)
18532 __Pyx_GOTREF(__pyx_t_5);
18533 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18534 __pyx_r = __pyx_t_5;
18556 __Pyx_PyThreadState_declare
18557 __Pyx_PyThreadState_assign
18558 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
18559 __Pyx_XGOTREF(__pyx_t_6);
18560 __Pyx_XGOTREF(__pyx_t_7);
18561 __Pyx_XGOTREF(__pyx_t_8);
18571 __Pyx_XDECREF(__pyx_r);
18572 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1860, __pyx_L4_error)
18573 __Pyx_GOTREF(__pyx_t_3);
18574 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_atanh);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1860, __pyx_L4_error)
18575 __Pyx_GOTREF(__pyx_t_9);
18576 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18578 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
18579 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
18580 if (likely(__pyx_t_3)) {
18581 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
18582 __Pyx_INCREF(__pyx_t_3);
18583 __Pyx_INCREF(
function);
18584 __Pyx_DECREF_SET(__pyx_t_9,
function);
18587 __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_3, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
18588 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18589 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1860, __pyx_L4_error)
18590 __Pyx_GOTREF(__pyx_t_5);
18591 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18592 __pyx_r = __pyx_t_5;
18594 goto __pyx_L8_try_return;
18605 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18606 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
18607 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
18617 __Pyx_AddTraceback(
"PyClical.atanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
18618 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1861, __pyx_L6_except_error)
18619 __Pyx_GOTREF(__pyx_t_5);
18620 __Pyx_GOTREF(__pyx_t_9);
18621 __Pyx_GOTREF(__pyx_t_3);
18630 __Pyx_XDECREF(__pyx_r);
18631 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1862, __pyx_L6_except_error)
18632 __Pyx_GOTREF(__pyx_t_10);
18633 __pyx_t_11 = __pyx_f_8PyClical_8clifford_wrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_10),
atanh(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1862, __pyx_L6_except_error)
18634 __Pyx_GOTREF(__pyx_t_11);
18635 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
18636 __pyx_r = __pyx_t_11;
18638 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18639 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18640 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18641 goto __pyx_L7_except_return;
18643 __pyx_L6_except_error:;
18652 __Pyx_XGIVEREF(__pyx_t_6);
18653 __Pyx_XGIVEREF(__pyx_t_7);
18654 __Pyx_XGIVEREF(__pyx_t_8);
18655 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
18656 goto __pyx_L1_error;
18657 __pyx_L8_try_return:;
18658 __Pyx_XGIVEREF(__pyx_t_6);
18659 __Pyx_XGIVEREF(__pyx_t_7);
18660 __Pyx_XGIVEREF(__pyx_t_8);
18661 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
18663 __pyx_L7_except_return:;
18664 __Pyx_XGIVEREF(__pyx_t_6);
18665 __Pyx_XGIVEREF(__pyx_t_7);
18666 __Pyx_XGIVEREF(__pyx_t_8);
18667 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
18682 __Pyx_XDECREF(__pyx_t_3);
18683 __Pyx_XDECREF(__pyx_t_5);
18684 __Pyx_XDECREF(__pyx_t_9);
18685 __Pyx_XDECREF(__pyx_t_10);
18686 __Pyx_XDECREF(__pyx_t_11);
18687 __Pyx_AddTraceback(
"PyClical.atanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
18690 __Pyx_XGIVEREF(__pyx_r);
18691 __Pyx_RefNannyFinishContext();
18696 static PyObject *__pyx_pw_8PyClical_79atanh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
18697 static char __pyx_doc_8PyClical_78atanh[] =
"\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 ";
18698 static PyObject *__pyx_pw_8PyClical_79atanh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18699 PyObject *__pyx_v_obj = 0;
18700 PyObject *__pyx_v_i = 0;
18701 int __pyx_lineno = 0;
18702 const char *__pyx_filename = NULL;
18703 int __pyx_clineno = 0;
18704 PyObject *__pyx_r = 0;
18705 __Pyx_RefNannyDeclarations
18706 __Pyx_RefNannySetupContext(
"atanh (wrapper)", 0);
18708 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
18709 PyObject* values[2] = {0,0};
18710 values[1] = ((PyObject *)Py_None);
18711 if (unlikely(__pyx_kwds)) {
18712 Py_ssize_t kw_args;
18713 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
18714 switch (pos_args) {
18715 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18716 CYTHON_FALLTHROUGH;
18717 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18718 CYTHON_FALLTHROUGH;
18720 default:
goto __pyx_L5_argtuple_error;
18722 kw_args = PyDict_Size(__pyx_kwds);
18723 switch (pos_args) {
18725 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
18726 else goto __pyx_L5_argtuple_error;
18727 CYTHON_FALLTHROUGH;
18730 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
18731 if (value) { values[1] = value; kw_args--; }
18734 if (unlikely(kw_args > 0)) {
18735 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"atanh") < 0)) __PYX_ERR(0, 1847, __pyx_L3_error)
18738 switch (PyTuple_GET_SIZE(__pyx_args)) {
18739 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18740 CYTHON_FALLTHROUGH;
18741 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18743 default:
goto __pyx_L5_argtuple_error;
18746 __pyx_v_obj = values[0];
18747 __pyx_v_i = values[1];
18749 goto __pyx_L4_argument_unpacking_done;
18750 __pyx_L5_argtuple_error:;
18751 __Pyx_RaiseArgtupleInvalid(
"atanh", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1847, __pyx_L3_error)
18753 __Pyx_AddTraceback(
"PyClical.atanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
18754 __Pyx_RefNannyFinishContext();
18756 __pyx_L4_argument_unpacking_done:;
18757 __pyx_r = __pyx_pf_8PyClical_78atanh(__pyx_self, __pyx_v_obj, __pyx_v_i);
18760 __Pyx_RefNannyFinishContext();
18764 static PyObject *__pyx_pf_8PyClical_78atanh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
18765 PyObject *__pyx_r = NULL;
18766 __Pyx_RefNannyDeclarations
18767 PyObject *__pyx_t_1 = NULL;
18768 struct __pyx_opt_args_8PyClical_atanh __pyx_t_2;
18769 int __pyx_lineno = 0;
18770 const char *__pyx_filename = NULL;
18771 int __pyx_clineno = 0;
18772 __Pyx_RefNannySetupContext(
"atanh", 0);
18773 __Pyx_XDECREF(__pyx_r);
18774 __pyx_t_2.__pyx_n = 1;
18775 __pyx_t_2.i = __pyx_v_i;
18776 __pyx_t_1 = __pyx_f_8PyClical_atanh(__pyx_v_obj, 0, &__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1847, __pyx_L1_error)
18777 __Pyx_GOTREF(__pyx_t_1);
18778 __pyx_r = __pyx_t_1;
18784 __Pyx_XDECREF(__pyx_t_1);
18785 __Pyx_AddTraceback(
"PyClical.atanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
18788 __Pyx_XGIVEREF(__pyx_r);
18789 __Pyx_RefNannyFinishContext();
18801 static PyObject *__pyx_pw_8PyClical_81random_clifford(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
18802 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) {
18803 PyObject *__pyx_v_fill = ((PyObject *)__pyx_float_1_0);
18804 PyObject *__pyx_r = NULL;
18805 __Pyx_RefNannyDeclarations
18806 PyObject *__pyx_t_1 = NULL;
18807 PyObject *__pyx_t_2 = NULL;
18809 PyObject *__pyx_t_4 = NULL;
18810 int __pyx_lineno = 0;
18811 const char *__pyx_filename = NULL;
18812 int __pyx_clineno = 0;
18813 __Pyx_RefNannySetupContext(
"random_clifford", 0);
18814 if (__pyx_optional_args) {
18815 if (__pyx_optional_args->__pyx_n > 0) {
18816 __pyx_v_fill = __pyx_optional_args->fill;
18827 __Pyx_XDECREF(__pyx_r);
18828 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1871, __pyx_L1_error)
18829 __Pyx_GOTREF(__pyx_t_1);
18830 __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1871, __pyx_L1_error)
18831 __Pyx_GOTREF(__pyx_t_2);
18832 __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_fill);
if (unlikely((__pyx_t_3 == ((
scalar_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1871, __pyx_L1_error)
18833 __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, 1871, __pyx_L1_error)
18834 __Pyx_GOTREF(__pyx_t_4);
18835 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18836 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18837 __pyx_r = __pyx_t_4;
18851 __Pyx_XDECREF(__pyx_t_1);
18852 __Pyx_XDECREF(__pyx_t_2);
18853 __Pyx_XDECREF(__pyx_t_4);
18854 __Pyx_AddTraceback(
"PyClical.random_clifford", __pyx_clineno, __pyx_lineno, __pyx_filename);
18857 __Pyx_XGIVEREF(__pyx_r);
18858 __Pyx_RefNannyFinishContext();
18863 static PyObject *__pyx_pw_8PyClical_81random_clifford(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
18864 static char __pyx_doc_8PyClical_80random_clifford[] =
"\n Random multivector within a frame.\n\n >>> print(random_clifford(index_set({-3,-1,2})).frame())\n {-3,-1,2}\n ";
18865 static PyObject *__pyx_pw_8PyClical_81random_clifford(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18866 struct __pyx_obj_8PyClical_index_set *__pyx_v_ixt = 0;
18867 PyObject *__pyx_v_fill = 0;
18868 int __pyx_lineno = 0;
18869 const char *__pyx_filename = NULL;
18870 int __pyx_clineno = 0;
18871 PyObject *__pyx_r = 0;
18872 __Pyx_RefNannyDeclarations
18873 __Pyx_RefNannySetupContext(
"random_clifford (wrapper)", 0);
18875 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ixt,&__pyx_n_s_fill,0};
18876 PyObject* values[2] = {0,0};
18877 values[1] = ((PyObject *)__pyx_float_1_0);
18878 if (unlikely(__pyx_kwds)) {
18879 Py_ssize_t kw_args;
18880 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
18881 switch (pos_args) {
18882 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18883 CYTHON_FALLTHROUGH;
18884 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18885 CYTHON_FALLTHROUGH;
18887 default:
goto __pyx_L5_argtuple_error;
18889 kw_args = PyDict_Size(__pyx_kwds);
18890 switch (pos_args) {
18892 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ixt)) != 0)) kw_args--;
18893 else goto __pyx_L5_argtuple_error;
18894 CYTHON_FALLTHROUGH;
18897 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fill);
18898 if (value) { values[1] = value; kw_args--; }
18901 if (unlikely(kw_args > 0)) {
18902 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"random_clifford") < 0)) __PYX_ERR(0, 1864, __pyx_L3_error)
18905 switch (PyTuple_GET_SIZE(__pyx_args)) {
18906 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18907 CYTHON_FALLTHROUGH;
18908 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18910 default:
goto __pyx_L5_argtuple_error;
18913 __pyx_v_ixt = ((
struct __pyx_obj_8PyClical_index_set *)values[0]);
18914 __pyx_v_fill = values[1];
18916 goto __pyx_L4_argument_unpacking_done;
18917 __pyx_L5_argtuple_error:;
18918 __Pyx_RaiseArgtupleInvalid(
"random_clifford", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1864, __pyx_L3_error)
18920 __Pyx_AddTraceback(
"PyClical.random_clifford", __pyx_clineno, __pyx_lineno, __pyx_filename);
18921 __Pyx_RefNannyFinishContext();
18923 __pyx_L4_argument_unpacking_done:;
18924 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ixt), __pyx_ptype_8PyClical_index_set, 1,
"ixt", 0))) __PYX_ERR(0, 1864, __pyx_L1_error)
18925 __pyx_r = __pyx_pf_8PyClical_80random_clifford(__pyx_self, __pyx_v_ixt, __pyx_v_fill);
18932 __Pyx_RefNannyFinishContext();
18936 static PyObject *__pyx_pf_8PyClical_80random_clifford(CYTHON_UNUSED PyObject *__pyx_self,
struct __pyx_obj_8PyClical_index_set *__pyx_v_ixt, PyObject *__pyx_v_fill) {
18937 PyObject *__pyx_r = NULL;
18938 __Pyx_RefNannyDeclarations
18939 PyObject *__pyx_t_1 = NULL;
18940 struct __pyx_opt_args_8PyClical_random_clifford __pyx_t_2;
18941 int __pyx_lineno = 0;
18942 const char *__pyx_filename = NULL;
18943 int __pyx_clineno = 0;
18944 __Pyx_RefNannySetupContext(
"random_clifford", 0);
18945 __Pyx_XDECREF(__pyx_r);
18946 __pyx_t_2.__pyx_n = 1;
18947 __pyx_t_2.fill = __pyx_v_fill;
18948 __pyx_t_1 = __pyx_f_8PyClical_random_clifford(__pyx_v_ixt, 0, &__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1864, __pyx_L1_error)
18949 __Pyx_GOTREF(__pyx_t_1);
18950 __pyx_r = __pyx_t_1;
18956 __Pyx_XDECREF(__pyx_t_1);
18957 __Pyx_AddTraceback(
"PyClical.random_clifford", __pyx_clineno, __pyx_lineno, __pyx_filename);
18960 __Pyx_XGIVEREF(__pyx_r);
18961 __Pyx_RefNannyFinishContext();
18973 static PyObject *__pyx_pw_8PyClical_83cga3(PyObject *__pyx_self, PyObject *__pyx_v_obj);
18974 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cga3(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
18975 PyObject *__pyx_r = NULL;
18976 __Pyx_RefNannyDeclarations
18977 PyObject *__pyx_t_1 = NULL;
18978 PyObject *__pyx_t_2 = NULL;
18979 int __pyx_lineno = 0;
18980 const char *__pyx_filename = NULL;
18981 int __pyx_clineno = 0;
18982 __Pyx_RefNannySetupContext(
"cga3", 0);
18991 __Pyx_XDECREF(__pyx_r);
18992 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1880, __pyx_L1_error)
18993 __Pyx_GOTREF(__pyx_t_1);
18994 __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, 1880, __pyx_L1_error)
18995 __Pyx_GOTREF(__pyx_t_2);
18996 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18997 __pyx_r = __pyx_t_2;
19011 __Pyx_XDECREF(__pyx_t_1);
19012 __Pyx_XDECREF(__pyx_t_2);
19013 __Pyx_AddTraceback(
"PyClical.cga3", __pyx_clineno, __pyx_lineno, __pyx_filename);
19016 __Pyx_XGIVEREF(__pyx_r);
19017 __Pyx_RefNannyFinishContext();
19022 static PyObject *__pyx_pw_8PyClical_83cga3(PyObject *__pyx_self, PyObject *__pyx_v_obj);
19023 static char __pyx_doc_8PyClical_82cga3[] =
"\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 ";
19024 static PyObject *__pyx_pw_8PyClical_83cga3(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
19025 PyObject *__pyx_r = 0;
19026 __Pyx_RefNannyDeclarations
19027 __Pyx_RefNannySetupContext(
"cga3 (wrapper)", 0);
19028 __pyx_r = __pyx_pf_8PyClical_82cga3(__pyx_self, ((PyObject *)__pyx_v_obj));
19031 __Pyx_RefNannyFinishContext();
19035 static PyObject *__pyx_pf_8PyClical_82cga3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
19036 PyObject *__pyx_r = NULL;
19037 __Pyx_RefNannyDeclarations
19038 PyObject *__pyx_t_1 = NULL;
19039 int __pyx_lineno = 0;
19040 const char *__pyx_filename = NULL;
19041 int __pyx_clineno = 0;
19042 __Pyx_RefNannySetupContext(
"cga3", 0);
19043 __Pyx_XDECREF(__pyx_r);
19044 __pyx_t_1 = __pyx_f_8PyClical_cga3(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1873, __pyx_L1_error)
19045 __Pyx_GOTREF(__pyx_t_1);
19046 __pyx_r = __pyx_t_1;
19052 __Pyx_XDECREF(__pyx_t_1);
19053 __Pyx_AddTraceback(
"PyClical.cga3", __pyx_clineno, __pyx_lineno, __pyx_filename);
19056 __Pyx_XGIVEREF(__pyx_r);
19057 __Pyx_RefNannyFinishContext();
19069 static PyObject *__pyx_pw_8PyClical_85cga3std(PyObject *__pyx_self, PyObject *__pyx_v_obj);
19070 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cga3std(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
19071 PyObject *__pyx_r = NULL;
19072 __Pyx_RefNannyDeclarations
19073 PyObject *__pyx_t_1 = NULL;
19074 PyObject *__pyx_t_2 = NULL;
19075 int __pyx_lineno = 0;
19076 const char *__pyx_filename = NULL;
19077 int __pyx_clineno = 0;
19078 __Pyx_RefNannySetupContext(
"cga3std", 0);
19087 __Pyx_XDECREF(__pyx_r);
19088 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1891, __pyx_L1_error)
19089 __Pyx_GOTREF(__pyx_t_1);
19090 __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, 1891, __pyx_L1_error)
19091 __Pyx_GOTREF(__pyx_t_2);
19092 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19093 __pyx_r = __pyx_t_2;
19107 __Pyx_XDECREF(__pyx_t_1);
19108 __Pyx_XDECREF(__pyx_t_2);
19109 __Pyx_AddTraceback(
"PyClical.cga3std", __pyx_clineno, __pyx_lineno, __pyx_filename);
19112 __Pyx_XGIVEREF(__pyx_r);
19113 __Pyx_RefNannyFinishContext();
19118 static PyObject *__pyx_pw_8PyClical_85cga3std(PyObject *__pyx_self, PyObject *__pyx_v_obj);
19119 static char __pyx_doc_8PyClical_84cga3std[] =
"\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 ";
19120 static PyObject *__pyx_pw_8PyClical_85cga3std(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
19121 PyObject *__pyx_r = 0;
19122 __Pyx_RefNannyDeclarations
19123 __Pyx_RefNannySetupContext(
"cga3std (wrapper)", 0);
19124 __pyx_r = __pyx_pf_8PyClical_84cga3std(__pyx_self, ((PyObject *)__pyx_v_obj));
19127 __Pyx_RefNannyFinishContext();
19131 static PyObject *__pyx_pf_8PyClical_84cga3std(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
19132 PyObject *__pyx_r = NULL;
19133 __Pyx_RefNannyDeclarations
19134 PyObject *__pyx_t_1 = NULL;
19135 int __pyx_lineno = 0;
19136 const char *__pyx_filename = NULL;
19137 int __pyx_clineno = 0;
19138 __Pyx_RefNannySetupContext(
"cga3std", 0);
19139 __Pyx_XDECREF(__pyx_r);
19140 __pyx_t_1 = __pyx_f_8PyClical_cga3std(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1882, __pyx_L1_error)
19141 __Pyx_GOTREF(__pyx_t_1);
19142 __pyx_r = __pyx_t_1;
19148 __Pyx_XDECREF(__pyx_t_1);
19149 __Pyx_AddTraceback(
"PyClical.cga3std", __pyx_clineno, __pyx_lineno, __pyx_filename);
19152 __Pyx_XGIVEREF(__pyx_r);
19153 __Pyx_RefNannyFinishContext();
19165 static PyObject *__pyx_pw_8PyClical_87agc3(PyObject *__pyx_self, PyObject *__pyx_v_obj);
19166 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_agc3(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
19167 PyObject *__pyx_r = NULL;
19168 __Pyx_RefNannyDeclarations
19169 PyObject *__pyx_t_1 = NULL;
19170 PyObject *__pyx_t_2 = NULL;
19171 int __pyx_lineno = 0;
19172 const char *__pyx_filename = NULL;
19173 int __pyx_clineno = 0;
19174 __Pyx_RefNannySetupContext(
"agc3", 0);
19183 __Pyx_XDECREF(__pyx_r);
19184 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1902, __pyx_L1_error)
19185 __Pyx_GOTREF(__pyx_t_1);
19186 __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, 1902, __pyx_L1_error)
19187 __Pyx_GOTREF(__pyx_t_2);
19188 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19189 __pyx_r = __pyx_t_2;
19203 __Pyx_XDECREF(__pyx_t_1);
19204 __Pyx_XDECREF(__pyx_t_2);
19205 __Pyx_AddTraceback(
"PyClical.agc3", __pyx_clineno, __pyx_lineno, __pyx_filename);
19208 __Pyx_XGIVEREF(__pyx_r);
19209 __Pyx_RefNannyFinishContext();
19214 static PyObject *__pyx_pw_8PyClical_87agc3(PyObject *__pyx_self, PyObject *__pyx_v_obj);
19215 static char __pyx_doc_8PyClical_86agc3[] =
"\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 ";
19216 static PyObject *__pyx_pw_8PyClical_87agc3(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
19217 PyObject *__pyx_r = 0;
19218 __Pyx_RefNannyDeclarations
19219 __Pyx_RefNannySetupContext(
"agc3 (wrapper)", 0);
19220 __pyx_r = __pyx_pf_8PyClical_86agc3(__pyx_self, ((PyObject *)__pyx_v_obj));
19223 __Pyx_RefNannyFinishContext();
19227 static PyObject *__pyx_pf_8PyClical_86agc3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
19228 PyObject *__pyx_r = NULL;
19229 __Pyx_RefNannyDeclarations
19230 PyObject *__pyx_t_1 = NULL;
19231 int __pyx_lineno = 0;
19232 const char *__pyx_filename = NULL;
19233 int __pyx_clineno = 0;
19234 __Pyx_RefNannySetupContext(
"agc3", 0);
19235 __Pyx_XDECREF(__pyx_r);
19236 __pyx_t_1 = __pyx_f_8PyClical_agc3(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1893, __pyx_L1_error)
19237 __Pyx_GOTREF(__pyx_t_1);
19238 __pyx_r = __pyx_t_1;
19244 __Pyx_XDECREF(__pyx_t_1);
19245 __Pyx_AddTraceback(
"PyClical.agc3", __pyx_clineno, __pyx_lineno, __pyx_filename);
19248 __Pyx_XGIVEREF(__pyx_r);
19249 __Pyx_RefNannyFinishContext();
19262 static PyObject *__pyx_pw_8PyClical_89e(PyObject *__pyx_self, PyObject *__pyx_v_obj);
19263 static char __pyx_doc_8PyClical_88e[] =
"\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 ";
19264 static PyMethodDef __pyx_mdef_8PyClical_89e = {
"e", (PyCFunction)__pyx_pw_8PyClical_89e, METH_O, __pyx_doc_8PyClical_88e};
19265 static PyObject *__pyx_pw_8PyClical_89e(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
19266 PyObject *__pyx_r = 0;
19267 __Pyx_RefNannyDeclarations
19268 __Pyx_RefNannySetupContext(
"e (wrapper)", 0);
19269 __pyx_r = __pyx_pf_8PyClical_88e(__pyx_self, ((PyObject *)__pyx_v_obj));
19272 __Pyx_RefNannyFinishContext();
19276 static PyObject *__pyx_pf_8PyClical_88e(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
19277 PyObject *__pyx_r = NULL;
19278 __Pyx_RefNannyDeclarations
19279 PyObject *__pyx_t_1 = NULL;
19280 PyObject *__pyx_t_2 = NULL;
19281 int __pyx_lineno = 0;
19282 const char *__pyx_filename = NULL;
19283 int __pyx_clineno = 0;
19284 __Pyx_RefNannySetupContext(
"e", 0);
19293 __Pyx_XDECREF(__pyx_r);
19294 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_index_set), __pyx_v_obj);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1947, __pyx_L1_error)
19295 __Pyx_GOTREF(__pyx_t_1);
19296 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1947, __pyx_L1_error)
19297 __Pyx_GOTREF(__pyx_t_2);
19298 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19299 __pyx_r = __pyx_t_2;
19313 __Pyx_XDECREF(__pyx_t_1);
19314 __Pyx_XDECREF(__pyx_t_2);
19315 __Pyx_AddTraceback(
"PyClical.e", __pyx_clineno, __pyx_lineno, __pyx_filename);
19318 __Pyx_XGIVEREF(__pyx_r);
19319 __Pyx_RefNannyFinishContext();
19332 static PyObject *__pyx_pw_8PyClical_91istpq(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
19333 static char __pyx_doc_8PyClical_90istpq[] =
"\n Abbreviation for index_set({-q,...p}).\n\n >>> print(istpq(2,3))\n {-3,-2,-1,1,2}\n ";
19334 static PyMethodDef __pyx_mdef_8PyClical_91istpq = {
"istpq", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_91istpq, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_90istpq};
19335 static PyObject *__pyx_pw_8PyClical_91istpq(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
19336 PyObject *__pyx_v_p = 0;
19337 PyObject *__pyx_v_q = 0;
19338 int __pyx_lineno = 0;
19339 const char *__pyx_filename = NULL;
19340 int __pyx_clineno = 0;
19341 PyObject *__pyx_r = 0;
19342 __Pyx_RefNannyDeclarations
19343 __Pyx_RefNannySetupContext(
"istpq (wrapper)", 0);
19345 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,&__pyx_n_s_q,0};
19346 PyObject* values[2] = {0,0};
19347 if (unlikely(__pyx_kwds)) {
19348 Py_ssize_t kw_args;
19349 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
19350 switch (pos_args) {
19351 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19352 CYTHON_FALLTHROUGH;
19353 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19354 CYTHON_FALLTHROUGH;
19356 default:
goto __pyx_L5_argtuple_error;
19358 kw_args = PyDict_Size(__pyx_kwds);
19359 switch (pos_args) {
19361 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p)) != 0)) kw_args--;
19362 else goto __pyx_L5_argtuple_error;
19363 CYTHON_FALLTHROUGH;
19365 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q)) != 0)) kw_args--;
19367 __Pyx_RaiseArgtupleInvalid(
"istpq", 1, 2, 2, 1); __PYX_ERR(0, 1949, __pyx_L3_error)
19370 if (unlikely(kw_args > 0)) {
19371 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"istpq") < 0)) __PYX_ERR(0, 1949, __pyx_L3_error)
19373 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
19374 goto __pyx_L5_argtuple_error;
19376 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19377 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19379 __pyx_v_p = values[0];
19380 __pyx_v_q = values[1];
19382 goto __pyx_L4_argument_unpacking_done;
19383 __pyx_L5_argtuple_error:;
19384 __Pyx_RaiseArgtupleInvalid(
"istpq", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1949, __pyx_L3_error)
19386 __Pyx_AddTraceback(
"PyClical.istpq", __pyx_clineno, __pyx_lineno, __pyx_filename);
19387 __Pyx_RefNannyFinishContext();
19389 __pyx_L4_argument_unpacking_done:;
19390 __pyx_r = __pyx_pf_8PyClical_90istpq(__pyx_self, __pyx_v_p, __pyx_v_q);
19393 __Pyx_RefNannyFinishContext();
19397 static PyObject *__pyx_pf_8PyClical_90istpq(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_p, PyObject *__pyx_v_q) {
19398 PyObject *__pyx_r = NULL;
19399 __Pyx_RefNannyDeclarations
19400 PyObject *__pyx_t_1 = NULL;
19401 PyObject *__pyx_t_2 = NULL;
19402 PyObject *__pyx_t_3 = NULL;
19403 int __pyx_lineno = 0;
19404 const char *__pyx_filename = NULL;
19405 int __pyx_clineno = 0;
19406 __Pyx_RefNannySetupContext(
"istpq", 0);
19415 __Pyx_XDECREF(__pyx_r);
19416 __pyx_t_1 = PyNumber_Negative(__pyx_v_q);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1956, __pyx_L1_error)
19417 __Pyx_GOTREF(__pyx_t_1);
19418 __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_p, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1956, __pyx_L1_error)
19419 __Pyx_GOTREF(__pyx_t_2);
19420 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1956, __pyx_L1_error)
19421 __Pyx_GOTREF(__pyx_t_3);
19422 __Pyx_GIVEREF(__pyx_t_1);
19423 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
19424 __Pyx_GIVEREF(__pyx_t_2);
19425 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
19428 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1956, __pyx_L1_error)
19429 __Pyx_GOTREF(__pyx_t_2);
19430 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19431 __pyx_t_3 = PySet_New(__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1956, __pyx_L1_error)
19432 __Pyx_GOTREF(__pyx_t_3);
19433 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19434 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_index_set), __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1956, __pyx_L1_error)
19435 __Pyx_GOTREF(__pyx_t_2);
19436 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19437 __pyx_r = __pyx_t_2;
19451 __Pyx_XDECREF(__pyx_t_1);
19452 __Pyx_XDECREF(__pyx_t_2);
19453 __Pyx_XDECREF(__pyx_t_3);
19454 __Pyx_AddTraceback(
"PyClical.istpq", __pyx_clineno, __pyx_lineno, __pyx_filename);
19457 __Pyx_XGIVEREF(__pyx_r);
19458 __Pyx_RefNannyFinishContext();
19471 static PyObject *__pyx_pw_8PyClical_93_test(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused);
19472 static PyMethodDef __pyx_mdef_8PyClical_93_test = {
"_test", (PyCFunction)__pyx_pw_8PyClical_93_test, METH_NOARGS, 0};
19473 static PyObject *__pyx_pw_8PyClical_93_test(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
19474 PyObject *__pyx_r = 0;
19475 __Pyx_RefNannyDeclarations
19476 __Pyx_RefNannySetupContext(
"_test (wrapper)", 0);
19477 __pyx_r = __pyx_pf_8PyClical_92_test(__pyx_self);
19480 __Pyx_RefNannyFinishContext();
19484 static PyObject *__pyx_pf_8PyClical_92_test(CYTHON_UNUSED PyObject *__pyx_self) {
19485 PyObject *__pyx_v_PyClical = NULL;
19486 PyObject *__pyx_v_doctest = NULL;
19487 PyObject *__pyx_r = NULL;
19488 __Pyx_RefNannyDeclarations
19489 PyObject *__pyx_t_1 = NULL;
19490 PyObject *__pyx_t_2 = NULL;
19491 PyObject *__pyx_t_3 = NULL;
19492 int __pyx_lineno = 0;
19493 const char *__pyx_filename = NULL;
19494 int __pyx_clineno = 0;
19495 __Pyx_RefNannySetupContext(
"_test", 0);
19504 __pyx_t_1 = __Pyx_Import(__pyx_n_s_PyClical, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1963, __pyx_L1_error)
19505 __Pyx_GOTREF(__pyx_t_1);
19506 __pyx_v_PyClical = __pyx_t_1;
19508 __pyx_t_1 = __Pyx_Import(__pyx_n_s_doctest, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1963, __pyx_L1_error)
19509 __Pyx_GOTREF(__pyx_t_1);
19510 __pyx_v_doctest = __pyx_t_1;
19520 __Pyx_XDECREF(__pyx_r);
19521 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_doctest, __pyx_n_s_testmod);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1964, __pyx_L1_error)
19522 __Pyx_GOTREF(__pyx_t_2);
19524 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
19525 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
19526 if (likely(__pyx_t_3)) {
19527 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
19528 __Pyx_INCREF(__pyx_t_3);
19529 __Pyx_INCREF(
function);
19530 __Pyx_DECREF_SET(__pyx_t_2,
function);
19533 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_PyClical) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_PyClical);
19534 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
19535 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1964, __pyx_L1_error)
19536 __Pyx_GOTREF(__pyx_t_1);
19537 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19538 __pyx_r = __pyx_t_1;
19552 __Pyx_XDECREF(__pyx_t_1);
19553 __Pyx_XDECREF(__pyx_t_2);
19554 __Pyx_XDECREF(__pyx_t_3);
19555 __Pyx_AddTraceback(
"PyClical._test", __pyx_clineno, __pyx_lineno, __pyx_filename);
19558 __Pyx_XDECREF(__pyx_v_PyClical);
19559 __Pyx_XDECREF(__pyx_v_doctest);
19560 __Pyx_XGIVEREF(__pyx_r);
19561 __Pyx_RefNannyFinishContext();
19573 static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_string(std::string
const &__pyx_v_s) {
19574 PyObject *__pyx_r = NULL;
19575 __Pyx_RefNannyDeclarations
19576 PyObject *__pyx_t_1 = NULL;
19577 int __pyx_lineno = 0;
19578 const char *__pyx_filename = NULL;
19579 int __pyx_clineno = 0;
19580 __Pyx_RefNannySetupContext(
"__pyx_convert_PyObject_string_to_py_std__in_string", 0);
19589 __Pyx_XDECREF(__pyx_r);
19590 __pyx_t_1 = __Pyx_PyObject_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size());
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 32, __pyx_L1_error)
19591 __Pyx_GOTREF(__pyx_t_1);
19592 __pyx_r = __pyx_t_1;
19606 __Pyx_XDECREF(__pyx_t_1);
19607 __Pyx_AddTraceback(
"string.to_py.__pyx_convert_PyObject_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
19610 __Pyx_XGIVEREF(__pyx_r);
19611 __Pyx_RefNannyFinishContext();
19623 static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_string(std::string
const &__pyx_v_s) {
19624 PyObject *__pyx_r = NULL;
19625 __Pyx_RefNannyDeclarations
19626 PyObject *__pyx_t_1 = NULL;
19627 int __pyx_lineno = 0;
19628 const char *__pyx_filename = NULL;
19629 int __pyx_clineno = 0;
19630 __Pyx_RefNannySetupContext(
"__pyx_convert_PyUnicode_string_to_py_std__in_string", 0);
19639 __Pyx_XDECREF(__pyx_r);
19640 __pyx_t_1 = __Pyx_PyUnicode_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size());
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 38, __pyx_L1_error)
19641 __Pyx_GOTREF(__pyx_t_1);
19642 __pyx_r = __pyx_t_1;
19656 __Pyx_XDECREF(__pyx_t_1);
19657 __Pyx_AddTraceback(
"string.to_py.__pyx_convert_PyUnicode_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
19660 __Pyx_XGIVEREF(__pyx_r);
19661 __Pyx_RefNannyFinishContext();
19673 static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(std::string
const &__pyx_v_s) {
19674 PyObject *__pyx_r = NULL;
19675 __Pyx_RefNannyDeclarations
19676 PyObject *__pyx_t_1 = NULL;
19677 int __pyx_lineno = 0;
19678 const char *__pyx_filename = NULL;
19679 int __pyx_clineno = 0;
19680 __Pyx_RefNannySetupContext(
"__pyx_convert_PyStr_string_to_py_std__in_string", 0);
19689 __Pyx_XDECREF(__pyx_r);
19690 __pyx_t_1 = __Pyx_PyStr_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size());
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 44, __pyx_L1_error)
19691 __Pyx_GOTREF(__pyx_t_1);
19692 __pyx_r = __pyx_t_1;
19706 __Pyx_XDECREF(__pyx_t_1);
19707 __Pyx_AddTraceback(
"string.to_py.__pyx_convert_PyStr_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
19710 __Pyx_XGIVEREF(__pyx_r);
19711 __Pyx_RefNannyFinishContext();
19723 static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string(std::string
const &__pyx_v_s) {
19724 PyObject *__pyx_r = NULL;
19725 __Pyx_RefNannyDeclarations
19726 PyObject *__pyx_t_1 = NULL;
19727 int __pyx_lineno = 0;
19728 const char *__pyx_filename = NULL;
19729 int __pyx_clineno = 0;
19730 __Pyx_RefNannySetupContext(
"__pyx_convert_PyBytes_string_to_py_std__in_string", 0);
19739 __Pyx_XDECREF(__pyx_r);
19740 __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size());
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 50, __pyx_L1_error)
19741 __Pyx_GOTREF(__pyx_t_1);
19742 __pyx_r = __pyx_t_1;
19756 __Pyx_XDECREF(__pyx_t_1);
19757 __Pyx_AddTraceback(
"string.to_py.__pyx_convert_PyBytes_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
19760 __Pyx_XGIVEREF(__pyx_r);
19761 __Pyx_RefNannyFinishContext();
19773 static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_string(std::string
const &__pyx_v_s) {
19774 PyObject *__pyx_r = NULL;
19775 __Pyx_RefNannyDeclarations
19776 PyObject *__pyx_t_1 = NULL;
19777 int __pyx_lineno = 0;
19778 const char *__pyx_filename = NULL;
19779 int __pyx_clineno = 0;
19780 __Pyx_RefNannySetupContext(
"__pyx_convert_PyByteArray_string_to_py_std__in_string", 0);
19788 __Pyx_XDECREF(__pyx_r);
19789 __pyx_t_1 = __Pyx_PyByteArray_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size());
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 56, __pyx_L1_error)
19790 __Pyx_GOTREF(__pyx_t_1);
19791 __pyx_r = __pyx_t_1;
19805 __Pyx_XDECREF(__pyx_t_1);
19806 __Pyx_AddTraceback(
"string.to_py.__pyx_convert_PyByteArray_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
19809 __Pyx_XGIVEREF(__pyx_r);
19810 __Pyx_RefNannyFinishContext();
19813 static struct __pyx_vtabstruct_8PyClical_index_set __pyx_vtable_8PyClical_index_set;
19815 static PyObject *__pyx_tp_new_8PyClical_index_set(PyTypeObject *t, PyObject *a, PyObject *k) {
19816 struct __pyx_obj_8PyClical_index_set *p;
19818 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
19819 o = (*t->tp_alloc)(t, 0);
19821 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
19823 if (unlikely(!o))
return 0;
19824 p = ((
struct __pyx_obj_8PyClical_index_set *)o);
19825 p->__pyx_vtab = __pyx_vtabptr_8PyClical_index_set;
19826 if (unlikely(__pyx_pw_8PyClical_9index_set_3__cinit__(o, a, k) < 0))
goto bad;
19829 Py_DECREF(o); o = 0;
19833 static void __pyx_tp_dealloc_8PyClical_index_set(PyObject *o) {
19834 #if CYTHON_USE_TP_FINALIZE 19835 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))) {
19836 if (PyObject_CallFinalizerFromDealloc(o))
return;
19840 PyObject *etype, *eval, *etb;
19841 PyErr_Fetch(&etype, &eval, &etb);
19842 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
19843 __pyx_pw_8PyClical_9index_set_5__dealloc__(o);
19844 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
19845 PyErr_Restore(etype, eval, etb);
19847 (*Py_TYPE(o)->tp_free)(o);
19849 static PyObject *__pyx_sq_item_8PyClical_index_set(PyObject *o, Py_ssize_t
i) {
19851 PyObject *x = PyInt_FromSsize_t(
i);
if(!x)
return 0;
19852 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
19857 static int __pyx_mp_ass_subscript_8PyClical_index_set(PyObject *o, PyObject *
i, PyObject *v) {
19859 return __pyx_pw_8PyClical_9index_set_9__setitem__(o,
i, v);
19862 PyErr_Format(PyExc_NotImplementedError,
19863 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
19868 static PyMethodDef __pyx_methods_8PyClical_index_set[] = {
19869 {
"copy", (PyCFunction)__pyx_pw_8PyClical_9index_set_1copy, METH_NOARGS, __pyx_doc_8PyClical_9index_set_copy},
19870 {
"count", (PyCFunction)__pyx_pw_8PyClical_9index_set_32count, METH_NOARGS, __pyx_doc_8PyClical_9index_set_31count},
19871 {
"count_neg", (PyCFunction)__pyx_pw_8PyClical_9index_set_34count_neg, METH_NOARGS, __pyx_doc_8PyClical_9index_set_33count_neg},
19872 {
"count_pos", (PyCFunction)__pyx_pw_8PyClical_9index_set_36count_pos, METH_NOARGS, __pyx_doc_8PyClical_9index_set_35count_pos},
19873 {
"min", (PyCFunction)__pyx_pw_8PyClical_9index_set_38min, METH_NOARGS, __pyx_doc_8PyClical_9index_set_37min},
19874 {
"max", (PyCFunction)__pyx_pw_8PyClical_9index_set_40max, METH_NOARGS, __pyx_doc_8PyClical_9index_set_39max},
19875 {
"hash_fn", (PyCFunction)__pyx_pw_8PyClical_9index_set_42hash_fn, METH_NOARGS, __pyx_doc_8PyClical_9index_set_41hash_fn},
19876 {
"sign_of_mult", (PyCFunction)__pyx_pw_8PyClical_9index_set_44sign_of_mult, METH_O, __pyx_doc_8PyClical_9index_set_43sign_of_mult},
19877 {
"sign_of_square", (PyCFunction)__pyx_pw_8PyClical_9index_set_46sign_of_square, METH_NOARGS, __pyx_doc_8PyClical_9index_set_45sign_of_square},
19878 {
"__reduce_cython__", (PyCFunction)__pyx_pw_8PyClical_9index_set_52__reduce_cython__, METH_NOARGS, 0},
19879 {
"__setstate_cython__", (PyCFunction)__pyx_pw_8PyClical_9index_set_54__setstate_cython__, METH_O, 0},
19883 static PyNumberMethods __pyx_tp_as_number_index_set = {
19887 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 19897 __pyx_pw_8PyClical_9index_set_18__invert__,
19900 __pyx_pw_8PyClical_9index_set_24__and__,
19901 __pyx_pw_8PyClical_9index_set_20__xor__,
19902 __pyx_pw_8PyClical_9index_set_28__or__,
19903 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 19907 #if PY_MAJOR_VERSION < 3 19913 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 19916 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 19922 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 19929 __pyx_pw_8PyClical_9index_set_26__iand__,
19930 __pyx_pw_8PyClical_9index_set_22__ixor__,
19931 __pyx_pw_8PyClical_9index_set_30__ior__,
19937 #if PY_VERSION_HEX >= 0x03050000 19940 #if PY_VERSION_HEX >= 0x03050000 19945 static PySequenceMethods __pyx_tp_as_sequence_index_set = {
19949 __pyx_sq_item_8PyClical_index_set,
19953 __pyx_pw_8PyClical_9index_set_13__contains__,
19958 static PyMappingMethods __pyx_tp_as_mapping_index_set = {
19960 __pyx_pw_8PyClical_9index_set_11__getitem__,
19961 __pyx_mp_ass_subscript_8PyClical_index_set,
19964 static PyTypeObject __pyx_type_8PyClical_index_set = {
19965 PyVarObject_HEAD_INIT(0, 0)
19966 "PyClical.index_set",
19967 sizeof(
struct __pyx_obj_8PyClical_index_set),
19969 __pyx_tp_dealloc_8PyClical_index_set,
19970 #if PY_VERSION_HEX < 0x030800b4
19973 #if PY_VERSION_HEX >= 0x030800b4
19978 #if PY_MAJOR_VERSION < 3 19981 #if PY_MAJOR_VERSION >= 3 19984 __pyx_pw_8PyClical_9index_set_48__repr__,
19985 &__pyx_tp_as_number_index_set,
19986 &__pyx_tp_as_sequence_index_set,
19987 &__pyx_tp_as_mapping_index_set,
19990 __pyx_pw_8PyClical_9index_set_50__str__,
19994 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
19995 "\n Python class index_set wraps C++ class IndexSet.\n ",
19998 __pyx_pw_8PyClical_9index_set_7__richcmp__,
20000 __pyx_pw_8PyClical_9index_set_15__iter__,
20002 __pyx_methods_8PyClical_index_set,
20012 __pyx_tp_new_8PyClical_index_set,
20022 #if PY_VERSION_HEX >= 0x030400a1 20025 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 20028 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 20031 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 20035 static struct __pyx_vtabstruct_8PyClical_clifford __pyx_vtable_8PyClical_clifford;
20037 static PyObject *__pyx_tp_new_8PyClical_clifford(PyTypeObject *t, PyObject *a, PyObject *k) {
20038 struct __pyx_obj_8PyClical_clifford *p;
20040 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
20041 o = (*t->tp_alloc)(t, 0);
20043 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
20045 if (unlikely(!o))
return 0;
20046 p = ((
struct __pyx_obj_8PyClical_clifford *)o);
20047 p->__pyx_vtab = __pyx_vtabptr_8PyClical_clifford;
20048 if (unlikely(__pyx_pw_8PyClical_8clifford_3__cinit__(o, a, k) < 0))
goto bad;
20051 Py_DECREF(o); o = 0;
20055 static void __pyx_tp_dealloc_8PyClical_clifford(PyObject *o) {
20056 #if CYTHON_USE_TP_FINALIZE 20057 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))) {
20058 if (PyObject_CallFinalizerFromDealloc(o))
return;
20062 PyObject *etype, *eval, *etb;
20063 PyErr_Fetch(&etype, &eval, &etb);
20064 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
20065 __pyx_pw_8PyClical_8clifford_5__dealloc__(o);
20066 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
20067 PyErr_Restore(etype, eval, etb);
20069 (*Py_TYPE(o)->tp_free)(o);
20071 static PyObject *__pyx_sq_item_8PyClical_clifford(PyObject *o, Py_ssize_t
i) {
20073 PyObject *x = PyInt_FromSsize_t(
i);
if(!x)
return 0;
20074 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
20079 static PyMethodDef __pyx_methods_8PyClical_clifford[] = {
20080 {
"copy", (PyCFunction)__pyx_pw_8PyClical_8clifford_1copy, METH_NOARGS, __pyx_doc_8PyClical_8clifford_copy},
20081 {
"reframe", (PyCFunction)__pyx_pw_8PyClical_8clifford_11reframe, METH_O, __pyx_doc_8PyClical_8clifford_10reframe},
20082 {
"inv", (PyCFunction)__pyx_pw_8PyClical_8clifford_49inv, METH_NOARGS, __pyx_doc_8PyClical_8clifford_48inv},
20083 {
"pow", (PyCFunction)__pyx_pw_8PyClical_8clifford_57pow, METH_O, __pyx_doc_8PyClical_8clifford_56pow},
20084 {
"outer_pow", (PyCFunction)__pyx_pw_8PyClical_8clifford_59outer_pow, METH_O, __pyx_doc_8PyClical_8clifford_58outer_pow},
20085 {
"scalar", (PyCFunction)__pyx_pw_8PyClical_8clifford_63scalar, METH_NOARGS, __pyx_doc_8PyClical_8clifford_62scalar},
20086 {
"pure", (PyCFunction)__pyx_pw_8PyClical_8clifford_65pure, METH_NOARGS, __pyx_doc_8PyClical_8clifford_64pure},
20087 {
"even", (PyCFunction)__pyx_pw_8PyClical_8clifford_67even, METH_NOARGS, __pyx_doc_8PyClical_8clifford_66even},
20088 {
"odd", (PyCFunction)__pyx_pw_8PyClical_8clifford_69odd, METH_NOARGS, __pyx_doc_8PyClical_8clifford_68odd},
20089 {
"vector_part", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_8clifford_71vector_part, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_8clifford_70vector_part},
20090 {
"involute", (PyCFunction)__pyx_pw_8PyClical_8clifford_73involute, METH_NOARGS, __pyx_doc_8PyClical_8clifford_72involute},
20091 {
"reverse", (PyCFunction)__pyx_pw_8PyClical_8clifford_75reverse, METH_NOARGS, __pyx_doc_8PyClical_8clifford_74reverse},
20092 {
"conj", (PyCFunction)__pyx_pw_8PyClical_8clifford_77conj, METH_NOARGS, __pyx_doc_8PyClical_8clifford_76conj},
20093 {
"quad", (PyCFunction)__pyx_pw_8PyClical_8clifford_79quad, METH_NOARGS, __pyx_doc_8PyClical_8clifford_78quad},
20094 {
"norm", (PyCFunction)__pyx_pw_8PyClical_8clifford_81norm, METH_NOARGS, __pyx_doc_8PyClical_8clifford_80norm},
20095 {
"abs", (PyCFunction)__pyx_pw_8PyClical_8clifford_83abs, METH_NOARGS, __pyx_doc_8PyClical_8clifford_82abs},
20096 {
"max_abs", (PyCFunction)__pyx_pw_8PyClical_8clifford_85max_abs, METH_NOARGS, __pyx_doc_8PyClical_8clifford_84max_abs},
20097 {
"truncated", (PyCFunction)__pyx_pw_8PyClical_8clifford_87truncated, METH_O, __pyx_doc_8PyClical_8clifford_86truncated},
20098 {
"isinf", (PyCFunction)__pyx_pw_8PyClical_8clifford_89isinf, METH_NOARGS, __pyx_doc_8PyClical_8clifford_88isinf},
20099 {
"isnan", (PyCFunction)__pyx_pw_8PyClical_8clifford_91isnan, METH_NOARGS, __pyx_doc_8PyClical_8clifford_90isnan},
20100 {
"frame", (PyCFunction)__pyx_pw_8PyClical_8clifford_93frame, METH_NOARGS, __pyx_doc_8PyClical_8clifford_92frame},
20101 {
"__reduce_cython__", (PyCFunction)__pyx_pw_8PyClical_8clifford_99__reduce_cython__, METH_NOARGS, 0},
20102 {
"__setstate_cython__", (PyCFunction)__pyx_pw_8PyClical_8clifford_101__setstate_cython__, METH_O, 0},
20106 static PyNumberMethods __pyx_tp_as_number_clifford = {
20107 __pyx_pw_8PyClical_8clifford_21__add__,
20108 __pyx_pw_8PyClical_8clifford_25__sub__,
20109 __pyx_pw_8PyClical_8clifford_29__mul__,
20110 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 20113 __pyx_pw_8PyClical_8clifford_33__mod__,
20115 __pyx_pw_8PyClical_8clifford_55__pow__,
20116 __pyx_pw_8PyClical_8clifford_17__neg__,
20117 __pyx_pw_8PyClical_8clifford_19__pos__,
20123 __pyx_pw_8PyClical_8clifford_37__and__,
20124 __pyx_pw_8PyClical_8clifford_41__xor__,
20125 __pyx_pw_8PyClical_8clifford_51__or__,
20126 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 20130 #if PY_MAJOR_VERSION < 3 20136 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 20139 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 20142 __pyx_pw_8PyClical_8clifford_23__iadd__,
20143 __pyx_pw_8PyClical_8clifford_27__isub__,
20144 __pyx_pw_8PyClical_8clifford_31__imul__,
20145 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 20146 __pyx_pw_8PyClical_8clifford_47__idiv__,
20148 __pyx_pw_8PyClical_8clifford_35__imod__,
20152 __pyx_pw_8PyClical_8clifford_39__iand__,
20153 __pyx_pw_8PyClical_8clifford_43__ixor__,
20154 __pyx_pw_8PyClical_8clifford_53__ior__,
20156 __pyx_pw_8PyClical_8clifford_45__truediv__,
20160 #if PY_VERSION_HEX >= 0x03050000 20163 #if PY_VERSION_HEX >= 0x03050000 20168 static PySequenceMethods __pyx_tp_as_sequence_clifford = {
20172 __pyx_sq_item_8PyClical_clifford,
20176 __pyx_pw_8PyClical_8clifford_7__contains__,
20181 static PyMappingMethods __pyx_tp_as_mapping_clifford = {
20183 __pyx_pw_8PyClical_8clifford_15__getitem__,
20187 static PyTypeObject __pyx_type_8PyClical_clifford = {
20188 PyVarObject_HEAD_INIT(0, 0)
20189 "PyClical.clifford",
20190 sizeof(
struct __pyx_obj_8PyClical_clifford),
20192 __pyx_tp_dealloc_8PyClical_clifford,
20193 #if PY_VERSION_HEX < 0x030800b4
20196 #if PY_VERSION_HEX >= 0x030800b4
20201 #if PY_MAJOR_VERSION < 3 20204 #if PY_MAJOR_VERSION >= 3 20207 __pyx_pw_8PyClical_8clifford_95__repr__,
20208 &__pyx_tp_as_number_clifford,
20209 &__pyx_tp_as_sequence_clifford,
20210 &__pyx_tp_as_mapping_clifford,
20212 __pyx_pw_8PyClical_8clifford_61__call__,
20213 __pyx_pw_8PyClical_8clifford_97__str__,
20217 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
20218 "\n Python class clifford wraps C++ class Clifford.\n ",
20221 __pyx_pw_8PyClical_8clifford_13__richcmp__,
20223 __pyx_pw_8PyClical_8clifford_9__iter__,
20225 __pyx_methods_8PyClical_clifford,
20235 __pyx_tp_new_8PyClical_clifford,
20245 #if PY_VERSION_HEX >= 0x030400a1 20248 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 20251 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 20254 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 20259 static struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *__pyx_freelist_8PyClical___pyx_scope_struct____iter__[8];
20260 static int __pyx_freecount_8PyClical___pyx_scope_struct____iter__ = 0;
20262 static PyObject *__pyx_tp_new_8PyClical___pyx_scope_struct____iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
20264 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__)))) {
20265 o = (PyObject*)__pyx_freelist_8PyClical___pyx_scope_struct____iter__[--__pyx_freecount_8PyClical___pyx_scope_struct____iter__];
20266 memset(o, 0,
sizeof(
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__));
20267 (void) PyObject_INIT(o, t);
20268 PyObject_GC_Track(o);
20270 o = (*t->tp_alloc)(t, 0);
20271 if (unlikely(!o))
return 0;
20276 static void __pyx_tp_dealloc_8PyClical___pyx_scope_struct____iter__(PyObject *o) {
20277 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *p = (
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)o;
20278 PyObject_GC_UnTrack(o);
20279 Py_CLEAR(p->__pyx_v_idx);
20280 Py_CLEAR(p->__pyx_v_self);
20281 Py_CLEAR(p->__pyx_t_0);
20282 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__)))) {
20283 __pyx_freelist_8PyClical___pyx_scope_struct____iter__[__pyx_freecount_8PyClical___pyx_scope_struct____iter__++] = ((
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)o);
20285 (*Py_TYPE(o)->tp_free)(o);
20289 static int __pyx_tp_traverse_8PyClical___pyx_scope_struct____iter__(PyObject *o, visitproc v,
void *a) {
20291 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *p = (
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)o;
20292 if (p->__pyx_v_idx) {
20293 e = (*v)(p->__pyx_v_idx, a);
if (
e)
return e;
20295 if (p->__pyx_v_self) {
20296 e = (*v)(((PyObject *)p->__pyx_v_self), a);
if (
e)
return e;
20298 if (p->__pyx_t_0) {
20299 e = (*v)(p->__pyx_t_0, a);
if (
e)
return e;
20304 static PyTypeObject __pyx_type_8PyClical___pyx_scope_struct____iter__ = {
20305 PyVarObject_HEAD_INIT(0, 0)
20306 "PyClical.__pyx_scope_struct____iter__",
20307 sizeof(
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__),
20309 __pyx_tp_dealloc_8PyClical___pyx_scope_struct____iter__,
20310 #if PY_VERSION_HEX < 0x030800b4
20313 #if PY_VERSION_HEX >= 0x030800b4
20318 #if PY_MAJOR_VERSION < 3 20321 #if PY_MAJOR_VERSION >= 3 20334 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
20336 __pyx_tp_traverse_8PyClical___pyx_scope_struct____iter__,
20352 __pyx_tp_new_8PyClical___pyx_scope_struct____iter__,
20362 #if PY_VERSION_HEX >= 0x030400a1 20365 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 20368 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 20371 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 20376 static PyMethodDef __pyx_methods[] = {
20377 {
"compare", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_3compare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_2compare},
20378 {
"min_neg", (PyCFunction)__pyx_pw_8PyClical_5min_neg, METH_O, __pyx_doc_8PyClical_4min_neg},
20379 {
"max_pos", (PyCFunction)__pyx_pw_8PyClical_7max_pos, METH_O, __pyx_doc_8PyClical_6max_pos},
20380 {
"error_squared_tol", (PyCFunction)__pyx_pw_8PyClical_11error_squared_tol, METH_O, __pyx_doc_8PyClical_10error_squared_tol},
20381 {
"error_squared", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_13error_squared, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_12error_squared},
20382 {
"approx_equal", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_15approx_equal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_14approx_equal},
20383 {
"inv", (PyCFunction)__pyx_pw_8PyClical_17inv, METH_O, __pyx_doc_8PyClical_16inv},
20384 {
"scalar", (PyCFunction)__pyx_pw_8PyClical_19scalar, METH_O, __pyx_doc_8PyClical_18scalar},
20385 {
"real", (PyCFunction)__pyx_pw_8PyClical_21real, METH_O, __pyx_doc_8PyClical_20real},
20386 {
"imag", (PyCFunction)__pyx_pw_8PyClical_23imag, METH_O, __pyx_doc_8PyClical_22imag},
20387 {
"pure", (PyCFunction)__pyx_pw_8PyClical_25pure, METH_O, __pyx_doc_8PyClical_24pure},
20388 {
"even", (PyCFunction)__pyx_pw_8PyClical_27even, METH_O, __pyx_doc_8PyClical_26even},
20389 {
"odd", (PyCFunction)__pyx_pw_8PyClical_29odd, METH_O, __pyx_doc_8PyClical_28odd},
20390 {
"involute", (PyCFunction)__pyx_pw_8PyClical_31involute, METH_O, __pyx_doc_8PyClical_30involute},
20391 {
"reverse", (PyCFunction)__pyx_pw_8PyClical_33reverse, METH_O, __pyx_doc_8PyClical_32reverse},
20392 {
"conj", (PyCFunction)__pyx_pw_8PyClical_35conj, METH_O, __pyx_doc_8PyClical_34conj},
20393 {
"quad", (PyCFunction)__pyx_pw_8PyClical_37quad, METH_O, __pyx_doc_8PyClical_36quad},
20394 {
"norm", (PyCFunction)__pyx_pw_8PyClical_39norm, METH_O, __pyx_doc_8PyClical_38norm},
20395 {
"abs", (PyCFunction)__pyx_pw_8PyClical_41abs, METH_O, __pyx_doc_8PyClical_40abs},
20396 {
"max_abs", (PyCFunction)__pyx_pw_8PyClical_43max_abs, METH_O, __pyx_doc_8PyClical_42max_abs},
20397 {
"pow", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_45pow, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_44pow},
20398 {
"outer_pow", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_47outer_pow, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_46outer_pow},
20399 {
"complexifier", (PyCFunction)__pyx_pw_8PyClical_49complexifier, METH_O, __pyx_doc_8PyClical_48complexifier},
20400 {
"sqrt", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_51sqrt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_50sqrt},
20401 {
"exp", (PyCFunction)__pyx_pw_8PyClical_53exp, METH_O, __pyx_doc_8PyClical_52exp},
20402 {
"log", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_55log, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_54log},
20403 {
"cos", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_57cos, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_56cos},
20404 {
"acos", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_59acos, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_58acos},
20405 {
"cosh", (PyCFunction)__pyx_pw_8PyClical_61cosh, METH_O, __pyx_doc_8PyClical_60cosh},
20406 {
"acosh", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_63acosh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_62acosh},
20407 {
"sin", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_65sin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_64sin},
20408 {
"asin", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_67asin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_66asin},
20409 {
"sinh", (PyCFunction)__pyx_pw_8PyClical_69sinh, METH_O, __pyx_doc_8PyClical_68sinh},
20410 {
"asinh", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_71asinh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_70asinh},
20411 {
"tan", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_73tan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_72tan},
20412 {
"atan", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_75atan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_74atan},
20413 {
"tanh", (PyCFunction)__pyx_pw_8PyClical_77tanh, METH_O, __pyx_doc_8PyClical_76tanh},
20414 {
"atanh", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_79atanh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_78atanh},
20415 {
"random_clifford", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_81random_clifford, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_80random_clifford},
20416 {
"cga3", (PyCFunction)__pyx_pw_8PyClical_83cga3, METH_O, __pyx_doc_8PyClical_82cga3},
20417 {
"cga3std", (PyCFunction)__pyx_pw_8PyClical_85cga3std, METH_O, __pyx_doc_8PyClical_84cga3std},
20418 {
"agc3", (PyCFunction)__pyx_pw_8PyClical_87agc3, METH_O, __pyx_doc_8PyClical_86agc3},
20422 #if PY_MAJOR_VERSION >= 3 20423 #if CYTHON_PEP489_MULTI_PHASE_INIT 20424 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
20425 static int __pyx_pymod_exec_PyClical(PyObject* module);
20426 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
20427 {Py_mod_create, (
void*)__pyx_pymod_create},
20428 {Py_mod_exec, (
void*)__pyx_pymod_exec_PyClical},
20433 static struct PyModuleDef __pyx_moduledef = {
20434 PyModuleDef_HEAD_INIT,
20437 #if CYTHON_PEP489_MULTI_PHASE_INIT 20443 #if CYTHON_PEP489_MULTI_PHASE_INIT 20444 __pyx_moduledef_slots,
20453 #ifndef CYTHON_SMALL_CODE 20454 #if defined(__clang__) 20455 #define CYTHON_SMALL_CODE 20456 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) 20457 #define CYTHON_SMALL_CODE __attribute__((cold)) 20459 #define CYTHON_SMALL_CODE 20463 static __Pyx_StringTabEntry __pyx_string_tab[] = {
20464 {&__pyx_kp_u_, __pyx_k_,
sizeof(__pyx_k_), 0, 1, 0, 0},
20465 {&__pyx_kp_u_Abbreviation_for_clifford_index, __pyx_k_Abbreviation_for_clifford_index,
sizeof(__pyx_k_Abbreviation_for_clifford_index), 0, 1, 0, 0},
20466 {&__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},
20467 {&__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},
20468 {&__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},
20469 {&__pyx_kp_u_Cannot_initialize_clifford_objec, __pyx_k_Cannot_initialize_clifford_objec,
sizeof(__pyx_k_Cannot_initialize_clifford_objec), 0, 1, 0, 0},
20470 {&__pyx_kp_u_Cannot_initialize_index_set_obje, __pyx_k_Cannot_initialize_index_set_obje,
sizeof(__pyx_k_Cannot_initialize_index_set_obje), 0, 1, 0, 0},
20471 {&__pyx_kp_u_Cannot_reframe, __pyx_k_Cannot_reframe,
sizeof(__pyx_k_Cannot_reframe), 0, 1, 0, 0},
20472 {&__pyx_kp_u_Cannot_take_vector_part_of, __pyx_k_Cannot_take_vector_part_of,
sizeof(__pyx_k_Cannot_take_vector_part_of), 0, 1, 0, 0},
20473 {&__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},
20474 {&__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},
20475 {&__pyx_kp_u_Check_if_a_multivector_contains_2, __pyx_k_Check_if_a_multivector_contains_2,
sizeof(__pyx_k_Check_if_a_multivector_contains_2), 0, 1, 0, 0},
20476 {&__pyx_kp_u_Conjugation_reverse_o_involute, __pyx_k_Conjugation_reverse_o_involute,
sizeof(__pyx_k_Conjugation_reverse_o_involute), 0, 1, 0, 0},
20477 {&__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},
20478 {&__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},
20479 {&__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},
20480 {&__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},
20481 {&__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},
20482 {&__pyx_kp_u_Convert_Euclidean_3D_multivecto, __pyx_k_Convert_Euclidean_3D_multivecto,
sizeof(__pyx_k_Convert_Euclidean_3D_multivecto), 0, 1, 0, 0},
20483 {&__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},
20484 {&__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},
20485 {&__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},
20486 {&__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},
20487 {&__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},
20488 {&__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},
20489 {&__pyx_kp_u_Geometric_difference_print_clif, __pyx_k_Geometric_difference_print_clif,
sizeof(__pyx_k_Geometric_difference_print_clif), 0, 1, 0, 0},
20490 {&__pyx_kp_u_Geometric_difference_x_clifford, __pyx_k_Geometric_difference_x_clifford,
sizeof(__pyx_k_Geometric_difference_x_clifford), 0, 1, 0, 0},
20491 {&__pyx_kp_u_Geometric_multiplicative_invers, __pyx_k_Geometric_multiplicative_invers,
sizeof(__pyx_k_Geometric_multiplicative_invers), 0, 1, 0, 0},
20492 {&__pyx_kp_u_Geometric_multiplicative_invers_2, __pyx_k_Geometric_multiplicative_invers_2,
sizeof(__pyx_k_Geometric_multiplicative_invers_2), 0, 1, 0, 0},
20493 {&__pyx_kp_u_Geometric_product_print_cliffor, __pyx_k_Geometric_product_print_cliffor,
sizeof(__pyx_k_Geometric_product_print_cliffor), 0, 1, 0, 0},
20494 {&__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},
20495 {&__pyx_kp_u_Geometric_quotient_print_cliffo, __pyx_k_Geometric_quotient_print_cliffo,
sizeof(__pyx_k_Geometric_quotient_print_cliffo), 0, 1, 0, 0},
20496 {&__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},
20497 {&__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},
20498 {&__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},
20499 {&__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},
20500 {&__pyx_kp_u_Hyperbolic_cosine_of_multivecto, __pyx_k_Hyperbolic_cosine_of_multivecto,
sizeof(__pyx_k_Hyperbolic_cosine_of_multivecto), 0, 1, 0, 0},
20501 {&__pyx_kp_u_Hyperbolic_sine_of_multivector, __pyx_k_Hyperbolic_sine_of_multivector,
sizeof(__pyx_k_Hyperbolic_sine_of_multivector), 0, 1, 0, 0},
20502 {&__pyx_kp_u_Hyperbolic_tangent_of_multivect, __pyx_k_Hyperbolic_tangent_of_multivect,
sizeof(__pyx_k_Hyperbolic_tangent_of_multivect), 0, 1, 0, 0},
20503 {&__pyx_kp_u_Imaginary_part_deprecated_alway, __pyx_k_Imaginary_part_deprecated_alway,
sizeof(__pyx_k_Imaginary_part_deprecated_alway), 0, 1, 0, 0},
20504 {&__pyx_n_s_IndexError, __pyx_k_IndexError,
sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
20505 {&__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},
20506 {&__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},
20507 {&__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},
20508 {&__pyx_n_s_Integral, __pyx_k_Integral,
sizeof(__pyx_k_Integral), 0, 0, 1, 1},
20509 {&__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},
20510 {&__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},
20511 {&__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},
20512 {&__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},
20513 {&__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},
20514 {&__pyx_kp_u_Inverse_tangent_of_multivector, __pyx_k_Inverse_tangent_of_multivector,
sizeof(__pyx_k_Inverse_tangent_of_multivector), 0, 1, 0, 0},
20515 {&__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},
20516 {&__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},
20517 {&__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},
20518 {&__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},
20519 {&__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},
20520 {&__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},
20521 {&__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},
20522 {&__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},
20523 {&__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},
20524 {&__pyx_kp_u_Natural_logarithm_of_multivecto, __pyx_k_Natural_logarithm_of_multivecto,
sizeof(__pyx_k_Natural_logarithm_of_multivecto), 0, 1, 0, 0},
20525 {&__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},
20526 {&__pyx_n_s_NotImplemented, __pyx_k_NotImplemented,
sizeof(__pyx_k_NotImplemented), 0, 0, 1, 1},
20527 {&__pyx_kp_u_Not_applicable, __pyx_k_Not_applicable,
sizeof(__pyx_k_Not_applicable), 0, 1, 0, 0},
20528 {&__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},
20529 {&__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},
20530 {&__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},
20531 {&__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},
20532 {&__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},
20533 {&__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},
20534 {&__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},
20535 {&__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},
20536 {&__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},
20537 {&__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},
20538 {&__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},
20539 {&__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},
20540 {&__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},
20541 {&__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},
20542 {&__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},
20543 {&__pyx_n_s_PyClical, __pyx_k_PyClical,
sizeof(__pyx_k_PyClical), 0, 0, 1, 1},
20544 {&__pyx_kp_s_PyClical_pyx, __pyx_k_PyClical_pyx,
sizeof(__pyx_k_PyClical_pyx), 0, 0, 1, 0},
20545 {&__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},
20546 {&__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},
20547 {&__pyx_kp_u_Quadratic_norm_error_tolerance, __pyx_k_Quadratic_norm_error_tolerance,
sizeof(__pyx_k_Quadratic_norm_error_tolerance), 0, 1, 0, 0},
20548 {&__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},
20549 {&__pyx_n_s_Real, __pyx_k_Real,
sizeof(__pyx_k_Real), 0, 0, 1, 1},
20550 {&__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},
20551 {&__pyx_kp_u_Relative_or_absolute_error_usin, __pyx_k_Relative_or_absolute_error_usin,
sizeof(__pyx_k_Relative_or_absolute_error_usin), 0, 1, 0, 0},
20552 {&__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},
20553 {&__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},
20554 {&__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},
20555 {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError,
sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
20556 {&__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},
20557 {&__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},
20558 {&__pyx_n_s_Sequence, __pyx_k_Sequence,
sizeof(__pyx_k_Sequence), 0, 0, 1, 1},
20559 {&__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},
20560 {&__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},
20561 {&__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},
20562 {&__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},
20563 {&__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},
20564 {&__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},
20565 {&__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},
20566 {&__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},
20567 {&__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},
20568 {&__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},
20569 {&__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},
20570 {&__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},
20571 {&__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},
20572 {&__pyx_kp_u_Symmetric_set_difference_exclus, __pyx_k_Symmetric_set_difference_exclus,
sizeof(__pyx_k_Symmetric_set_difference_exclus), 0, 1, 0, 0},
20573 {&__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},
20574 {&__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},
20575 {&__pyx_kp_u_Test_for_approximate_equality_o, __pyx_k_Test_for_approximate_equality_o,
sizeof(__pyx_k_Test_for_approximate_equality_o), 0, 1, 0, 0},
20576 {&__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},
20577 {&__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},
20578 {&__pyx_kp_u_The_informal_string_representat, __pyx_k_The_informal_string_representat,
sizeof(__pyx_k_The_informal_string_representat), 0, 1, 0, 0},
20579 {&__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},
20580 {&__pyx_kp_u_The_official_string_representat, __pyx_k_The_official_string_representat,
sizeof(__pyx_k_The_official_string_representat), 0, 1, 0, 0},
20581 {&__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},
20582 {&__pyx_kp_u_This_comparison_operator_is_not, __pyx_k_This_comparison_operator_is_not,
sizeof(__pyx_k_This_comparison_operator_is_not), 0, 1, 0, 0},
20583 {&__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},
20584 {&__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},
20585 {&__pyx_n_s_TypeError, __pyx_k_TypeError,
sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
20586 {&__pyx_kp_u_UTF_8, __pyx_k_UTF_8,
sizeof(__pyx_k_UTF_8), 0, 1, 0, 0},
20587 {&__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},
20588 {&__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},
20589 {&__pyx_n_s_ValueError, __pyx_k_ValueError,
sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
20590 {&__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},
20591 {&__pyx_kp_u__2, __pyx_k__2,
sizeof(__pyx_k__2), 0, 1, 0, 0},
20592 {&__pyx_kp_u__5, __pyx_k__5,
sizeof(__pyx_k__5), 0, 1, 0, 0},
20593 {&__pyx_kp_u__6, __pyx_k__6,
sizeof(__pyx_k__6), 0, 1, 0, 0},
20594 {&__pyx_kp_u__7, __pyx_k__7,
sizeof(__pyx_k__7), 0, 1, 0, 0},
20595 {&__pyx_kp_u__8, __pyx_k__8,
sizeof(__pyx_k__8), 0, 1, 0, 0},
20596 {&__pyx_kp_u__9, __pyx_k__9,
sizeof(__pyx_k__9), 0, 1, 0, 0},
20597 {&__pyx_n_s_abc, __pyx_k_abc,
sizeof(__pyx_k_abc), 0, 0, 1, 1},
20598 {&__pyx_kp_u_abs_line_1522, __pyx_k_abs_line_1522,
sizeof(__pyx_k_abs_line_1522), 0, 1, 0, 0},
20599 {&__pyx_n_s_acos, __pyx_k_acos,
sizeof(__pyx_k_acos), 0, 0, 1, 1},
20600 {&__pyx_kp_u_acos_line_1668, __pyx_k_acos_line_1668,
sizeof(__pyx_k_acos_line_1668), 0, 1, 0, 0},
20601 {&__pyx_n_s_acosh, __pyx_k_acosh,
sizeof(__pyx_k_acosh), 0, 0, 1, 1},
20602 {&__pyx_kp_u_acosh_line_1705, __pyx_k_acosh_line_1705,
sizeof(__pyx_k_acosh_line_1705), 0, 1, 0, 0},
20603 {&__pyx_kp_u_agc3_line_1893, __pyx_k_agc3_line_1893,
sizeof(__pyx_k_agc3_line_1893), 0, 1, 0, 0},
20604 {&__pyx_kp_u_approx_equal_line_1359, __pyx_k_approx_equal_line_1359,
sizeof(__pyx_k_approx_equal_line_1359), 0, 1, 0, 0},
20605 {&__pyx_n_s_args, __pyx_k_args,
sizeof(__pyx_k_args), 0, 0, 1, 1},
20606 {&__pyx_kp_u_as_frame, __pyx_k_as_frame,
sizeof(__pyx_k_as_frame), 0, 1, 0, 0},
20607 {&__pyx_n_s_asin, __pyx_k_asin,
sizeof(__pyx_k_asin), 0, 0, 1, 1},
20608 {&__pyx_kp_u_asin_line_1747, __pyx_k_asin_line_1747,
sizeof(__pyx_k_asin_line_1747), 0, 1, 0, 0},
20609 {&__pyx_n_s_asinh, __pyx_k_asinh,
sizeof(__pyx_k_asinh), 0, 0, 1, 1},
20610 {&__pyx_kp_u_asinh_line_1782, __pyx_k_asinh_line_1782,
sizeof(__pyx_k_asinh_line_1782), 0, 1, 0, 0},
20611 {&__pyx_n_s_atan, __pyx_k_atan,
sizeof(__pyx_k_atan), 0, 0, 1, 1},
20612 {&__pyx_kp_u_atan_line_1818, __pyx_k_atan_line_1818,
sizeof(__pyx_k_atan_line_1818), 0, 1, 0, 0},
20613 {&__pyx_n_s_atanh, __pyx_k_atanh,
sizeof(__pyx_k_atanh), 0, 0, 1, 1},
20614 {&__pyx_kp_u_atanh_line_1847, __pyx_k_atanh_line_1847,
sizeof(__pyx_k_atanh_line_1847), 0, 1, 0, 0},
20615 {&__pyx_kp_u_cga3_line_1873, __pyx_k_cga3_line_1873,
sizeof(__pyx_k_cga3_line_1873), 0, 1, 0, 0},
20616 {&__pyx_kp_u_cga3std_line_1882, __pyx_k_cga3std_line_1882,
sizeof(__pyx_k_cga3std_line_1882), 0, 1, 0, 0},
20617 {&__pyx_n_s_cl, __pyx_k_cl,
sizeof(__pyx_k_cl), 0, 0, 1, 1},
20618 {&__pyx_n_s_clifford, __pyx_k_clifford,
sizeof(__pyx_k_clifford), 0, 0, 1, 1},
20619 {&__pyx_kp_u_clifford___add___line_740, __pyx_k_clifford___add___line_740,
sizeof(__pyx_k_clifford___add___line_740), 0, 1, 0, 0},
20620 {&__pyx_kp_u_clifford___and___line_836, __pyx_k_clifford___and___line_836,
sizeof(__pyx_k_clifford___and___line_836), 0, 1, 0, 0},
20621 {&__pyx_kp_u_clifford___call___line_1020, __pyx_k_clifford___call___line_1020,
sizeof(__pyx_k_clifford___call___line_1020), 0, 1, 0, 0},
20622 {&__pyx_kp_u_clifford___getitem___line_707, __pyx_k_clifford___getitem___line_707,
sizeof(__pyx_k_clifford___getitem___line_707), 0, 1, 0, 0},
20623 {&__pyx_kp_u_clifford___iadd___line_751, __pyx_k_clifford___iadd___line_751,
sizeof(__pyx_k_clifford___iadd___line_751), 0, 1, 0, 0},
20624 {&__pyx_kp_u_clifford___iand___line_851, __pyx_k_clifford___iand___line_851,
sizeof(__pyx_k_clifford___iand___line_851), 0, 1, 0, 0},
20625 {&__pyx_kp_u_clifford___idiv___line_911, __pyx_k_clifford___idiv___line_911,
sizeof(__pyx_k_clifford___idiv___line_911), 0, 1, 0, 0},
20626 {&__pyx_kp_u_clifford___imod___line_821, __pyx_k_clifford___imod___line_821,
sizeof(__pyx_k_clifford___imod___line_821), 0, 1, 0, 0},
20627 {&__pyx_kp_u_clifford___imul___line_793, __pyx_k_clifford___imul___line_793,
sizeof(__pyx_k_clifford___imul___line_793), 0, 1, 0, 0},
20628 {&__pyx_kp_u_clifford___ior___line_950, __pyx_k_clifford___ior___line_950,
sizeof(__pyx_k_clifford___ior___line_950), 0, 1, 0, 0},
20629 {&__pyx_kp_u_clifford___isub___line_771, __pyx_k_clifford___isub___line_771,
sizeof(__pyx_k_clifford___isub___line_771), 0, 1, 0, 0},
20630 {&__pyx_kp_u_clifford___iter___line_638, __pyx_k_clifford___iter___line_638,
sizeof(__pyx_k_clifford___iter___line_638), 0, 1, 0, 0},
20631 {&__pyx_kp_u_clifford___ixor___line_881, __pyx_k_clifford___ixor___line_881,
sizeof(__pyx_k_clifford___ixor___line_881), 0, 1, 0, 0},
20632 {&__pyx_kp_u_clifford___mod___line_806, __pyx_k_clifford___mod___line_806,
sizeof(__pyx_k_clifford___mod___line_806), 0, 1, 0, 0},
20633 {&__pyx_kp_u_clifford___mul___line_780, __pyx_k_clifford___mul___line_780,
sizeof(__pyx_k_clifford___mul___line_780), 0, 1, 0, 0},
20634 {&__pyx_kp_u_clifford___neg___line_722, __pyx_k_clifford___neg___line_722,
sizeof(__pyx_k_clifford___neg___line_722), 0, 1, 0, 0},
20635 {&__pyx_kp_u_clifford___or___line_939, __pyx_k_clifford___or___line_939,
sizeof(__pyx_k_clifford___or___line_939), 0, 1, 0, 0},
20636 {&__pyx_kp_u_clifford___pos___line_731, __pyx_k_clifford___pos___line_731,
sizeof(__pyx_k_clifford___pos___line_731), 0, 1, 0, 0},
20637 {&__pyx_kp_u_clifford___pow___line_961, __pyx_k_clifford___pow___line_961,
sizeof(__pyx_k_clifford___pow___line_961), 0, 1, 0, 0},
20638 {&__pyx_kp_u_clifford___repr___line_1235, __pyx_k_clifford___repr___line_1235,
sizeof(__pyx_k_clifford___repr___line_1235), 0, 1, 0, 0},
20639 {&__pyx_kp_u_clifford___str___line_1244, __pyx_k_clifford___str___line_1244,
sizeof(__pyx_k_clifford___str___line_1244), 0, 1, 0, 0},
20640 {&__pyx_kp_u_clifford___sub___line_760, __pyx_k_clifford___sub___line_760,
sizeof(__pyx_k_clifford___sub___line_760), 0, 1, 0, 0},
20641 {&__pyx_kp_u_clifford___truediv___line_896, __pyx_k_clifford___truediv___line_896,
sizeof(__pyx_k_clifford___truediv___line_896), 0, 1, 0, 0},
20642 {&__pyx_kp_u_clifford___xor___line_866, __pyx_k_clifford___xor___line_866,
sizeof(__pyx_k_clifford___xor___line_866), 0, 1, 0, 0},
20643 {&__pyx_kp_u_clifford_abs_line_1175, __pyx_k_clifford_abs_line_1175,
sizeof(__pyx_k_clifford_abs_line_1175), 0, 1, 0, 0},
20644 {&__pyx_kp_u_clifford_conj_line_1138, __pyx_k_clifford_conj_line_1138,
sizeof(__pyx_k_clifford_conj_line_1138), 0, 1, 0, 0},
20645 {&__pyx_kp_u_clifford_copy_line_556, __pyx_k_clifford_copy_line_556,
sizeof(__pyx_k_clifford_copy_line_556), 0, 1, 0, 0},
20646 {&__pyx_kp_u_clifford_even_line_1061, __pyx_k_clifford_even_line_1061,
sizeof(__pyx_k_clifford_even_line_1061), 0, 1, 0, 0},
20647 {&__pyx_kp_u_clifford_frame_line_1224, __pyx_k_clifford_frame_line_1224,
sizeof(__pyx_k_clifford_frame_line_1224), 0, 1, 0, 0},
20648 {&__pyx_n_s_clifford_hidden_doctests, __pyx_k_clifford_hidden_doctests,
sizeof(__pyx_k_clifford_hidden_doctests), 0, 0, 1, 1},
20649 {&__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},
20650 {&__pyx_kp_u_clifford_inv_line_926, __pyx_k_clifford_inv_line_926,
sizeof(__pyx_k_clifford_inv_line_926), 0, 1, 0, 0},
20651 {&__pyx_kp_u_clifford_involute_line_1107, __pyx_k_clifford_involute_line_1107,
sizeof(__pyx_k_clifford_involute_line_1107), 0, 1, 0, 0},
20652 {&__pyx_kp_u_clifford_isinf_line_1206, __pyx_k_clifford_isinf_line_1206,
sizeof(__pyx_k_clifford_isinf_line_1206), 0, 1, 0, 0},
20653 {&__pyx_kp_u_clifford_isnan_line_1215, __pyx_k_clifford_isnan_line_1215,
sizeof(__pyx_k_clifford_isnan_line_1215), 0, 1, 0, 0},
20654 {&__pyx_kp_u_clifford_max_abs_line_1184, __pyx_k_clifford_max_abs_line_1184,
sizeof(__pyx_k_clifford_max_abs_line_1184), 0, 1, 0, 0},
20655 {&__pyx_kp_u_clifford_norm_line_1164, __pyx_k_clifford_norm_line_1164,
sizeof(__pyx_k_clifford_norm_line_1164), 0, 1, 0, 0},
20656 {&__pyx_kp_u_clifford_odd_line_1070, __pyx_k_clifford_odd_line_1070,
sizeof(__pyx_k_clifford_odd_line_1070), 0, 1, 0, 0},
20657 {&__pyx_kp_u_clifford_outer_pow_line_1004, __pyx_k_clifford_outer_pow_line_1004,
sizeof(__pyx_k_clifford_outer_pow_line_1004), 0, 1, 0, 0},
20658 {&__pyx_kp_u_clifford_pow_line_980, __pyx_k_clifford_pow_line_980,
sizeof(__pyx_k_clifford_pow_line_980), 0, 1, 0, 0},
20659 {&__pyx_kp_u_clifford_pure_line_1050, __pyx_k_clifford_pure_line_1050,
sizeof(__pyx_k_clifford_pure_line_1050), 0, 1, 0, 0},
20660 {&__pyx_kp_u_clifford_quad_line_1153, __pyx_k_clifford_quad_line_1153,
sizeof(__pyx_k_clifford_quad_line_1153), 0, 1, 0, 0},
20661 {&__pyx_kp_u_clifford_reframe_line_649, __pyx_k_clifford_reframe_line_649,
sizeof(__pyx_k_clifford_reframe_line_649), 0, 1, 0, 0},
20662 {&__pyx_kp_u_clifford_reverse_line_1123, __pyx_k_clifford_reverse_line_1123,
sizeof(__pyx_k_clifford_reverse_line_1123), 0, 1, 0, 0},
20663 {&__pyx_kp_u_clifford_scalar_line_1039, __pyx_k_clifford_scalar_line_1039,
sizeof(__pyx_k_clifford_scalar_line_1039), 0, 1, 0, 0},
20664 {&__pyx_kp_u_clifford_truncated_line_1195, __pyx_k_clifford_truncated_line_1195,
sizeof(__pyx_k_clifford_truncated_line_1195), 0, 1, 0, 0},
20665 {&__pyx_kp_u_clifford_vector_part_line_1079, __pyx_k_clifford_vector_part_line_1079,
sizeof(__pyx_k_clifford_vector_part_line_1079), 0, 1, 0, 0},
20666 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback,
sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
20667 {&__pyx_n_s_close, __pyx_k_close,
sizeof(__pyx_k_close), 0, 0, 1, 1},
20668 {&__pyx_n_s_collections, __pyx_k_collections,
sizeof(__pyx_k_collections), 0, 0, 1, 1},
20669 {&__pyx_kp_u_compare_line_492, __pyx_k_compare_line_492,
sizeof(__pyx_k_compare_line_492), 0, 1, 0, 0},
20670 {&__pyx_kp_u_complexifier_line_1576, __pyx_k_complexifier_line_1576,
sizeof(__pyx_k_complexifier_line_1576), 0, 1, 0, 0},
20671 {&__pyx_n_s_conj, __pyx_k_conj,
sizeof(__pyx_k_conj), 0, 0, 1, 1},
20672 {&__pyx_kp_u_conj_line_1485, __pyx_k_conj_line_1485,
sizeof(__pyx_k_conj_line_1485), 0, 1, 0, 0},
20673 {&__pyx_n_s_copy, __pyx_k_copy,
sizeof(__pyx_k_copy), 0, 0, 1, 1},
20674 {&__pyx_n_s_cos, __pyx_k_cos,
sizeof(__pyx_k_cos), 0, 0, 1, 1},
20675 {&__pyx_kp_u_cos_line_1651, __pyx_k_cos_line_1651,
sizeof(__pyx_k_cos_line_1651), 0, 1, 0, 0},
20676 {&__pyx_n_s_cosh, __pyx_k_cosh,
sizeof(__pyx_k_cosh), 0, 0, 1, 1},
20677 {&__pyx_kp_u_cosh_line_1689, __pyx_k_cosh_line_1689,
sizeof(__pyx_k_cosh_line_1689), 0, 1, 0, 0},
20678 {&__pyx_n_s_doctest, __pyx_k_doctest,
sizeof(__pyx_k_doctest), 0, 0, 1, 1},
20679 {&__pyx_n_s_e, __pyx_k_e,
sizeof(__pyx_k_e), 0, 0, 1, 1},
20680 {&__pyx_kp_u_e_line_1936, __pyx_k_e_line_1936,
sizeof(__pyx_k_e_line_1936), 0, 1, 0, 0},
20681 {&__pyx_n_s_encode, __pyx_k_encode,
sizeof(__pyx_k_encode), 0, 0, 1, 1},
20682 {&__pyx_kp_u_error_squared_line_1346, __pyx_k_error_squared_line_1346,
sizeof(__pyx_k_error_squared_line_1346), 0, 1, 0, 0},
20683 {&__pyx_kp_u_error_squared_tol_line_1337, __pyx_k_error_squared_tol_line_1337,
sizeof(__pyx_k_error_squared_tol_line_1337), 0, 1, 0, 0},
20684 {&__pyx_n_s_even, __pyx_k_even,
sizeof(__pyx_k_even), 0, 0, 1, 1},
20685 {&__pyx_kp_u_even_line_1437, __pyx_k_even_line_1437,
sizeof(__pyx_k_even_line_1437), 0, 1, 0, 0},
20686 {&__pyx_n_s_exp, __pyx_k_exp,
sizeof(__pyx_k_exp), 0, 0, 1, 1},
20687 {&__pyx_kp_u_exp_line_1614, __pyx_k_exp_line_1614,
sizeof(__pyx_k_exp_line_1614), 0, 1, 0, 0},
20688 {&__pyx_n_s_fill, __pyx_k_fill,
sizeof(__pyx_k_fill), 0, 0, 1, 1},
20689 {&__pyx_n_s_frm, __pyx_k_frm,
sizeof(__pyx_k_frm), 0, 0, 1, 1},
20690 {&__pyx_kp_u_from, __pyx_k_from,
sizeof(__pyx_k_from), 0, 1, 0, 0},
20691 {&__pyx_n_s_getstate, __pyx_k_getstate,
sizeof(__pyx_k_getstate), 0, 0, 1, 1},
20692 {&__pyx_n_s_grade, __pyx_k_grade,
sizeof(__pyx_k_grade), 0, 0, 1, 1},
20693 {&__pyx_n_s_i, __pyx_k_i,
sizeof(__pyx_k_i), 0, 0, 1, 1},
20694 {&__pyx_kp_u_imag_line_1415, __pyx_k_imag_line_1415,
sizeof(__pyx_k_imag_line_1415), 0, 1, 0, 0},
20695 {&__pyx_n_s_import, __pyx_k_import,
sizeof(__pyx_k_import), 0, 0, 1, 1},
20696 {&__pyx_n_s_index_set, __pyx_k_index_set,
sizeof(__pyx_k_index_set), 0, 0, 1, 1},
20697 {&__pyx_kp_u_index_set___and___line_271, __pyx_k_index_set___and___line_271,
sizeof(__pyx_k_index_set___and___line_271), 0, 1, 0, 0},
20698 {&__pyx_kp_u_index_set___getitem___line_191, __pyx_k_index_set___getitem___line_191,
sizeof(__pyx_k_index_set___getitem___line_191), 0, 1, 0, 0},
20699 {&__pyx_kp_u_index_set___iand___line_282, __pyx_k_index_set___iand___line_282,
sizeof(__pyx_k_index_set___iand___line_282), 0, 1, 0, 0},
20700 {&__pyx_kp_u_index_set___invert___line_240, __pyx_k_index_set___invert___line_240,
sizeof(__pyx_k_index_set___invert___line_240), 0, 1, 0, 0},
20701 {&__pyx_kp_u_index_set___ior___line_304, __pyx_k_index_set___ior___line_304,
sizeof(__pyx_k_index_set___ior___line_304), 0, 1, 0, 0},
20702 {&__pyx_n_s_index_set___iter, __pyx_k_index_set___iter,
sizeof(__pyx_k_index_set___iter), 0, 0, 1, 1},
20703 {&__pyx_kp_u_index_set___iter___line_229, __pyx_k_index_set___iter___line_229,
sizeof(__pyx_k_index_set___iter___line_229), 0, 1, 0, 0},
20704 {&__pyx_kp_u_index_set___ixor___line_260, __pyx_k_index_set___ixor___line_260,
sizeof(__pyx_k_index_set___ixor___line_260), 0, 1, 0, 0},
20705 {&__pyx_kp_u_index_set___or___line_293, __pyx_k_index_set___or___line_293,
sizeof(__pyx_k_index_set___or___line_293), 0, 1, 0, 0},
20706 {&__pyx_kp_u_index_set___repr___line_384, __pyx_k_index_set___repr___line_384,
sizeof(__pyx_k_index_set___repr___line_384), 0, 1, 0, 0},
20707 {&__pyx_kp_u_index_set___setitem___line_179, __pyx_k_index_set___setitem___line_179,
sizeof(__pyx_k_index_set___setitem___line_179), 0, 1, 0, 0},
20708 {&__pyx_kp_u_index_set___str___line_395, __pyx_k_index_set___str___line_395,
sizeof(__pyx_k_index_set___str___line_395), 0, 1, 0, 0},
20709 {&__pyx_kp_u_index_set___xor___line_249, __pyx_k_index_set___xor___line_249,
sizeof(__pyx_k_index_set___xor___line_249), 0, 1, 0, 0},
20710 {&__pyx_kp_u_index_set_copy_line_65, __pyx_k_index_set_copy_line_65,
sizeof(__pyx_k_index_set_copy_line_65), 0, 1, 0, 0},
20711 {&__pyx_kp_u_index_set_count_line_315, __pyx_k_index_set_count_line_315,
sizeof(__pyx_k_index_set_count_line_315), 0, 1, 0, 0},
20712 {&__pyx_kp_u_index_set_count_neg_line_324, __pyx_k_index_set_count_neg_line_324,
sizeof(__pyx_k_index_set_count_neg_line_324), 0, 1, 0, 0},
20713 {&__pyx_kp_u_index_set_count_pos_line_333, __pyx_k_index_set_count_pos_line_333,
sizeof(__pyx_k_index_set_count_pos_line_333), 0, 1, 0, 0},
20714 {&__pyx_n_s_index_set_hidden_doctests, __pyx_k_index_set_hidden_doctests,
sizeof(__pyx_k_index_set_hidden_doctests), 0, 0, 1, 1},
20715 {&__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},
20716 {&__pyx_kp_u_index_set_max_line_351, __pyx_k_index_set_max_line_351,
sizeof(__pyx_k_index_set_max_line_351), 0, 1, 0, 0},
20717 {&__pyx_kp_u_index_set_min_line_342, __pyx_k_index_set_min_line_342,
sizeof(__pyx_k_index_set_min_line_342), 0, 1, 0, 0},
20718 {&__pyx_kp_u_index_set_sign_of_mult_line_366, __pyx_k_index_set_sign_of_mult_line_366,
sizeof(__pyx_k_index_set_sign_of_mult_line_366), 0, 1, 0, 0},
20719 {&__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},
20720 {&__pyx_n_s_inv, __pyx_k_inv,
sizeof(__pyx_k_inv), 0, 0, 1, 1},
20721 {&__pyx_kp_u_inv_line_1378, __pyx_k_inv_line_1378,
sizeof(__pyx_k_inv_line_1378), 0, 1, 0, 0},
20722 {&__pyx_kp_u_invalid, __pyx_k_invalid,
sizeof(__pyx_k_invalid), 0, 1, 0, 0},
20723 {&__pyx_kp_u_invalid_string, __pyx_k_invalid_string,
sizeof(__pyx_k_invalid_string), 0, 1, 0, 0},
20724 {&__pyx_n_s_involute, __pyx_k_involute,
sizeof(__pyx_k_involute), 0, 0, 1, 1},
20725 {&__pyx_kp_u_involute_line_1455, __pyx_k_involute_line_1455,
sizeof(__pyx_k_involute_line_1455), 0, 1, 0, 0},
20726 {&__pyx_n_s_ist, __pyx_k_ist,
sizeof(__pyx_k_ist), 0, 0, 1, 1},
20727 {&__pyx_n_s_istpq, __pyx_k_istpq,
sizeof(__pyx_k_istpq), 0, 0, 1, 1},
20728 {&__pyx_kp_u_istpq_line_1949, __pyx_k_istpq_line_1949,
sizeof(__pyx_k_istpq_line_1949), 0, 1, 0, 0},
20729 {&__pyx_n_s_iter, __pyx_k_iter,
sizeof(__pyx_k_iter), 0, 0, 1, 1},
20730 {&__pyx_n_s_ixt, __pyx_k_ixt,
sizeof(__pyx_k_ixt), 0, 0, 1, 1},
20731 {&__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},
20732 {&__pyx_n_s_lhs, __pyx_k_lhs,
sizeof(__pyx_k_lhs), 0, 0, 1, 1},
20733 {&__pyx_n_s_log, __pyx_k_log,
sizeof(__pyx_k_log), 0, 0, 1, 1},
20734 {&__pyx_kp_u_log_line_1628, __pyx_k_log_line_1628,
sizeof(__pyx_k_log_line_1628), 0, 1, 0, 0},
20735 {&__pyx_n_s_m, __pyx_k_m,
sizeof(__pyx_k_m), 0, 0, 1, 1},
20736 {&__pyx_n_s_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 0, 1, 1},
20737 {&__pyx_n_u_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 1, 0, 1},
20738 {&__pyx_n_s_math, __pyx_k_math,
sizeof(__pyx_k_math), 0, 0, 1, 1},
20739 {&__pyx_n_s_max, __pyx_k_max,
sizeof(__pyx_k_max), 0, 0, 1, 1},
20740 {&__pyx_kp_u_max_abs_line_1531, __pyx_k_max_abs_line_1531,
sizeof(__pyx_k_max_abs_line_1531), 0, 1, 0, 0},
20741 {&__pyx_kp_u_max_pos_line_513, __pyx_k_max_pos_line_513,
sizeof(__pyx_k_max_pos_line_513), 0, 1, 0, 0},
20742 {&__pyx_n_s_min, __pyx_k_min,
sizeof(__pyx_k_min), 0, 0, 1, 1},
20743 {&__pyx_kp_u_min_neg_line_504, __pyx_k_min_neg_line_504,
sizeof(__pyx_k_min_neg_line_504), 0, 1, 0, 0},
20744 {&__pyx_n_s_name, __pyx_k_name,
sizeof(__pyx_k_name), 0, 0, 1, 1},
20745 {&__pyx_n_s_nbar3, __pyx_k_nbar3,
sizeof(__pyx_k_nbar3), 0, 0, 1, 1},
20746 {&__pyx_n_s_ninf3, __pyx_k_ninf3,
sizeof(__pyx_k_ninf3), 0, 0, 1, 1},
20747 {&__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},
20748 {&__pyx_n_s_norm, __pyx_k_norm,
sizeof(__pyx_k_norm), 0, 0, 1, 1},
20749 {&__pyx_kp_u_norm_line_1511, __pyx_k_norm_line_1511,
sizeof(__pyx_k_norm_line_1511), 0, 1, 0, 0},
20750 {&__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},
20751 {&__pyx_n_s_numbers, __pyx_k_numbers,
sizeof(__pyx_k_numbers), 0, 0, 1, 1},
20752 {&__pyx_n_s_obj, __pyx_k_obj,
sizeof(__pyx_k_obj), 0, 0, 1, 1},
20753 {&__pyx_n_s_odd, __pyx_k_odd,
sizeof(__pyx_k_odd), 0, 0, 1, 1},
20754 {&__pyx_kp_u_odd_line_1446, __pyx_k_odd_line_1446,
sizeof(__pyx_k_odd_line_1446), 0, 1, 0, 0},
20755 {&__pyx_n_s_other, __pyx_k_other,
sizeof(__pyx_k_other), 0, 0, 1, 1},
20756 {&__pyx_n_s_outer_pow, __pyx_k_outer_pow,
sizeof(__pyx_k_outer_pow), 0, 0, 1, 1},
20757 {&__pyx_kp_u_outer_pow_line_1567, __pyx_k_outer_pow_line_1567,
sizeof(__pyx_k_outer_pow_line_1567), 0, 1, 0, 0},
20758 {&__pyx_n_s_p, __pyx_k_p,
sizeof(__pyx_k_p), 0, 0, 1, 1},
20759 {&__pyx_n_s_pi, __pyx_k_pi,
sizeof(__pyx_k_pi), 0, 0, 1, 1},
20760 {&__pyx_n_s_pow, __pyx_k_pow,
sizeof(__pyx_k_pow), 0, 0, 1, 1},
20761 {&__pyx_kp_u_pow_line_1543, __pyx_k_pow_line_1543,
sizeof(__pyx_k_pow_line_1543), 0, 1, 0, 0},
20762 {&__pyx_n_s_pure, __pyx_k_pure,
sizeof(__pyx_k_pure), 0, 0, 1, 1},
20763 {&__pyx_kp_u_pure_line_1426, __pyx_k_pure_line_1426,
sizeof(__pyx_k_pure_line_1426), 0, 1, 0, 0},
20764 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable,
sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
20765 {&__pyx_n_s_q, __pyx_k_q,
sizeof(__pyx_k_q), 0, 0, 1, 1},
20766 {&__pyx_n_s_quad, __pyx_k_quad,
sizeof(__pyx_k_quad), 0, 0, 1, 1},
20767 {&__pyx_kp_u_quad_line_1500, __pyx_k_quad_line_1500,
sizeof(__pyx_k_quad_line_1500), 0, 1, 0, 0},
20768 {&__pyx_kp_u_random_clifford_line_1864, __pyx_k_random_clifford_line_1864,
sizeof(__pyx_k_random_clifford_line_1864), 0, 1, 0, 0},
20769 {&__pyx_n_s_range, __pyx_k_range,
sizeof(__pyx_k_range), 0, 0, 1, 1},
20770 {&__pyx_kp_u_real_line_1404, __pyx_k_real_line_1404,
sizeof(__pyx_k_real_line_1404), 0, 1, 0, 0},
20771 {&__pyx_n_s_reduce, __pyx_k_reduce,
sizeof(__pyx_k_reduce), 0, 0, 1, 1},
20772 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython,
sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
20773 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex,
sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
20774 {&__pyx_n_s_reverse, __pyx_k_reverse,
sizeof(__pyx_k_reverse), 0, 0, 1, 1},
20775 {&__pyx_kp_u_reverse_line_1470, __pyx_k_reverse_line_1470,
sizeof(__pyx_k_reverse_line_1470), 0, 1, 0, 0},
20776 {&__pyx_n_s_rhs, __pyx_k_rhs,
sizeof(__pyx_k_rhs), 0, 0, 1, 1},
20777 {&__pyx_n_s_scalar, __pyx_k_scalar,
sizeof(__pyx_k_scalar), 0, 0, 1, 1},
20778 {&__pyx_n_s_scalar_epsilon, __pyx_k_scalar_epsilon,
sizeof(__pyx_k_scalar_epsilon), 0, 0, 1, 1},
20779 {&__pyx_kp_u_scalar_line_1393, __pyx_k_scalar_line_1393,
sizeof(__pyx_k_scalar_line_1393), 0, 1, 0, 0},
20780 {&__pyx_n_s_send, __pyx_k_send,
sizeof(__pyx_k_send), 0, 0, 1, 1},
20781 {&__pyx_n_s_setstate, __pyx_k_setstate,
sizeof(__pyx_k_setstate), 0, 0, 1, 1},
20782 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython,
sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
20783 {&__pyx_n_s_sin, __pyx_k_sin,
sizeof(__pyx_k_sin), 0, 0, 1, 1},
20784 {&__pyx_kp_u_sin_line_1728, __pyx_k_sin_line_1728,
sizeof(__pyx_k_sin_line_1728), 0, 1, 0, 0},
20785 {&__pyx_n_s_sinh, __pyx_k_sinh,
sizeof(__pyx_k_sinh), 0, 0, 1, 1},
20786 {&__pyx_kp_u_sinh_line_1768, __pyx_k_sinh_line_1768,
sizeof(__pyx_k_sinh_line_1768), 0, 1, 0, 0},
20787 {&__pyx_n_s_sqrt, __pyx_k_sqrt,
sizeof(__pyx_k_sqrt), 0, 0, 1, 1},
20788 {&__pyx_kp_u_sqrt_line_1591, __pyx_k_sqrt_line_1591,
sizeof(__pyx_k_sqrt_line_1591), 0, 1, 0, 0},
20789 {&__pyx_n_s_tan, __pyx_k_tan,
sizeof(__pyx_k_tan), 0, 0, 1, 1},
20790 {&__pyx_kp_u_tan_line_1801, __pyx_k_tan_line_1801,
sizeof(__pyx_k_tan_line_1801), 0, 1, 0, 0},
20791 {&__pyx_n_s_tanh, __pyx_k_tanh,
sizeof(__pyx_k_tanh), 0, 0, 1, 1},
20792 {&__pyx_kp_u_tanh_line_1835, __pyx_k_tanh_line_1835,
sizeof(__pyx_k_tanh_line_1835), 0, 1, 0, 0},
20793 {&__pyx_n_s_tau, __pyx_k_tau,
sizeof(__pyx_k_tau), 0, 0, 1, 1},
20794 {&__pyx_n_s_test, __pyx_k_test,
sizeof(__pyx_k_test), 0, 0, 1, 1},
20795 {&__pyx_n_s_test_2, __pyx_k_test_2,
sizeof(__pyx_k_test_2), 0, 0, 1, 1},
20796 {&__pyx_n_s_testmod, __pyx_k_testmod,
sizeof(__pyx_k_testmod), 0, 0, 1, 1},
20797 {&__pyx_n_s_threshold, __pyx_k_threshold,
sizeof(__pyx_k_threshold), 0, 0, 1, 1},
20798 {&__pyx_n_s_throw, __pyx_k_throw,
sizeof(__pyx_k_throw), 0, 0, 1, 1},
20799 {&__pyx_kp_u_to_frame, __pyx_k_to_frame,
sizeof(__pyx_k_to_frame), 0, 1, 0, 0},
20800 {&__pyx_n_s_tol, __pyx_k_tol,
sizeof(__pyx_k_tol), 0, 0, 1, 1},
20801 {&__pyx_kp_u_using, __pyx_k_using,
sizeof(__pyx_k_using), 0, 1, 0, 0},
20802 {&__pyx_kp_u_using_invalid, __pyx_k_using_invalid,
sizeof(__pyx_k_using_invalid), 0, 1, 0, 0},
20803 {&__pyx_kp_u_utf_8, __pyx_k_utf_8,
sizeof(__pyx_k_utf_8), 0, 1, 0, 0},
20804 {&__pyx_kp_u_value, __pyx_k_value,
sizeof(__pyx_k_value), 0, 1, 0, 0},
20805 {&__pyx_n_s_version, __pyx_k_version,
sizeof(__pyx_k_version), 0, 0, 1, 1},
20806 {&__pyx_n_s_xrange, __pyx_k_xrange,
sizeof(__pyx_k_xrange), 0, 0, 1, 1},
20807 {0, 0, 0, 0, 0, 0, 0}
20809 static CYTHON_SMALL_CODE
int __Pyx_InitCachedBuiltins(
void) {
20810 __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError);
if (!__pyx_builtin_IndexError) __PYX_ERR(0, 103, __pyx_L1_error)
20811 __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError);
if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 105, __pyx_L1_error)
20812 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError);
if (!__pyx_builtin_TypeError) __PYX_ERR(0, 105, __pyx_L1_error)
20813 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError);
if (!__pyx_builtin_ValueError) __PYX_ERR(0, 106, __pyx_L1_error)
20814 __pyx_builtin_NotImplemented = __Pyx_GetBuiltinName(__pyx_n_s_NotImplemented);
if (!__pyx_builtin_NotImplemented) __PYX_ERR(0, 159, __pyx_L1_error)
20815 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_range) __PYX_ERR(0, 236, __pyx_L1_error)
20816 #if PY_MAJOR_VERSION >= 3 20817 __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_xrange) __PYX_ERR(0, 1099, __pyx_L1_error)
20819 __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange);
if (!__pyx_builtin_xrange) __PYX_ERR(0, 1099, __pyx_L1_error)
20826 static CYTHON_SMALL_CODE
int __Pyx_InitCachedConstants(
void) {
20827 __Pyx_RefNannyDeclarations
20828 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
20836 __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)
20837 __Pyx_GOTREF(__pyx_tuple__3);
20838 __Pyx_GIVEREF(__pyx_tuple__3);
20845 __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)
20846 __Pyx_GOTREF(__pyx_tuple__4);
20847 __Pyx_GIVEREF(__pyx_tuple__4);
20856 __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_Not_applicable);
if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 636, __pyx_L1_error)
20857 __Pyx_GOTREF(__pyx_tuple__10);
20858 __Pyx_GIVEREF(__pyx_tuple__10);
20866 __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 2, __pyx_L1_error)
20867 __Pyx_GOTREF(__pyx_tuple__11);
20868 __Pyx_GIVEREF(__pyx_tuple__11);
20875 __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 4, __pyx_L1_error)
20876 __Pyx_GOTREF(__pyx_tuple__12);
20877 __Pyx_GIVEREF(__pyx_tuple__12);
20886 __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_PyClical_pyx, __pyx_n_s_index_set_hidden_doctests, 406, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 406, __pyx_L1_error)
20895 __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_PyClical_pyx, __pyx_n_s_clifford_hidden_doctests, 1253, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 1253, __pyx_L1_error)
20904 __pyx_tuple__15 = PyTuple_Pack(1, __pyx_float_1_0);
if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 1907, __pyx_L1_error)
20905 __Pyx_GOTREF(__pyx_tuple__15);
20906 __Pyx_GIVEREF(__pyx_tuple__15);
20915 __pyx_tuple__16 = PyTuple_Pack(1, __pyx_n_s_obj);
if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 1936, __pyx_L1_error)
20916 __Pyx_GOTREF(__pyx_tuple__16);
20917 __Pyx_GIVEREF(__pyx_tuple__16);
20918 __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_PyClical_pyx, __pyx_n_s_e, 1936, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 1936, __pyx_L1_error)
20927 __pyx_tuple__18 = PyTuple_Pack(2, __pyx_n_s_p, __pyx_n_s_q);
if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 1949, __pyx_L1_error)
20928 __Pyx_GOTREF(__pyx_tuple__18);
20929 __Pyx_GIVEREF(__pyx_tuple__18);
20930 __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_PyClical_pyx, __pyx_n_s_istpq, 1949, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 1949, __pyx_L1_error)
20939 __pyx_tuple__20 = PyTuple_Pack(1, __pyx_int_4);
if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 1958, __pyx_L1_error)
20940 __Pyx_GOTREF(__pyx_tuple__20);
20941 __Pyx_GIVEREF(__pyx_tuple__20);
20942 __pyx_tuple__21 = PyTuple_Pack(1, __pyx_int_neg_1);
if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 1958, __pyx_L1_error)
20943 __Pyx_GOTREF(__pyx_tuple__21);
20944 __Pyx_GIVEREF(__pyx_tuple__21);
20953 __pyx_tuple__22 = PyTuple_Pack(2, __pyx_n_s_PyClical, __pyx_n_s_doctest);
if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 1962, __pyx_L1_error)
20954 __Pyx_GOTREF(__pyx_tuple__22);
20955 __Pyx_GIVEREF(__pyx_tuple__22);
20956 __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_PyClical_pyx, __pyx_n_s_test, 1962, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 1962, __pyx_L1_error)
20957 __Pyx_RefNannyFinishContext();
20960 __Pyx_RefNannyFinishContext();
20964 static CYTHON_SMALL_CODE
int __Pyx_InitGlobals(
void) {
20965 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
20966 __pyx_float_0_0 =
PyFloat_FromDouble(0.0);
if (unlikely(!__pyx_float_0_0)) __PYX_ERR(0, 1, __pyx_L1_error)
20967 __pyx_float_1_0 =
PyFloat_FromDouble(1.0);
if (unlikely(!__pyx_float_1_0)) __PYX_ERR(0, 1, __pyx_L1_error)
20968 __pyx_float_4_0 =
PyFloat_FromDouble(4.0);
if (unlikely(!__pyx_float_4_0)) __PYX_ERR(0, 1, __pyx_L1_error)
20969 __pyx_float_8_0 =
PyFloat_FromDouble(8.0);
if (unlikely(!__pyx_float_8_0)) __PYX_ERR(0, 1, __pyx_L1_error)
20970 __pyx_int_0 = PyInt_FromLong(0);
if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
20971 __pyx_int_1 = PyInt_FromLong(1);
if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
20972 __pyx_int_4 = PyInt_FromLong(4);
if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error)
20973 __pyx_int_neg_1 = PyInt_FromLong(-1);
if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
20979 static CYTHON_SMALL_CODE
int __Pyx_modinit_global_init_code(
void);
20980 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_export_code(
void);
20981 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_export_code(
void);
20982 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_init_code(
void);
20983 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_import_code(
void);
20984 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_import_code(
void);
20985 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_import_code(
void);
20987 static int __Pyx_modinit_global_init_code(
void) {
20988 __Pyx_RefNannyDeclarations
20989 __Pyx_RefNannySetupContext(
"__Pyx_modinit_global_init_code", 0);
20991 __Pyx_RefNannyFinishContext();
20995 static int __Pyx_modinit_variable_export_code(
void) {
20996 __Pyx_RefNannyDeclarations
20997 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_export_code", 0);
20999 __Pyx_RefNannyFinishContext();
21003 static int __Pyx_modinit_function_export_code(
void) {
21004 __Pyx_RefNannyDeclarations
21005 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_export_code", 0);
21007 __Pyx_RefNannyFinishContext();
21011 static int __Pyx_modinit_type_init_code(
void) {
21012 __Pyx_RefNannyDeclarations
21013 int __pyx_lineno = 0;
21014 const char *__pyx_filename = NULL;
21015 int __pyx_clineno = 0;
21016 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_init_code", 0);
21018 __pyx_vtabptr_8PyClical_index_set = &__pyx_vtable_8PyClical_index_set;
21019 __pyx_vtable_8PyClical_index_set.wrap = (PyObject *(*)(
struct __pyx_obj_8PyClical_index_set *,
IndexSet))__pyx_f_8PyClical_9index_set_wrap;
21020 __pyx_vtable_8PyClical_index_set.unwrap = (
IndexSet (*)(
struct __pyx_obj_8PyClical_index_set *))__pyx_f_8PyClical_9index_set_unwrap;
21021 __pyx_vtable_8PyClical_index_set.copy = (PyObject *(*)(
struct __pyx_obj_8PyClical_index_set *,
int __pyx_skip_dispatch))__pyx_f_8PyClical_9index_set_copy;
21022 if (PyType_Ready(&__pyx_type_8PyClical_index_set) < 0) __PYX_ERR(0, 46, __pyx_L1_error)
21023 #if PY_VERSION_HEX < 0x030800B1 21024 __pyx_type_8PyClical_index_set.tp_print = 0;
21026 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8PyClical_index_set.tp_dictoffset && __pyx_type_8PyClical_index_set.tp_getattro == PyObject_GenericGetAttr)) {
21027 __pyx_type_8PyClical_index_set.tp_getattro = __Pyx_PyObject_GenericGetAttr;
21029 #if CYTHON_COMPILING_IN_CPYTHON 21031 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__setitem__");
if (unlikely(!wrapper)) __PYX_ERR(0, 46, __pyx_L1_error)
21032 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
21033 __pyx_wrapperbase_8PyClical_9index_set_8__setitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
21034 __pyx_wrapperbase_8PyClical_9index_set_8__setitem__.doc = __pyx_doc_8PyClical_9index_set_8__setitem__;
21035 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_8__setitem__;
21039 #if CYTHON_COMPILING_IN_CPYTHON 21041 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__getitem__");
if (unlikely(!wrapper)) __PYX_ERR(0, 46, __pyx_L1_error)
21042 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
21043 __pyx_wrapperbase_8PyClical_9index_set_10__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
21044 __pyx_wrapperbase_8PyClical_9index_set_10__getitem__.doc = __pyx_doc_8PyClical_9index_set_10__getitem__;
21045 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_10__getitem__;
21049 #if CYTHON_COMPILING_IN_CPYTHON 21051 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__contains__");
if (unlikely(!wrapper)) __PYX_ERR(0, 46, __pyx_L1_error)
21052 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
21053 __pyx_wrapperbase_8PyClical_9index_set_12__contains__ = *((PyWrapperDescrObject *)wrapper)->d_base;
21054 __pyx_wrapperbase_8PyClical_9index_set_12__contains__.doc = __pyx_doc_8PyClical_9index_set_12__contains__;
21055 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_12__contains__;
21059 #if CYTHON_COMPILING_IN_CPYTHON 21061 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__iter__");
if (unlikely(!wrapper)) __PYX_ERR(0, 46, __pyx_L1_error)
21062 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
21063 __pyx_wrapperbase_8PyClical_9index_set_14__iter__ = *((PyWrapperDescrObject *)wrapper)->d_base;
21064 __pyx_wrapperbase_8PyClical_9index_set_14__iter__.doc = __pyx_doc_8PyClical_9index_set_14__iter__;
21065 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_14__iter__;
21069 #if CYTHON_COMPILING_IN_CPYTHON 21071 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__invert__");
if (unlikely(!wrapper)) __PYX_ERR(0, 46, __pyx_L1_error)
21072 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
21073 __pyx_wrapperbase_8PyClical_9index_set_17__invert__ = *((PyWrapperDescrObject *)wrapper)->d_base;
21074 __pyx_wrapperbase_8PyClical_9index_set_17__invert__.doc = __pyx_doc_8PyClical_9index_set_17__invert__;
21075 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_17__invert__;
21079 #if CYTHON_COMPILING_IN_CPYTHON 21081 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__xor__");
if (unlikely(!wrapper)) __PYX_ERR(0, 46, __pyx_L1_error)
21082 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
21083 __pyx_wrapperbase_8PyClical_9index_set_19__xor__ = *((PyWrapperDescrObject *)wrapper)->d_base;
21084 __pyx_wrapperbase_8PyClical_9index_set_19__xor__.doc = __pyx_doc_8PyClical_9index_set_19__xor__;
21085 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_19__xor__;
21089 #if CYTHON_COMPILING_IN_CPYTHON 21091 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__ixor__");
if (unlikely(!wrapper)) __PYX_ERR(0, 46, __pyx_L1_error)
21092 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
21093 __pyx_wrapperbase_8PyClical_9index_set_21__ixor__ = *((PyWrapperDescrObject *)wrapper)->d_base;
21094 __pyx_wrapperbase_8PyClical_9index_set_21__ixor__.doc = __pyx_doc_8PyClical_9index_set_21__ixor__;
21095 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_21__ixor__;
21099 #if CYTHON_COMPILING_IN_CPYTHON 21101 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__and__");
if (unlikely(!wrapper)) __PYX_ERR(0, 46, __pyx_L1_error)
21102 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
21103 __pyx_wrapperbase_8PyClical_9index_set_23__and__ = *((PyWrapperDescrObject *)wrapper)->d_base;
21104 __pyx_wrapperbase_8PyClical_9index_set_23__and__.doc = __pyx_doc_8PyClical_9index_set_23__and__;
21105 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_23__and__;
21109 #if CYTHON_COMPILING_IN_CPYTHON 21111 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__iand__");
if (unlikely(!wrapper)) __PYX_ERR(0, 46, __pyx_L1_error)
21112 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
21113 __pyx_wrapperbase_8PyClical_9index_set_25__iand__ = *((PyWrapperDescrObject *)wrapper)->d_base;
21114 __pyx_wrapperbase_8PyClical_9index_set_25__iand__.doc = __pyx_doc_8PyClical_9index_set_25__iand__;
21115 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_25__iand__;
21119 #if CYTHON_COMPILING_IN_CPYTHON 21121 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__or__");
if (unlikely(!wrapper)) __PYX_ERR(0, 46, __pyx_L1_error)
21122 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
21123 __pyx_wrapperbase_8PyClical_9index_set_27__or__ = *((PyWrapperDescrObject *)wrapper)->d_base;
21124 __pyx_wrapperbase_8PyClical_9index_set_27__or__.doc = __pyx_doc_8PyClical_9index_set_27__or__;
21125 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_27__or__;
21129 #if CYTHON_COMPILING_IN_CPYTHON 21131 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__ior__");
if (unlikely(!wrapper)) __PYX_ERR(0, 46, __pyx_L1_error)
21132 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
21133 __pyx_wrapperbase_8PyClical_9index_set_29__ior__ = *((PyWrapperDescrObject *)wrapper)->d_base;
21134 __pyx_wrapperbase_8PyClical_9index_set_29__ior__.doc = __pyx_doc_8PyClical_9index_set_29__ior__;
21135 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_29__ior__;
21139 #if CYTHON_COMPILING_IN_CPYTHON 21141 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__repr__");
if (unlikely(!wrapper)) __PYX_ERR(0, 46, __pyx_L1_error)
21142 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
21143 __pyx_wrapperbase_8PyClical_9index_set_47__repr__ = *((PyWrapperDescrObject *)wrapper)->d_base;
21144 __pyx_wrapperbase_8PyClical_9index_set_47__repr__.doc = __pyx_doc_8PyClical_9index_set_47__repr__;
21145 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_47__repr__;
21149 #if CYTHON_COMPILING_IN_CPYTHON 21151 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__str__");
if (unlikely(!wrapper)) __PYX_ERR(0, 46, __pyx_L1_error)
21152 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
21153 __pyx_wrapperbase_8PyClical_9index_set_49__str__ = *((PyWrapperDescrObject *)wrapper)->d_base;
21154 __pyx_wrapperbase_8PyClical_9index_set_49__str__.doc = __pyx_doc_8PyClical_9index_set_49__str__;
21155 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_49__str__;
21159 if (__Pyx_SetVtable(__pyx_type_8PyClical_index_set.tp_dict, __pyx_vtabptr_8PyClical_index_set) < 0) __PYX_ERR(0, 46, __pyx_L1_error)
21160 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_index_set, (PyObject *)&__pyx_type_8PyClical_index_set) < 0) __PYX_ERR(0, 46, __pyx_L1_error)
21161 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8PyClical_index_set) < 0) __PYX_ERR(0, 46, __pyx_L1_error)
21162 __pyx_ptype_8PyClical_index_set = &__pyx_type_8PyClical_index_set;
21163 __pyx_vtabptr_8PyClical_clifford = &__pyx_vtable_8PyClical_clifford;
21164 __pyx_vtable_8PyClical_clifford.wrap = (PyObject *(*)(
struct __pyx_obj_8PyClical_clifford *,
Clifford))__pyx_f_8PyClical_8clifford_wrap;
21165 __pyx_vtable_8PyClical_clifford.unwrap = (
Clifford (*)(
struct __pyx_obj_8PyClical_clifford *))__pyx_f_8PyClical_8clifford_unwrap;
21166 __pyx_vtable_8PyClical_clifford.copy = (PyObject *(*)(
struct __pyx_obj_8PyClical_clifford *,
int __pyx_skip_dispatch))__pyx_f_8PyClical_8clifford_copy;
21167 if (PyType_Ready(&__pyx_type_8PyClical_clifford) < 0) __PYX_ERR(0, 537, __pyx_L1_error)
21168 #if PY_VERSION_HEX < 0x030800B1 21169 __pyx_type_8PyClical_clifford.tp_print = 0;
21171 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8PyClical_clifford.tp_dictoffset && __pyx_type_8PyClical_clifford.tp_getattro == PyObject_GenericGetAttr)) {
21172 __pyx_type_8PyClical_clifford.tp_getattro = __Pyx_PyObject_GenericGetAttr;
21174 #if CYTHON_COMPILING_IN_CPYTHON 21176 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__contains__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
21177 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
21178 __pyx_wrapperbase_8PyClical_8clifford_6__contains__ = *((PyWrapperDescrObject *)wrapper)->d_base;
21179 __pyx_wrapperbase_8PyClical_8clifford_6__contains__.doc = __pyx_doc_8PyClical_8clifford_6__contains__;
21180 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_6__contains__;
21184 #if CYTHON_COMPILING_IN_CPYTHON 21186 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__iter__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
21187 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
21188 __pyx_wrapperbase_8PyClical_8clifford_8__iter__ = *((PyWrapperDescrObject *)wrapper)->d_base;
21189 __pyx_wrapperbase_8PyClical_8clifford_8__iter__.doc = __pyx_doc_8PyClical_8clifford_8__iter__;
21190 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_8__iter__;
21194 #if CYTHON_COMPILING_IN_CPYTHON 21196 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__getitem__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
21197 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
21198 __pyx_wrapperbase_8PyClical_8clifford_14__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
21199 __pyx_wrapperbase_8PyClical_8clifford_14__getitem__.doc = __pyx_doc_8PyClical_8clifford_14__getitem__;
21200 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_14__getitem__;
21204 #if CYTHON_COMPILING_IN_CPYTHON 21206 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__neg__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
21207 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
21208 __pyx_wrapperbase_8PyClical_8clifford_16__neg__ = *((PyWrapperDescrObject *)wrapper)->d_base;
21209 __pyx_wrapperbase_8PyClical_8clifford_16__neg__.doc = __pyx_doc_8PyClical_8clifford_16__neg__;
21210 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_16__neg__;
21214 #if CYTHON_COMPILING_IN_CPYTHON 21216 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__pos__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
21217 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
21218 __pyx_wrapperbase_8PyClical_8clifford_18__pos__ = *((PyWrapperDescrObject *)wrapper)->d_base;
21219 __pyx_wrapperbase_8PyClical_8clifford_18__pos__.doc = __pyx_doc_8PyClical_8clifford_18__pos__;
21220 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_18__pos__;
21224 #if CYTHON_COMPILING_IN_CPYTHON 21226 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__add__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
21227 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
21228 __pyx_wrapperbase_8PyClical_8clifford_20__add__ = *((PyWrapperDescrObject *)wrapper)->d_base;
21229 __pyx_wrapperbase_8PyClical_8clifford_20__add__.doc = __pyx_doc_8PyClical_8clifford_20__add__;
21230 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_20__add__;
21234 #if CYTHON_COMPILING_IN_CPYTHON 21236 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__iadd__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
21237 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
21238 __pyx_wrapperbase_8PyClical_8clifford_22__iadd__ = *((PyWrapperDescrObject *)wrapper)->d_base;
21239 __pyx_wrapperbase_8PyClical_8clifford_22__iadd__.doc = __pyx_doc_8PyClical_8clifford_22__iadd__;
21240 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_22__iadd__;
21244 #if CYTHON_COMPILING_IN_CPYTHON 21246 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__sub__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
21247 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
21248 __pyx_wrapperbase_8PyClical_8clifford_24__sub__ = *((PyWrapperDescrObject *)wrapper)->d_base;
21249 __pyx_wrapperbase_8PyClical_8clifford_24__sub__.doc = __pyx_doc_8PyClical_8clifford_24__sub__;
21250 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_24__sub__;
21254 #if CYTHON_COMPILING_IN_CPYTHON 21256 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__isub__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
21257 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
21258 __pyx_wrapperbase_8PyClical_8clifford_26__isub__ = *((PyWrapperDescrObject *)wrapper)->d_base;
21259 __pyx_wrapperbase_8PyClical_8clifford_26__isub__.doc = __pyx_doc_8PyClical_8clifford_26__isub__;
21260 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_26__isub__;
21264 #if CYTHON_COMPILING_IN_CPYTHON 21266 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__mul__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
21267 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
21268 __pyx_wrapperbase_8PyClical_8clifford_28__mul__ = *((PyWrapperDescrObject *)wrapper)->d_base;
21269 __pyx_wrapperbase_8PyClical_8clifford_28__mul__.doc = __pyx_doc_8PyClical_8clifford_28__mul__;
21270 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_28__mul__;
21274 #if CYTHON_COMPILING_IN_CPYTHON 21276 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__imul__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
21277 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
21278 __pyx_wrapperbase_8PyClical_8clifford_30__imul__ = *((PyWrapperDescrObject *)wrapper)->d_base;
21279 __pyx_wrapperbase_8PyClical_8clifford_30__imul__.doc = __pyx_doc_8PyClical_8clifford_30__imul__;
21280 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_30__imul__;
21284 #if CYTHON_COMPILING_IN_CPYTHON 21286 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__mod__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
21287 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
21288 __pyx_wrapperbase_8PyClical_8clifford_32__mod__ = *((PyWrapperDescrObject *)wrapper)->d_base;
21289 __pyx_wrapperbase_8PyClical_8clifford_32__mod__.doc = __pyx_doc_8PyClical_8clifford_32__mod__;
21290 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_32__mod__;
21294 #if CYTHON_COMPILING_IN_CPYTHON 21296 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__imod__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
21297 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
21298 __pyx_wrapperbase_8PyClical_8clifford_34__imod__ = *((PyWrapperDescrObject *)wrapper)->d_base;
21299 __pyx_wrapperbase_8PyClical_8clifford_34__imod__.doc = __pyx_doc_8PyClical_8clifford_34__imod__;
21300 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_34__imod__;
21304 #if CYTHON_COMPILING_IN_CPYTHON 21306 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__and__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
21307 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
21308 __pyx_wrapperbase_8PyClical_8clifford_36__and__ = *((PyWrapperDescrObject *)wrapper)->d_base;
21309 __pyx_wrapperbase_8PyClical_8clifford_36__and__.doc = __pyx_doc_8PyClical_8clifford_36__and__;
21310 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_36__and__;
21314 #if CYTHON_COMPILING_IN_CPYTHON 21316 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__iand__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
21317 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
21318 __pyx_wrapperbase_8PyClical_8clifford_38__iand__ = *((PyWrapperDescrObject *)wrapper)->d_base;
21319 __pyx_wrapperbase_8PyClical_8clifford_38__iand__.doc = __pyx_doc_8PyClical_8clifford_38__iand__;
21320 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_38__iand__;
21324 #if CYTHON_COMPILING_IN_CPYTHON 21326 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__xor__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
21327 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
21328 __pyx_wrapperbase_8PyClical_8clifford_40__xor__ = *((PyWrapperDescrObject *)wrapper)->d_base;
21329 __pyx_wrapperbase_8PyClical_8clifford_40__xor__.doc = __pyx_doc_8PyClical_8clifford_40__xor__;
21330 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_40__xor__;
21334 #if CYTHON_COMPILING_IN_CPYTHON 21336 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__ixor__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
21337 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
21338 __pyx_wrapperbase_8PyClical_8clifford_42__ixor__ = *((PyWrapperDescrObject *)wrapper)->d_base;
21339 __pyx_wrapperbase_8PyClical_8clifford_42__ixor__.doc = __pyx_doc_8PyClical_8clifford_42__ixor__;
21340 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_42__ixor__;
21344 #if CYTHON_COMPILING_IN_CPYTHON 21346 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__truediv__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
21347 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
21348 __pyx_wrapperbase_8PyClical_8clifford_44__truediv__ = *((PyWrapperDescrObject *)wrapper)->d_base;
21349 __pyx_wrapperbase_8PyClical_8clifford_44__truediv__.doc = __pyx_doc_8PyClical_8clifford_44__truediv__;
21350 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_44__truediv__;
21354 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 21355 #if CYTHON_COMPILING_IN_CPYTHON 21357 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__idiv__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
21358 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
21359 __pyx_wrapperbase_8PyClical_8clifford_46__idiv__ = *((PyWrapperDescrObject *)wrapper)->d_base;
21360 __pyx_wrapperbase_8PyClical_8clifford_46__idiv__.doc = __pyx_doc_8PyClical_8clifford_46__idiv__;
21361 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_46__idiv__;
21366 #if CYTHON_COMPILING_IN_CPYTHON 21368 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__or__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
21369 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
21370 __pyx_wrapperbase_8PyClical_8clifford_50__or__ = *((PyWrapperDescrObject *)wrapper)->d_base;
21371 __pyx_wrapperbase_8PyClical_8clifford_50__or__.doc = __pyx_doc_8PyClical_8clifford_50__or__;
21372 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_50__or__;
21376 #if CYTHON_COMPILING_IN_CPYTHON 21378 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__ior__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
21379 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
21380 __pyx_wrapperbase_8PyClical_8clifford_52__ior__ = *((PyWrapperDescrObject *)wrapper)->d_base;
21381 __pyx_wrapperbase_8PyClical_8clifford_52__ior__.doc = __pyx_doc_8PyClical_8clifford_52__ior__;
21382 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_52__ior__;
21386 #if CYTHON_COMPILING_IN_CPYTHON 21388 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__pow__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
21389 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
21390 __pyx_wrapperbase_8PyClical_8clifford_54__pow__ = *((PyWrapperDescrObject *)wrapper)->d_base;
21391 __pyx_wrapperbase_8PyClical_8clifford_54__pow__.doc = __pyx_doc_8PyClical_8clifford_54__pow__;
21392 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_54__pow__;
21396 #if CYTHON_COMPILING_IN_CPYTHON 21398 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__call__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
21399 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
21400 __pyx_wrapperbase_8PyClical_8clifford_60__call__ = *((PyWrapperDescrObject *)wrapper)->d_base;
21401 __pyx_wrapperbase_8PyClical_8clifford_60__call__.doc = __pyx_doc_8PyClical_8clifford_60__call__;
21402 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_60__call__;
21406 #if CYTHON_COMPILING_IN_CPYTHON 21408 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__repr__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
21409 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
21410 __pyx_wrapperbase_8PyClical_8clifford_94__repr__ = *((PyWrapperDescrObject *)wrapper)->d_base;
21411 __pyx_wrapperbase_8PyClical_8clifford_94__repr__.doc = __pyx_doc_8PyClical_8clifford_94__repr__;
21412 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_94__repr__;
21416 #if CYTHON_COMPILING_IN_CPYTHON 21418 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__str__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
21419 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
21420 __pyx_wrapperbase_8PyClical_8clifford_96__str__ = *((PyWrapperDescrObject *)wrapper)->d_base;
21421 __pyx_wrapperbase_8PyClical_8clifford_96__str__.doc = __pyx_doc_8PyClical_8clifford_96__str__;
21422 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_96__str__;
21426 if (__Pyx_SetVtable(__pyx_type_8PyClical_clifford.tp_dict, __pyx_vtabptr_8PyClical_clifford) < 0) __PYX_ERR(0, 537, __pyx_L1_error)
21427 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_clifford, (PyObject *)&__pyx_type_8PyClical_clifford) < 0) __PYX_ERR(0, 537, __pyx_L1_error)
21428 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8PyClical_clifford) < 0) __PYX_ERR(0, 537, __pyx_L1_error)
21429 __pyx_ptype_8PyClical_clifford = &__pyx_type_8PyClical_clifford;
21430 if (PyType_Ready(&__pyx_type_8PyClical___pyx_scope_struct____iter__) < 0) __PYX_ERR(0, 229, __pyx_L1_error)
21431 #if PY_VERSION_HEX < 0x030800B1 21432 __pyx_type_8PyClical___pyx_scope_struct____iter__.tp_print = 0;
21434 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8PyClical___pyx_scope_struct____iter__.tp_dictoffset && __pyx_type_8PyClical___pyx_scope_struct____iter__.tp_getattro == PyObject_GenericGetAttr)) {
21435 __pyx_type_8PyClical___pyx_scope_struct____iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
21437 __pyx_ptype_8PyClical___pyx_scope_struct____iter__ = &__pyx_type_8PyClical___pyx_scope_struct____iter__;
21438 __Pyx_RefNannyFinishContext();
21441 __Pyx_RefNannyFinishContext();
21445 static int __Pyx_modinit_type_import_code(
void) {
21446 __Pyx_RefNannyDeclarations
21447 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_import_code", 0);
21449 __Pyx_RefNannyFinishContext();
21453 static int __Pyx_modinit_variable_import_code(
void) {
21454 __Pyx_RefNannyDeclarations
21455 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_import_code", 0);
21457 __Pyx_RefNannyFinishContext();
21461 static int __Pyx_modinit_function_import_code(
void) {
21462 __Pyx_RefNannyDeclarations
21463 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_import_code", 0);
21465 __Pyx_RefNannyFinishContext();
21470 #ifndef CYTHON_NO_PYINIT_EXPORT 21471 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC 21472 #elif PY_MAJOR_VERSION < 3 21474 #define __Pyx_PyMODINIT_FUNC extern "C" void 21476 #define __Pyx_PyMODINIT_FUNC void 21480 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * 21482 #define __Pyx_PyMODINIT_FUNC PyObject * 21487 #if PY_MAJOR_VERSION < 3 21488 __Pyx_PyMODINIT_FUNC initPyClical(
void) CYTHON_SMALL_CODE;
21489 __Pyx_PyMODINIT_FUNC initPyClical(
void)
21491 __Pyx_PyMODINIT_FUNC PyInit_PyClical(
void) CYTHON_SMALL_CODE;
21492 __Pyx_PyMODINIT_FUNC PyInit_PyClical(
void)
21493 #if CYTHON_PEP489_MULTI_PHASE_INIT 21495 return PyModuleDef_Init(&__pyx_moduledef);
21497 static CYTHON_SMALL_CODE
int __Pyx_check_single_interpreter(
void) {
21498 #if PY_VERSION_HEX >= 0x030700A1 21499 static PY_INT64_T main_interpreter_id = -1;
21500 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
21501 if (main_interpreter_id == -1) {
21502 main_interpreter_id = current_id;
21503 return (unlikely(current_id == -1)) ? -1 : 0;
21504 }
else if (unlikely(main_interpreter_id != current_id))
21506 static PyInterpreterState *main_interpreter = NULL;
21507 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
21508 if (!main_interpreter) {
21509 main_interpreter = current_interpreter;
21510 }
else if (unlikely(main_interpreter != current_interpreter))
21515 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
21520 static CYTHON_SMALL_CODE
int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict,
const char* from_name,
const char* to_name,
int allow_none) {
21521 PyObject *value = PyObject_GetAttrString(spec, from_name);
21523 if (likely(value)) {
21524 if (allow_none || value != Py_None) {
21525 result = PyDict_SetItemString(moddict, to_name, value);
21528 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
21535 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
21536 PyObject *module = NULL, *moddict, *modname;
21537 if (__Pyx_check_single_interpreter())
21540 return __Pyx_NewRef(__pyx_m);
21541 modname = PyObject_GetAttrString(spec,
"name");
21542 if (unlikely(!modname))
goto bad;
21543 module = PyModule_NewObject(modname);
21544 Py_DECREF(modname);
21545 if (unlikely(!module))
goto bad;
21546 moddict = PyModule_GetDict(module);
21547 if (unlikely(!moddict))
goto bad;
21548 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__", 1) < 0))
goto bad;
21549 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__", 1) < 0))
goto bad;
21550 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__", 1) < 0))
goto bad;
21551 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__", 0) < 0))
goto bad;
21554 Py_XDECREF(module);
21559 static CYTHON_SMALL_CODE
int __pyx_pymod_exec_PyClical(PyObject *__pyx_pyinit_module)
21563 PyObject *__pyx_t_1 = NULL;
21564 PyObject *__pyx_t_2 = NULL;
21565 PyObject *__pyx_t_3 = NULL;
21567 int __pyx_lineno = 0;
21568 const char *__pyx_filename = NULL;
21569 int __pyx_clineno = 0;
21570 __Pyx_RefNannyDeclarations
21571 #if CYTHON_PEP489_MULTI_PHASE_INIT 21573 if (__pyx_m == __pyx_pyinit_module)
return 0;
21574 PyErr_SetString(PyExc_RuntimeError,
"Module 'PyClical' has already been imported. Re-initialisation is not supported.");
21577 #elif PY_MAJOR_VERSION >= 3 21578 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
21580 #if CYTHON_REFNANNY 21581 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
21582 if (!__Pyx_RefNanny) {
21584 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
21585 if (!__Pyx_RefNanny)
21586 Py_FatalError(
"failed to import 'refnanny' module");
21589 __Pyx_RefNannySetupContext(
"__Pyx_PyMODINIT_FUNC PyInit_PyClical(void)", 0);
21590 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21591 #ifdef __Pxy_PyFrame_Initialize_Offsets 21592 __Pxy_PyFrame_Initialize_Offsets();
21594 __pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
21595 __pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
21596 __pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
21597 #ifdef __Pyx_CyFunction_USED 21598 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21600 #ifdef __Pyx_FusedFunction_USED 21601 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21603 #ifdef __Pyx_Coroutine_USED 21604 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21606 #ifdef __Pyx_Generator_USED 21607 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21609 #ifdef __Pyx_AsyncGen_USED 21610 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21612 #ifdef __Pyx_StopAsyncIteration_USED 21613 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21617 #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS 21618 PyEval_InitThreads();
21621 #if CYTHON_PEP489_MULTI_PHASE_INIT 21622 __pyx_m = __pyx_pyinit_module;
21623 Py_INCREF(__pyx_m);
21625 #if PY_MAJOR_VERSION < 3 21626 __pyx_m = Py_InitModule4(
"PyClical", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
21628 __pyx_m = PyModule_Create(&__pyx_moduledef);
21630 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
21632 __pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
21633 Py_INCREF(__pyx_d);
21634 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
21635 Py_INCREF(__pyx_b);
21636 __pyx_cython_runtime = PyImport_AddModule((
char *)
"cython_runtime");
if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
21637 Py_INCREF(__pyx_cython_runtime);
21638 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
21640 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21641 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) 21642 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21644 if (__pyx_module_is_main_PyClical) {
21645 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21647 #if PY_MAJOR_VERSION >= 3 21649 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
21650 if (!PyDict_GetItemString(modules,
"PyClical")) {
21651 if (unlikely(PyDict_SetItemString(modules,
"PyClical", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
21656 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21658 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21660 (void)__Pyx_modinit_global_init_code();
21661 (void)__Pyx_modinit_variable_export_code();
21662 (void)__Pyx_modinit_function_export_code();
21663 if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
21664 (void)__Pyx_modinit_type_import_code();
21665 (void)__Pyx_modinit_variable_import_code();
21666 (void)__Pyx_modinit_function_import_code();
21668 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) 21669 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21679 __pyx_t_1 = __Pyx_Import(__pyx_n_s_math, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
21680 __Pyx_GOTREF(__pyx_t_1);
21681 if (PyDict_SetItem(__pyx_d, __pyx_n_s_math, __pyx_t_1) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
21682 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21691 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numbers, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error)
21692 __Pyx_GOTREF(__pyx_t_1);
21693 if (PyDict_SetItem(__pyx_d, __pyx_n_s_numbers, __pyx_t_1) < 0) __PYX_ERR(0, 30, __pyx_L1_error)
21694 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21703 __pyx_t_1 = __Pyx_Import(__pyx_n_s_collections, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
21704 __Pyx_GOTREF(__pyx_t_1);
21705 if (PyDict_SetItem(__pyx_d, __pyx_n_s_collections, __pyx_t_1) < 0) __PYX_ERR(0, 31, __pyx_L1_error)
21706 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21715 __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(
glucat_package_version);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
21716 __Pyx_GOTREF(__pyx_t_1);
21717 __pyx_t_2 = PyTuple_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error)
21718 __Pyx_GOTREF(__pyx_t_2);
21719 __Pyx_GIVEREF(__pyx_t_1);
21720 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
21721 __Pyx_INCREF(__pyx_kp_u_utf_8);
21722 __Pyx_GIVEREF(__pyx_kp_u_utf_8);
21723 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_kp_u_utf_8);
21725 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_2, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
21726 __Pyx_GOTREF(__pyx_t_1);
21727 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21728 if (PyDict_SetItem(__pyx_d, __pyx_n_s_version, __pyx_t_1) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
21729 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21738 __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, 406, __pyx_L1_error)
21739 __Pyx_GOTREF(__pyx_t_1);
21740 if (PyDict_SetItem(__pyx_d, __pyx_n_s_index_set_hidden_doctests, __pyx_t_1) < 0) __PYX_ERR(0, 406, __pyx_L1_error)
21741 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21750 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8PyClical_9clifford_hidden_doctests, NULL, __pyx_n_s_PyClical);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1253, __pyx_L1_error)
21751 __Pyx_GOTREF(__pyx_t_1);
21752 if (PyDict_SetItem(__pyx_d, __pyx_n_s_clifford_hidden_doctests, __pyx_t_1) < 0) __PYX_ERR(0, 1253, __pyx_L1_error)
21753 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21763 __Pyx_GOTREF(__pyx_t_1);
21764 if (PyDict_SetItem(__pyx_d, __pyx_n_s_scalar_epsilon, __pyx_t_1) < 0) __PYX_ERR(0, 1905, __pyx_L1_error)
21765 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21774 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_tuple__15, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1907, __pyx_L1_error)
21775 __Pyx_GOTREF(__pyx_t_1);
21776 __pyx_t_2 = __pyx_f_8PyClical_atan(__pyx_t_1, 0, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1907, __pyx_L1_error)
21777 __Pyx_GOTREF(__pyx_t_2);
21778 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21779 __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_float_4_0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1907, __pyx_L1_error)
21780 __Pyx_GOTREF(__pyx_t_1);
21781 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21782 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pi, __pyx_t_1) < 0) __PYX_ERR(0, 1907, __pyx_L1_error)
21783 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21792 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_tuple__15, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1908, __pyx_L1_error)
21793 __Pyx_GOTREF(__pyx_t_1);
21794 __pyx_t_2 = __pyx_f_8PyClical_atan(__pyx_t_1, 0, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1908, __pyx_L1_error)
21795 __Pyx_GOTREF(__pyx_t_2);
21796 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21797 __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_float_8_0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1908, __pyx_L1_error)
21798 __Pyx_GOTREF(__pyx_t_1);
21799 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21800 if (PyDict_SetItem(__pyx_d, __pyx_n_s_tau, __pyx_t_1) < 0) __PYX_ERR(0, 1908, __pyx_L1_error)
21801 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21810 if (PyDict_SetItem(__pyx_d, __pyx_n_s_cl, ((PyObject *)__pyx_ptype_8PyClical_clifford)) < 0) __PYX_ERR(0, 1910, __pyx_L1_error)
21819 if (PyDict_SetItem(__pyx_d, __pyx_n_s_ist, ((PyObject *)__pyx_ptype_8PyClical_index_set)) < 0) __PYX_ERR(0, 1928, __pyx_L1_error)
21828 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8PyClical_89e, NULL, __pyx_n_s_PyClical);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1936, __pyx_L1_error)
21829 __Pyx_GOTREF(__pyx_t_1);
21830 if (PyDict_SetItem(__pyx_d, __pyx_n_s_e, __pyx_t_1) < 0) __PYX_ERR(0, 1936, __pyx_L1_error)
21831 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21840 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8PyClical_91istpq, NULL, __pyx_n_s_PyClical);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1949, __pyx_L1_error)
21841 __Pyx_GOTREF(__pyx_t_1);
21842 if (PyDict_SetItem(__pyx_d, __pyx_n_s_istpq, __pyx_t_1) < 0) __PYX_ERR(0, 1949, __pyx_L1_error)
21843 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21852 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_e);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1958, __pyx_L1_error)
21853 __Pyx_GOTREF(__pyx_t_1);
21854 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__20, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1958, __pyx_L1_error)
21855 __Pyx_GOTREF(__pyx_t_2);
21856 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21857 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_e);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1958, __pyx_L1_error)
21858 __Pyx_GOTREF(__pyx_t_1);
21859 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__21, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1958, __pyx_L1_error)
21860 __Pyx_GOTREF(__pyx_t_3);
21861 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21862 __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1958, __pyx_L1_error)
21863 __Pyx_GOTREF(__pyx_t_1);
21864 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21865 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21866 if (PyDict_SetItem(__pyx_d, __pyx_n_s_ninf3, __pyx_t_1) < 0) __PYX_ERR(0, 1958, __pyx_L1_error)
21867 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21876 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_e);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1959, __pyx_L1_error)
21877 __Pyx_GOTREF(__pyx_t_1);
21878 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__20, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1959, __pyx_L1_error)
21879 __Pyx_GOTREF(__pyx_t_3);
21880 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21881 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_e);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1959, __pyx_L1_error)
21882 __Pyx_GOTREF(__pyx_t_1);
21883 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__21, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1959, __pyx_L1_error)
21884 __Pyx_GOTREF(__pyx_t_2);
21885 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21886 __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1959, __pyx_L1_error)
21887 __Pyx_GOTREF(__pyx_t_1);
21888 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21889 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21890 if (PyDict_SetItem(__pyx_d, __pyx_n_s_nbar3, __pyx_t_1) < 0) __PYX_ERR(0, 1959, __pyx_L1_error)
21891 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21900 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8PyClical_93_test, NULL, __pyx_n_s_PyClical);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1962, __pyx_L1_error)
21901 __Pyx_GOTREF(__pyx_t_1);
21902 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1962, __pyx_L1_error)
21903 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21911 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_name);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1966, __pyx_L1_error)
21912 __Pyx_GOTREF(__pyx_t_1);
21913 __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_main, Py_EQ));
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1966, __pyx_L1_error)
21914 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21922 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_test);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1967, __pyx_L1_error)
21923 __Pyx_GOTREF(__pyx_t_1);
21924 __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1967, __pyx_L1_error)
21925 __Pyx_GOTREF(__pyx_t_2);
21926 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21927 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21942 __pyx_t_2 = __Pyx_PyDict_NewPresized(111);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
21943 __Pyx_GOTREF(__pyx_t_2);
21944 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_index_set_copy_line_65, __pyx_kp_u_Copy_this_index_set_object_s_in) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21945 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_index_set___setitem___line_179, __pyx_kp_u_Set_the_value_of_an_index_set_o) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21946 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_index_set___getitem___line_191, __pyx_kp_u_Get_the_value_of_an_index_set_o) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21947 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_index_set___iter___line_229, __pyx_kp_u_Iterate_over_the_indices_of_an) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21948 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_index_set___invert___line_240, __pyx_kp_u_Set_complement_not_print_index) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21949 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_index_set___xor___line_249, __pyx_kp_u_Symmetric_set_difference_exclus) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21950 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_index_set___ixor___line_260, __pyx_kp_u_Symmetric_set_difference_exclus_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21951 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_index_set___and___line_271, __pyx_kp_u_Set_intersection_and_print_inde) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21952 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_index_set___iand___line_282, __pyx_kp_u_Set_intersection_and_x_index_se) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21953 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_index_set___or___line_293, __pyx_kp_u_Set_union_or_print_index_set_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21954 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_index_set___ior___line_304, __pyx_kp_u_Set_union_or_x_index_set_1_x_in) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21955 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_index_set_count_line_315, __pyx_kp_u_Cardinality_Number_of_indices_i) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21956 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_index_set_count_neg_line_324, __pyx_kp_u_Number_of_negative_indices_incl) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21957 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_index_set_count_pos_line_333, __pyx_kp_u_Number_of_positive_indices_incl) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21958 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_index_set_min_line_342, __pyx_kp_u_Minimum_member_index_set_1_1_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21959 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_index_set_max_line_351, __pyx_kp_u_Maximum_member_index_set_1_1_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21960 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_index_set_sign_of_mult_line_366, __pyx_kp_u_Sign_of_geometric_product_of_tw) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21961 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)
21962 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_index_set___repr___line_384, __pyx_kp_u_The_official_string_representat) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21963 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_index_set___str___line_395, __pyx_kp_u_The_informal_string_representat) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21964 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)
21965 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_compare_line_492, __pyx_kp_u_lexicographic_compare_eg_3_4_5) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21966 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_min_neg_line_504, __pyx_kp_u_Minimum_negative_index_or_0_if) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21967 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_max_pos_line_513, __pyx_kp_u_Maximum_positive_index_or_0_if) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21968 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford_copy_line_556, __pyx_kp_u_Copy_this_clifford_object_x_cli) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21969 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford___iter___line_638, __pyx_kp_u_Not_applicable_for_a_in_cliffor) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21970 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford_reframe_line_649, __pyx_kp_u_Put_self_into_a_larger_frame_co) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21971 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford___getitem___line_707, __pyx_kp_u_Subscripting_map_from_index_set) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21972 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford___neg___line_722, __pyx_kp_u_Unary_print_clifford_1_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21973 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford___pos___line_731, __pyx_kp_u_Unary_print_clifford_1_1_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21974 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford___add___line_740, __pyx_kp_u_Geometric_sum_print_clifford_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21975 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford___iadd___line_751, __pyx_kp_u_Geometric_sum_x_clifford_1_x_cl) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21976 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford___sub___line_760, __pyx_kp_u_Geometric_difference_print_clif) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21977 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford___isub___line_771, __pyx_kp_u_Geometric_difference_x_clifford) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21978 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford___mul___line_780, __pyx_kp_u_Geometric_product_print_cliffor) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21979 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford___imul___line_793, __pyx_kp_u_Geometric_product_x_clifford_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21980 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford___mod___line_806, __pyx_kp_u_Contraction_print_clifford_1_cl) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21981 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford___imod___line_821, __pyx_kp_u_Contraction_x_clifford_1_x_clif) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21982 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford___and___line_836, __pyx_kp_u_Inner_product_print_clifford_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21983 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford___iand___line_851, __pyx_kp_u_Inner_product_x_clifford_1_x_cl) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21984 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford___xor___line_866, __pyx_kp_u_Outer_product_print_clifford_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21985 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford___ixor___line_881, __pyx_kp_u_Outer_product_x_clifford_1_x_cl) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21986 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford___truediv___line_896, __pyx_kp_u_Geometric_quotient_print_cliffo) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21987 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford___idiv___line_911, __pyx_kp_u_Geometric_quotient_x_clifford_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21988 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford_inv_line_926, __pyx_kp_u_Geometric_multiplicative_invers) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21989 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford___or___line_939, __pyx_kp_u_Transform_left_hand_side_using) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21990 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford___ior___line_950, __pyx_kp_u_Transform_left_hand_side_using_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21991 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford___pow___line_961, __pyx_kp_u_Power_self_to_the_m_x_clifford) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21992 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford_pow_line_980, __pyx_kp_u_Power_self_to_the_m_x_clifford_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21993 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford_outer_pow_line_1004, __pyx_kp_u_Outer_product_power_x_clifford) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21994 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford___call___line_1020, __pyx_kp_u_Pure_grade_vector_part_print_cl) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21995 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford_scalar_line_1039, __pyx_kp_u_Scalar_part_clifford_1_1_1_2_sc) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21996 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford_pure_line_1050, __pyx_kp_u_Pure_part_print_clifford_1_1_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21997 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford_even_line_1061, __pyx_kp_u_Even_part_of_multivector_sum_of) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21998 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford_odd_line_1070, __pyx_kp_u_Odd_part_of_multivector_sum_of) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21999 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford_vector_part_line_1079, __pyx_kp_u_Vector_part_of_multivector_as_a) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22000 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford_involute_line_1107, __pyx_kp_u_Main_involution_each_i_is_repla) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22001 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford_reverse_line_1123, __pyx_kp_u_Reversion_eg_clifford_1_cliffor) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22002 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford_conj_line_1138, __pyx_kp_u_Conjugation_reverse_o_involute) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22003 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford_quad_line_1153, __pyx_kp_u_Quadratic_form_rev_x_x_0_print) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22004 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford_norm_line_1164, __pyx_kp_u_Norm_sum_of_squares_of_coordina) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22005 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford_abs_line_1175, __pyx_kp_u_Absolute_value_square_root_of_n) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22006 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford_max_abs_line_1184, __pyx_kp_u_Maximum_of_absolute_values_of_c) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22007 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford_truncated_line_1195, __pyx_kp_u_Remove_all_terms_of_self_with_r) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22008 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford_isinf_line_1206, __pyx_kp_u_Check_if_a_multivector_contains) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22009 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford_isnan_line_1215, __pyx_kp_u_Check_if_a_multivector_contains_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22010 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford_frame_line_1224, __pyx_kp_u_Subalgebra_generated_by_all_gen) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22011 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford___repr___line_1235, __pyx_kp_u_The_official_string_representat_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22012 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford___str___line_1244, __pyx_kp_u_The_informal_string_representat_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22013 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)
22014 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_error_squared_tol_line_1337, __pyx_kp_u_Quadratic_norm_error_tolerance) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22015 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_error_squared_line_1346, __pyx_kp_u_Relative_or_absolute_error_usin) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22016 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_approx_equal_line_1359, __pyx_kp_u_Test_for_approximate_equality_o) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22017 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_inv_line_1378, __pyx_kp_u_Geometric_multiplicative_invers_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22018 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_scalar_line_1393, __pyx_kp_u_Scalar_part_scalar_clifford_1_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22019 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_real_line_1404, __pyx_kp_u_Real_part_synonym_for_scalar_pa) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22020 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_imag_line_1415, __pyx_kp_u_Imaginary_part_deprecated_alway) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22021 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_pure_line_1426, __pyx_kp_u_Pure_part_print_pure_clifford_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22022 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_even_line_1437, __pyx_kp_u_Even_part_of_multivector_sum_of_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22023 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_odd_line_1446, __pyx_kp_u_Odd_part_of_multivector_sum_of_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22024 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_involute_line_1455, __pyx_kp_u_Main_involution_each_i_is_repla_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22025 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_reverse_line_1470, __pyx_kp_u_Reversion_eg_1_2_2_1_print_reve) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22026 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_conj_line_1485, __pyx_kp_u_Conjugation_reverse_o_involute_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22027 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_quad_line_1500, __pyx_kp_u_Quadratic_form_rev_x_x_0_print_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22028 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_norm_line_1511, __pyx_kp_u_norm_sum_of_squares_of_coordina) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22029 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_abs_line_1522, __pyx_kp_u_Absolute_value_of_multivector_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22030 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_max_abs_line_1531, __pyx_kp_u_Maximum_absolute_value_of_coord) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22031 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_pow_line_1543, __pyx_kp_u_Integer_power_of_multivector_ob) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22032 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_outer_pow_line_1567, __pyx_kp_u_Outer_product_power_of_multivec) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22033 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_complexifier_line_1576, __pyx_kp_u_Square_root_of_1_which_commutes) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22034 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_sqrt_line_1591, __pyx_kp_u_Square_root_of_multivector_with) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22035 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_exp_line_1614, __pyx_kp_u_Exponential_of_multivector_x_cl) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22036 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_log_line_1628, __pyx_kp_u_Natural_logarithm_of_multivecto) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22037 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_cos_line_1651, __pyx_kp_u_Cosine_of_multivector_with_opti) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22038 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_acos_line_1668, __pyx_kp_u_Inverse_cosine_of_multivector_w) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22039 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_cosh_line_1689, __pyx_kp_u_Hyperbolic_cosine_of_multivecto) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22040 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_acosh_line_1705, __pyx_kp_u_Inverse_hyperbolic_cosine_of_mu) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22041 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_sin_line_1728, __pyx_kp_u_Sine_of_multivector_with_option) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22042 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_asin_line_1747, __pyx_kp_u_Inverse_sine_of_multivector_wit) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22043 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_sinh_line_1768, __pyx_kp_u_Hyperbolic_sine_of_multivector) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22044 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_asinh_line_1782, __pyx_kp_u_Inverse_hyperbolic_sine_of_mult) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22045 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_tan_line_1801, __pyx_kp_u_Tangent_of_multivector_with_opt) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22046 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_atan_line_1818, __pyx_kp_u_Inverse_tangent_of_multivector) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22047 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_tanh_line_1835, __pyx_kp_u_Hyperbolic_tangent_of_multivect) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22048 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_atanh_line_1847, __pyx_kp_u_Inverse_hyperbolic_tangent_of_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22049 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_random_clifford_line_1864, __pyx_kp_u_Random_multivector_within_a_fra) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22050 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_cga3_line_1873, __pyx_kp_u_Convert_Euclidean_3D_multivecto) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22051 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_cga3std_line_1882, __pyx_kp_u_Convert_CGA3_null_vector_to_sta) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22052 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_agc3_line_1893, __pyx_kp_u_Convert_CGA3_null_vector_to_Euc) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22053 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_e_line_1936, __pyx_kp_u_Abbreviation_for_clifford_index) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22054 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_istpq_line_1949, __pyx_kp_u_Abbreviation_for_index_set_q_p) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22055 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_2, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22056 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22070 __Pyx_XDECREF(__pyx_t_1);
22071 __Pyx_XDECREF(__pyx_t_2);
22072 __Pyx_XDECREF(__pyx_t_3);
22075 __Pyx_AddTraceback(
"init PyClical", __pyx_clineno, __pyx_lineno, __pyx_filename);
22078 }
else if (!PyErr_Occurred()) {
22079 PyErr_SetString(PyExc_ImportError,
"init PyClical");
22082 __Pyx_RefNannyFinishContext();
22083 #if CYTHON_PEP489_MULTI_PHASE_INIT 22084 return (__pyx_m != NULL) ? 0 : -1;
22085 #elif PY_MAJOR_VERSION >= 3 22094 #if CYTHON_REFNANNY 22095 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
22096 PyObject *m = NULL, *p = NULL;
22098 m = PyImport_ImportModule(modname);
22100 p = PyObject_GetAttrString(m,
"RefNannyAPI");
22102 r = PyLong_AsVoidPtr(p);
22106 return (__Pyx_RefNannyAPIStruct *)r;
22111 #if CYTHON_USE_TYPE_SLOTS 22112 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject*
obj, PyObject* attr_name) {
22113 PyTypeObject* tp = Py_TYPE(
obj);
22114 if (likely(tp->tp_getattro))
22115 return tp->tp_getattro(
obj, attr_name);
22116 #if PY_MAJOR_VERSION < 3 22117 if (likely(tp->tp_getattr))
22118 return tp->tp_getattr(
obj, PyString_AS_STRING(attr_name));
22120 return PyObject_GetAttr(
obj, attr_name);
22125 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
22126 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
22127 if (unlikely(!result)) {
22128 PyErr_Format(PyExc_NameError,
22129 #
if PY_MAJOR_VERSION >= 3
22130 "name '%U' is not defined", name);
22132 "name '%.200s' is not defined", PyString_AS_STRING(name));
22139 #if CYTHON_FAST_PYCCALL 22140 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
22141 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
22142 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
22143 PyObject *
self = PyCFunction_GET_SELF(func);
22144 int flags = PyCFunction_GET_FLAGS(func);
22145 assert(PyCFunction_Check(func));
22146 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
22147 assert(nargs >= 0);
22148 assert(nargs == 0 || args != NULL);
22152 assert(!PyErr_Occurred());
22153 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
22154 return (*((__Pyx_PyCFunctionFastWithKeywords)(
void*)meth)) (
self, args, nargs, NULL);
22156 return (*((__Pyx_PyCFunctionFast)(
void*)meth)) (
self, args, nargs);
22162 #if CYTHON_FAST_PYCALL 22163 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
22164 PyObject *globals) {
22166 PyThreadState *tstate = __Pyx_PyThreadState_Current;
22167 PyObject **fastlocals;
22170 assert(globals != NULL);
22175 assert(tstate != NULL);
22176 f = PyFrame_New(tstate, co, globals, NULL);
22180 fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
22181 for (
i = 0;
i < na;
i++) {
22183 fastlocals[
i] = *args++;
22185 result = PyEval_EvalFrameEx(f,0);
22186 ++tstate->recursion_depth;
22188 --tstate->recursion_depth;
22191 #if 1 || PY_VERSION_HEX < 0x030600B1 22192 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
22193 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
22194 PyObject *globals = PyFunction_GET_GLOBALS(func);
22195 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
22197 #if PY_MAJOR_VERSION >= 3 22200 PyObject *kwtuple, **k;
22205 assert(kwargs == NULL || PyDict_Check(kwargs));
22206 nk = kwargs ? PyDict_Size(kwargs) : 0;
22207 if (Py_EnterRecursiveCall((
char*)
" while calling a Python object")) {
22211 #
if PY_MAJOR_VERSION >= 3
22212 co->co_kwonlyargcount == 0 &&
22214 likely(kwargs == NULL || nk == 0) &&
22215 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
22216 if (argdefs == NULL && co->co_argcount == nargs) {
22217 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
22220 else if (nargs == 0 && argdefs != NULL
22221 && co->co_argcount == Py_SIZE(argdefs)) {
22224 args = &PyTuple_GET_ITEM(argdefs, 0);
22225 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
22229 if (kwargs != NULL) {
22231 kwtuple = PyTuple_New(2 * nk);
22232 if (kwtuple == NULL) {
22236 k = &PyTuple_GET_ITEM(kwtuple, 0);
22238 while (PyDict_Next(kwargs, &pos, &k[
i], &k[
i+1])) {
22249 closure = PyFunction_GET_CLOSURE(func);
22250 #if PY_MAJOR_VERSION >= 3 22251 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
22253 if (argdefs != NULL) {
22254 d = &PyTuple_GET_ITEM(argdefs, 0);
22255 nd = Py_SIZE(argdefs);
22261 #if PY_MAJOR_VERSION >= 3 22262 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
22265 d, (
int)nd, kwdefs, closure);
22267 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
22270 d, (
int)nd, closure);
22272 Py_XDECREF(kwtuple);
22274 Py_LeaveRecursiveCall();
22281 #if CYTHON_COMPILING_IN_CPYTHON 22282 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
22284 ternaryfunc call = Py_TYPE(func)->tp_call;
22285 if (unlikely(!call))
22286 return PyObject_Call(func, arg, kw);
22287 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
22289 result = (*call)(func, arg, kw);
22290 Py_LeaveRecursiveCall();
22291 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
22294 "NULL result without error in PyObject_Call");
22301 #if CYTHON_COMPILING_IN_CPYTHON 22302 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
22303 PyObject *
self, *result;
22305 cfunc = PyCFunction_GET_FUNCTION(func);
22306 self = PyCFunction_GET_SELF(func);
22307 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
22309 result = cfunc(
self, arg);
22310 Py_LeaveRecursiveCall();
22311 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
22314 "NULL result without error in PyObject_Call");
22321 #if CYTHON_COMPILING_IN_CPYTHON 22322 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
22324 PyObject *args = PyTuple_New(1);
22325 if (unlikely(!args))
return NULL;
22327 PyTuple_SET_ITEM(args, 0, arg);
22328 result = __Pyx_PyObject_Call(func, args, NULL);
22332 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
22333 #if CYTHON_FAST_PYCALL 22334 if (PyFunction_Check(func)) {
22335 return __Pyx_PyFunction_FastCall(func, &arg, 1);
22338 if (likely(PyCFunction_Check(func))) {
22339 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
22340 return __Pyx_PyObject_CallMethO(func, arg);
22341 #if CYTHON_FAST_PYCCALL 22342 }
else if (__Pyx_PyFastCFunction_Check(func)) {
22343 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
22347 return __Pyx__PyObject_CallOneArg(func, arg);
22350 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
22352 PyObject *args = PyTuple_Pack(1, arg);
22353 if (unlikely(!args))
return NULL;
22354 result = __Pyx_PyObject_Call(func, args, NULL);
22361 #if CYTHON_FAST_THREAD_STATE 22362 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
22363 PyObject *tmp_type, *tmp_value, *tmp_tb;
22364 tmp_type = tstate->curexc_type;
22365 tmp_value = tstate->curexc_value;
22366 tmp_tb = tstate->curexc_traceback;
22367 tstate->curexc_type = type;
22368 tstate->curexc_value = value;
22369 tstate->curexc_traceback = tb;
22370 Py_XDECREF(tmp_type);
22371 Py_XDECREF(tmp_value);
22372 Py_XDECREF(tmp_tb);
22374 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
22375 *type = tstate->curexc_type;
22376 *value = tstate->curexc_value;
22377 *tb = tstate->curexc_traceback;
22378 tstate->curexc_type = 0;
22379 tstate->curexc_value = 0;
22380 tstate->curexc_traceback = 0;
22385 static void __Pyx_WriteUnraisable(
const char *name, CYTHON_UNUSED
int clineno,
22386 CYTHON_UNUSED
int lineno, CYTHON_UNUSED
const char *filename,
22387 int full_traceback, CYTHON_UNUSED
int nogil) {
22388 PyObject *old_exc, *old_val, *old_tb;
22390 __Pyx_PyThreadState_declare
22392 PyGILState_STATE state;
22394 state = PyGILState_Ensure();
22396 else state = (PyGILState_STATE)-1;
22399 __Pyx_PyThreadState_assign
22400 __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
22401 if (full_traceback) {
22402 Py_XINCREF(old_exc);
22403 Py_XINCREF(old_val);
22404 Py_XINCREF(old_tb);
22405 __Pyx_ErrRestore(old_exc, old_val, old_tb);
22408 #if PY_MAJOR_VERSION < 3 22409 ctx = PyString_FromString(name);
22411 ctx = PyUnicode_FromString(name);
22413 __Pyx_ErrRestore(old_exc, old_val, old_tb);
22415 PyErr_WriteUnraisable(Py_None);
22417 PyErr_WriteUnraisable(ctx);
22422 PyGILState_Release(state);
22427 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS 22428 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *
obj) {
22429 PyObject *dict = Py_TYPE(
obj)->tp_dict;
22430 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
22432 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *
obj) {
22433 PyObject **dictptr = NULL;
22434 Py_ssize_t offset = Py_TYPE(
obj)->tp_dictoffset;
22436 #if CYTHON_COMPILING_IN_CPYTHON 22437 dictptr = (likely(offset > 0)) ? (PyObject **) ((
char *)
obj + offset) : _PyObject_GetDictPtr(
obj);
22439 dictptr = _PyObject_GetDictPtr(
obj);
22442 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
22444 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject*
obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
22445 PyObject *dict = Py_TYPE(
obj)->tp_dict;
22446 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
22448 return obj_dict_version == __Pyx_get_object_dict_version(
obj);
22453 #if CYTHON_COMPILING_IN_CPYTHON 22454 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
22455 #if CYTHON_FAST_PYCALL 22456 if (PyFunction_Check(func)) {
22457 return __Pyx_PyFunction_FastCall(func, NULL, 0);
22460 #ifdef __Pyx_CyFunction_USED 22461 if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
22463 if (likely(PyCFunction_Check(func)))
22466 if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
22467 return __Pyx_PyObject_CallMethO(func, NULL);
22470 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
22475 static void __Pyx_RaiseDoubleKeywordsError(
22476 const char* func_name,
22479 PyErr_Format(PyExc_TypeError,
22480 #
if PY_MAJOR_VERSION >= 3
22481 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
22483 "%s() got multiple values for keyword argument '%s'", func_name,
22484 PyString_AsString(kw_name));
22489 static int __Pyx_ParseOptionalKeywords(
22491 PyObject **argnames[],
22493 PyObject *values[],
22494 Py_ssize_t num_pos_args,
22495 const char* function_name)
22497 PyObject *key = 0, *value = 0;
22498 Py_ssize_t pos = 0;
22500 PyObject*** first_kw_arg = argnames + num_pos_args;
22501 while (PyDict_Next(kwds, &pos, &key, &value)) {
22502 name = first_kw_arg;
22503 while (*name && (**name != key)) name++;
22505 values[name-argnames] = value;
22508 name = first_kw_arg;
22509 #if PY_MAJOR_VERSION < 3 22510 if (likely(PyString_Check(key))) {
22512 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
22513 && _PyString_Eq(**name, key)) {
22514 values[name-argnames] = value;
22519 if (*name)
continue;
22521 PyObject*** argname = argnames;
22522 while (argname != first_kw_arg) {
22523 if ((**argname == key) || (
22524 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
22525 && _PyString_Eq(**argname, key))) {
22526 goto arg_passed_twice;
22533 if (likely(PyUnicode_Check(key))) {
22535 int cmp = (**name == key) ? 0 :
22536 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
22537 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
22539 PyUnicode_Compare(**name, key);
22540 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
22542 values[name-argnames] = value;
22547 if (*name)
continue;
22549 PyObject*** argname = argnames;
22550 while (argname != first_kw_arg) {
22551 int cmp = (**argname == key) ? 0 :
22552 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
22553 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
22555 PyUnicode_Compare(**argname, key);
22556 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
22557 if (cmp == 0)
goto arg_passed_twice;
22562 goto invalid_keyword_type;
22564 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
22566 goto invalid_keyword;
22571 __Pyx_RaiseDoubleKeywordsError(function_name, key);
22573 invalid_keyword_type:
22574 PyErr_Format(PyExc_TypeError,
22575 "%.200s() keywords must be strings", function_name);
22578 PyErr_Format(PyExc_TypeError,
22579 #
if PY_MAJOR_VERSION < 3
22580 "%.200s() got an unexpected keyword argument '%.200s'",
22581 function_name, PyString_AsString(key));
22583 "%s() got an unexpected keyword argument '%U'",
22584 function_name, key);
22591 static void __Pyx_RaiseArgtupleInvalid(
22592 const char* func_name,
22594 Py_ssize_t num_min,
22595 Py_ssize_t num_max,
22596 Py_ssize_t num_found)
22598 Py_ssize_t num_expected;
22599 const char *more_or_less;
22600 if (num_found < num_min) {
22601 num_expected = num_min;
22602 more_or_less =
"at least";
22604 num_expected = num_max;
22605 more_or_less =
"at most";
22608 more_or_less =
"exactly";
22610 PyErr_Format(PyExc_TypeError,
22611 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
22612 func_name, more_or_less, num_expected,
22613 (num_expected == 1) ?
"" :
"s", num_found);
22617 #if CYTHON_USE_DICT_VERSIONS 22618 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
22620 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
22624 #if !CYTHON_AVOID_BORROWED_REFS 22625 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 22626 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
22627 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
22628 if (likely(result)) {
22629 return __Pyx_NewRef(result);
22630 }
else if (unlikely(PyErr_Occurred())) {
22634 result = PyDict_GetItem(__pyx_d, name);
22635 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
22636 if (likely(result)) {
22637 return __Pyx_NewRef(result);
22641 result = PyObject_GetItem(__pyx_d, name);
22642 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
22643 if (likely(result)) {
22644 return __Pyx_NewRef(result);
22648 return __Pyx_GetBuiltinName(name);
22652 #if CYTHON_USE_EXC_INFO_STACK 22653 static _PyErr_StackItem *
22654 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
22656 _PyErr_StackItem *exc_info = tstate->exc_info;
22657 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
22658 exc_info->previous_item != NULL)
22660 exc_info = exc_info->previous_item;
22667 #if CYTHON_FAST_THREAD_STATE 22668 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
22669 #if CYTHON_USE_EXC_INFO_STACK 22670 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
22671 *type = exc_info->exc_type;
22672 *value = exc_info->exc_value;
22673 *tb = exc_info->exc_traceback;
22675 *type = tstate->exc_type;
22676 *value = tstate->exc_value;
22677 *tb = tstate->exc_traceback;
22680 Py_XINCREF(*value);
22683 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
22684 PyObject *tmp_type, *tmp_value, *tmp_tb;
22685 #if CYTHON_USE_EXC_INFO_STACK 22686 _PyErr_StackItem *exc_info = tstate->exc_info;
22687 tmp_type = exc_info->exc_type;
22688 tmp_value = exc_info->exc_value;
22689 tmp_tb = exc_info->exc_traceback;
22690 exc_info->exc_type = type;
22691 exc_info->exc_value = value;
22692 exc_info->exc_traceback = tb;
22694 tmp_type = tstate->exc_type;
22695 tmp_value = tstate->exc_value;
22696 tmp_tb = tstate->exc_traceback;
22697 tstate->exc_type = type;
22698 tstate->exc_value = value;
22699 tstate->exc_traceback = tb;
22701 Py_XDECREF(tmp_type);
22702 Py_XDECREF(tmp_value);
22703 Py_XDECREF(tmp_tb);
22708 #if CYTHON_FAST_THREAD_STATE 22709 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
22711 n = PyTuple_GET_SIZE(tuple);
22712 #if PY_MAJOR_VERSION >= 3 22713 for (
i=0;
i<n;
i++) {
22714 if (exc_type == PyTuple_GET_ITEM(tuple,
i))
return 1;
22717 for (
i=0;
i<n;
i++) {
22718 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple,
i)))
return 1;
22722 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
22723 PyObject *exc_type = tstate->curexc_type;
22724 if (exc_type == err)
return 1;
22725 if (unlikely(!exc_type))
return 0;
22726 if (unlikely(PyTuple_Check(err)))
22727 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
22728 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
22733 #if CYTHON_FAST_THREAD_STATE 22734 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
22736 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
22739 PyObject *local_type, *local_value, *local_tb;
22740 #if CYTHON_FAST_THREAD_STATE 22741 PyObject *tmp_type, *tmp_value, *tmp_tb;
22742 local_type = tstate->curexc_type;
22743 local_value = tstate->curexc_value;
22744 local_tb = tstate->curexc_traceback;
22745 tstate->curexc_type = 0;
22746 tstate->curexc_value = 0;
22747 tstate->curexc_traceback = 0;
22749 PyErr_Fetch(&local_type, &local_value, &local_tb);
22751 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
22752 #if CYTHON_FAST_THREAD_STATE 22753 if (unlikely(tstate->curexc_type))
22755 if (unlikely(PyErr_Occurred()))
22758 #if PY_MAJOR_VERSION >= 3 22760 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
22764 Py_XINCREF(local_tb);
22765 Py_XINCREF(local_type);
22766 Py_XINCREF(local_value);
22767 *type = local_type;
22768 *value = local_value;
22770 #if CYTHON_FAST_THREAD_STATE 22771 #if CYTHON_USE_EXC_INFO_STACK 22773 _PyErr_StackItem *exc_info = tstate->exc_info;
22774 tmp_type = exc_info->exc_type;
22775 tmp_value = exc_info->exc_value;
22776 tmp_tb = exc_info->exc_traceback;
22777 exc_info->exc_type = local_type;
22778 exc_info->exc_value = local_value;
22779 exc_info->exc_traceback = local_tb;
22782 tmp_type = tstate->exc_type;
22783 tmp_value = tstate->exc_value;
22784 tmp_tb = tstate->exc_traceback;
22785 tstate->exc_type = local_type;
22786 tstate->exc_value = local_value;
22787 tstate->exc_traceback = local_tb;
22789 Py_XDECREF(tmp_type);
22790 Py_XDECREF(tmp_value);
22791 Py_XDECREF(tmp_tb);
22793 PyErr_SetExcInfo(local_type, local_value, local_tb);
22800 Py_XDECREF(local_type);
22801 Py_XDECREF(local_value);
22802 Py_XDECREF(local_tb);
22807 #if PY_MAJOR_VERSION < 3 22808 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
22809 CYTHON_UNUSED PyObject *cause) {
22810 __Pyx_PyThreadState_declare
22812 if (!value || value == Py_None)
22816 if (!tb || tb == Py_None)
22820 if (!PyTraceBack_Check(tb)) {
22821 PyErr_SetString(PyExc_TypeError,
22822 "raise: arg 3 must be a traceback or None");
22826 if (PyType_Check(type)) {
22827 #if CYTHON_COMPILING_IN_PYPY 22829 Py_INCREF(Py_None);
22833 PyErr_NormalizeException(&type, &value, &tb);
22836 PyErr_SetString(PyExc_TypeError,
22837 "instance exception may not have a separate value");
22841 type = (PyObject*) Py_TYPE(type);
22843 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
22844 PyErr_SetString(PyExc_TypeError,
22845 "raise: exception class must be a subclass of BaseException");
22849 __Pyx_PyThreadState_assign
22850 __Pyx_ErrRestore(type, value, tb);
22859 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
22860 PyObject* owned_instance = NULL;
22861 if (tb == Py_None) {
22863 }
else if (tb && !PyTraceBack_Check(tb)) {
22864 PyErr_SetString(PyExc_TypeError,
22865 "raise: arg 3 must be a traceback or None");
22868 if (value == Py_None)
22870 if (PyExceptionInstance_Check(type)) {
22872 PyErr_SetString(PyExc_TypeError,
22873 "instance exception may not have a separate value");
22877 type = (PyObject*) Py_TYPE(value);
22878 }
else if (PyExceptionClass_Check(type)) {
22879 PyObject *instance_class = NULL;
22880 if (value && PyExceptionInstance_Check(value)) {
22881 instance_class = (PyObject*) Py_TYPE(value);
22882 if (instance_class != type) {
22883 int is_subclass = PyObject_IsSubclass(instance_class, type);
22884 if (!is_subclass) {
22885 instance_class = NULL;
22886 }
else if (unlikely(is_subclass == -1)) {
22889 type = instance_class;
22893 if (!instance_class) {
22896 args = PyTuple_New(0);
22897 else if (PyTuple_Check(value)) {
22901 args = PyTuple_Pack(1, value);
22904 owned_instance = PyObject_Call(type, args, NULL);
22906 if (!owned_instance)
22908 value = owned_instance;
22909 if (!PyExceptionInstance_Check(value)) {
22910 PyErr_Format(PyExc_TypeError,
22911 "calling %R should have returned an instance of " 22912 "BaseException, not %R",
22913 type, Py_TYPE(value));
22918 PyErr_SetString(PyExc_TypeError,
22919 "raise: exception class must be a subclass of BaseException");
22923 PyObject *fixed_cause;
22924 if (cause == Py_None) {
22925 fixed_cause = NULL;
22926 }
else if (PyExceptionClass_Check(cause)) {
22927 fixed_cause = PyObject_CallObject(cause, NULL);
22928 if (fixed_cause == NULL)
22930 }
else if (PyExceptionInstance_Check(cause)) {
22931 fixed_cause = cause;
22932 Py_INCREF(fixed_cause);
22934 PyErr_SetString(PyExc_TypeError,
22935 "exception causes must derive from " 22939 PyException_SetCause(value, fixed_cause);
22941 PyErr_SetObject(type, value);
22943 #if CYTHON_COMPILING_IN_PYPY 22944 PyObject *tmp_type, *tmp_value, *tmp_tb;
22945 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
22947 PyErr_Restore(tmp_type, tmp_value, tb);
22948 Py_XDECREF(tmp_tb);
22950 PyThreadState *tstate = __Pyx_PyThreadState_Current;
22951 PyObject* tmp_tb = tstate->curexc_traceback;
22952 if (tb != tmp_tb) {
22954 tstate->curexc_traceback = tb;
22955 Py_XDECREF(tmp_tb);
22960 Py_XDECREF(owned_instance);
22966 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2) {
22967 PyObject *args, *result = NULL;
22968 #if CYTHON_FAST_PYCALL 22969 if (PyFunction_Check(
function)) {
22970 PyObject *args[2] = {arg1, arg2};
22971 return __Pyx_PyFunction_FastCall(
function, args, 2);
22974 #if CYTHON_FAST_PYCCALL 22975 if (__Pyx_PyFastCFunction_Check(
function)) {
22976 PyObject *args[2] = {arg1, arg2};
22977 return __Pyx_PyCFunction_FastCall(
function, args, 2);
22980 args = PyTuple_New(2);
22981 if (unlikely(!args))
goto done;
22983 PyTuple_SET_ITEM(args, 0, arg1);
22985 PyTuple_SET_ITEM(args, 1, arg2);
22986 Py_INCREF(
function);
22987 result = __Pyx_PyObject_Call(
function, args, NULL);
22989 Py_DECREF(
function);
22995 #if !CYTHON_COMPILING_IN_PYPY 22996 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
long intval,
int inplace,
int zerodivision_check) {
22998 (void)zerodivision_check;
22999 #if PY_MAJOR_VERSION < 3 23000 if (likely(PyInt_CheckExact(op1))) {
23001 const long b = intval;
23003 long a = PyInt_AS_LONG(op1);
23004 x = (long)((
unsigned long)a + b);
23005 if (likely((x^a) >= 0 || (x^b) >= 0))
23006 return PyInt_FromLong(x);
23007 return PyLong_Type.tp_as_number->nb_add(op1, op2);
23010 #if CYTHON_USE_PYLONG_INTERNALS 23011 if (likely(PyLong_CheckExact(op1))) {
23012 const long b = intval;
23014 #ifdef HAVE_LONG_LONG 23015 const PY_LONG_LONG llb = intval;
23016 PY_LONG_LONG lla, llx;
23018 const digit* digits = ((PyLongObject*)op1)->ob_digit;
23019 const Py_ssize_t size = Py_SIZE(op1);
23020 if (likely(__Pyx_sst_abs(size) <= 1)) {
23021 a = likely(size) ? digits[0] : 0;
23022 if (size == -1) a = -a;
23026 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
23027 a = -(long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
23029 #ifdef HAVE_LONG_LONG 23030 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
23031 lla = -(PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
23035 CYTHON_FALLTHROUGH;
23037 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
23038 a = (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
23040 #ifdef HAVE_LONG_LONG 23041 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
23042 lla = (PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
23046 CYTHON_FALLTHROUGH;
23048 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
23049 a = -(long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
23051 #ifdef HAVE_LONG_LONG 23052 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
23053 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]));
23057 CYTHON_FALLTHROUGH;
23059 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
23060 a = (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
23062 #ifdef HAVE_LONG_LONG 23063 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
23064 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]));
23068 CYTHON_FALLTHROUGH;
23070 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
23071 a = -(long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
23073 #ifdef HAVE_LONG_LONG 23074 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
23075 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]));
23079 CYTHON_FALLTHROUGH;
23081 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
23082 a = (long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
23084 #ifdef HAVE_LONG_LONG 23085 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
23086 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]));
23090 CYTHON_FALLTHROUGH;
23091 default:
return PyLong_Type.tp_as_number->nb_add(op1, op2);
23095 return PyLong_FromLong(x);
23096 #ifdef HAVE_LONG_LONG 23099 return PyLong_FromLongLong(llx);
23105 if (PyFloat_CheckExact(op1)) {
23106 const long b = intval;
23107 double a = PyFloat_AS_DOUBLE(op1);
23109 PyFPE_START_PROTECT(
"add",
return NULL)
23110 result = ((double)a) + (double)b;
23111 PyFPE_END_PROTECT(result)
23114 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
23119 static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
23120 const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop,
23121 const char* encoding,
const char* errors,
23122 PyObject* (*decode_func)(
const char *s, Py_ssize_t size,
const char *errors)) {
23123 if (unlikely((start < 0) | (stop < 0))) {
23134 if (unlikely(stop <= start))
23135 return __Pyx_NewRef(__pyx_empty_unicode);
23136 length = stop - start;
23139 return decode_func(cstring, length, errors);
23141 return PyUnicode_Decode(cstring, length, encoding, errors);
23146 #if CYTHON_FAST_THREAD_STATE 23147 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
23148 PyObject *tmp_type, *tmp_value, *tmp_tb;
23149 #if CYTHON_USE_EXC_INFO_STACK 23150 _PyErr_StackItem *exc_info = tstate->exc_info;
23151 tmp_type = exc_info->exc_type;
23152 tmp_value = exc_info->exc_value;
23153 tmp_tb = exc_info->exc_traceback;
23154 exc_info->exc_type = *type;
23155 exc_info->exc_value = *value;
23156 exc_info->exc_traceback = *tb;
23158 tmp_type = tstate->exc_type;
23159 tmp_value = tstate->exc_value;
23160 tmp_tb = tstate->exc_traceback;
23161 tstate->exc_type = *type;
23162 tstate->exc_value = *value;
23163 tstate->exc_traceback = *tb;
23166 *value = tmp_value;
23170 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
23171 PyObject *tmp_type, *tmp_value, *tmp_tb;
23172 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
23173 PyErr_SetExcInfo(*type, *value, *tb);
23175 *value = tmp_value;
23181 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
23184 r = PyObject_SetItem(o, j, v);
23188 static CYTHON_INLINE
int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t
i, PyObject *v,
int is_list,
23189 CYTHON_NCP_UNUSED
int wraparound, CYTHON_NCP_UNUSED
int boundscheck) {
23190 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS 23191 if (is_list || PyList_CheckExact(o)) {
23192 Py_ssize_t n = (!wraparound) ?
i : ((likely(
i >= 0)) ?
i :
i + PyList_GET_SIZE(o));
23193 if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) {
23194 PyObject* old = PyList_GET_ITEM(o, n);
23196 PyList_SET_ITEM(o, n, v);
23201 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
23202 if (likely(m && m->sq_ass_item)) {
23203 if (wraparound && unlikely(
i < 0) && likely(m->sq_length)) {
23204 Py_ssize_t l = m->sq_length(o);
23205 if (likely(l >= 0)) {
23208 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
23213 return m->sq_ass_item(o,
i, v);
23217 #if CYTHON_COMPILING_IN_PYPY 23218 if (is_list || (PySequence_Check(o) && !PyDict_Check(o)))
23220 if (is_list || PySequence_Check(o))
23223 return PySequence_SetItem(o,
i, v);
23226 return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(
i), v);
23230 static int __Pyx__ArgTypeTest(PyObject *
obj, PyTypeObject *type,
const char *name,
int exact)
23232 if (unlikely(!type)) {
23233 PyErr_SetString(PyExc_SystemError,
"Missing type object");
23237 #if PY_MAJOR_VERSION == 2 23238 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(
obj)))
return 1;
23242 if (likely(__Pyx_TypeCheck(
obj, type)))
return 1;
23244 PyErr_Format(PyExc_TypeError,
23245 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
23246 name, type->tp_name, Py_TYPE(
obj)->tp_name);
23251 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level) {
23252 PyObject *empty_list = 0;
23253 PyObject *module = 0;
23254 PyObject *global_dict = 0;
23255 PyObject *empty_dict = 0;
23257 #if PY_MAJOR_VERSION < 3 23258 PyObject *py_import;
23259 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
23266 empty_list = PyList_New(0);
23271 global_dict = PyModule_GetDict(__pyx_m);
23274 empty_dict = PyDict_New();
23278 #if PY_MAJOR_VERSION >= 3 23280 if ((1) && (strchr(__Pyx_MODULE_NAME,
'.'))) {
23281 module = PyImport_ImportModuleLevelObject(
23282 name, global_dict, empty_dict, list, 1);
23284 if (!PyErr_ExceptionMatches(PyExc_ImportError))
23293 #if PY_MAJOR_VERSION < 3 23294 PyObject *py_level = PyInt_FromLong(level);
23297 module = PyObject_CallFunctionObjArgs(py_import,
23298 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
23299 Py_DECREF(py_level);
23301 module = PyImport_ImportModuleLevelObject(
23302 name, global_dict, empty_dict, list, level);
23307 #if PY_MAJOR_VERSION < 3 23308 Py_XDECREF(py_import);
23310 Py_XDECREF(empty_list);
23311 Py_XDECREF(empty_dict);
23316 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 23317 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
23318 PyErr_Format(PyExc_AttributeError,
23319 #
if PY_MAJOR_VERSION >= 3
23320 "'%.50s' object has no attribute '%U'",
23321 tp->tp_name, attr_name);
23323 "'%.50s' object has no attribute '%.400s'",
23324 tp->tp_name, PyString_AS_STRING(attr_name));
23328 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject*
obj, PyObject* attr_name) {
23330 PyTypeObject *tp = Py_TYPE(
obj);
23331 if (unlikely(!PyString_Check(attr_name))) {
23332 return PyObject_GenericGetAttr(
obj, attr_name);
23334 assert(!tp->tp_dictoffset);
23335 descr = _PyType_Lookup(tp, attr_name);
23336 if (unlikely(!descr)) {
23337 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
23340 #if PY_MAJOR_VERSION < 3 23341 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
23344 descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
23346 PyObject *res = f(descr,
obj, (PyObject *)tp);
23356 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 23357 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject*
obj, PyObject* attr_name) {
23358 if (unlikely(Py_TYPE(
obj)->tp_dictoffset)) {
23359 return PyObject_GenericGetAttr(
obj, attr_name);
23361 return __Pyx_PyObject_GenericGetAttrNoDict(
obj, attr_name);
23366 static int __Pyx_SetVtable(PyObject *dict,
void *vtable) {
23367 #if PY_VERSION_HEX >= 0x02070000 23368 PyObject *ob = PyCapsule_New(vtable, 0, 0);
23370 PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
23374 if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
23384 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(
void) {
23385 __Pyx_PyThreadState_declare
23386 __Pyx_PyThreadState_assign
23387 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
23388 __Pyx_PyErr_Clear();
23390 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject*
obj, PyObject* attr_name) {
23392 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 23393 PyTypeObject* tp = Py_TYPE(
obj);
23394 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
23395 return _PyObject_GenericGetAttrWithDict(
obj, attr_name, NULL, 1);
23398 result = __Pyx_PyObject_GetAttrStr(
obj, attr_name);
23399 if (unlikely(!result)) {
23400 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
23406 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
23408 PyObject *name_attr;
23409 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name);
23410 if (likely(name_attr)) {
23411 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
23415 if (unlikely(ret < 0)) {
23419 Py_XDECREF(name_attr);
23422 static int __Pyx_setup_reduce(PyObject* type_obj) {
23424 PyObject *object_reduce = NULL;
23425 PyObject *object_reduce_ex = NULL;
23426 PyObject *reduce = NULL;
23427 PyObject *reduce_ex = NULL;
23428 PyObject *reduce_cython = NULL;
23429 PyObject *setstate = NULL;
23430 PyObject *setstate_cython = NULL;
23431 #if CYTHON_USE_PYTYPE_LOOKUP 23432 if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate))
goto __PYX_GOOD;
23434 if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate))
goto __PYX_GOOD;
23436 #if CYTHON_USE_PYTYPE_LOOKUP 23437 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto __PYX_BAD;
23439 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto __PYX_BAD;
23441 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex);
if (unlikely(!reduce_ex))
goto __PYX_BAD;
23442 if (reduce_ex == object_reduce_ex) {
23443 #if CYTHON_USE_PYTYPE_LOOKUP 23444 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto __PYX_BAD;
23446 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto __PYX_BAD;
23448 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce);
if (unlikely(!reduce))
goto __PYX_BAD;
23449 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
23450 reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
23451 if (likely(reduce_cython)) {
23452 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
23453 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
23454 }
else if (reduce == object_reduce || PyErr_Occurred()) {
23457 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
23458 if (!setstate) PyErr_Clear();
23459 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
23460 setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
23461 if (likely(setstate_cython)) {
23462 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
23463 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
23464 }
else if (!setstate || PyErr_Occurred()) {
23468 PyType_Modified((PyTypeObject*)type_obj);
23473 if (!PyErr_Occurred())
23474 PyErr_Format(PyExc_RuntimeError,
"Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
23477 #if !CYTHON_USE_PYTYPE_LOOKUP 23478 Py_XDECREF(object_reduce);
23479 Py_XDECREF(object_reduce_ex);
23481 Py_XDECREF(reduce);
23482 Py_XDECREF(reduce_ex);
23483 Py_XDECREF(reduce_cython);
23484 Py_XDECREF(setstate);
23485 Py_XDECREF(setstate_cython);
23490 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals) {
23491 #if CYTHON_COMPILING_IN_PYPY 23492 return PyObject_RichCompareBool(s1, s2, equals);
23495 return (equals == Py_EQ);
23496 }
else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
23497 const char *ps1, *ps2;
23498 Py_ssize_t length = PyBytes_GET_SIZE(s1);
23499 if (length != PyBytes_GET_SIZE(s2))
23500 return (equals == Py_NE);
23501 ps1 = PyBytes_AS_STRING(s1);
23502 ps2 = PyBytes_AS_STRING(s2);
23503 if (ps1[0] != ps2[0]) {
23504 return (equals == Py_NE);
23505 }
else if (length == 1) {
23506 return (equals == Py_EQ);
23509 #if CYTHON_USE_UNICODE_INTERNALS 23510 Py_hash_t hash1, hash2;
23511 hash1 = ((PyBytesObject*)s1)->ob_shash;
23512 hash2 = ((PyBytesObject*)s2)->ob_shash;
23513 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
23514 return (equals == Py_NE);
23517 result = memcmp(ps1, ps2, (
size_t)length);
23518 return (equals == Py_EQ) ? (result == 0) : (result != 0);
23520 }
else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
23521 return (equals == Py_NE);
23522 }
else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
23523 return (equals == Py_NE);
23526 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
23529 result = __Pyx_PyObject_IsTrue(py_result);
23530 Py_DECREF(py_result);
23537 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals) {
23538 #if CYTHON_COMPILING_IN_PYPY 23539 return PyObject_RichCompareBool(s1, s2, equals);
23541 #if PY_MAJOR_VERSION < 3 23542 PyObject* owned_ref = NULL;
23544 int s1_is_unicode, s2_is_unicode;
23548 s1_is_unicode = PyUnicode_CheckExact(s1);
23549 s2_is_unicode = PyUnicode_CheckExact(s2);
23550 #if PY_MAJOR_VERSION < 3 23551 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
23552 owned_ref = PyUnicode_FromObject(s2);
23553 if (unlikely(!owned_ref))
23557 }
else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
23558 owned_ref = PyUnicode_FromObject(s1);
23559 if (unlikely(!owned_ref))
23563 }
else if (((!s2_is_unicode) & (!s1_is_unicode))) {
23564 return __Pyx_PyBytes_Equals(s1, s2, equals);
23567 if (s1_is_unicode & s2_is_unicode) {
23570 void *data1, *data2;
23571 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
23573 length = __Pyx_PyUnicode_GET_LENGTH(s1);
23574 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
23577 #if CYTHON_USE_UNICODE_INTERNALS 23579 Py_hash_t hash1, hash2;
23580 #if CYTHON_PEP393_ENABLED 23581 hash1 = ((PyASCIIObject*)s1)->hash;
23582 hash2 = ((PyASCIIObject*)s2)->hash;
23584 hash1 = ((PyUnicodeObject*)s1)->hash;
23585 hash2 = ((PyUnicodeObject*)s2)->hash;
23587 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
23592 kind = __Pyx_PyUnicode_KIND(s1);
23593 if (kind != __Pyx_PyUnicode_KIND(s2)) {
23596 data1 = __Pyx_PyUnicode_DATA(s1);
23597 data2 = __Pyx_PyUnicode_DATA(s2);
23598 if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
23600 }
else if (length == 1) {
23603 int result = memcmp(data1, data2, (
size_t)(length * kind));
23604 #if PY_MAJOR_VERSION < 3 23605 Py_XDECREF(owned_ref);
23607 return (equals == Py_EQ) ? (result == 0) : (result != 0);
23609 }
else if ((s1 == Py_None) & s2_is_unicode) {
23611 }
else if ((s2 == Py_None) & s1_is_unicode) {
23615 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
23616 #if PY_MAJOR_VERSION < 3 23617 Py_XDECREF(owned_ref);
23621 result = __Pyx_PyObject_IsTrue(py_result);
23622 Py_DECREF(py_result);
23626 #if PY_MAJOR_VERSION < 3 23627 Py_XDECREF(owned_ref);
23629 return (equals == Py_EQ);
23631 #if PY_MAJOR_VERSION < 3 23632 Py_XDECREF(owned_ref);
23634 return (equals == Py_NE);
23639 #ifndef CYTHON_CLINE_IN_TRACEBACK 23640 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate,
int c_line) {
23641 PyObject *use_cline;
23642 PyObject *ptype, *pvalue, *ptraceback;
23643 #if CYTHON_COMPILING_IN_CPYTHON 23644 PyObject **cython_runtime_dict;
23646 if (unlikely(!__pyx_cython_runtime)) {
23649 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
23650 #if CYTHON_COMPILING_IN_CPYTHON 23651 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
23652 if (likely(cython_runtime_dict)) {
23653 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
23654 use_cline, *cython_runtime_dict,
23655 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
23659 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
23660 if (use_cline_obj) {
23661 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
23662 Py_DECREF(use_cline_obj);
23670 (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
23672 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
23675 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
23681 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
23682 int start = 0, mid = 0, end = count - 1;
23683 if (end >= 0 && code_line > entries[end].code_line) {
23686 while (start < end) {
23687 mid = start + (end - start) / 2;
23688 if (code_line < entries[mid].code_line) {
23690 }
else if (code_line > entries[mid].code_line) {
23696 if (code_line <= entries[mid].code_line) {
23702 static PyCodeObject *__pyx_find_code_object(
int code_line) {
23703 PyCodeObject* code_object;
23705 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
23708 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
23709 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
23712 code_object = __pyx_code_cache.entries[pos].code_object;
23713 Py_INCREF(code_object);
23714 return code_object;
23716 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
23718 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
23719 if (unlikely(!code_line)) {
23722 if (unlikely(!entries)) {
23723 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
23724 if (likely(entries)) {
23725 __pyx_code_cache.entries = entries;
23726 __pyx_code_cache.max_count = 64;
23727 __pyx_code_cache.count = 1;
23728 entries[0].code_line = code_line;
23729 entries[0].code_object = code_object;
23730 Py_INCREF(code_object);
23734 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
23735 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
23736 PyCodeObject* tmp = entries[pos].code_object;
23737 entries[pos].code_object = code_object;
23741 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
23742 int new_max = __pyx_code_cache.max_count + 64;
23743 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
23744 __pyx_code_cache.entries, ((
size_t)new_max) *
sizeof(__Pyx_CodeObjectCacheEntry));
23745 if (unlikely(!entries)) {
23748 __pyx_code_cache.entries = entries;
23749 __pyx_code_cache.max_count = new_max;
23751 for (
i=__pyx_code_cache.count;
i>pos;
i--) {
23752 entries[
i] = entries[
i-1];
23754 entries[pos].code_line = code_line;
23755 entries[pos].code_object = code_object;
23756 __pyx_code_cache.count++;
23757 Py_INCREF(code_object);
23761 #include "compile.h" 23762 #include "frameobject.h" 23763 #include "traceback.h" 23764 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
23765 const char *funcname,
int c_line,
23766 int py_line,
const char *filename) {
23767 PyCodeObject *py_code = NULL;
23768 PyObject *py_funcname = NULL;
23769 #if PY_MAJOR_VERSION < 3 23770 PyObject *py_srcfile = NULL;
23771 py_srcfile = PyString_FromString(filename);
23772 if (!py_srcfile)
goto bad;
23775 #if PY_MAJOR_VERSION < 3 23776 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
23777 if (!py_funcname)
goto bad;
23779 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
23780 if (!py_funcname)
goto bad;
23781 funcname = PyUnicode_AsUTF8(py_funcname);
23782 if (!funcname)
goto bad;
23786 #if PY_MAJOR_VERSION < 3 23787 py_funcname = PyString_FromString(funcname);
23788 if (!py_funcname)
goto bad;
23791 #if PY_MAJOR_VERSION < 3 23792 py_code = __Pyx_PyCode_New(
23809 Py_DECREF(py_srcfile);
23811 py_code = PyCode_NewEmpty(filename, funcname, py_line);
23813 Py_XDECREF(py_funcname);
23816 Py_XDECREF(py_funcname);
23817 #if PY_MAJOR_VERSION < 3 23818 Py_XDECREF(py_srcfile);
23822 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
23823 int py_line,
const char *filename) {
23824 PyCodeObject *py_code = 0;
23825 PyFrameObject *py_frame = 0;
23826 PyThreadState *tstate = __Pyx_PyThreadState_Current;
23828 c_line = __Pyx_CLineForTraceback(tstate, c_line);
23830 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
23832 py_code = __Pyx_CreateCodeObjectForTraceback(
23833 funcname, c_line, py_line, filename);
23834 if (!py_code)
goto bad;
23835 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
23837 py_frame = PyFrame_New(
23843 if (!py_frame)
goto bad;
23844 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
23845 PyTraceBack_Here(py_frame);
23847 Py_XDECREF(py_code);
23848 Py_XDECREF(py_frame);
23852 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ 23853 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) 23854 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ 23855 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) 23856 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ 23858 func_type value = func_value;\ 23859 if (sizeof(target_type) < sizeof(func_type)) {\ 23860 if (unlikely(value != (func_type) (target_type) value)) {\ 23861 func_type zero = 0;\ 23862 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ 23863 return (target_type) -1;\ 23864 if (is_unsigned && unlikely(value < zero))\ 23865 goto raise_neg_overflow;\ 23867 goto raise_overflow;\ 23870 return (target_type) value;\ 23874 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *x) {
23875 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC 23876 #pragma GCC diagnostic push 23877 #pragma GCC diagnostic ignored "-Wconversion" 23879 const int neg_one = (int) -1, const_zero = (
int) 0;
23880 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC 23881 #pragma GCC diagnostic pop 23883 const int is_unsigned = neg_one > const_zero;
23884 #if PY_MAJOR_VERSION < 3 23885 if (likely(PyInt_Check(x))) {
23886 if (
sizeof(
int) <
sizeof(long)) {
23887 __PYX_VERIFY_RETURN_INT(
int,
long, PyInt_AS_LONG(x))
23889 long val = PyInt_AS_LONG(x);
23890 if (is_unsigned && unlikely(val < 0)) {
23891 goto raise_neg_overflow;
23897 if (likely(PyLong_Check(x))) {
23899 #if CYTHON_USE_PYLONG_INTERNALS 23900 const digit* digits = ((PyLongObject*)x)->ob_digit;
23901 switch (Py_SIZE(x)) {
23902 case 0:
return (
int) 0;
23903 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, digits[0])
23905 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
23906 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
23907 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
23908 }
else if (8 *
sizeof(
int) >= 2 * PyLong_SHIFT) {
23909 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
23914 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
23915 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
23916 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
23917 }
else if (8 *
sizeof(
int) >= 3 * PyLong_SHIFT) {
23918 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
23923 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
23924 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
23925 __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])))
23926 }
else if (8 *
sizeof(
int) >= 4 * PyLong_SHIFT) {
23927 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
23933 #if CYTHON_COMPILING_IN_CPYTHON 23934 if (unlikely(Py_SIZE(x) < 0)) {
23935 goto raise_neg_overflow;
23939 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
23940 if (unlikely(result < 0))
23942 if (unlikely(result == 1))
23943 goto raise_neg_overflow;
23946 if (
sizeof(
int) <=
sizeof(
unsigned long)) {
23947 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
23948 #ifdef HAVE_LONG_LONG 23949 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
23950 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
23954 #if CYTHON_USE_PYLONG_INTERNALS 23955 const digit* digits = ((PyLongObject*)x)->ob_digit;
23956 switch (Py_SIZE(x)) {
23957 case 0:
return (
int) 0;
23958 case -1: __PYX_VERIFY_RETURN_INT(
int, sdigit, (sdigit) (-(sdigit)digits[0]))
23959 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, +digits[0])
23961 if (8 *
sizeof(
int) - 1 > 1 * PyLong_SHIFT) {
23962 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
23963 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
23964 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
23965 return (
int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
23970 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
23971 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
23972 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
23973 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
23974 return (
int) ((((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
23979 if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
23980 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
23981 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
23982 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
23983 return (
int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
23988 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
23989 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
23990 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
23991 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
23992 return (
int) ((((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
23997 if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
23998 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
23999 __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])))
24000 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
24001 return (
int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
24006 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
24007 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
24008 __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])))
24009 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
24010 return (
int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
24016 if (
sizeof(
int) <=
sizeof(long)) {
24017 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
24018 #ifdef HAVE_LONG_LONG 24019 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
24020 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
24025 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) 24026 PyErr_SetString(PyExc_RuntimeError,
24027 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
24030 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
24031 #if PY_MAJOR_VERSION < 3 24032 if (likely(v) && !PyLong_Check(v)) {
24034 v = PyNumber_Long(tmp);
24039 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
24040 unsigned char *bytes = (
unsigned char *)&val;
24041 int ret = _PyLong_AsByteArray((PyLongObject *)v,
24042 bytes,
sizeof(val),
24043 is_little, !is_unsigned);
24053 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
24054 if (!tmp)
return (
int) -1;
24055 val = __Pyx_PyInt_As_int(tmp);
24060 PyErr_SetString(PyExc_OverflowError,
24061 "value too large to convert to int");
24063 raise_neg_overflow:
24064 PyErr_SetString(PyExc_OverflowError,
24065 "can't convert negative value to int");
24070 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value) {
24071 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC 24072 #pragma GCC diagnostic push 24073 #pragma GCC diagnostic ignored "-Wconversion" 24075 const int neg_one = (int) -1, const_zero = (
int) 0;
24076 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC 24077 #pragma GCC diagnostic pop 24079 const int is_unsigned = neg_one > const_zero;
24081 if (
sizeof(
int) <
sizeof(long)) {
24082 return PyInt_FromLong((
long) value);
24083 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
24084 return PyLong_FromUnsignedLong((
unsigned long) value);
24085 #ifdef HAVE_LONG_LONG 24086 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
24087 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
24091 if (
sizeof(
int) <=
sizeof(
long)) {
24092 return PyInt_FromLong((
long) value);
24093 #ifdef HAVE_LONG_LONG 24094 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
24095 return PyLong_FromLongLong((PY_LONG_LONG) value);
24100 int one = 1;
int little = (int)*(
unsigned char *)&one;
24101 unsigned char *bytes = (
unsigned char *)&value;
24102 return _PyLong_FromByteArray(bytes,
sizeof(
int),
24103 little, !is_unsigned);
24108 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value) {
24109 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC 24110 #pragma GCC diagnostic push 24111 #pragma GCC diagnostic ignored "-Wconversion" 24113 const long neg_one = (long) -1, const_zero = (
long) 0;
24114 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC 24115 #pragma GCC diagnostic pop 24117 const int is_unsigned = neg_one > const_zero;
24119 if (
sizeof(
long) <
sizeof(long)) {
24120 return PyInt_FromLong((
long) value);
24121 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
24122 return PyLong_FromUnsignedLong((
unsigned long) value);
24123 #ifdef HAVE_LONG_LONG 24124 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
24125 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
24129 if (
sizeof(
long) <=
sizeof(
long)) {
24130 return PyInt_FromLong((
long) value);
24131 #ifdef HAVE_LONG_LONG 24132 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
24133 return PyLong_FromLongLong((PY_LONG_LONG) value);
24138 int one = 1;
int little = (int)*(
unsigned char *)&one;
24139 unsigned char *bytes = (
unsigned char *)&value;
24140 return _PyLong_FromByteArray(bytes,
sizeof(
long),
24141 little, !is_unsigned);
24146 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *x) {
24147 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC 24148 #pragma GCC diagnostic push 24149 #pragma GCC diagnostic ignored "-Wconversion" 24151 const long neg_one = (long) -1, const_zero = (
long) 0;
24152 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC 24153 #pragma GCC diagnostic pop 24155 const int is_unsigned = neg_one > const_zero;
24156 #if PY_MAJOR_VERSION < 3 24157 if (likely(PyInt_Check(x))) {
24158 if (
sizeof(
long) <
sizeof(long)) {
24159 __PYX_VERIFY_RETURN_INT(
long,
long, PyInt_AS_LONG(x))
24161 long val = PyInt_AS_LONG(x);
24162 if (is_unsigned && unlikely(val < 0)) {
24163 goto raise_neg_overflow;
24169 if (likely(PyLong_Check(x))) {
24171 #if CYTHON_USE_PYLONG_INTERNALS 24172 const digit* digits = ((PyLongObject*)x)->ob_digit;
24173 switch (Py_SIZE(x)) {
24174 case 0:
return (
long) 0;
24175 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, digits[0])
24177 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
24178 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
24179 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
24180 }
else if (8 *
sizeof(
long) >= 2 * PyLong_SHIFT) {
24181 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
24186 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
24187 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
24188 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
24189 }
else if (8 *
sizeof(
long) >= 3 * PyLong_SHIFT) {
24190 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
24195 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
24196 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
24197 __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])))
24198 }
else if (8 *
sizeof(
long) >= 4 * PyLong_SHIFT) {
24199 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
24205 #if CYTHON_COMPILING_IN_CPYTHON 24206 if (unlikely(Py_SIZE(x) < 0)) {
24207 goto raise_neg_overflow;
24211 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
24212 if (unlikely(result < 0))
24214 if (unlikely(result == 1))
24215 goto raise_neg_overflow;
24218 if (
sizeof(
long) <=
sizeof(
unsigned long)) {
24219 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
24220 #ifdef HAVE_LONG_LONG 24221 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
24222 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
24226 #if CYTHON_USE_PYLONG_INTERNALS 24227 const digit* digits = ((PyLongObject*)x)->ob_digit;
24228 switch (Py_SIZE(x)) {
24229 case 0:
return (
long) 0;
24230 case -1: __PYX_VERIFY_RETURN_INT(
long, sdigit, (sdigit) (-(sdigit)digits[0]))
24231 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, +digits[0])
24233 if (8 *
sizeof(
long) - 1 > 1 * PyLong_SHIFT) {
24234 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
24235 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
24236 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
24237 return (
long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
24242 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
24243 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
24244 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
24245 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
24246 return (
long) ((((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
24251 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
24252 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
24253 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
24254 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
24255 return (
long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
24260 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
24261 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
24262 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
24263 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
24264 return (
long) ((((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
24269 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
24270 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
24271 __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])))
24272 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
24273 return (
long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
24278 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
24279 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
24280 __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])))
24281 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
24282 return (
long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
24288 if (
sizeof(
long) <=
sizeof(long)) {
24289 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
24290 #ifdef HAVE_LONG_LONG 24291 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
24292 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
24297 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) 24298 PyErr_SetString(PyExc_RuntimeError,
24299 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
24302 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
24303 #if PY_MAJOR_VERSION < 3 24304 if (likely(v) && !PyLong_Check(v)) {
24306 v = PyNumber_Long(tmp);
24311 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
24312 unsigned char *bytes = (
unsigned char *)&val;
24313 int ret = _PyLong_AsByteArray((PyLongObject *)v,
24314 bytes,
sizeof(val),
24315 is_little, !is_unsigned);
24325 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
24326 if (!tmp)
return (
long) -1;
24327 val = __Pyx_PyInt_As_long(tmp);
24332 PyErr_SetString(PyExc_OverflowError,
24333 "value too large to convert to long");
24335 raise_neg_overflow:
24336 PyErr_SetString(PyExc_OverflowError,
24337 "can't convert negative value to long");
24342 #if CYTHON_COMPILING_IN_CPYTHON 24343 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
24349 return b == &PyBaseObject_Type;
24351 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
24353 if (a == b)
return 1;
24357 n = PyTuple_GET_SIZE(mro);
24358 for (
i = 0;
i < n;
i++) {
24359 if (PyTuple_GET_ITEM(mro,
i) == (PyObject *)b)
24364 return __Pyx_InBases(a, b);
24366 #if PY_MAJOR_VERSION == 2 24367 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
24368 PyObject *exception, *value, *tb;
24370 __Pyx_PyThreadState_declare
24371 __Pyx_PyThreadState_assign
24372 __Pyx_ErrFetch(&exception, &value, &tb);
24373 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
24374 if (unlikely(res == -1)) {
24375 PyErr_WriteUnraisable(err);
24379 res = PyObject_IsSubclass(err, exc_type2);
24380 if (unlikely(res == -1)) {
24381 PyErr_WriteUnraisable(err);
24385 __Pyx_ErrRestore(exception, value, tb);
24389 static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
24390 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
24392 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
24397 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
24399 assert(PyExceptionClass_Check(exc_type));
24400 n = PyTuple_GET_SIZE(tuple);
24401 #if PY_MAJOR_VERSION >= 3 24402 for (
i=0;
i<n;
i++) {
24403 if (exc_type == PyTuple_GET_ITEM(tuple,
i))
return 1;
24406 for (
i=0;
i<n;
i++) {
24407 PyObject *t = PyTuple_GET_ITEM(tuple,
i);
24408 #if PY_MAJOR_VERSION < 3 24409 if (likely(exc_type == t))
return 1;
24411 if (likely(PyExceptionClass_Check(t))) {
24412 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
24418 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
24419 if (likely(err == exc_type))
return 1;
24420 if (likely(PyExceptionClass_Check(err))) {
24421 if (likely(PyExceptionClass_Check(exc_type))) {
24422 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
24423 }
else if (likely(PyTuple_Check(exc_type))) {
24424 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
24428 return PyErr_GivenExceptionMatches(err, exc_type);
24430 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
24431 assert(PyExceptionClass_Check(exc_type1));
24432 assert(PyExceptionClass_Check(exc_type2));
24433 if (likely(err == exc_type1 || err == exc_type2))
return 1;
24434 if (likely(PyExceptionClass_Check(err))) {
24435 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
24437 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
24442 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
24443 PyObject* fake_module;
24444 PyTypeObject* cached_type = NULL;
24445 fake_module = PyImport_AddModule((
char*)
"_cython_" CYTHON_ABI);
24446 if (!fake_module)
return NULL;
24447 Py_INCREF(fake_module);
24448 cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
24450 if (!PyType_Check((PyObject*)cached_type)) {
24451 PyErr_Format(PyExc_TypeError,
24452 "Shared Cython type %.200s is not a type object",
24456 if (cached_type->tp_basicsize != type->tp_basicsize) {
24457 PyErr_Format(PyExc_TypeError,
24458 "Shared Cython type %.200s has the wrong size, try recompiling",
24463 if (!PyErr_ExceptionMatches(PyExc_AttributeError))
goto bad;
24465 if (PyType_Ready(type) < 0)
goto bad;
24466 if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
24469 cached_type = type;
24472 Py_DECREF(fake_module);
24473 return cached_type;
24475 Py_XDECREF(cached_type);
24476 cached_type = NULL;
24481 static int __Pyx_PyObject_GetMethod(PyObject *
obj, PyObject *name, PyObject **method) {
24483 #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP 24484 PyTypeObject *tp = Py_TYPE(
obj);
24486 descrgetfunc f = NULL;
24487 PyObject **dictptr, *dict;
24488 int meth_found = 0;
24489 assert (*method == NULL);
24490 if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
24491 attr = __Pyx_PyObject_GetAttrStr(
obj, name);
24494 if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
24497 descr = _PyType_Lookup(tp, name);
24498 if (likely(descr != NULL)) {
24500 #if PY_MAJOR_VERSION >= 3 24501 #ifdef __Pyx_CyFunction_USED 24502 if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
24504 if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type)))
24507 #ifdef __Pyx_CyFunction_USED 24508 if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
24510 if (likely(PyFunction_Check(descr)))
24516 f = Py_TYPE(descr)->tp_descr_get;
24517 if (f != NULL && PyDescr_IsData(descr)) {
24518 attr = f(descr,
obj, (PyObject *)Py_TYPE(
obj));
24524 dictptr = _PyObject_GetDictPtr(
obj);
24525 if (dictptr != NULL && (dict = *dictptr) != NULL) {
24527 attr = __Pyx_PyDict_GetItemStr(dict, name);
24528 if (attr != NULL) {
24541 attr = f(descr,
obj, (PyObject *)Py_TYPE(
obj));
24545 if (descr != NULL) {
24549 PyErr_Format(PyExc_AttributeError,
24550 #
if PY_MAJOR_VERSION >= 3
24551 "'%.50s' object has no attribute '%U'",
24552 tp->tp_name, name);
24554 "'%.50s' object has no attribute '%.400s'",
24555 tp->tp_name, PyString_AS_STRING(name));
24559 attr = __Pyx_PyObject_GetAttrStr(
obj, name);
24563 #if CYTHON_UNPACK_METHODS 24564 if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) ==
obj)) {
24565 PyObject *
function = PyMethod_GET_FUNCTION(attr);
24566 Py_INCREF(
function);
24568 *method =
function;
24577 static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
24578 PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
24582 static PyObject* __Pyx_PyObject_CallMethod1(PyObject*
obj, PyObject* method_name, PyObject* arg) {
24583 PyObject *method = NULL, *result;
24584 int is_method = __Pyx_PyObject_GetMethod(
obj, method_name, &method);
24585 if (likely(is_method)) {
24586 result = __Pyx_PyObject_Call2Args(method,
obj, arg);
24590 if (unlikely(!method))
return NULL;
24591 return __Pyx__PyObject_CallMethod1(method, arg);
24595 #include <structmember.h> 24596 #include <frameobject.h> 24597 #define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom) 24598 static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) {
24599 PyObject *et, *ev, *tb;
24600 PyObject *value = NULL;
24601 __Pyx_ErrFetch(&et, &ev, &tb);
24605 Py_INCREF(Py_None);
24609 if (likely(et == PyExc_StopIteration)) {
24611 Py_INCREF(Py_None);
24614 #if PY_VERSION_HEX >= 0x030300A0 24615 else if (Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) {
24616 value = ((PyStopIterationObject *)ev)->value;
24621 else if (unlikely(PyTuple_Check(ev))) {
24622 if (PyTuple_GET_SIZE(ev) >= 1) {
24623 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 24624 value = PyTuple_GET_ITEM(ev, 0);
24627 value = PySequence_ITEM(ev, 0);
24630 Py_INCREF(Py_None);
24635 else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
24638 if (likely(value)) {
24644 }
else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
24645 __Pyx_ErrRestore(et, ev, tb);
24648 PyErr_NormalizeException(&et, &ev, &tb);
24649 if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
24650 __Pyx_ErrRestore(et, ev, tb);
24655 #if PY_VERSION_HEX >= 0x030300A0 24656 value = ((PyStopIterationObject *)ev)->value;
24661 PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args);
24663 if (likely(args)) {
24664 value = PySequence_GetItem(args, 0);
24667 if (unlikely(!value)) {
24668 __Pyx_ErrRestore(NULL, NULL, NULL);
24669 Py_INCREF(Py_None);
24677 static CYTHON_INLINE
24678 void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) {
24679 PyObject *t, *v, *tb;
24680 t = exc_state->exc_type;
24681 v = exc_state->exc_value;
24682 tb = exc_state->exc_traceback;
24683 exc_state->exc_type = NULL;
24684 exc_state->exc_value = NULL;
24685 exc_state->exc_traceback = NULL;
24690 #define __Pyx_Coroutine_AlreadyRunningError(gen) (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL) 24691 static void __Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject *gen) {
24694 #ifdef __Pyx_Coroutine_USED 24695 }
else if (__Pyx_Coroutine_Check((PyObject*)gen)) {
24696 msg =
"coroutine already executing";
24698 #ifdef __Pyx_AsyncGen_USED 24699 }
else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
24700 msg =
"async generator already executing";
24703 msg =
"generator already executing";
24705 PyErr_SetString(PyExc_ValueError, msg);
24707 #define __Pyx_Coroutine_NotStartedError(gen) (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL) 24708 static void __Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject *gen) {
24711 #ifdef __Pyx_Coroutine_USED 24712 }
else if (__Pyx_Coroutine_Check(gen)) {
24713 msg =
"can't send non-None value to a just-started coroutine";
24715 #ifdef __Pyx_AsyncGen_USED 24716 }
else if (__Pyx_AsyncGen_CheckExact(gen)) {
24717 msg =
"can't send non-None value to a just-started async generator";
24720 msg =
"can't send non-None value to a just-started generator";
24722 PyErr_SetString(PyExc_TypeError, msg);
24724 #define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing) (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL) 24725 static void __Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject *gen, PyObject *value, CYTHON_UNUSED
int closing) {
24726 #ifdef __Pyx_Coroutine_USED 24727 if (!closing && __Pyx_Coroutine_Check(gen)) {
24728 PyErr_SetString(PyExc_RuntimeError,
"cannot reuse already awaited coroutine");
24732 #ifdef __Pyx_AsyncGen_USED 24733 if (__Pyx_AsyncGen_CheckExact(gen))
24734 PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration);
24737 PyErr_SetNone(PyExc_StopIteration);
24741 PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *
self, PyObject *value,
int closing) {
24742 __Pyx_PyThreadState_declare
24743 PyThreadState *tstate;
24744 __Pyx_ExcInfoStruct *exc_state;
24746 assert(!self->is_running);
24747 if (unlikely(self->resume_label == 0)) {
24748 if (unlikely(value && value != Py_None)) {
24749 return __Pyx_Coroutine_NotStartedError((PyObject*)
self);
24752 if (unlikely(self->resume_label == -1)) {
24753 return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)
self, value, closing);
24755 #if CYTHON_FAST_THREAD_STATE 24756 __Pyx_PyThreadState_assign
24757 tstate = __pyx_tstate;
24759 tstate = __Pyx_PyThreadState_Current;
24761 exc_state = &
self->gi_exc_state;
24762 if (exc_state->exc_type) {
24763 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON 24765 if (exc_state->exc_traceback) {
24766 PyTracebackObject *tb = (PyTracebackObject *) exc_state->exc_traceback;
24767 PyFrameObject *f = tb->tb_frame;
24768 assert(f->f_back == NULL);
24769 #if PY_VERSION_HEX >= 0x030B00A1 24770 f->f_back = PyThreadState_GetFrame(tstate);
24772 Py_XINCREF(tstate->frame);
24773 f->f_back = tstate->frame;
24778 #if CYTHON_USE_EXC_INFO_STACK 24779 exc_state->previous_item = tstate->exc_info;
24780 tstate->exc_info = exc_state;
24782 if (exc_state->exc_type) {
24783 __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
24785 __Pyx_Coroutine_ExceptionClear(exc_state);
24786 __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
24789 self->is_running = 1;
24790 retval =
self->body((PyObject *)
self, tstate, value);
24791 self->is_running = 0;
24792 #if CYTHON_USE_EXC_INFO_STACK 24793 exc_state = &
self->gi_exc_state;
24794 tstate->exc_info = exc_state->previous_item;
24795 exc_state->previous_item = NULL;
24796 __Pyx_Coroutine_ResetFrameBackpointer(exc_state);
24800 static CYTHON_INLINE
void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) {
24801 PyObject *exc_tb = exc_state->exc_traceback;
24802 if (likely(exc_tb)) {
24803 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON 24805 PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
24806 PyFrameObject *f = tb->tb_frame;
24807 Py_CLEAR(f->f_back);
24811 static CYTHON_INLINE
24812 PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *retval) {
24813 if (unlikely(!retval)) {
24814 __Pyx_PyThreadState_declare
24815 __Pyx_PyThreadState_assign
24816 if (!__Pyx_PyErr_Occurred()) {
24817 PyObject *exc = PyExc_StopIteration;
24818 #ifdef __Pyx_AsyncGen_USED 24819 if (__Pyx_AsyncGen_CheckExact(gen))
24820 exc = __Pyx_PyExc_StopAsyncIteration;
24822 __Pyx_PyErr_SetNone(exc);
24827 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) 24828 static CYTHON_INLINE
24829 PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) {
24830 #if PY_VERSION_HEX <= 0x030A00A1 24831 return _PyGen_Send(gen, arg);
24834 if (PyIter_Send((PyObject*)gen, arg ? arg : Py_None, &result) == PYGEN_RETURN) {
24835 if (PyAsyncGen_CheckExact(gen)) {
24836 assert(result == Py_None);
24837 PyErr_SetNone(PyExc_StopAsyncIteration);
24839 else if (result == Py_None) {
24840 PyErr_SetNone(PyExc_StopIteration);
24843 _PyGen_SetStopIterationValue(result);
24851 static CYTHON_INLINE
24852 PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
24854 PyObject *val = NULL;
24855 __Pyx_Coroutine_Undelegate(gen);
24856 __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
24857 ret = __Pyx_Coroutine_SendEx(gen, val, 0);
24861 static PyObject *__Pyx_Coroutine_Send(PyObject *
self, PyObject *value) {
24863 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*)
self;
24864 PyObject *yf = gen->yieldfrom;
24865 if (unlikely(gen->is_running))
24866 return __Pyx_Coroutine_AlreadyRunningError(gen);
24869 gen->is_running = 1;
24870 #ifdef __Pyx_Generator_USED 24871 if (__Pyx_Generator_CheckExact(yf)) {
24872 ret = __Pyx_Coroutine_Send(yf, value);
24875 #ifdef __Pyx_Coroutine_USED 24876 if (__Pyx_Coroutine_Check(yf)) {
24877 ret = __Pyx_Coroutine_Send(yf, value);
24880 #ifdef __Pyx_AsyncGen_USED 24881 if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
24882 ret = __Pyx_async_gen_asend_send(yf, value);
24885 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) 24886 if (PyGen_CheckExact(yf)) {
24887 ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
24890 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) 24891 if (PyCoro_CheckExact(yf)) {
24892 ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
24896 if (value == Py_None)
24897 ret = Py_TYPE(yf)->tp_iternext(yf);
24899 ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
24901 gen->is_running = 0;
24905 retval = __Pyx_Coroutine_FinishDelegation(gen);
24907 retval = __Pyx_Coroutine_SendEx(gen, value, 0);
24909 return __Pyx_Coroutine_MethodReturn(
self, retval);
24911 static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
24912 PyObject *retval = NULL;
24914 #ifdef __Pyx_Generator_USED 24915 if (__Pyx_Generator_CheckExact(yf)) {
24916 retval = __Pyx_Coroutine_Close(yf);
24921 #ifdef __Pyx_Coroutine_USED 24922 if (__Pyx_Coroutine_Check(yf)) {
24923 retval = __Pyx_Coroutine_Close(yf);
24927 if (__Pyx_CoroutineAwait_CheckExact(yf)) {
24928 retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL);
24933 #ifdef __Pyx_AsyncGen_USED 24934 if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
24935 retval = __Pyx_async_gen_asend_close(yf, NULL);
24937 if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
24938 retval = __Pyx_async_gen_athrow_close(yf, NULL);
24943 gen->is_running = 1;
24944 meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close);
24945 if (unlikely(!meth)) {
24946 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
24947 PyErr_WriteUnraisable(yf);
24951 retval = PyObject_CallFunction(meth, NULL);
24956 gen->is_running = 0;
24958 Py_XDECREF(retval);
24961 static PyObject *__Pyx_Generator_Next(PyObject *
self) {
24962 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*)
self;
24963 PyObject *yf = gen->yieldfrom;
24964 if (unlikely(gen->is_running))
24965 return __Pyx_Coroutine_AlreadyRunningError(gen);
24968 gen->is_running = 1;
24969 #ifdef __Pyx_Generator_USED 24970 if (__Pyx_Generator_CheckExact(yf)) {
24971 ret = __Pyx_Generator_Next(yf);
24974 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) 24975 if (PyGen_CheckExact(yf)) {
24976 ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL);
24979 #ifdef __Pyx_Coroutine_USED 24980 if (__Pyx_Coroutine_Check(yf)) {
24981 ret = __Pyx_Coroutine_Send(yf, Py_None);
24984 ret = Py_TYPE(yf)->tp_iternext(yf);
24985 gen->is_running = 0;
24989 return __Pyx_Coroutine_FinishDelegation(gen);
24991 return __Pyx_Coroutine_SendEx(gen, Py_None, 0);
24993 static PyObject *__Pyx_Coroutine_Close_Method(PyObject *
self, CYTHON_UNUSED PyObject *arg) {
24994 return __Pyx_Coroutine_Close(
self);
24996 static PyObject *__Pyx_Coroutine_Close(PyObject *
self) {
24997 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
24998 PyObject *retval, *raised_exception;
24999 PyObject *yf = gen->yieldfrom;
25001 if (unlikely(gen->is_running))
25002 return __Pyx_Coroutine_AlreadyRunningError(gen);
25005 err = __Pyx_Coroutine_CloseIter(gen, yf);
25006 __Pyx_Coroutine_Undelegate(gen);
25010 PyErr_SetNone(PyExc_GeneratorExit);
25011 retval = __Pyx_Coroutine_SendEx(gen, NULL, 1);
25012 if (unlikely(retval)) {
25016 #ifdef __Pyx_Coroutine_USED 25017 }
else if (__Pyx_Coroutine_Check(
self)) {
25018 msg =
"coroutine ignored GeneratorExit";
25020 #ifdef __Pyx_AsyncGen_USED 25021 }
else if (__Pyx_AsyncGen_CheckExact(
self)) {
25022 #if PY_VERSION_HEX < 0x03060000 25023 msg =
"async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)";
25025 msg =
"async generator ignored GeneratorExit";
25029 msg =
"generator ignored GeneratorExit";
25031 PyErr_SetString(PyExc_RuntimeError, msg);
25034 raised_exception = PyErr_Occurred();
25035 if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) {
25036 if (raised_exception) PyErr_Clear();
25037 Py_INCREF(Py_None);
25042 static PyObject *__Pyx__Coroutine_Throw(PyObject *
self, PyObject *typ, PyObject *val, PyObject *tb,
25043 PyObject *args,
int close_on_genexit) {
25044 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
25045 PyObject *yf = gen->yieldfrom;
25046 if (unlikely(gen->is_running))
25047 return __Pyx_Coroutine_AlreadyRunningError(gen);
25051 if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
25052 int err = __Pyx_Coroutine_CloseIter(gen, yf);
25054 __Pyx_Coroutine_Undelegate(gen);
25056 return __Pyx_Coroutine_MethodReturn(
self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
25059 gen->is_running = 1;
25061 #ifdef __Pyx_Generator_USED
25062 || __Pyx_Generator_CheckExact(yf)
25064 #ifdef __Pyx_Coroutine_USED
25065 || __Pyx_Coroutine_Check(yf)
25068 ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
25069 #ifdef __Pyx_Coroutine_USED 25070 }
else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
25071 ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
25074 PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw);
25075 if (unlikely(!meth)) {
25077 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
25078 gen->is_running = 0;
25082 __Pyx_Coroutine_Undelegate(gen);
25083 gen->is_running = 0;
25086 if (likely(args)) {
25087 ret = PyObject_CallObject(meth, args);
25089 ret = PyObject_CallFunctionObjArgs(meth, typ, val, tb, NULL);
25093 gen->is_running = 0;
25096 ret = __Pyx_Coroutine_FinishDelegation(gen);
25098 return __Pyx_Coroutine_MethodReturn(
self, ret);
25101 __Pyx_Raise(typ, val, tb, NULL);
25102 return __Pyx_Coroutine_MethodReturn(
self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
25104 static PyObject *__Pyx_Coroutine_Throw(PyObject *
self, PyObject *args) {
25106 PyObject *val = NULL;
25107 PyObject *tb = NULL;
25108 if (!PyArg_UnpackTuple(args, (
char *)
"throw", 1, 3, &typ, &val, &tb))
25110 return __Pyx__Coroutine_Throw(
self, typ, val, tb, args, 1);
25112 static CYTHON_INLINE
int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit,
void *arg) {
25113 Py_VISIT(exc_state->exc_type);
25114 Py_VISIT(exc_state->exc_value);
25115 Py_VISIT(exc_state->exc_traceback);
25118 static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit,
void *arg) {
25119 Py_VISIT(gen->closure);
25120 Py_VISIT(gen->classobj);
25121 Py_VISIT(gen->yieldfrom);
25122 return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg);
25124 static int __Pyx_Coroutine_clear(PyObject *
self) {
25125 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
25126 Py_CLEAR(gen->closure);
25127 Py_CLEAR(gen->classobj);
25128 Py_CLEAR(gen->yieldfrom);
25129 __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state);
25130 #ifdef __Pyx_AsyncGen_USED 25131 if (__Pyx_AsyncGen_CheckExact(
self)) {
25132 Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
25135 Py_CLEAR(gen->gi_code);
25136 Py_CLEAR(gen->gi_frame);
25137 Py_CLEAR(gen->gi_name);
25138 Py_CLEAR(gen->gi_qualname);
25139 Py_CLEAR(gen->gi_modulename);
25142 static void __Pyx_Coroutine_dealloc(PyObject *
self) {
25143 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
25144 PyObject_GC_UnTrack(gen);
25145 if (gen->gi_weakreflist != NULL)
25146 PyObject_ClearWeakRefs(
self);
25147 if (gen->resume_label >= 0) {
25148 PyObject_GC_Track(
self);
25149 #if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE 25150 if (PyObject_CallFinalizerFromDealloc(
self))
25152 Py_TYPE(gen)->tp_del(
self);
25153 if (Py_REFCNT(
self) > 0)
25158 PyObject_GC_UnTrack(
self);
25160 #ifdef __Pyx_AsyncGen_USED 25161 if (__Pyx_AsyncGen_CheckExact(
self)) {
25165 Py_CLEAR(((__pyx_PyAsyncGenObject*)
self)->ag_finalizer);
25168 __Pyx_Coroutine_clear(
self);
25169 PyObject_GC_Del(gen);
25171 static void __Pyx_Coroutine_del(PyObject *
self) {
25172 PyObject *error_type, *error_value, *error_traceback;
25173 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
25174 __Pyx_PyThreadState_declare
25175 if (gen->resume_label < 0) {
25178 #if !CYTHON_USE_TP_FINALIZE 25179 assert(self->ob_refcnt == 0);
25180 __Pyx_SET_REFCNT(
self, 1);
25182 __Pyx_PyThreadState_assign
25183 __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
25184 #ifdef __Pyx_AsyncGen_USED 25185 if (__Pyx_AsyncGen_CheckExact(
self)) {
25186 __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)
self;
25187 PyObject *finalizer = agen->ag_finalizer;
25188 if (finalizer && !agen->ag_closed) {
25189 PyObject *res = __Pyx_PyObject_CallOneArg(finalizer,
self);
25190 if (unlikely(!res)) {
25191 PyErr_WriteUnraisable(
self);
25195 __Pyx_ErrRestore(error_type, error_value, error_traceback);
25200 if (unlikely(gen->resume_label == 0 && !error_value)) {
25201 #ifdef __Pyx_Coroutine_USED 25202 #ifdef __Pyx_Generator_USED 25203 if (!__Pyx_Generator_CheckExact(
self))
25206 PyObject_GC_UnTrack(
self);
25207 #if PY_MAJOR_VERSION >= 3 || defined(PyErr_WarnFormat) 25208 if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1,
"coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
25209 PyErr_WriteUnraisable(
self);
25213 #if CYTHON_COMPILING_IN_PYPY 25215 cmsg = (
char*)
"coroutine was never awaited";
25218 PyObject *qualname;
25219 qualname = gen->gi_qualname;
25220 cname = PyString_AS_STRING(qualname);
25221 msg = PyString_FromFormat(
"coroutine '%.50s' was never awaited", cname);
25222 if (unlikely(!msg)) {
25224 cmsg = (
char*)
"coroutine was never awaited";
25226 cmsg = PyString_AS_STRING(msg);
25229 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0))
25230 PyErr_WriteUnraisable(
self);
25233 PyObject_GC_Track(
self);
25237 PyObject *res = __Pyx_Coroutine_Close(
self);
25238 if (unlikely(!res)) {
25239 if (PyErr_Occurred())
25240 PyErr_WriteUnraisable(
self);
25245 __Pyx_ErrRestore(error_type, error_value, error_traceback);
25246 #if !CYTHON_USE_TP_FINALIZE 25247 assert(Py_REFCNT(
self) > 0);
25248 if (--self->ob_refcnt == 0) {
25252 Py_ssize_t refcnt = Py_REFCNT(
self);
25253 _Py_NewReference(
self);
25254 __Pyx_SET_REFCNT(
self, refcnt);
25256 #if CYTHON_COMPILING_IN_CPYTHON 25257 assert(PyType_IS_GC(Py_TYPE(
self)) &&
25258 _Py_AS_GC(
self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
25261 #ifdef COUNT_ALLOCS 25262 --Py_TYPE(
self)->tp_frees;
25263 --Py_TYPE(
self)->tp_allocs;
25268 __Pyx_Coroutine_get_name(__pyx_CoroutineObject *
self, CYTHON_UNUSED
void *context)
25270 PyObject *name =
self->gi_name;
25271 if (unlikely(!name)) name = Py_None;
25276 __Pyx_Coroutine_set_name(__pyx_CoroutineObject *
self, PyObject *value, CYTHON_UNUSED
void *context)
25279 #if PY_MAJOR_VERSION >= 3 25280 if (unlikely(value == NULL || !PyUnicode_Check(value)))
25282 if (unlikely(value == NULL || !PyString_Check(value)))
25285 PyErr_SetString(PyExc_TypeError,
25286 "__name__ must be set to a string object");
25289 tmp =
self->gi_name;
25291 self->gi_name = value;
25296 __Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *
self, CYTHON_UNUSED
void *context)
25298 PyObject *name =
self->gi_qualname;
25299 if (unlikely(!name)) name = Py_None;
25304 __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *
self, PyObject *value, CYTHON_UNUSED
void *context)
25307 #if PY_MAJOR_VERSION >= 3 25308 if (unlikely(value == NULL || !PyUnicode_Check(value)))
25310 if (unlikely(value == NULL || !PyString_Check(value)))
25313 PyErr_SetString(PyExc_TypeError,
25314 "__qualname__ must be set to a string object");
25317 tmp =
self->gi_qualname;
25319 self->gi_qualname = value;
25324 __Pyx_Coroutine_get_frame(__pyx_CoroutineObject *
self, CYTHON_UNUSED
void *context)
25326 PyObject *frame =
self->gi_frame;
25328 if (unlikely(!self->gi_code)) {
25331 frame = (PyObject *) PyFrame_New(
25332 PyThreadState_Get(),
25333 (PyCodeObject*) self->gi_code,
25337 if (unlikely(!frame))
25339 self->gi_frame = frame;
25344 static __pyx_CoroutineObject *__Pyx__Coroutine_New(
25345 PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
25346 PyObject *name, PyObject *qualname, PyObject *module_name) {
25347 __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
25348 if (unlikely(!gen))
25350 return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name);
25352 static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
25353 __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
25354 PyObject *name, PyObject *qualname, PyObject *module_name) {
25356 gen->closure = closure;
25357 Py_XINCREF(closure);
25358 gen->is_running = 0;
25359 gen->resume_label = 0;
25360 gen->classobj = NULL;
25361 gen->yieldfrom = NULL;
25362 gen->gi_exc_state.exc_type = NULL;
25363 gen->gi_exc_state.exc_value = NULL;
25364 gen->gi_exc_state.exc_traceback = NULL;
25365 #if CYTHON_USE_EXC_INFO_STACK 25366 gen->gi_exc_state.previous_item = NULL;
25368 gen->gi_weakreflist = NULL;
25369 Py_XINCREF(qualname);
25370 gen->gi_qualname = qualname;
25372 gen->gi_name = name;
25373 Py_XINCREF(module_name);
25374 gen->gi_modulename = module_name;
25376 gen->gi_code = code;
25377 gen->gi_frame = NULL;
25378 PyObject_GC_Track(gen);
25383 static PyObject* __Pyx_Coroutine_patch_module(PyObject* module,
const char* py_code) {
25384 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) 25386 PyObject *globals, *result_obj;
25387 globals = PyDict_New();
if (unlikely(!globals))
goto ignore;
25388 result = PyDict_SetItemString(globals,
"_cython_coroutine_type",
25389 #ifdef __Pyx_Coroutine_USED
25390 (PyObject*)__pyx_CoroutineType);
25394 if (unlikely(result < 0))
goto ignore;
25395 result = PyDict_SetItemString(globals,
"_cython_generator_type",
25396 #ifdef __Pyx_Generator_USED
25397 (PyObject*)__pyx_GeneratorType);
25401 if (unlikely(result < 0))
goto ignore;
25402 if (unlikely(PyDict_SetItemString(globals,
"_module", module) < 0))
goto ignore;
25403 if (unlikely(PyDict_SetItemString(globals,
"__builtins__", __pyx_b) < 0))
goto ignore;
25404 result_obj = PyRun_String(py_code, Py_file_input, globals, globals);
25405 if (unlikely(!result_obj))
goto ignore;
25406 Py_DECREF(result_obj);
25407 Py_DECREF(globals);
25410 Py_XDECREF(globals);
25411 PyErr_WriteUnraisable(module);
25412 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
"Cython module failed to patch module with custom type", 1) < 0)) {
25423 #ifndef CYTHON_REGISTER_ABCS 25424 #define CYTHON_REGISTER_ABCS 1 25426 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) 25427 static PyObject* __Pyx_patch_abc_module(PyObject *module);
25428 static PyObject* __Pyx_patch_abc_module(PyObject *module) {
25429 module = __Pyx_Coroutine_patch_module(
25431 "if _cython_generator_type is not None:\n" 25432 " try: Generator = _module.Generator\n" 25433 " except AttributeError: pass\n" 25434 " else: Generator.register(_cython_generator_type)\n" 25435 "if _cython_coroutine_type is not None:\n" 25436 " try: Coroutine = _module.Coroutine\n" 25437 " except AttributeError: pass\n" 25438 " else: Coroutine.register(_cython_coroutine_type)\n" 25443 static int __Pyx_patch_abc(
void) {
25444 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) 25445 static int abc_patched = 0;
25446 if (CYTHON_REGISTER_ABCS && !abc_patched) {
25448 module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ?
"collections.abc" :
"collections");
25450 PyErr_WriteUnraisable(NULL);
25451 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
25452 ((PY_MAJOR_VERSION >= 3) ?
25453 "Cython module failed to register with collections.abc module" :
25454 "Cython module failed to register with collections module"), 1) < 0)) {
25458 module = __Pyx_patch_abc_module(module);
25460 if (unlikely(!module))
25464 module = PyImport_ImportModule(
"backports_abc");
25466 module = __Pyx_patch_abc_module(module);
25467 Py_XDECREF(module);
25474 if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL);
25480 static PyMethodDef __pyx_Generator_methods[] = {
25481 {
"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
25482 (
char*) PyDoc_STR(
"send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
25483 {
"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
25484 (
char*) PyDoc_STR(
"throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
25485 {
"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS,
25486 (
char*) PyDoc_STR(
"close() -> raise GeneratorExit inside generator.")},
25489 static PyMemberDef __pyx_Generator_memberlist[] = {
25490 {(
char *)
"gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL},
25491 {(
char*)
"gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
25492 (
char*) PyDoc_STR(
"object being iterated by 'yield from', or None")},
25493 {(
char*)
"gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
25496 static PyGetSetDef __pyx_Generator_getsets[] = {
25497 {(
char *)
"__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
25498 (
char*) PyDoc_STR(
"name of the generator"), 0},
25499 {(
char *)
"__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
25500 (
char*) PyDoc_STR(
"qualified name of the generator"), 0},
25501 {(
char *)
"gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL,
25502 (
char*) PyDoc_STR(
"Frame of the generator"), 0},
25505 static PyTypeObject __pyx_GeneratorType_type = {
25506 PyVarObject_HEAD_INIT(0, 0)
25508 sizeof(__pyx_CoroutineObject),
25510 (destructor) __Pyx_Coroutine_dealloc,
25525 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
25527 (traverseproc) __Pyx_Coroutine_traverse,
25530 offsetof(__pyx_CoroutineObject, gi_weakreflist),
25532 (iternextfunc) __Pyx_Generator_Next,
25533 __pyx_Generator_methods,
25534 __pyx_Generator_memberlist,
25535 __pyx_Generator_getsets,
25551 #
if CYTHON_USE_TP_FINALIZE
25554 __Pyx_Coroutine_del,
25557 #
if CYTHON_USE_TP_FINALIZE
25558 __Pyx_Coroutine_del,
25559 #elif PY_VERSION_HEX >= 0x030400a1
25562 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
25565 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 25568 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 25572 static int __pyx_Generator_init(
void) {
25573 __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
25574 __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
25575 __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
25576 if (unlikely(!__pyx_GeneratorType)) {
25583 static int __Pyx_check_binary_version(
void) {
25584 char ctversion[4], rtversion[4];
25585 PyOS_snprintf(ctversion, 4,
"%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
25586 PyOS_snprintf(rtversion, 4,
"%s", Py_GetVersion());
25587 if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
25589 PyOS_snprintf(message,
sizeof(message),
25590 "compiletime version %s of module '%.100s' " 25591 "does not match runtime version %s",
25592 ctversion, __Pyx_MODULE_NAME, rtversion);
25593 return PyErr_WarnEx(NULL, message, 1);
25599 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
25601 #if PY_MAJOR_VERSION < 3 25602 if (t->is_unicode) {
25603 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
25604 }
else if (t->intern) {
25605 *t->p = PyString_InternFromString(t->s);
25607 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
25610 if (t->is_unicode | t->is_str) {
25612 *t->p = PyUnicode_InternFromString(t->s);
25613 }
else if (t->encoding) {
25614 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
25616 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
25619 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
25624 if (PyObject_Hash(*t->p) == -1)
25631 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
25632 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
25634 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
25636 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
25638 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 25639 #if !CYTHON_PEP393_ENABLED 25640 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
25642 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
25643 if (!defenc)
return NULL;
25644 defenc_c = PyBytes_AS_STRING(defenc);
25645 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 25647 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
25649 for (c = defenc_c; c < end; c++) {
25650 if ((
unsigned char) (*c) >= 128) {
25651 PyUnicode_AsASCIIString(o);
25657 *length = PyBytes_GET_SIZE(defenc);
25661 static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
25662 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
25663 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 25664 if (likely(PyUnicode_IS_ASCII(o))) {
25665 *length = PyUnicode_GET_LENGTH(o);
25666 return PyUnicode_AsUTF8(o);
25668 PyUnicode_AsASCIIString(o);
25672 return PyUnicode_AsUTF8AndSize(o, length);
25677 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
25678 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 25680 #
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
25681 __Pyx_sys_getdefaultencoding_not_ascii &&
25683 PyUnicode_Check(o)) {
25684 return __Pyx_PyUnicode_AsStringAndSize(o, length);
25687 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) 25688 if (PyByteArray_Check(o)) {
25689 *length = PyByteArray_GET_SIZE(o);
25690 return PyByteArray_AS_STRING(o);
25695 int r = PyBytes_AsStringAndSize(o, &result, length);
25696 if (unlikely(r < 0)) {
25703 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
25704 int is_true = x == Py_True;
25705 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
25706 else return PyObject_IsTrue(x);
25708 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
25710 if (unlikely(!x))
return -1;
25711 retval = __Pyx_PyObject_IsTrue(x);
25715 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result,
const char* type_name) {
25716 #if PY_MAJOR_VERSION >= 3 25717 if (PyLong_Check(result)) {
25718 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
25719 "__int__ returned non-int (type %.200s). " 25720 "The ability to return an instance of a strict subclass of int " 25721 "is deprecated, and may be removed in a future version of Python.",
25722 Py_TYPE(result)->tp_name)) {
25729 PyErr_Format(PyExc_TypeError,
25730 "__%.4s__ returned non-%.4s (type %.200s)",
25731 type_name, type_name, Py_TYPE(result)->tp_name);
25735 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
25736 #if CYTHON_USE_TYPE_SLOTS 25737 PyNumberMethods *m;
25739 const char *name = NULL;
25740 PyObject *res = NULL;
25741 #if PY_MAJOR_VERSION < 3 25742 if (likely(PyInt_Check(x) || PyLong_Check(x)))
25744 if (likely(PyLong_Check(x)))
25746 return __Pyx_NewRef(x);
25747 #if CYTHON_USE_TYPE_SLOTS 25748 m = Py_TYPE(x)->tp_as_number;
25749 #if PY_MAJOR_VERSION < 3 25750 if (m && m->nb_int) {
25752 res = m->nb_int(x);
25754 else if (m && m->nb_long) {
25756 res = m->nb_long(x);
25759 if (likely(m && m->nb_int)) {
25761 res = m->nb_int(x);
25765 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
25766 res = PyNumber_Int(x);
25770 #if PY_MAJOR_VERSION < 3 25771 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
25773 if (unlikely(!PyLong_CheckExact(res))) {
25775 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
25778 else if (!PyErr_Occurred()) {
25779 PyErr_SetString(PyExc_TypeError,
25780 "an integer is required");
25784 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
25787 #if PY_MAJOR_VERSION < 3 25788 if (likely(PyInt_CheckExact(b))) {
25789 if (
sizeof(Py_ssize_t) >=
sizeof(
long))
25790 return PyInt_AS_LONG(b);
25792 return PyInt_AsSsize_t(b);
25795 if (likely(PyLong_CheckExact(b))) {
25796 #if CYTHON_USE_PYLONG_INTERNALS 25797 const digit* digits = ((PyLongObject*)b)->ob_digit;
25798 const Py_ssize_t size = Py_SIZE(b);
25799 if (likely(__Pyx_sst_abs(size) <= 1)) {
25800 ival = likely(size) ? digits[0] : 0;
25801 if (size == -1) ival = -ival;
25806 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
25807 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
25811 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
25812 return -(Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
25816 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
25817 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
25821 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
25822 return -(Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
25826 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
25827 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]));
25831 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
25832 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]));
25838 return PyLong_AsSsize_t(b);
25840 x = PyNumber_Index(b);
25842 ival = PyInt_AsSsize_t(x);
25846 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
25847 if (
sizeof(Py_hash_t) ==
sizeof(Py_ssize_t)) {
25848 return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
25849 #if PY_MAJOR_VERSION < 3 25850 }
else if (likely(PyInt_CheckExact(o))) {
25851 return PyInt_AS_LONG(o);
25856 x = PyNumber_Index(o);
25858 ival = PyInt_AsLong(x);
25863 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
25864 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
25866 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
25867 return PyInt_FromSize_t(ival);
auto atanh(const Multivector< Scalar_T, LO, HI, Tune_P > &val, const Multivector< Scalar_T, LO, HI, Tune_P > &i, const bool prechecked=false) -> const Multivector< Scalar_T, LO, HI, Tune_P >
Inverse hyperbolic tangent of multivector with specified complexifier.
String glucat_package_version
String clifford_to_str(const Multivector_T &mv)
The "informal" string representation of Multivector_T mv.
String index_set_to_repr(const Index_Set_T &ist)
The “official” string representation of Index_Set_T ist.
auto exp(const framed_multi< Scalar_T, LO, HI, Tune_P > &val) -> const framed_multi< Scalar_T, LO, HI, Tune_P >
Exponential of multivector.
auto operator!=(const Multivector< Scalar_T, LO, HI, Tune_P > &lhs, const RHS< Scalar_T, LO, HI, Tune_P > &rhs) -> bool
Test for inequality of multivectors.
auto max_pos(const index_set< LO, HI > &ist) -> index_t
Maximum positive index, or 0 if none.
auto min_neg(const index_set< LO, HI > &ist) -> index_t
Minimum negative index, or 0 if none.
auto asinh(const Multivector< Scalar_T, LO, HI, Tune_P > &val, const Multivector< Scalar_T, LO, HI, Tune_P > &i, const bool prechecked=false) -> const Multivector< Scalar_T, LO, HI, Tune_P >
Inverse hyperbolic sine of multivector with specified complexifier.
auto error_squared(const Multivector< Scalar_T, LO, HI, Tune_P > &lhs, const RHS< Scalar_T, LO, HI, Tune_P > &rhs, const Scalar_T threshold) -> Scalar_T
Relative or absolute error using the quadratic norm.
auto log(const Multivector< Scalar_T, LO, HI, Tune_P > &val, const Multivector< Scalar_T, LO, HI, Tune_P > &i, const bool prechecked=false) -> const Multivector< Scalar_T, LO, HI, Tune_P >
Natural logarithm of multivector with specified complexifier.
auto complexifier(const Multivector< Scalar_T, LO, HI, Tune_P > &val) -> const Multivector< Scalar_T, LO, HI, Tune_P >
Square root of -1 which commutes with all members of the frame of the given multivector.
auto sinh(const Multivector< Scalar_T, LO, HI, Tune_P > &val) -> const Multivector< Scalar_T, LO, HI, Tune_P >
Hyperbolic sine of multivector.
auto approx_equal(const Multivector< Scalar_T, LO, HI, Tune_P > &lhs, const RHS< Scalar_T, LO, HI, Tune_P > &rhs, const Scalar_T threshold, const Scalar_T tolerance) -> bool
Test for approximate equality of multivectors.
A matrix_multi<Scalar_T,LO,HI,Tune_P> is a matrix approximation to a multivector. ...
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)].
auto asin(const Multivector< Scalar_T, LO, HI, Tune_P > &val, const Multivector< Scalar_T, LO, HI, Tune_P > &i, const bool prechecked=false) -> const Multivector< Scalar_T, LO, HI, Tune_P >
Inverse sine of multivector with specified complexifier.
auto tanh(const Multivector< Scalar_T, LO, HI, Tune_P > &val) -> const Multivector< Scalar_T, LO, HI, Tune_P >
Hyperbolic tangent of multivector.
auto error_squared_tol(const Multivector< Scalar_T, LO, HI, Tune_P > &val) -> Scalar_T
Quadratic norm error tolerance relative to a specific multivector.
auto abs(const Multivector< Scalar_T, LO, HI, Tune_P > &val) -> Scalar_T
Absolute value == sqrt(norm)
auto compare(const index_set< LO, HI > &a, const index_set< LO, HI > &b) -> int
"lexicographic compare" eg. {3,4,5} is less than {3,7,8}
auto operator &(const Multivector< Scalar_T, LO, HI, Tune_P > &lhs, const RHS< Scalar_T, LO, HI, Tune_P > &rhs) -> const Multivector< Scalar_T, LO, HI, Tune_P >
Inner product.
index_set< lo_ndx, hi_ndx > IndexSet
auto tan(const Multivector< Scalar_T, LO, HI, Tune_P > &val, const Multivector< Scalar_T, LO, HI, Tune_P > &i, const bool prechecked=false) -> const Multivector< Scalar_T, LO, HI, Tune_P >
Tangent of multivector with specified complexifier.
auto acosh(const Multivector< Scalar_T, LO, HI, Tune_P > &val, const Multivector< Scalar_T, LO, HI, Tune_P > &i, const bool prechecked=false) -> const Multivector< Scalar_T, LO, HI, Tune_P >
Inverse hyperbolic cosine of multivector with specified complexifier.
auto cos(const Multivector< Scalar_T, LO, HI, Tune_P > &val, const Multivector< Scalar_T, LO, HI, Tune_P > &i, const bool prechecked=false) -> const Multivector< Scalar_T, LO, HI, Tune_P >
Cosine of multivector with specified complexifier.
auto atan(const Multivector< Scalar_T, LO, HI, Tune_P > &val, const Multivector< Scalar_T, LO, HI, Tune_P > &i, const bool prechecked=false) -> const Multivector< Scalar_T, LO, HI, Tune_P >
Inverse tangent of multivector with specified complexifier.
PyObject * PyFloat_FromDouble(Scalar_T v)
auto sqrt(const Multivector< Scalar_T, LO, HI, Tune_P > &val, const Multivector< Scalar_T, LO, HI, Tune_P > &i, const bool prechecked=false) -> const Multivector< Scalar_T, LO, HI, Tune_P >
Square root of multivector with specified complexifier.
Index set class based on std::bitset<> in Gnu standard C++ library.
String index_set_to_str(const Index_Set_T &ist)
The "informal" string representation of Index_Set_T ist.
auto sin(const Multivector< Scalar_T, LO, HI, Tune_P > &val, const Multivector< Scalar_T, LO, HI, Tune_P > &i, const bool prechecked=false) -> const Multivector< Scalar_T, LO, HI, Tune_P >
Sine of multivector with specified complexifier.
auto cosh(const Multivector< Scalar_T, LO, HI, Tune_P > &val) -> const Multivector< Scalar_T, LO, HI, Tune_P >
Hyperbolic cosine of multivector.
auto max_abs(const Multivector< Scalar_T, LO, HI, Tune_P > &val) -> Scalar_T
Maximum of absolute values of components of multivector: multivector infinity norm.
matrix_multi< scalar_t, lo_ndx, hi_ndx, tuning_promoted > Clifford
auto acos(const Multivector< Scalar_T, LO, HI, Tune_P > &val, const Multivector< Scalar_T, LO, HI, Tune_P > &i, const bool prechecked=false) -> const Multivector< Scalar_T, LO, HI, Tune_P >
Inverse cosine of multivector with specified complexifier.
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)].