66 #define PY_SSIZE_T_CLEAN
69 #error Python headers needed to compile C extensions, please install development version of Python.
70 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
71 #error Cython requires Python 2.6+ or Python 3.3+.
73 #define CYTHON_ABI "0_29_10"
74 #define CYTHON_HEX_VERSION 0x001D0AF0
75 #define CYTHON_FUTURE_DIVISION 1
78 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
80 #if !defined(WIN32) && !defined(MS_WINDOWS)
92 #define DL_IMPORT(t) t
95 #define DL_EXPORT(t) t
98 #ifndef HAVE_LONG_LONG
99 #if PY_VERSION_HEX >= 0x02070000
100 #define HAVE_LONG_LONG
104 #define PY_LONG_LONG LONG_LONG
107 #define Py_HUGE_VAL HUGE_VAL
110 #define CYTHON_COMPILING_IN_PYPY 1
111 #define CYTHON_COMPILING_IN_PYSTON 0
112 #define CYTHON_COMPILING_IN_CPYTHON 0
113 #undef CYTHON_USE_TYPE_SLOTS
114 #define CYTHON_USE_TYPE_SLOTS 0
115 #undef CYTHON_USE_PYTYPE_LOOKUP
116 #define CYTHON_USE_PYTYPE_LOOKUP 0
117 #if PY_VERSION_HEX < 0x03050000
118 #undef CYTHON_USE_ASYNC_SLOTS
119 #define CYTHON_USE_ASYNC_SLOTS 0
120 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
121 #define CYTHON_USE_ASYNC_SLOTS 1
123 #undef CYTHON_USE_PYLIST_INTERNALS
124 #define CYTHON_USE_PYLIST_INTERNALS 0
125 #undef CYTHON_USE_UNICODE_INTERNALS
126 #define CYTHON_USE_UNICODE_INTERNALS 0
127 #undef CYTHON_USE_UNICODE_WRITER
128 #define CYTHON_USE_UNICODE_WRITER 0
129 #undef CYTHON_USE_PYLONG_INTERNALS
130 #define CYTHON_USE_PYLONG_INTERNALS 0
131 #undef CYTHON_AVOID_BORROWED_REFS
132 #define CYTHON_AVOID_BORROWED_REFS 1
133 #undef CYTHON_ASSUME_SAFE_MACROS
134 #define CYTHON_ASSUME_SAFE_MACROS 0
135 #undef CYTHON_UNPACK_METHODS
136 #define CYTHON_UNPACK_METHODS 0
137 #undef CYTHON_FAST_THREAD_STATE
138 #define CYTHON_FAST_THREAD_STATE 0
139 #undef CYTHON_FAST_PYCALL
140 #define CYTHON_FAST_PYCALL 0
141 #undef CYTHON_PEP489_MULTI_PHASE_INIT
142 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
143 #undef CYTHON_USE_TP_FINALIZE
144 #define CYTHON_USE_TP_FINALIZE 0
145 #undef CYTHON_USE_DICT_VERSIONS
146 #define CYTHON_USE_DICT_VERSIONS 0
147 #undef CYTHON_USE_EXC_INFO_STACK
148 #define CYTHON_USE_EXC_INFO_STACK 0
149 #elif defined(PYSTON_VERSION)
150 #define CYTHON_COMPILING_IN_PYPY 0
151 #define CYTHON_COMPILING_IN_PYSTON 1
152 #define CYTHON_COMPILING_IN_CPYTHON 0
153 #ifndef CYTHON_USE_TYPE_SLOTS
154 #define CYTHON_USE_TYPE_SLOTS 1
156 #undef CYTHON_USE_PYTYPE_LOOKUP
157 #define CYTHON_USE_PYTYPE_LOOKUP 0
158 #undef CYTHON_USE_ASYNC_SLOTS
159 #define CYTHON_USE_ASYNC_SLOTS 0
160 #undef CYTHON_USE_PYLIST_INTERNALS
161 #define CYTHON_USE_PYLIST_INTERNALS 0
162 #ifndef CYTHON_USE_UNICODE_INTERNALS
163 #define CYTHON_USE_UNICODE_INTERNALS 1
165 #undef CYTHON_USE_UNICODE_WRITER
166 #define CYTHON_USE_UNICODE_WRITER 0
167 #undef CYTHON_USE_PYLONG_INTERNALS
168 #define CYTHON_USE_PYLONG_INTERNALS 0
169 #ifndef CYTHON_AVOID_BORROWED_REFS
170 #define CYTHON_AVOID_BORROWED_REFS 0
172 #ifndef CYTHON_ASSUME_SAFE_MACROS
173 #define CYTHON_ASSUME_SAFE_MACROS 1
175 #ifndef CYTHON_UNPACK_METHODS
176 #define CYTHON_UNPACK_METHODS 1
178 #undef CYTHON_FAST_THREAD_STATE
179 #define CYTHON_FAST_THREAD_STATE 0
180 #undef CYTHON_FAST_PYCALL
181 #define CYTHON_FAST_PYCALL 0
182 #undef CYTHON_PEP489_MULTI_PHASE_INIT
183 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
184 #undef CYTHON_USE_TP_FINALIZE
185 #define CYTHON_USE_TP_FINALIZE 0
186 #undef CYTHON_USE_DICT_VERSIONS
187 #define CYTHON_USE_DICT_VERSIONS 0
188 #undef CYTHON_USE_EXC_INFO_STACK
189 #define CYTHON_USE_EXC_INFO_STACK 0
191 #define CYTHON_COMPILING_IN_PYPY 0
192 #define CYTHON_COMPILING_IN_PYSTON 0
193 #define CYTHON_COMPILING_IN_CPYTHON 1
194 #ifndef CYTHON_USE_TYPE_SLOTS
195 #define CYTHON_USE_TYPE_SLOTS 1
197 #if PY_VERSION_HEX < 0x02070000
198 #undef CYTHON_USE_PYTYPE_LOOKUP
199 #define CYTHON_USE_PYTYPE_LOOKUP 0
200 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
201 #define CYTHON_USE_PYTYPE_LOOKUP 1
203 #if PY_MAJOR_VERSION < 3
204 #undef CYTHON_USE_ASYNC_SLOTS
205 #define CYTHON_USE_ASYNC_SLOTS 0
206 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
207 #define CYTHON_USE_ASYNC_SLOTS 1
209 #if PY_VERSION_HEX < 0x02070000
210 #undef CYTHON_USE_PYLONG_INTERNALS
211 #define CYTHON_USE_PYLONG_INTERNALS 0
212 #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
213 #define CYTHON_USE_PYLONG_INTERNALS 1
215 #ifndef CYTHON_USE_PYLIST_INTERNALS
216 #define CYTHON_USE_PYLIST_INTERNALS 1
218 #ifndef CYTHON_USE_UNICODE_INTERNALS
219 #define CYTHON_USE_UNICODE_INTERNALS 1
221 #if PY_VERSION_HEX < 0x030300F0
222 #undef CYTHON_USE_UNICODE_WRITER
223 #define CYTHON_USE_UNICODE_WRITER 0
224 #elif !defined(CYTHON_USE_UNICODE_WRITER)
225 #define CYTHON_USE_UNICODE_WRITER 1
227 #ifndef CYTHON_AVOID_BORROWED_REFS
228 #define CYTHON_AVOID_BORROWED_REFS 0
230 #ifndef CYTHON_ASSUME_SAFE_MACROS
231 #define CYTHON_ASSUME_SAFE_MACROS 1
233 #ifndef CYTHON_UNPACK_METHODS
234 #define CYTHON_UNPACK_METHODS 1
236 #ifndef CYTHON_FAST_THREAD_STATE
237 #define CYTHON_FAST_THREAD_STATE 1
239 #ifndef CYTHON_FAST_PYCALL
240 #define CYTHON_FAST_PYCALL 1
242 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
243 #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
245 #ifndef CYTHON_USE_TP_FINALIZE
246 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
248 #ifndef CYTHON_USE_DICT_VERSIONS
249 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
251 #ifndef CYTHON_USE_EXC_INFO_STACK
252 #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
255 #if !defined(CYTHON_FAST_PYCCALL)
256 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
258 #if CYTHON_USE_PYLONG_INTERNALS
259 #include "longintrepr.h"
264 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P ==
sizeof(
void*)) };
267 #ifndef __has_attribute
268 #define __has_attribute(x) 0
270 #ifndef __has_cpp_attribute
271 #define __has_cpp_attribute(x) 0
273 #ifndef CYTHON_RESTRICT
274 #if defined(__GNUC__)
275 #define CYTHON_RESTRICT __restrict__
276 #elif defined(_MSC_VER) && _MSC_VER >= 1400
277 #define CYTHON_RESTRICT __restrict
278 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
279 #define CYTHON_RESTRICT restrict
281 #define CYTHON_RESTRICT
284 #ifndef CYTHON_UNUSED
285 # if defined(__GNUC__)
286 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
287 # define CYTHON_UNUSED __attribute__ ((__unused__))
289 # define CYTHON_UNUSED
291 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
292 # define CYTHON_UNUSED __attribute__ ((__unused__))
294 # define CYTHON_UNUSED
297 #ifndef CYTHON_MAYBE_UNUSED_VAR
298 # if defined(__cplusplus)
299 template<
class T>
void CYTHON_MAYBE_UNUSED_VAR(
const T& ) { }
301 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
304 #ifndef CYTHON_NCP_UNUSED
305 # if CYTHON_COMPILING_IN_CPYTHON
306 # define CYTHON_NCP_UNUSED
308 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
311 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
313 #ifndef _MSC_STDINT_H_
315 typedef unsigned char uint8_t;
316 typedef unsigned int uint32_t;
318 typedef unsigned __int8 uint8_t;
319 typedef unsigned __int32 uint32_t;
325 #ifndef CYTHON_FALLTHROUGH
326 #if defined(__cplusplus) && __cplusplus >= 201103L
327 #if __has_cpp_attribute(fallthrough)
328 #define CYTHON_FALLTHROUGH [[fallthrough]]
329 #elif __has_cpp_attribute(clang::fallthrough)
330 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
331 #elif __has_cpp_attribute(gnu::fallthrough)
332 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
335 #ifndef CYTHON_FALLTHROUGH
336 #if __has_attribute(fallthrough)
337 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
339 #define CYTHON_FALLTHROUGH
342 #if defined(__clang__ ) && defined(__apple_build_version__)
343 #if __apple_build_version__ < 7000000
344 #undef CYTHON_FALLTHROUGH
345 #define CYTHON_FALLTHROUGH
351 #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
353 #ifndef CYTHON_INLINE
354 #if defined(__clang__)
355 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
357 #define CYTHON_INLINE inline
361 void __Pyx_call_destructor(T& x) {
365 class __Pyx_FakeReference {
367 __Pyx_FakeReference() : ptr(NULL) { }
368 __Pyx_FakeReference(
const T& ref) : ptr(const_cast<T*>(&ref)) { }
369 T *operator->() {
return ptr; }
371 operator T&() {
return *ptr; }
372 template<
typename U>
bool operator ==(U other) {
return *ptr == other; }
373 template<
typename U>
bool operator !=(U other) {
return *ptr != other; }
378 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
379 #define Py_OptimizeFlag 0
381 #define __PYX_BUILD_PY_SSIZE_T "n"
382 #define CYTHON_FORMAT_SSIZE_T "z"
383 #if PY_MAJOR_VERSION < 3
384 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
385 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
386 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
387 #define __Pyx_DefaultClassType PyClass_Type
389 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
390 #if PY_VERSION_HEX < 0x030800A4
391 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
392 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
394 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
395 PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
397 #define __Pyx_DefaultClassType PyType_Type
399 #ifndef Py_TPFLAGS_CHECKTYPES
400 #define Py_TPFLAGS_CHECKTYPES 0
402 #ifndef Py_TPFLAGS_HAVE_INDEX
403 #define Py_TPFLAGS_HAVE_INDEX 0
405 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
406 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
408 #ifndef Py_TPFLAGS_HAVE_FINALIZE
409 #define Py_TPFLAGS_HAVE_FINALIZE 0
411 #ifndef METH_STACKLESS
412 #define METH_STACKLESS 0
414 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
415 #ifndef METH_FASTCALL
416 #define METH_FASTCALL 0x80
418 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *
self, PyObject *
const *args, Py_ssize_t nargs);
419 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *
self, PyObject *
const *args,
420 Py_ssize_t nargs, PyObject *kwnames);
422 #define __Pyx_PyCFunctionFast _PyCFunctionFast
423 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
425 #if CYTHON_FAST_PYCCALL
426 #define __Pyx_PyFastCFunction_Check(func)\
427 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
429 #define __Pyx_PyFastCFunction_Check(func) 0
431 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
432 #define PyObject_Malloc(s) PyMem_Malloc(s)
433 #define PyObject_Free(p) PyMem_Free(p)
434 #define PyObject_Realloc(p) PyMem_Realloc(p)
436 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
437 #define PyMem_RawMalloc(n) PyMem_Malloc(n)
438 #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
439 #define PyMem_RawFree(p) PyMem_Free(p)
441 #if CYTHON_COMPILING_IN_PYSTON
442 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
443 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
445 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
446 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
448 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
449 #define __Pyx_PyThreadState_Current PyThreadState_GET()
450 #elif PY_VERSION_HEX >= 0x03060000
451 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
452 #elif PY_VERSION_HEX >= 0x03000000
453 #define __Pyx_PyThreadState_Current PyThreadState_GET()
455 #define __Pyx_PyThreadState_Current _PyThreadState_Current
457 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
458 #include "pythread.h"
459 #define Py_tss_NEEDS_INIT 0
460 typedef int Py_tss_t;
461 static CYTHON_INLINE
int PyThread_tss_create(Py_tss_t *key) {
462 *key = PyThread_create_key();
465 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(
void) {
466 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(
sizeof(Py_tss_t));
467 *key = Py_tss_NEEDS_INIT;
470 static CYTHON_INLINE
void PyThread_tss_free(Py_tss_t *key) {
473 static CYTHON_INLINE
int PyThread_tss_is_created(Py_tss_t *key) {
474 return *key != Py_tss_NEEDS_INIT;
476 static CYTHON_INLINE
void PyThread_tss_delete(Py_tss_t *key) {
477 PyThread_delete_key(*key);
478 *key = Py_tss_NEEDS_INIT;
480 static CYTHON_INLINE
int PyThread_tss_set(Py_tss_t *key,
void *value) {
481 return PyThread_set_key_value(*key, value);
483 static CYTHON_INLINE
void * PyThread_tss_get(Py_tss_t *key) {
484 return PyThread_get_key_value(*key);
487 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
488 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
490 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
492 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
493 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
494 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
496 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
497 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
499 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
500 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
502 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
504 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
505 #define CYTHON_PEP393_ENABLED 1
506 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
507 0 : _PyUnicode_Ready((PyObject *)(op)))
508 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
509 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
510 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
511 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
512 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
513 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
514 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
515 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
517 #define CYTHON_PEP393_ENABLED 0
518 #define PyUnicode_1BYTE_KIND 1
519 #define PyUnicode_2BYTE_KIND 2
520 #define PyUnicode_4BYTE_KIND 4
521 #define __Pyx_PyUnicode_READY(op) (0)
522 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
523 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
524 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
525 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
526 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
527 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
528 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
529 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
531 #if CYTHON_COMPILING_IN_PYPY
532 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
533 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
535 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
536 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
537 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
539 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
540 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
542 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
543 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
545 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
546 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
548 #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))
549 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
550 #if PY_MAJOR_VERSION >= 3
551 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
553 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
555 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
556 #define PyObject_ASCII(o) PyObject_Repr(o)
558 #if PY_MAJOR_VERSION >= 3
559 #define PyBaseString_Type PyUnicode_Type
560 #define PyStringObject PyUnicodeObject
561 #define PyString_Type PyUnicode_Type
562 #define PyString_Check PyUnicode_Check
563 #define PyString_CheckExact PyUnicode_CheckExact
564 #define PyObject_Unicode PyObject_Str
566 #if PY_MAJOR_VERSION >= 3
567 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
568 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
570 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
571 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
573 #ifndef PySet_CheckExact
574 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
576 #if CYTHON_ASSUME_SAFE_MACROS
577 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
579 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
581 #if PY_MAJOR_VERSION >= 3
582 #define PyIntObject PyLongObject
583 #define PyInt_Type PyLong_Type
584 #define PyInt_Check(op) PyLong_Check(op)
585 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
586 #define PyInt_FromString PyLong_FromString
587 #define PyInt_FromUnicode PyLong_FromUnicode
588 #define PyInt_FromLong PyLong_FromLong
589 #define PyInt_FromSize_t PyLong_FromSize_t
590 #define PyInt_FromSsize_t PyLong_FromSsize_t
591 #define PyInt_AsLong PyLong_AsLong
592 #define PyInt_AS_LONG PyLong_AS_LONG
593 #define PyInt_AsSsize_t PyLong_AsSsize_t
594 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
595 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
596 #define PyNumber_Int PyNumber_Long
598 #if PY_MAJOR_VERSION >= 3
599 #define PyBoolObject PyLongObject
601 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
602 #ifndef PyUnicode_InternFromString
603 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
606 #if PY_VERSION_HEX < 0x030200A4
607 typedef long Py_hash_t;
608 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
609 #define __Pyx_PyInt_AsHash_t PyInt_AsLong
611 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
612 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
614 #if PY_MAJOR_VERSION >= 3
615 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
617 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
619 #if CYTHON_USE_ASYNC_SLOTS
620 #if PY_VERSION_HEX >= 0x030500B1
621 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
622 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
624 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
627 #define __Pyx_PyType_AsAsync(obj) NULL
629 #ifndef __Pyx_PyAsyncMethodsStruct
634 } __Pyx_PyAsyncMethodsStruct;
637 #if defined(WIN32) || defined(MS_WINDOWS)
638 #define _USE_MATH_DEFINES
642 #define __PYX_NAN() ((float) NAN)
644 static CYTHON_INLINE
float __PYX_NAN() {
646 memset(&value, 0xFF,
sizeof(value));
650 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
651 #define __Pyx_truncl trunc
653 #define __Pyx_truncl truncl
657 #define __PYX_ERR(f_index, lineno, Ln_error) \
659 __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
662 #ifndef __PYX_EXTERN_C
664 #define __PYX_EXTERN_C extern "C"
666 #define __PYX_EXTERN_C extern
670 #define __PYX_HAVE__PyClical
671 #define __PYX_HAVE_API__PyClical
685 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
686 #define CYTHON_WITHOUT_ASSERTIONS
689 typedef struct {PyObject **p;
const char *s;
const Py_ssize_t n;
const char* encoding;
690 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
692 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
693 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
694 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
695 #define __PYX_DEFAULT_STRING_ENCODING ""
696 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
697 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
698 #define __Pyx_uchar_cast(c) ((unsigned char)c)
699 #define __Pyx_long_cast(x) ((long)x)
700 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
701 (sizeof(type) < sizeof(Py_ssize_t)) ||\
702 (sizeof(type) > sizeof(Py_ssize_t) &&\
703 likely(v < (type)PY_SSIZE_T_MAX ||\
704 v == (type)PY_SSIZE_T_MAX) &&\
705 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
706 v == (type)PY_SSIZE_T_MIN))) ||\
707 (sizeof(type) == sizeof(Py_ssize_t) &&\
708 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
709 v == (type)PY_SSIZE_T_MAX))) )
710 static CYTHON_INLINE
int __Pyx_is_valid_index(Py_ssize_t
i, Py_ssize_t limit) {
711 return (
size_t)
i < (size_t) limit;
713 #if defined (__cplusplus) && __cplusplus >= 201103L
715 #define __Pyx_sst_abs(value) std::abs(value)
716 #elif SIZEOF_INT >= SIZEOF_SIZE_T
717 #define __Pyx_sst_abs(value) abs(value)
718 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
719 #define __Pyx_sst_abs(value) labs(value)
720 #elif defined (_MSC_VER)
721 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
722 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
723 #define __Pyx_sst_abs(value) llabs(value)
724 #elif defined (__GNUC__)
725 #define __Pyx_sst_abs(value) __builtin_llabs(value)
727 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
729 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
730 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
731 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
732 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
733 #define __Pyx_PyBytes_FromString PyBytes_FromString
734 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
735 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
736 #if PY_MAJOR_VERSION < 3
737 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
738 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
740 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
741 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
743 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
744 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
745 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
746 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
747 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
748 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
749 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
750 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
751 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
752 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
753 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
754 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
755 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
756 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
757 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
758 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
759 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *u) {
760 const Py_UNICODE *u_end = u;
762 return (
size_t)(u_end - u - 1);
764 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
765 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
766 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
767 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
768 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
769 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
770 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
771 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
772 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
773 #define __Pyx_PySequence_Tuple(obj)\
774 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
775 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
776 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
777 #if CYTHON_ASSUME_SAFE_MACROS
778 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
780 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
782 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
783 #if PY_MAJOR_VERSION >= 3
784 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
786 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
788 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
789 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
790 static int __Pyx_sys_getdefaultencoding_not_ascii;
791 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
793 PyObject* default_encoding = NULL;
794 PyObject* ascii_chars_u = NULL;
795 PyObject* ascii_chars_b = NULL;
796 const char* default_encoding_c;
797 sys = PyImport_ImportModule(
"sys");
799 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
801 if (!default_encoding)
goto bad;
802 default_encoding_c = PyBytes_AsString(default_encoding);
803 if (!default_encoding_c)
goto bad;
804 if (strcmp(default_encoding_c,
"ascii") == 0) {
805 __Pyx_sys_getdefaultencoding_not_ascii = 0;
807 char ascii_chars[128];
809 for (c = 0; c < 128; c++) {
812 __Pyx_sys_getdefaultencoding_not_ascii = 1;
813 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
814 if (!ascii_chars_u)
goto bad;
815 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
816 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
819 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
823 Py_DECREF(ascii_chars_u);
824 Py_DECREF(ascii_chars_b);
826 Py_DECREF(default_encoding);
829 Py_XDECREF(default_encoding);
830 Py_XDECREF(ascii_chars_u);
831 Py_XDECREF(ascii_chars_b);
835 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
836 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
838 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
839 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
840 static char* __PYX_DEFAULT_STRING_ENCODING;
841 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
843 PyObject* default_encoding = NULL;
844 char* default_encoding_c;
845 sys = PyImport_ImportModule(
"sys");
847 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
849 if (!default_encoding)
goto bad;
850 default_encoding_c = PyBytes_AsString(default_encoding);
851 if (!default_encoding_c)
goto bad;
852 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c) + 1);
853 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
854 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
855 Py_DECREF(default_encoding);
858 Py_XDECREF(default_encoding);
866 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
867 #define likely(x) __builtin_expect(!!(x), 1)
868 #define unlikely(x) __builtin_expect(!!(x), 0)
870 #define likely(x) (x)
871 #define unlikely(x) (x)
873 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
875 static PyObject *__pyx_m = NULL;
876 static PyObject *__pyx_d;
877 static PyObject *__pyx_b;
878 static PyObject *__pyx_cython_runtime = NULL;
879 static PyObject *__pyx_empty_tuple;
880 static PyObject *__pyx_empty_bytes;
881 static PyObject *__pyx_empty_unicode;
882 static int __pyx_lineno;
883 static int __pyx_clineno = 0;
884 static const char * __pyx_cfilenm= __FILE__;
885 static const char *__pyx_filename;
888 static const char *__pyx_f[] = {
894 struct __pyx_obj_8PyClical_index_set;
895 struct __pyx_obj_8PyClical_clifford;
896 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__;
897 struct __pyx_opt_args_8PyClical_sqrt;
898 struct __pyx_opt_args_8PyClical_log;
899 struct __pyx_opt_args_8PyClical_cos;
900 struct __pyx_opt_args_8PyClical_acos;
901 struct __pyx_opt_args_8PyClical_acosh;
902 struct __pyx_opt_args_8PyClical_sin;
903 struct __pyx_opt_args_8PyClical_asin;
904 struct __pyx_opt_args_8PyClical_asinh;
905 struct __pyx_opt_args_8PyClical_tan;
906 struct __pyx_opt_args_8PyClical_atan;
907 struct __pyx_opt_args_8PyClical_atanh;
908 struct __pyx_opt_args_8PyClical_random_clifford;
917 struct __pyx_opt_args_8PyClical_sqrt {
929 struct __pyx_opt_args_8PyClical_log {
941 struct __pyx_opt_args_8PyClical_cos {
953 struct __pyx_opt_args_8PyClical_acos {
965 struct __pyx_opt_args_8PyClical_acosh {
977 struct __pyx_opt_args_8PyClical_sin {
989 struct __pyx_opt_args_8PyClical_asin {
1001 struct __pyx_opt_args_8PyClical_asinh {
1013 struct __pyx_opt_args_8PyClical_tan {
1025 struct __pyx_opt_args_8PyClical_atan {
1037 struct __pyx_opt_args_8PyClical_atanh {
1049 struct __pyx_opt_args_8PyClical_random_clifford {
1061 struct __pyx_obj_8PyClical_index_set {
1063 struct __pyx_vtabstruct_8PyClical_index_set *__pyx_vtab;
1075 struct __pyx_obj_8PyClical_clifford {
1077 struct __pyx_vtabstruct_8PyClical_clifford *__pyx_vtab;
1089 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ {
1091 PyObject *__pyx_v_idx;
1092 struct __pyx_obj_8PyClical_index_set *__pyx_v_self;
1093 PyObject *__pyx_t_0;
1094 Py_ssize_t __pyx_t_1;
1095 PyObject *(*__pyx_t_2)(PyObject *);
1108 struct __pyx_vtabstruct_8PyClical_index_set {
1109 PyObject *(*wrap)(
struct __pyx_obj_8PyClical_index_set *,
IndexSet);
1110 IndexSet (*unwrap)(
struct __pyx_obj_8PyClical_index_set *);
1111 PyObject *(*copy)(
struct __pyx_obj_8PyClical_index_set *,
int __pyx_skip_dispatch);
1113 static struct __pyx_vtabstruct_8PyClical_index_set *__pyx_vtabptr_8PyClical_index_set;
1114 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_9index_set_wrap(
struct __pyx_obj_8PyClical_index_set *,
IndexSet);
1115 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_9index_set_unwrap(
struct __pyx_obj_8PyClical_index_set *);
1126 struct __pyx_vtabstruct_8PyClical_clifford {
1127 PyObject *(*wrap)(
struct __pyx_obj_8PyClical_clifford *,
Clifford);
1128 Clifford (*unwrap)(
struct __pyx_obj_8PyClical_clifford *);
1129 PyObject *(*copy)(
struct __pyx_obj_8PyClical_clifford *,
int __pyx_skip_dispatch);
1131 static struct __pyx_vtabstruct_8PyClical_clifford *__pyx_vtabptr_8PyClical_clifford;
1132 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_8clifford_wrap(
struct __pyx_obj_8PyClical_clifford *,
Clifford);
1133 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_8clifford_unwrap(
struct __pyx_obj_8PyClical_clifford *);
1137 #ifndef CYTHON_REFNANNY
1138 #define CYTHON_REFNANNY 0
1142 void (*INCREF)(
void*, PyObject*, int);
1143 void (*DECREF)(
void*, PyObject*, int);
1144 void (*GOTREF)(
void*, PyObject*, int);
1145 void (*GIVEREF)(
void*, PyObject*, int);
1146 void* (*SetupContext)(
const char*, int,
const char*);
1147 void (*FinishContext)(
void**);
1148 } __Pyx_RefNannyAPIStruct;
1149 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1150 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1151 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1153 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1155 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1156 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1157 PyGILState_Release(__pyx_gilstate_save);\
1159 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1162 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1163 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1165 #define __Pyx_RefNannyFinishContext()\
1166 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1167 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1168 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1169 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1170 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1171 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1172 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1173 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1174 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1176 #define __Pyx_RefNannyDeclarations
1177 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1178 #define __Pyx_RefNannyFinishContext()
1179 #define __Pyx_INCREF(r) Py_INCREF(r)
1180 #define __Pyx_DECREF(r) Py_DECREF(r)
1181 #define __Pyx_GOTREF(r)
1182 #define __Pyx_GIVEREF(r)
1183 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1184 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1185 #define __Pyx_XGOTREF(r)
1186 #define __Pyx_XGIVEREF(r)
1188 #define __Pyx_XDECREF_SET(r, v) do {\
1189 PyObject *tmp = (PyObject *) r;\
1190 r = v; __Pyx_XDECREF(tmp);\
1192 #define __Pyx_DECREF_SET(r, v) do {\
1193 PyObject *tmp = (PyObject *) r;\
1194 r = v; __Pyx_DECREF(tmp);\
1196 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1197 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1200 #if CYTHON_USE_TYPE_SLOTS
1201 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject*
obj, PyObject* attr_name);
1203 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1207 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1210 #if CYTHON_FAST_PYCCALL
1211 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1213 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1217 #if CYTHON_FAST_PYCALL
1218 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1219 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1220 #if 1 || PY_VERSION_HEX < 0x030600B1
1221 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
int nargs, PyObject *kwargs);
1223 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1225 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1226 (sizeof(char [1 - 2*!(cond)]) - 1)
1227 #ifndef Py_MEMBER_SIZE
1228 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1230 static size_t __pyx_pyframe_localsplus_offset = 0;
1231 #include "frameobject.h"
1232 #define __Pxy_PyFrame_Initialize_Offsets()\
1233 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1234 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1235 #define __Pyx_PyFrame_GetLocalsplus(frame)\
1236 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1240 #if CYTHON_COMPILING_IN_CPYTHON
1241 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1243 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1247 #if CYTHON_COMPILING_IN_CPYTHON
1248 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1252 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1255 #if CYTHON_FAST_THREAD_STATE
1256 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1257 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1258 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1260 #define __Pyx_PyThreadState_declare
1261 #define __Pyx_PyThreadState_assign
1262 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1266 #if CYTHON_FAST_THREAD_STATE
1267 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1268 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1269 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1270 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1271 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1272 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1273 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1274 #if CYTHON_COMPILING_IN_CPYTHON
1275 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1277 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1280 #define __Pyx_PyErr_Clear() PyErr_Clear()
1281 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1282 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1283 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1284 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1285 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1286 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1287 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1291 static void __Pyx_WriteUnraisable(
const char *name,
int clineno,
1292 int lineno,
const char *filename,
1293 int full_traceback,
int nogil);
1296 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1297 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1298 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1299 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1300 (version_var) = __PYX_GET_DICT_VERSION(dict);\
1301 (cache_var) = (value);
1302 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1303 static PY_UINT64_T __pyx_dict_version = 0;\
1304 static PyObject *__pyx_dict_cached_value = NULL;\
1305 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1306 (VAR) = __pyx_dict_cached_value;\
1308 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1309 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1312 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *
obj);
1313 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *
obj);
1314 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject*
obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1316 #define __PYX_GET_DICT_VERSION(dict) (0)
1317 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1318 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1322 #if CYTHON_COMPILING_IN_CPYTHON
1323 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1325 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1329 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
1332 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1333 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1334 const char* function_name);
1337 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1338 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1341 #if CYTHON_USE_DICT_VERSIONS
1342 #define __Pyx_GetModuleGlobalName(var, name) {\
1343 static PY_UINT64_T __pyx_dict_version = 0;\
1344 static PyObject *__pyx_dict_cached_value = NULL;\
1345 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1346 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1347 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1349 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1350 PY_UINT64_T __pyx_dict_version;\
1351 PyObject *__pyx_dict_cached_value;\
1352 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1354 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1356 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1357 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1358 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1362 #if CYTHON_USE_EXC_INFO_STACK
1363 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1367 #if CYTHON_FAST_THREAD_STATE
1368 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1369 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1370 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1371 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1373 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1374 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1378 #if CYTHON_FAST_THREAD_STATE
1379 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1380 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1382 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1386 #if CYTHON_FAST_THREAD_STATE
1387 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1388 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1390 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1394 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1397 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2);
1400 #if !CYTHON_COMPILING_IN_PYPY
1401 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2,
long intval,
int inplace,
int zerodivision_check);
1403 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
1404 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1408 static CYTHON_INLINE
int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq,
int eq) {
1409 int result = PySequence_Contains(seq, item);
1410 return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
1417 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(
const char *s, Py_ssize_t size,
const char *errors) {
1419 return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1421 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(
const char *s, Py_ssize_t size,
const char *errors) {
1423 return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1425 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(
const char *s, Py_ssize_t size,
const char *errors) {
1427 return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1431 static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
1432 const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop,
1433 const char* encoding,
const char* errors,
1434 PyObject* (*decode_func)(
const char *s, Py_ssize_t size,
const char *errors));
1437 static CYTHON_INLINE PyObject* __Pyx_decode_cpp_string(
1438 std::string cppstring, Py_ssize_t start, Py_ssize_t stop,
1439 const char* encoding,
const char* errors,
1440 PyObject* (*decode_func)(
const char *s, Py_ssize_t size,
const char *errors)) {
1441 return __Pyx_decode_c_bytes(
1442 cppstring.data(), cppstring.size(), start, stop, encoding, errors, decode_func);
1446 #if CYTHON_FAST_THREAD_STATE
1447 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
1448 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1450 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
1454 #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1455 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1456 __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\
1457 (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
1458 __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
1459 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
1460 static CYTHON_INLINE
int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t
i, PyObject *v,
1461 int is_list,
int wraparound,
int boundscheck);
1464 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1465 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1466 __Pyx__ArgTypeTest(obj, type, name, exact))
1467 static int __Pyx__ArgTypeTest(PyObject *
obj, PyTypeObject *type,
const char *name,
int exact);
1470 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
1476 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1477 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject*
obj, PyObject* attr_name);
1479 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1483 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1484 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject*
obj, PyObject* attr_name);
1486 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1490 static int __Pyx_SetVtable(PyObject *dict,
void *vtable);
1493 static int __Pyx_setup_reduce(PyObject* type_obj);
1496 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals);
1499 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals);
1502 #ifdef CYTHON_CLINE_IN_TRACEBACK
1503 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1505 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
1510 PyCodeObject* code_object;
1512 } __Pyx_CodeObjectCacheEntry;
1513 struct __Pyx_CodeObjectCache {
1516 __Pyx_CodeObjectCacheEntry* entries;
1518 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1519 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
1520 static PyCodeObject *__pyx_find_code_object(
int code_line);
1521 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
1524 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
1525 int py_line,
const char *filename);
1528 #ifndef __Pyx_CppExn2PyErr
1531 #include <stdexcept>
1533 static void __Pyx_CppExn2PyErr() {
1535 if (PyErr_Occurred())
1539 }
catch (
const std::bad_alloc& exn) {
1540 PyErr_SetString(PyExc_MemoryError, exn.what());
1541 }
catch (
const std::bad_cast& exn) {
1542 PyErr_SetString(PyExc_TypeError, exn.what());
1543 }
catch (
const std::bad_typeid& exn) {
1544 PyErr_SetString(PyExc_TypeError, exn.what());
1545 }
catch (
const std::domain_error& exn) {
1546 PyErr_SetString(PyExc_ValueError, exn.what());
1547 }
catch (
const std::invalid_argument& exn) {
1548 PyErr_SetString(PyExc_ValueError, exn.what());
1549 }
catch (
const std::ios_base::failure& exn) {
1550 PyErr_SetString(PyExc_IOError, exn.what());
1551 }
catch (
const std::out_of_range& exn) {
1552 PyErr_SetString(PyExc_IndexError, exn.what());
1553 }
catch (
const std::overflow_error& exn) {
1554 PyErr_SetString(PyExc_OverflowError, exn.what());
1555 }
catch (
const std::range_error& exn) {
1556 PyErr_SetString(PyExc_ArithmeticError, exn.what());
1557 }
catch (
const std::underflow_error& exn) {
1558 PyErr_SetString(PyExc_ArithmeticError, exn.what());
1559 }
catch (
const std::exception& exn) {
1560 PyErr_SetString(PyExc_RuntimeError, exn.what());
1564 PyErr_SetString(PyExc_RuntimeError,
"Unknown exception");
1570 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
1573 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
1576 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
1579 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
1582 #if CYTHON_COMPILING_IN_CPYTHON
1583 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1584 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1585 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1586 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1588 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1589 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1590 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1592 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1595 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
1598 static int __Pyx_PyObject_GetMethod(PyObject *
obj, PyObject *name, PyObject **method);
1601 static PyObject* __Pyx_PyObject_CallMethod1(PyObject*
obj, PyObject* method_name, PyObject* arg);
1604 typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyThreadState *, PyObject *);
1605 #if CYTHON_USE_EXC_INFO_STACK
1606 #define __Pyx_ExcInfoStruct _PyErr_StackItem
1610 PyObject *exc_value;
1611 PyObject *exc_traceback;
1612 } __Pyx_ExcInfoStruct;
1616 __pyx_coroutine_body_t body;
1618 __Pyx_ExcInfoStruct gi_exc_state;
1619 PyObject *gi_weakreflist;
1621 PyObject *yieldfrom;
1623 PyObject *gi_qualname;
1624 PyObject *gi_modulename;
1628 } __pyx_CoroutineObject;
1629 static __pyx_CoroutineObject *__Pyx__Coroutine_New(
1630 PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
1631 PyObject *name, PyObject *qualname, PyObject *module_name);
1632 static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
1633 __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
1634 PyObject *name, PyObject *qualname, PyObject *module_name);
1635 static CYTHON_INLINE
void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *
self);
1636 static int __Pyx_Coroutine_clear(PyObject *
self);
1637 static PyObject *__Pyx_Coroutine_Send(PyObject *
self, PyObject *value);
1638 static PyObject *__Pyx_Coroutine_Close(PyObject *
self);
1639 static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
1640 #if CYTHON_USE_EXC_INFO_STACK
1641 #define __Pyx_Coroutine_SwapException(self)
1642 #define __Pyx_Coroutine_ResetAndClearException(self) __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state)
1644 #define __Pyx_Coroutine_SwapException(self) {\
1645 __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\
1646 __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\
1648 #define __Pyx_Coroutine_ResetAndClearException(self) {\
1649 __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\
1650 (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\
1653 #if CYTHON_FAST_THREAD_STATE
1654 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
1655 __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue)
1657 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
1658 __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue)
1660 static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue);
1661 static CYTHON_INLINE
void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state);
1664 static PyObject* __Pyx_Coroutine_patch_module(PyObject* module,
const char* py_code);
1667 static int __Pyx_patch_abc(
void);
1670 #define __Pyx_Generator_USED
1671 static PyTypeObject *__pyx_GeneratorType = 0;
1672 #define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType)
1673 #define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\
1674 __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name)
1675 static PyObject *__Pyx_Generator_Next(PyObject *
self);
1676 static int __pyx_Generator_init(
void);
1679 static int __Pyx_check_binary_version(
void);
1682 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1684 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_9index_set_wrap(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self,
IndexSet __pyx_v_other);
1685 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_9index_set_unwrap(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
1686 static PyObject *__pyx_f_8PyClical_9index_set_copy(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self,
int __pyx_skip_dispatch);
1687 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_8clifford_wrap(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self,
Clifford __pyx_v_other);
1688 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_8clifford_unwrap(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
1689 static PyObject *__pyx_f_8PyClical_8clifford_copy(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self,
int __pyx_skip_dispatch);
1700 static PyTypeObject *__pyx_ptype_8PyClical_index_set = 0;
1701 static PyTypeObject *__pyx_ptype_8PyClical_clifford = 0;
1702 static PyTypeObject *__pyx_ptype_8PyClical___pyx_scope_struct____iter__ = 0;
1703 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_toIndexSet(PyObject *);
1704 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_compare(PyObject *, PyObject *,
int __pyx_skip_dispatch);
1705 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_min_neg(PyObject *,
int __pyx_skip_dispatch);
1706 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_max_pos(PyObject *,
int __pyx_skip_dispatch);
1707 static CYTHON_INLINE std::vector<scalar_t> __pyx_f_8PyClical_list_to_vector(PyObject *);
1708 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_toClifford(PyObject *);
1709 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_inv(PyObject *,
int __pyx_skip_dispatch);
1710 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_scalar(PyObject *,
int __pyx_skip_dispatch);
1711 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_real(PyObject *,
int __pyx_skip_dispatch);
1712 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_imag(PyObject *,
int __pyx_skip_dispatch);
1713 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_pure(PyObject *,
int __pyx_skip_dispatch);
1714 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_even(PyObject *,
int __pyx_skip_dispatch);
1715 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_odd(PyObject *,
int __pyx_skip_dispatch);
1716 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_involute(PyObject *,
int __pyx_skip_dispatch);
1717 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_reverse(PyObject *,
int __pyx_skip_dispatch);
1718 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_conj(PyObject *,
int __pyx_skip_dispatch);
1719 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_quad(PyObject *,
int __pyx_skip_dispatch);
1720 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_norm(PyObject *,
int __pyx_skip_dispatch);
1721 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_abs(PyObject *,
int __pyx_skip_dispatch);
1722 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_max_abs(PyObject *,
int __pyx_skip_dispatch);
1723 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_pow(PyObject *, PyObject *,
int __pyx_skip_dispatch);
1724 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_outer_pow(PyObject *, PyObject *,
int __pyx_skip_dispatch);
1725 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_complexifier(PyObject *,
int __pyx_skip_dispatch);
1726 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_sqrt(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_sqrt *__pyx_optional_args);
1727 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_exp(PyObject *,
int __pyx_skip_dispatch);
1728 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_log(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_log *__pyx_optional_args);
1729 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cos(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_cos *__pyx_optional_args);
1730 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_acos(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_acos *__pyx_optional_args);
1731 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cosh(PyObject *,
int __pyx_skip_dispatch);
1732 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_acosh(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_acosh *__pyx_optional_args);
1733 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_sin(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_sin *__pyx_optional_args);
1734 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_asin(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_asin *__pyx_optional_args);
1735 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_sinh(PyObject *,
int __pyx_skip_dispatch);
1736 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_asinh(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_asinh *__pyx_optional_args);
1737 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_tan(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_tan *__pyx_optional_args);
1738 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_atan(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_atan *__pyx_optional_args);
1739 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_tanh(PyObject *,
int __pyx_skip_dispatch);
1740 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_atanh(PyObject *,
int __pyx_skip_dispatch,
struct __pyx_opt_args_8PyClical_atanh *__pyx_optional_args);
1741 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);
1742 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cga3(PyObject *,
int __pyx_skip_dispatch);
1743 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cga3std(PyObject *,
int __pyx_skip_dispatch);
1744 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_agc3(PyObject *,
int __pyx_skip_dispatch);
1745 static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_string(std::string
const &);
1746 static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_string(std::string
const &);
1747 static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(std::string
const &);
1748 static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string(std::string
const &);
1749 static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_string(std::string
const &);
1750 #define __Pyx_MODULE_NAME "PyClical"
1751 extern int __pyx_module_is_main_PyClical;
1752 int __pyx_module_is_main_PyClical = 0;
1755 static PyObject *__pyx_builtin_IndexError;
1756 static PyObject *__pyx_builtin_RuntimeError;
1757 static PyObject *__pyx_builtin_TypeError;
1758 static PyObject *__pyx_builtin_ValueError;
1759 static PyObject *__pyx_builtin_NotImplemented;
1760 static PyObject *__pyx_builtin_range;
1761 static PyObject *__pyx_builtin_xrange;
1762 static const char __pyx_k_[] =
".";
1763 static const char __pyx_k_e[] =
"e";
1764 static const char __pyx_k_i[] =
"i";
1765 static const char __pyx_k_m[] =
"m";
1766 static const char __pyx_k_p[] =
"p";
1767 static const char __pyx_k_q[] =
"q";
1768 static const char __pyx_k__2[] =
" ";
1769 static const char __pyx_k__5[] =
":";
1770 static const char __pyx_k__6[] =
"\n\t";
1771 static const char __pyx_k__7[] =
" (";
1772 static const char __pyx_k__8[] =
", ";
1773 static const char __pyx_k__9[] =
").";
1774 static const char __pyx_k_cl[] =
"cl";
1775 static const char __pyx_k_pi[] =
"pi";
1776 static const char __pyx_k_abc[] =
"abc";
1777 static const char __pyx_k_cos[] =
"cos";
1778 static const char __pyx_k_exp[] =
"exp";
1779 static const char __pyx_k_frm[] =
"frm";
1780 static const char __pyx_k_inv[] =
"inv";
1781 static const char __pyx_k_ist[] =
"ist";
1782 static const char __pyx_k_ixt[] =
"ixt";
1783 static const char __pyx_k_lhs[] =
"lhs";
1784 static const char __pyx_k_log[] =
"log";
1785 static const char __pyx_k_max[] =
"max";
1786 static const char __pyx_k_min[] =
"min";
1787 static const char __pyx_k_obj[] =
"obj";
1788 static const char __pyx_k_odd[] =
"odd";
1789 static const char __pyx_k_pow[] =
"pow";
1790 static const char __pyx_k_rhs[] =
"rhs";
1791 static const char __pyx_k_sin[] =
"sin";
1792 static const char __pyx_k_tan[] =
"tan";
1793 static const char __pyx_k_tau[] =
"tau";
1794 static const char __pyx_k_Real[] =
"Real";
1795 static const char __pyx_k_acos[] =
"acos";
1796 static const char __pyx_k_args[] =
"args";
1797 static const char __pyx_k_asin[] =
"asin";
1798 static const char __pyx_k_atan[] =
"atan";
1799 static const char __pyx_k_conj[] =
"conj";
1800 static const char __pyx_k_copy[] =
"copy";
1801 static const char __pyx_k_cosh[] =
"cosh";
1802 static const char __pyx_k_even[] =
"even";
1803 static const char __pyx_k_fill[] =
"fill";
1804 static const char __pyx_k_from[] =
" from ";
1805 static const char __pyx_k_iter[] =
"__iter__";
1806 static const char __pyx_k_main[] =
"__main__";
1807 static const char __pyx_k_math[] =
"math";
1808 static const char __pyx_k_name[] =
"__name__";
1809 static const char __pyx_k_norm[] =
"norm";
1810 static const char __pyx_k_pure[] =
"pure";
1811 static const char __pyx_k_quad[] =
"quad";
1812 static const char __pyx_k_send[] =
"send";
1813 static const char __pyx_k_sinh[] =
"sinh";
1814 static const char __pyx_k_sqrt[] =
"sqrt";
1815 static const char __pyx_k_tanh[] =
"tanh";
1816 static const char __pyx_k_test[] =
"_test";
1817 static const char __pyx_k_0_8_4[] =
"0.8.4";
1818 static const char __pyx_k_UTF_8[] =
"UTF-8";
1819 static const char __pyx_k_acosh[] =
"acosh";
1820 static const char __pyx_k_asinh[] =
"asinh";
1821 static const char __pyx_k_atanh[] =
"atanh";
1822 static const char __pyx_k_close[] =
"close";
1823 static const char __pyx_k_grade[] =
"grade";
1824 static const char __pyx_k_istpq[] =
"istpq";
1825 static const char __pyx_k_nbar3[] =
"nbar3";
1826 static const char __pyx_k_ninf3[] =
"ninf3";
1827 static const char __pyx_k_other[] =
"other";
1828 static const char __pyx_k_range[] =
"range";
1829 static const char __pyx_k_throw[] =
"throw";
1830 static const char __pyx_k_using[] =
" using (";
1831 static const char __pyx_k_value[] =
" value ";
1832 static const char __pyx_k_encode[] =
"encode";
1833 static const char __pyx_k_import[] =
"__import__";
1834 static const char __pyx_k_reduce[] =
"__reduce__";
1835 static const char __pyx_k_scalar[] =
"scalar";
1836 static const char __pyx_k_test_2[] =
"__test__";
1837 static const char __pyx_k_xrange[] =
"xrange";
1838 static const char __pyx_k_doctest[] =
"doctest";
1839 static const char __pyx_k_invalid[] =
" invalid ";
1840 static const char __pyx_k_numbers[] =
"numbers";
1841 static const char __pyx_k_reverse[] =
"reverse";
1842 static const char __pyx_k_testmod[] =
"testmod";
1843 static const char __pyx_k_version[] =
"__version__";
1844 static const char __pyx_k_Integral[] =
"Integral";
1845 static const char __pyx_k_PyClical[] =
"PyClical";
1846 static const char __pyx_k_Sequence[] =
"Sequence";
1847 static const char __pyx_k_as_frame[] =
" as frame:\n\t";
1848 static const char __pyx_k_clifford[] =
"clifford";
1849 static const char __pyx_k_getstate[] =
"__getstate__";
1850 static const char __pyx_k_involute[] =
"involute";
1851 static const char __pyx_k_setstate[] =
"__setstate__";
1852 static const char __pyx_k_to_frame[] =
" to frame ";
1853 static const char __pyx_k_TypeError[] =
"TypeError";
1854 static const char __pyx_k_index_set[] =
"index_set";
1855 static const char __pyx_k_outer_pow[] =
"outer_pow";
1856 static const char __pyx_k_reduce_ex[] =
"__reduce_ex__";
1857 static const char __pyx_k_IndexError[] =
"IndexError";
1858 static const char __pyx_k_ValueError[] =
"ValueError";
1859 static const char __pyx_k_pyx_vtable[] =
"__pyx_vtable__";
1860 static const char __pyx_k_collections[] =
"collections";
1861 static const char __pyx_k_e_line_1886[] =
"e (line 1886)";
1862 static const char __pyx_k_PyClical_pyx[] =
"PyClical.pyx";
1863 static const char __pyx_k_RuntimeError[] =
"RuntimeError";
1864 static const char __pyx_k_abs_line_1472[] =
"abs (line 1472)";
1865 static const char __pyx_k_cos_line_1601[] =
"cos (line 1601)";
1866 static const char __pyx_k_exp_line_1564[] =
"exp (line 1564)";
1867 static const char __pyx_k_inv_line_1328[] =
"inv (line 1328)";
1868 static const char __pyx_k_log_line_1578[] =
"log (line 1578)";
1869 static const char __pyx_k_odd_line_1396[] =
"odd (line 1396)";
1870 static const char __pyx_k_pow_line_1493[] =
"pow (line 1493)";
1871 static const char __pyx_k_reduce_cython[] =
"__reduce_cython__";
1872 static const char __pyx_k_sin_line_1678[] =
"sin (line 1678)";
1873 static const char __pyx_k_tan_line_1751[] =
"tan (line 1751)";
1874 static const char __pyx_k_using_invalid[] =
" using invalid ";
1875 static const char __pyx_k_Cannot_reframe[] =
"Cannot reframe";
1876 static const char __pyx_k_NotImplemented[] =
"NotImplemented";
1877 static const char __pyx_k_Not_applicable[] =
"Not applicable.";
1878 static const char __pyx_k_acos_line_1618[] =
"acos (line 1618)";
1879 static const char __pyx_k_agc3_line_1843[] =
"agc3 (line 1843)";
1880 static const char __pyx_k_asin_line_1697[] =
"asin (line 1697)";
1881 static const char __pyx_k_atan_line_1768[] =
"atan (line 1768)";
1882 static const char __pyx_k_cga3_line_1823[] =
"cga3 (line 1823)";
1883 static const char __pyx_k_conj_line_1435[] =
"conj (line 1435)";
1884 static const char __pyx_k_cosh_line_1639[] =
"cosh (line 1639)";
1885 static const char __pyx_k_even_line_1387[] =
"even (line 1387)";
1886 static const char __pyx_k_imag_line_1365[] =
"imag (line 1365)";
1887 static const char __pyx_k_invalid_string[] =
" invalid string ";
1888 static const char __pyx_k_norm_line_1461[] =
"norm (line 1461)";
1889 static const char __pyx_k_pure_line_1376[] =
"pure (line 1376)";
1890 static const char __pyx_k_quad_line_1450[] =
"quad (line 1450)";
1891 static const char __pyx_k_real_line_1354[] =
"real (line 1354)";
1892 static const char __pyx_k_scalar_epsilon[] =
"scalar_epsilon";
1893 static const char __pyx_k_sinh_line_1718[] =
"sinh (line 1718)";
1894 static const char __pyx_k_sqrt_line_1541[] =
"sqrt (line 1541)";
1895 static const char __pyx_k_tanh_line_1785[] =
"tanh (line 1785)";
1896 static const char __pyx_k_acosh_line_1655[] =
"acosh (line 1655)";
1897 static const char __pyx_k_asinh_line_1732[] =
"asinh (line 1732)";
1898 static const char __pyx_k_atanh_line_1797[] =
"atanh (line 1797)";
1899 static const char __pyx_k_istpq_line_1899[] =
"istpq (line 1899)";
1900 static const char __pyx_k_setstate_cython[] =
"__setstate_cython__";
1901 static const char __pyx_k_compare_line_492[] =
"compare (line 492)";
1902 static const char __pyx_k_index_set___iter[] =
"index_set.__iter__";
1903 static const char __pyx_k_max_pos_line_513[] =
"max_pos (line 513)";
1904 static const char __pyx_k_min_neg_line_504[] =
"min_neg (line 504)";
1905 static const char __pyx_k_scalar_line_1343[] =
"scalar (line 1343)";
1906 static const char __pyx_k_cga3std_line_1832[] =
"cga3std (line 1832)";
1907 static const char __pyx_k_max_abs_line_1481[] =
"max_abs (line 1481)";
1908 static const char __pyx_k_reverse_line_1420[] =
"reverse (line 1420)";
1909 static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
1910 static const char __pyx_k_involute_line_1405[] =
"involute (line 1405)";
1911 static const char __pyx_k_outer_pow_line_1517[] =
"outer_pow (line 1517)";
1912 static const char __pyx_k_clifford_inv_line_926[] =
"clifford.inv (line 926)";
1913 static const char __pyx_k_clifford_pow_line_980[] =
"clifford.pow (line 980)";
1914 static const char __pyx_k_clifford_abs_line_1175[] =
"clifford.abs (line 1175)";
1915 static const char __pyx_k_clifford_copy_line_556[] =
"clifford.copy (line 556)";
1916 static const char __pyx_k_clifford_odd_line_1070[] =
"clifford.odd (line 1070)";
1917 static const char __pyx_k_complexifier_line_1526[] =
"complexifier (line 1526)";
1918 static const char __pyx_k_index_set_copy_line_65[] =
"index_set.copy (line 65)";
1919 static const char __pyx_k_index_set_max_line_351[] =
"index_set.max (line 351)";
1920 static const char __pyx_k_index_set_min_line_342[] =
"index_set.min (line 342)";
1921 static const char __pyx_k_clifford_conj_line_1138[] =
"clifford.conj (line 1138)";
1922 static const char __pyx_k_clifford_even_line_1061[] =
"clifford.even (line 1061)";
1923 static const char __pyx_k_clifford_norm_line_1164[] =
"clifford.norm (line 1164)";
1924 static const char __pyx_k_clifford_pure_line_1050[] =
"clifford.pure (line 1050)";
1925 static const char __pyx_k_clifford_quad_line_1153[] =
"clifford.quad (line 1153)";
1926 static const char __pyx_k_Unary_print_clifford_1_1[] =
"\n Unary -.\n\n >>> print(-clifford(\"{1}\"))\n -{1}\n ";
1927 static const char __pyx_k_clifford___or___line_939[] =
"clifford.__or__ (line 939)";
1928 static const char __pyx_k_clifford_frame_line_1215[] =
"clifford.frame (line 1215)";
1929 static const char __pyx_k_clifford_hidden_doctests[] =
"clifford_hidden_doctests";
1930 static const char __pyx_k_clifford_isnan_line_1206[] =
"clifford.isnan (line 1206)";
1931 static const char __pyx_k_index_set_count_line_315[] =
"index_set.count (line 315)";
1932 static const char __pyx_k_clifford___add___line_740[] =
"clifford.__add__ (line 740)";
1933 static const char __pyx_k_clifford___and___line_836[] =
"clifford.__and__ (line 836)";
1934 static const char __pyx_k_clifford___ior___line_950[] =
"clifford.__ior__ (line 950)";
1935 static const char __pyx_k_clifford___mod___line_806[] =
"clifford.__mod__ (line 806)";
1936 static const char __pyx_k_clifford___mul___line_780[] =
"clifford.__mul__ (line 780)";
1937 static const char __pyx_k_clifford___neg___line_722[] =
"clifford.__neg__ (line 722)";
1938 static const char __pyx_k_clifford___pos___line_731[] =
"clifford.__pos__ (line 731)";
1939 static const char __pyx_k_clifford___pow___line_961[] =
"clifford.__pow__ (line 961)";
1940 static const char __pyx_k_clifford___sub___line_760[] =
"clifford.__sub__ (line 760)";
1941 static const char __pyx_k_clifford___xor___line_866[] =
"clifford.__xor__ (line 866)";
1942 static const char __pyx_k_clifford_reframe_line_649[] =
"clifford.reframe (line 649)";
1943 static const char __pyx_k_clifford_scalar_line_1039[] =
"clifford.scalar (line 1039)";
1944 static const char __pyx_k_index_set___or___line_293[] =
"index_set.__or__ (line 293)";
1945 static const char __pyx_k_index_set_hidden_doctests[] =
"index_set_hidden_doctests";
1946 static const char __pyx_k_random_clifford_line_1814[] =
"random_clifford (line 1814)";
1947 static const char __pyx_k_Cannot_take_vector_part_of[] =
"Cannot take vector part of ";
1948 static const char __pyx_k_Unary_print_clifford_1_1_2[] =
"\n Unary +.\n\n >>> print(+clifford(\"{1}\"))\n {1}\n ";
1949 static const char __pyx_k_clifford___iadd___line_751[] =
"clifford.__iadd__ (line 751)";
1950 static const char __pyx_k_clifford___iand___line_851[] =
"clifford.__iand__ (line 851)";
1951 static const char __pyx_k_clifford___idiv___line_911[] =
"clifford.__idiv__ (line 911)";
1952 static const char __pyx_k_clifford___imod___line_821[] =
"clifford.__imod__ (line 821)";
1953 static const char __pyx_k_clifford___imul___line_793[] =
"clifford.__imul__ (line 793)";
1954 static const char __pyx_k_clifford___isub___line_771[] =
"clifford.__isub__ (line 771)";
1955 static const char __pyx_k_clifford___iter___line_638[] =
"clifford.__iter__ (line 638)";
1956 static const char __pyx_k_clifford___ixor___line_881[] =
"clifford.__ixor__ (line 881)";
1957 static const char __pyx_k_clifford___str___line_1235[] =
"clifford.__str__ (line 1235)";
1958 static const char __pyx_k_clifford_max_abs_line_1184[] =
"clifford.max_abs (line 1184)";
1959 static const char __pyx_k_clifford_reverse_line_1123[] =
"clifford.reverse (line 1123)";
1960 static const char __pyx_k_index_set___and___line_271[] =
"index_set.__and__ (line 271)";
1961 static const char __pyx_k_index_set___ior___line_304[] =
"index_set.__ior__ (line 304)";
1962 static const char __pyx_k_index_set___str___line_395[] =
"index_set.__str__ (line 395)";
1963 static const char __pyx_k_index_set___xor___line_249[] =
"index_set.__xor__ (line 249)";
1964 static const char __pyx_k_clifford___call___line_1020[] =
"clifford.__call__ (line 1020)";
1965 static const char __pyx_k_clifford___repr___line_1226[] =
"clifford.__repr__ (line 1226)";
1966 static const char __pyx_k_clifford_involute_line_1107[] =
"clifford.involute (line 1107)";
1967 static const char __pyx_k_index_set___iand___line_282[] =
"index_set.__iand__ (line 282)";
1968 static const char __pyx_k_index_set___iter___line_229[] =
"index_set.__iter__ (line 229)";
1969 static const char __pyx_k_index_set___ixor___line_260[] =
"index_set.__ixor__ (line 260)";
1970 static const char __pyx_k_index_set___repr___line_384[] =
"index_set.__repr__ (line 384)";
1971 static const char __pyx_k_clifford_outer_pow_line_1004[] =
"clifford.outer_pow (line 1004)";
1972 static const char __pyx_k_clifford_truncated_line_1195[] =
"clifford.truncated (line 1195)";
1973 static const char __pyx_k_index_set_count_neg_line_324[] =
"index_set.count_neg (line 324)";
1974 static const char __pyx_k_index_set_count_pos_line_333[] =
"index_set.count_pos (line 333)";
1975 static const char __pyx_k_clifford___getitem___line_707[] =
"clifford.__getitem__ (line 707)";
1976 static const char __pyx_k_clifford___truediv___line_896[] =
"clifford.__truediv__ (line 896)";
1977 static const char __pyx_k_index_set___invert___line_240[] =
"index_set.__invert__ (line 240)";
1978 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 ";
1979 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 ";
1980 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 ";
1981 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 ";
1982 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 ";
1983 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 ";
1984 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 ";
1985 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 ";
1986 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 ";
1987 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 ";
1988 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 ";
1989 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 ";
1990 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 ";
1991 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 ";
1992 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 ";
1993 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 ";
1994 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 ";
1995 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 ";
1996 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 ";
1997 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 ";
1998 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 ";
1999 static const char __pyx_k_clifford_vector_part_line_1079[] =
"clifford.vector_part (line 1079)";
2000 static const char __pyx_k_index_set___getitem___line_191[] =
"index_set.__getitem__ (line 191)";
2001 static const char __pyx_k_index_set___setitem___line_179[] =
"index_set.__setitem__ (line 179)";
2002 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 ";
2003 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 ";
2004 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 ";
2005 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 ";
2006 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 ";
2007 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 ";
2008 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 ";
2009 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 ";
2010 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 ";
2011 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 ";
2012 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 ";
2013 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 ";
2014 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 ";
2015 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 ";
2016 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 ";
2017 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 ";
2018 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 ";
2019 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 ";
2020 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 ";
2021 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 ";
2022 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 ";
2023 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 ";
2024 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 ";
2025 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 ";
2026 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 ";
2027 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 ";
2028 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 ";
2029 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 ";
2030 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 ";
2031 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 ";
2032 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 ";
2033 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 ";
2034 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 ";
2035 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 ";
2036 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 ";
2037 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 ";
2038 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 ";
2039 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 ";
2040 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 ";
2041 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 ";
2042 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 ";
2043 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 ";
2044 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 ";
2045 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 ";
2046 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 ";
2047 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 ";
2048 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 ";
2049 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 ";
2050 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 ";
2051 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 ";
2052 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 ";
2053 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 ";
2054 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 ";
2055 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 ";
2056 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 ";
2057 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 ";
2058 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 ";
2059 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 ";
2060 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 ";
2061 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 ";
2062 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 ";
2063 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 ";
2064 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 ";
2065 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 ";
2066 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 ";
2067 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 ";
2068 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 ";
2069 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 ";
2070 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 ";
2071 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 ";
2072 static const char __pyx_k_This_comparison_operator_is_not[] =
"This comparison operator is not implemented for ";
2073 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 ";
2074 static const char __pyx_k_index_set_sign_of_mult_line_366[] =
"index_set.sign_of_mult (line 366)";
2075 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 ";
2076 static const char __pyx_k_Cannot_initialize_clifford_objec[] =
"Cannot initialize clifford object from";
2077 static const char __pyx_k_Cannot_initialize_index_set_obje[] =
"Cannot initialize index_set object from";
2078 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 ";
2079 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 ";
2080 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 ";
2081 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 ";
2082 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 ";
2083 static const char __pyx_k_clifford_hidden_doctests_line_12[] =
"clifford_hidden_doctests (line 1244)";
2084 static const char __pyx_k_index_set_hidden_doctests_line_4[] =
"index_set_hidden_doctests (line 406)";
2085 static const char __pyx_k_index_set_sign_of_square_line_37[] =
"index_set.sign_of_square (line 375)";
2086 static const char __pyx_k_no_default___reduce___due_to_non[] =
"no default __reduce__ due to non-trivial __cinit__";
2087 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 ";
2088 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 ";
2089 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 ";
2090 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 ";
2091 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 ";
2092 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 ";
2093 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 ";
2094 static PyObject *__pyx_kp_u_;
2095 static PyObject *__pyx_kp_u_0_8_4;
2096 static PyObject *__pyx_kp_u_Abbreviation_for_clifford_index;
2097 static PyObject *__pyx_kp_u_Abbreviation_for_index_set_q_p;
2098 static PyObject *__pyx_kp_u_Absolute_value_of_multivector_m;
2099 static PyObject *__pyx_kp_u_Absolute_value_square_root_of_n;
2100 static PyObject *__pyx_kp_u_Cannot_initialize_clifford_objec;
2101 static PyObject *__pyx_kp_u_Cannot_initialize_index_set_obje;
2102 static PyObject *__pyx_kp_u_Cannot_reframe;
2103 static PyObject *__pyx_kp_u_Cannot_take_vector_part_of;
2104 static PyObject *__pyx_kp_u_Cardinality_Number_of_indices_i;
2105 static PyObject *__pyx_kp_u_Check_if_a_multivector_contains;
2106 static PyObject *__pyx_kp_u_Conjugation_reverse_o_involute;
2107 static PyObject *__pyx_kp_u_Conjugation_reverse_o_involute_2;
2108 static PyObject *__pyx_kp_u_Contraction_print_clifford_1_cl;
2109 static PyObject *__pyx_kp_u_Contraction_x_clifford_1_x_clif;
2110 static PyObject *__pyx_kp_u_Convert_CGA3_null_vector_to_Euc;
2111 static PyObject *__pyx_kp_u_Convert_CGA3_null_vector_to_sta;
2112 static PyObject *__pyx_kp_u_Convert_Euclidean_3D_multivecto;
2113 static PyObject *__pyx_kp_u_Copy_this_clifford_object_x_cli;
2114 static PyObject *__pyx_kp_u_Copy_this_index_set_object_s_in;
2115 static PyObject *__pyx_kp_u_Cosine_of_multivector_with_opti;
2116 static PyObject *__pyx_kp_u_Even_part_of_multivector_sum_of;
2117 static PyObject *__pyx_kp_u_Even_part_of_multivector_sum_of_2;
2118 static PyObject *__pyx_kp_u_Exponential_of_multivector_x_cl;
2119 static PyObject *__pyx_kp_u_Geometric_difference_print_clif;
2120 static PyObject *__pyx_kp_u_Geometric_difference_x_clifford;
2121 static PyObject *__pyx_kp_u_Geometric_multiplicative_invers;
2122 static PyObject *__pyx_kp_u_Geometric_multiplicative_invers_2;
2123 static PyObject *__pyx_kp_u_Geometric_product_print_cliffor;
2124 static PyObject *__pyx_kp_u_Geometric_product_x_clifford_2;
2125 static PyObject *__pyx_kp_u_Geometric_quotient_print_cliffo;
2126 static PyObject *__pyx_kp_u_Geometric_quotient_x_clifford_1;
2127 static PyObject *__pyx_kp_u_Geometric_sum_print_clifford_1;
2128 static PyObject *__pyx_kp_u_Geometric_sum_x_clifford_1_x_cl;
2129 static PyObject *__pyx_kp_u_Get_the_value_of_an_index_set_o;
2130 static PyObject *__pyx_kp_u_Hyperbolic_cosine_of_multivecto;
2131 static PyObject *__pyx_kp_u_Hyperbolic_sine_of_multivector;
2132 static PyObject *__pyx_kp_u_Hyperbolic_tangent_of_multivect;
2133 static PyObject *__pyx_kp_u_Imaginary_part_deprecated_alway;
2134 static PyObject *__pyx_n_s_IndexError;
2135 static PyObject *__pyx_kp_u_Inner_product_print_clifford_1;
2136 static PyObject *__pyx_kp_u_Inner_product_x_clifford_1_x_cl;
2137 static PyObject *__pyx_kp_u_Integer_power_of_multivector_ob;
2138 static PyObject *__pyx_n_s_Integral;
2139 static PyObject *__pyx_kp_u_Inverse_cosine_of_multivector_w;
2140 static PyObject *__pyx_kp_u_Inverse_hyperbolic_cosine_of_mu;
2141 static PyObject *__pyx_kp_u_Inverse_hyperbolic_sine_of_mult;
2142 static PyObject *__pyx_kp_u_Inverse_hyperbolic_tangent_of_m;
2143 static PyObject *__pyx_kp_u_Inverse_sine_of_multivector_wit;
2144 static PyObject *__pyx_kp_u_Inverse_tangent_of_multivector;
2145 static PyObject *__pyx_kp_u_Iterate_over_the_indices_of_an;
2146 static PyObject *__pyx_kp_u_Main_involution_each_i_is_repla;
2147 static PyObject *__pyx_kp_u_Main_involution_each_i_is_repla_2;
2148 static PyObject *__pyx_kp_u_Maximum_absolute_value_of_coord;
2149 static PyObject *__pyx_kp_u_Maximum_member_index_set_1_1_2;
2150 static PyObject *__pyx_kp_u_Maximum_of_absolute_values_of_c;
2151 static PyObject *__pyx_kp_u_Maximum_positive_index_or_0_if;
2152 static PyObject *__pyx_kp_u_Minimum_member_index_set_1_1_2;
2153 static PyObject *__pyx_kp_u_Minimum_negative_index_or_0_if;
2154 static PyObject *__pyx_kp_u_Natural_logarithm_of_multivecto;
2155 static PyObject *__pyx_kp_u_Norm_sum_of_squares_of_coordina;
2156 static PyObject *__pyx_n_s_NotImplemented;
2157 static PyObject *__pyx_kp_u_Not_applicable;
2158 static PyObject *__pyx_kp_u_Not_applicable_for_a_in_cliffor;
2159 static PyObject *__pyx_kp_u_Number_of_negative_indices_incl;
2160 static PyObject *__pyx_kp_u_Number_of_positive_indices_incl;
2161 static PyObject *__pyx_kp_u_Odd_part_of_multivector_sum_of;
2162 static PyObject *__pyx_kp_u_Odd_part_of_multivector_sum_of_2;
2163 static PyObject *__pyx_kp_u_Outer_product_power_of_multivec;
2164 static PyObject *__pyx_kp_u_Outer_product_power_x_clifford;
2165 static PyObject *__pyx_kp_u_Outer_product_print_clifford_1;
2166 static PyObject *__pyx_kp_u_Outer_product_x_clifford_1_x_cl;
2167 static PyObject *__pyx_kp_u_Power_self_to_the_m_x_clifford;
2168 static PyObject *__pyx_kp_u_Power_self_to_the_m_x_clifford_2;
2169 static PyObject *__pyx_kp_u_Pure_grade_vector_part_print_cl;
2170 static PyObject *__pyx_kp_u_Pure_part_print_clifford_1_1_1;
2171 static PyObject *__pyx_kp_u_Pure_part_print_pure_clifford_1;
2172 static PyObject *__pyx_kp_u_Put_self_into_a_larger_frame_co;
2173 static PyObject *__pyx_n_s_PyClical;
2174 static PyObject *__pyx_kp_s_PyClical_pyx;
2175 static PyObject *__pyx_kp_u_Quadratic_form_rev_x_x_0_print;
2176 static PyObject *__pyx_kp_u_Quadratic_form_rev_x_x_0_print_2;
2177 static PyObject *__pyx_kp_u_Random_multivector_within_a_fra;
2178 static PyObject *__pyx_n_s_Real;
2179 static PyObject *__pyx_kp_u_Real_part_synonym_for_scalar_pa;
2180 static PyObject *__pyx_kp_u_Remove_all_terms_of_self_with_r;
2181 static PyObject *__pyx_kp_u_Reversion_eg_1_2_2_1_print_reve;
2182 static PyObject *__pyx_kp_u_Reversion_eg_clifford_1_cliffor;
2183 static PyObject *__pyx_n_s_RuntimeError;
2184 static PyObject *__pyx_kp_u_Scalar_part_clifford_1_1_1_2_sc;
2185 static PyObject *__pyx_kp_u_Scalar_part_scalar_clifford_1_1;
2186 static PyObject *__pyx_n_s_Sequence;
2187 static PyObject *__pyx_kp_u_Set_complement_not_print_index;
2188 static PyObject *__pyx_kp_u_Set_intersection_and_print_inde;
2189 static PyObject *__pyx_kp_u_Set_intersection_and_x_index_se;
2190 static PyObject *__pyx_kp_u_Set_the_value_of_an_index_set_o;
2191 static PyObject *__pyx_kp_u_Set_union_or_print_index_set_1;
2192 static PyObject *__pyx_kp_u_Set_union_or_x_index_set_1_x_in;
2193 static PyObject *__pyx_kp_u_Sign_of_geometric_product_of_tw;
2194 static PyObject *__pyx_kp_u_Sign_of_geometric_square_of_a_C;
2195 static PyObject *__pyx_kp_u_Sine_of_multivector_with_option;
2196 static PyObject *__pyx_kp_u_Square_root_of_1_which_commutes;
2197 static PyObject *__pyx_kp_u_Square_root_of_multivector_with;
2198 static PyObject *__pyx_kp_u_Subalgebra_generated_by_all_gen;
2199 static PyObject *__pyx_kp_u_Subscripting_map_from_index_set;
2200 static PyObject *__pyx_kp_u_Symmetric_set_difference_exclus;
2201 static PyObject *__pyx_kp_u_Symmetric_set_difference_exclus_2;
2202 static PyObject *__pyx_kp_u_Tangent_of_multivector_with_opt;
2203 static PyObject *__pyx_kp_u_Tests_for_functions_that_Doctes;
2204 static PyObject *__pyx_kp_u_Tests_for_functions_that_Doctes_2;
2205 static PyObject *__pyx_kp_u_The_informal_string_representat;
2206 static PyObject *__pyx_kp_u_The_informal_string_representat_2;
2207 static PyObject *__pyx_kp_u_The_official_string_representat;
2208 static PyObject *__pyx_kp_u_The_official_string_representat_2;
2209 static PyObject *__pyx_kp_u_This_comparison_operator_is_not;
2210 static PyObject *__pyx_kp_u_Transform_left_hand_side_using;
2211 static PyObject *__pyx_kp_u_Transform_left_hand_side_using_2;
2212 static PyObject *__pyx_n_s_TypeError;
2213 static PyObject *__pyx_kp_u_UTF_8;
2214 static PyObject *__pyx_kp_u_Unary_print_clifford_1_1;
2215 static PyObject *__pyx_kp_u_Unary_print_clifford_1_1_2;
2216 static PyObject *__pyx_n_s_ValueError;
2217 static PyObject *__pyx_kp_u_Vector_part_of_multivector_as_a;
2218 static PyObject *__pyx_kp_u__2;
2219 static PyObject *__pyx_kp_u__5;
2220 static PyObject *__pyx_kp_u__6;
2221 static PyObject *__pyx_kp_u__7;
2222 static PyObject *__pyx_kp_u__8;
2223 static PyObject *__pyx_kp_u__9;
2224 static PyObject *__pyx_n_s_abc;
2225 static PyObject *__pyx_kp_u_abs_line_1472;
2226 static PyObject *__pyx_n_s_acos;
2227 static PyObject *__pyx_kp_u_acos_line_1618;
2228 static PyObject *__pyx_n_s_acosh;
2229 static PyObject *__pyx_kp_u_acosh_line_1655;
2230 static PyObject *__pyx_kp_u_agc3_line_1843;
2231 static PyObject *__pyx_n_s_args;
2232 static PyObject *__pyx_kp_u_as_frame;
2233 static PyObject *__pyx_n_s_asin;
2234 static PyObject *__pyx_kp_u_asin_line_1697;
2235 static PyObject *__pyx_n_s_asinh;
2236 static PyObject *__pyx_kp_u_asinh_line_1732;
2237 static PyObject *__pyx_n_s_atan;
2238 static PyObject *__pyx_kp_u_atan_line_1768;
2239 static PyObject *__pyx_n_s_atanh;
2240 static PyObject *__pyx_kp_u_atanh_line_1797;
2241 static PyObject *__pyx_kp_u_cga3_line_1823;
2242 static PyObject *__pyx_kp_u_cga3std_line_1832;
2243 static PyObject *__pyx_n_s_cl;
2244 static PyObject *__pyx_n_s_clifford;
2245 static PyObject *__pyx_kp_u_clifford___add___line_740;
2246 static PyObject *__pyx_kp_u_clifford___and___line_836;
2247 static PyObject *__pyx_kp_u_clifford___call___line_1020;
2248 static PyObject *__pyx_kp_u_clifford___getitem___line_707;
2249 static PyObject *__pyx_kp_u_clifford___iadd___line_751;
2250 static PyObject *__pyx_kp_u_clifford___iand___line_851;
2251 static PyObject *__pyx_kp_u_clifford___idiv___line_911;
2252 static PyObject *__pyx_kp_u_clifford___imod___line_821;
2253 static PyObject *__pyx_kp_u_clifford___imul___line_793;
2254 static PyObject *__pyx_kp_u_clifford___ior___line_950;
2255 static PyObject *__pyx_kp_u_clifford___isub___line_771;
2256 static PyObject *__pyx_kp_u_clifford___iter___line_638;
2257 static PyObject *__pyx_kp_u_clifford___ixor___line_881;
2258 static PyObject *__pyx_kp_u_clifford___mod___line_806;
2259 static PyObject *__pyx_kp_u_clifford___mul___line_780;
2260 static PyObject *__pyx_kp_u_clifford___neg___line_722;
2261 static PyObject *__pyx_kp_u_clifford___or___line_939;
2262 static PyObject *__pyx_kp_u_clifford___pos___line_731;
2263 static PyObject *__pyx_kp_u_clifford___pow___line_961;
2264 static PyObject *__pyx_kp_u_clifford___repr___line_1226;
2265 static PyObject *__pyx_kp_u_clifford___str___line_1235;
2266 static PyObject *__pyx_kp_u_clifford___sub___line_760;
2267 static PyObject *__pyx_kp_u_clifford___truediv___line_896;
2268 static PyObject *__pyx_kp_u_clifford___xor___line_866;
2269 static PyObject *__pyx_kp_u_clifford_abs_line_1175;
2270 static PyObject *__pyx_kp_u_clifford_conj_line_1138;
2271 static PyObject *__pyx_kp_u_clifford_copy_line_556;
2272 static PyObject *__pyx_kp_u_clifford_even_line_1061;
2273 static PyObject *__pyx_kp_u_clifford_frame_line_1215;
2274 static PyObject *__pyx_n_s_clifford_hidden_doctests;
2275 static PyObject *__pyx_kp_u_clifford_hidden_doctests_line_12;
2276 static PyObject *__pyx_kp_u_clifford_inv_line_926;
2277 static PyObject *__pyx_kp_u_clifford_involute_line_1107;
2278 static PyObject *__pyx_kp_u_clifford_isnan_line_1206;
2279 static PyObject *__pyx_kp_u_clifford_max_abs_line_1184;
2280 static PyObject *__pyx_kp_u_clifford_norm_line_1164;
2281 static PyObject *__pyx_kp_u_clifford_odd_line_1070;
2282 static PyObject *__pyx_kp_u_clifford_outer_pow_line_1004;
2283 static PyObject *__pyx_kp_u_clifford_pow_line_980;
2284 static PyObject *__pyx_kp_u_clifford_pure_line_1050;
2285 static PyObject *__pyx_kp_u_clifford_quad_line_1153;
2286 static PyObject *__pyx_kp_u_clifford_reframe_line_649;
2287 static PyObject *__pyx_kp_u_clifford_reverse_line_1123;
2288 static PyObject *__pyx_kp_u_clifford_scalar_line_1039;
2289 static PyObject *__pyx_kp_u_clifford_truncated_line_1195;
2290 static PyObject *__pyx_kp_u_clifford_vector_part_line_1079;
2291 static PyObject *__pyx_n_s_cline_in_traceback;
2292 static PyObject *__pyx_n_s_close;
2293 static PyObject *__pyx_n_s_collections;
2294 static PyObject *__pyx_kp_u_compare_line_492;
2295 static PyObject *__pyx_kp_u_complexifier_line_1526;
2296 static PyObject *__pyx_n_s_conj;
2297 static PyObject *__pyx_kp_u_conj_line_1435;
2298 static PyObject *__pyx_n_s_copy;
2299 static PyObject *__pyx_n_s_cos;
2300 static PyObject *__pyx_kp_u_cos_line_1601;
2301 static PyObject *__pyx_n_s_cosh;
2302 static PyObject *__pyx_kp_u_cosh_line_1639;
2303 static PyObject *__pyx_n_s_doctest;
2304 static PyObject *__pyx_n_s_e;
2305 static PyObject *__pyx_kp_u_e_line_1886;
2306 static PyObject *__pyx_n_s_encode;
2307 static PyObject *__pyx_n_s_even;
2308 static PyObject *__pyx_kp_u_even_line_1387;
2309 static PyObject *__pyx_n_s_exp;
2310 static PyObject *__pyx_kp_u_exp_line_1564;
2311 static PyObject *__pyx_n_s_fill;
2312 static PyObject *__pyx_n_s_frm;
2313 static PyObject *__pyx_kp_u_from;
2314 static PyObject *__pyx_n_s_getstate;
2315 static PyObject *__pyx_n_s_grade;
2316 static PyObject *__pyx_n_s_i;
2317 static PyObject *__pyx_kp_u_imag_line_1365;
2318 static PyObject *__pyx_n_s_import;
2319 static PyObject *__pyx_n_s_index_set;
2320 static PyObject *__pyx_kp_u_index_set___and___line_271;
2321 static PyObject *__pyx_kp_u_index_set___getitem___line_191;
2322 static PyObject *__pyx_kp_u_index_set___iand___line_282;
2323 static PyObject *__pyx_kp_u_index_set___invert___line_240;
2324 static PyObject *__pyx_kp_u_index_set___ior___line_304;
2325 static PyObject *__pyx_n_s_index_set___iter;
2326 static PyObject *__pyx_kp_u_index_set___iter___line_229;
2327 static PyObject *__pyx_kp_u_index_set___ixor___line_260;
2328 static PyObject *__pyx_kp_u_index_set___or___line_293;
2329 static PyObject *__pyx_kp_u_index_set___repr___line_384;
2330 static PyObject *__pyx_kp_u_index_set___setitem___line_179;
2331 static PyObject *__pyx_kp_u_index_set___str___line_395;
2332 static PyObject *__pyx_kp_u_index_set___xor___line_249;
2333 static PyObject *__pyx_kp_u_index_set_copy_line_65;
2334 static PyObject *__pyx_kp_u_index_set_count_line_315;
2335 static PyObject *__pyx_kp_u_index_set_count_neg_line_324;
2336 static PyObject *__pyx_kp_u_index_set_count_pos_line_333;
2337 static PyObject *__pyx_n_s_index_set_hidden_doctests;
2338 static PyObject *__pyx_kp_u_index_set_hidden_doctests_line_4;
2339 static PyObject *__pyx_kp_u_index_set_max_line_351;
2340 static PyObject *__pyx_kp_u_index_set_min_line_342;
2341 static PyObject *__pyx_kp_u_index_set_sign_of_mult_line_366;
2342 static PyObject *__pyx_kp_u_index_set_sign_of_square_line_37;
2343 static PyObject *__pyx_n_s_inv;
2344 static PyObject *__pyx_kp_u_inv_line_1328;
2345 static PyObject *__pyx_kp_u_invalid;
2346 static PyObject *__pyx_kp_u_invalid_string;
2347 static PyObject *__pyx_n_s_involute;
2348 static PyObject *__pyx_kp_u_involute_line_1405;
2349 static PyObject *__pyx_n_s_ist;
2350 static PyObject *__pyx_n_s_istpq;
2351 static PyObject *__pyx_kp_u_istpq_line_1899;
2352 static PyObject *__pyx_n_s_iter;
2353 static PyObject *__pyx_n_s_ixt;
2354 static PyObject *__pyx_kp_u_lexicographic_compare_eg_3_4_5;
2355 static PyObject *__pyx_n_s_lhs;
2356 static PyObject *__pyx_n_s_log;
2357 static PyObject *__pyx_kp_u_log_line_1578;
2358 static PyObject *__pyx_n_s_m;
2359 static PyObject *__pyx_n_s_main;
2360 static PyObject *__pyx_n_u_main;
2361 static PyObject *__pyx_n_s_math;
2362 static PyObject *__pyx_n_s_max;
2363 static PyObject *__pyx_kp_u_max_abs_line_1481;
2364 static PyObject *__pyx_kp_u_max_pos_line_513;
2365 static PyObject *__pyx_n_s_min;
2366 static PyObject *__pyx_kp_u_min_neg_line_504;
2367 static PyObject *__pyx_n_s_name;
2368 static PyObject *__pyx_n_s_nbar3;
2369 static PyObject *__pyx_n_s_ninf3;
2370 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2371 static PyObject *__pyx_n_s_norm;
2372 static PyObject *__pyx_kp_u_norm_line_1461;
2373 static PyObject *__pyx_kp_u_norm_sum_of_squares_of_coordina;
2374 static PyObject *__pyx_n_s_numbers;
2375 static PyObject *__pyx_n_s_obj;
2376 static PyObject *__pyx_n_s_odd;
2377 static PyObject *__pyx_kp_u_odd_line_1396;
2378 static PyObject *__pyx_n_s_other;
2379 static PyObject *__pyx_n_s_outer_pow;
2380 static PyObject *__pyx_kp_u_outer_pow_line_1517;
2381 static PyObject *__pyx_n_s_p;
2382 static PyObject *__pyx_n_s_pi;
2383 static PyObject *__pyx_n_s_pow;
2384 static PyObject *__pyx_kp_u_pow_line_1493;
2385 static PyObject *__pyx_n_s_pure;
2386 static PyObject *__pyx_kp_u_pure_line_1376;
2387 static PyObject *__pyx_n_s_pyx_vtable;
2388 static PyObject *__pyx_n_s_q;
2389 static PyObject *__pyx_n_s_quad;
2390 static PyObject *__pyx_kp_u_quad_line_1450;
2391 static PyObject *__pyx_kp_u_random_clifford_line_1814;
2392 static PyObject *__pyx_n_s_range;
2393 static PyObject *__pyx_kp_u_real_line_1354;
2394 static PyObject *__pyx_n_s_reduce;
2395 static PyObject *__pyx_n_s_reduce_cython;
2396 static PyObject *__pyx_n_s_reduce_ex;
2397 static PyObject *__pyx_n_s_reverse;
2398 static PyObject *__pyx_kp_u_reverse_line_1420;
2399 static PyObject *__pyx_n_s_rhs;
2400 static PyObject *__pyx_n_s_scalar;
2401 static PyObject *__pyx_n_s_scalar_epsilon;
2402 static PyObject *__pyx_kp_u_scalar_line_1343;
2403 static PyObject *__pyx_n_s_send;
2404 static PyObject *__pyx_n_s_setstate;
2405 static PyObject *__pyx_n_s_setstate_cython;
2406 static PyObject *__pyx_n_s_sin;
2407 static PyObject *__pyx_kp_u_sin_line_1678;
2408 static PyObject *__pyx_n_s_sinh;
2409 static PyObject *__pyx_kp_u_sinh_line_1718;
2410 static PyObject *__pyx_n_s_sqrt;
2411 static PyObject *__pyx_kp_u_sqrt_line_1541;
2412 static PyObject *__pyx_n_s_tan;
2413 static PyObject *__pyx_kp_u_tan_line_1751;
2414 static PyObject *__pyx_n_s_tanh;
2415 static PyObject *__pyx_kp_u_tanh_line_1785;
2416 static PyObject *__pyx_n_s_tau;
2417 static PyObject *__pyx_n_s_test;
2418 static PyObject *__pyx_n_s_test_2;
2419 static PyObject *__pyx_n_s_testmod;
2420 static PyObject *__pyx_n_s_throw;
2421 static PyObject *__pyx_kp_u_to_frame;
2422 static PyObject *__pyx_kp_u_using;
2423 static PyObject *__pyx_kp_u_using_invalid;
2424 static PyObject *__pyx_kp_u_value;
2425 static PyObject *__pyx_n_s_version;
2426 static PyObject *__pyx_n_s_xrange;
2427 static PyObject *__pyx_pf_8PyClical_9index_set_copy(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2428 static int __pyx_pf_8PyClical_9index_set_2__cinit__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_other);
2429 static void __pyx_pf_8PyClical_9index_set_4__dealloc__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2430 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);
2431 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);
2432 static PyObject *__pyx_pf_8PyClical_9index_set_10__getitem__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_idx);
2433 static int __pyx_pf_8PyClical_9index_set_12__contains__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_idx);
2434 static PyObject *__pyx_pf_8PyClical_9index_set_14__iter__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2435 static PyObject *__pyx_pf_8PyClical_9index_set_17__invert__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2436 static PyObject *__pyx_pf_8PyClical_9index_set_19__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2437 static PyObject *__pyx_pf_8PyClical_9index_set_21__ixor__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs);
2438 static PyObject *__pyx_pf_8PyClical_9index_set_23__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2439 static PyObject *__pyx_pf_8PyClical_9index_set_25__iand__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs);
2440 static PyObject *__pyx_pf_8PyClical_9index_set_27__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2441 static PyObject *__pyx_pf_8PyClical_9index_set_29__ior__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs);
2442 static PyObject *__pyx_pf_8PyClical_9index_set_31count(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2443 static PyObject *__pyx_pf_8PyClical_9index_set_33count_neg(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2444 static PyObject *__pyx_pf_8PyClical_9index_set_35count_pos(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2445 static PyObject *__pyx_pf_8PyClical_9index_set_37min(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2446 static PyObject *__pyx_pf_8PyClical_9index_set_39max(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2447 static PyObject *__pyx_pf_8PyClical_9index_set_41hash_fn(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2448 static PyObject *__pyx_pf_8PyClical_9index_set_43sign_of_mult(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs);
2449 static PyObject *__pyx_pf_8PyClical_9index_set_45sign_of_square(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2450 static PyObject *__pyx_pf_8PyClical_9index_set_47__repr__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2451 static PyObject *__pyx_pf_8PyClical_9index_set_49__str__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2452 static PyObject *__pyx_pf_8PyClical_9index_set_51__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_index_set *__pyx_v_self);
2453 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);
2454 static PyObject *__pyx_pf_8PyClical_index_set_hidden_doctests(CYTHON_UNUSED PyObject *__pyx_self);
2455 static PyObject *__pyx_pf_8PyClical_2compare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2456 static PyObject *__pyx_pf_8PyClical_4min_neg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2457 static PyObject *__pyx_pf_8PyClical_6max_pos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2458 static PyObject *__pyx_pf_8PyClical_8clifford_copy(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2459 static int __pyx_pf_8PyClical_8clifford_2__cinit__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_ixt);
2460 static void __pyx_pf_8PyClical_8clifford_4__dealloc__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2461 static int __pyx_pf_8PyClical_8clifford_6__contains__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_x);
2462 static PyObject *__pyx_pf_8PyClical_8clifford_8__iter__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2463 static PyObject *__pyx_pf_8PyClical_8clifford_10reframe(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_ixt);
2464 static PyObject *__pyx_pf_8PyClical_8clifford_12__richcmp__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op);
2465 static PyObject *__pyx_pf_8PyClical_8clifford_14__getitem__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_ixt);
2466 static PyObject *__pyx_pf_8PyClical_8clifford_16__neg__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2467 static PyObject *__pyx_pf_8PyClical_8clifford_18__pos__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2468 static PyObject *__pyx_pf_8PyClical_8clifford_20__add__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2469 static PyObject *__pyx_pf_8PyClical_8clifford_22__iadd__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2470 static PyObject *__pyx_pf_8PyClical_8clifford_24__sub__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2471 static PyObject *__pyx_pf_8PyClical_8clifford_26__isub__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2472 static PyObject *__pyx_pf_8PyClical_8clifford_28__mul__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2473 static PyObject *__pyx_pf_8PyClical_8clifford_30__imul__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2474 static PyObject *__pyx_pf_8PyClical_8clifford_32__mod__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2475 static PyObject *__pyx_pf_8PyClical_8clifford_34__imod__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2476 static PyObject *__pyx_pf_8PyClical_8clifford_36__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2477 static PyObject *__pyx_pf_8PyClical_8clifford_38__iand__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2478 static PyObject *__pyx_pf_8PyClical_8clifford_40__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2479 static PyObject *__pyx_pf_8PyClical_8clifford_42__ixor__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2480 static PyObject *__pyx_pf_8PyClical_8clifford_44__truediv__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2481 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
2482 static PyObject *__pyx_pf_8PyClical_8clifford_46__idiv__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2484 static PyObject *__pyx_pf_8PyClical_8clifford_48inv(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2485 static PyObject *__pyx_pf_8PyClical_8clifford_50__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
2486 static PyObject *__pyx_pf_8PyClical_8clifford_52__ior__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs);
2487 static PyObject *__pyx_pf_8PyClical_8clifford_54__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_m, CYTHON_UNUSED PyObject *__pyx_v_dummy);
2488 static PyObject *__pyx_pf_8PyClical_8clifford_56pow(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_m);
2489 static PyObject *__pyx_pf_8PyClical_8clifford_58outer_pow(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_m);
2490 static PyObject *__pyx_pf_8PyClical_8clifford_60__call__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_grade);
2491 static PyObject *__pyx_pf_8PyClical_8clifford_62scalar(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2492 static PyObject *__pyx_pf_8PyClical_8clifford_64pure(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2493 static PyObject *__pyx_pf_8PyClical_8clifford_66even(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2494 static PyObject *__pyx_pf_8PyClical_8clifford_68odd(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2495 static PyObject *__pyx_pf_8PyClical_8clifford_70vector_part(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_frm);
2496 static PyObject *__pyx_pf_8PyClical_8clifford_72involute(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2497 static PyObject *__pyx_pf_8PyClical_8clifford_74reverse(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2498 static PyObject *__pyx_pf_8PyClical_8clifford_76conj(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2499 static PyObject *__pyx_pf_8PyClical_8clifford_78quad(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2500 static PyObject *__pyx_pf_8PyClical_8clifford_80norm(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2501 static PyObject *__pyx_pf_8PyClical_8clifford_82abs(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2502 static PyObject *__pyx_pf_8PyClical_8clifford_84max_abs(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2503 static PyObject *__pyx_pf_8PyClical_8clifford_86truncated(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_limit);
2504 static PyObject *__pyx_pf_8PyClical_8clifford_88isnan(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2505 static PyObject *__pyx_pf_8PyClical_8clifford_90frame(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2506 static PyObject *__pyx_pf_8PyClical_8clifford_92__repr__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2507 static PyObject *__pyx_pf_8PyClical_8clifford_94__str__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2508 static PyObject *__pyx_pf_8PyClical_8clifford_96__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self);
2509 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);
2510 static PyObject *__pyx_pf_8PyClical_8clifford_hidden_doctests(CYTHON_UNUSED PyObject *__pyx_self);
2511 static PyObject *__pyx_pf_8PyClical_10inv(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2512 static PyObject *__pyx_pf_8PyClical_12scalar(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2513 static PyObject *__pyx_pf_8PyClical_14real(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2514 static PyObject *__pyx_pf_8PyClical_16imag(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2515 static PyObject *__pyx_pf_8PyClical_18pure(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2516 static PyObject *__pyx_pf_8PyClical_20even(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2517 static PyObject *__pyx_pf_8PyClical_22odd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2518 static PyObject *__pyx_pf_8PyClical_24involute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2519 static PyObject *__pyx_pf_8PyClical_26reverse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2520 static PyObject *__pyx_pf_8PyClical_28conj(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2521 static PyObject *__pyx_pf_8PyClical_30quad(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2522 static PyObject *__pyx_pf_8PyClical_32norm(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2523 static PyObject *__pyx_pf_8PyClical_34abs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2524 static PyObject *__pyx_pf_8PyClical_36max_abs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2525 static PyObject *__pyx_pf_8PyClical_38pow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_m);
2526 static PyObject *__pyx_pf_8PyClical_40outer_pow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_m);
2527 static PyObject *__pyx_pf_8PyClical_42complexifier(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2528 static PyObject *__pyx_pf_8PyClical_44sqrt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2529 static PyObject *__pyx_pf_8PyClical_46exp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2530 static PyObject *__pyx_pf_8PyClical_48log(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2531 static PyObject *__pyx_pf_8PyClical_50cos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2532 static PyObject *__pyx_pf_8PyClical_52acos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2533 static PyObject *__pyx_pf_8PyClical_54cosh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2534 static PyObject *__pyx_pf_8PyClical_56acosh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2535 static PyObject *__pyx_pf_8PyClical_58sin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2536 static PyObject *__pyx_pf_8PyClical_60asin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2537 static PyObject *__pyx_pf_8PyClical_62sinh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2538 static PyObject *__pyx_pf_8PyClical_64asinh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2539 static PyObject *__pyx_pf_8PyClical_66tan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2540 static PyObject *__pyx_pf_8PyClical_68atan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2541 static PyObject *__pyx_pf_8PyClical_70tanh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2542 static PyObject *__pyx_pf_8PyClical_72atanh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i);
2543 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);
2544 static PyObject *__pyx_pf_8PyClical_76cga3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2545 static PyObject *__pyx_pf_8PyClical_78cga3std(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2546 static PyObject *__pyx_pf_8PyClical_80agc3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2547 static PyObject *__pyx_pf_8PyClical_82e(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj);
2548 static PyObject *__pyx_pf_8PyClical_84istpq(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_p, PyObject *__pyx_v_q);
2549 static PyObject *__pyx_pf_8PyClical_86_test(CYTHON_UNUSED PyObject *__pyx_self);
2550 static PyObject *__pyx_tp_new_8PyClical_index_set(PyTypeObject *t, PyObject *a, PyObject *k);
2551 static PyObject *__pyx_tp_new_8PyClical_clifford(PyTypeObject *t, PyObject *a, PyObject *k);
2552 static PyObject *__pyx_tp_new_8PyClical___pyx_scope_struct____iter__(PyTypeObject *t, PyObject *a, PyObject *k);
2553 static PyObject *__pyx_float_0_0;
2554 static PyObject *__pyx_float_1_0;
2555 static PyObject *__pyx_float_4_0;
2556 static PyObject *__pyx_float_8_0;
2557 static PyObject *__pyx_int_0;
2558 static PyObject *__pyx_int_1;
2559 static PyObject *__pyx_int_4;
2560 static PyObject *__pyx_int_neg_1;
2561 static PyObject *__pyx_tuple__3;
2562 static PyObject *__pyx_tuple__4;
2563 static PyObject *__pyx_tuple__10;
2564 static PyObject *__pyx_tuple__11;
2565 static PyObject *__pyx_tuple__12;
2566 static PyObject *__pyx_tuple__15;
2567 static PyObject *__pyx_tuple__16;
2568 static PyObject *__pyx_tuple__18;
2569 static PyObject *__pyx_tuple__20;
2570 static PyObject *__pyx_tuple__21;
2571 static PyObject *__pyx_tuple__22;
2572 static PyObject *__pyx_codeobj__13;
2573 static PyObject *__pyx_codeobj__14;
2574 static PyObject *__pyx_codeobj__17;
2575 static PyObject *__pyx_codeobj__19;
2576 static PyObject *__pyx_codeobj__23;
2587 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_toIndexSet(PyObject *__pyx_v_obj) {
2589 __Pyx_RefNannyDeclarations
2590 PyObject *__pyx_t_1 = NULL;
2591 __Pyx_RefNannySetupContext(
"toIndexSet", 0);
2600 __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)
2601 __Pyx_GOTREF(__pyx_t_1);
2602 __pyx_r = (((
struct __pyx_obj_8PyClical_index_set *)__pyx_t_1)->instance[0]);
2603 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2616 __Pyx_XDECREF(__pyx_t_1);
2617 __Pyx_WriteUnraisable(
"PyClical.toIndexSet", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
2618 __Pyx_pretend_to_initialize(&__pyx_r);
2620 __Pyx_RefNannyFinishContext();
2632 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_9index_set_wrap(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self,
IndexSet __pyx_v_other) {
2633 PyObject *__pyx_r = NULL;
2634 __Pyx_RefNannyDeclarations
2635 __Pyx_RefNannySetupContext(
"wrap", 0);
2644 (__pyx_v_self->instance[0]) = __pyx_v_other;
2653 __Pyx_XDECREF(__pyx_r);
2654 __Pyx_INCREF(((PyObject *)__pyx_v_self));
2655 __pyx_r = ((PyObject *)__pyx_v_self);
2668 __Pyx_XGIVEREF(__pyx_r);
2669 __Pyx_RefNannyFinishContext();
2681 static CYTHON_INLINE
IndexSet __pyx_f_8PyClical_9index_set_unwrap(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
2683 __Pyx_RefNannyDeclarations
2684 __Pyx_RefNannySetupContext(
"unwrap", 0);
2693 __pyx_r = (__pyx_v_self->instance[0]);
2706 __Pyx_RefNannyFinishContext();
2718 static PyObject *__pyx_pw_8PyClical_9index_set_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
2719 static PyObject *__pyx_f_8PyClical_9index_set_copy(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self,
int __pyx_skip_dispatch) {
2720 PyObject *__pyx_r = NULL;
2721 __Pyx_RefNannyDeclarations
2722 PyObject *__pyx_t_1 = NULL;
2723 PyObject *__pyx_t_2 = NULL;
2724 PyObject *__pyx_t_3 = NULL;
2725 PyObject *__pyx_t_4 = NULL;
2726 __Pyx_RefNannySetupContext(
"copy", 0);
2728 if (unlikely(__pyx_skip_dispatch)) ;
2730 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)))) {
2731 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
2732 static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
2733 if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
2734 PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
2736 __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)
2737 __Pyx_GOTREF(__pyx_t_1);
2738 if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(
void*)__pyx_pw_8PyClical_9index_set_1copy)) {
2739 __Pyx_XDECREF(__pyx_r);
2740 __Pyx_INCREF(__pyx_t_1);
2741 __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
2742 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
2743 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
2744 if (likely(__pyx_t_4)) {
2745 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
2746 __Pyx_INCREF(__pyx_t_4);
2747 __Pyx_INCREF(
function);
2748 __Pyx_DECREF_SET(__pyx_t_3,
function);
2751 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
2752 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
2753 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error)
2754 __Pyx_GOTREF(__pyx_t_2);
2755 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2756 __pyx_r = __pyx_t_2;
2758 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2761 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
2762 __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
2763 __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
2764 if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
2765 __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
2768 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2769 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
2781 __Pyx_XDECREF(__pyx_r);
2782 __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)
2783 __Pyx_GOTREF(__pyx_t_1);
2784 __pyx_r = __pyx_t_1;
2798 __Pyx_XDECREF(__pyx_t_1);
2799 __Pyx_XDECREF(__pyx_t_2);
2800 __Pyx_XDECREF(__pyx_t_3);
2801 __Pyx_XDECREF(__pyx_t_4);
2802 __Pyx_AddTraceback(
"PyClical.index_set.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
2805 __Pyx_XGIVEREF(__pyx_r);
2806 __Pyx_RefNannyFinishContext();
2811 static PyObject *__pyx_pw_8PyClical_9index_set_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
2812 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 ";
2813 static PyObject *__pyx_pw_8PyClical_9index_set_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
2814 PyObject *__pyx_r = 0;
2815 __Pyx_RefNannyDeclarations
2816 __Pyx_RefNannySetupContext(
"copy (wrapper)", 0);
2817 __pyx_r = __pyx_pf_8PyClical_9index_set_copy(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
2820 __Pyx_RefNannyFinishContext();
2824 static PyObject *__pyx_pf_8PyClical_9index_set_copy(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
2825 PyObject *__pyx_r = NULL;
2826 __Pyx_RefNannyDeclarations
2827 PyObject *__pyx_t_1 = NULL;
2828 __Pyx_RefNannySetupContext(
"copy", 0);
2829 __Pyx_XDECREF(__pyx_r);
2830 __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)
2831 __Pyx_GOTREF(__pyx_t_1);
2832 __pyx_r = __pyx_t_1;
2838 __Pyx_XDECREF(__pyx_t_1);
2839 __Pyx_AddTraceback(
"PyClical.index_set.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
2842 __Pyx_XGIVEREF(__pyx_r);
2843 __Pyx_RefNannyFinishContext();
2856 static int __pyx_pw_8PyClical_9index_set_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2857 static int __pyx_pw_8PyClical_9index_set_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2858 PyObject *__pyx_v_other = 0;
2860 __Pyx_RefNannyDeclarations
2861 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
2863 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,0};
2864 PyObject* values[1] = {0};
2865 values[0] = ((PyObject *)__pyx_int_0);
2866 if (unlikely(__pyx_kwds)) {
2868 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2870 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2873 default:
goto __pyx_L5_argtuple_error;
2875 kw_args = PyDict_Size(__pyx_kwds);
2879 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other);
2880 if (value) { values[0] = value; kw_args--; }
2883 if (unlikely(kw_args > 0)) {
2884 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(0, 74, __pyx_L3_error)
2887 switch (PyTuple_GET_SIZE(__pyx_args)) {
2888 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2891 default:
goto __pyx_L5_argtuple_error;
2894 __pyx_v_other = values[0];
2896 goto __pyx_L4_argument_unpacking_done;
2897 __pyx_L5_argtuple_error:;
2898 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 74, __pyx_L3_error)
2900 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2901 __Pyx_RefNannyFinishContext();
2903 __pyx_L4_argument_unpacking_done:;
2904 __pyx_r = __pyx_pf_8PyClical_9index_set_2__cinit__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), __pyx_v_other);
2907 __Pyx_RefNannyFinishContext();
2911 static int __pyx_pf_8PyClical_9index_set_2__cinit__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_other) {
2912 PyObject *__pyx_v_error_msg_prefix = NULL;
2913 PyObject *__pyx_v_idx = NULL;
2914 PyObject *__pyx_v_bother = NULL;
2916 __Pyx_RefNannyDeclarations
2920 PyObject *__pyx_t_4 = NULL;
2921 PyObject *__pyx_t_5 = NULL;
2924 PyObject *__pyx_t_8 = NULL;
2925 PyObject *__pyx_t_9 = NULL;
2926 PyObject *__pyx_t_10 = NULL;
2927 Py_ssize_t __pyx_t_11;
2928 PyObject *(*__pyx_t_12)(PyObject *);
2929 PyObject *__pyx_t_13 = NULL;
2930 PyObject *__pyx_t_14 = NULL;
2931 PyObject *__pyx_t_15 = NULL;
2932 PyObject *__pyx_t_16 = NULL;
2934 __Pyx_RefNannySetupContext(
"__cinit__", 0);
2943 __Pyx_INCREF(__pyx_kp_u_Cannot_initialize_index_set_obje);
2944 __pyx_v_error_msg_prefix = __pyx_kp_u_Cannot_initialize_index_set_obje;
2953 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8PyClical_index_set);
2954 __pyx_t_2 = (__pyx_t_1 != 0);
2965 __pyx_t_3 =
new IndexSet(__pyx_f_8PyClical_9index_set_unwrap(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_other)));
2967 __Pyx_CppExn2PyErr();
2968 __PYX_ERR(0, 95, __pyx_L1_error)
2970 __pyx_v_self->instance = __pyx_t_3;
2989 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_numbers);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error)
2990 __Pyx_GOTREF(__pyx_t_4);
2991 __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)
2992 __Pyx_GOTREF(__pyx_t_5);
2993 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2994 __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)
2995 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2996 __pyx_t_1 = (__pyx_t_2 != 0);
3006 __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)
3008 __pyx_t_3 =
new IndexSet(((
int)__pyx_t_6));
3010 __Pyx_CppExn2PyErr();
3011 __PYX_ERR(0, 97, __pyx_L1_error)
3013 __pyx_v_self->instance = __pyx_t_3;
3032 __pyx_t_2 = PySet_Check(__pyx_v_other);
3033 __pyx_t_7 = (__pyx_t_2 != 0);
3036 __pyx_t_1 = __pyx_t_7;
3037 goto __pyx_L4_bool_binop_done;
3039 __pyx_t_7 = PyFrozenSet_Check(__pyx_v_other);
3040 __pyx_t_2 = (__pyx_t_7 != 0);
3041 __pyx_t_1 = __pyx_t_2;
3042 __pyx_L4_bool_binop_done:;
3043 __pyx_t_2 = (__pyx_t_1 != 0);
3054 __Pyx_PyThreadState_declare
3055 __Pyx_PyThreadState_assign
3056 __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
3057 __Pyx_XGOTREF(__pyx_t_8);
3058 __Pyx_XGOTREF(__pyx_t_9);
3059 __Pyx_XGOTREF(__pyx_t_10);
3070 __pyx_v_self->instance = __pyx_t_3;
3079 if (likely(PyList_CheckExact(__pyx_v_other)) || PyTuple_CheckExact(__pyx_v_other)) {
3080 __pyx_t_5 = __pyx_v_other; __Pyx_INCREF(__pyx_t_5); __pyx_t_11 = 0;
3083 __pyx_t_11 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_other);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 101, __pyx_L6_error)
3084 __Pyx_GOTREF(__pyx_t_5);
3085 __pyx_t_12 = Py_TYPE(__pyx_t_5)->tp_iternext;
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 101, __pyx_L6_error)
3088 if (likely(!__pyx_t_12)) {
3089 if (likely(PyList_CheckExact(__pyx_t_5))) {
3090 if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_5))
break;
3091 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3092 __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)
3094 __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)
3095 __Pyx_GOTREF(__pyx_t_4);
3098 if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_5))
break;
3099 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3100 __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)
3102 __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)
3103 __Pyx_GOTREF(__pyx_t_4);
3107 __pyx_t_4 = __pyx_t_12(__pyx_t_5);
3108 if (unlikely(!__pyx_t_4)) {
3109 PyObject* exc_type = PyErr_Occurred();
3111 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
3112 else __PYX_ERR(0, 101, __pyx_L6_error)
3116 __Pyx_GOTREF(__pyx_t_4);
3118 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_4);
3128 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self), __pyx_v_idx, Py_True) < 0)) __PYX_ERR(0, 102, __pyx_L6_error)
3138 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3148 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3149 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
3150 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3151 goto __pyx_L11_try_end;
3153 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3154 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3163 __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_IndexError);
3165 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3166 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_13) < 0) __PYX_ERR(0, 103, __pyx_L8_except_error)
3167 __Pyx_GOTREF(__pyx_t_5);
3168 __Pyx_GOTREF(__pyx_t_4);
3169 __Pyx_GOTREF(__pyx_t_13);
3178 __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)
3179 __Pyx_GOTREF(__pyx_t_14);
3180 __pyx_t_15 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 104, __pyx_L8_except_error)
3181 __Pyx_GOTREF(__pyx_t_15);
3182 __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)
3183 __Pyx_GOTREF(__pyx_t_16);
3184 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3185 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3186 __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)
3187 __Pyx_GOTREF(__pyx_t_15);
3188 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3189 __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)
3190 __Pyx_GOTREF(__pyx_t_16);
3191 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3192 __Pyx_Raise(__pyx_t_16, 0, 0, 0);
3193 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3194 __PYX_ERR(0, 104, __pyx_L8_except_error)
3204 __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
3206 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3207 if (__Pyx_GetException(&__pyx_t_13, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(0, 105, __pyx_L8_except_error)
3208 __Pyx_GOTREF(__pyx_t_13);
3209 __Pyx_GOTREF(__pyx_t_4);
3210 __Pyx_GOTREF(__pyx_t_5);
3219 __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)
3220 __Pyx_GOTREF(__pyx_t_16);
3221 __pyx_t_15 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 106, __pyx_L8_except_error)
3222 __Pyx_GOTREF(__pyx_t_15);
3223 __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)
3224 __Pyx_GOTREF(__pyx_t_14);
3225 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3226 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3227 __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)
3228 __Pyx_GOTREF(__pyx_t_15);
3229 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3230 __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)
3231 __Pyx_GOTREF(__pyx_t_14);
3232 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3233 __Pyx_Raise(__pyx_t_14, 0, 0, 0);
3234 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3235 __PYX_ERR(0, 106, __pyx_L8_except_error)
3237 goto __pyx_L8_except_error;
3238 __pyx_L8_except_error:;
3247 __Pyx_XGIVEREF(__pyx_t_8);
3248 __Pyx_XGIVEREF(__pyx_t_9);
3249 __Pyx_XGIVEREF(__pyx_t_10);
3250 __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
3251 goto __pyx_L1_error;
3272 __pyx_t_2 = PyUnicode_Check(__pyx_v_other);
3273 __pyx_t_1 = (__pyx_t_2 != 0);
3274 if (likely(__pyx_t_1)) {
3284 __Pyx_PyThreadState_declare
3285 __Pyx_PyThreadState_assign
3286 __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
3287 __Pyx_XGOTREF(__pyx_t_10);
3288 __Pyx_XGOTREF(__pyx_t_9);
3289 __Pyx_XGOTREF(__pyx_t_8);
3299 __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)
3300 __Pyx_GOTREF(__pyx_t_4);
3302 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
3303 __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_4);
3304 if (likely(__pyx_t_13)) {
3305 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
3306 __Pyx_INCREF(__pyx_t_13);
3307 __Pyx_INCREF(
function);
3308 __Pyx_DECREF_SET(__pyx_t_4,
function);
3311 __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);
3312 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
3313 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 109, __pyx_L18_error)
3314 __Pyx_GOTREF(__pyx_t_5);
3315 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3316 __pyx_v_bother = __pyx_t_5;
3326 __pyx_t_17 = __Pyx_PyObject_AsWritableString(__pyx_v_bother);
if (unlikely((!__pyx_t_17) && PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L18_error)
3328 __pyx_t_3 =
new IndexSet(((
char *)__pyx_t_17));
3330 __Pyx_CppExn2PyErr();
3331 __PYX_ERR(0, 110, __pyx_L18_error)
3333 __pyx_v_self->instance = __pyx_t_3;
3343 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3344 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
3345 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3346 goto __pyx_L23_try_end;
3348 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
3349 __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
3350 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
3351 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
3352 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3353 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3362 __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
3364 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3365 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_13) < 0) __PYX_ERR(0, 111, __pyx_L20_except_error)
3366 __Pyx_GOTREF(__pyx_t_5);
3367 __Pyx_GOTREF(__pyx_t_4);
3368 __Pyx_GOTREF(__pyx_t_13);
3377 __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)
3378 __Pyx_GOTREF(__pyx_t_14);
3379 __pyx_t_15 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 112, __pyx_L20_except_error)
3380 __Pyx_GOTREF(__pyx_t_15);
3381 __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)
3382 __Pyx_GOTREF(__pyx_t_16);
3383 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3384 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3385 __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)
3386 __Pyx_GOTREF(__pyx_t_15);
3387 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3388 __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)
3389 __Pyx_GOTREF(__pyx_t_16);
3390 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3391 __Pyx_Raise(__pyx_t_16, 0, 0, 0);
3392 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3393 __PYX_ERR(0, 112, __pyx_L20_except_error)
3395 goto __pyx_L20_except_error;
3396 __pyx_L20_except_error:;
3405 __Pyx_XGIVEREF(__pyx_t_10);
3406 __Pyx_XGIVEREF(__pyx_t_9);
3407 __Pyx_XGIVEREF(__pyx_t_8);
3408 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8);
3409 goto __pyx_L1_error;
3431 __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)
3432 __Pyx_GOTREF(__pyx_t_13);
3433 __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)
3434 __Pyx_GOTREF(__pyx_t_4);
3435 __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_t_13, __pyx_t_4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 114, __pyx_L1_error)
3436 __Pyx_GOTREF(__pyx_t_5);
3437 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
3438 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3439 __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_t_5, __pyx_kp_u_);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 114, __pyx_L1_error)
3440 __Pyx_GOTREF(__pyx_t_4);
3441 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3442 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 114, __pyx_L1_error)
3443 __Pyx_GOTREF(__pyx_t_5);
3444 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3445 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
3446 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3447 __PYX_ERR(0, 114, __pyx_L1_error)
3463 __Pyx_XDECREF(__pyx_t_4);
3464 __Pyx_XDECREF(__pyx_t_5);
3465 __Pyx_XDECREF(__pyx_t_13);
3466 __Pyx_XDECREF(__pyx_t_14);
3467 __Pyx_XDECREF(__pyx_t_15);
3468 __Pyx_XDECREF(__pyx_t_16);
3469 __Pyx_AddTraceback(
"PyClical.index_set.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3472 __Pyx_XDECREF(__pyx_v_error_msg_prefix);
3473 __Pyx_XDECREF(__pyx_v_idx);
3474 __Pyx_XDECREF(__pyx_v_bother);
3475 __Pyx_RefNannyFinishContext();
3488 static void __pyx_pw_8PyClical_9index_set_5__dealloc__(PyObject *__pyx_v_self);
3489 static void __pyx_pw_8PyClical_9index_set_5__dealloc__(PyObject *__pyx_v_self) {
3490 __Pyx_RefNannyDeclarations
3491 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
3492 __pyx_pf_8PyClical_9index_set_4__dealloc__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
3495 __Pyx_RefNannyFinishContext();
3498 static void __pyx_pf_8PyClical_9index_set_4__dealloc__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
3499 __Pyx_RefNannyDeclarations
3500 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
3509 delete __pyx_v_self->instance;
3520 __Pyx_RefNannyFinishContext();
3532 static PyObject *__pyx_pw_8PyClical_9index_set_7__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op);
3533 static PyObject *__pyx_pw_8PyClical_9index_set_7__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op) {
3534 PyObject *__pyx_r = 0;
3535 __Pyx_RefNannyDeclarations
3536 __Pyx_RefNannySetupContext(
"__richcmp__ (wrapper)", 0);
3537 __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));
3540 __Pyx_RefNannyFinishContext();
3544 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) {
3545 PyObject *__pyx_v_eq = NULL;
3546 PyObject *__pyx_v_lt = NULL;
3547 PyObject *__pyx_r = NULL;
3548 __Pyx_RefNannyDeclarations
3552 PyObject *__pyx_t_4 = NULL;
3553 __Pyx_RefNannySetupContext(
"__richcmp__", 0);
3562 __pyx_t_2 = (((PyObject *)__pyx_v_lhs) == Py_None);
3563 __pyx_t_3 = (__pyx_t_2 != 0);
3566 __pyx_t_1 = __pyx_t_3;
3567 goto __pyx_L4_bool_binop_done;
3569 __pyx_t_3 = (__pyx_v_rhs == Py_None);
3570 __pyx_t_2 = (__pyx_t_3 != 0);
3571 __pyx_t_1 = __pyx_t_2;
3572 __pyx_L4_bool_binop_done:;
3582 __pyx_t_1 = (((PyObject *)__pyx_v_lhs) == __pyx_v_rhs);
3583 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 144, __pyx_L1_error)
3584 __Pyx_GOTREF(__pyx_t_4);
3585 __pyx_v_eq = __pyx_t_4;
3595 switch (__pyx_v_op) {
3605 __Pyx_XDECREF(__pyx_r);
3606 __Pyx_INCREF(__pyx_v_eq);
3607 __pyx_r = __pyx_v_eq;
3627 __Pyx_XDECREF(__pyx_r);
3628 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_eq);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 148, __pyx_L1_error)
3629 __pyx_t_4 = __Pyx_PyBool_FromLong((!__pyx_t_1));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error)
3630 __Pyx_GOTREF(__pyx_t_4);
3631 __pyx_r = __pyx_t_4;
3652 switch (__pyx_v_op) {
3662 __Pyx_XDECREF(__pyx_r);
3663 __Pyx_INCREF(Py_False);
3684 __Pyx_XDECREF(__pyx_r);
3685 __Pyx_INCREF(__pyx_v_eq);
3686 __pyx_r = __pyx_v_eq;
3706 __Pyx_XDECREF(__pyx_r);
3707 __Pyx_INCREF(Py_False);
3728 __Pyx_XDECREF(__pyx_r);
3729 __Pyx_INCREF(__pyx_v_eq);
3730 __pyx_r = __pyx_v_eq;
3750 __Pyx_XDECREF(__pyx_r);
3751 __Pyx_INCREF(__pyx_builtin_NotImplemented);
3752 __pyx_r = __pyx_builtin_NotImplemented;
3776 __pyx_t_1 = (__pyx_f_8PyClical_toIndexSet(((PyObject *)__pyx_v_lhs)) == __pyx_f_8PyClical_toIndexSet(__pyx_v_rhs));
3777 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 161, __pyx_L1_error)
3778 __Pyx_GOTREF(__pyx_t_4);
3779 __pyx_v_eq = __pyx_t_4;
3789 switch (__pyx_v_op) {
3799 __Pyx_XDECREF(__pyx_r);
3800 __Pyx_INCREF(__pyx_v_eq);
3801 __pyx_r = __pyx_v_eq;
3821 __Pyx_XDECREF(__pyx_r);
3822 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_eq);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 165, __pyx_L1_error)
3823 __pyx_t_4 = __Pyx_PyBool_FromLong((!__pyx_t_1));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error)
3824 __Pyx_GOTREF(__pyx_t_4);
3825 __pyx_r = __pyx_t_4;
3846 __pyx_t_1 = (__pyx_f_8PyClical_toIndexSet(((PyObject *)__pyx_v_lhs)) < __pyx_f_8PyClical_toIndexSet(__pyx_v_rhs));
3847 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error)
3848 __Pyx_GOTREF(__pyx_t_4);
3849 __pyx_v_lt = __pyx_t_4;
3859 switch (__pyx_v_op) {
3869 __Pyx_XDECREF(__pyx_r);
3870 __Pyx_INCREF(__pyx_v_lt);
3871 __pyx_r = __pyx_v_lt;
3891 __Pyx_XDECREF(__pyx_r);
3892 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_lt);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 171, __pyx_L1_error)
3895 __Pyx_INCREF(__pyx_v_lt);
3896 __pyx_t_4 = __pyx_v_lt;
3897 goto __pyx_L6_bool_binop_done;
3899 __Pyx_INCREF(__pyx_v_eq);
3900 __pyx_t_4 = __pyx_v_eq;
3901 __pyx_L6_bool_binop_done:;
3902 __pyx_r = __pyx_t_4;
3923 __Pyx_XDECREF(__pyx_r);
3924 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_lt);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 173, __pyx_L1_error)
3927 __pyx_t_1 = __pyx_t_2;
3928 goto __pyx_L8_bool_binop_done;
3930 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_eq);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 173, __pyx_L1_error)
3931 __pyx_t_1 = __pyx_t_2;
3932 __pyx_L8_bool_binop_done:;
3933 __pyx_t_4 = __Pyx_PyBool_FromLong((!__pyx_t_1));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 173, __pyx_L1_error)
3934 __Pyx_GOTREF(__pyx_t_4);
3935 __pyx_r = __pyx_t_4;
3956 __Pyx_XDECREF(__pyx_r);
3957 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_lt);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 175, __pyx_L1_error)
3958 __pyx_t_4 = __Pyx_PyBool_FromLong((!__pyx_t_1));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 175, __pyx_L1_error)
3959 __Pyx_GOTREF(__pyx_t_4);
3960 __pyx_r = __pyx_t_4;
3981 __Pyx_XDECREF(__pyx_r);
3982 __Pyx_INCREF(__pyx_builtin_NotImplemented);
3983 __pyx_r = __pyx_builtin_NotImplemented;
4001 __Pyx_XDECREF(__pyx_t_4);
4002 __Pyx_AddTraceback(
"PyClical.index_set.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4005 __Pyx_XDECREF(__pyx_v_eq);
4006 __Pyx_XDECREF(__pyx_v_lt);
4007 __Pyx_XGIVEREF(__pyx_r);
4008 __Pyx_RefNannyFinishContext();
4021 static int __pyx_pw_8PyClical_9index_set_9__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx, PyObject *__pyx_v_val);
4022 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 ";
4023 #if CYTHON_COMPILING_IN_CPYTHON
4024 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_8__setitem__;
4026 static int __pyx_pw_8PyClical_9index_set_9__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx, PyObject *__pyx_v_val) {
4028 __Pyx_RefNannyDeclarations
4029 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
4030 __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));
4033 __Pyx_RefNannyFinishContext();
4037 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) {
4039 __Pyx_RefNannyDeclarations
4042 __Pyx_RefNannySetupContext(
"__setitem__", 0);
4051 __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)
4052 __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)
4054 __pyx_v_self->instance->set(__pyx_t_1, __pyx_t_2);
4056 __Pyx_CppExn2PyErr();
4057 __PYX_ERR(0, 188, __pyx_L1_error)
4080 __Pyx_AddTraceback(
"PyClical.index_set.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4083 __Pyx_RefNannyFinishContext();
4096 static PyObject *__pyx_pw_8PyClical_9index_set_11__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx);
4097 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 ";
4098 #if CYTHON_COMPILING_IN_CPYTHON
4099 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_10__getitem__;
4101 static PyObject *__pyx_pw_8PyClical_9index_set_11__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx) {
4102 PyObject *__pyx_r = 0;
4103 __Pyx_RefNannyDeclarations
4104 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
4105 __pyx_r = __pyx_pf_8PyClical_9index_set_10__getitem__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_idx));
4108 __Pyx_RefNannyFinishContext();
4112 static PyObject *__pyx_pf_8PyClical_9index_set_10__getitem__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_idx) {
4113 PyObject *__pyx_r = NULL;
4114 __Pyx_RefNannyDeclarations
4116 PyObject *__pyx_t_2 = NULL;
4117 __Pyx_RefNannySetupContext(
"__getitem__", 0);
4126 __Pyx_XDECREF(__pyx_r);
4127 __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)
4128 __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)
4129 __Pyx_GOTREF(__pyx_t_2);
4130 __pyx_r = __pyx_t_2;
4144 __Pyx_XDECREF(__pyx_t_2);
4145 __Pyx_AddTraceback(
"PyClical.index_set.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4148 __Pyx_XGIVEREF(__pyx_r);
4149 __Pyx_RefNannyFinishContext();
4162 static int __pyx_pw_8PyClical_9index_set_13__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx);
4163 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 ";
4164 #if CYTHON_COMPILING_IN_CPYTHON
4165 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_12__contains__;
4167 static int __pyx_pw_8PyClical_9index_set_13__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_idx) {
4169 __Pyx_RefNannyDeclarations
4170 __Pyx_RefNannySetupContext(
"__contains__ (wrapper)", 0);
4171 __pyx_r = __pyx_pf_8PyClical_9index_set_12__contains__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_idx));
4174 __Pyx_RefNannyFinishContext();
4178 static int __pyx_pf_8PyClical_9index_set_12__contains__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_idx) {
4180 __Pyx_RefNannyDeclarations
4182 __Pyx_RefNannySetupContext(
"__contains__", 0);
4191 __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)
4192 __pyx_r = __pyx_v_self->instance->operator[](__pyx_t_1);
4205 __Pyx_AddTraceback(
"PyClical.index_set.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4208 __Pyx_RefNannyFinishContext();
4211 static PyObject *__pyx_gb_8PyClical_9index_set_16generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value);
4222 static PyObject *__pyx_pw_8PyClical_9index_set_15__iter__(PyObject *__pyx_v_self);
4223 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 ";
4224 #if CYTHON_COMPILING_IN_CPYTHON
4225 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_14__iter__;
4227 static PyObject *__pyx_pw_8PyClical_9index_set_15__iter__(PyObject *__pyx_v_self) {
4228 PyObject *__pyx_r = 0;
4229 __Pyx_RefNannyDeclarations
4230 __Pyx_RefNannySetupContext(
"__iter__ (wrapper)", 0);
4231 __pyx_r = __pyx_pf_8PyClical_9index_set_14__iter__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
4234 __Pyx_RefNannyFinishContext();
4238 static PyObject *__pyx_pf_8PyClical_9index_set_14__iter__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
4239 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *__pyx_cur_scope;
4240 PyObject *__pyx_r = NULL;
4241 __Pyx_RefNannyDeclarations
4242 __Pyx_RefNannySetupContext(
"__iter__", 0);
4243 __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);
4244 if (unlikely(!__pyx_cur_scope)) {
4245 __pyx_cur_scope = ((
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)Py_None);
4246 __Pyx_INCREF(Py_None);
4247 __PYX_ERR(0, 229, __pyx_L1_error)
4249 __Pyx_GOTREF(__pyx_cur_scope);
4251 __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
4252 __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
4253 __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
4255 __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)
4256 __Pyx_DECREF(__pyx_cur_scope);
4257 __Pyx_RefNannyFinishContext();
4258 return (PyObject *) gen;
4263 __Pyx_AddTraceback(
"PyClical.index_set.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4265 __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
4266 __Pyx_XGIVEREF(__pyx_r);
4267 __Pyx_RefNannyFinishContext();
4271 static PyObject *__pyx_gb_8PyClical_9index_set_16generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value)
4273 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *__pyx_cur_scope = ((
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)__pyx_generator->closure);
4274 PyObject *__pyx_r = NULL;
4275 PyObject *__pyx_t_1 = NULL;
4276 PyObject *__pyx_t_2 = NULL;
4277 PyObject *__pyx_t_3 = NULL;
4278 PyObject *__pyx_t_4 = NULL;
4279 Py_ssize_t __pyx_t_5;
4280 PyObject *(*__pyx_t_6)(PyObject *);
4283 __Pyx_RefNannyDeclarations
4284 __Pyx_RefNannySetupContext(
"__iter__", 0);
4285 switch (__pyx_generator->resume_label) {
4286 case 0:
goto __pyx_L3_first_run;
4287 case 1:
goto __pyx_L7_resume_from_yield;
4289 __Pyx_RefNannyFinishContext();
4292 __pyx_L3_first_run:;
4293 if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 229, __pyx_L1_error)
4302 __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)
4303 __Pyx_GOTREF(__pyx_t_2);
4305 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
4306 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
4307 if (likely(__pyx_t_3)) {
4308 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
4309 __Pyx_INCREF(__pyx_t_3);
4310 __Pyx_INCREF(
function);
4311 __Pyx_DECREF_SET(__pyx_t_2,
function);
4314 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
4315 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4316 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error)
4317 __Pyx_GOTREF(__pyx_t_1);
4318 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4319 __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)
4320 __Pyx_GOTREF(__pyx_t_3);
4322 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4323 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
4324 if (likely(__pyx_t_4)) {
4325 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4326 __Pyx_INCREF(__pyx_t_4);
4327 __Pyx_INCREF(
function);
4328 __Pyx_DECREF_SET(__pyx_t_3,
function);
4331 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
4332 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4333 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error)
4334 __Pyx_GOTREF(__pyx_t_2);
4335 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4336 __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)
4337 __Pyx_GOTREF(__pyx_t_3);
4338 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4339 __pyx_t_2 = PyTuple_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error)
4340 __Pyx_GOTREF(__pyx_t_2);
4341 __Pyx_GIVEREF(__pyx_t_1);
4342 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
4343 __Pyx_GIVEREF(__pyx_t_3);
4344 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
4347 __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)
4348 __Pyx_GOTREF(__pyx_t_3);
4349 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4350 if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
4351 __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
4354 __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error)
4355 __Pyx_GOTREF(__pyx_t_2);
4356 __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext;
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 236, __pyx_L1_error)
4358 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4360 if (likely(!__pyx_t_6)) {
4361 if (likely(PyList_CheckExact(__pyx_t_2))) {
4362 if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2))
break;
4363 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4364 __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)
4366 __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)
4367 __Pyx_GOTREF(__pyx_t_3);
4370 if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2))
break;
4371 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4372 __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)
4374 __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)
4375 __Pyx_GOTREF(__pyx_t_3);
4379 __pyx_t_3 = __pyx_t_6(__pyx_t_2);
4380 if (unlikely(!__pyx_t_3)) {
4381 PyObject* exc_type = PyErr_Occurred();
4383 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
4384 else __PYX_ERR(0, 236, __pyx_L1_error)
4388 __Pyx_GOTREF(__pyx_t_3);
4390 __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_idx);
4391 __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_idx, __pyx_t_3);
4392 __Pyx_GIVEREF(__pyx_t_3);
4402 __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)
4403 __pyx_t_8 = (__pyx_t_7 != 0);
4413 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_idx);
4414 __pyx_r = __pyx_cur_scope->__pyx_v_idx;
4415 __Pyx_XGIVEREF(__pyx_t_2);
4416 __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
4417 __pyx_cur_scope->__pyx_t_1 = __pyx_t_5;
4418 __pyx_cur_scope->__pyx_t_2 = __pyx_t_6;
4419 __Pyx_XGIVEREF(__pyx_r);
4420 __Pyx_RefNannyFinishContext();
4421 __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
4423 __pyx_generator->resume_label = 1;
4425 __pyx_L7_resume_from_yield:;
4426 __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
4427 __pyx_cur_scope->__pyx_t_0 = 0;
4428 __Pyx_XGOTREF(__pyx_t_2);
4429 __pyx_t_5 = __pyx_cur_scope->__pyx_t_1;
4430 __pyx_t_6 = __pyx_cur_scope->__pyx_t_2;
4431 if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 238, __pyx_L1_error)
4450 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4451 CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
4462 PyErr_SetNone(PyExc_StopIteration);
4465 __Pyx_XDECREF(__pyx_t_1);
4466 __Pyx_XDECREF(__pyx_t_2);
4467 __Pyx_XDECREF(__pyx_t_3);
4468 __Pyx_XDECREF(__pyx_t_4);
4469 __Pyx_AddTraceback(
"__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4471 __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
4472 #if !CYTHON_USE_EXC_INFO_STACK
4473 __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
4475 __pyx_generator->resume_label = -1;
4476 __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
4477 __Pyx_RefNannyFinishContext();
4490 static PyObject *__pyx_pw_8PyClical_9index_set_18__invert__(PyObject *__pyx_v_self);
4491 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 ";
4492 #if CYTHON_COMPILING_IN_CPYTHON
4493 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_17__invert__;
4495 static PyObject *__pyx_pw_8PyClical_9index_set_18__invert__(PyObject *__pyx_v_self) {
4496 PyObject *__pyx_r = 0;
4497 __Pyx_RefNannyDeclarations
4498 __Pyx_RefNannySetupContext(
"__invert__ (wrapper)", 0);
4499 __pyx_r = __pyx_pf_8PyClical_9index_set_17__invert__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
4502 __Pyx_RefNannyFinishContext();
4506 static PyObject *__pyx_pf_8PyClical_9index_set_17__invert__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
4507 PyObject *__pyx_r = NULL;
4508 __Pyx_RefNannyDeclarations
4509 PyObject *__pyx_t_1 = NULL;
4510 PyObject *__pyx_t_2 = NULL;
4511 __Pyx_RefNannySetupContext(
"__invert__", 0);
4520 __Pyx_XDECREF(__pyx_r);
4521 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_index_set));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error)
4522 __Pyx_GOTREF(__pyx_t_1);
4523 __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)
4524 __Pyx_GOTREF(__pyx_t_2);
4525 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4526 __pyx_r = __pyx_t_2;
4540 __Pyx_XDECREF(__pyx_t_1);
4541 __Pyx_XDECREF(__pyx_t_2);
4542 __Pyx_AddTraceback(
"PyClical.index_set.__invert__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4545 __Pyx_XGIVEREF(__pyx_r);
4546 __Pyx_RefNannyFinishContext();
4559 static PyObject *__pyx_pw_8PyClical_9index_set_20__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
4560 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 ";
4561 #if CYTHON_COMPILING_IN_CPYTHON
4562 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_19__xor__;
4564 static PyObject *__pyx_pw_8PyClical_9index_set_20__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4565 PyObject *__pyx_r = 0;
4566 __Pyx_RefNannyDeclarations
4567 __Pyx_RefNannySetupContext(
"__xor__ (wrapper)", 0);
4568 __pyx_r = __pyx_pf_8PyClical_9index_set_19__xor__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
4571 __Pyx_RefNannyFinishContext();
4575 static PyObject *__pyx_pf_8PyClical_9index_set_19__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4576 PyObject *__pyx_r = NULL;
4577 __Pyx_RefNannyDeclarations
4578 PyObject *__pyx_t_1 = NULL;
4579 PyObject *__pyx_t_2 = NULL;
4580 __Pyx_RefNannySetupContext(
"__xor__", 0);
4589 __Pyx_XDECREF(__pyx_r);
4590 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_index_set));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 258, __pyx_L1_error)
4591 __Pyx_GOTREF(__pyx_t_1);
4592 __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)
4593 __Pyx_GOTREF(__pyx_t_2);
4594 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4595 __pyx_r = __pyx_t_2;
4609 __Pyx_XDECREF(__pyx_t_1);
4610 __Pyx_XDECREF(__pyx_t_2);
4611 __Pyx_AddTraceback(
"PyClical.index_set.__xor__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4614 __Pyx_XGIVEREF(__pyx_r);
4615 __Pyx_RefNannyFinishContext();
4628 static PyObject *__pyx_pw_8PyClical_9index_set_22__ixor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
4629 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 ";
4630 #if CYTHON_COMPILING_IN_CPYTHON
4631 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_21__ixor__;
4633 static PyObject *__pyx_pw_8PyClical_9index_set_22__ixor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
4634 PyObject *__pyx_r = 0;
4635 __Pyx_RefNannyDeclarations
4636 __Pyx_RefNannySetupContext(
"__ixor__ (wrapper)", 0);
4637 __pyx_r = __pyx_pf_8PyClical_9index_set_21__ixor__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
4640 __Pyx_RefNannyFinishContext();
4644 static PyObject *__pyx_pf_8PyClical_9index_set_21__ixor__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs) {
4645 PyObject *__pyx_r = NULL;
4646 __Pyx_RefNannyDeclarations
4647 PyObject *__pyx_t_1 = NULL;
4648 __Pyx_RefNannySetupContext(
"__ixor__", 0);
4657 __Pyx_XDECREF(__pyx_r);
4658 __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)
4659 __Pyx_GOTREF(__pyx_t_1);
4660 __pyx_r = __pyx_t_1;
4674 __Pyx_XDECREF(__pyx_t_1);
4675 __Pyx_AddTraceback(
"PyClical.index_set.__ixor__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4678 __Pyx_XGIVEREF(__pyx_r);
4679 __Pyx_RefNannyFinishContext();
4692 static PyObject *__pyx_pw_8PyClical_9index_set_24__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
4693 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 ";
4694 #if CYTHON_COMPILING_IN_CPYTHON
4695 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_23__and__;
4697 static PyObject *__pyx_pw_8PyClical_9index_set_24__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4698 PyObject *__pyx_r = 0;
4699 __Pyx_RefNannyDeclarations
4700 __Pyx_RefNannySetupContext(
"__and__ (wrapper)", 0);
4701 __pyx_r = __pyx_pf_8PyClical_9index_set_23__and__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
4704 __Pyx_RefNannyFinishContext();
4708 static PyObject *__pyx_pf_8PyClical_9index_set_23__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4709 PyObject *__pyx_r = NULL;
4710 __Pyx_RefNannyDeclarations
4711 PyObject *__pyx_t_1 = NULL;
4712 PyObject *__pyx_t_2 = NULL;
4713 __Pyx_RefNannySetupContext(
"__and__", 0);
4722 __Pyx_XDECREF(__pyx_r);
4723 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_index_set));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error)
4724 __Pyx_GOTREF(__pyx_t_1);
4725 __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)
4726 __Pyx_GOTREF(__pyx_t_2);
4727 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4728 __pyx_r = __pyx_t_2;
4742 __Pyx_XDECREF(__pyx_t_1);
4743 __Pyx_XDECREF(__pyx_t_2);
4744 __Pyx_AddTraceback(
"PyClical.index_set.__and__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4747 __Pyx_XGIVEREF(__pyx_r);
4748 __Pyx_RefNannyFinishContext();
4761 static PyObject *__pyx_pw_8PyClical_9index_set_26__iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
4762 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 ";
4763 #if CYTHON_COMPILING_IN_CPYTHON
4764 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_25__iand__;
4766 static PyObject *__pyx_pw_8PyClical_9index_set_26__iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
4767 PyObject *__pyx_r = 0;
4768 __Pyx_RefNannyDeclarations
4769 __Pyx_RefNannySetupContext(
"__iand__ (wrapper)", 0);
4770 __pyx_r = __pyx_pf_8PyClical_9index_set_25__iand__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
4773 __Pyx_RefNannyFinishContext();
4777 static PyObject *__pyx_pf_8PyClical_9index_set_25__iand__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs) {
4778 PyObject *__pyx_r = NULL;
4779 __Pyx_RefNannyDeclarations
4780 PyObject *__pyx_t_1 = NULL;
4781 __Pyx_RefNannySetupContext(
"__iand__", 0);
4790 __Pyx_XDECREF(__pyx_r);
4791 __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)
4792 __Pyx_GOTREF(__pyx_t_1);
4793 __pyx_r = __pyx_t_1;
4807 __Pyx_XDECREF(__pyx_t_1);
4808 __Pyx_AddTraceback(
"PyClical.index_set.__iand__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4811 __Pyx_XGIVEREF(__pyx_r);
4812 __Pyx_RefNannyFinishContext();
4825 static PyObject *__pyx_pw_8PyClical_9index_set_28__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
4826 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 ";
4827 #if CYTHON_COMPILING_IN_CPYTHON
4828 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_27__or__;
4830 static PyObject *__pyx_pw_8PyClical_9index_set_28__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4831 PyObject *__pyx_r = 0;
4832 __Pyx_RefNannyDeclarations
4833 __Pyx_RefNannySetupContext(
"__or__ (wrapper)", 0);
4834 __pyx_r = __pyx_pf_8PyClical_9index_set_27__or__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
4837 __Pyx_RefNannyFinishContext();
4841 static PyObject *__pyx_pf_8PyClical_9index_set_27__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
4842 PyObject *__pyx_r = NULL;
4843 __Pyx_RefNannyDeclarations
4844 PyObject *__pyx_t_1 = NULL;
4845 PyObject *__pyx_t_2 = NULL;
4846 __Pyx_RefNannySetupContext(
"__or__", 0);
4855 __Pyx_XDECREF(__pyx_r);
4856 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_index_set));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error)
4857 __Pyx_GOTREF(__pyx_t_1);
4858 __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)
4859 __Pyx_GOTREF(__pyx_t_2);
4860 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4861 __pyx_r = __pyx_t_2;
4875 __Pyx_XDECREF(__pyx_t_1);
4876 __Pyx_XDECREF(__pyx_t_2);
4877 __Pyx_AddTraceback(
"PyClical.index_set.__or__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4880 __Pyx_XGIVEREF(__pyx_r);
4881 __Pyx_RefNannyFinishContext();
4894 static PyObject *__pyx_pw_8PyClical_9index_set_30__ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
4895 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 ";
4896 #if CYTHON_COMPILING_IN_CPYTHON
4897 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_29__ior__;
4899 static PyObject *__pyx_pw_8PyClical_9index_set_30__ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
4900 PyObject *__pyx_r = 0;
4901 __Pyx_RefNannyDeclarations
4902 __Pyx_RefNannySetupContext(
"__ior__ (wrapper)", 0);
4903 __pyx_r = __pyx_pf_8PyClical_9index_set_29__ior__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
4906 __Pyx_RefNannyFinishContext();
4910 static PyObject *__pyx_pf_8PyClical_9index_set_29__ior__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs) {
4911 PyObject *__pyx_r = NULL;
4912 __Pyx_RefNannyDeclarations
4913 PyObject *__pyx_t_1 = NULL;
4914 __Pyx_RefNannySetupContext(
"__ior__", 0);
4923 __Pyx_XDECREF(__pyx_r);
4924 __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)
4925 __Pyx_GOTREF(__pyx_t_1);
4926 __pyx_r = __pyx_t_1;
4940 __Pyx_XDECREF(__pyx_t_1);
4941 __Pyx_AddTraceback(
"PyClical.index_set.__ior__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4944 __Pyx_XGIVEREF(__pyx_r);
4945 __Pyx_RefNannyFinishContext();
4958 static PyObject *__pyx_pw_8PyClical_9index_set_32count(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4959 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 ";
4960 static PyObject *__pyx_pw_8PyClical_9index_set_32count(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4961 PyObject *__pyx_r = 0;
4962 __Pyx_RefNannyDeclarations
4963 __Pyx_RefNannySetupContext(
"count (wrapper)", 0);
4964 __pyx_r = __pyx_pf_8PyClical_9index_set_31count(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
4967 __Pyx_RefNannyFinishContext();
4971 static PyObject *__pyx_pf_8PyClical_9index_set_31count(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
4972 PyObject *__pyx_r = NULL;
4973 __Pyx_RefNannyDeclarations
4974 PyObject *__pyx_t_1 = NULL;
4975 __Pyx_RefNannySetupContext(
"count", 0);
4984 __Pyx_XDECREF(__pyx_r);
4985 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->instance->count());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error)
4986 __Pyx_GOTREF(__pyx_t_1);
4987 __pyx_r = __pyx_t_1;
5001 __Pyx_XDECREF(__pyx_t_1);
5002 __Pyx_AddTraceback(
"PyClical.index_set.count", __pyx_clineno, __pyx_lineno, __pyx_filename);
5005 __Pyx_XGIVEREF(__pyx_r);
5006 __Pyx_RefNannyFinishContext();
5019 static PyObject *__pyx_pw_8PyClical_9index_set_34count_neg(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5020 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 ";
5021 static PyObject *__pyx_pw_8PyClical_9index_set_34count_neg(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5022 PyObject *__pyx_r = 0;
5023 __Pyx_RefNannyDeclarations
5024 __Pyx_RefNannySetupContext(
"count_neg (wrapper)", 0);
5025 __pyx_r = __pyx_pf_8PyClical_9index_set_33count_neg(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5028 __Pyx_RefNannyFinishContext();
5032 static PyObject *__pyx_pf_8PyClical_9index_set_33count_neg(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5033 PyObject *__pyx_r = NULL;
5034 __Pyx_RefNannyDeclarations
5035 PyObject *__pyx_t_1 = NULL;
5036 __Pyx_RefNannySetupContext(
"count_neg", 0);
5045 __Pyx_XDECREF(__pyx_r);
5046 __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)
5047 __Pyx_GOTREF(__pyx_t_1);
5048 __pyx_r = __pyx_t_1;
5062 __Pyx_XDECREF(__pyx_t_1);
5063 __Pyx_AddTraceback(
"PyClical.index_set.count_neg", __pyx_clineno, __pyx_lineno, __pyx_filename);
5066 __Pyx_XGIVEREF(__pyx_r);
5067 __Pyx_RefNannyFinishContext();
5080 static PyObject *__pyx_pw_8PyClical_9index_set_36count_pos(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5081 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 ";
5082 static PyObject *__pyx_pw_8PyClical_9index_set_36count_pos(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5083 PyObject *__pyx_r = 0;
5084 __Pyx_RefNannyDeclarations
5085 __Pyx_RefNannySetupContext(
"count_pos (wrapper)", 0);
5086 __pyx_r = __pyx_pf_8PyClical_9index_set_35count_pos(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5089 __Pyx_RefNannyFinishContext();
5093 static PyObject *__pyx_pf_8PyClical_9index_set_35count_pos(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5094 PyObject *__pyx_r = NULL;
5095 __Pyx_RefNannyDeclarations
5096 PyObject *__pyx_t_1 = NULL;
5097 __Pyx_RefNannySetupContext(
"count_pos", 0);
5106 __Pyx_XDECREF(__pyx_r);
5107 __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)
5108 __Pyx_GOTREF(__pyx_t_1);
5109 __pyx_r = __pyx_t_1;
5123 __Pyx_XDECREF(__pyx_t_1);
5124 __Pyx_AddTraceback(
"PyClical.index_set.count_pos", __pyx_clineno, __pyx_lineno, __pyx_filename);
5127 __Pyx_XGIVEREF(__pyx_r);
5128 __Pyx_RefNannyFinishContext();
5141 static PyObject *__pyx_pw_8PyClical_9index_set_38min(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5142 static char __pyx_doc_8PyClical_9index_set_37min[] =
"\n Minimum member.\n\n >>> index_set({-1,1,2}).min()\n -1\n ";
5143 static PyObject *__pyx_pw_8PyClical_9index_set_38min(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5144 PyObject *__pyx_r = 0;
5145 __Pyx_RefNannyDeclarations
5146 __Pyx_RefNannySetupContext(
"min (wrapper)", 0);
5147 __pyx_r = __pyx_pf_8PyClical_9index_set_37min(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5150 __Pyx_RefNannyFinishContext();
5154 static PyObject *__pyx_pf_8PyClical_9index_set_37min(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5155 PyObject *__pyx_r = NULL;
5156 __Pyx_RefNannyDeclarations
5157 PyObject *__pyx_t_1 = NULL;
5158 __Pyx_RefNannySetupContext(
"min", 0);
5167 __Pyx_XDECREF(__pyx_r);
5168 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->instance->min());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 349, __pyx_L1_error)
5169 __Pyx_GOTREF(__pyx_t_1);
5170 __pyx_r = __pyx_t_1;
5184 __Pyx_XDECREF(__pyx_t_1);
5185 __Pyx_AddTraceback(
"PyClical.index_set.min", __pyx_clineno, __pyx_lineno, __pyx_filename);
5188 __Pyx_XGIVEREF(__pyx_r);
5189 __Pyx_RefNannyFinishContext();
5202 static PyObject *__pyx_pw_8PyClical_9index_set_40max(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5203 static char __pyx_doc_8PyClical_9index_set_39max[] =
"\n Maximum member.\n\n >>> index_set({-1,1,2}).max()\n 2\n ";
5204 static PyObject *__pyx_pw_8PyClical_9index_set_40max(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5205 PyObject *__pyx_r = 0;
5206 __Pyx_RefNannyDeclarations
5207 __Pyx_RefNannySetupContext(
"max (wrapper)", 0);
5208 __pyx_r = __pyx_pf_8PyClical_9index_set_39max(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5211 __Pyx_RefNannyFinishContext();
5215 static PyObject *__pyx_pf_8PyClical_9index_set_39max(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5216 PyObject *__pyx_r = NULL;
5217 __Pyx_RefNannyDeclarations
5218 PyObject *__pyx_t_1 = NULL;
5219 __Pyx_RefNannySetupContext(
"max", 0);
5228 __Pyx_XDECREF(__pyx_r);
5229 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->instance->max());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 358, __pyx_L1_error)
5230 __Pyx_GOTREF(__pyx_t_1);
5231 __pyx_r = __pyx_t_1;
5245 __Pyx_XDECREF(__pyx_t_1);
5246 __Pyx_AddTraceback(
"PyClical.index_set.max", __pyx_clineno, __pyx_lineno, __pyx_filename);
5249 __Pyx_XGIVEREF(__pyx_r);
5250 __Pyx_RefNannyFinishContext();
5263 static PyObject *__pyx_pw_8PyClical_9index_set_42hash_fn(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5264 static char __pyx_doc_8PyClical_9index_set_41hash_fn[] =
"\n Hash function.\n ";
5265 static PyObject *__pyx_pw_8PyClical_9index_set_42hash_fn(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5266 PyObject *__pyx_r = 0;
5267 __Pyx_RefNannyDeclarations
5268 __Pyx_RefNannySetupContext(
"hash_fn (wrapper)", 0);
5269 __pyx_r = __pyx_pf_8PyClical_9index_set_41hash_fn(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5272 __Pyx_RefNannyFinishContext();
5276 static PyObject *__pyx_pf_8PyClical_9index_set_41hash_fn(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5277 PyObject *__pyx_r = NULL;
5278 __Pyx_RefNannyDeclarations
5279 PyObject *__pyx_t_1 = NULL;
5280 __Pyx_RefNannySetupContext(
"hash_fn", 0);
5289 __Pyx_XDECREF(__pyx_r);
5290 __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)
5291 __Pyx_GOTREF(__pyx_t_1);
5292 __pyx_r = __pyx_t_1;
5306 __Pyx_XDECREF(__pyx_t_1);
5307 __Pyx_AddTraceback(
"PyClical.index_set.hash_fn", __pyx_clineno, __pyx_lineno, __pyx_filename);
5310 __Pyx_XGIVEREF(__pyx_r);
5311 __Pyx_RefNannyFinishContext();
5324 static PyObject *__pyx_pw_8PyClical_9index_set_44sign_of_mult(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
5325 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 ";
5326 static PyObject *__pyx_pw_8PyClical_9index_set_44sign_of_mult(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
5327 PyObject *__pyx_r = 0;
5328 __Pyx_RefNannyDeclarations
5329 __Pyx_RefNannySetupContext(
"sign_of_mult (wrapper)", 0);
5330 __pyx_r = __pyx_pf_8PyClical_9index_set_43sign_of_mult(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
5333 __Pyx_RefNannyFinishContext();
5337 static PyObject *__pyx_pf_8PyClical_9index_set_43sign_of_mult(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self, PyObject *__pyx_v_rhs) {
5338 PyObject *__pyx_r = NULL;
5339 __Pyx_RefNannyDeclarations
5340 PyObject *__pyx_t_1 = NULL;
5341 __Pyx_RefNannySetupContext(
"sign_of_mult", 0);
5350 __Pyx_XDECREF(__pyx_r);
5351 __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)
5352 __Pyx_GOTREF(__pyx_t_1);
5353 __pyx_r = __pyx_t_1;
5367 __Pyx_XDECREF(__pyx_t_1);
5368 __Pyx_AddTraceback(
"PyClical.index_set.sign_of_mult", __pyx_clineno, __pyx_lineno, __pyx_filename);
5371 __Pyx_XGIVEREF(__pyx_r);
5372 __Pyx_RefNannyFinishContext();
5385 static PyObject *__pyx_pw_8PyClical_9index_set_46sign_of_square(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5386 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 ";
5387 static PyObject *__pyx_pw_8PyClical_9index_set_46sign_of_square(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5388 PyObject *__pyx_r = 0;
5389 __Pyx_RefNannyDeclarations
5390 __Pyx_RefNannySetupContext(
"sign_of_square (wrapper)", 0);
5391 __pyx_r = __pyx_pf_8PyClical_9index_set_45sign_of_square(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5394 __Pyx_RefNannyFinishContext();
5398 static PyObject *__pyx_pf_8PyClical_9index_set_45sign_of_square(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5399 PyObject *__pyx_r = NULL;
5400 __Pyx_RefNannyDeclarations
5401 PyObject *__pyx_t_1 = NULL;
5402 __Pyx_RefNannySetupContext(
"sign_of_square", 0);
5411 __Pyx_XDECREF(__pyx_r);
5412 __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)
5413 __Pyx_GOTREF(__pyx_t_1);
5414 __pyx_r = __pyx_t_1;
5428 __Pyx_XDECREF(__pyx_t_1);
5429 __Pyx_AddTraceback(
"PyClical.index_set.sign_of_square", __pyx_clineno, __pyx_lineno, __pyx_filename);
5432 __Pyx_XGIVEREF(__pyx_r);
5433 __Pyx_RefNannyFinishContext();
5446 static PyObject *__pyx_pw_8PyClical_9index_set_48__repr__(PyObject *__pyx_v_self);
5447 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 ";
5448 #if CYTHON_COMPILING_IN_CPYTHON
5449 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_47__repr__;
5451 static PyObject *__pyx_pw_8PyClical_9index_set_48__repr__(PyObject *__pyx_v_self) {
5452 PyObject *__pyx_r = 0;
5453 __Pyx_RefNannyDeclarations
5454 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
5455 __pyx_r = __pyx_pf_8PyClical_9index_set_47__repr__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5458 __Pyx_RefNannyFinishContext();
5462 static PyObject *__pyx_pf_8PyClical_9index_set_47__repr__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5463 PyObject *__pyx_r = NULL;
5464 __Pyx_RefNannyDeclarations
5465 PyObject *__pyx_t_1 = NULL;
5466 __Pyx_RefNannySetupContext(
"__repr__", 0);
5475 __Pyx_XDECREF(__pyx_r);
5476 __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)
5477 __Pyx_GOTREF(__pyx_t_1);
5478 __pyx_r = __pyx_t_1;
5492 __Pyx_XDECREF(__pyx_t_1);
5493 __Pyx_AddTraceback(
"PyClical.index_set.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5496 __Pyx_XGIVEREF(__pyx_r);
5497 __Pyx_RefNannyFinishContext();
5510 static PyObject *__pyx_pw_8PyClical_9index_set_50__str__(PyObject *__pyx_v_self);
5511 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 ";
5512 #if CYTHON_COMPILING_IN_CPYTHON
5513 struct wrapperbase __pyx_wrapperbase_8PyClical_9index_set_49__str__;
5515 static PyObject *__pyx_pw_8PyClical_9index_set_50__str__(PyObject *__pyx_v_self) {
5516 PyObject *__pyx_r = 0;
5517 __Pyx_RefNannyDeclarations
5518 __Pyx_RefNannySetupContext(
"__str__ (wrapper)", 0);
5519 __pyx_r = __pyx_pf_8PyClical_9index_set_49__str__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5522 __Pyx_RefNannyFinishContext();
5526 static PyObject *__pyx_pf_8PyClical_9index_set_49__str__(
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5527 PyObject *__pyx_r = NULL;
5528 __Pyx_RefNannyDeclarations
5529 PyObject *__pyx_t_1 = NULL;
5530 __Pyx_RefNannySetupContext(
"__str__", 0);
5539 __Pyx_XDECREF(__pyx_r);
5540 __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)
5541 __Pyx_GOTREF(__pyx_t_1);
5542 __pyx_r = __pyx_t_1;
5556 __Pyx_XDECREF(__pyx_t_1);
5557 __Pyx_AddTraceback(
"PyClical.index_set.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5560 __Pyx_XGIVEREF(__pyx_r);
5561 __Pyx_RefNannyFinishContext();
5572 static PyObject *__pyx_pw_8PyClical_9index_set_52__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5573 static PyObject *__pyx_pw_8PyClical_9index_set_52__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5574 PyObject *__pyx_r = 0;
5575 __Pyx_RefNannyDeclarations
5576 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
5577 __pyx_r = __pyx_pf_8PyClical_9index_set_51__reduce_cython__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self));
5580 __Pyx_RefNannyFinishContext();
5584 static PyObject *__pyx_pf_8PyClical_9index_set_51__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_index_set *__pyx_v_self) {
5585 PyObject *__pyx_r = NULL;
5586 __Pyx_RefNannyDeclarations
5587 PyObject *__pyx_t_1 = NULL;
5588 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
5596 __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)
5597 __Pyx_GOTREF(__pyx_t_1);
5598 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5599 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5600 __PYX_ERR(1, 2, __pyx_L1_error)
5610 __Pyx_XDECREF(__pyx_t_1);
5611 __Pyx_AddTraceback(
"PyClical.index_set.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5613 __Pyx_XGIVEREF(__pyx_r);
5614 __Pyx_RefNannyFinishContext();
5626 static PyObject *__pyx_pw_8PyClical_9index_set_54__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
5627 static PyObject *__pyx_pw_8PyClical_9index_set_54__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
5628 PyObject *__pyx_r = 0;
5629 __Pyx_RefNannyDeclarations
5630 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
5631 __pyx_r = __pyx_pf_8PyClical_9index_set_53__setstate_cython__(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
5634 __Pyx_RefNannyFinishContext();
5638 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) {
5639 PyObject *__pyx_r = NULL;
5640 __Pyx_RefNannyDeclarations
5641 PyObject *__pyx_t_1 = NULL;
5642 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
5649 __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)
5650 __Pyx_GOTREF(__pyx_t_1);
5651 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5652 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5653 __PYX_ERR(1, 4, __pyx_L1_error)
5664 __Pyx_XDECREF(__pyx_t_1);
5665 __Pyx_AddTraceback(
"PyClical.index_set.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5667 __Pyx_XGIVEREF(__pyx_r);
5668 __Pyx_RefNannyFinishContext();
5681 static PyObject *__pyx_pw_8PyClical_1index_set_hidden_doctests(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused);
5682 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 ";
5683 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};
5684 static PyObject *__pyx_pw_8PyClical_1index_set_hidden_doctests(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
5685 PyObject *__pyx_r = 0;
5686 __Pyx_RefNannyDeclarations
5687 __Pyx_RefNannySetupContext(
"index_set_hidden_doctests (wrapper)", 0);
5688 __pyx_r = __pyx_pf_8PyClical_index_set_hidden_doctests(__pyx_self);
5691 __Pyx_RefNannyFinishContext();
5695 static PyObject *__pyx_pf_8PyClical_index_set_hidden_doctests(CYTHON_UNUSED PyObject *__pyx_self) {
5696 PyObject *__pyx_r = NULL;
5697 __Pyx_RefNannyDeclarations
5698 __Pyx_RefNannySetupContext(
"index_set_hidden_doctests", 0);
5707 __Pyx_XDECREF(__pyx_r);
5708 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5721 __Pyx_XGIVEREF(__pyx_r);
5722 __Pyx_RefNannyFinishContext();
5734 static PyObject *__pyx_pw_8PyClical_3compare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5735 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_compare(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs, CYTHON_UNUSED
int __pyx_skip_dispatch) {
5736 PyObject *__pyx_r = NULL;
5737 __Pyx_RefNannyDeclarations
5738 PyObject *__pyx_t_1 = NULL;
5739 __Pyx_RefNannySetupContext(
"compare", 0);
5748 __Pyx_XDECREF(__pyx_r);
5749 __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)
5750 __Pyx_GOTREF(__pyx_t_1);
5751 __pyx_r = __pyx_t_1;
5765 __Pyx_XDECREF(__pyx_t_1);
5766 __Pyx_AddTraceback(
"PyClical.compare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5769 __Pyx_XGIVEREF(__pyx_r);
5770 __Pyx_RefNannyFinishContext();
5775 static PyObject *__pyx_pw_8PyClical_3compare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5776 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 ";
5777 static PyObject *__pyx_pw_8PyClical_3compare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5778 PyObject *__pyx_v_lhs = 0;
5779 PyObject *__pyx_v_rhs = 0;
5780 PyObject *__pyx_r = 0;
5781 __Pyx_RefNannyDeclarations
5782 __Pyx_RefNannySetupContext(
"compare (wrapper)", 0);
5784 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lhs,&__pyx_n_s_rhs,0};
5785 PyObject* values[2] = {0,0};
5786 if (unlikely(__pyx_kwds)) {
5788 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5790 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5792 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5795 default:
goto __pyx_L5_argtuple_error;
5797 kw_args = PyDict_Size(__pyx_kwds);
5800 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lhs)) != 0)) kw_args--;
5801 else goto __pyx_L5_argtuple_error;
5804 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rhs)) != 0)) kw_args--;
5806 __Pyx_RaiseArgtupleInvalid(
"compare", 1, 2, 2, 1); __PYX_ERR(0, 492, __pyx_L3_error)
5809 if (unlikely(kw_args > 0)) {
5810 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"compare") < 0)) __PYX_ERR(0, 492, __pyx_L3_error)
5812 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5813 goto __pyx_L5_argtuple_error;
5815 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5816 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5818 __pyx_v_lhs = values[0];
5819 __pyx_v_rhs = values[1];
5821 goto __pyx_L4_argument_unpacking_done;
5822 __pyx_L5_argtuple_error:;
5823 __Pyx_RaiseArgtupleInvalid(
"compare", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 492, __pyx_L3_error)
5825 __Pyx_AddTraceback(
"PyClical.compare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5826 __Pyx_RefNannyFinishContext();
5828 __pyx_L4_argument_unpacking_done:;
5829 __pyx_r = __pyx_pf_8PyClical_2compare(__pyx_self, __pyx_v_lhs, __pyx_v_rhs);
5832 __Pyx_RefNannyFinishContext();
5836 static PyObject *__pyx_pf_8PyClical_2compare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
5837 PyObject *__pyx_r = NULL;
5838 __Pyx_RefNannyDeclarations
5839 PyObject *__pyx_t_1 = NULL;
5840 __Pyx_RefNannySetupContext(
"compare", 0);
5841 __Pyx_XDECREF(__pyx_r);
5842 __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)
5843 __Pyx_GOTREF(__pyx_t_1);
5844 __pyx_r = __pyx_t_1;
5850 __Pyx_XDECREF(__pyx_t_1);
5851 __Pyx_AddTraceback(
"PyClical.compare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5854 __Pyx_XGIVEREF(__pyx_r);
5855 __Pyx_RefNannyFinishContext();
5867 static PyObject *__pyx_pw_8PyClical_5min_neg(PyObject *__pyx_self, PyObject *__pyx_v_obj);
5868 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_min_neg(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
5869 PyObject *__pyx_r = NULL;
5870 __Pyx_RefNannyDeclarations
5871 PyObject *__pyx_t_1 = NULL;
5872 __Pyx_RefNannySetupContext(
"min_neg", 0);
5881 __Pyx_XDECREF(__pyx_r);
5882 __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)
5883 __Pyx_GOTREF(__pyx_t_1);
5884 __pyx_r = __pyx_t_1;
5898 __Pyx_XDECREF(__pyx_t_1);
5899 __Pyx_AddTraceback(
"PyClical.min_neg", __pyx_clineno, __pyx_lineno, __pyx_filename);
5902 __Pyx_XGIVEREF(__pyx_r);
5903 __Pyx_RefNannyFinishContext();
5908 static PyObject *__pyx_pw_8PyClical_5min_neg(PyObject *__pyx_self, PyObject *__pyx_v_obj);
5909 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 ";
5910 static PyObject *__pyx_pw_8PyClical_5min_neg(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
5911 PyObject *__pyx_r = 0;
5912 __Pyx_RefNannyDeclarations
5913 __Pyx_RefNannySetupContext(
"min_neg (wrapper)", 0);
5914 __pyx_r = __pyx_pf_8PyClical_4min_neg(__pyx_self, ((PyObject *)__pyx_v_obj));
5917 __Pyx_RefNannyFinishContext();
5921 static PyObject *__pyx_pf_8PyClical_4min_neg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
5922 PyObject *__pyx_r = NULL;
5923 __Pyx_RefNannyDeclarations
5924 PyObject *__pyx_t_1 = NULL;
5925 __Pyx_RefNannySetupContext(
"min_neg", 0);
5926 __Pyx_XDECREF(__pyx_r);
5927 __pyx_t_1 = __pyx_f_8PyClical_min_neg(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error)
5928 __Pyx_GOTREF(__pyx_t_1);
5929 __pyx_r = __pyx_t_1;
5935 __Pyx_XDECREF(__pyx_t_1);
5936 __Pyx_AddTraceback(
"PyClical.min_neg", __pyx_clineno, __pyx_lineno, __pyx_filename);
5939 __Pyx_XGIVEREF(__pyx_r);
5940 __Pyx_RefNannyFinishContext();
5952 static PyObject *__pyx_pw_8PyClical_7max_pos(PyObject *__pyx_self, PyObject *__pyx_v_obj);
5953 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_max_pos(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
5954 PyObject *__pyx_r = NULL;
5955 __Pyx_RefNannyDeclarations
5956 PyObject *__pyx_t_1 = NULL;
5957 __Pyx_RefNannySetupContext(
"max_pos", 0);
5966 __Pyx_XDECREF(__pyx_r);
5967 __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)
5968 __Pyx_GOTREF(__pyx_t_1);
5969 __pyx_r = __pyx_t_1;
5983 __Pyx_XDECREF(__pyx_t_1);
5984 __Pyx_AddTraceback(
"PyClical.max_pos", __pyx_clineno, __pyx_lineno, __pyx_filename);
5987 __Pyx_XGIVEREF(__pyx_r);
5988 __Pyx_RefNannyFinishContext();
5993 static PyObject *__pyx_pw_8PyClical_7max_pos(PyObject *__pyx_self, PyObject *__pyx_v_obj);
5994 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 ";
5995 static PyObject *__pyx_pw_8PyClical_7max_pos(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
5996 PyObject *__pyx_r = 0;
5997 __Pyx_RefNannyDeclarations
5998 __Pyx_RefNannySetupContext(
"max_pos (wrapper)", 0);
5999 __pyx_r = __pyx_pf_8PyClical_6max_pos(__pyx_self, ((PyObject *)__pyx_v_obj));
6002 __Pyx_RefNannyFinishContext();
6006 static PyObject *__pyx_pf_8PyClical_6max_pos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
6007 PyObject *__pyx_r = NULL;
6008 __Pyx_RefNannyDeclarations
6009 PyObject *__pyx_t_1 = NULL;
6010 __Pyx_RefNannySetupContext(
"max_pos", 0);
6011 __Pyx_XDECREF(__pyx_r);
6012 __pyx_t_1 = __pyx_f_8PyClical_max_pos(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 513, __pyx_L1_error)
6013 __Pyx_GOTREF(__pyx_t_1);
6014 __pyx_r = __pyx_t_1;
6020 __Pyx_XDECREF(__pyx_t_1);
6021 __Pyx_AddTraceback(
"PyClical.max_pos", __pyx_clineno, __pyx_lineno, __pyx_filename);
6024 __Pyx_XGIVEREF(__pyx_r);
6025 __Pyx_RefNannyFinishContext();
6037 static CYTHON_INLINE std::vector<scalar_t> __pyx_f_8PyClical_list_to_vector(PyObject *__pyx_v_lst) {
6038 std::vector<scalar_t> __pyx_v_v;
6039 PyObject *__pyx_v_s = NULL;
6040 std::vector<scalar_t> __pyx_r;
6041 __Pyx_RefNannyDeclarations
6042 PyObject *__pyx_t_1 = NULL;
6043 Py_ssize_t __pyx_t_2;
6044 PyObject *(*__pyx_t_3)(PyObject *);
6045 PyObject *__pyx_t_4 = NULL;
6047 __Pyx_RefNannySetupContext(
"list_to_vector", 0);
6056 if (likely(PyList_CheckExact(__pyx_v_lst)) || PyTuple_CheckExact(__pyx_v_lst)) {
6057 __pyx_t_1 = __pyx_v_lst; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
6060 __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_lst);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error)
6061 __Pyx_GOTREF(__pyx_t_1);
6062 __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 527, __pyx_L1_error)
6065 if (likely(!__pyx_t_3)) {
6066 if (likely(PyList_CheckExact(__pyx_t_1))) {
6067 if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1))
break;
6068 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6069 __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)
6071 __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)
6072 __Pyx_GOTREF(__pyx_t_4);
6075 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1))
break;
6076 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6077 __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)
6079 __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)
6080 __Pyx_GOTREF(__pyx_t_4);
6084 __pyx_t_4 = __pyx_t_3(__pyx_t_1);
6085 if (unlikely(!__pyx_t_4)) {
6086 PyObject* exc_type = PyErr_Occurred();
6088 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
6089 else __PYX_ERR(0, 527, __pyx_L1_error)
6093 __Pyx_GOTREF(__pyx_t_4);
6095 __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_4);
6105 __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)
6107 __pyx_v_v.push_back(((
scalar_t)__pyx_t_5));
6109 __Pyx_CppExn2PyErr();
6110 __PYX_ERR(0, 528, __pyx_L1_error)
6121 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6130 __pyx_r = __pyx_v_v;
6143 __Pyx_XDECREF(__pyx_t_1);
6144 __Pyx_XDECREF(__pyx_t_4);
6145 __Pyx_WriteUnraisable(
"PyClical.list_to_vector", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6146 __Pyx_pretend_to_initialize(&__pyx_r);
6148 __Pyx_XDECREF(__pyx_v_s);
6149 __Pyx_RefNannyFinishContext();
6161 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_toClifford(PyObject *__pyx_v_obj) {
6163 __Pyx_RefNannyDeclarations
6164 PyObject *__pyx_t_1 = NULL;
6165 __Pyx_RefNannySetupContext(
"toClifford", 0);
6174 __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)
6175 __Pyx_GOTREF(__pyx_t_1);
6176 __pyx_r = (((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_1)->instance[0]);
6177 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6190 __Pyx_XDECREF(__pyx_t_1);
6191 __Pyx_WriteUnraisable(
"PyClical.toClifford", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6192 __Pyx_pretend_to_initialize(&__pyx_r);
6194 __Pyx_RefNannyFinishContext();
6206 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_8clifford_wrap(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self,
Clifford __pyx_v_other) {
6207 PyObject *__pyx_r = NULL;
6208 __Pyx_RefNannyDeclarations
6209 __Pyx_RefNannySetupContext(
"wrap", 0);
6218 (__pyx_v_self->instance[0]) = __pyx_v_other;
6227 __Pyx_XDECREF(__pyx_r);
6228 __Pyx_INCREF(((PyObject *)__pyx_v_self));
6229 __pyx_r = ((PyObject *)__pyx_v_self);
6242 __Pyx_XGIVEREF(__pyx_r);
6243 __Pyx_RefNannyFinishContext();
6255 static CYTHON_INLINE
Clifford __pyx_f_8PyClical_8clifford_unwrap(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
6257 __Pyx_RefNannyDeclarations
6258 __Pyx_RefNannySetupContext(
"unwrap", 0);
6267 __pyx_r = (__pyx_v_self->instance[0]);
6280 __Pyx_RefNannyFinishContext();
6292 static PyObject *__pyx_pw_8PyClical_8clifford_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
6293 static PyObject *__pyx_f_8PyClical_8clifford_copy(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self,
int __pyx_skip_dispatch) {
6294 PyObject *__pyx_r = NULL;
6295 __Pyx_RefNannyDeclarations
6296 PyObject *__pyx_t_1 = NULL;
6297 PyObject *__pyx_t_2 = NULL;
6298 PyObject *__pyx_t_3 = NULL;
6299 PyObject *__pyx_t_4 = NULL;
6300 __Pyx_RefNannySetupContext(
"copy", 0);
6302 if (unlikely(__pyx_skip_dispatch)) ;
6304 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)))) {
6305 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
6306 static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
6307 if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
6308 PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
6310 __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)
6311 __Pyx_GOTREF(__pyx_t_1);
6312 if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(
void*)__pyx_pw_8PyClical_8clifford_1copy)) {
6313 __Pyx_XDECREF(__pyx_r);
6314 __Pyx_INCREF(__pyx_t_1);
6315 __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
6316 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
6317 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
6318 if (likely(__pyx_t_4)) {
6319 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
6320 __Pyx_INCREF(__pyx_t_4);
6321 __Pyx_INCREF(
function);
6322 __Pyx_DECREF_SET(__pyx_t_3,
function);
6325 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
6326 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6327 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 556, __pyx_L1_error)
6328 __Pyx_GOTREF(__pyx_t_2);
6329 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6330 __pyx_r = __pyx_t_2;
6332 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6335 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
6336 __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
6337 __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
6338 if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
6339 __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
6342 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6343 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
6355 __Pyx_XDECREF(__pyx_r);
6356 __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)
6357 __Pyx_GOTREF(__pyx_t_1);
6358 __pyx_r = __pyx_t_1;
6372 __Pyx_XDECREF(__pyx_t_1);
6373 __Pyx_XDECREF(__pyx_t_2);
6374 __Pyx_XDECREF(__pyx_t_3);
6375 __Pyx_XDECREF(__pyx_t_4);
6376 __Pyx_AddTraceback(
"PyClical.clifford.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
6379 __Pyx_XGIVEREF(__pyx_r);
6380 __Pyx_RefNannyFinishContext();
6385 static PyObject *__pyx_pw_8PyClical_8clifford_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
6386 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 ";
6387 static PyObject *__pyx_pw_8PyClical_8clifford_1copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
6388 PyObject *__pyx_r = 0;
6389 __Pyx_RefNannyDeclarations
6390 __Pyx_RefNannySetupContext(
"copy (wrapper)", 0);
6391 __pyx_r = __pyx_pf_8PyClical_8clifford_copy(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
6394 __Pyx_RefNannyFinishContext();
6398 static PyObject *__pyx_pf_8PyClical_8clifford_copy(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
6399 PyObject *__pyx_r = NULL;
6400 __Pyx_RefNannyDeclarations
6401 PyObject *__pyx_t_1 = NULL;
6402 __Pyx_RefNannySetupContext(
"copy", 0);
6403 __Pyx_XDECREF(__pyx_r);
6404 __pyx_t_1 = __pyx_f_8PyClical_8clifford_copy(__pyx_v_self, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 556, __pyx_L1_error)
6405 __Pyx_GOTREF(__pyx_t_1);
6406 __pyx_r = __pyx_t_1;
6412 __Pyx_XDECREF(__pyx_t_1);
6413 __Pyx_AddTraceback(
"PyClical.clifford.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
6416 __Pyx_XGIVEREF(__pyx_r);
6417 __Pyx_RefNannyFinishContext();
6430 static int __pyx_pw_8PyClical_8clifford_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6431 static int __pyx_pw_8PyClical_8clifford_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6432 PyObject *__pyx_v_other = 0;
6433 PyObject *__pyx_v_ixt = 0;
6435 __Pyx_RefNannyDeclarations
6436 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
6438 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_ixt,0};
6439 PyObject* values[2] = {0,0};
6440 values[0] = ((PyObject *)__pyx_int_0);
6441 values[1] = ((PyObject *)Py_None);
6442 if (unlikely(__pyx_kwds)) {
6444 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6446 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6448 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6451 default:
goto __pyx_L5_argtuple_error;
6453 kw_args = PyDict_Size(__pyx_kwds);
6457 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other);
6458 if (value) { values[0] = value; kw_args--; }
6463 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ixt);
6464 if (value) { values[1] = value; kw_args--; }
6467 if (unlikely(kw_args > 0)) {
6468 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(0, 565, __pyx_L3_error)
6471 switch (PyTuple_GET_SIZE(__pyx_args)) {
6472 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6474 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6477 default:
goto __pyx_L5_argtuple_error;
6480 __pyx_v_other = values[0];
6481 __pyx_v_ixt = values[1];
6483 goto __pyx_L4_argument_unpacking_done;
6484 __pyx_L5_argtuple_error:;
6485 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 565, __pyx_L3_error)
6487 __Pyx_AddTraceback(
"PyClical.clifford.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6488 __Pyx_RefNannyFinishContext();
6490 __pyx_L4_argument_unpacking_done:;
6491 __pyx_r = __pyx_pf_8PyClical_8clifford_2__cinit__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), __pyx_v_other, __pyx_v_ixt);
6494 __Pyx_RefNannyFinishContext();
6498 static int __pyx_pf_8PyClical_8clifford_2__cinit__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_ixt) {
6499 PyObject *__pyx_v_error_msg_prefix = NULL;
6500 PyObject *__pyx_v_bother = NULL;
6501 PyObject *__pyx_v_err = NULL;
6503 __Pyx_RefNannyDeclarations
6506 PyObject *__pyx_t_3 = NULL;
6507 PyObject *__pyx_t_4 = NULL;
6508 PyObject *__pyx_t_5 = NULL;
6510 PyObject *__pyx_t_7 = NULL;
6511 PyObject *__pyx_t_8 = NULL;
6513 PyObject *__pyx_t_10 = NULL;
6514 PyObject *__pyx_t_11 = NULL;
6515 PyObject *__pyx_t_12 = NULL;
6516 PyObject *__pyx_t_13 = NULL;
6519 PyObject *__pyx_t_16 = NULL;
6520 PyObject *__pyx_t_17 = NULL;
6521 PyObject *__pyx_t_18 = NULL;
6523 char const *__pyx_t_20;
6524 PyObject *__pyx_t_21 = NULL;
6525 PyObject *__pyx_t_22 = NULL;
6526 PyObject *__pyx_t_23 = NULL;
6527 __Pyx_RefNannySetupContext(
"__cinit__", 0);
6536 __Pyx_INCREF(__pyx_kp_u_Cannot_initialize_clifford_objec);
6537 __pyx_v_error_msg_prefix = __pyx_kp_u_Cannot_initialize_clifford_objec;
6546 __pyx_t_1 = (__pyx_v_ixt == Py_None);
6547 __pyx_t_2 = (__pyx_t_1 != 0);
6558 __Pyx_PyThreadState_declare
6559 __Pyx_PyThreadState_assign
6560 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
6561 __Pyx_XGOTREF(__pyx_t_3);
6562 __Pyx_XGOTREF(__pyx_t_4);
6563 __Pyx_XGOTREF(__pyx_t_5);
6573 __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8PyClical_clifford);
6574 __pyx_t_1 = (__pyx_t_2 != 0);
6585 __pyx_t_6 =
new Clifford(__pyx_f_8PyClical_8clifford_unwrap(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_other)));
6587 __Pyx_CppExn2PyErr();
6588 __PYX_ERR(0, 592, __pyx_L4_error)
6590 __pyx_v_self->instance = __pyx_t_6;
6609 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8PyClical_index_set);
6610 __pyx_t_2 = (__pyx_t_1 != 0);
6621 __pyx_t_6 =
new Clifford(__pyx_f_8PyClical_9index_set_unwrap(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_other)), ((
scalar_t)1.0));
6623 __Pyx_CppExn2PyErr();
6624 __PYX_ERR(0, 594, __pyx_L4_error)
6626 __pyx_v_self->instance = __pyx_t_6;
6645 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_numbers);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 595, __pyx_L4_error)
6646 __Pyx_GOTREF(__pyx_t_7);
6647 __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)
6648 __Pyx_GOTREF(__pyx_t_8);
6649 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6650 __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)
6651 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6652 __pyx_t_1 = (__pyx_t_2 != 0);
6662 __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)
6666 __Pyx_CppExn2PyErr();
6667 __PYX_ERR(0, 596, __pyx_L4_error)
6669 __pyx_v_self->instance = __pyx_t_6;
6688 __pyx_t_1 = PyUnicode_Check(__pyx_v_other);
6689 __pyx_t_2 = (__pyx_t_1 != 0);
6690 if (likely(__pyx_t_2)) {
6700 __Pyx_PyThreadState_declare
6701 __Pyx_PyThreadState_assign
6702 __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
6703 __Pyx_XGOTREF(__pyx_t_10);
6704 __Pyx_XGOTREF(__pyx_t_11);
6705 __Pyx_XGOTREF(__pyx_t_12);
6715 __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)
6716 __Pyx_GOTREF(__pyx_t_7);
6718 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
6719 __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_7);
6720 if (likely(__pyx_t_13)) {
6721 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
6722 __Pyx_INCREF(__pyx_t_13);
6723 __Pyx_INCREF(
function);
6724 __Pyx_DECREF_SET(__pyx_t_7,
function);
6727 __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);
6728 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
6729 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 599, __pyx_L11_error)
6730 __Pyx_GOTREF(__pyx_t_8);
6731 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6732 __pyx_v_bother = __pyx_t_8;
6742 __pyx_t_14 = __Pyx_PyObject_AsWritableString(__pyx_v_bother);
if (unlikely((!__pyx_t_14) && PyErr_Occurred())) __PYX_ERR(0, 600, __pyx_L11_error)
6744 __pyx_t_6 =
new Clifford(((
char *)__pyx_t_14));
6746 __Pyx_CppExn2PyErr();
6747 __PYX_ERR(0, 600, __pyx_L11_error)
6749 __pyx_v_self->instance = __pyx_t_6;
6759 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
6760 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
6761 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
6762 goto __pyx_L16_try_end;
6764 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
6765 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6766 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
6775 __pyx_t_15 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
6777 __Pyx_AddTraceback(
"PyClical.clifford.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6778 if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_13) < 0) __PYX_ERR(0, 601, __pyx_L13_except_error)
6779 __Pyx_GOTREF(__pyx_t_8);
6780 __Pyx_GOTREF(__pyx_t_7);
6781 __Pyx_GOTREF(__pyx_t_13);
6790 __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)
6791 __Pyx_GOTREF(__pyx_t_16);
6792 __pyx_t_17 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 602, __pyx_L13_except_error)
6793 __Pyx_GOTREF(__pyx_t_17);
6794 __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)
6795 __Pyx_GOTREF(__pyx_t_18);
6796 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6797 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6798 __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)
6799 __Pyx_GOTREF(__pyx_t_17);
6800 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6801 __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)
6802 __Pyx_GOTREF(__pyx_t_18);
6803 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6804 __Pyx_Raise(__pyx_t_18, 0, 0, 0);
6805 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6806 __PYX_ERR(0, 602, __pyx_L13_except_error)
6808 goto __pyx_L13_except_error;
6809 __pyx_L13_except_error:;
6818 __Pyx_XGIVEREF(__pyx_t_10);
6819 __Pyx_XGIVEREF(__pyx_t_11);
6820 __Pyx_XGIVEREF(__pyx_t_12);
6821 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
6822 goto __pyx_L4_error;
6844 __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)
6845 __Pyx_GOTREF(__pyx_t_13);
6846 __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)
6847 __Pyx_GOTREF(__pyx_t_7);
6848 __pyx_t_8 = __Pyx_PyUnicode_Concat(__pyx_t_13, __pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 604, __pyx_L4_error)
6849 __Pyx_GOTREF(__pyx_t_8);
6850 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
6851 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6852 __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_t_8, __pyx_kp_u_);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 604, __pyx_L4_error)
6853 __Pyx_GOTREF(__pyx_t_7);
6854 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6855 __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 604, __pyx_L4_error)
6856 __Pyx_GOTREF(__pyx_t_8);
6857 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6858 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
6859 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6860 __PYX_ERR(0, 604, __pyx_L4_error)
6872 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6873 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6874 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
6875 goto __pyx_L9_try_end;
6877 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
6878 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
6879 __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
6880 __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
6881 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6882 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
6891 __pyx_t_15 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
6893 __Pyx_AddTraceback(
"PyClical.clifford.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6894 if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_13) < 0) __PYX_ERR(0, 605, __pyx_L6_except_error)
6895 __Pyx_GOTREF(__pyx_t_8);
6896 __Pyx_GOTREF(__pyx_t_7);
6897 __Pyx_GOTREF(__pyx_t_13);
6898 __Pyx_INCREF(__pyx_t_7);
6899 __pyx_v_err = __pyx_t_7;
6909 __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)
6910 __Pyx_GOTREF(__pyx_t_18);
6911 __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)
6912 __Pyx_GOTREF(__pyx_t_17);
6913 __pyx_t_16 = __Pyx_PyUnicode_Concat(__pyx_t_18, __pyx_t_17);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 606, __pyx_L24_error)
6914 __Pyx_GOTREF(__pyx_t_16);
6915 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6916 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6925 __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)
6926 __Pyx_GOTREF(__pyx_t_17);
6927 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6928 __pyx_t_16 = PyObject_Repr(__pyx_v_other);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 607, __pyx_L24_error)
6929 __Pyx_GOTREF(__pyx_t_16);
6930 __pyx_t_18 = __Pyx_PyUnicode_ConcatSafe(__pyx_t_17, __pyx_t_16);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 607, __pyx_L24_error)
6931 __Pyx_GOTREF(__pyx_t_18);
6932 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6933 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6934 __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)
6935 __Pyx_GOTREF(__pyx_t_16);
6936 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6945 __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)
6946 __Pyx_GOTREF(__pyx_t_18);
6947 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6948 __pyx_t_16 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_err);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 608, __pyx_L24_error)
6949 __Pyx_GOTREF(__pyx_t_16);
6950 __pyx_t_17 = __Pyx_PyUnicode_Concat(__pyx_t_18, __pyx_t_16);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 608, __pyx_L24_error)
6951 __Pyx_GOTREF(__pyx_t_17);
6952 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6953 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6962 __pyx_t_16 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_17);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 606, __pyx_L24_error)
6963 __Pyx_GOTREF(__pyx_t_16);
6964 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6965 __Pyx_Raise(__pyx_t_16, 0, 0, 0);
6966 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6967 __PYX_ERR(0, 606, __pyx_L24_error)
6980 __Pyx_PyThreadState_declare
6981 __Pyx_PyThreadState_assign
6982 __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0;
6983 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
6984 __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
6985 __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
6986 if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23);
6987 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);
6988 __Pyx_XGOTREF(__pyx_t_12);
6989 __Pyx_XGOTREF(__pyx_t_11);
6990 __Pyx_XGOTREF(__pyx_t_10);
6991 __Pyx_XGOTREF(__pyx_t_21);
6992 __Pyx_XGOTREF(__pyx_t_22);
6993 __Pyx_XGOTREF(__pyx_t_23);
6994 __pyx_t_15 = __pyx_lineno; __pyx_t_19 = __pyx_clineno; __pyx_t_20 = __pyx_filename;
6996 __Pyx_DECREF(__pyx_v_err);
6999 if (PY_MAJOR_VERSION >= 3) {
7000 __Pyx_XGIVEREF(__pyx_t_21);
7001 __Pyx_XGIVEREF(__pyx_t_22);
7002 __Pyx_XGIVEREF(__pyx_t_23);
7003 __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_23);
7005 __Pyx_XGIVEREF(__pyx_t_12);
7006 __Pyx_XGIVEREF(__pyx_t_11);
7007 __Pyx_XGIVEREF(__pyx_t_10);
7008 __Pyx_ErrRestore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
7009 __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0;
7010 __pyx_lineno = __pyx_t_15; __pyx_clineno = __pyx_t_19; __pyx_filename = __pyx_t_20;
7011 goto __pyx_L6_except_error;
7015 goto __pyx_L6_except_error;
7016 __pyx_L6_except_error:;
7025 __Pyx_XGIVEREF(__pyx_t_3);
7026 __Pyx_XGIVEREF(__pyx_t_4);
7027 __Pyx_XGIVEREF(__pyx_t_5);
7028 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
7029 goto __pyx_L1_error;
7050 __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_ixt, __pyx_ptype_8PyClical_index_set);
7051 __pyx_t_1 = (__pyx_t_2 != 0);
7052 if (likely(__pyx_t_1)) {
7061 __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_numbers);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 610, __pyx_L1_error)
7062 __Pyx_GOTREF(__pyx_t_13);
7063 __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)
7064 __Pyx_GOTREF(__pyx_t_7);
7065 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7066 __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)
7067 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7068 __pyx_t_2 = (__pyx_t_1 != 0);
7078 __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)
7080 __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));
7082 __Pyx_CppExn2PyErr();
7083 __PYX_ERR(0, 611, __pyx_L1_error)
7085 __pyx_v_self->instance = __pyx_t_6;
7104 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_collections);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 612, __pyx_L1_error)
7105 __Pyx_GOTREF(__pyx_t_7);
7106 __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)
7107 __Pyx_GOTREF(__pyx_t_13);
7108 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7109 __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)
7110 __Pyx_GOTREF(__pyx_t_7);
7111 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7112 __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)
7113 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7114 __pyx_t_1 = (__pyx_t_2 != 0);
7115 if (likely(__pyx_t_1)) {
7125 __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)));
7127 __Pyx_CppExn2PyErr();
7128 __PYX_ERR(0, 613, __pyx_L1_error)
7130 __pyx_v_self->instance = __pyx_t_6;
7150 __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)
7151 __Pyx_GOTREF(__pyx_t_7);
7152 __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)
7153 __Pyx_GOTREF(__pyx_t_13);
7154 __pyx_t_8 = __Pyx_PyUnicode_Concat(__pyx_t_7, __pyx_t_13);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 615, __pyx_L1_error)
7155 __Pyx_GOTREF(__pyx_t_8);
7156 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7157 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7166 __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)
7167 __Pyx_GOTREF(__pyx_t_13);
7168 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7169 __pyx_t_8 = PyObject_Repr(__pyx_v_ixt);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 616, __pyx_L1_error)
7170 __Pyx_GOTREF(__pyx_t_8);
7171 __pyx_t_7 = __Pyx_PyUnicode_ConcatSafe(__pyx_t_13, __pyx_t_8);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 616, __pyx_L1_error)
7172 __Pyx_GOTREF(__pyx_t_7);
7173 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7174 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7175 __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)
7176 __Pyx_GOTREF(__pyx_t_8);
7177 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7186 __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_8);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 615, __pyx_L1_error)
7187 __Pyx_GOTREF(__pyx_t_7);
7188 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7189 __Pyx_Raise(__pyx_t_7, 0, 0, 0);
7190 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7191 __PYX_ERR(0, 615, __pyx_L1_error)
7213 __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)
7214 __Pyx_GOTREF(__pyx_t_7);
7215 __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)
7216 __Pyx_GOTREF(__pyx_t_8);
7217 __pyx_t_13 = __Pyx_PyUnicode_Concat(__pyx_t_7, __pyx_t_8);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 618, __pyx_L1_error)
7218 __Pyx_GOTREF(__pyx_t_13);
7219 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7220 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7229 __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)
7230 __Pyx_GOTREF(__pyx_t_8);
7231 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7232 __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)
7233 __Pyx_GOTREF(__pyx_t_13);
7234 __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_t_8, __pyx_t_13);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 619, __pyx_L1_error)
7235 __Pyx_GOTREF(__pyx_t_7);
7236 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7237 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7238 __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)
7239 __Pyx_GOTREF(__pyx_t_13);
7240 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7249 __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_13);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 618, __pyx_L1_error)
7250 __Pyx_GOTREF(__pyx_t_7);
7251 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7252 __Pyx_Raise(__pyx_t_7, 0, 0, 0);
7253 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7254 __PYX_ERR(0, 618, __pyx_L1_error)
7270 __Pyx_XDECREF(__pyx_t_7);
7271 __Pyx_XDECREF(__pyx_t_8);
7272 __Pyx_XDECREF(__pyx_t_13);
7273 __Pyx_XDECREF(__pyx_t_16);
7274 __Pyx_XDECREF(__pyx_t_17);
7275 __Pyx_XDECREF(__pyx_t_18);
7276 __Pyx_AddTraceback(
"PyClical.clifford.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7279 __Pyx_XDECREF(__pyx_v_error_msg_prefix);
7280 __Pyx_XDECREF(__pyx_v_bother);
7281 __Pyx_XDECREF(__pyx_v_err);
7282 __Pyx_RefNannyFinishContext();
7295 static void __pyx_pw_8PyClical_8clifford_5__dealloc__(PyObject *__pyx_v_self);
7296 static void __pyx_pw_8PyClical_8clifford_5__dealloc__(PyObject *__pyx_v_self) {
7297 __Pyx_RefNannyDeclarations
7298 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
7299 __pyx_pf_8PyClical_8clifford_4__dealloc__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
7302 __Pyx_RefNannyFinishContext();
7305 static void __pyx_pf_8PyClical_8clifford_4__dealloc__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
7306 __Pyx_RefNannyDeclarations
7307 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
7316 delete __pyx_v_self->instance;
7327 __Pyx_RefNannyFinishContext();
7339 static int __pyx_pw_8PyClical_8clifford_7__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_x);
7340 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 ";
7341 #if CYTHON_COMPILING_IN_CPYTHON
7342 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_6__contains__;
7344 static int __pyx_pw_8PyClical_8clifford_7__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_x) {
7346 __Pyx_RefNannyDeclarations
7347 __Pyx_RefNannySetupContext(
"__contains__ (wrapper)", 0);
7348 __pyx_r = __pyx_pf_8PyClical_8clifford_6__contains__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_x));
7351 __Pyx_RefNannyFinishContext();
7355 static int __pyx_pf_8PyClical_8clifford_6__contains__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_x) {
7357 __Pyx_RefNannyDeclarations
7358 PyObject *__pyx_t_1 = NULL;
7359 __Pyx_RefNannySetupContext(
"__contains__", 0);
7368 __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)
7369 __Pyx_GOTREF(__pyx_t_1);
7370 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
7371 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7372 __PYX_ERR(0, 636, __pyx_L1_error)
7384 __Pyx_XDECREF(__pyx_t_1);
7385 __Pyx_AddTraceback(
"PyClical.clifford.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7387 __Pyx_RefNannyFinishContext();
7400 static PyObject *__pyx_pw_8PyClical_8clifford_9__iter__(PyObject *__pyx_v_self);
7401 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 ";
7402 #if CYTHON_COMPILING_IN_CPYTHON
7403 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_8__iter__;
7405 static PyObject *__pyx_pw_8PyClical_8clifford_9__iter__(PyObject *__pyx_v_self) {
7406 PyObject *__pyx_r = 0;
7407 __Pyx_RefNannyDeclarations
7408 __Pyx_RefNannySetupContext(
"__iter__ (wrapper)", 0);
7409 __pyx_r = __pyx_pf_8PyClical_8clifford_8__iter__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
7412 __Pyx_RefNannyFinishContext();
7416 static PyObject *__pyx_pf_8PyClical_8clifford_8__iter__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
7417 PyObject *__pyx_r = NULL;
7418 __Pyx_RefNannyDeclarations
7419 PyObject *__pyx_t_1 = NULL;
7420 __Pyx_RefNannySetupContext(
"__iter__", 0);
7429 __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)
7430 __Pyx_GOTREF(__pyx_t_1);
7431 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
7432 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7433 __PYX_ERR(0, 647, __pyx_L1_error)
7445 __Pyx_XDECREF(__pyx_t_1);
7446 __Pyx_AddTraceback(
"PyClical.clifford.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7448 __Pyx_XGIVEREF(__pyx_r);
7449 __Pyx_RefNannyFinishContext();
7462 static PyObject *__pyx_pw_8PyClical_8clifford_11reframe(PyObject *__pyx_v_self, PyObject *__pyx_v_ixt);
7463 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 ";
7464 static PyObject *__pyx_pw_8PyClical_8clifford_11reframe(PyObject *__pyx_v_self, PyObject *__pyx_v_ixt) {
7465 PyObject *__pyx_r = 0;
7466 __Pyx_RefNannyDeclarations
7467 __Pyx_RefNannySetupContext(
"reframe (wrapper)", 0);
7468 __pyx_r = __pyx_pf_8PyClical_8clifford_10reframe(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_ixt));
7471 __Pyx_RefNannyFinishContext();
7475 static PyObject *__pyx_pf_8PyClical_8clifford_10reframe(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_ixt) {
7476 PyObject *__pyx_v_error_msg_prefix = NULL;
7477 struct __pyx_obj_8PyClical_clifford *__pyx_v_result = NULL;
7478 PyObject *__pyx_v_err = NULL;
7479 PyObject *__pyx_r = NULL;
7480 __Pyx_RefNannyDeclarations
7483 PyObject *__pyx_t_3 = NULL;
7484 PyObject *__pyx_t_4 = NULL;
7485 PyObject *__pyx_t_5 = NULL;
7486 PyObject *__pyx_t_6 = NULL;
7489 PyObject *__pyx_t_9 = NULL;
7490 PyObject *__pyx_t_10 = NULL;
7491 PyObject *__pyx_t_11 = NULL;
7492 PyObject *__pyx_t_12 = NULL;
7493 PyObject *__pyx_t_13 = NULL;
7495 char const *__pyx_t_15;
7496 PyObject *__pyx_t_16 = NULL;
7497 PyObject *__pyx_t_17 = NULL;
7498 PyObject *__pyx_t_18 = NULL;
7499 PyObject *__pyx_t_19 = NULL;
7500 PyObject *__pyx_t_20 = NULL;
7501 PyObject *__pyx_t_21 = NULL;
7502 __Pyx_RefNannySetupContext(
"reframe", 0);
7511 __Pyx_INCREF(__pyx_kp_u_Cannot_reframe);
7512 __pyx_v_error_msg_prefix = __pyx_kp_u_Cannot_reframe;
7521 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_ixt, __pyx_ptype_8PyClical_index_set);
7522 __pyx_t_2 = (__pyx_t_1 != 0);
7523 if (likely(__pyx_t_2)) {
7533 __Pyx_PyThreadState_declare
7534 __Pyx_PyThreadState_assign
7535 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
7536 __Pyx_XGOTREF(__pyx_t_3);
7537 __Pyx_XGOTREF(__pyx_t_4);
7538 __Pyx_XGOTREF(__pyx_t_5);
7548 __pyx_t_6 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 662, __pyx_L4_error)
7549 __Pyx_GOTREF(__pyx_t_6);
7550 __pyx_v_result = ((
struct __pyx_obj_8PyClical_clifford *)__pyx_t_6);
7561 __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)));
7563 __Pyx_CppExn2PyErr();
7564 __PYX_ERR(0, 663, __pyx_L4_error)
7566 __pyx_v_result->instance = __pyx_t_7;
7576 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7577 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7578 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
7579 goto __pyx_L9_try_end;
7581 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
7590 __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
7592 __Pyx_AddTraceback(
"PyClical.clifford.reframe", __pyx_clineno, __pyx_lineno, __pyx_filename);
7593 if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 664, __pyx_L6_except_error)
7594 __Pyx_GOTREF(__pyx_t_6);
7595 __Pyx_GOTREF(__pyx_t_9);
7596 __Pyx_GOTREF(__pyx_t_10);
7597 __Pyx_INCREF(__pyx_t_9);
7598 __pyx_v_err = __pyx_t_9;
7608 __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)
7609 __Pyx_GOTREF(__pyx_t_11);
7610 __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)
7611 __Pyx_GOTREF(__pyx_t_12);
7612 __pyx_t_13 = __Pyx_PyUnicode_Concat(__pyx_t_11, __pyx_t_12);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 665, __pyx_L15_error)
7613 __Pyx_GOTREF(__pyx_t_13);
7614 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7615 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7616 __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)
7617 __Pyx_GOTREF(__pyx_t_12);
7618 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7627 __pyx_t_13 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_ixt);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 666, __pyx_L15_error)
7628 __Pyx_GOTREF(__pyx_t_13);
7629 __pyx_t_11 = __Pyx_PyUnicode_Concat(__pyx_t_12, __pyx_t_13);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 666, __pyx_L15_error)
7630 __Pyx_GOTREF(__pyx_t_11);
7631 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7632 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7633 __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)
7634 __Pyx_GOTREF(__pyx_t_13);
7635 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7644 __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)
7645 __Pyx_GOTREF(__pyx_t_11);
7646 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7647 __pyx_t_13 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_err);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 667, __pyx_L15_error)
7648 __Pyx_GOTREF(__pyx_t_13);
7649 __pyx_t_12 = __Pyx_PyUnicode_Concat(__pyx_t_11, __pyx_t_13);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 667, __pyx_L15_error)
7650 __Pyx_GOTREF(__pyx_t_12);
7651 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7652 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7661 __pyx_t_13 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_12);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 665, __pyx_L15_error)
7662 __Pyx_GOTREF(__pyx_t_13);
7663 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7664 __Pyx_Raise(__pyx_t_13, 0, 0, 0);
7665 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7666 __PYX_ERR(0, 665, __pyx_L15_error)
7679 __Pyx_PyThreadState_declare
7680 __Pyx_PyThreadState_assign
7681 __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
7682 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
7683 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
7684 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
7685 if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
7686 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);
7687 __Pyx_XGOTREF(__pyx_t_16);
7688 __Pyx_XGOTREF(__pyx_t_17);
7689 __Pyx_XGOTREF(__pyx_t_18);
7690 __Pyx_XGOTREF(__pyx_t_19);
7691 __Pyx_XGOTREF(__pyx_t_20);
7692 __Pyx_XGOTREF(__pyx_t_21);
7693 __pyx_t_8 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
7695 __Pyx_DECREF(__pyx_v_err);
7698 if (PY_MAJOR_VERSION >= 3) {
7699 __Pyx_XGIVEREF(__pyx_t_19);
7700 __Pyx_XGIVEREF(__pyx_t_20);
7701 __Pyx_XGIVEREF(__pyx_t_21);
7702 __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
7704 __Pyx_XGIVEREF(__pyx_t_16);
7705 __Pyx_XGIVEREF(__pyx_t_17);
7706 __Pyx_XGIVEREF(__pyx_t_18);
7707 __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
7708 __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
7709 __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
7710 goto __pyx_L6_except_error;
7714 goto __pyx_L6_except_error;
7715 __pyx_L6_except_error:;
7724 __Pyx_XGIVEREF(__pyx_t_3);
7725 __Pyx_XGIVEREF(__pyx_t_4);
7726 __Pyx_XGIVEREF(__pyx_t_5);
7727 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
7728 goto __pyx_L1_error;
7750 __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)
7751 __Pyx_GOTREF(__pyx_t_10);
7752 __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)
7753 __Pyx_GOTREF(__pyx_t_9);
7754 __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_t_10, __pyx_t_9);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 669, __pyx_L1_error)
7755 __Pyx_GOTREF(__pyx_t_6);
7756 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7757 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7758 __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)
7759 __Pyx_GOTREF(__pyx_t_9);
7760 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7761 __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_9);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 669, __pyx_L1_error)
7762 __Pyx_GOTREF(__pyx_t_6);
7763 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7764 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
7765 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7766 __PYX_ERR(0, 669, __pyx_L1_error)
7777 __Pyx_XDECREF(__pyx_r);
7778 __Pyx_INCREF(((PyObject *)__pyx_v_result));
7779 __pyx_r = ((PyObject *)__pyx_v_result);
7792 __Pyx_XDECREF(__pyx_t_6);
7793 __Pyx_XDECREF(__pyx_t_9);
7794 __Pyx_XDECREF(__pyx_t_10);
7795 __Pyx_XDECREF(__pyx_t_11);
7796 __Pyx_XDECREF(__pyx_t_12);
7797 __Pyx_XDECREF(__pyx_t_13);
7798 __Pyx_AddTraceback(
"PyClical.clifford.reframe", __pyx_clineno, __pyx_lineno, __pyx_filename);
7801 __Pyx_XDECREF(__pyx_v_error_msg_prefix);
7802 __Pyx_XDECREF((PyObject *)__pyx_v_result);
7803 __Pyx_XDECREF(__pyx_v_err);
7804 __Pyx_XGIVEREF(__pyx_r);
7805 __Pyx_RefNannyFinishContext();
7818 static PyObject *__pyx_pw_8PyClical_8clifford_13__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op);
7819 static PyObject *__pyx_pw_8PyClical_8clifford_13__richcmp__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op) {
7820 PyObject *__pyx_r = 0;
7821 __Pyx_RefNannyDeclarations
7822 __Pyx_RefNannySetupContext(
"__richcmp__ (wrapper)", 0);
7823 __pyx_r = __pyx_pf_8PyClical_8clifford_12__richcmp__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs), ((
int)__pyx_v_op));
7826 __Pyx_RefNannyFinishContext();
7830 static PyObject *__pyx_pf_8PyClical_8clifford_12__richcmp__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_lhs, PyObject *__pyx_v_rhs,
int __pyx_v_op) {
7831 PyObject *__pyx_r = NULL;
7832 __Pyx_RefNannyDeclarations
7836 PyObject *__pyx_t_4 = NULL;
7837 PyObject *__pyx_t_5 = NULL;
7838 PyObject *__pyx_t_6 = NULL;
7839 __Pyx_RefNannySetupContext(
"__richcmp__", 0);
7848 __pyx_t_1 = ((__pyx_v_op == 2) != 0);
7858 __pyx_t_2 = (((PyObject *)__pyx_v_lhs) == Py_None);
7859 __pyx_t_3 = (__pyx_t_2 != 0);
7862 __pyx_t_1 = __pyx_t_3;
7863 goto __pyx_L5_bool_binop_done;
7865 __pyx_t_3 = (__pyx_v_rhs == Py_None);
7866 __pyx_t_2 = (__pyx_t_3 != 0);
7867 __pyx_t_1 = __pyx_t_2;
7868 __pyx_L5_bool_binop_done:;
7878 __Pyx_XDECREF(__pyx_r);
7879 __pyx_t_1 = (((PyObject *)__pyx_v_lhs) == __pyx_v_rhs);
7880 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 693, __pyx_L1_error)
7881 __Pyx_GOTREF(__pyx_t_4);
7882 __pyx_r = __pyx_t_4;
7903 __Pyx_XDECREF(__pyx_r);
7904 __pyx_t_1 = (__pyx_f_8PyClical_toClifford(((PyObject *)__pyx_v_lhs)) == __pyx_f_8PyClical_toClifford(__pyx_v_rhs));
7905 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 695, __pyx_L1_error)
7906 __Pyx_GOTREF(__pyx_t_4);
7907 __pyx_r = __pyx_t_4;
7928 __pyx_t_1 = ((__pyx_v_op == 3) != 0);
7938 __pyx_t_2 = (((PyObject *)__pyx_v_lhs) == Py_None);
7939 __pyx_t_3 = (__pyx_t_2 != 0);
7942 __pyx_t_1 = __pyx_t_3;
7943 goto __pyx_L8_bool_binop_done;
7945 __pyx_t_3 = (__pyx_v_rhs == Py_None);
7946 __pyx_t_2 = (__pyx_t_3 != 0);
7947 __pyx_t_1 = __pyx_t_2;
7948 __pyx_L8_bool_binop_done:;
7958 __Pyx_XDECREF(__pyx_r);
7959 __pyx_t_1 = (((PyObject *)__pyx_v_lhs) == __pyx_v_rhs);
7960 __pyx_t_4 = __Pyx_PyBool_FromLong((!((!(!__pyx_t_1)) != 0)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 698, __pyx_L1_error)
7961 __Pyx_GOTREF(__pyx_t_4);
7962 __pyx_r = __pyx_t_4;
7983 __Pyx_XDECREF(__pyx_r);
7984 __pyx_t_1 = (__pyx_f_8PyClical_toClifford(((PyObject *)__pyx_v_lhs)) != __pyx_f_8PyClical_toClifford(__pyx_v_rhs));
7985 __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_1)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 700, __pyx_L1_error)
7986 __Pyx_GOTREF(__pyx_t_4);
7987 __pyx_r = __pyx_t_4;
8008 __pyx_t_2 = __Pyx_TypeCheck(((PyObject *)__pyx_v_lhs), __pyx_ptype_8PyClical_clifford);
8009 __pyx_t_3 = (__pyx_t_2 != 0);
8012 __pyx_t_1 = __pyx_t_3;
8013 goto __pyx_L10_bool_binop_done;
8015 __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_rhs, __pyx_ptype_8PyClical_clifford);
8016 __pyx_t_2 = (__pyx_t_3 != 0);
8017 __pyx_t_1 = __pyx_t_2;
8018 __pyx_L10_bool_binop_done:;
8019 if (unlikely(__pyx_t_1)) {
8028 __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)
8029 __Pyx_GOTREF(__pyx_t_4);
8030 __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)
8031 __Pyx_GOTREF(__pyx_t_5);
8032 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8033 __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)
8034 __Pyx_GOTREF(__pyx_t_4);
8035 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8036 __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)
8037 __Pyx_GOTREF(__pyx_t_5);
8038 __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_t_4, __pyx_t_5);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 703, __pyx_L1_error)
8039 __Pyx_GOTREF(__pyx_t_6);
8040 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8041 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8042 __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_t_6, __pyx_kp_u_);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 703, __pyx_L1_error)
8043 __Pyx_GOTREF(__pyx_t_5);
8044 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8053 __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_5);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 702, __pyx_L1_error)
8054 __Pyx_GOTREF(__pyx_t_6);
8055 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8056 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
8057 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8058 __PYX_ERR(0, 702, __pyx_L1_error)
8077 __Pyx_XDECREF(__pyx_r);
8078 __Pyx_INCREF(__pyx_builtin_NotImplemented);
8079 __pyx_r = __pyx_builtin_NotImplemented;
8093 __Pyx_XDECREF(__pyx_t_4);
8094 __Pyx_XDECREF(__pyx_t_5);
8095 __Pyx_XDECREF(__pyx_t_6);
8096 __Pyx_AddTraceback(
"PyClical.clifford.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8099 __Pyx_XGIVEREF(__pyx_r);
8100 __Pyx_RefNannyFinishContext();
8113 static PyObject *__pyx_pw_8PyClical_8clifford_15__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ixt);
8114 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 ";
8115 #if CYTHON_COMPILING_IN_CPYTHON
8116 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_14__getitem__;
8118 static PyObject *__pyx_pw_8PyClical_8clifford_15__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ixt) {
8119 PyObject *__pyx_r = 0;
8120 __Pyx_RefNannyDeclarations
8121 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
8122 __pyx_r = __pyx_pf_8PyClical_8clifford_14__getitem__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_ixt));
8125 __Pyx_RefNannyFinishContext();
8129 static PyObject *__pyx_pf_8PyClical_8clifford_14__getitem__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_ixt) {
8130 PyObject *__pyx_r = NULL;
8131 __Pyx_RefNannyDeclarations
8132 PyObject *__pyx_t_1 = NULL;
8133 __Pyx_RefNannySetupContext(
"__getitem__", 0);
8142 __Pyx_XDECREF(__pyx_r);
8143 __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)
8144 __Pyx_GOTREF(__pyx_t_1);
8145 __pyx_r = __pyx_t_1;
8159 __Pyx_XDECREF(__pyx_t_1);
8160 __Pyx_AddTraceback(
"PyClical.clifford.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8163 __Pyx_XGIVEREF(__pyx_r);
8164 __Pyx_RefNannyFinishContext();
8177 static PyObject *__pyx_pw_8PyClical_8clifford_17__neg__(PyObject *__pyx_v_self);
8178 static char __pyx_doc_8PyClical_8clifford_16__neg__[] =
"\n Unary -.\n\n >>> print(-clifford(\"{1}\"))\n -{1}\n ";
8179 #if CYTHON_COMPILING_IN_CPYTHON
8180 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_16__neg__;
8182 static PyObject *__pyx_pw_8PyClical_8clifford_17__neg__(PyObject *__pyx_v_self) {
8183 PyObject *__pyx_r = 0;
8184 __Pyx_RefNannyDeclarations
8185 __Pyx_RefNannySetupContext(
"__neg__ (wrapper)", 0);
8186 __pyx_r = __pyx_pf_8PyClical_8clifford_16__neg__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
8189 __Pyx_RefNannyFinishContext();
8193 static PyObject *__pyx_pf_8PyClical_8clifford_16__neg__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
8194 PyObject *__pyx_r = NULL;
8195 __Pyx_RefNannyDeclarations
8196 PyObject *__pyx_t_1 = NULL;
8197 PyObject *__pyx_t_2 = NULL;
8198 __Pyx_RefNannySetupContext(
"__neg__", 0);
8207 __Pyx_XDECREF(__pyx_r);
8208 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 729, __pyx_L1_error)
8209 __Pyx_GOTREF(__pyx_t_1);
8210 __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)
8211 __Pyx_GOTREF(__pyx_t_2);
8212 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8213 __pyx_r = __pyx_t_2;
8227 __Pyx_XDECREF(__pyx_t_1);
8228 __Pyx_XDECREF(__pyx_t_2);
8229 __Pyx_AddTraceback(
"PyClical.clifford.__neg__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8232 __Pyx_XGIVEREF(__pyx_r);
8233 __Pyx_RefNannyFinishContext();
8246 static PyObject *__pyx_pw_8PyClical_8clifford_19__pos__(PyObject *__pyx_v_self);
8247 static char __pyx_doc_8PyClical_8clifford_18__pos__[] =
"\n Unary +.\n\n >>> print(+clifford(\"{1}\"))\n {1}\n ";
8248 #if CYTHON_COMPILING_IN_CPYTHON
8249 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_18__pos__;
8251 static PyObject *__pyx_pw_8PyClical_8clifford_19__pos__(PyObject *__pyx_v_self) {
8252 PyObject *__pyx_r = 0;
8253 __Pyx_RefNannyDeclarations
8254 __Pyx_RefNannySetupContext(
"__pos__ (wrapper)", 0);
8255 __pyx_r = __pyx_pf_8PyClical_8clifford_18__pos__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
8258 __Pyx_RefNannyFinishContext();
8262 static PyObject *__pyx_pf_8PyClical_8clifford_18__pos__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
8263 PyObject *__pyx_r = NULL;
8264 __Pyx_RefNannyDeclarations
8265 PyObject *__pyx_t_1 = NULL;
8266 __Pyx_RefNannySetupContext(
"__pos__", 0);
8275 __Pyx_XDECREF(__pyx_r);
8276 __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)
8277 __Pyx_GOTREF(__pyx_t_1);
8278 __pyx_r = __pyx_t_1;
8292 __Pyx_XDECREF(__pyx_t_1);
8293 __Pyx_AddTraceback(
"PyClical.clifford.__pos__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8296 __Pyx_XGIVEREF(__pyx_r);
8297 __Pyx_RefNannyFinishContext();
8310 static PyObject *__pyx_pw_8PyClical_8clifford_21__add__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8311 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 ";
8312 #if CYTHON_COMPILING_IN_CPYTHON
8313 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_20__add__;
8315 static PyObject *__pyx_pw_8PyClical_8clifford_21__add__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8316 PyObject *__pyx_r = 0;
8317 __Pyx_RefNannyDeclarations
8318 __Pyx_RefNannySetupContext(
"__add__ (wrapper)", 0);
8319 __pyx_r = __pyx_pf_8PyClical_8clifford_20__add__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8322 __Pyx_RefNannyFinishContext();
8326 static PyObject *__pyx_pf_8PyClical_8clifford_20__add__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8327 PyObject *__pyx_r = NULL;
8328 __Pyx_RefNannyDeclarations
8329 PyObject *__pyx_t_1 = NULL;
8330 PyObject *__pyx_t_2 = NULL;
8331 __Pyx_RefNannySetupContext(
"__add__", 0);
8340 __Pyx_XDECREF(__pyx_r);
8341 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 749, __pyx_L1_error)
8342 __Pyx_GOTREF(__pyx_t_1);
8343 __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)
8344 __Pyx_GOTREF(__pyx_t_2);
8345 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8346 __pyx_r = __pyx_t_2;
8360 __Pyx_XDECREF(__pyx_t_1);
8361 __Pyx_XDECREF(__pyx_t_2);
8362 __Pyx_AddTraceback(
"PyClical.clifford.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8365 __Pyx_XGIVEREF(__pyx_r);
8366 __Pyx_RefNannyFinishContext();
8379 static PyObject *__pyx_pw_8PyClical_8clifford_23__iadd__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8380 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 ";
8381 #if CYTHON_COMPILING_IN_CPYTHON
8382 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_22__iadd__;
8384 static PyObject *__pyx_pw_8PyClical_8clifford_23__iadd__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8385 PyObject *__pyx_r = 0;
8386 __Pyx_RefNannyDeclarations
8387 __Pyx_RefNannySetupContext(
"__iadd__ (wrapper)", 0);
8388 __pyx_r = __pyx_pf_8PyClical_8clifford_22__iadd__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8391 __Pyx_RefNannyFinishContext();
8395 static PyObject *__pyx_pf_8PyClical_8clifford_22__iadd__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8396 PyObject *__pyx_r = NULL;
8397 __Pyx_RefNannyDeclarations
8398 PyObject *__pyx_t_1 = NULL;
8399 __Pyx_RefNannySetupContext(
"__iadd__", 0);
8408 __Pyx_XDECREF(__pyx_r);
8409 __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)
8410 __Pyx_GOTREF(__pyx_t_1);
8411 __pyx_r = __pyx_t_1;
8425 __Pyx_XDECREF(__pyx_t_1);
8426 __Pyx_AddTraceback(
"PyClical.clifford.__iadd__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8429 __Pyx_XGIVEREF(__pyx_r);
8430 __Pyx_RefNannyFinishContext();
8443 static PyObject *__pyx_pw_8PyClical_8clifford_25__sub__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8444 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 ";
8445 #if CYTHON_COMPILING_IN_CPYTHON
8446 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_24__sub__;
8448 static PyObject *__pyx_pw_8PyClical_8clifford_25__sub__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8449 PyObject *__pyx_r = 0;
8450 __Pyx_RefNannyDeclarations
8451 __Pyx_RefNannySetupContext(
"__sub__ (wrapper)", 0);
8452 __pyx_r = __pyx_pf_8PyClical_8clifford_24__sub__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8455 __Pyx_RefNannyFinishContext();
8459 static PyObject *__pyx_pf_8PyClical_8clifford_24__sub__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8460 PyObject *__pyx_r = NULL;
8461 __Pyx_RefNannyDeclarations
8462 PyObject *__pyx_t_1 = NULL;
8463 PyObject *__pyx_t_2 = NULL;
8464 __Pyx_RefNannySetupContext(
"__sub__", 0);
8473 __Pyx_XDECREF(__pyx_r);
8474 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 769, __pyx_L1_error)
8475 __Pyx_GOTREF(__pyx_t_1);
8476 __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)
8477 __Pyx_GOTREF(__pyx_t_2);
8478 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8479 __pyx_r = __pyx_t_2;
8493 __Pyx_XDECREF(__pyx_t_1);
8494 __Pyx_XDECREF(__pyx_t_2);
8495 __Pyx_AddTraceback(
"PyClical.clifford.__sub__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8498 __Pyx_XGIVEREF(__pyx_r);
8499 __Pyx_RefNannyFinishContext();
8512 static PyObject *__pyx_pw_8PyClical_8clifford_27__isub__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8513 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 ";
8514 #if CYTHON_COMPILING_IN_CPYTHON
8515 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_26__isub__;
8517 static PyObject *__pyx_pw_8PyClical_8clifford_27__isub__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8518 PyObject *__pyx_r = 0;
8519 __Pyx_RefNannyDeclarations
8520 __Pyx_RefNannySetupContext(
"__isub__ (wrapper)", 0);
8521 __pyx_r = __pyx_pf_8PyClical_8clifford_26__isub__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8524 __Pyx_RefNannyFinishContext();
8528 static PyObject *__pyx_pf_8PyClical_8clifford_26__isub__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8529 PyObject *__pyx_r = NULL;
8530 __Pyx_RefNannyDeclarations
8531 PyObject *__pyx_t_1 = NULL;
8532 __Pyx_RefNannySetupContext(
"__isub__", 0);
8541 __Pyx_XDECREF(__pyx_r);
8542 __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)
8543 __Pyx_GOTREF(__pyx_t_1);
8544 __pyx_r = __pyx_t_1;
8558 __Pyx_XDECREF(__pyx_t_1);
8559 __Pyx_AddTraceback(
"PyClical.clifford.__isub__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8562 __Pyx_XGIVEREF(__pyx_r);
8563 __Pyx_RefNannyFinishContext();
8576 static PyObject *__pyx_pw_8PyClical_8clifford_29__mul__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8577 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 ";
8578 #if CYTHON_COMPILING_IN_CPYTHON
8579 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_28__mul__;
8581 static PyObject *__pyx_pw_8PyClical_8clifford_29__mul__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8582 PyObject *__pyx_r = 0;
8583 __Pyx_RefNannyDeclarations
8584 __Pyx_RefNannySetupContext(
"__mul__ (wrapper)", 0);
8585 __pyx_r = __pyx_pf_8PyClical_8clifford_28__mul__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8588 __Pyx_RefNannyFinishContext();
8592 static PyObject *__pyx_pf_8PyClical_8clifford_28__mul__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8593 PyObject *__pyx_r = NULL;
8594 __Pyx_RefNannyDeclarations
8595 PyObject *__pyx_t_1 = NULL;
8596 PyObject *__pyx_t_2 = NULL;
8597 __Pyx_RefNannySetupContext(
"__mul__", 0);
8606 __Pyx_XDECREF(__pyx_r);
8607 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 791, __pyx_L1_error)
8608 __Pyx_GOTREF(__pyx_t_1);
8609 __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)
8610 __Pyx_GOTREF(__pyx_t_2);
8611 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8612 __pyx_r = __pyx_t_2;
8626 __Pyx_XDECREF(__pyx_t_1);
8627 __Pyx_XDECREF(__pyx_t_2);
8628 __Pyx_AddTraceback(
"PyClical.clifford.__mul__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8631 __Pyx_XGIVEREF(__pyx_r);
8632 __Pyx_RefNannyFinishContext();
8645 static PyObject *__pyx_pw_8PyClical_8clifford_31__imul__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8646 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 ";
8647 #if CYTHON_COMPILING_IN_CPYTHON
8648 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_30__imul__;
8650 static PyObject *__pyx_pw_8PyClical_8clifford_31__imul__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8651 PyObject *__pyx_r = 0;
8652 __Pyx_RefNannyDeclarations
8653 __Pyx_RefNannySetupContext(
"__imul__ (wrapper)", 0);
8654 __pyx_r = __pyx_pf_8PyClical_8clifford_30__imul__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8657 __Pyx_RefNannyFinishContext();
8661 static PyObject *__pyx_pf_8PyClical_8clifford_30__imul__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8662 PyObject *__pyx_r = NULL;
8663 __Pyx_RefNannyDeclarations
8664 PyObject *__pyx_t_1 = NULL;
8665 __Pyx_RefNannySetupContext(
"__imul__", 0);
8674 __Pyx_XDECREF(__pyx_r);
8675 __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)
8676 __Pyx_GOTREF(__pyx_t_1);
8677 __pyx_r = __pyx_t_1;
8691 __Pyx_XDECREF(__pyx_t_1);
8692 __Pyx_AddTraceback(
"PyClical.clifford.__imul__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8695 __Pyx_XGIVEREF(__pyx_r);
8696 __Pyx_RefNannyFinishContext();
8709 static PyObject *__pyx_pw_8PyClical_8clifford_33__mod__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8710 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 ";
8711 #if CYTHON_COMPILING_IN_CPYTHON
8712 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_32__mod__;
8714 static PyObject *__pyx_pw_8PyClical_8clifford_33__mod__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8715 PyObject *__pyx_r = 0;
8716 __Pyx_RefNannyDeclarations
8717 __Pyx_RefNannySetupContext(
"__mod__ (wrapper)", 0);
8718 __pyx_r = __pyx_pf_8PyClical_8clifford_32__mod__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8721 __Pyx_RefNannyFinishContext();
8725 static PyObject *__pyx_pf_8PyClical_8clifford_32__mod__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8726 PyObject *__pyx_r = NULL;
8727 __Pyx_RefNannyDeclarations
8728 PyObject *__pyx_t_1 = NULL;
8729 PyObject *__pyx_t_2 = NULL;
8730 __Pyx_RefNannySetupContext(
"__mod__", 0);
8739 __Pyx_XDECREF(__pyx_r);
8740 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 819, __pyx_L1_error)
8741 __Pyx_GOTREF(__pyx_t_1);
8742 __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)
8743 __Pyx_GOTREF(__pyx_t_2);
8744 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8745 __pyx_r = __pyx_t_2;
8759 __Pyx_XDECREF(__pyx_t_1);
8760 __Pyx_XDECREF(__pyx_t_2);
8761 __Pyx_AddTraceback(
"PyClical.clifford.__mod__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8764 __Pyx_XGIVEREF(__pyx_r);
8765 __Pyx_RefNannyFinishContext();
8778 static PyObject *__pyx_pw_8PyClical_8clifford_35__imod__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8779 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 ";
8780 #if CYTHON_COMPILING_IN_CPYTHON
8781 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_34__imod__;
8783 static PyObject *__pyx_pw_8PyClical_8clifford_35__imod__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8784 PyObject *__pyx_r = 0;
8785 __Pyx_RefNannyDeclarations
8786 __Pyx_RefNannySetupContext(
"__imod__ (wrapper)", 0);
8787 __pyx_r = __pyx_pf_8PyClical_8clifford_34__imod__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8790 __Pyx_RefNannyFinishContext();
8794 static PyObject *__pyx_pf_8PyClical_8clifford_34__imod__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8795 PyObject *__pyx_r = NULL;
8796 __Pyx_RefNannyDeclarations
8797 PyObject *__pyx_t_1 = NULL;
8798 __Pyx_RefNannySetupContext(
"__imod__", 0);
8807 __Pyx_XDECREF(__pyx_r);
8808 __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)
8809 __Pyx_GOTREF(__pyx_t_1);
8810 __pyx_r = __pyx_t_1;
8824 __Pyx_XDECREF(__pyx_t_1);
8825 __Pyx_AddTraceback(
"PyClical.clifford.__imod__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8828 __Pyx_XGIVEREF(__pyx_r);
8829 __Pyx_RefNannyFinishContext();
8842 static PyObject *__pyx_pw_8PyClical_8clifford_37__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8843 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 ";
8844 #if CYTHON_COMPILING_IN_CPYTHON
8845 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_36__and__;
8847 static PyObject *__pyx_pw_8PyClical_8clifford_37__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8848 PyObject *__pyx_r = 0;
8849 __Pyx_RefNannyDeclarations
8850 __Pyx_RefNannySetupContext(
"__and__ (wrapper)", 0);
8851 __pyx_r = __pyx_pf_8PyClical_8clifford_36__and__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8854 __Pyx_RefNannyFinishContext();
8858 static PyObject *__pyx_pf_8PyClical_8clifford_36__and__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8859 PyObject *__pyx_r = NULL;
8860 __Pyx_RefNannyDeclarations
8861 PyObject *__pyx_t_1 = NULL;
8862 PyObject *__pyx_t_2 = NULL;
8863 __Pyx_RefNannySetupContext(
"__and__", 0);
8872 __Pyx_XDECREF(__pyx_r);
8873 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 849, __pyx_L1_error)
8874 __Pyx_GOTREF(__pyx_t_1);
8875 __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)
8876 __Pyx_GOTREF(__pyx_t_2);
8877 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8878 __pyx_r = __pyx_t_2;
8892 __Pyx_XDECREF(__pyx_t_1);
8893 __Pyx_XDECREF(__pyx_t_2);
8894 __Pyx_AddTraceback(
"PyClical.clifford.__and__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8897 __Pyx_XGIVEREF(__pyx_r);
8898 __Pyx_RefNannyFinishContext();
8911 static PyObject *__pyx_pw_8PyClical_8clifford_39__iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
8912 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 ";
8913 #if CYTHON_COMPILING_IN_CPYTHON
8914 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_38__iand__;
8916 static PyObject *__pyx_pw_8PyClical_8clifford_39__iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
8917 PyObject *__pyx_r = 0;
8918 __Pyx_RefNannyDeclarations
8919 __Pyx_RefNannySetupContext(
"__iand__ (wrapper)", 0);
8920 __pyx_r = __pyx_pf_8PyClical_8clifford_38__iand__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
8923 __Pyx_RefNannyFinishContext();
8927 static PyObject *__pyx_pf_8PyClical_8clifford_38__iand__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
8928 PyObject *__pyx_r = NULL;
8929 __Pyx_RefNannyDeclarations
8930 PyObject *__pyx_t_1 = NULL;
8931 __Pyx_RefNannySetupContext(
"__iand__", 0);
8940 __Pyx_XDECREF(__pyx_r);
8941 __pyx_t_1 = __pyx_f_8PyClical_8clifford_wrap(__pyx_v_self, (__pyx_f_8PyClical_8clifford_unwrap(__pyx_v_self) & __pyx_f_8PyClical_toClifford(__pyx_v_rhs)));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 864, __pyx_L1_error)
8942 __Pyx_GOTREF(__pyx_t_1);
8943 __pyx_r = __pyx_t_1;
8957 __Pyx_XDECREF(__pyx_t_1);
8958 __Pyx_AddTraceback(
"PyClical.clifford.__iand__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8961 __Pyx_XGIVEREF(__pyx_r);
8962 __Pyx_RefNannyFinishContext();
8975 static PyObject *__pyx_pw_8PyClical_8clifford_41__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
8976 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 ";
8977 #if CYTHON_COMPILING_IN_CPYTHON
8978 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_40__xor__;
8980 static PyObject *__pyx_pw_8PyClical_8clifford_41__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8981 PyObject *__pyx_r = 0;
8982 __Pyx_RefNannyDeclarations
8983 __Pyx_RefNannySetupContext(
"__xor__ (wrapper)", 0);
8984 __pyx_r = __pyx_pf_8PyClical_8clifford_40__xor__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
8987 __Pyx_RefNannyFinishContext();
8991 static PyObject *__pyx_pf_8PyClical_8clifford_40__xor__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
8992 PyObject *__pyx_r = NULL;
8993 __Pyx_RefNannyDeclarations
8994 PyObject *__pyx_t_1 = NULL;
8995 PyObject *__pyx_t_2 = NULL;
8996 __Pyx_RefNannySetupContext(
"__xor__", 0);
9005 __Pyx_XDECREF(__pyx_r);
9006 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 879, __pyx_L1_error)
9007 __Pyx_GOTREF(__pyx_t_1);
9008 __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)
9009 __Pyx_GOTREF(__pyx_t_2);
9010 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9011 __pyx_r = __pyx_t_2;
9025 __Pyx_XDECREF(__pyx_t_1);
9026 __Pyx_XDECREF(__pyx_t_2);
9027 __Pyx_AddTraceback(
"PyClical.clifford.__xor__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9030 __Pyx_XGIVEREF(__pyx_r);
9031 __Pyx_RefNannyFinishContext();
9044 static PyObject *__pyx_pw_8PyClical_8clifford_43__ixor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
9045 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 ";
9046 #if CYTHON_COMPILING_IN_CPYTHON
9047 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_42__ixor__;
9049 static PyObject *__pyx_pw_8PyClical_8clifford_43__ixor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
9050 PyObject *__pyx_r = 0;
9051 __Pyx_RefNannyDeclarations
9052 __Pyx_RefNannySetupContext(
"__ixor__ (wrapper)", 0);
9053 __pyx_r = __pyx_pf_8PyClical_8clifford_42__ixor__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
9056 __Pyx_RefNannyFinishContext();
9060 static PyObject *__pyx_pf_8PyClical_8clifford_42__ixor__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
9061 PyObject *__pyx_r = NULL;
9062 __Pyx_RefNannyDeclarations
9063 PyObject *__pyx_t_1 = NULL;
9064 __Pyx_RefNannySetupContext(
"__ixor__", 0);
9073 __Pyx_XDECREF(__pyx_r);
9074 __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)
9075 __Pyx_GOTREF(__pyx_t_1);
9076 __pyx_r = __pyx_t_1;
9090 __Pyx_XDECREF(__pyx_t_1);
9091 __Pyx_AddTraceback(
"PyClical.clifford.__ixor__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9094 __Pyx_XGIVEREF(__pyx_r);
9095 __Pyx_RefNannyFinishContext();
9108 static PyObject *__pyx_pw_8PyClical_8clifford_45__truediv__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
9109 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 ";
9110 #if CYTHON_COMPILING_IN_CPYTHON
9111 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_44__truediv__;
9113 static PyObject *__pyx_pw_8PyClical_8clifford_45__truediv__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
9114 PyObject *__pyx_r = 0;
9115 __Pyx_RefNannyDeclarations
9116 __Pyx_RefNannySetupContext(
"__truediv__ (wrapper)", 0);
9117 __pyx_r = __pyx_pf_8PyClical_8clifford_44__truediv__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
9120 __Pyx_RefNannyFinishContext();
9124 static PyObject *__pyx_pf_8PyClical_8clifford_44__truediv__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
9125 PyObject *__pyx_r = NULL;
9126 __Pyx_RefNannyDeclarations
9127 PyObject *__pyx_t_1 = NULL;
9128 PyObject *__pyx_t_2 = NULL;
9129 __Pyx_RefNannySetupContext(
"__truediv__", 0);
9138 __Pyx_XDECREF(__pyx_r);
9139 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 909, __pyx_L1_error)
9140 __Pyx_GOTREF(__pyx_t_1);
9141 __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)
9142 __Pyx_GOTREF(__pyx_t_2);
9143 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9144 __pyx_r = __pyx_t_2;
9158 __Pyx_XDECREF(__pyx_t_1);
9159 __Pyx_XDECREF(__pyx_t_2);
9160 __Pyx_AddTraceback(
"PyClical.clifford.__truediv__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9163 __Pyx_XGIVEREF(__pyx_r);
9164 __Pyx_RefNannyFinishContext();
9177 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
9178 static PyObject *__pyx_pw_8PyClical_8clifford_47__idiv__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
9179 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 ";
9180 #if CYTHON_COMPILING_IN_CPYTHON
9181 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_46__idiv__;
9183 static PyObject *__pyx_pw_8PyClical_8clifford_47__idiv__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
9184 PyObject *__pyx_r = 0;
9185 __Pyx_RefNannyDeclarations
9186 __Pyx_RefNannySetupContext(
"__idiv__ (wrapper)", 0);
9187 __pyx_r = __pyx_pf_8PyClical_8clifford_46__idiv__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
9190 __Pyx_RefNannyFinishContext();
9195 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
9196 static PyObject *__pyx_pf_8PyClical_8clifford_46__idiv__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
9197 PyObject *__pyx_r = NULL;
9198 __Pyx_RefNannyDeclarations
9199 PyObject *__pyx_t_1 = NULL;
9200 __Pyx_RefNannySetupContext(
"__idiv__", 0);
9209 __Pyx_XDECREF(__pyx_r);
9210 __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)
9211 __Pyx_GOTREF(__pyx_t_1);
9212 __pyx_r = __pyx_t_1;
9226 __Pyx_XDECREF(__pyx_t_1);
9227 __Pyx_AddTraceback(
"PyClical.clifford.__idiv__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9230 __Pyx_XGIVEREF(__pyx_r);
9231 __Pyx_RefNannyFinishContext();
9245 static PyObject *__pyx_pw_8PyClical_8clifford_49inv(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9246 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 ";
9247 static PyObject *__pyx_pw_8PyClical_8clifford_49inv(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9248 PyObject *__pyx_r = 0;
9249 __Pyx_RefNannyDeclarations
9250 __Pyx_RefNannySetupContext(
"inv (wrapper)", 0);
9251 __pyx_r = __pyx_pf_8PyClical_8clifford_48inv(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
9254 __Pyx_RefNannyFinishContext();
9258 static PyObject *__pyx_pf_8PyClical_8clifford_48inv(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
9259 PyObject *__pyx_r = NULL;
9260 __Pyx_RefNannyDeclarations
9261 PyObject *__pyx_t_1 = NULL;
9262 PyObject *__pyx_t_2 = NULL;
9263 __Pyx_RefNannySetupContext(
"inv", 0);
9272 __Pyx_XDECREF(__pyx_r);
9273 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 937, __pyx_L1_error)
9274 __Pyx_GOTREF(__pyx_t_1);
9275 __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)
9276 __Pyx_GOTREF(__pyx_t_2);
9277 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9278 __pyx_r = __pyx_t_2;
9292 __Pyx_XDECREF(__pyx_t_1);
9293 __Pyx_XDECREF(__pyx_t_2);
9294 __Pyx_AddTraceback(
"PyClical.clifford.inv", __pyx_clineno, __pyx_lineno, __pyx_filename);
9297 __Pyx_XGIVEREF(__pyx_r);
9298 __Pyx_RefNannyFinishContext();
9311 static PyObject *__pyx_pw_8PyClical_8clifford_51__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs);
9312 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 ";
9313 #if CYTHON_COMPILING_IN_CPYTHON
9314 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_50__or__;
9316 static PyObject *__pyx_pw_8PyClical_8clifford_51__or__(PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs) {
9317 PyObject *__pyx_r = 0;
9318 __Pyx_RefNannyDeclarations
9319 __Pyx_RefNannySetupContext(
"__or__ (wrapper)", 0);
9320 __pyx_r = __pyx_pf_8PyClical_8clifford_50__or__(((PyObject *)__pyx_v_lhs), ((PyObject *)__pyx_v_rhs));
9323 __Pyx_RefNannyFinishContext();
9327 static PyObject *__pyx_pf_8PyClical_8clifford_50__or__(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 __Pyx_RefNannySetupContext(
"__or__", 0);
9341 __Pyx_XDECREF(__pyx_r);
9342 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 948, __pyx_L1_error)
9343 __Pyx_GOTREF(__pyx_t_1);
9344 __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)
9345 __Pyx_GOTREF(__pyx_t_2);
9346 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9347 __pyx_r = __pyx_t_2;
9361 __Pyx_XDECREF(__pyx_t_1);
9362 __Pyx_XDECREF(__pyx_t_2);
9363 __Pyx_AddTraceback(
"PyClical.clifford.__or__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9366 __Pyx_XGIVEREF(__pyx_r);
9367 __Pyx_RefNannyFinishContext();
9380 static PyObject *__pyx_pw_8PyClical_8clifford_53__ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs);
9381 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 ";
9382 #if CYTHON_COMPILING_IN_CPYTHON
9383 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_52__ior__;
9385 static PyObject *__pyx_pw_8PyClical_8clifford_53__ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
9386 PyObject *__pyx_r = 0;
9387 __Pyx_RefNannyDeclarations
9388 __Pyx_RefNannySetupContext(
"__ior__ (wrapper)", 0);
9389 __pyx_r = __pyx_pf_8PyClical_8clifford_52__ior__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_rhs));
9392 __Pyx_RefNannyFinishContext();
9396 static PyObject *__pyx_pf_8PyClical_8clifford_52__ior__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_rhs) {
9397 PyObject *__pyx_r = NULL;
9398 __Pyx_RefNannyDeclarations
9399 PyObject *__pyx_t_1 = NULL;
9400 __Pyx_RefNannySetupContext(
"__ior__", 0);
9409 __Pyx_XDECREF(__pyx_r);
9410 __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)
9411 __Pyx_GOTREF(__pyx_t_1);
9412 __pyx_r = __pyx_t_1;
9426 __Pyx_XDECREF(__pyx_t_1);
9427 __Pyx_AddTraceback(
"PyClical.clifford.__ior__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9430 __Pyx_XGIVEREF(__pyx_r);
9431 __Pyx_RefNannyFinishContext();
9444 static PyObject *__pyx_pw_8PyClical_8clifford_55__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_m, PyObject *__pyx_v_dummy);
9445 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 ";
9446 #if CYTHON_COMPILING_IN_CPYTHON
9447 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_54__pow__;
9449 static PyObject *__pyx_pw_8PyClical_8clifford_55__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_m, PyObject *__pyx_v_dummy) {
9450 PyObject *__pyx_r = 0;
9451 __Pyx_RefNannyDeclarations
9452 __Pyx_RefNannySetupContext(
"__pow__ (wrapper)", 0);
9453 __pyx_r = __pyx_pf_8PyClical_8clifford_54__pow__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_m), ((PyObject *)__pyx_v_dummy));
9456 __Pyx_RefNannyFinishContext();
9460 static PyObject *__pyx_pf_8PyClical_8clifford_54__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_m, CYTHON_UNUSED PyObject *__pyx_v_dummy) {
9461 PyObject *__pyx_r = NULL;
9462 __Pyx_RefNannyDeclarations
9463 PyObject *__pyx_t_1 = NULL;
9464 __Pyx_RefNannySetupContext(
"__pow__", 0);
9473 __Pyx_XDECREF(__pyx_r);
9474 __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)
9475 __Pyx_GOTREF(__pyx_t_1);
9476 __pyx_r = __pyx_t_1;
9490 __Pyx_XDECREF(__pyx_t_1);
9491 __Pyx_AddTraceback(
"PyClical.clifford.__pow__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9494 __Pyx_XGIVEREF(__pyx_r);
9495 __Pyx_RefNannyFinishContext();
9508 static PyObject *__pyx_pw_8PyClical_8clifford_57pow(PyObject *__pyx_v_self, PyObject *__pyx_v_m);
9509 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 ";
9510 static PyObject *__pyx_pw_8PyClical_8clifford_57pow(PyObject *__pyx_v_self, PyObject *__pyx_v_m) {
9511 PyObject *__pyx_r = 0;
9512 __Pyx_RefNannyDeclarations
9513 __Pyx_RefNannySetupContext(
"pow (wrapper)", 0);
9514 __pyx_r = __pyx_pf_8PyClical_8clifford_56pow(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_m));
9517 __Pyx_RefNannyFinishContext();
9521 static PyObject *__pyx_pf_8PyClical_8clifford_56pow(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_m) {
9522 PyObject *__pyx_r = NULL;
9523 __Pyx_RefNannyDeclarations
9524 PyObject *__pyx_t_1 = NULL;
9525 PyObject *__pyx_t_2 = NULL;
9529 __Pyx_RefNannySetupContext(
"pow", 0);
9538 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_numbers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 999, __pyx_L1_error)
9539 __Pyx_GOTREF(__pyx_t_1);
9540 __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)
9541 __Pyx_GOTREF(__pyx_t_2);
9542 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9543 __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)
9544 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9545 __pyx_t_4 = (__pyx_t_3 != 0);
9555 __Pyx_XDECREF(__pyx_r);
9556 __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1000, __pyx_L1_error)
9557 __Pyx_GOTREF(__pyx_t_2);
9558 __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)
9559 __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)
9560 __Pyx_GOTREF(__pyx_t_1);
9561 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9562 __pyx_r = __pyx_t_1;
9583 __Pyx_XDECREF(__pyx_r);
9584 __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)
9585 __Pyx_GOTREF(__pyx_t_1);
9586 __pyx_t_2 = PyNumber_Multiply(__pyx_v_m, __pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1002, __pyx_L1_error)
9587 __Pyx_GOTREF(__pyx_t_2);
9588 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9589 __pyx_t_1 = __pyx_f_8PyClical_exp(__pyx_t_2, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1002, __pyx_L1_error)
9590 __Pyx_GOTREF(__pyx_t_1);
9591 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9592 __pyx_r = __pyx_t_1;
9607 __Pyx_XDECREF(__pyx_t_1);
9608 __Pyx_XDECREF(__pyx_t_2);
9609 __Pyx_AddTraceback(
"PyClical.clifford.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
9612 __Pyx_XGIVEREF(__pyx_r);
9613 __Pyx_RefNannyFinishContext();
9626 static PyObject *__pyx_pw_8PyClical_8clifford_59outer_pow(PyObject *__pyx_v_self, PyObject *__pyx_v_m);
9627 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 ";
9628 static PyObject *__pyx_pw_8PyClical_8clifford_59outer_pow(PyObject *__pyx_v_self, PyObject *__pyx_v_m) {
9629 PyObject *__pyx_r = 0;
9630 __Pyx_RefNannyDeclarations
9631 __Pyx_RefNannySetupContext(
"outer_pow (wrapper)", 0);
9632 __pyx_r = __pyx_pf_8PyClical_8clifford_58outer_pow(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_m));
9635 __Pyx_RefNannyFinishContext();
9639 static PyObject *__pyx_pf_8PyClical_8clifford_58outer_pow(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_m) {
9640 PyObject *__pyx_r = NULL;
9641 __Pyx_RefNannyDeclarations
9642 PyObject *__pyx_t_1 = NULL;
9644 PyObject *__pyx_t_3 = NULL;
9645 __Pyx_RefNannySetupContext(
"outer_pow", 0);
9654 __Pyx_XDECREF(__pyx_r);
9655 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1018, __pyx_L1_error)
9656 __Pyx_GOTREF(__pyx_t_1);
9657 __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)
9658 __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)
9659 __Pyx_GOTREF(__pyx_t_3);
9660 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9661 __pyx_r = __pyx_t_3;
9675 __Pyx_XDECREF(__pyx_t_1);
9676 __Pyx_XDECREF(__pyx_t_3);
9677 __Pyx_AddTraceback(
"PyClical.clifford.outer_pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
9680 __Pyx_XGIVEREF(__pyx_r);
9681 __Pyx_RefNannyFinishContext();
9694 static PyObject *__pyx_pw_8PyClical_8clifford_61__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
9695 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 ";
9696 #if CYTHON_COMPILING_IN_CPYTHON
9697 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_60__call__;
9699 static PyObject *__pyx_pw_8PyClical_8clifford_61__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9700 PyObject *__pyx_v_grade = 0;
9701 PyObject *__pyx_r = 0;
9702 __Pyx_RefNannyDeclarations
9703 __Pyx_RefNannySetupContext(
"__call__ (wrapper)", 0);
9705 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_grade,0};
9706 PyObject* values[1] = {0};
9707 if (unlikely(__pyx_kwds)) {
9709 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9711 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9714 default:
goto __pyx_L5_argtuple_error;
9716 kw_args = PyDict_Size(__pyx_kwds);
9719 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_grade)) != 0)) kw_args--;
9720 else goto __pyx_L5_argtuple_error;
9722 if (unlikely(kw_args > 0)) {
9723 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__call__") < 0)) __PYX_ERR(0, 1020, __pyx_L3_error)
9725 }
else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
9726 goto __pyx_L5_argtuple_error;
9728 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9730 __pyx_v_grade = values[0];
9732 goto __pyx_L4_argument_unpacking_done;
9733 __pyx_L5_argtuple_error:;
9734 __Pyx_RaiseArgtupleInvalid(
"__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1020, __pyx_L3_error)
9736 __Pyx_AddTraceback(
"PyClical.clifford.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9737 __Pyx_RefNannyFinishContext();
9739 __pyx_L4_argument_unpacking_done:;
9740 __pyx_r = __pyx_pf_8PyClical_8clifford_60__call__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), __pyx_v_grade);
9743 __Pyx_RefNannyFinishContext();
9747 static PyObject *__pyx_pf_8PyClical_8clifford_60__call__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_grade) {
9748 PyObject *__pyx_r = NULL;
9749 __Pyx_RefNannyDeclarations
9750 PyObject *__pyx_t_1 = NULL;
9752 PyObject *__pyx_t_3 = NULL;
9753 __Pyx_RefNannySetupContext(
"__call__", 0);
9762 __Pyx_XDECREF(__pyx_r);
9763 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1037, __pyx_L1_error)
9764 __Pyx_GOTREF(__pyx_t_1);
9765 __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)
9766 __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)
9767 __Pyx_GOTREF(__pyx_t_3);
9768 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9769 __pyx_r = __pyx_t_3;
9783 __Pyx_XDECREF(__pyx_t_1);
9784 __Pyx_XDECREF(__pyx_t_3);
9785 __Pyx_AddTraceback(
"PyClical.clifford.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9788 __Pyx_XGIVEREF(__pyx_r);
9789 __Pyx_RefNannyFinishContext();
9802 static PyObject *__pyx_pw_8PyClical_8clifford_63scalar(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9803 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 ";
9804 static PyObject *__pyx_pw_8PyClical_8clifford_63scalar(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9805 PyObject *__pyx_r = 0;
9806 __Pyx_RefNannyDeclarations
9807 __Pyx_RefNannySetupContext(
"scalar (wrapper)", 0);
9808 __pyx_r = __pyx_pf_8PyClical_8clifford_62scalar(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
9811 __Pyx_RefNannyFinishContext();
9815 static PyObject *__pyx_pf_8PyClical_8clifford_62scalar(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
9816 PyObject *__pyx_r = NULL;
9817 __Pyx_RefNannyDeclarations
9818 PyObject *__pyx_t_1 = NULL;
9819 __Pyx_RefNannySetupContext(
"scalar", 0);
9828 __Pyx_XDECREF(__pyx_r);
9829 __pyx_t_1 =
PyFloat_FromDouble(__pyx_v_self->instance->scalar());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1048, __pyx_L1_error)
9830 __Pyx_GOTREF(__pyx_t_1);
9831 __pyx_r = __pyx_t_1;
9845 __Pyx_XDECREF(__pyx_t_1);
9846 __Pyx_AddTraceback(
"PyClical.clifford.scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
9849 __Pyx_XGIVEREF(__pyx_r);
9850 __Pyx_RefNannyFinishContext();
9863 static PyObject *__pyx_pw_8PyClical_8clifford_65pure(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9864 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 ";
9865 static PyObject *__pyx_pw_8PyClical_8clifford_65pure(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9866 PyObject *__pyx_r = 0;
9867 __Pyx_RefNannyDeclarations
9868 __Pyx_RefNannySetupContext(
"pure (wrapper)", 0);
9869 __pyx_r = __pyx_pf_8PyClical_8clifford_64pure(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
9872 __Pyx_RefNannyFinishContext();
9876 static PyObject *__pyx_pf_8PyClical_8clifford_64pure(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
9877 PyObject *__pyx_r = NULL;
9878 __Pyx_RefNannyDeclarations
9879 PyObject *__pyx_t_1 = NULL;
9880 PyObject *__pyx_t_2 = NULL;
9881 __Pyx_RefNannySetupContext(
"pure", 0);
9890 __Pyx_XDECREF(__pyx_r);
9891 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1059, __pyx_L1_error)
9892 __Pyx_GOTREF(__pyx_t_1);
9893 __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)
9894 __Pyx_GOTREF(__pyx_t_2);
9895 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9896 __pyx_r = __pyx_t_2;
9910 __Pyx_XDECREF(__pyx_t_1);
9911 __Pyx_XDECREF(__pyx_t_2);
9912 __Pyx_AddTraceback(
"PyClical.clifford.pure", __pyx_clineno, __pyx_lineno, __pyx_filename);
9915 __Pyx_XGIVEREF(__pyx_r);
9916 __Pyx_RefNannyFinishContext();
9929 static PyObject *__pyx_pw_8PyClical_8clifford_67even(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9930 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 ";
9931 static PyObject *__pyx_pw_8PyClical_8clifford_67even(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9932 PyObject *__pyx_r = 0;
9933 __Pyx_RefNannyDeclarations
9934 __Pyx_RefNannySetupContext(
"even (wrapper)", 0);
9935 __pyx_r = __pyx_pf_8PyClical_8clifford_66even(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
9938 __Pyx_RefNannyFinishContext();
9942 static PyObject *__pyx_pf_8PyClical_8clifford_66even(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
9943 PyObject *__pyx_r = NULL;
9944 __Pyx_RefNannyDeclarations
9945 PyObject *__pyx_t_1 = NULL;
9946 PyObject *__pyx_t_2 = NULL;
9947 __Pyx_RefNannySetupContext(
"even", 0);
9956 __Pyx_XDECREF(__pyx_r);
9957 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1068, __pyx_L1_error)
9958 __Pyx_GOTREF(__pyx_t_1);
9959 __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)
9960 __Pyx_GOTREF(__pyx_t_2);
9961 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9962 __pyx_r = __pyx_t_2;
9976 __Pyx_XDECREF(__pyx_t_1);
9977 __Pyx_XDECREF(__pyx_t_2);
9978 __Pyx_AddTraceback(
"PyClical.clifford.even", __pyx_clineno, __pyx_lineno, __pyx_filename);
9981 __Pyx_XGIVEREF(__pyx_r);
9982 __Pyx_RefNannyFinishContext();
9995 static PyObject *__pyx_pw_8PyClical_8clifford_69odd(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9996 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 ";
9997 static PyObject *__pyx_pw_8PyClical_8clifford_69odd(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9998 PyObject *__pyx_r = 0;
9999 __Pyx_RefNannyDeclarations
10000 __Pyx_RefNannySetupContext(
"odd (wrapper)", 0);
10001 __pyx_r = __pyx_pf_8PyClical_8clifford_68odd(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10004 __Pyx_RefNannyFinishContext();
10008 static PyObject *__pyx_pf_8PyClical_8clifford_68odd(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10009 PyObject *__pyx_r = NULL;
10010 __Pyx_RefNannyDeclarations
10011 PyObject *__pyx_t_1 = NULL;
10012 PyObject *__pyx_t_2 = NULL;
10013 __Pyx_RefNannySetupContext(
"odd", 0);
10022 __Pyx_XDECREF(__pyx_r);
10023 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1077, __pyx_L1_error)
10024 __Pyx_GOTREF(__pyx_t_1);
10025 __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)
10026 __Pyx_GOTREF(__pyx_t_2);
10027 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10028 __pyx_r = __pyx_t_2;
10042 __Pyx_XDECREF(__pyx_t_1);
10043 __Pyx_XDECREF(__pyx_t_2);
10044 __Pyx_AddTraceback(
"PyClical.clifford.odd", __pyx_clineno, __pyx_lineno, __pyx_filename);
10047 __Pyx_XGIVEREF(__pyx_r);
10048 __Pyx_RefNannyFinishContext();
10061 static PyObject *__pyx_pw_8PyClical_8clifford_71vector_part(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
10062 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 ";
10063 static PyObject *__pyx_pw_8PyClical_8clifford_71vector_part(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10064 PyObject *__pyx_v_frm = 0;
10065 PyObject *__pyx_r = 0;
10066 __Pyx_RefNannyDeclarations
10067 __Pyx_RefNannySetupContext(
"vector_part (wrapper)", 0);
10069 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frm,0};
10070 PyObject* values[1] = {0};
10071 values[0] = ((PyObject *)Py_None);
10072 if (unlikely(__pyx_kwds)) {
10073 Py_ssize_t kw_args;
10074 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10075 switch (pos_args) {
10076 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10077 CYTHON_FALLTHROUGH;
10079 default:
goto __pyx_L5_argtuple_error;
10081 kw_args = PyDict_Size(__pyx_kwds);
10082 switch (pos_args) {
10085 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_frm);
10086 if (value) { values[0] = value; kw_args--; }
10089 if (unlikely(kw_args > 0)) {
10090 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"vector_part") < 0)) __PYX_ERR(0, 1079, __pyx_L3_error)
10093 switch (PyTuple_GET_SIZE(__pyx_args)) {
10094 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10095 CYTHON_FALLTHROUGH;
10097 default:
goto __pyx_L5_argtuple_error;
10100 __pyx_v_frm = values[0];
10102 goto __pyx_L4_argument_unpacking_done;
10103 __pyx_L5_argtuple_error:;
10104 __Pyx_RaiseArgtupleInvalid(
"vector_part", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1079, __pyx_L3_error)
10106 __Pyx_AddTraceback(
"PyClical.clifford.vector_part", __pyx_clineno, __pyx_lineno, __pyx_filename);
10107 __Pyx_RefNannyFinishContext();
10109 __pyx_L4_argument_unpacking_done:;
10110 __pyx_r = __pyx_pf_8PyClical_8clifford_70vector_part(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), __pyx_v_frm);
10113 __Pyx_RefNannyFinishContext();
10117 static PyObject *__pyx_pf_8PyClical_8clifford_70vector_part(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_frm) {
10118 PyObject *__pyx_v_error_msg_prefix = NULL;
10119 std::vector<scalar_t> __pyx_v_vec;
10122 PyObject *__pyx_v_lst = NULL;
10123 PyObject *__pyx_v_err = NULL;
10124 PyObject *__pyx_r = NULL;
10125 __Pyx_RefNannyDeclarations
10126 PyObject *__pyx_t_1 = NULL;
10127 PyObject *__pyx_t_2 = NULL;
10128 PyObject *__pyx_t_3 = NULL;
10131 std::vector<scalar_t> __pyx_t_6;
10132 PyObject *__pyx_t_7 = NULL;
10136 PyObject *__pyx_t_11 = NULL;
10137 PyObject *__pyx_t_12 = NULL;
10138 PyObject *__pyx_t_13 = NULL;
10139 PyObject *__pyx_t_14 = NULL;
10140 PyObject *__pyx_t_15 = NULL;
10141 char const *__pyx_t_16;
10142 PyObject *__pyx_t_17 = NULL;
10143 PyObject *__pyx_t_18 = NULL;
10144 PyObject *__pyx_t_19 = NULL;
10145 PyObject *__pyx_t_20 = NULL;
10146 PyObject *__pyx_t_21 = NULL;
10147 PyObject *__pyx_t_22 = NULL;
10148 __Pyx_RefNannySetupContext(
"vector_part", 0);
10157 __Pyx_INCREF(__pyx_kp_u_Cannot_take_vector_part_of);
10158 __pyx_v_error_msg_prefix = __pyx_kp_u_Cannot_take_vector_part_of;
10168 __Pyx_PyThreadState_declare
10169 __Pyx_PyThreadState_assign
10170 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
10171 __Pyx_XGOTREF(__pyx_t_1);
10172 __Pyx_XGOTREF(__pyx_t_2);
10173 __Pyx_XGOTREF(__pyx_t_3);
10183 __pyx_t_4 = (__pyx_v_frm == Py_None);
10184 __pyx_t_5 = (__pyx_t_4 != 0);
10194 __pyx_t_6 = __pyx_v_self->instance->vector_part();
10195 __pyx_v_vec = __pyx_t_6;
10216 __pyx_t_6 = __pyx_v_self->instance->vector_part(__pyx_f_8PyClical_9index_set_unwrap(((
struct __pyx_obj_8PyClical_index_set *)__pyx_v_frm)));
10218 __Pyx_CppExn2PyErr();
10219 __PYX_ERR(0, 1096, __pyx_L3_error)
10221 __pyx_v_vec = __pyx_t_6;
10232 __pyx_v_n = __pyx_v_vec.size();
10241 __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)
10242 __Pyx_GOTREF(__pyx_t_7);
10243 { Py_ssize_t __pyx_temp;
10244 for (__pyx_temp=0; __pyx_temp < __pyx_v_n; __pyx_temp++) {
10245 __Pyx_INCREF(__pyx_float_0_0);
10246 __Pyx_GIVEREF(__pyx_float_0_0);
10247 PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_float_0_0);
10250 __pyx_v_lst = ((PyObject*)__pyx_t_7);
10260 __pyx_t_8 = __pyx_v_n;
10261 __pyx_t_9 = __pyx_t_8;
10262 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
10263 __pyx_v_i = __pyx_t_10;
10272 __pyx_t_7 =
PyFloat_FromDouble((__pyx_v_vec[__pyx_v_i]));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1100, __pyx_L3_error)
10273 __Pyx_GOTREF(__pyx_t_7);
10274 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)
10275 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10285 __Pyx_XDECREF(__pyx_r);
10286 __Pyx_INCREF(__pyx_v_lst);
10287 __pyx_r = __pyx_v_lst;
10288 goto __pyx_L7_try_return;
10299 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10308 __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
10310 __Pyx_AddTraceback(
"PyClical.clifford.vector_part", __pyx_clineno, __pyx_lineno, __pyx_filename);
10311 if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_11, &__pyx_t_12) < 0) __PYX_ERR(0, 1102, __pyx_L5_except_error)
10312 __Pyx_GOTREF(__pyx_t_7);
10313 __Pyx_GOTREF(__pyx_t_11);
10314 __Pyx_GOTREF(__pyx_t_12);
10315 __Pyx_INCREF(__pyx_t_11);
10316 __pyx_v_err = __pyx_t_11;
10326 __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)
10327 __Pyx_GOTREF(__pyx_t_13);
10328 __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)
10329 __Pyx_GOTREF(__pyx_t_14);
10330 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
10331 __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)
10332 __Pyx_GOTREF(__pyx_t_13);
10333 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
10342 __pyx_t_14 = PyObject_Repr(__pyx_v_frm);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1104, __pyx_L17_error)
10343 __Pyx_GOTREF(__pyx_t_14);
10344 __pyx_t_15 = __Pyx_PyUnicode_ConcatSafe(__pyx_t_13, __pyx_t_14);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1104, __pyx_L17_error)
10345 __Pyx_GOTREF(__pyx_t_15);
10346 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
10347 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
10348 __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)
10349 __Pyx_GOTREF(__pyx_t_14);
10350 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
10359 __pyx_t_15 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_err);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1105, __pyx_L17_error)
10360 __Pyx_GOTREF(__pyx_t_15);
10361 __pyx_t_13 = __Pyx_PyUnicode_Concat(__pyx_t_14, __pyx_t_15);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1105, __pyx_L17_error)
10362 __Pyx_GOTREF(__pyx_t_13);
10363 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
10364 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
10373 __pyx_t_15 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_13);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1103, __pyx_L17_error)
10374 __Pyx_GOTREF(__pyx_t_15);
10375 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
10376 __Pyx_Raise(__pyx_t_15, 0, 0, 0);
10377 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
10378 __PYX_ERR(0, 1103, __pyx_L17_error)
10391 __Pyx_PyThreadState_declare
10392 __Pyx_PyThreadState_assign
10393 __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
10394 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
10395 __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
10396 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
10397 if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
10398 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);
10399 __Pyx_XGOTREF(__pyx_t_17);
10400 __Pyx_XGOTREF(__pyx_t_18);
10401 __Pyx_XGOTREF(__pyx_t_19);
10402 __Pyx_XGOTREF(__pyx_t_20);
10403 __Pyx_XGOTREF(__pyx_t_21);
10404 __Pyx_XGOTREF(__pyx_t_22);
10405 __pyx_t_8 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
10407 __Pyx_DECREF(__pyx_v_err);
10408 __pyx_v_err = NULL;
10410 if (PY_MAJOR_VERSION >= 3) {
10411 __Pyx_XGIVEREF(__pyx_t_20);
10412 __Pyx_XGIVEREF(__pyx_t_21);
10413 __Pyx_XGIVEREF(__pyx_t_22);
10414 __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
10416 __Pyx_XGIVEREF(__pyx_t_17);
10417 __Pyx_XGIVEREF(__pyx_t_18);
10418 __Pyx_XGIVEREF(__pyx_t_19);
10419 __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
10420 __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
10421 __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_16;
10422 goto __pyx_L5_except_error;
10426 goto __pyx_L5_except_error;
10427 __pyx_L5_except_error:;
10436 __Pyx_XGIVEREF(__pyx_t_1);
10437 __Pyx_XGIVEREF(__pyx_t_2);
10438 __Pyx_XGIVEREF(__pyx_t_3);
10439 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
10440 goto __pyx_L1_error;
10441 __pyx_L7_try_return:;
10442 __Pyx_XGIVEREF(__pyx_t_1);
10443 __Pyx_XGIVEREF(__pyx_t_2);
10444 __Pyx_XGIVEREF(__pyx_t_3);
10445 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
10459 __Pyx_XDECREF(__pyx_t_7);
10460 __Pyx_XDECREF(__pyx_t_11);
10461 __Pyx_XDECREF(__pyx_t_12);
10462 __Pyx_XDECREF(__pyx_t_13);
10463 __Pyx_XDECREF(__pyx_t_14);
10464 __Pyx_XDECREF(__pyx_t_15);
10465 __Pyx_AddTraceback(
"PyClical.clifford.vector_part", __pyx_clineno, __pyx_lineno, __pyx_filename);
10468 __Pyx_XDECREF(__pyx_v_error_msg_prefix);
10469 __Pyx_XDECREF(__pyx_v_lst);
10470 __Pyx_XDECREF(__pyx_v_err);
10471 __Pyx_XGIVEREF(__pyx_r);
10472 __Pyx_RefNannyFinishContext();
10485 static PyObject *__pyx_pw_8PyClical_8clifford_73involute(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10486 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 ";
10487 static PyObject *__pyx_pw_8PyClical_8clifford_73involute(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10488 PyObject *__pyx_r = 0;
10489 __Pyx_RefNannyDeclarations
10490 __Pyx_RefNannySetupContext(
"involute (wrapper)", 0);
10491 __pyx_r = __pyx_pf_8PyClical_8clifford_72involute(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10494 __Pyx_RefNannyFinishContext();
10498 static PyObject *__pyx_pf_8PyClical_8clifford_72involute(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10499 PyObject *__pyx_r = NULL;
10500 __Pyx_RefNannyDeclarations
10501 PyObject *__pyx_t_1 = NULL;
10502 PyObject *__pyx_t_2 = NULL;
10503 __Pyx_RefNannySetupContext(
"involute", 0);
10512 __Pyx_XDECREF(__pyx_r);
10513 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1121, __pyx_L1_error)
10514 __Pyx_GOTREF(__pyx_t_1);
10515 __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)
10516 __Pyx_GOTREF(__pyx_t_2);
10517 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10518 __pyx_r = __pyx_t_2;
10532 __Pyx_XDECREF(__pyx_t_1);
10533 __Pyx_XDECREF(__pyx_t_2);
10534 __Pyx_AddTraceback(
"PyClical.clifford.involute", __pyx_clineno, __pyx_lineno, __pyx_filename);
10537 __Pyx_XGIVEREF(__pyx_r);
10538 __Pyx_RefNannyFinishContext();
10551 static PyObject *__pyx_pw_8PyClical_8clifford_75reverse(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10552 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 ";
10553 static PyObject *__pyx_pw_8PyClical_8clifford_75reverse(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10554 PyObject *__pyx_r = 0;
10555 __Pyx_RefNannyDeclarations
10556 __Pyx_RefNannySetupContext(
"reverse (wrapper)", 0);
10557 __pyx_r = __pyx_pf_8PyClical_8clifford_74reverse(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10560 __Pyx_RefNannyFinishContext();
10564 static PyObject *__pyx_pf_8PyClical_8clifford_74reverse(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10565 PyObject *__pyx_r = NULL;
10566 __Pyx_RefNannyDeclarations
10567 PyObject *__pyx_t_1 = NULL;
10568 PyObject *__pyx_t_2 = NULL;
10569 __Pyx_RefNannySetupContext(
"reverse", 0);
10578 __Pyx_XDECREF(__pyx_r);
10579 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1136, __pyx_L1_error)
10580 __Pyx_GOTREF(__pyx_t_1);
10581 __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)
10582 __Pyx_GOTREF(__pyx_t_2);
10583 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10584 __pyx_r = __pyx_t_2;
10598 __Pyx_XDECREF(__pyx_t_1);
10599 __Pyx_XDECREF(__pyx_t_2);
10600 __Pyx_AddTraceback(
"PyClical.clifford.reverse", __pyx_clineno, __pyx_lineno, __pyx_filename);
10603 __Pyx_XGIVEREF(__pyx_r);
10604 __Pyx_RefNannyFinishContext();
10617 static PyObject *__pyx_pw_8PyClical_8clifford_77conj(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10618 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 ";
10619 static PyObject *__pyx_pw_8PyClical_8clifford_77conj(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10620 PyObject *__pyx_r = 0;
10621 __Pyx_RefNannyDeclarations
10622 __Pyx_RefNannySetupContext(
"conj (wrapper)", 0);
10623 __pyx_r = __pyx_pf_8PyClical_8clifford_76conj(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10626 __Pyx_RefNannyFinishContext();
10630 static PyObject *__pyx_pf_8PyClical_8clifford_76conj(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10631 PyObject *__pyx_r = NULL;
10632 __Pyx_RefNannyDeclarations
10633 PyObject *__pyx_t_1 = NULL;
10634 PyObject *__pyx_t_2 = NULL;
10635 __Pyx_RefNannySetupContext(
"conj", 0);
10644 __Pyx_XDECREF(__pyx_r);
10645 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1151, __pyx_L1_error)
10646 __Pyx_GOTREF(__pyx_t_1);
10647 __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)
10648 __Pyx_GOTREF(__pyx_t_2);
10649 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10650 __pyx_r = __pyx_t_2;
10664 __Pyx_XDECREF(__pyx_t_1);
10665 __Pyx_XDECREF(__pyx_t_2);
10666 __Pyx_AddTraceback(
"PyClical.clifford.conj", __pyx_clineno, __pyx_lineno, __pyx_filename);
10669 __Pyx_XGIVEREF(__pyx_r);
10670 __Pyx_RefNannyFinishContext();
10683 static PyObject *__pyx_pw_8PyClical_8clifford_79quad(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10684 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 ";
10685 static PyObject *__pyx_pw_8PyClical_8clifford_79quad(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10686 PyObject *__pyx_r = 0;
10687 __Pyx_RefNannyDeclarations
10688 __Pyx_RefNannySetupContext(
"quad (wrapper)", 0);
10689 __pyx_r = __pyx_pf_8PyClical_8clifford_78quad(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10692 __Pyx_RefNannyFinishContext();
10696 static PyObject *__pyx_pf_8PyClical_8clifford_78quad(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10697 PyObject *__pyx_r = NULL;
10698 __Pyx_RefNannyDeclarations
10699 PyObject *__pyx_t_1 = NULL;
10700 __Pyx_RefNannySetupContext(
"quad", 0);
10709 __Pyx_XDECREF(__pyx_r);
10710 __pyx_t_1 =
PyFloat_FromDouble(__pyx_v_self->instance->quad());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1162, __pyx_L1_error)
10711 __Pyx_GOTREF(__pyx_t_1);
10712 __pyx_r = __pyx_t_1;
10726 __Pyx_XDECREF(__pyx_t_1);
10727 __Pyx_AddTraceback(
"PyClical.clifford.quad", __pyx_clineno, __pyx_lineno, __pyx_filename);
10730 __Pyx_XGIVEREF(__pyx_r);
10731 __Pyx_RefNannyFinishContext();
10744 static PyObject *__pyx_pw_8PyClical_8clifford_81norm(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10745 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 ";
10746 static PyObject *__pyx_pw_8PyClical_8clifford_81norm(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10747 PyObject *__pyx_r = 0;
10748 __Pyx_RefNannyDeclarations
10749 __Pyx_RefNannySetupContext(
"norm (wrapper)", 0);
10750 __pyx_r = __pyx_pf_8PyClical_8clifford_80norm(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10753 __Pyx_RefNannyFinishContext();
10757 static PyObject *__pyx_pf_8PyClical_8clifford_80norm(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10758 PyObject *__pyx_r = NULL;
10759 __Pyx_RefNannyDeclarations
10760 PyObject *__pyx_t_1 = NULL;
10761 __Pyx_RefNannySetupContext(
"norm", 0);
10770 __Pyx_XDECREF(__pyx_r);
10771 __pyx_t_1 =
PyFloat_FromDouble(__pyx_v_self->instance->norm());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1173, __pyx_L1_error)
10772 __Pyx_GOTREF(__pyx_t_1);
10773 __pyx_r = __pyx_t_1;
10787 __Pyx_XDECREF(__pyx_t_1);
10788 __Pyx_AddTraceback(
"PyClical.clifford.norm", __pyx_clineno, __pyx_lineno, __pyx_filename);
10791 __Pyx_XGIVEREF(__pyx_r);
10792 __Pyx_RefNannyFinishContext();
10805 static PyObject *__pyx_pw_8PyClical_8clifford_83abs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10806 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 ";
10807 static PyObject *__pyx_pw_8PyClical_8clifford_83abs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10808 PyObject *__pyx_r = 0;
10809 __Pyx_RefNannyDeclarations
10810 __Pyx_RefNannySetupContext(
"abs (wrapper)", 0);
10811 __pyx_r = __pyx_pf_8PyClical_8clifford_82abs(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10814 __Pyx_RefNannyFinishContext();
10818 static PyObject *__pyx_pf_8PyClical_8clifford_82abs(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10819 PyObject *__pyx_r = NULL;
10820 __Pyx_RefNannyDeclarations
10821 PyObject *__pyx_t_1 = NULL;
10822 __Pyx_RefNannySetupContext(
"abs", 0);
10831 __Pyx_XDECREF(__pyx_r);
10832 __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)
10833 __Pyx_GOTREF(__pyx_t_1);
10834 __pyx_r = __pyx_t_1;
10848 __Pyx_XDECREF(__pyx_t_1);
10849 __Pyx_AddTraceback(
"PyClical.clifford.abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
10852 __Pyx_XGIVEREF(__pyx_r);
10853 __Pyx_RefNannyFinishContext();
10866 static PyObject *__pyx_pw_8PyClical_8clifford_85max_abs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10867 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 ";
10868 static PyObject *__pyx_pw_8PyClical_8clifford_85max_abs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10869 PyObject *__pyx_r = 0;
10870 __Pyx_RefNannyDeclarations
10871 __Pyx_RefNannySetupContext(
"max_abs (wrapper)", 0);
10872 __pyx_r = __pyx_pf_8PyClical_8clifford_84max_abs(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
10875 __Pyx_RefNannyFinishContext();
10879 static PyObject *__pyx_pf_8PyClical_8clifford_84max_abs(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
10880 PyObject *__pyx_r = NULL;
10881 __Pyx_RefNannyDeclarations
10882 PyObject *__pyx_t_1 = NULL;
10883 __Pyx_RefNannySetupContext(
"max_abs", 0);
10892 __Pyx_XDECREF(__pyx_r);
10893 __pyx_t_1 =
PyFloat_FromDouble(__pyx_v_self->instance->max_abs());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1193, __pyx_L1_error)
10894 __Pyx_GOTREF(__pyx_t_1);
10895 __pyx_r = __pyx_t_1;
10909 __Pyx_XDECREF(__pyx_t_1);
10910 __Pyx_AddTraceback(
"PyClical.clifford.max_abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
10913 __Pyx_XGIVEREF(__pyx_r);
10914 __Pyx_RefNannyFinishContext();
10927 static PyObject *__pyx_pw_8PyClical_8clifford_87truncated(PyObject *__pyx_v_self, PyObject *__pyx_v_limit);
10928 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 ";
10929 static PyObject *__pyx_pw_8PyClical_8clifford_87truncated(PyObject *__pyx_v_self, PyObject *__pyx_v_limit) {
10930 PyObject *__pyx_r = 0;
10931 __Pyx_RefNannyDeclarations
10932 __Pyx_RefNannySetupContext(
"truncated (wrapper)", 0);
10933 __pyx_r = __pyx_pf_8PyClical_8clifford_86truncated(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v_limit));
10936 __Pyx_RefNannyFinishContext();
10940 static PyObject *__pyx_pf_8PyClical_8clifford_86truncated(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self, PyObject *__pyx_v_limit) {
10941 PyObject *__pyx_r = NULL;
10942 __Pyx_RefNannyDeclarations
10943 PyObject *__pyx_t_1 = NULL;
10945 PyObject *__pyx_t_3 = NULL;
10946 __Pyx_RefNannySetupContext(
"truncated", 0);
10955 __Pyx_XDECREF(__pyx_r);
10956 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1204, __pyx_L1_error)
10957 __Pyx_GOTREF(__pyx_t_1);
10958 __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)
10959 __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)
10960 __Pyx_GOTREF(__pyx_t_3);
10961 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10962 __pyx_r = __pyx_t_3;
10976 __Pyx_XDECREF(__pyx_t_1);
10977 __Pyx_XDECREF(__pyx_t_3);
10978 __Pyx_AddTraceback(
"PyClical.clifford.truncated", __pyx_clineno, __pyx_lineno, __pyx_filename);
10981 __Pyx_XGIVEREF(__pyx_r);
10982 __Pyx_RefNannyFinishContext();
10995 static PyObject *__pyx_pw_8PyClical_8clifford_89isnan(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10996 static char __pyx_doc_8PyClical_8clifford_88isnan[] =
"\n Check if a multivector contains any IEEE NaN values.\n\n >>> clifford().isnan()\n False\n ";
10997 static PyObject *__pyx_pw_8PyClical_8clifford_89isnan(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10998 PyObject *__pyx_r = 0;
10999 __Pyx_RefNannyDeclarations
11000 __Pyx_RefNannySetupContext(
"isnan (wrapper)", 0);
11001 __pyx_r = __pyx_pf_8PyClical_8clifford_88isnan(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
11004 __Pyx_RefNannyFinishContext();
11008 static PyObject *__pyx_pf_8PyClical_8clifford_88isnan(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
11009 PyObject *__pyx_r = NULL;
11010 __Pyx_RefNannyDeclarations
11011 PyObject *__pyx_t_1 = NULL;
11012 __Pyx_RefNannySetupContext(
"isnan", 0);
11021 __Pyx_XDECREF(__pyx_r);
11022 __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->instance->isnan());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1213, __pyx_L1_error)
11023 __Pyx_GOTREF(__pyx_t_1);
11024 __pyx_r = __pyx_t_1;
11038 __Pyx_XDECREF(__pyx_t_1);
11039 __Pyx_AddTraceback(
"PyClical.clifford.isnan", __pyx_clineno, __pyx_lineno, __pyx_filename);
11042 __Pyx_XGIVEREF(__pyx_r);
11043 __Pyx_RefNannyFinishContext();
11056 static PyObject *__pyx_pw_8PyClical_8clifford_91frame(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
11057 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 ";
11058 static PyObject *__pyx_pw_8PyClical_8clifford_91frame(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11059 PyObject *__pyx_r = 0;
11060 __Pyx_RefNannyDeclarations
11061 __Pyx_RefNannySetupContext(
"frame (wrapper)", 0);
11062 __pyx_r = __pyx_pf_8PyClical_8clifford_90frame(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
11065 __Pyx_RefNannyFinishContext();
11069 static PyObject *__pyx_pf_8PyClical_8clifford_90frame(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
11070 PyObject *__pyx_r = NULL;
11071 __Pyx_RefNannyDeclarations
11072 PyObject *__pyx_t_1 = NULL;
11073 PyObject *__pyx_t_2 = NULL;
11074 __Pyx_RefNannySetupContext(
"frame", 0);
11083 __Pyx_XDECREF(__pyx_r);
11084 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_index_set));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1224, __pyx_L1_error)
11085 __Pyx_GOTREF(__pyx_t_1);
11086 __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)
11087 __Pyx_GOTREF(__pyx_t_2);
11088 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11089 __pyx_r = __pyx_t_2;
11103 __Pyx_XDECREF(__pyx_t_1);
11104 __Pyx_XDECREF(__pyx_t_2);
11105 __Pyx_AddTraceback(
"PyClical.clifford.frame", __pyx_clineno, __pyx_lineno, __pyx_filename);
11108 __Pyx_XGIVEREF(__pyx_r);
11109 __Pyx_RefNannyFinishContext();
11122 static PyObject *__pyx_pw_8PyClical_8clifford_93__repr__(PyObject *__pyx_v_self);
11123 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 ";
11124 #if CYTHON_COMPILING_IN_CPYTHON
11125 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_92__repr__;
11127 static PyObject *__pyx_pw_8PyClical_8clifford_93__repr__(PyObject *__pyx_v_self) {
11128 PyObject *__pyx_r = 0;
11129 __Pyx_RefNannyDeclarations
11130 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
11131 __pyx_r = __pyx_pf_8PyClical_8clifford_92__repr__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
11134 __Pyx_RefNannyFinishContext();
11138 static PyObject *__pyx_pf_8PyClical_8clifford_92__repr__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
11139 PyObject *__pyx_r = NULL;
11140 __Pyx_RefNannyDeclarations
11141 PyObject *__pyx_t_1 = NULL;
11142 __Pyx_RefNannySetupContext(
"__repr__", 0);
11151 __Pyx_XDECREF(__pyx_r);
11152 __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)
11153 __Pyx_GOTREF(__pyx_t_1);
11154 __pyx_r = __pyx_t_1;
11168 __Pyx_XDECREF(__pyx_t_1);
11169 __Pyx_AddTraceback(
"PyClical.clifford.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11172 __Pyx_XGIVEREF(__pyx_r);
11173 __Pyx_RefNannyFinishContext();
11186 static PyObject *__pyx_pw_8PyClical_8clifford_95__str__(PyObject *__pyx_v_self);
11187 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 ";
11188 #if CYTHON_COMPILING_IN_CPYTHON
11189 struct wrapperbase __pyx_wrapperbase_8PyClical_8clifford_94__str__;
11191 static PyObject *__pyx_pw_8PyClical_8clifford_95__str__(PyObject *__pyx_v_self) {
11192 PyObject *__pyx_r = 0;
11193 __Pyx_RefNannyDeclarations
11194 __Pyx_RefNannySetupContext(
"__str__ (wrapper)", 0);
11195 __pyx_r = __pyx_pf_8PyClical_8clifford_94__str__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
11198 __Pyx_RefNannyFinishContext();
11202 static PyObject *__pyx_pf_8PyClical_8clifford_94__str__(
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
11203 PyObject *__pyx_r = NULL;
11204 __Pyx_RefNannyDeclarations
11205 PyObject *__pyx_t_1 = NULL;
11206 __Pyx_RefNannySetupContext(
"__str__", 0);
11215 __Pyx_XDECREF(__pyx_r);
11216 __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)
11217 __Pyx_GOTREF(__pyx_t_1);
11218 __pyx_r = __pyx_t_1;
11232 __Pyx_XDECREF(__pyx_t_1);
11233 __Pyx_AddTraceback(
"PyClical.clifford.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11236 __Pyx_XGIVEREF(__pyx_r);
11237 __Pyx_RefNannyFinishContext();
11248 static PyObject *__pyx_pw_8PyClical_8clifford_97__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
11249 static PyObject *__pyx_pw_8PyClical_8clifford_97__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11250 PyObject *__pyx_r = 0;
11251 __Pyx_RefNannyDeclarations
11252 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
11253 __pyx_r = __pyx_pf_8PyClical_8clifford_96__reduce_cython__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self));
11256 __Pyx_RefNannyFinishContext();
11260 static PyObject *__pyx_pf_8PyClical_8clifford_96__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_8PyClical_clifford *__pyx_v_self) {
11261 PyObject *__pyx_r = NULL;
11262 __Pyx_RefNannyDeclarations
11263 PyObject *__pyx_t_1 = NULL;
11264 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
11272 __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)
11273 __Pyx_GOTREF(__pyx_t_1);
11274 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
11275 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11276 __PYX_ERR(1, 2, __pyx_L1_error)
11286 __Pyx_XDECREF(__pyx_t_1);
11287 __Pyx_AddTraceback(
"PyClical.clifford.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11289 __Pyx_XGIVEREF(__pyx_r);
11290 __Pyx_RefNannyFinishContext();
11302 static PyObject *__pyx_pw_8PyClical_8clifford_99__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
11303 static PyObject *__pyx_pw_8PyClical_8clifford_99__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
11304 PyObject *__pyx_r = 0;
11305 __Pyx_RefNannyDeclarations
11306 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
11307 __pyx_r = __pyx_pf_8PyClical_8clifford_98__setstate_cython__(((
struct __pyx_obj_8PyClical_clifford *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
11310 __Pyx_RefNannyFinishContext();
11314 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) {
11315 PyObject *__pyx_r = NULL;
11316 __Pyx_RefNannyDeclarations
11317 PyObject *__pyx_t_1 = NULL;
11318 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
11325 __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)
11326 __Pyx_GOTREF(__pyx_t_1);
11327 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
11328 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11329 __PYX_ERR(1, 4, __pyx_L1_error)
11340 __Pyx_XDECREF(__pyx_t_1);
11341 __Pyx_AddTraceback(
"PyClical.clifford.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11343 __Pyx_XGIVEREF(__pyx_r);
11344 __Pyx_RefNannyFinishContext();
11357 static PyObject *__pyx_pw_8PyClical_9clifford_hidden_doctests(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused);
11358 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 ";
11359 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};
11360 static PyObject *__pyx_pw_8PyClical_9clifford_hidden_doctests(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
11361 PyObject *__pyx_r = 0;
11362 __Pyx_RefNannyDeclarations
11363 __Pyx_RefNannySetupContext(
"clifford_hidden_doctests (wrapper)", 0);
11364 __pyx_r = __pyx_pf_8PyClical_8clifford_hidden_doctests(__pyx_self);
11367 __Pyx_RefNannyFinishContext();
11371 static PyObject *__pyx_pf_8PyClical_8clifford_hidden_doctests(CYTHON_UNUSED PyObject *__pyx_self) {
11372 PyObject *__pyx_r = NULL;
11373 __Pyx_RefNannyDeclarations
11374 __Pyx_RefNannySetupContext(
"clifford_hidden_doctests", 0);
11383 __Pyx_XDECREF(__pyx_r);
11384 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11397 __Pyx_XGIVEREF(__pyx_r);
11398 __Pyx_RefNannyFinishContext();
11410 static PyObject *__pyx_pw_8PyClical_11inv(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11411 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_inv(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11412 PyObject *__pyx_r = NULL;
11413 __Pyx_RefNannyDeclarations
11414 PyObject *__pyx_t_1 = NULL;
11415 PyObject *__pyx_t_2 = NULL;
11416 PyObject *__pyx_t_3 = NULL;
11417 __Pyx_RefNannySetupContext(
"inv", 0);
11426 __Pyx_XDECREF(__pyx_r);
11427 __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)
11428 __Pyx_GOTREF(__pyx_t_2);
11429 __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)
11430 __Pyx_GOTREF(__pyx_t_3);
11431 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11433 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11434 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11435 if (likely(__pyx_t_2)) {
11436 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
11437 __Pyx_INCREF(__pyx_t_2);
11438 __Pyx_INCREF(
function);
11439 __Pyx_DECREF_SET(__pyx_t_3,
function);
11442 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
11443 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11444 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1341, __pyx_L1_error)
11445 __Pyx_GOTREF(__pyx_t_1);
11446 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11447 __pyx_r = __pyx_t_1;
11461 __Pyx_XDECREF(__pyx_t_1);
11462 __Pyx_XDECREF(__pyx_t_2);
11463 __Pyx_XDECREF(__pyx_t_3);
11464 __Pyx_AddTraceback(
"PyClical.inv", __pyx_clineno, __pyx_lineno, __pyx_filename);
11467 __Pyx_XGIVEREF(__pyx_r);
11468 __Pyx_RefNannyFinishContext();
11473 static PyObject *__pyx_pw_8PyClical_11inv(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11474 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 ";
11475 static PyObject *__pyx_pw_8PyClical_11inv(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11476 PyObject *__pyx_r = 0;
11477 __Pyx_RefNannyDeclarations
11478 __Pyx_RefNannySetupContext(
"inv (wrapper)", 0);
11479 __pyx_r = __pyx_pf_8PyClical_10inv(__pyx_self, ((PyObject *)__pyx_v_obj));
11482 __Pyx_RefNannyFinishContext();
11486 static PyObject *__pyx_pf_8PyClical_10inv(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11487 PyObject *__pyx_r = NULL;
11488 __Pyx_RefNannyDeclarations
11489 PyObject *__pyx_t_1 = NULL;
11490 __Pyx_RefNannySetupContext(
"inv", 0);
11491 __Pyx_XDECREF(__pyx_r);
11492 __pyx_t_1 = __pyx_f_8PyClical_inv(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1328, __pyx_L1_error)
11493 __Pyx_GOTREF(__pyx_t_1);
11494 __pyx_r = __pyx_t_1;
11500 __Pyx_XDECREF(__pyx_t_1);
11501 __Pyx_AddTraceback(
"PyClical.inv", __pyx_clineno, __pyx_lineno, __pyx_filename);
11504 __Pyx_XGIVEREF(__pyx_r);
11505 __Pyx_RefNannyFinishContext();
11517 static PyObject *__pyx_pw_8PyClical_13scalar(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11518 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_scalar(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11519 PyObject *__pyx_r = NULL;
11520 __Pyx_RefNannyDeclarations
11521 PyObject *__pyx_t_1 = NULL;
11522 PyObject *__pyx_t_2 = NULL;
11523 PyObject *__pyx_t_3 = NULL;
11524 __Pyx_RefNannySetupContext(
"scalar", 0);
11533 __Pyx_XDECREF(__pyx_r);
11534 __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)
11535 __Pyx_GOTREF(__pyx_t_2);
11536 __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)
11537 __Pyx_GOTREF(__pyx_t_3);
11538 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11540 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11541 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11542 if (likely(__pyx_t_2)) {
11543 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
11544 __Pyx_INCREF(__pyx_t_2);
11545 __Pyx_INCREF(
function);
11546 __Pyx_DECREF_SET(__pyx_t_3,
function);
11549 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
11550 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11551 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1352, __pyx_L1_error)
11552 __Pyx_GOTREF(__pyx_t_1);
11553 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11554 __pyx_r = __pyx_t_1;
11568 __Pyx_XDECREF(__pyx_t_1);
11569 __Pyx_XDECREF(__pyx_t_2);
11570 __Pyx_XDECREF(__pyx_t_3);
11571 __Pyx_AddTraceback(
"PyClical.scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
11574 __Pyx_XGIVEREF(__pyx_r);
11575 __Pyx_RefNannyFinishContext();
11580 static PyObject *__pyx_pw_8PyClical_13scalar(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11581 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 ";
11582 static PyObject *__pyx_pw_8PyClical_13scalar(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11583 PyObject *__pyx_r = 0;
11584 __Pyx_RefNannyDeclarations
11585 __Pyx_RefNannySetupContext(
"scalar (wrapper)", 0);
11586 __pyx_r = __pyx_pf_8PyClical_12scalar(__pyx_self, ((PyObject *)__pyx_v_obj));
11589 __Pyx_RefNannyFinishContext();
11593 static PyObject *__pyx_pf_8PyClical_12scalar(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11594 PyObject *__pyx_r = NULL;
11595 __Pyx_RefNannyDeclarations
11596 PyObject *__pyx_t_1 = NULL;
11597 __Pyx_RefNannySetupContext(
"scalar", 0);
11598 __Pyx_XDECREF(__pyx_r);
11599 __pyx_t_1 = __pyx_f_8PyClical_scalar(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1343, __pyx_L1_error)
11600 __Pyx_GOTREF(__pyx_t_1);
11601 __pyx_r = __pyx_t_1;
11607 __Pyx_XDECREF(__pyx_t_1);
11608 __Pyx_AddTraceback(
"PyClical.scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
11611 __Pyx_XGIVEREF(__pyx_r);
11612 __Pyx_RefNannyFinishContext();
11624 static PyObject *__pyx_pw_8PyClical_15real(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11625 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_real(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11626 PyObject *__pyx_r = NULL;
11627 __Pyx_RefNannyDeclarations
11628 PyObject *__pyx_t_1 = NULL;
11629 PyObject *__pyx_t_2 = NULL;
11630 PyObject *__pyx_t_3 = NULL;
11631 __Pyx_RefNannySetupContext(
"real", 0);
11640 __Pyx_XDECREF(__pyx_r);
11641 __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)
11642 __Pyx_GOTREF(__pyx_t_2);
11643 __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)
11644 __Pyx_GOTREF(__pyx_t_3);
11645 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11647 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11648 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11649 if (likely(__pyx_t_2)) {
11650 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
11651 __Pyx_INCREF(__pyx_t_2);
11652 __Pyx_INCREF(
function);
11653 __Pyx_DECREF_SET(__pyx_t_3,
function);
11656 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
11657 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11658 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1363, __pyx_L1_error)
11659 __Pyx_GOTREF(__pyx_t_1);
11660 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11661 __pyx_r = __pyx_t_1;
11675 __Pyx_XDECREF(__pyx_t_1);
11676 __Pyx_XDECREF(__pyx_t_2);
11677 __Pyx_XDECREF(__pyx_t_3);
11678 __Pyx_AddTraceback(
"PyClical.real", __pyx_clineno, __pyx_lineno, __pyx_filename);
11681 __Pyx_XGIVEREF(__pyx_r);
11682 __Pyx_RefNannyFinishContext();
11687 static PyObject *__pyx_pw_8PyClical_15real(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11688 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 ";
11689 static PyObject *__pyx_pw_8PyClical_15real(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11690 PyObject *__pyx_r = 0;
11691 __Pyx_RefNannyDeclarations
11692 __Pyx_RefNannySetupContext(
"real (wrapper)", 0);
11693 __pyx_r = __pyx_pf_8PyClical_14real(__pyx_self, ((PyObject *)__pyx_v_obj));
11696 __Pyx_RefNannyFinishContext();
11700 static PyObject *__pyx_pf_8PyClical_14real(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11701 PyObject *__pyx_r = NULL;
11702 __Pyx_RefNannyDeclarations
11703 PyObject *__pyx_t_1 = NULL;
11704 __Pyx_RefNannySetupContext(
"real", 0);
11705 __Pyx_XDECREF(__pyx_r);
11706 __pyx_t_1 = __pyx_f_8PyClical_real(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1354, __pyx_L1_error)
11707 __Pyx_GOTREF(__pyx_t_1);
11708 __pyx_r = __pyx_t_1;
11714 __Pyx_XDECREF(__pyx_t_1);
11715 __Pyx_AddTraceback(
"PyClical.real", __pyx_clineno, __pyx_lineno, __pyx_filename);
11718 __Pyx_XGIVEREF(__pyx_r);
11719 __Pyx_RefNannyFinishContext();
11731 static PyObject *__pyx_pw_8PyClical_17imag(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11732 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_imag(CYTHON_UNUSED PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11733 PyObject *__pyx_r = NULL;
11734 __Pyx_RefNannyDeclarations
11735 __Pyx_RefNannySetupContext(
"imag", 0);
11744 __Pyx_XDECREF(__pyx_r);
11745 __Pyx_INCREF(__pyx_float_0_0);
11746 __pyx_r = __pyx_float_0_0;
11759 __Pyx_XGIVEREF(__pyx_r);
11760 __Pyx_RefNannyFinishContext();
11765 static PyObject *__pyx_pw_8PyClical_17imag(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11766 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 ";
11767 static PyObject *__pyx_pw_8PyClical_17imag(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11768 PyObject *__pyx_r = 0;
11769 __Pyx_RefNannyDeclarations
11770 __Pyx_RefNannySetupContext(
"imag (wrapper)", 0);
11771 __pyx_r = __pyx_pf_8PyClical_16imag(__pyx_self, ((PyObject *)__pyx_v_obj));
11774 __Pyx_RefNannyFinishContext();
11778 static PyObject *__pyx_pf_8PyClical_16imag(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11779 PyObject *__pyx_r = NULL;
11780 __Pyx_RefNannyDeclarations
11781 PyObject *__pyx_t_1 = NULL;
11782 __Pyx_RefNannySetupContext(
"imag", 0);
11783 __Pyx_XDECREF(__pyx_r);
11784 __pyx_t_1 = __pyx_f_8PyClical_imag(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1365, __pyx_L1_error)
11785 __Pyx_GOTREF(__pyx_t_1);
11786 __pyx_r = __pyx_t_1;
11792 __Pyx_XDECREF(__pyx_t_1);
11793 __Pyx_AddTraceback(
"PyClical.imag", __pyx_clineno, __pyx_lineno, __pyx_filename);
11796 __Pyx_XGIVEREF(__pyx_r);
11797 __Pyx_RefNannyFinishContext();
11809 static PyObject *__pyx_pw_8PyClical_19pure(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11810 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_pure(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11811 PyObject *__pyx_r = NULL;
11812 __Pyx_RefNannyDeclarations
11813 PyObject *__pyx_t_1 = NULL;
11814 PyObject *__pyx_t_2 = NULL;
11815 PyObject *__pyx_t_3 = NULL;
11816 __Pyx_RefNannySetupContext(
"pure", 0);
11825 __Pyx_XDECREF(__pyx_r);
11826 __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)
11827 __Pyx_GOTREF(__pyx_t_2);
11828 __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)
11829 __Pyx_GOTREF(__pyx_t_3);
11830 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11832 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11833 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11834 if (likely(__pyx_t_2)) {
11835 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
11836 __Pyx_INCREF(__pyx_t_2);
11837 __Pyx_INCREF(
function);
11838 __Pyx_DECREF_SET(__pyx_t_3,
function);
11841 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
11842 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11843 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1385, __pyx_L1_error)
11844 __Pyx_GOTREF(__pyx_t_1);
11845 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11846 __pyx_r = __pyx_t_1;
11860 __Pyx_XDECREF(__pyx_t_1);
11861 __Pyx_XDECREF(__pyx_t_2);
11862 __Pyx_XDECREF(__pyx_t_3);
11863 __Pyx_AddTraceback(
"PyClical.pure", __pyx_clineno, __pyx_lineno, __pyx_filename);
11866 __Pyx_XGIVEREF(__pyx_r);
11867 __Pyx_RefNannyFinishContext();
11872 static PyObject *__pyx_pw_8PyClical_19pure(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11873 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 ";
11874 static PyObject *__pyx_pw_8PyClical_19pure(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11875 PyObject *__pyx_r = 0;
11876 __Pyx_RefNannyDeclarations
11877 __Pyx_RefNannySetupContext(
"pure (wrapper)", 0);
11878 __pyx_r = __pyx_pf_8PyClical_18pure(__pyx_self, ((PyObject *)__pyx_v_obj));
11881 __Pyx_RefNannyFinishContext();
11885 static PyObject *__pyx_pf_8PyClical_18pure(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11886 PyObject *__pyx_r = NULL;
11887 __Pyx_RefNannyDeclarations
11888 PyObject *__pyx_t_1 = NULL;
11889 __Pyx_RefNannySetupContext(
"pure", 0);
11890 __Pyx_XDECREF(__pyx_r);
11891 __pyx_t_1 = __pyx_f_8PyClical_pure(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1376, __pyx_L1_error)
11892 __Pyx_GOTREF(__pyx_t_1);
11893 __pyx_r = __pyx_t_1;
11899 __Pyx_XDECREF(__pyx_t_1);
11900 __Pyx_AddTraceback(
"PyClical.pure", __pyx_clineno, __pyx_lineno, __pyx_filename);
11903 __Pyx_XGIVEREF(__pyx_r);
11904 __Pyx_RefNannyFinishContext();
11916 static PyObject *__pyx_pw_8PyClical_21even(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11917 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_even(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
11918 PyObject *__pyx_r = NULL;
11919 __Pyx_RefNannyDeclarations
11920 PyObject *__pyx_t_1 = NULL;
11921 PyObject *__pyx_t_2 = NULL;
11922 PyObject *__pyx_t_3 = NULL;
11923 __Pyx_RefNannySetupContext(
"even", 0);
11932 __Pyx_XDECREF(__pyx_r);
11933 __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)
11934 __Pyx_GOTREF(__pyx_t_2);
11935 __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)
11936 __Pyx_GOTREF(__pyx_t_3);
11937 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11939 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11940 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11941 if (likely(__pyx_t_2)) {
11942 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
11943 __Pyx_INCREF(__pyx_t_2);
11944 __Pyx_INCREF(
function);
11945 __Pyx_DECREF_SET(__pyx_t_3,
function);
11948 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
11949 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11950 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1394, __pyx_L1_error)
11951 __Pyx_GOTREF(__pyx_t_1);
11952 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11953 __pyx_r = __pyx_t_1;
11967 __Pyx_XDECREF(__pyx_t_1);
11968 __Pyx_XDECREF(__pyx_t_2);
11969 __Pyx_XDECREF(__pyx_t_3);
11970 __Pyx_AddTraceback(
"PyClical.even", __pyx_clineno, __pyx_lineno, __pyx_filename);
11973 __Pyx_XGIVEREF(__pyx_r);
11974 __Pyx_RefNannyFinishContext();
11979 static PyObject *__pyx_pw_8PyClical_21even(PyObject *__pyx_self, PyObject *__pyx_v_obj);
11980 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 ";
11981 static PyObject *__pyx_pw_8PyClical_21even(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11982 PyObject *__pyx_r = 0;
11983 __Pyx_RefNannyDeclarations
11984 __Pyx_RefNannySetupContext(
"even (wrapper)", 0);
11985 __pyx_r = __pyx_pf_8PyClical_20even(__pyx_self, ((PyObject *)__pyx_v_obj));
11988 __Pyx_RefNannyFinishContext();
11992 static PyObject *__pyx_pf_8PyClical_20even(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
11993 PyObject *__pyx_r = NULL;
11994 __Pyx_RefNannyDeclarations
11995 PyObject *__pyx_t_1 = NULL;
11996 __Pyx_RefNannySetupContext(
"even", 0);
11997 __Pyx_XDECREF(__pyx_r);
11998 __pyx_t_1 = __pyx_f_8PyClical_even(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1387, __pyx_L1_error)
11999 __Pyx_GOTREF(__pyx_t_1);
12000 __pyx_r = __pyx_t_1;
12006 __Pyx_XDECREF(__pyx_t_1);
12007 __Pyx_AddTraceback(
"PyClical.even", __pyx_clineno, __pyx_lineno, __pyx_filename);
12010 __Pyx_XGIVEREF(__pyx_r);
12011 __Pyx_RefNannyFinishContext();
12023 static PyObject *__pyx_pw_8PyClical_23odd(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12024 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_odd(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12025 PyObject *__pyx_r = NULL;
12026 __Pyx_RefNannyDeclarations
12027 PyObject *__pyx_t_1 = NULL;
12028 PyObject *__pyx_t_2 = NULL;
12029 PyObject *__pyx_t_3 = NULL;
12030 __Pyx_RefNannySetupContext(
"odd", 0);
12039 __Pyx_XDECREF(__pyx_r);
12040 __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)
12041 __Pyx_GOTREF(__pyx_t_2);
12042 __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)
12043 __Pyx_GOTREF(__pyx_t_3);
12044 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12046 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
12047 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
12048 if (likely(__pyx_t_2)) {
12049 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
12050 __Pyx_INCREF(__pyx_t_2);
12051 __Pyx_INCREF(
function);
12052 __Pyx_DECREF_SET(__pyx_t_3,
function);
12055 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
12056 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12057 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1403, __pyx_L1_error)
12058 __Pyx_GOTREF(__pyx_t_1);
12059 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12060 __pyx_r = __pyx_t_1;
12074 __Pyx_XDECREF(__pyx_t_1);
12075 __Pyx_XDECREF(__pyx_t_2);
12076 __Pyx_XDECREF(__pyx_t_3);
12077 __Pyx_AddTraceback(
"PyClical.odd", __pyx_clineno, __pyx_lineno, __pyx_filename);
12080 __Pyx_XGIVEREF(__pyx_r);
12081 __Pyx_RefNannyFinishContext();
12086 static PyObject *__pyx_pw_8PyClical_23odd(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12087 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 ";
12088 static PyObject *__pyx_pw_8PyClical_23odd(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12089 PyObject *__pyx_r = 0;
12090 __Pyx_RefNannyDeclarations
12091 __Pyx_RefNannySetupContext(
"odd (wrapper)", 0);
12092 __pyx_r = __pyx_pf_8PyClical_22odd(__pyx_self, ((PyObject *)__pyx_v_obj));
12095 __Pyx_RefNannyFinishContext();
12099 static PyObject *__pyx_pf_8PyClical_22odd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12100 PyObject *__pyx_r = NULL;
12101 __Pyx_RefNannyDeclarations
12102 PyObject *__pyx_t_1 = NULL;
12103 __Pyx_RefNannySetupContext(
"odd", 0);
12104 __Pyx_XDECREF(__pyx_r);
12105 __pyx_t_1 = __pyx_f_8PyClical_odd(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1396, __pyx_L1_error)
12106 __Pyx_GOTREF(__pyx_t_1);
12107 __pyx_r = __pyx_t_1;
12113 __Pyx_XDECREF(__pyx_t_1);
12114 __Pyx_AddTraceback(
"PyClical.odd", __pyx_clineno, __pyx_lineno, __pyx_filename);
12117 __Pyx_XGIVEREF(__pyx_r);
12118 __Pyx_RefNannyFinishContext();
12130 static PyObject *__pyx_pw_8PyClical_25involute(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12131 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_involute(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12132 PyObject *__pyx_r = NULL;
12133 __Pyx_RefNannyDeclarations
12134 PyObject *__pyx_t_1 = NULL;
12135 PyObject *__pyx_t_2 = NULL;
12136 PyObject *__pyx_t_3 = NULL;
12137 __Pyx_RefNannySetupContext(
"involute", 0);
12146 __Pyx_XDECREF(__pyx_r);
12147 __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)
12148 __Pyx_GOTREF(__pyx_t_2);
12149 __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)
12150 __Pyx_GOTREF(__pyx_t_3);
12151 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12153 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
12154 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
12155 if (likely(__pyx_t_2)) {
12156 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
12157 __Pyx_INCREF(__pyx_t_2);
12158 __Pyx_INCREF(
function);
12159 __Pyx_DECREF_SET(__pyx_t_3,
function);
12162 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
12163 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12164 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1418, __pyx_L1_error)
12165 __Pyx_GOTREF(__pyx_t_1);
12166 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12167 __pyx_r = __pyx_t_1;
12181 __Pyx_XDECREF(__pyx_t_1);
12182 __Pyx_XDECREF(__pyx_t_2);
12183 __Pyx_XDECREF(__pyx_t_3);
12184 __Pyx_AddTraceback(
"PyClical.involute", __pyx_clineno, __pyx_lineno, __pyx_filename);
12187 __Pyx_XGIVEREF(__pyx_r);
12188 __Pyx_RefNannyFinishContext();
12193 static PyObject *__pyx_pw_8PyClical_25involute(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12194 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 ";
12195 static PyObject *__pyx_pw_8PyClical_25involute(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12196 PyObject *__pyx_r = 0;
12197 __Pyx_RefNannyDeclarations
12198 __Pyx_RefNannySetupContext(
"involute (wrapper)", 0);
12199 __pyx_r = __pyx_pf_8PyClical_24involute(__pyx_self, ((PyObject *)__pyx_v_obj));
12202 __Pyx_RefNannyFinishContext();
12206 static PyObject *__pyx_pf_8PyClical_24involute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12207 PyObject *__pyx_r = NULL;
12208 __Pyx_RefNannyDeclarations
12209 PyObject *__pyx_t_1 = NULL;
12210 __Pyx_RefNannySetupContext(
"involute", 0);
12211 __Pyx_XDECREF(__pyx_r);
12212 __pyx_t_1 = __pyx_f_8PyClical_involute(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1405, __pyx_L1_error)
12213 __Pyx_GOTREF(__pyx_t_1);
12214 __pyx_r = __pyx_t_1;
12220 __Pyx_XDECREF(__pyx_t_1);
12221 __Pyx_AddTraceback(
"PyClical.involute", __pyx_clineno, __pyx_lineno, __pyx_filename);
12224 __Pyx_XGIVEREF(__pyx_r);
12225 __Pyx_RefNannyFinishContext();
12237 static PyObject *__pyx_pw_8PyClical_27reverse(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12238 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_reverse(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12239 PyObject *__pyx_r = NULL;
12240 __Pyx_RefNannyDeclarations
12241 PyObject *__pyx_t_1 = NULL;
12242 PyObject *__pyx_t_2 = NULL;
12243 PyObject *__pyx_t_3 = NULL;
12244 __Pyx_RefNannySetupContext(
"reverse", 0);
12253 __Pyx_XDECREF(__pyx_r);
12254 __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)
12255 __Pyx_GOTREF(__pyx_t_2);
12256 __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)
12257 __Pyx_GOTREF(__pyx_t_3);
12258 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12260 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
12261 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
12262 if (likely(__pyx_t_2)) {
12263 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
12264 __Pyx_INCREF(__pyx_t_2);
12265 __Pyx_INCREF(
function);
12266 __Pyx_DECREF_SET(__pyx_t_3,
function);
12269 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
12270 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12271 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1433, __pyx_L1_error)
12272 __Pyx_GOTREF(__pyx_t_1);
12273 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12274 __pyx_r = __pyx_t_1;
12288 __Pyx_XDECREF(__pyx_t_1);
12289 __Pyx_XDECREF(__pyx_t_2);
12290 __Pyx_XDECREF(__pyx_t_3);
12291 __Pyx_AddTraceback(
"PyClical.reverse", __pyx_clineno, __pyx_lineno, __pyx_filename);
12294 __Pyx_XGIVEREF(__pyx_r);
12295 __Pyx_RefNannyFinishContext();
12300 static PyObject *__pyx_pw_8PyClical_27reverse(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12301 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 ";
12302 static PyObject *__pyx_pw_8PyClical_27reverse(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12303 PyObject *__pyx_r = 0;
12304 __Pyx_RefNannyDeclarations
12305 __Pyx_RefNannySetupContext(
"reverse (wrapper)", 0);
12306 __pyx_r = __pyx_pf_8PyClical_26reverse(__pyx_self, ((PyObject *)__pyx_v_obj));
12309 __Pyx_RefNannyFinishContext();
12313 static PyObject *__pyx_pf_8PyClical_26reverse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12314 PyObject *__pyx_r = NULL;
12315 __Pyx_RefNannyDeclarations
12316 PyObject *__pyx_t_1 = NULL;
12317 __Pyx_RefNannySetupContext(
"reverse", 0);
12318 __Pyx_XDECREF(__pyx_r);
12319 __pyx_t_1 = __pyx_f_8PyClical_reverse(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1420, __pyx_L1_error)
12320 __Pyx_GOTREF(__pyx_t_1);
12321 __pyx_r = __pyx_t_1;
12327 __Pyx_XDECREF(__pyx_t_1);
12328 __Pyx_AddTraceback(
"PyClical.reverse", __pyx_clineno, __pyx_lineno, __pyx_filename);
12331 __Pyx_XGIVEREF(__pyx_r);
12332 __Pyx_RefNannyFinishContext();
12344 static PyObject *__pyx_pw_8PyClical_29conj(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12345 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_conj(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12346 PyObject *__pyx_r = NULL;
12347 __Pyx_RefNannyDeclarations
12348 PyObject *__pyx_t_1 = NULL;
12349 PyObject *__pyx_t_2 = NULL;
12350 PyObject *__pyx_t_3 = NULL;
12351 __Pyx_RefNannySetupContext(
"conj", 0);
12360 __Pyx_XDECREF(__pyx_r);
12361 __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)
12362 __Pyx_GOTREF(__pyx_t_2);
12363 __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)
12364 __Pyx_GOTREF(__pyx_t_3);
12365 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12367 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
12368 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
12369 if (likely(__pyx_t_2)) {
12370 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
12371 __Pyx_INCREF(__pyx_t_2);
12372 __Pyx_INCREF(
function);
12373 __Pyx_DECREF_SET(__pyx_t_3,
function);
12376 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
12377 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12378 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1448, __pyx_L1_error)
12379 __Pyx_GOTREF(__pyx_t_1);
12380 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12381 __pyx_r = __pyx_t_1;
12395 __Pyx_XDECREF(__pyx_t_1);
12396 __Pyx_XDECREF(__pyx_t_2);
12397 __Pyx_XDECREF(__pyx_t_3);
12398 __Pyx_AddTraceback(
"PyClical.conj", __pyx_clineno, __pyx_lineno, __pyx_filename);
12401 __Pyx_XGIVEREF(__pyx_r);
12402 __Pyx_RefNannyFinishContext();
12407 static PyObject *__pyx_pw_8PyClical_29conj(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12408 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 ";
12409 static PyObject *__pyx_pw_8PyClical_29conj(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12410 PyObject *__pyx_r = 0;
12411 __Pyx_RefNannyDeclarations
12412 __Pyx_RefNannySetupContext(
"conj (wrapper)", 0);
12413 __pyx_r = __pyx_pf_8PyClical_28conj(__pyx_self, ((PyObject *)__pyx_v_obj));
12416 __Pyx_RefNannyFinishContext();
12420 static PyObject *__pyx_pf_8PyClical_28conj(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12421 PyObject *__pyx_r = NULL;
12422 __Pyx_RefNannyDeclarations
12423 PyObject *__pyx_t_1 = NULL;
12424 __Pyx_RefNannySetupContext(
"conj", 0);
12425 __Pyx_XDECREF(__pyx_r);
12426 __pyx_t_1 = __pyx_f_8PyClical_conj(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1435, __pyx_L1_error)
12427 __Pyx_GOTREF(__pyx_t_1);
12428 __pyx_r = __pyx_t_1;
12434 __Pyx_XDECREF(__pyx_t_1);
12435 __Pyx_AddTraceback(
"PyClical.conj", __pyx_clineno, __pyx_lineno, __pyx_filename);
12438 __Pyx_XGIVEREF(__pyx_r);
12439 __Pyx_RefNannyFinishContext();
12451 static PyObject *__pyx_pw_8PyClical_31quad(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12452 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_quad(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12453 PyObject *__pyx_r = NULL;
12454 __Pyx_RefNannyDeclarations
12455 PyObject *__pyx_t_1 = NULL;
12456 PyObject *__pyx_t_2 = NULL;
12457 PyObject *__pyx_t_3 = NULL;
12458 __Pyx_RefNannySetupContext(
"quad", 0);
12467 __Pyx_XDECREF(__pyx_r);
12468 __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)
12469 __Pyx_GOTREF(__pyx_t_2);
12470 __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)
12471 __Pyx_GOTREF(__pyx_t_3);
12472 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12474 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
12475 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
12476 if (likely(__pyx_t_2)) {
12477 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
12478 __Pyx_INCREF(__pyx_t_2);
12479 __Pyx_INCREF(
function);
12480 __Pyx_DECREF_SET(__pyx_t_3,
function);
12483 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
12484 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12485 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1459, __pyx_L1_error)
12486 __Pyx_GOTREF(__pyx_t_1);
12487 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12488 __pyx_r = __pyx_t_1;
12502 __Pyx_XDECREF(__pyx_t_1);
12503 __Pyx_XDECREF(__pyx_t_2);
12504 __Pyx_XDECREF(__pyx_t_3);
12505 __Pyx_AddTraceback(
"PyClical.quad", __pyx_clineno, __pyx_lineno, __pyx_filename);
12508 __Pyx_XGIVEREF(__pyx_r);
12509 __Pyx_RefNannyFinishContext();
12514 static PyObject *__pyx_pw_8PyClical_31quad(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12515 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 ";
12516 static PyObject *__pyx_pw_8PyClical_31quad(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12517 PyObject *__pyx_r = 0;
12518 __Pyx_RefNannyDeclarations
12519 __Pyx_RefNannySetupContext(
"quad (wrapper)", 0);
12520 __pyx_r = __pyx_pf_8PyClical_30quad(__pyx_self, ((PyObject *)__pyx_v_obj));
12523 __Pyx_RefNannyFinishContext();
12527 static PyObject *__pyx_pf_8PyClical_30quad(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12528 PyObject *__pyx_r = NULL;
12529 __Pyx_RefNannyDeclarations
12530 PyObject *__pyx_t_1 = NULL;
12531 __Pyx_RefNannySetupContext(
"quad", 0);
12532 __Pyx_XDECREF(__pyx_r);
12533 __pyx_t_1 = __pyx_f_8PyClical_quad(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1450, __pyx_L1_error)
12534 __Pyx_GOTREF(__pyx_t_1);
12535 __pyx_r = __pyx_t_1;
12541 __Pyx_XDECREF(__pyx_t_1);
12542 __Pyx_AddTraceback(
"PyClical.quad", __pyx_clineno, __pyx_lineno, __pyx_filename);
12545 __Pyx_XGIVEREF(__pyx_r);
12546 __Pyx_RefNannyFinishContext();
12558 static PyObject *__pyx_pw_8PyClical_33norm(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12559 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_norm(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12560 PyObject *__pyx_r = NULL;
12561 __Pyx_RefNannyDeclarations
12562 PyObject *__pyx_t_1 = NULL;
12563 PyObject *__pyx_t_2 = NULL;
12564 PyObject *__pyx_t_3 = NULL;
12565 __Pyx_RefNannySetupContext(
"norm", 0);
12574 __Pyx_XDECREF(__pyx_r);
12575 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8PyClical_clifford), __pyx_v_obj);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1470, __pyx_L1_error)
12576 __Pyx_GOTREF(__pyx_t_2);
12577 __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)
12578 __Pyx_GOTREF(__pyx_t_3);
12579 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12581 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
12582 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
12583 if (likely(__pyx_t_2)) {
12584 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
12585 __Pyx_INCREF(__pyx_t_2);
12586 __Pyx_INCREF(
function);
12587 __Pyx_DECREF_SET(__pyx_t_3,
function);
12590 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
12591 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12592 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1470, __pyx_L1_error)
12593 __Pyx_GOTREF(__pyx_t_1);
12594 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12595 __pyx_r = __pyx_t_1;
12609 __Pyx_XDECREF(__pyx_t_1);
12610 __Pyx_XDECREF(__pyx_t_2);
12611 __Pyx_XDECREF(__pyx_t_3);
12612 __Pyx_AddTraceback(
"PyClical.norm", __pyx_clineno, __pyx_lineno, __pyx_filename);
12615 __Pyx_XGIVEREF(__pyx_r);
12616 __Pyx_RefNannyFinishContext();
12621 static PyObject *__pyx_pw_8PyClical_33norm(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12622 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 ";
12623 static PyObject *__pyx_pw_8PyClical_33norm(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12624 PyObject *__pyx_r = 0;
12625 __Pyx_RefNannyDeclarations
12626 __Pyx_RefNannySetupContext(
"norm (wrapper)", 0);
12627 __pyx_r = __pyx_pf_8PyClical_32norm(__pyx_self, ((PyObject *)__pyx_v_obj));
12630 __Pyx_RefNannyFinishContext();
12634 static PyObject *__pyx_pf_8PyClical_32norm(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12635 PyObject *__pyx_r = NULL;
12636 __Pyx_RefNannyDeclarations
12637 PyObject *__pyx_t_1 = NULL;
12638 __Pyx_RefNannySetupContext(
"norm", 0);
12639 __Pyx_XDECREF(__pyx_r);
12640 __pyx_t_1 = __pyx_f_8PyClical_norm(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1461, __pyx_L1_error)
12641 __Pyx_GOTREF(__pyx_t_1);
12642 __pyx_r = __pyx_t_1;
12648 __Pyx_XDECREF(__pyx_t_1);
12649 __Pyx_AddTraceback(
"PyClical.norm", __pyx_clineno, __pyx_lineno, __pyx_filename);
12652 __Pyx_XGIVEREF(__pyx_r);
12653 __Pyx_RefNannyFinishContext();
12665 static PyObject *__pyx_pw_8PyClical_35abs(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12666 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_abs(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12667 PyObject *__pyx_r = NULL;
12668 __Pyx_RefNannyDeclarations
12669 PyObject *__pyx_t_1 = NULL;
12670 __Pyx_RefNannySetupContext(
"abs", 0);
12679 __Pyx_XDECREF(__pyx_r);
12680 __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)
12681 __Pyx_GOTREF(__pyx_t_1);
12682 __pyx_r = __pyx_t_1;
12696 __Pyx_XDECREF(__pyx_t_1);
12697 __Pyx_AddTraceback(
"PyClical.abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
12700 __Pyx_XGIVEREF(__pyx_r);
12701 __Pyx_RefNannyFinishContext();
12706 static PyObject *__pyx_pw_8PyClical_35abs(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12707 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 ";
12708 static PyObject *__pyx_pw_8PyClical_35abs(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12709 PyObject *__pyx_r = 0;
12710 __Pyx_RefNannyDeclarations
12711 __Pyx_RefNannySetupContext(
"abs (wrapper)", 0);
12712 __pyx_r = __pyx_pf_8PyClical_34abs(__pyx_self, ((PyObject *)__pyx_v_obj));
12715 __Pyx_RefNannyFinishContext();
12719 static PyObject *__pyx_pf_8PyClical_34abs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12720 PyObject *__pyx_r = NULL;
12721 __Pyx_RefNannyDeclarations
12722 PyObject *__pyx_t_1 = NULL;
12723 __Pyx_RefNannySetupContext(
"abs", 0);
12724 __Pyx_XDECREF(__pyx_r);
12725 __pyx_t_1 = __pyx_f_8PyClical_abs(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1472, __pyx_L1_error)
12726 __Pyx_GOTREF(__pyx_t_1);
12727 __pyx_r = __pyx_t_1;
12733 __Pyx_XDECREF(__pyx_t_1);
12734 __Pyx_AddTraceback(
"PyClical.abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
12737 __Pyx_XGIVEREF(__pyx_r);
12738 __Pyx_RefNannyFinishContext();
12750 static PyObject *__pyx_pw_8PyClical_37max_abs(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12751 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_max_abs(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12752 PyObject *__pyx_r = NULL;
12753 __Pyx_RefNannyDeclarations
12754 PyObject *__pyx_t_1 = NULL;
12755 __Pyx_RefNannySetupContext(
"max_abs", 0);
12764 __Pyx_XDECREF(__pyx_r);
12765 __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)
12766 __Pyx_GOTREF(__pyx_t_1);
12767 __pyx_r = __pyx_t_1;
12781 __Pyx_XDECREF(__pyx_t_1);
12782 __Pyx_AddTraceback(
"PyClical.max_abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
12785 __Pyx_XGIVEREF(__pyx_r);
12786 __Pyx_RefNannyFinishContext();
12791 static PyObject *__pyx_pw_8PyClical_37max_abs(PyObject *__pyx_self, PyObject *__pyx_v_obj);
12792 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 ";
12793 static PyObject *__pyx_pw_8PyClical_37max_abs(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12794 PyObject *__pyx_r = 0;
12795 __Pyx_RefNannyDeclarations
12796 __Pyx_RefNannySetupContext(
"max_abs (wrapper)", 0);
12797 __pyx_r = __pyx_pf_8PyClical_36max_abs(__pyx_self, ((PyObject *)__pyx_v_obj));
12800 __Pyx_RefNannyFinishContext();
12804 static PyObject *__pyx_pf_8PyClical_36max_abs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
12805 PyObject *__pyx_r = NULL;
12806 __Pyx_RefNannyDeclarations
12807 PyObject *__pyx_t_1 = NULL;
12808 __Pyx_RefNannySetupContext(
"max_abs", 0);
12809 __Pyx_XDECREF(__pyx_r);
12810 __pyx_t_1 = __pyx_f_8PyClical_max_abs(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1481, __pyx_L1_error)
12811 __Pyx_GOTREF(__pyx_t_1);
12812 __pyx_r = __pyx_t_1;
12818 __Pyx_XDECREF(__pyx_t_1);
12819 __Pyx_AddTraceback(
"PyClical.max_abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
12822 __Pyx_XGIVEREF(__pyx_r);
12823 __Pyx_RefNannyFinishContext();
12835 static PyObject *__pyx_pw_8PyClical_39pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
12836 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_pow(PyObject *__pyx_v_obj, PyObject *__pyx_v_m, CYTHON_UNUSED
int __pyx_skip_dispatch) {
12837 PyObject *__pyx_r = NULL;
12838 __Pyx_RefNannyDeclarations
12839 PyObject *__pyx_t_1 = NULL;
12840 PyObject *__pyx_t_2 = NULL;
12841 PyObject *__pyx_t_3 = NULL;
12842 PyObject *__pyx_t_4 = NULL;
12843 PyObject *__pyx_t_5 = NULL;
12844 PyObject *__pyx_t_6 = NULL;
12846 PyObject *__pyx_t_8 = NULL;
12847 PyObject *__pyx_t_9 = NULL;
12848 PyObject *__pyx_t_10 = NULL;
12849 __Pyx_RefNannySetupContext(
"pow", 0);
12859 __Pyx_PyThreadState_declare
12860 __Pyx_PyThreadState_assign
12861 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
12862 __Pyx_XGOTREF(__pyx_t_1);
12863 __Pyx_XGOTREF(__pyx_t_2);
12864 __Pyx_XGOTREF(__pyx_t_3);
12874 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1513, __pyx_L3_error)
12875 __Pyx_GOTREF(__pyx_t_5);
12876 __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)
12877 __Pyx_GOTREF(__pyx_t_6);
12878 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12881 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
12882 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
12883 if (likely(__pyx_t_5)) {
12884 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
12885 __Pyx_INCREF(__pyx_t_5);
12886 __Pyx_INCREF(
function);
12887 __Pyx_DECREF_SET(__pyx_t_6,
function);
12891 #if CYTHON_FAST_PYCALL
12892 if (PyFunction_Check(__pyx_t_6)) {
12893 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_obj, __pyx_v_m};
12894 __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)
12895 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12896 __Pyx_GOTREF(__pyx_t_4);
12899 #if CYTHON_FAST_PYCCALL
12900 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
12901 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_obj, __pyx_v_m};
12902 __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)
12903 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12904 __Pyx_GOTREF(__pyx_t_4);
12908 __pyx_t_8 = PyTuple_New(2+__pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1513, __pyx_L3_error)
12909 __Pyx_GOTREF(__pyx_t_8);
12911 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
12913 __Pyx_INCREF(__pyx_v_obj);
12914 __Pyx_GIVEREF(__pyx_v_obj);
12915 PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_obj);
12916 __Pyx_INCREF(__pyx_v_m);
12917 __Pyx_GIVEREF(__pyx_v_m);
12918 PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_m);
12919 __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)
12920 __Pyx_GOTREF(__pyx_t_4);
12921 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12923 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12924 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12934 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12935 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12936 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12937 goto __pyx_L8_try_end;
12939 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12940 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12941 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12942 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
12952 __Pyx_AddTraceback(
"PyClical.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
12953 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_8) < 0) __PYX_ERR(0, 1514, __pyx_L5_except_error)
12954 __Pyx_GOTREF(__pyx_t_4);
12955 __Pyx_GOTREF(__pyx_t_6);
12956 __Pyx_GOTREF(__pyx_t_8);
12965 __Pyx_XDECREF(__pyx_r);
12966 __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)
12967 __Pyx_GOTREF(__pyx_t_9);
12968 __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)
12969 __Pyx_GOTREF(__pyx_t_10);
12970 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12972 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
12973 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
12974 if (likely(__pyx_t_9)) {
12975 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_10);
12976 __Pyx_INCREF(__pyx_t_9);
12977 __Pyx_INCREF(
function);
12978 __Pyx_DECREF_SET(__pyx_t_10,
function);
12981 __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);
12982 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
12983 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1515, __pyx_L5_except_error)
12984 __Pyx_GOTREF(__pyx_t_5);
12985 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12986 __pyx_r = __pyx_t_5;
12988 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12989 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12990 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12991 goto __pyx_L6_except_return;
12993 __pyx_L5_except_error:;
13002 __Pyx_XGIVEREF(__pyx_t_1);
13003 __Pyx_XGIVEREF(__pyx_t_2);
13004 __Pyx_XGIVEREF(__pyx_t_3);
13005 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
13006 goto __pyx_L1_error;
13007 __pyx_L6_except_return:;
13008 __Pyx_XGIVEREF(__pyx_t_1);
13009 __Pyx_XGIVEREF(__pyx_t_2);
13010 __Pyx_XGIVEREF(__pyx_t_3);
13011 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
13025 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13028 __Pyx_XDECREF(__pyx_t_4);
13029 __Pyx_XDECREF(__pyx_t_5);
13030 __Pyx_XDECREF(__pyx_t_6);
13031 __Pyx_XDECREF(__pyx_t_8);
13032 __Pyx_XDECREF(__pyx_t_9);
13033 __Pyx_XDECREF(__pyx_t_10);
13034 __Pyx_AddTraceback(
"PyClical.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
13037 __Pyx_XGIVEREF(__pyx_r);
13038 __Pyx_RefNannyFinishContext();
13043 static PyObject *__pyx_pw_8PyClical_39pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13044 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 ";
13045 static PyObject *__pyx_pw_8PyClical_39pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13046 PyObject *__pyx_v_obj = 0;
13047 PyObject *__pyx_v_m = 0;
13048 PyObject *__pyx_r = 0;
13049 __Pyx_RefNannyDeclarations
13050 __Pyx_RefNannySetupContext(
"pow (wrapper)", 0);
13052 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_m,0};
13053 PyObject* values[2] = {0,0};
13054 if (unlikely(__pyx_kwds)) {
13055 Py_ssize_t kw_args;
13056 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13057 switch (pos_args) {
13058 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13059 CYTHON_FALLTHROUGH;
13060 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13061 CYTHON_FALLTHROUGH;
13063 default:
goto __pyx_L5_argtuple_error;
13065 kw_args = PyDict_Size(__pyx_kwds);
13066 switch (pos_args) {
13068 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
13069 else goto __pyx_L5_argtuple_error;
13070 CYTHON_FALLTHROUGH;
13072 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
13074 __Pyx_RaiseArgtupleInvalid(
"pow", 1, 2, 2, 1); __PYX_ERR(0, 1493, __pyx_L3_error)
13077 if (unlikely(kw_args > 0)) {
13078 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"pow") < 0)) __PYX_ERR(0, 1493, __pyx_L3_error)
13080 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
13081 goto __pyx_L5_argtuple_error;
13083 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13084 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13086 __pyx_v_obj = values[0];
13087 __pyx_v_m = values[1];
13089 goto __pyx_L4_argument_unpacking_done;
13090 __pyx_L5_argtuple_error:;
13091 __Pyx_RaiseArgtupleInvalid(
"pow", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1493, __pyx_L3_error)
13093 __Pyx_AddTraceback(
"PyClical.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
13094 __Pyx_RefNannyFinishContext();
13096 __pyx_L4_argument_unpacking_done:;
13097 __pyx_r = __pyx_pf_8PyClical_38pow(__pyx_self, __pyx_v_obj, __pyx_v_m);
13100 __Pyx_RefNannyFinishContext();
13104 static PyObject *__pyx_pf_8PyClical_38pow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_m) {
13105 PyObject *__pyx_r = NULL;
13106 __Pyx_RefNannyDeclarations
13107 PyObject *__pyx_t_1 = NULL;
13108 __Pyx_RefNannySetupContext(
"pow", 0);
13109 __Pyx_XDECREF(__pyx_r);
13110 __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)
13111 __Pyx_GOTREF(__pyx_t_1);
13112 __pyx_r = __pyx_t_1;
13118 __Pyx_XDECREF(__pyx_t_1);
13119 __Pyx_AddTraceback(
"PyClical.pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
13122 __Pyx_XGIVEREF(__pyx_r);
13123 __Pyx_RefNannyFinishContext();
13135 static PyObject *__pyx_pw_8PyClical_41outer_pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13136 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_outer_pow(PyObject *__pyx_v_obj, PyObject *__pyx_v_m, CYTHON_UNUSED
int __pyx_skip_dispatch) {
13137 PyObject *__pyx_r = NULL;
13138 __Pyx_RefNannyDeclarations
13139 PyObject *__pyx_t_1 = NULL;
13140 PyObject *__pyx_t_2 = NULL;
13141 PyObject *__pyx_t_3 = NULL;
13142 __Pyx_RefNannySetupContext(
"outer_pow", 0);
13151 __Pyx_XDECREF(__pyx_r);
13152 __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)
13153 __Pyx_GOTREF(__pyx_t_2);
13154 __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)
13155 __Pyx_GOTREF(__pyx_t_3);
13156 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13158 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
13159 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
13160 if (likely(__pyx_t_2)) {
13161 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
13162 __Pyx_INCREF(__pyx_t_2);
13163 __Pyx_INCREF(
function);
13164 __Pyx_DECREF_SET(__pyx_t_3,
function);
13167 __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);
13168 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
13169 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1524, __pyx_L1_error)
13170 __Pyx_GOTREF(__pyx_t_1);
13171 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13172 __pyx_r = __pyx_t_1;
13186 __Pyx_XDECREF(__pyx_t_1);
13187 __Pyx_XDECREF(__pyx_t_2);
13188 __Pyx_XDECREF(__pyx_t_3);
13189 __Pyx_AddTraceback(
"PyClical.outer_pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
13192 __Pyx_XGIVEREF(__pyx_r);
13193 __Pyx_RefNannyFinishContext();
13198 static PyObject *__pyx_pw_8PyClical_41outer_pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13199 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 ";
13200 static PyObject *__pyx_pw_8PyClical_41outer_pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13201 PyObject *__pyx_v_obj = 0;
13202 PyObject *__pyx_v_m = 0;
13203 PyObject *__pyx_r = 0;
13204 __Pyx_RefNannyDeclarations
13205 __Pyx_RefNannySetupContext(
"outer_pow (wrapper)", 0);
13207 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_m,0};
13208 PyObject* values[2] = {0,0};
13209 if (unlikely(__pyx_kwds)) {
13210 Py_ssize_t kw_args;
13211 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13212 switch (pos_args) {
13213 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13214 CYTHON_FALLTHROUGH;
13215 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13216 CYTHON_FALLTHROUGH;
13218 default:
goto __pyx_L5_argtuple_error;
13220 kw_args = PyDict_Size(__pyx_kwds);
13221 switch (pos_args) {
13223 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
13224 else goto __pyx_L5_argtuple_error;
13225 CYTHON_FALLTHROUGH;
13227 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
13229 __Pyx_RaiseArgtupleInvalid(
"outer_pow", 1, 2, 2, 1); __PYX_ERR(0, 1517, __pyx_L3_error)
13232 if (unlikely(kw_args > 0)) {
13233 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"outer_pow") < 0)) __PYX_ERR(0, 1517, __pyx_L3_error)
13235 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
13236 goto __pyx_L5_argtuple_error;
13238 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13239 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13241 __pyx_v_obj = values[0];
13242 __pyx_v_m = values[1];
13244 goto __pyx_L4_argument_unpacking_done;
13245 __pyx_L5_argtuple_error:;
13246 __Pyx_RaiseArgtupleInvalid(
"outer_pow", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1517, __pyx_L3_error)
13248 __Pyx_AddTraceback(
"PyClical.outer_pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
13249 __Pyx_RefNannyFinishContext();
13251 __pyx_L4_argument_unpacking_done:;
13252 __pyx_r = __pyx_pf_8PyClical_40outer_pow(__pyx_self, __pyx_v_obj, __pyx_v_m);
13255 __Pyx_RefNannyFinishContext();
13259 static PyObject *__pyx_pf_8PyClical_40outer_pow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_m) {
13260 PyObject *__pyx_r = NULL;
13261 __Pyx_RefNannyDeclarations
13262 PyObject *__pyx_t_1 = NULL;
13263 __Pyx_RefNannySetupContext(
"outer_pow", 0);
13264 __Pyx_XDECREF(__pyx_r);
13265 __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)
13266 __Pyx_GOTREF(__pyx_t_1);
13267 __pyx_r = __pyx_t_1;
13273 __Pyx_XDECREF(__pyx_t_1);
13274 __Pyx_AddTraceback(
"PyClical.outer_pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
13277 __Pyx_XGIVEREF(__pyx_r);
13278 __Pyx_RefNannyFinishContext();
13290 static PyObject *__pyx_pw_8PyClical_43complexifier(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13291 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_complexifier(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
13292 PyObject *__pyx_r = NULL;
13293 __Pyx_RefNannyDeclarations
13294 PyObject *__pyx_t_1 = NULL;
13295 PyObject *__pyx_t_2 = NULL;
13296 __Pyx_RefNannySetupContext(
"complexifier", 0);
13305 __Pyx_XDECREF(__pyx_r);
13306 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1539, __pyx_L1_error)
13307 __Pyx_GOTREF(__pyx_t_1);
13308 __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)
13309 __Pyx_GOTREF(__pyx_t_2);
13310 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13311 __pyx_r = __pyx_t_2;
13325 __Pyx_XDECREF(__pyx_t_1);
13326 __Pyx_XDECREF(__pyx_t_2);
13327 __Pyx_AddTraceback(
"PyClical.complexifier", __pyx_clineno, __pyx_lineno, __pyx_filename);
13330 __Pyx_XGIVEREF(__pyx_r);
13331 __Pyx_RefNannyFinishContext();
13336 static PyObject *__pyx_pw_8PyClical_43complexifier(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13337 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 ";
13338 static PyObject *__pyx_pw_8PyClical_43complexifier(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13339 PyObject *__pyx_r = 0;
13340 __Pyx_RefNannyDeclarations
13341 __Pyx_RefNannySetupContext(
"complexifier (wrapper)", 0);
13342 __pyx_r = __pyx_pf_8PyClical_42complexifier(__pyx_self, ((PyObject *)__pyx_v_obj));
13345 __Pyx_RefNannyFinishContext();
13349 static PyObject *__pyx_pf_8PyClical_42complexifier(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13350 PyObject *__pyx_r = NULL;
13351 __Pyx_RefNannyDeclarations
13352 PyObject *__pyx_t_1 = NULL;
13353 __Pyx_RefNannySetupContext(
"complexifier", 0);
13354 __Pyx_XDECREF(__pyx_r);
13355 __pyx_t_1 = __pyx_f_8PyClical_complexifier(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1526, __pyx_L1_error)
13356 __Pyx_GOTREF(__pyx_t_1);
13357 __pyx_r = __pyx_t_1;
13363 __Pyx_XDECREF(__pyx_t_1);
13364 __Pyx_AddTraceback(
"PyClical.complexifier", __pyx_clineno, __pyx_lineno, __pyx_filename);
13367 __Pyx_XGIVEREF(__pyx_r);
13368 __Pyx_RefNannyFinishContext();
13380 static PyObject *__pyx_pw_8PyClical_45sqrt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13381 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) {
13382 PyObject *__pyx_v_i = ((PyObject *)Py_None);
13383 PyObject *__pyx_r = NULL;
13384 __Pyx_RefNannyDeclarations
13387 PyObject *__pyx_t_3 = NULL;
13389 PyObject *__pyx_t_5 = NULL;
13390 PyObject *__pyx_t_6 = NULL;
13391 PyObject *__pyx_t_7 = NULL;
13392 PyObject *__pyx_t_8 = NULL;
13393 PyObject *__pyx_t_9 = NULL;
13394 PyObject *__pyx_t_10 = NULL;
13395 PyObject *__pyx_t_11 = NULL;
13396 __Pyx_RefNannySetupContext(
"sqrt", 0);
13397 if (__pyx_optional_args) {
13398 if (__pyx_optional_args->__pyx_n > 0) {
13399 __pyx_v_i = __pyx_optional_args->i;
13410 __pyx_t_1 = (__pyx_v_i != Py_None);
13411 __pyx_t_2 = (__pyx_t_1 != 0);
13421 __Pyx_XDECREF(__pyx_r);
13422 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1557, __pyx_L1_error)
13423 __Pyx_GOTREF(__pyx_t_3);
13425 __pyx_t_4 =
sqrt(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
13427 __Pyx_CppExn2PyErr();
13428 __PYX_ERR(0, 1557, __pyx_L1_error)
13430 __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)
13431 __Pyx_GOTREF(__pyx_t_5);
13432 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13433 __pyx_r = __pyx_t_5;
13455 __Pyx_PyThreadState_declare
13456 __Pyx_PyThreadState_assign
13457 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
13458 __Pyx_XGOTREF(__pyx_t_6);
13459 __Pyx_XGOTREF(__pyx_t_7);
13460 __Pyx_XGOTREF(__pyx_t_8);
13470 __Pyx_XDECREF(__pyx_r);
13471 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1560, __pyx_L4_error)
13472 __Pyx_GOTREF(__pyx_t_3);
13473 __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)
13474 __Pyx_GOTREF(__pyx_t_9);
13475 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13477 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
13478 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
13479 if (likely(__pyx_t_3)) {
13480 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
13481 __Pyx_INCREF(__pyx_t_3);
13482 __Pyx_INCREF(
function);
13483 __Pyx_DECREF_SET(__pyx_t_9,
function);
13486 __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);
13487 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13488 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1560, __pyx_L4_error)
13489 __Pyx_GOTREF(__pyx_t_5);
13490 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13491 __pyx_r = __pyx_t_5;
13493 goto __pyx_L8_try_return;
13504 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13505 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13506 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
13516 __Pyx_AddTraceback(
"PyClical.sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename);
13517 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1561, __pyx_L6_except_error)
13518 __Pyx_GOTREF(__pyx_t_5);
13519 __Pyx_GOTREF(__pyx_t_9);
13520 __Pyx_GOTREF(__pyx_t_3);
13529 __Pyx_XDECREF(__pyx_r);
13530 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1562, __pyx_L6_except_error)
13531 __Pyx_GOTREF(__pyx_t_10);
13532 __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)
13533 __Pyx_GOTREF(__pyx_t_11);
13534 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13535 __pyx_r = __pyx_t_11;
13537 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13538 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13539 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13540 goto __pyx_L7_except_return;
13542 __pyx_L6_except_error:;
13551 __Pyx_XGIVEREF(__pyx_t_6);
13552 __Pyx_XGIVEREF(__pyx_t_7);
13553 __Pyx_XGIVEREF(__pyx_t_8);
13554 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
13555 goto __pyx_L1_error;
13556 __pyx_L8_try_return:;
13557 __Pyx_XGIVEREF(__pyx_t_6);
13558 __Pyx_XGIVEREF(__pyx_t_7);
13559 __Pyx_XGIVEREF(__pyx_t_8);
13560 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
13562 __pyx_L7_except_return:;
13563 __Pyx_XGIVEREF(__pyx_t_6);
13564 __Pyx_XGIVEREF(__pyx_t_7);
13565 __Pyx_XGIVEREF(__pyx_t_8);
13566 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
13581 __Pyx_XDECREF(__pyx_t_3);
13582 __Pyx_XDECREF(__pyx_t_5);
13583 __Pyx_XDECREF(__pyx_t_9);
13584 __Pyx_XDECREF(__pyx_t_10);
13585 __Pyx_XDECREF(__pyx_t_11);
13586 __Pyx_AddTraceback(
"PyClical.sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename);
13589 __Pyx_XGIVEREF(__pyx_r);
13590 __Pyx_RefNannyFinishContext();
13595 static PyObject *__pyx_pw_8PyClical_45sqrt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13596 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 ";
13597 static PyObject *__pyx_pw_8PyClical_45sqrt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13598 PyObject *__pyx_v_obj = 0;
13599 PyObject *__pyx_v_i = 0;
13600 PyObject *__pyx_r = 0;
13601 __Pyx_RefNannyDeclarations
13602 __Pyx_RefNannySetupContext(
"sqrt (wrapper)", 0);
13604 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
13605 PyObject* values[2] = {0,0};
13606 values[1] = ((PyObject *)Py_None);
13607 if (unlikely(__pyx_kwds)) {
13608 Py_ssize_t kw_args;
13609 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13610 switch (pos_args) {
13611 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13612 CYTHON_FALLTHROUGH;
13613 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13614 CYTHON_FALLTHROUGH;
13616 default:
goto __pyx_L5_argtuple_error;
13618 kw_args = PyDict_Size(__pyx_kwds);
13619 switch (pos_args) {
13621 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
13622 else goto __pyx_L5_argtuple_error;
13623 CYTHON_FALLTHROUGH;
13626 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
13627 if (value) { values[1] = value; kw_args--; }
13630 if (unlikely(kw_args > 0)) {
13631 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"sqrt") < 0)) __PYX_ERR(0, 1541, __pyx_L3_error)
13634 switch (PyTuple_GET_SIZE(__pyx_args)) {
13635 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13636 CYTHON_FALLTHROUGH;
13637 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13639 default:
goto __pyx_L5_argtuple_error;
13642 __pyx_v_obj = values[0];
13643 __pyx_v_i = values[1];
13645 goto __pyx_L4_argument_unpacking_done;
13646 __pyx_L5_argtuple_error:;
13647 __Pyx_RaiseArgtupleInvalid(
"sqrt", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1541, __pyx_L3_error)
13649 __Pyx_AddTraceback(
"PyClical.sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename);
13650 __Pyx_RefNannyFinishContext();
13652 __pyx_L4_argument_unpacking_done:;
13653 __pyx_r = __pyx_pf_8PyClical_44sqrt(__pyx_self, __pyx_v_obj, __pyx_v_i);
13656 __Pyx_RefNannyFinishContext();
13660 static PyObject *__pyx_pf_8PyClical_44sqrt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
13661 PyObject *__pyx_r = NULL;
13662 __Pyx_RefNannyDeclarations
13663 PyObject *__pyx_t_1 = NULL;
13664 struct __pyx_opt_args_8PyClical_sqrt __pyx_t_2;
13665 __Pyx_RefNannySetupContext(
"sqrt", 0);
13666 __Pyx_XDECREF(__pyx_r);
13667 __pyx_t_2.__pyx_n = 1;
13668 __pyx_t_2.i = __pyx_v_i;
13669 __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)
13670 __Pyx_GOTREF(__pyx_t_1);
13671 __pyx_r = __pyx_t_1;
13677 __Pyx_XDECREF(__pyx_t_1);
13678 __Pyx_AddTraceback(
"PyClical.sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename);
13681 __Pyx_XGIVEREF(__pyx_r);
13682 __Pyx_RefNannyFinishContext();
13694 static PyObject *__pyx_pw_8PyClical_47exp(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13695 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_exp(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
13696 PyObject *__pyx_r = NULL;
13697 __Pyx_RefNannyDeclarations
13698 PyObject *__pyx_t_1 = NULL;
13699 PyObject *__pyx_t_2 = NULL;
13700 PyObject *__pyx_t_3 = NULL;
13701 PyObject *__pyx_t_4 = NULL;
13702 PyObject *__pyx_t_5 = NULL;
13703 PyObject *__pyx_t_6 = NULL;
13704 PyObject *__pyx_t_7 = NULL;
13705 PyObject *__pyx_t_8 = NULL;
13706 __Pyx_RefNannySetupContext(
"exp", 0);
13716 __Pyx_PyThreadState_declare
13717 __Pyx_PyThreadState_assign
13718 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
13719 __Pyx_XGOTREF(__pyx_t_1);
13720 __Pyx_XGOTREF(__pyx_t_2);
13721 __Pyx_XGOTREF(__pyx_t_3);
13731 __Pyx_XDECREF(__pyx_r);
13732 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1574, __pyx_L3_error)
13733 __Pyx_GOTREF(__pyx_t_5);
13734 __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)
13735 __Pyx_GOTREF(__pyx_t_6);
13736 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13738 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
13739 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
13740 if (likely(__pyx_t_5)) {
13741 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
13742 __Pyx_INCREF(__pyx_t_5);
13743 __Pyx_INCREF(
function);
13744 __Pyx_DECREF_SET(__pyx_t_6,
function);
13747 __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);
13748 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13749 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1574, __pyx_L3_error)
13750 __Pyx_GOTREF(__pyx_t_4);
13751 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13752 __pyx_r = __pyx_t_4;
13754 goto __pyx_L7_try_return;
13765 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
13766 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13767 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
13777 __Pyx_AddTraceback(
"PyClical.exp", __pyx_clineno, __pyx_lineno, __pyx_filename);
13778 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(0, 1575, __pyx_L5_except_error)
13779 __Pyx_GOTREF(__pyx_t_4);
13780 __Pyx_GOTREF(__pyx_t_6);
13781 __Pyx_GOTREF(__pyx_t_5);
13790 __Pyx_XDECREF(__pyx_r);
13791 __pyx_t_7 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1576, __pyx_L5_except_error)
13792 __Pyx_GOTREF(__pyx_t_7);
13793 __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)
13794 __Pyx_GOTREF(__pyx_t_8);
13795 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13796 __pyx_r = __pyx_t_8;
13798 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13799 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13800 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13801 goto __pyx_L6_except_return;
13803 __pyx_L5_except_error:;
13812 __Pyx_XGIVEREF(__pyx_t_1);
13813 __Pyx_XGIVEREF(__pyx_t_2);
13814 __Pyx_XGIVEREF(__pyx_t_3);
13815 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
13816 goto __pyx_L1_error;
13817 __pyx_L7_try_return:;
13818 __Pyx_XGIVEREF(__pyx_t_1);
13819 __Pyx_XGIVEREF(__pyx_t_2);
13820 __Pyx_XGIVEREF(__pyx_t_3);
13821 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
13823 __pyx_L6_except_return:;
13824 __Pyx_XGIVEREF(__pyx_t_1);
13825 __Pyx_XGIVEREF(__pyx_t_2);
13826 __Pyx_XGIVEREF(__pyx_t_3);
13827 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
13841 __Pyx_XDECREF(__pyx_t_4);
13842 __Pyx_XDECREF(__pyx_t_5);
13843 __Pyx_XDECREF(__pyx_t_6);
13844 __Pyx_XDECREF(__pyx_t_7);
13845 __Pyx_XDECREF(__pyx_t_8);
13846 __Pyx_AddTraceback(
"PyClical.exp", __pyx_clineno, __pyx_lineno, __pyx_filename);
13849 __Pyx_XGIVEREF(__pyx_r);
13850 __Pyx_RefNannyFinishContext();
13855 static PyObject *__pyx_pw_8PyClical_47exp(PyObject *__pyx_self, PyObject *__pyx_v_obj);
13856 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 ";
13857 static PyObject *__pyx_pw_8PyClical_47exp(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13858 PyObject *__pyx_r = 0;
13859 __Pyx_RefNannyDeclarations
13860 __Pyx_RefNannySetupContext(
"exp (wrapper)", 0);
13861 __pyx_r = __pyx_pf_8PyClical_46exp(__pyx_self, ((PyObject *)__pyx_v_obj));
13864 __Pyx_RefNannyFinishContext();
13868 static PyObject *__pyx_pf_8PyClical_46exp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
13869 PyObject *__pyx_r = NULL;
13870 __Pyx_RefNannyDeclarations
13871 PyObject *__pyx_t_1 = NULL;
13872 __Pyx_RefNannySetupContext(
"exp", 0);
13873 __Pyx_XDECREF(__pyx_r);
13874 __pyx_t_1 = __pyx_f_8PyClical_exp(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1564, __pyx_L1_error)
13875 __Pyx_GOTREF(__pyx_t_1);
13876 __pyx_r = __pyx_t_1;
13882 __Pyx_XDECREF(__pyx_t_1);
13883 __Pyx_AddTraceback(
"PyClical.exp", __pyx_clineno, __pyx_lineno, __pyx_filename);
13886 __Pyx_XGIVEREF(__pyx_r);
13887 __Pyx_RefNannyFinishContext();
13899 static PyObject *__pyx_pw_8PyClical_49log(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13900 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) {
13901 PyObject *__pyx_v_i = ((PyObject *)Py_None);
13902 PyObject *__pyx_r = NULL;
13903 __Pyx_RefNannyDeclarations
13906 PyObject *__pyx_t_3 = NULL;
13908 PyObject *__pyx_t_5 = NULL;
13909 PyObject *__pyx_t_6 = NULL;
13910 PyObject *__pyx_t_7 = NULL;
13911 PyObject *__pyx_t_8 = NULL;
13912 PyObject *__pyx_t_9 = NULL;
13913 PyObject *__pyx_t_10 = NULL;
13914 PyObject *__pyx_t_11 = NULL;
13915 __Pyx_RefNannySetupContext(
"log", 0);
13916 if (__pyx_optional_args) {
13917 if (__pyx_optional_args->__pyx_n > 0) {
13918 __pyx_v_i = __pyx_optional_args->i;
13929 __pyx_t_1 = (__pyx_v_i != Py_None);
13930 __pyx_t_2 = (__pyx_t_1 != 0);
13940 __Pyx_XDECREF(__pyx_r);
13941 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1594, __pyx_L1_error)
13942 __Pyx_GOTREF(__pyx_t_3);
13944 __pyx_t_4 =
log(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
13946 __Pyx_CppExn2PyErr();
13947 __PYX_ERR(0, 1594, __pyx_L1_error)
13949 __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)
13950 __Pyx_GOTREF(__pyx_t_5);
13951 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13952 __pyx_r = __pyx_t_5;
13974 __Pyx_PyThreadState_declare
13975 __Pyx_PyThreadState_assign
13976 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
13977 __Pyx_XGOTREF(__pyx_t_6);
13978 __Pyx_XGOTREF(__pyx_t_7);
13979 __Pyx_XGOTREF(__pyx_t_8);
13989 __Pyx_XDECREF(__pyx_r);
13990 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1597, __pyx_L4_error)
13991 __Pyx_GOTREF(__pyx_t_3);
13992 __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)
13993 __Pyx_GOTREF(__pyx_t_9);
13994 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13996 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
13997 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
13998 if (likely(__pyx_t_3)) {
13999 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
14000 __Pyx_INCREF(__pyx_t_3);
14001 __Pyx_INCREF(
function);
14002 __Pyx_DECREF_SET(__pyx_t_9,
function);
14005 __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);
14006 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14007 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1597, __pyx_L4_error)
14008 __Pyx_GOTREF(__pyx_t_5);
14009 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14010 __pyx_r = __pyx_t_5;
14012 goto __pyx_L8_try_return;
14023 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14024 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14025 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
14035 __Pyx_AddTraceback(
"PyClical.log", __pyx_clineno, __pyx_lineno, __pyx_filename);
14036 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1598, __pyx_L6_except_error)
14037 __Pyx_GOTREF(__pyx_t_5);
14038 __Pyx_GOTREF(__pyx_t_9);
14039 __Pyx_GOTREF(__pyx_t_3);
14048 __Pyx_XDECREF(__pyx_r);
14049 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1599, __pyx_L6_except_error)
14050 __Pyx_GOTREF(__pyx_t_10);
14051 __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)
14052 __Pyx_GOTREF(__pyx_t_11);
14053 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14054 __pyx_r = __pyx_t_11;
14056 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14057 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14058 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14059 goto __pyx_L7_except_return;
14061 __pyx_L6_except_error:;
14070 __Pyx_XGIVEREF(__pyx_t_6);
14071 __Pyx_XGIVEREF(__pyx_t_7);
14072 __Pyx_XGIVEREF(__pyx_t_8);
14073 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14074 goto __pyx_L1_error;
14075 __pyx_L8_try_return:;
14076 __Pyx_XGIVEREF(__pyx_t_6);
14077 __Pyx_XGIVEREF(__pyx_t_7);
14078 __Pyx_XGIVEREF(__pyx_t_8);
14079 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14081 __pyx_L7_except_return:;
14082 __Pyx_XGIVEREF(__pyx_t_6);
14083 __Pyx_XGIVEREF(__pyx_t_7);
14084 __Pyx_XGIVEREF(__pyx_t_8);
14085 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14100 __Pyx_XDECREF(__pyx_t_3);
14101 __Pyx_XDECREF(__pyx_t_5);
14102 __Pyx_XDECREF(__pyx_t_9);
14103 __Pyx_XDECREF(__pyx_t_10);
14104 __Pyx_XDECREF(__pyx_t_11);
14105 __Pyx_AddTraceback(
"PyClical.log", __pyx_clineno, __pyx_lineno, __pyx_filename);
14108 __Pyx_XGIVEREF(__pyx_r);
14109 __Pyx_RefNannyFinishContext();
14114 static PyObject *__pyx_pw_8PyClical_49log(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14115 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 ";
14116 static PyObject *__pyx_pw_8PyClical_49log(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14117 PyObject *__pyx_v_obj = 0;
14118 PyObject *__pyx_v_i = 0;
14119 PyObject *__pyx_r = 0;
14120 __Pyx_RefNannyDeclarations
14121 __Pyx_RefNannySetupContext(
"log (wrapper)", 0);
14123 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
14124 PyObject* values[2] = {0,0};
14125 values[1] = ((PyObject *)Py_None);
14126 if (unlikely(__pyx_kwds)) {
14127 Py_ssize_t kw_args;
14128 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14129 switch (pos_args) {
14130 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14131 CYTHON_FALLTHROUGH;
14132 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14133 CYTHON_FALLTHROUGH;
14135 default:
goto __pyx_L5_argtuple_error;
14137 kw_args = PyDict_Size(__pyx_kwds);
14138 switch (pos_args) {
14140 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
14141 else goto __pyx_L5_argtuple_error;
14142 CYTHON_FALLTHROUGH;
14145 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
14146 if (value) { values[1] = value; kw_args--; }
14149 if (unlikely(kw_args > 0)) {
14150 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"log") < 0)) __PYX_ERR(0, 1578, __pyx_L3_error)
14153 switch (PyTuple_GET_SIZE(__pyx_args)) {
14154 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14155 CYTHON_FALLTHROUGH;
14156 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14158 default:
goto __pyx_L5_argtuple_error;
14161 __pyx_v_obj = values[0];
14162 __pyx_v_i = values[1];
14164 goto __pyx_L4_argument_unpacking_done;
14165 __pyx_L5_argtuple_error:;
14166 __Pyx_RaiseArgtupleInvalid(
"log", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1578, __pyx_L3_error)
14168 __Pyx_AddTraceback(
"PyClical.log", __pyx_clineno, __pyx_lineno, __pyx_filename);
14169 __Pyx_RefNannyFinishContext();
14171 __pyx_L4_argument_unpacking_done:;
14172 __pyx_r = __pyx_pf_8PyClical_48log(__pyx_self, __pyx_v_obj, __pyx_v_i);
14175 __Pyx_RefNannyFinishContext();
14179 static PyObject *__pyx_pf_8PyClical_48log(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
14180 PyObject *__pyx_r = NULL;
14181 __Pyx_RefNannyDeclarations
14182 PyObject *__pyx_t_1 = NULL;
14183 struct __pyx_opt_args_8PyClical_log __pyx_t_2;
14184 __Pyx_RefNannySetupContext(
"log", 0);
14185 __Pyx_XDECREF(__pyx_r);
14186 __pyx_t_2.__pyx_n = 1;
14187 __pyx_t_2.i = __pyx_v_i;
14188 __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)
14189 __Pyx_GOTREF(__pyx_t_1);
14190 __pyx_r = __pyx_t_1;
14196 __Pyx_XDECREF(__pyx_t_1);
14197 __Pyx_AddTraceback(
"PyClical.log", __pyx_clineno, __pyx_lineno, __pyx_filename);
14200 __Pyx_XGIVEREF(__pyx_r);
14201 __Pyx_RefNannyFinishContext();
14213 static PyObject *__pyx_pw_8PyClical_51cos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14214 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) {
14215 PyObject *__pyx_v_i = ((PyObject *)Py_None);
14216 PyObject *__pyx_r = NULL;
14217 __Pyx_RefNannyDeclarations
14220 PyObject *__pyx_t_3 = NULL;
14222 PyObject *__pyx_t_5 = NULL;
14223 PyObject *__pyx_t_6 = NULL;
14224 PyObject *__pyx_t_7 = NULL;
14225 PyObject *__pyx_t_8 = NULL;
14226 PyObject *__pyx_t_9 = NULL;
14227 PyObject *__pyx_t_10 = NULL;
14228 PyObject *__pyx_t_11 = NULL;
14229 __Pyx_RefNannySetupContext(
"cos", 0);
14230 if (__pyx_optional_args) {
14231 if (__pyx_optional_args->__pyx_n > 0) {
14232 __pyx_v_i = __pyx_optional_args->i;
14243 __pyx_t_1 = (__pyx_v_i != Py_None);
14244 __pyx_t_2 = (__pyx_t_1 != 0);
14254 __Pyx_XDECREF(__pyx_r);
14255 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1611, __pyx_L1_error)
14256 __Pyx_GOTREF(__pyx_t_3);
14258 __pyx_t_4 =
cos(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
14260 __Pyx_CppExn2PyErr();
14261 __PYX_ERR(0, 1611, __pyx_L1_error)
14263 __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)
14264 __Pyx_GOTREF(__pyx_t_5);
14265 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14266 __pyx_r = __pyx_t_5;
14288 __Pyx_PyThreadState_declare
14289 __Pyx_PyThreadState_assign
14290 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
14291 __Pyx_XGOTREF(__pyx_t_6);
14292 __Pyx_XGOTREF(__pyx_t_7);
14293 __Pyx_XGOTREF(__pyx_t_8);
14303 __Pyx_XDECREF(__pyx_r);
14304 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1614, __pyx_L4_error)
14305 __Pyx_GOTREF(__pyx_t_3);
14306 __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)
14307 __Pyx_GOTREF(__pyx_t_9);
14308 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14310 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
14311 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
14312 if (likely(__pyx_t_3)) {
14313 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
14314 __Pyx_INCREF(__pyx_t_3);
14315 __Pyx_INCREF(
function);
14316 __Pyx_DECREF_SET(__pyx_t_9,
function);
14319 __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);
14320 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14321 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1614, __pyx_L4_error)
14322 __Pyx_GOTREF(__pyx_t_5);
14323 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14324 __pyx_r = __pyx_t_5;
14326 goto __pyx_L8_try_return;
14337 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14338 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14339 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
14349 __Pyx_AddTraceback(
"PyClical.cos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14350 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1615, __pyx_L6_except_error)
14351 __Pyx_GOTREF(__pyx_t_5);
14352 __Pyx_GOTREF(__pyx_t_9);
14353 __Pyx_GOTREF(__pyx_t_3);
14362 __Pyx_XDECREF(__pyx_r);
14363 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1616, __pyx_L6_except_error)
14364 __Pyx_GOTREF(__pyx_t_10);
14365 __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)
14366 __Pyx_GOTREF(__pyx_t_11);
14367 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14368 __pyx_r = __pyx_t_11;
14370 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14371 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14372 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14373 goto __pyx_L7_except_return;
14375 __pyx_L6_except_error:;
14384 __Pyx_XGIVEREF(__pyx_t_6);
14385 __Pyx_XGIVEREF(__pyx_t_7);
14386 __Pyx_XGIVEREF(__pyx_t_8);
14387 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14388 goto __pyx_L1_error;
14389 __pyx_L8_try_return:;
14390 __Pyx_XGIVEREF(__pyx_t_6);
14391 __Pyx_XGIVEREF(__pyx_t_7);
14392 __Pyx_XGIVEREF(__pyx_t_8);
14393 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14395 __pyx_L7_except_return:;
14396 __Pyx_XGIVEREF(__pyx_t_6);
14397 __Pyx_XGIVEREF(__pyx_t_7);
14398 __Pyx_XGIVEREF(__pyx_t_8);
14399 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14414 __Pyx_XDECREF(__pyx_t_3);
14415 __Pyx_XDECREF(__pyx_t_5);
14416 __Pyx_XDECREF(__pyx_t_9);
14417 __Pyx_XDECREF(__pyx_t_10);
14418 __Pyx_XDECREF(__pyx_t_11);
14419 __Pyx_AddTraceback(
"PyClical.cos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14422 __Pyx_XGIVEREF(__pyx_r);
14423 __Pyx_RefNannyFinishContext();
14428 static PyObject *__pyx_pw_8PyClical_51cos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14429 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 ";
14430 static PyObject *__pyx_pw_8PyClical_51cos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14431 PyObject *__pyx_v_obj = 0;
14432 PyObject *__pyx_v_i = 0;
14433 PyObject *__pyx_r = 0;
14434 __Pyx_RefNannyDeclarations
14435 __Pyx_RefNannySetupContext(
"cos (wrapper)", 0);
14437 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
14438 PyObject* values[2] = {0,0};
14439 values[1] = ((PyObject *)Py_None);
14440 if (unlikely(__pyx_kwds)) {
14441 Py_ssize_t kw_args;
14442 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14443 switch (pos_args) {
14444 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14445 CYTHON_FALLTHROUGH;
14446 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14447 CYTHON_FALLTHROUGH;
14449 default:
goto __pyx_L5_argtuple_error;
14451 kw_args = PyDict_Size(__pyx_kwds);
14452 switch (pos_args) {
14454 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
14455 else goto __pyx_L5_argtuple_error;
14456 CYTHON_FALLTHROUGH;
14459 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
14460 if (value) { values[1] = value; kw_args--; }
14463 if (unlikely(kw_args > 0)) {
14464 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"cos") < 0)) __PYX_ERR(0, 1601, __pyx_L3_error)
14467 switch (PyTuple_GET_SIZE(__pyx_args)) {
14468 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14469 CYTHON_FALLTHROUGH;
14470 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14472 default:
goto __pyx_L5_argtuple_error;
14475 __pyx_v_obj = values[0];
14476 __pyx_v_i = values[1];
14478 goto __pyx_L4_argument_unpacking_done;
14479 __pyx_L5_argtuple_error:;
14480 __Pyx_RaiseArgtupleInvalid(
"cos", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1601, __pyx_L3_error)
14482 __Pyx_AddTraceback(
"PyClical.cos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14483 __Pyx_RefNannyFinishContext();
14485 __pyx_L4_argument_unpacking_done:;
14486 __pyx_r = __pyx_pf_8PyClical_50cos(__pyx_self, __pyx_v_obj, __pyx_v_i);
14489 __Pyx_RefNannyFinishContext();
14493 static PyObject *__pyx_pf_8PyClical_50cos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
14494 PyObject *__pyx_r = NULL;
14495 __Pyx_RefNannyDeclarations
14496 PyObject *__pyx_t_1 = NULL;
14497 struct __pyx_opt_args_8PyClical_cos __pyx_t_2;
14498 __Pyx_RefNannySetupContext(
"cos", 0);
14499 __Pyx_XDECREF(__pyx_r);
14500 __pyx_t_2.__pyx_n = 1;
14501 __pyx_t_2.i = __pyx_v_i;
14502 __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)
14503 __Pyx_GOTREF(__pyx_t_1);
14504 __pyx_r = __pyx_t_1;
14510 __Pyx_XDECREF(__pyx_t_1);
14511 __Pyx_AddTraceback(
"PyClical.cos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14514 __Pyx_XGIVEREF(__pyx_r);
14515 __Pyx_RefNannyFinishContext();
14527 static PyObject *__pyx_pw_8PyClical_53acos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14528 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) {
14529 PyObject *__pyx_v_i = ((PyObject *)Py_None);
14530 PyObject *__pyx_r = NULL;
14531 __Pyx_RefNannyDeclarations
14534 PyObject *__pyx_t_3 = NULL;
14536 PyObject *__pyx_t_5 = NULL;
14537 PyObject *__pyx_t_6 = NULL;
14538 PyObject *__pyx_t_7 = NULL;
14539 PyObject *__pyx_t_8 = NULL;
14540 PyObject *__pyx_t_9 = NULL;
14541 PyObject *__pyx_t_10 = NULL;
14542 PyObject *__pyx_t_11 = NULL;
14543 __Pyx_RefNannySetupContext(
"acos", 0);
14544 if (__pyx_optional_args) {
14545 if (__pyx_optional_args->__pyx_n > 0) {
14546 __pyx_v_i = __pyx_optional_args->i;
14557 __pyx_t_1 = (__pyx_v_i != Py_None);
14558 __pyx_t_2 = (__pyx_t_1 != 0);
14568 __Pyx_XDECREF(__pyx_r);
14569 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1632, __pyx_L1_error)
14570 __Pyx_GOTREF(__pyx_t_3);
14572 __pyx_t_4 =
acos(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
14574 __Pyx_CppExn2PyErr();
14575 __PYX_ERR(0, 1632, __pyx_L1_error)
14577 __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)
14578 __Pyx_GOTREF(__pyx_t_5);
14579 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14580 __pyx_r = __pyx_t_5;
14602 __Pyx_PyThreadState_declare
14603 __Pyx_PyThreadState_assign
14604 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
14605 __Pyx_XGOTREF(__pyx_t_6);
14606 __Pyx_XGOTREF(__pyx_t_7);
14607 __Pyx_XGOTREF(__pyx_t_8);
14617 __Pyx_XDECREF(__pyx_r);
14618 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1635, __pyx_L4_error)
14619 __Pyx_GOTREF(__pyx_t_3);
14620 __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)
14621 __Pyx_GOTREF(__pyx_t_9);
14622 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14624 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
14625 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
14626 if (likely(__pyx_t_3)) {
14627 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
14628 __Pyx_INCREF(__pyx_t_3);
14629 __Pyx_INCREF(
function);
14630 __Pyx_DECREF_SET(__pyx_t_9,
function);
14633 __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);
14634 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14635 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1635, __pyx_L4_error)
14636 __Pyx_GOTREF(__pyx_t_5);
14637 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14638 __pyx_r = __pyx_t_5;
14640 goto __pyx_L8_try_return;
14651 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14652 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14653 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
14663 __Pyx_AddTraceback(
"PyClical.acos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14664 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1636, __pyx_L6_except_error)
14665 __Pyx_GOTREF(__pyx_t_5);
14666 __Pyx_GOTREF(__pyx_t_9);
14667 __Pyx_GOTREF(__pyx_t_3);
14676 __Pyx_XDECREF(__pyx_r);
14677 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1637, __pyx_L6_except_error)
14678 __Pyx_GOTREF(__pyx_t_10);
14679 __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)
14680 __Pyx_GOTREF(__pyx_t_11);
14681 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14682 __pyx_r = __pyx_t_11;
14684 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14685 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14686 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14687 goto __pyx_L7_except_return;
14689 __pyx_L6_except_error:;
14698 __Pyx_XGIVEREF(__pyx_t_6);
14699 __Pyx_XGIVEREF(__pyx_t_7);
14700 __Pyx_XGIVEREF(__pyx_t_8);
14701 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14702 goto __pyx_L1_error;
14703 __pyx_L8_try_return:;
14704 __Pyx_XGIVEREF(__pyx_t_6);
14705 __Pyx_XGIVEREF(__pyx_t_7);
14706 __Pyx_XGIVEREF(__pyx_t_8);
14707 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14709 __pyx_L7_except_return:;
14710 __Pyx_XGIVEREF(__pyx_t_6);
14711 __Pyx_XGIVEREF(__pyx_t_7);
14712 __Pyx_XGIVEREF(__pyx_t_8);
14713 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
14728 __Pyx_XDECREF(__pyx_t_3);
14729 __Pyx_XDECREF(__pyx_t_5);
14730 __Pyx_XDECREF(__pyx_t_9);
14731 __Pyx_XDECREF(__pyx_t_10);
14732 __Pyx_XDECREF(__pyx_t_11);
14733 __Pyx_AddTraceback(
"PyClical.acos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14736 __Pyx_XGIVEREF(__pyx_r);
14737 __Pyx_RefNannyFinishContext();
14742 static PyObject *__pyx_pw_8PyClical_53acos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14743 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 ";
14744 static PyObject *__pyx_pw_8PyClical_53acos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14745 PyObject *__pyx_v_obj = 0;
14746 PyObject *__pyx_v_i = 0;
14747 PyObject *__pyx_r = 0;
14748 __Pyx_RefNannyDeclarations
14749 __Pyx_RefNannySetupContext(
"acos (wrapper)", 0);
14751 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
14752 PyObject* values[2] = {0,0};
14753 values[1] = ((PyObject *)Py_None);
14754 if (unlikely(__pyx_kwds)) {
14755 Py_ssize_t kw_args;
14756 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14757 switch (pos_args) {
14758 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14759 CYTHON_FALLTHROUGH;
14760 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14761 CYTHON_FALLTHROUGH;
14763 default:
goto __pyx_L5_argtuple_error;
14765 kw_args = PyDict_Size(__pyx_kwds);
14766 switch (pos_args) {
14768 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
14769 else goto __pyx_L5_argtuple_error;
14770 CYTHON_FALLTHROUGH;
14773 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
14774 if (value) { values[1] = value; kw_args--; }
14777 if (unlikely(kw_args > 0)) {
14778 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"acos") < 0)) __PYX_ERR(0, 1618, __pyx_L3_error)
14781 switch (PyTuple_GET_SIZE(__pyx_args)) {
14782 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14783 CYTHON_FALLTHROUGH;
14784 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14786 default:
goto __pyx_L5_argtuple_error;
14789 __pyx_v_obj = values[0];
14790 __pyx_v_i = values[1];
14792 goto __pyx_L4_argument_unpacking_done;
14793 __pyx_L5_argtuple_error:;
14794 __Pyx_RaiseArgtupleInvalid(
"acos", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1618, __pyx_L3_error)
14796 __Pyx_AddTraceback(
"PyClical.acos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14797 __Pyx_RefNannyFinishContext();
14799 __pyx_L4_argument_unpacking_done:;
14800 __pyx_r = __pyx_pf_8PyClical_52acos(__pyx_self, __pyx_v_obj, __pyx_v_i);
14803 __Pyx_RefNannyFinishContext();
14807 static PyObject *__pyx_pf_8PyClical_52acos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
14808 PyObject *__pyx_r = NULL;
14809 __Pyx_RefNannyDeclarations
14810 PyObject *__pyx_t_1 = NULL;
14811 struct __pyx_opt_args_8PyClical_acos __pyx_t_2;
14812 __Pyx_RefNannySetupContext(
"acos", 0);
14813 __Pyx_XDECREF(__pyx_r);
14814 __pyx_t_2.__pyx_n = 1;
14815 __pyx_t_2.i = __pyx_v_i;
14816 __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)
14817 __Pyx_GOTREF(__pyx_t_1);
14818 __pyx_r = __pyx_t_1;
14824 __Pyx_XDECREF(__pyx_t_1);
14825 __Pyx_AddTraceback(
"PyClical.acos", __pyx_clineno, __pyx_lineno, __pyx_filename);
14828 __Pyx_XGIVEREF(__pyx_r);
14829 __Pyx_RefNannyFinishContext();
14841 static PyObject *__pyx_pw_8PyClical_55cosh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
14842 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cosh(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
14843 PyObject *__pyx_r = NULL;
14844 __Pyx_RefNannyDeclarations
14845 PyObject *__pyx_t_1 = NULL;
14846 PyObject *__pyx_t_2 = NULL;
14847 PyObject *__pyx_t_3 = NULL;
14848 PyObject *__pyx_t_4 = NULL;
14849 PyObject *__pyx_t_5 = NULL;
14850 PyObject *__pyx_t_6 = NULL;
14851 PyObject *__pyx_t_7 = NULL;
14852 PyObject *__pyx_t_8 = NULL;
14853 __Pyx_RefNannySetupContext(
"cosh", 0);
14863 __Pyx_PyThreadState_declare
14864 __Pyx_PyThreadState_assign
14865 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
14866 __Pyx_XGOTREF(__pyx_t_1);
14867 __Pyx_XGOTREF(__pyx_t_2);
14868 __Pyx_XGOTREF(__pyx_t_3);
14878 __Pyx_XDECREF(__pyx_r);
14879 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1651, __pyx_L3_error)
14880 __Pyx_GOTREF(__pyx_t_5);
14881 __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)
14882 __Pyx_GOTREF(__pyx_t_6);
14883 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14885 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
14886 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
14887 if (likely(__pyx_t_5)) {
14888 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
14889 __Pyx_INCREF(__pyx_t_5);
14890 __Pyx_INCREF(
function);
14891 __Pyx_DECREF_SET(__pyx_t_6,
function);
14894 __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);
14895 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14896 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1651, __pyx_L3_error)
14897 __Pyx_GOTREF(__pyx_t_4);
14898 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14899 __pyx_r = __pyx_t_4;
14901 goto __pyx_L7_try_return;
14912 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
14913 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14914 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
14924 __Pyx_AddTraceback(
"PyClical.cosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
14925 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(0, 1652, __pyx_L5_except_error)
14926 __Pyx_GOTREF(__pyx_t_4);
14927 __Pyx_GOTREF(__pyx_t_6);
14928 __Pyx_GOTREF(__pyx_t_5);
14937 __Pyx_XDECREF(__pyx_r);
14938 __pyx_t_7 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1653, __pyx_L5_except_error)
14939 __Pyx_GOTREF(__pyx_t_7);
14940 __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)
14941 __Pyx_GOTREF(__pyx_t_8);
14942 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14943 __pyx_r = __pyx_t_8;
14945 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14946 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14947 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14948 goto __pyx_L6_except_return;
14950 __pyx_L5_except_error:;
14959 __Pyx_XGIVEREF(__pyx_t_1);
14960 __Pyx_XGIVEREF(__pyx_t_2);
14961 __Pyx_XGIVEREF(__pyx_t_3);
14962 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
14963 goto __pyx_L1_error;
14964 __pyx_L7_try_return:;
14965 __Pyx_XGIVEREF(__pyx_t_1);
14966 __Pyx_XGIVEREF(__pyx_t_2);
14967 __Pyx_XGIVEREF(__pyx_t_3);
14968 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
14970 __pyx_L6_except_return:;
14971 __Pyx_XGIVEREF(__pyx_t_1);
14972 __Pyx_XGIVEREF(__pyx_t_2);
14973 __Pyx_XGIVEREF(__pyx_t_3);
14974 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
14988 __Pyx_XDECREF(__pyx_t_4);
14989 __Pyx_XDECREF(__pyx_t_5);
14990 __Pyx_XDECREF(__pyx_t_6);
14991 __Pyx_XDECREF(__pyx_t_7);
14992 __Pyx_XDECREF(__pyx_t_8);
14993 __Pyx_AddTraceback(
"PyClical.cosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
14996 __Pyx_XGIVEREF(__pyx_r);
14997 __Pyx_RefNannyFinishContext();
15002 static PyObject *__pyx_pw_8PyClical_55cosh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
15003 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 ";
15004 static PyObject *__pyx_pw_8PyClical_55cosh(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
15005 PyObject *__pyx_r = 0;
15006 __Pyx_RefNannyDeclarations
15007 __Pyx_RefNannySetupContext(
"cosh (wrapper)", 0);
15008 __pyx_r = __pyx_pf_8PyClical_54cosh(__pyx_self, ((PyObject *)__pyx_v_obj));
15011 __Pyx_RefNannyFinishContext();
15015 static PyObject *__pyx_pf_8PyClical_54cosh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
15016 PyObject *__pyx_r = NULL;
15017 __Pyx_RefNannyDeclarations
15018 PyObject *__pyx_t_1 = NULL;
15019 __Pyx_RefNannySetupContext(
"cosh", 0);
15020 __Pyx_XDECREF(__pyx_r);
15021 __pyx_t_1 = __pyx_f_8PyClical_cosh(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1639, __pyx_L1_error)
15022 __Pyx_GOTREF(__pyx_t_1);
15023 __pyx_r = __pyx_t_1;
15029 __Pyx_XDECREF(__pyx_t_1);
15030 __Pyx_AddTraceback(
"PyClical.cosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15033 __Pyx_XGIVEREF(__pyx_r);
15034 __Pyx_RefNannyFinishContext();
15046 static PyObject *__pyx_pw_8PyClical_57acosh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15047 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) {
15048 PyObject *__pyx_v_i = ((PyObject *)Py_None);
15049 PyObject *__pyx_r = NULL;
15050 __Pyx_RefNannyDeclarations
15053 PyObject *__pyx_t_3 = NULL;
15055 PyObject *__pyx_t_5 = NULL;
15056 PyObject *__pyx_t_6 = NULL;
15057 PyObject *__pyx_t_7 = NULL;
15058 PyObject *__pyx_t_8 = NULL;
15059 PyObject *__pyx_t_9 = NULL;
15060 PyObject *__pyx_t_10 = NULL;
15061 PyObject *__pyx_t_11 = NULL;
15062 __Pyx_RefNannySetupContext(
"acosh", 0);
15063 if (__pyx_optional_args) {
15064 if (__pyx_optional_args->__pyx_n > 0) {
15065 __pyx_v_i = __pyx_optional_args->i;
15076 __pyx_t_1 = (__pyx_v_i != Py_None);
15077 __pyx_t_2 = (__pyx_t_1 != 0);
15087 __Pyx_XDECREF(__pyx_r);
15088 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1671, __pyx_L1_error)
15089 __Pyx_GOTREF(__pyx_t_3);
15091 __pyx_t_4 =
acosh(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
15093 __Pyx_CppExn2PyErr();
15094 __PYX_ERR(0, 1671, __pyx_L1_error)
15096 __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)
15097 __Pyx_GOTREF(__pyx_t_5);
15098 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15099 __pyx_r = __pyx_t_5;
15121 __Pyx_PyThreadState_declare
15122 __Pyx_PyThreadState_assign
15123 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
15124 __Pyx_XGOTREF(__pyx_t_6);
15125 __Pyx_XGOTREF(__pyx_t_7);
15126 __Pyx_XGOTREF(__pyx_t_8);
15136 __Pyx_XDECREF(__pyx_r);
15137 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1674, __pyx_L4_error)
15138 __Pyx_GOTREF(__pyx_t_3);
15139 __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)
15140 __Pyx_GOTREF(__pyx_t_9);
15141 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15143 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
15144 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
15145 if (likely(__pyx_t_3)) {
15146 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
15147 __Pyx_INCREF(__pyx_t_3);
15148 __Pyx_INCREF(
function);
15149 __Pyx_DECREF_SET(__pyx_t_9,
function);
15152 __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);
15153 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15154 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1674, __pyx_L4_error)
15155 __Pyx_GOTREF(__pyx_t_5);
15156 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15157 __pyx_r = __pyx_t_5;
15159 goto __pyx_L8_try_return;
15170 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15171 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15172 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
15182 __Pyx_AddTraceback(
"PyClical.acosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15183 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1675, __pyx_L6_except_error)
15184 __Pyx_GOTREF(__pyx_t_5);
15185 __Pyx_GOTREF(__pyx_t_9);
15186 __Pyx_GOTREF(__pyx_t_3);
15195 __Pyx_XDECREF(__pyx_r);
15196 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1676, __pyx_L6_except_error)
15197 __Pyx_GOTREF(__pyx_t_10);
15198 __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)
15199 __Pyx_GOTREF(__pyx_t_11);
15200 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15201 __pyx_r = __pyx_t_11;
15203 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15204 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15205 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15206 goto __pyx_L7_except_return;
15208 __pyx_L6_except_error:;
15217 __Pyx_XGIVEREF(__pyx_t_6);
15218 __Pyx_XGIVEREF(__pyx_t_7);
15219 __Pyx_XGIVEREF(__pyx_t_8);
15220 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15221 goto __pyx_L1_error;
15222 __pyx_L8_try_return:;
15223 __Pyx_XGIVEREF(__pyx_t_6);
15224 __Pyx_XGIVEREF(__pyx_t_7);
15225 __Pyx_XGIVEREF(__pyx_t_8);
15226 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15228 __pyx_L7_except_return:;
15229 __Pyx_XGIVEREF(__pyx_t_6);
15230 __Pyx_XGIVEREF(__pyx_t_7);
15231 __Pyx_XGIVEREF(__pyx_t_8);
15232 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15247 __Pyx_XDECREF(__pyx_t_3);
15248 __Pyx_XDECREF(__pyx_t_5);
15249 __Pyx_XDECREF(__pyx_t_9);
15250 __Pyx_XDECREF(__pyx_t_10);
15251 __Pyx_XDECREF(__pyx_t_11);
15252 __Pyx_AddTraceback(
"PyClical.acosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15255 __Pyx_XGIVEREF(__pyx_r);
15256 __Pyx_RefNannyFinishContext();
15261 static PyObject *__pyx_pw_8PyClical_57acosh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15262 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 ";
15263 static PyObject *__pyx_pw_8PyClical_57acosh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15264 PyObject *__pyx_v_obj = 0;
15265 PyObject *__pyx_v_i = 0;
15266 PyObject *__pyx_r = 0;
15267 __Pyx_RefNannyDeclarations
15268 __Pyx_RefNannySetupContext(
"acosh (wrapper)", 0);
15270 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
15271 PyObject* values[2] = {0,0};
15272 values[1] = ((PyObject *)Py_None);
15273 if (unlikely(__pyx_kwds)) {
15274 Py_ssize_t kw_args;
15275 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15276 switch (pos_args) {
15277 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15278 CYTHON_FALLTHROUGH;
15279 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15280 CYTHON_FALLTHROUGH;
15282 default:
goto __pyx_L5_argtuple_error;
15284 kw_args = PyDict_Size(__pyx_kwds);
15285 switch (pos_args) {
15287 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
15288 else goto __pyx_L5_argtuple_error;
15289 CYTHON_FALLTHROUGH;
15292 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
15293 if (value) { values[1] = value; kw_args--; }
15296 if (unlikely(kw_args > 0)) {
15297 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"acosh") < 0)) __PYX_ERR(0, 1655, __pyx_L3_error)
15300 switch (PyTuple_GET_SIZE(__pyx_args)) {
15301 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15302 CYTHON_FALLTHROUGH;
15303 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15305 default:
goto __pyx_L5_argtuple_error;
15308 __pyx_v_obj = values[0];
15309 __pyx_v_i = values[1];
15311 goto __pyx_L4_argument_unpacking_done;
15312 __pyx_L5_argtuple_error:;
15313 __Pyx_RaiseArgtupleInvalid(
"acosh", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1655, __pyx_L3_error)
15315 __Pyx_AddTraceback(
"PyClical.acosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15316 __Pyx_RefNannyFinishContext();
15318 __pyx_L4_argument_unpacking_done:;
15319 __pyx_r = __pyx_pf_8PyClical_56acosh(__pyx_self, __pyx_v_obj, __pyx_v_i);
15322 __Pyx_RefNannyFinishContext();
15326 static PyObject *__pyx_pf_8PyClical_56acosh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
15327 PyObject *__pyx_r = NULL;
15328 __Pyx_RefNannyDeclarations
15329 PyObject *__pyx_t_1 = NULL;
15330 struct __pyx_opt_args_8PyClical_acosh __pyx_t_2;
15331 __Pyx_RefNannySetupContext(
"acosh", 0);
15332 __Pyx_XDECREF(__pyx_r);
15333 __pyx_t_2.__pyx_n = 1;
15334 __pyx_t_2.i = __pyx_v_i;
15335 __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)
15336 __Pyx_GOTREF(__pyx_t_1);
15337 __pyx_r = __pyx_t_1;
15343 __Pyx_XDECREF(__pyx_t_1);
15344 __Pyx_AddTraceback(
"PyClical.acosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
15347 __Pyx_XGIVEREF(__pyx_r);
15348 __Pyx_RefNannyFinishContext();
15360 static PyObject *__pyx_pw_8PyClical_59sin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15361 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) {
15362 PyObject *__pyx_v_i = ((PyObject *)Py_None);
15363 PyObject *__pyx_r = NULL;
15364 __Pyx_RefNannyDeclarations
15367 PyObject *__pyx_t_3 = NULL;
15369 PyObject *__pyx_t_5 = NULL;
15370 PyObject *__pyx_t_6 = NULL;
15371 PyObject *__pyx_t_7 = NULL;
15372 PyObject *__pyx_t_8 = NULL;
15373 PyObject *__pyx_t_9 = NULL;
15374 PyObject *__pyx_t_10 = NULL;
15375 PyObject *__pyx_t_11 = NULL;
15376 __Pyx_RefNannySetupContext(
"sin", 0);
15377 if (__pyx_optional_args) {
15378 if (__pyx_optional_args->__pyx_n > 0) {
15379 __pyx_v_i = __pyx_optional_args->i;
15390 __pyx_t_1 = (__pyx_v_i != Py_None);
15391 __pyx_t_2 = (__pyx_t_1 != 0);
15401 __Pyx_XDECREF(__pyx_r);
15402 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1690, __pyx_L1_error)
15403 __Pyx_GOTREF(__pyx_t_3);
15405 __pyx_t_4 =
sin(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
15407 __Pyx_CppExn2PyErr();
15408 __PYX_ERR(0, 1690, __pyx_L1_error)
15410 __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)
15411 __Pyx_GOTREF(__pyx_t_5);
15412 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15413 __pyx_r = __pyx_t_5;
15435 __Pyx_PyThreadState_declare
15436 __Pyx_PyThreadState_assign
15437 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
15438 __Pyx_XGOTREF(__pyx_t_6);
15439 __Pyx_XGOTREF(__pyx_t_7);
15440 __Pyx_XGOTREF(__pyx_t_8);
15450 __Pyx_XDECREF(__pyx_r);
15451 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1693, __pyx_L4_error)
15452 __Pyx_GOTREF(__pyx_t_3);
15453 __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)
15454 __Pyx_GOTREF(__pyx_t_9);
15455 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15457 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
15458 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
15459 if (likely(__pyx_t_3)) {
15460 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
15461 __Pyx_INCREF(__pyx_t_3);
15462 __Pyx_INCREF(
function);
15463 __Pyx_DECREF_SET(__pyx_t_9,
function);
15466 __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);
15467 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15468 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1693, __pyx_L4_error)
15469 __Pyx_GOTREF(__pyx_t_5);
15470 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15471 __pyx_r = __pyx_t_5;
15473 goto __pyx_L8_try_return;
15484 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15485 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15486 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
15496 __Pyx_AddTraceback(
"PyClical.sin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15497 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1694, __pyx_L6_except_error)
15498 __Pyx_GOTREF(__pyx_t_5);
15499 __Pyx_GOTREF(__pyx_t_9);
15500 __Pyx_GOTREF(__pyx_t_3);
15509 __Pyx_XDECREF(__pyx_r);
15510 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1695, __pyx_L6_except_error)
15511 __Pyx_GOTREF(__pyx_t_10);
15512 __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)
15513 __Pyx_GOTREF(__pyx_t_11);
15514 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15515 __pyx_r = __pyx_t_11;
15517 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15518 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15519 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15520 goto __pyx_L7_except_return;
15522 __pyx_L6_except_error:;
15531 __Pyx_XGIVEREF(__pyx_t_6);
15532 __Pyx_XGIVEREF(__pyx_t_7);
15533 __Pyx_XGIVEREF(__pyx_t_8);
15534 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15535 goto __pyx_L1_error;
15536 __pyx_L8_try_return:;
15537 __Pyx_XGIVEREF(__pyx_t_6);
15538 __Pyx_XGIVEREF(__pyx_t_7);
15539 __Pyx_XGIVEREF(__pyx_t_8);
15540 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15542 __pyx_L7_except_return:;
15543 __Pyx_XGIVEREF(__pyx_t_6);
15544 __Pyx_XGIVEREF(__pyx_t_7);
15545 __Pyx_XGIVEREF(__pyx_t_8);
15546 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15561 __Pyx_XDECREF(__pyx_t_3);
15562 __Pyx_XDECREF(__pyx_t_5);
15563 __Pyx_XDECREF(__pyx_t_9);
15564 __Pyx_XDECREF(__pyx_t_10);
15565 __Pyx_XDECREF(__pyx_t_11);
15566 __Pyx_AddTraceback(
"PyClical.sin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15569 __Pyx_XGIVEREF(__pyx_r);
15570 __Pyx_RefNannyFinishContext();
15575 static PyObject *__pyx_pw_8PyClical_59sin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15576 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 ";
15577 static PyObject *__pyx_pw_8PyClical_59sin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15578 PyObject *__pyx_v_obj = 0;
15579 PyObject *__pyx_v_i = 0;
15580 PyObject *__pyx_r = 0;
15581 __Pyx_RefNannyDeclarations
15582 __Pyx_RefNannySetupContext(
"sin (wrapper)", 0);
15584 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
15585 PyObject* values[2] = {0,0};
15586 values[1] = ((PyObject *)Py_None);
15587 if (unlikely(__pyx_kwds)) {
15588 Py_ssize_t kw_args;
15589 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15590 switch (pos_args) {
15591 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15592 CYTHON_FALLTHROUGH;
15593 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15594 CYTHON_FALLTHROUGH;
15596 default:
goto __pyx_L5_argtuple_error;
15598 kw_args = PyDict_Size(__pyx_kwds);
15599 switch (pos_args) {
15601 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
15602 else goto __pyx_L5_argtuple_error;
15603 CYTHON_FALLTHROUGH;
15606 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
15607 if (value) { values[1] = value; kw_args--; }
15610 if (unlikely(kw_args > 0)) {
15611 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"sin") < 0)) __PYX_ERR(0, 1678, __pyx_L3_error)
15614 switch (PyTuple_GET_SIZE(__pyx_args)) {
15615 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15616 CYTHON_FALLTHROUGH;
15617 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15619 default:
goto __pyx_L5_argtuple_error;
15622 __pyx_v_obj = values[0];
15623 __pyx_v_i = values[1];
15625 goto __pyx_L4_argument_unpacking_done;
15626 __pyx_L5_argtuple_error:;
15627 __Pyx_RaiseArgtupleInvalid(
"sin", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1678, __pyx_L3_error)
15629 __Pyx_AddTraceback(
"PyClical.sin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15630 __Pyx_RefNannyFinishContext();
15632 __pyx_L4_argument_unpacking_done:;
15633 __pyx_r = __pyx_pf_8PyClical_58sin(__pyx_self, __pyx_v_obj, __pyx_v_i);
15636 __Pyx_RefNannyFinishContext();
15640 static PyObject *__pyx_pf_8PyClical_58sin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
15641 PyObject *__pyx_r = NULL;
15642 __Pyx_RefNannyDeclarations
15643 PyObject *__pyx_t_1 = NULL;
15644 struct __pyx_opt_args_8PyClical_sin __pyx_t_2;
15645 __Pyx_RefNannySetupContext(
"sin", 0);
15646 __Pyx_XDECREF(__pyx_r);
15647 __pyx_t_2.__pyx_n = 1;
15648 __pyx_t_2.i = __pyx_v_i;
15649 __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)
15650 __Pyx_GOTREF(__pyx_t_1);
15651 __pyx_r = __pyx_t_1;
15657 __Pyx_XDECREF(__pyx_t_1);
15658 __Pyx_AddTraceback(
"PyClical.sin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15661 __Pyx_XGIVEREF(__pyx_r);
15662 __Pyx_RefNannyFinishContext();
15674 static PyObject *__pyx_pw_8PyClical_61asin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15675 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) {
15676 PyObject *__pyx_v_i = ((PyObject *)Py_None);
15677 PyObject *__pyx_r = NULL;
15678 __Pyx_RefNannyDeclarations
15681 PyObject *__pyx_t_3 = NULL;
15683 PyObject *__pyx_t_5 = NULL;
15684 PyObject *__pyx_t_6 = NULL;
15685 PyObject *__pyx_t_7 = NULL;
15686 PyObject *__pyx_t_8 = NULL;
15687 PyObject *__pyx_t_9 = NULL;
15688 PyObject *__pyx_t_10 = NULL;
15689 PyObject *__pyx_t_11 = NULL;
15690 __Pyx_RefNannySetupContext(
"asin", 0);
15691 if (__pyx_optional_args) {
15692 if (__pyx_optional_args->__pyx_n > 0) {
15693 __pyx_v_i = __pyx_optional_args->i;
15704 __pyx_t_1 = (__pyx_v_i != Py_None);
15705 __pyx_t_2 = (__pyx_t_1 != 0);
15715 __Pyx_XDECREF(__pyx_r);
15716 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1711, __pyx_L1_error)
15717 __Pyx_GOTREF(__pyx_t_3);
15719 __pyx_t_4 =
asin(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
15721 __Pyx_CppExn2PyErr();
15722 __PYX_ERR(0, 1711, __pyx_L1_error)
15724 __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)
15725 __Pyx_GOTREF(__pyx_t_5);
15726 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15727 __pyx_r = __pyx_t_5;
15749 __Pyx_PyThreadState_declare
15750 __Pyx_PyThreadState_assign
15751 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
15752 __Pyx_XGOTREF(__pyx_t_6);
15753 __Pyx_XGOTREF(__pyx_t_7);
15754 __Pyx_XGOTREF(__pyx_t_8);
15764 __Pyx_XDECREF(__pyx_r);
15765 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1714, __pyx_L4_error)
15766 __Pyx_GOTREF(__pyx_t_3);
15767 __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)
15768 __Pyx_GOTREF(__pyx_t_9);
15769 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15771 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
15772 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
15773 if (likely(__pyx_t_3)) {
15774 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
15775 __Pyx_INCREF(__pyx_t_3);
15776 __Pyx_INCREF(
function);
15777 __Pyx_DECREF_SET(__pyx_t_9,
function);
15780 __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);
15781 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15782 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1714, __pyx_L4_error)
15783 __Pyx_GOTREF(__pyx_t_5);
15784 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15785 __pyx_r = __pyx_t_5;
15787 goto __pyx_L8_try_return;
15798 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15799 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15800 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
15810 __Pyx_AddTraceback(
"PyClical.asin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15811 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1715, __pyx_L6_except_error)
15812 __Pyx_GOTREF(__pyx_t_5);
15813 __Pyx_GOTREF(__pyx_t_9);
15814 __Pyx_GOTREF(__pyx_t_3);
15823 __Pyx_XDECREF(__pyx_r);
15824 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1716, __pyx_L6_except_error)
15825 __Pyx_GOTREF(__pyx_t_10);
15826 __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)
15827 __Pyx_GOTREF(__pyx_t_11);
15828 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15829 __pyx_r = __pyx_t_11;
15831 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15832 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15833 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15834 goto __pyx_L7_except_return;
15836 __pyx_L6_except_error:;
15845 __Pyx_XGIVEREF(__pyx_t_6);
15846 __Pyx_XGIVEREF(__pyx_t_7);
15847 __Pyx_XGIVEREF(__pyx_t_8);
15848 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15849 goto __pyx_L1_error;
15850 __pyx_L8_try_return:;
15851 __Pyx_XGIVEREF(__pyx_t_6);
15852 __Pyx_XGIVEREF(__pyx_t_7);
15853 __Pyx_XGIVEREF(__pyx_t_8);
15854 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15856 __pyx_L7_except_return:;
15857 __Pyx_XGIVEREF(__pyx_t_6);
15858 __Pyx_XGIVEREF(__pyx_t_7);
15859 __Pyx_XGIVEREF(__pyx_t_8);
15860 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15875 __Pyx_XDECREF(__pyx_t_3);
15876 __Pyx_XDECREF(__pyx_t_5);
15877 __Pyx_XDECREF(__pyx_t_9);
15878 __Pyx_XDECREF(__pyx_t_10);
15879 __Pyx_XDECREF(__pyx_t_11);
15880 __Pyx_AddTraceback(
"PyClical.asin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15883 __Pyx_XGIVEREF(__pyx_r);
15884 __Pyx_RefNannyFinishContext();
15889 static PyObject *__pyx_pw_8PyClical_61asin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15890 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 ";
15891 static PyObject *__pyx_pw_8PyClical_61asin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15892 PyObject *__pyx_v_obj = 0;
15893 PyObject *__pyx_v_i = 0;
15894 PyObject *__pyx_r = 0;
15895 __Pyx_RefNannyDeclarations
15896 __Pyx_RefNannySetupContext(
"asin (wrapper)", 0);
15898 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
15899 PyObject* values[2] = {0,0};
15900 values[1] = ((PyObject *)Py_None);
15901 if (unlikely(__pyx_kwds)) {
15902 Py_ssize_t kw_args;
15903 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15904 switch (pos_args) {
15905 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15906 CYTHON_FALLTHROUGH;
15907 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15908 CYTHON_FALLTHROUGH;
15910 default:
goto __pyx_L5_argtuple_error;
15912 kw_args = PyDict_Size(__pyx_kwds);
15913 switch (pos_args) {
15915 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
15916 else goto __pyx_L5_argtuple_error;
15917 CYTHON_FALLTHROUGH;
15920 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
15921 if (value) { values[1] = value; kw_args--; }
15924 if (unlikely(kw_args > 0)) {
15925 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"asin") < 0)) __PYX_ERR(0, 1697, __pyx_L3_error)
15928 switch (PyTuple_GET_SIZE(__pyx_args)) {
15929 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15930 CYTHON_FALLTHROUGH;
15931 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15933 default:
goto __pyx_L5_argtuple_error;
15936 __pyx_v_obj = values[0];
15937 __pyx_v_i = values[1];
15939 goto __pyx_L4_argument_unpacking_done;
15940 __pyx_L5_argtuple_error:;
15941 __Pyx_RaiseArgtupleInvalid(
"asin", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1697, __pyx_L3_error)
15943 __Pyx_AddTraceback(
"PyClical.asin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15944 __Pyx_RefNannyFinishContext();
15946 __pyx_L4_argument_unpacking_done:;
15947 __pyx_r = __pyx_pf_8PyClical_60asin(__pyx_self, __pyx_v_obj, __pyx_v_i);
15950 __Pyx_RefNannyFinishContext();
15954 static PyObject *__pyx_pf_8PyClical_60asin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
15955 PyObject *__pyx_r = NULL;
15956 __Pyx_RefNannyDeclarations
15957 PyObject *__pyx_t_1 = NULL;
15958 struct __pyx_opt_args_8PyClical_asin __pyx_t_2;
15959 __Pyx_RefNannySetupContext(
"asin", 0);
15960 __Pyx_XDECREF(__pyx_r);
15961 __pyx_t_2.__pyx_n = 1;
15962 __pyx_t_2.i = __pyx_v_i;
15963 __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)
15964 __Pyx_GOTREF(__pyx_t_1);
15965 __pyx_r = __pyx_t_1;
15971 __Pyx_XDECREF(__pyx_t_1);
15972 __Pyx_AddTraceback(
"PyClical.asin", __pyx_clineno, __pyx_lineno, __pyx_filename);
15975 __Pyx_XGIVEREF(__pyx_r);
15976 __Pyx_RefNannyFinishContext();
15988 static PyObject *__pyx_pw_8PyClical_63sinh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
15989 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_sinh(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
15990 PyObject *__pyx_r = NULL;
15991 __Pyx_RefNannyDeclarations
15992 PyObject *__pyx_t_1 = NULL;
15993 PyObject *__pyx_t_2 = NULL;
15994 PyObject *__pyx_t_3 = NULL;
15995 PyObject *__pyx_t_4 = NULL;
15996 PyObject *__pyx_t_5 = NULL;
15997 PyObject *__pyx_t_6 = NULL;
15998 PyObject *__pyx_t_7 = NULL;
15999 PyObject *__pyx_t_8 = NULL;
16000 __Pyx_RefNannySetupContext(
"sinh", 0);
16010 __Pyx_PyThreadState_declare
16011 __Pyx_PyThreadState_assign
16012 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
16013 __Pyx_XGOTREF(__pyx_t_1);
16014 __Pyx_XGOTREF(__pyx_t_2);
16015 __Pyx_XGOTREF(__pyx_t_3);
16025 __Pyx_XDECREF(__pyx_r);
16026 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1728, __pyx_L3_error)
16027 __Pyx_GOTREF(__pyx_t_5);
16028 __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)
16029 __Pyx_GOTREF(__pyx_t_6);
16030 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16032 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
16033 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
16034 if (likely(__pyx_t_5)) {
16035 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
16036 __Pyx_INCREF(__pyx_t_5);
16037 __Pyx_INCREF(
function);
16038 __Pyx_DECREF_SET(__pyx_t_6,
function);
16041 __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);
16042 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16043 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1728, __pyx_L3_error)
16044 __Pyx_GOTREF(__pyx_t_4);
16045 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16046 __pyx_r = __pyx_t_4;
16048 goto __pyx_L7_try_return;
16059 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
16060 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16061 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
16071 __Pyx_AddTraceback(
"PyClical.sinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16072 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(0, 1729, __pyx_L5_except_error)
16073 __Pyx_GOTREF(__pyx_t_4);
16074 __Pyx_GOTREF(__pyx_t_6);
16075 __Pyx_GOTREF(__pyx_t_5);
16084 __Pyx_XDECREF(__pyx_r);
16085 __pyx_t_7 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1730, __pyx_L5_except_error)
16086 __Pyx_GOTREF(__pyx_t_7);
16087 __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)
16088 __Pyx_GOTREF(__pyx_t_8);
16089 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16090 __pyx_r = __pyx_t_8;
16092 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16093 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16094 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16095 goto __pyx_L6_except_return;
16097 __pyx_L5_except_error:;
16106 __Pyx_XGIVEREF(__pyx_t_1);
16107 __Pyx_XGIVEREF(__pyx_t_2);
16108 __Pyx_XGIVEREF(__pyx_t_3);
16109 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
16110 goto __pyx_L1_error;
16111 __pyx_L7_try_return:;
16112 __Pyx_XGIVEREF(__pyx_t_1);
16113 __Pyx_XGIVEREF(__pyx_t_2);
16114 __Pyx_XGIVEREF(__pyx_t_3);
16115 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
16117 __pyx_L6_except_return:;
16118 __Pyx_XGIVEREF(__pyx_t_1);
16119 __Pyx_XGIVEREF(__pyx_t_2);
16120 __Pyx_XGIVEREF(__pyx_t_3);
16121 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
16135 __Pyx_XDECREF(__pyx_t_4);
16136 __Pyx_XDECREF(__pyx_t_5);
16137 __Pyx_XDECREF(__pyx_t_6);
16138 __Pyx_XDECREF(__pyx_t_7);
16139 __Pyx_XDECREF(__pyx_t_8);
16140 __Pyx_AddTraceback(
"PyClical.sinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16143 __Pyx_XGIVEREF(__pyx_r);
16144 __Pyx_RefNannyFinishContext();
16149 static PyObject *__pyx_pw_8PyClical_63sinh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
16150 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 ";
16151 static PyObject *__pyx_pw_8PyClical_63sinh(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
16152 PyObject *__pyx_r = 0;
16153 __Pyx_RefNannyDeclarations
16154 __Pyx_RefNannySetupContext(
"sinh (wrapper)", 0);
16155 __pyx_r = __pyx_pf_8PyClical_62sinh(__pyx_self, ((PyObject *)__pyx_v_obj));
16158 __Pyx_RefNannyFinishContext();
16162 static PyObject *__pyx_pf_8PyClical_62sinh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
16163 PyObject *__pyx_r = NULL;
16164 __Pyx_RefNannyDeclarations
16165 PyObject *__pyx_t_1 = NULL;
16166 __Pyx_RefNannySetupContext(
"sinh", 0);
16167 __Pyx_XDECREF(__pyx_r);
16168 __pyx_t_1 = __pyx_f_8PyClical_sinh(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1718, __pyx_L1_error)
16169 __Pyx_GOTREF(__pyx_t_1);
16170 __pyx_r = __pyx_t_1;
16176 __Pyx_XDECREF(__pyx_t_1);
16177 __Pyx_AddTraceback(
"PyClical.sinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16180 __Pyx_XGIVEREF(__pyx_r);
16181 __Pyx_RefNannyFinishContext();
16193 static PyObject *__pyx_pw_8PyClical_65asinh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16194 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) {
16195 PyObject *__pyx_v_i = ((PyObject *)Py_None);
16196 PyObject *__pyx_r = NULL;
16197 __Pyx_RefNannyDeclarations
16200 PyObject *__pyx_t_3 = NULL;
16202 PyObject *__pyx_t_5 = NULL;
16203 PyObject *__pyx_t_6 = NULL;
16204 PyObject *__pyx_t_7 = NULL;
16205 PyObject *__pyx_t_8 = NULL;
16206 PyObject *__pyx_t_9 = NULL;
16207 PyObject *__pyx_t_10 = NULL;
16208 PyObject *__pyx_t_11 = NULL;
16209 __Pyx_RefNannySetupContext(
"asinh", 0);
16210 if (__pyx_optional_args) {
16211 if (__pyx_optional_args->__pyx_n > 0) {
16212 __pyx_v_i = __pyx_optional_args->i;
16223 __pyx_t_1 = (__pyx_v_i != Py_None);
16224 __pyx_t_2 = (__pyx_t_1 != 0);
16234 __Pyx_XDECREF(__pyx_r);
16235 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1744, __pyx_L1_error)
16236 __Pyx_GOTREF(__pyx_t_3);
16238 __pyx_t_4 =
asinh(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
16240 __Pyx_CppExn2PyErr();
16241 __PYX_ERR(0, 1744, __pyx_L1_error)
16243 __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)
16244 __Pyx_GOTREF(__pyx_t_5);
16245 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16246 __pyx_r = __pyx_t_5;
16268 __Pyx_PyThreadState_declare
16269 __Pyx_PyThreadState_assign
16270 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
16271 __Pyx_XGOTREF(__pyx_t_6);
16272 __Pyx_XGOTREF(__pyx_t_7);
16273 __Pyx_XGOTREF(__pyx_t_8);
16283 __Pyx_XDECREF(__pyx_r);
16284 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1747, __pyx_L4_error)
16285 __Pyx_GOTREF(__pyx_t_3);
16286 __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)
16287 __Pyx_GOTREF(__pyx_t_9);
16288 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16290 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
16291 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
16292 if (likely(__pyx_t_3)) {
16293 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
16294 __Pyx_INCREF(__pyx_t_3);
16295 __Pyx_INCREF(
function);
16296 __Pyx_DECREF_SET(__pyx_t_9,
function);
16299 __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);
16300 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16301 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1747, __pyx_L4_error)
16302 __Pyx_GOTREF(__pyx_t_5);
16303 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16304 __pyx_r = __pyx_t_5;
16306 goto __pyx_L8_try_return;
16317 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16318 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16319 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
16329 __Pyx_AddTraceback(
"PyClical.asinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16330 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1748, __pyx_L6_except_error)
16331 __Pyx_GOTREF(__pyx_t_5);
16332 __Pyx_GOTREF(__pyx_t_9);
16333 __Pyx_GOTREF(__pyx_t_3);
16342 __Pyx_XDECREF(__pyx_r);
16343 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1749, __pyx_L6_except_error)
16344 __Pyx_GOTREF(__pyx_t_10);
16345 __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)
16346 __Pyx_GOTREF(__pyx_t_11);
16347 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16348 __pyx_r = __pyx_t_11;
16350 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16351 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16352 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16353 goto __pyx_L7_except_return;
16355 __pyx_L6_except_error:;
16364 __Pyx_XGIVEREF(__pyx_t_6);
16365 __Pyx_XGIVEREF(__pyx_t_7);
16366 __Pyx_XGIVEREF(__pyx_t_8);
16367 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16368 goto __pyx_L1_error;
16369 __pyx_L8_try_return:;
16370 __Pyx_XGIVEREF(__pyx_t_6);
16371 __Pyx_XGIVEREF(__pyx_t_7);
16372 __Pyx_XGIVEREF(__pyx_t_8);
16373 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16375 __pyx_L7_except_return:;
16376 __Pyx_XGIVEREF(__pyx_t_6);
16377 __Pyx_XGIVEREF(__pyx_t_7);
16378 __Pyx_XGIVEREF(__pyx_t_8);
16379 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16394 __Pyx_XDECREF(__pyx_t_3);
16395 __Pyx_XDECREF(__pyx_t_5);
16396 __Pyx_XDECREF(__pyx_t_9);
16397 __Pyx_XDECREF(__pyx_t_10);
16398 __Pyx_XDECREF(__pyx_t_11);
16399 __Pyx_AddTraceback(
"PyClical.asinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16402 __Pyx_XGIVEREF(__pyx_r);
16403 __Pyx_RefNannyFinishContext();
16408 static PyObject *__pyx_pw_8PyClical_65asinh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16409 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 ";
16410 static PyObject *__pyx_pw_8PyClical_65asinh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16411 PyObject *__pyx_v_obj = 0;
16412 PyObject *__pyx_v_i = 0;
16413 PyObject *__pyx_r = 0;
16414 __Pyx_RefNannyDeclarations
16415 __Pyx_RefNannySetupContext(
"asinh (wrapper)", 0);
16417 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
16418 PyObject* values[2] = {0,0};
16419 values[1] = ((PyObject *)Py_None);
16420 if (unlikely(__pyx_kwds)) {
16421 Py_ssize_t kw_args;
16422 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16423 switch (pos_args) {
16424 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16425 CYTHON_FALLTHROUGH;
16426 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16427 CYTHON_FALLTHROUGH;
16429 default:
goto __pyx_L5_argtuple_error;
16431 kw_args = PyDict_Size(__pyx_kwds);
16432 switch (pos_args) {
16434 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
16435 else goto __pyx_L5_argtuple_error;
16436 CYTHON_FALLTHROUGH;
16439 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
16440 if (value) { values[1] = value; kw_args--; }
16443 if (unlikely(kw_args > 0)) {
16444 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"asinh") < 0)) __PYX_ERR(0, 1732, __pyx_L3_error)
16447 switch (PyTuple_GET_SIZE(__pyx_args)) {
16448 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16449 CYTHON_FALLTHROUGH;
16450 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16452 default:
goto __pyx_L5_argtuple_error;
16455 __pyx_v_obj = values[0];
16456 __pyx_v_i = values[1];
16458 goto __pyx_L4_argument_unpacking_done;
16459 __pyx_L5_argtuple_error:;
16460 __Pyx_RaiseArgtupleInvalid(
"asinh", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1732, __pyx_L3_error)
16462 __Pyx_AddTraceback(
"PyClical.asinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16463 __Pyx_RefNannyFinishContext();
16465 __pyx_L4_argument_unpacking_done:;
16466 __pyx_r = __pyx_pf_8PyClical_64asinh(__pyx_self, __pyx_v_obj, __pyx_v_i);
16469 __Pyx_RefNannyFinishContext();
16473 static PyObject *__pyx_pf_8PyClical_64asinh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
16474 PyObject *__pyx_r = NULL;
16475 __Pyx_RefNannyDeclarations
16476 PyObject *__pyx_t_1 = NULL;
16477 struct __pyx_opt_args_8PyClical_asinh __pyx_t_2;
16478 __Pyx_RefNannySetupContext(
"asinh", 0);
16479 __Pyx_XDECREF(__pyx_r);
16480 __pyx_t_2.__pyx_n = 1;
16481 __pyx_t_2.i = __pyx_v_i;
16482 __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)
16483 __Pyx_GOTREF(__pyx_t_1);
16484 __pyx_r = __pyx_t_1;
16490 __Pyx_XDECREF(__pyx_t_1);
16491 __Pyx_AddTraceback(
"PyClical.asinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
16494 __Pyx_XGIVEREF(__pyx_r);
16495 __Pyx_RefNannyFinishContext();
16507 static PyObject *__pyx_pw_8PyClical_67tan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16508 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) {
16509 PyObject *__pyx_v_i = ((PyObject *)Py_None);
16510 PyObject *__pyx_r = NULL;
16511 __Pyx_RefNannyDeclarations
16514 PyObject *__pyx_t_3 = NULL;
16516 PyObject *__pyx_t_5 = NULL;
16517 PyObject *__pyx_t_6 = NULL;
16518 PyObject *__pyx_t_7 = NULL;
16519 PyObject *__pyx_t_8 = NULL;
16520 PyObject *__pyx_t_9 = NULL;
16521 PyObject *__pyx_t_10 = NULL;
16522 PyObject *__pyx_t_11 = NULL;
16523 __Pyx_RefNannySetupContext(
"tan", 0);
16524 if (__pyx_optional_args) {
16525 if (__pyx_optional_args->__pyx_n > 0) {
16526 __pyx_v_i = __pyx_optional_args->i;
16537 __pyx_t_1 = (__pyx_v_i != Py_None);
16538 __pyx_t_2 = (__pyx_t_1 != 0);
16548 __Pyx_XDECREF(__pyx_r);
16549 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1761, __pyx_L1_error)
16550 __Pyx_GOTREF(__pyx_t_3);
16552 __pyx_t_4 =
tan(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
16554 __Pyx_CppExn2PyErr();
16555 __PYX_ERR(0, 1761, __pyx_L1_error)
16557 __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)
16558 __Pyx_GOTREF(__pyx_t_5);
16559 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16560 __pyx_r = __pyx_t_5;
16582 __Pyx_PyThreadState_declare
16583 __Pyx_PyThreadState_assign
16584 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
16585 __Pyx_XGOTREF(__pyx_t_6);
16586 __Pyx_XGOTREF(__pyx_t_7);
16587 __Pyx_XGOTREF(__pyx_t_8);
16597 __Pyx_XDECREF(__pyx_r);
16598 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1764, __pyx_L4_error)
16599 __Pyx_GOTREF(__pyx_t_3);
16600 __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)
16601 __Pyx_GOTREF(__pyx_t_9);
16602 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16604 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
16605 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
16606 if (likely(__pyx_t_3)) {
16607 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
16608 __Pyx_INCREF(__pyx_t_3);
16609 __Pyx_INCREF(
function);
16610 __Pyx_DECREF_SET(__pyx_t_9,
function);
16613 __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);
16614 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16615 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1764, __pyx_L4_error)
16616 __Pyx_GOTREF(__pyx_t_5);
16617 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16618 __pyx_r = __pyx_t_5;
16620 goto __pyx_L8_try_return;
16631 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16632 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16633 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
16643 __Pyx_AddTraceback(
"PyClical.tan", __pyx_clineno, __pyx_lineno, __pyx_filename);
16644 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1765, __pyx_L6_except_error)
16645 __Pyx_GOTREF(__pyx_t_5);
16646 __Pyx_GOTREF(__pyx_t_9);
16647 __Pyx_GOTREF(__pyx_t_3);
16656 __Pyx_XDECREF(__pyx_r);
16657 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1766, __pyx_L6_except_error)
16658 __Pyx_GOTREF(__pyx_t_10);
16659 __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)
16660 __Pyx_GOTREF(__pyx_t_11);
16661 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16662 __pyx_r = __pyx_t_11;
16664 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16665 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16666 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16667 goto __pyx_L7_except_return;
16669 __pyx_L6_except_error:;
16678 __Pyx_XGIVEREF(__pyx_t_6);
16679 __Pyx_XGIVEREF(__pyx_t_7);
16680 __Pyx_XGIVEREF(__pyx_t_8);
16681 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16682 goto __pyx_L1_error;
16683 __pyx_L8_try_return:;
16684 __Pyx_XGIVEREF(__pyx_t_6);
16685 __Pyx_XGIVEREF(__pyx_t_7);
16686 __Pyx_XGIVEREF(__pyx_t_8);
16687 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16689 __pyx_L7_except_return:;
16690 __Pyx_XGIVEREF(__pyx_t_6);
16691 __Pyx_XGIVEREF(__pyx_t_7);
16692 __Pyx_XGIVEREF(__pyx_t_8);
16693 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16708 __Pyx_XDECREF(__pyx_t_3);
16709 __Pyx_XDECREF(__pyx_t_5);
16710 __Pyx_XDECREF(__pyx_t_9);
16711 __Pyx_XDECREF(__pyx_t_10);
16712 __Pyx_XDECREF(__pyx_t_11);
16713 __Pyx_AddTraceback(
"PyClical.tan", __pyx_clineno, __pyx_lineno, __pyx_filename);
16716 __Pyx_XGIVEREF(__pyx_r);
16717 __Pyx_RefNannyFinishContext();
16722 static PyObject *__pyx_pw_8PyClical_67tan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16723 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 ";
16724 static PyObject *__pyx_pw_8PyClical_67tan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16725 PyObject *__pyx_v_obj = 0;
16726 PyObject *__pyx_v_i = 0;
16727 PyObject *__pyx_r = 0;
16728 __Pyx_RefNannyDeclarations
16729 __Pyx_RefNannySetupContext(
"tan (wrapper)", 0);
16731 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
16732 PyObject* values[2] = {0,0};
16733 values[1] = ((PyObject *)Py_None);
16734 if (unlikely(__pyx_kwds)) {
16735 Py_ssize_t kw_args;
16736 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16737 switch (pos_args) {
16738 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16739 CYTHON_FALLTHROUGH;
16740 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16741 CYTHON_FALLTHROUGH;
16743 default:
goto __pyx_L5_argtuple_error;
16745 kw_args = PyDict_Size(__pyx_kwds);
16746 switch (pos_args) {
16748 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
16749 else goto __pyx_L5_argtuple_error;
16750 CYTHON_FALLTHROUGH;
16753 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
16754 if (value) { values[1] = value; kw_args--; }
16757 if (unlikely(kw_args > 0)) {
16758 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"tan") < 0)) __PYX_ERR(0, 1751, __pyx_L3_error)
16761 switch (PyTuple_GET_SIZE(__pyx_args)) {
16762 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16763 CYTHON_FALLTHROUGH;
16764 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16766 default:
goto __pyx_L5_argtuple_error;
16769 __pyx_v_obj = values[0];
16770 __pyx_v_i = values[1];
16772 goto __pyx_L4_argument_unpacking_done;
16773 __pyx_L5_argtuple_error:;
16774 __Pyx_RaiseArgtupleInvalid(
"tan", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1751, __pyx_L3_error)
16776 __Pyx_AddTraceback(
"PyClical.tan", __pyx_clineno, __pyx_lineno, __pyx_filename);
16777 __Pyx_RefNannyFinishContext();
16779 __pyx_L4_argument_unpacking_done:;
16780 __pyx_r = __pyx_pf_8PyClical_66tan(__pyx_self, __pyx_v_obj, __pyx_v_i);
16783 __Pyx_RefNannyFinishContext();
16787 static PyObject *__pyx_pf_8PyClical_66tan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
16788 PyObject *__pyx_r = NULL;
16789 __Pyx_RefNannyDeclarations
16790 PyObject *__pyx_t_1 = NULL;
16791 struct __pyx_opt_args_8PyClical_tan __pyx_t_2;
16792 __Pyx_RefNannySetupContext(
"tan", 0);
16793 __Pyx_XDECREF(__pyx_r);
16794 __pyx_t_2.__pyx_n = 1;
16795 __pyx_t_2.i = __pyx_v_i;
16796 __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)
16797 __Pyx_GOTREF(__pyx_t_1);
16798 __pyx_r = __pyx_t_1;
16804 __Pyx_XDECREF(__pyx_t_1);
16805 __Pyx_AddTraceback(
"PyClical.tan", __pyx_clineno, __pyx_lineno, __pyx_filename);
16808 __Pyx_XGIVEREF(__pyx_r);
16809 __Pyx_RefNannyFinishContext();
16821 static PyObject *__pyx_pw_8PyClical_69atan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16822 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) {
16823 PyObject *__pyx_v_i = ((PyObject *)Py_None);
16824 PyObject *__pyx_r = NULL;
16825 __Pyx_RefNannyDeclarations
16828 PyObject *__pyx_t_3 = NULL;
16830 PyObject *__pyx_t_5 = NULL;
16831 PyObject *__pyx_t_6 = NULL;
16832 PyObject *__pyx_t_7 = NULL;
16833 PyObject *__pyx_t_8 = NULL;
16834 PyObject *__pyx_t_9 = NULL;
16835 PyObject *__pyx_t_10 = NULL;
16836 PyObject *__pyx_t_11 = NULL;
16837 __Pyx_RefNannySetupContext(
"atan", 0);
16838 if (__pyx_optional_args) {
16839 if (__pyx_optional_args->__pyx_n > 0) {
16840 __pyx_v_i = __pyx_optional_args->i;
16851 __pyx_t_1 = (__pyx_v_i != Py_None);
16852 __pyx_t_2 = (__pyx_t_1 != 0);
16862 __Pyx_XDECREF(__pyx_r);
16863 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1778, __pyx_L1_error)
16864 __Pyx_GOTREF(__pyx_t_3);
16866 __pyx_t_4 =
atan(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
16868 __Pyx_CppExn2PyErr();
16869 __PYX_ERR(0, 1778, __pyx_L1_error)
16871 __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)
16872 __Pyx_GOTREF(__pyx_t_5);
16873 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16874 __pyx_r = __pyx_t_5;
16896 __Pyx_PyThreadState_declare
16897 __Pyx_PyThreadState_assign
16898 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
16899 __Pyx_XGOTREF(__pyx_t_6);
16900 __Pyx_XGOTREF(__pyx_t_7);
16901 __Pyx_XGOTREF(__pyx_t_8);
16911 __Pyx_XDECREF(__pyx_r);
16912 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1781, __pyx_L4_error)
16913 __Pyx_GOTREF(__pyx_t_3);
16914 __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)
16915 __Pyx_GOTREF(__pyx_t_9);
16916 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16918 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
16919 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
16920 if (likely(__pyx_t_3)) {
16921 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
16922 __Pyx_INCREF(__pyx_t_3);
16923 __Pyx_INCREF(
function);
16924 __Pyx_DECREF_SET(__pyx_t_9,
function);
16927 __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);
16928 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16929 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1781, __pyx_L4_error)
16930 __Pyx_GOTREF(__pyx_t_5);
16931 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16932 __pyx_r = __pyx_t_5;
16934 goto __pyx_L8_try_return;
16945 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16946 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16947 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
16957 __Pyx_AddTraceback(
"PyClical.atan", __pyx_clineno, __pyx_lineno, __pyx_filename);
16958 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1782, __pyx_L6_except_error)
16959 __Pyx_GOTREF(__pyx_t_5);
16960 __Pyx_GOTREF(__pyx_t_9);
16961 __Pyx_GOTREF(__pyx_t_3);
16970 __Pyx_XDECREF(__pyx_r);
16971 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1783, __pyx_L6_except_error)
16972 __Pyx_GOTREF(__pyx_t_10);
16973 __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)
16974 __Pyx_GOTREF(__pyx_t_11);
16975 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16976 __pyx_r = __pyx_t_11;
16978 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16979 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16980 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16981 goto __pyx_L7_except_return;
16983 __pyx_L6_except_error:;
16992 __Pyx_XGIVEREF(__pyx_t_6);
16993 __Pyx_XGIVEREF(__pyx_t_7);
16994 __Pyx_XGIVEREF(__pyx_t_8);
16995 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16996 goto __pyx_L1_error;
16997 __pyx_L8_try_return:;
16998 __Pyx_XGIVEREF(__pyx_t_6);
16999 __Pyx_XGIVEREF(__pyx_t_7);
17000 __Pyx_XGIVEREF(__pyx_t_8);
17001 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17003 __pyx_L7_except_return:;
17004 __Pyx_XGIVEREF(__pyx_t_6);
17005 __Pyx_XGIVEREF(__pyx_t_7);
17006 __Pyx_XGIVEREF(__pyx_t_8);
17007 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17022 __Pyx_XDECREF(__pyx_t_3);
17023 __Pyx_XDECREF(__pyx_t_5);
17024 __Pyx_XDECREF(__pyx_t_9);
17025 __Pyx_XDECREF(__pyx_t_10);
17026 __Pyx_XDECREF(__pyx_t_11);
17027 __Pyx_AddTraceback(
"PyClical.atan", __pyx_clineno, __pyx_lineno, __pyx_filename);
17030 __Pyx_XGIVEREF(__pyx_r);
17031 __Pyx_RefNannyFinishContext();
17036 static PyObject *__pyx_pw_8PyClical_69atan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17037 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 ";
17038 static PyObject *__pyx_pw_8PyClical_69atan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17039 PyObject *__pyx_v_obj = 0;
17040 PyObject *__pyx_v_i = 0;
17041 PyObject *__pyx_r = 0;
17042 __Pyx_RefNannyDeclarations
17043 __Pyx_RefNannySetupContext(
"atan (wrapper)", 0);
17045 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
17046 PyObject* values[2] = {0,0};
17047 values[1] = ((PyObject *)Py_None);
17048 if (unlikely(__pyx_kwds)) {
17049 Py_ssize_t kw_args;
17050 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17051 switch (pos_args) {
17052 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17053 CYTHON_FALLTHROUGH;
17054 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17055 CYTHON_FALLTHROUGH;
17057 default:
goto __pyx_L5_argtuple_error;
17059 kw_args = PyDict_Size(__pyx_kwds);
17060 switch (pos_args) {
17062 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
17063 else goto __pyx_L5_argtuple_error;
17064 CYTHON_FALLTHROUGH;
17067 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
17068 if (value) { values[1] = value; kw_args--; }
17071 if (unlikely(kw_args > 0)) {
17072 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"atan") < 0)) __PYX_ERR(0, 1768, __pyx_L3_error)
17075 switch (PyTuple_GET_SIZE(__pyx_args)) {
17076 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17077 CYTHON_FALLTHROUGH;
17078 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17080 default:
goto __pyx_L5_argtuple_error;
17083 __pyx_v_obj = values[0];
17084 __pyx_v_i = values[1];
17086 goto __pyx_L4_argument_unpacking_done;
17087 __pyx_L5_argtuple_error:;
17088 __Pyx_RaiseArgtupleInvalid(
"atan", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1768, __pyx_L3_error)
17090 __Pyx_AddTraceback(
"PyClical.atan", __pyx_clineno, __pyx_lineno, __pyx_filename);
17091 __Pyx_RefNannyFinishContext();
17093 __pyx_L4_argument_unpacking_done:;
17094 __pyx_r = __pyx_pf_8PyClical_68atan(__pyx_self, __pyx_v_obj, __pyx_v_i);
17097 __Pyx_RefNannyFinishContext();
17101 static PyObject *__pyx_pf_8PyClical_68atan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
17102 PyObject *__pyx_r = NULL;
17103 __Pyx_RefNannyDeclarations
17104 PyObject *__pyx_t_1 = NULL;
17105 struct __pyx_opt_args_8PyClical_atan __pyx_t_2;
17106 __Pyx_RefNannySetupContext(
"atan", 0);
17107 __Pyx_XDECREF(__pyx_r);
17108 __pyx_t_2.__pyx_n = 1;
17109 __pyx_t_2.i = __pyx_v_i;
17110 __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)
17111 __Pyx_GOTREF(__pyx_t_1);
17112 __pyx_r = __pyx_t_1;
17118 __Pyx_XDECREF(__pyx_t_1);
17119 __Pyx_AddTraceback(
"PyClical.atan", __pyx_clineno, __pyx_lineno, __pyx_filename);
17122 __Pyx_XGIVEREF(__pyx_r);
17123 __Pyx_RefNannyFinishContext();
17135 static PyObject *__pyx_pw_8PyClical_71tanh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
17136 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_tanh(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
17137 PyObject *__pyx_r = NULL;
17138 __Pyx_RefNannyDeclarations
17139 PyObject *__pyx_t_1 = NULL;
17140 PyObject *__pyx_t_2 = NULL;
17141 PyObject *__pyx_t_3 = NULL;
17142 PyObject *__pyx_t_4 = NULL;
17143 PyObject *__pyx_t_5 = NULL;
17144 PyObject *__pyx_t_6 = NULL;
17145 PyObject *__pyx_t_7 = NULL;
17146 PyObject *__pyx_t_8 = NULL;
17147 __Pyx_RefNannySetupContext(
"tanh", 0);
17157 __Pyx_PyThreadState_declare
17158 __Pyx_PyThreadState_assign
17159 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
17160 __Pyx_XGOTREF(__pyx_t_1);
17161 __Pyx_XGOTREF(__pyx_t_2);
17162 __Pyx_XGOTREF(__pyx_t_3);
17172 __Pyx_XDECREF(__pyx_r);
17173 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1793, __pyx_L3_error)
17174 __Pyx_GOTREF(__pyx_t_5);
17175 __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)
17176 __Pyx_GOTREF(__pyx_t_6);
17177 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17179 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
17180 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
17181 if (likely(__pyx_t_5)) {
17182 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
17183 __Pyx_INCREF(__pyx_t_5);
17184 __Pyx_INCREF(
function);
17185 __Pyx_DECREF_SET(__pyx_t_6,
function);
17188 __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);
17189 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17190 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1793, __pyx_L3_error)
17191 __Pyx_GOTREF(__pyx_t_4);
17192 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17193 __pyx_r = __pyx_t_4;
17195 goto __pyx_L7_try_return;
17206 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
17207 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17208 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
17218 __Pyx_AddTraceback(
"PyClical.tanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17219 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(0, 1794, __pyx_L5_except_error)
17220 __Pyx_GOTREF(__pyx_t_4);
17221 __Pyx_GOTREF(__pyx_t_6);
17222 __Pyx_GOTREF(__pyx_t_5);
17231 __Pyx_XDECREF(__pyx_r);
17232 __pyx_t_7 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1795, __pyx_L5_except_error)
17233 __Pyx_GOTREF(__pyx_t_7);
17234 __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)
17235 __Pyx_GOTREF(__pyx_t_8);
17236 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
17237 __pyx_r = __pyx_t_8;
17239 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17240 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17241 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17242 goto __pyx_L6_except_return;
17244 __pyx_L5_except_error:;
17253 __Pyx_XGIVEREF(__pyx_t_1);
17254 __Pyx_XGIVEREF(__pyx_t_2);
17255 __Pyx_XGIVEREF(__pyx_t_3);
17256 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
17257 goto __pyx_L1_error;
17258 __pyx_L7_try_return:;
17259 __Pyx_XGIVEREF(__pyx_t_1);
17260 __Pyx_XGIVEREF(__pyx_t_2);
17261 __Pyx_XGIVEREF(__pyx_t_3);
17262 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
17264 __pyx_L6_except_return:;
17265 __Pyx_XGIVEREF(__pyx_t_1);
17266 __Pyx_XGIVEREF(__pyx_t_2);
17267 __Pyx_XGIVEREF(__pyx_t_3);
17268 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
17282 __Pyx_XDECREF(__pyx_t_4);
17283 __Pyx_XDECREF(__pyx_t_5);
17284 __Pyx_XDECREF(__pyx_t_6);
17285 __Pyx_XDECREF(__pyx_t_7);
17286 __Pyx_XDECREF(__pyx_t_8);
17287 __Pyx_AddTraceback(
"PyClical.tanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17290 __Pyx_XGIVEREF(__pyx_r);
17291 __Pyx_RefNannyFinishContext();
17296 static PyObject *__pyx_pw_8PyClical_71tanh(PyObject *__pyx_self, PyObject *__pyx_v_obj);
17297 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 ";
17298 static PyObject *__pyx_pw_8PyClical_71tanh(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
17299 PyObject *__pyx_r = 0;
17300 __Pyx_RefNannyDeclarations
17301 __Pyx_RefNannySetupContext(
"tanh (wrapper)", 0);
17302 __pyx_r = __pyx_pf_8PyClical_70tanh(__pyx_self, ((PyObject *)__pyx_v_obj));
17305 __Pyx_RefNannyFinishContext();
17309 static PyObject *__pyx_pf_8PyClical_70tanh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
17310 PyObject *__pyx_r = NULL;
17311 __Pyx_RefNannyDeclarations
17312 PyObject *__pyx_t_1 = NULL;
17313 __Pyx_RefNannySetupContext(
"tanh", 0);
17314 __Pyx_XDECREF(__pyx_r);
17315 __pyx_t_1 = __pyx_f_8PyClical_tanh(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1785, __pyx_L1_error)
17316 __Pyx_GOTREF(__pyx_t_1);
17317 __pyx_r = __pyx_t_1;
17323 __Pyx_XDECREF(__pyx_t_1);
17324 __Pyx_AddTraceback(
"PyClical.tanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17327 __Pyx_XGIVEREF(__pyx_r);
17328 __Pyx_RefNannyFinishContext();
17340 static PyObject *__pyx_pw_8PyClical_73atanh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17341 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) {
17342 PyObject *__pyx_v_i = ((PyObject *)Py_None);
17343 PyObject *__pyx_r = NULL;
17344 __Pyx_RefNannyDeclarations
17347 PyObject *__pyx_t_3 = NULL;
17349 PyObject *__pyx_t_5 = NULL;
17350 PyObject *__pyx_t_6 = NULL;
17351 PyObject *__pyx_t_7 = NULL;
17352 PyObject *__pyx_t_8 = NULL;
17353 PyObject *__pyx_t_9 = NULL;
17354 PyObject *__pyx_t_10 = NULL;
17355 PyObject *__pyx_t_11 = NULL;
17356 __Pyx_RefNannySetupContext(
"atanh", 0);
17357 if (__pyx_optional_args) {
17358 if (__pyx_optional_args->__pyx_n > 0) {
17359 __pyx_v_i = __pyx_optional_args->i;
17370 __pyx_t_1 = (__pyx_v_i != Py_None);
17371 __pyx_t_2 = (__pyx_t_1 != 0);
17381 __Pyx_XDECREF(__pyx_r);
17382 __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1807, __pyx_L1_error)
17383 __Pyx_GOTREF(__pyx_t_3);
17385 __pyx_t_4 =
atanh(__pyx_f_8PyClical_toClifford(__pyx_v_obj), __pyx_f_8PyClical_toClifford(__pyx_v_i));
17387 __Pyx_CppExn2PyErr();
17388 __PYX_ERR(0, 1807, __pyx_L1_error)
17390 __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)
17391 __Pyx_GOTREF(__pyx_t_5);
17392 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17393 __pyx_r = __pyx_t_5;
17415 __Pyx_PyThreadState_declare
17416 __Pyx_PyThreadState_assign
17417 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
17418 __Pyx_XGOTREF(__pyx_t_6);
17419 __Pyx_XGOTREF(__pyx_t_7);
17420 __Pyx_XGOTREF(__pyx_t_8);
17430 __Pyx_XDECREF(__pyx_r);
17431 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1810, __pyx_L4_error)
17432 __Pyx_GOTREF(__pyx_t_3);
17433 __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)
17434 __Pyx_GOTREF(__pyx_t_9);
17435 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17437 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
17438 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
17439 if (likely(__pyx_t_3)) {
17440 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
17441 __Pyx_INCREF(__pyx_t_3);
17442 __Pyx_INCREF(
function);
17443 __Pyx_DECREF_SET(__pyx_t_9,
function);
17446 __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);
17447 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17448 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1810, __pyx_L4_error)
17449 __Pyx_GOTREF(__pyx_t_5);
17450 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17451 __pyx_r = __pyx_t_5;
17453 goto __pyx_L8_try_return;
17464 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17465 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17466 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
17476 __Pyx_AddTraceback(
"PyClical.atanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17477 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1811, __pyx_L6_except_error)
17478 __Pyx_GOTREF(__pyx_t_5);
17479 __Pyx_GOTREF(__pyx_t_9);
17480 __Pyx_GOTREF(__pyx_t_3);
17489 __Pyx_XDECREF(__pyx_r);
17490 __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1812, __pyx_L6_except_error)
17491 __Pyx_GOTREF(__pyx_t_10);
17492 __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)
17493 __Pyx_GOTREF(__pyx_t_11);
17494 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
17495 __pyx_r = __pyx_t_11;
17497 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17498 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17499 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17500 goto __pyx_L7_except_return;
17502 __pyx_L6_except_error:;
17511 __Pyx_XGIVEREF(__pyx_t_6);
17512 __Pyx_XGIVEREF(__pyx_t_7);
17513 __Pyx_XGIVEREF(__pyx_t_8);
17514 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17515 goto __pyx_L1_error;
17516 __pyx_L8_try_return:;
17517 __Pyx_XGIVEREF(__pyx_t_6);
17518 __Pyx_XGIVEREF(__pyx_t_7);
17519 __Pyx_XGIVEREF(__pyx_t_8);
17520 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17522 __pyx_L7_except_return:;
17523 __Pyx_XGIVEREF(__pyx_t_6);
17524 __Pyx_XGIVEREF(__pyx_t_7);
17525 __Pyx_XGIVEREF(__pyx_t_8);
17526 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
17541 __Pyx_XDECREF(__pyx_t_3);
17542 __Pyx_XDECREF(__pyx_t_5);
17543 __Pyx_XDECREF(__pyx_t_9);
17544 __Pyx_XDECREF(__pyx_t_10);
17545 __Pyx_XDECREF(__pyx_t_11);
17546 __Pyx_AddTraceback(
"PyClical.atanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17549 __Pyx_XGIVEREF(__pyx_r);
17550 __Pyx_RefNannyFinishContext();
17555 static PyObject *__pyx_pw_8PyClical_73atanh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17556 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 ";
17557 static PyObject *__pyx_pw_8PyClical_73atanh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17558 PyObject *__pyx_v_obj = 0;
17559 PyObject *__pyx_v_i = 0;
17560 PyObject *__pyx_r = 0;
17561 __Pyx_RefNannyDeclarations
17562 __Pyx_RefNannySetupContext(
"atanh (wrapper)", 0);
17564 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_i,0};
17565 PyObject* values[2] = {0,0};
17566 values[1] = ((PyObject *)Py_None);
17567 if (unlikely(__pyx_kwds)) {
17568 Py_ssize_t kw_args;
17569 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17570 switch (pos_args) {
17571 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17572 CYTHON_FALLTHROUGH;
17573 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17574 CYTHON_FALLTHROUGH;
17576 default:
goto __pyx_L5_argtuple_error;
17578 kw_args = PyDict_Size(__pyx_kwds);
17579 switch (pos_args) {
17581 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
17582 else goto __pyx_L5_argtuple_error;
17583 CYTHON_FALLTHROUGH;
17586 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i);
17587 if (value) { values[1] = value; kw_args--; }
17590 if (unlikely(kw_args > 0)) {
17591 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"atanh") < 0)) __PYX_ERR(0, 1797, __pyx_L3_error)
17594 switch (PyTuple_GET_SIZE(__pyx_args)) {
17595 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17596 CYTHON_FALLTHROUGH;
17597 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17599 default:
goto __pyx_L5_argtuple_error;
17602 __pyx_v_obj = values[0];
17603 __pyx_v_i = values[1];
17605 goto __pyx_L4_argument_unpacking_done;
17606 __pyx_L5_argtuple_error:;
17607 __Pyx_RaiseArgtupleInvalid(
"atanh", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1797, __pyx_L3_error)
17609 __Pyx_AddTraceback(
"PyClical.atanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17610 __Pyx_RefNannyFinishContext();
17612 __pyx_L4_argument_unpacking_done:;
17613 __pyx_r = __pyx_pf_8PyClical_72atanh(__pyx_self, __pyx_v_obj, __pyx_v_i);
17616 __Pyx_RefNannyFinishContext();
17620 static PyObject *__pyx_pf_8PyClical_72atanh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_i) {
17621 PyObject *__pyx_r = NULL;
17622 __Pyx_RefNannyDeclarations
17623 PyObject *__pyx_t_1 = NULL;
17624 struct __pyx_opt_args_8PyClical_atanh __pyx_t_2;
17625 __Pyx_RefNannySetupContext(
"atanh", 0);
17626 __Pyx_XDECREF(__pyx_r);
17627 __pyx_t_2.__pyx_n = 1;
17628 __pyx_t_2.i = __pyx_v_i;
17629 __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)
17630 __Pyx_GOTREF(__pyx_t_1);
17631 __pyx_r = __pyx_t_1;
17637 __Pyx_XDECREF(__pyx_t_1);
17638 __Pyx_AddTraceback(
"PyClical.atanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
17641 __Pyx_XGIVEREF(__pyx_r);
17642 __Pyx_RefNannyFinishContext();
17654 static PyObject *__pyx_pw_8PyClical_75random_clifford(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17655 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) {
17656 PyObject *__pyx_v_fill = ((PyObject *)__pyx_float_1_0);
17657 PyObject *__pyx_r = NULL;
17658 __Pyx_RefNannyDeclarations
17659 PyObject *__pyx_t_1 = NULL;
17660 PyObject *__pyx_t_2 = NULL;
17662 PyObject *__pyx_t_4 = NULL;
17663 __Pyx_RefNannySetupContext(
"random_clifford", 0);
17664 if (__pyx_optional_args) {
17665 if (__pyx_optional_args->__pyx_n > 0) {
17666 __pyx_v_fill = __pyx_optional_args->fill;
17677 __Pyx_XDECREF(__pyx_r);
17678 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1821, __pyx_L1_error)
17679 __Pyx_GOTREF(__pyx_t_1);
17680 __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1821, __pyx_L1_error)
17681 __Pyx_GOTREF(__pyx_t_2);
17682 __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)
17683 __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)
17684 __Pyx_GOTREF(__pyx_t_4);
17685 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17686 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17687 __pyx_r = __pyx_t_4;
17701 __Pyx_XDECREF(__pyx_t_1);
17702 __Pyx_XDECREF(__pyx_t_2);
17703 __Pyx_XDECREF(__pyx_t_4);
17704 __Pyx_AddTraceback(
"PyClical.random_clifford", __pyx_clineno, __pyx_lineno, __pyx_filename);
17707 __Pyx_XGIVEREF(__pyx_r);
17708 __Pyx_RefNannyFinishContext();
17713 static PyObject *__pyx_pw_8PyClical_75random_clifford(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17714 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 ";
17715 static PyObject *__pyx_pw_8PyClical_75random_clifford(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17716 struct __pyx_obj_8PyClical_index_set *__pyx_v_ixt = 0;
17717 PyObject *__pyx_v_fill = 0;
17718 PyObject *__pyx_r = 0;
17719 __Pyx_RefNannyDeclarations
17720 __Pyx_RefNannySetupContext(
"random_clifford (wrapper)", 0);
17722 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ixt,&__pyx_n_s_fill,0};
17723 PyObject* values[2] = {0,0};
17724 values[1] = ((PyObject *)__pyx_float_1_0);
17725 if (unlikely(__pyx_kwds)) {
17726 Py_ssize_t kw_args;
17727 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17728 switch (pos_args) {
17729 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17730 CYTHON_FALLTHROUGH;
17731 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17732 CYTHON_FALLTHROUGH;
17734 default:
goto __pyx_L5_argtuple_error;
17736 kw_args = PyDict_Size(__pyx_kwds);
17737 switch (pos_args) {
17739 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ixt)) != 0)) kw_args--;
17740 else goto __pyx_L5_argtuple_error;
17741 CYTHON_FALLTHROUGH;
17744 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fill);
17745 if (value) { values[1] = value; kw_args--; }
17748 if (unlikely(kw_args > 0)) {
17749 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"random_clifford") < 0)) __PYX_ERR(0, 1814, __pyx_L3_error)
17752 switch (PyTuple_GET_SIZE(__pyx_args)) {
17753 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17754 CYTHON_FALLTHROUGH;
17755 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17757 default:
goto __pyx_L5_argtuple_error;
17760 __pyx_v_ixt = ((
struct __pyx_obj_8PyClical_index_set *)values[0]);
17761 __pyx_v_fill = values[1];
17763 goto __pyx_L4_argument_unpacking_done;
17764 __pyx_L5_argtuple_error:;
17765 __Pyx_RaiseArgtupleInvalid(
"random_clifford", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1814, __pyx_L3_error)
17767 __Pyx_AddTraceback(
"PyClical.random_clifford", __pyx_clineno, __pyx_lineno, __pyx_filename);
17768 __Pyx_RefNannyFinishContext();
17770 __pyx_L4_argument_unpacking_done:;
17771 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ixt), __pyx_ptype_8PyClical_index_set, 1,
"ixt", 0))) __PYX_ERR(0, 1814, __pyx_L1_error)
17772 __pyx_r = __pyx_pf_8PyClical_74random_clifford(__pyx_self, __pyx_v_ixt, __pyx_v_fill);
17779 __Pyx_RefNannyFinishContext();
17783 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) {
17784 PyObject *__pyx_r = NULL;
17785 __Pyx_RefNannyDeclarations
17786 PyObject *__pyx_t_1 = NULL;
17787 struct __pyx_opt_args_8PyClical_random_clifford __pyx_t_2;
17788 __Pyx_RefNannySetupContext(
"random_clifford", 0);
17789 __Pyx_XDECREF(__pyx_r);
17790 __pyx_t_2.__pyx_n = 1;
17791 __pyx_t_2.fill = __pyx_v_fill;
17792 __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)
17793 __Pyx_GOTREF(__pyx_t_1);
17794 __pyx_r = __pyx_t_1;
17800 __Pyx_XDECREF(__pyx_t_1);
17801 __Pyx_AddTraceback(
"PyClical.random_clifford", __pyx_clineno, __pyx_lineno, __pyx_filename);
17804 __Pyx_XGIVEREF(__pyx_r);
17805 __Pyx_RefNannyFinishContext();
17817 static PyObject *__pyx_pw_8PyClical_77cga3(PyObject *__pyx_self, PyObject *__pyx_v_obj);
17818 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cga3(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
17819 PyObject *__pyx_r = NULL;
17820 __Pyx_RefNannyDeclarations
17821 PyObject *__pyx_t_1 = NULL;
17822 PyObject *__pyx_t_2 = NULL;
17823 __Pyx_RefNannySetupContext(
"cga3", 0);
17832 __Pyx_XDECREF(__pyx_r);
17833 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1830, __pyx_L1_error)
17834 __Pyx_GOTREF(__pyx_t_1);
17835 __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)
17836 __Pyx_GOTREF(__pyx_t_2);
17837 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17838 __pyx_r = __pyx_t_2;
17852 __Pyx_XDECREF(__pyx_t_1);
17853 __Pyx_XDECREF(__pyx_t_2);
17854 __Pyx_AddTraceback(
"PyClical.cga3", __pyx_clineno, __pyx_lineno, __pyx_filename);
17857 __Pyx_XGIVEREF(__pyx_r);
17858 __Pyx_RefNannyFinishContext();
17863 static PyObject *__pyx_pw_8PyClical_77cga3(PyObject *__pyx_self, PyObject *__pyx_v_obj);
17864 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 ";
17865 static PyObject *__pyx_pw_8PyClical_77cga3(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
17866 PyObject *__pyx_r = 0;
17867 __Pyx_RefNannyDeclarations
17868 __Pyx_RefNannySetupContext(
"cga3 (wrapper)", 0);
17869 __pyx_r = __pyx_pf_8PyClical_76cga3(__pyx_self, ((PyObject *)__pyx_v_obj));
17872 __Pyx_RefNannyFinishContext();
17876 static PyObject *__pyx_pf_8PyClical_76cga3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
17877 PyObject *__pyx_r = NULL;
17878 __Pyx_RefNannyDeclarations
17879 PyObject *__pyx_t_1 = NULL;
17880 __Pyx_RefNannySetupContext(
"cga3", 0);
17881 __Pyx_XDECREF(__pyx_r);
17882 __pyx_t_1 = __pyx_f_8PyClical_cga3(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1823, __pyx_L1_error)
17883 __Pyx_GOTREF(__pyx_t_1);
17884 __pyx_r = __pyx_t_1;
17890 __Pyx_XDECREF(__pyx_t_1);
17891 __Pyx_AddTraceback(
"PyClical.cga3", __pyx_clineno, __pyx_lineno, __pyx_filename);
17894 __Pyx_XGIVEREF(__pyx_r);
17895 __Pyx_RefNannyFinishContext();
17907 static PyObject *__pyx_pw_8PyClical_79cga3std(PyObject *__pyx_self, PyObject *__pyx_v_obj);
17908 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_cga3std(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
17909 PyObject *__pyx_r = NULL;
17910 __Pyx_RefNannyDeclarations
17911 PyObject *__pyx_t_1 = NULL;
17912 PyObject *__pyx_t_2 = NULL;
17913 __Pyx_RefNannySetupContext(
"cga3std", 0);
17922 __Pyx_XDECREF(__pyx_r);
17923 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1841, __pyx_L1_error)
17924 __Pyx_GOTREF(__pyx_t_1);
17925 __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)
17926 __Pyx_GOTREF(__pyx_t_2);
17927 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17928 __pyx_r = __pyx_t_2;
17942 __Pyx_XDECREF(__pyx_t_1);
17943 __Pyx_XDECREF(__pyx_t_2);
17944 __Pyx_AddTraceback(
"PyClical.cga3std", __pyx_clineno, __pyx_lineno, __pyx_filename);
17947 __Pyx_XGIVEREF(__pyx_r);
17948 __Pyx_RefNannyFinishContext();
17953 static PyObject *__pyx_pw_8PyClical_79cga3std(PyObject *__pyx_self, PyObject *__pyx_v_obj);
17954 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 ";
17955 static PyObject *__pyx_pw_8PyClical_79cga3std(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
17956 PyObject *__pyx_r = 0;
17957 __Pyx_RefNannyDeclarations
17958 __Pyx_RefNannySetupContext(
"cga3std (wrapper)", 0);
17959 __pyx_r = __pyx_pf_8PyClical_78cga3std(__pyx_self, ((PyObject *)__pyx_v_obj));
17962 __Pyx_RefNannyFinishContext();
17966 static PyObject *__pyx_pf_8PyClical_78cga3std(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
17967 PyObject *__pyx_r = NULL;
17968 __Pyx_RefNannyDeclarations
17969 PyObject *__pyx_t_1 = NULL;
17970 __Pyx_RefNannySetupContext(
"cga3std", 0);
17971 __Pyx_XDECREF(__pyx_r);
17972 __pyx_t_1 = __pyx_f_8PyClical_cga3std(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1832, __pyx_L1_error)
17973 __Pyx_GOTREF(__pyx_t_1);
17974 __pyx_r = __pyx_t_1;
17980 __Pyx_XDECREF(__pyx_t_1);
17981 __Pyx_AddTraceback(
"PyClical.cga3std", __pyx_clineno, __pyx_lineno, __pyx_filename);
17984 __Pyx_XGIVEREF(__pyx_r);
17985 __Pyx_RefNannyFinishContext();
17997 static PyObject *__pyx_pw_8PyClical_81agc3(PyObject *__pyx_self, PyObject *__pyx_v_obj);
17998 static CYTHON_INLINE PyObject *__pyx_f_8PyClical_agc3(PyObject *__pyx_v_obj, CYTHON_UNUSED
int __pyx_skip_dispatch) {
17999 PyObject *__pyx_r = NULL;
18000 __Pyx_RefNannyDeclarations
18001 PyObject *__pyx_t_1 = NULL;
18002 PyObject *__pyx_t_2 = NULL;
18003 __Pyx_RefNannySetupContext(
"agc3", 0);
18012 __Pyx_XDECREF(__pyx_r);
18013 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8PyClical_clifford));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1852, __pyx_L1_error)
18014 __Pyx_GOTREF(__pyx_t_1);
18015 __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)
18016 __Pyx_GOTREF(__pyx_t_2);
18017 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18018 __pyx_r = __pyx_t_2;
18032 __Pyx_XDECREF(__pyx_t_1);
18033 __Pyx_XDECREF(__pyx_t_2);
18034 __Pyx_AddTraceback(
"PyClical.agc3", __pyx_clineno, __pyx_lineno, __pyx_filename);
18037 __Pyx_XGIVEREF(__pyx_r);
18038 __Pyx_RefNannyFinishContext();
18043 static PyObject *__pyx_pw_8PyClical_81agc3(PyObject *__pyx_self, PyObject *__pyx_v_obj);
18044 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 ";
18045 static PyObject *__pyx_pw_8PyClical_81agc3(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18046 PyObject *__pyx_r = 0;
18047 __Pyx_RefNannyDeclarations
18048 __Pyx_RefNannySetupContext(
"agc3 (wrapper)", 0);
18049 __pyx_r = __pyx_pf_8PyClical_80agc3(__pyx_self, ((PyObject *)__pyx_v_obj));
18052 __Pyx_RefNannyFinishContext();
18056 static PyObject *__pyx_pf_8PyClical_80agc3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18057 PyObject *__pyx_r = NULL;
18058 __Pyx_RefNannyDeclarations
18059 PyObject *__pyx_t_1 = NULL;
18060 __Pyx_RefNannySetupContext(
"agc3", 0);
18061 __Pyx_XDECREF(__pyx_r);
18062 __pyx_t_1 = __pyx_f_8PyClical_agc3(__pyx_v_obj, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1843, __pyx_L1_error)
18063 __Pyx_GOTREF(__pyx_t_1);
18064 __pyx_r = __pyx_t_1;
18070 __Pyx_XDECREF(__pyx_t_1);
18071 __Pyx_AddTraceback(
"PyClical.agc3", __pyx_clineno, __pyx_lineno, __pyx_filename);
18074 __Pyx_XGIVEREF(__pyx_r);
18075 __Pyx_RefNannyFinishContext();
18088 static PyObject *__pyx_pw_8PyClical_83e(PyObject *__pyx_self, PyObject *__pyx_v_obj);
18089 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 ";
18090 static PyMethodDef __pyx_mdef_8PyClical_83e = {
"e", (PyCFunction)__pyx_pw_8PyClical_83e, METH_O, __pyx_doc_8PyClical_82e};
18091 static PyObject *__pyx_pw_8PyClical_83e(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18092 PyObject *__pyx_r = 0;
18093 __Pyx_RefNannyDeclarations
18094 __Pyx_RefNannySetupContext(
"e (wrapper)", 0);
18095 __pyx_r = __pyx_pf_8PyClical_82e(__pyx_self, ((PyObject *)__pyx_v_obj));
18098 __Pyx_RefNannyFinishContext();
18102 static PyObject *__pyx_pf_8PyClical_82e(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
18103 PyObject *__pyx_r = NULL;
18104 __Pyx_RefNannyDeclarations
18105 PyObject *__pyx_t_1 = NULL;
18106 PyObject *__pyx_t_2 = NULL;
18107 __Pyx_RefNannySetupContext(
"e", 0);
18116 __Pyx_XDECREF(__pyx_r);
18117 __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)
18118 __Pyx_GOTREF(__pyx_t_1);
18119 __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)
18120 __Pyx_GOTREF(__pyx_t_2);
18121 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18122 __pyx_r = __pyx_t_2;
18136 __Pyx_XDECREF(__pyx_t_1);
18137 __Pyx_XDECREF(__pyx_t_2);
18138 __Pyx_AddTraceback(
"PyClical.e", __pyx_clineno, __pyx_lineno, __pyx_filename);
18141 __Pyx_XGIVEREF(__pyx_r);
18142 __Pyx_RefNannyFinishContext();
18155 static PyObject *__pyx_pw_8PyClical_85istpq(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
18156 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 ";
18157 static PyMethodDef __pyx_mdef_8PyClical_85istpq = {
"istpq", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_85istpq, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_84istpq};
18158 static PyObject *__pyx_pw_8PyClical_85istpq(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18159 PyObject *__pyx_v_p = 0;
18160 PyObject *__pyx_v_q = 0;
18161 PyObject *__pyx_r = 0;
18162 __Pyx_RefNannyDeclarations
18163 __Pyx_RefNannySetupContext(
"istpq (wrapper)", 0);
18165 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,&__pyx_n_s_q,0};
18166 PyObject* values[2] = {0,0};
18167 if (unlikely(__pyx_kwds)) {
18168 Py_ssize_t kw_args;
18169 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
18170 switch (pos_args) {
18171 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18172 CYTHON_FALLTHROUGH;
18173 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18174 CYTHON_FALLTHROUGH;
18176 default:
goto __pyx_L5_argtuple_error;
18178 kw_args = PyDict_Size(__pyx_kwds);
18179 switch (pos_args) {
18181 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p)) != 0)) kw_args--;
18182 else goto __pyx_L5_argtuple_error;
18183 CYTHON_FALLTHROUGH;
18185 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q)) != 0)) kw_args--;
18187 __Pyx_RaiseArgtupleInvalid(
"istpq", 1, 2, 2, 1); __PYX_ERR(0, 1899, __pyx_L3_error)
18190 if (unlikely(kw_args > 0)) {
18191 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"istpq") < 0)) __PYX_ERR(0, 1899, __pyx_L3_error)
18193 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
18194 goto __pyx_L5_argtuple_error;
18196 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18197 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18199 __pyx_v_p = values[0];
18200 __pyx_v_q = values[1];
18202 goto __pyx_L4_argument_unpacking_done;
18203 __pyx_L5_argtuple_error:;
18204 __Pyx_RaiseArgtupleInvalid(
"istpq", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1899, __pyx_L3_error)
18206 __Pyx_AddTraceback(
"PyClical.istpq", __pyx_clineno, __pyx_lineno, __pyx_filename);
18207 __Pyx_RefNannyFinishContext();
18209 __pyx_L4_argument_unpacking_done:;
18210 __pyx_r = __pyx_pf_8PyClical_84istpq(__pyx_self, __pyx_v_p, __pyx_v_q);
18213 __Pyx_RefNannyFinishContext();
18217 static PyObject *__pyx_pf_8PyClical_84istpq(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_p, PyObject *__pyx_v_q) {
18218 PyObject *__pyx_r = NULL;
18219 __Pyx_RefNannyDeclarations
18220 PyObject *__pyx_t_1 = NULL;
18221 PyObject *__pyx_t_2 = NULL;
18222 PyObject *__pyx_t_3 = NULL;
18223 __Pyx_RefNannySetupContext(
"istpq", 0);
18232 __Pyx_XDECREF(__pyx_r);
18233 __pyx_t_1 = PyNumber_Negative(__pyx_v_q);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1906, __pyx_L1_error)
18234 __Pyx_GOTREF(__pyx_t_1);
18235 __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)
18236 __Pyx_GOTREF(__pyx_t_2);
18237 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1906, __pyx_L1_error)
18238 __Pyx_GOTREF(__pyx_t_3);
18239 __Pyx_GIVEREF(__pyx_t_1);
18240 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
18241 __Pyx_GIVEREF(__pyx_t_2);
18242 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
18245 __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)
18246 __Pyx_GOTREF(__pyx_t_2);
18247 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18248 __pyx_t_3 = PySet_New(__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1906, __pyx_L1_error)
18249 __Pyx_GOTREF(__pyx_t_3);
18250 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18251 __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)
18252 __Pyx_GOTREF(__pyx_t_2);
18253 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18254 __pyx_r = __pyx_t_2;
18268 __Pyx_XDECREF(__pyx_t_1);
18269 __Pyx_XDECREF(__pyx_t_2);
18270 __Pyx_XDECREF(__pyx_t_3);
18271 __Pyx_AddTraceback(
"PyClical.istpq", __pyx_clineno, __pyx_lineno, __pyx_filename);
18274 __Pyx_XGIVEREF(__pyx_r);
18275 __Pyx_RefNannyFinishContext();
18288 static PyObject *__pyx_pw_8PyClical_87_test(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused);
18289 static PyMethodDef __pyx_mdef_8PyClical_87_test = {
"_test", (PyCFunction)__pyx_pw_8PyClical_87_test, METH_NOARGS, 0};
18290 static PyObject *__pyx_pw_8PyClical_87_test(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
18291 PyObject *__pyx_r = 0;
18292 __Pyx_RefNannyDeclarations
18293 __Pyx_RefNannySetupContext(
"_test (wrapper)", 0);
18294 __pyx_r = __pyx_pf_8PyClical_86_test(__pyx_self);
18297 __Pyx_RefNannyFinishContext();
18301 static PyObject *__pyx_pf_8PyClical_86_test(CYTHON_UNUSED PyObject *__pyx_self) {
18302 PyObject *__pyx_v_PyClical = NULL;
18303 PyObject *__pyx_v_doctest = NULL;
18304 PyObject *__pyx_r = NULL;
18305 __Pyx_RefNannyDeclarations
18306 PyObject *__pyx_t_1 = NULL;
18307 PyObject *__pyx_t_2 = NULL;
18308 PyObject *__pyx_t_3 = NULL;
18309 __Pyx_RefNannySetupContext(
"_test", 0);
18318 __pyx_t_1 = __Pyx_Import(__pyx_n_s_PyClical, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1913, __pyx_L1_error)
18319 __Pyx_GOTREF(__pyx_t_1);
18320 __pyx_v_PyClical = __pyx_t_1;
18322 __pyx_t_1 = __Pyx_Import(__pyx_n_s_doctest, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1913, __pyx_L1_error)
18323 __Pyx_GOTREF(__pyx_t_1);
18324 __pyx_v_doctest = __pyx_t_1;
18334 __Pyx_XDECREF(__pyx_r);
18335 __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)
18336 __Pyx_GOTREF(__pyx_t_2);
18338 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
18339 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
18340 if (likely(__pyx_t_3)) {
18341 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
18342 __Pyx_INCREF(__pyx_t_3);
18343 __Pyx_INCREF(
function);
18344 __Pyx_DECREF_SET(__pyx_t_2,
function);
18347 __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);
18348 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18349 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1914, __pyx_L1_error)
18350 __Pyx_GOTREF(__pyx_t_1);
18351 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18352 __pyx_r = __pyx_t_1;
18366 __Pyx_XDECREF(__pyx_t_1);
18367 __Pyx_XDECREF(__pyx_t_2);
18368 __Pyx_XDECREF(__pyx_t_3);
18369 __Pyx_AddTraceback(
"PyClical._test", __pyx_clineno, __pyx_lineno, __pyx_filename);
18372 __Pyx_XDECREF(__pyx_v_PyClical);
18373 __Pyx_XDECREF(__pyx_v_doctest);
18374 __Pyx_XGIVEREF(__pyx_r);
18375 __Pyx_RefNannyFinishContext();
18387 static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_string(std::string
const &__pyx_v_s) {
18388 PyObject *__pyx_r = NULL;
18389 __Pyx_RefNannyDeclarations
18390 PyObject *__pyx_t_1 = NULL;
18391 __Pyx_RefNannySetupContext(
"__pyx_convert_PyObject_string_to_py_std__in_string", 0);
18400 __Pyx_XDECREF(__pyx_r);
18401 __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)
18402 __Pyx_GOTREF(__pyx_t_1);
18403 __pyx_r = __pyx_t_1;
18417 __Pyx_XDECREF(__pyx_t_1);
18418 __Pyx_AddTraceback(
"string.to_py.__pyx_convert_PyObject_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
18421 __Pyx_XGIVEREF(__pyx_r);
18422 __Pyx_RefNannyFinishContext();
18434 static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_string(std::string
const &__pyx_v_s) {
18435 PyObject *__pyx_r = NULL;
18436 __Pyx_RefNannyDeclarations
18437 PyObject *__pyx_t_1 = NULL;
18438 __Pyx_RefNannySetupContext(
"__pyx_convert_PyUnicode_string_to_py_std__in_string", 0);
18447 __Pyx_XDECREF(__pyx_r);
18448 __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)
18449 __Pyx_GOTREF(__pyx_t_1);
18450 __pyx_r = __pyx_t_1;
18464 __Pyx_XDECREF(__pyx_t_1);
18465 __Pyx_AddTraceback(
"string.to_py.__pyx_convert_PyUnicode_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
18468 __Pyx_XGIVEREF(__pyx_r);
18469 __Pyx_RefNannyFinishContext();
18481 static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(std::string
const &__pyx_v_s) {
18482 PyObject *__pyx_r = NULL;
18483 __Pyx_RefNannyDeclarations
18484 PyObject *__pyx_t_1 = NULL;
18485 __Pyx_RefNannySetupContext(
"__pyx_convert_PyStr_string_to_py_std__in_string", 0);
18494 __Pyx_XDECREF(__pyx_r);
18495 __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)
18496 __Pyx_GOTREF(__pyx_t_1);
18497 __pyx_r = __pyx_t_1;
18511 __Pyx_XDECREF(__pyx_t_1);
18512 __Pyx_AddTraceback(
"string.to_py.__pyx_convert_PyStr_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
18515 __Pyx_XGIVEREF(__pyx_r);
18516 __Pyx_RefNannyFinishContext();
18528 static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string(std::string
const &__pyx_v_s) {
18529 PyObject *__pyx_r = NULL;
18530 __Pyx_RefNannyDeclarations
18531 PyObject *__pyx_t_1 = NULL;
18532 __Pyx_RefNannySetupContext(
"__pyx_convert_PyBytes_string_to_py_std__in_string", 0);
18541 __Pyx_XDECREF(__pyx_r);
18542 __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)
18543 __Pyx_GOTREF(__pyx_t_1);
18544 __pyx_r = __pyx_t_1;
18558 __Pyx_XDECREF(__pyx_t_1);
18559 __Pyx_AddTraceback(
"string.to_py.__pyx_convert_PyBytes_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
18562 __Pyx_XGIVEREF(__pyx_r);
18563 __Pyx_RefNannyFinishContext();
18575 static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_string(std::string
const &__pyx_v_s) {
18576 PyObject *__pyx_r = NULL;
18577 __Pyx_RefNannyDeclarations
18578 PyObject *__pyx_t_1 = NULL;
18579 __Pyx_RefNannySetupContext(
"__pyx_convert_PyByteArray_string_to_py_std__in_string", 0);
18587 __Pyx_XDECREF(__pyx_r);
18588 __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)
18589 __Pyx_GOTREF(__pyx_t_1);
18590 __pyx_r = __pyx_t_1;
18604 __Pyx_XDECREF(__pyx_t_1);
18605 __Pyx_AddTraceback(
"string.to_py.__pyx_convert_PyByteArray_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
18608 __Pyx_XGIVEREF(__pyx_r);
18609 __Pyx_RefNannyFinishContext();
18612 static struct __pyx_vtabstruct_8PyClical_index_set __pyx_vtable_8PyClical_index_set;
18614 static PyObject *__pyx_tp_new_8PyClical_index_set(PyTypeObject *t, PyObject *a, PyObject *k) {
18615 struct __pyx_obj_8PyClical_index_set *p;
18617 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
18618 o = (*t->tp_alloc)(t, 0);
18620 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
18622 if (unlikely(!o))
return 0;
18623 p = ((
struct __pyx_obj_8PyClical_index_set *)o);
18624 p->__pyx_vtab = __pyx_vtabptr_8PyClical_index_set;
18625 if (unlikely(__pyx_pw_8PyClical_9index_set_3__cinit__(o, a, k) < 0))
goto bad;
18628 Py_DECREF(o); o = 0;
18632 static void __pyx_tp_dealloc_8PyClical_index_set(PyObject *o) {
18633 #if CYTHON_USE_TP_FINALIZE
18634 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))) {
18635 if (PyObject_CallFinalizerFromDealloc(o))
return;
18639 PyObject *etype, *eval, *etb;
18640 PyErr_Fetch(&etype, &eval, &etb);
18642 __pyx_pw_8PyClical_9index_set_5__dealloc__(o);
18644 PyErr_Restore(etype, eval, etb);
18646 (*Py_TYPE(o)->tp_free)(o);
18648 static PyObject *__pyx_sq_item_8PyClical_index_set(PyObject *o, Py_ssize_t
i) {
18650 PyObject *x = PyInt_FromSsize_t(
i);
if(!x)
return 0;
18651 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
18656 static int __pyx_mp_ass_subscript_8PyClical_index_set(PyObject *o, PyObject *
i, PyObject *v) {
18658 return __pyx_pw_8PyClical_9index_set_9__setitem__(o,
i, v);
18661 PyErr_Format(PyExc_NotImplementedError,
18662 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
18667 static PyMethodDef __pyx_methods_8PyClical_index_set[] = {
18668 {
"copy", (PyCFunction)__pyx_pw_8PyClical_9index_set_1copy, METH_NOARGS, __pyx_doc_8PyClical_9index_set_copy},
18669 {
"count", (PyCFunction)__pyx_pw_8PyClical_9index_set_32count, METH_NOARGS, __pyx_doc_8PyClical_9index_set_31count},
18670 {
"count_neg", (PyCFunction)__pyx_pw_8PyClical_9index_set_34count_neg, METH_NOARGS, __pyx_doc_8PyClical_9index_set_33count_neg},
18671 {
"count_pos", (PyCFunction)__pyx_pw_8PyClical_9index_set_36count_pos, METH_NOARGS, __pyx_doc_8PyClical_9index_set_35count_pos},
18672 {
"min", (PyCFunction)__pyx_pw_8PyClical_9index_set_38min, METH_NOARGS, __pyx_doc_8PyClical_9index_set_37min},
18673 {
"max", (PyCFunction)__pyx_pw_8PyClical_9index_set_40max, METH_NOARGS, __pyx_doc_8PyClical_9index_set_39max},
18674 {
"hash_fn", (PyCFunction)__pyx_pw_8PyClical_9index_set_42hash_fn, METH_NOARGS, __pyx_doc_8PyClical_9index_set_41hash_fn},
18675 {
"sign_of_mult", (PyCFunction)__pyx_pw_8PyClical_9index_set_44sign_of_mult, METH_O, __pyx_doc_8PyClical_9index_set_43sign_of_mult},
18676 {
"sign_of_square", (PyCFunction)__pyx_pw_8PyClical_9index_set_46sign_of_square, METH_NOARGS, __pyx_doc_8PyClical_9index_set_45sign_of_square},
18677 {
"__reduce_cython__", (PyCFunction)__pyx_pw_8PyClical_9index_set_52__reduce_cython__, METH_NOARGS, 0},
18678 {
"__setstate_cython__", (PyCFunction)__pyx_pw_8PyClical_9index_set_54__setstate_cython__, METH_O, 0},
18682 static PyNumberMethods __pyx_tp_as_number_index_set = {
18686 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
18696 __pyx_pw_8PyClical_9index_set_18__invert__,
18699 __pyx_pw_8PyClical_9index_set_24__and__,
18700 __pyx_pw_8PyClical_9index_set_20__xor__,
18701 __pyx_pw_8PyClical_9index_set_28__or__,
18702 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
18706 #if PY_MAJOR_VERSION < 3
18712 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
18715 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
18721 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
18728 __pyx_pw_8PyClical_9index_set_26__iand__,
18729 __pyx_pw_8PyClical_9index_set_22__ixor__,
18730 __pyx_pw_8PyClical_9index_set_30__ior__,
18736 #if PY_VERSION_HEX >= 0x03050000
18739 #if PY_VERSION_HEX >= 0x03050000
18744 static PySequenceMethods __pyx_tp_as_sequence_index_set = {
18748 __pyx_sq_item_8PyClical_index_set,
18752 __pyx_pw_8PyClical_9index_set_13__contains__,
18757 static PyMappingMethods __pyx_tp_as_mapping_index_set = {
18759 __pyx_pw_8PyClical_9index_set_11__getitem__,
18760 __pyx_mp_ass_subscript_8PyClical_index_set,
18763 static PyTypeObject __pyx_type_8PyClical_index_set = {
18764 PyVarObject_HEAD_INIT(0, 0)
18765 "PyClical.index_set",
18766 sizeof(
struct __pyx_obj_8PyClical_index_set),
18768 __pyx_tp_dealloc_8PyClical_index_set,
18772 #if PY_MAJOR_VERSION < 3
18775 #if PY_MAJOR_VERSION >= 3
18778 __pyx_pw_8PyClical_9index_set_48__repr__,
18779 &__pyx_tp_as_number_index_set,
18780 &__pyx_tp_as_sequence_index_set,
18781 &__pyx_tp_as_mapping_index_set,
18784 __pyx_pw_8PyClical_9index_set_50__str__,
18788 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
18789 "\n Python class index_set wraps C++ class IndexSet.\n ",
18792 __pyx_pw_8PyClical_9index_set_7__richcmp__,
18794 __pyx_pw_8PyClical_9index_set_15__iter__,
18796 __pyx_methods_8PyClical_index_set,
18806 __pyx_tp_new_8PyClical_index_set,
18816 #if PY_VERSION_HEX >= 0x030400a1
18819 #if PY_VERSION_HEX >= 0x030800b1
18823 static struct __pyx_vtabstruct_8PyClical_clifford __pyx_vtable_8PyClical_clifford;
18825 static PyObject *__pyx_tp_new_8PyClical_clifford(PyTypeObject *t, PyObject *a, PyObject *k) {
18826 struct __pyx_obj_8PyClical_clifford *p;
18828 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
18829 o = (*t->tp_alloc)(t, 0);
18831 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
18833 if (unlikely(!o))
return 0;
18834 p = ((
struct __pyx_obj_8PyClical_clifford *)o);
18835 p->__pyx_vtab = __pyx_vtabptr_8PyClical_clifford;
18836 if (unlikely(__pyx_pw_8PyClical_8clifford_3__cinit__(o, a, k) < 0))
goto bad;
18839 Py_DECREF(o); o = 0;
18843 static void __pyx_tp_dealloc_8PyClical_clifford(PyObject *o) {
18844 #if CYTHON_USE_TP_FINALIZE
18845 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))) {
18846 if (PyObject_CallFinalizerFromDealloc(o))
return;
18850 PyObject *etype, *eval, *etb;
18851 PyErr_Fetch(&etype, &eval, &etb);
18853 __pyx_pw_8PyClical_8clifford_5__dealloc__(o);
18855 PyErr_Restore(etype, eval, etb);
18857 (*Py_TYPE(o)->tp_free)(o);
18859 static PyObject *__pyx_sq_item_8PyClical_clifford(PyObject *o, Py_ssize_t
i) {
18861 PyObject *x = PyInt_FromSsize_t(
i);
if(!x)
return 0;
18862 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
18867 static PyMethodDef __pyx_methods_8PyClical_clifford[] = {
18868 {
"copy", (PyCFunction)__pyx_pw_8PyClical_8clifford_1copy, METH_NOARGS, __pyx_doc_8PyClical_8clifford_copy},
18869 {
"reframe", (PyCFunction)__pyx_pw_8PyClical_8clifford_11reframe, METH_O, __pyx_doc_8PyClical_8clifford_10reframe},
18870 {
"inv", (PyCFunction)__pyx_pw_8PyClical_8clifford_49inv, METH_NOARGS, __pyx_doc_8PyClical_8clifford_48inv},
18871 {
"pow", (PyCFunction)__pyx_pw_8PyClical_8clifford_57pow, METH_O, __pyx_doc_8PyClical_8clifford_56pow},
18872 {
"outer_pow", (PyCFunction)__pyx_pw_8PyClical_8clifford_59outer_pow, METH_O, __pyx_doc_8PyClical_8clifford_58outer_pow},
18873 {
"scalar", (PyCFunction)__pyx_pw_8PyClical_8clifford_63scalar, METH_NOARGS, __pyx_doc_8PyClical_8clifford_62scalar},
18874 {
"pure", (PyCFunction)__pyx_pw_8PyClical_8clifford_65pure, METH_NOARGS, __pyx_doc_8PyClical_8clifford_64pure},
18875 {
"even", (PyCFunction)__pyx_pw_8PyClical_8clifford_67even, METH_NOARGS, __pyx_doc_8PyClical_8clifford_66even},
18876 {
"odd", (PyCFunction)__pyx_pw_8PyClical_8clifford_69odd, METH_NOARGS, __pyx_doc_8PyClical_8clifford_68odd},
18877 {
"vector_part", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_8clifford_71vector_part, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_8clifford_70vector_part},
18878 {
"involute", (PyCFunction)__pyx_pw_8PyClical_8clifford_73involute, METH_NOARGS, __pyx_doc_8PyClical_8clifford_72involute},
18879 {
"reverse", (PyCFunction)__pyx_pw_8PyClical_8clifford_75reverse, METH_NOARGS, __pyx_doc_8PyClical_8clifford_74reverse},
18880 {
"conj", (PyCFunction)__pyx_pw_8PyClical_8clifford_77conj, METH_NOARGS, __pyx_doc_8PyClical_8clifford_76conj},
18881 {
"quad", (PyCFunction)__pyx_pw_8PyClical_8clifford_79quad, METH_NOARGS, __pyx_doc_8PyClical_8clifford_78quad},
18882 {
"norm", (PyCFunction)__pyx_pw_8PyClical_8clifford_81norm, METH_NOARGS, __pyx_doc_8PyClical_8clifford_80norm},
18883 {
"abs", (PyCFunction)__pyx_pw_8PyClical_8clifford_83abs, METH_NOARGS, __pyx_doc_8PyClical_8clifford_82abs},
18884 {
"max_abs", (PyCFunction)__pyx_pw_8PyClical_8clifford_85max_abs, METH_NOARGS, __pyx_doc_8PyClical_8clifford_84max_abs},
18885 {
"truncated", (PyCFunction)__pyx_pw_8PyClical_8clifford_87truncated, METH_O, __pyx_doc_8PyClical_8clifford_86truncated},
18886 {
"isnan", (PyCFunction)__pyx_pw_8PyClical_8clifford_89isnan, METH_NOARGS, __pyx_doc_8PyClical_8clifford_88isnan},
18887 {
"frame", (PyCFunction)__pyx_pw_8PyClical_8clifford_91frame, METH_NOARGS, __pyx_doc_8PyClical_8clifford_90frame},
18888 {
"__reduce_cython__", (PyCFunction)__pyx_pw_8PyClical_8clifford_97__reduce_cython__, METH_NOARGS, 0},
18889 {
"__setstate_cython__", (PyCFunction)__pyx_pw_8PyClical_8clifford_99__setstate_cython__, METH_O, 0},
18893 static PyNumberMethods __pyx_tp_as_number_clifford = {
18894 __pyx_pw_8PyClical_8clifford_21__add__,
18895 __pyx_pw_8PyClical_8clifford_25__sub__,
18896 __pyx_pw_8PyClical_8clifford_29__mul__,
18897 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
18900 __pyx_pw_8PyClical_8clifford_33__mod__,
18902 __pyx_pw_8PyClical_8clifford_55__pow__,
18903 __pyx_pw_8PyClical_8clifford_17__neg__,
18904 __pyx_pw_8PyClical_8clifford_19__pos__,
18910 __pyx_pw_8PyClical_8clifford_37__and__,
18911 __pyx_pw_8PyClical_8clifford_41__xor__,
18912 __pyx_pw_8PyClical_8clifford_51__or__,
18913 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
18917 #if PY_MAJOR_VERSION < 3
18923 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
18926 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
18929 __pyx_pw_8PyClical_8clifford_23__iadd__,
18930 __pyx_pw_8PyClical_8clifford_27__isub__,
18931 __pyx_pw_8PyClical_8clifford_31__imul__,
18932 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
18933 __pyx_pw_8PyClical_8clifford_47__idiv__,
18935 __pyx_pw_8PyClical_8clifford_35__imod__,
18939 __pyx_pw_8PyClical_8clifford_39__iand__,
18940 __pyx_pw_8PyClical_8clifford_43__ixor__,
18941 __pyx_pw_8PyClical_8clifford_53__ior__,
18943 __pyx_pw_8PyClical_8clifford_45__truediv__,
18947 #if PY_VERSION_HEX >= 0x03050000
18950 #if PY_VERSION_HEX >= 0x03050000
18955 static PySequenceMethods __pyx_tp_as_sequence_clifford = {
18959 __pyx_sq_item_8PyClical_clifford,
18963 __pyx_pw_8PyClical_8clifford_7__contains__,
18968 static PyMappingMethods __pyx_tp_as_mapping_clifford = {
18970 __pyx_pw_8PyClical_8clifford_15__getitem__,
18974 static PyTypeObject __pyx_type_8PyClical_clifford = {
18975 PyVarObject_HEAD_INIT(0, 0)
18976 "PyClical.clifford",
18977 sizeof(
struct __pyx_obj_8PyClical_clifford),
18979 __pyx_tp_dealloc_8PyClical_clifford,
18983 #if PY_MAJOR_VERSION < 3
18986 #if PY_MAJOR_VERSION >= 3
18989 __pyx_pw_8PyClical_8clifford_93__repr__,
18990 &__pyx_tp_as_number_clifford,
18991 &__pyx_tp_as_sequence_clifford,
18992 &__pyx_tp_as_mapping_clifford,
18994 __pyx_pw_8PyClical_8clifford_61__call__,
18995 __pyx_pw_8PyClical_8clifford_95__str__,
18999 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
19000 "\n Python class clifford wraps C++ class Clifford.\n ",
19003 __pyx_pw_8PyClical_8clifford_13__richcmp__,
19005 __pyx_pw_8PyClical_8clifford_9__iter__,
19007 __pyx_methods_8PyClical_clifford,
19017 __pyx_tp_new_8PyClical_clifford,
19027 #if PY_VERSION_HEX >= 0x030400a1
19030 #if PY_VERSION_HEX >= 0x030800b1
19035 static struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *__pyx_freelist_8PyClical___pyx_scope_struct____iter__[8];
19036 static int __pyx_freecount_8PyClical___pyx_scope_struct____iter__ = 0;
19038 static PyObject *__pyx_tp_new_8PyClical___pyx_scope_struct____iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
19040 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__)))) {
19041 o = (PyObject*)__pyx_freelist_8PyClical___pyx_scope_struct____iter__[--__pyx_freecount_8PyClical___pyx_scope_struct____iter__];
19042 memset(o, 0,
sizeof(
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__));
19043 (void) PyObject_INIT(o, t);
19044 PyObject_GC_Track(o);
19046 o = (*t->tp_alloc)(t, 0);
19047 if (unlikely(!o))
return 0;
19052 static void __pyx_tp_dealloc_8PyClical___pyx_scope_struct____iter__(PyObject *o) {
19053 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *p = (
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)o;
19054 PyObject_GC_UnTrack(o);
19055 Py_CLEAR(p->__pyx_v_idx);
19056 Py_CLEAR(p->__pyx_v_self);
19057 Py_CLEAR(p->__pyx_t_0);
19058 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__)))) {
19059 __pyx_freelist_8PyClical___pyx_scope_struct____iter__[__pyx_freecount_8PyClical___pyx_scope_struct____iter__++] = ((
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)o);
19061 (*Py_TYPE(o)->tp_free)(o);
19065 static int __pyx_tp_traverse_8PyClical___pyx_scope_struct____iter__(PyObject *o, visitproc v,
void *a) {
19067 struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *p = (
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__ *)o;
19068 if (p->__pyx_v_idx) {
19069 e = (*v)(p->__pyx_v_idx, a);
if (
e)
return e;
19071 if (p->__pyx_v_self) {
19072 e = (*v)(((PyObject *)p->__pyx_v_self), a);
if (
e)
return e;
19074 if (p->__pyx_t_0) {
19075 e = (*v)(p->__pyx_t_0, a);
if (
e)
return e;
19080 static PyTypeObject __pyx_type_8PyClical___pyx_scope_struct____iter__ = {
19081 PyVarObject_HEAD_INIT(0, 0)
19082 "PyClical.__pyx_scope_struct____iter__",
19083 sizeof(
struct __pyx_obj_8PyClical___pyx_scope_struct____iter__),
19085 __pyx_tp_dealloc_8PyClical___pyx_scope_struct____iter__,
19089 #if PY_MAJOR_VERSION < 3
19092 #if PY_MAJOR_VERSION >= 3
19105 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
19107 __pyx_tp_traverse_8PyClical___pyx_scope_struct____iter__,
19123 __pyx_tp_new_8PyClical___pyx_scope_struct____iter__,
19133 #if PY_VERSION_HEX >= 0x030400a1
19136 #if PY_VERSION_HEX >= 0x030800b1
19141 static PyMethodDef __pyx_methods[] = {
19142 {
"compare", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_3compare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_2compare},
19143 {
"min_neg", (PyCFunction)__pyx_pw_8PyClical_5min_neg, METH_O, __pyx_doc_8PyClical_4min_neg},
19144 {
"max_pos", (PyCFunction)__pyx_pw_8PyClical_7max_pos, METH_O, __pyx_doc_8PyClical_6max_pos},
19145 {
"inv", (PyCFunction)__pyx_pw_8PyClical_11inv, METH_O, __pyx_doc_8PyClical_10inv},
19146 {
"scalar", (PyCFunction)__pyx_pw_8PyClical_13scalar, METH_O, __pyx_doc_8PyClical_12scalar},
19147 {
"real", (PyCFunction)__pyx_pw_8PyClical_15real, METH_O, __pyx_doc_8PyClical_14real},
19148 {
"imag", (PyCFunction)__pyx_pw_8PyClical_17imag, METH_O, __pyx_doc_8PyClical_16imag},
19149 {
"pure", (PyCFunction)__pyx_pw_8PyClical_19pure, METH_O, __pyx_doc_8PyClical_18pure},
19150 {
"even", (PyCFunction)__pyx_pw_8PyClical_21even, METH_O, __pyx_doc_8PyClical_20even},
19151 {
"odd", (PyCFunction)__pyx_pw_8PyClical_23odd, METH_O, __pyx_doc_8PyClical_22odd},
19152 {
"involute", (PyCFunction)__pyx_pw_8PyClical_25involute, METH_O, __pyx_doc_8PyClical_24involute},
19153 {
"reverse", (PyCFunction)__pyx_pw_8PyClical_27reverse, METH_O, __pyx_doc_8PyClical_26reverse},
19154 {
"conj", (PyCFunction)__pyx_pw_8PyClical_29conj, METH_O, __pyx_doc_8PyClical_28conj},
19155 {
"quad", (PyCFunction)__pyx_pw_8PyClical_31quad, METH_O, __pyx_doc_8PyClical_30quad},
19156 {
"norm", (PyCFunction)__pyx_pw_8PyClical_33norm, METH_O, __pyx_doc_8PyClical_32norm},
19157 {
"abs", (PyCFunction)__pyx_pw_8PyClical_35abs, METH_O, __pyx_doc_8PyClical_34abs},
19158 {
"max_abs", (PyCFunction)__pyx_pw_8PyClical_37max_abs, METH_O, __pyx_doc_8PyClical_36max_abs},
19159 {
"pow", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_39pow, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_38pow},
19160 {
"outer_pow", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_41outer_pow, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_40outer_pow},
19161 {
"complexifier", (PyCFunction)__pyx_pw_8PyClical_43complexifier, METH_O, __pyx_doc_8PyClical_42complexifier},
19162 {
"sqrt", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_45sqrt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_44sqrt},
19163 {
"exp", (PyCFunction)__pyx_pw_8PyClical_47exp, METH_O, __pyx_doc_8PyClical_46exp},
19164 {
"log", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_49log, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_48log},
19165 {
"cos", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_51cos, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_50cos},
19166 {
"acos", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_53acos, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_52acos},
19167 {
"cosh", (PyCFunction)__pyx_pw_8PyClical_55cosh, METH_O, __pyx_doc_8PyClical_54cosh},
19168 {
"acosh", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_57acosh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_56acosh},
19169 {
"sin", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_59sin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_58sin},
19170 {
"asin", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_61asin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_60asin},
19171 {
"sinh", (PyCFunction)__pyx_pw_8PyClical_63sinh, METH_O, __pyx_doc_8PyClical_62sinh},
19172 {
"asinh", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_65asinh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_64asinh},
19173 {
"tan", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_67tan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_66tan},
19174 {
"atan", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_69atan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_68atan},
19175 {
"tanh", (PyCFunction)__pyx_pw_8PyClical_71tanh, METH_O, __pyx_doc_8PyClical_70tanh},
19176 {
"atanh", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_73atanh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_72atanh},
19177 {
"random_clifford", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_8PyClical_75random_clifford, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8PyClical_74random_clifford},
19178 {
"cga3", (PyCFunction)__pyx_pw_8PyClical_77cga3, METH_O, __pyx_doc_8PyClical_76cga3},
19179 {
"cga3std", (PyCFunction)__pyx_pw_8PyClical_79cga3std, METH_O, __pyx_doc_8PyClical_78cga3std},
19180 {
"agc3", (PyCFunction)__pyx_pw_8PyClical_81agc3, METH_O, __pyx_doc_8PyClical_80agc3},
19184 #if PY_MAJOR_VERSION >= 3
19185 #if CYTHON_PEP489_MULTI_PHASE_INIT
19186 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
19187 static int __pyx_pymod_exec_PyClical(PyObject* module);
19188 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
19189 {Py_mod_create, (
void*)__pyx_pymod_create},
19190 {Py_mod_exec, (
void*)__pyx_pymod_exec_PyClical},
19195 static struct PyModuleDef __pyx_moduledef = {
19196 PyModuleDef_HEAD_INIT,
19199 #if CYTHON_PEP489_MULTI_PHASE_INIT
19205 #if CYTHON_PEP489_MULTI_PHASE_INIT
19206 __pyx_moduledef_slots,
19215 #ifndef CYTHON_SMALL_CODE
19216 #if defined(__clang__)
19217 #define CYTHON_SMALL_CODE
19218 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
19219 #define CYTHON_SMALL_CODE __attribute__((cold))
19221 #define CYTHON_SMALL_CODE
19225 static __Pyx_StringTabEntry __pyx_string_tab[] = {
19226 {&__pyx_kp_u_, __pyx_k_,
sizeof(__pyx_k_), 0, 1, 0, 0},
19227 {&__pyx_kp_u_0_8_4, __pyx_k_0_8_4,
sizeof(__pyx_k_0_8_4), 0, 1, 0, 0},
19228 {&__pyx_kp_u_Abbreviation_for_clifford_index, __pyx_k_Abbreviation_for_clifford_index,
sizeof(__pyx_k_Abbreviation_for_clifford_index), 0, 1, 0, 0},
19229 {&__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},
19230 {&__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},
19231 {&__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},
19232 {&__pyx_kp_u_Cannot_initialize_clifford_objec, __pyx_k_Cannot_initialize_clifford_objec,
sizeof(__pyx_k_Cannot_initialize_clifford_objec), 0, 1, 0, 0},
19233 {&__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},
19234 {&__pyx_kp_u_Cannot_reframe, __pyx_k_Cannot_reframe,
sizeof(__pyx_k_Cannot_reframe), 0, 1, 0, 0},
19235 {&__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},
19236 {&__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},
19237 {&__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},
19238 {&__pyx_kp_u_Conjugation_reverse_o_involute, __pyx_k_Conjugation_reverse_o_involute,
sizeof(__pyx_k_Conjugation_reverse_o_involute), 0, 1, 0, 0},
19239 {&__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},
19240 {&__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},
19241 {&__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},
19242 {&__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},
19243 {&__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},
19244 {&__pyx_kp_u_Convert_Euclidean_3D_multivecto, __pyx_k_Convert_Euclidean_3D_multivecto,
sizeof(__pyx_k_Convert_Euclidean_3D_multivecto), 0, 1, 0, 0},
19245 {&__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},
19246 {&__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},
19247 {&__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},
19248 {&__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},
19249 {&__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},
19250 {&__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},
19251 {&__pyx_kp_u_Geometric_difference_print_clif, __pyx_k_Geometric_difference_print_clif,
sizeof(__pyx_k_Geometric_difference_print_clif), 0, 1, 0, 0},
19252 {&__pyx_kp_u_Geometric_difference_x_clifford, __pyx_k_Geometric_difference_x_clifford,
sizeof(__pyx_k_Geometric_difference_x_clifford), 0, 1, 0, 0},
19253 {&__pyx_kp_u_Geometric_multiplicative_invers, __pyx_k_Geometric_multiplicative_invers,
sizeof(__pyx_k_Geometric_multiplicative_invers), 0, 1, 0, 0},
19254 {&__pyx_kp_u_Geometric_multiplicative_invers_2, __pyx_k_Geometric_multiplicative_invers_2,
sizeof(__pyx_k_Geometric_multiplicative_invers_2), 0, 1, 0, 0},
19255 {&__pyx_kp_u_Geometric_product_print_cliffor, __pyx_k_Geometric_product_print_cliffor,
sizeof(__pyx_k_Geometric_product_print_cliffor), 0, 1, 0, 0},
19256 {&__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},
19257 {&__pyx_kp_u_Geometric_quotient_print_cliffo, __pyx_k_Geometric_quotient_print_cliffo,
sizeof(__pyx_k_Geometric_quotient_print_cliffo), 0, 1, 0, 0},
19258 {&__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},
19259 {&__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},
19260 {&__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},
19261 {&__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},
19262 {&__pyx_kp_u_Hyperbolic_cosine_of_multivecto, __pyx_k_Hyperbolic_cosine_of_multivecto,
sizeof(__pyx_k_Hyperbolic_cosine_of_multivecto), 0, 1, 0, 0},
19263 {&__pyx_kp_u_Hyperbolic_sine_of_multivector, __pyx_k_Hyperbolic_sine_of_multivector,
sizeof(__pyx_k_Hyperbolic_sine_of_multivector), 0, 1, 0, 0},
19264 {&__pyx_kp_u_Hyperbolic_tangent_of_multivect, __pyx_k_Hyperbolic_tangent_of_multivect,
sizeof(__pyx_k_Hyperbolic_tangent_of_multivect), 0, 1, 0, 0},
19265 {&__pyx_kp_u_Imaginary_part_deprecated_alway, __pyx_k_Imaginary_part_deprecated_alway,
sizeof(__pyx_k_Imaginary_part_deprecated_alway), 0, 1, 0, 0},
19266 {&__pyx_n_s_IndexError, __pyx_k_IndexError,
sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
19267 {&__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},
19268 {&__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},
19269 {&__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},
19270 {&__pyx_n_s_Integral, __pyx_k_Integral,
sizeof(__pyx_k_Integral), 0, 0, 1, 1},
19271 {&__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},
19272 {&__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},
19273 {&__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},
19274 {&__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},
19275 {&__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},
19276 {&__pyx_kp_u_Inverse_tangent_of_multivector, __pyx_k_Inverse_tangent_of_multivector,
sizeof(__pyx_k_Inverse_tangent_of_multivector), 0, 1, 0, 0},
19277 {&__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},
19278 {&__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},
19279 {&__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},
19280 {&__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},
19281 {&__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},
19282 {&__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},
19283 {&__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},
19284 {&__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},
19285 {&__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},
19286 {&__pyx_kp_u_Natural_logarithm_of_multivecto, __pyx_k_Natural_logarithm_of_multivecto,
sizeof(__pyx_k_Natural_logarithm_of_multivecto), 0, 1, 0, 0},
19287 {&__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},
19288 {&__pyx_n_s_NotImplemented, __pyx_k_NotImplemented,
sizeof(__pyx_k_NotImplemented), 0, 0, 1, 1},
19289 {&__pyx_kp_u_Not_applicable, __pyx_k_Not_applicable,
sizeof(__pyx_k_Not_applicable), 0, 1, 0, 0},
19290 {&__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},
19291 {&__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},
19292 {&__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},
19293 {&__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},
19294 {&__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},
19295 {&__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},
19296 {&__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},
19297 {&__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},
19298 {&__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},
19299 {&__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},
19300 {&__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},
19301 {&__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},
19302 {&__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},
19303 {&__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},
19304 {&__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},
19305 {&__pyx_n_s_PyClical, __pyx_k_PyClical,
sizeof(__pyx_k_PyClical), 0, 0, 1, 1},
19306 {&__pyx_kp_s_PyClical_pyx, __pyx_k_PyClical_pyx,
sizeof(__pyx_k_PyClical_pyx), 0, 0, 1, 0},
19307 {&__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},
19308 {&__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},
19309 {&__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},
19310 {&__pyx_n_s_Real, __pyx_k_Real,
sizeof(__pyx_k_Real), 0, 0, 1, 1},
19311 {&__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},
19312 {&__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},
19313 {&__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},
19314 {&__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},
19315 {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError,
sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
19316 {&__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},
19317 {&__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},
19318 {&__pyx_n_s_Sequence, __pyx_k_Sequence,
sizeof(__pyx_k_Sequence), 0, 0, 1, 1},
19319 {&__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},
19320 {&__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},
19321 {&__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},
19322 {&__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},
19323 {&__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},
19324 {&__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},
19325 {&__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},
19326 {&__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},
19327 {&__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},
19328 {&__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},
19329 {&__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},
19330 {&__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},
19331 {&__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},
19332 {&__pyx_kp_u_Symmetric_set_difference_exclus, __pyx_k_Symmetric_set_difference_exclus,
sizeof(__pyx_k_Symmetric_set_difference_exclus), 0, 1, 0, 0},
19333 {&__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},
19334 {&__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},
19335 {&__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},
19336 {&__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},
19337 {&__pyx_kp_u_The_informal_string_representat, __pyx_k_The_informal_string_representat,
sizeof(__pyx_k_The_informal_string_representat), 0, 1, 0, 0},
19338 {&__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},
19339 {&__pyx_kp_u_The_official_string_representat, __pyx_k_The_official_string_representat,
sizeof(__pyx_k_The_official_string_representat), 0, 1, 0, 0},
19340 {&__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},
19341 {&__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},
19342 {&__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},
19343 {&__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},
19344 {&__pyx_n_s_TypeError, __pyx_k_TypeError,
sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
19345 {&__pyx_kp_u_UTF_8, __pyx_k_UTF_8,
sizeof(__pyx_k_UTF_8), 0, 1, 0, 0},
19346 {&__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},
19347 {&__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},
19348 {&__pyx_n_s_ValueError, __pyx_k_ValueError,
sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
19349 {&__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},
19350 {&__pyx_kp_u__2, __pyx_k__2,
sizeof(__pyx_k__2), 0, 1, 0, 0},
19351 {&__pyx_kp_u__5, __pyx_k__5,
sizeof(__pyx_k__5), 0, 1, 0, 0},
19352 {&__pyx_kp_u__6, __pyx_k__6,
sizeof(__pyx_k__6), 0, 1, 0, 0},
19353 {&__pyx_kp_u__7, __pyx_k__7,
sizeof(__pyx_k__7), 0, 1, 0, 0},
19354 {&__pyx_kp_u__8, __pyx_k__8,
sizeof(__pyx_k__8), 0, 1, 0, 0},
19355 {&__pyx_kp_u__9, __pyx_k__9,
sizeof(__pyx_k__9), 0, 1, 0, 0},
19356 {&__pyx_n_s_abc, __pyx_k_abc,
sizeof(__pyx_k_abc), 0, 0, 1, 1},
19357 {&__pyx_kp_u_abs_line_1472, __pyx_k_abs_line_1472,
sizeof(__pyx_k_abs_line_1472), 0, 1, 0, 0},
19358 {&__pyx_n_s_acos, __pyx_k_acos,
sizeof(__pyx_k_acos), 0, 0, 1, 1},
19359 {&__pyx_kp_u_acos_line_1618, __pyx_k_acos_line_1618,
sizeof(__pyx_k_acos_line_1618), 0, 1, 0, 0},
19360 {&__pyx_n_s_acosh, __pyx_k_acosh,
sizeof(__pyx_k_acosh), 0, 0, 1, 1},
19361 {&__pyx_kp_u_acosh_line_1655, __pyx_k_acosh_line_1655,
sizeof(__pyx_k_acosh_line_1655), 0, 1, 0, 0},
19362 {&__pyx_kp_u_agc3_line_1843, __pyx_k_agc3_line_1843,
sizeof(__pyx_k_agc3_line_1843), 0, 1, 0, 0},
19363 {&__pyx_n_s_args, __pyx_k_args,
sizeof(__pyx_k_args), 0, 0, 1, 1},
19364 {&__pyx_kp_u_as_frame, __pyx_k_as_frame,
sizeof(__pyx_k_as_frame), 0, 1, 0, 0},
19365 {&__pyx_n_s_asin, __pyx_k_asin,
sizeof(__pyx_k_asin), 0, 0, 1, 1},
19366 {&__pyx_kp_u_asin_line_1697, __pyx_k_asin_line_1697,
sizeof(__pyx_k_asin_line_1697), 0, 1, 0, 0},
19367 {&__pyx_n_s_asinh, __pyx_k_asinh,
sizeof(__pyx_k_asinh), 0, 0, 1, 1},
19368 {&__pyx_kp_u_asinh_line_1732, __pyx_k_asinh_line_1732,
sizeof(__pyx_k_asinh_line_1732), 0, 1, 0, 0},
19369 {&__pyx_n_s_atan, __pyx_k_atan,
sizeof(__pyx_k_atan), 0, 0, 1, 1},
19370 {&__pyx_kp_u_atan_line_1768, __pyx_k_atan_line_1768,
sizeof(__pyx_k_atan_line_1768), 0, 1, 0, 0},
19371 {&__pyx_n_s_atanh, __pyx_k_atanh,
sizeof(__pyx_k_atanh), 0, 0, 1, 1},
19372 {&__pyx_kp_u_atanh_line_1797, __pyx_k_atanh_line_1797,
sizeof(__pyx_k_atanh_line_1797), 0, 1, 0, 0},
19373 {&__pyx_kp_u_cga3_line_1823, __pyx_k_cga3_line_1823,
sizeof(__pyx_k_cga3_line_1823), 0, 1, 0, 0},
19374 {&__pyx_kp_u_cga3std_line_1832, __pyx_k_cga3std_line_1832,
sizeof(__pyx_k_cga3std_line_1832), 0, 1, 0, 0},
19375 {&__pyx_n_s_cl, __pyx_k_cl,
sizeof(__pyx_k_cl), 0, 0, 1, 1},
19376 {&__pyx_n_s_clifford, __pyx_k_clifford,
sizeof(__pyx_k_clifford), 0, 0, 1, 1},
19377 {&__pyx_kp_u_clifford___add___line_740, __pyx_k_clifford___add___line_740,
sizeof(__pyx_k_clifford___add___line_740), 0, 1, 0, 0},
19378 {&__pyx_kp_u_clifford___and___line_836, __pyx_k_clifford___and___line_836,
sizeof(__pyx_k_clifford___and___line_836), 0, 1, 0, 0},
19379 {&__pyx_kp_u_clifford___call___line_1020, __pyx_k_clifford___call___line_1020,
sizeof(__pyx_k_clifford___call___line_1020), 0, 1, 0, 0},
19380 {&__pyx_kp_u_clifford___getitem___line_707, __pyx_k_clifford___getitem___line_707,
sizeof(__pyx_k_clifford___getitem___line_707), 0, 1, 0, 0},
19381 {&__pyx_kp_u_clifford___iadd___line_751, __pyx_k_clifford___iadd___line_751,
sizeof(__pyx_k_clifford___iadd___line_751), 0, 1, 0, 0},
19382 {&__pyx_kp_u_clifford___iand___line_851, __pyx_k_clifford___iand___line_851,
sizeof(__pyx_k_clifford___iand___line_851), 0, 1, 0, 0},
19383 {&__pyx_kp_u_clifford___idiv___line_911, __pyx_k_clifford___idiv___line_911,
sizeof(__pyx_k_clifford___idiv___line_911), 0, 1, 0, 0},
19384 {&__pyx_kp_u_clifford___imod___line_821, __pyx_k_clifford___imod___line_821,
sizeof(__pyx_k_clifford___imod___line_821), 0, 1, 0, 0},
19385 {&__pyx_kp_u_clifford___imul___line_793, __pyx_k_clifford___imul___line_793,
sizeof(__pyx_k_clifford___imul___line_793), 0, 1, 0, 0},
19386 {&__pyx_kp_u_clifford___ior___line_950, __pyx_k_clifford___ior___line_950,
sizeof(__pyx_k_clifford___ior___line_950), 0, 1, 0, 0},
19387 {&__pyx_kp_u_clifford___isub___line_771, __pyx_k_clifford___isub___line_771,
sizeof(__pyx_k_clifford___isub___line_771), 0, 1, 0, 0},
19388 {&__pyx_kp_u_clifford___iter___line_638, __pyx_k_clifford___iter___line_638,
sizeof(__pyx_k_clifford___iter___line_638), 0, 1, 0, 0},
19389 {&__pyx_kp_u_clifford___ixor___line_881, __pyx_k_clifford___ixor___line_881,
sizeof(__pyx_k_clifford___ixor___line_881), 0, 1, 0, 0},
19390 {&__pyx_kp_u_clifford___mod___line_806, __pyx_k_clifford___mod___line_806,
sizeof(__pyx_k_clifford___mod___line_806), 0, 1, 0, 0},
19391 {&__pyx_kp_u_clifford___mul___line_780, __pyx_k_clifford___mul___line_780,
sizeof(__pyx_k_clifford___mul___line_780), 0, 1, 0, 0},
19392 {&__pyx_kp_u_clifford___neg___line_722, __pyx_k_clifford___neg___line_722,
sizeof(__pyx_k_clifford___neg___line_722), 0, 1, 0, 0},
19393 {&__pyx_kp_u_clifford___or___line_939, __pyx_k_clifford___or___line_939,
sizeof(__pyx_k_clifford___or___line_939), 0, 1, 0, 0},
19394 {&__pyx_kp_u_clifford___pos___line_731, __pyx_k_clifford___pos___line_731,
sizeof(__pyx_k_clifford___pos___line_731), 0, 1, 0, 0},
19395 {&__pyx_kp_u_clifford___pow___line_961, __pyx_k_clifford___pow___line_961,
sizeof(__pyx_k_clifford___pow___line_961), 0, 1, 0, 0},
19396 {&__pyx_kp_u_clifford___repr___line_1226, __pyx_k_clifford___repr___line_1226,
sizeof(__pyx_k_clifford___repr___line_1226), 0, 1, 0, 0},
19397 {&__pyx_kp_u_clifford___str___line_1235, __pyx_k_clifford___str___line_1235,
sizeof(__pyx_k_clifford___str___line_1235), 0, 1, 0, 0},
19398 {&__pyx_kp_u_clifford___sub___line_760, __pyx_k_clifford___sub___line_760,
sizeof(__pyx_k_clifford___sub___line_760), 0, 1, 0, 0},
19399 {&__pyx_kp_u_clifford___truediv___line_896, __pyx_k_clifford___truediv___line_896,
sizeof(__pyx_k_clifford___truediv___line_896), 0, 1, 0, 0},
19400 {&__pyx_kp_u_clifford___xor___line_866, __pyx_k_clifford___xor___line_866,
sizeof(__pyx_k_clifford___xor___line_866), 0, 1, 0, 0},
19401 {&__pyx_kp_u_clifford_abs_line_1175, __pyx_k_clifford_abs_line_1175,
sizeof(__pyx_k_clifford_abs_line_1175), 0, 1, 0, 0},
19402 {&__pyx_kp_u_clifford_conj_line_1138, __pyx_k_clifford_conj_line_1138,
sizeof(__pyx_k_clifford_conj_line_1138), 0, 1, 0, 0},
19403 {&__pyx_kp_u_clifford_copy_line_556, __pyx_k_clifford_copy_line_556,
sizeof(__pyx_k_clifford_copy_line_556), 0, 1, 0, 0},
19404 {&__pyx_kp_u_clifford_even_line_1061, __pyx_k_clifford_even_line_1061,
sizeof(__pyx_k_clifford_even_line_1061), 0, 1, 0, 0},
19405 {&__pyx_kp_u_clifford_frame_line_1215, __pyx_k_clifford_frame_line_1215,
sizeof(__pyx_k_clifford_frame_line_1215), 0, 1, 0, 0},
19406 {&__pyx_n_s_clifford_hidden_doctests, __pyx_k_clifford_hidden_doctests,
sizeof(__pyx_k_clifford_hidden_doctests), 0, 0, 1, 1},
19407 {&__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},
19408 {&__pyx_kp_u_clifford_inv_line_926, __pyx_k_clifford_inv_line_926,
sizeof(__pyx_k_clifford_inv_line_926), 0, 1, 0, 0},
19409 {&__pyx_kp_u_clifford_involute_line_1107, __pyx_k_clifford_involute_line_1107,
sizeof(__pyx_k_clifford_involute_line_1107), 0, 1, 0, 0},
19410 {&__pyx_kp_u_clifford_isnan_line_1206, __pyx_k_clifford_isnan_line_1206,
sizeof(__pyx_k_clifford_isnan_line_1206), 0, 1, 0, 0},
19411 {&__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},
19412 {&__pyx_kp_u_clifford_norm_line_1164, __pyx_k_clifford_norm_line_1164,
sizeof(__pyx_k_clifford_norm_line_1164), 0, 1, 0, 0},
19413 {&__pyx_kp_u_clifford_odd_line_1070, __pyx_k_clifford_odd_line_1070,
sizeof(__pyx_k_clifford_odd_line_1070), 0, 1, 0, 0},
19414 {&__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},
19415 {&__pyx_kp_u_clifford_pow_line_980, __pyx_k_clifford_pow_line_980,
sizeof(__pyx_k_clifford_pow_line_980), 0, 1, 0, 0},
19416 {&__pyx_kp_u_clifford_pure_line_1050, __pyx_k_clifford_pure_line_1050,
sizeof(__pyx_k_clifford_pure_line_1050), 0, 1, 0, 0},
19417 {&__pyx_kp_u_clifford_quad_line_1153, __pyx_k_clifford_quad_line_1153,
sizeof(__pyx_k_clifford_quad_line_1153), 0, 1, 0, 0},
19418 {&__pyx_kp_u_clifford_reframe_line_649, __pyx_k_clifford_reframe_line_649,
sizeof(__pyx_k_clifford_reframe_line_649), 0, 1, 0, 0},
19419 {&__pyx_kp_u_clifford_reverse_line_1123, __pyx_k_clifford_reverse_line_1123,
sizeof(__pyx_k_clifford_reverse_line_1123), 0, 1, 0, 0},
19420 {&__pyx_kp_u_clifford_scalar_line_1039, __pyx_k_clifford_scalar_line_1039,
sizeof(__pyx_k_clifford_scalar_line_1039), 0, 1, 0, 0},
19421 {&__pyx_kp_u_clifford_truncated_line_1195, __pyx_k_clifford_truncated_line_1195,
sizeof(__pyx_k_clifford_truncated_line_1195), 0, 1, 0, 0},
19422 {&__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},
19423 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback,
sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
19424 {&__pyx_n_s_close, __pyx_k_close,
sizeof(__pyx_k_close), 0, 0, 1, 1},
19425 {&__pyx_n_s_collections, __pyx_k_collections,
sizeof(__pyx_k_collections), 0, 0, 1, 1},
19426 {&__pyx_kp_u_compare_line_492, __pyx_k_compare_line_492,
sizeof(__pyx_k_compare_line_492), 0, 1, 0, 0},
19427 {&__pyx_kp_u_complexifier_line_1526, __pyx_k_complexifier_line_1526,
sizeof(__pyx_k_complexifier_line_1526), 0, 1, 0, 0},
19428 {&__pyx_n_s_conj, __pyx_k_conj,
sizeof(__pyx_k_conj), 0, 0, 1, 1},
19429 {&__pyx_kp_u_conj_line_1435, __pyx_k_conj_line_1435,
sizeof(__pyx_k_conj_line_1435), 0, 1, 0, 0},
19430 {&__pyx_n_s_copy, __pyx_k_copy,
sizeof(__pyx_k_copy), 0, 0, 1, 1},
19431 {&__pyx_n_s_cos, __pyx_k_cos,
sizeof(__pyx_k_cos), 0, 0, 1, 1},
19432 {&__pyx_kp_u_cos_line_1601, __pyx_k_cos_line_1601,
sizeof(__pyx_k_cos_line_1601), 0, 1, 0, 0},
19433 {&__pyx_n_s_cosh, __pyx_k_cosh,
sizeof(__pyx_k_cosh), 0, 0, 1, 1},
19434 {&__pyx_kp_u_cosh_line_1639, __pyx_k_cosh_line_1639,
sizeof(__pyx_k_cosh_line_1639), 0, 1, 0, 0},
19435 {&__pyx_n_s_doctest, __pyx_k_doctest,
sizeof(__pyx_k_doctest), 0, 0, 1, 1},
19436 {&__pyx_n_s_e, __pyx_k_e,
sizeof(__pyx_k_e), 0, 0, 1, 1},
19437 {&__pyx_kp_u_e_line_1886, __pyx_k_e_line_1886,
sizeof(__pyx_k_e_line_1886), 0, 1, 0, 0},
19438 {&__pyx_n_s_encode, __pyx_k_encode,
sizeof(__pyx_k_encode), 0, 0, 1, 1},
19439 {&__pyx_n_s_even, __pyx_k_even,
sizeof(__pyx_k_even), 0, 0, 1, 1},
19440 {&__pyx_kp_u_even_line_1387, __pyx_k_even_line_1387,
sizeof(__pyx_k_even_line_1387), 0, 1, 0, 0},
19441 {&__pyx_n_s_exp, __pyx_k_exp,
sizeof(__pyx_k_exp), 0, 0, 1, 1},
19442 {&__pyx_kp_u_exp_line_1564, __pyx_k_exp_line_1564,
sizeof(__pyx_k_exp_line_1564), 0, 1, 0, 0},
19443 {&__pyx_n_s_fill, __pyx_k_fill,
sizeof(__pyx_k_fill), 0, 0, 1, 1},
19444 {&__pyx_n_s_frm, __pyx_k_frm,
sizeof(__pyx_k_frm), 0, 0, 1, 1},
19445 {&__pyx_kp_u_from, __pyx_k_from,
sizeof(__pyx_k_from), 0, 1, 0, 0},
19446 {&__pyx_n_s_getstate, __pyx_k_getstate,
sizeof(__pyx_k_getstate), 0, 0, 1, 1},
19447 {&__pyx_n_s_grade, __pyx_k_grade,
sizeof(__pyx_k_grade), 0, 0, 1, 1},
19448 {&__pyx_n_s_i, __pyx_k_i,
sizeof(__pyx_k_i), 0, 0, 1, 1},
19449 {&__pyx_kp_u_imag_line_1365, __pyx_k_imag_line_1365,
sizeof(__pyx_k_imag_line_1365), 0, 1, 0, 0},
19450 {&__pyx_n_s_import, __pyx_k_import,
sizeof(__pyx_k_import), 0, 0, 1, 1},
19451 {&__pyx_n_s_index_set, __pyx_k_index_set,
sizeof(__pyx_k_index_set), 0, 0, 1, 1},
19452 {&__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},
19453 {&__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},
19454 {&__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},
19455 {&__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},
19456 {&__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},
19457 {&__pyx_n_s_index_set___iter, __pyx_k_index_set___iter,
sizeof(__pyx_k_index_set___iter), 0, 0, 1, 1},
19458 {&__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},
19459 {&__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},
19460 {&__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},
19461 {&__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},
19462 {&__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},
19463 {&__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},
19464 {&__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},
19465 {&__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},
19466 {&__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},
19467 {&__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},
19468 {&__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},
19469 {&__pyx_n_s_index_set_hidden_doctests, __pyx_k_index_set_hidden_doctests,
sizeof(__pyx_k_index_set_hidden_doctests), 0, 0, 1, 1},
19470 {&__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},
19471 {&__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},
19472 {&__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},
19473 {&__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},
19474 {&__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},
19475 {&__pyx_n_s_inv, __pyx_k_inv,
sizeof(__pyx_k_inv), 0, 0, 1, 1},
19476 {&__pyx_kp_u_inv_line_1328, __pyx_k_inv_line_1328,
sizeof(__pyx_k_inv_line_1328), 0, 1, 0, 0},
19477 {&__pyx_kp_u_invalid, __pyx_k_invalid,
sizeof(__pyx_k_invalid), 0, 1, 0, 0},
19478 {&__pyx_kp_u_invalid_string, __pyx_k_invalid_string,
sizeof(__pyx_k_invalid_string), 0, 1, 0, 0},
19479 {&__pyx_n_s_involute, __pyx_k_involute,
sizeof(__pyx_k_involute), 0, 0, 1, 1},
19480 {&__pyx_kp_u_involute_line_1405, __pyx_k_involute_line_1405,
sizeof(__pyx_k_involute_line_1405), 0, 1, 0, 0},
19481 {&__pyx_n_s_ist, __pyx_k_ist,
sizeof(__pyx_k_ist), 0, 0, 1, 1},
19482 {&__pyx_n_s_istpq, __pyx_k_istpq,
sizeof(__pyx_k_istpq), 0, 0, 1, 1},
19483 {&__pyx_kp_u_istpq_line_1899, __pyx_k_istpq_line_1899,
sizeof(__pyx_k_istpq_line_1899), 0, 1, 0, 0},
19484 {&__pyx_n_s_iter, __pyx_k_iter,
sizeof(__pyx_k_iter), 0, 0, 1, 1},
19485 {&__pyx_n_s_ixt, __pyx_k_ixt,
sizeof(__pyx_k_ixt), 0, 0, 1, 1},
19486 {&__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},
19487 {&__pyx_n_s_lhs, __pyx_k_lhs,
sizeof(__pyx_k_lhs), 0, 0, 1, 1},
19488 {&__pyx_n_s_log, __pyx_k_log,
sizeof(__pyx_k_log), 0, 0, 1, 1},
19489 {&__pyx_kp_u_log_line_1578, __pyx_k_log_line_1578,
sizeof(__pyx_k_log_line_1578), 0, 1, 0, 0},
19490 {&__pyx_n_s_m, __pyx_k_m,
sizeof(__pyx_k_m), 0, 0, 1, 1},
19491 {&__pyx_n_s_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 0, 1, 1},
19492 {&__pyx_n_u_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 1, 0, 1},
19493 {&__pyx_n_s_math, __pyx_k_math,
sizeof(__pyx_k_math), 0, 0, 1, 1},
19494 {&__pyx_n_s_max, __pyx_k_max,
sizeof(__pyx_k_max), 0, 0, 1, 1},
19495 {&__pyx_kp_u_max_abs_line_1481, __pyx_k_max_abs_line_1481,
sizeof(__pyx_k_max_abs_line_1481), 0, 1, 0, 0},
19496 {&__pyx_kp_u_max_pos_line_513, __pyx_k_max_pos_line_513,
sizeof(__pyx_k_max_pos_line_513), 0, 1, 0, 0},
19497 {&__pyx_n_s_min, __pyx_k_min,
sizeof(__pyx_k_min), 0, 0, 1, 1},
19498 {&__pyx_kp_u_min_neg_line_504, __pyx_k_min_neg_line_504,
sizeof(__pyx_k_min_neg_line_504), 0, 1, 0, 0},
19499 {&__pyx_n_s_name, __pyx_k_name,
sizeof(__pyx_k_name), 0, 0, 1, 1},
19500 {&__pyx_n_s_nbar3, __pyx_k_nbar3,
sizeof(__pyx_k_nbar3), 0, 0, 1, 1},
19501 {&__pyx_n_s_ninf3, __pyx_k_ninf3,
sizeof(__pyx_k_ninf3), 0, 0, 1, 1},
19502 {&__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},
19503 {&__pyx_n_s_norm, __pyx_k_norm,
sizeof(__pyx_k_norm), 0, 0, 1, 1},
19504 {&__pyx_kp_u_norm_line_1461, __pyx_k_norm_line_1461,
sizeof(__pyx_k_norm_line_1461), 0, 1, 0, 0},
19505 {&__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},
19506 {&__pyx_n_s_numbers, __pyx_k_numbers,
sizeof(__pyx_k_numbers), 0, 0, 1, 1},
19507 {&__pyx_n_s_obj, __pyx_k_obj,
sizeof(__pyx_k_obj), 0, 0, 1, 1},
19508 {&__pyx_n_s_odd, __pyx_k_odd,
sizeof(__pyx_k_odd), 0, 0, 1, 1},
19509 {&__pyx_kp_u_odd_line_1396, __pyx_k_odd_line_1396,
sizeof(__pyx_k_odd_line_1396), 0, 1, 0, 0},
19510 {&__pyx_n_s_other, __pyx_k_other,
sizeof(__pyx_k_other), 0, 0, 1, 1},
19511 {&__pyx_n_s_outer_pow, __pyx_k_outer_pow,
sizeof(__pyx_k_outer_pow), 0, 0, 1, 1},
19512 {&__pyx_kp_u_outer_pow_line_1517, __pyx_k_outer_pow_line_1517,
sizeof(__pyx_k_outer_pow_line_1517), 0, 1, 0, 0},
19513 {&__pyx_n_s_p, __pyx_k_p,
sizeof(__pyx_k_p), 0, 0, 1, 1},
19514 {&__pyx_n_s_pi, __pyx_k_pi,
sizeof(__pyx_k_pi), 0, 0, 1, 1},
19515 {&__pyx_n_s_pow, __pyx_k_pow,
sizeof(__pyx_k_pow), 0, 0, 1, 1},
19516 {&__pyx_kp_u_pow_line_1493, __pyx_k_pow_line_1493,
sizeof(__pyx_k_pow_line_1493), 0, 1, 0, 0},
19517 {&__pyx_n_s_pure, __pyx_k_pure,
sizeof(__pyx_k_pure), 0, 0, 1, 1},
19518 {&__pyx_kp_u_pure_line_1376, __pyx_k_pure_line_1376,
sizeof(__pyx_k_pure_line_1376), 0, 1, 0, 0},
19519 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable,
sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
19520 {&__pyx_n_s_q, __pyx_k_q,
sizeof(__pyx_k_q), 0, 0, 1, 1},
19521 {&__pyx_n_s_quad, __pyx_k_quad,
sizeof(__pyx_k_quad), 0, 0, 1, 1},
19522 {&__pyx_kp_u_quad_line_1450, __pyx_k_quad_line_1450,
sizeof(__pyx_k_quad_line_1450), 0, 1, 0, 0},
19523 {&__pyx_kp_u_random_clifford_line_1814, __pyx_k_random_clifford_line_1814,
sizeof(__pyx_k_random_clifford_line_1814), 0, 1, 0, 0},
19524 {&__pyx_n_s_range, __pyx_k_range,
sizeof(__pyx_k_range), 0, 0, 1, 1},
19525 {&__pyx_kp_u_real_line_1354, __pyx_k_real_line_1354,
sizeof(__pyx_k_real_line_1354), 0, 1, 0, 0},
19526 {&__pyx_n_s_reduce, __pyx_k_reduce,
sizeof(__pyx_k_reduce), 0, 0, 1, 1},
19527 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython,
sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
19528 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex,
sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
19529 {&__pyx_n_s_reverse, __pyx_k_reverse,
sizeof(__pyx_k_reverse), 0, 0, 1, 1},
19530 {&__pyx_kp_u_reverse_line_1420, __pyx_k_reverse_line_1420,
sizeof(__pyx_k_reverse_line_1420), 0, 1, 0, 0},
19531 {&__pyx_n_s_rhs, __pyx_k_rhs,
sizeof(__pyx_k_rhs), 0, 0, 1, 1},
19532 {&__pyx_n_s_scalar, __pyx_k_scalar,
sizeof(__pyx_k_scalar), 0, 0, 1, 1},
19533 {&__pyx_n_s_scalar_epsilon, __pyx_k_scalar_epsilon,
sizeof(__pyx_k_scalar_epsilon), 0, 0, 1, 1},
19534 {&__pyx_kp_u_scalar_line_1343, __pyx_k_scalar_line_1343,
sizeof(__pyx_k_scalar_line_1343), 0, 1, 0, 0},
19535 {&__pyx_n_s_send, __pyx_k_send,
sizeof(__pyx_k_send), 0, 0, 1, 1},
19536 {&__pyx_n_s_setstate, __pyx_k_setstate,
sizeof(__pyx_k_setstate), 0, 0, 1, 1},
19537 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython,
sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
19538 {&__pyx_n_s_sin, __pyx_k_sin,
sizeof(__pyx_k_sin), 0, 0, 1, 1},
19539 {&__pyx_kp_u_sin_line_1678, __pyx_k_sin_line_1678,
sizeof(__pyx_k_sin_line_1678), 0, 1, 0, 0},
19540 {&__pyx_n_s_sinh, __pyx_k_sinh,
sizeof(__pyx_k_sinh), 0, 0, 1, 1},
19541 {&__pyx_kp_u_sinh_line_1718, __pyx_k_sinh_line_1718,
sizeof(__pyx_k_sinh_line_1718), 0, 1, 0, 0},
19542 {&__pyx_n_s_sqrt, __pyx_k_sqrt,
sizeof(__pyx_k_sqrt), 0, 0, 1, 1},
19543 {&__pyx_kp_u_sqrt_line_1541, __pyx_k_sqrt_line_1541,
sizeof(__pyx_k_sqrt_line_1541), 0, 1, 0, 0},
19544 {&__pyx_n_s_tan, __pyx_k_tan,
sizeof(__pyx_k_tan), 0, 0, 1, 1},
19545 {&__pyx_kp_u_tan_line_1751, __pyx_k_tan_line_1751,
sizeof(__pyx_k_tan_line_1751), 0, 1, 0, 0},
19546 {&__pyx_n_s_tanh, __pyx_k_tanh,
sizeof(__pyx_k_tanh), 0, 0, 1, 1},
19547 {&__pyx_kp_u_tanh_line_1785, __pyx_k_tanh_line_1785,
sizeof(__pyx_k_tanh_line_1785), 0, 1, 0, 0},
19548 {&__pyx_n_s_tau, __pyx_k_tau,
sizeof(__pyx_k_tau), 0, 0, 1, 1},
19549 {&__pyx_n_s_test, __pyx_k_test,
sizeof(__pyx_k_test), 0, 0, 1, 1},
19550 {&__pyx_n_s_test_2, __pyx_k_test_2,
sizeof(__pyx_k_test_2), 0, 0, 1, 1},
19551 {&__pyx_n_s_testmod, __pyx_k_testmod,
sizeof(__pyx_k_testmod), 0, 0, 1, 1},
19552 {&__pyx_n_s_throw, __pyx_k_throw,
sizeof(__pyx_k_throw), 0, 0, 1, 1},
19553 {&__pyx_kp_u_to_frame, __pyx_k_to_frame,
sizeof(__pyx_k_to_frame), 0, 1, 0, 0},
19554 {&__pyx_kp_u_using, __pyx_k_using,
sizeof(__pyx_k_using), 0, 1, 0, 0},
19555 {&__pyx_kp_u_using_invalid, __pyx_k_using_invalid,
sizeof(__pyx_k_using_invalid), 0, 1, 0, 0},
19556 {&__pyx_kp_u_value, __pyx_k_value,
sizeof(__pyx_k_value), 0, 1, 0, 0},
19557 {&__pyx_n_s_version, __pyx_k_version,
sizeof(__pyx_k_version), 0, 0, 1, 1},
19558 {&__pyx_n_s_xrange, __pyx_k_xrange,
sizeof(__pyx_k_xrange), 0, 0, 1, 1},
19559 {0, 0, 0, 0, 0, 0, 0}
19561 static CYTHON_SMALL_CODE
int __Pyx_InitCachedBuiltins(
void) {
19562 __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError);
if (!__pyx_builtin_IndexError) __PYX_ERR(0, 103, __pyx_L1_error)
19563 __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError);
if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 105, __pyx_L1_error)
19564 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError);
if (!__pyx_builtin_TypeError) __PYX_ERR(0, 105, __pyx_L1_error)
19565 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError);
if (!__pyx_builtin_ValueError) __PYX_ERR(0, 106, __pyx_L1_error)
19566 __pyx_builtin_NotImplemented = __Pyx_GetBuiltinName(__pyx_n_s_NotImplemented);
if (!__pyx_builtin_NotImplemented) __PYX_ERR(0, 159, __pyx_L1_error)
19567 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_range) __PYX_ERR(0, 236, __pyx_L1_error)
19568 #if PY_MAJOR_VERSION >= 3
19569 __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_xrange) __PYX_ERR(0, 1099, __pyx_L1_error)
19571 __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange);
if (!__pyx_builtin_xrange) __PYX_ERR(0, 1099, __pyx_L1_error)
19578 static CYTHON_SMALL_CODE
int __Pyx_InitCachedConstants(
void) {
19579 __Pyx_RefNannyDeclarations
19580 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
19588 __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)
19589 __Pyx_GOTREF(__pyx_tuple__3);
19590 __Pyx_GIVEREF(__pyx_tuple__3);
19597 __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)
19598 __Pyx_GOTREF(__pyx_tuple__4);
19599 __Pyx_GIVEREF(__pyx_tuple__4);
19608 __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_Not_applicable);
if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 636, __pyx_L1_error)
19609 __Pyx_GOTREF(__pyx_tuple__10);
19610 __Pyx_GIVEREF(__pyx_tuple__10);
19618 __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)
19619 __Pyx_GOTREF(__pyx_tuple__11);
19620 __Pyx_GIVEREF(__pyx_tuple__11);
19627 __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)
19628 __Pyx_GOTREF(__pyx_tuple__12);
19629 __Pyx_GIVEREF(__pyx_tuple__12);
19638 __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)
19647 __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)
19656 __pyx_tuple__15 = PyTuple_Pack(1, __pyx_float_1_0);
if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 1857, __pyx_L1_error)
19657 __Pyx_GOTREF(__pyx_tuple__15);
19658 __Pyx_GIVEREF(__pyx_tuple__15);
19667 __pyx_tuple__16 = PyTuple_Pack(1, __pyx_n_s_obj);
if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 1886, __pyx_L1_error)
19668 __Pyx_GOTREF(__pyx_tuple__16);
19669 __Pyx_GIVEREF(__pyx_tuple__16);
19670 __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)
19679 __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)
19680 __Pyx_GOTREF(__pyx_tuple__18);
19681 __Pyx_GIVEREF(__pyx_tuple__18);
19682 __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)
19691 __pyx_tuple__20 = PyTuple_Pack(1, __pyx_int_4);
if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 1908, __pyx_L1_error)
19692 __Pyx_GOTREF(__pyx_tuple__20);
19693 __Pyx_GIVEREF(__pyx_tuple__20);
19694 __pyx_tuple__21 = PyTuple_Pack(1, __pyx_int_neg_1);
if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 1908, __pyx_L1_error)
19695 __Pyx_GOTREF(__pyx_tuple__21);
19696 __Pyx_GIVEREF(__pyx_tuple__21);
19705 __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)
19706 __Pyx_GOTREF(__pyx_tuple__22);
19707 __Pyx_GIVEREF(__pyx_tuple__22);
19708 __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)
19709 __Pyx_RefNannyFinishContext();
19712 __Pyx_RefNannyFinishContext();
19716 static CYTHON_SMALL_CODE
int __Pyx_InitGlobals(
void) {
19717 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
19718 __pyx_float_0_0 =
PyFloat_FromDouble(0.0);
if (unlikely(!__pyx_float_0_0)) __PYX_ERR(0, 1, __pyx_L1_error)
19719 __pyx_float_1_0 =
PyFloat_FromDouble(1.0);
if (unlikely(!__pyx_float_1_0)) __PYX_ERR(0, 1, __pyx_L1_error)
19720 __pyx_float_4_0 =
PyFloat_FromDouble(4.0);
if (unlikely(!__pyx_float_4_0)) __PYX_ERR(0, 1, __pyx_L1_error)
19721 __pyx_float_8_0 =
PyFloat_FromDouble(8.0);
if (unlikely(!__pyx_float_8_0)) __PYX_ERR(0, 1, __pyx_L1_error)
19722 __pyx_int_0 = PyInt_FromLong(0);
if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
19723 __pyx_int_1 = PyInt_FromLong(1);
if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
19724 __pyx_int_4 = PyInt_FromLong(4);
if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error)
19725 __pyx_int_neg_1 = PyInt_FromLong(-1);
if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
19731 static CYTHON_SMALL_CODE
int __Pyx_modinit_global_init_code(
void);
19732 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_export_code(
void);
19733 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_export_code(
void);
19734 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_init_code(
void);
19735 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_import_code(
void);
19736 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_import_code(
void);
19737 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_import_code(
void);
19739 static int __Pyx_modinit_global_init_code(
void) {
19740 __Pyx_RefNannyDeclarations
19741 __Pyx_RefNannySetupContext(
"__Pyx_modinit_global_init_code", 0);
19743 __Pyx_RefNannyFinishContext();
19747 static int __Pyx_modinit_variable_export_code(
void) {
19748 __Pyx_RefNannyDeclarations
19749 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_export_code", 0);
19751 __Pyx_RefNannyFinishContext();
19755 static int __Pyx_modinit_function_export_code(
void) {
19756 __Pyx_RefNannyDeclarations
19757 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_export_code", 0);
19759 __Pyx_RefNannyFinishContext();
19763 static int __Pyx_modinit_type_init_code(
void) {
19764 __Pyx_RefNannyDeclarations
19765 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_init_code", 0);
19767 __pyx_vtabptr_8PyClical_index_set = &__pyx_vtable_8PyClical_index_set;
19768 __pyx_vtable_8PyClical_index_set.wrap = (PyObject *(*)(
struct __pyx_obj_8PyClical_index_set *,
IndexSet))__pyx_f_8PyClical_9index_set_wrap;
19769 __pyx_vtable_8PyClical_index_set.unwrap = (
IndexSet (*)(
struct __pyx_obj_8PyClical_index_set *))__pyx_f_8PyClical_9index_set_unwrap;
19770 __pyx_vtable_8PyClical_index_set.copy = (PyObject *(*)(
struct __pyx_obj_8PyClical_index_set *,
int __pyx_skip_dispatch))__pyx_f_8PyClical_9index_set_copy;
19771 if (PyType_Ready(&__pyx_type_8PyClical_index_set) < 0) __PYX_ERR(0, 46, __pyx_L1_error)
19772 #if PY_VERSION_HEX < 0x030800B1
19773 __pyx_type_8PyClical_index_set.tp_print = 0;
19775 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)) {
19776 __pyx_type_8PyClical_index_set.tp_getattro = __Pyx_PyObject_GenericGetAttr;
19778 #if CYTHON_COMPILING_IN_CPYTHON
19780 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__setitem__");
if (unlikely(!wrapper)) __PYX_ERR(0, 46, __pyx_L1_error)
19781 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19782 __pyx_wrapperbase_8PyClical_9index_set_8__setitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19783 __pyx_wrapperbase_8PyClical_9index_set_8__setitem__.doc = __pyx_doc_8PyClical_9index_set_8__setitem__;
19784 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_8__setitem__;
19788 #if CYTHON_COMPILING_IN_CPYTHON
19790 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__getitem__");
if (unlikely(!wrapper)) __PYX_ERR(0, 46, __pyx_L1_error)
19791 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19792 __pyx_wrapperbase_8PyClical_9index_set_10__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19793 __pyx_wrapperbase_8PyClical_9index_set_10__getitem__.doc = __pyx_doc_8PyClical_9index_set_10__getitem__;
19794 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_10__getitem__;
19798 #if CYTHON_COMPILING_IN_CPYTHON
19800 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__contains__");
if (unlikely(!wrapper)) __PYX_ERR(0, 46, __pyx_L1_error)
19801 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19802 __pyx_wrapperbase_8PyClical_9index_set_12__contains__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19803 __pyx_wrapperbase_8PyClical_9index_set_12__contains__.doc = __pyx_doc_8PyClical_9index_set_12__contains__;
19804 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_12__contains__;
19808 #if CYTHON_COMPILING_IN_CPYTHON
19810 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__iter__");
if (unlikely(!wrapper)) __PYX_ERR(0, 46, __pyx_L1_error)
19811 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19812 __pyx_wrapperbase_8PyClical_9index_set_14__iter__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19813 __pyx_wrapperbase_8PyClical_9index_set_14__iter__.doc = __pyx_doc_8PyClical_9index_set_14__iter__;
19814 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_14__iter__;
19818 #if CYTHON_COMPILING_IN_CPYTHON
19820 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__invert__");
if (unlikely(!wrapper)) __PYX_ERR(0, 46, __pyx_L1_error)
19821 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19822 __pyx_wrapperbase_8PyClical_9index_set_17__invert__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19823 __pyx_wrapperbase_8PyClical_9index_set_17__invert__.doc = __pyx_doc_8PyClical_9index_set_17__invert__;
19824 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_17__invert__;
19828 #if CYTHON_COMPILING_IN_CPYTHON
19830 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__xor__");
if (unlikely(!wrapper)) __PYX_ERR(0, 46, __pyx_L1_error)
19831 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19832 __pyx_wrapperbase_8PyClical_9index_set_19__xor__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19833 __pyx_wrapperbase_8PyClical_9index_set_19__xor__.doc = __pyx_doc_8PyClical_9index_set_19__xor__;
19834 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_19__xor__;
19838 #if CYTHON_COMPILING_IN_CPYTHON
19840 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__ixor__");
if (unlikely(!wrapper)) __PYX_ERR(0, 46, __pyx_L1_error)
19841 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19842 __pyx_wrapperbase_8PyClical_9index_set_21__ixor__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19843 __pyx_wrapperbase_8PyClical_9index_set_21__ixor__.doc = __pyx_doc_8PyClical_9index_set_21__ixor__;
19844 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_21__ixor__;
19848 #if CYTHON_COMPILING_IN_CPYTHON
19850 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__and__");
if (unlikely(!wrapper)) __PYX_ERR(0, 46, __pyx_L1_error)
19851 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19852 __pyx_wrapperbase_8PyClical_9index_set_23__and__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19853 __pyx_wrapperbase_8PyClical_9index_set_23__and__.doc = __pyx_doc_8PyClical_9index_set_23__and__;
19854 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_23__and__;
19858 #if CYTHON_COMPILING_IN_CPYTHON
19860 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__iand__");
if (unlikely(!wrapper)) __PYX_ERR(0, 46, __pyx_L1_error)
19861 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19862 __pyx_wrapperbase_8PyClical_9index_set_25__iand__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19863 __pyx_wrapperbase_8PyClical_9index_set_25__iand__.doc = __pyx_doc_8PyClical_9index_set_25__iand__;
19864 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_25__iand__;
19868 #if CYTHON_COMPILING_IN_CPYTHON
19870 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__or__");
if (unlikely(!wrapper)) __PYX_ERR(0, 46, __pyx_L1_error)
19871 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19872 __pyx_wrapperbase_8PyClical_9index_set_27__or__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19873 __pyx_wrapperbase_8PyClical_9index_set_27__or__.doc = __pyx_doc_8PyClical_9index_set_27__or__;
19874 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_27__or__;
19878 #if CYTHON_COMPILING_IN_CPYTHON
19880 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__ior__");
if (unlikely(!wrapper)) __PYX_ERR(0, 46, __pyx_L1_error)
19881 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19882 __pyx_wrapperbase_8PyClical_9index_set_29__ior__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19883 __pyx_wrapperbase_8PyClical_9index_set_29__ior__.doc = __pyx_doc_8PyClical_9index_set_29__ior__;
19884 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_29__ior__;
19888 #if CYTHON_COMPILING_IN_CPYTHON
19890 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__repr__");
if (unlikely(!wrapper)) __PYX_ERR(0, 46, __pyx_L1_error)
19891 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19892 __pyx_wrapperbase_8PyClical_9index_set_47__repr__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19893 __pyx_wrapperbase_8PyClical_9index_set_47__repr__.doc = __pyx_doc_8PyClical_9index_set_47__repr__;
19894 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_47__repr__;
19898 #if CYTHON_COMPILING_IN_CPYTHON
19900 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_index_set,
"__str__");
if (unlikely(!wrapper)) __PYX_ERR(0, 46, __pyx_L1_error)
19901 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19902 __pyx_wrapperbase_8PyClical_9index_set_49__str__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19903 __pyx_wrapperbase_8PyClical_9index_set_49__str__.doc = __pyx_doc_8PyClical_9index_set_49__str__;
19904 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_9index_set_49__str__;
19908 if (__Pyx_SetVtable(__pyx_type_8PyClical_index_set.tp_dict, __pyx_vtabptr_8PyClical_index_set) < 0) __PYX_ERR(0, 46, __pyx_L1_error)
19909 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_index_set, (PyObject *)&__pyx_type_8PyClical_index_set) < 0) __PYX_ERR(0, 46, __pyx_L1_error)
19910 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8PyClical_index_set) < 0) __PYX_ERR(0, 46, __pyx_L1_error)
19911 __pyx_ptype_8PyClical_index_set = &__pyx_type_8PyClical_index_set;
19912 __pyx_vtabptr_8PyClical_clifford = &__pyx_vtable_8PyClical_clifford;
19913 __pyx_vtable_8PyClical_clifford.wrap = (PyObject *(*)(
struct __pyx_obj_8PyClical_clifford *,
Clifford))__pyx_f_8PyClical_8clifford_wrap;
19914 __pyx_vtable_8PyClical_clifford.unwrap = (
Clifford (*)(
struct __pyx_obj_8PyClical_clifford *))__pyx_f_8PyClical_8clifford_unwrap;
19915 __pyx_vtable_8PyClical_clifford.copy = (PyObject *(*)(
struct __pyx_obj_8PyClical_clifford *,
int __pyx_skip_dispatch))__pyx_f_8PyClical_8clifford_copy;
19916 if (PyType_Ready(&__pyx_type_8PyClical_clifford) < 0) __PYX_ERR(0, 537, __pyx_L1_error)
19917 #if PY_VERSION_HEX < 0x030800B1
19918 __pyx_type_8PyClical_clifford.tp_print = 0;
19920 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8PyClical_clifford.tp_dictoffset && __pyx_type_8PyClical_clifford.tp_getattro == PyObject_GenericGetAttr)) {
19921 __pyx_type_8PyClical_clifford.tp_getattro = __Pyx_PyObject_GenericGetAttr;
19923 #if CYTHON_COMPILING_IN_CPYTHON
19925 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__contains__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
19926 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19927 __pyx_wrapperbase_8PyClical_8clifford_6__contains__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19928 __pyx_wrapperbase_8PyClical_8clifford_6__contains__.doc = __pyx_doc_8PyClical_8clifford_6__contains__;
19929 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_6__contains__;
19933 #if CYTHON_COMPILING_IN_CPYTHON
19935 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__iter__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
19936 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19937 __pyx_wrapperbase_8PyClical_8clifford_8__iter__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19938 __pyx_wrapperbase_8PyClical_8clifford_8__iter__.doc = __pyx_doc_8PyClical_8clifford_8__iter__;
19939 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_8__iter__;
19943 #if CYTHON_COMPILING_IN_CPYTHON
19945 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__getitem__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
19946 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19947 __pyx_wrapperbase_8PyClical_8clifford_14__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19948 __pyx_wrapperbase_8PyClical_8clifford_14__getitem__.doc = __pyx_doc_8PyClical_8clifford_14__getitem__;
19949 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_14__getitem__;
19953 #if CYTHON_COMPILING_IN_CPYTHON
19955 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__neg__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
19956 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19957 __pyx_wrapperbase_8PyClical_8clifford_16__neg__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19958 __pyx_wrapperbase_8PyClical_8clifford_16__neg__.doc = __pyx_doc_8PyClical_8clifford_16__neg__;
19959 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_16__neg__;
19963 #if CYTHON_COMPILING_IN_CPYTHON
19965 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__pos__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
19966 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19967 __pyx_wrapperbase_8PyClical_8clifford_18__pos__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19968 __pyx_wrapperbase_8PyClical_8clifford_18__pos__.doc = __pyx_doc_8PyClical_8clifford_18__pos__;
19969 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_18__pos__;
19973 #if CYTHON_COMPILING_IN_CPYTHON
19975 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__add__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
19976 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19977 __pyx_wrapperbase_8PyClical_8clifford_20__add__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19978 __pyx_wrapperbase_8PyClical_8clifford_20__add__.doc = __pyx_doc_8PyClical_8clifford_20__add__;
19979 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_20__add__;
19983 #if CYTHON_COMPILING_IN_CPYTHON
19985 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__iadd__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
19986 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19987 __pyx_wrapperbase_8PyClical_8clifford_22__iadd__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19988 __pyx_wrapperbase_8PyClical_8clifford_22__iadd__.doc = __pyx_doc_8PyClical_8clifford_22__iadd__;
19989 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_22__iadd__;
19993 #if CYTHON_COMPILING_IN_CPYTHON
19995 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__sub__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
19996 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
19997 __pyx_wrapperbase_8PyClical_8clifford_24__sub__ = *((PyWrapperDescrObject *)wrapper)->d_base;
19998 __pyx_wrapperbase_8PyClical_8clifford_24__sub__.doc = __pyx_doc_8PyClical_8clifford_24__sub__;
19999 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_24__sub__;
20003 #if CYTHON_COMPILING_IN_CPYTHON
20005 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__isub__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
20006 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20007 __pyx_wrapperbase_8PyClical_8clifford_26__isub__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20008 __pyx_wrapperbase_8PyClical_8clifford_26__isub__.doc = __pyx_doc_8PyClical_8clifford_26__isub__;
20009 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_26__isub__;
20013 #if CYTHON_COMPILING_IN_CPYTHON
20015 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__mul__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
20016 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20017 __pyx_wrapperbase_8PyClical_8clifford_28__mul__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20018 __pyx_wrapperbase_8PyClical_8clifford_28__mul__.doc = __pyx_doc_8PyClical_8clifford_28__mul__;
20019 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_28__mul__;
20023 #if CYTHON_COMPILING_IN_CPYTHON
20025 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__imul__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
20026 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20027 __pyx_wrapperbase_8PyClical_8clifford_30__imul__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20028 __pyx_wrapperbase_8PyClical_8clifford_30__imul__.doc = __pyx_doc_8PyClical_8clifford_30__imul__;
20029 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_30__imul__;
20033 #if CYTHON_COMPILING_IN_CPYTHON
20035 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__mod__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
20036 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20037 __pyx_wrapperbase_8PyClical_8clifford_32__mod__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20038 __pyx_wrapperbase_8PyClical_8clifford_32__mod__.doc = __pyx_doc_8PyClical_8clifford_32__mod__;
20039 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_32__mod__;
20043 #if CYTHON_COMPILING_IN_CPYTHON
20045 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__imod__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
20046 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20047 __pyx_wrapperbase_8PyClical_8clifford_34__imod__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20048 __pyx_wrapperbase_8PyClical_8clifford_34__imod__.doc = __pyx_doc_8PyClical_8clifford_34__imod__;
20049 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_34__imod__;
20053 #if CYTHON_COMPILING_IN_CPYTHON
20055 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__and__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
20056 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20057 __pyx_wrapperbase_8PyClical_8clifford_36__and__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20058 __pyx_wrapperbase_8PyClical_8clifford_36__and__.doc = __pyx_doc_8PyClical_8clifford_36__and__;
20059 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_36__and__;
20063 #if CYTHON_COMPILING_IN_CPYTHON
20065 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__iand__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
20066 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20067 __pyx_wrapperbase_8PyClical_8clifford_38__iand__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20068 __pyx_wrapperbase_8PyClical_8clifford_38__iand__.doc = __pyx_doc_8PyClical_8clifford_38__iand__;
20069 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_38__iand__;
20073 #if CYTHON_COMPILING_IN_CPYTHON
20075 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__xor__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
20076 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20077 __pyx_wrapperbase_8PyClical_8clifford_40__xor__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20078 __pyx_wrapperbase_8PyClical_8clifford_40__xor__.doc = __pyx_doc_8PyClical_8clifford_40__xor__;
20079 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_40__xor__;
20083 #if CYTHON_COMPILING_IN_CPYTHON
20085 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__ixor__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
20086 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20087 __pyx_wrapperbase_8PyClical_8clifford_42__ixor__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20088 __pyx_wrapperbase_8PyClical_8clifford_42__ixor__.doc = __pyx_doc_8PyClical_8clifford_42__ixor__;
20089 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_42__ixor__;
20093 #if CYTHON_COMPILING_IN_CPYTHON
20095 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__truediv__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
20096 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20097 __pyx_wrapperbase_8PyClical_8clifford_44__truediv__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20098 __pyx_wrapperbase_8PyClical_8clifford_44__truediv__.doc = __pyx_doc_8PyClical_8clifford_44__truediv__;
20099 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_44__truediv__;
20103 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
20104 #if CYTHON_COMPILING_IN_CPYTHON
20106 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__idiv__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
20107 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20108 __pyx_wrapperbase_8PyClical_8clifford_46__idiv__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20109 __pyx_wrapperbase_8PyClical_8clifford_46__idiv__.doc = __pyx_doc_8PyClical_8clifford_46__idiv__;
20110 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_46__idiv__;
20115 #if CYTHON_COMPILING_IN_CPYTHON
20117 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__or__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
20118 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20119 __pyx_wrapperbase_8PyClical_8clifford_50__or__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20120 __pyx_wrapperbase_8PyClical_8clifford_50__or__.doc = __pyx_doc_8PyClical_8clifford_50__or__;
20121 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_50__or__;
20125 #if CYTHON_COMPILING_IN_CPYTHON
20127 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__ior__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
20128 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20129 __pyx_wrapperbase_8PyClical_8clifford_52__ior__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20130 __pyx_wrapperbase_8PyClical_8clifford_52__ior__.doc = __pyx_doc_8PyClical_8clifford_52__ior__;
20131 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_52__ior__;
20135 #if CYTHON_COMPILING_IN_CPYTHON
20137 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__pow__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
20138 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20139 __pyx_wrapperbase_8PyClical_8clifford_54__pow__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20140 __pyx_wrapperbase_8PyClical_8clifford_54__pow__.doc = __pyx_doc_8PyClical_8clifford_54__pow__;
20141 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_54__pow__;
20145 #if CYTHON_COMPILING_IN_CPYTHON
20147 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__call__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
20148 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20149 __pyx_wrapperbase_8PyClical_8clifford_60__call__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20150 __pyx_wrapperbase_8PyClical_8clifford_60__call__.doc = __pyx_doc_8PyClical_8clifford_60__call__;
20151 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_60__call__;
20155 #if CYTHON_COMPILING_IN_CPYTHON
20157 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__repr__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
20158 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20159 __pyx_wrapperbase_8PyClical_8clifford_92__repr__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20160 __pyx_wrapperbase_8PyClical_8clifford_92__repr__.doc = __pyx_doc_8PyClical_8clifford_92__repr__;
20161 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_92__repr__;
20165 #if CYTHON_COMPILING_IN_CPYTHON
20167 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8PyClical_clifford,
"__str__");
if (unlikely(!wrapper)) __PYX_ERR(0, 537, __pyx_L1_error)
20168 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
20169 __pyx_wrapperbase_8PyClical_8clifford_94__str__ = *((PyWrapperDescrObject *)wrapper)->d_base;
20170 __pyx_wrapperbase_8PyClical_8clifford_94__str__.doc = __pyx_doc_8PyClical_8clifford_94__str__;
20171 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8PyClical_8clifford_94__str__;
20175 if (__Pyx_SetVtable(__pyx_type_8PyClical_clifford.tp_dict, __pyx_vtabptr_8PyClical_clifford) < 0) __PYX_ERR(0, 537, __pyx_L1_error)
20176 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_clifford, (PyObject *)&__pyx_type_8PyClical_clifford) < 0) __PYX_ERR(0, 537, __pyx_L1_error)
20177 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8PyClical_clifford) < 0) __PYX_ERR(0, 537, __pyx_L1_error)
20178 __pyx_ptype_8PyClical_clifford = &__pyx_type_8PyClical_clifford;
20179 if (PyType_Ready(&__pyx_type_8PyClical___pyx_scope_struct____iter__) < 0) __PYX_ERR(0, 229, __pyx_L1_error)
20180 #if PY_VERSION_HEX < 0x030800B1
20181 __pyx_type_8PyClical___pyx_scope_struct____iter__.tp_print = 0;
20183 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)) {
20184 __pyx_type_8PyClical___pyx_scope_struct____iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
20186 __pyx_ptype_8PyClical___pyx_scope_struct____iter__ = &__pyx_type_8PyClical___pyx_scope_struct____iter__;
20187 __Pyx_RefNannyFinishContext();
20190 __Pyx_RefNannyFinishContext();
20194 static int __Pyx_modinit_type_import_code(
void) {
20195 __Pyx_RefNannyDeclarations
20196 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_import_code", 0);
20198 __Pyx_RefNannyFinishContext();
20202 static int __Pyx_modinit_variable_import_code(
void) {
20203 __Pyx_RefNannyDeclarations
20204 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_import_code", 0);
20206 __Pyx_RefNannyFinishContext();
20210 static int __Pyx_modinit_function_import_code(
void) {
20211 __Pyx_RefNannyDeclarations
20212 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_import_code", 0);
20214 __Pyx_RefNannyFinishContext();
20219 #if PY_MAJOR_VERSION < 3
20220 #ifdef CYTHON_NO_PYINIT_EXPORT
20221 #define __Pyx_PyMODINIT_FUNC void
20223 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
20226 #ifdef CYTHON_NO_PYINIT_EXPORT
20227 #define __Pyx_PyMODINIT_FUNC PyObject *
20229 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
20234 #if PY_MAJOR_VERSION < 3
20235 __Pyx_PyMODINIT_FUNC initPyClical(
void) CYTHON_SMALL_CODE;
20236 __Pyx_PyMODINIT_FUNC initPyClical(
void)
20238 __Pyx_PyMODINIT_FUNC PyInit_PyClical(
void) CYTHON_SMALL_CODE;
20239 __Pyx_PyMODINIT_FUNC PyInit_PyClical(
void)
20240 #if CYTHON_PEP489_MULTI_PHASE_INIT
20242 return PyModuleDef_Init(&__pyx_moduledef);
20244 static CYTHON_SMALL_CODE
int __Pyx_check_single_interpreter(
void) {
20245 #if PY_VERSION_HEX >= 0x030700A1
20246 static PY_INT64_T main_interpreter_id = -1;
20247 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
20248 if (main_interpreter_id == -1) {
20249 main_interpreter_id = current_id;
20250 return (unlikely(current_id == -1)) ? -1 : 0;
20251 }
else if (unlikely(main_interpreter_id != current_id))
20253 static PyInterpreterState *main_interpreter = NULL;
20254 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
20255 if (!main_interpreter) {
20256 main_interpreter = current_interpreter;
20257 }
else if (unlikely(main_interpreter != current_interpreter))
20262 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
20267 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) {
20268 PyObject *value = PyObject_GetAttrString(spec, from_name);
20270 if (likely(value)) {
20271 if (allow_none || value != Py_None) {
20272 result = PyDict_SetItemString(moddict, to_name, value);
20275 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
20282 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
20283 PyObject *module = NULL, *moddict, *modname;
20284 if (__Pyx_check_single_interpreter())
20287 return __Pyx_NewRef(__pyx_m);
20288 modname = PyObject_GetAttrString(spec,
"name");
20289 if (unlikely(!modname))
goto bad;
20290 module = PyModule_NewObject(modname);
20291 Py_DECREF(modname);
20292 if (unlikely(!module))
goto bad;
20293 moddict = PyModule_GetDict(module);
20294 if (unlikely(!moddict))
goto bad;
20295 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__", 1) < 0))
goto bad;
20296 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__", 1) < 0))
goto bad;
20297 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__", 1) < 0))
goto bad;
20298 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__", 0) < 0))
goto bad;
20301 Py_XDECREF(module);
20306 static CYTHON_SMALL_CODE
int __pyx_pymod_exec_PyClical(PyObject *__pyx_pyinit_module)
20310 PyObject *__pyx_t_1 = NULL;
20311 PyObject *__pyx_t_2 = NULL;
20312 PyObject *__pyx_t_3 = NULL;
20314 __Pyx_RefNannyDeclarations
20315 #if CYTHON_PEP489_MULTI_PHASE_INIT
20317 if (__pyx_m == __pyx_pyinit_module)
return 0;
20318 PyErr_SetString(PyExc_RuntimeError,
"Module 'PyClical' has already been imported. Re-initialisation is not supported.");
20321 #elif PY_MAJOR_VERSION >= 3
20322 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
20324 #if CYTHON_REFNANNY
20325 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
20326 if (!__Pyx_RefNanny) {
20328 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
20329 if (!__Pyx_RefNanny)
20330 Py_FatalError(
"failed to import 'refnanny' module");
20333 __Pyx_RefNannySetupContext(
"__Pyx_PyMODINIT_FUNC PyInit_PyClical(void)", 0);
20334 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20335 #ifdef __Pxy_PyFrame_Initialize_Offsets
20336 __Pxy_PyFrame_Initialize_Offsets();
20338 __pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
20339 __pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
20340 __pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
20341 #ifdef __Pyx_CyFunction_USED
20342 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20344 #ifdef __Pyx_FusedFunction_USED
20345 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20347 #ifdef __Pyx_Coroutine_USED
20348 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20350 #ifdef __Pyx_Generator_USED
20351 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20353 #ifdef __Pyx_AsyncGen_USED
20354 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20356 #ifdef __Pyx_StopAsyncIteration_USED
20357 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20361 #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
20363 PyEval_InitThreads();
20367 #if CYTHON_PEP489_MULTI_PHASE_INIT
20368 __pyx_m = __pyx_pyinit_module;
20369 Py_INCREF(__pyx_m);
20371 #if PY_MAJOR_VERSION < 3
20372 __pyx_m = Py_InitModule4(
"PyClical", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
20374 __pyx_m = PyModule_Create(&__pyx_moduledef);
20376 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
20378 __pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
20379 Py_INCREF(__pyx_d);
20380 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
20381 Py_INCREF(__pyx_b);
20382 __pyx_cython_runtime = PyImport_AddModule((
char *)
"cython_runtime");
if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
20383 Py_INCREF(__pyx_cython_runtime);
20384 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
20386 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20387 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
20388 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20390 if (__pyx_module_is_main_PyClical) {
20391 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20393 #if PY_MAJOR_VERSION >= 3
20395 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
20396 if (!PyDict_GetItemString(modules,
"PyClical")) {
20397 if (unlikely(PyDict_SetItemString(modules,
"PyClical", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
20402 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20404 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20406 (void)__Pyx_modinit_global_init_code();
20407 (void)__Pyx_modinit_variable_export_code();
20408 (void)__Pyx_modinit_function_export_code();
20409 if (unlikely(__Pyx_modinit_type_init_code() != 0))
goto __pyx_L1_error;
20410 (void)__Pyx_modinit_type_import_code();
20411 (void)__Pyx_modinit_variable_import_code();
20412 (void)__Pyx_modinit_function_import_code();
20414 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
20415 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20425 __pyx_t_1 = __Pyx_Import(__pyx_n_s_math, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
20426 __Pyx_GOTREF(__pyx_t_1);
20427 if (PyDict_SetItem(__pyx_d, __pyx_n_s_math, __pyx_t_1) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
20428 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20437 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numbers, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error)
20438 __Pyx_GOTREF(__pyx_t_1);
20439 if (PyDict_SetItem(__pyx_d, __pyx_n_s_numbers, __pyx_t_1) < 0) __PYX_ERR(0, 30, __pyx_L1_error)
20440 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20449 __pyx_t_1 = __Pyx_Import(__pyx_n_s_collections, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
20450 __Pyx_GOTREF(__pyx_t_1);
20451 if (PyDict_SetItem(__pyx_d, __pyx_n_s_collections, __pyx_t_1) < 0) __PYX_ERR(0, 31, __pyx_L1_error)
20452 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20461 if (PyDict_SetItem(__pyx_d, __pyx_n_s_version, __pyx_kp_u_0_8_4) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
20470 __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)
20471 __Pyx_GOTREF(__pyx_t_1);
20472 if (PyDict_SetItem(__pyx_d, __pyx_n_s_index_set_hidden_doctests, __pyx_t_1) < 0) __PYX_ERR(0, 406, __pyx_L1_error)
20473 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20482 __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)
20483 __Pyx_GOTREF(__pyx_t_1);
20484 if (PyDict_SetItem(__pyx_d, __pyx_n_s_clifford_hidden_doctests, __pyx_t_1) < 0) __PYX_ERR(0, 1244, __pyx_L1_error)
20485 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20495 __Pyx_GOTREF(__pyx_t_1);
20496 if (PyDict_SetItem(__pyx_d, __pyx_n_s_scalar_epsilon, __pyx_t_1) < 0) __PYX_ERR(0, 1855, __pyx_L1_error)
20497 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20506 __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)
20507 __Pyx_GOTREF(__pyx_t_1);
20508 __pyx_t_2 = __pyx_f_8PyClical_atan(__pyx_t_1, 0, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1857, __pyx_L1_error)
20509 __Pyx_GOTREF(__pyx_t_2);
20510 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20511 __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_float_4_0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1857, __pyx_L1_error)
20512 __Pyx_GOTREF(__pyx_t_1);
20513 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20514 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pi, __pyx_t_1) < 0) __PYX_ERR(0, 1857, __pyx_L1_error)
20515 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20524 __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)
20525 __Pyx_GOTREF(__pyx_t_1);
20526 __pyx_t_2 = __pyx_f_8PyClical_atan(__pyx_t_1, 0, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1858, __pyx_L1_error)
20527 __Pyx_GOTREF(__pyx_t_2);
20528 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20529 __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_float_8_0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1858, __pyx_L1_error)
20530 __Pyx_GOTREF(__pyx_t_1);
20531 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20532 if (PyDict_SetItem(__pyx_d, __pyx_n_s_tau, __pyx_t_1) < 0) __PYX_ERR(0, 1858, __pyx_L1_error)
20533 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20542 if (PyDict_SetItem(__pyx_d, __pyx_n_s_cl, ((PyObject *)__pyx_ptype_8PyClical_clifford)) < 0) __PYX_ERR(0, 1860, __pyx_L1_error)
20551 if (PyDict_SetItem(__pyx_d, __pyx_n_s_ist, ((PyObject *)__pyx_ptype_8PyClical_index_set)) < 0) __PYX_ERR(0, 1878, __pyx_L1_error)
20560 __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)
20561 __Pyx_GOTREF(__pyx_t_1);
20562 if (PyDict_SetItem(__pyx_d, __pyx_n_s_e, __pyx_t_1) < 0) __PYX_ERR(0, 1886, __pyx_L1_error)
20563 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20572 __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)
20573 __Pyx_GOTREF(__pyx_t_1);
20574 if (PyDict_SetItem(__pyx_d, __pyx_n_s_istpq, __pyx_t_1) < 0) __PYX_ERR(0, 1899, __pyx_L1_error)
20575 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20584 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_e);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1908, __pyx_L1_error)
20585 __Pyx_GOTREF(__pyx_t_1);
20586 __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)
20587 __Pyx_GOTREF(__pyx_t_2);
20588 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20589 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_e);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1908, __pyx_L1_error)
20590 __Pyx_GOTREF(__pyx_t_1);
20591 __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)
20592 __Pyx_GOTREF(__pyx_t_3);
20593 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20594 __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1908, __pyx_L1_error)
20595 __Pyx_GOTREF(__pyx_t_1);
20596 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20597 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20598 if (PyDict_SetItem(__pyx_d, __pyx_n_s_ninf3, __pyx_t_1) < 0) __PYX_ERR(0, 1908, __pyx_L1_error)
20599 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20608 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_e);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1909, __pyx_L1_error)
20609 __Pyx_GOTREF(__pyx_t_1);
20610 __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)
20611 __Pyx_GOTREF(__pyx_t_3);
20612 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20613 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_e);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1909, __pyx_L1_error)
20614 __Pyx_GOTREF(__pyx_t_1);
20615 __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)
20616 __Pyx_GOTREF(__pyx_t_2);
20617 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20618 __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1909, __pyx_L1_error)
20619 __Pyx_GOTREF(__pyx_t_1);
20620 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20621 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20622 if (PyDict_SetItem(__pyx_d, __pyx_n_s_nbar3, __pyx_t_1) < 0) __PYX_ERR(0, 1909, __pyx_L1_error)
20623 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20632 __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)
20633 __Pyx_GOTREF(__pyx_t_1);
20634 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1912, __pyx_L1_error)
20635 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20643 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_name);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1916, __pyx_L1_error)
20644 __Pyx_GOTREF(__pyx_t_1);
20645 __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)
20646 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20654 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_test);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1917, __pyx_L1_error)
20655 __Pyx_GOTREF(__pyx_t_1);
20656 __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1917, __pyx_L1_error)
20657 __Pyx_GOTREF(__pyx_t_2);
20658 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20659 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20674 __pyx_t_2 = __Pyx_PyDict_NewPresized(107);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
20675 __Pyx_GOTREF(__pyx_t_2);
20676 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)
20677 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)
20678 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)
20679 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)
20680 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)
20681 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)
20682 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)
20683 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)
20684 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)
20685 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)
20686 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)
20687 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)
20688 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)
20689 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)
20690 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)
20691 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)
20692 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)
20693 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)
20694 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)
20695 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)
20696 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)
20697 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)
20698 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)
20699 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)
20700 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)
20701 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)
20702 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)
20703 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)
20704 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)
20705 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)
20706 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)
20707 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)
20708 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)
20709 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)
20710 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)
20711 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)
20712 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)
20713 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)
20714 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)
20715 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)
20716 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)
20717 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)
20718 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)
20719 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)
20720 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)
20721 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)
20722 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)
20723 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)
20724 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)
20725 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)
20726 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)
20727 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)
20728 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)
20729 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)
20730 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)
20731 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)
20732 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)
20733 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)
20734 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)
20735 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)
20736 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)
20737 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)
20738 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)
20739 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)
20740 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)
20741 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)
20742 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)
20743 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)
20744 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)
20745 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)
20746 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)
20747 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)
20748 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)
20749 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)
20750 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)
20751 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)
20752 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)
20753 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)
20754 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)
20755 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)
20756 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)
20757 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)
20758 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)
20759 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)
20760 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)
20761 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)
20762 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)
20763 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)
20764 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)
20765 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)
20766 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)
20767 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)
20768 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)
20769 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)
20770 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)
20771 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)
20772 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)
20773 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)
20774 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)
20775 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)
20776 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)
20777 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)
20778 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)
20779 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)
20780 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)
20781 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)
20782 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)
20783 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_2, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20784 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20798 __Pyx_XDECREF(__pyx_t_1);
20799 __Pyx_XDECREF(__pyx_t_2);
20800 __Pyx_XDECREF(__pyx_t_3);
20803 __Pyx_AddTraceback(
"init PyClical", __pyx_clineno, __pyx_lineno, __pyx_filename);
20806 }
else if (!PyErr_Occurred()) {
20807 PyErr_SetString(PyExc_ImportError,
"init PyClical");
20810 __Pyx_RefNannyFinishContext();
20811 #if CYTHON_PEP489_MULTI_PHASE_INIT
20812 return (__pyx_m != NULL) ? 0 : -1;
20813 #elif PY_MAJOR_VERSION >= 3
20822 #if CYTHON_REFNANNY
20823 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
20824 PyObject *m = NULL, *p = NULL;
20826 m = PyImport_ImportModule(modname);
20828 p = PyObject_GetAttrString(m,
"RefNannyAPI");
20830 r = PyLong_AsVoidPtr(p);
20834 return (__Pyx_RefNannyAPIStruct *)r;
20839 #if CYTHON_USE_TYPE_SLOTS
20840 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject*
obj, PyObject* attr_name) {
20841 PyTypeObject* tp = Py_TYPE(
obj);
20842 if (likely(tp->tp_getattro))
20843 return tp->tp_getattro(
obj, attr_name);
20844 #if PY_MAJOR_VERSION < 3
20845 if (likely(tp->tp_getattr))
20846 return tp->tp_getattr(
obj, PyString_AS_STRING(attr_name));
20848 return PyObject_GetAttr(
obj, attr_name);
20853 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
20854 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
20855 if (unlikely(!result)) {
20856 PyErr_Format(PyExc_NameError,
20857 #
if PY_MAJOR_VERSION >= 3
20858 "name '%U' is not defined", name);
20860 "name '%.200s' is not defined", PyString_AS_STRING(name));
20867 #if CYTHON_FAST_PYCCALL
20868 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
20869 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
20870 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
20871 PyObject *
self = PyCFunction_GET_SELF(func);
20872 int flags = PyCFunction_GET_FLAGS(func);
20873 assert(PyCFunction_Check(func));
20874 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
20875 assert(nargs >= 0);
20876 assert(nargs == 0 || args != NULL);
20880 assert(!PyErr_Occurred());
20881 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
20882 return (*((__Pyx_PyCFunctionFastWithKeywords)(
void*)meth)) (
self, args, nargs, NULL);
20884 return (*((__Pyx_PyCFunctionFast)(
void*)meth)) (
self, args, nargs);
20890 #if CYTHON_FAST_PYCALL
20891 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
20892 PyObject *globals) {
20894 PyThreadState *tstate = __Pyx_PyThreadState_Current;
20895 PyObject **fastlocals;
20898 assert(globals != NULL);
20903 assert(tstate != NULL);
20904 f = PyFrame_New(tstate, co, globals, NULL);
20908 fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
20909 for (
i = 0;
i < na;
i++) {
20911 fastlocals[
i] = *args++;
20913 result = PyEval_EvalFrameEx(f,0);
20914 ++tstate->recursion_depth;
20916 --tstate->recursion_depth;
20919 #if 1 || PY_VERSION_HEX < 0x030600B1
20920 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
int nargs, PyObject *kwargs) {
20921 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
20922 PyObject *globals = PyFunction_GET_GLOBALS(func);
20923 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
20925 #if PY_MAJOR_VERSION >= 3
20928 PyObject *kwtuple, **k;
20933 assert(kwargs == NULL || PyDict_Check(kwargs));
20934 nk = kwargs ? PyDict_Size(kwargs) : 0;
20935 if (Py_EnterRecursiveCall((
char*)
" while calling a Python object")) {
20939 #
if PY_MAJOR_VERSION >= 3
20940 co->co_kwonlyargcount == 0 &&
20942 likely(kwargs == NULL || nk == 0) &&
20943 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
20944 if (argdefs == NULL && co->co_argcount == nargs) {
20945 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
20948 else if (nargs == 0 && argdefs != NULL
20949 && co->co_argcount == Py_SIZE(argdefs)) {
20952 args = &PyTuple_GET_ITEM(argdefs, 0);
20953 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
20957 if (kwargs != NULL) {
20959 kwtuple = PyTuple_New(2 * nk);
20960 if (kwtuple == NULL) {
20964 k = &PyTuple_GET_ITEM(kwtuple, 0);
20966 while (PyDict_Next(kwargs, &pos, &k[
i], &k[
i+1])) {
20977 closure = PyFunction_GET_CLOSURE(func);
20978 #if PY_MAJOR_VERSION >= 3
20979 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
20981 if (argdefs != NULL) {
20982 d = &PyTuple_GET_ITEM(argdefs, 0);
20983 nd = Py_SIZE(argdefs);
20989 #if PY_MAJOR_VERSION >= 3
20990 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
20993 d, (
int)nd, kwdefs, closure);
20995 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
20998 d, (
int)nd, closure);
21000 Py_XDECREF(kwtuple);
21002 Py_LeaveRecursiveCall();
21009 #if CYTHON_COMPILING_IN_CPYTHON
21010 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
21012 ternaryfunc call = func->ob_type->tp_call;
21013 if (unlikely(!call))
21014 return PyObject_Call(func, arg, kw);
21015 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
21017 result = (*call)(func, arg, kw);
21018 Py_LeaveRecursiveCall();
21019 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
21022 "NULL result without error in PyObject_Call");
21029 #if CYTHON_COMPILING_IN_CPYTHON
21030 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
21031 PyObject *
self, *result;
21033 cfunc = PyCFunction_GET_FUNCTION(func);
21034 self = PyCFunction_GET_SELF(func);
21035 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
21037 result = cfunc(
self, arg);
21038 Py_LeaveRecursiveCall();
21039 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
21042 "NULL result without error in PyObject_Call");
21049 #if CYTHON_COMPILING_IN_CPYTHON
21050 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
21052 PyObject *args = PyTuple_New(1);
21053 if (unlikely(!args))
return NULL;
21055 PyTuple_SET_ITEM(args, 0, arg);
21056 result = __Pyx_PyObject_Call(func, args, NULL);
21060 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
21061 #if CYTHON_FAST_PYCALL
21062 if (PyFunction_Check(func)) {
21063 return __Pyx_PyFunction_FastCall(func, &arg, 1);
21066 if (likely(PyCFunction_Check(func))) {
21067 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
21068 return __Pyx_PyObject_CallMethO(func, arg);
21069 #if CYTHON_FAST_PYCCALL
21070 }
else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
21071 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
21075 return __Pyx__PyObject_CallOneArg(func, arg);
21078 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
21080 PyObject *args = PyTuple_Pack(1, arg);
21081 if (unlikely(!args))
return NULL;
21082 result = __Pyx_PyObject_Call(func, args, NULL);
21089 #if CYTHON_FAST_THREAD_STATE
21090 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
21091 PyObject *tmp_type, *tmp_value, *tmp_tb;
21092 tmp_type = tstate->curexc_type;
21093 tmp_value = tstate->curexc_value;
21094 tmp_tb = tstate->curexc_traceback;
21095 tstate->curexc_type = type;
21096 tstate->curexc_value = value;
21097 tstate->curexc_traceback = tb;
21098 Py_XDECREF(tmp_type);
21099 Py_XDECREF(tmp_value);
21100 Py_XDECREF(tmp_tb);
21102 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
21103 *type = tstate->curexc_type;
21104 *value = tstate->curexc_value;
21105 *tb = tstate->curexc_traceback;
21106 tstate->curexc_type = 0;
21107 tstate->curexc_value = 0;
21108 tstate->curexc_traceback = 0;
21113 static void __Pyx_WriteUnraisable(
const char *name, CYTHON_UNUSED
int clineno,
21114 CYTHON_UNUSED
int lineno, CYTHON_UNUSED
const char *filename,
21115 int full_traceback, CYTHON_UNUSED
int nogil) {
21116 PyObject *old_exc, *old_val, *old_tb;
21118 __Pyx_PyThreadState_declare
21120 PyGILState_STATE state;
21122 state = PyGILState_Ensure();
21124 else state = (PyGILState_STATE)-1;
21127 __Pyx_PyThreadState_assign
21128 __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
21129 if (full_traceback) {
21130 Py_XINCREF(old_exc);
21131 Py_XINCREF(old_val);
21132 Py_XINCREF(old_tb);
21133 __Pyx_ErrRestore(old_exc, old_val, old_tb);
21136 #if PY_MAJOR_VERSION < 3
21137 ctx = PyString_FromString(name);
21139 ctx = PyUnicode_FromString(name);
21141 __Pyx_ErrRestore(old_exc, old_val, old_tb);
21143 PyErr_WriteUnraisable(Py_None);
21145 PyErr_WriteUnraisable(ctx);
21150 PyGILState_Release(state);
21155 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
21156 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *
obj) {
21157 PyObject *dict = Py_TYPE(
obj)->tp_dict;
21158 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
21160 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *
obj) {
21161 PyObject **dictptr = NULL;
21162 Py_ssize_t offset = Py_TYPE(
obj)->tp_dictoffset;
21164 #if CYTHON_COMPILING_IN_CPYTHON
21165 dictptr = (likely(offset > 0)) ? (PyObject **) ((
char *)
obj + offset) : _PyObject_GetDictPtr(
obj);
21167 dictptr = _PyObject_GetDictPtr(
obj);
21170 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
21172 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject*
obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
21173 PyObject *dict = Py_TYPE(
obj)->tp_dict;
21174 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
21176 return obj_dict_version == __Pyx_get_object_dict_version(
obj);
21181 #if CYTHON_COMPILING_IN_CPYTHON
21182 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
21183 #if CYTHON_FAST_PYCALL
21184 if (PyFunction_Check(func)) {
21185 return __Pyx_PyFunction_FastCall(func, NULL, 0);
21188 #ifdef __Pyx_CyFunction_USED
21189 if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
21191 if (likely(PyCFunction_Check(func)))
21194 if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
21195 return __Pyx_PyObject_CallMethO(func, NULL);
21198 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
21203 static void __Pyx_RaiseDoubleKeywordsError(
21204 const char* func_name,
21207 PyErr_Format(PyExc_TypeError,
21208 #
if PY_MAJOR_VERSION >= 3
21209 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
21211 "%s() got multiple values for keyword argument '%s'", func_name,
21212 PyString_AsString(kw_name));
21217 static int __Pyx_ParseOptionalKeywords(
21219 PyObject **argnames[],
21221 PyObject *values[],
21222 Py_ssize_t num_pos_args,
21223 const char* function_name)
21225 PyObject *key = 0, *value = 0;
21226 Py_ssize_t pos = 0;
21228 PyObject*** first_kw_arg = argnames + num_pos_args;
21229 while (PyDict_Next(kwds, &pos, &key, &value)) {
21230 name = first_kw_arg;
21231 while (*name && (**name != key)) name++;
21233 values[name-argnames] = value;
21236 name = first_kw_arg;
21237 #if PY_MAJOR_VERSION < 3
21238 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
21240 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
21241 && _PyString_Eq(**name, key)) {
21242 values[name-argnames] = value;
21247 if (*name)
continue;
21249 PyObject*** argname = argnames;
21250 while (argname != first_kw_arg) {
21251 if ((**argname == key) || (
21252 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
21253 && _PyString_Eq(**argname, key))) {
21254 goto arg_passed_twice;
21261 if (likely(PyUnicode_Check(key))) {
21263 int cmp = (**name == key) ? 0 :
21264 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
21265 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
21267 PyUnicode_Compare(**name, key);
21268 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
21270 values[name-argnames] = value;
21275 if (*name)
continue;
21277 PyObject*** argname = argnames;
21278 while (argname != first_kw_arg) {
21279 int cmp = (**argname == key) ? 0 :
21280 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
21281 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
21283 PyUnicode_Compare(**argname, key);
21284 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
21285 if (cmp == 0)
goto arg_passed_twice;
21290 goto invalid_keyword_type;
21292 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
21294 goto invalid_keyword;
21299 __Pyx_RaiseDoubleKeywordsError(function_name, key);
21301 invalid_keyword_type:
21302 PyErr_Format(PyExc_TypeError,
21303 "%.200s() keywords must be strings", function_name);
21306 PyErr_Format(PyExc_TypeError,
21307 #
if PY_MAJOR_VERSION < 3
21308 "%.200s() got an unexpected keyword argument '%.200s'",
21309 function_name, PyString_AsString(key));
21311 "%s() got an unexpected keyword argument '%U'",
21312 function_name, key);
21319 static void __Pyx_RaiseArgtupleInvalid(
21320 const char* func_name,
21322 Py_ssize_t num_min,
21323 Py_ssize_t num_max,
21324 Py_ssize_t num_found)
21326 Py_ssize_t num_expected;
21327 const char *more_or_less;
21328 if (num_found < num_min) {
21329 num_expected = num_min;
21330 more_or_less =
"at least";
21332 num_expected = num_max;
21333 more_or_less =
"at most";
21336 more_or_less =
"exactly";
21338 PyErr_Format(PyExc_TypeError,
21339 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
21340 func_name, more_or_less, num_expected,
21341 (num_expected == 1) ?
"" :
"s", num_found);
21345 #if CYTHON_USE_DICT_VERSIONS
21346 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
21348 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
21352 #if !CYTHON_AVOID_BORROWED_REFS
21353 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
21354 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
21355 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
21356 if (likely(result)) {
21357 return __Pyx_NewRef(result);
21358 }
else if (unlikely(PyErr_Occurred())) {
21362 result = PyDict_GetItem(__pyx_d, name);
21363 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
21364 if (likely(result)) {
21365 return __Pyx_NewRef(result);
21369 result = PyObject_GetItem(__pyx_d, name);
21370 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
21371 if (likely(result)) {
21372 return __Pyx_NewRef(result);
21376 return __Pyx_GetBuiltinName(name);
21380 #if CYTHON_USE_EXC_INFO_STACK
21381 static _PyErr_StackItem *
21382 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
21384 _PyErr_StackItem *exc_info = tstate->exc_info;
21385 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
21386 exc_info->previous_item != NULL)
21388 exc_info = exc_info->previous_item;
21395 #if CYTHON_FAST_THREAD_STATE
21396 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
21397 #if CYTHON_USE_EXC_INFO_STACK
21398 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
21399 *type = exc_info->exc_type;
21400 *value = exc_info->exc_value;
21401 *tb = exc_info->exc_traceback;
21403 *type = tstate->exc_type;
21404 *value = tstate->exc_value;
21405 *tb = tstate->exc_traceback;
21408 Py_XINCREF(*value);
21411 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
21412 PyObject *tmp_type, *tmp_value, *tmp_tb;
21413 #if CYTHON_USE_EXC_INFO_STACK
21414 _PyErr_StackItem *exc_info = tstate->exc_info;
21415 tmp_type = exc_info->exc_type;
21416 tmp_value = exc_info->exc_value;
21417 tmp_tb = exc_info->exc_traceback;
21418 exc_info->exc_type = type;
21419 exc_info->exc_value = value;
21420 exc_info->exc_traceback = tb;
21422 tmp_type = tstate->exc_type;
21423 tmp_value = tstate->exc_value;
21424 tmp_tb = tstate->exc_traceback;
21425 tstate->exc_type = type;
21426 tstate->exc_value = value;
21427 tstate->exc_traceback = tb;
21429 Py_XDECREF(tmp_type);
21430 Py_XDECREF(tmp_value);
21431 Py_XDECREF(tmp_tb);
21436 #if CYTHON_FAST_THREAD_STATE
21437 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
21439 n = PyTuple_GET_SIZE(tuple);
21440 #if PY_MAJOR_VERSION >= 3
21441 for (
i=0;
i<n;
i++) {
21442 if (exc_type == PyTuple_GET_ITEM(tuple,
i))
return 1;
21445 for (
i=0;
i<n;
i++) {
21446 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple,
i)))
return 1;
21450 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
21451 PyObject *exc_type = tstate->curexc_type;
21452 if (exc_type == err)
return 1;
21453 if (unlikely(!exc_type))
return 0;
21454 if (unlikely(PyTuple_Check(err)))
21455 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
21456 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
21461 #if CYTHON_FAST_THREAD_STATE
21462 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
21464 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
21467 PyObject *local_type, *local_value, *local_tb;
21468 #if CYTHON_FAST_THREAD_STATE
21469 PyObject *tmp_type, *tmp_value, *tmp_tb;
21470 local_type = tstate->curexc_type;
21471 local_value = tstate->curexc_value;
21472 local_tb = tstate->curexc_traceback;
21473 tstate->curexc_type = 0;
21474 tstate->curexc_value = 0;
21475 tstate->curexc_traceback = 0;
21477 PyErr_Fetch(&local_type, &local_value, &local_tb);
21479 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
21480 #if CYTHON_FAST_THREAD_STATE
21481 if (unlikely(tstate->curexc_type))
21483 if (unlikely(PyErr_Occurred()))
21486 #if PY_MAJOR_VERSION >= 3
21488 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
21492 Py_XINCREF(local_tb);
21493 Py_XINCREF(local_type);
21494 Py_XINCREF(local_value);
21495 *type = local_type;
21496 *value = local_value;
21498 #if CYTHON_FAST_THREAD_STATE
21499 #if CYTHON_USE_EXC_INFO_STACK
21501 _PyErr_StackItem *exc_info = tstate->exc_info;
21502 tmp_type = exc_info->exc_type;
21503 tmp_value = exc_info->exc_value;
21504 tmp_tb = exc_info->exc_traceback;
21505 exc_info->exc_type = local_type;
21506 exc_info->exc_value = local_value;
21507 exc_info->exc_traceback = local_tb;
21510 tmp_type = tstate->exc_type;
21511 tmp_value = tstate->exc_value;
21512 tmp_tb = tstate->exc_traceback;
21513 tstate->exc_type = local_type;
21514 tstate->exc_value = local_value;
21515 tstate->exc_traceback = local_tb;
21517 Py_XDECREF(tmp_type);
21518 Py_XDECREF(tmp_value);
21519 Py_XDECREF(tmp_tb);
21521 PyErr_SetExcInfo(local_type, local_value, local_tb);
21528 Py_XDECREF(local_type);
21529 Py_XDECREF(local_value);
21530 Py_XDECREF(local_tb);
21535 #if PY_MAJOR_VERSION < 3
21536 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
21537 CYTHON_UNUSED PyObject *cause) {
21538 __Pyx_PyThreadState_declare
21540 if (!value || value == Py_None)
21544 if (!tb || tb == Py_None)
21548 if (!PyTraceBack_Check(tb)) {
21549 PyErr_SetString(PyExc_TypeError,
21550 "raise: arg 3 must be a traceback or None");
21554 if (PyType_Check(type)) {
21555 #if CYTHON_COMPILING_IN_PYPY
21557 Py_INCREF(Py_None);
21561 PyErr_NormalizeException(&type, &value, &tb);
21564 PyErr_SetString(PyExc_TypeError,
21565 "instance exception may not have a separate value");
21569 type = (PyObject*) Py_TYPE(type);
21571 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
21572 PyErr_SetString(PyExc_TypeError,
21573 "raise: exception class must be a subclass of BaseException");
21577 __Pyx_PyThreadState_assign
21578 __Pyx_ErrRestore(type, value, tb);
21587 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
21588 PyObject* owned_instance = NULL;
21589 if (tb == Py_None) {
21591 }
else if (tb && !PyTraceBack_Check(tb)) {
21592 PyErr_SetString(PyExc_TypeError,
21593 "raise: arg 3 must be a traceback or None");
21596 if (value == Py_None)
21598 if (PyExceptionInstance_Check(type)) {
21600 PyErr_SetString(PyExc_TypeError,
21601 "instance exception may not have a separate value");
21605 type = (PyObject*) Py_TYPE(value);
21606 }
else if (PyExceptionClass_Check(type)) {
21607 PyObject *instance_class = NULL;
21608 if (value && PyExceptionInstance_Check(value)) {
21609 instance_class = (PyObject*) Py_TYPE(value);
21610 if (instance_class != type) {
21611 int is_subclass = PyObject_IsSubclass(instance_class, type);
21612 if (!is_subclass) {
21613 instance_class = NULL;
21614 }
else if (unlikely(is_subclass == -1)) {
21617 type = instance_class;
21621 if (!instance_class) {
21624 args = PyTuple_New(0);
21625 else if (PyTuple_Check(value)) {
21629 args = PyTuple_Pack(1, value);
21632 owned_instance = PyObject_Call(type, args, NULL);
21634 if (!owned_instance)
21636 value = owned_instance;
21637 if (!PyExceptionInstance_Check(value)) {
21638 PyErr_Format(PyExc_TypeError,
21639 "calling %R should have returned an instance of "
21640 "BaseException, not %R",
21641 type, Py_TYPE(value));
21646 PyErr_SetString(PyExc_TypeError,
21647 "raise: exception class must be a subclass of BaseException");
21651 PyObject *fixed_cause;
21652 if (cause == Py_None) {
21653 fixed_cause = NULL;
21654 }
else if (PyExceptionClass_Check(cause)) {
21655 fixed_cause = PyObject_CallObject(cause, NULL);
21656 if (fixed_cause == NULL)
21658 }
else if (PyExceptionInstance_Check(cause)) {
21659 fixed_cause = cause;
21660 Py_INCREF(fixed_cause);
21662 PyErr_SetString(PyExc_TypeError,
21663 "exception causes must derive from "
21667 PyException_SetCause(value, fixed_cause);
21669 PyErr_SetObject(type, value);
21671 #if CYTHON_COMPILING_IN_PYPY
21672 PyObject *tmp_type, *tmp_value, *tmp_tb;
21673 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
21675 PyErr_Restore(tmp_type, tmp_value, tb);
21676 Py_XDECREF(tmp_tb);
21678 PyThreadState *tstate = __Pyx_PyThreadState_Current;
21679 PyObject* tmp_tb = tstate->curexc_traceback;
21680 if (tb != tmp_tb) {
21682 tstate->curexc_traceback = tb;
21683 Py_XDECREF(tmp_tb);
21688 Py_XDECREF(owned_instance);
21694 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2) {
21695 PyObject *args, *result = NULL;
21696 #if CYTHON_FAST_PYCALL
21697 if (PyFunction_Check(
function)) {
21698 PyObject *args[2] = {arg1, arg2};
21699 return __Pyx_PyFunction_FastCall(
function, args, 2);
21702 #if CYTHON_FAST_PYCCALL
21703 if (__Pyx_PyFastCFunction_Check(
function)) {
21704 PyObject *args[2] = {arg1, arg2};
21705 return __Pyx_PyCFunction_FastCall(
function, args, 2);
21708 args = PyTuple_New(2);
21709 if (unlikely(!args))
goto done;
21711 PyTuple_SET_ITEM(args, 0, arg1);
21713 PyTuple_SET_ITEM(args, 1, arg2);
21714 Py_INCREF(
function);
21715 result = __Pyx_PyObject_Call(
function, args, NULL);
21717 Py_DECREF(
function);
21723 #if !CYTHON_COMPILING_IN_PYPY
21724 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
long intval,
int inplace,
int zerodivision_check) {
21726 (void)zerodivision_check;
21727 #if PY_MAJOR_VERSION < 3
21728 if (likely(PyInt_CheckExact(op1))) {
21729 const long b = intval;
21731 long a = PyInt_AS_LONG(op1);
21732 x = (long)((
unsigned long)a + b);
21733 if (likely((x^a) >= 0 || (x^b) >= 0))
21734 return PyInt_FromLong(x);
21735 return PyLong_Type.tp_as_number->nb_add(op1, op2);
21738 #if CYTHON_USE_PYLONG_INTERNALS
21739 if (likely(PyLong_CheckExact(op1))) {
21740 const long b = intval;
21742 #ifdef HAVE_LONG_LONG
21743 const PY_LONG_LONG llb = intval;
21744 PY_LONG_LONG lla, llx;
21746 const digit* digits = ((PyLongObject*)op1)->ob_digit;
21747 const Py_ssize_t size = Py_SIZE(op1);
21748 if (likely(__Pyx_sst_abs(size) <= 1)) {
21749 a = likely(size) ? digits[0] : 0;
21750 if (size == -1) a = -a;
21754 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
21755 a = -(long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21757 #ifdef HAVE_LONG_LONG
21758 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
21759 lla = -(PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
21763 CYTHON_FALLTHROUGH;
21765 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
21766 a = (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21768 #ifdef HAVE_LONG_LONG
21769 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
21770 lla = (PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
21774 CYTHON_FALLTHROUGH;
21776 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
21777 a = -(long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21779 #ifdef HAVE_LONG_LONG
21780 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
21781 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]));
21785 CYTHON_FALLTHROUGH;
21787 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
21788 a = (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21790 #ifdef HAVE_LONG_LONG
21791 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
21792 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]));
21796 CYTHON_FALLTHROUGH;
21798 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
21799 a = -(long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21801 #ifdef HAVE_LONG_LONG
21802 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
21803 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]));
21807 CYTHON_FALLTHROUGH;
21809 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
21810 a = (long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
21812 #ifdef HAVE_LONG_LONG
21813 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
21814 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]));
21818 CYTHON_FALLTHROUGH;
21819 default:
return PyLong_Type.tp_as_number->nb_add(op1, op2);
21823 return PyLong_FromLong(x);
21824 #ifdef HAVE_LONG_LONG
21827 return PyLong_FromLongLong(llx);
21833 if (PyFloat_CheckExact(op1)) {
21834 const long b = intval;
21835 double a = PyFloat_AS_DOUBLE(op1);
21837 PyFPE_START_PROTECT(
"add",
return NULL)
21838 result = ((double)a) + (double)b;
21839 PyFPE_END_PROTECT(result)
21842 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
21847 static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
21848 const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop,
21849 const char* encoding,
const char* errors,
21850 PyObject* (*decode_func)(
const char *s, Py_ssize_t size,
const char *errors)) {
21851 if (unlikely((start < 0) | (stop < 0))) {
21862 length = stop - start;
21863 if (unlikely(length <= 0))
21864 return PyUnicode_FromUnicode(NULL, 0);
21867 return decode_func(cstring, length, errors);
21869 return PyUnicode_Decode(cstring, length, encoding, errors);
21874 #if CYTHON_FAST_THREAD_STATE
21875 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
21876 PyObject *tmp_type, *tmp_value, *tmp_tb;
21877 #if CYTHON_USE_EXC_INFO_STACK
21878 _PyErr_StackItem *exc_info = tstate->exc_info;
21879 tmp_type = exc_info->exc_type;
21880 tmp_value = exc_info->exc_value;
21881 tmp_tb = exc_info->exc_traceback;
21882 exc_info->exc_type = *type;
21883 exc_info->exc_value = *value;
21884 exc_info->exc_traceback = *tb;
21886 tmp_type = tstate->exc_type;
21887 tmp_value = tstate->exc_value;
21888 tmp_tb = tstate->exc_traceback;
21889 tstate->exc_type = *type;
21890 tstate->exc_value = *value;
21891 tstate->exc_traceback = *tb;
21894 *value = tmp_value;
21898 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
21899 PyObject *tmp_type, *tmp_value, *tmp_tb;
21900 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
21901 PyErr_SetExcInfo(*type, *value, *tb);
21903 *value = tmp_value;
21909 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
21912 r = PyObject_SetItem(o, j, v);
21916 static CYTHON_INLINE
int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t
i, PyObject *v,
int is_list,
21917 CYTHON_NCP_UNUSED
int wraparound, CYTHON_NCP_UNUSED
int boundscheck) {
21918 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
21919 if (is_list || PyList_CheckExact(o)) {
21920 Py_ssize_t n = (!wraparound) ?
i : ((likely(
i >= 0)) ?
i :
i + PyList_GET_SIZE(o));
21921 if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) {
21922 PyObject* old = PyList_GET_ITEM(o, n);
21924 PyList_SET_ITEM(o, n, v);
21929 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
21930 if (likely(m && m->sq_ass_item)) {
21931 if (wraparound && unlikely(
i < 0) && likely(m->sq_length)) {
21932 Py_ssize_t l = m->sq_length(o);
21933 if (likely(l >= 0)) {
21936 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
21941 return m->sq_ass_item(o,
i, v);
21945 #if CYTHON_COMPILING_IN_PYPY
21946 if (is_list || (PySequence_Check(o) && !PyDict_Check(o)))
21948 if (is_list || PySequence_Check(o))
21951 return PySequence_SetItem(o,
i, v);
21954 return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(
i), v);
21958 static int __Pyx__ArgTypeTest(PyObject *
obj, PyTypeObject *type,
const char *name,
int exact)
21960 if (unlikely(!type)) {
21961 PyErr_SetString(PyExc_SystemError,
"Missing type object");
21965 #if PY_MAJOR_VERSION == 2
21966 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(
obj)))
return 1;
21970 if (likely(__Pyx_TypeCheck(
obj, type)))
return 1;
21972 PyErr_Format(PyExc_TypeError,
21973 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
21974 name, type->tp_name, Py_TYPE(
obj)->tp_name);
21979 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level) {
21980 PyObject *empty_list = 0;
21981 PyObject *module = 0;
21982 PyObject *global_dict = 0;
21983 PyObject *empty_dict = 0;
21985 #if PY_MAJOR_VERSION < 3
21986 PyObject *py_import;
21987 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
21994 empty_list = PyList_New(0);
21999 global_dict = PyModule_GetDict(__pyx_m);
22002 empty_dict = PyDict_New();
22006 #if PY_MAJOR_VERSION >= 3
22008 if (strchr(__Pyx_MODULE_NAME,
'.')) {
22009 module = PyImport_ImportModuleLevelObject(
22010 name, global_dict, empty_dict, list, 1);
22012 if (!PyErr_ExceptionMatches(PyExc_ImportError))
22021 #if PY_MAJOR_VERSION < 3
22022 PyObject *py_level = PyInt_FromLong(level);
22025 module = PyObject_CallFunctionObjArgs(py_import,
22026 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
22027 Py_DECREF(py_level);
22029 module = PyImport_ImportModuleLevelObject(
22030 name, global_dict, empty_dict, list, level);
22035 #if PY_MAJOR_VERSION < 3
22036 Py_XDECREF(py_import);
22038 Py_XDECREF(empty_list);
22039 Py_XDECREF(empty_dict);
22044 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
22045 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
22046 PyErr_Format(PyExc_AttributeError,
22047 #
if PY_MAJOR_VERSION >= 3
22048 "'%.50s' object has no attribute '%U'",
22049 tp->tp_name, attr_name);
22051 "'%.50s' object has no attribute '%.400s'",
22052 tp->tp_name, PyString_AS_STRING(attr_name));
22056 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject*
obj, PyObject* attr_name) {
22058 PyTypeObject *tp = Py_TYPE(
obj);
22059 if (unlikely(!PyString_Check(attr_name))) {
22060 return PyObject_GenericGetAttr(
obj, attr_name);
22062 assert(!tp->tp_dictoffset);
22063 descr = _PyType_Lookup(tp, attr_name);
22064 if (unlikely(!descr)) {
22065 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
22068 #if PY_MAJOR_VERSION < 3
22069 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
22072 descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
22074 PyObject *res = f(descr,
obj, (PyObject *)tp);
22084 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
22085 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject*
obj, PyObject* attr_name) {
22086 if (unlikely(Py_TYPE(
obj)->tp_dictoffset)) {
22087 return PyObject_GenericGetAttr(
obj, attr_name);
22089 return __Pyx_PyObject_GenericGetAttrNoDict(
obj, attr_name);
22094 static int __Pyx_SetVtable(PyObject *dict,
void *vtable) {
22095 #if PY_VERSION_HEX >= 0x02070000
22096 PyObject *ob = PyCapsule_New(vtable, 0, 0);
22098 PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
22102 if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
22112 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
22114 PyObject *name_attr;
22115 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name);
22116 if (likely(name_attr)) {
22117 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
22121 if (unlikely(ret < 0)) {
22125 Py_XDECREF(name_attr);
22128 static int __Pyx_setup_reduce(PyObject* type_obj) {
22130 PyObject *object_reduce = NULL;
22131 PyObject *object_reduce_ex = NULL;
22132 PyObject *reduce = NULL;
22133 PyObject *reduce_ex = NULL;
22134 PyObject *reduce_cython = NULL;
22135 PyObject *setstate = NULL;
22136 PyObject *setstate_cython = NULL;
22137 #if CYTHON_USE_PYTYPE_LOOKUP
22138 if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate))
goto GOOD;
22140 if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate))
goto GOOD;
22142 #if CYTHON_USE_PYTYPE_LOOKUP
22143 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto BAD;
22145 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto BAD;
22147 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex);
if (unlikely(!reduce_ex))
goto BAD;
22148 if (reduce_ex == object_reduce_ex) {
22149 #if CYTHON_USE_PYTYPE_LOOKUP
22150 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto BAD;
22152 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto BAD;
22154 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce);
if (unlikely(!reduce))
goto BAD;
22155 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
22156 reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython);
if (unlikely(!reduce_cython))
goto BAD;
22157 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython);
if (unlikely(ret < 0))
goto BAD;
22158 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython);
if (unlikely(ret < 0))
goto BAD;
22159 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
22160 if (!setstate) PyErr_Clear();
22161 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
22162 setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython);
if (unlikely(!setstate_cython))
goto BAD;
22163 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython);
if (unlikely(ret < 0))
goto BAD;
22164 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython);
if (unlikely(ret < 0))
goto BAD;
22166 PyType_Modified((PyTypeObject*)type_obj);
22171 if (!PyErr_Occurred())
22172 PyErr_Format(PyExc_RuntimeError,
"Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
22175 #if !CYTHON_USE_PYTYPE_LOOKUP
22176 Py_XDECREF(object_reduce);
22177 Py_XDECREF(object_reduce_ex);
22179 Py_XDECREF(reduce);
22180 Py_XDECREF(reduce_ex);
22181 Py_XDECREF(reduce_cython);
22182 Py_XDECREF(setstate);
22183 Py_XDECREF(setstate_cython);
22188 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals) {
22189 #if CYTHON_COMPILING_IN_PYPY
22190 return PyObject_RichCompareBool(s1, s2, equals);
22193 return (equals == Py_EQ);
22194 }
else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
22195 const char *ps1, *ps2;
22196 Py_ssize_t length = PyBytes_GET_SIZE(s1);
22197 if (length != PyBytes_GET_SIZE(s2))
22198 return (equals == Py_NE);
22199 ps1 = PyBytes_AS_STRING(s1);
22200 ps2 = PyBytes_AS_STRING(s2);
22201 if (ps1[0] != ps2[0]) {
22202 return (equals == Py_NE);
22203 }
else if (length == 1) {
22204 return (equals == Py_EQ);
22207 #if CYTHON_USE_UNICODE_INTERNALS
22208 Py_hash_t hash1, hash2;
22209 hash1 = ((PyBytesObject*)s1)->ob_shash;
22210 hash2 = ((PyBytesObject*)s2)->ob_shash;
22211 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
22212 return (equals == Py_NE);
22215 result = memcmp(ps1, ps2, (
size_t)length);
22216 return (equals == Py_EQ) ? (result == 0) : (result != 0);
22218 }
else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
22219 return (equals == Py_NE);
22220 }
else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
22221 return (equals == Py_NE);
22224 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
22227 result = __Pyx_PyObject_IsTrue(py_result);
22228 Py_DECREF(py_result);
22235 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals) {
22236 #if CYTHON_COMPILING_IN_PYPY
22237 return PyObject_RichCompareBool(s1, s2, equals);
22239 #if PY_MAJOR_VERSION < 3
22240 PyObject* owned_ref = NULL;
22242 int s1_is_unicode, s2_is_unicode;
22246 s1_is_unicode = PyUnicode_CheckExact(s1);
22247 s2_is_unicode = PyUnicode_CheckExact(s2);
22248 #if PY_MAJOR_VERSION < 3
22249 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
22250 owned_ref = PyUnicode_FromObject(s2);
22251 if (unlikely(!owned_ref))
22255 }
else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
22256 owned_ref = PyUnicode_FromObject(s1);
22257 if (unlikely(!owned_ref))
22261 }
else if (((!s2_is_unicode) & (!s1_is_unicode))) {
22262 return __Pyx_PyBytes_Equals(s1, s2, equals);
22265 if (s1_is_unicode & s2_is_unicode) {
22268 void *data1, *data2;
22269 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
22271 length = __Pyx_PyUnicode_GET_LENGTH(s1);
22272 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
22275 #if CYTHON_USE_UNICODE_INTERNALS
22277 Py_hash_t hash1, hash2;
22278 #if CYTHON_PEP393_ENABLED
22279 hash1 = ((PyASCIIObject*)s1)->hash;
22280 hash2 = ((PyASCIIObject*)s2)->hash;
22282 hash1 = ((PyUnicodeObject*)s1)->hash;
22283 hash2 = ((PyUnicodeObject*)s2)->hash;
22285 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
22290 kind = __Pyx_PyUnicode_KIND(s1);
22291 if (kind != __Pyx_PyUnicode_KIND(s2)) {
22294 data1 = __Pyx_PyUnicode_DATA(s1);
22295 data2 = __Pyx_PyUnicode_DATA(s2);
22296 if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
22298 }
else if (length == 1) {
22301 int result = memcmp(data1, data2, (
size_t)(length * kind));
22302 #if PY_MAJOR_VERSION < 3
22303 Py_XDECREF(owned_ref);
22305 return (equals == Py_EQ) ? (result == 0) : (result != 0);
22307 }
else if ((s1 == Py_None) & s2_is_unicode) {
22309 }
else if ((s2 == Py_None) & s1_is_unicode) {
22313 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
22314 #if PY_MAJOR_VERSION < 3
22315 Py_XDECREF(owned_ref);
22319 result = __Pyx_PyObject_IsTrue(py_result);
22320 Py_DECREF(py_result);
22324 #if PY_MAJOR_VERSION < 3
22325 Py_XDECREF(owned_ref);
22327 return (equals == Py_EQ);
22329 #if PY_MAJOR_VERSION < 3
22330 Py_XDECREF(owned_ref);
22332 return (equals == Py_NE);
22337 #ifndef CYTHON_CLINE_IN_TRACEBACK
22338 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line) {
22339 PyObject *use_cline;
22340 PyObject *ptype, *pvalue, *ptraceback;
22341 #if CYTHON_COMPILING_IN_CPYTHON
22342 PyObject **cython_runtime_dict;
22344 if (unlikely(!__pyx_cython_runtime)) {
22347 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
22348 #if CYTHON_COMPILING_IN_CPYTHON
22349 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
22350 if (likely(cython_runtime_dict)) {
22351 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
22352 use_cline, *cython_runtime_dict,
22353 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
22357 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
22358 if (use_cline_obj) {
22359 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
22360 Py_DECREF(use_cline_obj);
22368 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
22370 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
22373 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
22379 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
22380 int start = 0, mid = 0, end = count - 1;
22381 if (end >= 0 && code_line > entries[end].code_line) {
22384 while (start < end) {
22385 mid = start + (end - start) / 2;
22386 if (code_line < entries[mid].code_line) {
22388 }
else if (code_line > entries[mid].code_line) {
22394 if (code_line <= entries[mid].code_line) {
22400 static PyCodeObject *__pyx_find_code_object(
int code_line) {
22401 PyCodeObject* code_object;
22403 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
22406 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
22407 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
22410 code_object = __pyx_code_cache.entries[pos].code_object;
22411 Py_INCREF(code_object);
22412 return code_object;
22414 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
22416 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
22417 if (unlikely(!code_line)) {
22420 if (unlikely(!entries)) {
22421 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
22422 if (likely(entries)) {
22423 __pyx_code_cache.entries = entries;
22424 __pyx_code_cache.max_count = 64;
22425 __pyx_code_cache.count = 1;
22426 entries[0].code_line = code_line;
22427 entries[0].code_object = code_object;
22428 Py_INCREF(code_object);
22432 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
22433 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
22434 PyCodeObject* tmp = entries[pos].code_object;
22435 entries[pos].code_object = code_object;
22439 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
22440 int new_max = __pyx_code_cache.max_count + 64;
22441 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
22442 __pyx_code_cache.entries, (
size_t)new_max*
sizeof(__Pyx_CodeObjectCacheEntry));
22443 if (unlikely(!entries)) {
22446 __pyx_code_cache.entries = entries;
22447 __pyx_code_cache.max_count = new_max;
22449 for (
i=__pyx_code_cache.count;
i>pos;
i--) {
22450 entries[
i] = entries[
i-1];
22452 entries[pos].code_line = code_line;
22453 entries[pos].code_object = code_object;
22454 __pyx_code_cache.count++;
22455 Py_INCREF(code_object);
22459 #include "compile.h"
22460 #include "frameobject.h"
22461 #include "traceback.h"
22462 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
22463 const char *funcname,
int c_line,
22464 int py_line,
const char *filename) {
22465 PyCodeObject *py_code = 0;
22466 PyObject *py_srcfile = 0;
22467 PyObject *py_funcname = 0;
22468 #if PY_MAJOR_VERSION < 3
22469 py_srcfile = PyString_FromString(filename);
22471 py_srcfile = PyUnicode_FromString(filename);
22473 if (!py_srcfile)
goto bad;
22475 #if PY_MAJOR_VERSION < 3
22476 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
22478 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
22482 #if PY_MAJOR_VERSION < 3
22483 py_funcname = PyString_FromString(funcname);
22485 py_funcname = PyUnicode_FromString(funcname);
22488 if (!py_funcname)
goto bad;
22489 py_code = __Pyx_PyCode_New(
22506 Py_DECREF(py_srcfile);
22507 Py_DECREF(py_funcname);
22510 Py_XDECREF(py_srcfile);
22511 Py_XDECREF(py_funcname);
22514 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
22515 int py_line,
const char *filename) {
22516 PyCodeObject *py_code = 0;
22517 PyFrameObject *py_frame = 0;
22518 PyThreadState *tstate = __Pyx_PyThreadState_Current;
22520 c_line = __Pyx_CLineForTraceback(tstate, c_line);
22522 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
22524 py_code = __Pyx_CreateCodeObjectForTraceback(
22525 funcname, c_line, py_line, filename);
22526 if (!py_code)
goto bad;
22527 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
22529 py_frame = PyFrame_New(
22535 if (!py_frame)
goto bad;
22536 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
22537 PyTraceBack_Here(py_frame);
22539 Py_XDECREF(py_code);
22540 Py_XDECREF(py_frame);
22544 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
22545 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
22546 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
22547 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
22548 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
22550 func_type value = func_value;\
22551 if (sizeof(target_type) < sizeof(func_type)) {\
22552 if (unlikely(value != (func_type) (target_type) value)) {\
22553 func_type zero = 0;\
22554 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
22555 return (target_type) -1;\
22556 if (is_unsigned && unlikely(value < zero))\
22557 goto raise_neg_overflow;\
22559 goto raise_overflow;\
22562 return (target_type) value;\
22566 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value) {
22567 const int neg_one = (int) ((
int) 0 - (int) 1), const_zero = (int) 0;
22568 const int is_unsigned = neg_one > const_zero;
22570 if (
sizeof(
int) <
sizeof(long)) {
22571 return PyInt_FromLong((
long) value);
22572 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
22573 return PyLong_FromUnsignedLong((
unsigned long) value);
22574 #ifdef HAVE_LONG_LONG
22575 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
22576 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
22580 if (
sizeof(
int) <=
sizeof(
long)) {
22581 return PyInt_FromLong((
long) value);
22582 #ifdef HAVE_LONG_LONG
22583 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
22584 return PyLong_FromLongLong((PY_LONG_LONG) value);
22589 int one = 1;
int little = (int)*(
unsigned char *)&one;
22590 unsigned char *bytes = (
unsigned char *)&value;
22591 return _PyLong_FromByteArray(bytes,
sizeof(
int),
22592 little, !is_unsigned);
22597 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *x) {
22598 const int neg_one = (int) ((
int) 0 - (int) 1), const_zero = (int) 0;
22599 const int is_unsigned = neg_one > const_zero;
22600 #if PY_MAJOR_VERSION < 3
22601 if (likely(PyInt_Check(x))) {
22602 if (
sizeof(
int) <
sizeof(long)) {
22603 __PYX_VERIFY_RETURN_INT(
int,
long, PyInt_AS_LONG(x))
22605 long val = PyInt_AS_LONG(x);
22606 if (is_unsigned && unlikely(val < 0)) {
22607 goto raise_neg_overflow;
22613 if (likely(PyLong_Check(x))) {
22615 #if CYTHON_USE_PYLONG_INTERNALS
22616 const digit* digits = ((PyLongObject*)x)->ob_digit;
22617 switch (Py_SIZE(x)) {
22618 case 0:
return (
int) 0;
22619 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, digits[0])
22621 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
22622 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22623 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22624 }
else if (8 *
sizeof(
int) >= 2 * PyLong_SHIFT) {
22625 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
22630 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
22631 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22632 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22633 }
else if (8 *
sizeof(
int) >= 3 * PyLong_SHIFT) {
22634 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
22639 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
22640 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22641 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22642 }
else if (8 *
sizeof(
int) >= 4 * PyLong_SHIFT) {
22643 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
22649 #if CYTHON_COMPILING_IN_CPYTHON
22650 if (unlikely(Py_SIZE(x) < 0)) {
22651 goto raise_neg_overflow;
22655 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
22656 if (unlikely(result < 0))
22658 if (unlikely(result == 1))
22659 goto raise_neg_overflow;
22662 if (
sizeof(
int) <=
sizeof(
unsigned long)) {
22663 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
22664 #ifdef HAVE_LONG_LONG
22665 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
22666 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
22670 #if CYTHON_USE_PYLONG_INTERNALS
22671 const digit* digits = ((PyLongObject*)x)->ob_digit;
22672 switch (Py_SIZE(x)) {
22673 case 0:
return (
int) 0;
22674 case -1: __PYX_VERIFY_RETURN_INT(
int, sdigit, (sdigit) (-(sdigit)digits[0]))
22675 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, +digits[0])
22677 if (8 *
sizeof(
int) - 1 > 1 * PyLong_SHIFT) {
22678 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22679 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22680 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
22681 return (
int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
22686 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
22687 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22688 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22689 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
22690 return (
int) ((((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
22695 if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
22696 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22697 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22698 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
22699 return (
int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
22704 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
22705 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22706 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22707 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
22708 return (
int) ((((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
22713 if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
22714 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22715 __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])))
22716 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
22717 return (
int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
22722 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
22723 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22724 __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])))
22725 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
22726 return (
int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
22732 if (
sizeof(
int) <=
sizeof(long)) {
22733 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
22734 #ifdef HAVE_LONG_LONG
22735 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
22736 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
22741 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
22742 PyErr_SetString(PyExc_RuntimeError,
22743 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
22746 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
22747 #if PY_MAJOR_VERSION < 3
22748 if (likely(v) && !PyLong_Check(v)) {
22750 v = PyNumber_Long(tmp);
22755 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
22756 unsigned char *bytes = (
unsigned char *)&val;
22757 int ret = _PyLong_AsByteArray((PyLongObject *)v,
22758 bytes,
sizeof(val),
22759 is_little, !is_unsigned);
22769 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
22770 if (!tmp)
return (
int) -1;
22771 val = __Pyx_PyInt_As_int(tmp);
22776 PyErr_SetString(PyExc_OverflowError,
22777 "value too large to convert to int");
22779 raise_neg_overflow:
22780 PyErr_SetString(PyExc_OverflowError,
22781 "can't convert negative value to int");
22786 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value) {
22787 const long neg_one = (long) ((
long) 0 - (long) 1), const_zero = (long) 0;
22788 const int is_unsigned = neg_one > const_zero;
22790 if (
sizeof(
long) <
sizeof(long)) {
22791 return PyInt_FromLong((
long) value);
22792 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
22793 return PyLong_FromUnsignedLong((
unsigned long) value);
22794 #ifdef HAVE_LONG_LONG
22795 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
22796 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
22800 if (
sizeof(
long) <=
sizeof(
long)) {
22801 return PyInt_FromLong((
long) value);
22802 #ifdef HAVE_LONG_LONG
22803 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
22804 return PyLong_FromLongLong((PY_LONG_LONG) value);
22809 int one = 1;
int little = (int)*(
unsigned char *)&one;
22810 unsigned char *bytes = (
unsigned char *)&value;
22811 return _PyLong_FromByteArray(bytes,
sizeof(
long),
22812 little, !is_unsigned);
22817 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *x) {
22818 const long neg_one = (long) ((
long) 0 - (long) 1), const_zero = (long) 0;
22819 const int is_unsigned = neg_one > const_zero;
22820 #if PY_MAJOR_VERSION < 3
22821 if (likely(PyInt_Check(x))) {
22822 if (
sizeof(
long) <
sizeof(long)) {
22823 __PYX_VERIFY_RETURN_INT(
long,
long, PyInt_AS_LONG(x))
22825 long val = PyInt_AS_LONG(x);
22826 if (is_unsigned && unlikely(val < 0)) {
22827 goto raise_neg_overflow;
22833 if (likely(PyLong_Check(x))) {
22835 #if CYTHON_USE_PYLONG_INTERNALS
22836 const digit* digits = ((PyLongObject*)x)->ob_digit;
22837 switch (Py_SIZE(x)) {
22838 case 0:
return (
long) 0;
22839 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, digits[0])
22841 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
22842 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22843 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22844 }
else if (8 *
sizeof(
long) >= 2 * PyLong_SHIFT) {
22845 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
22850 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
22851 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22852 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22853 }
else if (8 *
sizeof(
long) >= 3 * PyLong_SHIFT) {
22854 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
22859 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
22860 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22861 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22862 }
else if (8 *
sizeof(
long) >= 4 * PyLong_SHIFT) {
22863 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
22869 #if CYTHON_COMPILING_IN_CPYTHON
22870 if (unlikely(Py_SIZE(x) < 0)) {
22871 goto raise_neg_overflow;
22875 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
22876 if (unlikely(result < 0))
22878 if (unlikely(result == 1))
22879 goto raise_neg_overflow;
22882 if (
sizeof(
long) <=
sizeof(
unsigned long)) {
22883 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
22884 #ifdef HAVE_LONG_LONG
22885 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
22886 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
22890 #if CYTHON_USE_PYLONG_INTERNALS
22891 const digit* digits = ((PyLongObject*)x)->ob_digit;
22892 switch (Py_SIZE(x)) {
22893 case 0:
return (
long) 0;
22894 case -1: __PYX_VERIFY_RETURN_INT(
long, sdigit, (sdigit) (-(sdigit)digits[0]))
22895 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, +digits[0])
22897 if (8 *
sizeof(
long) - 1 > 1 * PyLong_SHIFT) {
22898 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22899 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22900 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
22901 return (
long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
22906 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
22907 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22908 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22909 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
22910 return (
long) ((((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
22915 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
22916 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22917 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22918 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
22919 return (
long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
22924 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
22925 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22926 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22927 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
22928 return (
long) ((((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
22933 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
22934 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22935 __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])))
22936 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
22937 return (
long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
22942 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
22943 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22944 __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])))
22945 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
22946 return (
long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
22952 if (
sizeof(
long) <=
sizeof(long)) {
22953 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
22954 #ifdef HAVE_LONG_LONG
22955 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
22956 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
22961 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
22962 PyErr_SetString(PyExc_RuntimeError,
22963 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
22966 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
22967 #if PY_MAJOR_VERSION < 3
22968 if (likely(v) && !PyLong_Check(v)) {
22970 v = PyNumber_Long(tmp);
22975 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
22976 unsigned char *bytes = (
unsigned char *)&val;
22977 int ret = _PyLong_AsByteArray((PyLongObject *)v,
22978 bytes,
sizeof(val),
22979 is_little, !is_unsigned);
22989 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
22990 if (!tmp)
return (
long) -1;
22991 val = __Pyx_PyInt_As_long(tmp);
22996 PyErr_SetString(PyExc_OverflowError,
22997 "value too large to convert to long");
22999 raise_neg_overflow:
23000 PyErr_SetString(PyExc_OverflowError,
23001 "can't convert negative value to long");
23006 #if CYTHON_COMPILING_IN_CPYTHON
23007 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
23013 return b == &PyBaseObject_Type;
23015 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
23017 if (a == b)
return 1;
23021 n = PyTuple_GET_SIZE(mro);
23022 for (
i = 0;
i < n;
i++) {
23023 if (PyTuple_GET_ITEM(mro,
i) == (PyObject *)b)
23028 return __Pyx_InBases(a, b);
23030 #if PY_MAJOR_VERSION == 2
23031 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
23032 PyObject *exception, *value, *tb;
23034 __Pyx_PyThreadState_declare
23035 __Pyx_PyThreadState_assign
23036 __Pyx_ErrFetch(&exception, &value, &tb);
23037 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
23038 if (unlikely(res == -1)) {
23039 PyErr_WriteUnraisable(err);
23043 res = PyObject_IsSubclass(err, exc_type2);
23044 if (unlikely(res == -1)) {
23045 PyErr_WriteUnraisable(err);
23049 __Pyx_ErrRestore(exception, value, tb);
23053 static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
23054 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
23056 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
23061 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
23063 assert(PyExceptionClass_Check(exc_type));
23064 n = PyTuple_GET_SIZE(tuple);
23065 #if PY_MAJOR_VERSION >= 3
23066 for (
i=0;
i<n;
i++) {
23067 if (exc_type == PyTuple_GET_ITEM(tuple,
i))
return 1;
23070 for (
i=0;
i<n;
i++) {
23071 PyObject *t = PyTuple_GET_ITEM(tuple,
i);
23072 #if PY_MAJOR_VERSION < 3
23073 if (likely(exc_type == t))
return 1;
23075 if (likely(PyExceptionClass_Check(t))) {
23076 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
23082 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
23083 if (likely(err == exc_type))
return 1;
23084 if (likely(PyExceptionClass_Check(err))) {
23085 if (likely(PyExceptionClass_Check(exc_type))) {
23086 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
23087 }
else if (likely(PyTuple_Check(exc_type))) {
23088 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
23092 return PyErr_GivenExceptionMatches(err, exc_type);
23094 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
23095 assert(PyExceptionClass_Check(exc_type1));
23096 assert(PyExceptionClass_Check(exc_type2));
23097 if (likely(err == exc_type1 || err == exc_type2))
return 1;
23098 if (likely(PyExceptionClass_Check(err))) {
23099 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
23101 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
23106 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
23107 PyObject* fake_module;
23108 PyTypeObject* cached_type = NULL;
23109 fake_module = PyImport_AddModule((
char*)
"_cython_" CYTHON_ABI);
23110 if (!fake_module)
return NULL;
23111 Py_INCREF(fake_module);
23112 cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
23114 if (!PyType_Check((PyObject*)cached_type)) {
23115 PyErr_Format(PyExc_TypeError,
23116 "Shared Cython type %.200s is not a type object",
23120 if (cached_type->tp_basicsize != type->tp_basicsize) {
23121 PyErr_Format(PyExc_TypeError,
23122 "Shared Cython type %.200s has the wrong size, try recompiling",
23127 if (!PyErr_ExceptionMatches(PyExc_AttributeError))
goto bad;
23129 if (PyType_Ready(type) < 0)
goto bad;
23130 if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
23133 cached_type = type;
23136 Py_DECREF(fake_module);
23137 return cached_type;
23139 Py_XDECREF(cached_type);
23140 cached_type = NULL;
23145 static int __Pyx_PyObject_GetMethod(PyObject *
obj, PyObject *name, PyObject **method) {
23147 #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
23148 PyTypeObject *tp = Py_TYPE(
obj);
23150 descrgetfunc f = NULL;
23151 PyObject **dictptr, *dict;
23152 int meth_found = 0;
23153 assert (*method == NULL);
23154 if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
23155 attr = __Pyx_PyObject_GetAttrStr(
obj, name);
23158 if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
23161 descr = _PyType_Lookup(tp, name);
23162 if (likely(descr != NULL)) {
23164 #if PY_MAJOR_VERSION >= 3
23165 #ifdef __Pyx_CyFunction_USED
23166 if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
23168 if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type)))
23171 #ifdef __Pyx_CyFunction_USED
23172 if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
23174 if (likely(PyFunction_Check(descr)))
23180 f = Py_TYPE(descr)->tp_descr_get;
23181 if (f != NULL && PyDescr_IsData(descr)) {
23182 attr = f(descr,
obj, (PyObject *)Py_TYPE(
obj));
23188 dictptr = _PyObject_GetDictPtr(
obj);
23189 if (dictptr != NULL && (dict = *dictptr) != NULL) {
23191 attr = __Pyx_PyDict_GetItemStr(dict, name);
23192 if (attr != NULL) {
23205 attr = f(descr,
obj, (PyObject *)Py_TYPE(
obj));
23209 if (descr != NULL) {
23213 PyErr_Format(PyExc_AttributeError,
23214 #
if PY_MAJOR_VERSION >= 3
23215 "'%.50s' object has no attribute '%U'",
23216 tp->tp_name, name);
23218 "'%.50s' object has no attribute '%.400s'",
23219 tp->tp_name, PyString_AS_STRING(name));
23223 attr = __Pyx_PyObject_GetAttrStr(
obj, name);
23227 #if CYTHON_UNPACK_METHODS
23228 if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) ==
obj)) {
23229 PyObject *
function = PyMethod_GET_FUNCTION(attr);
23230 Py_INCREF(
function);
23232 *method =
function;
23241 static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
23242 PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
23246 static PyObject* __Pyx_PyObject_CallMethod1(PyObject*
obj, PyObject* method_name, PyObject* arg) {
23247 PyObject *method = NULL, *result;
23248 int is_method = __Pyx_PyObject_GetMethod(
obj, method_name, &method);
23249 if (likely(is_method)) {
23250 result = __Pyx_PyObject_Call2Args(method,
obj, arg);
23254 if (unlikely(!method))
return NULL;
23255 return __Pyx__PyObject_CallMethod1(method, arg);
23259 #include <structmember.h>
23260 #include <frameobject.h>
23261 #define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
23262 static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) {
23263 PyObject *et, *ev, *tb;
23264 PyObject *value = NULL;
23265 __Pyx_ErrFetch(&et, &ev, &tb);
23269 Py_INCREF(Py_None);
23273 if (likely(et == PyExc_StopIteration)) {
23275 Py_INCREF(Py_None);
23278 #if PY_VERSION_HEX >= 0x030300A0
23279 else if (Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) {
23280 value = ((PyStopIterationObject *)ev)->value;
23285 else if (unlikely(PyTuple_Check(ev))) {
23286 if (PyTuple_GET_SIZE(ev) >= 1) {
23287 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
23288 value = PyTuple_GET_ITEM(ev, 0);
23291 value = PySequence_ITEM(ev, 0);
23294 Py_INCREF(Py_None);
23299 else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
23302 if (likely(value)) {
23308 }
else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
23309 __Pyx_ErrRestore(et, ev, tb);
23312 PyErr_NormalizeException(&et, &ev, &tb);
23313 if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
23314 __Pyx_ErrRestore(et, ev, tb);
23319 #if PY_VERSION_HEX >= 0x030300A0
23320 value = ((PyStopIterationObject *)ev)->value;
23325 PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args);
23327 if (likely(args)) {
23328 value = PySequence_GetItem(args, 0);
23331 if (unlikely(!value)) {
23332 __Pyx_ErrRestore(NULL, NULL, NULL);
23333 Py_INCREF(Py_None);
23341 static CYTHON_INLINE
23342 void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) {
23343 PyObject *t, *v, *tb;
23344 t = exc_state->exc_type;
23345 v = exc_state->exc_value;
23346 tb = exc_state->exc_traceback;
23347 exc_state->exc_type = NULL;
23348 exc_state->exc_value = NULL;
23349 exc_state->exc_traceback = NULL;
23354 #define __Pyx_Coroutine_AlreadyRunningError(gen) (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL)
23355 static void __Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject *gen) {
23358 #ifdef __Pyx_Coroutine_USED
23359 }
else if (__Pyx_Coroutine_Check((PyObject*)gen)) {
23360 msg =
"coroutine already executing";
23362 #ifdef __Pyx_AsyncGen_USED
23363 }
else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
23364 msg =
"async generator already executing";
23367 msg =
"generator already executing";
23369 PyErr_SetString(PyExc_ValueError, msg);
23371 #define __Pyx_Coroutine_NotStartedError(gen) (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL)
23372 static void __Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject *gen) {
23375 #ifdef __Pyx_Coroutine_USED
23376 }
else if (__Pyx_Coroutine_Check(gen)) {
23377 msg =
"can't send non-None value to a just-started coroutine";
23379 #ifdef __Pyx_AsyncGen_USED
23380 }
else if (__Pyx_AsyncGen_CheckExact(gen)) {
23381 msg =
"can't send non-None value to a just-started async generator";
23384 msg =
"can't send non-None value to a just-started generator";
23386 PyErr_SetString(PyExc_TypeError, msg);
23388 #define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing) (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL)
23389 static void __Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject *gen, PyObject *value, CYTHON_UNUSED
int closing) {
23390 #ifdef __Pyx_Coroutine_USED
23391 if (!closing && __Pyx_Coroutine_Check(gen)) {
23392 PyErr_SetString(PyExc_RuntimeError,
"cannot reuse already awaited coroutine");
23396 #ifdef __Pyx_AsyncGen_USED
23397 if (__Pyx_AsyncGen_CheckExact(gen))
23398 PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration);
23401 PyErr_SetNone(PyExc_StopIteration);
23405 PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *
self, PyObject *value,
int closing) {
23406 __Pyx_PyThreadState_declare
23407 PyThreadState *tstate;
23408 __Pyx_ExcInfoStruct *exc_state;
23410 assert(!self->is_running);
23411 if (unlikely(self->resume_label == 0)) {
23412 if (unlikely(value && value != Py_None)) {
23413 return __Pyx_Coroutine_NotStartedError((PyObject*)
self);
23416 if (unlikely(self->resume_label == -1)) {
23417 return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)
self, value, closing);
23419 #if CYTHON_FAST_THREAD_STATE
23420 __Pyx_PyThreadState_assign
23421 tstate = __pyx_tstate;
23423 tstate = __Pyx_PyThreadState_Current;
23425 exc_state = &
self->gi_exc_state;
23426 if (exc_state->exc_type) {
23427 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
23429 if (exc_state->exc_traceback) {
23430 PyTracebackObject *tb = (PyTracebackObject *) exc_state->exc_traceback;
23431 PyFrameObject *f = tb->tb_frame;
23432 Py_XINCREF(tstate->frame);
23433 assert(f->f_back == NULL);
23434 f->f_back = tstate->frame;
23438 #if CYTHON_USE_EXC_INFO_STACK
23439 exc_state->previous_item = tstate->exc_info;
23440 tstate->exc_info = exc_state;
23442 if (exc_state->exc_type) {
23443 __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
23445 __Pyx_Coroutine_ExceptionClear(exc_state);
23446 __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
23449 self->is_running = 1;
23450 retval =
self->body((PyObject *)
self, tstate, value);
23451 self->is_running = 0;
23452 #if CYTHON_USE_EXC_INFO_STACK
23453 exc_state = &
self->gi_exc_state;
23454 tstate->exc_info = exc_state->previous_item;
23455 exc_state->previous_item = NULL;
23456 __Pyx_Coroutine_ResetFrameBackpointer(exc_state);
23460 static CYTHON_INLINE
void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) {
23461 PyObject *exc_tb = exc_state->exc_traceback;
23462 if (likely(exc_tb)) {
23463 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
23465 PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
23466 PyFrameObject *f = tb->tb_frame;
23467 Py_CLEAR(f->f_back);
23471 static CYTHON_INLINE
23472 PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *retval) {
23473 if (unlikely(!retval)) {
23474 __Pyx_PyThreadState_declare
23475 __Pyx_PyThreadState_assign
23476 if (!__Pyx_PyErr_Occurred()) {
23477 PyObject *exc = PyExc_StopIteration;
23478 #ifdef __Pyx_AsyncGen_USED
23479 if (__Pyx_AsyncGen_CheckExact(gen))
23480 exc = __Pyx_PyExc_StopAsyncIteration;
23482 __Pyx_PyErr_SetNone(exc);
23487 static CYTHON_INLINE
23488 PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
23490 PyObject *val = NULL;
23491 __Pyx_Coroutine_Undelegate(gen);
23492 __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
23493 ret = __Pyx_Coroutine_SendEx(gen, val, 0);
23497 static PyObject *__Pyx_Coroutine_Send(PyObject *
self, PyObject *value) {
23499 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*)
self;
23500 PyObject *yf = gen->yieldfrom;
23501 if (unlikely(gen->is_running))
23502 return __Pyx_Coroutine_AlreadyRunningError(gen);
23505 gen->is_running = 1;
23506 #ifdef __Pyx_Generator_USED
23507 if (__Pyx_Generator_CheckExact(yf)) {
23508 ret = __Pyx_Coroutine_Send(yf, value);
23511 #ifdef __Pyx_Coroutine_USED
23512 if (__Pyx_Coroutine_Check(yf)) {
23513 ret = __Pyx_Coroutine_Send(yf, value);
23516 #ifdef __Pyx_AsyncGen_USED
23517 if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
23518 ret = __Pyx_async_gen_asend_send(yf, value);
23521 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
23522 if (PyGen_CheckExact(yf)) {
23523 ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
23526 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
23527 if (PyCoro_CheckExact(yf)) {
23528 ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
23532 if (value == Py_None)
23533 ret = Py_TYPE(yf)->tp_iternext(yf);
23535 ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
23537 gen->is_running = 0;
23541 retval = __Pyx_Coroutine_FinishDelegation(gen);
23543 retval = __Pyx_Coroutine_SendEx(gen, value, 0);
23545 return __Pyx_Coroutine_MethodReturn(
self, retval);
23547 static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
23548 PyObject *retval = NULL;
23550 #ifdef __Pyx_Generator_USED
23551 if (__Pyx_Generator_CheckExact(yf)) {
23552 retval = __Pyx_Coroutine_Close(yf);
23557 #ifdef __Pyx_Coroutine_USED
23558 if (__Pyx_Coroutine_Check(yf)) {
23559 retval = __Pyx_Coroutine_Close(yf);
23563 if (__Pyx_CoroutineAwait_CheckExact(yf)) {
23564 retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL);
23569 #ifdef __Pyx_AsyncGen_USED
23570 if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
23571 retval = __Pyx_async_gen_asend_close(yf, NULL);
23573 if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
23574 retval = __Pyx_async_gen_athrow_close(yf, NULL);
23579 gen->is_running = 1;
23580 meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close);
23581 if (unlikely(!meth)) {
23582 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
23583 PyErr_WriteUnraisable(yf);
23587 retval = PyObject_CallFunction(meth, NULL);
23592 gen->is_running = 0;
23594 Py_XDECREF(retval);
23597 static PyObject *__Pyx_Generator_Next(PyObject *
self) {
23598 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*)
self;
23599 PyObject *yf = gen->yieldfrom;
23600 if (unlikely(gen->is_running))
23601 return __Pyx_Coroutine_AlreadyRunningError(gen);
23604 gen->is_running = 1;
23605 #ifdef __Pyx_Generator_USED
23606 if (__Pyx_Generator_CheckExact(yf)) {
23607 ret = __Pyx_Generator_Next(yf);
23610 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
23611 if (PyGen_CheckExact(yf)) {
23612 ret = _PyGen_Send((PyGenObject*)yf, NULL);
23615 #ifdef __Pyx_Coroutine_USED
23616 if (__Pyx_Coroutine_Check(yf)) {
23617 ret = __Pyx_Coroutine_Send(yf, Py_None);
23620 ret = Py_TYPE(yf)->tp_iternext(yf);
23621 gen->is_running = 0;
23625 return __Pyx_Coroutine_FinishDelegation(gen);
23627 return __Pyx_Coroutine_SendEx(gen, Py_None, 0);
23629 static PyObject *__Pyx_Coroutine_Close_Method(PyObject *
self, CYTHON_UNUSED PyObject *arg) {
23630 return __Pyx_Coroutine_Close(
self);
23632 static PyObject *__Pyx_Coroutine_Close(PyObject *
self) {
23633 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
23634 PyObject *retval, *raised_exception;
23635 PyObject *yf = gen->yieldfrom;
23637 if (unlikely(gen->is_running))
23638 return __Pyx_Coroutine_AlreadyRunningError(gen);
23641 err = __Pyx_Coroutine_CloseIter(gen, yf);
23642 __Pyx_Coroutine_Undelegate(gen);
23646 PyErr_SetNone(PyExc_GeneratorExit);
23647 retval = __Pyx_Coroutine_SendEx(gen, NULL, 1);
23648 if (unlikely(retval)) {
23652 #ifdef __Pyx_Coroutine_USED
23653 }
else if (__Pyx_Coroutine_Check(
self)) {
23654 msg =
"coroutine ignored GeneratorExit";
23656 #ifdef __Pyx_AsyncGen_USED
23657 }
else if (__Pyx_AsyncGen_CheckExact(
self)) {
23658 #if PY_VERSION_HEX < 0x03060000
23659 msg =
"async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)";
23661 msg =
"async generator ignored GeneratorExit";
23665 msg =
"generator ignored GeneratorExit";
23667 PyErr_SetString(PyExc_RuntimeError, msg);
23670 raised_exception = PyErr_Occurred();
23671 if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) {
23672 if (raised_exception) PyErr_Clear();
23673 Py_INCREF(Py_None);
23678 static PyObject *__Pyx__Coroutine_Throw(PyObject *
self, PyObject *typ, PyObject *val, PyObject *tb,
23679 PyObject *args,
int close_on_genexit) {
23680 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
23681 PyObject *yf = gen->yieldfrom;
23682 if (unlikely(gen->is_running))
23683 return __Pyx_Coroutine_AlreadyRunningError(gen);
23687 if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
23688 int err = __Pyx_Coroutine_CloseIter(gen, yf);
23690 __Pyx_Coroutine_Undelegate(gen);
23692 return __Pyx_Coroutine_MethodReturn(
self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
23695 gen->is_running = 1;
23697 #ifdef __Pyx_Generator_USED
23698 || __Pyx_Generator_CheckExact(yf)
23700 #ifdef __Pyx_Coroutine_USED
23701 || __Pyx_Coroutine_Check(yf)
23704 ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
23705 #ifdef __Pyx_Coroutine_USED
23706 }
else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
23707 ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
23710 PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw);
23711 if (unlikely(!meth)) {
23713 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
23714 gen->is_running = 0;
23718 __Pyx_Coroutine_Undelegate(gen);
23719 gen->is_running = 0;
23722 if (likely(args)) {
23723 ret = PyObject_CallObject(meth, args);
23725 ret = PyObject_CallFunctionObjArgs(meth, typ, val, tb, NULL);
23729 gen->is_running = 0;
23732 ret = __Pyx_Coroutine_FinishDelegation(gen);
23734 return __Pyx_Coroutine_MethodReturn(
self, ret);
23737 __Pyx_Raise(typ, val, tb, NULL);
23738 return __Pyx_Coroutine_MethodReturn(
self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
23740 static PyObject *__Pyx_Coroutine_Throw(PyObject *
self, PyObject *args) {
23742 PyObject *val = NULL;
23743 PyObject *tb = NULL;
23744 if (!PyArg_UnpackTuple(args, (
char *)
"throw", 1, 3, &typ, &val, &tb))
23746 return __Pyx__Coroutine_Throw(
self, typ, val, tb, args, 1);
23748 static CYTHON_INLINE
int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit,
void *arg) {
23749 Py_VISIT(exc_state->exc_type);
23750 Py_VISIT(exc_state->exc_value);
23751 Py_VISIT(exc_state->exc_traceback);
23754 static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit,
void *arg) {
23755 Py_VISIT(gen->closure);
23756 Py_VISIT(gen->classobj);
23757 Py_VISIT(gen->yieldfrom);
23758 return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg);
23760 static int __Pyx_Coroutine_clear(PyObject *
self) {
23761 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
23762 Py_CLEAR(gen->closure);
23763 Py_CLEAR(gen->classobj);
23764 Py_CLEAR(gen->yieldfrom);
23765 __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state);
23766 #ifdef __Pyx_AsyncGen_USED
23767 if (__Pyx_AsyncGen_CheckExact(
self)) {
23768 Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
23771 Py_CLEAR(gen->gi_code);
23772 Py_CLEAR(gen->gi_name);
23773 Py_CLEAR(gen->gi_qualname);
23774 Py_CLEAR(gen->gi_modulename);
23777 static void __Pyx_Coroutine_dealloc(PyObject *
self) {
23778 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
23779 PyObject_GC_UnTrack(gen);
23780 if (gen->gi_weakreflist != NULL)
23781 PyObject_ClearWeakRefs(
self);
23782 if (gen->resume_label >= 0) {
23783 PyObject_GC_Track(
self);
23784 #if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE
23785 if (PyObject_CallFinalizerFromDealloc(
self))
23787 Py_TYPE(gen)->tp_del(
self);
23788 if (self->ob_refcnt > 0)
23793 PyObject_GC_UnTrack(
self);
23795 #ifdef __Pyx_AsyncGen_USED
23796 if (__Pyx_AsyncGen_CheckExact(
self)) {
23800 Py_CLEAR(((__pyx_PyAsyncGenObject*)
self)->ag_finalizer);
23803 __Pyx_Coroutine_clear(
self);
23804 PyObject_GC_Del(gen);
23806 static void __Pyx_Coroutine_del(PyObject *
self) {
23807 PyObject *error_type, *error_value, *error_traceback;
23808 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
23809 __Pyx_PyThreadState_declare
23810 if (gen->resume_label < 0) {
23813 #if !CYTHON_USE_TP_FINALIZE
23814 assert(self->ob_refcnt == 0);
23815 self->ob_refcnt = 1;
23817 __Pyx_PyThreadState_assign
23818 __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
23819 #ifdef __Pyx_AsyncGen_USED
23820 if (__Pyx_AsyncGen_CheckExact(
self)) {
23821 __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)
self;
23822 PyObject *finalizer = agen->ag_finalizer;
23823 if (finalizer && !agen->ag_closed) {
23824 PyObject *res = __Pyx_PyObject_CallOneArg(finalizer,
self);
23825 if (unlikely(!res)) {
23826 PyErr_WriteUnraisable(
self);
23830 __Pyx_ErrRestore(error_type, error_value, error_traceback);
23835 if (unlikely(gen->resume_label == 0 && !error_value)) {
23836 #ifdef __Pyx_Coroutine_USED
23837 #ifdef __Pyx_Generator_USED
23838 if (!__Pyx_Generator_CheckExact(
self))
23841 PyObject_GC_UnTrack(
self);
23842 #if PY_MAJOR_VERSION >= 3 || defined(PyErr_WarnFormat)
23843 if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1,
"coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
23844 PyErr_WriteUnraisable(
self);
23848 #if CYTHON_COMPILING_IN_PYPY
23850 cmsg = (
char*)
"coroutine was never awaited";
23853 PyObject *qualname;
23854 qualname = gen->gi_qualname;
23855 cname = PyString_AS_STRING(qualname);
23856 msg = PyString_FromFormat(
"coroutine '%.50s' was never awaited", cname);
23857 if (unlikely(!msg)) {
23859 cmsg = (
char*)
"coroutine was never awaited";
23861 cmsg = PyString_AS_STRING(msg);
23864 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0))
23865 PyErr_WriteUnraisable(
self);
23868 PyObject_GC_Track(
self);
23872 PyObject *res = __Pyx_Coroutine_Close(
self);
23873 if (unlikely(!res)) {
23874 if (PyErr_Occurred())
23875 PyErr_WriteUnraisable(
self);
23880 __Pyx_ErrRestore(error_type, error_value, error_traceback);
23881 #if !CYTHON_USE_TP_FINALIZE
23882 assert(self->ob_refcnt > 0);
23883 if (--self->ob_refcnt == 0) {
23887 Py_ssize_t refcnt =
self->ob_refcnt;
23888 _Py_NewReference(
self);
23889 self->ob_refcnt = refcnt;
23891 #if CYTHON_COMPILING_IN_CPYTHON
23892 assert(PyType_IS_GC(self->ob_type) &&
23893 _Py_AS_GC(
self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
23896 #ifdef COUNT_ALLOCS
23897 --Py_TYPE(
self)->tp_frees;
23898 --Py_TYPE(
self)->tp_allocs;
23903 __Pyx_Coroutine_get_name(__pyx_CoroutineObject *
self, CYTHON_UNUSED
void *context)
23905 PyObject *name =
self->gi_name;
23906 if (unlikely(!name)) name = Py_None;
23911 __Pyx_Coroutine_set_name(__pyx_CoroutineObject *
self, PyObject *value, CYTHON_UNUSED
void *context)
23914 #if PY_MAJOR_VERSION >= 3
23915 if (unlikely(value == NULL || !PyUnicode_Check(value)))
23917 if (unlikely(value == NULL || !PyString_Check(value)))
23920 PyErr_SetString(PyExc_TypeError,
23921 "__name__ must be set to a string object");
23924 tmp =
self->gi_name;
23926 self->gi_name = value;
23931 __Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *
self, CYTHON_UNUSED
void *context)
23933 PyObject *name =
self->gi_qualname;
23934 if (unlikely(!name)) name = Py_None;
23939 __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *
self, PyObject *value, CYTHON_UNUSED
void *context)
23942 #if PY_MAJOR_VERSION >= 3
23943 if (unlikely(value == NULL || !PyUnicode_Check(value)))
23945 if (unlikely(value == NULL || !PyString_Check(value)))
23948 PyErr_SetString(PyExc_TypeError,
23949 "__qualname__ must be set to a string object");
23952 tmp =
self->gi_qualname;
23954 self->gi_qualname = value;
23958 static __pyx_CoroutineObject *__Pyx__Coroutine_New(
23959 PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
23960 PyObject *name, PyObject *qualname, PyObject *module_name) {
23961 __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
23962 if (unlikely(!gen))
23964 return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name);
23966 static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
23967 __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
23968 PyObject *name, PyObject *qualname, PyObject *module_name) {
23970 gen->closure = closure;
23971 Py_XINCREF(closure);
23972 gen->is_running = 0;
23973 gen->resume_label = 0;
23974 gen->classobj = NULL;
23975 gen->yieldfrom = NULL;
23976 gen->gi_exc_state.exc_type = NULL;
23977 gen->gi_exc_state.exc_value = NULL;
23978 gen->gi_exc_state.exc_traceback = NULL;
23979 #if CYTHON_USE_EXC_INFO_STACK
23980 gen->gi_exc_state.previous_item = NULL;
23982 gen->gi_weakreflist = NULL;
23983 Py_XINCREF(qualname);
23984 gen->gi_qualname = qualname;
23986 gen->gi_name = name;
23987 Py_XINCREF(module_name);
23988 gen->gi_modulename = module_name;
23990 gen->gi_code = code;
23991 PyObject_GC_Track(gen);
23996 static PyObject* __Pyx_Coroutine_patch_module(PyObject* module,
const char* py_code) {
23997 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
23999 PyObject *globals, *result_obj;
24000 globals = PyDict_New();
if (unlikely(!globals))
goto ignore;
24001 result = PyDict_SetItemString(globals,
"_cython_coroutine_type",
24002 #ifdef __Pyx_Coroutine_USED
24003 (PyObject*)__pyx_CoroutineType);
24007 if (unlikely(result < 0))
goto ignore;
24008 result = PyDict_SetItemString(globals,
"_cython_generator_type",
24009 #ifdef __Pyx_Generator_USED
24010 (PyObject*)__pyx_GeneratorType);
24014 if (unlikely(result < 0))
goto ignore;
24015 if (unlikely(PyDict_SetItemString(globals,
"_module", module) < 0))
goto ignore;
24016 if (unlikely(PyDict_SetItemString(globals,
"__builtins__", __pyx_b) < 0))
goto ignore;
24017 result_obj = PyRun_String(py_code, Py_file_input, globals, globals);
24018 if (unlikely(!result_obj))
goto ignore;
24019 Py_DECREF(result_obj);
24020 Py_DECREF(globals);
24023 Py_XDECREF(globals);
24024 PyErr_WriteUnraisable(module);
24025 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
"Cython module failed to patch module with custom type", 1) < 0)) {
24036 #ifndef CYTHON_REGISTER_ABCS
24037 #define CYTHON_REGISTER_ABCS 1
24039 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
24040 static PyObject* __Pyx_patch_abc_module(PyObject *module);
24041 static PyObject* __Pyx_patch_abc_module(PyObject *module) {
24042 module = __Pyx_Coroutine_patch_module(
24044 "if _cython_generator_type is not None:\n"
24045 " try: Generator = _module.Generator\n"
24046 " except AttributeError: pass\n"
24047 " else: Generator.register(_cython_generator_type)\n"
24048 "if _cython_coroutine_type is not None:\n"
24049 " try: Coroutine = _module.Coroutine\n"
24050 " except AttributeError: pass\n"
24051 " else: Coroutine.register(_cython_coroutine_type)\n"
24056 static int __Pyx_patch_abc(
void) {
24057 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
24058 static int abc_patched = 0;
24059 if (CYTHON_REGISTER_ABCS && !abc_patched) {
24061 module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ?
"collections.abc" :
"collections");
24063 PyErr_WriteUnraisable(NULL);
24064 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
24065 ((PY_MAJOR_VERSION >= 3) ?
24066 "Cython module failed to register with collections.abc module" :
24067 "Cython module failed to register with collections module"), 1) < 0)) {
24071 module = __Pyx_patch_abc_module(module);
24073 if (unlikely(!module))
24077 module = PyImport_ImportModule(
"backports_abc");
24079 module = __Pyx_patch_abc_module(module);
24080 Py_XDECREF(module);
24087 if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL);
24093 static PyMethodDef __pyx_Generator_methods[] = {
24094 {
"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
24095 (
char*) PyDoc_STR(
"send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
24096 {
"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
24097 (
char*) PyDoc_STR(
"throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
24098 {
"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS,
24099 (
char*) PyDoc_STR(
"close() -> raise GeneratorExit inside generator.")},
24102 static PyMemberDef __pyx_Generator_memberlist[] = {
24103 {(
char *)
"gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL},
24104 {(
char*)
"gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
24105 (
char*) PyDoc_STR(
"object being iterated by 'yield from', or None")},
24106 {(
char*)
"gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
24109 static PyGetSetDef __pyx_Generator_getsets[] = {
24110 {(
char *)
"__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
24111 (
char*) PyDoc_STR(
"name of the generator"), 0},
24112 {(
char *)
"__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
24113 (
char*) PyDoc_STR(
"qualified name of the generator"), 0},
24116 static PyTypeObject __pyx_GeneratorType_type = {
24117 PyVarObject_HEAD_INIT(0, 0)
24119 sizeof(__pyx_CoroutineObject),
24121 (destructor) __Pyx_Coroutine_dealloc,
24136 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
24138 (traverseproc) __Pyx_Coroutine_traverse,
24141 offsetof(__pyx_CoroutineObject, gi_weakreflist),
24143 (iternextfunc) __Pyx_Generator_Next,
24144 __pyx_Generator_methods,
24145 __pyx_Generator_memberlist,
24146 __pyx_Generator_getsets,
24162 #
if CYTHON_USE_TP_FINALIZE
24165 __Pyx_Coroutine_del,
24168 #
if CYTHON_USE_TP_FINALIZE
24169 __Pyx_Coroutine_del,
24170 #elif PY_VERSION_HEX >= 0x030400a1
24173 #
if PY_VERSION_HEX >= 0x030800b1
24177 static int __pyx_Generator_init(
void) {
24178 __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
24179 __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
24180 __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
24181 if (unlikely(!__pyx_GeneratorType)) {
24188 static int __Pyx_check_binary_version(
void) {
24189 char ctversion[4], rtversion[4];
24190 PyOS_snprintf(ctversion, 4,
"%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
24191 PyOS_snprintf(rtversion, 4,
"%s", Py_GetVersion());
24192 if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
24194 PyOS_snprintf(message,
sizeof(message),
24195 "compiletime version %s of module '%.100s' "
24196 "does not match runtime version %s",
24197 ctversion, __Pyx_MODULE_NAME, rtversion);
24198 return PyErr_WarnEx(NULL, message, 1);
24204 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
24206 #if PY_MAJOR_VERSION < 3
24207 if (t->is_unicode) {
24208 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
24209 }
else if (t->intern) {
24210 *t->p = PyString_InternFromString(t->s);
24212 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
24215 if (t->is_unicode | t->is_str) {
24217 *t->p = PyUnicode_InternFromString(t->s);
24218 }
else if (t->encoding) {
24219 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
24221 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
24224 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
24229 if (PyObject_Hash(*t->p) == -1)
24236 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
24237 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
24239 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
24241 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
24243 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
24244 #if !CYTHON_PEP393_ENABLED
24245 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
24247 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
24248 if (!defenc)
return NULL;
24249 defenc_c = PyBytes_AS_STRING(defenc);
24250 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
24252 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
24254 for (c = defenc_c; c < end; c++) {
24255 if ((
unsigned char) (*c) >= 128) {
24256 PyUnicode_AsASCIIString(o);
24262 *length = PyBytes_GET_SIZE(defenc);
24266 static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
24267 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
24268 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
24269 if (likely(PyUnicode_IS_ASCII(o))) {
24270 *length = PyUnicode_GET_LENGTH(o);
24271 return PyUnicode_AsUTF8(o);
24273 PyUnicode_AsASCIIString(o);
24277 return PyUnicode_AsUTF8AndSize(o, length);
24282 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
24283 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
24285 #
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
24286 __Pyx_sys_getdefaultencoding_not_ascii &&
24288 PyUnicode_Check(o)) {
24289 return __Pyx_PyUnicode_AsStringAndSize(o, length);
24292 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
24293 if (PyByteArray_Check(o)) {
24294 *length = PyByteArray_GET_SIZE(o);
24295 return PyByteArray_AS_STRING(o);
24300 int r = PyBytes_AsStringAndSize(o, &result, length);
24301 if (unlikely(r < 0)) {
24308 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
24309 int is_true = x == Py_True;
24310 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
24311 else return PyObject_IsTrue(x);
24313 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
24315 if (unlikely(!x))
return -1;
24316 retval = __Pyx_PyObject_IsTrue(x);
24320 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result,
const char* type_name) {
24321 #if PY_MAJOR_VERSION >= 3
24322 if (PyLong_Check(result)) {
24323 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
24324 "__int__ returned non-int (type %.200s). "
24325 "The ability to return an instance of a strict subclass of int "
24326 "is deprecated, and may be removed in a future version of Python.",
24327 Py_TYPE(result)->tp_name)) {
24334 PyErr_Format(PyExc_TypeError,
24335 "__%.4s__ returned non-%.4s (type %.200s)",
24336 type_name, type_name, Py_TYPE(result)->tp_name);
24340 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
24341 #if CYTHON_USE_TYPE_SLOTS
24342 PyNumberMethods *m;
24344 const char *name = NULL;
24345 PyObject *res = NULL;
24346 #if PY_MAJOR_VERSION < 3
24347 if (likely(PyInt_Check(x) || PyLong_Check(x)))
24349 if (likely(PyLong_Check(x)))
24351 return __Pyx_NewRef(x);
24352 #if CYTHON_USE_TYPE_SLOTS
24353 m = Py_TYPE(x)->tp_as_number;
24354 #if PY_MAJOR_VERSION < 3
24355 if (m && m->nb_int) {
24357 res = m->nb_int(x);
24359 else if (m && m->nb_long) {
24361 res = m->nb_long(x);
24364 if (likely(m && m->nb_int)) {
24366 res = m->nb_int(x);
24370 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
24371 res = PyNumber_Int(x);
24375 #if PY_MAJOR_VERSION < 3
24376 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
24378 if (unlikely(!PyLong_CheckExact(res))) {
24380 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
24383 else if (!PyErr_Occurred()) {
24384 PyErr_SetString(PyExc_TypeError,
24385 "an integer is required");
24389 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
24392 #if PY_MAJOR_VERSION < 3
24393 if (likely(PyInt_CheckExact(b))) {
24394 if (
sizeof(Py_ssize_t) >=
sizeof(
long))
24395 return PyInt_AS_LONG(b);
24397 return PyInt_AsSsize_t(b);
24400 if (likely(PyLong_CheckExact(b))) {
24401 #if CYTHON_USE_PYLONG_INTERNALS
24402 const digit* digits = ((PyLongObject*)b)->ob_digit;
24403 const Py_ssize_t size = Py_SIZE(b);
24404 if (likely(__Pyx_sst_abs(size) <= 1)) {
24405 ival = likely(size) ? digits[0] : 0;
24406 if (size == -1) ival = -ival;
24411 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
24412 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
24416 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
24417 return -(Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
24421 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
24422 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
24426 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
24427 return -(Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
24431 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
24432 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]));
24436 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
24437 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]));
24443 return PyLong_AsSsize_t(b);
24445 x = PyNumber_Index(b);
24447 ival = PyInt_AsSsize_t(x);
24451 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
24452 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
24454 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
24455 return PyInt_FromSize_t(ival);