68 #define PY_SSIZE_T_CLEAN
71 #error Python headers needed to compile C extensions, please install development version of Python.
72 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
73 #error Cython requires Python 2.6+ or Python 3.3+.
75 #define CYTHON_ABI "0_29_21"
76 #define CYTHON_HEX_VERSION 0x001D15F0
77 #define CYTHON_FUTURE_DIVISION 1
80 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
82 #if !defined(WIN32) && !defined(MS_WINDOWS)
94 #define DL_IMPORT(t) t
97 #define DL_EXPORT(t) t
100 #ifndef HAVE_LONG_LONG
101 #if PY_VERSION_HEX >= 0x02070000
102 #define HAVE_LONG_LONG
106 #define PY_LONG_LONG LONG_LONG
109 #define Py_HUGE_VAL HUGE_VAL
112 #define CYTHON_COMPILING_IN_PYPY 1
113 #define CYTHON_COMPILING_IN_PYSTON 0
114 #define CYTHON_COMPILING_IN_CPYTHON 0
115 #undef CYTHON_USE_TYPE_SLOTS
116 #define CYTHON_USE_TYPE_SLOTS 0
117 #undef CYTHON_USE_PYTYPE_LOOKUP
118 #define CYTHON_USE_PYTYPE_LOOKUP 0
119 #if PY_VERSION_HEX < 0x03050000
120 #undef CYTHON_USE_ASYNC_SLOTS
121 #define CYTHON_USE_ASYNC_SLOTS 0
122 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
123 #define CYTHON_USE_ASYNC_SLOTS 1
125 #undef CYTHON_USE_PYLIST_INTERNALS
126 #define CYTHON_USE_PYLIST_INTERNALS 0
127 #undef CYTHON_USE_UNICODE_INTERNALS
128 #define CYTHON_USE_UNICODE_INTERNALS 0
129 #undef CYTHON_USE_UNICODE_WRITER
130 #define CYTHON_USE_UNICODE_WRITER 0
131 #undef CYTHON_USE_PYLONG_INTERNALS
132 #define CYTHON_USE_PYLONG_INTERNALS 0
133 #undef CYTHON_AVOID_BORROWED_REFS
134 #define CYTHON_AVOID_BORROWED_REFS 1
135 #undef CYTHON_ASSUME_SAFE_MACROS
136 #define CYTHON_ASSUME_SAFE_MACROS 0
137 #undef CYTHON_UNPACK_METHODS
138 #define CYTHON_UNPACK_METHODS 0
139 #undef CYTHON_FAST_THREAD_STATE
140 #define CYTHON_FAST_THREAD_STATE 0
141 #undef CYTHON_FAST_PYCALL
142 #define CYTHON_FAST_PYCALL 0
143 #undef CYTHON_PEP489_MULTI_PHASE_INIT
144 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
145 #undef CYTHON_USE_TP_FINALIZE
146 #define CYTHON_USE_TP_FINALIZE 0
147 #undef CYTHON_USE_DICT_VERSIONS
148 #define CYTHON_USE_DICT_VERSIONS 0
149 #undef CYTHON_USE_EXC_INFO_STACK
150 #define CYTHON_USE_EXC_INFO_STACK 0
151 #elif defined(PYSTON_VERSION)
152 #define CYTHON_COMPILING_IN_PYPY 0
153 #define CYTHON_COMPILING_IN_PYSTON 1
154 #define CYTHON_COMPILING_IN_CPYTHON 0
155 #ifndef CYTHON_USE_TYPE_SLOTS
156 #define CYTHON_USE_TYPE_SLOTS 1
158 #undef CYTHON_USE_PYTYPE_LOOKUP
159 #define CYTHON_USE_PYTYPE_LOOKUP 0
160 #undef CYTHON_USE_ASYNC_SLOTS
161 #define CYTHON_USE_ASYNC_SLOTS 0
162 #undef CYTHON_USE_PYLIST_INTERNALS
163 #define CYTHON_USE_PYLIST_INTERNALS 0
164 #ifndef CYTHON_USE_UNICODE_INTERNALS
165 #define CYTHON_USE_UNICODE_INTERNALS 1
167 #undef CYTHON_USE_UNICODE_WRITER
168 #define CYTHON_USE_UNICODE_WRITER 0
169 #undef CYTHON_USE_PYLONG_INTERNALS
170 #define CYTHON_USE_PYLONG_INTERNALS 0
171 #ifndef CYTHON_AVOID_BORROWED_REFS
172 #define CYTHON_AVOID_BORROWED_REFS 0
174 #ifndef CYTHON_ASSUME_SAFE_MACROS
175 #define CYTHON_ASSUME_SAFE_MACROS 1
177 #ifndef CYTHON_UNPACK_METHODS
178 #define CYTHON_UNPACK_METHODS 1
180 #undef CYTHON_FAST_THREAD_STATE
181 #define CYTHON_FAST_THREAD_STATE 0
182 #undef CYTHON_FAST_PYCALL
183 #define CYTHON_FAST_PYCALL 0
184 #undef CYTHON_PEP489_MULTI_PHASE_INIT
185 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
186 #undef CYTHON_USE_TP_FINALIZE
187 #define CYTHON_USE_TP_FINALIZE 0
188 #undef CYTHON_USE_DICT_VERSIONS
189 #define CYTHON_USE_DICT_VERSIONS 0
190 #undef CYTHON_USE_EXC_INFO_STACK
191 #define CYTHON_USE_EXC_INFO_STACK 0
193 #define CYTHON_COMPILING_IN_PYPY 0
194 #define CYTHON_COMPILING_IN_PYSTON 0
195 #define CYTHON_COMPILING_IN_CPYTHON 1
196 #ifndef CYTHON_USE_TYPE_SLOTS
197 #define CYTHON_USE_TYPE_SLOTS 1
199 #if PY_VERSION_HEX < 0x02070000
200 #undef CYTHON_USE_PYTYPE_LOOKUP
201 #define CYTHON_USE_PYTYPE_LOOKUP 0
202 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
203 #define CYTHON_USE_PYTYPE_LOOKUP 1
205 #if PY_MAJOR_VERSION < 3
206 #undef CYTHON_USE_ASYNC_SLOTS
207 #define CYTHON_USE_ASYNC_SLOTS 0
208 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
209 #define CYTHON_USE_ASYNC_SLOTS 1
211 #if PY_VERSION_HEX < 0x02070000
212 #undef CYTHON_USE_PYLONG_INTERNALS
213 #define CYTHON_USE_PYLONG_INTERNALS 0
214 #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
215 #define CYTHON_USE_PYLONG_INTERNALS 1
217 #ifndef CYTHON_USE_PYLIST_INTERNALS
218 #define CYTHON_USE_PYLIST_INTERNALS 1
220 #ifndef CYTHON_USE_UNICODE_INTERNALS
221 #define CYTHON_USE_UNICODE_INTERNALS 1
223 #if PY_VERSION_HEX < 0x030300F0
224 #undef CYTHON_USE_UNICODE_WRITER
225 #define CYTHON_USE_UNICODE_WRITER 0
226 #elif !defined(CYTHON_USE_UNICODE_WRITER)
227 #define CYTHON_USE_UNICODE_WRITER 1
229 #ifndef CYTHON_AVOID_BORROWED_REFS
230 #define CYTHON_AVOID_BORROWED_REFS 0
232 #ifndef CYTHON_ASSUME_SAFE_MACROS
233 #define CYTHON_ASSUME_SAFE_MACROS 1
235 #ifndef CYTHON_UNPACK_METHODS
236 #define CYTHON_UNPACK_METHODS 1
238 #ifndef CYTHON_FAST_THREAD_STATE
239 #define CYTHON_FAST_THREAD_STATE 1
241 #ifndef CYTHON_FAST_PYCALL
242 #define CYTHON_FAST_PYCALL 1
244 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
245 #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
247 #ifndef CYTHON_USE_TP_FINALIZE
248 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
250 #ifndef CYTHON_USE_DICT_VERSIONS
251 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
253 #ifndef CYTHON_USE_EXC_INFO_STACK
254 #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
257 #if !defined(CYTHON_FAST_PYCCALL)
258 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
260 #if CYTHON_USE_PYLONG_INTERNALS
261 #include "longintrepr.h"
266 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P ==
sizeof(
void*)) };
269 #ifndef __has_attribute
270 #define __has_attribute(x) 0
272 #ifndef __has_cpp_attribute
273 #define __has_cpp_attribute(x) 0
275 #ifndef CYTHON_RESTRICT
276 #if defined(__GNUC__)
277 #define CYTHON_RESTRICT __restrict__
278 #elif defined(_MSC_VER) && _MSC_VER >= 1400
279 #define CYTHON_RESTRICT __restrict
280 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
281 #define CYTHON_RESTRICT restrict
283 #define CYTHON_RESTRICT
286 #ifndef CYTHON_UNUSED
287 # if defined(__GNUC__)
288 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
289 # define CYTHON_UNUSED __attribute__ ((__unused__))
291 # define CYTHON_UNUSED
293 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
294 # define CYTHON_UNUSED __attribute__ ((__unused__))
296 # define CYTHON_UNUSED
299 #ifndef CYTHON_MAYBE_UNUSED_VAR
300 # if defined(__cplusplus)
301 template<
class T>
void CYTHON_MAYBE_UNUSED_VAR(
const T& ) { }
303 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
306 #ifndef CYTHON_NCP_UNUSED
307 # if CYTHON_COMPILING_IN_CPYTHON
308 # define CYTHON_NCP_UNUSED
310 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
313 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
315 #ifndef _MSC_STDINT_H_
317 typedef unsigned char uint8_t;
318 typedef unsigned int uint32_t;
320 typedef unsigned __int8 uint8_t;
321 typedef unsigned __int32 uint32_t;
327 #ifndef CYTHON_FALLTHROUGH
328 #if defined(__cplusplus) && __cplusplus >= 201103L
329 #if __has_cpp_attribute(fallthrough)
330 #define CYTHON_FALLTHROUGH [[fallthrough]]
331 #elif __has_cpp_attribute(clang::fallthrough)
332 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
333 #elif __has_cpp_attribute(gnu::fallthrough)
334 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
337 #ifndef CYTHON_FALLTHROUGH
338 #if __has_attribute(fallthrough)
339 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
341 #define CYTHON_FALLTHROUGH
344 #if defined(__clang__ ) && defined(__apple_build_version__)
345 #if __apple_build_version__ < 7000000
346 #undef CYTHON_FALLTHROUGH
347 #define CYTHON_FALLTHROUGH
353 #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
355 #ifndef CYTHON_INLINE
356 #if defined(__clang__)
357 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
359 #define CYTHON_INLINE inline
363 void __Pyx_call_destructor(T& x) {
367 class __Pyx_FakeReference {
369 __Pyx_FakeReference() : ptr(NULL) { }
370 __Pyx_FakeReference(
const T& ref) : ptr(const_cast<T*>(&ref)) { }
371 T *operator->() {
return ptr; }
373 operator T&() {
return *ptr; }
374 template<
typename U>
bool operator ==(U other) {
return *ptr == other; }
375 template<
typename U>
bool operator !=(U other) {
return *ptr != other; }
380 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
381 #define Py_OptimizeFlag 0
383 #define __PYX_BUILD_PY_SSIZE_T "n"
384 #define CYTHON_FORMAT_SSIZE_T "z"
385 #if PY_MAJOR_VERSION < 3
386 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
387 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
388 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
389 #define __Pyx_DefaultClassType PyClass_Type
391 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
392 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
393 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
394 PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
396 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
397 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
399 #define __Pyx_DefaultClassType PyType_Type
401 #ifndef Py_TPFLAGS_CHECKTYPES
402 #define Py_TPFLAGS_CHECKTYPES 0
404 #ifndef Py_TPFLAGS_HAVE_INDEX
405 #define Py_TPFLAGS_HAVE_INDEX 0
407 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
408 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
410 #ifndef Py_TPFLAGS_HAVE_FINALIZE
411 #define Py_TPFLAGS_HAVE_FINALIZE 0
413 #ifndef METH_STACKLESS
414 #define METH_STACKLESS 0
416 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
417 #ifndef METH_FASTCALL
418 #define METH_FASTCALL 0x80
420 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *
self, PyObject *
const *args, Py_ssize_t nargs);
421 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *
self, PyObject *
const *args,
422 Py_ssize_t nargs, PyObject *kwnames);
424 #define __Pyx_PyCFunctionFast _PyCFunctionFast
425 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
427 #if CYTHON_FAST_PYCCALL
428 #define __Pyx_PyFastCFunction_Check(func)\
429 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
431 #define __Pyx_PyFastCFunction_Check(func) 0
433 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
434 #define PyObject_Malloc(s) PyMem_Malloc(s)
435 #define PyObject_Free(p) PyMem_Free(p)
436 #define PyObject_Realloc(p) PyMem_Realloc(p)
438 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
439 #define PyMem_RawMalloc(n) PyMem_Malloc(n)
440 #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
441 #define PyMem_RawFree(p) PyMem_Free(p)
443 #if CYTHON_COMPILING_IN_PYSTON
444 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
445 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
447 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
448 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
450 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
451 #define __Pyx_PyThreadState_Current PyThreadState_GET()
452 #elif PY_VERSION_HEX >= 0x03060000
453 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
454 #elif PY_VERSION_HEX >= 0x03000000
455 #define __Pyx_PyThreadState_Current PyThreadState_GET()
457 #define __Pyx_PyThreadState_Current _PyThreadState_Current
459 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
460 #include "pythread.h"
461 #define Py_tss_NEEDS_INIT 0
462 typedef int Py_tss_t;
463 static CYTHON_INLINE
int PyThread_tss_create(Py_tss_t *key) {
464 *key = PyThread_create_key();
467 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(
void) {
468 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(
sizeof(Py_tss_t));
469 *key = Py_tss_NEEDS_INIT;
472 static CYTHON_INLINE
void PyThread_tss_free(Py_tss_t *key) {
475 static CYTHON_INLINE
int PyThread_tss_is_created(Py_tss_t *key) {
476 return *key != Py_tss_NEEDS_INIT;
478 static CYTHON_INLINE
void PyThread_tss_delete(Py_tss_t *key) {
479 PyThread_delete_key(*key);
480 *key = Py_tss_NEEDS_INIT;
482 static CYTHON_INLINE
int PyThread_tss_set(Py_tss_t *key,
void *value) {
483 return PyThread_set_key_value(*key, value);
485 static CYTHON_INLINE
void * PyThread_tss_get(Py_tss_t *key) {
486 return PyThread_get_key_value(*key);
489 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
490 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
492 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
494 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
495 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
496 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
498 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
499 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
501 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
502 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
504 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
506 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
507 #define CYTHON_PEP393_ENABLED 1
508 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
509 0 : _PyUnicode_Ready((PyObject *)(op)))
510 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
511 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
512 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
513 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
514 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
515 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
516 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
517 #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
518 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
520 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
523 #define CYTHON_PEP393_ENABLED 0
524 #define PyUnicode_1BYTE_KIND 1
525 #define PyUnicode_2BYTE_KIND 2
526 #define PyUnicode_4BYTE_KIND 4
527 #define __Pyx_PyUnicode_READY(op) (0)
528 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
529 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
530 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
531 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
532 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
533 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
534 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
535 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
537 #if CYTHON_COMPILING_IN_PYPY
538 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
539 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
541 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
542 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
543 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
545 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
546 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
548 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
549 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
551 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
552 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
554 #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))
555 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
556 #if PY_MAJOR_VERSION >= 3
557 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
559 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
561 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
562 #define PyObject_ASCII(o) PyObject_Repr(o)
564 #if PY_MAJOR_VERSION >= 3
565 #define PyBaseString_Type PyUnicode_Type
566 #define PyStringObject PyUnicodeObject
567 #define PyString_Type PyUnicode_Type
568 #define PyString_Check PyUnicode_Check
569 #define PyString_CheckExact PyUnicode_CheckExact
570 #ifndef PyObject_Unicode
571 #define PyObject_Unicode PyObject_Str
574 #if PY_MAJOR_VERSION >= 3
575 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
576 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
578 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
579 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
581 #ifndef PySet_CheckExact
582 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
584 #if PY_VERSION_HEX >= 0x030900A4
585 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
586 #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
588 #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
589 #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
591 #if CYTHON_ASSUME_SAFE_MACROS
592 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
594 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
596 #if PY_MAJOR_VERSION >= 3
597 #define PyIntObject PyLongObject
598 #define PyInt_Type PyLong_Type
599 #define PyInt_Check(op) PyLong_Check(op)
600 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
601 #define PyInt_FromString PyLong_FromString
602 #define PyInt_FromUnicode PyLong_FromUnicode
603 #define PyInt_FromLong PyLong_FromLong
604 #define PyInt_FromSize_t PyLong_FromSize_t
605 #define PyInt_FromSsize_t PyLong_FromSsize_t
606 #define PyInt_AsLong PyLong_AsLong
607 #define PyInt_AS_LONG PyLong_AS_LONG
608 #define PyInt_AsSsize_t PyLong_AsSsize_t
609 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
610 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
611 #define PyNumber_Int PyNumber_Long
613 #if PY_MAJOR_VERSION >= 3
614 #define PyBoolObject PyLongObject
616 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
617 #ifndef PyUnicode_InternFromString
618 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
621 #if PY_VERSION_HEX < 0x030200A4
622 typedef long Py_hash_t;
623 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
624 #define __Pyx_PyInt_AsHash_t PyInt_AsLong
626 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
627 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
629 #if PY_MAJOR_VERSION >= 3
630 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
632 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
634 #if CYTHON_USE_ASYNC_SLOTS
635 #if PY_VERSION_HEX >= 0x030500B1
636 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
637 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
639 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
642 #define __Pyx_PyType_AsAsync(obj) NULL
644 #ifndef __Pyx_PyAsyncMethodsStruct
649 } __Pyx_PyAsyncMethodsStruct;
652 #if defined(WIN32) || defined(MS_WINDOWS)
653 #define _USE_MATH_DEFINES
657 #define __PYX_NAN() ((float) NAN)
659 static CYTHON_INLINE
float __PYX_NAN() {
661 memset(&value, 0xFF,
sizeof(value));
665 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
666 #define __Pyx_truncl trunc
668 #define __Pyx_truncl truncl
671 #define __PYX_MARK_ERR_POS(f_index, lineno) \
672 { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
673 #define __PYX_ERR(f_index, lineno, Ln_error) \
674 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
676 #ifndef __PYX_EXTERN_C
678 #define __PYX_EXTERN_C extern "C"
680 #define __PYX_EXTERN_C extern
684 #define __PYX_HAVE__PyClical
685 #define __PYX_HAVE_API__PyClical
699 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
700 #define CYTHON_WITHOUT_ASSERTIONS
703 typedef struct {PyObject **p;
const char *s;
const Py_ssize_t n;
const char* encoding;
704 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
706 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
707 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
708 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
709 #define __PYX_DEFAULT_STRING_ENCODING ""
710 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
711 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
712 #define __Pyx_uchar_cast(c) ((unsigned char)c)
713 #define __Pyx_long_cast(x) ((long)x)
714 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
715 (sizeof(type) < sizeof(Py_ssize_t)) ||\
716 (sizeof(type) > sizeof(Py_ssize_t) &&\
717 likely(v < (type)PY_SSIZE_T_MAX ||\
718 v == (type)PY_SSIZE_T_MAX) &&\
719 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
720 v == (type)PY_SSIZE_T_MIN))) ||\
721 (sizeof(type) == sizeof(Py_ssize_t) &&\
722 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
723 v == (type)PY_SSIZE_T_MAX))) )
724 static CYTHON_INLINE
int __Pyx_is_valid_index(Py_ssize_t
i, Py_ssize_t limit) {
725 return (
size_t)
i < (size_t) limit;
727 #if defined (__cplusplus) && __cplusplus >= 201103L
729 #define __Pyx_sst_abs(value) std::abs(value)
730 #elif SIZEOF_INT >= SIZEOF_SIZE_T
731 #define __Pyx_sst_abs(value) abs(value)
732 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
733 #define __Pyx_sst_abs(value) labs(value)
734 #elif defined (_MSC_VER)
735 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
736 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
737 #define __Pyx_sst_abs(value) llabs(value)
738 #elif defined (__GNUC__)
739 #define __Pyx_sst_abs(value) __builtin_llabs(value)
741 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
743 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
744 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
745 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
746 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
747 #define __Pyx_PyBytes_FromString PyBytes_FromString
748 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
749 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
750 #if PY_MAJOR_VERSION < 3
751 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
752 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
754 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
755 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
757 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
758 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
759 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
760 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
761 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
762 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
763 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
764 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
765 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
766 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
767 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
768 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
769 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
770 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
771 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
772 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
773 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *u) {
774 const Py_UNICODE *u_end = u;
776 return (
size_t)(u_end - u - 1);
778 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
779 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
780 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
781 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
782 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
783 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
784 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
785 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
786 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
787 #define __Pyx_PySequence_Tuple(obj)\
788 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
789 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
790 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
791 #if CYTHON_ASSUME_SAFE_MACROS
792 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
794 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
796 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
797 #if PY_MAJOR_VERSION >= 3
798 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
800 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
802 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
803 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
804 static int __Pyx_sys_getdefaultencoding_not_ascii;
805 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
807 PyObject* default_encoding = NULL;
808 PyObject* ascii_chars_u = NULL;
809 PyObject* ascii_chars_b = NULL;
810 const char* default_encoding_c;
811 sys = PyImport_ImportModule(
"sys");
813 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
815 if (!default_encoding)
goto bad;
816 default_encoding_c = PyBytes_AsString(default_encoding);
817 if (!default_encoding_c)
goto bad;
818 if (strcmp(default_encoding_c,
"ascii") == 0) {
819 __Pyx_sys_getdefaultencoding_not_ascii = 0;
821 char ascii_chars[128];
823 for (c = 0; c < 128; c++) {
826 __Pyx_sys_getdefaultencoding_not_ascii = 1;
827 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
828 if (!ascii_chars_u)
goto bad;
829 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
830 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
833 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
837 Py_DECREF(ascii_chars_u);
838 Py_DECREF(ascii_chars_b);
840 Py_DECREF(default_encoding);
843 Py_XDECREF(default_encoding);
844 Py_XDECREF(ascii_chars_u);
845 Py_XDECREF(ascii_chars_b);
849 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
850 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
852 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
853 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
854 static char* __PYX_DEFAULT_STRING_ENCODING;
855 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
857 PyObject* default_encoding = NULL;
858 char* default_encoding_c;
859 sys = PyImport_ImportModule(
"sys");
861 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
863 if (!default_encoding)
goto bad;
864 default_encoding_c = PyBytes_AsString(default_encoding);
865 if (!default_encoding_c)
goto bad;
866 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c) + 1);
867 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
868 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
869 Py_DECREF(default_encoding);
872 Py_XDECREF(default_encoding);
880 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
881 #define likely(x) __builtin_expect(!!(x), 1)
882 #define unlikely(x) __builtin_expect(!!(x), 0)
884 #define likely(x) (x)
885 #define unlikely(x) (x)
887 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
889 static PyObject *__pyx_m = NULL;
890 static PyObject *__pyx_d;
891 static PyObject *__pyx_b;
892 static PyObject *__pyx_cython_runtime = NULL;
893 static PyObject *__pyx_empty_tuple;
894 static PyObject *__pyx_empty_bytes;
895 static PyObject *__pyx_empty_unicode;
896 static int __pyx_lineno;
897 static int __pyx_clineno = 0;
898 static const char * __pyx_cfilenm= __FILE__;
899 static const char *__pyx_filename;
902 static const char *__pyx_f[] = {
908 struct __pyx_obj_8PyClical_index_set;
909 struct __pyx_obj_8PyClical_clifford;
910 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__;
911 struct __pyx_opt_args_8PyClical_sqrt;
912 struct __pyx_opt_args_8PyClical_log;
913 struct __pyx_opt_args_8PyClical_cos;
914 struct __pyx_opt_args_8PyClical_acos;
915 struct __pyx_opt_args_8PyClical_acosh;
916 struct __pyx_opt_args_8PyClical_sin;
917 struct __pyx_opt_args_8PyClical_asin;
918 struct __pyx_opt_args_8PyClical_asinh;
919 struct __pyx_opt_args_8PyClical_tan;
920 struct __pyx_opt_args_8PyClical_atan;
921 struct __pyx_opt_args_8PyClical_atanh;
922 struct __pyx_opt_args_8PyClical_random_clifford;
931 struct __pyx_opt_args_8PyClical_sqrt {
943 struct __pyx_opt_args_8PyClical_log {
955 struct __pyx_opt_args_8PyClical_cos {
967 struct __pyx_opt_args_8PyClical_acos {
979 struct __pyx_opt_args_8PyClical_acosh {
991 struct __pyx_opt_args_8PyClical_sin {
1003 struct __pyx_opt_args_8PyClical_asin {
1015 struct __pyx_opt_args_8PyClical_asinh {
1027 struct __pyx_opt_args_8PyClical_tan {
1039 struct __pyx_opt_args_8PyClical_atan {
1051 struct __pyx_opt_args_8PyClical_atanh {
1063 struct __pyx_opt_args_8PyClical_random_clifford {
1075 struct __pyx_obj_8PyClical_index_set {
1077 struct __pyx_vtabstruct_8PyClical_index_set *__pyx_vtab;
1089 struct __pyx_obj_8PyClical_clifford {
1091 struct __pyx_vtabstruct_8PyClical_clifford *__pyx_vtab;
1103 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ {
1105 PyObject *__pyx_v_idx;
1106 struct __pyx_obj_8PyClical_index_set *__pyx_v_self;
1107 PyObject *__pyx_t_0;
1108 Py_ssize_t __pyx_t_1;
1109 PyObject *(*__pyx_t_2)(PyObject *);
1122 struct __pyx_vtabstruct_8PyClical_index_set {
1123 PyObject *(*wrap)(
struct __pyx_obj_8PyClical_index_set *,
IndexSet);
1124 IndexSet (*unwrap)(
struct __pyx_obj_8PyClical_index_set *);
1125 PyObject *(*copy)(
struct __pyx_obj_8PyClical_index_set *,
int __pyx_skip_dispatch);
1127 static struct __pyx_vtabstruct_8PyClical_index_set *__pyx_vtabptr_8PyClical_index_set;
1128 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_9index_set_wrap(
struct __pyx_obj_8PyClical_index_set *,
IndexSet);
1129 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_9index_set_unwrap(
struct __pyx_obj_8PyClical_index_set *);
1140 struct __pyx_vtabstruct_8PyClical_clifford {
1141 PyObject *(*wrap)(
struct __pyx_obj_8PyClical_clifford *,
Clifford);
1142 Clifford (*unwrap)(
struct __pyx_obj_8PyClical_clifford *);
1143 PyObject *(*copy)(
struct __pyx_obj_8PyClical_clifford *,
int __pyx_skip_dispatch);
1145 static struct __pyx_vtabstruct_8PyClical_clifford *__pyx_vtabptr_8PyClical_clifford;
1146 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_8clifford_wrap(
struct __pyx_obj_8PyClical_clifford *,
Clifford);
1147 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_8clifford_unwrap(
struct __pyx_obj_8PyClical_clifford *);
1151 #ifndef CYTHON_REFNANNY
1152 #define CYTHON_REFNANNY 0
1156 void (*INCREF)(
void*, PyObject*, int);
1157 void (*DECREF)(
void*, PyObject*, int);
1158 void (*GOTREF)(
void*, PyObject*, int);
1159 void (*GIVEREF)(
void*, PyObject*, int);
1160 void* (*SetupContext)(
const char*, int,
const char*);
1161 void (*FinishContext)(
void**);
1162 } __Pyx_RefNannyAPIStruct;
1163 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1164 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1165 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1167 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1169 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1170 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1171 PyGILState_Release(__pyx_gilstate_save);\
1173 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1176 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1177 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1179 #define __Pyx_RefNannyFinishContext()\
1180 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1181 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1182 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1183 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1184 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1185 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1186 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1187 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1188 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1190 #define __Pyx_RefNannyDeclarations
1191 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1192 #define __Pyx_RefNannyFinishContext()
1193 #define __Pyx_INCREF(r) Py_INCREF(r)
1194 #define __Pyx_DECREF(r) Py_DECREF(r)
1195 #define __Pyx_GOTREF(r)
1196 #define __Pyx_GIVEREF(r)
1197 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1198 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1199 #define __Pyx_XGOTREF(r)
1200 #define __Pyx_XGIVEREF(r)
1202 #define __Pyx_XDECREF_SET(r, v) do {\
1203 PyObject *tmp = (PyObject *) r;\
1204 r = v; __Pyx_XDECREF(tmp);\
1206 #define __Pyx_DECREF_SET(r, v) do {\
1207 PyObject *tmp = (PyObject *) r;\
1208 r = v; __Pyx_DECREF(tmp);\
1210 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1211 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1214 #if CYTHON_USE_TYPE_SLOTS
1215 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject*
obj, PyObject* attr_name);
1217 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1221 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1224 #if CYTHON_FAST_PYCCALL
1225 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1227 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1231 #if CYTHON_FAST_PYCALL
1232 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1233 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1234 #if 1 || PY_VERSION_HEX < 0x030600B1
1235 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1237 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1239 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1240 (sizeof(char [1 - 2*!(cond)]) - 1)
1241 #ifndef Py_MEMBER_SIZE
1242 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1244 static size_t __pyx_pyframe_localsplus_offset = 0;
1245 #include "frameobject.h"
1246 #define __Pxy_PyFrame_Initialize_Offsets()\
1247 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1248 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1249 #define __Pyx_PyFrame_GetLocalsplus(frame)\
1250 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1254 #if CYTHON_COMPILING_IN_CPYTHON
1255 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1257 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1261 #if CYTHON_COMPILING_IN_CPYTHON
1262 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1266 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1269 #if CYTHON_FAST_THREAD_STATE
1270 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1271 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1272 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1274 #define __Pyx_PyThreadState_declare
1275 #define __Pyx_PyThreadState_assign
1276 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1280 #if CYTHON_FAST_THREAD_STATE
1281 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1282 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1283 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1284 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1285 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1286 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1287 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1288 #if CYTHON_COMPILING_IN_CPYTHON
1289 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1291 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1294 #define __Pyx_PyErr_Clear() PyErr_Clear()
1295 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1296 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1297 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1298 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1299 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1300 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1301 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1305 static void __Pyx_WriteUnraisable(
const char *name,
int clineno,
1306 int lineno,
const char *filename,
1307 int full_traceback,
int nogil);
1310 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1311 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1312 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1313 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1314 (version_var) = __PYX_GET_DICT_VERSION(dict);\
1315 (cache_var) = (value);
1316 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1317 static PY_UINT64_T __pyx_dict_version = 0;\
1318 static PyObject *__pyx_dict_cached_value = NULL;\
1319 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1320 (VAR) = __pyx_dict_cached_value;\
1322 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1323 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1326 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *
obj);
1327 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *
obj);
1328 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject*
obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1330 #define __PYX_GET_DICT_VERSION(dict) (0)
1331 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1332 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1336 #if CYTHON_COMPILING_IN_CPYTHON
1337 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1339 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1343 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
1346 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1347 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1348 const char* function_name);
1351 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1352 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1355 #if CYTHON_USE_DICT_VERSIONS
1356 #define __Pyx_GetModuleGlobalName(var, name) {\
1357 static PY_UINT64_T __pyx_dict_version = 0;\
1358 static PyObject *__pyx_dict_cached_value = NULL;\
1359 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1360 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1361 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1363 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1364 PY_UINT64_T __pyx_dict_version;\
1365 PyObject *__pyx_dict_cached_value;\
1366 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1368 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1370 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1371 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1372 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1376 #if CYTHON_USE_EXC_INFO_STACK
1377 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1381 #if CYTHON_FAST_THREAD_STATE
1382 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1383 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1384 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1385 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1387 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1388 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1392 #if CYTHON_FAST_THREAD_STATE
1393 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1394 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1396 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1400 #if CYTHON_FAST_THREAD_STATE
1401 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1402 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1404 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1408 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1411 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2);
1414 #if !CYTHON_COMPILING_IN_PYPY
1415 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2,
long intval,
int inplace,
int zerodivision_check);
1417 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
1418 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1422 static CYTHON_INLINE
int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq,
int eq) {
1423 int result = PySequence_Contains(seq, item);
1424 return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
1431 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(
const char *s, Py_ssize_t size,
const char *errors) {
1433 return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1435 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(
const char *s, Py_ssize_t size,
const char *errors) {
1437 return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1439 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(
const char *s, Py_ssize_t size,
const char *errors) {
1441 return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1445 static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
1446 const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop,
1447 const char* encoding,
const char* errors,
1448 PyObject* (*decode_func)(
const char *s, Py_ssize_t size,
const char *errors));
1451 static CYTHON_INLINE PyObject* __Pyx_decode_cpp_string(
1452 std::string cppstring, Py_ssize_t start, Py_ssize_t stop,
1453 const char* encoding,
const char* errors,
1454 PyObject* (*decode_func)(
const char *s, Py_ssize_t size,
const char *errors)) {
1455 return __Pyx_decode_c_bytes(
1456 cppstring.data(), cppstring.size(), start, stop, encoding, errors, decode_func);
1460 #if CYTHON_FAST_THREAD_STATE
1461 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
1462 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1464 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
1468 #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1469 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1470 __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\
1471 (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
1472 __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
1473 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
1474 static CYTHON_INLINE
int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t
i, PyObject *v,
1475 int is_list,
int wraparound,
int boundscheck);
1478 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1479 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1480 __Pyx__ArgTypeTest(obj, type, name, exact))
1481 static int __Pyx__ArgTypeTest(PyObject *
obj, PyTypeObject *type,
const char *name,
int exact);
1484 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
1490 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1491 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject*
obj, PyObject* attr_name);
1493 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1497 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1498 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject*
obj, PyObject* attr_name);
1500 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1504 static int __Pyx_SetVtable(PyObject *dict,
void *vtable);
1507 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject*
obj, PyObject* attr_name);
1510 static int __Pyx_setup_reduce(PyObject* type_obj);
1513 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals);
1516 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals);
1519 #ifdef CYTHON_CLINE_IN_TRACEBACK
1520 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1522 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
1527 PyCodeObject* code_object;
1529 } __Pyx_CodeObjectCacheEntry;
1530 struct __Pyx_CodeObjectCache {
1533 __Pyx_CodeObjectCacheEntry* entries;
1535 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1536 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
1537 static PyCodeObject *__pyx_find_code_object(
int code_line);
1538 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
1541 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
1542 int py_line,
const char *filename);
1545 #ifndef __Pyx_CppExn2PyErr
1548 #include <stdexcept>
1550 static void __Pyx_CppExn2PyErr() {
1552 if (PyErr_Occurred())
1556 }
catch (
const std::bad_alloc& exn) {
1557 PyErr_SetString(PyExc_MemoryError, exn.what());
1558 }
catch (
const std::bad_cast& exn) {
1559 PyErr_SetString(PyExc_TypeError, exn.what());
1560 }
catch (
const std::bad_typeid& exn) {
1561 PyErr_SetString(PyExc_TypeError, exn.what());
1562 }
catch (
const std::domain_error& exn) {
1563 PyErr_SetString(PyExc_ValueError, exn.what());
1564 }
catch (
const std::invalid_argument& exn) {
1565 PyErr_SetString(PyExc_ValueError, exn.what());
1566 }
catch (
const std::ios_base::failure& exn) {
1567 PyErr_SetString(PyExc_IOError, exn.what());
1568 }
catch (
const std::out_of_range& exn) {
1569 PyErr_SetString(PyExc_IndexError, exn.what());
1570 }
catch (
const std::overflow_error& exn) {
1571 PyErr_SetString(PyExc_OverflowError, exn.what());
1572 }
catch (
const std::range_error& exn) {
1573 PyErr_SetString(PyExc_ArithmeticError, exn.what());
1574 }
catch (
const std::underflow_error& exn) {
1575 PyErr_SetString(PyExc_ArithmeticError, exn.what());
1576 }
catch (
const std::exception& exn) {
1577 PyErr_SetString(PyExc_RuntimeError, exn.what());
1581 PyErr_SetString(PyExc_RuntimeError,
"Unknown exception");
1587 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
1590 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
1593 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
1596 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
1599 #if CYTHON_COMPILING_IN_CPYTHON
1600 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1601 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1602 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1603 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1605 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1606 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1607 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1609 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1612 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
1615 static int __Pyx_PyObject_GetMethod(PyObject *
obj, PyObject *name, PyObject **method);
1618 static PyObject* __Pyx_PyObject_CallMethod1(PyObject*
obj, PyObject* method_name, PyObject* arg);
1621 typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyThreadState *, PyObject *);
1622 #if CYTHON_USE_EXC_INFO_STACK
1623 #define __Pyx_ExcInfoStruct _PyErr_StackItem
1627 PyObject *exc_value;
1628 PyObject *exc_traceback;
1629 } __Pyx_ExcInfoStruct;
1633 __pyx_coroutine_body_t body;
1635 __Pyx_ExcInfoStruct gi_exc_state;
1636 PyObject *gi_weakreflist;
1638 PyObject *yieldfrom;
1640 PyObject *gi_qualname;
1641 PyObject *gi_modulename;
1645 } __pyx_CoroutineObject;
1646 static __pyx_CoroutineObject *__Pyx__Coroutine_New(
1647 PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
1648 PyObject *name, PyObject *qualname, PyObject *module_name);
1649 static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
1650 __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
1651 PyObject *name, PyObject *qualname, PyObject *module_name);
1652 static CYTHON_INLINE
void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *
self);
1653 static int __Pyx_Coroutine_clear(PyObject *
self);
1654 static PyObject *__Pyx_Coroutine_Send(PyObject *
self, PyObject *value);
1655 static PyObject *__Pyx_Coroutine_Close(PyObject *
self);
1656 static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
1657 #if CYTHON_USE_EXC_INFO_STACK
1658 #define __Pyx_Coroutine_SwapException(self)
1659 #define __Pyx_Coroutine_ResetAndClearException(self) __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state)
1661 #define __Pyx_Coroutine_SwapException(self) {\
1662 __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\
1663 __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\
1665 #define __Pyx_Coroutine_ResetAndClearException(self) {\
1666 __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\
1667 (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\
1670 #if CYTHON_FAST_THREAD_STATE
1671 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
1672 __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue)
1674 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
1675 __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue)
1677 static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue);
1678 static CYTHON_INLINE
void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state);
1681 static PyObject* __Pyx_Coroutine_patch_module(PyObject* module,
const char* py_code);
1684 static int __Pyx_patch_abc(
void);
1687 #define __Pyx_Generator_USED
1688 static PyTypeObject *__pyx_GeneratorType = 0;
1689 #define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType)
1690 #define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\
1691 __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name)
1692 static PyObject *__Pyx_Generator_Next(PyObject *
self);
1693 static int __pyx_Generator_init(
void);
1696 static int __Pyx_check_binary_version(
void);
1699 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1701 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_9index_set_wrap(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self,
IndexSet __pyx_v_other);
1702 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_9index_set_unwrap(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
1703 static PyObject *__pyx_f_8PyClical_9index_set_copy(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self,
int __pyx_skip_dispatch);
1704 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_8clifford_wrap(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self,
Clifford __pyx_v_other);
1705 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_8clifford_unwrap(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
1706 static PyObject *__pyx_f_8PyClical_8clifford_copy(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self,
int __pyx_skip_dispatch);
1717 static PyTypeObject *__pyx_ptype_8PyClical_index_set = 0;
1718 static PyTypeObject *__pyx_ptype_8PyClical_clifford = 0;
1719 static PyTypeObject *__pyx_ptype_8PyClical___pyx_scope_struct____iter__ = 0;
1720 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_toIndexSet(PyObject *);
1721 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_compare(PyObject *, PyObject *,
int __pyx_skip_dispatch);
1722 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_min_neg(PyObject *,
int __pyx_skip_dispatch);
1723 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_max_pos(PyObject *,
int __pyx_skip_dispatch);
1724 static CYTHON_INLINE std::vector<scalar_t> __pyx_f_8PyClical_list_to_vector(PyObject *);
1725 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_toClifford(PyObject *);
1726 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_inv(PyObject *,
int __pyx_skip_dispatch);
1727 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_scalar(PyObject *,
int __pyx_skip_dispatch);
1728 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_real(PyObject *,
int __pyx_skip_dispatch);
1729 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_imag(PyObject *,
int __pyx_skip_dispatch);
1730 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_pure(PyObject *,
int __pyx_skip_dispatch);
1731 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_even(PyObject *,
int __pyx_skip_dispatch);
1732 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_odd(PyObject *,
int __pyx_skip_dispatch);
1733 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_involute(PyObject *,
int __pyx_skip_dispatch);
1734 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_reverse(PyObject *,
int __pyx_skip_dispatch);
1735 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_conj(PyObject *,
int __pyx_skip_dispatch);
1736 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_quad(PyObject *,
int __pyx_skip_dispatch);
1737 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_norm(PyObject *,
int __pyx_skip_dispatch);
1738 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_abs(PyObject *,
int __pyx_skip_dispatch);
1739 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_max_abs(PyObject *,
int __pyx_skip_dispatch);
1740 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_pow(PyObject *, PyObject *,
int __pyx_skip_dispatch);
1741 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_outer_pow(PyObject *, PyObject *,
int __pyx_skip_dispatch);
1742 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_complexifier(PyObject *,
int __pyx_skip_dispatch);
1743 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_sqrt(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_sqrt *__pyx_optional_args);
1744 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_exp(PyObject *,
int __pyx_skip_dispatch);
1745 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_log(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_log *__pyx_optional_args);
1746 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cos(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_cos *__pyx_optional_args);
1747 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_acos(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_acos *__pyx_optional_args);
1748 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cosh(PyObject *,
int __pyx_skip_dispatch);
1749 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_acosh(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_acosh *__pyx_optional_args);
1750 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_sin(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_sin *__pyx_optional_args);
1751 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_asin(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_asin *__pyx_optional_args);
1752 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_sinh(PyObject *,
int __pyx_skip_dispatch);
1753 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_asinh(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_asinh *__pyx_optional_args);
1754 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_tan(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_tan *__pyx_optional_args);
1755 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_atan(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_atan *__pyx_optional_args);
1756 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_tanh(PyObject *,
int __pyx_skip_dispatch);
1757 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_atanh(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_atanh *__pyx_optional_args);
1758 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);
1759 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cga3(PyObject *,
int __pyx_skip_dispatch);
1760 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cga3std(PyObject *,
int __pyx_skip_dispatch);
1761 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_agc3(PyObject *,
int __pyx_skip_dispatch);
1762 static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_string(std::string
const &);
1763 static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_string(std::string
const &);
1764 static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(std::string
const &);
1765 static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string(std::string
const &);
1766 static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_string(std::string
const &);
1767 #define __Pyx_MODULE_NAME "PyClical"
1768 extern int __pyx_module_is_main_PyClical;
1769 int __pyx_module_is_main_PyClical = 0;
1772 static PyObject *__pyx_builtin_IndexError;
1773 static PyObject *__pyx_builtin_RuntimeError;
1774 static PyObject *__pyx_builtin_TypeError;
1775 static PyObject *__pyx_builtin_ValueError;
1776 static PyObject *__pyx_builtin_NotImplemented;
1777 static PyObject *__pyx_builtin_range;
1778 static PyObject *__pyx_builtin_xrange;
1779 static const char __pyx_k_[] =
".";
1780 static const char __pyx_k_e[] =
"e";
1781 static const char __pyx_k_i[] =
"i";
1782 static const char __pyx_k_m[] =
"m";
1783 static const char __pyx_k_p[] =
"p";
1784 static const char __pyx_k_q[] =
"q";
1785 static const char __pyx_k__2[] =
" ";
1786 static const char __pyx_k__5[] =
":";
1787 static const char __pyx_k__6[] =
"\n\t";
1788 static const char __pyx_k__7[] =
" (";
1789 static const char __pyx_k__8[] =
", ";
1790 static const char __pyx_k__9[] =
").";
1791 static const char __pyx_k_cl[] =
"cl";
1792 static const char __pyx_k_pi[] =
"pi";
1793 static const char __pyx_k_abc[] =
"abc";
1794 static const char __pyx_k_cos[] =
"cos";
1795 static const char __pyx_k_exp[] =
"exp";
1796 static const char __pyx_k_frm[] =
"frm";
1797 static const char __pyx_k_inv[] =
"inv";
1798 static const char __pyx_k_ist[] =
"ist";
1799 static const char __pyx_k_ixt[] =
"ixt";
1800 static const char __pyx_k_lhs[] =
"lhs";
1801 static const char __pyx_k_log[] =
"log";
1802 static const char __pyx_k_max[] =
"max";
1803 static const char __pyx_k_min[] =
"min";
1804 static const char __pyx_k_obj[] =
"obj";
1805 static const char __pyx_k_odd[] =
"odd";
1806 static const char __pyx_k_pow[] =
"pow";
1807 static const char __pyx_k_rhs[] =
"rhs";
1808 static const char __pyx_k_sin[] =
"sin";
1809 static const char __pyx_k_tan[] =
"tan";
1810 static const char __pyx_k_tau[] =
"tau";
1811 static const char __pyx_k_Real[] =
"Real";
1812 static const char __pyx_k_acos[] =
"acos";
1813 static const char __pyx_k_args[] =
"args";
1814 static const char __pyx_k_asin[] =
"asin";
1815 static const char __pyx_k_atan[] =
"atan";
1816 static const char __pyx_k_conj[] =
"conj";
1817 static const char __pyx_k_copy[] =
"copy";
1818 static const char __pyx_k_cosh[] =
"cosh";
1819 static const char __pyx_k_even[] =
"even";
1820 static const char __pyx_k_fill[] =
"fill";
1821 static const char __pyx_k_from[] =
" from ";
1822 static const char __pyx_k_iter[] =
"__iter__";
1823 static const char __pyx_k_main[] =
"__main__";
1824 static const char __pyx_k_math[] =
"math";
1825 static const char __pyx_k_name[] =
"__name__";
1826 static const char __pyx_k_norm[] =
"norm";
1827 static const char __pyx_k_pure[] =
"pure";
1828 static const char __pyx_k_quad[] =
"quad";
1829 static const char __pyx_k_send[] =
"send";
1830 static const char __pyx_k_sinh[] =
"sinh";
1831 static const char __pyx_k_sqrt[] =
"sqrt";
1832 static const char __pyx_k_tanh[] =
"tanh";
1833 static const char __pyx_k_test[] =
"_test";
1834 static const char __pyx_k_0_8_4[] =
"0.8.4";
1835 static const char __pyx_k_UTF_8[] =
"UTF-8";
1836 static const char __pyx_k_acosh[] =
"acosh";
1837 static const char __pyx_k_asinh[] =
"asinh";
1838 static const char __pyx_k_atanh[] =
"atanh";
1839 static const char __pyx_k_close[] =
"close";
1840 static const char __pyx_k_grade[] =
"grade";
1841 static const char __pyx_k_istpq[] =
"istpq";
1842 static const char __pyx_k_nbar3[] =
"nbar3";
1843 static const char __pyx_k_ninf3[] =
"ninf3";
1844 static const char __pyx_k_other[] =
"other";
1845 static const char __pyx_k_range[] =
"range";
1846 static const char __pyx_k_throw[] =
"throw";
1847 static const char __pyx_k_using[] =
" using (";
1848 static const char __pyx_k_value[] =
" value ";
1849 static const char __pyx_k_encode[] =
"encode";
1850 static const char __pyx_k_import[] =
"__import__";
1851 static const char __pyx_k_reduce[] =
"__reduce__";
1852 static const char __pyx_k_scalar[] =
"scalar";
1853 static const char __pyx_k_test_2[] =
"__test__";
1854 static const char __pyx_k_xrange[] =
"xrange";
1855 static const char __pyx_k_doctest[] =
"doctest";
1856 static const char __pyx_k_invalid[] =
" invalid ";
1857 static const char __pyx_k_numbers[] =
"numbers";
1858 static const char __pyx_k_reverse[] =
"reverse";
1859 static const char __pyx_k_testmod[] =
"testmod";
1860 static const char __pyx_k_version[] =
"__version__";
1861 static const char __pyx_k_Integral[] =
"Integral";
1862 static const char __pyx_k_PyClical[] =
"PyClical";
1863 static const char __pyx_k_Sequence[] =
"Sequence";
1864 static const char __pyx_k_as_frame[] =
" as frame:\n\t";
1865 static const char __pyx_k_clifford[] =
"clifford";
1866 static const char __pyx_k_getstate[] =
"__getstate__";
1867 static const char __pyx_k_involute[] =
"involute";
1868 static const char __pyx_k_setstate[] =
"__setstate__";
1869 static const char __pyx_k_to_frame[] =
" to frame ";
1870 static const char __pyx_k_TypeError[] =
"TypeError";
1871 static const char __pyx_k_index_set[] =
"index_set";
1872 static const char __pyx_k_outer_pow[] =
"outer_pow";
1873 static const char __pyx_k_reduce_ex[] =
"__reduce_ex__";
1874 static const char __pyx_k_IndexError[] =
"IndexError";
1875 static const char __pyx_k_ValueError[] =
"ValueError";
1876 static const char __pyx_k_pyx_vtable[] =
"__pyx_vtable__";
1877 static const char __pyx_k_collections[] =
"collections";
1878 static const char __pyx_k_e_line_1886[] =
"e (line 1886)";
1879 static const char __pyx_k_PyClical_pyx[] =
"PyClical.pyx";
1880 static const char __pyx_k_RuntimeError[] =
"RuntimeError";
1881 static const char __pyx_k_abs_line_1472[] =
"abs (line 1472)";
1882 static const char __pyx_k_cos_line_1601[] =
"cos (line 1601)";
1883 static const char __pyx_k_exp_line_1564[] =
"exp (line 1564)";
1884 static const char __pyx_k_inv_line_1328[] =
"inv (line 1328)";
1885 static const char __pyx_k_log_line_1578[] =
"log (line 1578)";
1886 static const char __pyx_k_odd_line_1396[] =
"odd (line 1396)";
1887 static const char __pyx_k_pow_line_1493[] =
"pow (line 1493)";
1888 static const char __pyx_k_reduce_cython[] =
"__reduce_cython__";
1889 static const char __pyx_k_sin_line_1678[] =
"sin (line 1678)";
1890 static const char __pyx_k_tan_line_1751[] =
"tan (line 1751)";
1891 static const char __pyx_k_using_invalid[] =
" using invalid ";
1892 static const char __pyx_k_Cannot_reframe[] =
"Cannot reframe";
1893 static const char __pyx_k_NotImplemented[] =
"NotImplemented";
1894 static const char __pyx_k_Not_applicable[] =
"Not applicable.";
1895 static const char __pyx_k_acos_line_1618[] =
"acos (line 1618)";
1896 static const char __pyx_k_agc3_line_1843[] =
"agc3 (line 1843)";
1897 static const char __pyx_k_asin_line_1697[] =
"asin (line 1697)";
1898 static const char __pyx_k_atan_line_1768[] =
"atan (line 1768)";
1899 static const char __pyx_k_cga3_line_1823[] =
"cga3 (line 1823)";
1900 static const char __pyx_k_conj_line_1435[] =
"conj (line 1435)";
1901 static const char __pyx_k_cosh_line_1639[] =
"cosh (line 1639)";
1902 static const char __pyx_k_even_line_1387[] =
"even (line 1387)";
1903 static const char __pyx_k_imag_line_1365[] =
"imag (line 1365)";
1904 static const char __pyx_k_invalid_string[] =
" invalid string ";
1905 static const char __pyx_k_norm_line_1461[] =
"norm (line 1461)";
1906 static const char __pyx_k_pure_line_1376[] =
"pure (line 1376)";
1907 static const char __pyx_k_quad_line_1450[] =
"quad (line 1450)";
1908 static const char __pyx_k_real_line_1354[] =
"real (line 1354)";
1909 static const char __pyx_k_scalar_epsilon[] =
"scalar_epsilon";
1910 static const char __pyx_k_sinh_line_1718[] =
"sinh (line 1718)";
1911 static const char __pyx_k_sqrt_line_1541[] =
"sqrt (line 1541)";
1912 static const char __pyx_k_tanh_line_1785[] =
"tanh (line 1785)";
1913 static const char __pyx_k_acosh_line_1655[] =
"acosh (line 1655)";
1914 static const char __pyx_k_asinh_line_1732[] =
"asinh (line 1732)";
1915 static const char __pyx_k_atanh_line_1797[] =
"atanh (line 1797)";
1916 static const char __pyx_k_istpq_line_1899[] =
"istpq (line 1899)";
1917 static const char __pyx_k_setstate_cython[] =
"__setstate_cython__";
1918 static const char __pyx_k_compare_line_492[] =
"compare (line 492)";
1919 static const char __pyx_k_index_set___iter[] =
"index_set.__iter__";
1920 static const char __pyx_k_max_pos_line_513[] =
"max_pos (line 513)";
1921 static const char __pyx_k_min_neg_line_504[] =
"min_neg (line 504)";
1922 static const char __pyx_k_scalar_line_1343[] =
"scalar (line 1343)";
1923 static const char __pyx_k_cga3std_line_1832[] =
"cga3std (line 1832)";
1924 static const char __pyx_k_max_abs_line_1481[] =
"max_abs (line 1481)";
1925 static const char __pyx_k_reverse_line_1420[] =
"reverse (line 1420)";
1926 static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
1927 static const char __pyx_k_involute_line_1405[] =
"involute (line 1405)";
1928 static const char __pyx_k_outer_pow_line_1517[] =
"outer_pow (line 1517)";
1929 static const char __pyx_k_clifford_inv_line_926[] =
"clifford.inv (line 926)";
1930 static const char __pyx_k_clifford_pow_line_980[] =
"clifford.pow (line 980)";
1931 static const char __pyx_k_clifford_abs_line_1175[] =
"clifford.abs (line 1175)";
1932 static const char __pyx_k_clifford_copy_line_556[] =
"clifford.copy (line 556)";
1933 static const char __pyx_k_clifford_odd_line_1070[] =
"clifford.odd (line 1070)";
1934 static const char __pyx_k_complexifier_line_1526[] =
"complexifier (line 1526)";
1935 static const char __pyx_k_index_set_copy_line_65[] =
"index_set.copy (line 65)";
1936 static const char __pyx_k_index_set_max_line_351[] =
"index_set.max (line 351)";
1937 static const char __pyx_k_index_set_min_line_342[] =
"index_set.min (line 342)";
1938 static const char __pyx_k_clifford_conj_line_1138[] =
"clifford.conj (line 1138)";
1939 static const char __pyx_k_clifford_even_line_1061[] =
"clifford.even (line 1061)";
1940 static const char __pyx_k_clifford_norm_line_1164[] =
"clifford.norm (line 1164)";
1941 static const char __pyx_k_clifford_pure_line_1050[] =
"clifford.pure (line 1050)";
1942 static const char __pyx_k_clifford_quad_line_1153[] =
"clifford.quad (line 1153)";
1943 static const char __pyx_k_Unary_print_clifford_1_1[] =
"\n Unary -.\n\n >>> print(-clifford(\"{1}\"))\n -{1}\n ";
1944 static const char __pyx_k_clifford___or___line_939[] =
"clifford.__or__ (line 939)";
1945 static const char __pyx_k_clifford_frame_line_1215[] =
"clifford.frame (line 1215)";
1946 static const char __pyx_k_clifford_hidden_doctests[] =
"clifford_hidden_doctests";
1947 static const char __pyx_k_clifford_isnan_line_1206[] =
"clifford.isnan (line 1206)";
1948 static const char __pyx_k_index_set_count_line_315[] =
"index_set.count (line 315)";
1949 static const char __pyx_k_clifford___add___line_740[] =
"clifford.__add__ (line 740)";
1950 static const char __pyx_k_clifford___and___line_836[] =
"clifford.__and__ (line 836)";
1951 static const char __pyx_k_clifford___ior___line_950[] =
"clifford.__ior__ (line 950)";
1952 static const char __pyx_k_clifford___mod___line_806[] =
"clifford.__mod__ (line 806)";
1953 static const char __pyx_k_clifford___mul___line_780[] =
"clifford.__mul__ (line 780)";
1954 static const char __pyx_k_clifford___neg___line_722[] =
"clifford.__neg__ (line 722)";
1955 static const char __pyx_k_clifford___pos___line_731[] =
"clifford.__pos__ (line 731)";
1956 static const char __pyx_k_clifford___pow___line_961[] =
"clifford.__pow__ (line 961)";
1957 static const char __pyx_k_clifford___sub___line_760[] =
"clifford.__sub__ (line 760)";
1958 static const char __pyx_k_clifford___xor___line_866[] =
"clifford.__xor__ (line 866)";
1959 static const char __pyx_k_clifford_reframe_line_649[] =
"clifford.reframe (line 649)";
1960 static const char __pyx_k_clifford_scalar_line_1039[] =
"clifford.scalar (line 1039)";
1961 static const char __pyx_k_index_set___or___line_293[] =
"index_set.__or__ (line 293)";
1962 static const char __pyx_k_index_set_hidden_doctests[] =
"index_set_hidden_doctests";
1963 static const char __pyx_k_random_clifford_line_1814[] =
"random_clifford (line 1814)";
1964 static const char __pyx_k_Cannot_take_vector_part_of[] =
"Cannot take vector part of ";
1965 static const char __pyx_k_Unary_print_clifford_1_1_2[] =
"\n Unary +.\n\n >>> print(+clifford(\"{1}\"))\n {1}\n ";
1966 static const char __pyx_k_clifford___iadd___line_751[] =
"clifford.__iadd__ (line 751)";
1967 static const char __pyx_k_clifford___iand___line_851[] =
"clifford.__iand__ (line 851)";
1968 static const char __pyx_k_clifford___idiv___line_911[] =
"clifford.__idiv__ (line 911)";
1969 static const char __pyx_k_clifford___imod___line_821[] =
"clifford.__imod__ (line 821)";
1970 static const char __pyx_k_clifford___imul___line_793[] =
"clifford.__imul__ (line 793)";
1971 static const char __pyx_k_clifford___isub___line_771[] =
"clifford.__isub__ (line 771)";
1972 static const char __pyx_k_clifford___iter___line_638[] =
"clifford.__iter__ (line 638)";
1973 static const char __pyx_k_clifford___ixor___line_881[] =
"clifford.__ixor__ (line 881)";
1974 static const char __pyx_k_clifford___str___line_1235[] =
"clifford.__str__ (line 1235)";
1975 static const char __pyx_k_clifford_max_abs_line_1184[] =
"clifford.max_abs (line 1184)";
1976 static const char __pyx_k_clifford_reverse_line_1123[] =
"clifford.reverse (line 1123)";
1977 static const char __pyx_k_index_set___and___line_271[] =
"index_set.__and__ (line 271)";
1978 static const char __pyx_k_index_set___ior___line_304[] =
"index_set.__ior__ (line 304)";
1979 static const char __pyx_k_index_set___str___line_395[] =
"index_set.__str__ (line 395)";
1980 static const char __pyx_k_index_set___xor___line_249[] =
"index_set.__xor__ (line 249)";
1981 static const char __pyx_k_clifford___call___line_1020[] =
"clifford.__call__ (line 1020)";
1982 static const char __pyx_k_clifford___repr___line_1226[] =
"clifford.__repr__ (line 1226)";
1983 static const char __pyx_k_clifford_involute_line_1107[] =
"clifford.involute (line 1107)";
1984 static const char __pyx_k_index_set___iand___line_282[] =
"index_set.__iand__ (line 282)";
1985 static const char __pyx_k_index_set___iter___line_229[] =
"index_set.__iter__ (line 229)";
1986 static const char __pyx_k_index_set___ixor___line_260[] =
"index_set.__ixor__ (line 260)";
1987 static const char __pyx_k_index_set___repr___line_384[] =
"index_set.__repr__ (line 384)";
1988 static const char __pyx_k_clifford_outer_pow_line_1004[] =
"clifford.outer_pow (line 1004)";
1989 static const char __pyx_k_clifford_truncated_line_1195[] =
"clifford.truncated (line 1195)";
1990 static const char __pyx_k_index_set_count_neg_line_324[] =
"index_set.count_neg (line 324)";
1991 static const char __pyx_k_index_set_count_pos_line_333[] =
"index_set.count_pos (line 333)";
1992 static const char __pyx_k_clifford___getitem___line_707[] =
"clifford.__getitem__ (line 707)";
1993 static const char __pyx_k_clifford___truediv___line_896[] =
"clifford.__truediv__ (line 896)";
1994 static const char __pyx_k_index_set___invert___line_240[] =
"index_set.__invert__ (line 240)";
1995 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 ";
1996 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 ";
1997 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 ";
1998 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 ";
1999 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 ";
2000 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 ";
2001 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 ";
2002 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 ";
2003 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 ";
2004 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 ";
2005 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 ";
2006 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 ";
2007 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 ";
2008 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 ";
2009 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 ";
2010 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 ";
2011 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 ";
2012 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 ";
2013 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 ";
2014 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 ";
2015 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 ";
2016 static const char __pyx_k_clifford_vector_part_line_1079[] =
"clifford.vector_part (line 1079)";
2017 static const char __pyx_k_index_set___getitem___line_191[] =
"index_set.__getitem__ (line 191)";
2018 static const char __pyx_k_index_set___setitem___line_179[] =
"index_set.__setitem__ (line 179)";
2019 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 ";
2020 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 ";
2021 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 ";
2022 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 ";
2023 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 ";
2024 static const char __pyx_k_Check_if_a_multivector_contains[] =
"\n Check if a multivector contains any IEEE NaN values.\n\n >>> clifford().isnan()\n False\n ";
2025 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 ";
2026 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 ";
2027 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 ";
2028 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 ";
2029 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 ";
2030 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 ";
2031 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 ";
2032 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 ";
2033 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 ";
2034 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 ";
2035 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 ";
2036 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 ";
2037 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 ";
2038 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 ";
2039 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 ";
2040 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 ";
2041 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 ";
2042 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 ";
2043 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 ";
2044 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 ";
2045 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 ";
2046 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 ";
2047 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 ";
2048 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 ";
2049 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 ";
2050 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 ";
2051 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 ";
2052 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 ";
2053 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 ";
2054 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 ";
2055 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 ";
2056 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 ";
2057 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 ";
2058 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 ";
2059 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 ";
2060 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 ";
2061 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 ";
2062 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 ";
2063 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 ";
2064 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 ";
2065 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 ";
2066 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 ";
2067 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 ";
2068 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 ";
2069 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 ";
2070 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 ";
2071 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 ";
2072 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 ";
2073 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 ";
2074 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 ";
2075 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 ";
2076 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 ";
2077 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 ";
2078 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 ";
2079 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 ";
2080 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 ";
2081 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 ";
2082 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 ";
2083 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 ";
2084 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 ";
2085 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 ";
2086 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 ";
2087 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 ";
2088 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 ";
2089 static const char __pyx_k_This_comparison_operator_is_not[] =
"This comparison operator is not implemented for ";
2090 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 ";
2091 static const char __pyx_k_index_set_sign_of_mult_line_366[] =
"index_set.sign_of_mult (line 366)";
2092 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 ";
2093 static const char __pyx_k_Cannot_initialize_clifford_objec[] =
"Cannot initialize clifford object from";
2094 static const char __pyx_k_Cannot_initialize_index_set_obje[] =
"Cannot initialize index_set object from";
2095 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 ";
2096 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 ";
2097 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 ";
2098 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 ";
2099 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 ";
2100 static const char __pyx_k_clifford_hidden_doctests_line_12[] =
"clifford_hidden_doctests (line 1244)";
2101 static const char __pyx_k_index_set_hidden_doctests_line_4[] =
"index_set_hidden_doctests (line 406)";
2102 static const char __pyx_k_index_set_sign_of_square_line_37[] =
"index_set.sign_of_square (line 375)";
2103 static const char __pyx_k_no_default___reduce___due_to_non[] =
"no default __reduce__ due to non-trivial __cinit__";
2104 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 ";
2105 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 ";
2106 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 ";
2107 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 ";
2108 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 ";
2109 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 ";
2110 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 ";
2111 static PyObject *__pyx_kp_u_;
2112 static PyObject *__pyx_kp_u_0_8_4;
2113 static PyObject *__pyx_kp_u_Abbreviation_for_clifford_index;
2114 static PyObject *__pyx_kp_u_Abbreviation_for_index_set_q_p;
2115 static PyObject *__pyx_kp_u_Absolute_value_of_multivector_m;
2116 static PyObject *__pyx_kp_u_Absolute_value_square_root_of_n;
2117 static PyObject *__pyx_kp_u_Cannot_initialize_clifford_objec;
2118 static PyObject *__pyx_kp_u_Cannot_initialize_index_set_obje;
2119 static PyObject *__pyx_kp_u_Cannot_reframe;
2120 static PyObject *__pyx_kp_u_Cannot_take_vector_part_of;
2121 static PyObject *__pyx_kp_u_Cardinality_Number_of_indices_i;
2122 static PyObject *__pyx_kp_u_Check_if_a_multivector_contains;
2123 static PyObject *__pyx_kp_u_Conjugation_reverse_o_involute;
2124 static PyObject *__pyx_kp_u_Conjugation_reverse_o_involute_2;
2125 static PyObject *__pyx_kp_u_Contraction_print_clifford_1_cl;
2126 static PyObject *__pyx_kp_u_Contraction_x_clifford_1_x_clif;
2127 static PyObject *__pyx_kp_u_Convert_CGA3_null_vector_to_Euc;
2128 static PyObject *__pyx_kp_u_Convert_CGA3_null_vector_to_sta;
2129 static PyObject *__pyx_kp_u_Convert_Euclidean_3D_multivecto;
2130 static PyObject *__pyx_kp_u_Copy_this_clifford_object_x_cli;
2131 static PyObject *__pyx_kp_u_Copy_this_index_set_object_s_in;
2132 static PyObject *__pyx_kp_u_Cosine_of_multivector_with_opti;
2133 static PyObject *__pyx_kp_u_Even_part_of_multivector_sum_of;
2134 static PyObject *__pyx_kp_u_Even_part_of_multivector_sum_of_2;
2135 static PyObject *__pyx_kp_u_Exponential_of_multivector_x_cl;
2136 static PyObject *__pyx_kp_u_Geometric_difference_print_clif;
2137 static PyObject *__pyx_kp_u_Geometric_difference_x_clifford;
2138 static PyObject *__pyx_kp_u_Geometric_multiplicative_invers;
2139 static PyObject *__pyx_kp_u_Geometric_multiplicative_invers_2;
2140 static PyObject *__pyx_kp_u_Geometric_product_print_cliffor;
2141 static PyObject *__pyx_kp_u_Geometric_product_x_clifford_2;
2142 static PyObject *__pyx_kp_u_Geometric_quotient_print_cliffo;
2143 static PyObject *__pyx_kp_u_Geometric_quotient_x_clifford_1;
2144 static PyObject *__pyx_kp_u_Geometric_sum_print_clifford_1;
2145 static PyObject *__pyx_kp_u_Geometric_sum_x_clifford_1_x_cl;
2146 static PyObject *__pyx_kp_u_Get_the_value_of_an_index_set_o;
2147 static PyObject *__pyx_kp_u_Hyperbolic_cosine_of_multivecto;
2148 static PyObject *__pyx_kp_u_Hyperbolic_sine_of_multivector;
2149 static PyObject *__pyx_kp_u_Hyperbolic_tangent_of_multivect;
2150 static PyObject *__pyx_kp_u_Imaginary_part_deprecated_alway;
2151 static PyObject *__pyx_n_s_IndexError;
2152 static PyObject *__pyx_kp_u_Inner_product_print_clifford_1;
2153 static PyObject *__pyx_kp_u_Inner_product_x_clifford_1_x_cl;
2154 static PyObject *__pyx_kp_u_Integer_power_of_multivector_ob;
2155 static PyObject *__pyx_n_s_Integral;
2156 static PyObject *__pyx_kp_u_Inverse_cosine_of_multivector_w;
2157 static PyObject *__pyx_kp_u_Inverse_hyperbolic_cosine_of_mu;
2158 static PyObject *__pyx_kp_u_Inverse_hyperbolic_sine_of_mult;
2159 static PyObject *__pyx_kp_u_Inverse_hyperbolic_tangent_of_m;
2160 static PyObject *__pyx_kp_u_Inverse_sine_of_multivector_wit;
2161 static PyObject *__pyx_kp_u_Inverse_tangent_of_multivector;
2162 static PyObject *__pyx_kp_u_Iterate_over_the_indices_of_an;
2163 static PyObject *__pyx_kp_u_Main_involution_each_i_is_repla;
2164 static PyObject *__pyx_kp_u_Main_involution_each_i_is_repla_2;
2165 static PyObject *__pyx_kp_u_Maximum_absolute_value_of_coord;
2166 static PyObject *__pyx_kp_u_Maximum_member_index_set_1_1_2;
2167 static PyObject *__pyx_kp_u_Maximum_of_absolute_values_of_c;
2168 static PyObject *__pyx_kp_u_Maximum_positive_index_or_0_if;
2169 static PyObject *__pyx_kp_u_Minimum_member_index_set_1_1_2;
2170 static PyObject *__pyx_kp_u_Minimum_negative_index_or_0_if;
2171 static PyObject *__pyx_kp_u_Natural_logarithm_of_multivecto;
2172 static PyObject *__pyx_kp_u_Norm_sum_of_squares_of_coordina;
2173 static PyObject *__pyx_n_s_NotImplemented;
2174 static PyObject *__pyx_kp_u_Not_applicable;
2175 static PyObject *__pyx_kp_u_Not_applicable_for_a_in_cliffor;
2176 static PyObject *__pyx_kp_u_Number_of_negative_indices_incl;
2177 static PyObject *__pyx_kp_u_Number_of_positive_indices_incl;
2178 static PyObject *__pyx_kp_u_Odd_part_of_multivector_sum_of;
2179 static PyObject *__pyx_kp_u_Odd_part_of_multivector_sum_of_2;
2180 static PyObject *__pyx_kp_u_Outer_product_power_of_multivec;
2181 static PyObject *__pyx_kp_u_Outer_product_power_x_clifford;
2182 static PyObject *__pyx_kp_u_Outer_product_print_clifford_1;
2183 static PyObject *__pyx_kp_u_Outer_product_x_clifford_1_x_cl;
2184 static PyObject *__pyx_kp_u_Power_self_to_the_m_x_clifford;
2185 static PyObject *__pyx_kp_u_Power_self_to_the_m_x_clifford_2;
2186 static PyObject *__pyx_kp_u_Pure_grade_vector_part_print_cl;
2187 static PyObject *__pyx_kp_u_Pure_part_print_clifford_1_1_1;
2188 static PyObject *__pyx_kp_u_Pure_part_print_pure_clifford_1;
2189 static PyObject *__pyx_kp_u_Put_self_into_a_larger_frame_co;
2190 static PyObject *__pyx_n_s_PyClical;
2191 static PyObject *__pyx_kp_s_PyClical_pyx;
2192 static PyObject *__pyx_kp_u_Quadratic_form_rev_x_x_0_print;
2193 static PyObject *__pyx_kp_u_Quadratic_form_rev_x_x_0_print_2;
2194 static PyObject *__pyx_kp_u_Random_multivector_within_a_fra;
2195 static PyObject *__pyx_n_s_Real;
2196 static PyObject *__pyx_kp_u_Real_part_synonym_for_scalar_pa;
2197 static PyObject *__pyx_kp_u_Remove_all_terms_of_self_with_r;
2198 static PyObject *__pyx_kp_u_Reversion_eg_1_2_2_1_print_reve;
2199 static PyObject *__pyx_kp_u_Reversion_eg_clifford_1_cliffor;
2200 static PyObject *__pyx_n_s_RuntimeError;
2201 static PyObject *__pyx_kp_u_Scalar_part_clifford_1_1_1_2_sc;
2202 static PyObject *__pyx_kp_u_Scalar_part_scalar_clifford_1_1;
2203 static PyObject *__pyx_n_s_Sequence;
2204 static PyObject *__pyx_kp_u_Set_complement_not_print_index;
2205 static PyObject *__pyx_kp_u_Set_intersection_and_print_inde;
2206 static PyObject *__pyx_kp_u_Set_intersection_and_x_index_se;
2207 static PyObject *__pyx_kp_u_Set_the_value_of_an_index_set_o;
2208 static PyObject *__pyx_kp_u_Set_union_or_print_index_set_1;
2209 static PyObject *__pyx_kp_u_Set_union_or_x_index_set_1_x_in;
2210 static PyObject *__pyx_kp_u_Sign_of_geometric_product_of_tw;
2211 static PyObject *__pyx_kp_u_Sign_of_geometric_square_of_a_C;
2212 static PyObject *__pyx_kp_u_Sine_of_multivector_with_option;
2213 static PyObject *__pyx_kp_u_Square_root_of_1_which_commutes;
2214 static PyObject *__pyx_kp_u_Square_root_of_multivector_with;
2215 static PyObject *__pyx_kp_u_Subalgebra_generated_by_all_gen;
2216 static PyObject *__pyx_kp_u_Subscripting_map_from_index_set;
2217 static PyObject *__pyx_kp_u_Symmetric_set_difference_exclus;
2218 static PyObject *__pyx_kp_u_Symmetric_set_difference_exclus_2;
2219 static PyObject *__pyx_kp_u_Tangent_of_multivector_with_opt;
2220 static PyObject *__pyx_kp_u_Tests_for_functions_that_Doctes;
2221 static PyObject *__pyx_kp_u_Tests_for_functions_that_Doctes_2;
2222 static PyObject *__pyx_kp_u_The_informal_string_representat;
2223 static PyObject *__pyx_kp_u_The_informal_string_representat_2;
2224 static PyObject *__pyx_kp_u_The_official_string_representat;
2225 static PyObject *__pyx_kp_u_The_official_string_representat_2;
2226 static PyObject *__pyx_kp_u_This_comparison_operator_is_not;
2227 static PyObject *__pyx_kp_u_Transform_left_hand_side_using;
2228 static PyObject *__pyx_kp_u_Transform_left_hand_side_using_2;
2229 static PyObject *__pyx_n_s_TypeError;
2230 static PyObject *__pyx_kp_u_UTF_8;
2231 static PyObject *__pyx_kp_u_Unary_print_clifford_1_1;
2232 static PyObject *__pyx_kp_u_Unary_print_clifford_1_1_2;
2233 static PyObject *__pyx_n_s_ValueError;
2234 static PyObject *__pyx_kp_u_Vector_part_of_multivector_as_a;
2235 static PyObject *__pyx_kp_u__2;
2236 static PyObject *__pyx_kp_u__5;
2237 static PyObject *__pyx_kp_u__6;
2238 static PyObject *__pyx_kp_u__7;
2239 static PyObject *__pyx_kp_u__8;
2240 static PyObject *__pyx_kp_u__9;
2241 static PyObject *__pyx_n_s_abc;
2242 static PyObject *__pyx_kp_u_abs_line_1472;
2243 static PyObject *__pyx_n_s_acos;
2244 static PyObject *__pyx_kp_u_acos_line_1618;
2245 static PyObject *__pyx_n_s_acosh;
2246 static PyObject *__pyx_kp_u_acosh_line_1655;
2247 static PyObject *__pyx_kp_u_agc3_line_1843;
2248 static PyObject *__pyx_n_s_args;
2249 static PyObject *__pyx_kp_u_as_frame;
2250 static PyObject *__pyx_n_s_asin;
2251 static PyObject *__pyx_kp_u_asin_line_1697;
2252 static PyObject *__pyx_n_s_asinh;
2253 static PyObject *__pyx_kp_u_asinh_line_1732;
2254 static PyObject *__pyx_n_s_atan;
2255 static PyObject *__pyx_kp_u_atan_line_1768;
2256 static PyObject *__pyx_n_s_atanh;
2257 static PyObject *__pyx_kp_u_atanh_line_1797;
2258 static PyObject *__pyx_kp_u_cga3_line_1823;
2259 static PyObject *__pyx_kp_u_cga3std_line_1832;
2260 static PyObject *__pyx_n_s_cl;
2261 static PyObject *__pyx_n_s_clifford;
2262 static PyObject *__pyx_kp_u_clifford___add___line_740;
2263 static PyObject *__pyx_kp_u_clifford___and___line_836;
2264 static PyObject *__pyx_kp_u_clifford___call___line_1020;
2265 static PyObject *__pyx_kp_u_clifford___getitem___line_707;
2266 static PyObject *__pyx_kp_u_clifford___iadd___line_751;
2267 static PyObject *__pyx_kp_u_clifford___iand___line_851;
2268 static PyObject *__pyx_kp_u_clifford___idiv___line_911;
2269 static PyObject *__pyx_kp_u_clifford___imod___line_821;
2270 static PyObject *__pyx_kp_u_clifford___imul___line_793;
2271 static PyObject *__pyx_kp_u_clifford___ior___line_950;
2272 static PyObject *__pyx_kp_u_clifford___isub___line_771;
2273 static PyObject *__pyx_kp_u_clifford___iter___line_638;
2274 static PyObject *__pyx_kp_u_clifford___ixor___line_881;
2275 static PyObject *__pyx_kp_u_clifford___mod___line_806;
2276 static PyObject *__pyx_kp_u_clifford___mul___line_780;
2277 static PyObject *__pyx_kp_u_clifford___neg___line_722;
2278 static PyObject *__pyx_kp_u_clifford___or___line_939;
2279 static PyObject *__pyx_kp_u_clifford___pos___line_731;
2280 static PyObject *__pyx_kp_u_clifford___pow___line_961;
2281 static PyObject *__pyx_kp_u_clifford___repr___line_1226;
2282 static PyObject *__pyx_kp_u_clifford___str___line_1235;
2283 static PyObject *__pyx_kp_u_clifford___sub___line_760;
2284 static PyObject *__pyx_kp_u_clifford___truediv___line_896;
2285 static PyObject *__pyx_kp_u_clifford___xor___line_866;
2286 static PyObject *__pyx_kp_u_clifford_abs_line_1175;
2287 static PyObject *__pyx_kp_u_clifford_conj_line_1138;
2288 static PyObject *__pyx_kp_u_clifford_copy_line_556;
2289 static PyObject *__pyx_kp_u_clifford_even_line_1061;
2290 static PyObject *__pyx_kp_u_clifford_frame_line_1215;
2291 static PyObject *__pyx_n_s_clifford_hidden_doctests;
2292 static PyObject *__pyx_kp_u_clifford_hidden_doctests_line_12;
2293 static PyObject *__pyx_kp_u_clifford_inv_line_926;
2294 static PyObject *__pyx_kp_u_clifford_involute_line_1107;
2295 static PyObject *__pyx_kp_u_clifford_isnan_line_1206;
2296 static PyObject *__pyx_kp_u_clifford_max_abs_line_1184;
2297 static PyObject *__pyx_kp_u_clifford_norm_line_1164;
2298 static PyObject *__pyx_kp_u_clifford_odd_line_1070;
2299 static PyObject *__pyx_kp_u_clifford_outer_pow_line_1004;
2300 static PyObject *__pyx_kp_u_clifford_pow_line_980;
2301 static PyObject *__pyx_kp_u_clifford_pure_line_1050;
2302 static PyObject *__pyx_kp_u_clifford_quad_line_1153;
2303 static PyObject *__pyx_kp_u_clifford_reframe_line_649;
2304 static PyObject *__pyx_kp_u_clifford_reverse_line_1123;
2305 static PyObject *__pyx_kp_u_clifford_scalar_line_1039;
2306 static PyObject *__pyx_kp_u_clifford_truncated_line_1195;
2307 static PyObject *__pyx_kp_u_clifford_vector_part_line_1079;
2308 static PyObject *__pyx_n_s_cline_in_traceback;
2309 static PyObject *__pyx_n_s_close;
2310 static PyObject *__pyx_n_s_collections;
2311 static PyObject *__pyx_kp_u_compare_line_492;
2312 static PyObject *__pyx_kp_u_complexifier_line_1526;
2313 static PyObject *__pyx_n_s_conj;
2314 static PyObject *__pyx_kp_u_conj_line_1435;
2315 static PyObject *__pyx_n_s_copy;
2316 static PyObject *__pyx_n_s_cos;
2317 static PyObject *__pyx_kp_u_cos_line_1601;
2318 static PyObject *__pyx_n_s_cosh;
2319 static PyObject *__pyx_kp_u_cosh_line_1639;
2320 static PyObject *__pyx_n_s_doctest;
2321 static PyObject *__pyx_n_s_e;
2322 static PyObject *__pyx_kp_u_e_line_1886;
2323 static PyObject *__pyx_n_s_encode;
2324 static PyObject *__pyx_n_s_even;
2325 static PyObject *__pyx_kp_u_even_line_1387;
2326 static PyObject *__pyx_n_s_exp;
2327 static PyObject *__pyx_kp_u_exp_line_1564;
2328 static PyObject *__pyx_n_s_fill;
2329 static PyObject *__pyx_n_s_frm;
2330 static PyObject *__pyx_kp_u_from;
2331 static PyObject *__pyx_n_s_getstate;
2332 static PyObject *__pyx_n_s_grade;
2333 static PyObject *__pyx_n_s_i;
2334 static PyObject *__pyx_kp_u_imag_line_1365;
2335 static PyObject *__pyx_n_s_import;
2336 static PyObject *__pyx_n_s_index_set;
2337 static PyObject *__pyx_kp_u_index_set___and___line_271;
2338 static PyObject *__pyx_kp_u_index_set___getitem___line_191;
2339 static PyObject *__pyx_kp_u_index_set___iand___line_282;
2340 static PyObject *__pyx_kp_u_index_set___invert___line_240;
2341 static PyObject *__pyx_kp_u_index_set___ior___line_304;
2342 static PyObject *__pyx_n_s_index_set___iter;
2343 static PyObject *__pyx_kp_u_index_set___iter___line_229;
2344 static PyObject *__pyx_kp_u_index_set___ixor___line_260;
2345 static PyObject *__pyx_kp_u_index_set___or___line_293;
2346 static PyObject *__pyx_kp_u_index_set___repr___line_384;
2347 static PyObject *__pyx_kp_u_index_set___setitem___line_179;
2348 static PyObject *__pyx_kp_u_index_set___str___line_395;
2349 static PyObject *__pyx_kp_u_index_set___xor___line_249;
2350 static PyObject *__pyx_kp_u_index_set_copy_line_65;
2351 static PyObject *__pyx_kp_u_index_set_count_line_315;
2352 static PyObject *__pyx_kp_u_index_set_count_neg_line_324;
2353 static PyObject *__pyx_kp_u_index_set_count_pos_line_333;
2354 static PyObject *__pyx_n_s_index_set_hidden_doctests;
2355 static PyObject *__pyx_kp_u_index_set_hidden_doctests_line_4;
2356 static PyObject *__pyx_kp_u_index_set_max_line_351;
2357 static PyObject *__pyx_kp_u_index_set_min_line_342;
2358 static PyObject *__pyx_kp_u_index_set_sign_of_mult_line_366;
2359 static PyObject *__pyx_kp_u_index_set_sign_of_square_line_37;
2360 static PyObject *__pyx_n_s_inv;
2361 static PyObject *__pyx_kp_u_inv_line_1328;
2362 static PyObject *__pyx_kp_u_invalid;
2363 static PyObject *__pyx_kp_u_invalid_string;
2364 static PyObject *__pyx_n_s_involute;
2365 static PyObject *__pyx_kp_u_involute_line_1405;
2366 static PyObject *__pyx_n_s_ist;
2367 static PyObject *__pyx_n_s_istpq;
2368 static PyObject *__pyx_kp_u_istpq_line_1899;
2369 static PyObject *__pyx_n_s_iter;
2370 static PyObject *__pyx_n_s_ixt;
2371 static PyObject *__pyx_kp_u_lexicographic_compare_eg_3_4_5;
2372 static PyObject *__pyx_n_s_lhs;
2373 static PyObject *__pyx_n_s_log;
2374 static PyObject *__pyx_kp_u_log_line_1578;
2375 static PyObject *__pyx_n_s_m;
2376 static PyObject *__pyx_n_s_main;
2377 static PyObject *__pyx_n_u_main;
2378 static PyObject *__pyx_n_s_math;
2379 static PyObject *__pyx_n_s_max;
2380 static PyObject *__pyx_kp_u_max_abs_line_1481;
2381 static PyObject *__pyx_kp_u_max_pos_line_513;
2382 static PyObject *__pyx_n_s_min;
2383 static PyObject *__pyx_kp_u_min_neg_line_504;
2384 static PyObject *__pyx_n_s_name;
2385 static PyObject *__pyx_n_s_nbar3;
2386 static PyObject *__pyx_n_s_ninf3;
2387 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2388 static PyObject *__pyx_n_s_norm;
2389 static PyObject *__pyx_kp_u_norm_line_1461;
2390 static PyObject *__pyx_kp_u_norm_sum_of_squares_of_coordina;
2391 static PyObject *__pyx_n_s_numbers;
2392 static PyObject *__pyx_n_s_obj;
2393 static PyObject *__pyx_n_s_odd;
2394 static PyObject *__pyx_kp_u_odd_line_1396;
2395 static PyObject *__pyx_n_s_other;
2396 static PyObject *__pyx_n_s_outer_pow;
2397 static PyObject *__pyx_kp_u_outer_pow_line_1517;
2398 static PyObject *__pyx_n_s_p;
2399 static PyObject *__pyx_n_s_pi;
2400 static PyObject *__pyx_n_s_pow;
2401 static PyObject *__pyx_kp_u_pow_line_1493;
2402 static PyObject *__pyx_n_s_pure;
2403 static PyObject *__pyx_kp_u_pure_line_1376;
2404 static PyObject *__pyx_n_s_pyx_vtable;
2405 static PyObject *__pyx_n_s_q;
2406 static PyObject *__pyx_n_s_quad;
2407 static PyObject *__pyx_kp_u_quad_line_1450;
2408 static PyObject *__pyx_kp_u_random_clifford_line_1814;
2409 static PyObject *__pyx_n_s_range;
2410 static PyObject *__pyx_kp_u_real_line_1354;
2411 static PyObject *__pyx_n_s_reduce;
2412 static PyObject *__pyx_n_s_reduce_cython;
2413 static PyObject *__pyx_n_s_reduce_ex;
2414 static PyObject *__pyx_n_s_reverse;
2415 static PyObject *__pyx_kp_u_reverse_line_1420;
2416 static PyObject *__pyx_n_s_rhs;
2417 static PyObject *__pyx_n_s_scalar;
2418 static PyObject *__pyx_n_s_scalar_epsilon;
2419 static PyObject *__pyx_kp_u_scalar_line_1343;
2420 static PyObject *__pyx_n_s_send;
2421 static PyObject *__pyx_n_s_setstate;
2422 static PyObject *__pyx_n_s_setstate_cython;
2423 static PyObject *__pyx_n_s_sin;
2424 static PyObject *__pyx_kp_u_sin_line_1678;
2425 static PyObject *__pyx_n_s_sinh;
2426 static PyObject *__pyx_kp_u_sinh_line_1718;
2427 static PyObject *__pyx_n_s_sqrt;
2428 static PyObject *__pyx_kp_u_sqrt_line_1541;
2429 static PyObject *__pyx_n_s_tan;
2430 static PyObject *__pyx_kp_u_tan_line_1751;
2431 static PyObject *__pyx_n_s_tanh;
2432 static PyObject *__pyx_kp_u_tanh_line_1785;
2433 static PyObject *__pyx_n_s_tau;
2434 static PyObject *__pyx_n_s_test;
2435 static PyObject *__pyx_n_s_test_2;
2436 static PyObject *__pyx_n_s_testmod;
2437 static PyObject *__pyx_n_s_throw;
2438 static PyObject *__pyx_kp_u_to_frame;
2439 static PyObject *__pyx_kp_u_using;
2440 static PyObject *__pyx_kp_u_using_invalid;
2441 static PyObject *__pyx_kp_u_value;
2442 static PyObject *__pyx_n_s_version;
2443 static PyObject *__pyx_n_s_xrange;
2444 static PyObject *__pyx_pf_8PyClical_9index_set_copy(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2445 static int __pyx_pf_8PyClical_9index_set_2__cinit__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_other);
2446 static void __pyx_pf_8PyClical_9index_set_4__dealloc__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2447 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);
2448 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);
2449 static PyObject *__pyx_pf_8PyClical_9index_set_10__getitem__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_idx);
2450 static int __pyx_pf_8PyClical_9index_set_12__contains__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_idx);
2451 static PyObject *__pyx_pf_8PyClical_9index_set_14__iter__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2452 static PyObject *__pyx_pf_8PyClical_9index_set_17__invert__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2453 static PyObject *__pyx_pf_8PyClical_9index_set_19__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2454 static PyObject *__pyx_pf_8PyClical_9index_set_21__ixor__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs);
2455 static PyObject *__pyx_pf_8PyClical_9index_set_23__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2456 static PyObject *__pyx_pf_8PyClical_9index_set_25__iand__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs);
2457 static PyObject *__pyx_pf_8PyClical_9index_set_27__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2458 static PyObject *__pyx_pf_8PyClical_9index_set_29__ior__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs);
2459 static PyObject *__pyx_pf_8PyClical_9index_set_31count(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2460 static PyObject *__pyx_pf_8PyClical_9index_set_33count_neg(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2461 static PyObject *__pyx_pf_8PyClical_9index_set_35count_pos(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2462 static PyObject *__pyx_pf_8PyClical_9index_set_37min(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2463 static PyObject *__pyx_pf_8PyClical_9index_set_39max(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2464 static PyObject *__pyx_pf_8PyClical_9index_set_41hash_fn(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2465 static PyObject *__pyx_pf_8PyClical_9index_set_43sign_of_mult(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs);
2466 static PyObject *__pyx_pf_8PyClical_9index_set_45sign_of_square(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2467 static PyObject *__pyx_pf_8PyClical_9index_set_47__repr__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2468 static PyObject *__pyx_pf_8PyClical_9index_set_49__str__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2469 static PyObject *__pyx_pf_8PyClical_9index_set_51__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2470 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);
2471 static PyObject *__pyx_pf_8PyClical_index_set_hidden_doctests(CYTHON_UNUSED PyObject *__pyx_self);
2472 static PyObject *__pyx_pf_8PyClical_2compare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2473 static PyObject *__pyx_pf_8PyClical_4min_neg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2474 static PyObject *__pyx_pf_8PyClical_6max_pos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2475 static PyObject *__pyx_pf_8PyClical_8clifford_copy(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2476 static int __pyx_pf_8PyClical_8clifford_2__cinit__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_ixt);
2477 static void __pyx_pf_8PyClical_8clifford_4__dealloc__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2478 static int __pyx_pf_8PyClical_8clifford_6__contains__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_x);
2479 static PyObject *__pyx_pf_8PyClical_8clifford_8__iter__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2480 static PyObject *__pyx_pf_8PyClical_8clifford_10reframe(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_ixt);
2481 static PyObject *__pyx_pf_8PyClical_8clifford_12__richcmp__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op);
2482 static PyObject *__pyx_pf_8PyClical_8clifford_14__getitem__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_ixt);
2483 static PyObject *__pyx_pf_8PyClical_8clifford_16__neg__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2484 static PyObject *__pyx_pf_8PyClical_8clifford_18__pos__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2485 static PyObject *__pyx_pf_8PyClical_8clifford_20__add__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2486 static PyObject *__pyx_pf_8PyClical_8clifford_22__iadd__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2487 static PyObject *__pyx_pf_8PyClical_8clifford_24__sub__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2488 static PyObject *__pyx_pf_8PyClical_8clifford_26__isub__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2489 static PyObject *__pyx_pf_8PyClical_8clifford_28__mul__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2490 static PyObject *__pyx_pf_8PyClical_8clifford_30__imul__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2491 static PyObject *__pyx_pf_8PyClical_8clifford_32__mod__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2492 static PyObject *__pyx_pf_8PyClical_8clifford_34__imod__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2493 static PyObject *__pyx_pf_8PyClical_8clifford_36__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2494 static PyObject *__pyx_pf_8PyClical_8clifford_38__iand__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2495 static PyObject *__pyx_pf_8PyClical_8clifford_40__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2496 static PyObject *__pyx_pf_8PyClical_8clifford_42__ixor__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2497 static PyObject *__pyx_pf_8PyClical_8clifford_44__truediv__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2498 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
2499 static PyObject *__pyx_pf_8PyClical_8clifford_46__idiv__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2501 static PyObject *__pyx_pf_8PyClical_8clifford_48inv(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2502 static PyObject *__pyx_pf_8PyClical_8clifford_50__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2503 static PyObject *__pyx_pf_8PyClical_8clifford_52__ior__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2504 static PyObject *__pyx_pf_8PyClical_8clifford_54__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_m, CYTHON_UNUSED PyObject *__pyx_v_dummy);
2505 static PyObject *__pyx_pf_8PyClical_8clifford_56pow(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_m);
2506 static PyObject *__pyx_pf_8PyClical_8clifford_58outer_pow(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_m);
2507 static PyObject *__pyx_pf_8PyClical_8clifford_60__call__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_grade);
2508 static PyObject *__pyx_pf_8PyClical_8clifford_62scalar(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2509 static PyObject *__pyx_pf_8PyClical_8clifford_64pure(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2510 static PyObject *__pyx_pf_8PyClical_8clifford_66even(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2511 static PyObject *__pyx_pf_8PyClical_8clifford_68odd(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2512 static PyObject *__pyx_pf_8PyClical_8clifford_70vector_part(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_frm);
2513 static PyObject *__pyx_pf_8PyClical_8clifford_72involute(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2514 static PyObject *__pyx_pf_8PyClical_8clifford_74reverse(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2515 static PyObject *__pyx_pf_8PyClical_8clifford_76conj(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2516 static PyObject *__pyx_pf_8PyClical_8clifford_78quad(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2517 static PyObject *__pyx_pf_8PyClical_8clifford_80norm(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2518 static PyObject *__pyx_pf_8PyClical_8clifford_82abs(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2519 static PyObject *__pyx_pf_8PyClical_8clifford_84max_abs(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2520 static PyObject *__pyx_pf_8PyClical_8clifford_86truncated(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_limit);
2521 static PyObject *__pyx_pf_8PyClical_8clifford_88isnan(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2522 static PyObject *__pyx_pf_8PyClical_8clifford_90frame(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2523 static PyObject *__pyx_pf_8PyClical_8clifford_92__repr__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2524 static PyObject *__pyx_pf_8PyClical_8clifford_94__str__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2525 static PyObject *__pyx_pf_8PyClical_8clifford_96__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2526 static PyObject *__pyx_pf_8PyClical_8clifford_98__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2527 static PyObject *__pyx_pf_8PyClical_8clifford_hidden_doctests(CYTHON_UNUSED PyObject *__pyx_self);
2528 static PyObject *__pyx_pf_8PyClical_10inv(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2529 static PyObject *__pyx_pf_8PyClical_12scalar(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2530 static PyObject *__pyx_pf_8PyClical_14real(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2531 static PyObject *__pyx_pf_8PyClical_16imag(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2532 static PyObject *__pyx_pf_8PyClical_18pure(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2533 static PyObject *__pyx_pf_8PyClical_20even(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2534 static PyObject *__pyx_pf_8PyClical_22odd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2535 static PyObject *__pyx_pf_8PyClical_24involute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2536 static PyObject *__pyx_pf_8PyClical_26reverse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2537 static PyObject *__pyx_pf_8PyClical_28conj(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2538 static PyObject *__pyx_pf_8PyClical_30quad(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2539 static PyObject *__pyx_pf_8PyClical_32norm(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2540 static PyObject *__pyx_pf_8PyClical_34abs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2541 static PyObject *__pyx_pf_8PyClical_36max_abs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2542 static PyObject *__pyx_pf_8PyClical_38pow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_m);
2543 static PyObject *__pyx_pf_8PyClical_40outer_pow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_m);
2544 static PyObject *__pyx_pf_8PyClical_42complexifier(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2545 static PyObject *__pyx_pf_8PyClical_44sqrt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2546 static PyObject *__pyx_pf_8PyClical_46exp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2547 static PyObject *__pyx_pf_8PyClical_48log(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2548 static PyObject *__pyx_pf_8PyClical_50cos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2549 static PyObject *__pyx_pf_8PyClical_52acos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2550 static PyObject *__pyx_pf_8PyClical_54cosh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2551 static PyObject *__pyx_pf_8PyClical_56acosh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2552 static PyObject *__pyx_pf_8PyClical_58sin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2553 static PyObject *__pyx_pf_8PyClical_60asin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2554 static PyObject *__pyx_pf_8PyClical_62sinh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2555 static PyObject *__pyx_pf_8PyClical_64asinh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2556 static PyObject *__pyx_pf_8PyClical_66tan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2557 static PyObject *__pyx_pf_8PyClical_68atan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2558 static PyObject *__pyx_pf_8PyClical_70tanh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2559 static PyObject *__pyx_pf_8PyClical_72atanh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2560 static PyObject *__pyx_pf_8PyClical_74random_clifford(CYTHON_UNUSED PyObject *__pyx_self,
struct __pyx_obj_8PyClical_index_set *__pyx_v_ixt, PyObject *__pyx_v_fill);
2561 static PyObject *__pyx_pf_8PyClical_76cga3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2562 static PyObject *__pyx_pf_8PyClical_78cga3std(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2563 static PyObject *__pyx_pf_8PyClical_80agc3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2564 static PyObject *__pyx_pf_8PyClical_82e(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2565 static PyObject *__pyx_pf_8PyClical_84istpq(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_p, PyObject *__pyx_v_q);
2566 static PyObject *__pyx_pf_8PyClical_86_test(CYTHON_UNUSED PyObject *__pyx_self);
2567 static PyObject *__pyx_tp_new_8PyClical_index_set(PyTypeObject *t, PyObject *a, PyObject *k);
2568 static PyObject *__pyx_tp_new_8PyClical_clifford(PyTypeObject *t, PyObject *a, PyObject *k);
2569 static PyObject *__pyx_tp_new_8PyClical___pyx_scope_struct____iter__(PyTypeObject *t, PyObject *a, PyObject *k);
2570 static PyObject *__pyx_float_0_0;
2571 static PyObject *__pyx_float_1_0;
2572 static PyObject *__pyx_float_4_0;
2573 static PyObject *__pyx_float_8_0;
2574 static PyObject *__pyx_int_0;
2575 static PyObject *__pyx_int_1;
2576 static PyObject *__pyx_int_4;
2577 static PyObject *__pyx_int_neg_1;
2578 static PyObject *__pyx_tuple__3;
2579 static PyObject *__pyx_tuple__4;
2580 static PyObject *__pyx_tuple__10;
2581 static PyObject *__pyx_tuple__11;
2582 static PyObject *__pyx_tuple__12;
2583 static PyObject *__pyx_tuple__15;
2584 static PyObject *__pyx_tuple__16;
2585 static PyObject *__pyx_tuple__18;
2586 static PyObject *__pyx_tuple__20;
2587 static PyObject *__pyx_tuple__21;
2588 static PyObject *__pyx_tuple__22;
2589 static PyObject *__pyx_codeobj__13;
2590 static PyObject *__pyx_codeobj__14;
2591 static PyObject *__pyx_codeobj__17;
2592 static PyObject *__pyx_codeobj__19;
2593 static PyObject *__pyx_codeobj__23;
2604 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_toIndexSet(PyObject *__pyx_v_obj) {
2606 __Pyx_RefNannyDeclarations
2607 PyObject *__pyx_t_1 = NULL;
2608 int __pyx_lineno = 0;
2609 const char *__pyx_filename = NULL;
2610 int __pyx_clineno = 0;
2611 __Pyx_RefNannySetupContext(
"toIndexSet", 0);
2620 __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)
2621 __Pyx_GOTREF(__pyx_t_1);
2622 __pyx_r = (((
struct __pyx_obj_8PyClical_index_set *)__pyx_t_1)->instance[0]);
2623 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2636 __Pyx_XDECREF(__pyx_t_1);
2637 __Pyx_WriteUnraisable(
"PyClical.toIndexSet", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
2638 __Pyx_pretend_to_initialize(&__pyx_r);
2640 __Pyx_RefNannyFinishContext();
2652 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_9index_set_wrap(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self,
IndexSet __pyx_v_other) {
2653 PyObject *__pyx_r = NULL;
2654 __Pyx_RefNannyDeclarations
2655 __Pyx_RefNannySetupContext(
"wrap", 0);
2664 (__pyx_v_self->instance[0]) = __pyx_v_other;
2673 __Pyx_XDECREF(__pyx_r);
2674 __Pyx_INCREF(((PyObject *)__pyx_v_self));
2675 __pyx_r = ((PyObject *)__pyx_v_self);
2688 __Pyx_XGIVEREF(__pyx_r);
2689 __Pyx_RefNannyFinishContext();
2701 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_9index_set_unwrap(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
2703 __Pyx_RefNannyDeclarations
2704 __Pyx_RefNannySetupContext(
"unwrap", 0);
2713 __pyx_r = (__pyx_v_self->instance[0]);
2726 __Pyx_RefNannyFinishContext();
2738 static PyObject *__pyx_pw_8PyClical_9index_set_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
2739 static PyObject *__pyx_f_8PyClical_9index_set_copy(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self,
int __pyx_skip_dispatch) {
2740 PyObject *__pyx_r = NULL;
2741 __Pyx_RefNannyDeclarations
2742 PyObject *__pyx_t_1 = NULL;
2743 PyObject *__pyx_t_2 = NULL;
2744 PyObject *__pyx_t_3 = NULL;
2745 PyObject *__pyx_t_4 = NULL;
2746 int __pyx_lineno = 0;
2747 const char *__pyx_filename = NULL;
2748 int __pyx_clineno = 0;
2749 __Pyx_RefNannySetupContext(
"copy", 0);
2751 if (unlikely(__pyx_skip_dispatch)) ;
2753 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)))) {
2754 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
2755 static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
2756 if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
2757 PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
2759 __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)
2760 __Pyx_GOTREF(__pyx_t_1);
2761 if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(
void*)__pyx_pw_8PyClical_9index_set_1copy)) {
2762 __Pyx_XDECREF(__pyx_r);
2763 __Pyx_INCREF(__pyx_t_1);
2764 __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
2765 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
2766 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
2767 if (likely(__pyx_t_4)) {
2768 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
2769 __Pyx_INCREF(__pyx_t_4);
2770 __Pyx_INCREF(
function);
2771 __Pyx_DECREF_SET(__pyx_t_3,
function);
2774 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
2775 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
2776 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error)
2777 __Pyx_GOTREF(__pyx_t_2);
2778 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2779 __pyx_r = __pyx_t_2;
2781 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2784 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
2785 __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
2786 __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
2787 if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
2788 __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
2791 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2792 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
2804 __Pyx_XDECREF(__pyx_r);
2805 __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)
2806 __Pyx_GOTREF(__pyx_t_1);
2807 __pyx_r = __pyx_t_1;
2821 __Pyx_XDECREF(__pyx_t_1);
2822 __Pyx_XDECREF(__pyx_t_2);
2823 __Pyx_XDECREF(__pyx_t_3);
2824 __Pyx_XDECREF(__pyx_t_4);
2825 __Pyx_AddTraceback(
"PyClical.index_set.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
2828 __Pyx_XGIVEREF(__pyx_r);
2829 __Pyx_RefNannyFinishContext();
2834 static PyObject *__pyx_pw_8PyClical_9index_set_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
2835 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 ";
2836 static PyObject *__pyx_pw_8PyClical_9index_set_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
2837 PyObject *__pyx_r = 0;
2838 __Pyx_RefNannyDeclarations
2839 __Pyx_RefNannySetupContext(
"copy (wrapper)", 0);
2840 __pyx_r = __pyx_pf_8PyClical_9index_set_copy(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
2843 __Pyx_RefNannyFinishContext();
2847 static PyObject *__pyx_pf_8PyClical_9index_set_copy(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
2848 PyObject *__pyx_r = NULL;
2849 __Pyx_RefNannyDeclarations
2850 PyObject *__pyx_t_1 = NULL;
2851 int __pyx_lineno = 0;
2852 const char *__pyx_filename = NULL;
2853 int __pyx_clineno = 0;
2854 __Pyx_RefNannySetupContext(
"copy", 0);
2855 __Pyx_XDECREF(__pyx_r);
2856 __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)
2857 __Pyx_GOTREF(__pyx_t_1);
2858 __pyx_r = __pyx_t_1;
2864 __Pyx_XDECREF(__pyx_t_1);
2865 __Pyx_AddTraceback(
"PyClical.index_set.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
2868 __Pyx_XGIVEREF(__pyx_r);
2869 __Pyx_RefNannyFinishContext();
2882 static int __pyx_pw_8PyClical_9index_set_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2883 static int __pyx_pw_8PyClical_9index_set_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2884 PyObject *__pyx_v_other = 0;
2885 int __pyx_lineno = 0;
2886 const char *__pyx_filename = NULL;
2887 int __pyx_clineno = 0;
2889 __Pyx_RefNannyDeclarations
2890 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
2892 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,0};
2893 PyObject* values[1] = {0};
2894 values[0] = ((PyObject *)__pyx_int_0);
2895 if (unlikely(__pyx_kwds)) {
2897 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2899 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2902 default:
goto __pyx_L5_argtuple_error;
2904 kw_args = PyDict_Size(__pyx_kwds);
2908 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other);
2909 if (value) { values[0] = value; kw_args--; }
2912 if (unlikely(kw_args > 0)) {
2913 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(0, 74, __pyx_L3_error)
2916 switch (PyTuple_GET_SIZE(__pyx_args)) {
2917 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2920 default:
goto __pyx_L5_argtuple_error;
2923 __pyx_v_other = values[0];
2925 goto __pyx_L4_argument_unpacking_done;
2926 __pyx_L5_argtuple_error:;
2927 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 74, __pyx_L3_error)
2929 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2930 __Pyx_RefNannyFinishContext();
2932 __pyx_L4_argument_unpacking_done:;
2933 __pyx_r = __pyx_pf_8PyClical_9index_set_2__cinit__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), __pyx_v_other);
2936 __Pyx_RefNannyFinishContext();
2940 static int __pyx_pf_8PyClical_9index_set_2__cinit__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_other) {
2941 PyObject *__pyx_v_error_msg_prefix = NULL;
2942 PyObject *__pyx_v_idx = NULL;
2943 PyObject *__pyx_v_bother = NULL;
2945 __Pyx_RefNannyDeclarations
2949 PyObject *__pyx_t_4 = NULL;
2950 PyObject *__pyx_t_5 = NULL;
2953 PyObject *__pyx_t_8 = NULL;
2954 PyObject *__pyx_t_9 = NULL;
2955 PyObject *__pyx_t_10 = NULL;
2956 Py_ssize_t __pyx_t_11;
2957 PyObject *(*__pyx_t_12)(PyObject *);
2958 PyObject *__pyx_t_13 = NULL;
2959 PyObject *__pyx_t_14 = NULL;
2960 PyObject *__pyx_t_15 = NULL;
2961 PyObject *__pyx_t_16 = NULL;
2963 int __pyx_lineno = 0;
2964 const char *__pyx_filename = NULL;
2965 int __pyx_clineno = 0;
2966 __Pyx_RefNannySetupContext(
"__cinit__", 0);
2975 __Pyx_INCREF(__pyx_kp_u_Cannot_initialize_index_set_obje);
2976 __pyx_v_error_msg_prefix = __pyx_kp_u_Cannot_initialize_index_set_obje;
2985 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8PyClical_index_set);
2986 __pyx_t_2 = (__pyx_t_1 != 0);
2997 __pyx_t_3 =
new IndexSet(__pyx_f_8PyClical_9index_set_unwrap(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_other)));
2999 __Pyx_CppExn2PyErr();
3000 __PYX_ERR(0, 95, __pyx_L1_error)
3002 __pyx_v_self->instance = __pyx_t_3;
3021 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_numbers);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error)
3022 __Pyx_GOTREF(__pyx_t_4);
3023 __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)
3024 __Pyx_GOTREF(__pyx_t_5);
3025 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3026 __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)
3027 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3028 __pyx_t_1 = (__pyx_t_2 != 0);
3038 __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)
3040 __pyx_t_3 =
new IndexSet(((
int)__pyx_t_6));
3042 __Pyx_CppExn2PyErr();
3043 __PYX_ERR(0, 97, __pyx_L1_error)
3045 __pyx_v_self->instance = __pyx_t_3;
3064 __pyx_t_2 = PySet_Check(__pyx_v_other);
3065 __pyx_t_7 = (__pyx_t_2 != 0);
3068 __pyx_t_1 = __pyx_t_7;
3069 goto __pyx_L4_bool_binop_done;
3071 __pyx_t_7 = PyFrozenSet_Check(__pyx_v_other);
3072 __pyx_t_2 = (__pyx_t_7 != 0);
3073 __pyx_t_1 = __pyx_t_2;
3074 __pyx_L4_bool_binop_done:;
3075 __pyx_t_2 = (__pyx_t_1 != 0);
3086 __Pyx_PyThreadState_declare
3087 __Pyx_PyThreadState_assign
3088 __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
3089 __Pyx_XGOTREF(__pyx_t_8);
3090 __Pyx_XGOTREF(__pyx_t_9);
3091 __Pyx_XGOTREF(__pyx_t_10);
3102 __pyx_v_self->instance = __pyx_t_3;
3111 if (likely(PyList_CheckExact(__pyx_v_other)) || PyTuple_CheckExact(__pyx_v_other)) {
3112 __pyx_t_5 = __pyx_v_other; __Pyx_INCREF(__pyx_t_5); __pyx_t_11 = 0;
3115 __pyx_t_11 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_other);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 101, __pyx_L6_error)
3116 __Pyx_GOTREF(__pyx_t_5);
3117 __pyx_t_12 = Py_TYPE(__pyx_t_5)->tp_iternext;
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 101, __pyx_L6_error)
3120 if (likely(!__pyx_t_12)) {
3121 if (likely(PyList_CheckExact(__pyx_t_5))) {
3122 if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_5))
break;
3123 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3124 __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)
3126 __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)
3127 __Pyx_GOTREF(__pyx_t_4);
3130 if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_5))
break;
3131 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3132 __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)
3134 __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)
3135 __Pyx_GOTREF(__pyx_t_4);
3139 __pyx_t_4 = __pyx_t_12(__pyx_t_5);
3140 if (unlikely(!__pyx_t_4)) {
3141 PyObject* exc_type = PyErr_Occurred();
3143 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
3144 else __PYX_ERR(0, 101, __pyx_L6_error)
3148 __Pyx_GOTREF(__pyx_t_4);
3150 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_4);
3160 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self), __pyx_v_idx, Py_True) < 0)) __PYX_ERR(0, 102, __pyx_L6_error)
3170 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3180 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3181 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
3182 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3183 goto __pyx_L11_try_end;
3185 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3186 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3195 __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_IndexError);
3197 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3198 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_13) < 0) __PYX_ERR(0, 103, __pyx_L8_except_error)
3199 __Pyx_GOTREF(__pyx_t_5);
3200 __Pyx_GOTREF(__pyx_t_4);
3201 __Pyx_GOTREF(__pyx_t_13);
3210 __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)
3211 __Pyx_GOTREF(__pyx_t_14);
3212 __pyx_t_15 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 104, __pyx_L8_except_error)
3213 __Pyx_GOTREF(__pyx_t_15);
3214 __pyx_t_16 = __Pyx_PyUnicode_ConcatSafe(__pyx_t_14, __pyx_t_15);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 104, __pyx_L8_except_error)
3215 __Pyx_GOTREF(__pyx_t_16);
3216 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3217 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3218 __pyx_t_15 = __Pyx_PyUnicode_Concat(__pyx_t_16, __pyx_kp_u_);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 104, __pyx_L8_except_error)
3219 __Pyx_GOTREF(__pyx_t_15);
3220 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3221 __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)
3222 __Pyx_GOTREF(__pyx_t_16);
3223 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3224 __Pyx_Raise(__pyx_t_16, 0, 0, 0);
3225 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3226 __PYX_ERR(0, 104, __pyx_L8_except_error)
3236 __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
3238 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3239 if (__Pyx_GetException(&__pyx_t_13, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(0, 105, __pyx_L8_except_error)
3240 __Pyx_GOTREF(__pyx_t_13);
3241 __Pyx_GOTREF(__pyx_t_4);
3242 __Pyx_GOTREF(__pyx_t_5);
3251 __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)
3252 __Pyx_GOTREF(__pyx_t_16);
3253 __pyx_t_15 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 106, __pyx_L8_except_error)
3254 __Pyx_GOTREF(__pyx_t_15);
3255 __pyx_t_14 = __Pyx_PyUnicode_ConcatSafe(__pyx_t_16, __pyx_t_15);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 106, __pyx_L8_except_error)
3256 __Pyx_GOTREF(__pyx_t_14);
3257 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3258 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3259 __pyx_t_15 = __Pyx_PyUnicode_Concat(__pyx_t_14, __pyx_kp_u_);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 106, __pyx_L8_except_error)
3260 __Pyx_GOTREF(__pyx_t_15);
3261 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3262 __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)
3263 __Pyx_GOTREF(__pyx_t_14);
3264 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3265 __Pyx_Raise(__pyx_t_14, 0, 0, 0);
3266 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3267 __PYX_ERR(0, 106, __pyx_L8_except_error)
3269 goto __pyx_L8_except_error;
3270 __pyx_L8_except_error:;
3279 __Pyx_XGIVEREF(__pyx_t_8);
3280 __Pyx_XGIVEREF(__pyx_t_9);
3281 __Pyx_XGIVEREF(__pyx_t_10);
3282 __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
3283 goto __pyx_L1_error;
3304 __pyx_t_2 = PyUnicode_Check(__pyx_v_other);
3305 __pyx_t_1 = (__pyx_t_2 != 0);
3306 if (likely(__pyx_t_1)) {
3316 __Pyx_PyThreadState_declare
3317 __Pyx_PyThreadState_assign
3318 __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
3319 __Pyx_XGOTREF(__pyx_t_10);
3320 __Pyx_XGOTREF(__pyx_t_9);
3321 __Pyx_XGOTREF(__pyx_t_8);
3331 __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)
3332 __Pyx_GOTREF(__pyx_t_4);
3334 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
3335 __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_4);
3336 if (likely(__pyx_t_13)) {
3337 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
3338 __Pyx_INCREF(__pyx_t_13);
3339 __Pyx_INCREF(
function);
3340 __Pyx_DECREF_SET(__pyx_t_4,
function);
3343 __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);
3344 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
3345 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 109, __pyx_L18_error)
3346 __Pyx_GOTREF(__pyx_t_5);
3347 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3348 __pyx_v_bother = __pyx_t_5;
3358 __pyx_t_17 = __Pyx_PyObject_AsWritableString(__pyx_v_bother);
if (unlikely((!__pyx_t_17) && PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L18_error)
3360 __pyx_t_3 =
new IndexSet(((
char *)__pyx_t_17));
3362 __Pyx_CppExn2PyErr();
3363 __PYX_ERR(0, 110, __pyx_L18_error)
3365 __pyx_v_self->instance = __pyx_t_3;
3375 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3376 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
3377 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3378 goto __pyx_L23_try_end;
3380 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
3381 __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
3382 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
3383 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
3384 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3385 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3394 __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
3396 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3397 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_13) < 0) __PYX_ERR(0, 111, __pyx_L20_except_error)
3398 __Pyx_GOTREF(__pyx_t_5);
3399 __Pyx_GOTREF(__pyx_t_4);
3400 __Pyx_GOTREF(__pyx_t_13);
3409 __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)
3410 __Pyx_GOTREF(__pyx_t_14);
3411 __pyx_t_15 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 112, __pyx_L20_except_error)
3412 __Pyx_GOTREF(__pyx_t_15);
3413 __pyx_t_16 = __Pyx_PyUnicode_ConcatSafe(__pyx_t_14, __pyx_t_15);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 112, __pyx_L20_except_error)
3414 __Pyx_GOTREF(__pyx_t_16);
3415 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3416 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3417 __pyx_t_15 = __Pyx_PyUnicode_Concat(__pyx_t_16, __pyx_kp_u_);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 112, __pyx_L20_except_error)
3418 __Pyx_GOTREF(__pyx_t_15);
3419 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3420 __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)
3421 __Pyx_GOTREF(__pyx_t_16);
3422 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3423 __Pyx_Raise(__pyx_t_16, 0, 0, 0);
3424 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3425 __PYX_ERR(0, 112, __pyx_L20_except_error)
3427 goto __pyx_L20_except_error;
3428 __pyx_L20_except_error:;
3437 __Pyx_XGIVEREF(__pyx_t_10);
3438 __Pyx_XGIVEREF(__pyx_t_9);
3439 __Pyx_XGIVEREF(__pyx_t_8);
3440 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8);
3441 goto __pyx_L1_error;
3463 __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)
3464 __Pyx_GOTREF(__pyx_t_13);
3465 __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)
3466 __Pyx_GOTREF(__pyx_t_4);
3467 __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_t_13, __pyx_t_4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 114, __pyx_L1_error)
3468 __Pyx_GOTREF(__pyx_t_5);
3469 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
3470 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3471 __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_t_5, __pyx_kp_u_);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 114, __pyx_L1_error)
3472 __Pyx_GOTREF(__pyx_t_4);
3473 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3474 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 114, __pyx_L1_error)
3475 __Pyx_GOTREF(__pyx_t_5);
3476 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3477 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
3478 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3479 __PYX_ERR(0, 114, __pyx_L1_error)
3495 __Pyx_XDECREF(__pyx_t_4);
3496 __Pyx_XDECREF(__pyx_t_5);
3497 __Pyx_XDECREF(__pyx_t_13);
3498 __Pyx_XDECREF(__pyx_t_14);
3499 __Pyx_XDECREF(__pyx_t_15);
3500 __Pyx_XDECREF(__pyx_t_16);
3501 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3504 __Pyx_XDECREF(__pyx_v_error_msg_prefix);
3505 __Pyx_XDECREF(__pyx_v_idx);
3506 __Pyx_XDECREF(__pyx_v_bother);
3507 __Pyx_RefNannyFinishContext();
3520 static void __pyx_pw_8PyClical_9index_set_5__dealloc__(PyObject *__pyx_v_self);
3521 static void __pyx_pw_8PyClical_9index_set_5__dealloc__(PyObject *__pyx_v_self) {
3522 __Pyx_RefNannyDeclarations
3523 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
3524 __pyx_pf_8PyClical_9index_set_4__dealloc__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
3527 __Pyx_RefNannyFinishContext();
3530 static void __pyx_pf_8PyClical_9index_set_4__dealloc__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
3531 __Pyx_RefNannyDeclarations
3532 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
3541 delete __pyx_v_self->instance;
3552 __Pyx_RefNannyFinishContext();
3564 static PyObject *__pyx_pw_8PyClical_9index_set_7__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op);
3565 static PyObject *__pyx_pw_8PyClical_9index_set_7__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op) {
3566 PyObject *__pyx_r = 0;
3567 __Pyx_RefNannyDeclarations
3568 __Pyx_RefNannySetupContext(
"__richcmp__ (wrapper)", 0);
3569 __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));
3572 __Pyx_RefNannyFinishContext();
3576 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) {
3577 PyObject *__pyx_v_eq = NULL;
3578 PyObject *__pyx_v_lt = NULL;
3579 PyObject *__pyx_r = NULL;
3580 __Pyx_RefNannyDeclarations
3584 PyObject *__pyx_t_4 = NULL;
3585 int __pyx_lineno = 0;
3586 const char *__pyx_filename = NULL;
3587 int __pyx_clineno = 0;
3588 __Pyx_RefNannySetupContext(
"__richcmp__", 0);
3597 __pyx_t_2 = (((PyObject *)__pyx_v_lhs) == Py_None);
3598 __pyx_t_3 = (__pyx_t_2 != 0);
3601 __pyx_t_1 = __pyx_t_3;
3602 goto __pyx_L4_bool_binop_done;
3604 __pyx_t_3 = (__pyx_v_rhs == Py_None);
3605 __pyx_t_2 = (__pyx_t_3 != 0);
3606 __pyx_t_1 = __pyx_t_2;
3607 __pyx_L4_bool_binop_done:;
3617 __pyx_t_1 = (((PyObject *)__pyx_v_lhs) == __pyx_v_rhs);
3618 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 144, __pyx_L1_error)
3619 __Pyx_GOTREF(__pyx_t_4);
3620 __pyx_v_eq = __pyx_t_4;
3630 switch (__pyx_v_op) {
3640 __Pyx_XDECREF(__pyx_r);
3641 __Pyx_INCREF(__pyx_v_eq);
3642 __pyx_r = __pyx_v_eq;
3662 __Pyx_XDECREF(__pyx_r);
3663 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_eq);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 148, __pyx_L1_error)
3664 __pyx_t_4 = __Pyx_PyBool_FromLong((!__pyx_t_1));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error)
3665 __Pyx_GOTREF(__pyx_t_4);
3666 __pyx_r = __pyx_t_4;
3687 switch (__pyx_v_op) {
3697 __Pyx_XDECREF(__pyx_r);
3698 __Pyx_INCREF(Py_False);
3719 __Pyx_XDECREF(__pyx_r);
3720 __Pyx_INCREF(__pyx_v_eq);
3721 __pyx_r = __pyx_v_eq;
3741 __Pyx_XDECREF(__pyx_r);
3742 __Pyx_INCREF(Py_False);
3763 __Pyx_XDECREF(__pyx_r);
3764 __Pyx_INCREF(__pyx_v_eq);
3765 __pyx_r = __pyx_v_eq;
3785 __Pyx_XDECREF(__pyx_r);
3786 __Pyx_INCREF(__pyx_builtin_NotImplemented);
3787 __pyx_r = __pyx_builtin_NotImplemented;
3811 __pyx_t_1 = (__pyx_f_8PyClical_toIndexSet(((PyObject *)__pyx_v_lhs)) == __pyx_f_8PyClical_toIndexSet(__pyx_v_rhs));
3812 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 161, __pyx_L1_error)
3813 __Pyx_GOTREF(__pyx_t_4);
3814 __pyx_v_eq = __pyx_t_4;
3824 switch (__pyx_v_op) {
3834 __Pyx_XDECREF(__pyx_r);
3835 __Pyx_INCREF(__pyx_v_eq);
3836 __pyx_r = __pyx_v_eq;
3856 __Pyx_XDECREF(__pyx_r);
3857 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_eq);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 165, __pyx_L1_error)
3858 __pyx_t_4 = __Pyx_PyBool_FromLong((!__pyx_t_1));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error)
3859 __Pyx_GOTREF(__pyx_t_4);
3860 __pyx_r = __pyx_t_4;
3881 __pyx_t_1 = (__pyx_f_8PyClical_toIndexSet(((PyObject *)__pyx_v_lhs)) < __pyx_f_8PyClical_toIndexSet(__pyx_v_rhs));
3882 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error)
3883 __Pyx_GOTREF(__pyx_t_4);
3884 __pyx_v_lt = __pyx_t_4;
3894 switch (__pyx_v_op) {
3904 __Pyx_XDECREF(__pyx_r);
3905 __Pyx_INCREF(__pyx_v_lt);
3906 __pyx_r = __pyx_v_lt;
3926 __Pyx_XDECREF(__pyx_r);
3927 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_lt);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 171, __pyx_L1_error)
3930 __Pyx_INCREF(__pyx_v_lt);
3931 __pyx_t_4 = __pyx_v_lt;
3932 goto __pyx_L6_bool_binop_done;
3934 __Pyx_INCREF(__pyx_v_eq);
3935 __pyx_t_4 = __pyx_v_eq;
3936 __pyx_L6_bool_binop_done:;
3937 __pyx_r = __pyx_t_4;
3958 __Pyx_XDECREF(__pyx_r);
3959 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_lt);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 173, __pyx_L1_error)
3962 __pyx_t_1 = __pyx_t_2;
3963 goto __pyx_L8_bool_binop_done;
3965 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_eq);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 173, __pyx_L1_error)
3966 __pyx_t_1 = __pyx_t_2;
3967 __pyx_L8_bool_binop_done:;
3968 __pyx_t_4 = __Pyx_PyBool_FromLong((!__pyx_t_1));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 173, __pyx_L1_error)
3969 __Pyx_GOTREF(__pyx_t_4);
3970 __pyx_r = __pyx_t_4;
3991 __Pyx_XDECREF(__pyx_r);
3992 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_lt);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 175, __pyx_L1_error)
3993 __pyx_t_4 = __Pyx_PyBool_FromLong((!__pyx_t_1));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 175, __pyx_L1_error)
3994 __Pyx_GOTREF(__pyx_t_4);
3995 __pyx_r = __pyx_t_4;
4016 __Pyx_XDECREF(__pyx_r);
4017 __Pyx_INCREF(__pyx_builtin_NotImplemented);
4018 __pyx_r = __pyx_builtin_NotImplemented;
4036 __Pyx_XDECREF(__pyx_t_4);
4037 __Pyx_AddTraceback(
"PyClical.index_set.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4040 __Pyx_XDECREF(__pyx_v_eq);
4041 __Pyx_XDECREF(__pyx_v_lt);
4042 __Pyx_XGIVEREF(__pyx_r);
4043 __Pyx_RefNannyFinishContext();
4056 static int __pyx_pw_8PyClical_9index_set_9__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx, PyObject *__pyx_v_val);
4057 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 ";
4058 #if CYTHON_COMPILING_IN_CPYTHON
4059 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_8__setitem__;
4061 static int __pyx_pw_8PyClical_9index_set_9__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx, PyObject *__pyx_v_val) {
4063 __Pyx_RefNannyDeclarations
4064 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
4065 __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));
4068 __Pyx_RefNannyFinishContext();
4072 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) {
4074 __Pyx_RefNannyDeclarations
4077 int __pyx_lineno = 0;
4078 const char *__pyx_filename = NULL;
4079 int __pyx_clineno = 0;
4080 __Pyx_RefNannySetupContext(
"__setitem__", 0);
4089 __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)
4090 __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)
4092 __pyx_v_self->instance->set(__pyx_t_1, __pyx_t_2);
4094 __Pyx_CppExn2PyErr();
4095 __PYX_ERR(0, 188, __pyx_L1_error)
4118 __Pyx_AddTraceback(
"PyClical.index_set.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4121 __Pyx_RefNannyFinishContext();
4134 static PyObject *__pyx_pw_8PyClical_9index_set_11__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx);
4135 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 ";
4136 #if CYTHON_COMPILING_IN_CPYTHON
4137 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_10__getitem__;
4139 static PyObject *__pyx_pw_8PyClical_9index_set_11__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx) {
4140 PyObject *__pyx_r = 0;
4141 __Pyx_RefNannyDeclarations
4142 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
4143 __pyx_r = __pyx_pf_8PyClical_9index_set_10__getitem__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_idx));
4146 __Pyx_RefNannyFinishContext();
4150 static PyObject *__pyx_pf_8PyClical_9index_set_10__getitem__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_idx) {
4151 PyObject *__pyx_r = NULL;
4152 __Pyx_RefNannyDeclarations
4154 PyObject *__pyx_t_2 = NULL;
4155 int __pyx_lineno = 0;
4156 const char *__pyx_filename = NULL;
4157 int __pyx_clineno = 0;
4158 __Pyx_RefNannySetupContext(
"__getitem__", 0);
4167 __Pyx_XDECREF(__pyx_r);
4168 __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)
4169 __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)
4170 __Pyx_GOTREF(__pyx_t_2);
4171 __pyx_r = __pyx_t_2;
4185 __Pyx_XDECREF(__pyx_t_2);
4186 __Pyx_AddTraceback(
"PyClical.index_set.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4189 __Pyx_XGIVEREF(__pyx_r);
4190 __Pyx_RefNannyFinishContext();
4203 static int __pyx_pw_8PyClical_9index_set_13__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx);
4204 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 ";
4205 #if CYTHON_COMPILING_IN_CPYTHON
4206 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_12__contains__;
4208 static int __pyx_pw_8PyClical_9index_set_13__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx) {
4210 __Pyx_RefNannyDeclarations
4211 __Pyx_RefNannySetupContext(
"__contains__ (wrapper)", 0);
4212 __pyx_r = __pyx_pf_8PyClical_9index_set_12__contains__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_idx));
4215 __Pyx_RefNannyFinishContext();
4219 static int __pyx_pf_8PyClical_9index_set_12__contains__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_idx) {
4221 __Pyx_RefNannyDeclarations
4223 int __pyx_lineno = 0;
4224 const char *__pyx_filename = NULL;
4225 int __pyx_clineno = 0;
4226 __Pyx_RefNannySetupContext(
"__contains__", 0);
4235 __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)
4236 __pyx_r = __pyx_v_self->instance->operator[](__pyx_t_1);
4249 __Pyx_AddTraceback(
"PyClical.index_set.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4252 __Pyx_RefNannyFinishContext();
4255 static PyObject *__pyx_gb_8PyClical_9index_set_16generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value);
4266 static PyObject *__pyx_pw_8PyClical_9index_set_15__iter__(PyObject *__pyx_v_self);
4267 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 ";
4268 #if CYTHON_COMPILING_IN_CPYTHON
4269 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_14__iter__;
4271 static PyObject *__pyx_pw_8PyClical_9index_set_15__iter__(PyObject *__pyx_v_self) {
4272 PyObject *__pyx_r = 0;
4273 __Pyx_RefNannyDeclarations
4274 __Pyx_RefNannySetupContext(
"__iter__ (wrapper)", 0);
4275 __pyx_r = __pyx_pf_8PyClical_9index_set_14__iter__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
4278 __Pyx_RefNannyFinishContext();
4282 static PyObject *__pyx_pf_8PyClical_9index_set_14__iter__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
4283 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *__pyx_cur_scope;
4284 PyObject *__pyx_r = NULL;
4285 __Pyx_RefNannyDeclarations
4286 int __pyx_lineno = 0;
4287 const char *__pyx_filename = NULL;
4288 int __pyx_clineno = 0;
4289 __Pyx_RefNannySetupContext(
"__iter__", 0);
4290 __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);
4291 if (unlikely(!__pyx_cur_scope)) {
4292 __pyx_cur_scope = ((
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)Py_None);
4293 __Pyx_INCREF(Py_None);
4294 __PYX_ERR(0, 229, __pyx_L1_error)
4296 __Pyx_GOTREF(__pyx_cur_scope);
4298 __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
4299 __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
4300 __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
4302 __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)
4303 __Pyx_DECREF(__pyx_cur_scope);
4304 __Pyx_RefNannyFinishContext();
4305 return (PyObject *) gen;
4310 __Pyx_AddTraceback(
"PyClical.index_set.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4312 __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
4313 __Pyx_XGIVEREF(__pyx_r);
4314 __Pyx_RefNannyFinishContext();
4318 static PyObject *__pyx_gb_8PyClical_9index_set_16generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value)
4320 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *__pyx_cur_scope = ((
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)__pyx_generator->closure);
4321 PyObject *__pyx_r = NULL;
4322 PyObject *__pyx_t_1 = NULL;
4323 PyObject *__pyx_t_2 = NULL;
4324 PyObject *__pyx_t_3 = NULL;
4325 PyObject *__pyx_t_4 = NULL;
4326 Py_ssize_t __pyx_t_5;
4327 PyObject *(*__pyx_t_6)(PyObject *);
4330 int __pyx_lineno = 0;
4331 const char *__pyx_filename = NULL;
4332 int __pyx_clineno = 0;
4333 __Pyx_RefNannyDeclarations
4334 __Pyx_RefNannySetupContext(
"__iter__", 0);
4335 switch (__pyx_generator->resume_label) {
4336 case 0:
goto __pyx_L3_first_run;
4337 case 1:
goto __pyx_L7_resume_from_yield;
4339 __Pyx_RefNannyFinishContext();
4342 __pyx_L3_first_run:;
4343 if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 229, __pyx_L1_error)
4352 __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)
4353 __Pyx_GOTREF(__pyx_t_2);
4355 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
4356 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
4357 if (likely(__pyx_t_3)) {
4358 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
4359 __Pyx_INCREF(__pyx_t_3);
4360 __Pyx_INCREF(
function);
4361 __Pyx_DECREF_SET(__pyx_t_2,
function);
4364 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
4365 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4366 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error)
4367 __Pyx_GOTREF(__pyx_t_1);
4368 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4369 __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)
4370 __Pyx_GOTREF(__pyx_t_3);
4372 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4373 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
4374 if (likely(__pyx_t_4)) {
4375 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4376 __Pyx_INCREF(__pyx_t_4);
4377 __Pyx_INCREF(
function);
4378 __Pyx_DECREF_SET(__pyx_t_3,
function);
4381 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
4382 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4383 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error)
4384 __Pyx_GOTREF(__pyx_t_2);
4385 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4386 __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)
4387 __Pyx_GOTREF(__pyx_t_3);
4388 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4389 __pyx_t_2 = PyTuple_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error)
4390 __Pyx_GOTREF(__pyx_t_2);
4391 __Pyx_GIVEREF(__pyx_t_1);
4392 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
4393 __Pyx_GIVEREF(__pyx_t_3);
4394 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
4397 __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)
4398 __Pyx_GOTREF(__pyx_t_3);
4399 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4400 if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
4401 __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
4404 __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error)
4405 __Pyx_GOTREF(__pyx_t_2);
4406 __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext;
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 236, __pyx_L1_error)
4408 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4410 if (likely(!__pyx_t_6)) {
4411 if (likely(PyList_CheckExact(__pyx_t_2))) {
4412 if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2))
break;
4413 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4414 __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)
4416 __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)
4417 __Pyx_GOTREF(__pyx_t_3);
4420 if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2))
break;
4421 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4422 __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)
4424 __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)
4425 __Pyx_GOTREF(__pyx_t_3);
4429 __pyx_t_3 = __pyx_t_6(__pyx_t_2);
4430 if (unlikely(!__pyx_t_3)) {
4431 PyObject* exc_type = PyErr_Occurred();
4433 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
4434 else __PYX_ERR(0, 236, __pyx_L1_error)
4438 __Pyx_GOTREF(__pyx_t_3);
4440 __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_idx);
4441 __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_idx, __pyx_t_3);
4442 __Pyx_GIVEREF(__pyx_t_3);
4452 __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)
4453 __pyx_t_8 = (__pyx_t_7 != 0);
4463 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_idx);
4464 __pyx_r = __pyx_cur_scope->__pyx_v_idx;
4465 __Pyx_XGIVEREF(__pyx_t_2);
4466 __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
4467 __pyx_cur_scope->__pyx_t_1 = __pyx_t_5;
4468 __pyx_cur_scope->__pyx_t_2 = __pyx_t_6;
4469 __Pyx_XGIVEREF(__pyx_r);
4470 __Pyx_RefNannyFinishContext();
4471 __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
4473 __pyx_generator->resume_label = 1;
4475 __pyx_L7_resume_from_yield:;
4476 __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
4477 __pyx_cur_scope->__pyx_t_0 = 0;
4478 __Pyx_XGOTREF(__pyx_t_2);
4479 __pyx_t_5 = __pyx_cur_scope->__pyx_t_1;
4480 __pyx_t_6 = __pyx_cur_scope->__pyx_t_2;
4481 if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 238, __pyx_L1_error)
4500 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4501 CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
4512 PyErr_SetNone(PyExc_StopIteration);
4515 __Pyx_XDECREF(__pyx_t_1);
4516 __Pyx_XDECREF(__pyx_t_2);
4517 __Pyx_XDECREF(__pyx_t_3);
4518 __Pyx_XDECREF(__pyx_t_4);
4519 __Pyx_AddTraceback(
"__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4521 __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
4522 #if !CYTHON_USE_EXC_INFO_STACK
4523 __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
4525 __pyx_generator->resume_label = -1;
4526 __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
4527 __Pyx_RefNannyFinishContext();
4540 static PyObject *__pyx_pw_8PyClical_9index_set_18__invert__(PyObject *__pyx_v_self);
4541 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 ";
4542 #if CYTHON_COMPILING_IN_CPYTHON
4543 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_17__invert__;
4545 static PyObject *__pyx_pw_8PyClical_9index_set_18__invert__(PyObject *__pyx_v_self) {
4546 PyObject *__pyx_r = 0;
4547 __Pyx_RefNannyDeclarations
4548 __Pyx_RefNannySetupContext(
"__invert__ (wrapper)", 0);
4549 __pyx_r = __pyx_pf_8PyClical_9index_set_17__invert__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
4552 __Pyx_RefNannyFinishContext();
4556 static PyObject *__pyx_pf_8PyClical_9index_set_17__invert__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
4557 PyObject *__pyx_r = NULL;
4558 __Pyx_RefNannyDeclarations
4559 PyObject *__pyx_t_1 = NULL;
4560 PyObject *__pyx_t_2 = NULL;
4561 int __pyx_lineno = 0;
4562 const char *__pyx_filename = NULL;
4563 int __pyx_clineno = 0;
4564 __Pyx_RefNannySetupContext(
"__invert__", 0);
4573 __Pyx_XDECREF(__pyx_r);
4574 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_index_set));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error)
4575 __Pyx_GOTREF(__pyx_t_1);
4576 __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)
4577 __Pyx_GOTREF(__pyx_t_2);
4578 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4579 __pyx_r = __pyx_t_2;
4593 __Pyx_XDECREF(__pyx_t_1);
4594 __Pyx_XDECREF(__pyx_t_2);
4595 __Pyx_AddTraceback(
"PyClical.index_set.__invert__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4598 __Pyx_XGIVEREF(__pyx_r);
4599 __Pyx_RefNannyFinishContext();
4612 static PyObject *__pyx_pw_8PyClical_9index_set_20__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
4613 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 ";
4614 #if CYTHON_COMPILING_IN_CPYTHON
4615 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_19__xor__;
4617 static PyObject *__pyx_pw_8PyClical_9index_set_20__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4618 PyObject *__pyx_r = 0;
4619 __Pyx_RefNannyDeclarations
4620 __Pyx_RefNannySetupContext(
"__xor__ (wrapper)", 0);
4621 __pyx_r = __pyx_pf_8PyClical_9index_set_19__xor__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
4624 __Pyx_RefNannyFinishContext();
4628 static PyObject *__pyx_pf_8PyClical_9index_set_19__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4629 PyObject *__pyx_r = NULL;
4630 __Pyx_RefNannyDeclarations
4631 PyObject *__pyx_t_1 = NULL;
4632 PyObject *__pyx_t_2 = NULL;
4633 int __pyx_lineno = 0;
4634 const char *__pyx_filename = NULL;
4635 int __pyx_clineno = 0;
4636 __Pyx_RefNannySetupContext(
"__xor__", 0);
4645 __Pyx_XDECREF(__pyx_r);
4646 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_index_set));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 258, __pyx_L1_error)
4647 __Pyx_GOTREF(__pyx_t_1);
4648 __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)
4649 __Pyx_GOTREF(__pyx_t_2);
4650 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4651 __pyx_r = __pyx_t_2;
4665 __Pyx_XDECREF(__pyx_t_1);
4666 __Pyx_XDECREF(__pyx_t_2);
4667 __Pyx_AddTraceback(
"PyClical.index_set.__xor__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4670 __Pyx_XGIVEREF(__pyx_r);
4671 __Pyx_RefNannyFinishContext();
4684 static PyObject *__pyx_pw_8PyClical_9index_set_22__ixor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
4685 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 ";
4686 #if CYTHON_COMPILING_IN_CPYTHON
4687 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_21__ixor__;
4689 static PyObject *__pyx_pw_8PyClical_9index_set_22__ixor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
4690 PyObject *__pyx_r = 0;
4691 __Pyx_RefNannyDeclarations
4692 __Pyx_RefNannySetupContext(
"__ixor__ (wrapper)", 0);
4693 __pyx_r = __pyx_pf_8PyClical_9index_set_21__ixor__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
4696 __Pyx_RefNannyFinishContext();
4700 static PyObject *__pyx_pf_8PyClical_9index_set_21__ixor__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs) {
4701 PyObject *__pyx_r = NULL;
4702 __Pyx_RefNannyDeclarations
4703 PyObject *__pyx_t_1 = NULL;
4704 int __pyx_lineno = 0;
4705 const char *__pyx_filename = NULL;
4706 int __pyx_clineno = 0;
4707 __Pyx_RefNannySetupContext(
"__ixor__", 0);
4716 __Pyx_XDECREF(__pyx_r);
4717 __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)
4718 __Pyx_GOTREF(__pyx_t_1);
4719 __pyx_r = __pyx_t_1;
4733 __Pyx_XDECREF(__pyx_t_1);
4734 __Pyx_AddTraceback(
"PyClical.index_set.__ixor__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4737 __Pyx_XGIVEREF(__pyx_r);
4738 __Pyx_RefNannyFinishContext();
4751 static PyObject *__pyx_pw_8PyClical_9index_set_24__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
4752 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 ";
4753 #if CYTHON_COMPILING_IN_CPYTHON
4754 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_23__and__;
4756 static PyObject *__pyx_pw_8PyClical_9index_set_24__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4757 PyObject *__pyx_r = 0;
4758 __Pyx_RefNannyDeclarations
4759 __Pyx_RefNannySetupContext(
"__and__ (wrapper)", 0);
4760 __pyx_r = __pyx_pf_8PyClical_9index_set_23__and__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
4763 __Pyx_RefNannyFinishContext();
4767 static PyObject *__pyx_pf_8PyClical_9index_set_23__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4768 PyObject *__pyx_r = NULL;
4769 __Pyx_RefNannyDeclarations
4770 PyObject *__pyx_t_1 = NULL;
4771 PyObject *__pyx_t_2 = NULL;
4772 int __pyx_lineno = 0;
4773 const char *__pyx_filename = NULL;
4774 int __pyx_clineno = 0;
4775 __Pyx_RefNannySetupContext(
"__and__", 0);
4784 __Pyx_XDECREF(__pyx_r);
4785 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_index_set));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error)
4786 __Pyx_GOTREF(__pyx_t_1);
4787 __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)
4788 __Pyx_GOTREF(__pyx_t_2);
4789 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4790 __pyx_r = __pyx_t_2;
4804 __Pyx_XDECREF(__pyx_t_1);
4805 __Pyx_XDECREF(__pyx_t_2);
4806 __Pyx_AddTraceback(
"PyClical.index_set.__and__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4809 __Pyx_XGIVEREF(__pyx_r);
4810 __Pyx_RefNannyFinishContext();
4823 static PyObject *__pyx_pw_8PyClical_9index_set_26__iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
4824 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 ";
4825 #if CYTHON_COMPILING_IN_CPYTHON
4826 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_25__iand__;
4828 static PyObject *__pyx_pw_8PyClical_9index_set_26__iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
4829 PyObject *__pyx_r = 0;
4830 __Pyx_RefNannyDeclarations
4831 __Pyx_RefNannySetupContext(
"__iand__ (wrapper)", 0);
4832 __pyx_r = __pyx_pf_8PyClical_9index_set_25__iand__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
4835 __Pyx_RefNannyFinishContext();
4839 static PyObject *__pyx_pf_8PyClical_9index_set_25__iand__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs) {
4840 PyObject *__pyx_r = NULL;
4841 __Pyx_RefNannyDeclarations
4842 PyObject *__pyx_t_1 = NULL;
4843 int __pyx_lineno = 0;
4844 const char *__pyx_filename = NULL;
4845 int __pyx_clineno = 0;
4846 __Pyx_RefNannySetupContext(
"__iand__", 0);
4855 __Pyx_XDECREF(__pyx_r);
4856 __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)
4857 __Pyx_GOTREF(__pyx_t_1);
4858 __pyx_r = __pyx_t_1;
4872 __Pyx_XDECREF(__pyx_t_1);
4873 __Pyx_AddTraceback(
"PyClical.index_set.__iand__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4876 __Pyx_XGIVEREF(__pyx_r);
4877 __Pyx_RefNannyFinishContext();
4890 static PyObject *__pyx_pw_8PyClical_9index_set_28__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
4891 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 ";
4892 #if CYTHON_COMPILING_IN_CPYTHON
4893 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_27__or__;
4895 static PyObject *__pyx_pw_8PyClical_9index_set_28__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4896 PyObject *__pyx_r = 0;
4897 __Pyx_RefNannyDeclarations
4898 __Pyx_RefNannySetupContext(
"__or__ (wrapper)", 0);
4899 __pyx_r = __pyx_pf_8PyClical_9index_set_27__or__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
4902 __Pyx_RefNannyFinishContext();
4906 static PyObject *__pyx_pf_8PyClical_9index_set_27__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4907 PyObject *__pyx_r = NULL;
4908 __Pyx_RefNannyDeclarations
4909 PyObject *__pyx_t_1 = NULL;
4910 PyObject *__pyx_t_2 = NULL;
4911 int __pyx_lineno = 0;
4912 const char *__pyx_filename = NULL;
4913 int __pyx_clineno = 0;
4914 __Pyx_RefNannySetupContext(
"__or__", 0);
4923 __Pyx_XDECREF(__pyx_r);
4924 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_index_set));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error)
4925 __Pyx_GOTREF(__pyx_t_1);
4926 __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)
4927 __Pyx_GOTREF(__pyx_t_2);
4928 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4929 __pyx_r = __pyx_t_2;
4943 __Pyx_XDECREF(__pyx_t_1);
4944 __Pyx_XDECREF(__pyx_t_2);
4945 __Pyx_AddTraceback(
"PyClical.index_set.__or__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4948 __Pyx_XGIVEREF(__pyx_r);
4949 __Pyx_RefNannyFinishContext();
4962 static PyObject *__pyx_pw_8PyClical_9index_set_30__ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
4963 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 ";
4964 #if CYTHON_COMPILING_IN_CPYTHON
4965 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_29__ior__;
4967 static PyObject *__pyx_pw_8PyClical_9index_set_30__ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
4968 PyObject *__pyx_r = 0;
4969 __Pyx_RefNannyDeclarations
4970 __Pyx_RefNannySetupContext(
"__ior__ (wrapper)", 0);
4971 __pyx_r = __pyx_pf_8PyClical_9index_set_29__ior__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
4974 __Pyx_RefNannyFinishContext();
4978 static PyObject *__pyx_pf_8PyClical_9index_set_29__ior__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs) {
4979 PyObject *__pyx_r = NULL;
4980 __Pyx_RefNannyDeclarations
4981 PyObject *__pyx_t_1 = NULL;
4982 int __pyx_lineno = 0;
4983 const char *__pyx_filename = NULL;
4984 int __pyx_clineno = 0;
4985 __Pyx_RefNannySetupContext(
"__ior__", 0);
4994 __Pyx_XDECREF(__pyx_r);
4995 __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)
4996 __Pyx_GOTREF(__pyx_t_1);
4997 __pyx_r = __pyx_t_1;
5011 __Pyx_XDECREF(__pyx_t_1);
5012 __Pyx_AddTraceback(
"PyClical.index_set.__ior__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5015 __Pyx_XGIVEREF(__pyx_r);
5016 __Pyx_RefNannyFinishContext();
5029 static PyObject *__pyx_pw_8PyClical_9index_set_32count(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5030 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 ";
5031 static PyObject *__pyx_pw_8PyClical_9index_set_32count(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5032 PyObject *__pyx_r = 0;
5033 __Pyx_RefNannyDeclarations
5034 __Pyx_RefNannySetupContext(
"count (wrapper)", 0);
5035 __pyx_r = __pyx_pf_8PyClical_9index_set_31count(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5038 __Pyx_RefNannyFinishContext();
5042 static PyObject *__pyx_pf_8PyClical_9index_set_31count(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5043 PyObject *__pyx_r = NULL;
5044 __Pyx_RefNannyDeclarations
5045 PyObject *__pyx_t_1 = NULL;
5046 int __pyx_lineno = 0;
5047 const char *__pyx_filename = NULL;
5048 int __pyx_clineno = 0;
5049 __Pyx_RefNannySetupContext(
"count", 0);
5058 __Pyx_XDECREF(__pyx_r);
5059 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->instance->count());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error)
5060 __Pyx_GOTREF(__pyx_t_1);
5061 __pyx_r = __pyx_t_1;
5075 __Pyx_XDECREF(__pyx_t_1);
5076 __Pyx_AddTraceback(
"PyClical.index_set.count", __pyx_clineno, __pyx_lineno, __pyx_filename);
5079 __Pyx_XGIVEREF(__pyx_r);
5080 __Pyx_RefNannyFinishContext();
5093 static PyObject *__pyx_pw_8PyClical_9index_set_34count_neg(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5094 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 ";
5095 static PyObject *__pyx_pw_8PyClical_9index_set_34count_neg(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5096 PyObject *__pyx_r = 0;
5097 __Pyx_RefNannyDeclarations
5098 __Pyx_RefNannySetupContext(
"count_neg (wrapper)", 0);
5099 __pyx_r = __pyx_pf_8PyClical_9index_set_33count_neg(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5102 __Pyx_RefNannyFinishContext();
5106 static PyObject *__pyx_pf_8PyClical_9index_set_33count_neg(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5107 PyObject *__pyx_r = NULL;
5108 __Pyx_RefNannyDeclarations
5109 PyObject *__pyx_t_1 = NULL;
5110 int __pyx_lineno = 0;
5111 const char *__pyx_filename = NULL;
5112 int __pyx_clineno = 0;
5113 __Pyx_RefNannySetupContext(
"count_neg", 0);
5122 __Pyx_XDECREF(__pyx_r);
5123 __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)
5124 __Pyx_GOTREF(__pyx_t_1);
5125 __pyx_r = __pyx_t_1;
5139 __Pyx_XDECREF(__pyx_t_1);
5140 __Pyx_AddTraceback(
"PyClical.index_set.count_neg", __pyx_clineno, __pyx_lineno, __pyx_filename);
5143 __Pyx_XGIVEREF(__pyx_r);
5144 __Pyx_RefNannyFinishContext();
5157 static PyObject *__pyx_pw_8PyClical_9index_set_36count_pos(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5158 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 ";
5159 static PyObject *__pyx_pw_8PyClical_9index_set_36count_pos(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5160 PyObject *__pyx_r = 0;
5161 __Pyx_RefNannyDeclarations
5162 __Pyx_RefNannySetupContext(
"count_pos (wrapper)", 0);
5163 __pyx_r = __pyx_pf_8PyClical_9index_set_35count_pos(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5166 __Pyx_RefNannyFinishContext();
5170 static PyObject *__pyx_pf_8PyClical_9index_set_35count_pos(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5171 PyObject *__pyx_r = NULL;
5172 __Pyx_RefNannyDeclarations
5173 PyObject *__pyx_t_1 = NULL;
5174 int __pyx_lineno = 0;
5175 const char *__pyx_filename = NULL;
5176 int __pyx_clineno = 0;
5177 __Pyx_RefNannySetupContext(
"count_pos", 0);
5186 __Pyx_XDECREF(__pyx_r);
5187 __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)
5188 __Pyx_GOTREF(__pyx_t_1);
5189 __pyx_r = __pyx_t_1;
5203 __Pyx_XDECREF(__pyx_t_1);
5204 __Pyx_AddTraceback(
"PyClical.index_set.count_pos", __pyx_clineno, __pyx_lineno, __pyx_filename);
5207 __Pyx_XGIVEREF(__pyx_r);
5208 __Pyx_RefNannyFinishContext();
5221 static PyObject *__pyx_pw_8PyClical_9index_set_38min(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5222 static char __pyx_doc_8PyClical_9index_set_37min[] =
"\n Minimum member.\n\n >>> index_set({-1,1,2}).min()\n -1\n ";
5223 static PyObject *__pyx_pw_8PyClical_9index_set_38min(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5224 PyObject *__pyx_r = 0;
5225 __Pyx_RefNannyDeclarations
5226 __Pyx_RefNannySetupContext(
"min (wrapper)", 0);
5227 __pyx_r = __pyx_pf_8PyClical_9index_set_37min(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5230 __Pyx_RefNannyFinishContext();
5234 static PyObject *__pyx_pf_8PyClical_9index_set_37min(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5235 PyObject *__pyx_r = NULL;
5236 __Pyx_RefNannyDeclarations
5237 PyObject *__pyx_t_1 = NULL;
5238 int __pyx_lineno = 0;
5239 const char *__pyx_filename = NULL;
5240 int __pyx_clineno = 0;
5241 __Pyx_RefNannySetupContext(
"min", 0);
5250 __Pyx_XDECREF(__pyx_r);
5251 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->instance->min());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 349, __pyx_L1_error)
5252 __Pyx_GOTREF(__pyx_t_1);
5253 __pyx_r = __pyx_t_1;
5267 __Pyx_XDECREF(__pyx_t_1);
5268 __Pyx_AddTraceback(
"PyClical.index_set.min", __pyx_clineno, __pyx_lineno, __pyx_filename);
5271 __Pyx_XGIVEREF(__pyx_r);
5272 __Pyx_RefNannyFinishContext();
5285 static PyObject *__pyx_pw_8PyClical_9index_set_40max(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5286 static char __pyx_doc_8PyClical_9index_set_39max[] =
"\n Maximum member.\n\n >>> index_set({-1,1,2}).max()\n 2\n ";
5287 static PyObject *__pyx_pw_8PyClical_9index_set_40max(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5288 PyObject *__pyx_r = 0;
5289 __Pyx_RefNannyDeclarations
5290 __Pyx_RefNannySetupContext(
"max (wrapper)", 0);
5291 __pyx_r = __pyx_pf_8PyClical_9index_set_39max(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5294 __Pyx_RefNannyFinishContext();
5298 static PyObject *__pyx_pf_8PyClical_9index_set_39max(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5299 PyObject *__pyx_r = NULL;
5300 __Pyx_RefNannyDeclarations
5301 PyObject *__pyx_t_1 = NULL;
5302 int __pyx_lineno = 0;
5303 const char *__pyx_filename = NULL;
5304 int __pyx_clineno = 0;
5305 __Pyx_RefNannySetupContext(
"max", 0);
5314 __Pyx_XDECREF(__pyx_r);
5315 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->instance->max());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 358, __pyx_L1_error)
5316 __Pyx_GOTREF(__pyx_t_1);
5317 __pyx_r = __pyx_t_1;
5331 __Pyx_XDECREF(__pyx_t_1);
5332 __Pyx_AddTraceback(
"PyClical.index_set.max", __pyx_clineno, __pyx_lineno, __pyx_filename);
5335 __Pyx_XGIVEREF(__pyx_r);
5336 __Pyx_RefNannyFinishContext();
5349 static PyObject *__pyx_pw_8PyClical_9index_set_42hash_fn(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5350 static char __pyx_doc_8PyClical_9index_set_41hash_fn[] =
"\n Hash function.\n ";
5351 static PyObject *__pyx_pw_8PyClical_9index_set_42hash_fn(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5352 PyObject *__pyx_r = 0;
5353 __Pyx_RefNannyDeclarations
5354 __Pyx_RefNannySetupContext(
"hash_fn (wrapper)", 0);
5355 __pyx_r = __pyx_pf_8PyClical_9index_set_41hash_fn(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5358 __Pyx_RefNannyFinishContext();
5362 static PyObject *__pyx_pf_8PyClical_9index_set_41hash_fn(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5363 PyObject *__pyx_r = NULL;
5364 __Pyx_RefNannyDeclarations
5365 PyObject *__pyx_t_1 = NULL;
5366 int __pyx_lineno = 0;
5367 const char *__pyx_filename = NULL;
5368 int __pyx_clineno = 0;
5369 __Pyx_RefNannySetupContext(
"hash_fn", 0);
5378 __Pyx_XDECREF(__pyx_r);
5379 __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)
5380 __Pyx_GOTREF(__pyx_t_1);
5381 __pyx_r = __pyx_t_1;
5395 __Pyx_XDECREF(__pyx_t_1);
5396 __Pyx_AddTraceback(
"PyClical.index_set.hash_fn", __pyx_clineno, __pyx_lineno, __pyx_filename);
5399 __Pyx_XGIVEREF(__pyx_r);
5400 __Pyx_RefNannyFinishContext();
5413 static PyObject *__pyx_pw_8PyClical_9index_set_44sign_of_mult(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
5414 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 ";
5415 static PyObject *__pyx_pw_8PyClical_9index_set_44sign_of_mult(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
5416 PyObject *__pyx_r = 0;
5417 __Pyx_RefNannyDeclarations
5418 __Pyx_RefNannySetupContext(
"sign_of_mult (wrapper)", 0);
5419 __pyx_r = __pyx_pf_8PyClical_9index_set_43sign_of_mult(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
5422 __Pyx_RefNannyFinishContext();
5426 static PyObject *__pyx_pf_8PyClical_9index_set_43sign_of_mult(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs) {
5427 PyObject *__pyx_r = NULL;
5428 __Pyx_RefNannyDeclarations
5429 PyObject *__pyx_t_1 = NULL;
5430 int __pyx_lineno = 0;
5431 const char *__pyx_filename = NULL;
5432 int __pyx_clineno = 0;
5433 __Pyx_RefNannySetupContext(
"sign_of_mult", 0);
5442 __Pyx_XDECREF(__pyx_r);
5443 __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)
5444 __Pyx_GOTREF(__pyx_t_1);
5445 __pyx_r = __pyx_t_1;
5459 __Pyx_XDECREF(__pyx_t_1);
5460 __Pyx_AddTraceback(
"PyClical.index_set.sign_of_mult", __pyx_clineno, __pyx_lineno, __pyx_filename);
5463 __Pyx_XGIVEREF(__pyx_r);
5464 __Pyx_RefNannyFinishContext();
5477 static PyObject *__pyx_pw_8PyClical_9index_set_46sign_of_square(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5478 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 ";
5479 static PyObject *__pyx_pw_8PyClical_9index_set_46sign_of_square(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5480 PyObject *__pyx_r = 0;
5481 __Pyx_RefNannyDeclarations
5482 __Pyx_RefNannySetupContext(
"sign_of_square (wrapper)", 0);
5483 __pyx_r = __pyx_pf_8PyClical_9index_set_45sign_of_square(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5486 __Pyx_RefNannyFinishContext();
5490 static PyObject *__pyx_pf_8PyClical_9index_set_45sign_of_square(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5491 PyObject *__pyx_r = NULL;
5492 __Pyx_RefNannyDeclarations
5493 PyObject *__pyx_t_1 = NULL;
5494 int __pyx_lineno = 0;
5495 const char *__pyx_filename = NULL;
5496 int __pyx_clineno = 0;
5497 __Pyx_RefNannySetupContext(
"sign_of_square", 0);
5506 __Pyx_XDECREF(__pyx_r);
5507 __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)
5508 __Pyx_GOTREF(__pyx_t_1);
5509 __pyx_r = __pyx_t_1;
5523 __Pyx_XDECREF(__pyx_t_1);
5524 __Pyx_AddTraceback(
"PyClical.index_set.sign_of_square", __pyx_clineno, __pyx_lineno, __pyx_filename);
5527 __Pyx_XGIVEREF(__pyx_r);
5528 __Pyx_RefNannyFinishContext();
5541 static PyObject *__pyx_pw_8PyClical_9index_set_48__repr__(PyObject *__pyx_v_self);
5542 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 ";
5543 #if CYTHON_COMPILING_IN_CPYTHON
5544 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_47__repr__;
5546 static PyObject *__pyx_pw_8PyClical_9index_set_48__repr__(PyObject *__pyx_v_self) {
5547 PyObject *__pyx_r = 0;
5548 __Pyx_RefNannyDeclarations
5549 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
5550 __pyx_r = __pyx_pf_8PyClical_9index_set_47__repr__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5553 __Pyx_RefNannyFinishContext();
5557 static PyObject *__pyx_pf_8PyClical_9index_set_47__repr__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5558 PyObject *__pyx_r = NULL;
5559 __Pyx_RefNannyDeclarations
5560 PyObject *__pyx_t_1 = NULL;
5561 int __pyx_lineno = 0;
5562 const char *__pyx_filename = NULL;
5563 int __pyx_clineno = 0;
5564 __Pyx_RefNannySetupContext(
"__repr__", 0);
5573 __Pyx_XDECREF(__pyx_r);
5574 __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)
5575 __Pyx_GOTREF(__pyx_t_1);
5576 __pyx_r = __pyx_t_1;
5590 __Pyx_XDECREF(__pyx_t_1);
5591 __Pyx_AddTraceback(
"PyClical.index_set.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5594 __Pyx_XGIVEREF(__pyx_r);
5595 __Pyx_RefNannyFinishContext();
5608 static PyObject *__pyx_pw_8PyClical_9index_set_50__str__(PyObject *__pyx_v_self);
5609 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 ";
5610 #if CYTHON_COMPILING_IN_CPYTHON
5611 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_49__str__;
5613 static PyObject *__pyx_pw_8PyClical_9index_set_50__str__(PyObject *__pyx_v_self) {
5614 PyObject *__pyx_r = 0;
5615 __Pyx_RefNannyDeclarations
5616 __Pyx_RefNannySetupContext(
"__str__ (wrapper)", 0);
5617 __pyx_r = __pyx_pf_8PyClical_9index_set_49__str__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5620 __Pyx_RefNannyFinishContext();
5624 static PyObject *__pyx_pf_8PyClical_9index_set_49__str__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5625 PyObject *__pyx_r = NULL;
5626 __Pyx_RefNannyDeclarations
5627 PyObject *__pyx_t_1 = NULL;
5628 int __pyx_lineno = 0;
5629 const char *__pyx_filename = NULL;
5630 int __pyx_clineno = 0;
5631 __Pyx_RefNannySetupContext(
"__str__", 0);
5640 __Pyx_XDECREF(__pyx_r);
5641 __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)
5642 __Pyx_GOTREF(__pyx_t_1);
5643 __pyx_r = __pyx_t_1;
5657 __Pyx_XDECREF(__pyx_t_1);
5658 __Pyx_AddTraceback(
"PyClical.index_set.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5661 __Pyx_XGIVEREF(__pyx_r);
5662 __Pyx_RefNannyFinishContext();
5673 static PyObject *__pyx_pw_8PyClical_9index_set_52__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5674 static PyObject *__pyx_pw_8PyClical_9index_set_52__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5675 PyObject *__pyx_r = 0;
5676 __Pyx_RefNannyDeclarations
5677 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
5678 __pyx_r = __pyx_pf_8PyClical_9index_set_51__reduce_cython__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5681 __Pyx_RefNannyFinishContext();
5685 static PyObject *__pyx_pf_8PyClical_9index_set_51__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5686 PyObject *__pyx_r = NULL;
5687 __Pyx_RefNannyDeclarations
5688 PyObject *__pyx_t_1 = NULL;
5689 int __pyx_lineno = 0;
5690 const char *__pyx_filename = NULL;
5691 int __pyx_clineno = 0;
5692 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
5700 __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)
5701 __Pyx_GOTREF(__pyx_t_1);
5702 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5703 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5704 __PYX_ERR(1, 2, __pyx_L1_error)
5714 __Pyx_XDECREF(__pyx_t_1);
5715 __Pyx_AddTraceback(
"PyClical.index_set.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5717 __Pyx_XGIVEREF(__pyx_r);
5718 __Pyx_RefNannyFinishContext();
5730 static PyObject *__pyx_pw_8PyClical_9index_set_54__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
5731 static PyObject *__pyx_pw_8PyClical_9index_set_54__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
5732 PyObject *__pyx_r = 0;
5733 __Pyx_RefNannyDeclarations
5734 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
5735 __pyx_r = __pyx_pf_8PyClical_9index_set_53__setstate_cython__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
5738 __Pyx_RefNannyFinishContext();
5742 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) {
5743 PyObject *__pyx_r = NULL;
5744 __Pyx_RefNannyDeclarations
5745 PyObject *__pyx_t_1 = NULL;
5746 int __pyx_lineno = 0;
5747 const char *__pyx_filename = NULL;
5748 int __pyx_clineno = 0;
5749 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
5756 __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)
5757 __Pyx_GOTREF(__pyx_t_1);
5758 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5759 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5760 __PYX_ERR(1, 4, __pyx_L1_error)
5771 __Pyx_XDECREF(__pyx_t_1);
5772 __Pyx_AddTraceback(
"PyClical.index_set.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5774 __Pyx_XGIVEREF(__pyx_r);
5775 __Pyx_RefNannyFinishContext();
5788 static PyObject *__pyx_pw_8PyClical_1index_set_hidden_doctests(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused);
5789 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 ";
5790 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};
5791 static PyObject *__pyx_pw_8PyClical_1index_set_hidden_doctests(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
5792 PyObject *__pyx_r = 0;
5793 __Pyx_RefNannyDeclarations
5794 __Pyx_RefNannySetupContext(
"index_set_hidden_doctests (wrapper)", 0);
5795 __pyx_r = __pyx_pf_8PyClical_index_set_hidden_doctests(__pyx_self);
5798 __Pyx_RefNannyFinishContext();
5802 static PyObject *__pyx_pf_8PyClical_index_set_hidden_doctests(CYTHON_UNUSED PyObject *__pyx_self) {
5803 PyObject *__pyx_r = NULL;
5804 __Pyx_RefNannyDeclarations
5805 __Pyx_RefNannySetupContext(
"index_set_hidden_doctests", 0);
5814 __Pyx_XDECREF(__pyx_r);
5815 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5828 __Pyx_XGIVEREF(__pyx_r);
5829 __Pyx_RefNannyFinishContext();
5841 static PyObject *__pyx_pw_8PyClical_3compare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5842 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_compare(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs, CYTHON_UNUSED
int __pyx_skip_dispatch) {
5843 PyObject *__pyx_r = NULL;
5844 __Pyx_RefNannyDeclarations
5845 PyObject *__pyx_t_1 = NULL;
5846 int __pyx_lineno = 0;
5847 const char *__pyx_filename = NULL;
5848 int __pyx_clineno = 0;
5849 __Pyx_RefNannySetupContext(
"compare", 0);
5858 __Pyx_XDECREF(__pyx_r);
5859 __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)
5860 __Pyx_GOTREF(__pyx_t_1);
5861 __pyx_r = __pyx_t_1;
5875 __Pyx_XDECREF(__pyx_t_1);
5876 __Pyx_AddTraceback(
"PyClical.compare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5879 __Pyx_XGIVEREF(__pyx_r);
5880 __Pyx_RefNannyFinishContext();
5885 static PyObject *__pyx_pw_8PyClical_3compare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5886 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 ";
5887 static PyObject *__pyx_pw_8PyClical_3compare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5888 PyObject *__pyx_v_lhs = 0;
5889 PyObject *__pyx_v_rhs = 0;
5890 int __pyx_lineno = 0;
5891 const char *__pyx_filename = NULL;
5892 int __pyx_clineno = 0;
5893 PyObject *__pyx_r = 0;
5894 __Pyx_RefNannyDeclarations
5895 __Pyx_RefNannySetupContext(
"compare (wrapper)", 0);
5897 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lhs,&__pyx_n_s_rhs,0};
5898 PyObject* values[2] = {0,0};
5899 if (unlikely(__pyx_kwds)) {
5901 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5903 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5905 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5908 default:
goto __pyx_L5_argtuple_error;
5910 kw_args = PyDict_Size(__pyx_kwds);
5913 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lhs)) != 0)) kw_args--;
5914 else goto __pyx_L5_argtuple_error;
5917 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rhs)) != 0)) kw_args--;
5919 __Pyx_RaiseArgtupleInvalid(
"compare", 1, 2, 2, 1); __PYX_ERR(0, 492, __pyx_L3_error)
5922 if (unlikely(kw_args > 0)) {
5923 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"compare") < 0)) __PYX_ERR(0, 492, __pyx_L3_error)
5925 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5926 goto __pyx_L5_argtuple_error;
5928 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5929 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5931 __pyx_v_lhs = values[0];
5932 __pyx_v_rhs = values[1];
5934 goto __pyx_L4_argument_unpacking_done;
5935 __pyx_L5_argtuple_error:;
5936 __Pyx_RaiseArgtupleInvalid(
"compare", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 492, __pyx_L3_error)
5938 __Pyx_AddTraceback(
"PyClical.compare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5939 __Pyx_RefNannyFinishContext();
5941 __pyx_L4_argument_unpacking_done:;
5942 __pyx_r = __pyx_pf_8PyClical_2compare(__pyx_self, __pyx_v_lhs, __pyx_v_rhs);
5945 __Pyx_RefNannyFinishContext();
5949 static PyObject *__pyx_pf_8PyClical_2compare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
5950 PyObject *__pyx_r = NULL;
5951 __Pyx_RefNannyDeclarations
5952 PyObject *__pyx_t_1 = NULL;
5953 int __pyx_lineno = 0;
5954 const char *__pyx_filename = NULL;
5955 int __pyx_clineno = 0;
5956 __Pyx_RefNannySetupContext(
"compare", 0);
5957 __Pyx_XDECREF(__pyx_r);
5958 __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)
5959 __Pyx_GOTREF(__pyx_t_1);
5960 __pyx_r = __pyx_t_1;
5966 __Pyx_XDECREF(__pyx_t_1);
5967 __Pyx_AddTraceback(
"PyClical.compare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5970 __Pyx_XGIVEREF(__pyx_r);
5971 __Pyx_RefNannyFinishContext();
5983 static PyObject *__pyx_pw_8PyClical_5min_neg(PyObject *__pyx_self, PyObject *__pyx_v_obj);
5984 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_min_neg(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
5985 PyObject *__pyx_r = NULL;
5986 __Pyx_RefNannyDeclarations
5987 PyObject *__pyx_t_1 = NULL;
5988 int __pyx_lineno = 0;
5989 const char *__pyx_filename = NULL;
5990 int __pyx_clineno = 0;
5991 __Pyx_RefNannySetupContext(
"min_neg", 0);
6000 __Pyx_XDECREF(__pyx_r);
6001 __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)
6002 __Pyx_GOTREF(__pyx_t_1);
6003 __pyx_r = __pyx_t_1;
6017 __Pyx_XDECREF(__pyx_t_1);
6018 __Pyx_AddTraceback(
"PyClical.min_neg", __pyx_clineno, __pyx_lineno, __pyx_filename);
6021 __Pyx_XGIVEREF(__pyx_r);
6022 __Pyx_RefNannyFinishContext();
6027 static PyObject *__pyx_pw_8PyClical_5min_neg(PyObject *__pyx_self, PyObject *__pyx_v_obj);
6028 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 ";
6029 static PyObject *__pyx_pw_8PyClical_5min_neg(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
6030 PyObject *__pyx_r = 0;
6031 __Pyx_RefNannyDeclarations
6032 __Pyx_RefNannySetupContext(
"min_neg (wrapper)", 0);
6033 __pyx_r = __pyx_pf_8PyClical_4min_neg(__pyx_self, ((PyObject *)__pyx_v_obj));
6036 __Pyx_RefNannyFinishContext();
6040 static PyObject *__pyx_pf_8PyClical_4min_neg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
6041 PyObject *__pyx_r = NULL;
6042 __Pyx_RefNannyDeclarations
6043 PyObject *__pyx_t_1 = NULL;
6044 int __pyx_lineno = 0;
6045 const char *__pyx_filename = NULL;
6046 int __pyx_clineno = 0;
6047 __Pyx_RefNannySetupContext(
"min_neg", 0);
6048 __Pyx_XDECREF(__pyx_r);
6049 __pyx_t_1 = __pyx_f_8PyClical_min_neg(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error)
6050 __Pyx_GOTREF(__pyx_t_1);
6051 __pyx_r = __pyx_t_1;
6057 __Pyx_XDECREF(__pyx_t_1);
6058 __Pyx_AddTraceback(
"PyClical.min_neg", __pyx_clineno, __pyx_lineno, __pyx_filename);
6061 __Pyx_XGIVEREF(__pyx_r);
6062 __Pyx_RefNannyFinishContext();
6074 static PyObject *__pyx_pw_8PyClical_7max_pos(PyObject *__pyx_self, PyObject *__pyx_v_obj);
6075 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_max_pos(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
6076 PyObject *__pyx_r = NULL;
6077 __Pyx_RefNannyDeclarations
6078 PyObject *__pyx_t_1 = NULL;
6079 int __pyx_lineno = 0;
6080 const char *__pyx_filename = NULL;
6081 int __pyx_clineno = 0;
6082 __Pyx_RefNannySetupContext(
"max_pos", 0);
6091 __Pyx_XDECREF(__pyx_r);
6092 __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)
6093 __Pyx_GOTREF(__pyx_t_1);
6094 __pyx_r = __pyx_t_1;
6108 __Pyx_XDECREF(__pyx_t_1);
6109 __Pyx_AddTraceback(
"PyClical.max_pos", __pyx_clineno, __pyx_lineno, __pyx_filename);
6112 __Pyx_XGIVEREF(__pyx_r);
6113 __Pyx_RefNannyFinishContext();
6118 static PyObject *__pyx_pw_8PyClical_7max_pos(PyObject *__pyx_self, PyObject *__pyx_v_obj);
6119 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 ";
6120 static PyObject *__pyx_pw_8PyClical_7max_pos(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
6121 PyObject *__pyx_r = 0;
6122 __Pyx_RefNannyDeclarations
6123 __Pyx_RefNannySetupContext(
"max_pos (wrapper)", 0);
6124 __pyx_r = __pyx_pf_8PyClical_6max_pos(__pyx_self, ((PyObject *)__pyx_v_obj));
6127 __Pyx_RefNannyFinishContext();
6131 static PyObject *__pyx_pf_8PyClical_6max_pos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
6132 PyObject *__pyx_r = NULL;
6133 __Pyx_RefNannyDeclarations
6134 PyObject *__pyx_t_1 = NULL;
6135 int __pyx_lineno = 0;
6136 const char *__pyx_filename = NULL;
6137 int __pyx_clineno = 0;
6138 __Pyx_RefNannySetupContext(
"max_pos", 0);
6139 __Pyx_XDECREF(__pyx_r);
6140 __pyx_t_1 = __pyx_f_8PyClical_max_pos(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 513, __pyx_L1_error)
6141 __Pyx_GOTREF(__pyx_t_1);
6142 __pyx_r = __pyx_t_1;
6148 __Pyx_XDECREF(__pyx_t_1);
6149 __Pyx_AddTraceback(
"PyClical.max_pos", __pyx_clineno, __pyx_lineno, __pyx_filename);
6152 __Pyx_XGIVEREF(__pyx_r);
6153 __Pyx_RefNannyFinishContext();
6165 static CYTHON_INLINE std::vector<scalar_t> __pyx_f_8PyClical_list_to_vector(PyObject *__pyx_v_lst) {
6166 std::vector<scalar_t> __pyx_v_v;
6167 PyObject *__pyx_v_s = NULL;
6168 std::vector<scalar_t> __pyx_r;
6169 __Pyx_RefNannyDeclarations
6170 PyObject *__pyx_t_1 = NULL;
6171 Py_ssize_t __pyx_t_2;
6172 PyObject *(*__pyx_t_3)(PyObject *);
6173 PyObject *__pyx_t_4 = NULL;
6175 int __pyx_lineno = 0;
6176 const char *__pyx_filename = NULL;
6177 int __pyx_clineno = 0;
6178 __Pyx_RefNannySetupContext(
"list_to_vector", 0);
6187 if (likely(PyList_CheckExact(__pyx_v_lst)) || PyTuple_CheckExact(__pyx_v_lst)) {
6188 __pyx_t_1 = __pyx_v_lst; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
6191 __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_lst);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error)
6192 __Pyx_GOTREF(__pyx_t_1);
6193 __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 527, __pyx_L1_error)
6196 if (likely(!__pyx_t_3)) {
6197 if (likely(PyList_CheckExact(__pyx_t_1))) {
6198 if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1))
break;
6199 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6200 __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)
6202 __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)
6203 __Pyx_GOTREF(__pyx_t_4);
6206 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1))
break;
6207 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6208 __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)
6210 __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)
6211 __Pyx_GOTREF(__pyx_t_4);
6215 __pyx_t_4 = __pyx_t_3(__pyx_t_1);
6216 if (unlikely(!__pyx_t_4)) {
6217 PyObject* exc_type = PyErr_Occurred();
6219 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
6220 else __PYX_ERR(0, 527, __pyx_L1_error)
6224 __Pyx_GOTREF(__pyx_t_4);
6226 __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_4);
6236 __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)
6238 __pyx_v_v.push_back(((
scalar_t)__pyx_t_5));
6240 __Pyx_CppExn2PyErr();
6241 __PYX_ERR(0, 528, __pyx_L1_error)
6252 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6261 __pyx_r = __pyx_v_v;
6274 __Pyx_XDECREF(__pyx_t_1);
6275 __Pyx_XDECREF(__pyx_t_4);
6276 __Pyx_WriteUnraisable(
"PyClical.list_to_vector", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6277 __Pyx_pretend_to_initialize(&__pyx_r);
6279 __Pyx_XDECREF(__pyx_v_s);
6280 __Pyx_RefNannyFinishContext();
6292 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_toClifford(PyObject *__pyx_v_obj) {
6294 __Pyx_RefNannyDeclarations
6295 PyObject *__pyx_t_1 = NULL;
6296 int __pyx_lineno = 0;
6297 const char *__pyx_filename = NULL;
6298 int __pyx_clineno = 0;
6299 __Pyx_RefNannySetupContext(
"toClifford", 0);
6308 __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)
6309 __Pyx_GOTREF(__pyx_t_1);
6310 __pyx_r = (((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_1)->instance[0]);
6311 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6324 __Pyx_XDECREF(__pyx_t_1);
6325 __Pyx_WriteUnraisable(
"PyClical.toClifford", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6326 __Pyx_pretend_to_initialize(&__pyx_r);
6328 __Pyx_RefNannyFinishContext();
6340 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_8clifford_wrap(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self,
Clifford __pyx_v_other) {
6341 PyObject *__pyx_r = NULL;
6342 __Pyx_RefNannyDeclarations
6343 __Pyx_RefNannySetupContext(
"wrap", 0);
6352 (__pyx_v_self->instance[0]) = __pyx_v_other;
6361 __Pyx_XDECREF(__pyx_r);
6362 __Pyx_INCREF(((PyObject *)__pyx_v_self));
6363 __pyx_r = ((PyObject *)__pyx_v_self);
6376 __Pyx_XGIVEREF(__pyx_r);
6377 __Pyx_RefNannyFinishContext();
6389 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_8clifford_unwrap(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
6391 __Pyx_RefNannyDeclarations
6392 __Pyx_RefNannySetupContext(
"unwrap", 0);
6401 __pyx_r = (__pyx_v_self->instance[0]);
6414 __Pyx_RefNannyFinishContext();
6426 static PyObject *__pyx_pw_8PyClical_8clifford_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
6427 static PyObject *__pyx_f_8PyClical_8clifford_copy(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self,
int __pyx_skip_dispatch) {
6428 PyObject *__pyx_r = NULL;
6429 __Pyx_RefNannyDeclarations
6430 PyObject *__pyx_t_1 = NULL;
6431 PyObject *__pyx_t_2 = NULL;
6432 PyObject *__pyx_t_3 = NULL;
6433 PyObject *__pyx_t_4 = NULL;
6434 int __pyx_lineno = 0;
6435 const char *__pyx_filename = NULL;
6436 int __pyx_clineno = 0;
6437 __Pyx_RefNannySetupContext(
"copy", 0);
6439 if (unlikely(__pyx_skip_dispatch)) ;
6441 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)))) {
6442 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
6443 static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
6444 if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
6445 PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
6447 __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)
6448 __Pyx_GOTREF(__pyx_t_1);
6449 if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(
void*)__pyx_pw_8PyClical_8clifford_1copy)) {
6450 __Pyx_XDECREF(__pyx_r);
6451 __Pyx_INCREF(__pyx_t_1);
6452 __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
6453 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
6454 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
6455 if (likely(__pyx_t_4)) {
6456 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
6457 __Pyx_INCREF(__pyx_t_4);
6458 __Pyx_INCREF(
function);
6459 __Pyx_DECREF_SET(__pyx_t_3,
function);
6462 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
6463 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6464 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 556, __pyx_L1_error)
6465 __Pyx_GOTREF(__pyx_t_2);
6466 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6467 __pyx_r = __pyx_t_2;
6469 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6472 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
6473 __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
6474 __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
6475 if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
6476 __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
6479 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6480 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
6492 __Pyx_XDECREF(__pyx_r);
6493 __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)
6494 __Pyx_GOTREF(__pyx_t_1);
6495 __pyx_r = __pyx_t_1;
6509 __Pyx_XDECREF(__pyx_t_1);
6510 __Pyx_XDECREF(__pyx_t_2);
6511 __Pyx_XDECREF(__pyx_t_3);
6512 __Pyx_XDECREF(__pyx_t_4);
6513 __Pyx_AddTraceback(
"PyClical.clifford.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
6516 __Pyx_XGIVEREF(__pyx_r);
6517 __Pyx_RefNannyFinishContext();
6522 static PyObject *__pyx_pw_8PyClical_8clifford_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
6523 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 ";
6524 static PyObject *__pyx_pw_8PyClical_8clifford_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
6525 PyObject *__pyx_r = 0;
6526 __Pyx_RefNannyDeclarations
6527 __Pyx_RefNannySetupContext(
"copy (wrapper)", 0);
6528 __pyx_r = __pyx_pf_8PyClical_8clifford_copy(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
6531 __Pyx_RefNannyFinishContext();
6535 static PyObject *__pyx_pf_8PyClical_8clifford_copy(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
6536 PyObject *__pyx_r = NULL;
6537 __Pyx_RefNannyDeclarations
6538 PyObject *__pyx_t_1 = NULL;
6539 int __pyx_lineno = 0;
6540 const char *__pyx_filename = NULL;
6541 int __pyx_clineno = 0;
6542 __Pyx_RefNannySetupContext(
"copy", 0);
6543 __Pyx_XDECREF(__pyx_r);
6544 __pyx_t_1 = __pyx_f_8PyClical_8clifford_copy(__pyx_v_self, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 556, __pyx_L1_error)
6545 __Pyx_GOTREF(__pyx_t_1);
6546 __pyx_r = __pyx_t_1;
6552 __Pyx_XDECREF(__pyx_t_1);
6553 __Pyx_AddTraceback(
"PyClical.clifford.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
6556 __Pyx_XGIVEREF(__pyx_r);
6557 __Pyx_RefNannyFinishContext();
6570 static int __pyx_pw_8PyClical_8clifford_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6571 static int __pyx_pw_8PyClical_8clifford_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6572 PyObject *__pyx_v_other = 0;
6573 PyObject *__pyx_v_ixt = 0;
6574 int __pyx_lineno = 0;
6575 const char *__pyx_filename = NULL;
6576 int __pyx_clineno = 0;
6578 __Pyx_RefNannyDeclarations
6579 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
6581 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_ixt,0};
6582 PyObject* values[2] = {0,0};
6583 values[0] = ((PyObject *)__pyx_int_0);
6584 values[1] = ((PyObject *)Py_None);
6585 if (unlikely(__pyx_kwds)) {
6587 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6589 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6591 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6594 default:
goto __pyx_L5_argtuple_error;
6596 kw_args = PyDict_Size(__pyx_kwds);
6600 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other);
6601 if (value) { values[0] = value; kw_args--; }
6606 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ixt);
6607 if (value) { values[1] = value; kw_args--; }
6610 if (unlikely(kw_args > 0)) {
6611 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(0, 565, __pyx_L3_error)
6614 switch (PyTuple_GET_SIZE(__pyx_args)) {
6615 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6617 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6620 default:
goto __pyx_L5_argtuple_error;
6623 __pyx_v_other = values[0];
6624 __pyx_v_ixt = values[1];
6626 goto __pyx_L4_argument_unpacking_done;
6627 __pyx_L5_argtuple_error:;
6628 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 565, __pyx_L3_error)
6630 __Pyx_AddTraceback(
"PyClical.clifford.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6631 __Pyx_RefNannyFinishContext();
6633 __pyx_L4_argument_unpacking_done:;
6634 __pyx_r = __pyx_pf_8PyClical_8clifford_2__cinit__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), __pyx_v_other, __pyx_v_ixt);
6637 __Pyx_RefNannyFinishContext();
6641 static int __pyx_pf_8PyClical_8clifford_2__cinit__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_ixt) {
6642 PyObject *__pyx_v_error_msg_prefix = NULL;
6643 PyObject *__pyx_v_bother = NULL;
6644 PyObject *__pyx_v_err = NULL;
6646 __Pyx_RefNannyDeclarations
6649 PyObject *__pyx_t_3 = NULL;
6650 PyObject *__pyx_t_4 = NULL;
6651 PyObject *__pyx_t_5 = NULL;
6653 PyObject *__pyx_t_7 = NULL;
6654 PyObject *__pyx_t_8 = NULL;
6656 PyObject *__pyx_t_10 = NULL;
6657 PyObject *__pyx_t_11 = NULL;
6658 PyObject *__pyx_t_12 = NULL;
6659 PyObject *__pyx_t_13 = NULL;
6662 PyObject *__pyx_t_16 = NULL;
6663 PyObject *__pyx_t_17 = NULL;
6664 PyObject *__pyx_t_18 = NULL;
6666 char const *__pyx_t_20;
6667 PyObject *__pyx_t_21 = NULL;
6668 PyObject *__pyx_t_22 = NULL;
6669 PyObject *__pyx_t_23 = NULL;
6670 int __pyx_lineno = 0;
6671 const char *__pyx_filename = NULL;
6672 int __pyx_clineno = 0;
6673 __Pyx_RefNannySetupContext(
"__cinit__", 0);
6682 __Pyx_INCREF(__pyx_kp_u_Cannot_initialize_clifford_objec);
6683 __pyx_v_error_msg_prefix = __pyx_kp_u_Cannot_initialize_clifford_objec;
6692 __pyx_t_1 = (__pyx_v_ixt == Py_None);
6693 __pyx_t_2 = (__pyx_t_1 != 0);
6704 __Pyx_PyThreadState_declare
6705 __Pyx_PyThreadState_assign
6706 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
6707 __Pyx_XGOTREF(__pyx_t_3);
6708 __Pyx_XGOTREF(__pyx_t_4);
6709 __Pyx_XGOTREF(__pyx_t_5);
6719 __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8PyClical_clifford);
6720 __pyx_t_1 = (__pyx_t_2 != 0);
6731 __pyx_t_6 =
new Clifford(__pyx_f_8PyClical_8clifford_unwrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_other)));
6733 __Pyx_CppExn2PyErr();
6734 __PYX_ERR(0, 592, __pyx_L4_error)
6736 __pyx_v_self->instance = __pyx_t_6;
6755 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8PyClical_index_set);
6756 __pyx_t_2 = (__pyx_t_1 != 0);
6767 __pyx_t_6 =
new Clifford(__pyx_f_8PyClical_9index_set_unwrap(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_other)), ((
scalar_t)1.0));
6769 __Pyx_CppExn2PyErr();
6770 __PYX_ERR(0, 594, __pyx_L4_error)
6772 __pyx_v_self->instance = __pyx_t_6;
6791 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_numbers);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 595, __pyx_L4_error)
6792 __Pyx_GOTREF(__pyx_t_7);
6793 __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)
6794 __Pyx_GOTREF(__pyx_t_8);
6795 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6796 __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)
6797 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6798 __pyx_t_1 = (__pyx_t_2 != 0);
6808 __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)
6812 __Pyx_CppExn2PyErr();
6813 __PYX_ERR(0, 596, __pyx_L4_error)
6815 __pyx_v_self->instance = __pyx_t_6;
6834 __pyx_t_1 = PyUnicode_Check(__pyx_v_other);
6835 __pyx_t_2 = (__pyx_t_1 != 0);
6836 if (likely(__pyx_t_2)) {
6846 __Pyx_PyThreadState_declare
6847 __Pyx_PyThreadState_assign
6848 __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
6849 __Pyx_XGOTREF(__pyx_t_10);
6850 __Pyx_XGOTREF(__pyx_t_11);
6851 __Pyx_XGOTREF(__pyx_t_12);
6861 __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)
6862 __Pyx_GOTREF(__pyx_t_7);
6864 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
6865 __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_7);
6866 if (likely(__pyx_t_13)) {
6867 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
6868 __Pyx_INCREF(__pyx_t_13);
6869 __Pyx_INCREF(
function);
6870 __Pyx_DECREF_SET(__pyx_t_7,
function);
6873 __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);
6874 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
6875 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 599, __pyx_L11_error)
6876 __Pyx_GOTREF(__pyx_t_8);
6877 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6878 __pyx_v_bother = __pyx_t_8;
6888 __pyx_t_14 = __Pyx_PyObject_AsWritableString(__pyx_v_bother);
if (unlikely((!__pyx_t_14) && PyErr_Occurred())) __PYX_ERR(0, 600, __pyx_L11_error)
6890 __pyx_t_6 =
new Clifford(((
char *)__pyx_t_14));
6892 __Pyx_CppExn2PyErr();
6893 __PYX_ERR(0, 600, __pyx_L11_error)
6895 __pyx_v_self->instance = __pyx_t_6;
6905 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
6906 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
6907 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
6908 goto __pyx_L16_try_end;
6910 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
6911 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6912 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
6921 __pyx_t_15 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
6923 __Pyx_AddTraceback(
"PyClical.clifford.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6924 if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_13) < 0) __PYX_ERR(0, 601, __pyx_L13_except_error)
6925 __Pyx_GOTREF(__pyx_t_8);
6926 __Pyx_GOTREF(__pyx_t_7);
6927 __Pyx_GOTREF(__pyx_t_13);
6936 __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)
6937 __Pyx_GOTREF(__pyx_t_16);
6938 __pyx_t_17 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 602, __pyx_L13_except_error)
6939 __Pyx_GOTREF(__pyx_t_17);
6940 __pyx_t_18 = __Pyx_PyUnicode_ConcatSafe(__pyx_t_16, __pyx_t_17);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 602, __pyx_L13_except_error)
6941 __Pyx_GOTREF(__pyx_t_18);
6942 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6943 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6944 __pyx_t_17 = __Pyx_PyUnicode_Concat(__pyx_t_18, __pyx_kp_u_);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 602, __pyx_L13_except_error)
6945 __Pyx_GOTREF(__pyx_t_17);
6946 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6947 __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)
6948 __Pyx_GOTREF(__pyx_t_18);
6949 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6950 __Pyx_Raise(__pyx_t_18, 0, 0, 0);
6951 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6952 __PYX_ERR(0, 602, __pyx_L13_except_error)
6954 goto __pyx_L13_except_error;
6955 __pyx_L13_except_error:;
6964 __Pyx_XGIVEREF(__pyx_t_10);
6965 __Pyx_XGIVEREF(__pyx_t_11);
6966 __Pyx_XGIVEREF(__pyx_t_12);
6967 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
6968 goto __pyx_L4_error;
6990 __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)
6991 __Pyx_GOTREF(__pyx_t_13);
6992 __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)
6993 __Pyx_GOTREF(__pyx_t_7);
6994 __pyx_t_8 = __Pyx_PyUnicode_Concat(__pyx_t_13, __pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 604, __pyx_L4_error)
6995 __Pyx_GOTREF(__pyx_t_8);
6996 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
6997 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6998 __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_t_8, __pyx_kp_u_);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 604, __pyx_L4_error)
6999 __Pyx_GOTREF(__pyx_t_7);
7000 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7001 __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 604, __pyx_L4_error)
7002 __Pyx_GOTREF(__pyx_t_8);
7003 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7004 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7005 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7006 __PYX_ERR(0, 604, __pyx_L4_error)
7018 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7019 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7020 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
7021 goto __pyx_L9_try_end;
7023 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
7024 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
7025 __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
7026 __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
7027 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
7028 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
7037 __pyx_t_15 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
7039 __Pyx_AddTraceback(
"PyClical.clifford.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7040 if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_13) < 0) __PYX_ERR(0, 605, __pyx_L6_except_error)
7041 __Pyx_GOTREF(__pyx_t_8);
7042 __Pyx_GOTREF(__pyx_t_7);
7043 __Pyx_GOTREF(__pyx_t_13);
7044 __Pyx_INCREF(__pyx_t_7);
7045 __pyx_v_err = __pyx_t_7;
7055 __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)
7056 __Pyx_GOTREF(__pyx_t_18);
7057 __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)
7058 __Pyx_GOTREF(__pyx_t_17);
7059 __pyx_t_16 = __Pyx_PyUnicode_Concat(__pyx_t_18, __pyx_t_17);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 606, __pyx_L24_error)
7060 __Pyx_GOTREF(__pyx_t_16);
7061 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
7062 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
7071 __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)
7072 __Pyx_GOTREF(__pyx_t_17);
7073 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7074 __pyx_t_16 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 607, __pyx_L24_error)
7075 __Pyx_GOTREF(__pyx_t_16);
7076 __pyx_t_18 = __Pyx_PyUnicode_ConcatSafe(__pyx_t_17, __pyx_t_16);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 607, __pyx_L24_error)
7077 __Pyx_GOTREF(__pyx_t_18);
7078 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
7079 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7080 __pyx_t_16 = __Pyx_PyUnicode_Concat(__pyx_t_18, __pyx_kp_u__5);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 607, __pyx_L24_error)
7081 __Pyx_GOTREF(__pyx_t_16);
7082 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
7091 __pyx_t_18 = __Pyx_PyUnicode_Concat(__pyx_t_16, __pyx_kp_u__6);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 608, __pyx_L24_error)
7092 __Pyx_GOTREF(__pyx_t_18);
7093 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7094 __pyx_t_16 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_err);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 608, __pyx_L24_error)
7095 __Pyx_GOTREF(__pyx_t_16);
7096 __pyx_t_17 = __Pyx_PyUnicode_Concat(__pyx_t_18, __pyx_t_16);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 608, __pyx_L24_error)
7097 __Pyx_GOTREF(__pyx_t_17);
7098 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
7099 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7108 __pyx_t_16 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_17);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 606, __pyx_L24_error)
7109 __Pyx_GOTREF(__pyx_t_16);
7110 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
7111 __Pyx_Raise(__pyx_t_16, 0, 0, 0);
7112 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7113 __PYX_ERR(0, 606, __pyx_L24_error)
7126 __Pyx_PyThreadState_declare
7127 __Pyx_PyThreadState_assign
7128 __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0;
7129 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
7130 __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
7131 __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
7132 if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23);
7133 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);
7134 __Pyx_XGOTREF(__pyx_t_12);
7135 __Pyx_XGOTREF(__pyx_t_11);
7136 __Pyx_XGOTREF(__pyx_t_10);
7137 __Pyx_XGOTREF(__pyx_t_21);
7138 __Pyx_XGOTREF(__pyx_t_22);
7139 __Pyx_XGOTREF(__pyx_t_23);
7140 __pyx_t_15 = __pyx_lineno; __pyx_t_19 = __pyx_clineno; __pyx_t_20 = __pyx_filename;
7142 __Pyx_DECREF(__pyx_v_err);
7145 if (PY_MAJOR_VERSION >= 3) {
7146 __Pyx_XGIVEREF(__pyx_t_21);
7147 __Pyx_XGIVEREF(__pyx_t_22);
7148 __Pyx_XGIVEREF(__pyx_t_23);
7149 __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_23);
7151 __Pyx_XGIVEREF(__pyx_t_12);
7152 __Pyx_XGIVEREF(__pyx_t_11);
7153 __Pyx_XGIVEREF(__pyx_t_10);
7154 __Pyx_ErrRestore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
7155 __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0;
7156 __pyx_lineno = __pyx_t_15; __pyx_clineno = __pyx_t_19; __pyx_filename = __pyx_t_20;
7157 goto __pyx_L6_except_error;
7161 goto __pyx_L6_except_error;
7162 __pyx_L6_except_error:;
7171 __Pyx_XGIVEREF(__pyx_t_3);
7172 __Pyx_XGIVEREF(__pyx_t_4);
7173 __Pyx_XGIVEREF(__pyx_t_5);
7174 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
7175 goto __pyx_L1_error;
7196 __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_ixt, __pyx_ptype_8PyClical_index_set);
7197 __pyx_t_1 = (__pyx_t_2 != 0);
7198 if (likely(__pyx_t_1)) {
7207 __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_numbers);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 610, __pyx_L1_error)
7208 __Pyx_GOTREF(__pyx_t_13);
7209 __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)
7210 __Pyx_GOTREF(__pyx_t_7);
7211 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7212 __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)
7213 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7214 __pyx_t_2 = (__pyx_t_1 != 0);
7224 __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)
7226 __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));
7228 __Pyx_CppExn2PyErr();
7229 __PYX_ERR(0, 611, __pyx_L1_error)
7231 __pyx_v_self->instance = __pyx_t_6;
7250 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_collections);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 612, __pyx_L1_error)
7251 __Pyx_GOTREF(__pyx_t_7);
7252 __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)
7253 __Pyx_GOTREF(__pyx_t_13);
7254 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7255 __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)
7256 __Pyx_GOTREF(__pyx_t_7);
7257 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7258 __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)
7259 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7260 __pyx_t_1 = (__pyx_t_2 != 0);
7261 if (likely(__pyx_t_1)) {
7271 __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)));
7273 __Pyx_CppExn2PyErr();
7274 __PYX_ERR(0, 613, __pyx_L1_error)
7276 __pyx_v_self->instance = __pyx_t_6;
7296 __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)
7297 __Pyx_GOTREF(__pyx_t_7);
7298 __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)
7299 __Pyx_GOTREF(__pyx_t_13);
7300 __pyx_t_8 = __Pyx_PyUnicode_Concat(__pyx_t_7, __pyx_t_13);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 615, __pyx_L1_error)
7301 __Pyx_GOTREF(__pyx_t_8);
7302 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7303 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7312 __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)
7313 __Pyx_GOTREF(__pyx_t_13);
7314 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7315 __pyx_t_8 = PyObject_Repr(__pyx_v_ixt);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 616, __pyx_L1_error)
7316 __Pyx_GOTREF(__pyx_t_8);
7317 __pyx_t_7 = __Pyx_PyUnicode_ConcatSafe(__pyx_t_13, __pyx_t_8);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 616, __pyx_L1_error)
7318 __Pyx_GOTREF(__pyx_t_7);
7319 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7320 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7321 __pyx_t_8 = __Pyx_PyUnicode_Concat(__pyx_t_7, __pyx_kp_u__9);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 616, __pyx_L1_error)
7322 __Pyx_GOTREF(__pyx_t_8);
7323 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7332 __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_8);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 615, __pyx_L1_error)
7333 __Pyx_GOTREF(__pyx_t_7);
7334 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7335 __Pyx_Raise(__pyx_t_7, 0, 0, 0);
7336 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7337 __PYX_ERR(0, 615, __pyx_L1_error)
7359 __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)
7360 __Pyx_GOTREF(__pyx_t_7);
7361 __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)
7362 __Pyx_GOTREF(__pyx_t_8);
7363 __pyx_t_13 = __Pyx_PyUnicode_Concat(__pyx_t_7, __pyx_t_8);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 618, __pyx_L1_error)
7364 __Pyx_GOTREF(__pyx_t_13);
7365 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7366 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7375 __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)
7376 __Pyx_GOTREF(__pyx_t_8);
7377 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7378 __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)
7379 __Pyx_GOTREF(__pyx_t_13);
7380 __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_t_8, __pyx_t_13);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 619, __pyx_L1_error)
7381 __Pyx_GOTREF(__pyx_t_7);
7382 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7383 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7384 __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)
7385 __Pyx_GOTREF(__pyx_t_13);
7386 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7395 __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_13);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 618, __pyx_L1_error)
7396 __Pyx_GOTREF(__pyx_t_7);
7397 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7398 __Pyx_Raise(__pyx_t_7, 0, 0, 0);
7399 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7400 __PYX_ERR(0, 618, __pyx_L1_error)
7416 __Pyx_XDECREF(__pyx_t_7);
7417 __Pyx_XDECREF(__pyx_t_8);
7418 __Pyx_XDECREF(__pyx_t_13);
7419 __Pyx_XDECREF(__pyx_t_16);
7420 __Pyx_XDECREF(__pyx_t_17);
7421 __Pyx_XDECREF(__pyx_t_18);
7422 __Pyx_AddTraceback(
"PyClical.clifford.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7425 __Pyx_XDECREF(__pyx_v_error_msg_prefix);
7426 __Pyx_XDECREF(__pyx_v_bother);
7427 __Pyx_XDECREF(__pyx_v_err);
7428 __Pyx_RefNannyFinishContext();
7441 static void __pyx_pw_8PyClical_8clifford_5__dealloc__(PyObject *__pyx_v_self);
7442 static void __pyx_pw_8PyClical_8clifford_5__dealloc__(PyObject *__pyx_v_self) {
7443 __Pyx_RefNannyDeclarations
7444 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
7445 __pyx_pf_8PyClical_8clifford_4__dealloc__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
7448 __Pyx_RefNannyFinishContext();
7451 static void __pyx_pf_8PyClical_8clifford_4__dealloc__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
7452 __Pyx_RefNannyDeclarations
7453 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
7462 delete __pyx_v_self->instance;
7473 __Pyx_RefNannyFinishContext();
7485 static int __pyx_pw_8PyClical_8clifford_7__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_x);
7486 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 ";
7487 #if CYTHON_COMPILING_IN_CPYTHON
7488 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_6__contains__;
7490 static int __pyx_pw_8PyClical_8clifford_7__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_x) {
7492 __Pyx_RefNannyDeclarations
7493 __Pyx_RefNannySetupContext(
"__contains__ (wrapper)", 0);
7494 __pyx_r = __pyx_pf_8PyClical_8clifford_6__contains__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_x));
7497 __Pyx_RefNannyFinishContext();
7501 static int __pyx_pf_8PyClical_8clifford_6__contains__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_x) {
7503 __Pyx_RefNannyDeclarations
7504 PyObject *__pyx_t_1 = NULL;
7505 int __pyx_lineno = 0;
7506 const char *__pyx_filename = NULL;
7507 int __pyx_clineno = 0;
7508 __Pyx_RefNannySetupContext(
"__contains__", 0);
7517 __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)
7518 __Pyx_GOTREF(__pyx_t_1);
7519 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
7520 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7521 __PYX_ERR(0, 636, __pyx_L1_error)
7533 __Pyx_XDECREF(__pyx_t_1);
7534 __Pyx_AddTraceback(
"PyClical.clifford.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7536 __Pyx_RefNannyFinishContext();
7549 static PyObject *__pyx_pw_8PyClical_8clifford_9__iter__(PyObject *__pyx_v_self);
7550 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 ";
7551 #if CYTHON_COMPILING_IN_CPYTHON
7552 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_8__iter__;
7554 static PyObject *__pyx_pw_8PyClical_8clifford_9__iter__(PyObject *__pyx_v_self) {
7555 PyObject *__pyx_r = 0;
7556 __Pyx_RefNannyDeclarations
7557 __Pyx_RefNannySetupContext(
"__iter__ (wrapper)", 0);
7558 __pyx_r = __pyx_pf_8PyClical_8clifford_8__iter__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
7561 __Pyx_RefNannyFinishContext();
7565 static PyObject *__pyx_pf_8PyClical_8clifford_8__iter__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
7566 PyObject *__pyx_r = NULL;
7567 __Pyx_RefNannyDeclarations
7568 PyObject *__pyx_t_1 = NULL;
7569 int __pyx_lineno = 0;
7570 const char *__pyx_filename = NULL;
7571 int __pyx_clineno = 0;
7572 __Pyx_RefNannySetupContext(
"__iter__", 0);
7581 __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)
7582 __Pyx_GOTREF(__pyx_t_1);
7583 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
7584 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7585 __PYX_ERR(0, 647, __pyx_L1_error)
7597 __Pyx_XDECREF(__pyx_t_1);
7598 __Pyx_AddTraceback(
"PyClical.clifford.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7600 __Pyx_XGIVEREF(__pyx_r);
7601 __Pyx_RefNannyFinishContext();
7614 static PyObject *__pyx_pw_8PyClical_8clifford_11reframe(PyObject *__pyx_v_self, PyObject *__pyx_v_ixt);
7615 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 ";
7616 static PyObject *__pyx_pw_8PyClical_8clifford_11reframe(PyObject *__pyx_v_self, PyObject *__pyx_v_ixt) {
7617 PyObject *__pyx_r = 0;
7618 __Pyx_RefNannyDeclarations
7619 __Pyx_RefNannySetupContext(
"reframe (wrapper)", 0);
7620 __pyx_r = __pyx_pf_8PyClical_8clifford_10reframe(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_ixt));
7623 __Pyx_RefNannyFinishContext();
7627 static PyObject *__pyx_pf_8PyClical_8clifford_10reframe(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_ixt) {
7628 PyObject *__pyx_v_error_msg_prefix = NULL;
7629 struct __pyx_obj_8PyClical_clifford *__pyx_v_result = NULL;
7630 PyObject *__pyx_v_err = NULL;
7631 PyObject *__pyx_r = NULL;
7632 __Pyx_RefNannyDeclarations
7635 PyObject *__pyx_t_3 = NULL;
7636 PyObject *__pyx_t_4 = NULL;
7637 PyObject *__pyx_t_5 = NULL;
7638 PyObject *__pyx_t_6 = NULL;
7641 PyObject *__pyx_t_9 = NULL;
7642 PyObject *__pyx_t_10 = NULL;
7643 PyObject *__pyx_t_11 = NULL;
7644 PyObject *__pyx_t_12 = NULL;
7645 PyObject *__pyx_t_13 = NULL;
7647 char const *__pyx_t_15;
7648 PyObject *__pyx_t_16 = NULL;
7649 PyObject *__pyx_t_17 = NULL;
7650 PyObject *__pyx_t_18 = NULL;
7651 PyObject *__pyx_t_19 = NULL;
7652 PyObject *__pyx_t_20 = NULL;
7653 PyObject *__pyx_t_21 = NULL;
7654 int __pyx_lineno = 0;
7655 const char *__pyx_filename = NULL;
7656 int __pyx_clineno = 0;
7657 __Pyx_RefNannySetupContext(
"reframe", 0);
7666 __Pyx_INCREF(__pyx_kp_u_Cannot_reframe);
7667 __pyx_v_error_msg_prefix = __pyx_kp_u_Cannot_reframe;
7676 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_ixt, __pyx_ptype_8PyClical_index_set);
7677 __pyx_t_2 = (__pyx_t_1 != 0);
7678 if (likely(__pyx_t_2)) {
7688 __Pyx_PyThreadState_declare
7689 __Pyx_PyThreadState_assign
7690 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
7691 __Pyx_XGOTREF(__pyx_t_3);
7692 __Pyx_XGOTREF(__pyx_t_4);
7693 __Pyx_XGOTREF(__pyx_t_5);
7703 __pyx_t_6 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 662, __pyx_L4_error)
7704 __Pyx_GOTREF(__pyx_t_6);
7705 __pyx_v_result = ((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_6);
7716 __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)));
7718 __Pyx_CppExn2PyErr();
7719 __PYX_ERR(0, 663, __pyx_L4_error)
7721 __pyx_v_result->instance = __pyx_t_7;
7731 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7732 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7733 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
7734 goto __pyx_L9_try_end;
7736 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
7745 __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
7747 __Pyx_AddTraceback(
"PyClical.clifford.reframe", __pyx_clineno, __pyx_lineno, __pyx_filename);
7748 if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 664, __pyx_L6_except_error)
7749 __Pyx_GOTREF(__pyx_t_6);
7750 __Pyx_GOTREF(__pyx_t_9);
7751 __Pyx_GOTREF(__pyx_t_10);
7752 __Pyx_INCREF(__pyx_t_9);
7753 __pyx_v_err = __pyx_t_9;
7763 __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)
7764 __Pyx_GOTREF(__pyx_t_11);
7765 __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)
7766 __Pyx_GOTREF(__pyx_t_12);
7767 __pyx_t_13 = __Pyx_PyUnicode_Concat(__pyx_t_11, __pyx_t_12);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 665, __pyx_L15_error)
7768 __Pyx_GOTREF(__pyx_t_13);
7769 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7770 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7771 __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)
7772 __Pyx_GOTREF(__pyx_t_12);
7773 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7782 __pyx_t_13 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_ixt);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 666, __pyx_L15_error)
7783 __Pyx_GOTREF(__pyx_t_13);
7784 __pyx_t_11 = __Pyx_PyUnicode_Concat(__pyx_t_12, __pyx_t_13);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 666, __pyx_L15_error)
7785 __Pyx_GOTREF(__pyx_t_11);
7786 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7787 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7788 __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)
7789 __Pyx_GOTREF(__pyx_t_13);
7790 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7799 __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)
7800 __Pyx_GOTREF(__pyx_t_11);
7801 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7802 __pyx_t_13 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_err);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 667, __pyx_L15_error)
7803 __Pyx_GOTREF(__pyx_t_13);
7804 __pyx_t_12 = __Pyx_PyUnicode_Concat(__pyx_t_11, __pyx_t_13);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 667, __pyx_L15_error)
7805 __Pyx_GOTREF(__pyx_t_12);
7806 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7807 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7816 __pyx_t_13 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_12);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 665, __pyx_L15_error)
7817 __Pyx_GOTREF(__pyx_t_13);
7818 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7819 __Pyx_Raise(__pyx_t_13, 0, 0, 0);
7820 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7821 __PYX_ERR(0, 665, __pyx_L15_error)
7834 __Pyx_PyThreadState_declare
7835 __Pyx_PyThreadState_assign
7836 __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
7837 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
7838 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
7839 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
7840 if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
7841 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);
7842 __Pyx_XGOTREF(__pyx_t_16);
7843 __Pyx_XGOTREF(__pyx_t_17);
7844 __Pyx_XGOTREF(__pyx_t_18);
7845 __Pyx_XGOTREF(__pyx_t_19);
7846 __Pyx_XGOTREF(__pyx_t_20);
7847 __Pyx_XGOTREF(__pyx_t_21);
7848 __pyx_t_8 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
7850 __Pyx_DECREF(__pyx_v_err);
7853 if (PY_MAJOR_VERSION >= 3) {
7854 __Pyx_XGIVEREF(__pyx_t_19);
7855 __Pyx_XGIVEREF(__pyx_t_20);
7856 __Pyx_XGIVEREF(__pyx_t_21);
7857 __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
7859 __Pyx_XGIVEREF(__pyx_t_16);
7860 __Pyx_XGIVEREF(__pyx_t_17);
7861 __Pyx_XGIVEREF(__pyx_t_18);
7862 __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
7863 __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
7864 __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
7865 goto __pyx_L6_except_error;
7869 goto __pyx_L6_except_error;
7870 __pyx_L6_except_error:;
7879 __Pyx_XGIVEREF(__pyx_t_3);
7880 __Pyx_XGIVEREF(__pyx_t_4);
7881 __Pyx_XGIVEREF(__pyx_t_5);
7882 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
7883 goto __pyx_L1_error;
7905 __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)
7906 __Pyx_GOTREF(__pyx_t_10);
7907 __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)
7908 __Pyx_GOTREF(__pyx_t_9);
7909 __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_t_10, __pyx_t_9);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 669, __pyx_L1_error)
7910 __Pyx_GOTREF(__pyx_t_6);
7911 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7912 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7913 __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)
7914 __Pyx_GOTREF(__pyx_t_9);
7915 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7916 __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_9);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 669, __pyx_L1_error)
7917 __Pyx_GOTREF(__pyx_t_6);
7918 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7919 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
7920 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7921 __PYX_ERR(0, 669, __pyx_L1_error)
7932 __Pyx_XDECREF(__pyx_r);
7933 __Pyx_INCREF(((PyObject *)__pyx_v_result));
7934 __pyx_r = ((PyObject *)__pyx_v_result);
7947 __Pyx_XDECREF(__pyx_t_6);
7948 __Pyx_XDECREF(__pyx_t_9);
7949 __Pyx_XDECREF(__pyx_t_10);
7950 __Pyx_XDECREF(__pyx_t_11);
7951 __Pyx_XDECREF(__pyx_t_12);
7952 __Pyx_XDECREF(__pyx_t_13);
7953 __Pyx_AddTraceback(
"PyClical.clifford.reframe", __pyx_clineno, __pyx_lineno, __pyx_filename);
7956 __Pyx_XDECREF(__pyx_v_error_msg_prefix);
7957 __Pyx_XDECREF((PyObject *)__pyx_v_result);
7958 __Pyx_XDECREF(__pyx_v_err);
7959 __Pyx_XGIVEREF(__pyx_r);
7960 __Pyx_RefNannyFinishContext();
7973 static PyObject *__pyx_pw_8PyClical_8clifford_13__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op);
7974 static PyObject *__pyx_pw_8PyClical_8clifford_13__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op) {
7975 PyObject *__pyx_r = 0;
7976 __Pyx_RefNannyDeclarations
7977 __Pyx_RefNannySetupContext(
"__richcmp__ (wrapper)", 0);
7978 __pyx_r = __pyx_pf_8PyClical_8clifford_12__richcmp__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs), ((
int)__pyx_v_op));
7981 __Pyx_RefNannyFinishContext();
7985 static PyObject *__pyx_pf_8PyClical_8clifford_12__richcmp__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op) {
7986 PyObject *__pyx_r = NULL;
7987 __Pyx_RefNannyDeclarations
7991 PyObject *__pyx_t_4 = NULL;
7992 PyObject *__pyx_t_5 = NULL;
7993 PyObject *__pyx_t_6 = NULL;
7994 int __pyx_lineno = 0;
7995 const char *__pyx_filename = NULL;
7996 int __pyx_clineno = 0;
7997 __Pyx_RefNannySetupContext(
"__richcmp__", 0);
8006 __pyx_t_1 = ((__pyx_v_op == 2) != 0);
8016 __pyx_t_2 = (((PyObject *)__pyx_v_lhs) == Py_None);
8017 __pyx_t_3 = (__pyx_t_2 != 0);
8020 __pyx_t_1 = __pyx_t_3;
8021 goto __pyx_L5_bool_binop_done;
8023 __pyx_t_3 = (__pyx_v_rhs == Py_None);
8024 __pyx_t_2 = (__pyx_t_3 != 0);
8025 __pyx_t_1 = __pyx_t_2;
8026 __pyx_L5_bool_binop_done:;
8036 __Pyx_XDECREF(__pyx_r);
8037 __pyx_t_1 = (((PyObject *)__pyx_v_lhs) == __pyx_v_rhs);
8038 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 693, __pyx_L1_error)
8039 __Pyx_GOTREF(__pyx_t_4);
8040 __pyx_r = __pyx_t_4;
8061 __Pyx_XDECREF(__pyx_r);
8062 __pyx_t_1 = (__pyx_f_8PyClical_toClifford(((PyObject *)__pyx_v_lhs)) == __pyx_f_8PyClical_toClifford(__pyx_v_rhs));
8063 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 695, __pyx_L1_error)
8064 __Pyx_GOTREF(__pyx_t_4);
8065 __pyx_r = __pyx_t_4;
8086 __pyx_t_1 = ((__pyx_v_op == 3) != 0);
8096 __pyx_t_2 = (((PyObject *)__pyx_v_lhs) == Py_None);
8097 __pyx_t_3 = (__pyx_t_2 != 0);
8100 __pyx_t_1 = __pyx_t_3;
8101 goto __pyx_L8_bool_binop_done;
8103 __pyx_t_3 = (__pyx_v_rhs == Py_None);
8104 __pyx_t_2 = (__pyx_t_3 != 0);
8105 __pyx_t_1 = __pyx_t_2;
8106 __pyx_L8_bool_binop_done:;
8116 __Pyx_XDECREF(__pyx_r);
8117 __pyx_t_1 = (((PyObject *)__pyx_v_lhs) == __pyx_v_rhs);
8118 __pyx_t_4 = __Pyx_PyBool_FromLong((!((!(!__pyx_t_1)) != 0)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 698, __pyx_L1_error)
8119 __Pyx_GOTREF(__pyx_t_4);
8120 __pyx_r = __pyx_t_4;
8141 __Pyx_XDECREF(__pyx_r);
8142 __pyx_t_1 = (__pyx_f_8PyClical_toClifford(((PyObject *)__pyx_v_lhs)) != __pyx_f_8PyClical_toClifford(__pyx_v_rhs));
8143 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 700, __pyx_L1_error)
8144 __Pyx_GOTREF(__pyx_t_4);
8145 __pyx_r = __pyx_t_4;
8166 __pyx_t_2 = __Pyx_TypeCheck(((PyObject *)__pyx_v_lhs), __pyx_ptype_8PyClical_clifford);
8167 __pyx_t_3 = (__pyx_t_2 != 0);
8170 __pyx_t_1 = __pyx_t_3;
8171 goto __pyx_L10_bool_binop_done;
8173 __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_rhs, __pyx_ptype_8PyClical_clifford);
8174 __pyx_t_2 = (__pyx_t_3 != 0);
8175 __pyx_t_1 = __pyx_t_2;
8176 __pyx_L10_bool_binop_done:;
8177 if (unlikely(__pyx_t_1)) {
8186 __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)
8187 __Pyx_GOTREF(__pyx_t_4);
8188 __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)
8189 __Pyx_GOTREF(__pyx_t_5);
8190 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8191 __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)
8192 __Pyx_GOTREF(__pyx_t_4);
8193 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8194 __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)
8195 __Pyx_GOTREF(__pyx_t_5);
8196 __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_t_4, __pyx_t_5);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 703, __pyx_L1_error)
8197 __Pyx_GOTREF(__pyx_t_6);
8198 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8199 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8200 __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_t_6, __pyx_kp_u_);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 703, __pyx_L1_error)
8201 __Pyx_GOTREF(__pyx_t_5);
8202 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8211 __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_5);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 702, __pyx_L1_error)
8212 __Pyx_GOTREF(__pyx_t_6);
8213 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8214 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
8215 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8216 __PYX_ERR(0, 702, __pyx_L1_error)
8235 __Pyx_XDECREF(__pyx_r);
8236 __Pyx_INCREF(__pyx_builtin_NotImplemented);
8237 __pyx_r = __pyx_builtin_NotImplemented;
8251 __Pyx_XDECREF(__pyx_t_4);
8252 __Pyx_XDECREF(__pyx_t_5);
8253 __Pyx_XDECREF(__pyx_t_6);
8254 __Pyx_AddTraceback(
"PyClical.clifford.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8257 __Pyx_XGIVEREF(__pyx_r);
8258 __Pyx_RefNannyFinishContext();
8271 static PyObject *__pyx_pw_8PyClical_8clifford_15__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ixt);
8272 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 ";
8273 #if CYTHON_COMPILING_IN_CPYTHON
8274 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_14__getitem__;
8276 static PyObject *__pyx_pw_8PyClical_8clifford_15__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ixt) {
8277 PyObject *__pyx_r = 0;
8278 __Pyx_RefNannyDeclarations
8279 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
8280 __pyx_r = __pyx_pf_8PyClical_8clifford_14__getitem__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_ixt));
8283 __Pyx_RefNannyFinishContext();
8287 static PyObject *__pyx_pf_8PyClical_8clifford_14__getitem__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_ixt) {
8288 PyObject *__pyx_r = NULL;
8289 __Pyx_RefNannyDeclarations
8290 PyObject *__pyx_t_1 = NULL;
8291 int __pyx_lineno = 0;
8292 const char *__pyx_filename = NULL;
8293 int __pyx_clineno = 0;
8294 __Pyx_RefNannySetupContext(
"__getitem__", 0);
8303 __Pyx_XDECREF(__pyx_r);
8304 __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)
8305 __Pyx_GOTREF(__pyx_t_1);
8306 __pyx_r = __pyx_t_1;
8320 __Pyx_XDECREF(__pyx_t_1);
8321 __Pyx_AddTraceback(
"PyClical.clifford.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8324 __Pyx_XGIVEREF(__pyx_r);
8325 __Pyx_RefNannyFinishContext();
8338 static PyObject *__pyx_pw_8PyClical_8clifford_17__neg__(PyObject *__pyx_v_self);
8339 static char __pyx_doc_8PyClical_8clifford_16__neg__[] =
"\n Unary -.\n\n >>> print(-clifford(\"{1}\"))\n -{1}\n ";
8340 #if CYTHON_COMPILING_IN_CPYTHON
8341 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_16__neg__;
8343 static PyObject *__pyx_pw_8PyClical_8clifford_17__neg__(PyObject *__pyx_v_self) {
8344 PyObject *__pyx_r = 0;
8345 __Pyx_RefNannyDeclarations
8346 __Pyx_RefNannySetupContext(
"__neg__ (wrapper)", 0);
8347 __pyx_r = __pyx_pf_8PyClical_8clifford_16__neg__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
8350 __Pyx_RefNannyFinishContext();
8354 static PyObject *__pyx_pf_8PyClical_8clifford_16__neg__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
8355 PyObject *__pyx_r = NULL;
8356 __Pyx_RefNannyDeclarations
8357 PyObject *__pyx_t_1 = NULL;
8358 PyObject *__pyx_t_2 = NULL;
8359 int __pyx_lineno = 0;
8360 const char *__pyx_filename = NULL;
8361 int __pyx_clineno = 0;
8362 __Pyx_RefNannySetupContext(
"__neg__", 0);
8371 __Pyx_XDECREF(__pyx_r);
8372 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 729, __pyx_L1_error)
8373 __Pyx_GOTREF(__pyx_t_1);
8374 __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)
8375 __Pyx_GOTREF(__pyx_t_2);
8376 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8377 __pyx_r = __pyx_t_2;
8391 __Pyx_XDECREF(__pyx_t_1);
8392 __Pyx_XDECREF(__pyx_t_2);
8393 __Pyx_AddTraceback(
"PyClical.clifford.__neg__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8396 __Pyx_XGIVEREF(__pyx_r);
8397 __Pyx_RefNannyFinishContext();
8410 static PyObject *__pyx_pw_8PyClical_8clifford_19__pos__(PyObject *__pyx_v_self);
8411 static char __pyx_doc_8PyClical_8clifford_18__pos__[] =
"\n Unary +.\n\n >>> print(+clifford(\"{1}\"))\n {1}\n ";
8412 #if CYTHON_COMPILING_IN_CPYTHON
8413 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_18__pos__;
8415 static PyObject *__pyx_pw_8PyClical_8clifford_19__pos__(PyObject *__pyx_v_self) {
8416 PyObject *__pyx_r = 0;
8417 __Pyx_RefNannyDeclarations
8418 __Pyx_RefNannySetupContext(
"__pos__ (wrapper)", 0);
8419 __pyx_r = __pyx_pf_8PyClical_8clifford_18__pos__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
8422 __Pyx_RefNannyFinishContext();
8426 static PyObject *__pyx_pf_8PyClical_8clifford_18__pos__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
8427 PyObject *__pyx_r = NULL;
8428 __Pyx_RefNannyDeclarations
8429 PyObject *__pyx_t_1 = NULL;
8430 int __pyx_lineno = 0;
8431 const char *__pyx_filename = NULL;
8432 int __pyx_clineno = 0;
8433 __Pyx_RefNannySetupContext(
"__pos__", 0);
8442 __Pyx_XDECREF(__pyx_r);
8443 __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)
8444 __Pyx_GOTREF(__pyx_t_1);
8445 __pyx_r = __pyx_t_1;
8459 __Pyx_XDECREF(__pyx_t_1);
8460 __Pyx_AddTraceback(
"PyClical.clifford.__pos__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8463 __Pyx_XGIVEREF(__pyx_r);
8464 __Pyx_RefNannyFinishContext();
8477 static PyObject *__pyx_pw_8PyClical_8clifford_21__add__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8478 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 ";
8479 #if CYTHON_COMPILING_IN_CPYTHON
8480 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_20__add__;
8482 static PyObject *__pyx_pw_8PyClical_8clifford_21__add__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8483 PyObject *__pyx_r = 0;
8484 __Pyx_RefNannyDeclarations
8485 __Pyx_RefNannySetupContext(
"__add__ (wrapper)", 0);
8486 __pyx_r = __pyx_pf_8PyClical_8clifford_20__add__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8489 __Pyx_RefNannyFinishContext();
8493 static PyObject *__pyx_pf_8PyClical_8clifford_20__add__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8494 PyObject *__pyx_r = NULL;
8495 __Pyx_RefNannyDeclarations
8496 PyObject *__pyx_t_1 = NULL;
8497 PyObject *__pyx_t_2 = NULL;
8498 int __pyx_lineno = 0;
8499 const char *__pyx_filename = NULL;
8500 int __pyx_clineno = 0;
8501 __Pyx_RefNannySetupContext(
"__add__", 0);
8510 __Pyx_XDECREF(__pyx_r);
8511 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 749, __pyx_L1_error)
8512 __Pyx_GOTREF(__pyx_t_1);
8513 __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)
8514 __Pyx_GOTREF(__pyx_t_2);
8515 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8516 __pyx_r = __pyx_t_2;
8530 __Pyx_XDECREF(__pyx_t_1);
8531 __Pyx_XDECREF(__pyx_t_2);
8532 __Pyx_AddTraceback(
"PyClical.clifford.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8535 __Pyx_XGIVEREF(__pyx_r);
8536 __Pyx_RefNannyFinishContext();
8549 static PyObject *__pyx_pw_8PyClical_8clifford_23__iadd__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8550 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 ";
8551 #if CYTHON_COMPILING_IN_CPYTHON
8552 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_22__iadd__;
8554 static PyObject *__pyx_pw_8PyClical_8clifford_23__iadd__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8555 PyObject *__pyx_r = 0;
8556 __Pyx_RefNannyDeclarations
8557 __Pyx_RefNannySetupContext(
"__iadd__ (wrapper)", 0);
8558 __pyx_r = __pyx_pf_8PyClical_8clifford_22__iadd__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8561 __Pyx_RefNannyFinishContext();
8565 static PyObject *__pyx_pf_8PyClical_8clifford_22__iadd__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8566 PyObject *__pyx_r = NULL;
8567 __Pyx_RefNannyDeclarations
8568 PyObject *__pyx_t_1 = NULL;
8569 int __pyx_lineno = 0;
8570 const char *__pyx_filename = NULL;
8571 int __pyx_clineno = 0;
8572 __Pyx_RefNannySetupContext(
"__iadd__", 0);
8581 __Pyx_XDECREF(__pyx_r);
8582 __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)
8583 __Pyx_GOTREF(__pyx_t_1);
8584 __pyx_r = __pyx_t_1;
8598 __Pyx_XDECREF(__pyx_t_1);
8599 __Pyx_AddTraceback(
"PyClical.clifford.__iadd__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8602 __Pyx_XGIVEREF(__pyx_r);
8603 __Pyx_RefNannyFinishContext();
8616 static PyObject *__pyx_pw_8PyClical_8clifford_25__sub__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8617 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 ";
8618 #if CYTHON_COMPILING_IN_CPYTHON
8619 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_24__sub__;
8621 static PyObject *__pyx_pw_8PyClical_8clifford_25__sub__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8622 PyObject *__pyx_r = 0;
8623 __Pyx_RefNannyDeclarations
8624 __Pyx_RefNannySetupContext(
"__sub__ (wrapper)", 0);
8625 __pyx_r = __pyx_pf_8PyClical_8clifford_24__sub__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8628 __Pyx_RefNannyFinishContext();
8632 static PyObject *__pyx_pf_8PyClical_8clifford_24__sub__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8633 PyObject *__pyx_r = NULL;
8634 __Pyx_RefNannyDeclarations
8635 PyObject *__pyx_t_1 = NULL;
8636 PyObject *__pyx_t_2 = NULL;
8637 int __pyx_lineno = 0;
8638 const char *__pyx_filename = NULL;
8639 int __pyx_clineno = 0;
8640 __Pyx_RefNannySetupContext(
"__sub__", 0);
8649 __Pyx_XDECREF(__pyx_r);
8650 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 769, __pyx_L1_error)
8651 __Pyx_GOTREF(__pyx_t_1);
8652 __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)
8653 __Pyx_GOTREF(__pyx_t_2);
8654 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8655 __pyx_r = __pyx_t_2;
8669 __Pyx_XDECREF(__pyx_t_1);
8670 __Pyx_XDECREF(__pyx_t_2);
8671 __Pyx_AddTraceback(
"PyClical.clifford.__sub__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8674 __Pyx_XGIVEREF(__pyx_r);
8675 __Pyx_RefNannyFinishContext();
8688 static PyObject *__pyx_pw_8PyClical_8clifford_27__isub__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8689 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 ";
8690 #if CYTHON_COMPILING_IN_CPYTHON
8691 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_26__isub__;
8693 static PyObject *__pyx_pw_8PyClical_8clifford_27__isub__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8694 PyObject *__pyx_r = 0;
8695 __Pyx_RefNannyDeclarations
8696 __Pyx_RefNannySetupContext(
"__isub__ (wrapper)", 0);
8697 __pyx_r = __pyx_pf_8PyClical_8clifford_26__isub__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8700 __Pyx_RefNannyFinishContext();
8704 static PyObject *__pyx_pf_8PyClical_8clifford_26__isub__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8705 PyObject *__pyx_r = NULL;
8706 __Pyx_RefNannyDeclarations
8707 PyObject *__pyx_t_1 = NULL;
8708 int __pyx_lineno = 0;
8709 const char *__pyx_filename = NULL;
8710 int __pyx_clineno = 0;
8711 __Pyx_RefNannySetupContext(
"__isub__", 0);
8720 __Pyx_XDECREF(__pyx_r);
8721 __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)
8722 __Pyx_GOTREF(__pyx_t_1);
8723 __pyx_r = __pyx_t_1;
8737 __Pyx_XDECREF(__pyx_t_1);
8738 __Pyx_AddTraceback(
"PyClical.clifford.__isub__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8741 __Pyx_XGIVEREF(__pyx_r);
8742 __Pyx_RefNannyFinishContext();
8755 static PyObject *__pyx_pw_8PyClical_8clifford_29__mul__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8756 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 ";
8757 #if CYTHON_COMPILING_IN_CPYTHON
8758 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_28__mul__;
8760 static PyObject *__pyx_pw_8PyClical_8clifford_29__mul__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8761 PyObject *__pyx_r = 0;
8762 __Pyx_RefNannyDeclarations
8763 __Pyx_RefNannySetupContext(
"__mul__ (wrapper)", 0);
8764 __pyx_r = __pyx_pf_8PyClical_8clifford_28__mul__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8767 __Pyx_RefNannyFinishContext();
8771 static PyObject *__pyx_pf_8PyClical_8clifford_28__mul__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8772 PyObject *__pyx_r = NULL;
8773 __Pyx_RefNannyDeclarations
8774 PyObject *__pyx_t_1 = NULL;
8775 PyObject *__pyx_t_2 = NULL;
8776 int __pyx_lineno = 0;
8777 const char *__pyx_filename = NULL;
8778 int __pyx_clineno = 0;
8779 __Pyx_RefNannySetupContext(
"__mul__", 0);
8788 __Pyx_XDECREF(__pyx_r);
8789 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 791, __pyx_L1_error)
8790 __Pyx_GOTREF(__pyx_t_1);
8791 __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)
8792 __Pyx_GOTREF(__pyx_t_2);
8793 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8794 __pyx_r = __pyx_t_2;
8808 __Pyx_XDECREF(__pyx_t_1);
8809 __Pyx_XDECREF(__pyx_t_2);
8810 __Pyx_AddTraceback(
"PyClical.clifford.__mul__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8813 __Pyx_XGIVEREF(__pyx_r);
8814 __Pyx_RefNannyFinishContext();
8827 static PyObject *__pyx_pw_8PyClical_8clifford_31__imul__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8828 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 ";
8829 #if CYTHON_COMPILING_IN_CPYTHON
8830 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_30__imul__;
8832 static PyObject *__pyx_pw_8PyClical_8clifford_31__imul__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8833 PyObject *__pyx_r = 0;
8834 __Pyx_RefNannyDeclarations
8835 __Pyx_RefNannySetupContext(
"__imul__ (wrapper)", 0);
8836 __pyx_r = __pyx_pf_8PyClical_8clifford_30__imul__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8839 __Pyx_RefNannyFinishContext();
8843 static PyObject *__pyx_pf_8PyClical_8clifford_30__imul__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8844 PyObject *__pyx_r = NULL;
8845 __Pyx_RefNannyDeclarations
8846 PyObject *__pyx_t_1 = NULL;
8847 int __pyx_lineno = 0;
8848 const char *__pyx_filename = NULL;
8849 int __pyx_clineno = 0;
8850 __Pyx_RefNannySetupContext(
"__imul__", 0);
8859 __Pyx_XDECREF(__pyx_r);
8860 __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)
8861 __Pyx_GOTREF(__pyx_t_1);
8862 __pyx_r = __pyx_t_1;
8876 __Pyx_XDECREF(__pyx_t_1);
8877 __Pyx_AddTraceback(
"PyClical.clifford.__imul__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8880 __Pyx_XGIVEREF(__pyx_r);
8881 __Pyx_RefNannyFinishContext();
8894 static PyObject *__pyx_pw_8PyClical_8clifford_33__mod__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8895 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 ";
8896 #if CYTHON_COMPILING_IN_CPYTHON
8897 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_32__mod__;
8899 static PyObject *__pyx_pw_8PyClical_8clifford_33__mod__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8900 PyObject *__pyx_r = 0;
8901 __Pyx_RefNannyDeclarations
8902 __Pyx_RefNannySetupContext(
"__mod__ (wrapper)", 0);
8903 __pyx_r = __pyx_pf_8PyClical_8clifford_32__mod__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8906 __Pyx_RefNannyFinishContext();
8910 static PyObject *__pyx_pf_8PyClical_8clifford_32__mod__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8911 PyObject *__pyx_r = NULL;
8912 __Pyx_RefNannyDeclarations
8913 PyObject *__pyx_t_1 = NULL;
8914 PyObject *__pyx_t_2 = NULL;
8915 int __pyx_lineno = 0;
8916 const char *__pyx_filename = NULL;
8917 int __pyx_clineno = 0;
8918 __Pyx_RefNannySetupContext(
"__mod__", 0);
8927 __Pyx_XDECREF(__pyx_r);
8928 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 819, __pyx_L1_error)
8929 __Pyx_GOTREF(__pyx_t_1);
8930 __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)
8931 __Pyx_GOTREF(__pyx_t_2);
8932 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8933 __pyx_r = __pyx_t_2;
8947 __Pyx_XDECREF(__pyx_t_1);
8948 __Pyx_XDECREF(__pyx_t_2);
8949 __Pyx_AddTraceback(
"PyClical.clifford.__mod__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8952 __Pyx_XGIVEREF(__pyx_r);
8953 __Pyx_RefNannyFinishContext();
8966 static PyObject *__pyx_pw_8PyClical_8clifford_35__imod__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8967 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 ";
8968 #if CYTHON_COMPILING_IN_CPYTHON
8969 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_34__imod__;
8971 static PyObject *__pyx_pw_8PyClical_8clifford_35__imod__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8972 PyObject *__pyx_r = 0;
8973 __Pyx_RefNannyDeclarations
8974 __Pyx_RefNannySetupContext(
"__imod__ (wrapper)", 0);
8975 __pyx_r = __pyx_pf_8PyClical_8clifford_34__imod__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8978 __Pyx_RefNannyFinishContext();
8982 static PyObject *__pyx_pf_8PyClical_8clifford_34__imod__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8983 PyObject *__pyx_r = NULL;
8984 __Pyx_RefNannyDeclarations
8985 PyObject *__pyx_t_1 = NULL;
8986 int __pyx_lineno = 0;
8987 const char *__pyx_filename = NULL;
8988 int __pyx_clineno = 0;
8989 __Pyx_RefNannySetupContext(
"__imod__", 0);
8998 __Pyx_XDECREF(__pyx_r);
8999 __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)
9000 __Pyx_GOTREF(__pyx_t_1);
9001 __pyx_r = __pyx_t_1;
9015 __Pyx_XDECREF(__pyx_t_1);
9016 __Pyx_AddTraceback(
"PyClical.clifford.__imod__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9019 __Pyx_XGIVEREF(__pyx_r);
9020 __Pyx_RefNannyFinishContext();
9033 static PyObject *__pyx_pw_8PyClical_8clifford_37__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
9034 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 ";
9035 #if CYTHON_COMPILING_IN_CPYTHON
9036 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_36__and__;
9038 static PyObject *__pyx_pw_8PyClical_8clifford_37__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
9039 PyObject *__pyx_r = 0;
9040 __Pyx_RefNannyDeclarations
9041 __Pyx_RefNannySetupContext(
"__and__ (wrapper)", 0);
9042 __pyx_r = __pyx_pf_8PyClical_8clifford_36__and__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
9045 __Pyx_RefNannyFinishContext();
9049 static PyObject *__pyx_pf_8PyClical_8clifford_36__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
9050 PyObject *__pyx_r = NULL;
9051 __Pyx_RefNannyDeclarations
9052 PyObject *__pyx_t_1 = NULL;
9053 PyObject *__pyx_t_2 = NULL;
9054 int __pyx_lineno = 0;
9055 const char *__pyx_filename = NULL;
9056 int __pyx_clineno = 0;
9057 __Pyx_RefNannySetupContext(
"__and__", 0);
9066 __Pyx_XDECREF(__pyx_r);
9067 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 849, __pyx_L1_error)
9068 __Pyx_GOTREF(__pyx_t_1);
9069 __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)
9070 __Pyx_GOTREF(__pyx_t_2);
9071 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9072 __pyx_r = __pyx_t_2;
9086 __Pyx_XDECREF(__pyx_t_1);
9087 __Pyx_XDECREF(__pyx_t_2);
9088 __Pyx_AddTraceback(
"PyClical.clifford.__and__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9091 __Pyx_XGIVEREF(__pyx_r);
9092 __Pyx_RefNannyFinishContext();
9105 static PyObject *__pyx_pw_8PyClical_8clifford_39__iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
9106 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 ";
9107 #if CYTHON_COMPILING_IN_CPYTHON
9108 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_38__iand__;
9110 static PyObject *__pyx_pw_8PyClical_8clifford_39__iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
9111 PyObject *__pyx_r = 0;
9112 __Pyx_RefNannyDeclarations
9113 __Pyx_RefNannySetupContext(
"__iand__ (wrapper)", 0);
9114 __pyx_r = __pyx_pf_8PyClical_8clifford_38__iand__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
9117 __Pyx_RefNannyFinishContext();
9121 static PyObject *__pyx_pf_8PyClical_8clifford_38__iand__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
9122 PyObject *__pyx_r = NULL;
9123 __Pyx_RefNannyDeclarations
9124 PyObject *__pyx_t_1 = NULL;
9125 int __pyx_lineno = 0;
9126 const char *__pyx_filename = NULL;
9127 int __pyx_clineno = 0;
9128 __Pyx_RefNannySetupContext(
"__iand__", 0);
9137 __Pyx_XDECREF(__pyx_r);
9138 __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)
9139 __Pyx_GOTREF(__pyx_t_1);
9140 __pyx_r = __pyx_t_1;
9154 __Pyx_XDECREF(__pyx_t_1);
9155 __Pyx_AddTraceback(
"PyClical.clifford.__iand__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9158 __Pyx_XGIVEREF(__pyx_r);
9159 __Pyx_RefNannyFinishContext();
9172 static PyObject *__pyx_pw_8PyClical_8clifford_41__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
9173 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 ";
9174 #if CYTHON_COMPILING_IN_CPYTHON
9175 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_40__xor__;
9177 static PyObject *__pyx_pw_8PyClical_8clifford_41__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
9178 PyObject *__pyx_r = 0;
9179 __Pyx_RefNannyDeclarations
9180 __Pyx_RefNannySetupContext(
"__xor__ (wrapper)", 0);
9181 __pyx_r = __pyx_pf_8PyClical_8clifford_40__xor__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
9184 __Pyx_RefNannyFinishContext();
9188 static PyObject *__pyx_pf_8PyClical_8clifford_40__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
9189 PyObject *__pyx_r = NULL;
9190 __Pyx_RefNannyDeclarations
9191 PyObject *__pyx_t_1 = NULL;
9192 PyObject *__pyx_t_2 = NULL;
9193 int __pyx_lineno = 0;
9194 const char *__pyx_filename = NULL;
9195 int __pyx_clineno = 0;
9196 __Pyx_RefNannySetupContext(
"__xor__", 0);
9205 __Pyx_XDECREF(__pyx_r);
9206 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 879, __pyx_L1_error)
9207 __Pyx_GOTREF(__pyx_t_1);
9208 __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)
9209 __Pyx_GOTREF(__pyx_t_2);
9210 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9211 __pyx_r = __pyx_t_2;
9225 __Pyx_XDECREF(__pyx_t_1);
9226 __Pyx_XDECREF(__pyx_t_2);
9227 __Pyx_AddTraceback(
"PyClical.clifford.__xor__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9230 __Pyx_XGIVEREF(__pyx_r);
9231 __Pyx_RefNannyFinishContext();
9244 static PyObject *__pyx_pw_8PyClical_8clifford_43__ixor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
9245 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 ";
9246 #if CYTHON_COMPILING_IN_CPYTHON
9247 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_42__ixor__;
9249 static PyObject *__pyx_pw_8PyClical_8clifford_43__ixor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
9250 PyObject *__pyx_r = 0;
9251 __Pyx_RefNannyDeclarations
9252 __Pyx_RefNannySetupContext(
"__ixor__ (wrapper)", 0);
9253 __pyx_r = __pyx_pf_8PyClical_8clifford_42__ixor__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
9256 __Pyx_RefNannyFinishContext();
9260 static PyObject *__pyx_pf_8PyClical_8clifford_42__ixor__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
9261 PyObject *__pyx_r = NULL;
9262 __Pyx_RefNannyDeclarations
9263 PyObject *__pyx_t_1 = NULL;
9264 int __pyx_lineno = 0;
9265 const char *__pyx_filename = NULL;
9266 int __pyx_clineno = 0;
9267 __Pyx_RefNannySetupContext(
"__ixor__", 0);
9276 __Pyx_XDECREF(__pyx_r);
9277 __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)
9278 __Pyx_GOTREF(__pyx_t_1);
9279 __pyx_r = __pyx_t_1;
9293 __Pyx_XDECREF(__pyx_t_1);
9294 __Pyx_AddTraceback(
"PyClical.clifford.__ixor__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9297 __Pyx_XGIVEREF(__pyx_r);
9298 __Pyx_RefNannyFinishContext();
9311 static PyObject *__pyx_pw_8PyClical_8clifford_45__truediv__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
9312 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 ";
9313 #if CYTHON_COMPILING_IN_CPYTHON
9314 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_44__truediv__;
9316 static PyObject *__pyx_pw_8PyClical_8clifford_45__truediv__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
9317 PyObject *__pyx_r = 0;
9318 __Pyx_RefNannyDeclarations
9319 __Pyx_RefNannySetupContext(
"__truediv__ (wrapper)", 0);
9320 __pyx_r = __pyx_pf_8PyClical_8clifford_44__truediv__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
9323 __Pyx_RefNannyFinishContext();
9327 static PyObject *__pyx_pf_8PyClical_8clifford_44__truediv__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
9328 PyObject *__pyx_r = NULL;
9329 __Pyx_RefNannyDeclarations
9330 PyObject *__pyx_t_1 = NULL;
9331 PyObject *__pyx_t_2 = NULL;
9332 int __pyx_lineno = 0;
9333 const char *__pyx_filename = NULL;
9334 int __pyx_clineno = 0;
9335 __Pyx_RefNannySetupContext(
"__truediv__", 0);
9344 __Pyx_XDECREF(__pyx_r);
9345 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 909, __pyx_L1_error)
9346 __Pyx_GOTREF(__pyx_t_1);
9347 __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)
9348 __Pyx_GOTREF(__pyx_t_2);
9349 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9350 __pyx_r = __pyx_t_2;
9364 __Pyx_XDECREF(__pyx_t_1);
9365 __Pyx_XDECREF(__pyx_t_2);
9366 __Pyx_AddTraceback(
"PyClical.clifford.__truediv__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9369 __Pyx_XGIVEREF(__pyx_r);
9370 __Pyx_RefNannyFinishContext();
9383 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
9384 static PyObject *__pyx_pw_8PyClical_8clifford_47__idiv__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
9385 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 ";
9386 #if CYTHON_COMPILING_IN_CPYTHON
9387 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_46__idiv__;
9389 static PyObject *__pyx_pw_8PyClical_8clifford_47__idiv__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
9390 PyObject *__pyx_r = 0;
9391 __Pyx_RefNannyDeclarations
9392 __Pyx_RefNannySetupContext(
"__idiv__ (wrapper)", 0);
9393 __pyx_r = __pyx_pf_8PyClical_8clifford_46__idiv__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
9396 __Pyx_RefNannyFinishContext();
9401 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
9402 static PyObject *__pyx_pf_8PyClical_8clifford_46__idiv__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
9403 PyObject *__pyx_r = NULL;
9404 __Pyx_RefNannyDeclarations
9405 PyObject *__pyx_t_1 = NULL;
9406 int __pyx_lineno = 0;
9407 const char *__pyx_filename = NULL;
9408 int __pyx_clineno = 0;
9409 __Pyx_RefNannySetupContext(
"__idiv__", 0);
9418 __Pyx_XDECREF(__pyx_r);
9419 __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)
9420 __Pyx_GOTREF(__pyx_t_1);
9421 __pyx_r = __pyx_t_1;
9435 __Pyx_XDECREF(__pyx_t_1);
9436 __Pyx_AddTraceback(
"PyClical.clifford.__idiv__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9439 __Pyx_XGIVEREF(__pyx_r);
9440 __Pyx_RefNannyFinishContext();
9454 static PyObject *__pyx_pw_8PyClical_8clifford_49inv(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9455 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 ";
9456 static PyObject *__pyx_pw_8PyClical_8clifford_49inv(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9457 PyObject *__pyx_r = 0;
9458 __Pyx_RefNannyDeclarations
9459 __Pyx_RefNannySetupContext(
"inv (wrapper)", 0);
9460 __pyx_r = __pyx_pf_8PyClical_8clifford_48inv(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
9463 __Pyx_RefNannyFinishContext();
9467 static PyObject *__pyx_pf_8PyClical_8clifford_48inv(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
9468 PyObject *__pyx_r = NULL;
9469 __Pyx_RefNannyDeclarations
9470 PyObject *__pyx_t_1 = NULL;
9471 PyObject *__pyx_t_2 = NULL;
9472 int __pyx_lineno = 0;
9473 const char *__pyx_filename = NULL;
9474 int __pyx_clineno = 0;
9475 __Pyx_RefNannySetupContext(
"inv", 0);
9484 __Pyx_XDECREF(__pyx_r);
9485 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 937, __pyx_L1_error)
9486 __Pyx_GOTREF(__pyx_t_1);
9487 __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)
9488 __Pyx_GOTREF(__pyx_t_2);
9489 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9490 __pyx_r = __pyx_t_2;
9504 __Pyx_XDECREF(__pyx_t_1);
9505 __Pyx_XDECREF(__pyx_t_2);
9506 __Pyx_AddTraceback(
"PyClical.clifford.inv", __pyx_clineno, __pyx_lineno, __pyx_filename);
9509 __Pyx_XGIVEREF(__pyx_r);
9510 __Pyx_RefNannyFinishContext();
9523 static PyObject *__pyx_pw_8PyClical_8clifford_51__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
9524 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 ";
9525 #if CYTHON_COMPILING_IN_CPYTHON
9526 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_50__or__;
9528 static PyObject *__pyx_pw_8PyClical_8clifford_51__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
9529 PyObject *__pyx_r = 0;
9530 __Pyx_RefNannyDeclarations
9531 __Pyx_RefNannySetupContext(
"__or__ (wrapper)", 0);
9532 __pyx_r = __pyx_pf_8PyClical_8clifford_50__or__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
9535 __Pyx_RefNannyFinishContext();
9539 static PyObject *__pyx_pf_8PyClical_8clifford_50__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
9540 PyObject *__pyx_r = NULL;
9541 __Pyx_RefNannyDeclarations
9542 PyObject *__pyx_t_1 = NULL;
9543 PyObject *__pyx_t_2 = NULL;
9544 int __pyx_lineno = 0;
9545 const char *__pyx_filename = NULL;
9546 int __pyx_clineno = 0;
9547 __Pyx_RefNannySetupContext(
"__or__", 0);
9556 __Pyx_XDECREF(__pyx_r);
9557 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 948, __pyx_L1_error)
9558 __Pyx_GOTREF(__pyx_t_1);
9559 __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)
9560 __Pyx_GOTREF(__pyx_t_2);
9561 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9562 __pyx_r = __pyx_t_2;
9576 __Pyx_XDECREF(__pyx_t_1);
9577 __Pyx_XDECREF(__pyx_t_2);
9578 __Pyx_AddTraceback(
"PyClical.clifford.__or__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9581 __Pyx_XGIVEREF(__pyx_r);
9582 __Pyx_RefNannyFinishContext();
9595 static PyObject *__pyx_pw_8PyClical_8clifford_53__ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
9596 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 ";
9597 #if CYTHON_COMPILING_IN_CPYTHON
9598 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_52__ior__;
9600 static PyObject *__pyx_pw_8PyClical_8clifford_53__ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
9601 PyObject *__pyx_r = 0;
9602 __Pyx_RefNannyDeclarations
9603 __Pyx_RefNannySetupContext(
"__ior__ (wrapper)", 0);
9604 __pyx_r = __pyx_pf_8PyClical_8clifford_52__ior__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
9607 __Pyx_RefNannyFinishContext();
9611 static PyObject *__pyx_pf_8PyClical_8clifford_52__ior__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
9612 PyObject *__pyx_r = NULL;
9613 __Pyx_RefNannyDeclarations
9614 PyObject *__pyx_t_1 = NULL;
9615 int __pyx_lineno = 0;
9616 const char *__pyx_filename = NULL;
9617 int __pyx_clineno = 0;
9618 __Pyx_RefNannySetupContext(
"__ior__", 0);
9627 __Pyx_XDECREF(__pyx_r);
9628 __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)
9629 __Pyx_GOTREF(__pyx_t_1);
9630 __pyx_r = __pyx_t_1;
9644 __Pyx_XDECREF(__pyx_t_1);
9645 __Pyx_AddTraceback(
"PyClical.clifford.__ior__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9648 __Pyx_XGIVEREF(__pyx_r);
9649 __Pyx_RefNannyFinishContext();
9662 static PyObject *__pyx_pw_8PyClical_8clifford_55__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_m, PyObject *__pyx_v_dummy);
9663 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 ";
9664 #if CYTHON_COMPILING_IN_CPYTHON
9665 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_54__pow__;
9667 static PyObject *__pyx_pw_8PyClical_8clifford_55__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_m, PyObject *__pyx_v_dummy) {
9668 PyObject *__pyx_r = 0;
9669 __Pyx_RefNannyDeclarations
9670 __Pyx_RefNannySetupContext(
"__pow__ (wrapper)", 0);
9671 __pyx_r = __pyx_pf_8PyClical_8clifford_54__pow__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_m), ((PyObject *)__pyx_v_dummy));
9674 __Pyx_RefNannyFinishContext();
9678 static PyObject *__pyx_pf_8PyClical_8clifford_54__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_m, CYTHON_UNUSED PyObject *__pyx_v_dummy) {
9679 PyObject *__pyx_r = NULL;
9680 __Pyx_RefNannyDeclarations
9681 PyObject *__pyx_t_1 = NULL;
9682 int __pyx_lineno = 0;
9683 const char *__pyx_filename = NULL;
9684 int __pyx_clineno = 0;
9685 __Pyx_RefNannySetupContext(
"__pow__", 0);
9694 __Pyx_XDECREF(__pyx_r);
9695 __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)
9696 __Pyx_GOTREF(__pyx_t_1);
9697 __pyx_r = __pyx_t_1;
9711 __Pyx_XDECREF(__pyx_t_1);
9712 __Pyx_AddTraceback(
"PyClical.clifford.__pow__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9715 __Pyx_XGIVEREF(__pyx_r);
9716 __Pyx_RefNannyFinishContext();
9729 static PyObject *__pyx_pw_8PyClical_8clifford_57pow(PyObject *__pyx_v_self, PyObject *__pyx_v_m);
9730 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 ";
9731 static PyObject *__pyx_pw_8PyClical_8clifford_57pow(PyObject *__pyx_v_self, PyObject *__pyx_v_m) {
9732 PyObject *__pyx_r = 0;
9733 __Pyx_RefNannyDeclarations
9734 __Pyx_RefNannySetupContext(
"pow (wrapper)", 0);
9735 __pyx_r = __pyx_pf_8PyClical_8clifford_56pow(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_m));
9738 __Pyx_RefNannyFinishContext();
9742 static PyObject *__pyx_pf_8PyClical_8clifford_56pow(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_m) {
9743 PyObject *__pyx_r = NULL;
9744 __Pyx_RefNannyDeclarations
9745 PyObject *__pyx_t_1 = NULL;
9746 PyObject *__pyx_t_2 = NULL;
9750 int __pyx_lineno = 0;
9751 const char *__pyx_filename = NULL;
9752 int __pyx_clineno = 0;
9753 __Pyx_RefNannySetupContext(
"pow", 0);
9762 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_numbers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 999, __pyx_L1_error)
9763 __Pyx_GOTREF(__pyx_t_1);
9764 __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)
9765 __Pyx_GOTREF(__pyx_t_2);
9766 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9767 __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)
9768 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9769 __pyx_t_4 = (__pyx_t_3 != 0);
9779 __Pyx_XDECREF(__pyx_r);
9780 __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1000, __pyx_L1_error)
9781 __Pyx_GOTREF(__pyx_t_2);
9782 __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)
9783 __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)
9784 __Pyx_GOTREF(__pyx_t_1);
9785 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9786 __pyx_r = __pyx_t_1;
9807 __Pyx_XDECREF(__pyx_r);
9808 __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)
9809 __Pyx_GOTREF(__pyx_t_1);
9810 __pyx_t_2 = PyNumber_Multiply(__pyx_v_m, __pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1002, __pyx_L1_error)
9811 __Pyx_GOTREF(__pyx_t_2);
9812 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9813 __pyx_t_1 = __pyx_f_8PyClical_exp(__pyx_t_2, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1002, __pyx_L1_error)
9814 __Pyx_GOTREF(__pyx_t_1);
9815 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9816 __pyx_r = __pyx_t_1;
9831 __Pyx_XDECREF(__pyx_t_1);
9832 __Pyx_XDECREF(__pyx_t_2);
9833 __Pyx_AddTraceback(
"PyClical.clifford.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
9836 __Pyx_XGIVEREF(__pyx_r);
9837 __Pyx_RefNannyFinishContext();
9850 static PyObject *__pyx_pw_8PyClical_8clifford_59outer_pow(PyObject *__pyx_v_self, PyObject *__pyx_v_m);
9851 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 ";
9852 static PyObject *__pyx_pw_8PyClical_8clifford_59outer_pow(PyObject *__pyx_v_self, PyObject *__pyx_v_m) {
9853 PyObject *__pyx_r = 0;
9854 __Pyx_RefNannyDeclarations
9855 __Pyx_RefNannySetupContext(
"outer_pow (wrapper)", 0);
9856 __pyx_r = __pyx_pf_8PyClical_8clifford_58outer_pow(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_m));
9859 __Pyx_RefNannyFinishContext();
9863 static PyObject *__pyx_pf_8PyClical_8clifford_58outer_pow(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_m) {
9864 PyObject *__pyx_r = NULL;
9865 __Pyx_RefNannyDeclarations
9866 PyObject *__pyx_t_1 = NULL;
9868 PyObject *__pyx_t_3 = NULL;
9869 int __pyx_lineno = 0;
9870 const char *__pyx_filename = NULL;
9871 int __pyx_clineno = 0;
9872 __Pyx_RefNannySetupContext(
"outer_pow", 0);
9881 __Pyx_XDECREF(__pyx_r);
9882 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1018, __pyx_L1_error)
9883 __Pyx_GOTREF(__pyx_t_1);
9884 __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)
9885 __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)
9886 __Pyx_GOTREF(__pyx_t_3);
9887 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9888 __pyx_r = __pyx_t_3;
9902 __Pyx_XDECREF(__pyx_t_1);
9903 __Pyx_XDECREF(__pyx_t_3);
9904 __Pyx_AddTraceback(
"PyClical.clifford.outer_pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
9907 __Pyx_XGIVEREF(__pyx_r);
9908 __Pyx_RefNannyFinishContext();
9921 static PyObject *__pyx_pw_8PyClical_8clifford_61__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
9922 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 ";
9923 #if CYTHON_COMPILING_IN_CPYTHON
9924 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_60__call__;
9926 static PyObject *__pyx_pw_8PyClical_8clifford_61__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9927 PyObject *__pyx_v_grade = 0;
9928 int __pyx_lineno = 0;
9929 const char *__pyx_filename = NULL;
9930 int __pyx_clineno = 0;
9931 PyObject *__pyx_r = 0;
9932 __Pyx_RefNannyDeclarations
9933 __Pyx_RefNannySetupContext(
"__call__ (wrapper)", 0);
9935 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_grade,0};
9936 PyObject* values[1] = {0};
9937 if (unlikely(__pyx_kwds)) {
9939 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9941 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9944 default:
goto __pyx_L5_argtuple_error;
9946 kw_args = PyDict_Size(__pyx_kwds);
9949 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_grade)) != 0)) kw_args--;
9950 else goto __pyx_L5_argtuple_error;
9952 if (unlikely(kw_args > 0)) {
9953 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__call__") < 0)) __PYX_ERR(0, 1020, __pyx_L3_error)
9955 }
else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
9956 goto __pyx_L5_argtuple_error;
9958 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9960 __pyx_v_grade = values[0];
9962 goto __pyx_L4_argument_unpacking_done;
9963 __pyx_L5_argtuple_error:;
9964 __Pyx_RaiseArgtupleInvalid(
"__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1020, __pyx_L3_error)
9966 __Pyx_AddTraceback(
"PyClical.clifford.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9967 __Pyx_RefNannyFinishContext();
9969 __pyx_L4_argument_unpacking_done:;
9970 __pyx_r = __pyx_pf_8PyClical_8clifford_60__call__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), __pyx_v_grade);
9973 __Pyx_RefNannyFinishContext();
9977 static PyObject *__pyx_pf_8PyClical_8clifford_60__call__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_grade) {
9978 PyObject *__pyx_r = NULL;
9979 __Pyx_RefNannyDeclarations
9980 PyObject *__pyx_t_1 = NULL;
9982 PyObject *__pyx_t_3 = NULL;
9983 int __pyx_lineno = 0;
9984 const char *__pyx_filename = NULL;
9985 int __pyx_clineno = 0;
9986 __Pyx_RefNannySetupContext(
"__call__", 0);
9995 __Pyx_XDECREF(__pyx_r);
9996 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1037, __pyx_L1_error)
9997 __Pyx_GOTREF(__pyx_t_1);
9998 __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)
9999 __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)
10000 __Pyx_GOTREF(__pyx_t_3);
10001 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10002 __pyx_r = __pyx_t_3;
10016 __Pyx_XDECREF(__pyx_t_1);
10017 __Pyx_XDECREF(__pyx_t_3);
10018 __Pyx_AddTraceback(
"PyClical.clifford.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10021 __Pyx_XGIVEREF(__pyx_r);
10022 __Pyx_RefNannyFinishContext();
10035 static PyObject *__pyx_pw_8PyClical_8clifford_63scalar(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10036 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 ";
10037 static PyObject *__pyx_pw_8PyClical_8clifford_63scalar(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10038 PyObject *__pyx_r = 0;
10039 __Pyx_RefNannyDeclarations
10040 __Pyx_RefNannySetupContext(
"scalar (wrapper)", 0);
10041 __pyx_r = __pyx_pf_8PyClical_8clifford_62scalar(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10044 __Pyx_RefNannyFinishContext();
10048 static PyObject *__pyx_pf_8PyClical_8clifford_62scalar(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10049 PyObject *__pyx_r = NULL;
10050 __Pyx_RefNannyDeclarations
10051 PyObject *__pyx_t_1 = NULL;
10052 int __pyx_lineno = 0;
10053 const char *__pyx_filename = NULL;
10054 int __pyx_clineno = 0;
10055 __Pyx_RefNannySetupContext(
"scalar", 0);
10064 __Pyx_XDECREF(__pyx_r);
10065 __pyx_t_1 =
PyFloat_FromDouble(__pyx_v_self->instance->scalar());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1048, __pyx_L1_error)
10066 __Pyx_GOTREF(__pyx_t_1);
10067 __pyx_r = __pyx_t_1;
10081 __Pyx_XDECREF(__pyx_t_1);
10082 __Pyx_AddTraceback(
"PyClical.clifford.scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
10085 __Pyx_XGIVEREF(__pyx_r);
10086 __Pyx_RefNannyFinishContext();
10099 static PyObject *__pyx_pw_8PyClical_8clifford_65pure(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10100 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 ";
10101 static PyObject *__pyx_pw_8PyClical_8clifford_65pure(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10102 PyObject *__pyx_r = 0;
10103 __Pyx_RefNannyDeclarations
10104 __Pyx_RefNannySetupContext(
"pure (wrapper)", 0);
10105 __pyx_r = __pyx_pf_8PyClical_8clifford_64pure(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10108 __Pyx_RefNannyFinishContext();
10112 static PyObject *__pyx_pf_8PyClical_8clifford_64pure(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10113 PyObject *__pyx_r = NULL;
10114 __Pyx_RefNannyDeclarations
10115 PyObject *__pyx_t_1 = NULL;
10116 PyObject *__pyx_t_2 = NULL;
10117 int __pyx_lineno = 0;
10118 const char *__pyx_filename = NULL;
10119 int __pyx_clineno = 0;
10120 __Pyx_RefNannySetupContext(
"pure", 0);
10129 __Pyx_XDECREF(__pyx_r);
10130 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1059, __pyx_L1_error)
10131 __Pyx_GOTREF(__pyx_t_1);
10132 __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)
10133 __Pyx_GOTREF(__pyx_t_2);
10134 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10135 __pyx_r = __pyx_t_2;
10149 __Pyx_XDECREF(__pyx_t_1);
10150 __Pyx_XDECREF(__pyx_t_2);
10151 __Pyx_AddTraceback(
"PyClical.clifford.pure", __pyx_clineno, __pyx_lineno, __pyx_filename);
10154 __Pyx_XGIVEREF(__pyx_r);
10155 __Pyx_RefNannyFinishContext();
10168 static PyObject *__pyx_pw_8PyClical_8clifford_67even(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10169 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 ";
10170 static PyObject *__pyx_pw_8PyClical_8clifford_67even(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10171 PyObject *__pyx_r = 0;
10172 __Pyx_RefNannyDeclarations
10173 __Pyx_RefNannySetupContext(
"even (wrapper)", 0);
10174 __pyx_r = __pyx_pf_8PyClical_8clifford_66even(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10177 __Pyx_RefNannyFinishContext();
10181 static PyObject *__pyx_pf_8PyClical_8clifford_66even(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10182 PyObject *__pyx_r = NULL;
10183 __Pyx_RefNannyDeclarations
10184 PyObject *__pyx_t_1 = NULL;
10185 PyObject *__pyx_t_2 = NULL;
10186 int __pyx_lineno = 0;
10187 const char *__pyx_filename = NULL;
10188 int __pyx_clineno = 0;
10189 __Pyx_RefNannySetupContext(
"even", 0);
10198 __Pyx_XDECREF(__pyx_r);
10199 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1068, __pyx_L1_error)
10200 __Pyx_GOTREF(__pyx_t_1);
10201 __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)
10202 __Pyx_GOTREF(__pyx_t_2);
10203 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10204 __pyx_r = __pyx_t_2;
10218 __Pyx_XDECREF(__pyx_t_1);
10219 __Pyx_XDECREF(__pyx_t_2);
10220 __Pyx_AddTraceback(
"PyClical.clifford.even", __pyx_clineno, __pyx_lineno, __pyx_filename);
10223 __Pyx_XGIVEREF(__pyx_r);
10224 __Pyx_RefNannyFinishContext();
10237 static PyObject *__pyx_pw_8PyClical_8clifford_69odd(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10238 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 ";
10239 static PyObject *__pyx_pw_8PyClical_8clifford_69odd(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10240 PyObject *__pyx_r = 0;
10241 __Pyx_RefNannyDeclarations
10242 __Pyx_RefNannySetupContext(
"odd (wrapper)", 0);
10243 __pyx_r = __pyx_pf_8PyClical_8clifford_68odd(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10246 __Pyx_RefNannyFinishContext();
10250 static PyObject *__pyx_pf_8PyClical_8clifford_68odd(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10251 PyObject *__pyx_r = NULL;
10252 __Pyx_RefNannyDeclarations
10253 PyObject *__pyx_t_1 = NULL;
10254 PyObject *__pyx_t_2 = NULL;
10255 int __pyx_lineno = 0;
10256 const char *__pyx_filename = NULL;
10257 int __pyx_clineno = 0;
10258 __Pyx_RefNannySetupContext(
"odd", 0);
10267 __Pyx_XDECREF(__pyx_r);
10268 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1077, __pyx_L1_error)
10269 __Pyx_GOTREF(__pyx_t_1);
10270 __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)
10271 __Pyx_GOTREF(__pyx_t_2);
10272 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10273 __pyx_r = __pyx_t_2;
10287 __Pyx_XDECREF(__pyx_t_1);
10288 __Pyx_XDECREF(__pyx_t_2);
10289 __Pyx_AddTraceback(
"PyClical.clifford.odd", __pyx_clineno, __pyx_lineno, __pyx_filename);
10292 __Pyx_XGIVEREF(__pyx_r);
10293 __Pyx_RefNannyFinishContext();
10306 static PyObject *__pyx_pw_8PyClical_8clifford_71vector_part(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
10307 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 ";
10308 static PyObject *__pyx_pw_8PyClical_8clifford_71vector_part(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10309 PyObject *__pyx_v_frm = 0;
10310 int __pyx_lineno = 0;
10311 const char *__pyx_filename = NULL;
10312 int __pyx_clineno = 0;
10313 PyObject *__pyx_r = 0;
10314 __Pyx_RefNannyDeclarations
10315 __Pyx_RefNannySetupContext(
"vector_part (wrapper)", 0);
10317 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frm,0};
10318 PyObject* values[1] = {0};
10319 values[0] = ((PyObject *)Py_None);
10320 if (unlikely(__pyx_kwds)) {
10321 Py_ssize_t kw_args;
10322 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10323 switch (pos_args) {
10324 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10325 CYTHON_FALLTHROUGH;
10327 default:
goto __pyx_L5_argtuple_error;
10329 kw_args = PyDict_Size(__pyx_kwds);
10330 switch (pos_args) {
10333 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_frm);
10334 if (value) { values[0] = value; kw_args--; }
10337 if (unlikely(kw_args > 0)) {
10338 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"vector_part") < 0)) __PYX_ERR(0, 1079, __pyx_L3_error)
10341 switch (PyTuple_GET_SIZE(__pyx_args)) {
10342 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10343 CYTHON_FALLTHROUGH;
10345 default:
goto __pyx_L5_argtuple_error;
10348 __pyx_v_frm = values[0];
10350 goto __pyx_L4_argument_unpacking_done;
10351 __pyx_L5_argtuple_error:;
10352 __Pyx_RaiseArgtupleInvalid(
"vector_part", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1079, __pyx_L3_error)
10354 __Pyx_AddTraceback(
"PyClical.clifford.vector_part", __pyx_clineno, __pyx_lineno, __pyx_filename);
10355 __Pyx_RefNannyFinishContext();
10357 __pyx_L4_argument_unpacking_done:;
10358 __pyx_r = __pyx_pf_8PyClical_8clifford_70vector_part(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), __pyx_v_frm);
10361 __Pyx_RefNannyFinishContext();
10365 static PyObject *__pyx_pf_8PyClical_8clifford_70vector_part(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_frm) {
10366 PyObject *__pyx_v_error_msg_prefix = NULL;
10367 std::vector<scalar_t> __pyx_v_vec;
10370 PyObject *__pyx_v_lst = NULL;
10371 PyObject *__pyx_v_err = NULL;
10372 PyObject *__pyx_r = NULL;
10373 __Pyx_RefNannyDeclarations
10374 PyObject *__pyx_t_1 = NULL;
10375 PyObject *__pyx_t_2 = NULL;
10376 PyObject *__pyx_t_3 = NULL;
10379 std::vector<scalar_t> __pyx_t_6;
10380 PyObject *__pyx_t_7 = NULL;
10384 PyObject *__pyx_t_11 = NULL;
10385 PyObject *__pyx_t_12 = NULL;
10386 PyObject *__pyx_t_13 = NULL;
10387 PyObject *__pyx_t_14 = NULL;
10388 PyObject *__pyx_t_15 = NULL;
10389 char const *__pyx_t_16;
10390 PyObject *__pyx_t_17 = NULL;
10391 PyObject *__pyx_t_18 = NULL;
10392 PyObject *__pyx_t_19 = NULL;
10393 PyObject *__pyx_t_20 = NULL;
10394 PyObject *__pyx_t_21 = NULL;
10395 PyObject *__pyx_t_22 = NULL;
10396 int __pyx_lineno = 0;
10397 const char *__pyx_filename = NULL;
10398 int __pyx_clineno = 0;
10399 __Pyx_RefNannySetupContext(
"vector_part", 0);
10408 __Pyx_INCREF(__pyx_kp_u_Cannot_take_vector_part_of);
10409 __pyx_v_error_msg_prefix = __pyx_kp_u_Cannot_take_vector_part_of;
10419 __Pyx_PyThreadState_declare
10420 __Pyx_PyThreadState_assign
10421 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
10422 __Pyx_XGOTREF(__pyx_t_1);
10423 __Pyx_XGOTREF(__pyx_t_2);
10424 __Pyx_XGOTREF(__pyx_t_3);
10434 __pyx_t_4 = (__pyx_v_frm == Py_None);
10435 __pyx_t_5 = (__pyx_t_4 != 0);
10445 __pyx_t_6 = __pyx_v_self->instance->vector_part();
10446 __pyx_v_vec = __pyx_t_6;
10467 __pyx_t_6 = __pyx_v_self->instance->vector_part(__pyx_f_8PyClical_9index_set_unwrap(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_frm)));
10469 __Pyx_CppExn2PyErr();
10470 __PYX_ERR(0, 1096, __pyx_L3_error)
10472 __pyx_v_vec = __pyx_t_6;
10483 __pyx_v_n = __pyx_v_vec.size();
10492 __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)
10493 __Pyx_GOTREF(__pyx_t_7);
10494 { Py_ssize_t __pyx_temp;
10495 for (__pyx_temp=0; __pyx_temp < __pyx_v_n; __pyx_temp++) {
10496 __Pyx_INCREF(__pyx_float_0_0);
10497 __Pyx_GIVEREF(__pyx_float_0_0);
10498 PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_float_0_0);
10501 __pyx_v_lst = ((PyObject*)__pyx_t_7);
10511 __pyx_t_8 = __pyx_v_n;
10512 __pyx_t_9 = __pyx_t_8;
10513 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
10514 __pyx_v_i = __pyx_t_10;
10523 __pyx_t_7 =
PyFloat_FromDouble((__pyx_v_vec[__pyx_v_i]));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1100, __pyx_L3_error)
10524 __Pyx_GOTREF(__pyx_t_7);
10525 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)
10526 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10536 __Pyx_XDECREF(__pyx_r);
10537 __Pyx_INCREF(__pyx_v_lst);
10538 __pyx_r = __pyx_v_lst;
10539 goto __pyx_L7_try_return;
10550 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10559 __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
10561 __Pyx_AddTraceback(
"PyClical.clifford.vector_part", __pyx_clineno, __pyx_lineno, __pyx_filename);
10562 if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_11, &__pyx_t_12) < 0) __PYX_ERR(0, 1102, __pyx_L5_except_error)
10563 __Pyx_GOTREF(__pyx_t_7);
10564 __Pyx_GOTREF(__pyx_t_11);
10565 __Pyx_GOTREF(__pyx_t_12);
10566 __Pyx_INCREF(__pyx_t_11);
10567 __pyx_v_err = __pyx_t_11;
10577 __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)
10578 __Pyx_GOTREF(__pyx_t_13);
10579 __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)
10580 __Pyx_GOTREF(__pyx_t_14);
10581 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
10582 __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)
10583 __Pyx_GOTREF(__pyx_t_13);
10584 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
10593 __pyx_t_14 = PyObject_Repr(__pyx_v_frm);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1104, __pyx_L17_error)
10594 __Pyx_GOTREF(__pyx_t_14);
10595 __pyx_t_15 = __Pyx_PyUnicode_ConcatSafe(__pyx_t_13, __pyx_t_14);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1104, __pyx_L17_error)
10596 __Pyx_GOTREF(__pyx_t_15);
10597 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
10598 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
10599 __pyx_t_14 = __Pyx_PyUnicode_Concat(__pyx_t_15, __pyx_kp_u_as_frame);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1104, __pyx_L17_error)
10600 __Pyx_GOTREF(__pyx_t_14);
10601 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
10610 __pyx_t_15 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_err);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1105, __pyx_L17_error)
10611 __Pyx_GOTREF(__pyx_t_15);
10612 __pyx_t_13 = __Pyx_PyUnicode_Concat(__pyx_t_14, __pyx_t_15);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1105, __pyx_L17_error)
10613 __Pyx_GOTREF(__pyx_t_13);
10614 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
10615 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
10624 __pyx_t_15 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_13);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1103, __pyx_L17_error)
10625 __Pyx_GOTREF(__pyx_t_15);
10626 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
10627 __Pyx_Raise(__pyx_t_15, 0, 0, 0);
10628 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
10629 __PYX_ERR(0, 1103, __pyx_L17_error)
10642 __Pyx_PyThreadState_declare
10643 __Pyx_PyThreadState_assign
10644 __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
10645 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
10646 __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
10647 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
10648 if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
10649 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);
10650 __Pyx_XGOTREF(__pyx_t_17);
10651 __Pyx_XGOTREF(__pyx_t_18);
10652 __Pyx_XGOTREF(__pyx_t_19);
10653 __Pyx_XGOTREF(__pyx_t_20);
10654 __Pyx_XGOTREF(__pyx_t_21);
10655 __Pyx_XGOTREF(__pyx_t_22);
10656 __pyx_t_8 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
10658 __Pyx_DECREF(__pyx_v_err);
10659 __pyx_v_err = NULL;
10661 if (PY_MAJOR_VERSION >= 3) {
10662 __Pyx_XGIVEREF(__pyx_t_20);
10663 __Pyx_XGIVEREF(__pyx_t_21);
10664 __Pyx_XGIVEREF(__pyx_t_22);
10665 __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
10667 __Pyx_XGIVEREF(__pyx_t_17);
10668 __Pyx_XGIVEREF(__pyx_t_18);
10669 __Pyx_XGIVEREF(__pyx_t_19);
10670 __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
10671 __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
10672 __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_16;
10673 goto __pyx_L5_except_error;
10677 goto __pyx_L5_except_error;
10678 __pyx_L5_except_error:;
10687 __Pyx_XGIVEREF(__pyx_t_1);
10688 __Pyx_XGIVEREF(__pyx_t_2);
10689 __Pyx_XGIVEREF(__pyx_t_3);
10690 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
10691 goto __pyx_L1_error;
10692 __pyx_L7_try_return:;
10693 __Pyx_XGIVEREF(__pyx_t_1);
10694 __Pyx_XGIVEREF(__pyx_t_2);
10695 __Pyx_XGIVEREF(__pyx_t_3);
10696 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
10710 __Pyx_XDECREF(__pyx_t_7);
10711 __Pyx_XDECREF(__pyx_t_11);
10712 __Pyx_XDECREF(__pyx_t_12);
10713 __Pyx_XDECREF(__pyx_t_13);
10714 __Pyx_XDECREF(__pyx_t_14);
10715 __Pyx_XDECREF(__pyx_t_15);
10716 __Pyx_AddTraceback(
"PyClical.clifford.vector_part", __pyx_clineno, __pyx_lineno, __pyx_filename);
10719 __Pyx_XDECREF(__pyx_v_error_msg_prefix);
10720 __Pyx_XDECREF(__pyx_v_lst);
10721 __Pyx_XDECREF(__pyx_v_err);
10722 __Pyx_XGIVEREF(__pyx_r);
10723 __Pyx_RefNannyFinishContext();
10736 static PyObject *__pyx_pw_8PyClical_8clifford_73involute(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10737 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 ";
10738 static PyObject *__pyx_pw_8PyClical_8clifford_73involute(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10739 PyObject *__pyx_r = 0;
10740 __Pyx_RefNannyDeclarations
10741 __Pyx_RefNannySetupContext(
"involute (wrapper)", 0);
10742 __pyx_r = __pyx_pf_8PyClical_8clifford_72involute(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10745 __Pyx_RefNannyFinishContext();
10749 static PyObject *__pyx_pf_8PyClical_8clifford_72involute(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10750 PyObject *__pyx_r = NULL;
10751 __Pyx_RefNannyDeclarations
10752 PyObject *__pyx_t_1 = NULL;
10753 PyObject *__pyx_t_2 = NULL;
10754 int __pyx_lineno = 0;
10755 const char *__pyx_filename = NULL;
10756 int __pyx_clineno = 0;
10757 __Pyx_RefNannySetupContext(
"involute", 0);
10766 __Pyx_XDECREF(__pyx_r);
10767 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1121, __pyx_L1_error)
10768 __Pyx_GOTREF(__pyx_t_1);
10769 __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)
10770 __Pyx_GOTREF(__pyx_t_2);
10771 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10772 __pyx_r = __pyx_t_2;
10786 __Pyx_XDECREF(__pyx_t_1);
10787 __Pyx_XDECREF(__pyx_t_2);
10788 __Pyx_AddTraceback(
"PyClical.clifford.involute", __pyx_clineno, __pyx_lineno, __pyx_filename);
10791 __Pyx_XGIVEREF(__pyx_r);
10792 __Pyx_RefNannyFinishContext();
10805 static PyObject *__pyx_pw_8PyClical_8clifford_75reverse(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10806 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 ";
10807 static PyObject *__pyx_pw_8PyClical_8clifford_75reverse(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10808 PyObject *__pyx_r = 0;
10809 __Pyx_RefNannyDeclarations
10810 __Pyx_RefNannySetupContext(
"reverse (wrapper)", 0);
10811 __pyx_r = __pyx_pf_8PyClical_8clifford_74reverse(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10814 __Pyx_RefNannyFinishContext();
10818 static PyObject *__pyx_pf_8PyClical_8clifford_74reverse(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10819 PyObject *__pyx_r = NULL;
10820 __Pyx_RefNannyDeclarations
10821 PyObject *__pyx_t_1 = NULL;
10822 PyObject *__pyx_t_2 = NULL;
10823 int __pyx_lineno = 0;
10824 const char *__pyx_filename = NULL;
10825 int __pyx_clineno = 0;
10826 __Pyx_RefNannySetupContext(
"reverse", 0);
10835 __Pyx_XDECREF(__pyx_r);
10836 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1136, __pyx_L1_error)
10837 __Pyx_GOTREF(__pyx_t_1);
10838 __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)
10839 __Pyx_GOTREF(__pyx_t_2);
10840 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10841 __pyx_r = __pyx_t_2;
10855 __Pyx_XDECREF(__pyx_t_1);
10856 __Pyx_XDECREF(__pyx_t_2);
10857 __Pyx_AddTraceback(
"PyClical.clifford.reverse", __pyx_clineno, __pyx_lineno, __pyx_filename);
10860 __Pyx_XGIVEREF(__pyx_r);
10861 __Pyx_RefNannyFinishContext();
10874 static PyObject *__pyx_pw_8PyClical_8clifford_77conj(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10875 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 ";
10876 static PyObject *__pyx_pw_8PyClical_8clifford_77conj(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10877 PyObject *__pyx_r = 0;
10878 __Pyx_RefNannyDeclarations
10879 __Pyx_RefNannySetupContext(
"conj (wrapper)", 0);
10880 __pyx_r = __pyx_pf_8PyClical_8clifford_76conj(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10883 __Pyx_RefNannyFinishContext();
10887 static PyObject *__pyx_pf_8PyClical_8clifford_76conj(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10888 PyObject *__pyx_r = NULL;
10889 __Pyx_RefNannyDeclarations
10890 PyObject *__pyx_t_1 = NULL;
10891 PyObject *__pyx_t_2 = NULL;
10892 int __pyx_lineno = 0;
10893 const char *__pyx_filename = NULL;
10894 int __pyx_clineno = 0;
10895 __Pyx_RefNannySetupContext(
"conj", 0);
10904 __Pyx_XDECREF(__pyx_r);
10905 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1151, __pyx_L1_error)
10906 __Pyx_GOTREF(__pyx_t_1);
10907 __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)
10908 __Pyx_GOTREF(__pyx_t_2);
10909 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10910 __pyx_r = __pyx_t_2;
10924 __Pyx_XDECREF(__pyx_t_1);
10925 __Pyx_XDECREF(__pyx_t_2);
10926 __Pyx_AddTraceback(
"PyClical.clifford.conj", __pyx_clineno, __pyx_lineno, __pyx_filename);
10929 __Pyx_XGIVEREF(__pyx_r);
10930 __Pyx_RefNannyFinishContext();
10943 static PyObject *__pyx_pw_8PyClical_8clifford_79quad(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10944 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 ";
10945 static PyObject *__pyx_pw_8PyClical_8clifford_79quad(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10946 PyObject *__pyx_r = 0;
10947 __Pyx_RefNannyDeclarations
10948 __Pyx_RefNannySetupContext(
"quad (wrapper)", 0);
10949 __pyx_r = __pyx_pf_8PyClical_8clifford_78quad(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10952 __Pyx_RefNannyFinishContext();
10956 static PyObject *__pyx_pf_8PyClical_8clifford_78quad(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10957 PyObject *__pyx_r = NULL;
10958 __Pyx_RefNannyDeclarations
10959 PyObject *__pyx_t_1 = NULL;
10960 int __pyx_lineno = 0;
10961 const char *__pyx_filename = NULL;
10962 int __pyx_clineno = 0;
10963 __Pyx_RefNannySetupContext(
"quad", 0);
10972 __Pyx_XDECREF(__pyx_r);
10973 __pyx_t_1 =
PyFloat_FromDouble(__pyx_v_self->instance->quad());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1162, __pyx_L1_error)
10974 __Pyx_GOTREF(__pyx_t_1);
10975 __pyx_r = __pyx_t_1;
10989 __Pyx_XDECREF(__pyx_t_1);
10990 __Pyx_AddTraceback(
"PyClical.clifford.quad", __pyx_clineno, __pyx_lineno, __pyx_filename);
10993 __Pyx_XGIVEREF(__pyx_r);
10994 __Pyx_RefNannyFinishContext();
11007 static PyObject *__pyx_pw_8PyClical_8clifford_81norm(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
11008 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 ";
11009 static PyObject *__pyx_pw_8PyClical_8clifford_81norm(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11010 PyObject *__pyx_r = 0;
11011 __Pyx_RefNannyDeclarations
11012 __Pyx_RefNannySetupContext(
"norm (wrapper)", 0);
11013 __pyx_r = __pyx_pf_8PyClical_8clifford_80norm(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
11016 __Pyx_RefNannyFinishContext();
11020 static PyObject *__pyx_pf_8PyClical_8clifford_80norm(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
11021 PyObject *__pyx_r = NULL;
11022 __Pyx_RefNannyDeclarations
11023 PyObject *__pyx_t_1 = NULL;
11024 int __pyx_lineno = 0;
11025 const char *__pyx_filename = NULL;
11026 int __pyx_clineno = 0;
11027 __Pyx_RefNannySetupContext(
"norm", 0);
11036 __Pyx_XDECREF(__pyx_r);
11037 __pyx_t_1 =
PyFloat_FromDouble(__pyx_v_self->instance->norm());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1173, __pyx_L1_error)
11038 __Pyx_GOTREF(__pyx_t_1);
11039 __pyx_r = __pyx_t_1;
11053 __Pyx_XDECREF(__pyx_t_1);
11054 __Pyx_AddTraceback(
"PyClical.clifford.norm", __pyx_clineno, __pyx_lineno, __pyx_filename);
11057 __Pyx_XGIVEREF(__pyx_r);
11058 __Pyx_RefNannyFinishContext();
11071 static PyObject *__pyx_pw_8PyClical_8clifford_83abs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
11072 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 ";
11073 static PyObject *__pyx_pw_8PyClical_8clifford_83abs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11074 PyObject *__pyx_r = 0;
11075 __Pyx_RefNannyDeclarations
11076 __Pyx_RefNannySetupContext(
"abs (wrapper)", 0);
11077 __pyx_r = __pyx_pf_8PyClical_8clifford_82abs(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
11080 __Pyx_RefNannyFinishContext();
11084 static PyObject *__pyx_pf_8PyClical_8clifford_82abs(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
11085 PyObject *__pyx_r = NULL;
11086 __Pyx_RefNannyDeclarations
11087 PyObject *__pyx_t_1 = NULL;
11088 int __pyx_lineno = 0;
11089 const char *__pyx_filename = NULL;
11090 int __pyx_clineno = 0;
11091 __Pyx_RefNannySetupContext(
"abs", 0);
11100 __Pyx_XDECREF(__pyx_r);
11101 __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)
11102 __Pyx_GOTREF(__pyx_t_1);
11103 __pyx_r = __pyx_t_1;
11117 __Pyx_XDECREF(__pyx_t_1);
11118 __Pyx_AddTraceback(
"PyClical.clifford.abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
11121 __Pyx_XGIVEREF(__pyx_r);
11122 __Pyx_RefNannyFinishContext();
11135 static PyObject *__pyx_pw_8PyClical_8clifford_85max_abs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
11136 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 ";
11137 static PyObject *__pyx_pw_8PyClical_8clifford_85max_abs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11138 PyObject *__pyx_r = 0;
11139 __Pyx_RefNannyDeclarations
11140 __Pyx_RefNannySetupContext(
"max_abs (wrapper)", 0);
11141 __pyx_r = __pyx_pf_8PyClical_8clifford_84max_abs(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
11144 __Pyx_RefNannyFinishContext();
11148 static PyObject *__pyx_pf_8PyClical_8clifford_84max_abs(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
11149 PyObject *__pyx_r = NULL;
11150 __Pyx_RefNannyDeclarations
11151 PyObject *__pyx_t_1 = NULL;
11152 int __pyx_lineno = 0;
11153 const char *__pyx_filename = NULL;
11154 int __pyx_clineno = 0;
11155 __Pyx_RefNannySetupContext(
"max_abs", 0);
11164 __Pyx_XDECREF(__pyx_r);
11165 __pyx_t_1 =
PyFloat_FromDouble(__pyx_v_self->instance->max_abs());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1193, __pyx_L1_error)
11166 __Pyx_GOTREF(__pyx_t_1);
11167 __pyx_r = __pyx_t_1;
11181 __Pyx_XDECREF(__pyx_t_1);
11182 __Pyx_AddTraceback(
"PyClical.clifford.max_abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
11185 __Pyx_XGIVEREF(__pyx_r);
11186 __Pyx_RefNannyFinishContext();
11199 static PyObject *__pyx_pw_8PyClical_8clifford_87truncated(PyObject *__pyx_v_self, PyObject *__pyx_v_limit);
11200 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 ";
11201 static PyObject *__pyx_pw_8PyClical_8clifford_87truncated(PyObject *__pyx_v_self, PyObject *__pyx_v_limit) {
11202 PyObject *__pyx_r = 0;
11203 __Pyx_RefNannyDeclarations
11204 __Pyx_RefNannySetupContext(
"truncated (wrapper)", 0);
11205 __pyx_r = __pyx_pf_8PyClical_8clifford_86truncated(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_limit));
11208 __Pyx_RefNannyFinishContext();
11212 static PyObject *__pyx_pf_8PyClical_8clifford_86truncated(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_limit) {
11213 PyObject *__pyx_r = NULL;
11214 __Pyx_RefNannyDeclarations
11215 PyObject *__pyx_t_1 = NULL;
11217 PyObject *__pyx_t_3 = NULL;
11218 int __pyx_lineno = 0;
11219 const char *__pyx_filename = NULL;
11220 int __pyx_clineno = 0;
11221 __Pyx_RefNannySetupContext(
"truncated", 0);
11230 __Pyx_XDECREF(__pyx_r);
11231 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1204, __pyx_L1_error)
11232 __Pyx_GOTREF(__pyx_t_1);
11233 __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)
11234 __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)
11235 __Pyx_GOTREF(__pyx_t_3);
11236 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11237 __pyx_r = __pyx_t_3;
11251 __Pyx_XDECREF(__pyx_t_1);
11252 __Pyx_XDECREF(__pyx_t_3);
11253 __Pyx_AddTraceback(
"PyClical.clifford.truncated", __pyx_clineno, __pyx_lineno, __pyx_filename);
11256 __Pyx_XGIVEREF(__pyx_r);
11257 __Pyx_RefNannyFinishContext();
11270 static PyObject *__pyx_pw_8PyClical_8clifford_89isnan(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
11271 static char __pyx_doc_8PyClical_8clifford_88isnan[] =
"\n Check if a multivector contains any IEEE NaN values.\n\n >>> clifford().isnan()\n False\n ";
11272 static PyObject *__pyx_pw_8PyClical_8clifford_89isnan(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11273 PyObject *__pyx_r = 0;
11274 __Pyx_RefNannyDeclarations
11275 __Pyx_RefNannySetupContext(
"isnan (wrapper)", 0);
11276 __pyx_r = __pyx_pf_8PyClical_8clifford_88isnan(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
11279 __Pyx_RefNannyFinishContext();
11283 static PyObject *__pyx_pf_8PyClical_8clifford_88isnan(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
11284 PyObject *__pyx_r = NULL;
11285 __Pyx_RefNannyDeclarations
11286 PyObject *__pyx_t_1 = NULL;
11287 int __pyx_lineno = 0;
11288 const char *__pyx_filename = NULL;
11289 int __pyx_clineno = 0;
11290 __Pyx_RefNannySetupContext(
"isnan", 0);
11299 __Pyx_XDECREF(__pyx_r);
11300 __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->instance->isnan());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1213, __pyx_L1_error)
11301 __Pyx_GOTREF(__pyx_t_1);
11302 __pyx_r = __pyx_t_1;
11316 __Pyx_XDECREF(__pyx_t_1);
11317 __Pyx_AddTraceback(
"PyClical.clifford.isnan", __pyx_clineno, __pyx_lineno, __pyx_filename);
11320 __Pyx_XGIVEREF(__pyx_r);
11321 __Pyx_RefNannyFinishContext();
11334 static PyObject *__pyx_pw_8PyClical_8clifford_91frame(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
11335 static char __pyx_doc_8PyClical_8clifford_90frame[] =
"\n Subalgebra generated by all generators of terms of given multivector.\n\n >>> print(clifford(\"1+3{-1}+2{1,2}+4{-2,7}\").frame())\n {-2,-1,1,2,7}\n >>> s=clifford(\"1+3{-1}+2{1,2}+4{-2,7}\").frame(); type(s)\n <class 'PyClical.index_set'>\n ";
11336 static PyObject *__pyx_pw_8PyClical_8clifford_91frame(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11337 PyObject *__pyx_r = 0;
11338 __Pyx_RefNannyDeclarations
11339 __Pyx_RefNannySetupContext(
"frame (wrapper)", 0);
11340 __pyx_r = __pyx_pf_8PyClical_8clifford_90frame(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
11343 __Pyx_RefNannyFinishContext();
11347 static PyObject *__pyx_pf_8PyClical_8clifford_90frame(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
11348 PyObject *__pyx_r = NULL;
11349 __Pyx_RefNannyDeclarations
11350 PyObject *__pyx_t_1 = NULL;
11351 PyObject *__pyx_t_2 = NULL;
11352 int __pyx_lineno = 0;
11353 const char *__pyx_filename = NULL;
11354 int __pyx_clineno = 0;
11355 __Pyx_RefNannySetupContext(
"frame", 0);
11364 __Pyx_XDECREF(__pyx_r);
11365 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_index_set));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1224, __pyx_L1_error)
11366 __Pyx_GOTREF(__pyx_t_1);
11367 __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, 1224, __pyx_L1_error)
11368 __Pyx_GOTREF(__pyx_t_2);
11369 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11370 __pyx_r = __pyx_t_2;
11384 __Pyx_XDECREF(__pyx_t_1);
11385 __Pyx_XDECREF(__pyx_t_2);
11386 __Pyx_AddTraceback(
"PyClical.clifford.frame", __pyx_clineno, __pyx_lineno, __pyx_filename);
11389 __Pyx_XGIVEREF(__pyx_r);
11390 __Pyx_RefNannyFinishContext();
11403 static PyObject *__pyx_pw_8PyClical_8clifford_93__repr__(PyObject *__pyx_v_self);
11404 static char __pyx_doc_8PyClical_8clifford_92__repr__[] =
"\n The \342\200\234official\342\200\235 string representation of self.\n\n >>> clifford(\"1+3{-1}+2{1,2}+4{-2,7}\").__repr__()\n 'clifford(\"1+3{-1}+2{1,2}+4{-2,7}\")'\n ";
11405 #if CYTHON_COMPILING_IN_CPYTHON
11406 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_92__repr__;
11408 static PyObject *__pyx_pw_8PyClical_8clifford_93__repr__(PyObject *__pyx_v_self) {
11409 PyObject *__pyx_r = 0;
11410 __Pyx_RefNannyDeclarations
11411 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
11412 __pyx_r = __pyx_pf_8PyClical_8clifford_92__repr__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
11415 __Pyx_RefNannyFinishContext();
11419 static PyObject *__pyx_pf_8PyClical_8clifford_92__repr__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
11420 PyObject *__pyx_r = NULL;
11421 __Pyx_RefNannyDeclarations
11422 PyObject *__pyx_t_1 = NULL;
11423 int __pyx_lineno = 0;
11424 const char *__pyx_filename = NULL;
11425 int __pyx_clineno = 0;
11426 __Pyx_RefNannySetupContext(
"__repr__", 0);
11435 __Pyx_XDECREF(__pyx_r);
11436 __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, 1233, __pyx_L1_error)
11437 __Pyx_GOTREF(__pyx_t_1);
11438 __pyx_r = __pyx_t_1;
11452 __Pyx_XDECREF(__pyx_t_1);
11453 __Pyx_AddTraceback(
"PyClical.clifford.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11456 __Pyx_XGIVEREF(__pyx_r);
11457 __Pyx_RefNannyFinishContext();
11470 static PyObject *__pyx_pw_8PyClical_8clifford_95__str__(PyObject *__pyx_v_self);
11471 static char __pyx_doc_8PyClical_8clifford_94__str__[] =
"\n The \342\200\234informal\342\200\235 string representation of self.\n\n >>> clifford(\"1+3{-1}+2{1,2}+4{-2,7}\").__str__()\n '1+3{-1}+2{1,2}+4{-2,7}'\n ";
11472 #if CYTHON_COMPILING_IN_CPYTHON
11473 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_94__str__;
11475 static PyObject *__pyx_pw_8PyClical_8clifford_95__str__(PyObject *__pyx_v_self) {
11476 PyObject *__pyx_r = 0;
11477 __Pyx_RefNannyDeclarations
11478 __Pyx_RefNannySetupContext(
"__str__ (wrapper)", 0);
11479 __pyx_r = __pyx_pf_8PyClical_8clifford_94__str__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
11482 __Pyx_RefNannyFinishContext();
11486 static PyObject *__pyx_pf_8PyClical_8clifford_94__str__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
11487 PyObject *__pyx_r = NULL;
11488 __Pyx_RefNannyDeclarations
11489 PyObject *__pyx_t_1 = NULL;
11490 int __pyx_lineno = 0;
11491 const char *__pyx_filename = NULL;
11492 int __pyx_clineno = 0;
11493 __Pyx_RefNannySetupContext(
"__str__", 0);
11502 __Pyx_XDECREF(__pyx_r);
11503 __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, 1242, __pyx_L1_error)
11504 __Pyx_GOTREF(__pyx_t_1);
11505 __pyx_r = __pyx_t_1;
11519 __Pyx_XDECREF(__pyx_t_1);
11520 __Pyx_AddTraceback(
"PyClical.clifford.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11523 __Pyx_XGIVEREF(__pyx_r);
11524 __Pyx_RefNannyFinishContext();
11535 static PyObject *__pyx_pw_8PyClical_8clifford_97__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
11536 static PyObject *__pyx_pw_8PyClical_8clifford_97__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11537 PyObject *__pyx_r = 0;
11538 __Pyx_RefNannyDeclarations
11539 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
11540 __pyx_r = __pyx_pf_8PyClical_8clifford_96__reduce_cython__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
11543 __Pyx_RefNannyFinishContext();
11547 static PyObject *__pyx_pf_8PyClical_8clifford_96__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
11548 PyObject *__pyx_r = NULL;
11549 __Pyx_RefNannyDeclarations
11550 PyObject *__pyx_t_1 = NULL;
11551 int __pyx_lineno = 0;
11552 const char *__pyx_filename = NULL;
11553 int __pyx_clineno = 0;
11554 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
11562 __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)
11563 __Pyx_GOTREF(__pyx_t_1);
11564 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
11565 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11566 __PYX_ERR(1, 2, __pyx_L1_error)
11576 __Pyx_XDECREF(__pyx_t_1);
11577 __Pyx_AddTraceback(
"PyClical.clifford.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11579 __Pyx_XGIVEREF(__pyx_r);
11580 __Pyx_RefNannyFinishContext();
11592 static PyObject *__pyx_pw_8PyClical_8clifford_99__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
11593 static PyObject *__pyx_pw_8PyClical_8clifford_99__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
11594 PyObject *__pyx_r = 0;
11595 __Pyx_RefNannyDeclarations
11596 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
11597 __pyx_r = __pyx_pf_8PyClical_8clifford_98__setstate_cython__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
11600 __Pyx_RefNannyFinishContext();
11604 static PyObject *__pyx_pf_8PyClical_8clifford_98__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
11605 PyObject *__pyx_r = NULL;
11606 __Pyx_RefNannyDeclarations
11607 PyObject *__pyx_t_1 = NULL;
11608 int __pyx_lineno = 0;
11609 const char *__pyx_filename = NULL;
11610 int __pyx_clineno = 0;
11611 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
11618 __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)
11619 __Pyx_GOTREF(__pyx_t_1);
11620 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
11621 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11622 __PYX_ERR(1, 4, __pyx_L1_error)
11633 __Pyx_XDECREF(__pyx_t_1);
11634 __Pyx_AddTraceback(
"PyClical.clifford.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11636 __Pyx_XGIVEREF(__pyx_r);
11637 __Pyx_RefNannyFinishContext();
11650 static PyObject *__pyx_pw_8PyClical_9clifford_hidden_doctests(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused);
11651 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 ";
11652 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};
11653 static PyObject *__pyx_pw_8PyClical_9clifford_hidden_doctests(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
11654 PyObject *__pyx_r = 0;
11655 __Pyx_RefNannyDeclarations
11656 __Pyx_RefNannySetupContext(
"clifford_hidden_doctests (wrapper)", 0);
11657 __pyx_r = __pyx_pf_8PyClical_8clifford_hidden_doctests(__pyx_self);
11660 __Pyx_RefNannyFinishContext();
11664 static PyObject *__pyx_pf_8PyClical_8clifford_hidden_doctests(CYTHON_UNUSED PyObject *__pyx_self) {
11665 PyObject *__pyx_r = NULL;
11666 __Pyx_RefNannyDeclarations
11667 __Pyx_RefNannySetupContext(
"clifford_hidden_doctests", 0);
11676 __Pyx_XDECREF(__pyx_r);
11677 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11690 __Pyx_XGIVEREF(__pyx_r);
11691 __Pyx_RefNannyFinishContext();
11703 static PyObject *__pyx_pw_8PyClical_11inv(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11704 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_inv(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11705 PyObject *__pyx_r = NULL;
11706 __Pyx_RefNannyDeclarations
11707 PyObject *__pyx_t_1 = NULL;
11708 PyObject *__pyx_t_2 = NULL;
11709 PyObject *__pyx_t_3 = NULL;
11710 int __pyx_lineno = 0;
11711 const char *__pyx_filename = NULL;
11712 int __pyx_clineno = 0;
11713 __Pyx_RefNannySetupContext(
"inv", 0);
11722 __Pyx_XDECREF(__pyx_r);
11723 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_v_obj);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1341, __pyx_L1_error)
11724 __Pyx_GOTREF(__pyx_t_2);
11725 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inv);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1341, __pyx_L1_error)
11726 __Pyx_GOTREF(__pyx_t_3);
11727 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11729 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11730 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11731 if (likely(__pyx_t_2)) {
11732 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
11733 __Pyx_INCREF(__pyx_t_2);
11734 __Pyx_INCREF(
function);
11735 __Pyx_DECREF_SET(__pyx_t_3,
function);
11738 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
11739 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11740 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1341, __pyx_L1_error)
11741 __Pyx_GOTREF(__pyx_t_1);
11742 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11743 __pyx_r = __pyx_t_1;
11757 __Pyx_XDECREF(__pyx_t_1);
11758 __Pyx_XDECREF(__pyx_t_2);
11759 __Pyx_XDECREF(__pyx_t_3);
11760 __Pyx_AddTraceback(
"PyClical.inv", __pyx_clineno, __pyx_lineno, __pyx_filename);
11763 __Pyx_XGIVEREF(__pyx_r);
11764 __Pyx_RefNannyFinishContext();
11769 static PyObject *__pyx_pw_8PyClical_11inv(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11770 static char __pyx_doc_8PyClical_10inv[] =
"\n Geometric multiplicative inverse.\n\n >>> print(inv(clifford(\"{1}\")))\n {1}\n >>> print(inv(clifford(\"{-1}\")))\n -{-1}\n >>> print(inv(clifford(\"{-2,-1}\")))\n -{-2,-1}\n >>> print(inv(clifford(\"{-1}+{1}\")))\n nan\n ";
11771 static PyObject *__pyx_pw_8PyClical_11inv(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11772 PyObject *__pyx_r = 0;
11773 __Pyx_RefNannyDeclarations
11774 __Pyx_RefNannySetupContext(
"inv (wrapper)", 0);
11775 __pyx_r = __pyx_pf_8PyClical_10inv(__pyx_self, ((PyObject *)__pyx_v_obj));
11778 __Pyx_RefNannyFinishContext();
11782 static PyObject *__pyx_pf_8PyClical_10inv(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11783 PyObject *__pyx_r = NULL;
11784 __Pyx_RefNannyDeclarations
11785 PyObject *__pyx_t_1 = NULL;
11786 int __pyx_lineno = 0;
11787 const char *__pyx_filename = NULL;
11788 int __pyx_clineno = 0;
11789 __Pyx_RefNannySetupContext(
"inv", 0);
11790 __Pyx_XDECREF(__pyx_r);
11791 __pyx_t_1 = __pyx_f_8PyClical_inv(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1328, __pyx_L1_error)
11792 __Pyx_GOTREF(__pyx_t_1);
11793 __pyx_r = __pyx_t_1;
11799 __Pyx_XDECREF(__pyx_t_1);
11800 __Pyx_AddTraceback(
"PyClical.inv", __pyx_clineno, __pyx_lineno, __pyx_filename);
11803 __Pyx_XGIVEREF(__pyx_r);
11804 __Pyx_RefNannyFinishContext();
11816 static PyObject *__pyx_pw_8PyClical_13scalar(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11817 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_scalar(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11818 PyObject *__pyx_r = NULL;
11819 __Pyx_RefNannyDeclarations
11820 PyObject *__pyx_t_1 = NULL;
11821 PyObject *__pyx_t_2 = NULL;
11822 PyObject *__pyx_t_3 = NULL;
11823 int __pyx_lineno = 0;
11824 const char *__pyx_filename = NULL;
11825 int __pyx_clineno = 0;
11826 __Pyx_RefNannySetupContext(
"scalar", 0);
11835 __Pyx_XDECREF(__pyx_r);
11836 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_v_obj);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1352, __pyx_L1_error)
11837 __Pyx_GOTREF(__pyx_t_2);
11838 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_scalar);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1352, __pyx_L1_error)
11839 __Pyx_GOTREF(__pyx_t_3);
11840 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11842 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11843 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11844 if (likely(__pyx_t_2)) {
11845 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
11846 __Pyx_INCREF(__pyx_t_2);
11847 __Pyx_INCREF(
function);
11848 __Pyx_DECREF_SET(__pyx_t_3,
function);
11851 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
11852 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11853 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1352, __pyx_L1_error)
11854 __Pyx_GOTREF(__pyx_t_1);
11855 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11856 __pyx_r = __pyx_t_1;
11870 __Pyx_XDECREF(__pyx_t_1);
11871 __Pyx_XDECREF(__pyx_t_2);
11872 __Pyx_XDECREF(__pyx_t_3);
11873 __Pyx_AddTraceback(
"PyClical.scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
11876 __Pyx_XGIVEREF(__pyx_r);
11877 __Pyx_RefNannyFinishContext();
11882 static PyObject *__pyx_pw_8PyClical_13scalar(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11883 static char __pyx_doc_8PyClical_12scalar[] =
"\n Scalar part.\n\n >>> scalar(clifford(\"1+{1}+{1,2}\"))\n 1.0\n >>> scalar(clifford(\"{1,2}\"))\n 0.0\n ";
11884 static PyObject *__pyx_pw_8PyClical_13scalar(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11885 PyObject *__pyx_r = 0;
11886 __Pyx_RefNannyDeclarations
11887 __Pyx_RefNannySetupContext(
"scalar (wrapper)", 0);
11888 __pyx_r = __pyx_pf_8PyClical_12scalar(__pyx_self, ((PyObject *)__pyx_v_obj));
11891 __Pyx_RefNannyFinishContext();
11895 static PyObject *__pyx_pf_8PyClical_12scalar(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11896 PyObject *__pyx_r = NULL;
11897 __Pyx_RefNannyDeclarations
11898 PyObject *__pyx_t_1 = NULL;
11899 int __pyx_lineno = 0;
11900 const char *__pyx_filename = NULL;
11901 int __pyx_clineno = 0;
11902 __Pyx_RefNannySetupContext(
"scalar", 0);
11903 __Pyx_XDECREF(__pyx_r);
11904 __pyx_t_1 = __pyx_f_8PyClical_scalar(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1343, __pyx_L1_error)
11905 __Pyx_GOTREF(__pyx_t_1);
11906 __pyx_r = __pyx_t_1;
11912 __Pyx_XDECREF(__pyx_t_1);
11913 __Pyx_AddTraceback(
"PyClical.scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
11916 __Pyx_XGIVEREF(__pyx_r);
11917 __Pyx_RefNannyFinishContext();
11929 static PyObject *__pyx_pw_8PyClical_15real(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11930 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_real(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11931 PyObject *__pyx_r = NULL;
11932 __Pyx_RefNannyDeclarations
11933 PyObject *__pyx_t_1 = NULL;
11934 PyObject *__pyx_t_2 = NULL;
11935 PyObject *__pyx_t_3 = NULL;
11936 int __pyx_lineno = 0;
11937 const char *__pyx_filename = NULL;
11938 int __pyx_clineno = 0;
11939 __Pyx_RefNannySetupContext(
"real", 0);
11948 __Pyx_XDECREF(__pyx_r);
11949 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_v_obj);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1363, __pyx_L1_error)
11950 __Pyx_GOTREF(__pyx_t_2);
11951 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_scalar);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1363, __pyx_L1_error)
11952 __Pyx_GOTREF(__pyx_t_3);
11953 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11955 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11956 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11957 if (likely(__pyx_t_2)) {
11958 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
11959 __Pyx_INCREF(__pyx_t_2);
11960 __Pyx_INCREF(
function);
11961 __Pyx_DECREF_SET(__pyx_t_3,
function);
11964 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
11965 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11966 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1363, __pyx_L1_error)
11967 __Pyx_GOTREF(__pyx_t_1);
11968 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11969 __pyx_r = __pyx_t_1;
11983 __Pyx_XDECREF(__pyx_t_1);
11984 __Pyx_XDECREF(__pyx_t_2);
11985 __Pyx_XDECREF(__pyx_t_3);
11986 __Pyx_AddTraceback(
"PyClical.real", __pyx_clineno, __pyx_lineno, __pyx_filename);
11989 __Pyx_XGIVEREF(__pyx_r);
11990 __Pyx_RefNannyFinishContext();
11995 static PyObject *__pyx_pw_8PyClical_15real(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11996 static char __pyx_doc_8PyClical_14real[] =
"\n Real part: synonym for scalar part.\n\n >>> real(clifford(\"1+{1}+{1,2}\"))\n 1.0\n >>> real(clifford(\"{1,2}\"))\n 0.0\n ";
11997 static PyObject *__pyx_pw_8PyClical_15real(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11998 PyObject *__pyx_r = 0;
11999 __Pyx_RefNannyDeclarations
12000 __Pyx_RefNannySetupContext(
"real (wrapper)", 0);
12001 __pyx_r = __pyx_pf_8PyClical_14real(__pyx_self, ((PyObject *)__pyx_v_obj));
12004 __Pyx_RefNannyFinishContext();
12008 static PyObject *__pyx_pf_8PyClical_14real(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12009 PyObject *__pyx_r = NULL;
12010 __Pyx_RefNannyDeclarations
12011 PyObject *__pyx_t_1 = NULL;
12012 int __pyx_lineno = 0;
12013 const char *__pyx_filename = NULL;
12014 int __pyx_clineno = 0;
12015 __Pyx_RefNannySetupContext(
"real", 0);
12016 __Pyx_XDECREF(__pyx_r);
12017 __pyx_t_1 = __pyx_f_8PyClical_real(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1354, __pyx_L1_error)
12018 __Pyx_GOTREF(__pyx_t_1);
12019 __pyx_r = __pyx_t_1;
12025 __Pyx_XDECREF(__pyx_t_1);
12026 __Pyx_AddTraceback(
"PyClical.real", __pyx_clineno, __pyx_lineno, __pyx_filename);
12029 __Pyx_XGIVEREF(__pyx_r);
12030 __Pyx_RefNannyFinishContext();
12042 static PyObject *__pyx_pw_8PyClical_17imag(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12043 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_imag(CYTHON_UNUSED PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12044 PyObject *__pyx_r = NULL;
12045 __Pyx_RefNannyDeclarations
12046 __Pyx_RefNannySetupContext(
"imag", 0);
12055 __Pyx_XDECREF(__pyx_r);
12056 __Pyx_INCREF(__pyx_float_0_0);
12057 __pyx_r = __pyx_float_0_0;
12070 __Pyx_XGIVEREF(__pyx_r);
12071 __Pyx_RefNannyFinishContext();
12076 static PyObject *__pyx_pw_8PyClical_17imag(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12077 static char __pyx_doc_8PyClical_16imag[] =
"\n Imaginary part: deprecated (always 0).\n\n >>> imag(clifford(\"1+{1}+{1,2}\"))\n 0.0\n >>> imag(clifford(\"{1,2}\"))\n 0.0\n ";
12078 static PyObject *__pyx_pw_8PyClical_17imag(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12079 PyObject *__pyx_r = 0;
12080 __Pyx_RefNannyDeclarations
12081 __Pyx_RefNannySetupContext(
"imag (wrapper)", 0);
12082 __pyx_r = __pyx_pf_8PyClical_16imag(__pyx_self, ((PyObject *)__pyx_v_obj));
12085 __Pyx_RefNannyFinishContext();
12089 static PyObject *__pyx_pf_8PyClical_16imag(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12090 PyObject *__pyx_r = NULL;
12091 __Pyx_RefNannyDeclarations
12092 PyObject *__pyx_t_1 = NULL;
12093 int __pyx_lineno = 0;
12094 const char *__pyx_filename = NULL;
12095 int __pyx_clineno = 0;
12096 __Pyx_RefNannySetupContext(
"imag", 0);
12097 __Pyx_XDECREF(__pyx_r);
12098 __pyx_t_1 = __pyx_f_8PyClical_imag(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1365, __pyx_L1_error)
12099 __Pyx_GOTREF(__pyx_t_1);
12100 __pyx_r = __pyx_t_1;
12106 __Pyx_XDECREF(__pyx_t_1);
12107 __Pyx_AddTraceback(
"PyClical.imag", __pyx_clineno, __pyx_lineno, __pyx_filename);
12110 __Pyx_XGIVEREF(__pyx_r);
12111 __Pyx_RefNannyFinishContext();
12123 static PyObject *__pyx_pw_8PyClical_19pure(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12124 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_pure(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12125 PyObject *__pyx_r = NULL;
12126 __Pyx_RefNannyDeclarations
12127 PyObject *__pyx_t_1 = NULL;
12128 PyObject *__pyx_t_2 = NULL;
12129 PyObject *__pyx_t_3 = NULL;
12130 int __pyx_lineno = 0;
12131 const char *__pyx_filename = NULL;
12132 int __pyx_clineno = 0;
12133 __Pyx_RefNannySetupContext(
"pure", 0);
12142 __Pyx_XDECREF(__pyx_r);
12143 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_v_obj);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1385, __pyx_L1_error)
12144 __Pyx_GOTREF(__pyx_t_2);
12145 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pure);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1385, __pyx_L1_error)
12146 __Pyx_GOTREF(__pyx_t_3);
12147 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12149 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
12150 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
12151 if (likely(__pyx_t_2)) {
12152 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
12153 __Pyx_INCREF(__pyx_t_2);
12154 __Pyx_INCREF(
function);
12155 __Pyx_DECREF_SET(__pyx_t_3,
function);
12158 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
12159 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12160 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1385, __pyx_L1_error)
12161 __Pyx_GOTREF(__pyx_t_1);
12162 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12163 __pyx_r = __pyx_t_1;
12177 __Pyx_XDECREF(__pyx_t_1);
12178 __Pyx_XDECREF(__pyx_t_2);
12179 __Pyx_XDECREF(__pyx_t_3);
12180 __Pyx_AddTraceback(
"PyClical.pure", __pyx_clineno, __pyx_lineno, __pyx_filename);
12183 __Pyx_XGIVEREF(__pyx_r);
12184 __Pyx_RefNannyFinishContext();
12189 static PyObject *__pyx_pw_8PyClical_19pure(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12190 static char __pyx_doc_8PyClical_18pure[] =
"\n Pure part\n\n >>> print(pure(clifford(\"1+{1}+{1,2}\")))\n {1}+{1,2}\n >>> print(pure(clifford(\"{1,2}\")))\n {1,2}\n ";
12191 static PyObject *__pyx_pw_8PyClical_19pure(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12192 PyObject *__pyx_r = 0;
12193 __Pyx_RefNannyDeclarations
12194 __Pyx_RefNannySetupContext(
"pure (wrapper)", 0);
12195 __pyx_r = __pyx_pf_8PyClical_18pure(__pyx_self, ((PyObject *)__pyx_v_obj));
12198 __Pyx_RefNannyFinishContext();
12202 static PyObject *__pyx_pf_8PyClical_18pure(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12203 PyObject *__pyx_r = NULL;
12204 __Pyx_RefNannyDeclarations
12205 PyObject *__pyx_t_1 = NULL;
12206 int __pyx_lineno = 0;
12207 const char *__pyx_filename = NULL;
12208 int __pyx_clineno = 0;
12209 __Pyx_RefNannySetupContext(
"pure", 0);
12210 __Pyx_XDECREF(__pyx_r);
12211 __pyx_t_1 = __pyx_f_8PyClical_pure(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1376, __pyx_L1_error)
12212 __Pyx_GOTREF(__pyx_t_1);
12213 __pyx_r = __pyx_t_1;
12219 __Pyx_XDECREF(__pyx_t_1);
12220 __Pyx_AddTraceback(
"PyClical.pure", __pyx_clineno, __pyx_lineno, __pyx_filename);
12223 __Pyx_XGIVEREF(__pyx_r);
12224 __Pyx_RefNannyFinishContext();
12236 static PyObject *__pyx_pw_8PyClical_21even(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12237 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_even(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12238 PyObject *__pyx_r = NULL;
12239 __Pyx_RefNannyDeclarations
12240 PyObject *__pyx_t_1 = NULL;
12241 PyObject *__pyx_t_2 = NULL;
12242 PyObject *__pyx_t_3 = NULL;
12243 int __pyx_lineno = 0;
12244 const char *__pyx_filename = NULL;
12245 int __pyx_clineno = 0;
12246 __Pyx_RefNannySetupContext(
"even", 0);
12255 __Pyx_XDECREF(__pyx_r);
12256 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_v_obj);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1394, __pyx_L1_error)
12257 __Pyx_GOTREF(__pyx_t_2);
12258 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_even);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1394, __pyx_L1_error)
12259 __Pyx_GOTREF(__pyx_t_3);
12260 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12262 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
12263 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
12264 if (likely(__pyx_t_2)) {
12265 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
12266 __Pyx_INCREF(__pyx_t_2);
12267 __Pyx_INCREF(
function);
12268 __Pyx_DECREF_SET(__pyx_t_3,
function);
12271 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
12272 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12273 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1394, __pyx_L1_error)
12274 __Pyx_GOTREF(__pyx_t_1);
12275 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12276 __pyx_r = __pyx_t_1;
12290 __Pyx_XDECREF(__pyx_t_1);
12291 __Pyx_XDECREF(__pyx_t_2);
12292 __Pyx_XDECREF(__pyx_t_3);
12293 __Pyx_AddTraceback(
"PyClical.even", __pyx_clineno, __pyx_lineno, __pyx_filename);
12296 __Pyx_XGIVEREF(__pyx_r);
12297 __Pyx_RefNannyFinishContext();
12302 static PyObject *__pyx_pw_8PyClical_21even(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12303 static char __pyx_doc_8PyClical_20even[] =
"\n Even part of multivector, sum of even grade terms.\n\n >>> print(even(clifford(\"1+{1}+{1,2}\")))\n 1+{1,2}\n ";
12304 static PyObject *__pyx_pw_8PyClical_21even(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12305 PyObject *__pyx_r = 0;
12306 __Pyx_RefNannyDeclarations
12307 __Pyx_RefNannySetupContext(
"even (wrapper)", 0);
12308 __pyx_r = __pyx_pf_8PyClical_20even(__pyx_self, ((PyObject *)__pyx_v_obj));
12311 __Pyx_RefNannyFinishContext();
12315 static PyObject *__pyx_pf_8PyClical_20even(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12316 PyObject *__pyx_r = NULL;
12317 __Pyx_RefNannyDeclarations
12318 PyObject *__pyx_t_1 = NULL;
12319 int __pyx_lineno = 0;
12320 const char *__pyx_filename = NULL;
12321 int __pyx_clineno = 0;
12322 __Pyx_RefNannySetupContext(
"even", 0);
12323 __Pyx_XDECREF(__pyx_r);
12324 __pyx_t_1 = __pyx_f_8PyClical_even(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1387, __pyx_L1_error)
12325 __Pyx_GOTREF(__pyx_t_1);
12326 __pyx_r = __pyx_t_1;
12332 __Pyx_XDECREF(__pyx_t_1);
12333 __Pyx_AddTraceback(
"PyClical.even", __pyx_clineno, __pyx_lineno, __pyx_filename);
12336 __Pyx_XGIVEREF(__pyx_r);
12337 __Pyx_RefNannyFinishContext();
12349 static PyObject *__pyx_pw_8PyClical_23odd(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12350 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_odd(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12351 PyObject *__pyx_r = NULL;
12352 __Pyx_RefNannyDeclarations
12353 PyObject *__pyx_t_1 = NULL;
12354 PyObject *__pyx_t_2 = NULL;
12355 PyObject *__pyx_t_3 = NULL;
12356 int __pyx_lineno = 0;
12357 const char *__pyx_filename = NULL;
12358 int __pyx_clineno = 0;
12359 __Pyx_RefNannySetupContext(
"odd", 0);
12368 __Pyx_XDECREF(__pyx_r);
12369 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_v_obj);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1403, __pyx_L1_error)
12370 __Pyx_GOTREF(__pyx_t_2);
12371 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_odd);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1403, __pyx_L1_error)
12372 __Pyx_GOTREF(__pyx_t_3);
12373 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12375 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
12376 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
12377 if (likely(__pyx_t_2)) {
12378 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
12379 __Pyx_INCREF(__pyx_t_2);
12380 __Pyx_INCREF(
function);
12381 __Pyx_DECREF_SET(__pyx_t_3,
function);
12384 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
12385 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12386 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1403, __pyx_L1_error)
12387 __Pyx_GOTREF(__pyx_t_1);
12388 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12389 __pyx_r = __pyx_t_1;
12403 __Pyx_XDECREF(__pyx_t_1);
12404 __Pyx_XDECREF(__pyx_t_2);
12405 __Pyx_XDECREF(__pyx_t_3);
12406 __Pyx_AddTraceback(
"PyClical.odd", __pyx_clineno, __pyx_lineno, __pyx_filename);
12409 __Pyx_XGIVEREF(__pyx_r);
12410 __Pyx_RefNannyFinishContext();
12415 static PyObject *__pyx_pw_8PyClical_23odd(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12416 static char __pyx_doc_8PyClical_22odd[] =
"\n Odd part of multivector, sum of odd grade terms.\n\n >>> print(odd(clifford(\"1+{1}+{1,2}\")))\n {1}\n ";
12417 static PyObject *__pyx_pw_8PyClical_23odd(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12418 PyObject *__pyx_r = 0;
12419 __Pyx_RefNannyDeclarations
12420 __Pyx_RefNannySetupContext(
"odd (wrapper)", 0);
12421 __pyx_r = __pyx_pf_8PyClical_22odd(__pyx_self, ((PyObject *)__pyx_v_obj));
12424 __Pyx_RefNannyFinishContext();
12428 static PyObject *__pyx_pf_8PyClical_22odd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12429 PyObject *__pyx_r = NULL;
12430 __Pyx_RefNannyDeclarations
12431 PyObject *__pyx_t_1 = NULL;
12432 int __pyx_lineno = 0;
12433 const char *__pyx_filename = NULL;
12434 int __pyx_clineno = 0;
12435 __Pyx_RefNannySetupContext(
"odd", 0);
12436 __Pyx_XDECREF(__pyx_r);
12437 __pyx_t_1 = __pyx_f_8PyClical_odd(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1396, __pyx_L1_error)
12438 __Pyx_GOTREF(__pyx_t_1);
12439 __pyx_r = __pyx_t_1;
12445 __Pyx_XDECREF(__pyx_t_1);
12446 __Pyx_AddTraceback(
"PyClical.odd", __pyx_clineno, __pyx_lineno, __pyx_filename);
12449 __Pyx_XGIVEREF(__pyx_r);
12450 __Pyx_RefNannyFinishContext();
12462 static PyObject *__pyx_pw_8PyClical_25involute(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12463 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_involute(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12464 PyObject *__pyx_r = NULL;
12465 __Pyx_RefNannyDeclarations
12466 PyObject *__pyx_t_1 = NULL;
12467 PyObject *__pyx_t_2 = NULL;
12468 PyObject *__pyx_t_3 = NULL;
12469 int __pyx_lineno = 0;
12470 const char *__pyx_filename = NULL;
12471 int __pyx_clineno = 0;
12472 __Pyx_RefNannySetupContext(
"involute", 0);
12481 __Pyx_XDECREF(__pyx_r);
12482 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_v_obj);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1418, __pyx_L1_error)
12483 __Pyx_GOTREF(__pyx_t_2);
12484 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_involute);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1418, __pyx_L1_error)
12485 __Pyx_GOTREF(__pyx_t_3);
12486 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12488 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
12489 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
12490 if (likely(__pyx_t_2)) {
12491 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
12492 __Pyx_INCREF(__pyx_t_2);
12493 __Pyx_INCREF(
function);
12494 __Pyx_DECREF_SET(__pyx_t_3,
function);
12497 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
12498 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12499 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1418, __pyx_L1_error)
12500 __Pyx_GOTREF(__pyx_t_1);
12501 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12502 __pyx_r = __pyx_t_1;
12516 __Pyx_XDECREF(__pyx_t_1);
12517 __Pyx_XDECREF(__pyx_t_2);
12518 __Pyx_XDECREF(__pyx_t_3);
12519 __Pyx_AddTraceback(
"PyClical.involute", __pyx_clineno, __pyx_lineno, __pyx_filename);
12522 __Pyx_XGIVEREF(__pyx_r);
12523 __Pyx_RefNannyFinishContext();
12528 static PyObject *__pyx_pw_8PyClical_25involute(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12529 static char __pyx_doc_8PyClical_24involute[] =
"\n Main involution, each {i} is replaced by -{i} in each term, eg. {1}*{2} -> (-{2})*(-{1})\n\n >>> print(involute(clifford(\"{1}\")))\n -{1}\n >>> print(involute(clifford(\"{2}\") * clifford(\"{1}\")))\n -{1,2}\n >>> print(involute(clifford(\"{1}\") * clifford(\"{2}\")))\n {1,2}\n >>> print(involute(clifford(\"1+{1}+{1,2}\")))\n 1-{1}+{1,2}\n ";
12530 static PyObject *__pyx_pw_8PyClical_25involute(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12531 PyObject *__pyx_r = 0;
12532 __Pyx_RefNannyDeclarations
12533 __Pyx_RefNannySetupContext(
"involute (wrapper)", 0);
12534 __pyx_r = __pyx_pf_8PyClical_24involute(__pyx_self, ((PyObject *)__pyx_v_obj));
12537 __Pyx_RefNannyFinishContext();
12541 static PyObject *__pyx_pf_8PyClical_24involute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12542 PyObject *__pyx_r = NULL;
12543 __Pyx_RefNannyDeclarations
12544 PyObject *__pyx_t_1 = NULL;
12545 int __pyx_lineno = 0;
12546 const char *__pyx_filename = NULL;
12547 int __pyx_clineno = 0;
12548 __Pyx_RefNannySetupContext(
"involute", 0);
12549 __Pyx_XDECREF(__pyx_r);
12550 __pyx_t_1 = __pyx_f_8PyClical_involute(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1405, __pyx_L1_error)
12551 __Pyx_GOTREF(__pyx_t_1);
12552 __pyx_r = __pyx_t_1;
12558 __Pyx_XDECREF(__pyx_t_1);
12559 __Pyx_AddTraceback(
"PyClical.involute", __pyx_clineno, __pyx_lineno, __pyx_filename);
12562 __Pyx_XGIVEREF(__pyx_r);
12563 __Pyx_RefNannyFinishContext();
12575 static PyObject *__pyx_pw_8PyClical_27reverse(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12576 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_reverse(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12577 PyObject *__pyx_r = NULL;
12578 __Pyx_RefNannyDeclarations
12579 PyObject *__pyx_t_1 = NULL;
12580 PyObject *__pyx_t_2 = NULL;
12581 PyObject *__pyx_t_3 = NULL;
12582 int __pyx_lineno = 0;
12583 const char *__pyx_filename = NULL;
12584 int __pyx_clineno = 0;
12585 __Pyx_RefNannySetupContext(
"reverse", 0);
12594 __Pyx_XDECREF(__pyx_r);
12595 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_v_obj);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1433, __pyx_L1_error)
12596 __Pyx_GOTREF(__pyx_t_2);
12597 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_reverse);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1433, __pyx_L1_error)
12598 __Pyx_GOTREF(__pyx_t_3);
12599 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12601 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
12602 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
12603 if (likely(__pyx_t_2)) {
12604 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
12605 __Pyx_INCREF(__pyx_t_2);
12606 __Pyx_INCREF(
function);
12607 __Pyx_DECREF_SET(__pyx_t_3,
function);
12610 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
12611 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12612 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1433, __pyx_L1_error)
12613 __Pyx_GOTREF(__pyx_t_1);
12614 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12615 __pyx_r = __pyx_t_1;
12629 __Pyx_XDECREF(__pyx_t_1);
12630 __Pyx_XDECREF(__pyx_t_2);
12631 __Pyx_XDECREF(__pyx_t_3);
12632 __Pyx_AddTraceback(
"PyClical.reverse", __pyx_clineno, __pyx_lineno, __pyx_filename);
12635 __Pyx_XGIVEREF(__pyx_r);
12636 __Pyx_RefNannyFinishContext();
12641 static PyObject *__pyx_pw_8PyClical_27reverse(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12642 static char __pyx_doc_8PyClical_26reverse[] =
"\n Reversion, eg. {1}*{2} -> {2}*{1}\n\n >>> print(reverse(clifford(\"{1}\")))\n {1}\n >>> print(reverse(clifford(\"{2}\") * clifford(\"{1}\")))\n {1,2}\n >>> print(reverse(clifford(\"{1}\") * clifford(\"{2}\")))\n -{1,2}\n >>> print(reverse(clifford(\"1+{1}+{1,2}\")))\n 1+{1}-{1,2}\n ";
12643 static PyObject *__pyx_pw_8PyClical_27reverse(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12644 PyObject *__pyx_r = 0;
12645 __Pyx_RefNannyDeclarations
12646 __Pyx_RefNannySetupContext(
"reverse (wrapper)", 0);
12647 __pyx_r = __pyx_pf_8PyClical_26reverse(__pyx_self, ((PyObject *)__pyx_v_obj));
12650 __Pyx_RefNannyFinishContext();
12654 static PyObject *__pyx_pf_8PyClical_26reverse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12655 PyObject *__pyx_r = NULL;
12656 __Pyx_RefNannyDeclarations
12657 PyObject *__pyx_t_1 = NULL;
12658 int __pyx_lineno = 0;
12659 const char *__pyx_filename = NULL;
12660 int __pyx_clineno = 0;
12661 __Pyx_RefNannySetupContext(
"reverse", 0);
12662 __Pyx_XDECREF(__pyx_r);
12663 __pyx_t_1 = __pyx_f_8PyClical_reverse(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1420, __pyx_L1_error)
12664 __Pyx_GOTREF(__pyx_t_1);
12665 __pyx_r = __pyx_t_1;
12671 __Pyx_XDECREF(__pyx_t_1);
12672 __Pyx_AddTraceback(
"PyClical.reverse", __pyx_clineno, __pyx_lineno, __pyx_filename);
12675 __Pyx_XGIVEREF(__pyx_r);
12676 __Pyx_RefNannyFinishContext();
12688 static PyObject *__pyx_pw_8PyClical_29conj(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12689 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_conj(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12690 PyObject *__pyx_r = NULL;
12691 __Pyx_RefNannyDeclarations
12692 PyObject *__pyx_t_1 = NULL;
12693 PyObject *__pyx_t_2 = NULL;
12694 PyObject *__pyx_t_3 = NULL;
12695 int __pyx_lineno = 0;
12696 const char *__pyx_filename = NULL;
12697 int __pyx_clineno = 0;
12698 __Pyx_RefNannySetupContext(
"conj", 0);
12707 __Pyx_XDECREF(__pyx_r);
12708 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_v_obj);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1448, __pyx_L1_error)
12709 __Pyx_GOTREF(__pyx_t_2);
12710 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_conj);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1448, __pyx_L1_error)
12711 __Pyx_GOTREF(__pyx_t_3);
12712 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12714 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
12715 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
12716 if (likely(__pyx_t_2)) {
12717 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
12718 __Pyx_INCREF(__pyx_t_2);
12719 __Pyx_INCREF(
function);
12720 __Pyx_DECREF_SET(__pyx_t_3,
function);
12723 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
12724 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12725 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1448, __pyx_L1_error)
12726 __Pyx_GOTREF(__pyx_t_1);
12727 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12728 __pyx_r = __pyx_t_1;
12742 __Pyx_XDECREF(__pyx_t_1);
12743 __Pyx_XDECREF(__pyx_t_2);
12744 __Pyx_XDECREF(__pyx_t_3);
12745 __Pyx_AddTraceback(
"PyClical.conj", __pyx_clineno, __pyx_lineno, __pyx_filename);
12748 __Pyx_XGIVEREF(__pyx_r);
12749 __Pyx_RefNannyFinishContext();
12754 static PyObject *__pyx_pw_8PyClical_29conj(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12755 static char __pyx_doc_8PyClical_28conj[] =
"\n Conjugation, reverse o involute == involute o reverse.\n\n >>> print(conj(clifford(\"{1}\")))\n -{1}\n >>> print(conj(clifford(\"{2}\") * clifford(\"{1}\")))\n {1,2}\n >>> print(conj(clifford(\"{1}\") * clifford(\"{2}\")))\n -{1,2}\n >>> print(conj(clifford(\"1+{1}+{1,2}\")))\n 1-{1}-{1,2}\n ";
12756 static PyObject *__pyx_pw_8PyClical_29conj(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12757 PyObject *__pyx_r = 0;
12758 __Pyx_RefNannyDeclarations
12759 __Pyx_RefNannySetupContext(
"conj (wrapper)", 0);
12760 __pyx_r = __pyx_pf_8PyClical_28conj(__pyx_self, ((PyObject *)__pyx_v_obj));
12763 __Pyx_RefNannyFinishContext();
12767 static PyObject *__pyx_pf_8PyClical_28conj(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12768 PyObject *__pyx_r = NULL;
12769 __Pyx_RefNannyDeclarations
12770 PyObject *__pyx_t_1 = NULL;
12771 int __pyx_lineno = 0;
12772 const char *__pyx_filename = NULL;
12773 int __pyx_clineno = 0;
12774 __Pyx_RefNannySetupContext(
"conj", 0);
12775 __Pyx_XDECREF(__pyx_r);
12776 __pyx_t_1 = __pyx_f_8PyClical_conj(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1435, __pyx_L1_error)
12777 __Pyx_GOTREF(__pyx_t_1);
12778 __pyx_r = __pyx_t_1;
12784 __Pyx_XDECREF(__pyx_t_1);
12785 __Pyx_AddTraceback(
"PyClical.conj", __pyx_clineno, __pyx_lineno, __pyx_filename);
12788 __Pyx_XGIVEREF(__pyx_r);
12789 __Pyx_RefNannyFinishContext();
12801 static PyObject *__pyx_pw_8PyClical_31quad(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12802 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_quad(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12803 PyObject *__pyx_r = NULL;
12804 __Pyx_RefNannyDeclarations
12805 PyObject *__pyx_t_1 = NULL;
12806 PyObject *__pyx_t_2 = NULL;
12807 PyObject *__pyx_t_3 = NULL;
12808 int __pyx_lineno = 0;
12809 const char *__pyx_filename = NULL;
12810 int __pyx_clineno = 0;
12811 __Pyx_RefNannySetupContext(
"quad", 0);
12820 __Pyx_XDECREF(__pyx_r);
12821 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_v_obj);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1459, __pyx_L1_error)
12822 __Pyx_GOTREF(__pyx_t_2);
12823 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_quad);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1459, __pyx_L1_error)
12824 __Pyx_GOTREF(__pyx_t_3);
12825 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12827 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
12828 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
12829 if (likely(__pyx_t_2)) {
12830 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
12831 __Pyx_INCREF(__pyx_t_2);
12832 __Pyx_INCREF(
function);
12833 __Pyx_DECREF_SET(__pyx_t_3,
function);
12836 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
12837 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12838 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1459, __pyx_L1_error)
12839 __Pyx_GOTREF(__pyx_t_1);
12840 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12841 __pyx_r = __pyx_t_1;
12855 __Pyx_XDECREF(__pyx_t_1);
12856 __Pyx_XDECREF(__pyx_t_2);
12857 __Pyx_XDECREF(__pyx_t_3);
12858 __Pyx_AddTraceback(
"PyClical.quad", __pyx_clineno, __pyx_lineno, __pyx_filename);
12861 __Pyx_XGIVEREF(__pyx_r);
12862 __Pyx_RefNannyFinishContext();
12867 static PyObject *__pyx_pw_8PyClical_31quad(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12868 static char __pyx_doc_8PyClical_30quad[] =
"\n Quadratic form == (rev(x)*x)(0).\n\n >>> print(quad(clifford(\"1+{1}+{1,2}\")))\n 3.0\n >>> print(quad(clifford(\"1+{-1}+{1,2}+{1,2,3}\")))\n 2.0\n ";
12869 static PyObject *__pyx_pw_8PyClical_31quad(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12870 PyObject *__pyx_r = 0;
12871 __Pyx_RefNannyDeclarations
12872 __Pyx_RefNannySetupContext(
"quad (wrapper)", 0);
12873 __pyx_r = __pyx_pf_8PyClical_30quad(__pyx_self, ((PyObject *)__pyx_v_obj));
12876 __Pyx_RefNannyFinishContext();
12880 static PyObject *__pyx_pf_8PyClical_30quad(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12881 PyObject *__pyx_r = NULL;
12882 __Pyx_RefNannyDeclarations
12883 PyObject *__pyx_t_1 = NULL;
12884 int __pyx_lineno = 0;
12885 const char *__pyx_filename = NULL;
12886 int __pyx_clineno = 0;
12887 __Pyx_RefNannySetupContext(
"quad", 0);
12888 __Pyx_XDECREF(__pyx_r);
12889 __pyx_t_1 = __pyx_f_8PyClical_quad(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1450, __pyx_L1_error)
12890 __Pyx_GOTREF(__pyx_t_1);
12891 __pyx_r = __pyx_t_1;
12897 __Pyx_XDECREF(__pyx_t_1);
12898 __Pyx_AddTraceback(
"PyClical.quad", __pyx_clineno, __pyx_lineno, __pyx_filename);
12901 __Pyx_XGIVEREF(__pyx_r);
12902 __Pyx_RefNannyFinishContext();
12914 static PyObject *__pyx_pw_8PyClical_33norm(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12915 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_norm(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12916 PyObject *__pyx_r = NULL;
12917 __Pyx_RefNannyDeclarations
12918 PyObject *__pyx_t_1 = NULL;
12919 PyObject *__pyx_t_2 = NULL;
12920 PyObject *__pyx_t_3 = NULL;
12921 int __pyx_lineno = 0;
12922 const char *__pyx_filename = NULL;
12923 int __pyx_clineno = 0;
12924 __Pyx_RefNannySetupContext(
"norm", 0);
12933 __Pyx_XDECREF(__pyx_r);
12934 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_v_obj);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1470, __pyx_L1_error)
12935 __Pyx_GOTREF(__pyx_t_2);
12936 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_norm);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1470, __pyx_L1_error)
12937 __Pyx_GOTREF(__pyx_t_3);
12938 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12940 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
12941 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
12942 if (likely(__pyx_t_2)) {
12943 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
12944 __Pyx_INCREF(__pyx_t_2);
12945 __Pyx_INCREF(
function);
12946 __Pyx_DECREF_SET(__pyx_t_3,
function);
12949 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
12950 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12951 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1470, __pyx_L1_error)
12952 __Pyx_GOTREF(__pyx_t_1);
12953 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12954 __pyx_r = __pyx_t_1;
12968 __Pyx_XDECREF(__pyx_t_1);
12969 __Pyx_XDECREF(__pyx_t_2);
12970 __Pyx_XDECREF(__pyx_t_3);
12971 __Pyx_AddTraceback(
"PyClical.norm", __pyx_clineno, __pyx_lineno, __pyx_filename);
12974 __Pyx_XGIVEREF(__pyx_r);
12975 __Pyx_RefNannyFinishContext();
12980 static PyObject *__pyx_pw_8PyClical_33norm(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12981 static char __pyx_doc_8PyClical_32norm[] =
"\n norm == sum of squares of coordinates.\n\n >>> norm(clifford(\"1+{1}+{1,2}\"))\n 3.0\n >>> norm(clifford(\"1+{-1}+{1,2}+{1,2,3}\"))\n 4.0\n ";
12982 static PyObject *__pyx_pw_8PyClical_33norm(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12983 PyObject *__pyx_r = 0;
12984 __Pyx_RefNannyDeclarations
12985 __Pyx_RefNannySetupContext(
"norm (wrapper)", 0);
12986 __pyx_r = __pyx_pf_8PyClical_32norm(__pyx_self, ((PyObject *)__pyx_v_obj));
12989 __Pyx_RefNannyFinishContext();
12993 static PyObject *__pyx_pf_8PyClical_32norm(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12994 PyObject *__pyx_r = NULL;
12995 __Pyx_RefNannyDeclarations
12996 PyObject *__pyx_t_1 = NULL;
12997 int __pyx_lineno = 0;
12998 const char *__pyx_filename = NULL;
12999 int __pyx_clineno = 0;
13000 __Pyx_RefNannySetupContext(
"norm", 0);
13001 __Pyx_XDECREF(__pyx_r);
13002 __pyx_t_1 = __pyx_f_8PyClical_norm(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1461, __pyx_L1_error)
13003 __Pyx_GOTREF(__pyx_t_1);
13004 __pyx_r = __pyx_t_1;
13010 __Pyx_XDECREF(__pyx_t_1);
13011 __Pyx_AddTraceback(
"PyClical.norm", __pyx_clineno, __pyx_lineno, __pyx_filename);
13014 __Pyx_XGIVEREF(__pyx_r);
13015 __Pyx_RefNannyFinishContext();
13027 static PyObject *__pyx_pw_8PyClical_35abs(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13028 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_abs(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
13029 PyObject *__pyx_r = NULL;
13030 __Pyx_RefNannyDeclarations
13031 PyObject *__pyx_t_1 = NULL;
13032 int __pyx_lineno = 0;
13033 const char *__pyx_filename = NULL;
13034 int __pyx_clineno = 0;
13035 __Pyx_RefNannySetupContext(
"abs", 0);
13044 __Pyx_XDECREF(__pyx_r);
13045 __pyx_t_1 =
PyFloat_FromDouble(
abs(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1479, __pyx_L1_error)
13046 __Pyx_GOTREF(__pyx_t_1);
13047 __pyx_r = __pyx_t_1;
13061 __Pyx_XDECREF(__pyx_t_1);
13062 __Pyx_AddTraceback(
"PyClical.abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
13065 __Pyx_XGIVEREF(__pyx_r);
13066 __Pyx_RefNannyFinishContext();
13071 static PyObject *__pyx_pw_8PyClical_35abs(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13072 static char __pyx_doc_8PyClical_34abs[] =
"\n Absolute value of multivector: multivector 2-norm.\n\n >>> abs(clifford(\"1+{-1}+{1,2}+{1,2,3}\"))\n 2.0\n ";
13073 static PyObject *__pyx_pw_8PyClical_35abs(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13074 PyObject *__pyx_r = 0;
13075 __Pyx_RefNannyDeclarations
13076 __Pyx_RefNannySetupContext(
"abs (wrapper)", 0);
13077 __pyx_r = __pyx_pf_8PyClical_34abs(__pyx_self, ((PyObject *)__pyx_v_obj));
13080 __Pyx_RefNannyFinishContext();
13084 static PyObject *__pyx_pf_8PyClical_34abs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13085 PyObject *__pyx_r = NULL;
13086 __Pyx_RefNannyDeclarations
13087 PyObject *__pyx_t_1 = NULL;
13088 int __pyx_lineno = 0;
13089 const char *__pyx_filename = NULL;
13090 int __pyx_clineno = 0;
13091 __Pyx_RefNannySetupContext(
"abs", 0);
13092 __Pyx_XDECREF(__pyx_r);
13093 __pyx_t_1 = __pyx_f_8PyClical_abs(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1472, __pyx_L1_error)
13094 __Pyx_GOTREF(__pyx_t_1);
13095 __pyx_r = __pyx_t_1;
13101 __Pyx_XDECREF(__pyx_t_1);
13102 __Pyx_AddTraceback(
"PyClical.abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
13105 __Pyx_XGIVEREF(__pyx_r);
13106 __Pyx_RefNannyFinishContext();
13118 static PyObject *__pyx_pw_8PyClical_37max_abs(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13119 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_max_abs(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
13120 PyObject *__pyx_r = NULL;
13121 __Pyx_RefNannyDeclarations
13122 PyObject *__pyx_t_1 = NULL;
13123 int __pyx_lineno = 0;
13124 const char *__pyx_filename = NULL;
13125 int __pyx_clineno = 0;
13126 __Pyx_RefNannySetupContext(
"max_abs", 0);
13135 __Pyx_XDECREF(__pyx_r);
13136 __pyx_t_1 =
PyFloat_FromDouble(
max_abs(__pyx_f_8PyClical_toClifford(__pyx_v_obj)));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1491, __pyx_L1_error)
13137 __Pyx_GOTREF(__pyx_t_1);
13138 __pyx_r = __pyx_t_1;
13152 __Pyx_XDECREF(__pyx_t_1);
13153 __Pyx_AddTraceback(
"PyClical.max_abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
13156 __Pyx_XGIVEREF(__pyx_r);
13157 __Pyx_RefNannyFinishContext();
13162 static PyObject *__pyx_pw_8PyClical_37max_abs(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13163 static char __pyx_doc_8PyClical_36max_abs[] =
"\n Maximum absolute value of coordinates multivector: multivector infinity-norm.\n\n >>> max_abs(clifford(\"1+{-1}+{1,2}+{1,2,3}\"))\n 1.0\n >>> max_abs(clifford(\"3+2{1}+{1,2}\"))\n 3.0\n\n ";
13164 static PyObject *__pyx_pw_8PyClical_37max_abs(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13165 PyObject *__pyx_r = 0;
13166 __Pyx_RefNannyDeclarations
13167 __Pyx_RefNannySetupContext(
"max_abs (wrapper)", 0);
13168 __pyx_r = __pyx_pf_8PyClical_36max_abs(__pyx_self, ((PyObject *)__pyx_v_obj));
13171 __Pyx_RefNannyFinishContext();
13175 static PyObject *__pyx_pf_8PyClical_36max_abs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13176 PyObject *__pyx_r = NULL;
13177 __Pyx_RefNannyDeclarations
13178 PyObject *__pyx_t_1 = NULL;
13179 int __pyx_lineno = 0;
13180 const char *__pyx_filename = NULL;
13181 int __pyx_clineno = 0;
13182 __Pyx_RefNannySetupContext(
"max_abs", 0);
13183 __Pyx_XDECREF(__pyx_r);
13184 __pyx_t_1 = __pyx_f_8PyClical_max_abs(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1481, __pyx_L1_error)
13185 __Pyx_GOTREF(__pyx_t_1);
13186 __pyx_r = __pyx_t_1;
13192 __Pyx_XDECREF(__pyx_t_1);
13193 __Pyx_AddTraceback(
"PyClical.max_abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
13196 __Pyx_XGIVEREF(__pyx_r);
13197 __Pyx_RefNannyFinishContext();
13209 static PyObject *__pyx_pw_8PyClical_39pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13210 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_pow(PyObject *__pyx_v_obj, PyObject *__pyx_v_m, CYTHON_UNUSED
int __pyx_skip_dispatch) {
13211 PyObject *__pyx_r = NULL;
13212 __Pyx_RefNannyDeclarations
13213 PyObject *__pyx_t_1 = NULL;
13214 PyObject *__pyx_t_2 = NULL;
13215 PyObject *__pyx_t_3 = NULL;
13216 PyObject *__pyx_t_4 = NULL;
13217 PyObject *__pyx_t_5 = NULL;
13218 PyObject *__pyx_t_6 = NULL;
13220 PyObject *__pyx_t_8 = NULL;
13221 PyObject *__pyx_t_9 = NULL;
13222 PyObject *__pyx_t_10 = NULL;
13223 int __pyx_lineno = 0;
13224 const char *__pyx_filename = NULL;
13225 int __pyx_clineno = 0;
13226 __Pyx_RefNannySetupContext(
"pow", 0);
13236 __Pyx_PyThreadState_declare
13237 __Pyx_PyThreadState_assign
13238 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
13239 __Pyx_XGOTREF(__pyx_t_1);
13240 __Pyx_XGOTREF(__pyx_t_2);
13241 __Pyx_XGOTREF(__pyx_t_3);
13251 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1513, __pyx_L3_error)
13252 __Pyx_GOTREF(__pyx_t_5);
13253 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_pow);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1513, __pyx_L3_error)
13254 __Pyx_GOTREF(__pyx_t_6);
13255 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13258 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
13259 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
13260 if (likely(__pyx_t_5)) {
13261 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
13262 __Pyx_INCREF(__pyx_t_5);
13263 __Pyx_INCREF(
function);
13264 __Pyx_DECREF_SET(__pyx_t_6,
function);
13268 #if CYTHON_FAST_PYCALL
13269 if (PyFunction_Check(__pyx_t_6)) {
13270 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_obj, __pyx_v_m};
13271 __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, 1513, __pyx_L3_error)
13272 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13273 __Pyx_GOTREF(__pyx_t_4);
13276 #if CYTHON_FAST_PYCCALL
13277 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
13278 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_obj, __pyx_v_m};
13279 __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, 1513, __pyx_L3_error)
13280 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13281 __Pyx_GOTREF(__pyx_t_4);
13285 __pyx_t_8 = PyTuple_New(2+__pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1513, __pyx_L3_error)
13286 __Pyx_GOTREF(__pyx_t_8);
13288 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
13290 __Pyx_INCREF(__pyx_v_obj);
13291 __Pyx_GIVEREF(__pyx_v_obj);
13292 PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_obj);
13293 __Pyx_INCREF(__pyx_v_m);
13294 __Pyx_GIVEREF(__pyx_v_m);
13295 PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_m);
13296 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1513, __pyx_L3_error)
13297 __Pyx_GOTREF(__pyx_t_4);
13298 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13300 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13301 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13311 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
13312 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
13313 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13314 goto __pyx_L8_try_end;
13316 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
13317 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13318 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
13319 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
13329 __Pyx_AddTraceback(
"PyClical.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
13330 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_8) < 0) __PYX_ERR(0, 1514, __pyx_L5_except_error)
13331 __Pyx_GOTREF(__pyx_t_4);
13332 __Pyx_GOTREF(__pyx_t_6);
13333 __Pyx_GOTREF(__pyx_t_8);
13342 __Pyx_XDECREF(__pyx_r);
13343 __pyx_t_9 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_v_obj);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1515, __pyx_L5_except_error)
13344 __Pyx_GOTREF(__pyx_t_9);
13345 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_pow);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1515, __pyx_L5_except_error)
13346 __Pyx_GOTREF(__pyx_t_10);
13347 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13349 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
13350 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
13351 if (likely(__pyx_t_9)) {
13352 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_10);
13353 __Pyx_INCREF(__pyx_t_9);
13354 __Pyx_INCREF(
function);
13355 __Pyx_DECREF_SET(__pyx_t_10,
function);
13358 __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);
13359 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
13360 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1515, __pyx_L5_except_error)
13361 __Pyx_GOTREF(__pyx_t_5);
13362 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13363 __pyx_r = __pyx_t_5;
13365 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13366 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13367 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13368 goto __pyx_L6_except_return;
13370 __pyx_L5_except_error:;
13379 __Pyx_XGIVEREF(__pyx_t_1);
13380 __Pyx_XGIVEREF(__pyx_t_2);
13381 __Pyx_XGIVEREF(__pyx_t_3);
13382 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
13383 goto __pyx_L1_error;
13384 __pyx_L6_except_return:;
13385 __Pyx_XGIVEREF(__pyx_t_1);
13386 __Pyx_XGIVEREF(__pyx_t_2);
13387 __Pyx_XGIVEREF(__pyx_t_3);
13388 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
13402 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13405 __Pyx_XDECREF(__pyx_t_4);
13406 __Pyx_XDECREF(__pyx_t_5);
13407 __Pyx_XDECREF(__pyx_t_6);
13408 __Pyx_XDECREF(__pyx_t_8);
13409 __Pyx_XDECREF(__pyx_t_9);
13410 __Pyx_XDECREF(__pyx_t_10);
13411 __Pyx_AddTraceback(
"PyClical.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
13414 __Pyx_XGIVEREF(__pyx_r);
13415 __Pyx_RefNannyFinishContext();
13420 static PyObject *__pyx_pw_8PyClical_39pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13421 static char __pyx_doc_8PyClical_38pow[] =
"\n Integer power of multivector: obj to the m.\n\n >>> x=clifford(\"{1}\"); print(pow(x,2))\n 1\n >>> x=clifford(\"2\"); print(pow(x,2))\n 4\n >>> x=clifford(\"2+{1}\"); print(pow(x,0))\n 1\n >>> x=clifford(\"2+{1}\"); print(pow(x,1))\n 2+{1}\n >>> x=clifford(\"2+{1}\"); print(pow(x,2))\n 5+4{1}\n >>> print(pow(clifford(\"1+{1}+{1,2}\"),3))\n 1+3{1}+3{1,2}\n >>> i=clifford(\"{1,2}\"); print(exp(pi/2) * pow(i, i))\n 1\n ";
13422 static PyObject *__pyx_pw_8PyClical_39pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13423 PyObject *__pyx_v_obj = 0;
13424 PyObject *__pyx_v_m = 0;
13425 int __pyx_lineno = 0;
13426 const char *__pyx_filename = NULL;
13427 int __pyx_clineno = 0;
13428 PyObject *__pyx_r = 0;
13429 __Pyx_RefNannyDeclarations
13430 __Pyx_RefNannySetupContext(
"pow (wrapper)", 0);
13432 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_m,0};
13433 PyObject* values[2] = {0,0};
13434 if (unlikely(__pyx_kwds)) {
13435 Py_ssize_t kw_args;
13436 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13437 switch (pos_args) {
13438 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13439 CYTHON_FALLTHROUGH;
13440 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13441 CYTHON_FALLTHROUGH;
13443 default:
goto __pyx_L5_argtuple_error;
13445 kw_args = PyDict_Size(__pyx_kwds);
13446 switch (pos_args) {
13448 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
13449 else goto __pyx_L5_argtuple_error;
13450 CYTHON_FALLTHROUGH;
13452 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
13454 __Pyx_RaiseArgtupleInvalid(
"pow", 1, 2, 2, 1); __PYX_ERR(0, 1493, __pyx_L3_error)
13457 if (unlikely(kw_args > 0)) {
13458 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"pow") < 0)) __PYX_ERR(0, 1493, __pyx_L3_error)
13460 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
13461 goto __pyx_L5_argtuple_error;
13463 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13464 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13466 __pyx_v_obj = values[0];
13467 __pyx_v_m = values[1];
13469 goto __pyx_L4_argument_unpacking_done;
13470 __pyx_L5_argtuple_error:;
13471 __Pyx_RaiseArgtupleInvalid(
"pow", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1493, __pyx_L3_error)
13473 __Pyx_AddTraceback(
"PyClical.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
13474 __Pyx_RefNannyFinishContext();
13476 __pyx_L4_argument_unpacking_done:;
13477 __pyx_r = __pyx_pf_8PyClical_38pow(__pyx_self, __pyx_v_obj, __pyx_v_m);
13480 __Pyx_RefNannyFinishContext();
13484 static PyObject *__pyx_pf_8PyClical_38pow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_m) {
13485 PyObject *__pyx_r = NULL;
13486 __Pyx_RefNannyDeclarations
13487 PyObject *__pyx_t_1 = NULL;
13488 int __pyx_lineno = 0;
13489 const char *__pyx_filename = NULL;
13490 int __pyx_clineno = 0;
13491 __Pyx_RefNannySetupContext(
"pow", 0);
13492 __Pyx_XDECREF(__pyx_r);
13493 __pyx_t_1 = __pyx_f_8PyClical_pow(__pyx_v_obj, __pyx_v_m, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1493, __pyx_L1_error)
13494 __Pyx_GOTREF(__pyx_t_1);
13495 __pyx_r = __pyx_t_1;
13501 __Pyx_XDECREF(__pyx_t_1);
13502 __Pyx_AddTraceback(
"PyClical.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
13505 __Pyx_XGIVEREF(__pyx_r);
13506 __Pyx_RefNannyFinishContext();
13518 static PyObject *__pyx_pw_8PyClical_41outer_pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13519 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_outer_pow(PyObject *__pyx_v_obj, PyObject *__pyx_v_m, CYTHON_UNUSED
int __pyx_skip_dispatch) {
13520 PyObject *__pyx_r = NULL;
13521 __Pyx_RefNannyDeclarations
13522 PyObject *__pyx_t_1 = NULL;
13523 PyObject *__pyx_t_2 = NULL;
13524 PyObject *__pyx_t_3 = NULL;
13525 int __pyx_lineno = 0;
13526 const char *__pyx_filename = NULL;
13527 int __pyx_clineno = 0;
13528 __Pyx_RefNannySetupContext(
"outer_pow", 0);
13537 __Pyx_XDECREF(__pyx_r);
13538 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_v_obj);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1524, __pyx_L1_error)
13539 __Pyx_GOTREF(__pyx_t_2);
13540 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_outer_pow);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1524, __pyx_L1_error)
13541 __Pyx_GOTREF(__pyx_t_3);
13542 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13544 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
13545 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
13546 if (likely(__pyx_t_2)) {
13547 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
13548 __Pyx_INCREF(__pyx_t_2);
13549 __Pyx_INCREF(
function);
13550 __Pyx_DECREF_SET(__pyx_t_3,
function);
13553 __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);
13554 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
13555 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1524, __pyx_L1_error)
13556 __Pyx_GOTREF(__pyx_t_1);
13557 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13558 __pyx_r = __pyx_t_1;
13572 __Pyx_XDECREF(__pyx_t_1);
13573 __Pyx_XDECREF(__pyx_t_2);
13574 __Pyx_XDECREF(__pyx_t_3);
13575 __Pyx_AddTraceback(
"PyClical.outer_pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
13578 __Pyx_XGIVEREF(__pyx_r);
13579 __Pyx_RefNannyFinishContext();
13584 static PyObject *__pyx_pw_8PyClical_41outer_pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13585 static char __pyx_doc_8PyClical_40outer_pow[] =
"\n Outer product power of multivector.\n\n >>> print(outer_pow(clifford(\"1+{1}+{1,2}\"),3))\n 1+3{1}+3{1,2}\n ";
13586 static PyObject *__pyx_pw_8PyClical_41outer_pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13587 PyObject *__pyx_v_obj = 0;
13588 PyObject *__pyx_v_m = 0;
13589 int __pyx_lineno = 0;
13590 const char *__pyx_filename = NULL;
13591 int __pyx_clineno = 0;
13592 PyObject *__pyx_r = 0;
13593 __Pyx_RefNannyDeclarations
13594 __Pyx_RefNannySetupContext(
"outer_pow (wrapper)", 0);
13596 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_m,0};
13597 PyObject* values[2] = {0,0};
13598 if (unlikely(__pyx_kwds)) {
13599 Py_ssize_t kw_args;
13600 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13601 switch (pos_args) {
13602 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13603 CYTHON_FALLTHROUGH;
13604 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13605 CYTHON_FALLTHROUGH;
13607 default:
goto __pyx_L5_argtuple_error;
13609 kw_args = PyDict_Size(__pyx_kwds);
13610 switch (pos_args) {
13612 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
13613 else goto __pyx_L5_argtuple_error;
13614 CYTHON_FALLTHROUGH;
13616 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
13618 __Pyx_RaiseArgtupleInvalid(
"outer_pow", 1, 2, 2, 1); __PYX_ERR(0, 1517, __pyx_L3_error)
13621 if (unlikely(kw_args > 0)) {
13622 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"outer_pow") < 0)) __PYX_ERR(0, 1517, __pyx_L3_error)
13624 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
13625 goto __pyx_L5_argtuple_error;
13627 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13628 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13630 __pyx_v_obj = values[0];
13631 __pyx_v_m = values[1];
13633 goto __pyx_L4_argument_unpacking_done;
13634 __pyx_L5_argtuple_error:;
13635 __Pyx_RaiseArgtupleInvalid(
"outer_pow", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1517, __pyx_L3_error)
13637 __Pyx_AddTraceback(
"PyClical.outer_pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
13638 __Pyx_RefNannyFinishContext();
13640 __pyx_L4_argument_unpacking_done:;
13641 __pyx_r = __pyx_pf_8PyClical_40outer_pow(__pyx_self, __pyx_v_obj, __pyx_v_m);
13644 __Pyx_RefNannyFinishContext();
13648 static PyObject *__pyx_pf_8PyClical_40outer_pow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_m) {
13649 PyObject *__pyx_r = NULL;
13650 __Pyx_RefNannyDeclarations
13651 PyObject *__pyx_t_1 = NULL;
13652 int __pyx_lineno = 0;
13653 const char *__pyx_filename = NULL;
13654 int __pyx_clineno = 0;
13655 __Pyx_RefNannySetupContext(
"outer_pow", 0);
13656 __Pyx_XDECREF(__pyx_r);
13657 __pyx_t_1 = __pyx_f_8PyClical_outer_pow(__pyx_v_obj, __pyx_v_m, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1517, __pyx_L1_error)
13658 __Pyx_GOTREF(__pyx_t_1);
13659 __pyx_r = __pyx_t_1;
13665 __Pyx_XDECREF(__pyx_t_1);
13666 __Pyx_AddTraceback(
"PyClical.outer_pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
13669 __Pyx_XGIVEREF(__pyx_r);
13670 __Pyx_RefNannyFinishContext();
13682 static PyObject *__pyx_pw_8PyClical_43complexifier(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13683 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_complexifier(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
13684 PyObject *__pyx_r = NULL;
13685 __Pyx_RefNannyDeclarations
13686 PyObject *__pyx_t_1 = NULL;
13687 PyObject *__pyx_t_2 = NULL;
13688 int __pyx_lineno = 0;
13689 const char *__pyx_filename = NULL;
13690 int __pyx_clineno = 0;
13691 __Pyx_RefNannySetupContext(
"complexifier", 0);
13700 __Pyx_XDECREF(__pyx_r);
13701 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1539, __pyx_L1_error)
13702 __Pyx_GOTREF(__pyx_t_1);
13703 __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, 1539, __pyx_L1_error)
13704 __Pyx_GOTREF(__pyx_t_2);
13705 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13706 __pyx_r = __pyx_t_2;
13720 __Pyx_XDECREF(__pyx_t_1);
13721 __Pyx_XDECREF(__pyx_t_2);
13722 __Pyx_AddTraceback(
"PyClical.complexifier", __pyx_clineno, __pyx_lineno, __pyx_filename);
13725 __Pyx_XGIVEREF(__pyx_r);
13726 __Pyx_RefNannyFinishContext();
13731 static PyObject *__pyx_pw_8PyClical_43complexifier(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13732 static char __pyx_doc_8PyClical_42complexifier[] =
"\n Square root of -1 which commutes with all members of the frame of the given multivector.\n\n >>> print(complexifier(clifford(index_set({1}))))\n {1,2,3}\n >>> print(complexifier(clifford(index_set({-1}))))\n {-1}\n >>> print(complexifier(index_set({1})))\n {1,2,3}\n >>> print(complexifier(index_set({-1})))\n {-1}\n ";
13733 static PyObject *__pyx_pw_8PyClical_43complexifier(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13734 PyObject *__pyx_r = 0;
13735 __Pyx_RefNannyDeclarations
13736 __Pyx_RefNannySetupContext(
"complexifier (wrapper)", 0);
13737 __pyx_r = __pyx_pf_8PyClical_42complexifier(__pyx_self, ((PyObject *)__pyx_v_obj));
13740 __Pyx_RefNannyFinishContext();
13744 static PyObject *__pyx_pf_8PyClical_42complexifier(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13745 PyObject *__pyx_r = NULL;
13746 __Pyx_RefNannyDeclarations
13747 PyObject *__pyx_t_1 = NULL;
13748 int __pyx_lineno = 0;
13749 const char *__pyx_filename = NULL;
13750 int __pyx_clineno = 0;
13751 __Pyx_RefNannySetupContext(
"complexifier", 0);
13752 __Pyx_XDECREF(__pyx_r);
13753 __pyx_t_1 = __pyx_f_8PyClical_complexifier(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1526, __pyx_L1_error)
13754 __Pyx_GOTREF(__pyx_t_1);
13755 __pyx_r = __pyx_t_1;
13761 __Pyx_XDECREF(__pyx_t_1);
13762 __Pyx_AddTraceback(
"PyClical.complexifier", __pyx_clineno, __pyx_lineno, __pyx_filename);
13765 __Pyx_XGIVEREF(__pyx_r);
13766 __Pyx_RefNannyFinishContext();
13778 static PyObject *__pyx_pw_8PyClical_45sqrt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13779 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) {
13780 PyObject *__pyx_v_i = ((PyObject *)Py_None);
13781 PyObject *__pyx_r = NULL;
13782 __Pyx_RefNannyDeclarations
13785 PyObject *__pyx_t_3 = NULL;
13787 PyObject *__pyx_t_5 = NULL;
13788 PyObject *__pyx_t_6 = NULL;
13789 PyObject *__pyx_t_7 = NULL;
13790 PyObject *__pyx_t_8 = NULL;
13791 PyObject *__pyx_t_9 = NULL;
13792 PyObject *__pyx_t_10 = NULL;
13793 PyObject *__pyx_t_11 = NULL;
13794 int __pyx_lineno = 0;
13795 const char *__pyx_filename = NULL;
13796 int __pyx_clineno = 0;
13797 __Pyx_RefNannySetupContext(
"sqrt", 0);
13798 if (__pyx_optional_args) {
13799 if (__pyx_optional_args->__pyx_n > 0) {
13800 __pyx_v_i = __pyx_optional_args->i;
13811 __pyx_t_1 = (__pyx_v_i != Py_None);
13812 __pyx_t_2 = (__pyx_t_1 != 0);
13822 __Pyx_XDECREF(__pyx_r);
13823 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1557, __pyx_L1_error)
13824 __Pyx_GOTREF(__pyx_t_3);
13826 __pyx_t_4 =
sqrt(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
13828 __Pyx_CppExn2PyErr();
13829 __PYX_ERR(0, 1557, __pyx_L1_error)
13831 __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, 1557, __pyx_L1_error)
13832 __Pyx_GOTREF(__pyx_t_5);
13833 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13834 __pyx_r = __pyx_t_5;
13856 __Pyx_PyThreadState_declare
13857 __Pyx_PyThreadState_assign
13858 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
13859 __Pyx_XGOTREF(__pyx_t_6);
13860 __Pyx_XGOTREF(__pyx_t_7);
13861 __Pyx_XGOTREF(__pyx_t_8);
13871 __Pyx_XDECREF(__pyx_r);
13872 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1560, __pyx_L4_error)
13873 __Pyx_GOTREF(__pyx_t_3);
13874 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sqrt);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1560, __pyx_L4_error)
13875 __Pyx_GOTREF(__pyx_t_9);
13876 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13878 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
13879 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
13880 if (likely(__pyx_t_3)) {
13881 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
13882 __Pyx_INCREF(__pyx_t_3);
13883 __Pyx_INCREF(
function);
13884 __Pyx_DECREF_SET(__pyx_t_9,
function);
13887 __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);
13888 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13889 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1560, __pyx_L4_error)
13890 __Pyx_GOTREF(__pyx_t_5);
13891 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13892 __pyx_r = __pyx_t_5;
13894 goto __pyx_L8_try_return;
13905 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13906 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13907 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
13917 __Pyx_AddTraceback(
"PyClical.sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename);
13918 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1561, __pyx_L6_except_error)
13919 __Pyx_GOTREF(__pyx_t_5);
13920 __Pyx_GOTREF(__pyx_t_9);
13921 __Pyx_GOTREF(__pyx_t_3);
13930 __Pyx_XDECREF(__pyx_r);
13931 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1562, __pyx_L6_except_error)
13932 __Pyx_GOTREF(__pyx_t_10);
13933 __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, 1562, __pyx_L6_except_error)
13934 __Pyx_GOTREF(__pyx_t_11);
13935 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13936 __pyx_r = __pyx_t_11;
13938 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13939 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13940 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13941 goto __pyx_L7_except_return;
13943 __pyx_L6_except_error:;
13952 __Pyx_XGIVEREF(__pyx_t_6);
13953 __Pyx_XGIVEREF(__pyx_t_7);
13954 __Pyx_XGIVEREF(__pyx_t_8);
13955 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
13956 goto __pyx_L1_error;
13957 __pyx_L8_try_return:;
13958 __Pyx_XGIVEREF(__pyx_t_6);
13959 __Pyx_XGIVEREF(__pyx_t_7);
13960 __Pyx_XGIVEREF(__pyx_t_8);
13961 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
13963 __pyx_L7_except_return:;
13964 __Pyx_XGIVEREF(__pyx_t_6);
13965 __Pyx_XGIVEREF(__pyx_t_7);
13966 __Pyx_XGIVEREF(__pyx_t_8);
13967 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
13982 __Pyx_XDECREF(__pyx_t_3);
13983 __Pyx_XDECREF(__pyx_t_5);
13984 __Pyx_XDECREF(__pyx_t_9);
13985 __Pyx_XDECREF(__pyx_t_10);
13986 __Pyx_XDECREF(__pyx_t_11);
13987 __Pyx_AddTraceback(
"PyClical.sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename);
13990 __Pyx_XGIVEREF(__pyx_r);
13991 __Pyx_RefNannyFinishContext();
13996 static PyObject *__pyx_pw_8PyClical_45sqrt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13997 static char __pyx_doc_8PyClical_44sqrt[] =
"\n Square root of multivector with optional complexifier.\n\n >>> print(sqrt(-1))\n {-1}\n >>> print(sqrt(clifford(\"2{-1}\")))\n 1+{-1}\n >>> j=sqrt(-1,complexifier(index_set({1}))); print(j); print(j*j)\n {1,2,3}\n -1\n >>> j=sqrt(-1,\"{1,2,3}\"); print(j); print(j*j)\n {1,2,3}\n -1\n ";
13998 static PyObject *__pyx_pw_8PyClical_45sqrt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13999 PyObject *__pyx_v_obj = 0;
14000 PyObject *__pyx_v_i = 0;
14001 int __pyx_lineno = 0;
14002 const char *__pyx_filename = NULL;
14003 int __pyx_clineno = 0;
14004 PyObject *__pyx_r = 0;
14005 __Pyx_RefNannyDeclarations
14006 __Pyx_RefNannySetupContext(
"sqrt (wrapper)", 0);
14008 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
14009 PyObject* values[2] = {0,0};
14010 values[1] = ((PyObject *)Py_None);
14011 if (unlikely(__pyx_kwds)) {
14012 Py_ssize_t kw_args;
14013 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14014 switch (pos_args) {
14015 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14016 CYTHON_FALLTHROUGH;
14017 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14018 CYTHON_FALLTHROUGH;
14020 default:
goto __pyx_L5_argtuple_error;
14022 kw_args = PyDict_Size(__pyx_kwds);
14023 switch (pos_args) {
14025 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
14026 else goto __pyx_L5_argtuple_error;
14027 CYTHON_FALLTHROUGH;
14030 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
14031 if (value) { values[1] = value; kw_args--; }
14034 if (unlikely(kw_args > 0)) {
14035 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"sqrt") < 0)) __PYX_ERR(0, 1541, __pyx_L3_error)
14038 switch (PyTuple_GET_SIZE(__pyx_args)) {
14039 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14040 CYTHON_FALLTHROUGH;
14041 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14043 default:
goto __pyx_L5_argtuple_error;
14046 __pyx_v_obj = values[0];
14047 __pyx_v_i = values[1];
14049 goto __pyx_L4_argument_unpacking_done;
14050 __pyx_L5_argtuple_error:;
14051 __Pyx_RaiseArgtupleInvalid(
"sqrt", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1541, __pyx_L3_error)
14053 __Pyx_AddTraceback(
"PyClical.sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename);
14054 __Pyx_RefNannyFinishContext();
14056 __pyx_L4_argument_unpacking_done:;
14057 __pyx_r = __pyx_pf_8PyClical_44sqrt(__pyx_self, __pyx_v_obj, __pyx_v_i);
14060 __Pyx_RefNannyFinishContext();
14064 static PyObject *__pyx_pf_8PyClical_44sqrt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
14065 PyObject *__pyx_r = NULL;
14066 __Pyx_RefNannyDeclarations
14067 PyObject *__pyx_t_1 = NULL;
14068 struct __pyx_opt_args_8PyClical_sqrt __pyx_t_2;
14069 int __pyx_lineno = 0;
14070 const char *__pyx_filename = NULL;
14071 int __pyx_clineno = 0;
14072 __Pyx_RefNannySetupContext(
"sqrt", 0);
14073 __Pyx_XDECREF(__pyx_r);
14074 __pyx_t_2.__pyx_n = 1;
14075 __pyx_t_2.i = __pyx_v_i;
14076 __pyx_t_1 = __pyx_f_8PyClical_sqrt(__pyx_v_obj, 0, &__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1541, __pyx_L1_error)
14077 __Pyx_GOTREF(__pyx_t_1);
14078 __pyx_r = __pyx_t_1;
14084 __Pyx_XDECREF(__pyx_t_1);
14085 __Pyx_AddTraceback(
"PyClical.sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename);
14088 __Pyx_XGIVEREF(__pyx_r);
14089 __Pyx_RefNannyFinishContext();
14101 static PyObject *__pyx_pw_8PyClical_47exp(PyObject *__pyx_self, PyObject *__pyx_v_obj);
14102 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_exp(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
14103 PyObject *__pyx_r = NULL;
14104 __Pyx_RefNannyDeclarations
14105 PyObject *__pyx_t_1 = NULL;
14106 PyObject *__pyx_t_2 = NULL;
14107 PyObject *__pyx_t_3 = NULL;
14108 PyObject *__pyx_t_4 = NULL;
14109 PyObject *__pyx_t_5 = NULL;
14110 PyObject *__pyx_t_6 = NULL;
14111 PyObject *__pyx_t_7 = NULL;
14112 PyObject *__pyx_t_8 = NULL;
14113 int __pyx_lineno = 0;
14114 const char *__pyx_filename = NULL;
14115 int __pyx_clineno = 0;
14116 __Pyx_RefNannySetupContext(
"exp", 0);
14126 __Pyx_PyThreadState_declare
14127 __Pyx_PyThreadState_assign
14128 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
14129 __Pyx_XGOTREF(__pyx_t_1);
14130 __Pyx_XGOTREF(__pyx_t_2);
14131 __Pyx_XGOTREF(__pyx_t_3);
14141 __Pyx_XDECREF(__pyx_r);
14142 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1574, __pyx_L3_error)
14143 __Pyx_GOTREF(__pyx_t_5);
14144 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_exp);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1574, __pyx_L3_error)
14145 __Pyx_GOTREF(__pyx_t_6);
14146 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14148 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
14149 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
14150 if (likely(__pyx_t_5)) {
14151 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
14152 __Pyx_INCREF(__pyx_t_5);
14153 __Pyx_INCREF(
function);
14154 __Pyx_DECREF_SET(__pyx_t_6,
function);
14157 __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);
14158 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14159 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1574, __pyx_L3_error)
14160 __Pyx_GOTREF(__pyx_t_4);
14161 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14162 __pyx_r = __pyx_t_4;
14164 goto __pyx_L7_try_return;
14175 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
14176 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14177 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
14187 __Pyx_AddTraceback(
"PyClical.exp", __pyx_clineno, __pyx_lineno, __pyx_filename);
14188 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(0, 1575, __pyx_L5_except_error)
14189 __Pyx_GOTREF(__pyx_t_4);
14190 __Pyx_GOTREF(__pyx_t_6);
14191 __Pyx_GOTREF(__pyx_t_5);
14200 __Pyx_XDECREF(__pyx_r);
14201 __pyx_t_7 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1576, __pyx_L5_except_error)
14202 __Pyx_GOTREF(__pyx_t_7);
14203 __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, 1576, __pyx_L5_except_error)
14204 __Pyx_GOTREF(__pyx_t_8);
14205 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14206 __pyx_r = __pyx_t_8;
14208 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14209 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14210 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14211 goto __pyx_L6_except_return;
14213 __pyx_L5_except_error:;
14222 __Pyx_XGIVEREF(__pyx_t_1);
14223 __Pyx_XGIVEREF(__pyx_t_2);
14224 __Pyx_XGIVEREF(__pyx_t_3);
14225 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
14226 goto __pyx_L1_error;
14227 __pyx_L7_try_return:;
14228 __Pyx_XGIVEREF(__pyx_t_1);
14229 __Pyx_XGIVEREF(__pyx_t_2);
14230 __Pyx_XGIVEREF(__pyx_t_3);
14231 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
14233 __pyx_L6_except_return:;
14234 __Pyx_XGIVEREF(__pyx_t_1);
14235 __Pyx_XGIVEREF(__pyx_t_2);
14236 __Pyx_XGIVEREF(__pyx_t_3);
14237 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
14251 __Pyx_XDECREF(__pyx_t_4);
14252 __Pyx_XDECREF(__pyx_t_5);
14253 __Pyx_XDECREF(__pyx_t_6);
14254 __Pyx_XDECREF(__pyx_t_7);
14255 __Pyx_XDECREF(__pyx_t_8);
14256 __Pyx_AddTraceback(
"PyClical.exp", __pyx_clineno, __pyx_lineno, __pyx_filename);
14259 __Pyx_XGIVEREF(__pyx_r);
14260 __Pyx_RefNannyFinishContext();
14265 static PyObject *__pyx_pw_8PyClical_47exp(PyObject *__pyx_self, PyObject *__pyx_v_obj);
14266 static char __pyx_doc_8PyClical_46exp[] =
"\n Exponential of multivector.\n\n >>> x=clifford(\"{1,2}\") * pi/4; print(exp(x))\n 0.7071+0.7071{1,2}\n >>> x=clifford(\"{1,2}\") * pi/2; print(exp(x))\n {1,2}\n ";
14267 static PyObject *__pyx_pw_8PyClical_47exp(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
14268 PyObject *__pyx_r = 0;
14269 __Pyx_RefNannyDeclarations
14270 __Pyx_RefNannySetupContext(
"exp (wrapper)", 0);
14271 __pyx_r = __pyx_pf_8PyClical_46exp(__pyx_self, ((PyObject *)__pyx_v_obj));
14274 __Pyx_RefNannyFinishContext();
14278 static PyObject *__pyx_pf_8PyClical_46exp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
14279 PyObject *__pyx_r = NULL;
14280 __Pyx_RefNannyDeclarations
14281 PyObject *__pyx_t_1 = NULL;
14282 int __pyx_lineno = 0;
14283 const char *__pyx_filename = NULL;
14284 int __pyx_clineno = 0;
14285 __Pyx_RefNannySetupContext(
"exp", 0);
14286 __Pyx_XDECREF(__pyx_r);
14287 __pyx_t_1 = __pyx_f_8PyClical_exp(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1564, __pyx_L1_error)
14288 __Pyx_GOTREF(__pyx_t_1);
14289 __pyx_r = __pyx_t_1;
14295 __Pyx_XDECREF(__pyx_t_1);
14296 __Pyx_AddTraceback(
"PyClical.exp", __pyx_clineno, __pyx_lineno, __pyx_filename);
14299 __Pyx_XGIVEREF(__pyx_r);
14300 __Pyx_RefNannyFinishContext();
14312 static PyObject *__pyx_pw_8PyClical_49log(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14313 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) {
14314 PyObject *__pyx_v_i = ((PyObject *)Py_None);
14315 PyObject *__pyx_r = NULL;
14316 __Pyx_RefNannyDeclarations
14319 PyObject *__pyx_t_3 = NULL;
14321 PyObject *__pyx_t_5 = NULL;
14322 PyObject *__pyx_t_6 = NULL;
14323 PyObject *__pyx_t_7 = NULL;
14324 PyObject *__pyx_t_8 = NULL;
14325 PyObject *__pyx_t_9 = NULL;
14326 PyObject *__pyx_t_10 = NULL;
14327 PyObject *__pyx_t_11 = NULL;
14328 int __pyx_lineno = 0;
14329 const char *__pyx_filename = NULL;
14330 int __pyx_clineno = 0;
14331 __Pyx_RefNannySetupContext(
"log", 0);
14332 if (__pyx_optional_args) {
14333 if (__pyx_optional_args->__pyx_n > 0) {
14334 __pyx_v_i = __pyx_optional_args->i;
14345 __pyx_t_1 = (__pyx_v_i != Py_None);
14346 __pyx_t_2 = (__pyx_t_1 != 0);
14356 __Pyx_XDECREF(__pyx_r);
14357 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1594, __pyx_L1_error)
14358 __Pyx_GOTREF(__pyx_t_3);
14360 __pyx_t_4 =
log(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
14362 __Pyx_CppExn2PyErr();
14363 __PYX_ERR(0, 1594, __pyx_L1_error)
14365 __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, 1594, __pyx_L1_error)
14366 __Pyx_GOTREF(__pyx_t_5);
14367 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14368 __pyx_r = __pyx_t_5;
14390 __Pyx_PyThreadState_declare
14391 __Pyx_PyThreadState_assign
14392 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
14393 __Pyx_XGOTREF(__pyx_t_6);
14394 __Pyx_XGOTREF(__pyx_t_7);
14395 __Pyx_XGOTREF(__pyx_t_8);
14405 __Pyx_XDECREF(__pyx_r);
14406 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1597, __pyx_L4_error)
14407 __Pyx_GOTREF(__pyx_t_3);
14408 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_log);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1597, __pyx_L4_error)
14409 __Pyx_GOTREF(__pyx_t_9);
14410 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14412 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
14413 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
14414 if (likely(__pyx_t_3)) {
14415 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
14416 __Pyx_INCREF(__pyx_t_3);
14417 __Pyx_INCREF(
function);
14418 __Pyx_DECREF_SET(__pyx_t_9,
function);
14421 __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);
14422 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14423 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1597, __pyx_L4_error)
14424 __Pyx_GOTREF(__pyx_t_5);
14425 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14426 __pyx_r = __pyx_t_5;
14428 goto __pyx_L8_try_return;
14439 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14440 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14441 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
14451 __Pyx_AddTraceback(
"PyClical.log", __pyx_clineno, __pyx_lineno, __pyx_filename);
14452 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1598, __pyx_L6_except_error)
14453 __Pyx_GOTREF(__pyx_t_5);
14454 __Pyx_GOTREF(__pyx_t_9);
14455 __Pyx_GOTREF(__pyx_t_3);
14464 __Pyx_XDECREF(__pyx_r);
14465 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1599, __pyx_L6_except_error)
14466 __Pyx_GOTREF(__pyx_t_10);
14467 __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, 1599, __pyx_L6_except_error)
14468 __Pyx_GOTREF(__pyx_t_11);
14469 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14470 __pyx_r = __pyx_t_11;
14472 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14473 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14474 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14475 goto __pyx_L7_except_return;
14477 __pyx_L6_except_error:;
14486 __Pyx_XGIVEREF(__pyx_t_6);
14487 __Pyx_XGIVEREF(__pyx_t_7);
14488 __Pyx_XGIVEREF(__pyx_t_8);
14489 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14490 goto __pyx_L1_error;
14491 __pyx_L8_try_return:;
14492 __Pyx_XGIVEREF(__pyx_t_6);
14493 __Pyx_XGIVEREF(__pyx_t_7);
14494 __Pyx_XGIVEREF(__pyx_t_8);
14495 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14497 __pyx_L7_except_return:;
14498 __Pyx_XGIVEREF(__pyx_t_6);
14499 __Pyx_XGIVEREF(__pyx_t_7);
14500 __Pyx_XGIVEREF(__pyx_t_8);
14501 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14516 __Pyx_XDECREF(__pyx_t_3);
14517 __Pyx_XDECREF(__pyx_t_5);
14518 __Pyx_XDECREF(__pyx_t_9);
14519 __Pyx_XDECREF(__pyx_t_10);
14520 __Pyx_XDECREF(__pyx_t_11);
14521 __Pyx_AddTraceback(
"PyClical.log", __pyx_clineno, __pyx_lineno, __pyx_filename);
14524 __Pyx_XGIVEREF(__pyx_r);
14525 __Pyx_RefNannyFinishContext();
14530 static PyObject *__pyx_pw_8PyClical_49log(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14531 static char __pyx_doc_8PyClical_48log[] =
"\n Natural logarithm of multivector with optional complexifier.\n\n >>> x=clifford(\"{-1}\"); print((log(x,\"{-1}\") * 2/pi))\n {-1}\n >>> x=clifford(\"{1,2}\"); print((log(x,\"{1,2,3}\") * 2/pi))\n {1,2}\n >>> x=clifford(\"{1,2}\"); print((log(x) * 2/pi))\n {1,2}\n >>> x=clifford(\"{1,2}\"); print((log(x,\"{1,2}\") * 2/pi))\n Traceback (most recent call last):\n ...\n RuntimeError: check_complex(val, i): i is not a valid complexifier for val\n ";
14532 static PyObject *__pyx_pw_8PyClical_49log(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14533 PyObject *__pyx_v_obj = 0;
14534 PyObject *__pyx_v_i = 0;
14535 int __pyx_lineno = 0;
14536 const char *__pyx_filename = NULL;
14537 int __pyx_clineno = 0;
14538 PyObject *__pyx_r = 0;
14539 __Pyx_RefNannyDeclarations
14540 __Pyx_RefNannySetupContext(
"log (wrapper)", 0);
14542 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
14543 PyObject* values[2] = {0,0};
14544 values[1] = ((PyObject *)Py_None);
14545 if (unlikely(__pyx_kwds)) {
14546 Py_ssize_t kw_args;
14547 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14548 switch (pos_args) {
14549 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14550 CYTHON_FALLTHROUGH;
14551 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14552 CYTHON_FALLTHROUGH;
14554 default:
goto __pyx_L5_argtuple_error;
14556 kw_args = PyDict_Size(__pyx_kwds);
14557 switch (pos_args) {
14559 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
14560 else goto __pyx_L5_argtuple_error;
14561 CYTHON_FALLTHROUGH;
14564 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
14565 if (value) { values[1] = value; kw_args--; }
14568 if (unlikely(kw_args > 0)) {
14569 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"log") < 0)) __PYX_ERR(0, 1578, __pyx_L3_error)
14572 switch (PyTuple_GET_SIZE(__pyx_args)) {
14573 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14574 CYTHON_FALLTHROUGH;
14575 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14577 default:
goto __pyx_L5_argtuple_error;
14580 __pyx_v_obj = values[0];
14581 __pyx_v_i = values[1];
14583 goto __pyx_L4_argument_unpacking_done;
14584 __pyx_L5_argtuple_error:;
14585 __Pyx_RaiseArgtupleInvalid(
"log", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1578, __pyx_L3_error)
14587 __Pyx_AddTraceback(
"PyClical.log", __pyx_clineno, __pyx_lineno, __pyx_filename);
14588 __Pyx_RefNannyFinishContext();
14590 __pyx_L4_argument_unpacking_done:;
14591 __pyx_r = __pyx_pf_8PyClical_48log(__pyx_self, __pyx_v_obj, __pyx_v_i);
14594 __Pyx_RefNannyFinishContext();
14598 static PyObject *__pyx_pf_8PyClical_48log(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
14599 PyObject *__pyx_r = NULL;
14600 __Pyx_RefNannyDeclarations
14601 PyObject *__pyx_t_1 = NULL;
14602 struct __pyx_opt_args_8PyClical_log __pyx_t_2;
14603 int __pyx_lineno = 0;
14604 const char *__pyx_filename = NULL;
14605 int __pyx_clineno = 0;
14606 __Pyx_RefNannySetupContext(
"log", 0);
14607 __Pyx_XDECREF(__pyx_r);
14608 __pyx_t_2.__pyx_n = 1;
14609 __pyx_t_2.i = __pyx_v_i;
14610 __pyx_t_1 = __pyx_f_8PyClical_log(__pyx_v_obj, 0, &__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1578, __pyx_L1_error)
14611 __Pyx_GOTREF(__pyx_t_1);
14612 __pyx_r = __pyx_t_1;
14618 __Pyx_XDECREF(__pyx_t_1);
14619 __Pyx_AddTraceback(
"PyClical.log", __pyx_clineno, __pyx_lineno, __pyx_filename);
14622 __Pyx_XGIVEREF(__pyx_r);
14623 __Pyx_RefNannyFinishContext();
14635 static PyObject *__pyx_pw_8PyClical_51cos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14636 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) {
14637 PyObject *__pyx_v_i = ((PyObject *)Py_None);
14638 PyObject *__pyx_r = NULL;
14639 __Pyx_RefNannyDeclarations
14642 PyObject *__pyx_t_3 = NULL;
14644 PyObject *__pyx_t_5 = NULL;
14645 PyObject *__pyx_t_6 = NULL;
14646 PyObject *__pyx_t_7 = NULL;
14647 PyObject *__pyx_t_8 = NULL;
14648 PyObject *__pyx_t_9 = NULL;
14649 PyObject *__pyx_t_10 = NULL;
14650 PyObject *__pyx_t_11 = NULL;
14651 int __pyx_lineno = 0;
14652 const char *__pyx_filename = NULL;
14653 int __pyx_clineno = 0;
14654 __Pyx_RefNannySetupContext(
"cos", 0);
14655 if (__pyx_optional_args) {
14656 if (__pyx_optional_args->__pyx_n > 0) {
14657 __pyx_v_i = __pyx_optional_args->i;
14668 __pyx_t_1 = (__pyx_v_i != Py_None);
14669 __pyx_t_2 = (__pyx_t_1 != 0);
14679 __Pyx_XDECREF(__pyx_r);
14680 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1611, __pyx_L1_error)
14681 __Pyx_GOTREF(__pyx_t_3);
14683 __pyx_t_4 =
cos(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
14685 __Pyx_CppExn2PyErr();
14686 __PYX_ERR(0, 1611, __pyx_L1_error)
14688 __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, 1611, __pyx_L1_error)
14689 __Pyx_GOTREF(__pyx_t_5);
14690 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14691 __pyx_r = __pyx_t_5;
14713 __Pyx_PyThreadState_declare
14714 __Pyx_PyThreadState_assign
14715 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
14716 __Pyx_XGOTREF(__pyx_t_6);
14717 __Pyx_XGOTREF(__pyx_t_7);
14718 __Pyx_XGOTREF(__pyx_t_8);
14728 __Pyx_XDECREF(__pyx_r);
14729 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1614, __pyx_L4_error)
14730 __Pyx_GOTREF(__pyx_t_3);
14731 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_cos);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1614, __pyx_L4_error)
14732 __Pyx_GOTREF(__pyx_t_9);
14733 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14735 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
14736 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
14737 if (likely(__pyx_t_3)) {
14738 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
14739 __Pyx_INCREF(__pyx_t_3);
14740 __Pyx_INCREF(
function);
14741 __Pyx_DECREF_SET(__pyx_t_9,
function);
14744 __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);
14745 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14746 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1614, __pyx_L4_error)
14747 __Pyx_GOTREF(__pyx_t_5);
14748 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14749 __pyx_r = __pyx_t_5;
14751 goto __pyx_L8_try_return;
14762 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14763 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14764 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
14774 __Pyx_AddTraceback(
"PyClical.cos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14775 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1615, __pyx_L6_except_error)
14776 __Pyx_GOTREF(__pyx_t_5);
14777 __Pyx_GOTREF(__pyx_t_9);
14778 __Pyx_GOTREF(__pyx_t_3);
14787 __Pyx_XDECREF(__pyx_r);
14788 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1616, __pyx_L6_except_error)
14789 __Pyx_GOTREF(__pyx_t_10);
14790 __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, 1616, __pyx_L6_except_error)
14791 __Pyx_GOTREF(__pyx_t_11);
14792 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14793 __pyx_r = __pyx_t_11;
14795 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14796 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14797 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14798 goto __pyx_L7_except_return;
14800 __pyx_L6_except_error:;
14809 __Pyx_XGIVEREF(__pyx_t_6);
14810 __Pyx_XGIVEREF(__pyx_t_7);
14811 __Pyx_XGIVEREF(__pyx_t_8);
14812 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14813 goto __pyx_L1_error;
14814 __pyx_L8_try_return:;
14815 __Pyx_XGIVEREF(__pyx_t_6);
14816 __Pyx_XGIVEREF(__pyx_t_7);
14817 __Pyx_XGIVEREF(__pyx_t_8);
14818 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14820 __pyx_L7_except_return:;
14821 __Pyx_XGIVEREF(__pyx_t_6);
14822 __Pyx_XGIVEREF(__pyx_t_7);
14823 __Pyx_XGIVEREF(__pyx_t_8);
14824 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14839 __Pyx_XDECREF(__pyx_t_3);
14840 __Pyx_XDECREF(__pyx_t_5);
14841 __Pyx_XDECREF(__pyx_t_9);
14842 __Pyx_XDECREF(__pyx_t_10);
14843 __Pyx_XDECREF(__pyx_t_11);
14844 __Pyx_AddTraceback(
"PyClical.cos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14847 __Pyx_XGIVEREF(__pyx_r);
14848 __Pyx_RefNannyFinishContext();
14853 static PyObject *__pyx_pw_8PyClical_51cos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14854 static char __pyx_doc_8PyClical_50cos[] =
"\n Cosine of multivector with optional complexifier.\n\n >>> x=clifford(\"{1,2}\"); print(cos(acos(x),\"{1,2,3}\"))\n {1,2}\n >>> x=clifford(\"{1,2}\"); print(cos(acos(x)))\n {1,2}\n ";
14855 static PyObject *__pyx_pw_8PyClical_51cos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14856 PyObject *__pyx_v_obj = 0;
14857 PyObject *__pyx_v_i = 0;
14858 int __pyx_lineno = 0;
14859 const char *__pyx_filename = NULL;
14860 int __pyx_clineno = 0;
14861 PyObject *__pyx_r = 0;
14862 __Pyx_RefNannyDeclarations
14863 __Pyx_RefNannySetupContext(
"cos (wrapper)", 0);
14865 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
14866 PyObject* values[2] = {0,0};
14867 values[1] = ((PyObject *)Py_None);
14868 if (unlikely(__pyx_kwds)) {
14869 Py_ssize_t kw_args;
14870 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14871 switch (pos_args) {
14872 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14873 CYTHON_FALLTHROUGH;
14874 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14875 CYTHON_FALLTHROUGH;
14877 default:
goto __pyx_L5_argtuple_error;
14879 kw_args = PyDict_Size(__pyx_kwds);
14880 switch (pos_args) {
14882 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
14883 else goto __pyx_L5_argtuple_error;
14884 CYTHON_FALLTHROUGH;
14887 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
14888 if (value) { values[1] = value; kw_args--; }
14891 if (unlikely(kw_args > 0)) {
14892 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"cos") < 0)) __PYX_ERR(0, 1601, __pyx_L3_error)
14895 switch (PyTuple_GET_SIZE(__pyx_args)) {
14896 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14897 CYTHON_FALLTHROUGH;
14898 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14900 default:
goto __pyx_L5_argtuple_error;
14903 __pyx_v_obj = values[0];
14904 __pyx_v_i = values[1];
14906 goto __pyx_L4_argument_unpacking_done;
14907 __pyx_L5_argtuple_error:;
14908 __Pyx_RaiseArgtupleInvalid(
"cos", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1601, __pyx_L3_error)
14910 __Pyx_AddTraceback(
"PyClical.cos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14911 __Pyx_RefNannyFinishContext();
14913 __pyx_L4_argument_unpacking_done:;
14914 __pyx_r = __pyx_pf_8PyClical_50cos(__pyx_self, __pyx_v_obj, __pyx_v_i);
14917 __Pyx_RefNannyFinishContext();
14921 static PyObject *__pyx_pf_8PyClical_50cos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
14922 PyObject *__pyx_r = NULL;
14923 __Pyx_RefNannyDeclarations
14924 PyObject *__pyx_t_1 = NULL;
14925 struct __pyx_opt_args_8PyClical_cos __pyx_t_2;
14926 int __pyx_lineno = 0;
14927 const char *__pyx_filename = NULL;
14928 int __pyx_clineno = 0;
14929 __Pyx_RefNannySetupContext(
"cos", 0);
14930 __Pyx_XDECREF(__pyx_r);
14931 __pyx_t_2.__pyx_n = 1;
14932 __pyx_t_2.i = __pyx_v_i;
14933 __pyx_t_1 = __pyx_f_8PyClical_cos(__pyx_v_obj, 0, &__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1601, __pyx_L1_error)
14934 __Pyx_GOTREF(__pyx_t_1);
14935 __pyx_r = __pyx_t_1;
14941 __Pyx_XDECREF(__pyx_t_1);
14942 __Pyx_AddTraceback(
"PyClical.cos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14945 __Pyx_XGIVEREF(__pyx_r);
14946 __Pyx_RefNannyFinishContext();
14958 static PyObject *__pyx_pw_8PyClical_53acos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14959 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) {
14960 PyObject *__pyx_v_i = ((PyObject *)Py_None);
14961 PyObject *__pyx_r = NULL;
14962 __Pyx_RefNannyDeclarations
14965 PyObject *__pyx_t_3 = NULL;
14967 PyObject *__pyx_t_5 = NULL;
14968 PyObject *__pyx_t_6 = NULL;
14969 PyObject *__pyx_t_7 = NULL;
14970 PyObject *__pyx_t_8 = NULL;
14971 PyObject *__pyx_t_9 = NULL;
14972 PyObject *__pyx_t_10 = NULL;
14973 PyObject *__pyx_t_11 = NULL;
14974 int __pyx_lineno = 0;
14975 const char *__pyx_filename = NULL;
14976 int __pyx_clineno = 0;
14977 __Pyx_RefNannySetupContext(
"acos", 0);
14978 if (__pyx_optional_args) {
14979 if (__pyx_optional_args->__pyx_n > 0) {
14980 __pyx_v_i = __pyx_optional_args->i;
14991 __pyx_t_1 = (__pyx_v_i != Py_None);
14992 __pyx_t_2 = (__pyx_t_1 != 0);
15002 __Pyx_XDECREF(__pyx_r);
15003 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1632, __pyx_L1_error)
15004 __Pyx_GOTREF(__pyx_t_3);
15006 __pyx_t_4 =
acos(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
15008 __Pyx_CppExn2PyErr();
15009 __PYX_ERR(0, 1632, __pyx_L1_error)
15011 __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, 1632, __pyx_L1_error)
15012 __Pyx_GOTREF(__pyx_t_5);
15013 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15014 __pyx_r = __pyx_t_5;
15036 __Pyx_PyThreadState_declare
15037 __Pyx_PyThreadState_assign
15038 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
15039 __Pyx_XGOTREF(__pyx_t_6);
15040 __Pyx_XGOTREF(__pyx_t_7);
15041 __Pyx_XGOTREF(__pyx_t_8);
15051 __Pyx_XDECREF(__pyx_r);
15052 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1635, __pyx_L4_error)
15053 __Pyx_GOTREF(__pyx_t_3);
15054 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_acos);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1635, __pyx_L4_error)
15055 __Pyx_GOTREF(__pyx_t_9);
15056 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15058 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
15059 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
15060 if (likely(__pyx_t_3)) {
15061 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
15062 __Pyx_INCREF(__pyx_t_3);
15063 __Pyx_INCREF(
function);
15064 __Pyx_DECREF_SET(__pyx_t_9,
function);
15067 __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);
15068 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15069 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1635, __pyx_L4_error)
15070 __Pyx_GOTREF(__pyx_t_5);
15071 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15072 __pyx_r = __pyx_t_5;
15074 goto __pyx_L8_try_return;
15085 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15086 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15087 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
15097 __Pyx_AddTraceback(
"PyClical.acos", __pyx_clineno, __pyx_lineno, __pyx_filename);
15098 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1636, __pyx_L6_except_error)
15099 __Pyx_GOTREF(__pyx_t_5);
15100 __Pyx_GOTREF(__pyx_t_9);
15101 __Pyx_GOTREF(__pyx_t_3);
15110 __Pyx_XDECREF(__pyx_r);
15111 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1637, __pyx_L6_except_error)
15112 __Pyx_GOTREF(__pyx_t_10);
15113 __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, 1637, __pyx_L6_except_error)
15114 __Pyx_GOTREF(__pyx_t_11);
15115 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15116 __pyx_r = __pyx_t_11;
15118 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15119 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15120 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15121 goto __pyx_L7_except_return;
15123 __pyx_L6_except_error:;
15132 __Pyx_XGIVEREF(__pyx_t_6);
15133 __Pyx_XGIVEREF(__pyx_t_7);
15134 __Pyx_XGIVEREF(__pyx_t_8);
15135 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15136 goto __pyx_L1_error;
15137 __pyx_L8_try_return:;
15138 __Pyx_XGIVEREF(__pyx_t_6);
15139 __Pyx_XGIVEREF(__pyx_t_7);
15140 __Pyx_XGIVEREF(__pyx_t_8);
15141 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15143 __pyx_L7_except_return:;
15144 __Pyx_XGIVEREF(__pyx_t_6);
15145 __Pyx_XGIVEREF(__pyx_t_7);
15146 __Pyx_XGIVEREF(__pyx_t_8);
15147 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15162 __Pyx_XDECREF(__pyx_t_3);
15163 __Pyx_XDECREF(__pyx_t_5);
15164 __Pyx_XDECREF(__pyx_t_9);
15165 __Pyx_XDECREF(__pyx_t_10);
15166 __Pyx_XDECREF(__pyx_t_11);
15167 __Pyx_AddTraceback(
"PyClical.acos", __pyx_clineno, __pyx_lineno, __pyx_filename);
15170 __Pyx_XGIVEREF(__pyx_r);
15171 __Pyx_RefNannyFinishContext();
15176 static PyObject *__pyx_pw_8PyClical_53acos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15177 static char __pyx_doc_8PyClical_52acos[] =
"\n Inverse cosine of multivector with optional complexifier.\n\n >>> x=clifford(\"{1,2}\"); print(cos(acos(x),\"{1,2,3}\"))\n {1,2}\n >>> x=clifford(\"{1,2}\"); print(cos(acos(x),\"{-1,1,2,3,4}\"))\n {1,2}\n >>> print(acos(0) / pi)\n 0.5\n >>> x=clifford(\"{1,2}\"); print(cos(acos(x)))\n {1,2}\n ";
15178 static PyObject *__pyx_pw_8PyClical_53acos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15179 PyObject *__pyx_v_obj = 0;
15180 PyObject *__pyx_v_i = 0;
15181 int __pyx_lineno = 0;
15182 const char *__pyx_filename = NULL;
15183 int __pyx_clineno = 0;
15184 PyObject *__pyx_r = 0;
15185 __Pyx_RefNannyDeclarations
15186 __Pyx_RefNannySetupContext(
"acos (wrapper)", 0);
15188 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
15189 PyObject* values[2] = {0,0};
15190 values[1] = ((PyObject *)Py_None);
15191 if (unlikely(__pyx_kwds)) {
15192 Py_ssize_t kw_args;
15193 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15194 switch (pos_args) {
15195 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15196 CYTHON_FALLTHROUGH;
15197 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15198 CYTHON_FALLTHROUGH;
15200 default:
goto __pyx_L5_argtuple_error;
15202 kw_args = PyDict_Size(__pyx_kwds);
15203 switch (pos_args) {
15205 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
15206 else goto __pyx_L5_argtuple_error;
15207 CYTHON_FALLTHROUGH;
15210 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
15211 if (value) { values[1] = value; kw_args--; }
15214 if (unlikely(kw_args > 0)) {
15215 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"acos") < 0)) __PYX_ERR(0, 1618, __pyx_L3_error)
15218 switch (PyTuple_GET_SIZE(__pyx_args)) {
15219 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15220 CYTHON_FALLTHROUGH;
15221 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15223 default:
goto __pyx_L5_argtuple_error;
15226 __pyx_v_obj = values[0];
15227 __pyx_v_i = values[1];
15229 goto __pyx_L4_argument_unpacking_done;
15230 __pyx_L5_argtuple_error:;
15231 __Pyx_RaiseArgtupleInvalid(
"acos", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1618, __pyx_L3_error)
15233 __Pyx_AddTraceback(
"PyClical.acos", __pyx_clineno, __pyx_lineno, __pyx_filename);
15234 __Pyx_RefNannyFinishContext();
15236 __pyx_L4_argument_unpacking_done:;
15237 __pyx_r = __pyx_pf_8PyClical_52acos(__pyx_self, __pyx_v_obj, __pyx_v_i);
15240 __Pyx_RefNannyFinishContext();
15244 static PyObject *__pyx_pf_8PyClical_52acos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
15245 PyObject *__pyx_r = NULL;
15246 __Pyx_RefNannyDeclarations
15247 PyObject *__pyx_t_1 = NULL;
15248 struct __pyx_opt_args_8PyClical_acos __pyx_t_2;
15249 int __pyx_lineno = 0;
15250 const char *__pyx_filename = NULL;
15251 int __pyx_clineno = 0;
15252 __Pyx_RefNannySetupContext(
"acos", 0);
15253 __Pyx_XDECREF(__pyx_r);
15254 __pyx_t_2.__pyx_n = 1;
15255 __pyx_t_2.i = __pyx_v_i;
15256 __pyx_t_1 = __pyx_f_8PyClical_acos(__pyx_v_obj, 0, &__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1618, __pyx_L1_error)
15257 __Pyx_GOTREF(__pyx_t_1);
15258 __pyx_r = __pyx_t_1;
15264 __Pyx_XDECREF(__pyx_t_1);
15265 __Pyx_AddTraceback(
"PyClical.acos", __pyx_clineno, __pyx_lineno, __pyx_filename);
15268 __Pyx_XGIVEREF(__pyx_r);
15269 __Pyx_RefNannyFinishContext();
15281 static PyObject *__pyx_pw_8PyClical_55cosh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
15282 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cosh(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
15283 PyObject *__pyx_r = NULL;
15284 __Pyx_RefNannyDeclarations
15285 PyObject *__pyx_t_1 = NULL;
15286 PyObject *__pyx_t_2 = NULL;
15287 PyObject *__pyx_t_3 = NULL;
15288 PyObject *__pyx_t_4 = NULL;
15289 PyObject *__pyx_t_5 = NULL;
15290 PyObject *__pyx_t_6 = NULL;
15291 PyObject *__pyx_t_7 = NULL;
15292 PyObject *__pyx_t_8 = NULL;
15293 int __pyx_lineno = 0;
15294 const char *__pyx_filename = NULL;
15295 int __pyx_clineno = 0;
15296 __Pyx_RefNannySetupContext(
"cosh", 0);
15306 __Pyx_PyThreadState_declare
15307 __Pyx_PyThreadState_assign
15308 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
15309 __Pyx_XGOTREF(__pyx_t_1);
15310 __Pyx_XGOTREF(__pyx_t_2);
15311 __Pyx_XGOTREF(__pyx_t_3);
15321 __Pyx_XDECREF(__pyx_r);
15322 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1651, __pyx_L3_error)
15323 __Pyx_GOTREF(__pyx_t_5);
15324 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_cosh);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1651, __pyx_L3_error)
15325 __Pyx_GOTREF(__pyx_t_6);
15326 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15328 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
15329 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
15330 if (likely(__pyx_t_5)) {
15331 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
15332 __Pyx_INCREF(__pyx_t_5);
15333 __Pyx_INCREF(
function);
15334 __Pyx_DECREF_SET(__pyx_t_6,
function);
15337 __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);
15338 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15339 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1651, __pyx_L3_error)
15340 __Pyx_GOTREF(__pyx_t_4);
15341 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15342 __pyx_r = __pyx_t_4;
15344 goto __pyx_L7_try_return;
15355 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
15356 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15357 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
15367 __Pyx_AddTraceback(
"PyClical.cosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15368 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(0, 1652, __pyx_L5_except_error)
15369 __Pyx_GOTREF(__pyx_t_4);
15370 __Pyx_GOTREF(__pyx_t_6);
15371 __Pyx_GOTREF(__pyx_t_5);
15380 __Pyx_XDECREF(__pyx_r);
15381 __pyx_t_7 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1653, __pyx_L5_except_error)
15382 __Pyx_GOTREF(__pyx_t_7);
15383 __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, 1653, __pyx_L5_except_error)
15384 __Pyx_GOTREF(__pyx_t_8);
15385 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15386 __pyx_r = __pyx_t_8;
15388 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15389 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15390 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15391 goto __pyx_L6_except_return;
15393 __pyx_L5_except_error:;
15402 __Pyx_XGIVEREF(__pyx_t_1);
15403 __Pyx_XGIVEREF(__pyx_t_2);
15404 __Pyx_XGIVEREF(__pyx_t_3);
15405 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
15406 goto __pyx_L1_error;
15407 __pyx_L7_try_return:;
15408 __Pyx_XGIVEREF(__pyx_t_1);
15409 __Pyx_XGIVEREF(__pyx_t_2);
15410 __Pyx_XGIVEREF(__pyx_t_3);
15411 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
15413 __pyx_L6_except_return:;
15414 __Pyx_XGIVEREF(__pyx_t_1);
15415 __Pyx_XGIVEREF(__pyx_t_2);
15416 __Pyx_XGIVEREF(__pyx_t_3);
15417 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
15431 __Pyx_XDECREF(__pyx_t_4);
15432 __Pyx_XDECREF(__pyx_t_5);
15433 __Pyx_XDECREF(__pyx_t_6);
15434 __Pyx_XDECREF(__pyx_t_7);
15435 __Pyx_XDECREF(__pyx_t_8);
15436 __Pyx_AddTraceback(
"PyClical.cosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15439 __Pyx_XGIVEREF(__pyx_r);
15440 __Pyx_RefNannyFinishContext();
15445 static PyObject *__pyx_pw_8PyClical_55cosh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
15446 static char __pyx_doc_8PyClical_54cosh[] =
"\n Hyperbolic cosine of multivector.\n\n >>> x=clifford(\"{1,2}\") * pi; print(cosh(x))\n -1\n >>> x=clifford(\"{1,2,3}\"); print(cosh(acosh(x)))\n {1,2,3}\n >>> x=clifford(\"{1,2}\"); print(cosh(acosh(x)))\n {1,2}\n ";
15447 static PyObject *__pyx_pw_8PyClical_55cosh(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
15448 PyObject *__pyx_r = 0;
15449 __Pyx_RefNannyDeclarations
15450 __Pyx_RefNannySetupContext(
"cosh (wrapper)", 0);
15451 __pyx_r = __pyx_pf_8PyClical_54cosh(__pyx_self, ((PyObject *)__pyx_v_obj));
15454 __Pyx_RefNannyFinishContext();
15458 static PyObject *__pyx_pf_8PyClical_54cosh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
15459 PyObject *__pyx_r = NULL;
15460 __Pyx_RefNannyDeclarations
15461 PyObject *__pyx_t_1 = NULL;
15462 int __pyx_lineno = 0;
15463 const char *__pyx_filename = NULL;
15464 int __pyx_clineno = 0;
15465 __Pyx_RefNannySetupContext(
"cosh", 0);
15466 __Pyx_XDECREF(__pyx_r);
15467 __pyx_t_1 = __pyx_f_8PyClical_cosh(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1639, __pyx_L1_error)
15468 __Pyx_GOTREF(__pyx_t_1);
15469 __pyx_r = __pyx_t_1;
15475 __Pyx_XDECREF(__pyx_t_1);
15476 __Pyx_AddTraceback(
"PyClical.cosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15479 __Pyx_XGIVEREF(__pyx_r);
15480 __Pyx_RefNannyFinishContext();
15492 static PyObject *__pyx_pw_8PyClical_57acosh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15493 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) {
15494 PyObject *__pyx_v_i = ((PyObject *)Py_None);
15495 PyObject *__pyx_r = NULL;
15496 __Pyx_RefNannyDeclarations
15499 PyObject *__pyx_t_3 = NULL;
15501 PyObject *__pyx_t_5 = NULL;
15502 PyObject *__pyx_t_6 = NULL;
15503 PyObject *__pyx_t_7 = NULL;
15504 PyObject *__pyx_t_8 = NULL;
15505 PyObject *__pyx_t_9 = NULL;
15506 PyObject *__pyx_t_10 = NULL;
15507 PyObject *__pyx_t_11 = NULL;
15508 int __pyx_lineno = 0;
15509 const char *__pyx_filename = NULL;
15510 int __pyx_clineno = 0;
15511 __Pyx_RefNannySetupContext(
"acosh", 0);
15512 if (__pyx_optional_args) {
15513 if (__pyx_optional_args->__pyx_n > 0) {
15514 __pyx_v_i = __pyx_optional_args->i;
15525 __pyx_t_1 = (__pyx_v_i != Py_None);
15526 __pyx_t_2 = (__pyx_t_1 != 0);
15536 __Pyx_XDECREF(__pyx_r);
15537 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1671, __pyx_L1_error)
15538 __Pyx_GOTREF(__pyx_t_3);
15540 __pyx_t_4 =
acosh(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
15542 __Pyx_CppExn2PyErr();
15543 __PYX_ERR(0, 1671, __pyx_L1_error)
15545 __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, 1671, __pyx_L1_error)
15546 __Pyx_GOTREF(__pyx_t_5);
15547 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15548 __pyx_r = __pyx_t_5;
15570 __Pyx_PyThreadState_declare
15571 __Pyx_PyThreadState_assign
15572 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
15573 __Pyx_XGOTREF(__pyx_t_6);
15574 __Pyx_XGOTREF(__pyx_t_7);
15575 __Pyx_XGOTREF(__pyx_t_8);
15585 __Pyx_XDECREF(__pyx_r);
15586 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1674, __pyx_L4_error)
15587 __Pyx_GOTREF(__pyx_t_3);
15588 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_acosh);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1674, __pyx_L4_error)
15589 __Pyx_GOTREF(__pyx_t_9);
15590 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15592 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
15593 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
15594 if (likely(__pyx_t_3)) {
15595 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
15596 __Pyx_INCREF(__pyx_t_3);
15597 __Pyx_INCREF(
function);
15598 __Pyx_DECREF_SET(__pyx_t_9,
function);
15601 __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);
15602 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15603 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1674, __pyx_L4_error)
15604 __Pyx_GOTREF(__pyx_t_5);
15605 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15606 __pyx_r = __pyx_t_5;
15608 goto __pyx_L8_try_return;
15619 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15620 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15621 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
15631 __Pyx_AddTraceback(
"PyClical.acosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15632 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1675, __pyx_L6_except_error)
15633 __Pyx_GOTREF(__pyx_t_5);
15634 __Pyx_GOTREF(__pyx_t_9);
15635 __Pyx_GOTREF(__pyx_t_3);
15644 __Pyx_XDECREF(__pyx_r);
15645 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1676, __pyx_L6_except_error)
15646 __Pyx_GOTREF(__pyx_t_10);
15647 __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, 1676, __pyx_L6_except_error)
15648 __Pyx_GOTREF(__pyx_t_11);
15649 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15650 __pyx_r = __pyx_t_11;
15652 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15653 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15654 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15655 goto __pyx_L7_except_return;
15657 __pyx_L6_except_error:;
15666 __Pyx_XGIVEREF(__pyx_t_6);
15667 __Pyx_XGIVEREF(__pyx_t_7);
15668 __Pyx_XGIVEREF(__pyx_t_8);
15669 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15670 goto __pyx_L1_error;
15671 __pyx_L8_try_return:;
15672 __Pyx_XGIVEREF(__pyx_t_6);
15673 __Pyx_XGIVEREF(__pyx_t_7);
15674 __Pyx_XGIVEREF(__pyx_t_8);
15675 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15677 __pyx_L7_except_return:;
15678 __Pyx_XGIVEREF(__pyx_t_6);
15679 __Pyx_XGIVEREF(__pyx_t_7);
15680 __Pyx_XGIVEREF(__pyx_t_8);
15681 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15696 __Pyx_XDECREF(__pyx_t_3);
15697 __Pyx_XDECREF(__pyx_t_5);
15698 __Pyx_XDECREF(__pyx_t_9);
15699 __Pyx_XDECREF(__pyx_t_10);
15700 __Pyx_XDECREF(__pyx_t_11);
15701 __Pyx_AddTraceback(
"PyClical.acosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15704 __Pyx_XGIVEREF(__pyx_r);
15705 __Pyx_RefNannyFinishContext();
15710 static PyObject *__pyx_pw_8PyClical_57acosh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15711 static char __pyx_doc_8PyClical_56acosh[] =
"\n Inverse hyperbolic cosine of multivector with optional complexifier.\n\n >>> print(acosh(0,\"{-2,-1,1}\"))\n 1.571{-2,-1,1}\n >>> x=clifford(\"{1,2,3}\"); print(cosh(acosh(x,\"{-1,1,2,3,4}\")))\n {1,2,3}\n >>> print(acosh(0))\n 1.571{-1}\n >>> x=clifford(\"{1,2,3}\"); print(cosh(acosh(x)))\n {1,2,3}\n >>> x=clifford(\"{1,2}\"); print(cosh(acosh(x)))\n {1,2}\n ";
15712 static PyObject *__pyx_pw_8PyClical_57acosh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15713 PyObject *__pyx_v_obj = 0;
15714 PyObject *__pyx_v_i = 0;
15715 int __pyx_lineno = 0;
15716 const char *__pyx_filename = NULL;
15717 int __pyx_clineno = 0;
15718 PyObject *__pyx_r = 0;
15719 __Pyx_RefNannyDeclarations
15720 __Pyx_RefNannySetupContext(
"acosh (wrapper)", 0);
15722 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
15723 PyObject* values[2] = {0,0};
15724 values[1] = ((PyObject *)Py_None);
15725 if (unlikely(__pyx_kwds)) {
15726 Py_ssize_t kw_args;
15727 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15728 switch (pos_args) {
15729 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15730 CYTHON_FALLTHROUGH;
15731 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15732 CYTHON_FALLTHROUGH;
15734 default:
goto __pyx_L5_argtuple_error;
15736 kw_args = PyDict_Size(__pyx_kwds);
15737 switch (pos_args) {
15739 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
15740 else goto __pyx_L5_argtuple_error;
15741 CYTHON_FALLTHROUGH;
15744 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
15745 if (value) { values[1] = value; kw_args--; }
15748 if (unlikely(kw_args > 0)) {
15749 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"acosh") < 0)) __PYX_ERR(0, 1655, __pyx_L3_error)
15752 switch (PyTuple_GET_SIZE(__pyx_args)) {
15753 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15754 CYTHON_FALLTHROUGH;
15755 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15757 default:
goto __pyx_L5_argtuple_error;
15760 __pyx_v_obj = values[0];
15761 __pyx_v_i = values[1];
15763 goto __pyx_L4_argument_unpacking_done;
15764 __pyx_L5_argtuple_error:;
15765 __Pyx_RaiseArgtupleInvalid(
"acosh", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1655, __pyx_L3_error)
15767 __Pyx_AddTraceback(
"PyClical.acosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15768 __Pyx_RefNannyFinishContext();
15770 __pyx_L4_argument_unpacking_done:;
15771 __pyx_r = __pyx_pf_8PyClical_56acosh(__pyx_self, __pyx_v_obj, __pyx_v_i);
15774 __Pyx_RefNannyFinishContext();
15778 static PyObject *__pyx_pf_8PyClical_56acosh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
15779 PyObject *__pyx_r = NULL;
15780 __Pyx_RefNannyDeclarations
15781 PyObject *__pyx_t_1 = NULL;
15782 struct __pyx_opt_args_8PyClical_acosh __pyx_t_2;
15783 int __pyx_lineno = 0;
15784 const char *__pyx_filename = NULL;
15785 int __pyx_clineno = 0;
15786 __Pyx_RefNannySetupContext(
"acosh", 0);
15787 __Pyx_XDECREF(__pyx_r);
15788 __pyx_t_2.__pyx_n = 1;
15789 __pyx_t_2.i = __pyx_v_i;
15790 __pyx_t_1 = __pyx_f_8PyClical_acosh(__pyx_v_obj, 0, &__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1655, __pyx_L1_error)
15791 __Pyx_GOTREF(__pyx_t_1);
15792 __pyx_r = __pyx_t_1;
15798 __Pyx_XDECREF(__pyx_t_1);
15799 __Pyx_AddTraceback(
"PyClical.acosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15802 __Pyx_XGIVEREF(__pyx_r);
15803 __Pyx_RefNannyFinishContext();
15815 static PyObject *__pyx_pw_8PyClical_59sin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15816 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) {
15817 PyObject *__pyx_v_i = ((PyObject *)Py_None);
15818 PyObject *__pyx_r = NULL;
15819 __Pyx_RefNannyDeclarations
15822 PyObject *__pyx_t_3 = NULL;
15824 PyObject *__pyx_t_5 = NULL;
15825 PyObject *__pyx_t_6 = NULL;
15826 PyObject *__pyx_t_7 = NULL;
15827 PyObject *__pyx_t_8 = NULL;
15828 PyObject *__pyx_t_9 = NULL;
15829 PyObject *__pyx_t_10 = NULL;
15830 PyObject *__pyx_t_11 = NULL;
15831 int __pyx_lineno = 0;
15832 const char *__pyx_filename = NULL;
15833 int __pyx_clineno = 0;
15834 __Pyx_RefNannySetupContext(
"sin", 0);
15835 if (__pyx_optional_args) {
15836 if (__pyx_optional_args->__pyx_n > 0) {
15837 __pyx_v_i = __pyx_optional_args->i;
15848 __pyx_t_1 = (__pyx_v_i != Py_None);
15849 __pyx_t_2 = (__pyx_t_1 != 0);
15859 __Pyx_XDECREF(__pyx_r);
15860 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1690, __pyx_L1_error)
15861 __Pyx_GOTREF(__pyx_t_3);
15863 __pyx_t_4 =
sin(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
15865 __Pyx_CppExn2PyErr();
15866 __PYX_ERR(0, 1690, __pyx_L1_error)
15868 __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, 1690, __pyx_L1_error)
15869 __Pyx_GOTREF(__pyx_t_5);
15870 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15871 __pyx_r = __pyx_t_5;
15893 __Pyx_PyThreadState_declare
15894 __Pyx_PyThreadState_assign
15895 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
15896 __Pyx_XGOTREF(__pyx_t_6);
15897 __Pyx_XGOTREF(__pyx_t_7);
15898 __Pyx_XGOTREF(__pyx_t_8);
15908 __Pyx_XDECREF(__pyx_r);
15909 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1693, __pyx_L4_error)
15910 __Pyx_GOTREF(__pyx_t_3);
15911 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sin);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1693, __pyx_L4_error)
15912 __Pyx_GOTREF(__pyx_t_9);
15913 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15915 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
15916 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
15917 if (likely(__pyx_t_3)) {
15918 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
15919 __Pyx_INCREF(__pyx_t_3);
15920 __Pyx_INCREF(
function);
15921 __Pyx_DECREF_SET(__pyx_t_9,
function);
15924 __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);
15925 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15926 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1693, __pyx_L4_error)
15927 __Pyx_GOTREF(__pyx_t_5);
15928 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15929 __pyx_r = __pyx_t_5;
15931 goto __pyx_L8_try_return;
15942 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15943 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15944 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
15954 __Pyx_AddTraceback(
"PyClical.sin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15955 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1694, __pyx_L6_except_error)
15956 __Pyx_GOTREF(__pyx_t_5);
15957 __Pyx_GOTREF(__pyx_t_9);
15958 __Pyx_GOTREF(__pyx_t_3);
15967 __Pyx_XDECREF(__pyx_r);
15968 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1695, __pyx_L6_except_error)
15969 __Pyx_GOTREF(__pyx_t_10);
15970 __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, 1695, __pyx_L6_except_error)
15971 __Pyx_GOTREF(__pyx_t_11);
15972 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15973 __pyx_r = __pyx_t_11;
15975 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15976 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15977 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15978 goto __pyx_L7_except_return;
15980 __pyx_L6_except_error:;
15989 __Pyx_XGIVEREF(__pyx_t_6);
15990 __Pyx_XGIVEREF(__pyx_t_7);
15991 __Pyx_XGIVEREF(__pyx_t_8);
15992 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15993 goto __pyx_L1_error;
15994 __pyx_L8_try_return:;
15995 __Pyx_XGIVEREF(__pyx_t_6);
15996 __Pyx_XGIVEREF(__pyx_t_7);
15997 __Pyx_XGIVEREF(__pyx_t_8);
15998 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16000 __pyx_L7_except_return:;
16001 __Pyx_XGIVEREF(__pyx_t_6);
16002 __Pyx_XGIVEREF(__pyx_t_7);
16003 __Pyx_XGIVEREF(__pyx_t_8);
16004 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16019 __Pyx_XDECREF(__pyx_t_3);
16020 __Pyx_XDECREF(__pyx_t_5);
16021 __Pyx_XDECREF(__pyx_t_9);
16022 __Pyx_XDECREF(__pyx_t_10);
16023 __Pyx_XDECREF(__pyx_t_11);
16024 __Pyx_AddTraceback(
"PyClical.sin", __pyx_clineno, __pyx_lineno, __pyx_filename);
16027 __Pyx_XGIVEREF(__pyx_r);
16028 __Pyx_RefNannyFinishContext();
16033 static PyObject *__pyx_pw_8PyClical_59sin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16034 static char __pyx_doc_8PyClical_58sin[] =
"\n Sine of multivector with optional complexifier.\n\n >>> s=\"{-1}\"; x=clifford(s); print(asin(sin(x,s),s))\n {-1}\n >>> s=\"{-1}\"; x=clifford(s); print(asin(sin(x,s),\"{-2,-1,1}\"))\n {-1}\n >>> x=clifford(\"{1,2,3}\"); print(asin(sin(x)))\n {1,2,3}\n ";
16035 static PyObject *__pyx_pw_8PyClical_59sin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16036 PyObject *__pyx_v_obj = 0;
16037 PyObject *__pyx_v_i = 0;
16038 int __pyx_lineno = 0;
16039 const char *__pyx_filename = NULL;
16040 int __pyx_clineno = 0;
16041 PyObject *__pyx_r = 0;
16042 __Pyx_RefNannyDeclarations
16043 __Pyx_RefNannySetupContext(
"sin (wrapper)", 0);
16045 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
16046 PyObject* values[2] = {0,0};
16047 values[1] = ((PyObject *)Py_None);
16048 if (unlikely(__pyx_kwds)) {
16049 Py_ssize_t kw_args;
16050 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16051 switch (pos_args) {
16052 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16053 CYTHON_FALLTHROUGH;
16054 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16055 CYTHON_FALLTHROUGH;
16057 default:
goto __pyx_L5_argtuple_error;
16059 kw_args = PyDict_Size(__pyx_kwds);
16060 switch (pos_args) {
16062 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
16063 else goto __pyx_L5_argtuple_error;
16064 CYTHON_FALLTHROUGH;
16067 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
16068 if (value) { values[1] = value; kw_args--; }
16071 if (unlikely(kw_args > 0)) {
16072 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"sin") < 0)) __PYX_ERR(0, 1678, __pyx_L3_error)
16075 switch (PyTuple_GET_SIZE(__pyx_args)) {
16076 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16077 CYTHON_FALLTHROUGH;
16078 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16080 default:
goto __pyx_L5_argtuple_error;
16083 __pyx_v_obj = values[0];
16084 __pyx_v_i = values[1];
16086 goto __pyx_L4_argument_unpacking_done;
16087 __pyx_L5_argtuple_error:;
16088 __Pyx_RaiseArgtupleInvalid(
"sin", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1678, __pyx_L3_error)
16090 __Pyx_AddTraceback(
"PyClical.sin", __pyx_clineno, __pyx_lineno, __pyx_filename);
16091 __Pyx_RefNannyFinishContext();
16093 __pyx_L4_argument_unpacking_done:;
16094 __pyx_r = __pyx_pf_8PyClical_58sin(__pyx_self, __pyx_v_obj, __pyx_v_i);
16097 __Pyx_RefNannyFinishContext();
16101 static PyObject *__pyx_pf_8PyClical_58sin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
16102 PyObject *__pyx_r = NULL;
16103 __Pyx_RefNannyDeclarations
16104 PyObject *__pyx_t_1 = NULL;
16105 struct __pyx_opt_args_8PyClical_sin __pyx_t_2;
16106 int __pyx_lineno = 0;
16107 const char *__pyx_filename = NULL;
16108 int __pyx_clineno = 0;
16109 __Pyx_RefNannySetupContext(
"sin", 0);
16110 __Pyx_XDECREF(__pyx_r);
16111 __pyx_t_2.__pyx_n = 1;
16112 __pyx_t_2.i = __pyx_v_i;
16113 __pyx_t_1 = __pyx_f_8PyClical_sin(__pyx_v_obj, 0, &__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1678, __pyx_L1_error)
16114 __Pyx_GOTREF(__pyx_t_1);
16115 __pyx_r = __pyx_t_1;
16121 __Pyx_XDECREF(__pyx_t_1);
16122 __Pyx_AddTraceback(
"PyClical.sin", __pyx_clineno, __pyx_lineno, __pyx_filename);
16125 __Pyx_XGIVEREF(__pyx_r);
16126 __Pyx_RefNannyFinishContext();
16138 static PyObject *__pyx_pw_8PyClical_61asin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16139 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) {
16140 PyObject *__pyx_v_i = ((PyObject *)Py_None);
16141 PyObject *__pyx_r = NULL;
16142 __Pyx_RefNannyDeclarations
16145 PyObject *__pyx_t_3 = NULL;
16147 PyObject *__pyx_t_5 = NULL;
16148 PyObject *__pyx_t_6 = NULL;
16149 PyObject *__pyx_t_7 = NULL;
16150 PyObject *__pyx_t_8 = NULL;
16151 PyObject *__pyx_t_9 = NULL;
16152 PyObject *__pyx_t_10 = NULL;
16153 PyObject *__pyx_t_11 = NULL;
16154 int __pyx_lineno = 0;
16155 const char *__pyx_filename = NULL;
16156 int __pyx_clineno = 0;
16157 __Pyx_RefNannySetupContext(
"asin", 0);
16158 if (__pyx_optional_args) {
16159 if (__pyx_optional_args->__pyx_n > 0) {
16160 __pyx_v_i = __pyx_optional_args->i;
16171 __pyx_t_1 = (__pyx_v_i != Py_None);
16172 __pyx_t_2 = (__pyx_t_1 != 0);
16182 __Pyx_XDECREF(__pyx_r);
16183 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1711, __pyx_L1_error)
16184 __Pyx_GOTREF(__pyx_t_3);
16186 __pyx_t_4 =
asin(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
16188 __Pyx_CppExn2PyErr();
16189 __PYX_ERR(0, 1711, __pyx_L1_error)
16191 __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, 1711, __pyx_L1_error)
16192 __Pyx_GOTREF(__pyx_t_5);
16193 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16194 __pyx_r = __pyx_t_5;
16216 __Pyx_PyThreadState_declare
16217 __Pyx_PyThreadState_assign
16218 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
16219 __Pyx_XGOTREF(__pyx_t_6);
16220 __Pyx_XGOTREF(__pyx_t_7);
16221 __Pyx_XGOTREF(__pyx_t_8);
16231 __Pyx_XDECREF(__pyx_r);
16232 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1714, __pyx_L4_error)
16233 __Pyx_GOTREF(__pyx_t_3);
16234 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asin);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1714, __pyx_L4_error)
16235 __Pyx_GOTREF(__pyx_t_9);
16236 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16238 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
16239 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
16240 if (likely(__pyx_t_3)) {
16241 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
16242 __Pyx_INCREF(__pyx_t_3);
16243 __Pyx_INCREF(
function);
16244 __Pyx_DECREF_SET(__pyx_t_9,
function);
16247 __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);
16248 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16249 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1714, __pyx_L4_error)
16250 __Pyx_GOTREF(__pyx_t_5);
16251 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16252 __pyx_r = __pyx_t_5;
16254 goto __pyx_L8_try_return;
16265 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16266 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16267 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
16277 __Pyx_AddTraceback(
"PyClical.asin", __pyx_clineno, __pyx_lineno, __pyx_filename);
16278 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1715, __pyx_L6_except_error)
16279 __Pyx_GOTREF(__pyx_t_5);
16280 __Pyx_GOTREF(__pyx_t_9);
16281 __Pyx_GOTREF(__pyx_t_3);
16290 __Pyx_XDECREF(__pyx_r);
16291 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1716, __pyx_L6_except_error)
16292 __Pyx_GOTREF(__pyx_t_10);
16293 __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, 1716, __pyx_L6_except_error)
16294 __Pyx_GOTREF(__pyx_t_11);
16295 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16296 __pyx_r = __pyx_t_11;
16298 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16299 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16300 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16301 goto __pyx_L7_except_return;
16303 __pyx_L6_except_error:;
16312 __Pyx_XGIVEREF(__pyx_t_6);
16313 __Pyx_XGIVEREF(__pyx_t_7);
16314 __Pyx_XGIVEREF(__pyx_t_8);
16315 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16316 goto __pyx_L1_error;
16317 __pyx_L8_try_return:;
16318 __Pyx_XGIVEREF(__pyx_t_6);
16319 __Pyx_XGIVEREF(__pyx_t_7);
16320 __Pyx_XGIVEREF(__pyx_t_8);
16321 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16323 __pyx_L7_except_return:;
16324 __Pyx_XGIVEREF(__pyx_t_6);
16325 __Pyx_XGIVEREF(__pyx_t_7);
16326 __Pyx_XGIVEREF(__pyx_t_8);
16327 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16342 __Pyx_XDECREF(__pyx_t_3);
16343 __Pyx_XDECREF(__pyx_t_5);
16344 __Pyx_XDECREF(__pyx_t_9);
16345 __Pyx_XDECREF(__pyx_t_10);
16346 __Pyx_XDECREF(__pyx_t_11);
16347 __Pyx_AddTraceback(
"PyClical.asin", __pyx_clineno, __pyx_lineno, __pyx_filename);
16350 __Pyx_XGIVEREF(__pyx_r);
16351 __Pyx_RefNannyFinishContext();
16356 static PyObject *__pyx_pw_8PyClical_61asin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16357 static char __pyx_doc_8PyClical_60asin[] =
"\n Inverse sine of multivector with optional complexifier.\n\n >>> s=\"{-1}\"; x=clifford(s); print(asin(sin(x,s),s))\n {-1}\n >>> s=\"{-1}\"; x=clifford(s); print(asin(sin(x,s),\"{-2,-1,1}\"))\n {-1}\n >>> print(asin(1) / pi)\n 0.5\n >>> x=clifford(\"{1,2,3}\"); print(asin(sin(x)))\n {1,2,3}\n ";
16358 static PyObject *__pyx_pw_8PyClical_61asin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16359 PyObject *__pyx_v_obj = 0;
16360 PyObject *__pyx_v_i = 0;
16361 int __pyx_lineno = 0;
16362 const char *__pyx_filename = NULL;
16363 int __pyx_clineno = 0;
16364 PyObject *__pyx_r = 0;
16365 __Pyx_RefNannyDeclarations
16366 __Pyx_RefNannySetupContext(
"asin (wrapper)", 0);
16368 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
16369 PyObject* values[2] = {0,0};
16370 values[1] = ((PyObject *)Py_None);
16371 if (unlikely(__pyx_kwds)) {
16372 Py_ssize_t kw_args;
16373 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16374 switch (pos_args) {
16375 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16376 CYTHON_FALLTHROUGH;
16377 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16378 CYTHON_FALLTHROUGH;
16380 default:
goto __pyx_L5_argtuple_error;
16382 kw_args = PyDict_Size(__pyx_kwds);
16383 switch (pos_args) {
16385 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
16386 else goto __pyx_L5_argtuple_error;
16387 CYTHON_FALLTHROUGH;
16390 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
16391 if (value) { values[1] = value; kw_args--; }
16394 if (unlikely(kw_args > 0)) {
16395 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"asin") < 0)) __PYX_ERR(0, 1697, __pyx_L3_error)
16398 switch (PyTuple_GET_SIZE(__pyx_args)) {
16399 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16400 CYTHON_FALLTHROUGH;
16401 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16403 default:
goto __pyx_L5_argtuple_error;
16406 __pyx_v_obj = values[0];
16407 __pyx_v_i = values[1];
16409 goto __pyx_L4_argument_unpacking_done;
16410 __pyx_L5_argtuple_error:;
16411 __Pyx_RaiseArgtupleInvalid(
"asin", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1697, __pyx_L3_error)
16413 __Pyx_AddTraceback(
"PyClical.asin", __pyx_clineno, __pyx_lineno, __pyx_filename);
16414 __Pyx_RefNannyFinishContext();
16416 __pyx_L4_argument_unpacking_done:;
16417 __pyx_r = __pyx_pf_8PyClical_60asin(__pyx_self, __pyx_v_obj, __pyx_v_i);
16420 __Pyx_RefNannyFinishContext();
16424 static PyObject *__pyx_pf_8PyClical_60asin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
16425 PyObject *__pyx_r = NULL;
16426 __Pyx_RefNannyDeclarations
16427 PyObject *__pyx_t_1 = NULL;
16428 struct __pyx_opt_args_8PyClical_asin __pyx_t_2;
16429 int __pyx_lineno = 0;
16430 const char *__pyx_filename = NULL;
16431 int __pyx_clineno = 0;
16432 __Pyx_RefNannySetupContext(
"asin", 0);
16433 __Pyx_XDECREF(__pyx_r);
16434 __pyx_t_2.__pyx_n = 1;
16435 __pyx_t_2.i = __pyx_v_i;
16436 __pyx_t_1 = __pyx_f_8PyClical_asin(__pyx_v_obj, 0, &__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1697, __pyx_L1_error)
16437 __Pyx_GOTREF(__pyx_t_1);
16438 __pyx_r = __pyx_t_1;
16444 __Pyx_XDECREF(__pyx_t_1);
16445 __Pyx_AddTraceback(
"PyClical.asin", __pyx_clineno, __pyx_lineno, __pyx_filename);
16448 __Pyx_XGIVEREF(__pyx_r);
16449 __Pyx_RefNannyFinishContext();
16461 static PyObject *__pyx_pw_8PyClical_63sinh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
16462 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_sinh(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
16463 PyObject *__pyx_r = NULL;
16464 __Pyx_RefNannyDeclarations
16465 PyObject *__pyx_t_1 = NULL;
16466 PyObject *__pyx_t_2 = NULL;
16467 PyObject *__pyx_t_3 = NULL;
16468 PyObject *__pyx_t_4 = NULL;
16469 PyObject *__pyx_t_5 = NULL;
16470 PyObject *__pyx_t_6 = NULL;
16471 PyObject *__pyx_t_7 = NULL;
16472 PyObject *__pyx_t_8 = NULL;
16473 int __pyx_lineno = 0;
16474 const char *__pyx_filename = NULL;
16475 int __pyx_clineno = 0;
16476 __Pyx_RefNannySetupContext(
"sinh", 0);
16486 __Pyx_PyThreadState_declare
16487 __Pyx_PyThreadState_assign
16488 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
16489 __Pyx_XGOTREF(__pyx_t_1);
16490 __Pyx_XGOTREF(__pyx_t_2);
16491 __Pyx_XGOTREF(__pyx_t_3);
16501 __Pyx_XDECREF(__pyx_r);
16502 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1728, __pyx_L3_error)
16503 __Pyx_GOTREF(__pyx_t_5);
16504 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_sinh);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1728, __pyx_L3_error)
16505 __Pyx_GOTREF(__pyx_t_6);
16506 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16508 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
16509 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
16510 if (likely(__pyx_t_5)) {
16511 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
16512 __Pyx_INCREF(__pyx_t_5);
16513 __Pyx_INCREF(
function);
16514 __Pyx_DECREF_SET(__pyx_t_6,
function);
16517 __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);
16518 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16519 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1728, __pyx_L3_error)
16520 __Pyx_GOTREF(__pyx_t_4);
16521 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16522 __pyx_r = __pyx_t_4;
16524 goto __pyx_L7_try_return;
16535 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
16536 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16537 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
16547 __Pyx_AddTraceback(
"PyClical.sinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16548 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(0, 1729, __pyx_L5_except_error)
16549 __Pyx_GOTREF(__pyx_t_4);
16550 __Pyx_GOTREF(__pyx_t_6);
16551 __Pyx_GOTREF(__pyx_t_5);
16560 __Pyx_XDECREF(__pyx_r);
16561 __pyx_t_7 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1730, __pyx_L5_except_error)
16562 __Pyx_GOTREF(__pyx_t_7);
16563 __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, 1730, __pyx_L5_except_error)
16564 __Pyx_GOTREF(__pyx_t_8);
16565 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16566 __pyx_r = __pyx_t_8;
16568 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16569 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16570 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16571 goto __pyx_L6_except_return;
16573 __pyx_L5_except_error:;
16582 __Pyx_XGIVEREF(__pyx_t_1);
16583 __Pyx_XGIVEREF(__pyx_t_2);
16584 __Pyx_XGIVEREF(__pyx_t_3);
16585 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
16586 goto __pyx_L1_error;
16587 __pyx_L7_try_return:;
16588 __Pyx_XGIVEREF(__pyx_t_1);
16589 __Pyx_XGIVEREF(__pyx_t_2);
16590 __Pyx_XGIVEREF(__pyx_t_3);
16591 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
16593 __pyx_L6_except_return:;
16594 __Pyx_XGIVEREF(__pyx_t_1);
16595 __Pyx_XGIVEREF(__pyx_t_2);
16596 __Pyx_XGIVEREF(__pyx_t_3);
16597 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
16611 __Pyx_XDECREF(__pyx_t_4);
16612 __Pyx_XDECREF(__pyx_t_5);
16613 __Pyx_XDECREF(__pyx_t_6);
16614 __Pyx_XDECREF(__pyx_t_7);
16615 __Pyx_XDECREF(__pyx_t_8);
16616 __Pyx_AddTraceback(
"PyClical.sinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16619 __Pyx_XGIVEREF(__pyx_r);
16620 __Pyx_RefNannyFinishContext();
16625 static PyObject *__pyx_pw_8PyClical_63sinh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
16626 static char __pyx_doc_8PyClical_62sinh[] =
"\n Hyperbolic sine of multivector.\n\n >>> x=clifford(\"{1,2}\") * pi/2; print(sinh(x))\n {1,2}\n >>> x=clifford(\"{1,2}\") * pi/6; print(sinh(x))\n 0.5{1,2}\n ";
16627 static PyObject *__pyx_pw_8PyClical_63sinh(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
16628 PyObject *__pyx_r = 0;
16629 __Pyx_RefNannyDeclarations
16630 __Pyx_RefNannySetupContext(
"sinh (wrapper)", 0);
16631 __pyx_r = __pyx_pf_8PyClical_62sinh(__pyx_self, ((PyObject *)__pyx_v_obj));
16634 __Pyx_RefNannyFinishContext();
16638 static PyObject *__pyx_pf_8PyClical_62sinh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
16639 PyObject *__pyx_r = NULL;
16640 __Pyx_RefNannyDeclarations
16641 PyObject *__pyx_t_1 = NULL;
16642 int __pyx_lineno = 0;
16643 const char *__pyx_filename = NULL;
16644 int __pyx_clineno = 0;
16645 __Pyx_RefNannySetupContext(
"sinh", 0);
16646 __Pyx_XDECREF(__pyx_r);
16647 __pyx_t_1 = __pyx_f_8PyClical_sinh(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1718, __pyx_L1_error)
16648 __Pyx_GOTREF(__pyx_t_1);
16649 __pyx_r = __pyx_t_1;
16655 __Pyx_XDECREF(__pyx_t_1);
16656 __Pyx_AddTraceback(
"PyClical.sinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16659 __Pyx_XGIVEREF(__pyx_r);
16660 __Pyx_RefNannyFinishContext();
16672 static PyObject *__pyx_pw_8PyClical_65asinh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16673 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) {
16674 PyObject *__pyx_v_i = ((PyObject *)Py_None);
16675 PyObject *__pyx_r = NULL;
16676 __Pyx_RefNannyDeclarations
16679 PyObject *__pyx_t_3 = NULL;
16681 PyObject *__pyx_t_5 = NULL;
16682 PyObject *__pyx_t_6 = NULL;
16683 PyObject *__pyx_t_7 = NULL;
16684 PyObject *__pyx_t_8 = NULL;
16685 PyObject *__pyx_t_9 = NULL;
16686 PyObject *__pyx_t_10 = NULL;
16687 PyObject *__pyx_t_11 = NULL;
16688 int __pyx_lineno = 0;
16689 const char *__pyx_filename = NULL;
16690 int __pyx_clineno = 0;
16691 __Pyx_RefNannySetupContext(
"asinh", 0);
16692 if (__pyx_optional_args) {
16693 if (__pyx_optional_args->__pyx_n > 0) {
16694 __pyx_v_i = __pyx_optional_args->i;
16705 __pyx_t_1 = (__pyx_v_i != Py_None);
16706 __pyx_t_2 = (__pyx_t_1 != 0);
16716 __Pyx_XDECREF(__pyx_r);
16717 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1744, __pyx_L1_error)
16718 __Pyx_GOTREF(__pyx_t_3);
16720 __pyx_t_4 =
asinh(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
16722 __Pyx_CppExn2PyErr();
16723 __PYX_ERR(0, 1744, __pyx_L1_error)
16725 __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, 1744, __pyx_L1_error)
16726 __Pyx_GOTREF(__pyx_t_5);
16727 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16728 __pyx_r = __pyx_t_5;
16750 __Pyx_PyThreadState_declare
16751 __Pyx_PyThreadState_assign
16752 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
16753 __Pyx_XGOTREF(__pyx_t_6);
16754 __Pyx_XGOTREF(__pyx_t_7);
16755 __Pyx_XGOTREF(__pyx_t_8);
16765 __Pyx_XDECREF(__pyx_r);
16766 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1747, __pyx_L4_error)
16767 __Pyx_GOTREF(__pyx_t_3);
16768 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asinh);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1747, __pyx_L4_error)
16769 __Pyx_GOTREF(__pyx_t_9);
16770 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16772 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
16773 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
16774 if (likely(__pyx_t_3)) {
16775 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
16776 __Pyx_INCREF(__pyx_t_3);
16777 __Pyx_INCREF(
function);
16778 __Pyx_DECREF_SET(__pyx_t_9,
function);
16781 __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);
16782 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16783 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1747, __pyx_L4_error)
16784 __Pyx_GOTREF(__pyx_t_5);
16785 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16786 __pyx_r = __pyx_t_5;
16788 goto __pyx_L8_try_return;
16799 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16800 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16801 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
16811 __Pyx_AddTraceback(
"PyClical.asinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16812 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1748, __pyx_L6_except_error)
16813 __Pyx_GOTREF(__pyx_t_5);
16814 __Pyx_GOTREF(__pyx_t_9);
16815 __Pyx_GOTREF(__pyx_t_3);
16824 __Pyx_XDECREF(__pyx_r);
16825 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1749, __pyx_L6_except_error)
16826 __Pyx_GOTREF(__pyx_t_10);
16827 __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, 1749, __pyx_L6_except_error)
16828 __Pyx_GOTREF(__pyx_t_11);
16829 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16830 __pyx_r = __pyx_t_11;
16832 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16833 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16834 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16835 goto __pyx_L7_except_return;
16837 __pyx_L6_except_error:;
16846 __Pyx_XGIVEREF(__pyx_t_6);
16847 __Pyx_XGIVEREF(__pyx_t_7);
16848 __Pyx_XGIVEREF(__pyx_t_8);
16849 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16850 goto __pyx_L1_error;
16851 __pyx_L8_try_return:;
16852 __Pyx_XGIVEREF(__pyx_t_6);
16853 __Pyx_XGIVEREF(__pyx_t_7);
16854 __Pyx_XGIVEREF(__pyx_t_8);
16855 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16857 __pyx_L7_except_return:;
16858 __Pyx_XGIVEREF(__pyx_t_6);
16859 __Pyx_XGIVEREF(__pyx_t_7);
16860 __Pyx_XGIVEREF(__pyx_t_8);
16861 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16876 __Pyx_XDECREF(__pyx_t_3);
16877 __Pyx_XDECREF(__pyx_t_5);
16878 __Pyx_XDECREF(__pyx_t_9);
16879 __Pyx_XDECREF(__pyx_t_10);
16880 __Pyx_XDECREF(__pyx_t_11);
16881 __Pyx_AddTraceback(
"PyClical.asinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16884 __Pyx_XGIVEREF(__pyx_r);
16885 __Pyx_RefNannyFinishContext();
16890 static PyObject *__pyx_pw_8PyClical_65asinh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16891 static char __pyx_doc_8PyClical_64asinh[] =
"\n Inverse hyperbolic sine of multivector with optional complexifier.\n\n >>> x=clifford(\"{1,2}\"); print(asinh(x,\"{1,2,3}\") * 2/pi)\n {1,2}\n >>> x=clifford(\"{1,2}\"); print(asinh(x) * 2/pi)\n {1,2}\n >>> x=clifford(\"{1,2}\") / 2; print(asinh(x) * 6/pi)\n {1,2}\n ";
16892 static PyObject *__pyx_pw_8PyClical_65asinh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16893 PyObject *__pyx_v_obj = 0;
16894 PyObject *__pyx_v_i = 0;
16895 int __pyx_lineno = 0;
16896 const char *__pyx_filename = NULL;
16897 int __pyx_clineno = 0;
16898 PyObject *__pyx_r = 0;
16899 __Pyx_RefNannyDeclarations
16900 __Pyx_RefNannySetupContext(
"asinh (wrapper)", 0);
16902 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
16903 PyObject* values[2] = {0,0};
16904 values[1] = ((PyObject *)Py_None);
16905 if (unlikely(__pyx_kwds)) {
16906 Py_ssize_t kw_args;
16907 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16908 switch (pos_args) {
16909 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16910 CYTHON_FALLTHROUGH;
16911 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16912 CYTHON_FALLTHROUGH;
16914 default:
goto __pyx_L5_argtuple_error;
16916 kw_args = PyDict_Size(__pyx_kwds);
16917 switch (pos_args) {
16919 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
16920 else goto __pyx_L5_argtuple_error;
16921 CYTHON_FALLTHROUGH;
16924 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
16925 if (value) { values[1] = value; kw_args--; }
16928 if (unlikely(kw_args > 0)) {
16929 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"asinh") < 0)) __PYX_ERR(0, 1732, __pyx_L3_error)
16932 switch (PyTuple_GET_SIZE(__pyx_args)) {
16933 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16934 CYTHON_FALLTHROUGH;
16935 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16937 default:
goto __pyx_L5_argtuple_error;
16940 __pyx_v_obj = values[0];
16941 __pyx_v_i = values[1];
16943 goto __pyx_L4_argument_unpacking_done;
16944 __pyx_L5_argtuple_error:;
16945 __Pyx_RaiseArgtupleInvalid(
"asinh", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1732, __pyx_L3_error)
16947 __Pyx_AddTraceback(
"PyClical.asinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16948 __Pyx_RefNannyFinishContext();
16950 __pyx_L4_argument_unpacking_done:;
16951 __pyx_r = __pyx_pf_8PyClical_64asinh(__pyx_self, __pyx_v_obj, __pyx_v_i);
16954 __Pyx_RefNannyFinishContext();
16958 static PyObject *__pyx_pf_8PyClical_64asinh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
16959 PyObject *__pyx_r = NULL;
16960 __Pyx_RefNannyDeclarations
16961 PyObject *__pyx_t_1 = NULL;
16962 struct __pyx_opt_args_8PyClical_asinh __pyx_t_2;
16963 int __pyx_lineno = 0;
16964 const char *__pyx_filename = NULL;
16965 int __pyx_clineno = 0;
16966 __Pyx_RefNannySetupContext(
"asinh", 0);
16967 __Pyx_XDECREF(__pyx_r);
16968 __pyx_t_2.__pyx_n = 1;
16969 __pyx_t_2.i = __pyx_v_i;
16970 __pyx_t_1 = __pyx_f_8PyClical_asinh(__pyx_v_obj, 0, &__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1732, __pyx_L1_error)
16971 __Pyx_GOTREF(__pyx_t_1);
16972 __pyx_r = __pyx_t_1;
16978 __Pyx_XDECREF(__pyx_t_1);
16979 __Pyx_AddTraceback(
"PyClical.asinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16982 __Pyx_XGIVEREF(__pyx_r);
16983 __Pyx_RefNannyFinishContext();
16995 static PyObject *__pyx_pw_8PyClical_67tan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16996 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) {
16997 PyObject *__pyx_v_i = ((PyObject *)Py_None);
16998 PyObject *__pyx_r = NULL;
16999 __Pyx_RefNannyDeclarations
17002 PyObject *__pyx_t_3 = NULL;
17004 PyObject *__pyx_t_5 = NULL;
17005 PyObject *__pyx_t_6 = NULL;
17006 PyObject *__pyx_t_7 = NULL;
17007 PyObject *__pyx_t_8 = NULL;
17008 PyObject *__pyx_t_9 = NULL;
17009 PyObject *__pyx_t_10 = NULL;
17010 PyObject *__pyx_t_11 = NULL;
17011 int __pyx_lineno = 0;
17012 const char *__pyx_filename = NULL;
17013 int __pyx_clineno = 0;
17014 __Pyx_RefNannySetupContext(
"tan", 0);
17015 if (__pyx_optional_args) {
17016 if (__pyx_optional_args->__pyx_n > 0) {
17017 __pyx_v_i = __pyx_optional_args->i;
17028 __pyx_t_1 = (__pyx_v_i != Py_None);
17029 __pyx_t_2 = (__pyx_t_1 != 0);
17039 __Pyx_XDECREF(__pyx_r);
17040 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1761, __pyx_L1_error)
17041 __Pyx_GOTREF(__pyx_t_3);
17043 __pyx_t_4 =
tan(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
17045 __Pyx_CppExn2PyErr();
17046 __PYX_ERR(0, 1761, __pyx_L1_error)
17048 __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)
17049 __Pyx_GOTREF(__pyx_t_5);
17050 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17051 __pyx_r = __pyx_t_5;
17073 __Pyx_PyThreadState_declare
17074 __Pyx_PyThreadState_assign
17075 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
17076 __Pyx_XGOTREF(__pyx_t_6);
17077 __Pyx_XGOTREF(__pyx_t_7);
17078 __Pyx_XGOTREF(__pyx_t_8);
17088 __Pyx_XDECREF(__pyx_r);
17089 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1764, __pyx_L4_error)
17090 __Pyx_GOTREF(__pyx_t_3);
17091 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_tan);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1764, __pyx_L4_error)
17092 __Pyx_GOTREF(__pyx_t_9);
17093 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17095 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
17096 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
17097 if (likely(__pyx_t_3)) {
17098 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
17099 __Pyx_INCREF(__pyx_t_3);
17100 __Pyx_INCREF(
function);
17101 __Pyx_DECREF_SET(__pyx_t_9,
function);
17104 __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);
17105 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17106 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1764, __pyx_L4_error)
17107 __Pyx_GOTREF(__pyx_t_5);
17108 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17109 __pyx_r = __pyx_t_5;
17111 goto __pyx_L8_try_return;
17122 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17123 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17124 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
17134 __Pyx_AddTraceback(
"PyClical.tan", __pyx_clineno, __pyx_lineno, __pyx_filename);
17135 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1765, __pyx_L6_except_error)
17136 __Pyx_GOTREF(__pyx_t_5);
17137 __Pyx_GOTREF(__pyx_t_9);
17138 __Pyx_GOTREF(__pyx_t_3);
17147 __Pyx_XDECREF(__pyx_r);
17148 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1766, __pyx_L6_except_error)
17149 __Pyx_GOTREF(__pyx_t_10);
17150 __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, 1766, __pyx_L6_except_error)
17151 __Pyx_GOTREF(__pyx_t_11);
17152 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
17153 __pyx_r = __pyx_t_11;
17155 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17156 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17157 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17158 goto __pyx_L7_except_return;
17160 __pyx_L6_except_error:;
17169 __Pyx_XGIVEREF(__pyx_t_6);
17170 __Pyx_XGIVEREF(__pyx_t_7);
17171 __Pyx_XGIVEREF(__pyx_t_8);
17172 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17173 goto __pyx_L1_error;
17174 __pyx_L8_try_return:;
17175 __Pyx_XGIVEREF(__pyx_t_6);
17176 __Pyx_XGIVEREF(__pyx_t_7);
17177 __Pyx_XGIVEREF(__pyx_t_8);
17178 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17180 __pyx_L7_except_return:;
17181 __Pyx_XGIVEREF(__pyx_t_6);
17182 __Pyx_XGIVEREF(__pyx_t_7);
17183 __Pyx_XGIVEREF(__pyx_t_8);
17184 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17199 __Pyx_XDECREF(__pyx_t_3);
17200 __Pyx_XDECREF(__pyx_t_5);
17201 __Pyx_XDECREF(__pyx_t_9);
17202 __Pyx_XDECREF(__pyx_t_10);
17203 __Pyx_XDECREF(__pyx_t_11);
17204 __Pyx_AddTraceback(
"PyClical.tan", __pyx_clineno, __pyx_lineno, __pyx_filename);
17207 __Pyx_XGIVEREF(__pyx_r);
17208 __Pyx_RefNannyFinishContext();
17213 static PyObject *__pyx_pw_8PyClical_67tan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17214 static char __pyx_doc_8PyClical_66tan[] =
"\n Tangent of multivector with optional complexifier.\n\n >>> x=clifford(\"{1,2}\"); print(tan(x,\"{1,2,3}\"))\n 0.7616{1,2}\n >>> x=clifford(\"{1,2}\"); print(tan(x))\n 0.7616{1,2}\n ";
17215 static PyObject *__pyx_pw_8PyClical_67tan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17216 PyObject *__pyx_v_obj = 0;
17217 PyObject *__pyx_v_i = 0;
17218 int __pyx_lineno = 0;
17219 const char *__pyx_filename = NULL;
17220 int __pyx_clineno = 0;
17221 PyObject *__pyx_r = 0;
17222 __Pyx_RefNannyDeclarations
17223 __Pyx_RefNannySetupContext(
"tan (wrapper)", 0);
17225 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
17226 PyObject* values[2] = {0,0};
17227 values[1] = ((PyObject *)Py_None);
17228 if (unlikely(__pyx_kwds)) {
17229 Py_ssize_t kw_args;
17230 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17231 switch (pos_args) {
17232 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17233 CYTHON_FALLTHROUGH;
17234 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17235 CYTHON_FALLTHROUGH;
17237 default:
goto __pyx_L5_argtuple_error;
17239 kw_args = PyDict_Size(__pyx_kwds);
17240 switch (pos_args) {
17242 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
17243 else goto __pyx_L5_argtuple_error;
17244 CYTHON_FALLTHROUGH;
17247 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
17248 if (value) { values[1] = value; kw_args--; }
17251 if (unlikely(kw_args > 0)) {
17252 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"tan") < 0)) __PYX_ERR(0, 1751, __pyx_L3_error)
17255 switch (PyTuple_GET_SIZE(__pyx_args)) {
17256 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17257 CYTHON_FALLTHROUGH;
17258 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17260 default:
goto __pyx_L5_argtuple_error;
17263 __pyx_v_obj = values[0];
17264 __pyx_v_i = values[1];
17266 goto __pyx_L4_argument_unpacking_done;
17267 __pyx_L5_argtuple_error:;
17268 __Pyx_RaiseArgtupleInvalid(
"tan", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1751, __pyx_L3_error)
17270 __Pyx_AddTraceback(
"PyClical.tan", __pyx_clineno, __pyx_lineno, __pyx_filename);
17271 __Pyx_RefNannyFinishContext();
17273 __pyx_L4_argument_unpacking_done:;
17274 __pyx_r = __pyx_pf_8PyClical_66tan(__pyx_self, __pyx_v_obj, __pyx_v_i);
17277 __Pyx_RefNannyFinishContext();
17281 static PyObject *__pyx_pf_8PyClical_66tan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
17282 PyObject *__pyx_r = NULL;
17283 __Pyx_RefNannyDeclarations
17284 PyObject *__pyx_t_1 = NULL;
17285 struct __pyx_opt_args_8PyClical_tan __pyx_t_2;
17286 int __pyx_lineno = 0;
17287 const char *__pyx_filename = NULL;
17288 int __pyx_clineno = 0;
17289 __Pyx_RefNannySetupContext(
"tan", 0);
17290 __Pyx_XDECREF(__pyx_r);
17291 __pyx_t_2.__pyx_n = 1;
17292 __pyx_t_2.i = __pyx_v_i;
17293 __pyx_t_1 = __pyx_f_8PyClical_tan(__pyx_v_obj, 0, &__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1751, __pyx_L1_error)
17294 __Pyx_GOTREF(__pyx_t_1);
17295 __pyx_r = __pyx_t_1;
17301 __Pyx_XDECREF(__pyx_t_1);
17302 __Pyx_AddTraceback(
"PyClical.tan", __pyx_clineno, __pyx_lineno, __pyx_filename);
17305 __Pyx_XGIVEREF(__pyx_r);
17306 __Pyx_RefNannyFinishContext();
17318 static PyObject *__pyx_pw_8PyClical_69atan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17319 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) {
17320 PyObject *__pyx_v_i = ((PyObject *)Py_None);
17321 PyObject *__pyx_r = NULL;
17322 __Pyx_RefNannyDeclarations
17325 PyObject *__pyx_t_3 = NULL;
17327 PyObject *__pyx_t_5 = NULL;
17328 PyObject *__pyx_t_6 = NULL;
17329 PyObject *__pyx_t_7 = NULL;
17330 PyObject *__pyx_t_8 = NULL;
17331 PyObject *__pyx_t_9 = NULL;
17332 PyObject *__pyx_t_10 = NULL;
17333 PyObject *__pyx_t_11 = NULL;
17334 int __pyx_lineno = 0;
17335 const char *__pyx_filename = NULL;
17336 int __pyx_clineno = 0;
17337 __Pyx_RefNannySetupContext(
"atan", 0);
17338 if (__pyx_optional_args) {
17339 if (__pyx_optional_args->__pyx_n > 0) {
17340 __pyx_v_i = __pyx_optional_args->i;
17351 __pyx_t_1 = (__pyx_v_i != Py_None);
17352 __pyx_t_2 = (__pyx_t_1 != 0);
17362 __Pyx_XDECREF(__pyx_r);
17363 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1778, __pyx_L1_error)
17364 __Pyx_GOTREF(__pyx_t_3);
17366 __pyx_t_4 =
atan(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
17368 __Pyx_CppExn2PyErr();
17369 __PYX_ERR(0, 1778, __pyx_L1_error)
17371 __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, 1778, __pyx_L1_error)
17372 __Pyx_GOTREF(__pyx_t_5);
17373 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17374 __pyx_r = __pyx_t_5;
17396 __Pyx_PyThreadState_declare
17397 __Pyx_PyThreadState_assign
17398 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
17399 __Pyx_XGOTREF(__pyx_t_6);
17400 __Pyx_XGOTREF(__pyx_t_7);
17401 __Pyx_XGOTREF(__pyx_t_8);
17411 __Pyx_XDECREF(__pyx_r);
17412 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1781, __pyx_L4_error)
17413 __Pyx_GOTREF(__pyx_t_3);
17414 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_atan);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1781, __pyx_L4_error)
17415 __Pyx_GOTREF(__pyx_t_9);
17416 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17418 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
17419 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
17420 if (likely(__pyx_t_3)) {
17421 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
17422 __Pyx_INCREF(__pyx_t_3);
17423 __Pyx_INCREF(
function);
17424 __Pyx_DECREF_SET(__pyx_t_9,
function);
17427 __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);
17428 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17429 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1781, __pyx_L4_error)
17430 __Pyx_GOTREF(__pyx_t_5);
17431 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17432 __pyx_r = __pyx_t_5;
17434 goto __pyx_L8_try_return;
17445 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17446 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17447 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
17457 __Pyx_AddTraceback(
"PyClical.atan", __pyx_clineno, __pyx_lineno, __pyx_filename);
17458 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1782, __pyx_L6_except_error)
17459 __Pyx_GOTREF(__pyx_t_5);
17460 __Pyx_GOTREF(__pyx_t_9);
17461 __Pyx_GOTREF(__pyx_t_3);
17470 __Pyx_XDECREF(__pyx_r);
17471 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1783, __pyx_L6_except_error)
17472 __Pyx_GOTREF(__pyx_t_10);
17473 __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, 1783, __pyx_L6_except_error)
17474 __Pyx_GOTREF(__pyx_t_11);
17475 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
17476 __pyx_r = __pyx_t_11;
17478 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17479 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17480 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17481 goto __pyx_L7_except_return;
17483 __pyx_L6_except_error:;
17492 __Pyx_XGIVEREF(__pyx_t_6);
17493 __Pyx_XGIVEREF(__pyx_t_7);
17494 __Pyx_XGIVEREF(__pyx_t_8);
17495 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17496 goto __pyx_L1_error;
17497 __pyx_L8_try_return:;
17498 __Pyx_XGIVEREF(__pyx_t_6);
17499 __Pyx_XGIVEREF(__pyx_t_7);
17500 __Pyx_XGIVEREF(__pyx_t_8);
17501 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17503 __pyx_L7_except_return:;
17504 __Pyx_XGIVEREF(__pyx_t_6);
17505 __Pyx_XGIVEREF(__pyx_t_7);
17506 __Pyx_XGIVEREF(__pyx_t_8);
17507 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17522 __Pyx_XDECREF(__pyx_t_3);
17523 __Pyx_XDECREF(__pyx_t_5);
17524 __Pyx_XDECREF(__pyx_t_9);
17525 __Pyx_XDECREF(__pyx_t_10);
17526 __Pyx_XDECREF(__pyx_t_11);
17527 __Pyx_AddTraceback(
"PyClical.atan", __pyx_clineno, __pyx_lineno, __pyx_filename);
17530 __Pyx_XGIVEREF(__pyx_r);
17531 __Pyx_RefNannyFinishContext();
17536 static PyObject *__pyx_pw_8PyClical_69atan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17537 static char __pyx_doc_8PyClical_68atan[] =
"\n Inverse tangent of multivector with optional complexifier.\n\n >>> s=index_set({1,2,3}); x=clifford(\"{1}\"); print(tan(atan(x,s),s))\n {1}\n >>> x=clifford(\"{1}\"); print(tan(atan(x)))\n {1}\n ";
17538 static PyObject *__pyx_pw_8PyClical_69atan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17539 PyObject *__pyx_v_obj = 0;
17540 PyObject *__pyx_v_i = 0;
17541 int __pyx_lineno = 0;
17542 const char *__pyx_filename = NULL;
17543 int __pyx_clineno = 0;
17544 PyObject *__pyx_r = 0;
17545 __Pyx_RefNannyDeclarations
17546 __Pyx_RefNannySetupContext(
"atan (wrapper)", 0);
17548 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
17549 PyObject* values[2] = {0,0};
17550 values[1] = ((PyObject *)Py_None);
17551 if (unlikely(__pyx_kwds)) {
17552 Py_ssize_t kw_args;
17553 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17554 switch (pos_args) {
17555 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17556 CYTHON_FALLTHROUGH;
17557 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17558 CYTHON_FALLTHROUGH;
17560 default:
goto __pyx_L5_argtuple_error;
17562 kw_args = PyDict_Size(__pyx_kwds);
17563 switch (pos_args) {
17565 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
17566 else goto __pyx_L5_argtuple_error;
17567 CYTHON_FALLTHROUGH;
17570 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
17571 if (value) { values[1] = value; kw_args--; }
17574 if (unlikely(kw_args > 0)) {
17575 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"atan") < 0)) __PYX_ERR(0, 1768, __pyx_L3_error)
17578 switch (PyTuple_GET_SIZE(__pyx_args)) {
17579 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17580 CYTHON_FALLTHROUGH;
17581 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17583 default:
goto __pyx_L5_argtuple_error;
17586 __pyx_v_obj = values[0];
17587 __pyx_v_i = values[1];
17589 goto __pyx_L4_argument_unpacking_done;
17590 __pyx_L5_argtuple_error:;
17591 __Pyx_RaiseArgtupleInvalid(
"atan", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1768, __pyx_L3_error)
17593 __Pyx_AddTraceback(
"PyClical.atan", __pyx_clineno, __pyx_lineno, __pyx_filename);
17594 __Pyx_RefNannyFinishContext();
17596 __pyx_L4_argument_unpacking_done:;
17597 __pyx_r = __pyx_pf_8PyClical_68atan(__pyx_self, __pyx_v_obj, __pyx_v_i);
17600 __Pyx_RefNannyFinishContext();
17604 static PyObject *__pyx_pf_8PyClical_68atan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
17605 PyObject *__pyx_r = NULL;
17606 __Pyx_RefNannyDeclarations
17607 PyObject *__pyx_t_1 = NULL;
17608 struct __pyx_opt_args_8PyClical_atan __pyx_t_2;
17609 int __pyx_lineno = 0;
17610 const char *__pyx_filename = NULL;
17611 int __pyx_clineno = 0;
17612 __Pyx_RefNannySetupContext(
"atan", 0);
17613 __Pyx_XDECREF(__pyx_r);
17614 __pyx_t_2.__pyx_n = 1;
17615 __pyx_t_2.i = __pyx_v_i;
17616 __pyx_t_1 = __pyx_f_8PyClical_atan(__pyx_v_obj, 0, &__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1768, __pyx_L1_error)
17617 __Pyx_GOTREF(__pyx_t_1);
17618 __pyx_r = __pyx_t_1;
17624 __Pyx_XDECREF(__pyx_t_1);
17625 __Pyx_AddTraceback(
"PyClical.atan", __pyx_clineno, __pyx_lineno, __pyx_filename);
17628 __Pyx_XGIVEREF(__pyx_r);
17629 __Pyx_RefNannyFinishContext();
17641 static PyObject *__pyx_pw_8PyClical_71tanh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
17642 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_tanh(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
17643 PyObject *__pyx_r = NULL;
17644 __Pyx_RefNannyDeclarations
17645 PyObject *__pyx_t_1 = NULL;
17646 PyObject *__pyx_t_2 = NULL;
17647 PyObject *__pyx_t_3 = NULL;
17648 PyObject *__pyx_t_4 = NULL;
17649 PyObject *__pyx_t_5 = NULL;
17650 PyObject *__pyx_t_6 = NULL;
17651 PyObject *__pyx_t_7 = NULL;
17652 PyObject *__pyx_t_8 = NULL;
17653 int __pyx_lineno = 0;
17654 const char *__pyx_filename = NULL;
17655 int __pyx_clineno = 0;
17656 __Pyx_RefNannySetupContext(
"tanh", 0);
17666 __Pyx_PyThreadState_declare
17667 __Pyx_PyThreadState_assign
17668 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
17669 __Pyx_XGOTREF(__pyx_t_1);
17670 __Pyx_XGOTREF(__pyx_t_2);
17671 __Pyx_XGOTREF(__pyx_t_3);
17681 __Pyx_XDECREF(__pyx_r);
17682 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1793, __pyx_L3_error)
17683 __Pyx_GOTREF(__pyx_t_5);
17684 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_tanh);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1793, __pyx_L3_error)
17685 __Pyx_GOTREF(__pyx_t_6);
17686 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17688 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
17689 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
17690 if (likely(__pyx_t_5)) {
17691 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
17692 __Pyx_INCREF(__pyx_t_5);
17693 __Pyx_INCREF(
function);
17694 __Pyx_DECREF_SET(__pyx_t_6,
function);
17697 __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);
17698 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17699 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1793, __pyx_L3_error)
17700 __Pyx_GOTREF(__pyx_t_4);
17701 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17702 __pyx_r = __pyx_t_4;
17704 goto __pyx_L7_try_return;
17715 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
17716 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17717 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
17727 __Pyx_AddTraceback(
"PyClical.tanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17728 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(0, 1794, __pyx_L5_except_error)
17729 __Pyx_GOTREF(__pyx_t_4);
17730 __Pyx_GOTREF(__pyx_t_6);
17731 __Pyx_GOTREF(__pyx_t_5);
17740 __Pyx_XDECREF(__pyx_r);
17741 __pyx_t_7 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1795, __pyx_L5_except_error)
17742 __Pyx_GOTREF(__pyx_t_7);
17743 __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, 1795, __pyx_L5_except_error)
17744 __Pyx_GOTREF(__pyx_t_8);
17745 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
17746 __pyx_r = __pyx_t_8;
17748 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17749 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17750 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17751 goto __pyx_L6_except_return;
17753 __pyx_L5_except_error:;
17762 __Pyx_XGIVEREF(__pyx_t_1);
17763 __Pyx_XGIVEREF(__pyx_t_2);
17764 __Pyx_XGIVEREF(__pyx_t_3);
17765 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
17766 goto __pyx_L1_error;
17767 __pyx_L7_try_return:;
17768 __Pyx_XGIVEREF(__pyx_t_1);
17769 __Pyx_XGIVEREF(__pyx_t_2);
17770 __Pyx_XGIVEREF(__pyx_t_3);
17771 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
17773 __pyx_L6_except_return:;
17774 __Pyx_XGIVEREF(__pyx_t_1);
17775 __Pyx_XGIVEREF(__pyx_t_2);
17776 __Pyx_XGIVEREF(__pyx_t_3);
17777 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
17791 __Pyx_XDECREF(__pyx_t_4);
17792 __Pyx_XDECREF(__pyx_t_5);
17793 __Pyx_XDECREF(__pyx_t_6);
17794 __Pyx_XDECREF(__pyx_t_7);
17795 __Pyx_XDECREF(__pyx_t_8);
17796 __Pyx_AddTraceback(
"PyClical.tanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17799 __Pyx_XGIVEREF(__pyx_r);
17800 __Pyx_RefNannyFinishContext();
17805 static PyObject *__pyx_pw_8PyClical_71tanh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
17806 static char __pyx_doc_8PyClical_70tanh[] =
"\n Hyperbolic tangent of multivector.\n\n >>> x=clifford(\"{1,2}\") * pi/4; print(tanh(x))\n {1,2}\n ";
17807 static PyObject *__pyx_pw_8PyClical_71tanh(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
17808 PyObject *__pyx_r = 0;
17809 __Pyx_RefNannyDeclarations
17810 __Pyx_RefNannySetupContext(
"tanh (wrapper)", 0);
17811 __pyx_r = __pyx_pf_8PyClical_70tanh(__pyx_self, ((PyObject *)__pyx_v_obj));
17814 __Pyx_RefNannyFinishContext();
17818 static PyObject *__pyx_pf_8PyClical_70tanh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
17819 PyObject *__pyx_r = NULL;
17820 __Pyx_RefNannyDeclarations
17821 PyObject *__pyx_t_1 = NULL;
17822 int __pyx_lineno = 0;
17823 const char *__pyx_filename = NULL;
17824 int __pyx_clineno = 0;
17825 __Pyx_RefNannySetupContext(
"tanh", 0);
17826 __Pyx_XDECREF(__pyx_r);
17827 __pyx_t_1 = __pyx_f_8PyClical_tanh(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1785, __pyx_L1_error)
17828 __Pyx_GOTREF(__pyx_t_1);
17829 __pyx_r = __pyx_t_1;
17835 __Pyx_XDECREF(__pyx_t_1);
17836 __Pyx_AddTraceback(
"PyClical.tanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17839 __Pyx_XGIVEREF(__pyx_r);
17840 __Pyx_RefNannyFinishContext();
17852 static PyObject *__pyx_pw_8PyClical_73atanh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17853 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) {
17854 PyObject *__pyx_v_i = ((PyObject *)Py_None);
17855 PyObject *__pyx_r = NULL;
17856 __Pyx_RefNannyDeclarations
17859 PyObject *__pyx_t_3 = NULL;
17861 PyObject *__pyx_t_5 = NULL;
17862 PyObject *__pyx_t_6 = NULL;
17863 PyObject *__pyx_t_7 = NULL;
17864 PyObject *__pyx_t_8 = NULL;
17865 PyObject *__pyx_t_9 = NULL;
17866 PyObject *__pyx_t_10 = NULL;
17867 PyObject *__pyx_t_11 = NULL;
17868 int __pyx_lineno = 0;
17869 const char *__pyx_filename = NULL;
17870 int __pyx_clineno = 0;
17871 __Pyx_RefNannySetupContext(
"atanh", 0);
17872 if (__pyx_optional_args) {
17873 if (__pyx_optional_args->__pyx_n > 0) {
17874 __pyx_v_i = __pyx_optional_args->i;
17885 __pyx_t_1 = (__pyx_v_i != Py_None);
17886 __pyx_t_2 = (__pyx_t_1 != 0);
17896 __Pyx_XDECREF(__pyx_r);
17897 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1807, __pyx_L1_error)
17898 __Pyx_GOTREF(__pyx_t_3);
17900 __pyx_t_4 =
atanh(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
17902 __Pyx_CppExn2PyErr();
17903 __PYX_ERR(0, 1807, __pyx_L1_error)
17905 __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, 1807, __pyx_L1_error)
17906 __Pyx_GOTREF(__pyx_t_5);
17907 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17908 __pyx_r = __pyx_t_5;
17930 __Pyx_PyThreadState_declare
17931 __Pyx_PyThreadState_assign
17932 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
17933 __Pyx_XGOTREF(__pyx_t_6);
17934 __Pyx_XGOTREF(__pyx_t_7);
17935 __Pyx_XGOTREF(__pyx_t_8);
17945 __Pyx_XDECREF(__pyx_r);
17946 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1810, __pyx_L4_error)
17947 __Pyx_GOTREF(__pyx_t_3);
17948 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_atanh);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1810, __pyx_L4_error)
17949 __Pyx_GOTREF(__pyx_t_9);
17950 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17952 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
17953 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
17954 if (likely(__pyx_t_3)) {
17955 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
17956 __Pyx_INCREF(__pyx_t_3);
17957 __Pyx_INCREF(
function);
17958 __Pyx_DECREF_SET(__pyx_t_9,
function);
17961 __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);
17962 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17963 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1810, __pyx_L4_error)
17964 __Pyx_GOTREF(__pyx_t_5);
17965 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17966 __pyx_r = __pyx_t_5;
17968 goto __pyx_L8_try_return;
17979 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17980 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17981 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
17991 __Pyx_AddTraceback(
"PyClical.atanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17992 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1811, __pyx_L6_except_error)
17993 __Pyx_GOTREF(__pyx_t_5);
17994 __Pyx_GOTREF(__pyx_t_9);
17995 __Pyx_GOTREF(__pyx_t_3);
18004 __Pyx_XDECREF(__pyx_r);
18005 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1812, __pyx_L6_except_error)
18006 __Pyx_GOTREF(__pyx_t_10);
18007 __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, 1812, __pyx_L6_except_error)
18008 __Pyx_GOTREF(__pyx_t_11);
18009 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
18010 __pyx_r = __pyx_t_11;
18012 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18013 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18014 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18015 goto __pyx_L7_except_return;
18017 __pyx_L6_except_error:;
18026 __Pyx_XGIVEREF(__pyx_t_6);
18027 __Pyx_XGIVEREF(__pyx_t_7);
18028 __Pyx_XGIVEREF(__pyx_t_8);
18029 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
18030 goto __pyx_L1_error;
18031 __pyx_L8_try_return:;
18032 __Pyx_XGIVEREF(__pyx_t_6);
18033 __Pyx_XGIVEREF(__pyx_t_7);
18034 __Pyx_XGIVEREF(__pyx_t_8);
18035 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
18037 __pyx_L7_except_return:;
18038 __Pyx_XGIVEREF(__pyx_t_6);
18039 __Pyx_XGIVEREF(__pyx_t_7);
18040 __Pyx_XGIVEREF(__pyx_t_8);
18041 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
18056 __Pyx_XDECREF(__pyx_t_3);
18057 __Pyx_XDECREF(__pyx_t_5);
18058 __Pyx_XDECREF(__pyx_t_9);
18059 __Pyx_XDECREF(__pyx_t_10);
18060 __Pyx_XDECREF(__pyx_t_11);
18061 __Pyx_AddTraceback(
"PyClical.atanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
18064 __Pyx_XGIVEREF(__pyx_r);
18065 __Pyx_RefNannyFinishContext();
18070 static PyObject *__pyx_pw_8PyClical_73atanh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
18071 static char __pyx_doc_8PyClical_72atanh[] =
"\n Inverse hyperbolic tangent of multivector with optional complexifier.\n\n >>> s=index_set({1,2,3}); x=clifford(\"{1,2}\"); print(tanh(atanh(x,s)))\n {1,2}\n >>> x=clifford(\"{1,2}\"); print(tanh(atanh(x)))\n {1,2}\n ";
18072 static PyObject *__pyx_pw_8PyClical_73atanh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18073 PyObject *__pyx_v_obj = 0;
18074 PyObject *__pyx_v_i = 0;
18075 int __pyx_lineno = 0;
18076 const char *__pyx_filename = NULL;
18077 int __pyx_clineno = 0;
18078 PyObject *__pyx_r = 0;
18079 __Pyx_RefNannyDeclarations
18080 __Pyx_RefNannySetupContext(
"atanh (wrapper)", 0);
18082 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
18083 PyObject* values[2] = {0,0};
18084 values[1] = ((PyObject *)Py_None);
18085 if (unlikely(__pyx_kwds)) {
18086 Py_ssize_t kw_args;
18087 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
18088 switch (pos_args) {
18089 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18090 CYTHON_FALLTHROUGH;
18091 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18092 CYTHON_FALLTHROUGH;
18094 default:
goto __pyx_L5_argtuple_error;
18096 kw_args = PyDict_Size(__pyx_kwds);
18097 switch (pos_args) {
18099 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
18100 else goto __pyx_L5_argtuple_error;
18101 CYTHON_FALLTHROUGH;
18104 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
18105 if (value) { values[1] = value; kw_args--; }
18108 if (unlikely(kw_args > 0)) {
18109 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"atanh") < 0)) __PYX_ERR(0, 1797, __pyx_L3_error)
18112 switch (PyTuple_GET_SIZE(__pyx_args)) {
18113 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18114 CYTHON_FALLTHROUGH;
18115 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18117 default:
goto __pyx_L5_argtuple_error;
18120 __pyx_v_obj = values[0];
18121 __pyx_v_i = values[1];
18123 goto __pyx_L4_argument_unpacking_done;
18124 __pyx_L5_argtuple_error:;
18125 __Pyx_RaiseArgtupleInvalid(
"atanh", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1797, __pyx_L3_error)
18127 __Pyx_AddTraceback(
"PyClical.atanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
18128 __Pyx_RefNannyFinishContext();
18130 __pyx_L4_argument_unpacking_done:;
18131 __pyx_r = __pyx_pf_8PyClical_72atanh(__pyx_self, __pyx_v_obj, __pyx_v_i);
18134 __Pyx_RefNannyFinishContext();
18138 static PyObject *__pyx_pf_8PyClical_72atanh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
18139 PyObject *__pyx_r = NULL;
18140 __Pyx_RefNannyDeclarations
18141 PyObject *__pyx_t_1 = NULL;
18142 struct __pyx_opt_args_8PyClical_atanh __pyx_t_2;
18143 int __pyx_lineno = 0;
18144 const char *__pyx_filename = NULL;
18145 int __pyx_clineno = 0;
18146 __Pyx_RefNannySetupContext(
"atanh", 0);
18147 __Pyx_XDECREF(__pyx_r);
18148 __pyx_t_2.__pyx_n = 1;
18149 __pyx_t_2.i = __pyx_v_i;
18150 __pyx_t_1 = __pyx_f_8PyClical_atanh(__pyx_v_obj, 0, &__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1797, __pyx_L1_error)
18151 __Pyx_GOTREF(__pyx_t_1);
18152 __pyx_r = __pyx_t_1;
18158 __Pyx_XDECREF(__pyx_t_1);
18159 __Pyx_AddTraceback(
"PyClical.atanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
18162 __Pyx_XGIVEREF(__pyx_r);
18163 __Pyx_RefNannyFinishContext();
18175 static PyObject *__pyx_pw_8PyClical_75random_clifford(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
18176 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) {
18177 PyObject *__pyx_v_fill = ((PyObject *)__pyx_float_1_0);
18178 PyObject *__pyx_r = NULL;
18179 __Pyx_RefNannyDeclarations
18180 PyObject *__pyx_t_1 = NULL;
18181 PyObject *__pyx_t_2 = NULL;
18183 PyObject *__pyx_t_4 = NULL;
18184 int __pyx_lineno = 0;
18185 const char *__pyx_filename = NULL;
18186 int __pyx_clineno = 0;
18187 __Pyx_RefNannySetupContext(
"random_clifford", 0);
18188 if (__pyx_optional_args) {
18189 if (__pyx_optional_args->__pyx_n > 0) {
18190 __pyx_v_fill = __pyx_optional_args->fill;
18201 __Pyx_XDECREF(__pyx_r);
18202 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1821, __pyx_L1_error)
18203 __Pyx_GOTREF(__pyx_t_1);
18204 __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1821, __pyx_L1_error)
18205 __Pyx_GOTREF(__pyx_t_2);
18206 __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_fill);
if (unlikely((__pyx_t_3 == ((
scalar_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1821, __pyx_L1_error)
18207 __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, 1821, __pyx_L1_error)
18208 __Pyx_GOTREF(__pyx_t_4);
18209 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18210 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18211 __pyx_r = __pyx_t_4;
18225 __Pyx_XDECREF(__pyx_t_1);
18226 __Pyx_XDECREF(__pyx_t_2);
18227 __Pyx_XDECREF(__pyx_t_4);
18228 __Pyx_AddTraceback(
"PyClical.random_clifford", __pyx_clineno, __pyx_lineno, __pyx_filename);
18231 __Pyx_XGIVEREF(__pyx_r);
18232 __Pyx_RefNannyFinishContext();
18237 static PyObject *__pyx_pw_8PyClical_75random_clifford(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
18238 static char __pyx_doc_8PyClical_74random_clifford[] =
"\n Random multivector within a frame.\n\n >>> print(random_clifford(index_set({-3,-1,2})).frame())\n {-3,-1,2}\n ";
18239 static PyObject *__pyx_pw_8PyClical_75random_clifford(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18240 struct __pyx_obj_8PyClical_index_set *__pyx_v_ixt = 0;
18241 PyObject *__pyx_v_fill = 0;
18242 int __pyx_lineno = 0;
18243 const char *__pyx_filename = NULL;
18244 int __pyx_clineno = 0;
18245 PyObject *__pyx_r = 0;
18246 __Pyx_RefNannyDeclarations
18247 __Pyx_RefNannySetupContext(
"random_clifford (wrapper)", 0);
18249 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ixt,&__pyx_n_s_fill,0};
18250 PyObject* values[2] = {0,0};
18251 values[1] = ((PyObject *)__pyx_float_1_0);
18252 if (unlikely(__pyx_kwds)) {
18253 Py_ssize_t kw_args;
18254 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
18255 switch (pos_args) {
18256 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18257 CYTHON_FALLTHROUGH;
18258 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18259 CYTHON_FALLTHROUGH;
18261 default:
goto __pyx_L5_argtuple_error;
18263 kw_args = PyDict_Size(__pyx_kwds);
18264 switch (pos_args) {
18266 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ixt)) != 0)) kw_args--;
18267 else goto __pyx_L5_argtuple_error;
18268 CYTHON_FALLTHROUGH;
18271 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fill);
18272 if (value) { values[1] = value; kw_args--; }
18275 if (unlikely(kw_args > 0)) {
18276 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"random_clifford") < 0)) __PYX_ERR(0, 1814, __pyx_L3_error)
18279 switch (PyTuple_GET_SIZE(__pyx_args)) {
18280 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18281 CYTHON_FALLTHROUGH;
18282 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18284 default:
goto __pyx_L5_argtuple_error;
18287 __pyx_v_ixt = ((
struct __pyx_obj_8PyClical_index_set *)values[0]);
18288 __pyx_v_fill = values[1];
18290 goto __pyx_L4_argument_unpacking_done;
18291 __pyx_L5_argtuple_error:;
18292 __Pyx_RaiseArgtupleInvalid(
"random_clifford", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1814, __pyx_L3_error)
18294 __Pyx_AddTraceback(
"PyClical.random_clifford", __pyx_clineno, __pyx_lineno, __pyx_filename);
18295 __Pyx_RefNannyFinishContext();
18297 __pyx_L4_argument_unpacking_done:;
18298 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ixt), __pyx_ptype_8PyClical_index_set, 1,
"ixt", 0))) __PYX_ERR(0, 1814, __pyx_L1_error)
18299 __pyx_r = __pyx_pf_8PyClical_74random_clifford(__pyx_self, __pyx_v_ixt, __pyx_v_fill);
18306 __Pyx_RefNannyFinishContext();
18310 static PyObject *__pyx_pf_8PyClical_74random_clifford(CYTHON_UNUSED PyObject *__pyx_self,
struct __pyx_obj_8PyClical_index_set *__pyx_v_ixt, PyObject *__pyx_v_fill) {
18311 PyObject *__pyx_r = NULL;
18312 __Pyx_RefNannyDeclarations
18313 PyObject *__pyx_t_1 = NULL;
18314 struct __pyx_opt_args_8PyClical_random_clifford __pyx_t_2;
18315 int __pyx_lineno = 0;
18316 const char *__pyx_filename = NULL;
18317 int __pyx_clineno = 0;
18318 __Pyx_RefNannySetupContext(
"random_clifford", 0);
18319 __Pyx_XDECREF(__pyx_r);
18320 __pyx_t_2.__pyx_n = 1;
18321 __pyx_t_2.fill = __pyx_v_fill;
18322 __pyx_t_1 = __pyx_f_8PyClical_random_clifford(__pyx_v_ixt, 0, &__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1814, __pyx_L1_error)
18323 __Pyx_GOTREF(__pyx_t_1);
18324 __pyx_r = __pyx_t_1;
18330 __Pyx_XDECREF(__pyx_t_1);
18331 __Pyx_AddTraceback(
"PyClical.random_clifford", __pyx_clineno, __pyx_lineno, __pyx_filename);
18334 __Pyx_XGIVEREF(__pyx_r);
18335 __Pyx_RefNannyFinishContext();
18347 static PyObject *__pyx_pw_8PyClical_77cga3(PyObject *__pyx_self, PyObject *__pyx_v_obj);
18348 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cga3(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
18349 PyObject *__pyx_r = NULL;
18350 __Pyx_RefNannyDeclarations
18351 PyObject *__pyx_t_1 = NULL;
18352 PyObject *__pyx_t_2 = NULL;
18353 int __pyx_lineno = 0;
18354 const char *__pyx_filename = NULL;
18355 int __pyx_clineno = 0;
18356 __Pyx_RefNannySetupContext(
"cga3", 0);
18365 __Pyx_XDECREF(__pyx_r);
18366 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1830, __pyx_L1_error)
18367 __Pyx_GOTREF(__pyx_t_1);
18368 __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, 1830, __pyx_L1_error)
18369 __Pyx_GOTREF(__pyx_t_2);
18370 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18371 __pyx_r = __pyx_t_2;
18385 __Pyx_XDECREF(__pyx_t_1);
18386 __Pyx_XDECREF(__pyx_t_2);
18387 __Pyx_AddTraceback(
"PyClical.cga3", __pyx_clineno, __pyx_lineno, __pyx_filename);
18390 __Pyx_XGIVEREF(__pyx_r);
18391 __Pyx_RefNannyFinishContext();
18396 static PyObject *__pyx_pw_8PyClical_77cga3(PyObject *__pyx_self, PyObject *__pyx_v_obj);
18397 static char __pyx_doc_8PyClical_76cga3[] =
"\n Convert Euclidean 3D multivector to Conformal Geometric Algebra using Doran and Lasenby definition.\n\n >>> x=clifford(\"2{1}+9{2}+{3}\"); print(cga3(x))\n 87{-1}+4{1}+18{2}+2{3}+85{4}\n ";
18398 static PyObject *__pyx_pw_8PyClical_77cga3(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18399 PyObject *__pyx_r = 0;
18400 __Pyx_RefNannyDeclarations
18401 __Pyx_RefNannySetupContext(
"cga3 (wrapper)", 0);
18402 __pyx_r = __pyx_pf_8PyClical_76cga3(__pyx_self, ((PyObject *)__pyx_v_obj));
18405 __Pyx_RefNannyFinishContext();
18409 static PyObject *__pyx_pf_8PyClical_76cga3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18410 PyObject *__pyx_r = NULL;
18411 __Pyx_RefNannyDeclarations
18412 PyObject *__pyx_t_1 = NULL;
18413 int __pyx_lineno = 0;
18414 const char *__pyx_filename = NULL;
18415 int __pyx_clineno = 0;
18416 __Pyx_RefNannySetupContext(
"cga3", 0);
18417 __Pyx_XDECREF(__pyx_r);
18418 __pyx_t_1 = __pyx_f_8PyClical_cga3(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1823, __pyx_L1_error)
18419 __Pyx_GOTREF(__pyx_t_1);
18420 __pyx_r = __pyx_t_1;
18426 __Pyx_XDECREF(__pyx_t_1);
18427 __Pyx_AddTraceback(
"PyClical.cga3", __pyx_clineno, __pyx_lineno, __pyx_filename);
18430 __Pyx_XGIVEREF(__pyx_r);
18431 __Pyx_RefNannyFinishContext();
18443 static PyObject *__pyx_pw_8PyClical_79cga3std(PyObject *__pyx_self, PyObject *__pyx_v_obj);
18444 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cga3std(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
18445 PyObject *__pyx_r = NULL;
18446 __Pyx_RefNannyDeclarations
18447 PyObject *__pyx_t_1 = NULL;
18448 PyObject *__pyx_t_2 = NULL;
18449 int __pyx_lineno = 0;
18450 const char *__pyx_filename = NULL;
18451 int __pyx_clineno = 0;
18452 __Pyx_RefNannySetupContext(
"cga3std", 0);
18461 __Pyx_XDECREF(__pyx_r);
18462 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1841, __pyx_L1_error)
18463 __Pyx_GOTREF(__pyx_t_1);
18464 __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, 1841, __pyx_L1_error)
18465 __Pyx_GOTREF(__pyx_t_2);
18466 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18467 __pyx_r = __pyx_t_2;
18481 __Pyx_XDECREF(__pyx_t_1);
18482 __Pyx_XDECREF(__pyx_t_2);
18483 __Pyx_AddTraceback(
"PyClical.cga3std", __pyx_clineno, __pyx_lineno, __pyx_filename);
18486 __Pyx_XGIVEREF(__pyx_r);
18487 __Pyx_RefNannyFinishContext();
18492 static PyObject *__pyx_pw_8PyClical_79cga3std(PyObject *__pyx_self, PyObject *__pyx_v_obj);
18493 static char __pyx_doc_8PyClical_78cga3std[] =
"\n Convert CGA3 null vector to standard conformal null vector using Doran and Lasenby definition.\n\n >>> x=clifford(\"2{1}+9{2}+{3}\"); print(cga3std(cga3(x)))\n 87{-1}+4{1}+18{2}+2{3}+85{4}\n >>> x=clifford(\"2{1}+9{2}+{3}\"); print(cga3std(cga3(x))-cga3(x))\n 0\n ";
18494 static PyObject *__pyx_pw_8PyClical_79cga3std(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18495 PyObject *__pyx_r = 0;
18496 __Pyx_RefNannyDeclarations
18497 __Pyx_RefNannySetupContext(
"cga3std (wrapper)", 0);
18498 __pyx_r = __pyx_pf_8PyClical_78cga3std(__pyx_self, ((PyObject *)__pyx_v_obj));
18501 __Pyx_RefNannyFinishContext();
18505 static PyObject *__pyx_pf_8PyClical_78cga3std(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18506 PyObject *__pyx_r = NULL;
18507 __Pyx_RefNannyDeclarations
18508 PyObject *__pyx_t_1 = NULL;
18509 int __pyx_lineno = 0;
18510 const char *__pyx_filename = NULL;
18511 int __pyx_clineno = 0;
18512 __Pyx_RefNannySetupContext(
"cga3std", 0);
18513 __Pyx_XDECREF(__pyx_r);
18514 __pyx_t_1 = __pyx_f_8PyClical_cga3std(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1832, __pyx_L1_error)
18515 __Pyx_GOTREF(__pyx_t_1);
18516 __pyx_r = __pyx_t_1;
18522 __Pyx_XDECREF(__pyx_t_1);
18523 __Pyx_AddTraceback(
"PyClical.cga3std", __pyx_clineno, __pyx_lineno, __pyx_filename);
18526 __Pyx_XGIVEREF(__pyx_r);
18527 __Pyx_RefNannyFinishContext();
18539 static PyObject *__pyx_pw_8PyClical_81agc3(PyObject *__pyx_self, PyObject *__pyx_v_obj);
18540 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_agc3(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
18541 PyObject *__pyx_r = NULL;
18542 __Pyx_RefNannyDeclarations
18543 PyObject *__pyx_t_1 = NULL;
18544 PyObject *__pyx_t_2 = NULL;
18545 int __pyx_lineno = 0;
18546 const char *__pyx_filename = NULL;
18547 int __pyx_clineno = 0;
18548 __Pyx_RefNannySetupContext(
"agc3", 0);
18557 __Pyx_XDECREF(__pyx_r);
18558 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1852, __pyx_L1_error)
18559 __Pyx_GOTREF(__pyx_t_1);
18560 __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, 1852, __pyx_L1_error)
18561 __Pyx_GOTREF(__pyx_t_2);
18562 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18563 __pyx_r = __pyx_t_2;
18577 __Pyx_XDECREF(__pyx_t_1);
18578 __Pyx_XDECREF(__pyx_t_2);
18579 __Pyx_AddTraceback(
"PyClical.agc3", __pyx_clineno, __pyx_lineno, __pyx_filename);
18582 __Pyx_XGIVEREF(__pyx_r);
18583 __Pyx_RefNannyFinishContext();
18588 static PyObject *__pyx_pw_8PyClical_81agc3(PyObject *__pyx_self, PyObject *__pyx_v_obj);
18589 static char __pyx_doc_8PyClical_80agc3[] =
"\n Convert CGA3 null vector to Euclidean 3D vector using Doran and Lasenby definition.\n\n >>> x=clifford(\"2{1}+9{2}+{3}\"); print(agc3(cga3(x)))\n 2{1}+9{2}+{3}\n >>> x=clifford(\"2{1}+9{2}+{3}\"); print(agc3(cga3(x))-x)\n 0\n ";
18590 static PyObject *__pyx_pw_8PyClical_81agc3(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18591 PyObject *__pyx_r = 0;
18592 __Pyx_RefNannyDeclarations
18593 __Pyx_RefNannySetupContext(
"agc3 (wrapper)", 0);
18594 __pyx_r = __pyx_pf_8PyClical_80agc3(__pyx_self, ((PyObject *)__pyx_v_obj));
18597 __Pyx_RefNannyFinishContext();
18601 static PyObject *__pyx_pf_8PyClical_80agc3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18602 PyObject *__pyx_r = NULL;
18603 __Pyx_RefNannyDeclarations
18604 PyObject *__pyx_t_1 = NULL;
18605 int __pyx_lineno = 0;
18606 const char *__pyx_filename = NULL;
18607 int __pyx_clineno = 0;
18608 __Pyx_RefNannySetupContext(
"agc3", 0);
18609 __Pyx_XDECREF(__pyx_r);
18610 __pyx_t_1 = __pyx_f_8PyClical_agc3(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1843, __pyx_L1_error)
18611 __Pyx_GOTREF(__pyx_t_1);
18612 __pyx_r = __pyx_t_1;
18618 __Pyx_XDECREF(__pyx_t_1);
18619 __Pyx_AddTraceback(
"PyClical.agc3", __pyx_clineno, __pyx_lineno, __pyx_filename);
18622 __Pyx_XGIVEREF(__pyx_r);
18623 __Pyx_RefNannyFinishContext();
18636 static PyObject *__pyx_pw_8PyClical_83e(PyObject *__pyx_self, PyObject *__pyx_v_obj);
18637 static char __pyx_doc_8PyClical_82e[] =
"\n Abbreviation for clifford(index_set(obj)).\n\n >>> print(e(1))\n {1}\n >>> print(e(-1))\n {-1}\n >>> print(e(0))\n 1\n ";
18638 static PyMethodDef __pyx_mdef_8PyClical_83e = {
"e", (PyCFunction)__pyx_pw_8PyClical_83e, METH_O, __pyx_doc_8PyClical_82e};
18639 static PyObject *__pyx_pw_8PyClical_83e(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18640 PyObject *__pyx_r = 0;
18641 __Pyx_RefNannyDeclarations
18642 __Pyx_RefNannySetupContext(
"e (wrapper)", 0);
18643 __pyx_r = __pyx_pf_8PyClical_82e(__pyx_self, ((PyObject *)__pyx_v_obj));
18646 __Pyx_RefNannyFinishContext();
18650 static PyObject *__pyx_pf_8PyClical_82e(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18651 PyObject *__pyx_r = NULL;
18652 __Pyx_RefNannyDeclarations
18653 PyObject *__pyx_t_1 = NULL;
18654 PyObject *__pyx_t_2 = NULL;
18655 int __pyx_lineno = 0;
18656 const char *__pyx_filename = NULL;
18657 int __pyx_clineno = 0;
18658 __Pyx_RefNannySetupContext(
"e", 0);
18667 __Pyx_XDECREF(__pyx_r);
18668 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_index_set), __pyx_v_obj);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1897, __pyx_L1_error)
18669 __Pyx_GOTREF(__pyx_t_1);
18670 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1897, __pyx_L1_error)
18671 __Pyx_GOTREF(__pyx_t_2);
18672 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18673 __pyx_r = __pyx_t_2;
18687 __Pyx_XDECREF(__pyx_t_1);
18688 __Pyx_XDECREF(__pyx_t_2);
18689 __Pyx_AddTraceback(
"PyClical.e", __pyx_clineno, __pyx_lineno, __pyx_filename);
18692 __Pyx_XGIVEREF(__pyx_r);
18693 __Pyx_RefNannyFinishContext();
18706 static PyObject *__pyx_pw_8PyClical_85istpq(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
18707 static char __pyx_doc_8PyClical_84istpq[] =
"\n Abbreviation for index_set({-q,...p}).\n\n >>> print(istpq(2,3))\n {-3,-2,-1,1,2}\n ";
18708 static PyMethodDef __pyx_mdef_8PyClical_85istpq = {
"istpq", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_85istpq, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_84istpq};
18709 static PyObject *__pyx_pw_8PyClical_85istpq(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18710 PyObject *__pyx_v_p = 0;
18711 PyObject *__pyx_v_q = 0;
18712 int __pyx_lineno = 0;
18713 const char *__pyx_filename = NULL;
18714 int __pyx_clineno = 0;
18715 PyObject *__pyx_r = 0;
18716 __Pyx_RefNannyDeclarations
18717 __Pyx_RefNannySetupContext(
"istpq (wrapper)", 0);
18719 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,&__pyx_n_s_q,0};
18720 PyObject* values[2] = {0,0};
18721 if (unlikely(__pyx_kwds)) {
18722 Py_ssize_t kw_args;
18723 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
18724 switch (pos_args) {
18725 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18726 CYTHON_FALLTHROUGH;
18727 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18728 CYTHON_FALLTHROUGH;
18730 default:
goto __pyx_L5_argtuple_error;
18732 kw_args = PyDict_Size(__pyx_kwds);
18733 switch (pos_args) {
18735 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p)) != 0)) kw_args--;
18736 else goto __pyx_L5_argtuple_error;
18737 CYTHON_FALLTHROUGH;
18739 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q)) != 0)) kw_args--;
18741 __Pyx_RaiseArgtupleInvalid(
"istpq", 1, 2, 2, 1); __PYX_ERR(0, 1899, __pyx_L3_error)
18744 if (unlikely(kw_args > 0)) {
18745 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"istpq") < 0)) __PYX_ERR(0, 1899, __pyx_L3_error)
18747 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
18748 goto __pyx_L5_argtuple_error;
18750 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18751 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18753 __pyx_v_p = values[0];
18754 __pyx_v_q = values[1];
18756 goto __pyx_L4_argument_unpacking_done;
18757 __pyx_L5_argtuple_error:;
18758 __Pyx_RaiseArgtupleInvalid(
"istpq", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1899, __pyx_L3_error)
18760 __Pyx_AddTraceback(
"PyClical.istpq", __pyx_clineno, __pyx_lineno, __pyx_filename);
18761 __Pyx_RefNannyFinishContext();
18763 __pyx_L4_argument_unpacking_done:;
18764 __pyx_r = __pyx_pf_8PyClical_84istpq(__pyx_self, __pyx_v_p, __pyx_v_q);
18767 __Pyx_RefNannyFinishContext();
18771 static PyObject *__pyx_pf_8PyClical_84istpq(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_p, PyObject *__pyx_v_q) {
18772 PyObject *__pyx_r = NULL;
18773 __Pyx_RefNannyDeclarations
18774 PyObject *__pyx_t_1 = NULL;
18775 PyObject *__pyx_t_2 = NULL;
18776 PyObject *__pyx_t_3 = NULL;
18777 int __pyx_lineno = 0;
18778 const char *__pyx_filename = NULL;
18779 int __pyx_clineno = 0;
18780 __Pyx_RefNannySetupContext(
"istpq", 0);
18789 __Pyx_XDECREF(__pyx_r);
18790 __pyx_t_1 = PyNumber_Negative(__pyx_v_q);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1906, __pyx_L1_error)
18791 __Pyx_GOTREF(__pyx_t_1);
18792 __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_p, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1906, __pyx_L1_error)
18793 __Pyx_GOTREF(__pyx_t_2);
18794 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1906, __pyx_L1_error)
18795 __Pyx_GOTREF(__pyx_t_3);
18796 __Pyx_GIVEREF(__pyx_t_1);
18797 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
18798 __Pyx_GIVEREF(__pyx_t_2);
18799 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
18802 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1906, __pyx_L1_error)
18803 __Pyx_GOTREF(__pyx_t_2);
18804 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18805 __pyx_t_3 = PySet_New(__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1906, __pyx_L1_error)
18806 __Pyx_GOTREF(__pyx_t_3);
18807 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18808 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_index_set), __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1906, __pyx_L1_error)
18809 __Pyx_GOTREF(__pyx_t_2);
18810 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18811 __pyx_r = __pyx_t_2;
18825 __Pyx_XDECREF(__pyx_t_1);
18826 __Pyx_XDECREF(__pyx_t_2);
18827 __Pyx_XDECREF(__pyx_t_3);
18828 __Pyx_AddTraceback(
"PyClical.istpq", __pyx_clineno, __pyx_lineno, __pyx_filename);
18831 __Pyx_XGIVEREF(__pyx_r);
18832 __Pyx_RefNannyFinishContext();
18845 static PyObject *__pyx_pw_8PyClical_87_test(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused);
18846 static PyMethodDef __pyx_mdef_8PyClical_87_test = {
"_test", (PyCFunction)__pyx_pw_8PyClical_87_test, METH_NOARGS, 0};
18847 static PyObject *__pyx_pw_8PyClical_87_test(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
18848 PyObject *__pyx_r = 0;
18849 __Pyx_RefNannyDeclarations
18850 __Pyx_RefNannySetupContext(
"_test (wrapper)", 0);
18851 __pyx_r = __pyx_pf_8PyClical_86_test(__pyx_self);
18854 __Pyx_RefNannyFinishContext();
18858 static PyObject *__pyx_pf_8PyClical_86_test(CYTHON_UNUSED PyObject *__pyx_self) {
18859 PyObject *__pyx_v_PyClical = NULL;
18860 PyObject *__pyx_v_doctest = NULL;
18861 PyObject *__pyx_r = NULL;
18862 __Pyx_RefNannyDeclarations
18863 PyObject *__pyx_t_1 = NULL;
18864 PyObject *__pyx_t_2 = NULL;
18865 PyObject *__pyx_t_3 = NULL;
18866 int __pyx_lineno = 0;
18867 const char *__pyx_filename = NULL;
18868 int __pyx_clineno = 0;
18869 __Pyx_RefNannySetupContext(
"_test", 0);
18878 __pyx_t_1 = __Pyx_Import(__pyx_n_s_PyClical, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1913, __pyx_L1_error)
18879 __Pyx_GOTREF(__pyx_t_1);
18880 __pyx_v_PyClical = __pyx_t_1;
18882 __pyx_t_1 = __Pyx_Import(__pyx_n_s_doctest, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1913, __pyx_L1_error)
18883 __Pyx_GOTREF(__pyx_t_1);
18884 __pyx_v_doctest = __pyx_t_1;
18894 __Pyx_XDECREF(__pyx_r);
18895 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_doctest, __pyx_n_s_testmod);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1914, __pyx_L1_error)
18896 __Pyx_GOTREF(__pyx_t_2);
18898 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
18899 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
18900 if (likely(__pyx_t_3)) {
18901 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
18902 __Pyx_INCREF(__pyx_t_3);
18903 __Pyx_INCREF(
function);
18904 __Pyx_DECREF_SET(__pyx_t_2,
function);
18907 __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);
18908 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18909 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1914, __pyx_L1_error)
18910 __Pyx_GOTREF(__pyx_t_1);
18911 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18912 __pyx_r = __pyx_t_1;
18926 __Pyx_XDECREF(__pyx_t_1);
18927 __Pyx_XDECREF(__pyx_t_2);
18928 __Pyx_XDECREF(__pyx_t_3);
18929 __Pyx_AddTraceback(
"PyClical._test", __pyx_clineno, __pyx_lineno, __pyx_filename);
18932 __Pyx_XDECREF(__pyx_v_PyClical);
18933 __Pyx_XDECREF(__pyx_v_doctest);
18934 __Pyx_XGIVEREF(__pyx_r);
18935 __Pyx_RefNannyFinishContext();
18947 static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_string(std::string
const &__pyx_v_s) {
18948 PyObject *__pyx_r = NULL;
18949 __Pyx_RefNannyDeclarations
18950 PyObject *__pyx_t_1 = NULL;
18951 int __pyx_lineno = 0;
18952 const char *__pyx_filename = NULL;
18953 int __pyx_clineno = 0;
18954 __Pyx_RefNannySetupContext(
"__pyx_convert_PyObject_string_to_py_std__in_string", 0);
18963 __Pyx_XDECREF(__pyx_r);
18964 __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)
18965 __Pyx_GOTREF(__pyx_t_1);
18966 __pyx_r = __pyx_t_1;
18980 __Pyx_XDECREF(__pyx_t_1);
18981 __Pyx_AddTraceback(
"string.to_py.__pyx_convert_PyObject_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
18984 __Pyx_XGIVEREF(__pyx_r);
18985 __Pyx_RefNannyFinishContext();
18997 static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_string(std::string
const &__pyx_v_s) {
18998 PyObject *__pyx_r = NULL;
18999 __Pyx_RefNannyDeclarations
19000 PyObject *__pyx_t_1 = NULL;
19001 int __pyx_lineno = 0;
19002 const char *__pyx_filename = NULL;
19003 int __pyx_clineno = 0;
19004 __Pyx_RefNannySetupContext(
"__pyx_convert_PyUnicode_string_to_py_std__in_string", 0);
19013 __Pyx_XDECREF(__pyx_r);
19014 __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)
19015 __Pyx_GOTREF(__pyx_t_1);
19016 __pyx_r = __pyx_t_1;
19030 __Pyx_XDECREF(__pyx_t_1);
19031 __Pyx_AddTraceback(
"string.to_py.__pyx_convert_PyUnicode_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
19034 __Pyx_XGIVEREF(__pyx_r);
19035 __Pyx_RefNannyFinishContext();
19047 static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(std::string
const &__pyx_v_s) {
19048 PyObject *__pyx_r = NULL;
19049 __Pyx_RefNannyDeclarations
19050 PyObject *__pyx_t_1 = NULL;
19051 int __pyx_lineno = 0;
19052 const char *__pyx_filename = NULL;
19053 int __pyx_clineno = 0;
19054 __Pyx_RefNannySetupContext(
"__pyx_convert_PyStr_string_to_py_std__in_string", 0);
19063 __Pyx_XDECREF(__pyx_r);
19064 __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)
19065 __Pyx_GOTREF(__pyx_t_1);
19066 __pyx_r = __pyx_t_1;
19080 __Pyx_XDECREF(__pyx_t_1);
19081 __Pyx_AddTraceback(
"string.to_py.__pyx_convert_PyStr_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
19084 __Pyx_XGIVEREF(__pyx_r);
19085 __Pyx_RefNannyFinishContext();
19097 static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string(std::string
const &__pyx_v_s) {
19098 PyObject *__pyx_r = NULL;
19099 __Pyx_RefNannyDeclarations
19100 PyObject *__pyx_t_1 = NULL;
19101 int __pyx_lineno = 0;
19102 const char *__pyx_filename = NULL;
19103 int __pyx_clineno = 0;
19104 __Pyx_RefNannySetupContext(
"__pyx_convert_PyBytes_string_to_py_std__in_string", 0);
19113 __Pyx_XDECREF(__pyx_r);
19114 __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)
19115 __Pyx_GOTREF(__pyx_t_1);
19116 __pyx_r = __pyx_t_1;
19130 __Pyx_XDECREF(__pyx_t_1);
19131 __Pyx_AddTraceback(
"string.to_py.__pyx_convert_PyBytes_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
19134 __Pyx_XGIVEREF(__pyx_r);
19135 __Pyx_RefNannyFinishContext();
19147 static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_string(std::string
const &__pyx_v_s) {
19148 PyObject *__pyx_r = NULL;
19149 __Pyx_RefNannyDeclarations
19150 PyObject *__pyx_t_1 = NULL;
19151 int __pyx_lineno = 0;
19152 const char *__pyx_filename = NULL;
19153 int __pyx_clineno = 0;
19154 __Pyx_RefNannySetupContext(
"__pyx_convert_PyByteArray_string_to_py_std__in_string", 0);
19162 __Pyx_XDECREF(__pyx_r);
19163 __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)
19164 __Pyx_GOTREF(__pyx_t_1);
19165 __pyx_r = __pyx_t_1;
19179 __Pyx_XDECREF(__pyx_t_1);
19180 __Pyx_AddTraceback(
"string.to_py.__pyx_convert_PyByteArray_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
19183 __Pyx_XGIVEREF(__pyx_r);
19184 __Pyx_RefNannyFinishContext();
19187 static struct __pyx_vtabstruct_8PyClical_index_set __pyx_vtable_8PyClical_index_set;
19189 static PyObject *__pyx_tp_new_8PyClical_index_set(PyTypeObject *t, PyObject *a, PyObject *k) {
19190 struct __pyx_obj_8PyClical_index_set *p;
19192 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
19193 o = (*t->tp_alloc)(t, 0);
19195 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
19197 if (unlikely(!o))
return 0;
19198 p = ((
struct __pyx_obj_8PyClical_index_set *)o);
19199 p->__pyx_vtab = __pyx_vtabptr_8PyClical_index_set;
19200 if (unlikely(__pyx_pw_8PyClical_9index_set_3__cinit__(o, a, k) < 0))
goto bad;
19203 Py_DECREF(o); o = 0;
19207 static void __pyx_tp_dealloc_8PyClical_index_set(PyObject *o) {
19208 #if CYTHON_USE_TP_FINALIZE
19209 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))) {
19210 if (PyObject_CallFinalizerFromDealloc(o))
return;
19214 PyObject *etype, *eval, *etb;
19215 PyErr_Fetch(&etype, &eval, &etb);
19216 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
19217 __pyx_pw_8PyClical_9index_set_5__dealloc__(o);
19218 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
19219 PyErr_Restore(etype, eval, etb);
19221 (*Py_TYPE(o)->tp_free)(o);
19223 static PyObject *__pyx_sq_item_8PyClical_index_set(PyObject *o, Py_ssize_t
i) {
19225 PyObject *x = PyInt_FromSsize_t(
i);
if(!x)
return 0;
19226 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
19231 static int __pyx_mp_ass_subscript_8PyClical_index_set(PyObject *o, PyObject *
i, PyObject *v) {
19233 return __pyx_pw_8PyClical_9index_set_9__setitem__(o,
i, v);
19236 PyErr_Format(PyExc_NotImplementedError,
19237 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
19242 static PyMethodDef __pyx_methods_8PyClical_index_set[] = {
19243 {
"copy", (PyCFunction)__pyx_pw_8PyClical_9index_set_1copy, METH_NOARGS, __pyx_doc_8PyClical_9index_set_copy},
19244 {
"count", (PyCFunction)__pyx_pw_8PyClical_9index_set_32count, METH_NOARGS, __pyx_doc_8PyClical_9index_set_31count},
19245 {
"count_neg", (PyCFunction)__pyx_pw_8PyClical_9index_set_34count_neg, METH_NOARGS, __pyx_doc_8PyClical_9index_set_33count_neg},
19246 {
"count_pos", (PyCFunction)__pyx_pw_8PyClical_9index_set_36count_pos, METH_NOARGS, __pyx_doc_8PyClical_9index_set_35count_pos},
19247 {
"min", (PyCFunction)__pyx_pw_8PyClical_9index_set_38min, METH_NOARGS, __pyx_doc_8PyClical_9index_set_37min},
19248 {
"max", (PyCFunction)__pyx_pw_8PyClical_9index_set_40max, METH_NOARGS, __pyx_doc_8PyClical_9index_set_39max},
19249 {
"hash_fn", (PyCFunction)__pyx_pw_8PyClical_9index_set_42hash_fn, METH_NOARGS, __pyx_doc_8PyClical_9index_set_41hash_fn},
19250 {
"sign_of_mult", (PyCFunction)__pyx_pw_8PyClical_9index_set_44sign_of_mult, METH_O, __pyx_doc_8PyClical_9index_set_43sign_of_mult},
19251 {
"sign_of_square", (PyCFunction)__pyx_pw_8PyClical_9index_set_46sign_of_square, METH_NOARGS, __pyx_doc_8PyClical_9index_set_45sign_of_square},
19252 {
"__reduce_cython__", (PyCFunction)__pyx_pw_8PyClical_9index_set_52__reduce_cython__, METH_NOARGS, 0},
19253 {
"__setstate_cython__", (PyCFunction)__pyx_pw_8PyClical_9index_set_54__setstate_cython__, METH_O, 0},
19257 static PyNumberMethods __pyx_tp_as_number_index_set = {
19261 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
19271 __pyx_pw_8PyClical_9index_set_18__invert__,
19274 __pyx_pw_8PyClical_9index_set_24__and__,
19275 __pyx_pw_8PyClical_9index_set_20__xor__,
19276 __pyx_pw_8PyClical_9index_set_28__or__,
19277 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
19281 #if PY_MAJOR_VERSION < 3
19287 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
19290 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
19296 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
19303 __pyx_pw_8PyClical_9index_set_26__iand__,
19304 __pyx_pw_8PyClical_9index_set_22__ixor__,
19305 __pyx_pw_8PyClical_9index_set_30__ior__,
19311 #if PY_VERSION_HEX >= 0x03050000
19314 #if PY_VERSION_HEX >= 0x03050000
19319 static PySequenceMethods __pyx_tp_as_sequence_index_set = {
19323 __pyx_sq_item_8PyClical_index_set,
19327 __pyx_pw_8PyClical_9index_set_13__contains__,
19332 static PyMappingMethods __pyx_tp_as_mapping_index_set = {
19334 __pyx_pw_8PyClical_9index_set_11__getitem__,
19335 __pyx_mp_ass_subscript_8PyClical_index_set,
19338 static PyTypeObject __pyx_type_8PyClical_index_set = {
19339 PyVarObject_HEAD_INIT(0, 0)
19340 "PyClical.index_set",
19341 sizeof(
struct __pyx_obj_8PyClical_index_set),
19343 __pyx_tp_dealloc_8PyClical_index_set,
19344 #if PY_VERSION_HEX < 0x030800b4
19347 #if PY_VERSION_HEX >= 0x030800b4
19352 #if PY_MAJOR_VERSION < 3
19355 #if PY_MAJOR_VERSION >= 3
19358 __pyx_pw_8PyClical_9index_set_48__repr__,
19359 &__pyx_tp_as_number_index_set,
19360 &__pyx_tp_as_sequence_index_set,
19361 &__pyx_tp_as_mapping_index_set,
19364 __pyx_pw_8PyClical_9index_set_50__str__,
19368 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
19369 "\n Python class index_set wraps C++ class IndexSet.\n ",
19372 __pyx_pw_8PyClical_9index_set_7__richcmp__,
19374 __pyx_pw_8PyClical_9index_set_15__iter__,
19376 __pyx_methods_8PyClical_index_set,
19386 __pyx_tp_new_8PyClical_index_set,
19396 #if PY_VERSION_HEX >= 0x030400a1
19399 #if PY_VERSION_HEX >= 0x030800b1
19402 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
19406 static struct __pyx_vtabstruct_8PyClical_clifford __pyx_vtable_8PyClical_clifford;
19408 static PyObject *__pyx_tp_new_8PyClical_clifford(PyTypeObject *t, PyObject *a, PyObject *k) {
19409 struct __pyx_obj_8PyClical_clifford *p;
19411 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
19412 o = (*t->tp_alloc)(t, 0);
19414 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
19416 if (unlikely(!o))
return 0;
19417 p = ((
struct __pyx_obj_8PyClical_clifford *)o);
19418 p->__pyx_vtab = __pyx_vtabptr_8PyClical_clifford;
19419 if (unlikely(__pyx_pw_8PyClical_8clifford_3__cinit__(o, a, k) < 0))
goto bad;
19422 Py_DECREF(o); o = 0;
19426 static void __pyx_tp_dealloc_8PyClical_clifford(PyObject *o) {
19427 #if CYTHON_USE_TP_FINALIZE
19428 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))) {
19429 if (PyObject_CallFinalizerFromDealloc(o))
return;
19433 PyObject *etype, *eval, *etb;
19434 PyErr_Fetch(&etype, &eval, &etb);
19435 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
19436 __pyx_pw_8PyClical_8clifford_5__dealloc__(o);
19437 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
19438 PyErr_Restore(etype, eval, etb);
19440 (*Py_TYPE(o)->tp_free)(o);
19442 static PyObject *__pyx_sq_item_8PyClical_clifford(PyObject *o, Py_ssize_t
i) {
19444 PyObject *x = PyInt_FromSsize_t(
i);
if(!x)
return 0;
19445 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
19450 static PyMethodDef __pyx_methods_8PyClical_clifford[] = {
19451 {
"copy", (PyCFunction)__pyx_pw_8PyClical_8clifford_1copy, METH_NOARGS, __pyx_doc_8PyClical_8clifford_copy},
19452 {
"reframe", (PyCFunction)__pyx_pw_8PyClical_8clifford_11reframe, METH_O, __pyx_doc_8PyClical_8clifford_10reframe},
19453 {
"inv", (PyCFunction)__pyx_pw_8PyClical_8clifford_49inv, METH_NOARGS, __pyx_doc_8PyClical_8clifford_48inv},
19454 {
"pow", (PyCFunction)__pyx_pw_8PyClical_8clifford_57pow, METH_O, __pyx_doc_8PyClical_8clifford_56pow},
19455 {
"outer_pow", (PyCFunction)__pyx_pw_8PyClical_8clifford_59outer_pow, METH_O, __pyx_doc_8PyClical_8clifford_58outer_pow},
19456 {
"scalar", (PyCFunction)__pyx_pw_8PyClical_8clifford_63scalar, METH_NOARGS, __pyx_doc_8PyClical_8clifford_62scalar},
19457 {
"pure", (PyCFunction)__pyx_pw_8PyClical_8clifford_65pure, METH_NOARGS, __pyx_doc_8PyClical_8clifford_64pure},
19458 {
"even", (PyCFunction)__pyx_pw_8PyClical_8clifford_67even, METH_NOARGS, __pyx_doc_8PyClical_8clifford_66even},
19459 {
"odd", (PyCFunction)__pyx_pw_8PyClical_8clifford_69odd, METH_NOARGS, __pyx_doc_8PyClical_8clifford_68odd},
19460 {
"vector_part", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_8clifford_71vector_part, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_8clifford_70vector_part},
19461 {
"involute", (PyCFunction)__pyx_pw_8PyClical_8clifford_73involute, METH_NOARGS, __pyx_doc_8PyClical_8clifford_72involute},
19462 {
"reverse", (PyCFunction)__pyx_pw_8PyClical_8clifford_75reverse, METH_NOARGS, __pyx_doc_8PyClical_8clifford_74reverse},
19463 {
"conj", (PyCFunction)__pyx_pw_8PyClical_8clifford_77conj, METH_NOARGS, __pyx_doc_8PyClical_8clifford_76conj},
19464 {
"quad", (PyCFunction)__pyx_pw_8PyClical_8clifford_79quad, METH_NOARGS, __pyx_doc_8PyClical_8clifford_78quad},
19465 {
"norm", (PyCFunction)__pyx_pw_8PyClical_8clifford_81norm, METH_NOARGS, __pyx_doc_8PyClical_8clifford_80norm},
19466 {
"abs", (PyCFunction)__pyx_pw_8PyClical_8clifford_83abs, METH_NOARGS, __pyx_doc_8PyClical_8clifford_82abs},
19467 {
"max_abs", (PyCFunction)__pyx_pw_8PyClical_8clifford_85max_abs, METH_NOARGS, __pyx_doc_8PyClical_8clifford_84max_abs},
19468 {
"truncated", (PyCFunction)__pyx_pw_8PyClical_8clifford_87truncated, METH_O, __pyx_doc_8PyClical_8clifford_86truncated},
19469 {
"isnan", (PyCFunction)__pyx_pw_8PyClical_8clifford_89isnan, METH_NOARGS, __pyx_doc_8PyClical_8clifford_88isnan},
19470 {
"frame", (PyCFunction)__pyx_pw_8PyClical_8clifford_91frame, METH_NOARGS, __pyx_doc_8PyClical_8clifford_90frame},
19471 {
"__reduce_cython__", (PyCFunction)__pyx_pw_8PyClical_8clifford_97__reduce_cython__, METH_NOARGS, 0},
19472 {
"__setstate_cython__", (PyCFunction)__pyx_pw_8PyClical_8clifford_99__setstate_cython__, METH_O, 0},
19476 static PyNumberMethods __pyx_tp_as_number_clifford = {
19477 __pyx_pw_8PyClical_8clifford_21__add__,
19478 __pyx_pw_8PyClical_8clifford_25__sub__,
19479 __pyx_pw_8PyClical_8clifford_29__mul__,
19480 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
19483 __pyx_pw_8PyClical_8clifford_33__mod__,
19485 __pyx_pw_8PyClical_8clifford_55__pow__,
19486 __pyx_pw_8PyClical_8clifford_17__neg__,
19487 __pyx_pw_8PyClical_8clifford_19__pos__,
19493 __pyx_pw_8PyClical_8clifford_37__and__,
19494 __pyx_pw_8PyClical_8clifford_41__xor__,
19495 __pyx_pw_8PyClical_8clifford_51__or__,
19496 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
19500 #if PY_MAJOR_VERSION < 3
19506 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
19509 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
19512 __pyx_pw_8PyClical_8clifford_23__iadd__,
19513 __pyx_pw_8PyClical_8clifford_27__isub__,
19514 __pyx_pw_8PyClical_8clifford_31__imul__,
19515 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
19516 __pyx_pw_8PyClical_8clifford_47__idiv__,
19518 __pyx_pw_8PyClical_8clifford_35__imod__,
19522 __pyx_pw_8PyClical_8clifford_39__iand__,
19523 __pyx_pw_8PyClical_8clifford_43__ixor__,
19524 __pyx_pw_8PyClical_8clifford_53__ior__,
19526 __pyx_pw_8PyClical_8clifford_45__truediv__,
19530 #if PY_VERSION_HEX >= 0x03050000
19533 #if PY_VERSION_HEX >= 0x03050000
19538 static PySequenceMethods __pyx_tp_as_sequence_clifford = {
19542 __pyx_sq_item_8PyClical_clifford,
19546 __pyx_pw_8PyClical_8clifford_7__contains__,
19551 static PyMappingMethods __pyx_tp_as_mapping_clifford = {
19553 __pyx_pw_8PyClical_8clifford_15__getitem__,
19557 static PyTypeObject __pyx_type_8PyClical_clifford = {
19558 PyVarObject_HEAD_INIT(0, 0)
19559 "PyClical.clifford",
19560 sizeof(
struct __pyx_obj_8PyClical_clifford),
19562 __pyx_tp_dealloc_8PyClical_clifford,
19563 #if PY_VERSION_HEX < 0x030800b4
19566 #if PY_VERSION_HEX >= 0x030800b4
19571 #if PY_MAJOR_VERSION < 3
19574 #if PY_MAJOR_VERSION >= 3
19577 __pyx_pw_8PyClical_8clifford_93__repr__,
19578 &__pyx_tp_as_number_clifford,
19579 &__pyx_tp_as_sequence_clifford,
19580 &__pyx_tp_as_mapping_clifford,
19582 __pyx_pw_8PyClical_8clifford_61__call__,
19583 __pyx_pw_8PyClical_8clifford_95__str__,
19587 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
19588 "\n Python class clifford wraps C++ class Clifford.\n ",
19591 __pyx_pw_8PyClical_8clifford_13__richcmp__,
19593 __pyx_pw_8PyClical_8clifford_9__iter__,
19595 __pyx_methods_8PyClical_clifford,
19605 __pyx_tp_new_8PyClical_clifford,
19615 #if PY_VERSION_HEX >= 0x030400a1
19618 #if PY_VERSION_HEX >= 0x030800b1
19621 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
19626 static struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *__pyx_freelist_8PyClical___pyx_scope_struct____iter__[8];
19627 static int __pyx_freecount_8PyClical___pyx_scope_struct____iter__ = 0;
19629 static PyObject *__pyx_tp_new_8PyClical___pyx_scope_struct____iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
19631 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__)))) {
19632 o = (PyObject*)__pyx_freelist_8PyClical___pyx_scope_struct____iter__[--__pyx_freecount_8PyClical___pyx_scope_struct____iter__];
19633 memset(o, 0,
sizeof(
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__));
19634 (void) PyObject_INIT(o, t);
19635 PyObject_GC_Track(o);
19637 o = (*t->tp_alloc)(t, 0);
19638 if (unlikely(!o))
return 0;
19643 static void __pyx_tp_dealloc_8PyClical___pyx_scope_struct____iter__(PyObject *o) {
19644 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *p = (
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)o;
19645 PyObject_GC_UnTrack(o);
19646 Py_CLEAR(p->__pyx_v_idx);
19647 Py_CLEAR(p->__pyx_v_self);
19648 Py_CLEAR(p->__pyx_t_0);
19649 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__)))) {
19650 __pyx_freelist_8PyClical___pyx_scope_struct____iter__[__pyx_freecount_8PyClical___pyx_scope_struct____iter__++] = ((
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)o);
19652 (*Py_TYPE(o)->tp_free)(o);
19656 static int __pyx_tp_traverse_8PyClical___pyx_scope_struct____iter__(PyObject *o, visitproc v,
void *a) {
19658 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *p = (
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)o;
19659 if (p->__pyx_v_idx) {
19660 e = (*v)(p->__pyx_v_idx, a);
if (
e)
return e;
19662 if (p->__pyx_v_self) {
19663 e = (*v)(((PyObject *)p->__pyx_v_self), a);
if (
e)
return e;
19665 if (p->__pyx_t_0) {
19666 e = (*v)(p->__pyx_t_0, a);
if (
e)
return e;
19671 static PyTypeObject __pyx_type_8PyClical___pyx_scope_struct____iter__ = {
19672 PyVarObject_HEAD_INIT(0, 0)
19673 "PyClical.__pyx_scope_struct____iter__",
19674 sizeof(
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__),
19676 __pyx_tp_dealloc_8PyClical___pyx_scope_struct____iter__,
19677 #if PY_VERSION_HEX < 0x030800b4
19680 #if PY_VERSION_HEX >= 0x030800b4
19685 #if PY_MAJOR_VERSION < 3
19688 #if PY_MAJOR_VERSION >= 3
19701 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
19703 __pyx_tp_traverse_8PyClical___pyx_scope_struct____iter__,
19719 __pyx_tp_new_8PyClical___pyx_scope_struct____iter__,
19729 #if PY_VERSION_HEX >= 0x030400a1
19732 #if PY_VERSION_HEX >= 0x030800b1
19735 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
19740 static PyMethodDef __pyx_methods[] = {
19741 {
"compare", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_3compare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_2compare},
19742 {
"min_neg", (PyCFunction)__pyx_pw_8PyClical_5min_neg, METH_O, __pyx_doc_8PyClical_4min_neg},
19743 {
"max_pos", (PyCFunction)__pyx_pw_8PyClical_7max_pos, METH_O, __pyx_doc_8PyClical_6max_pos},
19744 {
"inv", (PyCFunction)__pyx_pw_8PyClical_11inv, METH_O, __pyx_doc_8PyClical_10inv},
19745 {
"scalar", (PyCFunction)__pyx_pw_8PyClical_13scalar, METH_O, __pyx_doc_8PyClical_12scalar},
19746 {
"real", (PyCFunction)__pyx_pw_8PyClical_15real, METH_O, __pyx_doc_8PyClical_14real},
19747 {
"imag", (PyCFunction)__pyx_pw_8PyClical_17imag, METH_O, __pyx_doc_8PyClical_16imag},
19748 {
"pure", (PyCFunction)__pyx_pw_8PyClical_19pure, METH_O, __pyx_doc_8PyClical_18pure},
19749 {
"even", (PyCFunction)__pyx_pw_8PyClical_21even, METH_O, __pyx_doc_8PyClical_20even},
19750 {
"odd", (PyCFunction)__pyx_pw_8PyClical_23odd, METH_O, __pyx_doc_8PyClical_22odd},
19751 {
"involute", (PyCFunction)__pyx_pw_8PyClical_25involute, METH_O, __pyx_doc_8PyClical_24involute},
19752 {
"reverse", (PyCFunction)__pyx_pw_8PyClical_27reverse, METH_O, __pyx_doc_8PyClical_26reverse},
19753 {
"conj", (PyCFunction)__pyx_pw_8PyClical_29conj, METH_O, __pyx_doc_8PyClical_28conj},
19754 {
"quad", (PyCFunction)__pyx_pw_8PyClical_31quad, METH_O, __pyx_doc_8PyClical_30quad},
19755 {
"norm", (PyCFunction)__pyx_pw_8PyClical_33norm, METH_O, __pyx_doc_8PyClical_32norm},
19756 {
"abs", (PyCFunction)__pyx_pw_8PyClical_35abs, METH_O, __pyx_doc_8PyClical_34abs},
19757 {
"max_abs", (PyCFunction)__pyx_pw_8PyClical_37max_abs, METH_O, __pyx_doc_8PyClical_36max_abs},
19758 {
"pow", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_39pow, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_38pow},
19759 {
"outer_pow", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_41outer_pow, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_40outer_pow},
19760 {
"complexifier", (PyCFunction)__pyx_pw_8PyClical_43complexifier, METH_O, __pyx_doc_8PyClical_42complexifier},
19761 {
"sqrt", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_45sqrt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_44sqrt},
19762 {
"exp", (PyCFunction)__pyx_pw_8PyClical_47exp, METH_O, __pyx_doc_8PyClical_46exp},
19763 {
"log", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_49log, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_48log},
19764 {
"cos", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_51cos, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_50cos},
19765 {
"acos", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_53acos, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_52acos},
19766 {
"cosh", (PyCFunction)__pyx_pw_8PyClical_55cosh, METH_O, __pyx_doc_8PyClical_54cosh},
19767 {
"acosh", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_57acosh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_56acosh},
19768 {
"sin", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_59sin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_58sin},
19769 {
"asin", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_61asin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_60asin},
19770 {
"sinh", (PyCFunction)__pyx_pw_8PyClical_63sinh, METH_O, __pyx_doc_8PyClical_62sinh},
19771 {
"asinh", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_65asinh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_64asinh},
19772 {
"tan", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_67tan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_66tan},
19773 {
"atan", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_69atan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_68atan},
19774 {
"tanh", (PyCFunction)__pyx_pw_8PyClical_71tanh, METH_O, __pyx_doc_8PyClical_70tanh},
19775 {
"atanh", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_73atanh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_72atanh},
19776 {
"random_clifford", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_75random_clifford, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_74random_clifford},
19777 {
"cga3", (PyCFunction)__pyx_pw_8PyClical_77cga3, METH_O, __pyx_doc_8PyClical_76cga3},
19778 {
"cga3std", (PyCFunction)__pyx_pw_8PyClical_79cga3std, METH_O, __pyx_doc_8PyClical_78cga3std},
19779 {
"agc3", (PyCFunction)__pyx_pw_8PyClical_81agc3, METH_O, __pyx_doc_8PyClical_80agc3},
19783 #if PY_MAJOR_VERSION >= 3
19784 #if CYTHON_PEP489_MULTI_PHASE_INIT
19785 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
19786 static int __pyx_pymod_exec_PyClical(PyObject* module);
19787 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
19788 {Py_mod_create, (
void*)__pyx_pymod_create},
19789 {Py_mod_exec, (
void*)__pyx_pymod_exec_PyClical},
19794 static struct PyModuleDef __pyx_moduledef = {
19795 PyModuleDef_HEAD_INIT,
19798 #if CYTHON_PEP489_MULTI_PHASE_INIT
19804 #if CYTHON_PEP489_MULTI_PHASE_INIT
19805 __pyx_moduledef_slots,
19814 #ifndef CYTHON_SMALL_CODE
19815 #if defined(__clang__)
19816 #define CYTHON_SMALL_CODE
19817 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
19818 #define CYTHON_SMALL_CODE __attribute__((cold))
19820 #define CYTHON_SMALL_CODE
19824 static __Pyx_StringTabEntry __pyx_string_tab[] = {
19825 {&__pyx_kp_u_, __pyx_k_,
sizeof(__pyx_k_), 0, 1, 0, 0},
19826 {&__pyx_kp_u_0_8_4, __pyx_k_0_8_4,
sizeof(__pyx_k_0_8_4), 0, 1, 0, 0},
19827 {&__pyx_kp_u_Abbreviation_for_clifford_index, __pyx_k_Abbreviation_for_clifford_index,
sizeof(__pyx_k_Abbreviation_for_clifford_index), 0, 1, 0, 0},
19828 {&__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},
19829 {&__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},
19830 {&__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},
19831 {&__pyx_kp_u_Cannot_initialize_clifford_objec, __pyx_k_Cannot_initialize_clifford_objec,
sizeof(__pyx_k_Cannot_initialize_clifford_objec), 0, 1, 0, 0},
19832 {&__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},
19833 {&__pyx_kp_u_Cannot_reframe, __pyx_k_Cannot_reframe,
sizeof(__pyx_k_Cannot_reframe), 0, 1, 0, 0},
19834 {&__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},
19835 {&__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},
19836 {&__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},
19837 {&__pyx_kp_u_Conjugation_reverse_o_involute, __pyx_k_Conjugation_reverse_o_involute,
sizeof(__pyx_k_Conjugation_reverse_o_involute), 0, 1, 0, 0},
19838 {&__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},
19839 {&__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},
19840 {&__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},
19841 {&__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},
19842 {&__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},
19843 {&__pyx_kp_u_Convert_Euclidean_3D_multivecto, __pyx_k_Convert_Euclidean_3D_multivecto,
sizeof(__pyx_k_Convert_Euclidean_3D_multivecto), 0, 1, 0, 0},
19844 {&__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},
19845 {&__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},
19846 {&__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},
19847 {&__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},
19848 {&__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},
19849 {&__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},
19850 {&__pyx_kp_u_Geometric_difference_print_clif, __pyx_k_Geometric_difference_print_clif,
sizeof(__pyx_k_Geometric_difference_print_clif), 0, 1, 0, 0},
19851 {&__pyx_kp_u_Geometric_difference_x_clifford, __pyx_k_Geometric_difference_x_clifford,
sizeof(__pyx_k_Geometric_difference_x_clifford), 0, 1, 0, 0},
19852 {&__pyx_kp_u_Geometric_multiplicative_invers, __pyx_k_Geometric_multiplicative_invers,
sizeof(__pyx_k_Geometric_multiplicative_invers), 0, 1, 0, 0},
19853 {&__pyx_kp_u_Geometric_multiplicative_invers_2, __pyx_k_Geometric_multiplicative_invers_2,
sizeof(__pyx_k_Geometric_multiplicative_invers_2), 0, 1, 0, 0},
19854 {&__pyx_kp_u_Geometric_product_print_cliffor, __pyx_k_Geometric_product_print_cliffor,
sizeof(__pyx_k_Geometric_product_print_cliffor), 0, 1, 0, 0},
19855 {&__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},
19856 {&__pyx_kp_u_Geometric_quotient_print_cliffo, __pyx_k_Geometric_quotient_print_cliffo,
sizeof(__pyx_k_Geometric_quotient_print_cliffo), 0, 1, 0, 0},
19857 {&__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},
19858 {&__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},
19859 {&__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},
19860 {&__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},
19861 {&__pyx_kp_u_Hyperbolic_cosine_of_multivecto, __pyx_k_Hyperbolic_cosine_of_multivecto,
sizeof(__pyx_k_Hyperbolic_cosine_of_multivecto), 0, 1, 0, 0},
19862 {&__pyx_kp_u_Hyperbolic_sine_of_multivector, __pyx_k_Hyperbolic_sine_of_multivector,
sizeof(__pyx_k_Hyperbolic_sine_of_multivector), 0, 1, 0, 0},
19863 {&__pyx_kp_u_Hyperbolic_tangent_of_multivect, __pyx_k_Hyperbolic_tangent_of_multivect,
sizeof(__pyx_k_Hyperbolic_tangent_of_multivect), 0, 1, 0, 0},
19864 {&__pyx_kp_u_Imaginary_part_deprecated_alway, __pyx_k_Imaginary_part_deprecated_alway,
sizeof(__pyx_k_Imaginary_part_deprecated_alway), 0, 1, 0, 0},
19865 {&__pyx_n_s_IndexError, __pyx_k_IndexError,
sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
19866 {&__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},
19867 {&__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},
19868 {&__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},
19869 {&__pyx_n_s_Integral, __pyx_k_Integral,
sizeof(__pyx_k_Integral), 0, 0, 1, 1},
19870 {&__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},
19871 {&__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},
19872 {&__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},
19873 {&__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},
19874 {&__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},
19875 {&__pyx_kp_u_Inverse_tangent_of_multivector, __pyx_k_Inverse_tangent_of_multivector,
sizeof(__pyx_k_Inverse_tangent_of_multivector), 0, 1, 0, 0},
19876 {&__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},
19877 {&__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},
19878 {&__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},
19879 {&__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},
19880 {&__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},
19881 {&__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},
19882 {&__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},
19883 {&__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},
19884 {&__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},
19885 {&__pyx_kp_u_Natural_logarithm_of_multivecto, __pyx_k_Natural_logarithm_of_multivecto,
sizeof(__pyx_k_Natural_logarithm_of_multivecto), 0, 1, 0, 0},
19886 {&__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},
19887 {&__pyx_n_s_NotImplemented, __pyx_k_NotImplemented,
sizeof(__pyx_k_NotImplemented), 0, 0, 1, 1},
19888 {&__pyx_kp_u_Not_applicable, __pyx_k_Not_applicable,
sizeof(__pyx_k_Not_applicable), 0, 1, 0, 0},
19889 {&__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},
19890 {&__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},
19891 {&__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},
19892 {&__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},
19893 {&__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},
19894 {&__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},
19895 {&__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},
19896 {&__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},
19897 {&__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},
19898 {&__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},
19899 {&__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},
19900 {&__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},
19901 {&__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},
19902 {&__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},
19903 {&__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},
19904 {&__pyx_n_s_PyClical, __pyx_k_PyClical,
sizeof(__pyx_k_PyClical), 0, 0, 1, 1},
19905 {&__pyx_kp_s_PyClical_pyx, __pyx_k_PyClical_pyx,
sizeof(__pyx_k_PyClical_pyx), 0, 0, 1, 0},
19906 {&__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},
19907 {&__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},
19908 {&__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},
19909 {&__pyx_n_s_Real, __pyx_k_Real,
sizeof(__pyx_k_Real), 0, 0, 1, 1},
19910 {&__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},
19911 {&__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},
19912 {&__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},
19913 {&__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},
19914 {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError,
sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
19915 {&__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},
19916 {&__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},
19917 {&__pyx_n_s_Sequence, __pyx_k_Sequence,
sizeof(__pyx_k_Sequence), 0, 0, 1, 1},
19918 {&__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},
19919 {&__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},
19920 {&__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},
19921 {&__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},
19922 {&__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},
19923 {&__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},
19924 {&__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},
19925 {&__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},
19926 {&__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},
19927 {&__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},
19928 {&__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},
19929 {&__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},
19930 {&__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},
19931 {&__pyx_kp_u_Symmetric_set_difference_exclus, __pyx_k_Symmetric_set_difference_exclus,
sizeof(__pyx_k_Symmetric_set_difference_exclus), 0, 1, 0, 0},
19932 {&__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},
19933 {&__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},
19934 {&__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},
19935 {&__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},
19936 {&__pyx_kp_u_The_informal_string_representat, __pyx_k_The_informal_string_representat,
sizeof(__pyx_k_The_informal_string_representat), 0, 1, 0, 0},
19937 {&__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},
19938 {&__pyx_kp_u_The_official_string_representat, __pyx_k_The_official_string_representat,
sizeof(__pyx_k_The_official_string_representat), 0, 1, 0, 0},
19939 {&__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},
19940 {&__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},
19941 {&__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},
19942 {&__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},
19943 {&__pyx_n_s_TypeError, __pyx_k_TypeError,
sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
19944 {&__pyx_kp_u_UTF_8, __pyx_k_UTF_8,
sizeof(__pyx_k_UTF_8), 0, 1, 0, 0},
19945 {&__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},
19946 {&__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},
19947 {&__pyx_n_s_ValueError, __pyx_k_ValueError,
sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
19948 {&__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},
19949 {&__pyx_kp_u__2, __pyx_k__2,
sizeof(__pyx_k__2), 0, 1, 0, 0},
19950 {&__pyx_kp_u__5, __pyx_k__5,
sizeof(__pyx_k__5), 0, 1, 0, 0},
19951 {&__pyx_kp_u__6, __pyx_k__6,
sizeof(__pyx_k__6), 0, 1, 0, 0},
19952 {&__pyx_kp_u__7, __pyx_k__7,
sizeof(__pyx_k__7), 0, 1, 0, 0},
19953 {&__pyx_kp_u__8, __pyx_k__8,
sizeof(__pyx_k__8), 0, 1, 0, 0},
19954 {&__pyx_kp_u__9, __pyx_k__9,
sizeof(__pyx_k__9), 0, 1, 0, 0},
19955 {&__pyx_n_s_abc, __pyx_k_abc,
sizeof(__pyx_k_abc), 0, 0, 1, 1},
19956 {&__pyx_kp_u_abs_line_1472, __pyx_k_abs_line_1472,
sizeof(__pyx_k_abs_line_1472), 0, 1, 0, 0},
19957 {&__pyx_n_s_acos, __pyx_k_acos,
sizeof(__pyx_k_acos), 0, 0, 1, 1},
19958 {&__pyx_kp_u_acos_line_1618, __pyx_k_acos_line_1618,
sizeof(__pyx_k_acos_line_1618), 0, 1, 0, 0},
19959 {&__pyx_n_s_acosh, __pyx_k_acosh,
sizeof(__pyx_k_acosh), 0, 0, 1, 1},
19960 {&__pyx_kp_u_acosh_line_1655, __pyx_k_acosh_line_1655,
sizeof(__pyx_k_acosh_line_1655), 0, 1, 0, 0},
19961 {&__pyx_kp_u_agc3_line_1843, __pyx_k_agc3_line_1843,
sizeof(__pyx_k_agc3_line_1843), 0, 1, 0, 0},
19962 {&__pyx_n_s_args, __pyx_k_args,
sizeof(__pyx_k_args), 0, 0, 1, 1},
19963 {&__pyx_kp_u_as_frame, __pyx_k_as_frame,
sizeof(__pyx_k_as_frame), 0, 1, 0, 0},
19964 {&__pyx_n_s_asin, __pyx_k_asin,
sizeof(__pyx_k_asin), 0, 0, 1, 1},
19965 {&__pyx_kp_u_asin_line_1697, __pyx_k_asin_line_1697,
sizeof(__pyx_k_asin_line_1697), 0, 1, 0, 0},
19966 {&__pyx_n_s_asinh, __pyx_k_asinh,
sizeof(__pyx_k_asinh), 0, 0, 1, 1},
19967 {&__pyx_kp_u_asinh_line_1732, __pyx_k_asinh_line_1732,
sizeof(__pyx_k_asinh_line_1732), 0, 1, 0, 0},
19968 {&__pyx_n_s_atan, __pyx_k_atan,
sizeof(__pyx_k_atan), 0, 0, 1, 1},
19969 {&__pyx_kp_u_atan_line_1768, __pyx_k_atan_line_1768,
sizeof(__pyx_k_atan_line_1768), 0, 1, 0, 0},
19970 {&__pyx_n_s_atanh, __pyx_k_atanh,
sizeof(__pyx_k_atanh), 0, 0, 1, 1},
19971 {&__pyx_kp_u_atanh_line_1797, __pyx_k_atanh_line_1797,
sizeof(__pyx_k_atanh_line_1797), 0, 1, 0, 0},
19972 {&__pyx_kp_u_cga3_line_1823, __pyx_k_cga3_line_1823,
sizeof(__pyx_k_cga3_line_1823), 0, 1, 0, 0},
19973 {&__pyx_kp_u_cga3std_line_1832, __pyx_k_cga3std_line_1832,
sizeof(__pyx_k_cga3std_line_1832), 0, 1, 0, 0},
19974 {&__pyx_n_s_cl, __pyx_k_cl,
sizeof(__pyx_k_cl), 0, 0, 1, 1},
19975 {&__pyx_n_s_clifford, __pyx_k_clifford,
sizeof(__pyx_k_clifford), 0, 0, 1, 1},
19976 {&__pyx_kp_u_clifford___add___line_740, __pyx_k_clifford___add___line_740,
sizeof(__pyx_k_clifford___add___line_740), 0, 1, 0, 0},
19977 {&__pyx_kp_u_clifford___and___line_836, __pyx_k_clifford___and___line_836,
sizeof(__pyx_k_clifford___and___line_836), 0, 1, 0, 0},
19978 {&__pyx_kp_u_clifford___call___line_1020, __pyx_k_clifford___call___line_1020,
sizeof(__pyx_k_clifford___call___line_1020), 0, 1, 0, 0},
19979 {&__pyx_kp_u_clifford___getitem___line_707, __pyx_k_clifford___getitem___line_707,
sizeof(__pyx_k_clifford___getitem___line_707), 0, 1, 0, 0},
19980 {&__pyx_kp_u_clifford___iadd___line_751, __pyx_k_clifford___iadd___line_751,
sizeof(__pyx_k_clifford___iadd___line_751), 0, 1, 0, 0},
19981 {&__pyx_kp_u_clifford___iand___line_851, __pyx_k_clifford___iand___line_851,
sizeof(__pyx_k_clifford___iand___line_851), 0, 1, 0, 0},
19982 {&__pyx_kp_u_clifford___idiv___line_911, __pyx_k_clifford___idiv___line_911,
sizeof(__pyx_k_clifford___idiv___line_911), 0, 1, 0, 0},
19983 {&__pyx_kp_u_clifford___imod___line_821, __pyx_k_clifford___imod___line_821,
sizeof(__pyx_k_clifford___imod___line_821), 0, 1, 0, 0},
19984 {&__pyx_kp_u_clifford___imul___line_793, __pyx_k_clifford___imul___line_793,
sizeof(__pyx_k_clifford___imul___line_793), 0, 1, 0, 0},
19985 {&__pyx_kp_u_clifford___ior___line_950, __pyx_k_clifford___ior___line_950,
sizeof(__pyx_k_clifford___ior___line_950), 0, 1, 0, 0},
19986 {&__pyx_kp_u_clifford___isub___line_771, __pyx_k_clifford___isub___line_771,
sizeof(__pyx_k_clifford___isub___line_771), 0, 1, 0, 0},
19987 {&__pyx_kp_u_clifford___iter___line_638, __pyx_k_clifford___iter___line_638,
sizeof(__pyx_k_clifford___iter___line_638), 0, 1, 0, 0},
19988 {&__pyx_kp_u_clifford___ixor___line_881, __pyx_k_clifford___ixor___line_881,
sizeof(__pyx_k_clifford___ixor___line_881), 0, 1, 0, 0},
19989 {&__pyx_kp_u_clifford___mod___line_806, __pyx_k_clifford___mod___line_806,
sizeof(__pyx_k_clifford___mod___line_806), 0, 1, 0, 0},
19990 {&__pyx_kp_u_clifford___mul___line_780, __pyx_k_clifford___mul___line_780,
sizeof(__pyx_k_clifford___mul___line_780), 0, 1, 0, 0},
19991 {&__pyx_kp_u_clifford___neg___line_722, __pyx_k_clifford___neg___line_722,
sizeof(__pyx_k_clifford___neg___line_722), 0, 1, 0, 0},
19992 {&__pyx_kp_u_clifford___or___line_939, __pyx_k_clifford___or___line_939,
sizeof(__pyx_k_clifford___or___line_939), 0, 1, 0, 0},
19993 {&__pyx_kp_u_clifford___pos___line_731, __pyx_k_clifford___pos___line_731,
sizeof(__pyx_k_clifford___pos___line_731), 0, 1, 0, 0},
19994 {&__pyx_kp_u_clifford___pow___line_961, __pyx_k_clifford___pow___line_961,
sizeof(__pyx_k_clifford___pow___line_961), 0, 1, 0, 0},
19995 {&__pyx_kp_u_clifford___repr___line_1226, __pyx_k_clifford___repr___line_1226,
sizeof(__pyx_k_clifford___repr___line_1226), 0, 1, 0, 0},
19996 {&__pyx_kp_u_clifford___str___line_1235, __pyx_k_clifford___str___line_1235,
sizeof(__pyx_k_clifford___str___line_1235), 0, 1, 0, 0},
19997 {&__pyx_kp_u_clifford___sub___line_760, __pyx_k_clifford___sub___line_760,
sizeof(__pyx_k_clifford___sub___line_760), 0, 1, 0, 0},
19998 {&__pyx_kp_u_clifford___truediv___line_896, __pyx_k_clifford___truediv___line_896,
sizeof(__pyx_k_clifford___truediv___line_896), 0, 1, 0, 0},
19999 {&__pyx_kp_u_clifford___xor___line_866, __pyx_k_clifford___xor___line_866,
sizeof(__pyx_k_clifford___xor___line_866), 0, 1, 0, 0},
20000 {&__pyx_kp_u_clifford_abs_line_1175, __pyx_k_clifford_abs_line_1175,
sizeof(__pyx_k_clifford_abs_line_1175), 0, 1, 0, 0},
20001 {&__pyx_kp_u_clifford_conj_line_1138, __pyx_k_clifford_conj_line_1138,
sizeof(__pyx_k_clifford_conj_line_1138), 0, 1, 0, 0},
20002 {&__pyx_kp_u_clifford_copy_line_556, __pyx_k_clifford_copy_line_556,
sizeof(__pyx_k_clifford_copy_line_556), 0, 1, 0, 0},
20003 {&__pyx_kp_u_clifford_even_line_1061, __pyx_k_clifford_even_line_1061,
sizeof(__pyx_k_clifford_even_line_1061), 0, 1, 0, 0},
20004 {&__pyx_kp_u_clifford_frame_line_1215, __pyx_k_clifford_frame_line_1215,
sizeof(__pyx_k_clifford_frame_line_1215), 0, 1, 0, 0},
20005 {&__pyx_n_s_clifford_hidden_doctests, __pyx_k_clifford_hidden_doctests,
sizeof(__pyx_k_clifford_hidden_doctests), 0, 0, 1, 1},
20006 {&__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},
20007 {&__pyx_kp_u_clifford_inv_line_926, __pyx_k_clifford_inv_line_926,
sizeof(__pyx_k_clifford_inv_line_926), 0, 1, 0, 0},
20008 {&__pyx_kp_u_clifford_involute_line_1107, __pyx_k_clifford_involute_line_1107,
sizeof(__pyx_k_clifford_involute_line_1107), 0, 1, 0, 0},
20009 {&__pyx_kp_u_clifford_isnan_line_1206, __pyx_k_clifford_isnan_line_1206,
sizeof(__pyx_k_clifford_isnan_line_1206), 0, 1, 0, 0},
20010 {&__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},
20011 {&__pyx_kp_u_clifford_norm_line_1164, __pyx_k_clifford_norm_line_1164,
sizeof(__pyx_k_clifford_norm_line_1164), 0, 1, 0, 0},
20012 {&__pyx_kp_u_clifford_odd_line_1070, __pyx_k_clifford_odd_line_1070,
sizeof(__pyx_k_clifford_odd_line_1070), 0, 1, 0, 0},
20013 {&__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},
20014 {&__pyx_kp_u_clifford_pow_line_980, __pyx_k_clifford_pow_line_980,
sizeof(__pyx_k_clifford_pow_line_980), 0, 1, 0, 0},
20015 {&__pyx_kp_u_clifford_pure_line_1050, __pyx_k_clifford_pure_line_1050,
sizeof(__pyx_k_clifford_pure_line_1050), 0, 1, 0, 0},
20016 {&__pyx_kp_u_clifford_quad_line_1153, __pyx_k_clifford_quad_line_1153,
sizeof(__pyx_k_clifford_quad_line_1153), 0, 1, 0, 0},
20017 {&__pyx_kp_u_clifford_reframe_line_649, __pyx_k_clifford_reframe_line_649,
sizeof(__pyx_k_clifford_reframe_line_649), 0, 1, 0, 0},
20018 {&__pyx_kp_u_clifford_reverse_line_1123, __pyx_k_clifford_reverse_line_1123,
sizeof(__pyx_k_clifford_reverse_line_1123), 0, 1, 0, 0},
20019 {&__pyx_kp_u_clifford_scalar_line_1039, __pyx_k_clifford_scalar_line_1039,
sizeof(__pyx_k_clifford_scalar_line_1039), 0, 1, 0, 0},
20020 {&__pyx_kp_u_clifford_truncated_line_1195, __pyx_k_clifford_truncated_line_1195,
sizeof(__pyx_k_clifford_truncated_line_1195), 0, 1, 0, 0},
20021 {&__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},
20022 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback,
sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
20023 {&__pyx_n_s_close, __pyx_k_close,
sizeof(__pyx_k_close), 0, 0, 1, 1},
20024 {&__pyx_n_s_collections, __pyx_k_collections,
sizeof(__pyx_k_collections), 0, 0, 1, 1},
20025 {&__pyx_kp_u_compare_line_492, __pyx_k_compare_line_492,
sizeof(__pyx_k_compare_line_492), 0, 1, 0, 0},
20026 {&__pyx_kp_u_complexifier_line_1526, __pyx_k_complexifier_line_1526,
sizeof(__pyx_k_complexifier_line_1526), 0, 1, 0, 0},
20027 {&__pyx_n_s_conj, __pyx_k_conj,
sizeof(__pyx_k_conj), 0, 0, 1, 1},
20028 {&__pyx_kp_u_conj_line_1435, __pyx_k_conj_line_1435,
sizeof(__pyx_k_conj_line_1435), 0, 1, 0, 0},
20029 {&__pyx_n_s_copy, __pyx_k_copy,
sizeof(__pyx_k_copy), 0, 0, 1, 1},
20030 {&__pyx_n_s_cos, __pyx_k_cos,
sizeof(__pyx_k_cos), 0, 0, 1, 1},
20031 {&__pyx_kp_u_cos_line_1601, __pyx_k_cos_line_1601,
sizeof(__pyx_k_cos_line_1601), 0, 1, 0, 0},
20032 {&__pyx_n_s_cosh, __pyx_k_cosh,
sizeof(__pyx_k_cosh), 0, 0, 1, 1},
20033 {&__pyx_kp_u_cosh_line_1639, __pyx_k_cosh_line_1639,
sizeof(__pyx_k_cosh_line_1639), 0, 1, 0, 0},
20034 {&__pyx_n_s_doctest, __pyx_k_doctest,
sizeof(__pyx_k_doctest), 0, 0, 1, 1},
20035 {&__pyx_n_s_e, __pyx_k_e,
sizeof(__pyx_k_e), 0, 0, 1, 1},
20036 {&__pyx_kp_u_e_line_1886, __pyx_k_e_line_1886,
sizeof(__pyx_k_e_line_1886), 0, 1, 0, 0},
20037 {&__pyx_n_s_encode, __pyx_k_encode,
sizeof(__pyx_k_encode), 0, 0, 1, 1},
20038 {&__pyx_n_s_even, __pyx_k_even,
sizeof(__pyx_k_even), 0, 0, 1, 1},
20039 {&__pyx_kp_u_even_line_1387, __pyx_k_even_line_1387,
sizeof(__pyx_k_even_line_1387), 0, 1, 0, 0},
20040 {&__pyx_n_s_exp, __pyx_k_exp,
sizeof(__pyx_k_exp), 0, 0, 1, 1},
20041 {&__pyx_kp_u_exp_line_1564, __pyx_k_exp_line_1564,
sizeof(__pyx_k_exp_line_1564), 0, 1, 0, 0},
20042 {&__pyx_n_s_fill, __pyx_k_fill,
sizeof(__pyx_k_fill), 0, 0, 1, 1},
20043 {&__pyx_n_s_frm, __pyx_k_frm,
sizeof(__pyx_k_frm), 0, 0, 1, 1},
20044 {&__pyx_kp_u_from, __pyx_k_from,
sizeof(__pyx_k_from), 0, 1, 0, 0},
20045 {&__pyx_n_s_getstate, __pyx_k_getstate,
sizeof(__pyx_k_getstate), 0, 0, 1, 1},
20046 {&__pyx_n_s_grade, __pyx_k_grade,
sizeof(__pyx_k_grade), 0, 0, 1, 1},
20047 {&__pyx_n_s_i, __pyx_k_i,
sizeof(__pyx_k_i), 0, 0, 1, 1},
20048 {&__pyx_kp_u_imag_line_1365, __pyx_k_imag_line_1365,
sizeof(__pyx_k_imag_line_1365), 0, 1, 0, 0},
20049 {&__pyx_n_s_import, __pyx_k_import,
sizeof(__pyx_k_import), 0, 0, 1, 1},
20050 {&__pyx_n_s_index_set, __pyx_k_index_set,
sizeof(__pyx_k_index_set), 0, 0, 1, 1},
20051 {&__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},
20052 {&__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},
20053 {&__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},
20054 {&__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},
20055 {&__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},
20056 {&__pyx_n_s_index_set___iter, __pyx_k_index_set___iter,
sizeof(__pyx_k_index_set___iter), 0, 0, 1, 1},
20057 {&__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},
20058 {&__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},
20059 {&__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},
20060 {&__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},
20061 {&__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},
20062 {&__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},
20063 {&__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},
20064 {&__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},
20065 {&__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},
20066 {&__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},
20067 {&__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},
20068 {&__pyx_n_s_index_set_hidden_doctests, __pyx_k_index_set_hidden_doctests,
sizeof(__pyx_k_index_set_hidden_doctests), 0, 0, 1, 1},
20069 {&__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},
20070 {&__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},
20071 {&__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},
20072 {&__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},
20073 {&__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},
20074 {&__pyx_n_s_inv, __pyx_k_inv,
sizeof(__pyx_k_inv), 0, 0, 1, 1},
20075 {&__pyx_kp_u_inv_line_1328, __pyx_k_inv_line_1328,
sizeof(__pyx_k_inv_line_1328), 0, 1, 0, 0},
20076 {&__pyx_kp_u_invalid, __pyx_k_invalid,
sizeof(__pyx_k_invalid), 0, 1, 0, 0},
20077 {&__pyx_kp_u_invalid_string, __pyx_k_invalid_string,
sizeof(__pyx_k_invalid_string), 0, 1, 0, 0},
20078 {&__pyx_n_s_involute, __pyx_k_involute,
sizeof(__pyx_k_involute), 0, 0, 1, 1},
20079 {&__pyx_kp_u_involute_line_1405, __pyx_k_involute_line_1405,
sizeof(__pyx_k_involute_line_1405), 0, 1, 0, 0},
20080 {&__pyx_n_s_ist, __pyx_k_ist,
sizeof(__pyx_k_ist), 0, 0, 1, 1},
20081 {&__pyx_n_s_istpq, __pyx_k_istpq,
sizeof(__pyx_k_istpq), 0, 0, 1, 1},
20082 {&__pyx_kp_u_istpq_line_1899, __pyx_k_istpq_line_1899,
sizeof(__pyx_k_istpq_line_1899), 0, 1, 0, 0},
20083 {&__pyx_n_s_iter, __pyx_k_iter,
sizeof(__pyx_k_iter), 0, 0, 1, 1},
20084 {&__pyx_n_s_ixt, __pyx_k_ixt,
sizeof(__pyx_k_ixt), 0, 0, 1, 1},
20085 {&__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},
20086 {&__pyx_n_s_lhs, __pyx_k_lhs,
sizeof(__pyx_k_lhs), 0, 0, 1, 1},
20087 {&__pyx_n_s_log, __pyx_k_log,
sizeof(__pyx_k_log), 0, 0, 1, 1},
20088 {&__pyx_kp_u_log_line_1578, __pyx_k_log_line_1578,
sizeof(__pyx_k_log_line_1578), 0, 1, 0, 0},
20089 {&__pyx_n_s_m, __pyx_k_m,
sizeof(__pyx_k_m), 0, 0, 1, 1},
20090 {&__pyx_n_s_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 0, 1, 1},
20091 {&__pyx_n_u_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 1, 0, 1},
20092 {&__pyx_n_s_math, __pyx_k_math,
sizeof(__pyx_k_math), 0, 0, 1, 1},
20093 {&__pyx_n_s_max, __pyx_k_max,
sizeof(__pyx_k_max), 0, 0, 1, 1},
20094 {&__pyx_kp_u_max_abs_line_1481, __pyx_k_max_abs_line_1481,
sizeof(__pyx_k_max_abs_line_1481), 0, 1, 0, 0},
20095 {&__pyx_kp_u_max_pos_line_513, __pyx_k_max_pos_line_513,
sizeof(__pyx_k_max_pos_line_513), 0, 1, 0, 0},
20096 {&__pyx_n_s_min, __pyx_k_min,
sizeof(__pyx_k_min), 0, 0, 1, 1},
20097 {&__pyx_kp_u_min_neg_line_504, __pyx_k_min_neg_line_504,
sizeof(__pyx_k_min_neg_line_504), 0, 1, 0, 0},
20098 {&__pyx_n_s_name, __pyx_k_name,
sizeof(__pyx_k_name), 0, 0, 1, 1},
20099 {&__pyx_n_s_nbar3, __pyx_k_nbar3,
sizeof(__pyx_k_nbar3), 0, 0, 1, 1},
20100 {&__pyx_n_s_ninf3, __pyx_k_ninf3,
sizeof(__pyx_k_ninf3), 0, 0, 1, 1},
20101 {&__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},
20102 {&__pyx_n_s_norm, __pyx_k_norm,
sizeof(__pyx_k_norm), 0, 0, 1, 1},
20103 {&__pyx_kp_u_norm_line_1461, __pyx_k_norm_line_1461,
sizeof(__pyx_k_norm_line_1461), 0, 1, 0, 0},
20104 {&__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},
20105 {&__pyx_n_s_numbers, __pyx_k_numbers,
sizeof(__pyx_k_numbers), 0, 0, 1, 1},
20106 {&__pyx_n_s_obj, __pyx_k_obj,
sizeof(__pyx_k_obj), 0, 0, 1, 1},
20107 {&__pyx_n_s_odd, __pyx_k_odd,
sizeof(__pyx_k_odd), 0, 0, 1, 1},
20108 {&__pyx_kp_u_odd_line_1396, __pyx_k_odd_line_1396,
sizeof(__pyx_k_odd_line_1396), 0, 1, 0, 0},
20109 {&__pyx_n_s_other, __pyx_k_other,
sizeof(__pyx_k_other), 0, 0, 1, 1},
20110 {&__pyx_n_s_outer_pow, __pyx_k_outer_pow,
sizeof(__pyx_k_outer_pow), 0, 0, 1, 1},
20111 {&__pyx_kp_u_outer_pow_line_1517, __pyx_k_outer_pow_line_1517,
sizeof(__pyx_k_outer_pow_line_1517), 0, 1, 0, 0},
20112 {&__pyx_n_s_p, __pyx_k_p,
sizeof(__pyx_k_p), 0, 0, 1, 1},
20113 {&__pyx_n_s_pi, __pyx_k_pi,
sizeof(__pyx_k_pi), 0, 0, 1, 1},
20114 {&__pyx_n_s_pow, __pyx_k_pow,
sizeof(__pyx_k_pow), 0, 0, 1, 1},
20115 {&__pyx_kp_u_pow_line_1493, __pyx_k_pow_line_1493,
sizeof(__pyx_k_pow_line_1493), 0, 1, 0, 0},
20116 {&__pyx_n_s_pure, __pyx_k_pure,
sizeof(__pyx_k_pure), 0, 0, 1, 1},
20117 {&__pyx_kp_u_pure_line_1376, __pyx_k_pure_line_1376,
sizeof(__pyx_k_pure_line_1376), 0, 1, 0, 0},
20118 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable,
sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
20119 {&__pyx_n_s_q, __pyx_k_q,
sizeof(__pyx_k_q), 0, 0, 1, 1},
20120 {&__pyx_n_s_quad, __pyx_k_quad,
sizeof(__pyx_k_quad), 0, 0, 1, 1},
20121 {&__pyx_kp_u_quad_line_1450, __pyx_k_quad_line_1450,
sizeof(__pyx_k_quad_line_1450), 0, 1, 0, 0},
20122 {&__pyx_kp_u_random_clifford_line_1814, __pyx_k_random_clifford_line_1814,
sizeof(__pyx_k_random_clifford_line_1814), 0, 1, 0, 0},
20123 {&__pyx_n_s_range, __pyx_k_range,
sizeof(__pyx_k_range), 0, 0, 1, 1},
20124 {&__pyx_kp_u_real_line_1354, __pyx_k_real_line_1354,
sizeof(__pyx_k_real_line_1354), 0, 1, 0, 0},
20125 {&__pyx_n_s_reduce, __pyx_k_reduce,
sizeof(__pyx_k_reduce), 0, 0, 1, 1},
20126 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython,
sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
20127 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex,
sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
20128 {&__pyx_n_s_reverse, __pyx_k_reverse,
sizeof(__pyx_k_reverse), 0, 0, 1, 1},
20129 {&__pyx_kp_u_reverse_line_1420, __pyx_k_reverse_line_1420,
sizeof(__pyx_k_reverse_line_1420), 0, 1, 0, 0},
20130 {&__pyx_n_s_rhs, __pyx_k_rhs,
sizeof(__pyx_k_rhs), 0, 0, 1, 1},
20131 {&__pyx_n_s_scalar, __pyx_k_scalar,
sizeof(__pyx_k_scalar), 0, 0, 1, 1},
20132 {&__pyx_n_s_scalar_epsilon, __pyx_k_scalar_epsilon,
sizeof(__pyx_k_scalar_epsilon), 0, 0, 1, 1},
20133 {&__pyx_kp_u_scalar_line_1343, __pyx_k_scalar_line_1343,
sizeof(__pyx_k_scalar_line_1343), 0, 1, 0, 0},
20134 {&__pyx_n_s_send, __pyx_k_send,
sizeof(__pyx_k_send), 0, 0, 1, 1},
20135 {&__pyx_n_s_setstate, __pyx_k_setstate,
sizeof(__pyx_k_setstate), 0, 0, 1, 1},
20136 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython,
sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
20137 {&__pyx_n_s_sin, __pyx_k_sin,
sizeof(__pyx_k_sin), 0, 0, 1, 1},
20138 {&__pyx_kp_u_sin_line_1678, __pyx_k_sin_line_1678,
sizeof(__pyx_k_sin_line_1678), 0, 1, 0, 0},
20139 {&__pyx_n_s_sinh, __pyx_k_sinh,
sizeof(__pyx_k_sinh), 0, 0, 1, 1},
20140 {&__pyx_kp_u_sinh_line_1718, __pyx_k_sinh_line_1718,
sizeof(__pyx_k_sinh_line_1718), 0, 1, 0, 0},
20141 {&__pyx_n_s_sqrt, __pyx_k_sqrt,
sizeof(__pyx_k_sqrt), 0, 0, 1, 1},
20142 {&__pyx_kp_u_sqrt_line_1541, __pyx_k_sqrt_line_1541,
sizeof(__pyx_k_sqrt_line_1541), 0, 1, 0, 0},
20143 {&__pyx_n_s_tan, __pyx_k_tan,
sizeof(__pyx_k_tan), 0, 0, 1, 1},
20144 {&__pyx_kp_u_tan_line_1751, __pyx_k_tan_line_1751,
sizeof(__pyx_k_tan_line_1751), 0, 1, 0, 0},
20145 {&__pyx_n_s_tanh, __pyx_k_tanh,
sizeof(__pyx_k_tanh), 0, 0, 1, 1},
20146 {&__pyx_kp_u_tanh_line_1785, __pyx_k_tanh_line_1785,
sizeof(__pyx_k_tanh_line_1785), 0, 1, 0, 0},
20147 {&__pyx_n_s_tau, __pyx_k_tau,
sizeof(__pyx_k_tau), 0, 0, 1, 1},
20148 {&__pyx_n_s_test, __pyx_k_test,
sizeof(__pyx_k_test), 0, 0, 1, 1},
20149 {&__pyx_n_s_test_2, __pyx_k_test_2,
sizeof(__pyx_k_test_2), 0, 0, 1, 1},
20150 {&__pyx_n_s_testmod, __pyx_k_testmod,
sizeof(__pyx_k_testmod), 0, 0, 1, 1},
20151 {&__pyx_n_s_throw, __pyx_k_throw,
sizeof(__pyx_k_throw), 0, 0, 1, 1},
20152 {&__pyx_kp_u_to_frame, __pyx_k_to_frame,
sizeof(__pyx_k_to_frame), 0, 1, 0, 0},
20153 {&__pyx_kp_u_using, __pyx_k_using,
sizeof(__pyx_k_using), 0, 1, 0, 0},
20154 {&__pyx_kp_u_using_invalid, __pyx_k_using_invalid,
sizeof(__pyx_k_using_invalid), 0, 1, 0, 0},
20155 {&__pyx_kp_u_value, __pyx_k_value,
sizeof(__pyx_k_value), 0, 1, 0, 0},
20156 {&__pyx_n_s_version, __pyx_k_version,
sizeof(__pyx_k_version), 0, 0, 1, 1},
20157 {&__pyx_n_s_xrange, __pyx_k_xrange,
sizeof(__pyx_k_xrange), 0, 0, 1, 1},
20158 {0, 0, 0, 0, 0, 0, 0}
20160 static CYTHON_SMALL_CODE
int __Pyx_InitCachedBuiltins(
void) {
20161 __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError);
if (!__pyx_builtin_IndexError) __PYX_ERR(0, 103, __pyx_L1_error)
20162 __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError);
if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 105, __pyx_L1_error)
20163 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError);
if (!__pyx_builtin_TypeError) __PYX_ERR(0, 105, __pyx_L1_error)
20164 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError);
if (!__pyx_builtin_ValueError) __PYX_ERR(0, 106, __pyx_L1_error)
20165 __pyx_builtin_NotImplemented = __Pyx_GetBuiltinName(__pyx_n_s_NotImplemented);
if (!__pyx_builtin_NotImplemented) __PYX_ERR(0, 159, __pyx_L1_error)
20166 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_range) __PYX_ERR(0, 236, __pyx_L1_error)
20167 #if PY_MAJOR_VERSION >= 3
20168 __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_xrange) __PYX_ERR(0, 1099, __pyx_L1_error)
20170 __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange);
if (!__pyx_builtin_xrange) __PYX_ERR(0, 1099, __pyx_L1_error)
20177 static CYTHON_SMALL_CODE
int __Pyx_InitCachedConstants(
void) {
20178 __Pyx_RefNannyDeclarations
20179 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
20187 __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)
20188 __Pyx_GOTREF(__pyx_tuple__3);
20189 __Pyx_GIVEREF(__pyx_tuple__3);
20196 __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)
20197 __Pyx_GOTREF(__pyx_tuple__4);
20198 __Pyx_GIVEREF(__pyx_tuple__4);
20207 __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_Not_applicable);
if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 636, __pyx_L1_error)
20208 __Pyx_GOTREF(__pyx_tuple__10);
20209 __Pyx_GIVEREF(__pyx_tuple__10);
20217 __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)
20218 __Pyx_GOTREF(__pyx_tuple__11);
20219 __Pyx_GIVEREF(__pyx_tuple__11);
20226 __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)
20227 __Pyx_GOTREF(__pyx_tuple__12);
20228 __Pyx_GIVEREF(__pyx_tuple__12);
20237 __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)
20246 __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, 1244, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 1244, __pyx_L1_error)
20255 __pyx_tuple__15 = PyTuple_Pack(1, __pyx_float_1_0);
if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 1857, __pyx_L1_error)
20256 __Pyx_GOTREF(__pyx_tuple__15);
20257 __Pyx_GIVEREF(__pyx_tuple__15);
20266 __pyx_tuple__16 = PyTuple_Pack(1, __pyx_n_s_obj);
if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 1886, __pyx_L1_error)
20267 __Pyx_GOTREF(__pyx_tuple__16);
20268 __Pyx_GIVEREF(__pyx_tuple__16);
20269 __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, 1886, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 1886, __pyx_L1_error)
20278 __pyx_tuple__18 = PyTuple_Pack(2, __pyx_n_s_p, __pyx_n_s_q);
if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 1899, __pyx_L1_error)
20279 __Pyx_GOTREF(__pyx_tuple__18);
20280 __Pyx_GIVEREF(__pyx_tuple__18);
20281 __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, 1899, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 1899, __pyx_L1_error)
20290 __pyx_tuple__20 = PyTuple_Pack(1, __pyx_int_4);
if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 1908, __pyx_L1_error)
20291 __Pyx_GOTREF(__pyx_tuple__20);
20292 __Pyx_GIVEREF(__pyx_tuple__20);
20293 __pyx_tuple__21 = PyTuple_Pack(1, __pyx_int_neg_1);
if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 1908, __pyx_L1_error)
20294 __Pyx_GOTREF(__pyx_tuple__21);
20295 __Pyx_GIVEREF(__pyx_tuple__21);
20304 __pyx_tuple__22 = PyTuple_Pack(2, __pyx_n_s_PyClical, __pyx_n_s_doctest);
if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 1912, __pyx_L1_error)
20305 __Pyx_GOTREF(__pyx_tuple__22);
20306 __Pyx_GIVEREF(__pyx_tuple__22);
20307 __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, 1912, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 1912, __pyx_L1_error)
20308 __Pyx_RefNannyFinishContext();
20311 __Pyx_RefNannyFinishContext();
20315 static CYTHON_SMALL_CODE
int __Pyx_InitGlobals(
void) {
20316 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
20317 __pyx_float_0_0 =
PyFloat_FromDouble(0.0);
if (unlikely(!__pyx_float_0_0)) __PYX_ERR(0, 1, __pyx_L1_error)
20318 __pyx_float_1_0 =
PyFloat_FromDouble(1.0);
if (unlikely(!__pyx_float_1_0)) __PYX_ERR(0, 1, __pyx_L1_error)
20319 __pyx_float_4_0 =
PyFloat_FromDouble(4.0);
if (unlikely(!__pyx_float_4_0)) __PYX_ERR(0, 1, __pyx_L1_error)
20320 __pyx_float_8_0 =
PyFloat_FromDouble(8.0);
if (unlikely(!__pyx_float_8_0)) __PYX_ERR(0, 1, __pyx_L1_error)
20321 __pyx_int_0 = PyInt_FromLong(0);
if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
20322 __pyx_int_1 = PyInt_FromLong(1);
if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
20323 __pyx_int_4 = PyInt_FromLong(4);
if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error)
20324 __pyx_int_neg_1 = PyInt_FromLong(-1);
if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
20330 static CYTHON_SMALL_CODE
int __Pyx_modinit_global_init_code(
void);
20331 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_export_code(
void);
20332 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_export_code(
void);
20333 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_init_code(
void);
20334 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_import_code(
void);
20335 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_import_code(
void);
20336 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_import_code(
void);
20338 static int __Pyx_modinit_global_init_code(
void) {
20339 __Pyx_RefNannyDeclarations
20340 __Pyx_RefNannySetupContext(
"__Pyx_modinit_global_init_code", 0);
20342 __Pyx_RefNannyFinishContext();
20346 static int __Pyx_modinit_variable_export_code(
void) {
20347 __Pyx_RefNannyDeclarations
20348 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_export_code", 0);
20350 __Pyx_RefNannyFinishContext();
20354 static int __Pyx_modinit_function_export_code(
void) {
20355 __Pyx_RefNannyDeclarations
20356 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_export_code", 0);
20358 __Pyx_RefNannyFinishContext();
20362 static int __Pyx_modinit_type_init_code(
void) {
20363 __Pyx_RefNannyDeclarations
20364 int __pyx_lineno = 0;
20365 const char *__pyx_filename = NULL;
20366 int __pyx_clineno = 0;
20367 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_init_code", 0);
20369 __pyx_vtabptr_8PyClical_index_set = &__pyx_vtable_8PyClical_index_set;
20370 __pyx_vtable_8PyClical_index_set.wrap = (PyObject *(*)(
struct __pyx_obj_8PyClical_index_set *,
IndexSet))__pyx_f_8PyClical_9index_set_wrap;
20371 __pyx_vtable_8PyClical_index_set.unwrap = (
IndexSet (*)(
struct __pyx_obj_8PyClical_index_set *))__pyx_f_8PyClical_9index_set_unwrap;
20372 __pyx_vtable_8PyClical_index_set.copy = (PyObject *(*)(
struct __pyx_obj_8PyClical_index_set *,
int __pyx_skip_dispatch))__pyx_f_8PyClical_9index_set_copy;
20373 if (PyType_Ready(&__pyx_type_8PyClical_index_set) < 0) __PYX_ERR(0, 46, __pyx_L1_error)
20374 #if PY_VERSION_HEX < 0x030800B1
20375 __pyx_type_8PyClical_index_set.tp_print = 0;
20377 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)) {
20378 __pyx_type_8PyClical_index_set.tp_getattro = __Pyx_PyObject_GenericGetAttr;
20380 #if CYTHON_COMPILING_IN_CPYTHON
20382 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__setitem__");
if (unlikely(!wrapper)) __PYX_ERR(0, 46, __pyx_L1_error)
20383 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20384 __pyx_wrapperbase_8PyClical_9index_set_8__setitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20385 __pyx_wrapperbase_8PyClical_9index_set_8__setitem__.doc = __pyx_doc_8PyClical_9index_set_8__setitem__;
20386 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_8__setitem__;
20390 #if CYTHON_COMPILING_IN_CPYTHON
20392 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__getitem__");
if (unlikely(!wrapper)) __PYX_ERR(0, 46, __pyx_L1_error)
20393 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20394 __pyx_wrapperbase_8PyClical_9index_set_10__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20395 __pyx_wrapperbase_8PyClical_9index_set_10__getitem__.doc = __pyx_doc_8PyClical_9index_set_10__getitem__;
20396 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_10__getitem__;
20400 #if CYTHON_COMPILING_IN_CPYTHON
20402 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__contains__");
if (unlikely(!wrapper)) __PYX_ERR(0, 46, __pyx_L1_error)
20403 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20404 __pyx_wrapperbase_8PyClical_9index_set_12__contains__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20405 __pyx_wrapperbase_8PyClical_9index_set_12__contains__.doc = __pyx_doc_8PyClical_9index_set_12__contains__;
20406 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_12__contains__;
20410 #if CYTHON_COMPILING_IN_CPYTHON
20412 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__iter__");
if (unlikely(!wrapper)) __PYX_ERR(0, 46, __pyx_L1_error)
20413 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20414 __pyx_wrapperbase_8PyClical_9index_set_14__iter__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20415 __pyx_wrapperbase_8PyClical_9index_set_14__iter__.doc = __pyx_doc_8PyClical_9index_set_14__iter__;
20416 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_14__iter__;
20420 #if CYTHON_COMPILING_IN_CPYTHON
20422 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__invert__");
if (unlikely(!wrapper)) __PYX_ERR(0, 46, __pyx_L1_error)
20423 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20424 __pyx_wrapperbase_8PyClical_9index_set_17__invert__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20425 __pyx_wrapperbase_8PyClical_9index_set_17__invert__.doc = __pyx_doc_8PyClical_9index_set_17__invert__;
20426 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_17__invert__;
20430 #if CYTHON_COMPILING_IN_CPYTHON
20432 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__xor__");
if (unlikely(!wrapper)) __PYX_ERR(0, 46, __pyx_L1_error)
20433 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20434 __pyx_wrapperbase_8PyClical_9index_set_19__xor__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20435 __pyx_wrapperbase_8PyClical_9index_set_19__xor__.doc = __pyx_doc_8PyClical_9index_set_19__xor__;
20436 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_19__xor__;
20440 #if CYTHON_COMPILING_IN_CPYTHON
20442 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__ixor__");
if (unlikely(!wrapper)) __PYX_ERR(0, 46, __pyx_L1_error)
20443 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20444 __pyx_wrapperbase_8PyClical_9index_set_21__ixor__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20445 __pyx_wrapperbase_8PyClical_9index_set_21__ixor__.doc = __pyx_doc_8PyClical_9index_set_21__ixor__;
20446 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_21__ixor__;
20450 #if CYTHON_COMPILING_IN_CPYTHON
20452 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__and__");
if (unlikely(!wrapper)) __PYX_ERR(0, 46, __pyx_L1_error)
20453 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20454 __pyx_wrapperbase_8PyClical_9index_set_23__and__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20455 __pyx_wrapperbase_8PyClical_9index_set_23__and__.doc = __pyx_doc_8PyClical_9index_set_23__and__;
20456 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_23__and__;
20460 #if CYTHON_COMPILING_IN_CPYTHON
20462 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__iand__");
if (unlikely(!wrapper)) __PYX_ERR(0, 46, __pyx_L1_error)
20463 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20464 __pyx_wrapperbase_8PyClical_9index_set_25__iand__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20465 __pyx_wrapperbase_8PyClical_9index_set_25__iand__.doc = __pyx_doc_8PyClical_9index_set_25__iand__;
20466 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_25__iand__;
20470 #if CYTHON_COMPILING_IN_CPYTHON
20472 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__or__");
if (unlikely(!wrapper)) __PYX_ERR(0, 46, __pyx_L1_error)
20473 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20474 __pyx_wrapperbase_8PyClical_9index_set_27__or__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20475 __pyx_wrapperbase_8PyClical_9index_set_27__or__.doc = __pyx_doc_8PyClical_9index_set_27__or__;
20476 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_27__or__;
20480 #if CYTHON_COMPILING_IN_CPYTHON
20482 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__ior__");
if (unlikely(!wrapper)) __PYX_ERR(0, 46, __pyx_L1_error)
20483 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20484 __pyx_wrapperbase_8PyClical_9index_set_29__ior__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20485 __pyx_wrapperbase_8PyClical_9index_set_29__ior__.doc = __pyx_doc_8PyClical_9index_set_29__ior__;
20486 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_29__ior__;
20490 #if CYTHON_COMPILING_IN_CPYTHON
20492 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__repr__");
if (unlikely(!wrapper)) __PYX_ERR(0, 46, __pyx_L1_error)
20493 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20494 __pyx_wrapperbase_8PyClical_9index_set_47__repr__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20495 __pyx_wrapperbase_8PyClical_9index_set_47__repr__.doc = __pyx_doc_8PyClical_9index_set_47__repr__;
20496 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_47__repr__;
20500 #if CYTHON_COMPILING_IN_CPYTHON
20502 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__str__");
if (unlikely(!wrapper)) __PYX_ERR(0, 46, __pyx_L1_error)
20503 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20504 __pyx_wrapperbase_8PyClical_9index_set_49__str__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20505 __pyx_wrapperbase_8PyClical_9index_set_49__str__.doc = __pyx_doc_8PyClical_9index_set_49__str__;
20506 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_49__str__;
20510 if (__Pyx_SetVtable(__pyx_type_8PyClical_index_set.tp_dict, __pyx_vtabptr_8PyClical_index_set) < 0) __PYX_ERR(0, 46, __pyx_L1_error)
20511 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_index_set, (PyObject *)&__pyx_type_8PyClical_index_set) < 0) __PYX_ERR(0, 46, __pyx_L1_error)
20512 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8PyClical_index_set) < 0) __PYX_ERR(0, 46, __pyx_L1_error)
20513 __pyx_ptype_8PyClical_index_set = &__pyx_type_8PyClical_index_set;
20514 __pyx_vtabptr_8PyClical_clifford = &__pyx_vtable_8PyClical_clifford;
20515 __pyx_vtable_8PyClical_clifford.wrap = (PyObject *(*)(
struct __pyx_obj_8PyClical_clifford *,
Clifford))__pyx_f_8PyClical_8clifford_wrap;
20516 __pyx_vtable_8PyClical_clifford.unwrap = (
Clifford (*)(
struct __pyx_obj_8PyClical_clifford *))__pyx_f_8PyClical_8clifford_unwrap;
20517 __pyx_vtable_8PyClical_clifford.copy = (PyObject *(*)(
struct __pyx_obj_8PyClical_clifford *,
int __pyx_skip_dispatch))__pyx_f_8PyClical_8clifford_copy;
20518 if (PyType_Ready(&__pyx_type_8PyClical_clifford) < 0) __PYX_ERR(0, 537, __pyx_L1_error)
20519 #if PY_VERSION_HEX < 0x030800B1
20520 __pyx_type_8PyClical_clifford.tp_print = 0;
20522 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8PyClical_clifford.tp_dictoffset && __pyx_type_8PyClical_clifford.tp_getattro == PyObject_GenericGetAttr)) {
20523 __pyx_type_8PyClical_clifford.tp_getattro = __Pyx_PyObject_GenericGetAttr;
20525 #if CYTHON_COMPILING_IN_CPYTHON
20527 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__contains__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
20528 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20529 __pyx_wrapperbase_8PyClical_8clifford_6__contains__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20530 __pyx_wrapperbase_8PyClical_8clifford_6__contains__.doc = __pyx_doc_8PyClical_8clifford_6__contains__;
20531 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_6__contains__;
20535 #if CYTHON_COMPILING_IN_CPYTHON
20537 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__iter__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
20538 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20539 __pyx_wrapperbase_8PyClical_8clifford_8__iter__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20540 __pyx_wrapperbase_8PyClical_8clifford_8__iter__.doc = __pyx_doc_8PyClical_8clifford_8__iter__;
20541 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_8__iter__;
20545 #if CYTHON_COMPILING_IN_CPYTHON
20547 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__getitem__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
20548 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20549 __pyx_wrapperbase_8PyClical_8clifford_14__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20550 __pyx_wrapperbase_8PyClical_8clifford_14__getitem__.doc = __pyx_doc_8PyClical_8clifford_14__getitem__;
20551 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_14__getitem__;
20555 #if CYTHON_COMPILING_IN_CPYTHON
20557 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__neg__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
20558 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20559 __pyx_wrapperbase_8PyClical_8clifford_16__neg__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20560 __pyx_wrapperbase_8PyClical_8clifford_16__neg__.doc = __pyx_doc_8PyClical_8clifford_16__neg__;
20561 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_16__neg__;
20565 #if CYTHON_COMPILING_IN_CPYTHON
20567 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__pos__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
20568 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20569 __pyx_wrapperbase_8PyClical_8clifford_18__pos__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20570 __pyx_wrapperbase_8PyClical_8clifford_18__pos__.doc = __pyx_doc_8PyClical_8clifford_18__pos__;
20571 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_18__pos__;
20575 #if CYTHON_COMPILING_IN_CPYTHON
20577 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__add__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
20578 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20579 __pyx_wrapperbase_8PyClical_8clifford_20__add__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20580 __pyx_wrapperbase_8PyClical_8clifford_20__add__.doc = __pyx_doc_8PyClical_8clifford_20__add__;
20581 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_20__add__;
20585 #if CYTHON_COMPILING_IN_CPYTHON
20587 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__iadd__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
20588 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20589 __pyx_wrapperbase_8PyClical_8clifford_22__iadd__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20590 __pyx_wrapperbase_8PyClical_8clifford_22__iadd__.doc = __pyx_doc_8PyClical_8clifford_22__iadd__;
20591 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_22__iadd__;
20595 #if CYTHON_COMPILING_IN_CPYTHON
20597 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__sub__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
20598 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20599 __pyx_wrapperbase_8PyClical_8clifford_24__sub__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20600 __pyx_wrapperbase_8PyClical_8clifford_24__sub__.doc = __pyx_doc_8PyClical_8clifford_24__sub__;
20601 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_24__sub__;
20605 #if CYTHON_COMPILING_IN_CPYTHON
20607 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__isub__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
20608 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20609 __pyx_wrapperbase_8PyClical_8clifford_26__isub__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20610 __pyx_wrapperbase_8PyClical_8clifford_26__isub__.doc = __pyx_doc_8PyClical_8clifford_26__isub__;
20611 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_26__isub__;
20615 #if CYTHON_COMPILING_IN_CPYTHON
20617 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__mul__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
20618 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20619 __pyx_wrapperbase_8PyClical_8clifford_28__mul__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20620 __pyx_wrapperbase_8PyClical_8clifford_28__mul__.doc = __pyx_doc_8PyClical_8clifford_28__mul__;
20621 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_28__mul__;
20625 #if CYTHON_COMPILING_IN_CPYTHON
20627 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__imul__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
20628 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20629 __pyx_wrapperbase_8PyClical_8clifford_30__imul__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20630 __pyx_wrapperbase_8PyClical_8clifford_30__imul__.doc = __pyx_doc_8PyClical_8clifford_30__imul__;
20631 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_30__imul__;
20635 #if CYTHON_COMPILING_IN_CPYTHON
20637 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__mod__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
20638 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20639 __pyx_wrapperbase_8PyClical_8clifford_32__mod__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20640 __pyx_wrapperbase_8PyClical_8clifford_32__mod__.doc = __pyx_doc_8PyClical_8clifford_32__mod__;
20641 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_32__mod__;
20645 #if CYTHON_COMPILING_IN_CPYTHON
20647 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__imod__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
20648 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20649 __pyx_wrapperbase_8PyClical_8clifford_34__imod__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20650 __pyx_wrapperbase_8PyClical_8clifford_34__imod__.doc = __pyx_doc_8PyClical_8clifford_34__imod__;
20651 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_34__imod__;
20655 #if CYTHON_COMPILING_IN_CPYTHON
20657 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__and__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
20658 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20659 __pyx_wrapperbase_8PyClical_8clifford_36__and__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20660 __pyx_wrapperbase_8PyClical_8clifford_36__and__.doc = __pyx_doc_8PyClical_8clifford_36__and__;
20661 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_36__and__;
20665 #if CYTHON_COMPILING_IN_CPYTHON
20667 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__iand__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
20668 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20669 __pyx_wrapperbase_8PyClical_8clifford_38__iand__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20670 __pyx_wrapperbase_8PyClical_8clifford_38__iand__.doc = __pyx_doc_8PyClical_8clifford_38__iand__;
20671 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_38__iand__;
20675 #if CYTHON_COMPILING_IN_CPYTHON
20677 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__xor__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
20678 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20679 __pyx_wrapperbase_8PyClical_8clifford_40__xor__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20680 __pyx_wrapperbase_8PyClical_8clifford_40__xor__.doc = __pyx_doc_8PyClical_8clifford_40__xor__;
20681 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_40__xor__;
20685 #if CYTHON_COMPILING_IN_CPYTHON
20687 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__ixor__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
20688 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20689 __pyx_wrapperbase_8PyClical_8clifford_42__ixor__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20690 __pyx_wrapperbase_8PyClical_8clifford_42__ixor__.doc = __pyx_doc_8PyClical_8clifford_42__ixor__;
20691 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_42__ixor__;
20695 #if CYTHON_COMPILING_IN_CPYTHON
20697 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__truediv__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
20698 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20699 __pyx_wrapperbase_8PyClical_8clifford_44__truediv__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20700 __pyx_wrapperbase_8PyClical_8clifford_44__truediv__.doc = __pyx_doc_8PyClical_8clifford_44__truediv__;
20701 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_44__truediv__;
20705 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
20706 #if CYTHON_COMPILING_IN_CPYTHON
20708 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__idiv__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
20709 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20710 __pyx_wrapperbase_8PyClical_8clifford_46__idiv__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20711 __pyx_wrapperbase_8PyClical_8clifford_46__idiv__.doc = __pyx_doc_8PyClical_8clifford_46__idiv__;
20712 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_46__idiv__;
20717 #if CYTHON_COMPILING_IN_CPYTHON
20719 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__or__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
20720 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20721 __pyx_wrapperbase_8PyClical_8clifford_50__or__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20722 __pyx_wrapperbase_8PyClical_8clifford_50__or__.doc = __pyx_doc_8PyClical_8clifford_50__or__;
20723 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_50__or__;
20727 #if CYTHON_COMPILING_IN_CPYTHON
20729 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__ior__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
20730 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20731 __pyx_wrapperbase_8PyClical_8clifford_52__ior__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20732 __pyx_wrapperbase_8PyClical_8clifford_52__ior__.doc = __pyx_doc_8PyClical_8clifford_52__ior__;
20733 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_52__ior__;
20737 #if CYTHON_COMPILING_IN_CPYTHON
20739 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__pow__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
20740 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20741 __pyx_wrapperbase_8PyClical_8clifford_54__pow__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20742 __pyx_wrapperbase_8PyClical_8clifford_54__pow__.doc = __pyx_doc_8PyClical_8clifford_54__pow__;
20743 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_54__pow__;
20747 #if CYTHON_COMPILING_IN_CPYTHON
20749 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__call__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
20750 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20751 __pyx_wrapperbase_8PyClical_8clifford_60__call__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20752 __pyx_wrapperbase_8PyClical_8clifford_60__call__.doc = __pyx_doc_8PyClical_8clifford_60__call__;
20753 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_60__call__;
20757 #if CYTHON_COMPILING_IN_CPYTHON
20759 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__repr__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
20760 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20761 __pyx_wrapperbase_8PyClical_8clifford_92__repr__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20762 __pyx_wrapperbase_8PyClical_8clifford_92__repr__.doc = __pyx_doc_8PyClical_8clifford_92__repr__;
20763 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_92__repr__;
20767 #if CYTHON_COMPILING_IN_CPYTHON
20769 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__str__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
20770 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20771 __pyx_wrapperbase_8PyClical_8clifford_94__str__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20772 __pyx_wrapperbase_8PyClical_8clifford_94__str__.doc = __pyx_doc_8PyClical_8clifford_94__str__;
20773 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_94__str__;
20777 if (__Pyx_SetVtable(__pyx_type_8PyClical_clifford.tp_dict, __pyx_vtabptr_8PyClical_clifford) < 0) __PYX_ERR(0, 537, __pyx_L1_error)
20778 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_clifford, (PyObject *)&__pyx_type_8PyClical_clifford) < 0) __PYX_ERR(0, 537, __pyx_L1_error)
20779 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8PyClical_clifford) < 0) __PYX_ERR(0, 537, __pyx_L1_error)
20780 __pyx_ptype_8PyClical_clifford = &__pyx_type_8PyClical_clifford;
20781 if (PyType_Ready(&__pyx_type_8PyClical___pyx_scope_struct____iter__) < 0) __PYX_ERR(0, 229, __pyx_L1_error)
20782 #if PY_VERSION_HEX < 0x030800B1
20783 __pyx_type_8PyClical___pyx_scope_struct____iter__.tp_print = 0;
20785 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)) {
20786 __pyx_type_8PyClical___pyx_scope_struct____iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
20788 __pyx_ptype_8PyClical___pyx_scope_struct____iter__ = &__pyx_type_8PyClical___pyx_scope_struct____iter__;
20789 __Pyx_RefNannyFinishContext();
20792 __Pyx_RefNannyFinishContext();
20796 static int __Pyx_modinit_type_import_code(
void) {
20797 __Pyx_RefNannyDeclarations
20798 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_import_code", 0);
20800 __Pyx_RefNannyFinishContext();
20804 static int __Pyx_modinit_variable_import_code(
void) {
20805 __Pyx_RefNannyDeclarations
20806 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_import_code", 0);
20808 __Pyx_RefNannyFinishContext();
20812 static int __Pyx_modinit_function_import_code(
void) {
20813 __Pyx_RefNannyDeclarations
20814 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_import_code", 0);
20816 __Pyx_RefNannyFinishContext();
20821 #ifndef CYTHON_NO_PYINIT_EXPORT
20822 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
20823 #elif PY_MAJOR_VERSION < 3
20825 #define __Pyx_PyMODINIT_FUNC extern "C" void
20827 #define __Pyx_PyMODINIT_FUNC void
20831 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
20833 #define __Pyx_PyMODINIT_FUNC PyObject *
20838 #if PY_MAJOR_VERSION < 3
20839 __Pyx_PyMODINIT_FUNC initPyClical(
void) CYTHON_SMALL_CODE;
20840 __Pyx_PyMODINIT_FUNC initPyClical(
void)
20842 __Pyx_PyMODINIT_FUNC PyInit_PyClical(
void) CYTHON_SMALL_CODE;
20843 __Pyx_PyMODINIT_FUNC PyInit_PyClical(
void)
20844 #if CYTHON_PEP489_MULTI_PHASE_INIT
20846 return PyModuleDef_Init(&__pyx_moduledef);
20848 static CYTHON_SMALL_CODE
int __Pyx_check_single_interpreter(
void) {
20849 #if PY_VERSION_HEX >= 0x030700A1
20850 static PY_INT64_T main_interpreter_id = -1;
20851 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
20852 if (main_interpreter_id == -1) {
20853 main_interpreter_id = current_id;
20854 return (unlikely(current_id == -1)) ? -1 : 0;
20855 }
else if (unlikely(main_interpreter_id != current_id))
20857 static PyInterpreterState *main_interpreter = NULL;
20858 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
20859 if (!main_interpreter) {
20860 main_interpreter = current_interpreter;
20861 }
else if (unlikely(main_interpreter != current_interpreter))
20866 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
20871 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) {
20872 PyObject *value = PyObject_GetAttrString(spec, from_name);
20874 if (likely(value)) {
20875 if (allow_none || value != Py_None) {
20876 result = PyDict_SetItemString(moddict, to_name, value);
20879 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
20886 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
20887 PyObject *module = NULL, *moddict, *modname;
20888 if (__Pyx_check_single_interpreter())
20891 return __Pyx_NewRef(__pyx_m);
20892 modname = PyObject_GetAttrString(spec,
"name");
20893 if (unlikely(!modname))
goto bad;
20894 module = PyModule_NewObject(modname);
20895 Py_DECREF(modname);
20896 if (unlikely(!module))
goto bad;
20897 moddict = PyModule_GetDict(module);
20898 if (unlikely(!moddict))
goto bad;
20899 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__", 1) < 0))
goto bad;
20900 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__", 1) < 0))
goto bad;
20901 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__", 1) < 0))
goto bad;
20902 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__", 0) < 0))
goto bad;
20905 Py_XDECREF(module);
20910 static CYTHON_SMALL_CODE
int __pyx_pymod_exec_PyClical(PyObject *__pyx_pyinit_module)
20914 PyObject *__pyx_t_1 = NULL;
20915 PyObject *__pyx_t_2 = NULL;
20916 PyObject *__pyx_t_3 = NULL;
20918 int __pyx_lineno = 0;
20919 const char *__pyx_filename = NULL;
20920 int __pyx_clineno = 0;
20921 __Pyx_RefNannyDeclarations
20922 #if CYTHON_PEP489_MULTI_PHASE_INIT
20924 if (__pyx_m == __pyx_pyinit_module)
return 0;
20925 PyErr_SetString(PyExc_RuntimeError,
"Module 'PyClical' has already been imported. Re-initialisation is not supported.");
20928 #elif PY_MAJOR_VERSION >= 3
20929 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
20931 #if CYTHON_REFNANNY
20932 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
20933 if (!__Pyx_RefNanny) {
20935 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
20936 if (!__Pyx_RefNanny)
20937 Py_FatalError(
"failed to import 'refnanny' module");
20940 __Pyx_RefNannySetupContext(
"__Pyx_PyMODINIT_FUNC PyInit_PyClical(void)", 0);
20941 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20942 #ifdef __Pxy_PyFrame_Initialize_Offsets
20943 __Pxy_PyFrame_Initialize_Offsets();
20945 __pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
20946 __pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
20947 __pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
20948 #ifdef __Pyx_CyFunction_USED
20949 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20951 #ifdef __Pyx_FusedFunction_USED
20952 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20954 #ifdef __Pyx_Coroutine_USED
20955 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20957 #ifdef __Pyx_Generator_USED
20958 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20960 #ifdef __Pyx_AsyncGen_USED
20961 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20963 #ifdef __Pyx_StopAsyncIteration_USED
20964 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20968 #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
20970 PyEval_InitThreads();
20974 #if CYTHON_PEP489_MULTI_PHASE_INIT
20975 __pyx_m = __pyx_pyinit_module;
20976 Py_INCREF(__pyx_m);
20978 #if PY_MAJOR_VERSION < 3
20979 __pyx_m = Py_InitModule4(
"PyClical", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
20981 __pyx_m = PyModule_Create(&__pyx_moduledef);
20983 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
20985 __pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
20986 Py_INCREF(__pyx_d);
20987 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
20988 Py_INCREF(__pyx_b);
20989 __pyx_cython_runtime = PyImport_AddModule((
char *)
"cython_runtime");
if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
20990 Py_INCREF(__pyx_cython_runtime);
20991 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
20993 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20994 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
20995 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20997 if (__pyx_module_is_main_PyClical) {
20998 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21000 #if PY_MAJOR_VERSION >= 3
21002 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
21003 if (!PyDict_GetItemString(modules,
"PyClical")) {
21004 if (unlikely(PyDict_SetItemString(modules,
"PyClical", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
21009 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21011 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21013 (void)__Pyx_modinit_global_init_code();
21014 (void)__Pyx_modinit_variable_export_code();
21015 (void)__Pyx_modinit_function_export_code();
21016 if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
21017 (void)__Pyx_modinit_type_import_code();
21018 (void)__Pyx_modinit_variable_import_code();
21019 (void)__Pyx_modinit_function_import_code();
21021 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
21022 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21032 __pyx_t_1 = __Pyx_Import(__pyx_n_s_math, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
21033 __Pyx_GOTREF(__pyx_t_1);
21034 if (PyDict_SetItem(__pyx_d, __pyx_n_s_math, __pyx_t_1) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
21035 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21044 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numbers, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error)
21045 __Pyx_GOTREF(__pyx_t_1);
21046 if (PyDict_SetItem(__pyx_d, __pyx_n_s_numbers, __pyx_t_1) < 0) __PYX_ERR(0, 30, __pyx_L1_error)
21047 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21056 __pyx_t_1 = __Pyx_Import(__pyx_n_s_collections, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
21057 __Pyx_GOTREF(__pyx_t_1);
21058 if (PyDict_SetItem(__pyx_d, __pyx_n_s_collections, __pyx_t_1) < 0) __PYX_ERR(0, 31, __pyx_L1_error)
21059 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21068 if (PyDict_SetItem(__pyx_d, __pyx_n_s_version, __pyx_kp_u_0_8_4) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
21077 __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)
21078 __Pyx_GOTREF(__pyx_t_1);
21079 if (PyDict_SetItem(__pyx_d, __pyx_n_s_index_set_hidden_doctests, __pyx_t_1) < 0) __PYX_ERR(0, 406, __pyx_L1_error)
21080 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21089 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8PyClical_9clifford_hidden_doctests, NULL, __pyx_n_s_PyClical);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1244, __pyx_L1_error)
21090 __Pyx_GOTREF(__pyx_t_1);
21091 if (PyDict_SetItem(__pyx_d, __pyx_n_s_clifford_hidden_doctests, __pyx_t_1) < 0) __PYX_ERR(0, 1244, __pyx_L1_error)
21092 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21102 __Pyx_GOTREF(__pyx_t_1);
21103 if (PyDict_SetItem(__pyx_d, __pyx_n_s_scalar_epsilon, __pyx_t_1) < 0) __PYX_ERR(0, 1855, __pyx_L1_error)
21104 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21113 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_tuple__15, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1857, __pyx_L1_error)
21114 __Pyx_GOTREF(__pyx_t_1);
21115 __pyx_t_2 = __pyx_f_8PyClical_atan(__pyx_t_1, 0, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1857, __pyx_L1_error)
21116 __Pyx_GOTREF(__pyx_t_2);
21117 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21118 __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_float_4_0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1857, __pyx_L1_error)
21119 __Pyx_GOTREF(__pyx_t_1);
21120 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21121 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pi, __pyx_t_1) < 0) __PYX_ERR(0, 1857, __pyx_L1_error)
21122 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21131 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_tuple__15, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1858, __pyx_L1_error)
21132 __Pyx_GOTREF(__pyx_t_1);
21133 __pyx_t_2 = __pyx_f_8PyClical_atan(__pyx_t_1, 0, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1858, __pyx_L1_error)
21134 __Pyx_GOTREF(__pyx_t_2);
21135 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21136 __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_float_8_0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1858, __pyx_L1_error)
21137 __Pyx_GOTREF(__pyx_t_1);
21138 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21139 if (PyDict_SetItem(__pyx_d, __pyx_n_s_tau, __pyx_t_1) < 0) __PYX_ERR(0, 1858, __pyx_L1_error)
21140 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21149 if (PyDict_SetItem(__pyx_d, __pyx_n_s_cl, ((PyObject *)__pyx_ptype_8PyClical_clifford)) < 0) __PYX_ERR(0, 1860, __pyx_L1_error)
21158 if (PyDict_SetItem(__pyx_d, __pyx_n_s_ist, ((PyObject *)__pyx_ptype_8PyClical_index_set)) < 0) __PYX_ERR(0, 1878, __pyx_L1_error)
21167 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8PyClical_83e, NULL, __pyx_n_s_PyClical);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1886, __pyx_L1_error)
21168 __Pyx_GOTREF(__pyx_t_1);
21169 if (PyDict_SetItem(__pyx_d, __pyx_n_s_e, __pyx_t_1) < 0) __PYX_ERR(0, 1886, __pyx_L1_error)
21170 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21179 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8PyClical_85istpq, NULL, __pyx_n_s_PyClical);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1899, __pyx_L1_error)
21180 __Pyx_GOTREF(__pyx_t_1);
21181 if (PyDict_SetItem(__pyx_d, __pyx_n_s_istpq, __pyx_t_1) < 0) __PYX_ERR(0, 1899, __pyx_L1_error)
21182 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21191 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_e);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1908, __pyx_L1_error)
21192 __Pyx_GOTREF(__pyx_t_1);
21193 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__20, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1908, __pyx_L1_error)
21194 __Pyx_GOTREF(__pyx_t_2);
21195 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21196 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_e);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1908, __pyx_L1_error)
21197 __Pyx_GOTREF(__pyx_t_1);
21198 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__21, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1908, __pyx_L1_error)
21199 __Pyx_GOTREF(__pyx_t_3);
21200 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21201 __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1908, __pyx_L1_error)
21202 __Pyx_GOTREF(__pyx_t_1);
21203 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21204 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21205 if (PyDict_SetItem(__pyx_d, __pyx_n_s_ninf3, __pyx_t_1) < 0) __PYX_ERR(0, 1908, __pyx_L1_error)
21206 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21215 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_e);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1909, __pyx_L1_error)
21216 __Pyx_GOTREF(__pyx_t_1);
21217 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__20, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1909, __pyx_L1_error)
21218 __Pyx_GOTREF(__pyx_t_3);
21219 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21220 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_e);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1909, __pyx_L1_error)
21221 __Pyx_GOTREF(__pyx_t_1);
21222 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__21, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1909, __pyx_L1_error)
21223 __Pyx_GOTREF(__pyx_t_2);
21224 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21225 __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1909, __pyx_L1_error)
21226 __Pyx_GOTREF(__pyx_t_1);
21227 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21228 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21229 if (PyDict_SetItem(__pyx_d, __pyx_n_s_nbar3, __pyx_t_1) < 0) __PYX_ERR(0, 1909, __pyx_L1_error)
21230 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21239 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8PyClical_87_test, NULL, __pyx_n_s_PyClical);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1912, __pyx_L1_error)
21240 __Pyx_GOTREF(__pyx_t_1);
21241 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1912, __pyx_L1_error)
21242 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21250 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_name);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1916, __pyx_L1_error)
21251 __Pyx_GOTREF(__pyx_t_1);
21252 __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_main, Py_EQ));
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1916, __pyx_L1_error)
21253 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21261 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_test);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1917, __pyx_L1_error)
21262 __Pyx_GOTREF(__pyx_t_1);
21263 __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1917, __pyx_L1_error)
21264 __Pyx_GOTREF(__pyx_t_2);
21265 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21266 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21281 __pyx_t_2 = __Pyx_PyDict_NewPresized(107);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
21282 __Pyx_GOTREF(__pyx_t_2);
21283 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)
21284 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)
21285 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)
21286 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)
21287 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)
21288 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)
21289 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)
21290 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)
21291 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)
21292 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)
21293 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)
21294 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)
21295 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)
21296 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)
21297 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)
21298 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)
21299 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)
21300 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)
21301 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)
21302 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)
21303 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)
21304 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)
21305 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)
21306 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)
21307 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)
21308 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)
21309 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)
21310 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)
21311 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)
21312 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)
21313 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)
21314 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)
21315 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)
21316 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)
21317 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)
21318 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)
21319 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)
21320 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)
21321 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)
21322 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)
21323 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)
21324 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)
21325 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)
21326 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)
21327 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)
21328 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)
21329 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)
21330 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)
21331 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)
21332 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)
21333 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)
21334 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)
21335 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)
21336 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)
21337 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)
21338 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)
21339 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)
21340 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)
21341 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)
21342 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)
21343 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)
21344 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)
21345 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)
21346 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)
21347 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford_isnan_line_1206, __pyx_kp_u_Check_if_a_multivector_contains) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21348 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford_frame_line_1215, __pyx_kp_u_Subalgebra_generated_by_all_gen) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21349 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford___repr___line_1226, __pyx_kp_u_The_official_string_representat_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21350 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_clifford___str___line_1235, __pyx_kp_u_The_informal_string_representat_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21351 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)
21352 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_inv_line_1328, __pyx_kp_u_Geometric_multiplicative_invers_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21353 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_scalar_line_1343, __pyx_kp_u_Scalar_part_scalar_clifford_1_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21354 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_real_line_1354, __pyx_kp_u_Real_part_synonym_for_scalar_pa) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21355 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_imag_line_1365, __pyx_kp_u_Imaginary_part_deprecated_alway) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21356 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_pure_line_1376, __pyx_kp_u_Pure_part_print_pure_clifford_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21357 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_even_line_1387, __pyx_kp_u_Even_part_of_multivector_sum_of_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21358 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_odd_line_1396, __pyx_kp_u_Odd_part_of_multivector_sum_of_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21359 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_involute_line_1405, __pyx_kp_u_Main_involution_each_i_is_repla_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21360 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_reverse_line_1420, __pyx_kp_u_Reversion_eg_1_2_2_1_print_reve) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21361 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_conj_line_1435, __pyx_kp_u_Conjugation_reverse_o_involute_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21362 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_quad_line_1450, __pyx_kp_u_Quadratic_form_rev_x_x_0_print_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21363 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_norm_line_1461, __pyx_kp_u_norm_sum_of_squares_of_coordina) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21364 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_abs_line_1472, __pyx_kp_u_Absolute_value_of_multivector_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21365 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_max_abs_line_1481, __pyx_kp_u_Maximum_absolute_value_of_coord) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21366 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_pow_line_1493, __pyx_kp_u_Integer_power_of_multivector_ob) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21367 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_outer_pow_line_1517, __pyx_kp_u_Outer_product_power_of_multivec) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21368 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_complexifier_line_1526, __pyx_kp_u_Square_root_of_1_which_commutes) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21369 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_sqrt_line_1541, __pyx_kp_u_Square_root_of_multivector_with) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21370 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_exp_line_1564, __pyx_kp_u_Exponential_of_multivector_x_cl) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21371 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_log_line_1578, __pyx_kp_u_Natural_logarithm_of_multivecto) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21372 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_cos_line_1601, __pyx_kp_u_Cosine_of_multivector_with_opti) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21373 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_acos_line_1618, __pyx_kp_u_Inverse_cosine_of_multivector_w) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21374 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_cosh_line_1639, __pyx_kp_u_Hyperbolic_cosine_of_multivecto) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21375 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_acosh_line_1655, __pyx_kp_u_Inverse_hyperbolic_cosine_of_mu) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21376 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_sin_line_1678, __pyx_kp_u_Sine_of_multivector_with_option) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21377 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_asin_line_1697, __pyx_kp_u_Inverse_sine_of_multivector_wit) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21378 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_sinh_line_1718, __pyx_kp_u_Hyperbolic_sine_of_multivector) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21379 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_asinh_line_1732, __pyx_kp_u_Inverse_hyperbolic_sine_of_mult) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21380 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_tan_line_1751, __pyx_kp_u_Tangent_of_multivector_with_opt) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21381 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_atan_line_1768, __pyx_kp_u_Inverse_tangent_of_multivector) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21382 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_tanh_line_1785, __pyx_kp_u_Hyperbolic_tangent_of_multivect) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21383 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_atanh_line_1797, __pyx_kp_u_Inverse_hyperbolic_tangent_of_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21384 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_random_clifford_line_1814, __pyx_kp_u_Random_multivector_within_a_fra) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21385 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_cga3_line_1823, __pyx_kp_u_Convert_Euclidean_3D_multivecto) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21386 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_cga3std_line_1832, __pyx_kp_u_Convert_CGA3_null_vector_to_sta) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21387 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_agc3_line_1843, __pyx_kp_u_Convert_CGA3_null_vector_to_Euc) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21388 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_e_line_1886, __pyx_kp_u_Abbreviation_for_clifford_index) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21389 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_istpq_line_1899, __pyx_kp_u_Abbreviation_for_index_set_q_p) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21390 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_2, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21391 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21405 __Pyx_XDECREF(__pyx_t_1);
21406 __Pyx_XDECREF(__pyx_t_2);
21407 __Pyx_XDECREF(__pyx_t_3);
21410 __Pyx_AddTraceback(
"init PyClical", __pyx_clineno, __pyx_lineno, __pyx_filename);
21413 }
else if (!PyErr_Occurred()) {
21414 PyErr_SetString(PyExc_ImportError,
"init PyClical");
21417 __Pyx_RefNannyFinishContext();
21418 #if CYTHON_PEP489_MULTI_PHASE_INIT
21419 return (__pyx_m != NULL) ? 0 : -1;
21420 #elif PY_MAJOR_VERSION >= 3
21429 #if CYTHON_REFNANNY
21430 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
21431 PyObject *m = NULL, *p = NULL;
21433 m = PyImport_ImportModule(modname);
21435 p = PyObject_GetAttrString(m,
"RefNannyAPI");
21437 r = PyLong_AsVoidPtr(p);
21441 return (__Pyx_RefNannyAPIStruct *)r;
21446 #if CYTHON_USE_TYPE_SLOTS
21447 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject*
obj, PyObject* attr_name) {
21448 PyTypeObject* tp = Py_TYPE(
obj);
21449 if (likely(tp->tp_getattro))
21450 return tp->tp_getattro(
obj, attr_name);
21451 #if PY_MAJOR_VERSION < 3
21452 if (likely(tp->tp_getattr))
21453 return tp->tp_getattr(
obj, PyString_AS_STRING(attr_name));
21455 return PyObject_GetAttr(
obj, attr_name);
21460 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
21461 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
21462 if (unlikely(!result)) {
21463 PyErr_Format(PyExc_NameError,
21464 #
if PY_MAJOR_VERSION >= 3
21465 "name '%U' is not defined", name);
21467 "name '%.200s' is not defined", PyString_AS_STRING(name));
21474 #if CYTHON_FAST_PYCCALL
21475 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
21476 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
21477 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
21478 PyObject *
self = PyCFunction_GET_SELF(func);
21479 int flags = PyCFunction_GET_FLAGS(func);
21480 assert(PyCFunction_Check(func));
21481 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
21482 assert(nargs >= 0);
21483 assert(nargs == 0 || args != NULL);
21487 assert(!PyErr_Occurred());
21488 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
21489 return (*((__Pyx_PyCFunctionFastWithKeywords)(
void*)meth)) (
self, args, nargs, NULL);
21491 return (*((__Pyx_PyCFunctionFast)(
void*)meth)) (
self, args, nargs);
21497 #if CYTHON_FAST_PYCALL
21498 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
21499 PyObject *globals) {
21501 PyThreadState *tstate = __Pyx_PyThreadState_Current;
21502 PyObject **fastlocals;
21505 assert(globals != NULL);
21510 assert(tstate != NULL);
21511 f = PyFrame_New(tstate, co, globals, NULL);
21515 fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
21516 for (
i = 0;
i < na;
i++) {
21518 fastlocals[
i] = *args++;
21520 result = PyEval_EvalFrameEx(f,0);
21521 ++tstate->recursion_depth;
21523 --tstate->recursion_depth;
21526 #if 1 || PY_VERSION_HEX < 0x030600B1
21527 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
21528 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
21529 PyObject *globals = PyFunction_GET_GLOBALS(func);
21530 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
21532 #if PY_MAJOR_VERSION >= 3
21535 PyObject *kwtuple, **k;
21540 assert(kwargs == NULL || PyDict_Check(kwargs));
21541 nk = kwargs ? PyDict_Size(kwargs) : 0;
21542 if (Py_EnterRecursiveCall((
char*)
" while calling a Python object")) {
21546 #
if PY_MAJOR_VERSION >= 3
21547 co->co_kwonlyargcount == 0 &&
21549 likely(kwargs == NULL || nk == 0) &&
21550 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
21551 if (argdefs == NULL && co->co_argcount == nargs) {
21552 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
21555 else if (nargs == 0 && argdefs != NULL
21556 && co->co_argcount == Py_SIZE(argdefs)) {
21559 args = &PyTuple_GET_ITEM(argdefs, 0);
21560 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
21564 if (kwargs != NULL) {
21566 kwtuple = PyTuple_New(2 * nk);
21567 if (kwtuple == NULL) {
21571 k = &PyTuple_GET_ITEM(kwtuple, 0);
21573 while (PyDict_Next(kwargs, &pos, &k[
i], &k[
i+1])) {
21584 closure = PyFunction_GET_CLOSURE(func);
21585 #if PY_MAJOR_VERSION >= 3
21586 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
21588 if (argdefs != NULL) {
21589 d = &PyTuple_GET_ITEM(argdefs, 0);
21590 nd = Py_SIZE(argdefs);
21596 #if PY_MAJOR_VERSION >= 3
21597 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
21600 d, (
int)nd, kwdefs, closure);
21602 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
21605 d, (
int)nd, closure);
21607 Py_XDECREF(kwtuple);
21609 Py_LeaveRecursiveCall();
21616 #if CYTHON_COMPILING_IN_CPYTHON
21617 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
21619 ternaryfunc call = func->ob_type->tp_call;
21620 if (unlikely(!call))
21621 return PyObject_Call(func, arg, kw);
21622 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
21624 result = (*call)(func, arg, kw);
21625 Py_LeaveRecursiveCall();
21626 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
21629 "NULL result without error in PyObject_Call");
21636 #if CYTHON_COMPILING_IN_CPYTHON
21637 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
21638 PyObject *
self, *result;
21640 cfunc = PyCFunction_GET_FUNCTION(func);
21641 self = PyCFunction_GET_SELF(func);
21642 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
21644 result = cfunc(
self, arg);
21645 Py_LeaveRecursiveCall();
21646 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
21649 "NULL result without error in PyObject_Call");
21656 #if CYTHON_COMPILING_IN_CPYTHON
21657 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
21659 PyObject *args = PyTuple_New(1);
21660 if (unlikely(!args))
return NULL;
21662 PyTuple_SET_ITEM(args, 0, arg);
21663 result = __Pyx_PyObject_Call(func, args, NULL);
21667 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
21668 #if CYTHON_FAST_PYCALL
21669 if (PyFunction_Check(func)) {
21670 return __Pyx_PyFunction_FastCall(func, &arg, 1);
21673 if (likely(PyCFunction_Check(func))) {
21674 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
21675 return __Pyx_PyObject_CallMethO(func, arg);
21676 #if CYTHON_FAST_PYCCALL
21677 }
else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
21678 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
21682 return __Pyx__PyObject_CallOneArg(func, arg);
21685 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
21687 PyObject *args = PyTuple_Pack(1, arg);
21688 if (unlikely(!args))
return NULL;
21689 result = __Pyx_PyObject_Call(func, args, NULL);
21696 #if CYTHON_FAST_THREAD_STATE
21697 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
21698 PyObject *tmp_type, *tmp_value, *tmp_tb;
21699 tmp_type = tstate->curexc_type;
21700 tmp_value = tstate->curexc_value;
21701 tmp_tb = tstate->curexc_traceback;
21702 tstate->curexc_type = type;
21703 tstate->curexc_value = value;
21704 tstate->curexc_traceback = tb;
21705 Py_XDECREF(tmp_type);
21706 Py_XDECREF(tmp_value);
21707 Py_XDECREF(tmp_tb);
21709 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
21710 *type = tstate->curexc_type;
21711 *value = tstate->curexc_value;
21712 *tb = tstate->curexc_traceback;
21713 tstate->curexc_type = 0;
21714 tstate->curexc_value = 0;
21715 tstate->curexc_traceback = 0;
21720 static void __Pyx_WriteUnraisable(
const char *name, CYTHON_UNUSED
int clineno,
21721 CYTHON_UNUSED
int lineno, CYTHON_UNUSED
const char *filename,
21722 int full_traceback, CYTHON_UNUSED
int nogil) {
21723 PyObject *old_exc, *old_val, *old_tb;
21725 __Pyx_PyThreadState_declare
21727 PyGILState_STATE state;
21729 state = PyGILState_Ensure();
21731 else state = (PyGILState_STATE)-1;
21734 __Pyx_PyThreadState_assign
21735 __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
21736 if (full_traceback) {
21737 Py_XINCREF(old_exc);
21738 Py_XINCREF(old_val);
21739 Py_XINCREF(old_tb);
21740 __Pyx_ErrRestore(old_exc, old_val, old_tb);
21743 #if PY_MAJOR_VERSION < 3
21744 ctx = PyString_FromString(name);
21746 ctx = PyUnicode_FromString(name);
21748 __Pyx_ErrRestore(old_exc, old_val, old_tb);
21750 PyErr_WriteUnraisable(Py_None);
21752 PyErr_WriteUnraisable(ctx);
21757 PyGILState_Release(state);
21762 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
21763 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *
obj) {
21764 PyObject *dict = Py_TYPE(
obj)->tp_dict;
21765 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
21767 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *
obj) {
21768 PyObject **dictptr = NULL;
21769 Py_ssize_t offset = Py_TYPE(
obj)->tp_dictoffset;
21771 #if CYTHON_COMPILING_IN_CPYTHON
21772 dictptr = (likely(offset > 0)) ? (PyObject **) ((
char *)
obj + offset) : _PyObject_GetDictPtr(
obj);
21774 dictptr = _PyObject_GetDictPtr(
obj);
21777 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
21779 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject*
obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
21780 PyObject *dict = Py_TYPE(
obj)->tp_dict;
21781 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
21783 return obj_dict_version == __Pyx_get_object_dict_version(
obj);
21788 #if CYTHON_COMPILING_IN_CPYTHON
21789 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
21790 #if CYTHON_FAST_PYCALL
21791 if (PyFunction_Check(func)) {
21792 return __Pyx_PyFunction_FastCall(func, NULL, 0);
21795 #ifdef __Pyx_CyFunction_USED
21796 if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
21798 if (likely(PyCFunction_Check(func)))
21801 if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
21802 return __Pyx_PyObject_CallMethO(func, NULL);
21805 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
21810 static void __Pyx_RaiseDoubleKeywordsError(
21811 const char* func_name,
21814 PyErr_Format(PyExc_TypeError,
21815 #
if PY_MAJOR_VERSION >= 3
21816 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
21818 "%s() got multiple values for keyword argument '%s'", func_name,
21819 PyString_AsString(kw_name));
21824 static int __Pyx_ParseOptionalKeywords(
21826 PyObject **argnames[],
21828 PyObject *values[],
21829 Py_ssize_t num_pos_args,
21830 const char* function_name)
21832 PyObject *key = 0, *value = 0;
21833 Py_ssize_t pos = 0;
21835 PyObject*** first_kw_arg = argnames + num_pos_args;
21836 while (PyDict_Next(kwds, &pos, &key, &value)) {
21837 name = first_kw_arg;
21838 while (*name && (**name != key)) name++;
21840 values[name-argnames] = value;
21843 name = first_kw_arg;
21844 #if PY_MAJOR_VERSION < 3
21845 if (likely(PyString_Check(key))) {
21847 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
21848 && _PyString_Eq(**name, key)) {
21849 values[name-argnames] = value;
21854 if (*name)
continue;
21856 PyObject*** argname = argnames;
21857 while (argname != first_kw_arg) {
21858 if ((**argname == key) || (
21859 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
21860 && _PyString_Eq(**argname, key))) {
21861 goto arg_passed_twice;
21868 if (likely(PyUnicode_Check(key))) {
21870 int cmp = (**name == key) ? 0 :
21871 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
21872 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
21874 PyUnicode_Compare(**name, key);
21875 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
21877 values[name-argnames] = value;
21882 if (*name)
continue;
21884 PyObject*** argname = argnames;
21885 while (argname != first_kw_arg) {
21886 int cmp = (**argname == key) ? 0 :
21887 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
21888 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
21890 PyUnicode_Compare(**argname, key);
21891 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
21892 if (cmp == 0)
goto arg_passed_twice;
21897 goto invalid_keyword_type;
21899 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
21901 goto invalid_keyword;
21906 __Pyx_RaiseDoubleKeywordsError(function_name, key);
21908 invalid_keyword_type:
21909 PyErr_Format(PyExc_TypeError,
21910 "%.200s() keywords must be strings", function_name);
21913 PyErr_Format(PyExc_TypeError,
21914 #
if PY_MAJOR_VERSION < 3
21915 "%.200s() got an unexpected keyword argument '%.200s'",
21916 function_name, PyString_AsString(key));
21918 "%s() got an unexpected keyword argument '%U'",
21919 function_name, key);
21926 static void __Pyx_RaiseArgtupleInvalid(
21927 const char* func_name,
21929 Py_ssize_t num_min,
21930 Py_ssize_t num_max,
21931 Py_ssize_t num_found)
21933 Py_ssize_t num_expected;
21934 const char *more_or_less;
21935 if (num_found < num_min) {
21936 num_expected = num_min;
21937 more_or_less =
"at least";
21939 num_expected = num_max;
21940 more_or_less =
"at most";
21943 more_or_less =
"exactly";
21945 PyErr_Format(PyExc_TypeError,
21946 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
21947 func_name, more_or_less, num_expected,
21948 (num_expected == 1) ?
"" :
"s", num_found);
21952 #if CYTHON_USE_DICT_VERSIONS
21953 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
21955 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
21959 #if !CYTHON_AVOID_BORROWED_REFS
21960 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
21961 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
21962 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
21963 if (likely(result)) {
21964 return __Pyx_NewRef(result);
21965 }
else if (unlikely(PyErr_Occurred())) {
21969 result = PyDict_GetItem(__pyx_d, name);
21970 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
21971 if (likely(result)) {
21972 return __Pyx_NewRef(result);
21976 result = PyObject_GetItem(__pyx_d, name);
21977 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
21978 if (likely(result)) {
21979 return __Pyx_NewRef(result);
21983 return __Pyx_GetBuiltinName(name);
21987 #if CYTHON_USE_EXC_INFO_STACK
21988 static _PyErr_StackItem *
21989 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
21991 _PyErr_StackItem *exc_info = tstate->exc_info;
21992 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
21993 exc_info->previous_item != NULL)
21995 exc_info = exc_info->previous_item;
22002 #if CYTHON_FAST_THREAD_STATE
22003 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
22004 #if CYTHON_USE_EXC_INFO_STACK
22005 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
22006 *type = exc_info->exc_type;
22007 *value = exc_info->exc_value;
22008 *tb = exc_info->exc_traceback;
22010 *type = tstate->exc_type;
22011 *value = tstate->exc_value;
22012 *tb = tstate->exc_traceback;
22015 Py_XINCREF(*value);
22018 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
22019 PyObject *tmp_type, *tmp_value, *tmp_tb;
22020 #if CYTHON_USE_EXC_INFO_STACK
22021 _PyErr_StackItem *exc_info = tstate->exc_info;
22022 tmp_type = exc_info->exc_type;
22023 tmp_value = exc_info->exc_value;
22024 tmp_tb = exc_info->exc_traceback;
22025 exc_info->exc_type = type;
22026 exc_info->exc_value = value;
22027 exc_info->exc_traceback = tb;
22029 tmp_type = tstate->exc_type;
22030 tmp_value = tstate->exc_value;
22031 tmp_tb = tstate->exc_traceback;
22032 tstate->exc_type = type;
22033 tstate->exc_value = value;
22034 tstate->exc_traceback = tb;
22036 Py_XDECREF(tmp_type);
22037 Py_XDECREF(tmp_value);
22038 Py_XDECREF(tmp_tb);
22043 #if CYTHON_FAST_THREAD_STATE
22044 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
22046 n = PyTuple_GET_SIZE(tuple);
22047 #if PY_MAJOR_VERSION >= 3
22048 for (
i=0;
i<n;
i++) {
22049 if (exc_type == PyTuple_GET_ITEM(tuple,
i))
return 1;
22052 for (
i=0;
i<n;
i++) {
22053 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple,
i)))
return 1;
22057 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
22058 PyObject *exc_type = tstate->curexc_type;
22059 if (exc_type == err)
return 1;
22060 if (unlikely(!exc_type))
return 0;
22061 if (unlikely(PyTuple_Check(err)))
22062 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
22063 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
22068 #if CYTHON_FAST_THREAD_STATE
22069 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
22071 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
22074 PyObject *local_type, *local_value, *local_tb;
22075 #if CYTHON_FAST_THREAD_STATE
22076 PyObject *tmp_type, *tmp_value, *tmp_tb;
22077 local_type = tstate->curexc_type;
22078 local_value = tstate->curexc_value;
22079 local_tb = tstate->curexc_traceback;
22080 tstate->curexc_type = 0;
22081 tstate->curexc_value = 0;
22082 tstate->curexc_traceback = 0;
22084 PyErr_Fetch(&local_type, &local_value, &local_tb);
22086 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
22087 #if CYTHON_FAST_THREAD_STATE
22088 if (unlikely(tstate->curexc_type))
22090 if (unlikely(PyErr_Occurred()))
22093 #if PY_MAJOR_VERSION >= 3
22095 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
22099 Py_XINCREF(local_tb);
22100 Py_XINCREF(local_type);
22101 Py_XINCREF(local_value);
22102 *type = local_type;
22103 *value = local_value;
22105 #if CYTHON_FAST_THREAD_STATE
22106 #if CYTHON_USE_EXC_INFO_STACK
22108 _PyErr_StackItem *exc_info = tstate->exc_info;
22109 tmp_type = exc_info->exc_type;
22110 tmp_value = exc_info->exc_value;
22111 tmp_tb = exc_info->exc_traceback;
22112 exc_info->exc_type = local_type;
22113 exc_info->exc_value = local_value;
22114 exc_info->exc_traceback = local_tb;
22117 tmp_type = tstate->exc_type;
22118 tmp_value = tstate->exc_value;
22119 tmp_tb = tstate->exc_traceback;
22120 tstate->exc_type = local_type;
22121 tstate->exc_value = local_value;
22122 tstate->exc_traceback = local_tb;
22124 Py_XDECREF(tmp_type);
22125 Py_XDECREF(tmp_value);
22126 Py_XDECREF(tmp_tb);
22128 PyErr_SetExcInfo(local_type, local_value, local_tb);
22135 Py_XDECREF(local_type);
22136 Py_XDECREF(local_value);
22137 Py_XDECREF(local_tb);
22142 #if PY_MAJOR_VERSION < 3
22143 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
22144 CYTHON_UNUSED PyObject *cause) {
22145 __Pyx_PyThreadState_declare
22147 if (!value || value == Py_None)
22151 if (!tb || tb == Py_None)
22155 if (!PyTraceBack_Check(tb)) {
22156 PyErr_SetString(PyExc_TypeError,
22157 "raise: arg 3 must be a traceback or None");
22161 if (PyType_Check(type)) {
22162 #if CYTHON_COMPILING_IN_PYPY
22164 Py_INCREF(Py_None);
22168 PyErr_NormalizeException(&type, &value, &tb);
22171 PyErr_SetString(PyExc_TypeError,
22172 "instance exception may not have a separate value");
22176 type = (PyObject*) Py_TYPE(type);
22178 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
22179 PyErr_SetString(PyExc_TypeError,
22180 "raise: exception class must be a subclass of BaseException");
22184 __Pyx_PyThreadState_assign
22185 __Pyx_ErrRestore(type, value, tb);
22194 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
22195 PyObject* owned_instance = NULL;
22196 if (tb == Py_None) {
22198 }
else if (tb && !PyTraceBack_Check(tb)) {
22199 PyErr_SetString(PyExc_TypeError,
22200 "raise: arg 3 must be a traceback or None");
22203 if (value == Py_None)
22205 if (PyExceptionInstance_Check(type)) {
22207 PyErr_SetString(PyExc_TypeError,
22208 "instance exception may not have a separate value");
22212 type = (PyObject*) Py_TYPE(value);
22213 }
else if (PyExceptionClass_Check(type)) {
22214 PyObject *instance_class = NULL;
22215 if (value && PyExceptionInstance_Check(value)) {
22216 instance_class = (PyObject*) Py_TYPE(value);
22217 if (instance_class != type) {
22218 int is_subclass = PyObject_IsSubclass(instance_class, type);
22219 if (!is_subclass) {
22220 instance_class = NULL;
22221 }
else if (unlikely(is_subclass == -1)) {
22224 type = instance_class;
22228 if (!instance_class) {
22231 args = PyTuple_New(0);
22232 else if (PyTuple_Check(value)) {
22236 args = PyTuple_Pack(1, value);
22239 owned_instance = PyObject_Call(type, args, NULL);
22241 if (!owned_instance)
22243 value = owned_instance;
22244 if (!PyExceptionInstance_Check(value)) {
22245 PyErr_Format(PyExc_TypeError,
22246 "calling %R should have returned an instance of "
22247 "BaseException, not %R",
22248 type, Py_TYPE(value));
22253 PyErr_SetString(PyExc_TypeError,
22254 "raise: exception class must be a subclass of BaseException");
22258 PyObject *fixed_cause;
22259 if (cause == Py_None) {
22260 fixed_cause = NULL;
22261 }
else if (PyExceptionClass_Check(cause)) {
22262 fixed_cause = PyObject_CallObject(cause, NULL);
22263 if (fixed_cause == NULL)
22265 }
else if (PyExceptionInstance_Check(cause)) {
22266 fixed_cause = cause;
22267 Py_INCREF(fixed_cause);
22269 PyErr_SetString(PyExc_TypeError,
22270 "exception causes must derive from "
22274 PyException_SetCause(value, fixed_cause);
22276 PyErr_SetObject(type, value);
22278 #if CYTHON_COMPILING_IN_PYPY
22279 PyObject *tmp_type, *tmp_value, *tmp_tb;
22280 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
22282 PyErr_Restore(tmp_type, tmp_value, tb);
22283 Py_XDECREF(tmp_tb);
22285 PyThreadState *tstate = __Pyx_PyThreadState_Current;
22286 PyObject* tmp_tb = tstate->curexc_traceback;
22287 if (tb != tmp_tb) {
22289 tstate->curexc_traceback = tb;
22290 Py_XDECREF(tmp_tb);
22295 Py_XDECREF(owned_instance);
22301 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2) {
22302 PyObject *args, *result = NULL;
22303 #if CYTHON_FAST_PYCALL
22304 if (PyFunction_Check(
function)) {
22305 PyObject *args[2] = {arg1, arg2};
22306 return __Pyx_PyFunction_FastCall(
function, args, 2);
22309 #if CYTHON_FAST_PYCCALL
22310 if (__Pyx_PyFastCFunction_Check(
function)) {
22311 PyObject *args[2] = {arg1, arg2};
22312 return __Pyx_PyCFunction_FastCall(
function, args, 2);
22315 args = PyTuple_New(2);
22316 if (unlikely(!args))
goto done;
22318 PyTuple_SET_ITEM(args, 0, arg1);
22320 PyTuple_SET_ITEM(args, 1, arg2);
22321 Py_INCREF(
function);
22322 result = __Pyx_PyObject_Call(
function, args, NULL);
22324 Py_DECREF(
function);
22330 #if !CYTHON_COMPILING_IN_PYPY
22331 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
long intval,
int inplace,
int zerodivision_check) {
22333 (void)zerodivision_check;
22334 #if PY_MAJOR_VERSION < 3
22335 if (likely(PyInt_CheckExact(op1))) {
22336 const long b = intval;
22338 long a = PyInt_AS_LONG(op1);
22339 x = (long)((
unsigned long)a + b);
22340 if (likely((x^a) >= 0 || (x^b) >= 0))
22341 return PyInt_FromLong(x);
22342 return PyLong_Type.tp_as_number->nb_add(op1, op2);
22345 #if CYTHON_USE_PYLONG_INTERNALS
22346 if (likely(PyLong_CheckExact(op1))) {
22347 const long b = intval;
22349 #ifdef HAVE_LONG_LONG
22350 const PY_LONG_LONG llb = intval;
22351 PY_LONG_LONG lla, llx;
22353 const digit* digits = ((PyLongObject*)op1)->ob_digit;
22354 const Py_ssize_t size = Py_SIZE(op1);
22355 if (likely(__Pyx_sst_abs(size) <= 1)) {
22356 a = likely(size) ? digits[0] : 0;
22357 if (size == -1) a = -a;
22361 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
22362 a = -(long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
22364 #ifdef HAVE_LONG_LONG
22365 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
22366 lla = -(PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
22370 CYTHON_FALLTHROUGH;
22372 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
22373 a = (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
22375 #ifdef HAVE_LONG_LONG
22376 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
22377 lla = (PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
22381 CYTHON_FALLTHROUGH;
22383 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
22384 a = -(long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
22386 #ifdef HAVE_LONG_LONG
22387 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
22388 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]));
22392 CYTHON_FALLTHROUGH;
22394 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
22395 a = (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
22397 #ifdef HAVE_LONG_LONG
22398 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
22399 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]));
22403 CYTHON_FALLTHROUGH;
22405 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
22406 a = -(long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
22408 #ifdef HAVE_LONG_LONG
22409 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
22410 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]));
22414 CYTHON_FALLTHROUGH;
22416 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
22417 a = (long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
22419 #ifdef HAVE_LONG_LONG
22420 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
22421 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]));
22425 CYTHON_FALLTHROUGH;
22426 default:
return PyLong_Type.tp_as_number->nb_add(op1, op2);
22430 return PyLong_FromLong(x);
22431 #ifdef HAVE_LONG_LONG
22434 return PyLong_FromLongLong(llx);
22440 if (PyFloat_CheckExact(op1)) {
22441 const long b = intval;
22442 double a = PyFloat_AS_DOUBLE(op1);
22444 PyFPE_START_PROTECT(
"add",
return NULL)
22445 result = ((double)a) + (double)b;
22446 PyFPE_END_PROTECT(result)
22449 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
22454 static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
22455 const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop,
22456 const char* encoding,
const char* errors,
22457 PyObject* (*decode_func)(
const char *s, Py_ssize_t size,
const char *errors)) {
22458 if (unlikely((start < 0) | (stop < 0))) {
22469 if (unlikely(stop <= start))
22470 return __Pyx_NewRef(__pyx_empty_unicode);
22471 length = stop - start;
22474 return decode_func(cstring, length, errors);
22476 return PyUnicode_Decode(cstring, length, encoding, errors);
22481 #if CYTHON_FAST_THREAD_STATE
22482 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
22483 PyObject *tmp_type, *tmp_value, *tmp_tb;
22484 #if CYTHON_USE_EXC_INFO_STACK
22485 _PyErr_StackItem *exc_info = tstate->exc_info;
22486 tmp_type = exc_info->exc_type;
22487 tmp_value = exc_info->exc_value;
22488 tmp_tb = exc_info->exc_traceback;
22489 exc_info->exc_type = *type;
22490 exc_info->exc_value = *value;
22491 exc_info->exc_traceback = *tb;
22493 tmp_type = tstate->exc_type;
22494 tmp_value = tstate->exc_value;
22495 tmp_tb = tstate->exc_traceback;
22496 tstate->exc_type = *type;
22497 tstate->exc_value = *value;
22498 tstate->exc_traceback = *tb;
22501 *value = tmp_value;
22505 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
22506 PyObject *tmp_type, *tmp_value, *tmp_tb;
22507 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
22508 PyErr_SetExcInfo(*type, *value, *tb);
22510 *value = tmp_value;
22516 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
22519 r = PyObject_SetItem(o, j, v);
22523 static CYTHON_INLINE
int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t
i, PyObject *v,
int is_list,
22524 CYTHON_NCP_UNUSED
int wraparound, CYTHON_NCP_UNUSED
int boundscheck) {
22525 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
22526 if (is_list || PyList_CheckExact(o)) {
22527 Py_ssize_t n = (!wraparound) ?
i : ((likely(
i >= 0)) ?
i :
i + PyList_GET_SIZE(o));
22528 if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) {
22529 PyObject* old = PyList_GET_ITEM(o, n);
22531 PyList_SET_ITEM(o, n, v);
22536 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
22537 if (likely(m && m->sq_ass_item)) {
22538 if (wraparound && unlikely(
i < 0) && likely(m->sq_length)) {
22539 Py_ssize_t l = m->sq_length(o);
22540 if (likely(l >= 0)) {
22543 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
22548 return m->sq_ass_item(o,
i, v);
22552 #if CYTHON_COMPILING_IN_PYPY
22553 if (is_list || (PySequence_Check(o) && !PyDict_Check(o)))
22555 if (is_list || PySequence_Check(o))
22558 return PySequence_SetItem(o,
i, v);
22561 return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(
i), v);
22565 static int __Pyx__ArgTypeTest(PyObject *
obj, PyTypeObject *type,
const char *name,
int exact)
22567 if (unlikely(!type)) {
22568 PyErr_SetString(PyExc_SystemError,
"Missing type object");
22572 #if PY_MAJOR_VERSION == 2
22573 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(
obj)))
return 1;
22577 if (likely(__Pyx_TypeCheck(
obj, type)))
return 1;
22579 PyErr_Format(PyExc_TypeError,
22580 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
22581 name, type->tp_name, Py_TYPE(
obj)->tp_name);
22586 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level) {
22587 PyObject *empty_list = 0;
22588 PyObject *module = 0;
22589 PyObject *global_dict = 0;
22590 PyObject *empty_dict = 0;
22592 #if PY_MAJOR_VERSION < 3
22593 PyObject *py_import;
22594 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
22601 empty_list = PyList_New(0);
22606 global_dict = PyModule_GetDict(__pyx_m);
22609 empty_dict = PyDict_New();
22613 #if PY_MAJOR_VERSION >= 3
22615 if ((1) && (strchr(__Pyx_MODULE_NAME,
'.'))) {
22616 module = PyImport_ImportModuleLevelObject(
22617 name, global_dict, empty_dict, list, 1);
22619 if (!PyErr_ExceptionMatches(PyExc_ImportError))
22628 #if PY_MAJOR_VERSION < 3
22629 PyObject *py_level = PyInt_FromLong(level);
22632 module = PyObject_CallFunctionObjArgs(py_import,
22633 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
22634 Py_DECREF(py_level);
22636 module = PyImport_ImportModuleLevelObject(
22637 name, global_dict, empty_dict, list, level);
22642 #if PY_MAJOR_VERSION < 3
22643 Py_XDECREF(py_import);
22645 Py_XDECREF(empty_list);
22646 Py_XDECREF(empty_dict);
22651 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
22652 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
22653 PyErr_Format(PyExc_AttributeError,
22654 #
if PY_MAJOR_VERSION >= 3
22655 "'%.50s' object has no attribute '%U'",
22656 tp->tp_name, attr_name);
22658 "'%.50s' object has no attribute '%.400s'",
22659 tp->tp_name, PyString_AS_STRING(attr_name));
22663 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject*
obj, PyObject* attr_name) {
22665 PyTypeObject *tp = Py_TYPE(
obj);
22666 if (unlikely(!PyString_Check(attr_name))) {
22667 return PyObject_GenericGetAttr(
obj, attr_name);
22669 assert(!tp->tp_dictoffset);
22670 descr = _PyType_Lookup(tp, attr_name);
22671 if (unlikely(!descr)) {
22672 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
22675 #if PY_MAJOR_VERSION < 3
22676 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
22679 descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
22681 PyObject *res = f(descr,
obj, (PyObject *)tp);
22691 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
22692 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject*
obj, PyObject* attr_name) {
22693 if (unlikely(Py_TYPE(
obj)->tp_dictoffset)) {
22694 return PyObject_GenericGetAttr(
obj, attr_name);
22696 return __Pyx_PyObject_GenericGetAttrNoDict(
obj, attr_name);
22701 static int __Pyx_SetVtable(PyObject *dict,
void *vtable) {
22702 #if PY_VERSION_HEX >= 0x02070000
22703 PyObject *ob = PyCapsule_New(vtable, 0, 0);
22705 PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
22709 if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
22719 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(
void) {
22720 __Pyx_PyThreadState_declare
22721 __Pyx_PyThreadState_assign
22722 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
22723 __Pyx_PyErr_Clear();
22725 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject*
obj, PyObject* attr_name) {
22727 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
22728 PyTypeObject* tp = Py_TYPE(
obj);
22729 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
22730 return _PyObject_GenericGetAttrWithDict(
obj, attr_name, NULL, 1);
22733 result = __Pyx_PyObject_GetAttrStr(
obj, attr_name);
22734 if (unlikely(!result)) {
22735 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
22741 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
22743 PyObject *name_attr;
22744 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name);
22745 if (likely(name_attr)) {
22746 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
22750 if (unlikely(ret < 0)) {
22754 Py_XDECREF(name_attr);
22757 static int __Pyx_setup_reduce(PyObject* type_obj) {
22759 PyObject *object_reduce = NULL;
22760 PyObject *object_reduce_ex = NULL;
22761 PyObject *reduce = NULL;
22762 PyObject *reduce_ex = NULL;
22763 PyObject *reduce_cython = NULL;
22764 PyObject *setstate = NULL;
22765 PyObject *setstate_cython = NULL;
22766 #if CYTHON_USE_PYTYPE_LOOKUP
22767 if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate))
goto __PYX_GOOD;
22769 if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate))
goto __PYX_GOOD;
22771 #if CYTHON_USE_PYTYPE_LOOKUP
22772 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto __PYX_BAD;
22774 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto __PYX_BAD;
22776 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex);
if (unlikely(!reduce_ex))
goto __PYX_BAD;
22777 if (reduce_ex == object_reduce_ex) {
22778 #if CYTHON_USE_PYTYPE_LOOKUP
22779 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto __PYX_BAD;
22781 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto __PYX_BAD;
22783 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce);
if (unlikely(!reduce))
goto __PYX_BAD;
22784 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
22785 reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
22786 if (likely(reduce_cython)) {
22787 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
22788 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
22789 }
else if (reduce == object_reduce || PyErr_Occurred()) {
22792 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
22793 if (!setstate) PyErr_Clear();
22794 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
22795 setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
22796 if (likely(setstate_cython)) {
22797 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
22798 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
22799 }
else if (!setstate || PyErr_Occurred()) {
22803 PyType_Modified((PyTypeObject*)type_obj);
22808 if (!PyErr_Occurred())
22809 PyErr_Format(PyExc_RuntimeError,
"Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
22812 #if !CYTHON_USE_PYTYPE_LOOKUP
22813 Py_XDECREF(object_reduce);
22814 Py_XDECREF(object_reduce_ex);
22816 Py_XDECREF(reduce);
22817 Py_XDECREF(reduce_ex);
22818 Py_XDECREF(reduce_cython);
22819 Py_XDECREF(setstate);
22820 Py_XDECREF(setstate_cython);
22825 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals) {
22826 #if CYTHON_COMPILING_IN_PYPY
22827 return PyObject_RichCompareBool(s1, s2, equals);
22830 return (equals == Py_EQ);
22831 }
else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
22832 const char *ps1, *ps2;
22833 Py_ssize_t length = PyBytes_GET_SIZE(s1);
22834 if (length != PyBytes_GET_SIZE(s2))
22835 return (equals == Py_NE);
22836 ps1 = PyBytes_AS_STRING(s1);
22837 ps2 = PyBytes_AS_STRING(s2);
22838 if (ps1[0] != ps2[0]) {
22839 return (equals == Py_NE);
22840 }
else if (length == 1) {
22841 return (equals == Py_EQ);
22844 #if CYTHON_USE_UNICODE_INTERNALS
22845 Py_hash_t hash1, hash2;
22846 hash1 = ((PyBytesObject*)s1)->ob_shash;
22847 hash2 = ((PyBytesObject*)s2)->ob_shash;
22848 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
22849 return (equals == Py_NE);
22852 result = memcmp(ps1, ps2, (
size_t)length);
22853 return (equals == Py_EQ) ? (result == 0) : (result != 0);
22855 }
else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
22856 return (equals == Py_NE);
22857 }
else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
22858 return (equals == Py_NE);
22861 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
22864 result = __Pyx_PyObject_IsTrue(py_result);
22865 Py_DECREF(py_result);
22872 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals) {
22873 #if CYTHON_COMPILING_IN_PYPY
22874 return PyObject_RichCompareBool(s1, s2, equals);
22876 #if PY_MAJOR_VERSION < 3
22877 PyObject* owned_ref = NULL;
22879 int s1_is_unicode, s2_is_unicode;
22883 s1_is_unicode = PyUnicode_CheckExact(s1);
22884 s2_is_unicode = PyUnicode_CheckExact(s2);
22885 #if PY_MAJOR_VERSION < 3
22886 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
22887 owned_ref = PyUnicode_FromObject(s2);
22888 if (unlikely(!owned_ref))
22892 }
else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
22893 owned_ref = PyUnicode_FromObject(s1);
22894 if (unlikely(!owned_ref))
22898 }
else if (((!s2_is_unicode) & (!s1_is_unicode))) {
22899 return __Pyx_PyBytes_Equals(s1, s2, equals);
22902 if (s1_is_unicode & s2_is_unicode) {
22905 void *data1, *data2;
22906 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
22908 length = __Pyx_PyUnicode_GET_LENGTH(s1);
22909 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
22912 #if CYTHON_USE_UNICODE_INTERNALS
22914 Py_hash_t hash1, hash2;
22915 #if CYTHON_PEP393_ENABLED
22916 hash1 = ((PyASCIIObject*)s1)->hash;
22917 hash2 = ((PyASCIIObject*)s2)->hash;
22919 hash1 = ((PyUnicodeObject*)s1)->hash;
22920 hash2 = ((PyUnicodeObject*)s2)->hash;
22922 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
22927 kind = __Pyx_PyUnicode_KIND(s1);
22928 if (kind != __Pyx_PyUnicode_KIND(s2)) {
22931 data1 = __Pyx_PyUnicode_DATA(s1);
22932 data2 = __Pyx_PyUnicode_DATA(s2);
22933 if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
22935 }
else if (length == 1) {
22938 int result = memcmp(data1, data2, (
size_t)(length * kind));
22939 #if PY_MAJOR_VERSION < 3
22940 Py_XDECREF(owned_ref);
22942 return (equals == Py_EQ) ? (result == 0) : (result != 0);
22944 }
else if ((s1 == Py_None) & s2_is_unicode) {
22946 }
else if ((s2 == Py_None) & s1_is_unicode) {
22950 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
22951 #if PY_MAJOR_VERSION < 3
22952 Py_XDECREF(owned_ref);
22956 result = __Pyx_PyObject_IsTrue(py_result);
22957 Py_DECREF(py_result);
22961 #if PY_MAJOR_VERSION < 3
22962 Py_XDECREF(owned_ref);
22964 return (equals == Py_EQ);
22966 #if PY_MAJOR_VERSION < 3
22967 Py_XDECREF(owned_ref);
22969 return (equals == Py_NE);
22974 #ifndef CYTHON_CLINE_IN_TRACEBACK
22975 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate,
int c_line) {
22976 PyObject *use_cline;
22977 PyObject *ptype, *pvalue, *ptraceback;
22978 #if CYTHON_COMPILING_IN_CPYTHON
22979 PyObject **cython_runtime_dict;
22981 if (unlikely(!__pyx_cython_runtime)) {
22984 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
22985 #if CYTHON_COMPILING_IN_CPYTHON
22986 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
22987 if (likely(cython_runtime_dict)) {
22988 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
22989 use_cline, *cython_runtime_dict,
22990 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
22994 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
22995 if (use_cline_obj) {
22996 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
22997 Py_DECREF(use_cline_obj);
23005 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
23007 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
23010 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
23016 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
23017 int start = 0, mid = 0, end = count - 1;
23018 if (end >= 0 && code_line > entries[end].code_line) {
23021 while (start < end) {
23022 mid = start + (end - start) / 2;
23023 if (code_line < entries[mid].code_line) {
23025 }
else if (code_line > entries[mid].code_line) {
23031 if (code_line <= entries[mid].code_line) {
23037 static PyCodeObject *__pyx_find_code_object(
int code_line) {
23038 PyCodeObject* code_object;
23040 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
23043 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
23044 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
23047 code_object = __pyx_code_cache.entries[pos].code_object;
23048 Py_INCREF(code_object);
23049 return code_object;
23051 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
23053 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
23054 if (unlikely(!code_line)) {
23057 if (unlikely(!entries)) {
23058 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
23059 if (likely(entries)) {
23060 __pyx_code_cache.entries = entries;
23061 __pyx_code_cache.max_count = 64;
23062 __pyx_code_cache.count = 1;
23063 entries[0].code_line = code_line;
23064 entries[0].code_object = code_object;
23065 Py_INCREF(code_object);
23069 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
23070 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
23071 PyCodeObject* tmp = entries[pos].code_object;
23072 entries[pos].code_object = code_object;
23076 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
23077 int new_max = __pyx_code_cache.max_count + 64;
23078 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
23079 __pyx_code_cache.entries, ((
size_t)new_max) *
sizeof(__Pyx_CodeObjectCacheEntry));
23080 if (unlikely(!entries)) {
23083 __pyx_code_cache.entries = entries;
23084 __pyx_code_cache.max_count = new_max;
23086 for (
i=__pyx_code_cache.count;
i>pos;
i--) {
23087 entries[
i] = entries[
i-1];
23089 entries[pos].code_line = code_line;
23090 entries[pos].code_object = code_object;
23091 __pyx_code_cache.count++;
23092 Py_INCREF(code_object);
23096 #include "compile.h"
23097 #include "frameobject.h"
23098 #include "traceback.h"
23099 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
23100 const char *funcname,
int c_line,
23101 int py_line,
const char *filename) {
23102 PyCodeObject *py_code = 0;
23103 PyObject *py_srcfile = 0;
23104 PyObject *py_funcname = 0;
23105 #if PY_MAJOR_VERSION < 3
23106 py_srcfile = PyString_FromString(filename);
23108 py_srcfile = PyUnicode_FromString(filename);
23110 if (!py_srcfile)
goto bad;
23112 #if PY_MAJOR_VERSION < 3
23113 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
23115 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
23119 #if PY_MAJOR_VERSION < 3
23120 py_funcname = PyString_FromString(funcname);
23122 py_funcname = PyUnicode_FromString(funcname);
23125 if (!py_funcname)
goto bad;
23126 py_code = __Pyx_PyCode_New(
23143 Py_DECREF(py_srcfile);
23144 Py_DECREF(py_funcname);
23147 Py_XDECREF(py_srcfile);
23148 Py_XDECREF(py_funcname);
23151 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
23152 int py_line,
const char *filename) {
23153 PyCodeObject *py_code = 0;
23154 PyFrameObject *py_frame = 0;
23155 PyThreadState *tstate = __Pyx_PyThreadState_Current;
23157 c_line = __Pyx_CLineForTraceback(tstate, c_line);
23159 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
23161 py_code = __Pyx_CreateCodeObjectForTraceback(
23162 funcname, c_line, py_line, filename);
23163 if (!py_code)
goto bad;
23164 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
23166 py_frame = PyFrame_New(
23172 if (!py_frame)
goto bad;
23173 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
23174 PyTraceBack_Here(py_frame);
23176 Py_XDECREF(py_code);
23177 Py_XDECREF(py_frame);
23181 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
23182 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
23183 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
23184 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
23185 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
23187 func_type value = func_value;\
23188 if (sizeof(target_type) < sizeof(func_type)) {\
23189 if (unlikely(value != (func_type) (target_type) value)) {\
23190 func_type zero = 0;\
23191 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
23192 return (target_type) -1;\
23193 if (is_unsigned && unlikely(value < zero))\
23194 goto raise_neg_overflow;\
23196 goto raise_overflow;\
23199 return (target_type) value;\
23203 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value) {
23204 const int neg_one = (int) ((
int) 0 - (int) 1), const_zero = (int) 0;
23205 const int is_unsigned = neg_one > const_zero;
23207 if (
sizeof(
int) <
sizeof(long)) {
23208 return PyInt_FromLong((
long) value);
23209 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
23210 return PyLong_FromUnsignedLong((
unsigned long) value);
23211 #ifdef HAVE_LONG_LONG
23212 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
23213 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
23217 if (
sizeof(
int) <=
sizeof(
long)) {
23218 return PyInt_FromLong((
long) value);
23219 #ifdef HAVE_LONG_LONG
23220 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
23221 return PyLong_FromLongLong((PY_LONG_LONG) value);
23226 int one = 1;
int little = (int)*(
unsigned char *)&one;
23227 unsigned char *bytes = (
unsigned char *)&value;
23228 return _PyLong_FromByteArray(bytes,
sizeof(
int),
23229 little, !is_unsigned);
23234 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *x) {
23235 const int neg_one = (int) ((
int) 0 - (int) 1), const_zero = (int) 0;
23236 const int is_unsigned = neg_one > const_zero;
23237 #if PY_MAJOR_VERSION < 3
23238 if (likely(PyInt_Check(x))) {
23239 if (
sizeof(
int) <
sizeof(long)) {
23240 __PYX_VERIFY_RETURN_INT(
int,
long, PyInt_AS_LONG(x))
23242 long val = PyInt_AS_LONG(x);
23243 if (is_unsigned && unlikely(val < 0)) {
23244 goto raise_neg_overflow;
23250 if (likely(PyLong_Check(x))) {
23252 #if CYTHON_USE_PYLONG_INTERNALS
23253 const digit* digits = ((PyLongObject*)x)->ob_digit;
23254 switch (Py_SIZE(x)) {
23255 case 0:
return (
int) 0;
23256 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, digits[0])
23258 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
23259 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
23260 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
23261 }
else if (8 *
sizeof(
int) >= 2 * PyLong_SHIFT) {
23262 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
23267 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
23268 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
23269 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
23270 }
else if (8 *
sizeof(
int) >= 3 * PyLong_SHIFT) {
23271 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
23276 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
23277 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
23278 __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])))
23279 }
else if (8 *
sizeof(
int) >= 4 * PyLong_SHIFT) {
23280 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
23286 #if CYTHON_COMPILING_IN_CPYTHON
23287 if (unlikely(Py_SIZE(x) < 0)) {
23288 goto raise_neg_overflow;
23292 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
23293 if (unlikely(result < 0))
23295 if (unlikely(result == 1))
23296 goto raise_neg_overflow;
23299 if (
sizeof(
int) <=
sizeof(
unsigned long)) {
23300 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
23301 #ifdef HAVE_LONG_LONG
23302 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
23303 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
23307 #if CYTHON_USE_PYLONG_INTERNALS
23308 const digit* digits = ((PyLongObject*)x)->ob_digit;
23309 switch (Py_SIZE(x)) {
23310 case 0:
return (
int) 0;
23311 case -1: __PYX_VERIFY_RETURN_INT(
int, sdigit, (sdigit) (-(sdigit)digits[0]))
23312 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, +digits[0])
23314 if (8 *
sizeof(
int) - 1 > 1 * PyLong_SHIFT) {
23315 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
23316 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
23317 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
23318 return (
int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
23323 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
23324 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
23325 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
23326 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
23327 return (
int) ((((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
23332 if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
23333 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
23334 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
23335 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
23336 return (
int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
23341 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
23342 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
23343 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
23344 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
23345 return (
int) ((((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
23350 if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
23351 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
23352 __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])))
23353 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
23354 return (
int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
23359 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
23360 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
23361 __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])))
23362 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
23363 return (
int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
23369 if (
sizeof(
int) <=
sizeof(long)) {
23370 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
23371 #ifdef HAVE_LONG_LONG
23372 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
23373 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
23378 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
23379 PyErr_SetString(PyExc_RuntimeError,
23380 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
23383 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
23384 #if PY_MAJOR_VERSION < 3
23385 if (likely(v) && !PyLong_Check(v)) {
23387 v = PyNumber_Long(tmp);
23392 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
23393 unsigned char *bytes = (
unsigned char *)&val;
23394 int ret = _PyLong_AsByteArray((PyLongObject *)v,
23395 bytes,
sizeof(val),
23396 is_little, !is_unsigned);
23406 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
23407 if (!tmp)
return (
int) -1;
23408 val = __Pyx_PyInt_As_int(tmp);
23413 PyErr_SetString(PyExc_OverflowError,
23414 "value too large to convert to int");
23416 raise_neg_overflow:
23417 PyErr_SetString(PyExc_OverflowError,
23418 "can't convert negative value to int");
23423 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value) {
23424 const long neg_one = (long) ((
long) 0 - (long) 1), const_zero = (long) 0;
23425 const int is_unsigned = neg_one > const_zero;
23427 if (
sizeof(
long) <
sizeof(long)) {
23428 return PyInt_FromLong((
long) value);
23429 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
23430 return PyLong_FromUnsignedLong((
unsigned long) value);
23431 #ifdef HAVE_LONG_LONG
23432 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
23433 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
23437 if (
sizeof(
long) <=
sizeof(
long)) {
23438 return PyInt_FromLong((
long) value);
23439 #ifdef HAVE_LONG_LONG
23440 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
23441 return PyLong_FromLongLong((PY_LONG_LONG) value);
23446 int one = 1;
int little = (int)*(
unsigned char *)&one;
23447 unsigned char *bytes = (
unsigned char *)&value;
23448 return _PyLong_FromByteArray(bytes,
sizeof(
long),
23449 little, !is_unsigned);
23454 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *x) {
23455 const long neg_one = (long) ((
long) 0 - (long) 1), const_zero = (long) 0;
23456 const int is_unsigned = neg_one > const_zero;
23457 #if PY_MAJOR_VERSION < 3
23458 if (likely(PyInt_Check(x))) {
23459 if (
sizeof(
long) <
sizeof(long)) {
23460 __PYX_VERIFY_RETURN_INT(
long,
long, PyInt_AS_LONG(x))
23462 long val = PyInt_AS_LONG(x);
23463 if (is_unsigned && unlikely(val < 0)) {
23464 goto raise_neg_overflow;
23470 if (likely(PyLong_Check(x))) {
23472 #if CYTHON_USE_PYLONG_INTERNALS
23473 const digit* digits = ((PyLongObject*)x)->ob_digit;
23474 switch (Py_SIZE(x)) {
23475 case 0:
return (
long) 0;
23476 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, digits[0])
23478 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
23479 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
23480 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
23481 }
else if (8 *
sizeof(
long) >= 2 * PyLong_SHIFT) {
23482 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
23487 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
23488 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
23489 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
23490 }
else if (8 *
sizeof(
long) >= 3 * PyLong_SHIFT) {
23491 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
23496 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
23497 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
23498 __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])))
23499 }
else if (8 *
sizeof(
long) >= 4 * PyLong_SHIFT) {
23500 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
23506 #if CYTHON_COMPILING_IN_CPYTHON
23507 if (unlikely(Py_SIZE(x) < 0)) {
23508 goto raise_neg_overflow;
23512 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
23513 if (unlikely(result < 0))
23515 if (unlikely(result == 1))
23516 goto raise_neg_overflow;
23519 if (
sizeof(
long) <=
sizeof(
unsigned long)) {
23520 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
23521 #ifdef HAVE_LONG_LONG
23522 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
23523 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
23527 #if CYTHON_USE_PYLONG_INTERNALS
23528 const digit* digits = ((PyLongObject*)x)->ob_digit;
23529 switch (Py_SIZE(x)) {
23530 case 0:
return (
long) 0;
23531 case -1: __PYX_VERIFY_RETURN_INT(
long, sdigit, (sdigit) (-(sdigit)digits[0]))
23532 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, +digits[0])
23534 if (8 *
sizeof(
long) - 1 > 1 * PyLong_SHIFT) {
23535 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
23536 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
23537 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
23538 return (
long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
23543 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
23544 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
23545 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
23546 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
23547 return (
long) ((((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
23552 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
23553 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
23554 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
23555 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
23556 return (
long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
23561 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
23562 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
23563 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
23564 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
23565 return (
long) ((((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
23570 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
23571 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
23572 __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])))
23573 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
23574 return (
long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
23579 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
23580 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
23581 __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])))
23582 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
23583 return (
long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
23589 if (
sizeof(
long) <=
sizeof(long)) {
23590 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
23591 #ifdef HAVE_LONG_LONG
23592 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
23593 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
23598 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
23599 PyErr_SetString(PyExc_RuntimeError,
23600 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
23603 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
23604 #if PY_MAJOR_VERSION < 3
23605 if (likely(v) && !PyLong_Check(v)) {
23607 v = PyNumber_Long(tmp);
23612 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
23613 unsigned char *bytes = (
unsigned char *)&val;
23614 int ret = _PyLong_AsByteArray((PyLongObject *)v,
23615 bytes,
sizeof(val),
23616 is_little, !is_unsigned);
23626 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
23627 if (!tmp)
return (
long) -1;
23628 val = __Pyx_PyInt_As_long(tmp);
23633 PyErr_SetString(PyExc_OverflowError,
23634 "value too large to convert to long");
23636 raise_neg_overflow:
23637 PyErr_SetString(PyExc_OverflowError,
23638 "can't convert negative value to long");
23643 #if CYTHON_COMPILING_IN_CPYTHON
23644 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
23650 return b == &PyBaseObject_Type;
23652 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
23654 if (a == b)
return 1;
23658 n = PyTuple_GET_SIZE(mro);
23659 for (
i = 0;
i < n;
i++) {
23660 if (PyTuple_GET_ITEM(mro,
i) == (PyObject *)b)
23665 return __Pyx_InBases(a, b);
23667 #if PY_MAJOR_VERSION == 2
23668 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
23669 PyObject *exception, *value, *tb;
23671 __Pyx_PyThreadState_declare
23672 __Pyx_PyThreadState_assign
23673 __Pyx_ErrFetch(&exception, &value, &tb);
23674 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
23675 if (unlikely(res == -1)) {
23676 PyErr_WriteUnraisable(err);
23680 res = PyObject_IsSubclass(err, exc_type2);
23681 if (unlikely(res == -1)) {
23682 PyErr_WriteUnraisable(err);
23686 __Pyx_ErrRestore(exception, value, tb);
23690 static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
23691 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
23693 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
23698 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
23700 assert(PyExceptionClass_Check(exc_type));
23701 n = PyTuple_GET_SIZE(tuple);
23702 #if PY_MAJOR_VERSION >= 3
23703 for (
i=0;
i<n;
i++) {
23704 if (exc_type == PyTuple_GET_ITEM(tuple,
i))
return 1;
23707 for (
i=0;
i<n;
i++) {
23708 PyObject *t = PyTuple_GET_ITEM(tuple,
i);
23709 #if PY_MAJOR_VERSION < 3
23710 if (likely(exc_type == t))
return 1;
23712 if (likely(PyExceptionClass_Check(t))) {
23713 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
23719 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
23720 if (likely(err == exc_type))
return 1;
23721 if (likely(PyExceptionClass_Check(err))) {
23722 if (likely(PyExceptionClass_Check(exc_type))) {
23723 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
23724 }
else if (likely(PyTuple_Check(exc_type))) {
23725 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
23729 return PyErr_GivenExceptionMatches(err, exc_type);
23731 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
23732 assert(PyExceptionClass_Check(exc_type1));
23733 assert(PyExceptionClass_Check(exc_type2));
23734 if (likely(err == exc_type1 || err == exc_type2))
return 1;
23735 if (likely(PyExceptionClass_Check(err))) {
23736 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
23738 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
23743 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
23744 PyObject* fake_module;
23745 PyTypeObject* cached_type = NULL;
23746 fake_module = PyImport_AddModule((
char*)
"_cython_" CYTHON_ABI);
23747 if (!fake_module)
return NULL;
23748 Py_INCREF(fake_module);
23749 cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
23751 if (!PyType_Check((PyObject*)cached_type)) {
23752 PyErr_Format(PyExc_TypeError,
23753 "Shared Cython type %.200s is not a type object",
23757 if (cached_type->tp_basicsize != type->tp_basicsize) {
23758 PyErr_Format(PyExc_TypeError,
23759 "Shared Cython type %.200s has the wrong size, try recompiling",
23764 if (!PyErr_ExceptionMatches(PyExc_AttributeError))
goto bad;
23766 if (PyType_Ready(type) < 0)
goto bad;
23767 if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
23770 cached_type = type;
23773 Py_DECREF(fake_module);
23774 return cached_type;
23776 Py_XDECREF(cached_type);
23777 cached_type = NULL;
23782 static int __Pyx_PyObject_GetMethod(PyObject *
obj, PyObject *name, PyObject **method) {
23784 #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
23785 PyTypeObject *tp = Py_TYPE(
obj);
23787 descrgetfunc f = NULL;
23788 PyObject **dictptr, *dict;
23789 int meth_found = 0;
23790 assert (*method == NULL);
23791 if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
23792 attr = __Pyx_PyObject_GetAttrStr(
obj, name);
23795 if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
23798 descr = _PyType_Lookup(tp, name);
23799 if (likely(descr != NULL)) {
23801 #if PY_MAJOR_VERSION >= 3
23802 #ifdef __Pyx_CyFunction_USED
23803 if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
23805 if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type)))
23808 #ifdef __Pyx_CyFunction_USED
23809 if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
23811 if (likely(PyFunction_Check(descr)))
23817 f = Py_TYPE(descr)->tp_descr_get;
23818 if (f != NULL && PyDescr_IsData(descr)) {
23819 attr = f(descr,
obj, (PyObject *)Py_TYPE(
obj));
23825 dictptr = _PyObject_GetDictPtr(
obj);
23826 if (dictptr != NULL && (dict = *dictptr) != NULL) {
23828 attr = __Pyx_PyDict_GetItemStr(dict, name);
23829 if (attr != NULL) {
23842 attr = f(descr,
obj, (PyObject *)Py_TYPE(
obj));
23846 if (descr != NULL) {
23850 PyErr_Format(PyExc_AttributeError,
23851 #
if PY_MAJOR_VERSION >= 3
23852 "'%.50s' object has no attribute '%U'",
23853 tp->tp_name, name);
23855 "'%.50s' object has no attribute '%.400s'",
23856 tp->tp_name, PyString_AS_STRING(name));
23860 attr = __Pyx_PyObject_GetAttrStr(
obj, name);
23864 #if CYTHON_UNPACK_METHODS
23865 if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) ==
obj)) {
23866 PyObject *
function = PyMethod_GET_FUNCTION(attr);
23867 Py_INCREF(
function);
23869 *method =
function;
23878 static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
23879 PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
23883 static PyObject* __Pyx_PyObject_CallMethod1(PyObject*
obj, PyObject* method_name, PyObject* arg) {
23884 PyObject *method = NULL, *result;
23885 int is_method = __Pyx_PyObject_GetMethod(
obj, method_name, &method);
23886 if (likely(is_method)) {
23887 result = __Pyx_PyObject_Call2Args(method,
obj, arg);
23891 if (unlikely(!method))
return NULL;
23892 return __Pyx__PyObject_CallMethod1(method, arg);
23896 #include <structmember.h>
23897 #include <frameobject.h>
23898 #define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
23899 static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) {
23900 PyObject *et, *ev, *tb;
23901 PyObject *value = NULL;
23902 __Pyx_ErrFetch(&et, &ev, &tb);
23906 Py_INCREF(Py_None);
23910 if (likely(et == PyExc_StopIteration)) {
23912 Py_INCREF(Py_None);
23915 #if PY_VERSION_HEX >= 0x030300A0
23916 else if (Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) {
23917 value = ((PyStopIterationObject *)ev)->value;
23922 else if (unlikely(PyTuple_Check(ev))) {
23923 if (PyTuple_GET_SIZE(ev) >= 1) {
23924 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
23925 value = PyTuple_GET_ITEM(ev, 0);
23928 value = PySequence_ITEM(ev, 0);
23931 Py_INCREF(Py_None);
23936 else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
23939 if (likely(value)) {
23945 }
else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
23946 __Pyx_ErrRestore(et, ev, tb);
23949 PyErr_NormalizeException(&et, &ev, &tb);
23950 if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
23951 __Pyx_ErrRestore(et, ev, tb);
23956 #if PY_VERSION_HEX >= 0x030300A0
23957 value = ((PyStopIterationObject *)ev)->value;
23962 PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args);
23964 if (likely(args)) {
23965 value = PySequence_GetItem(args, 0);
23968 if (unlikely(!value)) {
23969 __Pyx_ErrRestore(NULL, NULL, NULL);
23970 Py_INCREF(Py_None);
23978 static CYTHON_INLINE
23979 void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) {
23980 PyObject *t, *v, *tb;
23981 t = exc_state->exc_type;
23982 v = exc_state->exc_value;
23983 tb = exc_state->exc_traceback;
23984 exc_state->exc_type = NULL;
23985 exc_state->exc_value = NULL;
23986 exc_state->exc_traceback = NULL;
23991 #define __Pyx_Coroutine_AlreadyRunningError(gen) (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL)
23992 static void __Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject *gen) {
23995 #ifdef __Pyx_Coroutine_USED
23996 }
else if (__Pyx_Coroutine_Check((PyObject*)gen)) {
23997 msg =
"coroutine already executing";
23999 #ifdef __Pyx_AsyncGen_USED
24000 }
else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
24001 msg =
"async generator already executing";
24004 msg =
"generator already executing";
24006 PyErr_SetString(PyExc_ValueError, msg);
24008 #define __Pyx_Coroutine_NotStartedError(gen) (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL)
24009 static void __Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject *gen) {
24012 #ifdef __Pyx_Coroutine_USED
24013 }
else if (__Pyx_Coroutine_Check(gen)) {
24014 msg =
"can't send non-None value to a just-started coroutine";
24016 #ifdef __Pyx_AsyncGen_USED
24017 }
else if (__Pyx_AsyncGen_CheckExact(gen)) {
24018 msg =
"can't send non-None value to a just-started async generator";
24021 msg =
"can't send non-None value to a just-started generator";
24023 PyErr_SetString(PyExc_TypeError, msg);
24025 #define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing) (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL)
24026 static void __Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject *gen, PyObject *value, CYTHON_UNUSED
int closing) {
24027 #ifdef __Pyx_Coroutine_USED
24028 if (!closing && __Pyx_Coroutine_Check(gen)) {
24029 PyErr_SetString(PyExc_RuntimeError,
"cannot reuse already awaited coroutine");
24033 #ifdef __Pyx_AsyncGen_USED
24034 if (__Pyx_AsyncGen_CheckExact(gen))
24035 PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration);
24038 PyErr_SetNone(PyExc_StopIteration);
24042 PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *
self, PyObject *value,
int closing) {
24043 __Pyx_PyThreadState_declare
24044 PyThreadState *tstate;
24045 __Pyx_ExcInfoStruct *exc_state;
24047 assert(!self->is_running);
24048 if (unlikely(self->resume_label == 0)) {
24049 if (unlikely(value && value != Py_None)) {
24050 return __Pyx_Coroutine_NotStartedError((PyObject*)
self);
24053 if (unlikely(self->resume_label == -1)) {
24054 return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)
self, value, closing);
24056 #if CYTHON_FAST_THREAD_STATE
24057 __Pyx_PyThreadState_assign
24058 tstate = __pyx_tstate;
24060 tstate = __Pyx_PyThreadState_Current;
24062 exc_state = &
self->gi_exc_state;
24063 if (exc_state->exc_type) {
24064 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
24066 if (exc_state->exc_traceback) {
24067 PyTracebackObject *tb = (PyTracebackObject *) exc_state->exc_traceback;
24068 PyFrameObject *f = tb->tb_frame;
24069 Py_XINCREF(tstate->frame);
24070 assert(f->f_back == NULL);
24071 f->f_back = tstate->frame;
24075 #if CYTHON_USE_EXC_INFO_STACK
24076 exc_state->previous_item = tstate->exc_info;
24077 tstate->exc_info = exc_state;
24079 if (exc_state->exc_type) {
24080 __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
24082 __Pyx_Coroutine_ExceptionClear(exc_state);
24083 __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
24086 self->is_running = 1;
24087 retval =
self->body((PyObject *)
self, tstate, value);
24088 self->is_running = 0;
24089 #if CYTHON_USE_EXC_INFO_STACK
24090 exc_state = &
self->gi_exc_state;
24091 tstate->exc_info = exc_state->previous_item;
24092 exc_state->previous_item = NULL;
24093 __Pyx_Coroutine_ResetFrameBackpointer(exc_state);
24097 static CYTHON_INLINE
void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) {
24098 PyObject *exc_tb = exc_state->exc_traceback;
24099 if (likely(exc_tb)) {
24100 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
24102 PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
24103 PyFrameObject *f = tb->tb_frame;
24104 Py_CLEAR(f->f_back);
24108 static CYTHON_INLINE
24109 PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *retval) {
24110 if (unlikely(!retval)) {
24111 __Pyx_PyThreadState_declare
24112 __Pyx_PyThreadState_assign
24113 if (!__Pyx_PyErr_Occurred()) {
24114 PyObject *exc = PyExc_StopIteration;
24115 #ifdef __Pyx_AsyncGen_USED
24116 if (__Pyx_AsyncGen_CheckExact(gen))
24117 exc = __Pyx_PyExc_StopAsyncIteration;
24119 __Pyx_PyErr_SetNone(exc);
24124 static CYTHON_INLINE
24125 PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
24127 PyObject *val = NULL;
24128 __Pyx_Coroutine_Undelegate(gen);
24129 __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
24130 ret = __Pyx_Coroutine_SendEx(gen, val, 0);
24134 static PyObject *__Pyx_Coroutine_Send(PyObject *
self, PyObject *value) {
24136 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*)
self;
24137 PyObject *yf = gen->yieldfrom;
24138 if (unlikely(gen->is_running))
24139 return __Pyx_Coroutine_AlreadyRunningError(gen);
24142 gen->is_running = 1;
24143 #ifdef __Pyx_Generator_USED
24144 if (__Pyx_Generator_CheckExact(yf)) {
24145 ret = __Pyx_Coroutine_Send(yf, value);
24148 #ifdef __Pyx_Coroutine_USED
24149 if (__Pyx_Coroutine_Check(yf)) {
24150 ret = __Pyx_Coroutine_Send(yf, value);
24153 #ifdef __Pyx_AsyncGen_USED
24154 if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
24155 ret = __Pyx_async_gen_asend_send(yf, value);
24158 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
24159 if (PyGen_CheckExact(yf)) {
24160 ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
24163 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
24164 if (PyCoro_CheckExact(yf)) {
24165 ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
24169 if (value == Py_None)
24170 ret = Py_TYPE(yf)->tp_iternext(yf);
24172 ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
24174 gen->is_running = 0;
24178 retval = __Pyx_Coroutine_FinishDelegation(gen);
24180 retval = __Pyx_Coroutine_SendEx(gen, value, 0);
24182 return __Pyx_Coroutine_MethodReturn(
self, retval);
24184 static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
24185 PyObject *retval = NULL;
24187 #ifdef __Pyx_Generator_USED
24188 if (__Pyx_Generator_CheckExact(yf)) {
24189 retval = __Pyx_Coroutine_Close(yf);
24194 #ifdef __Pyx_Coroutine_USED
24195 if (__Pyx_Coroutine_Check(yf)) {
24196 retval = __Pyx_Coroutine_Close(yf);
24200 if (__Pyx_CoroutineAwait_CheckExact(yf)) {
24201 retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL);
24206 #ifdef __Pyx_AsyncGen_USED
24207 if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
24208 retval = __Pyx_async_gen_asend_close(yf, NULL);
24210 if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
24211 retval = __Pyx_async_gen_athrow_close(yf, NULL);
24216 gen->is_running = 1;
24217 meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close);
24218 if (unlikely(!meth)) {
24219 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
24220 PyErr_WriteUnraisable(yf);
24224 retval = PyObject_CallFunction(meth, NULL);
24229 gen->is_running = 0;
24231 Py_XDECREF(retval);
24234 static PyObject *__Pyx_Generator_Next(PyObject *
self) {
24235 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*)
self;
24236 PyObject *yf = gen->yieldfrom;
24237 if (unlikely(gen->is_running))
24238 return __Pyx_Coroutine_AlreadyRunningError(gen);
24241 gen->is_running = 1;
24242 #ifdef __Pyx_Generator_USED
24243 if (__Pyx_Generator_CheckExact(yf)) {
24244 ret = __Pyx_Generator_Next(yf);
24247 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
24248 if (PyGen_CheckExact(yf)) {
24249 ret = _PyGen_Send((PyGenObject*)yf, NULL);
24252 #ifdef __Pyx_Coroutine_USED
24253 if (__Pyx_Coroutine_Check(yf)) {
24254 ret = __Pyx_Coroutine_Send(yf, Py_None);
24257 ret = Py_TYPE(yf)->tp_iternext(yf);
24258 gen->is_running = 0;
24262 return __Pyx_Coroutine_FinishDelegation(gen);
24264 return __Pyx_Coroutine_SendEx(gen, Py_None, 0);
24266 static PyObject *__Pyx_Coroutine_Close_Method(PyObject *
self, CYTHON_UNUSED PyObject *arg) {
24267 return __Pyx_Coroutine_Close(
self);
24269 static PyObject *__Pyx_Coroutine_Close(PyObject *
self) {
24270 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
24271 PyObject *retval, *raised_exception;
24272 PyObject *yf = gen->yieldfrom;
24274 if (unlikely(gen->is_running))
24275 return __Pyx_Coroutine_AlreadyRunningError(gen);
24278 err = __Pyx_Coroutine_CloseIter(gen, yf);
24279 __Pyx_Coroutine_Undelegate(gen);
24283 PyErr_SetNone(PyExc_GeneratorExit);
24284 retval = __Pyx_Coroutine_SendEx(gen, NULL, 1);
24285 if (unlikely(retval)) {
24289 #ifdef __Pyx_Coroutine_USED
24290 }
else if (__Pyx_Coroutine_Check(
self)) {
24291 msg =
"coroutine ignored GeneratorExit";
24293 #ifdef __Pyx_AsyncGen_USED
24294 }
else if (__Pyx_AsyncGen_CheckExact(
self)) {
24295 #if PY_VERSION_HEX < 0x03060000
24296 msg =
"async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)";
24298 msg =
"async generator ignored GeneratorExit";
24302 msg =
"generator ignored GeneratorExit";
24304 PyErr_SetString(PyExc_RuntimeError, msg);
24307 raised_exception = PyErr_Occurred();
24308 if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) {
24309 if (raised_exception) PyErr_Clear();
24310 Py_INCREF(Py_None);
24315 static PyObject *__Pyx__Coroutine_Throw(PyObject *
self, PyObject *typ, PyObject *val, PyObject *tb,
24316 PyObject *args,
int close_on_genexit) {
24317 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
24318 PyObject *yf = gen->yieldfrom;
24319 if (unlikely(gen->is_running))
24320 return __Pyx_Coroutine_AlreadyRunningError(gen);
24324 if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
24325 int err = __Pyx_Coroutine_CloseIter(gen, yf);
24327 __Pyx_Coroutine_Undelegate(gen);
24329 return __Pyx_Coroutine_MethodReturn(
self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
24332 gen->is_running = 1;
24334 #ifdef __Pyx_Generator_USED
24335 || __Pyx_Generator_CheckExact(yf)
24337 #ifdef __Pyx_Coroutine_USED
24338 || __Pyx_Coroutine_Check(yf)
24341 ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
24342 #ifdef __Pyx_Coroutine_USED
24343 }
else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
24344 ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
24347 PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw);
24348 if (unlikely(!meth)) {
24350 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
24351 gen->is_running = 0;
24355 __Pyx_Coroutine_Undelegate(gen);
24356 gen->is_running = 0;
24359 if (likely(args)) {
24360 ret = PyObject_CallObject(meth, args);
24362 ret = PyObject_CallFunctionObjArgs(meth, typ, val, tb, NULL);
24366 gen->is_running = 0;
24369 ret = __Pyx_Coroutine_FinishDelegation(gen);
24371 return __Pyx_Coroutine_MethodReturn(
self, ret);
24374 __Pyx_Raise(typ, val, tb, NULL);
24375 return __Pyx_Coroutine_MethodReturn(
self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
24377 static PyObject *__Pyx_Coroutine_Throw(PyObject *
self, PyObject *args) {
24379 PyObject *val = NULL;
24380 PyObject *tb = NULL;
24381 if (!PyArg_UnpackTuple(args, (
char *)
"throw", 1, 3, &typ, &val, &tb))
24383 return __Pyx__Coroutine_Throw(
self, typ, val, tb, args, 1);
24385 static CYTHON_INLINE
int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit,
void *arg) {
24386 Py_VISIT(exc_state->exc_type);
24387 Py_VISIT(exc_state->exc_value);
24388 Py_VISIT(exc_state->exc_traceback);
24391 static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit,
void *arg) {
24392 Py_VISIT(gen->closure);
24393 Py_VISIT(gen->classobj);
24394 Py_VISIT(gen->yieldfrom);
24395 return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg);
24397 static int __Pyx_Coroutine_clear(PyObject *
self) {
24398 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
24399 Py_CLEAR(gen->closure);
24400 Py_CLEAR(gen->classobj);
24401 Py_CLEAR(gen->yieldfrom);
24402 __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state);
24403 #ifdef __Pyx_AsyncGen_USED
24404 if (__Pyx_AsyncGen_CheckExact(
self)) {
24405 Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
24408 Py_CLEAR(gen->gi_code);
24409 Py_CLEAR(gen->gi_name);
24410 Py_CLEAR(gen->gi_qualname);
24411 Py_CLEAR(gen->gi_modulename);
24414 static void __Pyx_Coroutine_dealloc(PyObject *
self) {
24415 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
24416 PyObject_GC_UnTrack(gen);
24417 if (gen->gi_weakreflist != NULL)
24418 PyObject_ClearWeakRefs(
self);
24419 if (gen->resume_label >= 0) {
24420 PyObject_GC_Track(
self);
24421 #if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE
24422 if (PyObject_CallFinalizerFromDealloc(
self))
24424 Py_TYPE(gen)->tp_del(
self);
24425 if (self->ob_refcnt > 0)
24430 PyObject_GC_UnTrack(
self);
24432 #ifdef __Pyx_AsyncGen_USED
24433 if (__Pyx_AsyncGen_CheckExact(
self)) {
24437 Py_CLEAR(((__pyx_PyAsyncGenObject*)
self)->ag_finalizer);
24440 __Pyx_Coroutine_clear(
self);
24441 PyObject_GC_Del(gen);
24443 static void __Pyx_Coroutine_del(PyObject *
self) {
24444 PyObject *error_type, *error_value, *error_traceback;
24445 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
24446 __Pyx_PyThreadState_declare
24447 if (gen->resume_label < 0) {
24450 #if !CYTHON_USE_TP_FINALIZE
24451 assert(self->ob_refcnt == 0);
24452 self->ob_refcnt = 1;
24454 __Pyx_PyThreadState_assign
24455 __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
24456 #ifdef __Pyx_AsyncGen_USED
24457 if (__Pyx_AsyncGen_CheckExact(
self)) {
24458 __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)
self;
24459 PyObject *finalizer = agen->ag_finalizer;
24460 if (finalizer && !agen->ag_closed) {
24461 PyObject *res = __Pyx_PyObject_CallOneArg(finalizer,
self);
24462 if (unlikely(!res)) {
24463 PyErr_WriteUnraisable(
self);
24467 __Pyx_ErrRestore(error_type, error_value, error_traceback);
24472 if (unlikely(gen->resume_label == 0 && !error_value)) {
24473 #ifdef __Pyx_Coroutine_USED
24474 #ifdef __Pyx_Generator_USED
24475 if (!__Pyx_Generator_CheckExact(
self))
24478 PyObject_GC_UnTrack(
self);
24479 #if PY_MAJOR_VERSION >= 3 || defined(PyErr_WarnFormat)
24480 if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1,
"coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
24481 PyErr_WriteUnraisable(
self);
24485 #if CYTHON_COMPILING_IN_PYPY
24487 cmsg = (
char*)
"coroutine was never awaited";
24490 PyObject *qualname;
24491 qualname = gen->gi_qualname;
24492 cname = PyString_AS_STRING(qualname);
24493 msg = PyString_FromFormat(
"coroutine '%.50s' was never awaited", cname);
24494 if (unlikely(!msg)) {
24496 cmsg = (
char*)
"coroutine was never awaited";
24498 cmsg = PyString_AS_STRING(msg);
24501 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0))
24502 PyErr_WriteUnraisable(
self);
24505 PyObject_GC_Track(
self);
24509 PyObject *res = __Pyx_Coroutine_Close(
self);
24510 if (unlikely(!res)) {
24511 if (PyErr_Occurred())
24512 PyErr_WriteUnraisable(
self);
24517 __Pyx_ErrRestore(error_type, error_value, error_traceback);
24518 #if !CYTHON_USE_TP_FINALIZE
24519 assert(self->ob_refcnt > 0);
24520 if (--self->ob_refcnt == 0) {
24524 Py_ssize_t refcnt =
self->ob_refcnt;
24525 _Py_NewReference(
self);
24526 self->ob_refcnt = refcnt;
24528 #if CYTHON_COMPILING_IN_CPYTHON
24529 assert(PyType_IS_GC(self->ob_type) &&
24530 _Py_AS_GC(
self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
24533 #ifdef COUNT_ALLOCS
24534 --Py_TYPE(
self)->tp_frees;
24535 --Py_TYPE(
self)->tp_allocs;
24540 __Pyx_Coroutine_get_name(__pyx_CoroutineObject *
self, CYTHON_UNUSED
void *context)
24542 PyObject *name =
self->gi_name;
24543 if (unlikely(!name)) name = Py_None;
24548 __Pyx_Coroutine_set_name(__pyx_CoroutineObject *
self, PyObject *value, CYTHON_UNUSED
void *context)
24551 #if PY_MAJOR_VERSION >= 3
24552 if (unlikely(value == NULL || !PyUnicode_Check(value)))
24554 if (unlikely(value == NULL || !PyString_Check(value)))
24557 PyErr_SetString(PyExc_TypeError,
24558 "__name__ must be set to a string object");
24561 tmp =
self->gi_name;
24563 self->gi_name = value;
24568 __Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *
self, CYTHON_UNUSED
void *context)
24570 PyObject *name =
self->gi_qualname;
24571 if (unlikely(!name)) name = Py_None;
24576 __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *
self, PyObject *value, CYTHON_UNUSED
void *context)
24579 #if PY_MAJOR_VERSION >= 3
24580 if (unlikely(value == NULL || !PyUnicode_Check(value)))
24582 if (unlikely(value == NULL || !PyString_Check(value)))
24585 PyErr_SetString(PyExc_TypeError,
24586 "__qualname__ must be set to a string object");
24589 tmp =
self->gi_qualname;
24591 self->gi_qualname = value;
24595 static __pyx_CoroutineObject *__Pyx__Coroutine_New(
24596 PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
24597 PyObject *name, PyObject *qualname, PyObject *module_name) {
24598 __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
24599 if (unlikely(!gen))
24601 return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name);
24603 static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
24604 __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
24605 PyObject *name, PyObject *qualname, PyObject *module_name) {
24607 gen->closure = closure;
24608 Py_XINCREF(closure);
24609 gen->is_running = 0;
24610 gen->resume_label = 0;
24611 gen->classobj = NULL;
24612 gen->yieldfrom = NULL;
24613 gen->gi_exc_state.exc_type = NULL;
24614 gen->gi_exc_state.exc_value = NULL;
24615 gen->gi_exc_state.exc_traceback = NULL;
24616 #if CYTHON_USE_EXC_INFO_STACK
24617 gen->gi_exc_state.previous_item = NULL;
24619 gen->gi_weakreflist = NULL;
24620 Py_XINCREF(qualname);
24621 gen->gi_qualname = qualname;
24623 gen->gi_name = name;
24624 Py_XINCREF(module_name);
24625 gen->gi_modulename = module_name;
24627 gen->gi_code = code;
24628 PyObject_GC_Track(gen);
24633 static PyObject* __Pyx_Coroutine_patch_module(PyObject* module,
const char* py_code) {
24634 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
24636 PyObject *globals, *result_obj;
24637 globals = PyDict_New();
if (unlikely(!globals))
goto ignore;
24638 result = PyDict_SetItemString(globals,
"_cython_coroutine_type",
24639 #ifdef __Pyx_Coroutine_USED
24640 (PyObject*)__pyx_CoroutineType);
24644 if (unlikely(result < 0))
goto ignore;
24645 result = PyDict_SetItemString(globals,
"_cython_generator_type",
24646 #ifdef __Pyx_Generator_USED
24647 (PyObject*)__pyx_GeneratorType);
24651 if (unlikely(result < 0))
goto ignore;
24652 if (unlikely(PyDict_SetItemString(globals,
"_module", module) < 0))
goto ignore;
24653 if (unlikely(PyDict_SetItemString(globals,
"__builtins__", __pyx_b) < 0))
goto ignore;
24654 result_obj = PyRun_String(py_code, Py_file_input, globals, globals);
24655 if (unlikely(!result_obj))
goto ignore;
24656 Py_DECREF(result_obj);
24657 Py_DECREF(globals);
24660 Py_XDECREF(globals);
24661 PyErr_WriteUnraisable(module);
24662 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
"Cython module failed to patch module with custom type", 1) < 0)) {
24673 #ifndef CYTHON_REGISTER_ABCS
24674 #define CYTHON_REGISTER_ABCS 1
24676 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
24677 static PyObject* __Pyx_patch_abc_module(PyObject *module);
24678 static PyObject* __Pyx_patch_abc_module(PyObject *module) {
24679 module = __Pyx_Coroutine_patch_module(
24681 "if _cython_generator_type is not None:\n"
24682 " try: Generator = _module.Generator\n"
24683 " except AttributeError: pass\n"
24684 " else: Generator.register(_cython_generator_type)\n"
24685 "if _cython_coroutine_type is not None:\n"
24686 " try: Coroutine = _module.Coroutine\n"
24687 " except AttributeError: pass\n"
24688 " else: Coroutine.register(_cython_coroutine_type)\n"
24693 static int __Pyx_patch_abc(
void) {
24694 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
24695 static int abc_patched = 0;
24696 if (CYTHON_REGISTER_ABCS && !abc_patched) {
24698 module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ?
"collections.abc" :
"collections");
24700 PyErr_WriteUnraisable(NULL);
24701 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
24702 ((PY_MAJOR_VERSION >= 3) ?
24703 "Cython module failed to register with collections.abc module" :
24704 "Cython module failed to register with collections module"), 1) < 0)) {
24708 module = __Pyx_patch_abc_module(module);
24710 if (unlikely(!module))
24714 module = PyImport_ImportModule(
"backports_abc");
24716 module = __Pyx_patch_abc_module(module);
24717 Py_XDECREF(module);
24724 if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL);
24730 static PyMethodDef __pyx_Generator_methods[] = {
24731 {
"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
24732 (
char*) PyDoc_STR(
"send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
24733 {
"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
24734 (
char*) PyDoc_STR(
"throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
24735 {
"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS,
24736 (
char*) PyDoc_STR(
"close() -> raise GeneratorExit inside generator.")},
24739 static PyMemberDef __pyx_Generator_memberlist[] = {
24740 {(
char *)
"gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL},
24741 {(
char*)
"gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
24742 (
char*) PyDoc_STR(
"object being iterated by 'yield from', or None")},
24743 {(
char*)
"gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
24746 static PyGetSetDef __pyx_Generator_getsets[] = {
24747 {(
char *)
"__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
24748 (
char*) PyDoc_STR(
"name of the generator"), 0},
24749 {(
char *)
"__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
24750 (
char*) PyDoc_STR(
"qualified name of the generator"), 0},
24753 static PyTypeObject __pyx_GeneratorType_type = {
24754 PyVarObject_HEAD_INIT(0, 0)
24756 sizeof(__pyx_CoroutineObject),
24758 (destructor) __Pyx_Coroutine_dealloc,
24773 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
24775 (traverseproc) __Pyx_Coroutine_traverse,
24778 offsetof(__pyx_CoroutineObject, gi_weakreflist),
24780 (iternextfunc) __Pyx_Generator_Next,
24781 __pyx_Generator_methods,
24782 __pyx_Generator_memberlist,
24783 __pyx_Generator_getsets,
24799 #
if CYTHON_USE_TP_FINALIZE
24802 __Pyx_Coroutine_del,
24805 #
if CYTHON_USE_TP_FINALIZE
24806 __Pyx_Coroutine_del,
24807 #elif PY_VERSION_HEX >= 0x030400a1
24810 #
if PY_VERSION_HEX >= 0x030800b1
24813 #
if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
24817 static int __pyx_Generator_init(
void) {
24818 __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
24819 __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
24820 __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
24821 if (unlikely(!__pyx_GeneratorType)) {
24828 static int __Pyx_check_binary_version(
void) {
24829 char ctversion[4], rtversion[4];
24830 PyOS_snprintf(ctversion, 4,
"%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
24831 PyOS_snprintf(rtversion, 4,
"%s", Py_GetVersion());
24832 if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
24834 PyOS_snprintf(message,
sizeof(message),
24835 "compiletime version %s of module '%.100s' "
24836 "does not match runtime version %s",
24837 ctversion, __Pyx_MODULE_NAME, rtversion);
24838 return PyErr_WarnEx(NULL, message, 1);
24844 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
24846 #if PY_MAJOR_VERSION < 3
24847 if (t->is_unicode) {
24848 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
24849 }
else if (t->intern) {
24850 *t->p = PyString_InternFromString(t->s);
24852 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
24855 if (t->is_unicode | t->is_str) {
24857 *t->p = PyUnicode_InternFromString(t->s);
24858 }
else if (t->encoding) {
24859 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
24861 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
24864 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
24869 if (PyObject_Hash(*t->p) == -1)
24876 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
24877 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
24879 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
24881 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
24883 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
24884 #if !CYTHON_PEP393_ENABLED
24885 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
24887 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
24888 if (!defenc)
return NULL;
24889 defenc_c = PyBytes_AS_STRING(defenc);
24890 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
24892 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
24894 for (c = defenc_c; c < end; c++) {
24895 if ((
unsigned char) (*c) >= 128) {
24896 PyUnicode_AsASCIIString(o);
24902 *length = PyBytes_GET_SIZE(defenc);
24906 static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
24907 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
24908 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
24909 if (likely(PyUnicode_IS_ASCII(o))) {
24910 *length = PyUnicode_GET_LENGTH(o);
24911 return PyUnicode_AsUTF8(o);
24913 PyUnicode_AsASCIIString(o);
24917 return PyUnicode_AsUTF8AndSize(o, length);
24922 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
24923 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
24925 #
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
24926 __Pyx_sys_getdefaultencoding_not_ascii &&
24928 PyUnicode_Check(o)) {
24929 return __Pyx_PyUnicode_AsStringAndSize(o, length);
24932 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
24933 if (PyByteArray_Check(o)) {
24934 *length = PyByteArray_GET_SIZE(o);
24935 return PyByteArray_AS_STRING(o);
24940 int r = PyBytes_AsStringAndSize(o, &result, length);
24941 if (unlikely(r < 0)) {
24948 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
24949 int is_true = x == Py_True;
24950 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
24951 else return PyObject_IsTrue(x);
24953 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
24955 if (unlikely(!x))
return -1;
24956 retval = __Pyx_PyObject_IsTrue(x);
24960 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result,
const char* type_name) {
24961 #if PY_MAJOR_VERSION >= 3
24962 if (PyLong_Check(result)) {
24963 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
24964 "__int__ returned non-int (type %.200s). "
24965 "The ability to return an instance of a strict subclass of int "
24966 "is deprecated, and may be removed in a future version of Python.",
24967 Py_TYPE(result)->tp_name)) {
24974 PyErr_Format(PyExc_TypeError,
24975 "__%.4s__ returned non-%.4s (type %.200s)",
24976 type_name, type_name, Py_TYPE(result)->tp_name);
24980 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
24981 #if CYTHON_USE_TYPE_SLOTS
24982 PyNumberMethods *m;
24984 const char *name = NULL;
24985 PyObject *res = NULL;
24986 #if PY_MAJOR_VERSION < 3
24987 if (likely(PyInt_Check(x) || PyLong_Check(x)))
24989 if (likely(PyLong_Check(x)))
24991 return __Pyx_NewRef(x);
24992 #if CYTHON_USE_TYPE_SLOTS
24993 m = Py_TYPE(x)->tp_as_number;
24994 #if PY_MAJOR_VERSION < 3
24995 if (m && m->nb_int) {
24997 res = m->nb_int(x);
24999 else if (m && m->nb_long) {
25001 res = m->nb_long(x);
25004 if (likely(m && m->nb_int)) {
25006 res = m->nb_int(x);
25010 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
25011 res = PyNumber_Int(x);
25015 #if PY_MAJOR_VERSION < 3
25016 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
25018 if (unlikely(!PyLong_CheckExact(res))) {
25020 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
25023 else if (!PyErr_Occurred()) {
25024 PyErr_SetString(PyExc_TypeError,
25025 "an integer is required");
25029 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
25032 #if PY_MAJOR_VERSION < 3
25033 if (likely(PyInt_CheckExact(b))) {
25034 if (
sizeof(Py_ssize_t) >=
sizeof(
long))
25035 return PyInt_AS_LONG(b);
25037 return PyInt_AsSsize_t(b);
25040 if (likely(PyLong_CheckExact(b))) {
25041 #if CYTHON_USE_PYLONG_INTERNALS
25042 const digit* digits = ((PyLongObject*)b)->ob_digit;
25043 const Py_ssize_t size = Py_SIZE(b);
25044 if (likely(__Pyx_sst_abs(size) <= 1)) {
25045 ival = likely(size) ? digits[0] : 0;
25046 if (size == -1) ival = -ival;
25051 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
25052 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
25056 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
25057 return -(Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
25061 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
25062 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
25066 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
25067 return -(Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
25071 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
25072 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]));
25076 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
25077 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]));
25083 return PyLong_AsSsize_t(b);
25085 x = PyNumber_Index(b);
25087 ival = PyInt_AsSsize_t(x);
25091 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
25092 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
25094 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
25095 return PyInt_FromSize_t(ival);